code: def get_default_override(function_or_class, **kwargs):
      """
      Looks up an option default override.
      Meant to be used inside functions that use this facility.
  
      Args:
          function: the function that calls this.
            For example::
  
              def Convolution(args, init=default_override_or(glorot_uniform()), activation=default_override_or(identity), pad=default_override_or(False)):
              init = _get_default_override(Convolution, init=init) # pass default under the same name
  
      """
      # parameter checking and casting
      if len(kwargs) != 1:
          raise TypeError(
              "get_default_override() takes 1 keyword argument but %s were given"
              % len(kwargs)
          )
      key, value = next(
          iter(kwargs.items())
      )  # this is the keyword argument that the user passed in
      if function_or_class is not None:
          # first arg, unless None, must be an actual Python function...
          from inspect import isfunction, isclass
  
          if not (
              isfunction(function_or_class)
              or isclass(function_or_class)
          ):
              raise ValueError(
                  "get_default_override() expects the first argument to be a Python function or class"
              )
          # ...that has an arg with the same name as the given parameter
          from inspect import getargspec
  
          args, _, _, _ = (
              getargspec(function_or_class)
              if isfunction(function_or_class)
              else getargspec(function_or_class.__init__)
          )
          if key not in args:
              raise TypeError(
                  "{0}() has no argument named '{1}'".format(
                      function_or_class.__name__, key
                  )
              )
      # if the value passed in is not a default, then use that value
      if not is_default_override(value):
          return value
      # traverse linked list of scopes inside-out until an override was found, else fall back to default
      opts = _OptionsContextManager._current_default_overrides
      while opts is not None:
          if (
              opts._scope is None
              or function_or_class is None
              or function_or_class in opts._scope
          ):  # we are in the right scope
              if hasattr(opts, key):
                  return opts[
                      key
                  ]  # look up the option override and return it if present in this scope
          opts = opts._outer  # step out one scope and try again
      return value.value
  
file_path: CNTK/bindings/python/cntk/default_options.py
label_desc: Use image node_id 4 for calling a global function with example usage: get_default_override(function_or_class) and returns: value, value, opts