code: def get_call_signature_details(module, position):
      leaf = module.get_leaf_for_position(
          position, include_prefixes=True
      )
      if leaf.start_pos >= position:
          # Whitespace / comments after the leaf count towards the previous leaf.
          leaf = leaf.get_previous_leaf()
          if leaf is None:
              return None
  
      if leaf == ")":
          if leaf.end_pos == position:
              leaf = leaf.get_next_leaf()
  
      # Now that we know where we are in the syntax tree, we start to look at
      # parents for possible function definitions.
      node = leaf.parent
      while node is not None:
          if node.type in ("funcdef", "classdef"):
              # Don't show call signatures if there's stuff before it that just
              # makes it feel strange to have a call signature.
              return None
  
          for n in node.children[::-1]:
              if n.start_pos < position and n.type == "error_node":
                  result = _get_call_signature_details_from_error_node(
                      n, position
                  )
                  if result is not None:
                      return result
  
          if node.type == "trailer" and node.children[0] == "(":
              leaf = node.get_previous_leaf()
              if leaf is None:
                  return None
              return CallSignatureDetails(
                  node.children[0],
                  *_get_index_and_key(node.children, position),
              )
  
          node = node.parent
  
      return None
  
imports: import re
  from collections import namedtuple
  from textwrap import dedent
  from parso.python.parser import Parser
  from parso.python import tree
  from jedi._compatibility import u
  from jedi.evaluate.syntax_tree import eval_atom
  from jedi.evaluate.helpers import evaluate_call_of_leaf
  from jedi.evaluate.compiled import get_string_context_set
  from jedi.cache import call_signature_time_cache
label_desc: Use image node_id 9 for calling a global function with example usage: get_call_signature_details(module, position) and returns: None, None, None, CallSignatureDetails, None, result