def _namifyString(string):
    # Many branches case has a return, encodes the naming policy of strings
    # constants, with often complex decisions to make, pylint: disable=R0911

    if string in ("", b""):
        return "empty"
    elif string == ' ':
        return "space"
    elif string == '.':
        return "dot"
    elif string == '\n':
        return "newline"
    elif type(string) is str and \
         _re_str_needs_no_digest.match(string) and \
         '\n' not in string:
        # Some strings can be left intact for source code readability.
        return "plain_" + string
    elif len(string) == 1:
        return "chr_%d" % ord(string)
    elif len(string) > 2 and string[0] == '<' and string[-1] == '>' and \
         _re_str_needs_no_digest.match(string[1:-1]) and \
         '\n' not in string:
        return "angle_" + string[1:-1]
    else:
        # Others are better digested to not cause compiler trouble
        return "digest_" + _digest(repr(string))
dataset/ETHPy150Open kayhayen/Nuitka/nuitka/codegen/Namify.py/_namifyString/original