class_docstr: A generic transpiler for Python functions.
  
  Its interface is the `transform` API, which can process Python function
  objects. Internally, it handles parsing.
  
  Users typically subclass this, customizing the `transform_ast` method. The
  output of transformed_ast is returned directly by `transform`. Existing
  methods like `transform_function` may also be overloaded.
  
  Example:
  
      class MyTransformer(GenericTranspiler):
  
        def transform_ast(self, node, ctx):
          result = <<transform node>>
          return result
  
      transformer = MyTransfomer()
  
      result = transformer.transform(f, ...)
      # result is the output
class_docstr_tok: ["A","generic","transpiler","for","Python","functions",".","Its","interface","is","the","`","transform","`","API",",","which","can","process","Python","function","objects",".","Internally",",","it","handles","parsing",".","Users","typically","subclass","this",",","customizing","the","`","transform_ast","`","method",".","The","output","of","transformed_ast","is","returned","directly","by","`","transform","`",".","Existing","methods","like","`","transform_function","`","may","also","be","overloaded",".","Example",":","class","MyTransformer","(","GenericTranspiler",")",":","def","transform_ast","(","self",",","node",",","ctx",")",":","result","=","<","<","transform","node",">",">","return","result","transformer","=","MyTransfomer","(",")","result","=","transformer.transform","(","f",",","...",")","#","result","is","the","output"]
docstr: Transforms a Python object.
  
  Users typically call this method.
  
  Args:
    obj: A Python object, function, type, etc.
    user_context: An opaque object (may be None) that is forwarded to
      transform_ast, through the ctx.user attribute.
  Returns:
    The result of calling transform_function.
  
  Raises:
    NotImplementedError: if the type of obj is not handled.
docstr_tok: ["Transforms","a","Python","object",".","Users","typically","call","this","method",".","Args",":","obj",":","A","Python","object",",","function",",","type",",","etc",".","user_context",":","An","opaque","object","(","may","be","None",")","that","is","forwarded","to","transform_ast",",","through","the","ctx.user","attribute",".","Returns",":","The","result","of","calling","transform_function",".","Raises",":","NotImplementedError",":","if","the","type","of","obj","is","not","handled","."]
code: def transform(self, obj, user_context):
      """Transforms a Python object.
  
      Users typically call this method.
  
      Args:
        obj: A Python object, function, type, etc.
        user_context: An opaque object (may be None) that is forwarded to
          transform_ast, through the ctx.user attribute.
      Returns:
        The result of calling transform_function.
  
      Raises:
        NotImplementedError: if the type of obj is not handled.
      """
      if inspect.isfunction(obj) or inspect.ismethod(obj):
          return self.transform_function(obj, user_context)
  
      raise NotImplementedError("Non-function: {}".format(type(obj)))
  
imports: import inspect
  import threading
  import types
  import gast
  from tensorflow.python.autograph.pyct import cache
  from tensorflow.python.autograph.pyct import inspect_utils
  from tensorflow.python.autograph.pyct import loader
  from tensorflow.python.autograph.pyct import naming
  from tensorflow.python.autograph.pyct import origin_info
  from tensorflow.python.autograph.pyct import parser
  from tensorflow.python.autograph.pyct import templates
  from tensorflow.python.autograph.pyct import transformer
  from tensorflow.python.autograph.utils import ag_logging
label_desc: Use image node_id 3 for calling the GenericTranspiler obj's underlying member method code with example usage: obj.transform(obj, user_context) and returns: self