97f9d00c54118f6bd0bdb2f161a9a4b66fb0631e,estnltk/core.py,,as_unicode,#Any#Any#,19
Before Change
"""
if six.PY2:
if isinstance(s, str):
return s.decode(encoding)
else:
return unicode(s)
else: // ==> Py3
if isinstance(s, bytes):
After Change
elif isinstance(s, six.binary_type):
return s.decode(encoding)
else:
raise ValueError("Can only convert types {0} and {1}".format(six.text_type, six.binary_type))
def as_binary(s, encoding="utf-8"):
"""Convert the string to binary"""
if isinstance(s, six.text_type):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
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_unicode
Project Name: openml/openml-python
Commit Name: 8ed133ec4a5c2780c324ee171cd20ddb5368dc95
Time: 2018-10-17
Author: arlindkadra@gmail.com
File Name: openml/datasets/functions.py
Class Name:
Method Name: create_dataset
Project Name: deepgram/kur
Commit Name: c10177e717a57c5db8b0e8ab7efa07051e77c4be
Time: 2016-12-05
Author: ajsyp@syptech.net
File Name: setup.py
Class Name:
Method Name: get_version