def codecName(encoding):
 if ((encoding is not None) and (type(encoding) in types.StringTypes)):
  canonicalName = ascii_punctuation_re.sub('', encoding).lower()
  return encodings.get(canonicalName, None)
 else:
  return None

def codecName ( encoding ) : if ( ( encoding is not None ) and ( type ( encoding ) in types . StringTypes ) ) : canonicalName = ascii_punctuation_re . sub ( '' , encoding ) . lower ( ) return encodings . get ( canonicalName , None ) else : return None
return the python codec name corresponding to an encoding or none if the string doesnt correspond to a valid encoding .