code: def collections_namedtuple(evaluator, obj, arguments):
      """
      Implementation of the namedtuple function.
  
      This has to be done by processing the namedtuple class template and
      evaluating the result.
  
      """
      collections_context = obj.parent_context
      _class_template_set = collections_context.py__getattribute__(
          "_class_template"
      )
      if not _class_template_set:
          # Namedtuples are not supported on Python 2.6, early 2.7, because the
          # _class_template variable is not defined, there.
          return NO_CONTEXTS
  
      # Process arguments
      # TODO here we only use one of the types, we should use all.
      # TODO this is buggy, doesn't need to be a string
      name = list(_follow_param(evaluator, arguments, 0))[
          0
      ].get_safe_value()
      _fields = list(_follow_param(evaluator, arguments, 1))[0]
      if isinstance(_fields, compiled.CompiledObject):
          fields = _fields.get_safe_value().replace(",", " ").split()
      elif isinstance(_fields, iterable.Sequence):
          fields = [
              v.get_safe_value()
              for lazy_context in _fields.py__iter__()
              for v in lazy_context.infer()
              if is_string(v)
          ]
      else:
          return NO_CONTEXTS
  
      def get_var(name):
          (x,) = collections_context.py__getattribute__(name)
          return x.get_safe_value()
  
      base = next(iter(_class_template_set)).get_safe_value()
      base += _NAMEDTUPLE_INIT
      # Build source code
      code = base.format(
          typename=name,
          field_names=tuple(fields),
          num_fields=len(fields),
          arg_list=repr(tuple(fields))
          .replace("u'", "")
          .replace("'", "")[1:-1],
          repr_fmt=", ".join(
              get_var("_repr_template").format(name=name)
              for name in fields
          ),
          field_defs="\n".join(
              get_var("_field_template").format(index=index, name=name)
              for index, name in enumerate(fields)
          ),
      )
  
      # Parse source code
      module = evaluator.grammar.parse(code)
      generated_class = next(module.iter_classdefs())
      parent_context = ModuleContext(
          evaluator,
          module,
          None,
          code_lines=parso.split_lines(code, keepends=True),
      )
      return ContextSet(
          ClassContext(evaluator, parent_context, generated_class)
      )
  
imports: import parso
  from jedi._compatibility import force_unicode
  from jedi import debug
  from jedi.evaluate.arguments import ValuesArguments, repack_with_argument_clinic
  from jedi.evaluate import analysis
  from jedi.evaluate import compiled
  from jedi.evaluate.context.instance import AbstractInstanceContext, CompiledInstance, BoundMethod, InstanceArguments
  from jedi.evaluate.base_context import ContextualizedNode, NO_CONTEXTS, ContextSet
  from jedi.evaluate.context import ClassContext, ModuleContext, FunctionExecutionContext
  from jedi.evaluate.context import iterable
  from jedi.evaluate.lazy_context import LazyTreeContext
  from jedi.evaluate.syntax_tree import is_string
label_desc: Use image node_id 10 for calling a global function with example usage: collections_namedtuple(evaluator, obj, arguments) and returns: ContextSet, NO_CONTEXTS, x, NO_CONTEXTS