parameters: (self, obj, attribute)
return_statement: return self.undefined(obj=obj, name=attribute)
docstring: Subscribe an object from sandboxed code and prefer the
          attribute.  The attribute passed *must* be a bytestring.
docstring_summary: Subscribe an object from sandboxed code and prefer the
          attribute.  The attribute passed *must* be a bytestring.
docstring_tokens: Subscribe an object from sandboxed code and prefer the attribute . The attribute passed * must * be a bytestring .
function: def getattr(self, obj, attribute):
          """Subscribe an object from sandboxed code and prefer the
          attribute.  The attribute passed *must* be a bytestring.
          """
          try:
              value = getattr(obj, attribute)
          except AttributeError:
              try:
                  return obj[attribute]
              except (TypeError, LookupError):
                  pass
          else:
              if self.is_safe_attribute(obj, attribute, value):
                  return value
              return self.unsafe_undefined(obj, attribute)
          return self.undefined(obj=obj, name=attribute)
function_tokens: def getattr ( self , obj , attribute ) : try : value = getattr ( obj , attribute ) except AttributeError : try : return obj [ attribute ] except ( TypeError , LookupError ) : pass else : if self . is_safe_attribute ( obj , attribute , value ) : return value return self . unsafe_undefined ( obj , attribute ) return self . undefined ( obj = obj , name = attribute )