#NEWLINE# def _GetAliasForIdentifier( identifier , alias_map ) : #NEWLINE# #INDENT# "Returns the aliased_symbol name for an identifier.\n\n  Example usage:\n    >>> alias_map = {'MyClass': 'goog.foo.MyClass'}\n    >>> _GetAliasForIdentifier('MyClass.prototype.action', alias_map)\n    'goog.foo.MyClass.prototype.action'\n\n    >>> _GetAliasForIdentifier('MyClass.prototype.action', {})\n    None\n\n  Args:\n    identifier: The identifier.\n    alias_map: A dictionary mapping a symbol to an alias.\n\n  Returns:\n    The aliased symbol name or None if not found.\n  " #NEWLINE# ns = identifier . split ( '.' , 1 ) [ 0 ] #NEWLINE# aliased_symbol = alias_map . get ( ns ) #NEWLINE# if alias_map : #NEWLINE# #INDENT# return ( aliased_symbol + identifier [ len ( ns ) : ] )