code: def extract_callback_args(args, kwargs, name, type_):
      """Extract arguments for callback from a name and type"""
      parameters = kwargs.get(name, [])
      if parameters:
          if not isinstance(parameters, (list, tuple)):
              # accept a single item, not wrapped in a list, for any of the
              # categories as a named arg (even though previously only output
              # could be given unwrapped)
              return [parameters]
      else:
          while args and isinstance(args[0], type_):
              parameters.append(args.pop(0))
      return parameters
  
imports: import json
  from dash.development.base_component import Component
  from ._validate import validate_callback
  from ._grouping import flatten_grouping, make_grouping_by_index
label_desc: Use image node_id 7 for calling a global function with example usage: extract_callback_args(args, kwargs, name, type_) and returns: parameters, list