parameters: (self, obj, argument)
return_statement: return self.undefined(obj=obj, name=argument)
docstring: Subscribe an object from sandboxed code.
docstring_summary: Subscribe an object from sandboxed code.
docstring_tokens: Subscribe an object from sandboxed code .
function: def getitem(self, obj, argument):
          """Subscribe an object from sandboxed code."""
          try:
              return obj[argument]
          except (TypeError, LookupError):
              if isinstance(argument, string_types):
                  try:
                      attr = str(argument)
                  except Exception:
                      pass
                  else:
                      try:
                          value = getattr(obj, attr)
                      except AttributeError:
                          pass
                      else:
                          if self.is_safe_attribute(obj, argument, value):
                              return value
                          return self.unsafe_undefined(obj, argument)
          return self.undefined(obj=obj, name=argument)
function_tokens: def getitem ( self , obj , argument ) : try : return obj [ argument ] except ( TypeError , LookupError ) : if isinstance ( argument , string_types ) : try : attr = str ( argument ) except Exception : pass else : try : value = getattr ( obj , attr ) except AttributeError : pass else : if self . is_safe_attribute ( obj , argument , value ) : return value return self . unsafe_undefined ( obj , argument ) return self . undefined ( obj = obj , name = argument )