code: def to_ast(value):
      """
      Turn a value into ast expression.
  
      >>> a = 1
      >>> print(ast.dump(to_ast(a)))
      Num(n=1)
      >>> a = [1, 2, 3]
      >>> print(ast.dump(to_ast(a)))
      List(elts=[Num(n=1), Num(n=2), Num(n=3)], ctx=Load())
      """
  
      if any(value is t for t in (bool, int, float)):
          return builtin_folding(value)
      elif isinstance(value, np.generic):
          return to_ast(value.item())
      elif isinstance(value, (numbers.Number, str, bool, type(None))):
          iinfo = np.iinfo(int)
          if isinstance(value, int) and not (
              iinfo.min <= value <= iinfo.max
          ):
              from pythran.syntax import PythranSyntaxError
  
              raise PythranSyntaxError(
                  "constant folding results in big int"
              )
          return ast.Constant(value, None)
      elif isinstance(value, (list, tuple, set, dict, np.ndarray)):
          return size_container_folding(value)
      elif (
          hasattr(value, "__module__")
          and value.__module__ == "builtins"
      ):
          # TODO Can be done the same way for others modules
          return builtin_folding(value)
      # only meaningful for python3
      elif isinstance(value, (filter, map, zip)):
          return to_ast(list(value))
      elif isinstance(value, np._globals._NoValueType):
          return ast.Attribute(
              ast.Attribute(
                  ast.Name("numpy", ast.Load(), None, None),
                  "_globals",
                  ast.Load(),
              ),
              "_NoValueType",
              ast.Load(),
          )
      raise ToNotEval()
  
file_path: catboost/contrib/python/pythran/pythran/conversion.py
imports: import gast
  import numpy
  import numbers
label_desc: Use image node_id 5 for calling a global function with example usage: to_ast(value) and returns: builtin_folding, to_ast, ast, size_container_folding, builtin_folding, to_ast, ast