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""):
    """Function for listing filenames with given prefix and suffix in the root directory.
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: mailgyc/doudizhu
Commit Name: 001177e85fe09a3a2fd4c30600a42b92902b3d43
Time: 2019-09-30
Author: gaoyc@outlook.com
File Name: doudizhu/apps/account/views.py
Class Name: SignupHandler
Method Name: post


Project Name: deepdrive/deepdrive
Commit Name: 4b46d3a17a5c50d5597fdd476dc747f946e2af98
Time: 2019-01-11
Author: cquiter@gmail.com
File Name: agents/dagger/train/train_mobilenet_v2.py
Class Name:
Method Name: train_mobile_net