(name)
return 'private' + insecure
Transform name to snake case.
Transform name to snake case.
Transform name to snake case .
def _to_snake_case(name):
    """Transform name to snake case."""
    intermediate = re.sub('(.)([A-Z][a-z0-9]+)', r'\1_\2', name)
    insecure = re.sub('([a-z])([A-Z])', r'\1_\2', intermediate).lower()
    # If the class is private the name starts with "_" which is not secure
    # for creating scopes. We prefix the name with "private" in this case.
    if insecure[0] != '_':
      return insecure
    return 'private' + insecure
def _to_snake_case ( name ) : intermediate = re . sub ( '(.)([A-Z][a-z0-9]+)' , r'\1_\2' , name ) insecure = re . sub ( '([a-z])([A-Z])' , r'\1_\2' , intermediate ) . lower ( ) # If the class is private the name starts with "_" which is not secure # for creating scopes. We prefix the name with "private" in this case. if insecure [ 0 ] != '_' : return insecure return 'private' + insecure