def is_str(string):
if sys.version_info[:<NUM_LIT:2>] >= (<NUM_LIT:3>, <NUM_LIT:0>):<EOL><INDENT>return isinstance(string, str)<EOL><DEDENT>return isinstance(string, basestring)<EOL>
Python 2 and 3 compatible string checker.

Args:
    string (str | basestring): the string to check

Returns:
    bool: True or False