(cls, graphql_name)
Converts a GraphQL name, ``aName`` to Python: ``a_name``.

        Note that an underscore is appended if the name is a Python keyword.

        >>> BaseItem._to_python_name('aName')
        'a_name'
        >>> BaseItem._to_python_name('for')
        'for_'
        >>> BaseItem._to_python_name('__typename')
        '__typename__'
Converts a GraphQL name, ``aName`` to Python: ``a_name``.
Converts a GraphQL name aName to Python : a_name .
def _to_python_name(cls, graphql_name):
        '''Converts a GraphQL name, ``aName`` to Python: ``a_name``.

        Note that an underscore is appended if the name is a Python keyword.

        >>> BaseItem._to_python_name('aName')
        'a_name'
        >>> BaseItem._to_python_name('for')
        'for_'
        >>> BaseItem._to_python_name('__typename')
        '__typename__'
        '''
        s = []
        rgx = re.compile('([^A-Z]+|[A-Z]+[^A-Z]*)')
        for w in rgx.findall(graphql_name):
            s.append(w.lower())
        name = '_'.join(s)
        if keyword.iskeyword(name):
            return name + '_'
        try:
            return cls._renamed_to_python_fields[name]
        except KeyError:
            return name
def _to_python_name ( cls , graphql_name ) : s = [ ] rgx = re . compile ( '([^A-Z]+|[A-Z]+[^A-Z]*)' ) for w in rgx . findall ( graphql_name ) : s . append ( w . lower ( ) ) name = '_' . join ( s ) if keyword . iskeyword ( name ) : return name + '_' try : return cls . _renamed_to_python_fields [ name ] except KeyError : return name