def xform_name(name, sep='_', _xform_cache=_xform_cache, partial_renames=_partial_renames):
 if (sep in name):
  return name
 key = (name, sep)
 if (key not in _xform_cache):
  if (_special_case_transform.search(name) is not None):
   is_special = _special_case_transform.search(name)
   matched = is_special.group()
   name = ((name[:(- len(matched))] + sep) + matched.lower())
  s1 = _first_cap_regex.sub((('\\1' + sep) + '\\2'), name)
  s2 = _number_cap_regex.sub((('\\1' + sep) + '\\2'), s1)
  transformed = _end_cap_regex.sub((('\\1' + sep) + '\\2'), s2).lower()
  for (old, new) in partial_renames.items():
   if (old in transformed):
    transformed = transformed.replace(old, new)
  _xform_cache[key] = transformed
 return _xform_cache[key]

def xform_name ( name , sep = '_' , _xform_cache = _xform_cache , partial_renames = _partial_renames ) : if ( sep in name ) : return name key = ( name , sep ) if ( key not in _xform_cache ) : if ( _special_case_transform . search ( name ) is not None ) : is_special = _special_case_transform . search ( name ) matched = is_special . group ( ) name = ( ( name [ : ( - len ( matched ) ) ] + sep ) + matched . lower ( ) ) s1 = _first_cap_regex . sub ( ( ( '\\1' + sep ) + '\\2' ) , name ) s2 = _number_cap_regex . sub ( ( ( '\\1' + sep ) + '\\2' ) , s1 ) transformed = _end_cap_regex . sub ( ( ( '\\1' + sep ) + '\\2' ) , s2 ) . lower ( ) for ( old , new ) in partial_renames . items ( ) : if ( old in transformed ) : transformed = transformed . replace ( old , new ) _xform_cache [ key ] = transformed return _xform_cache [ key ]
convert camel case to a "pythonic" name .