97f9d00c54118f6bd0bdb2f161a9a4b66fb0631e,estnltk/core.py,,as_binary,#Any#Any#,47

Before Change


    if six.PY2 and isinstance(word, unicode):
        return s.encode(encoding)
    elif six.PY3 and isinstance(word, str):
        return s.encode(encoding) // bytes must be in utf8
    return s.decode(encoding).encode(encoding)

After Change


    """Convert the string to binary"""
    if isinstance(s, six.text_type):
        return s.encode(encoding)
    elif isinstance(s, six.binary_type):
        // make sure the binary is in required encoding
        return s.decode(encoding).encode(encoding)
    else:
        raise ValueError("Can only convert types {0} and {1}".format(six.text_type, six.binary_type))


def get_filenames(root, prefix=u"", suffix=u""):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: estnltk/estnltk
Commit Name: 97f9d00c54118f6bd0bdb2f161a9a4b66fb0631e
Time: 2014-11-12
Author: brainscauseminds@gmail.com
File Name: estnltk/core.py
Class Name:
Method Name: as_binary


Project Name: asyml/texar
Commit Name: b4fc4ccd412d6372d60de32883bdd512c17ac1ff
Time: 2018-10-10
Author: zhitinghu@gmail.com
File Name: bin/utils/make_vocab.py
Class Name:
Method Name: main


Project Name: horovod/horovod
Commit Name: c7dfdcef44d181ee2b834e3b0fb06c9c82f952b3
Time: 2019-11-20
Author: github@enrico.minack.dev
File Name: horovod/run/common/util/host_hash.py
Class Name:
Method Name: host_hash