parameters: (environment, attribute)
return_statement: return attrgetter
docstring: Returns a callable that looks up the given attribute from a
      passed object with the rules of the environment.  Dots are allowed
      to access attributes of attributes.
docstring_summary: Returns a callable that looks up the given attribute from a
      passed object with the rules of the environment.  Dots are allowed
      to access attributes of attributes.
docstring_tokens: Returns a callable that looks up the given attribute from a passed object with the rules of the environment . Dots are allowed to access attributes of attributes .
function: def make_attrgetter(environment, attribute):
      """Returns a callable that looks up the given attribute from a
      passed object with the rules of the environment.  Dots are allowed
      to access attributes of attributes.
      """
      if not isinstance(attribute, basestring) or '.' not in attribute:
          return lambda x: environment.getitem(x, attribute)
      attribute = attribute.split('.')
      def attrgetter(item):
          for part in attribute:
              item = environment.getitem(item, part)
          return item
      return attrgetter
function_tokens: def make_attrgetter ( environment , attribute ) : if not isinstance ( attribute , basestring ) or '.' not in attribute : return lambda x : environment . getitem ( x , attribute ) attribute = attribute . split ( '.' ) def attrgetter ( item ) : for part in attribute : item = environment . getitem ( item , part ) return item return attrgetter