code: def requires(*args, **kwargs):
      """
      Decorator to wrap functions with extra dependencies:
  
      Arguments
      ---------
      args : list
              list of strings containing module to import
      verbose : bool
                  boolean describing whether to print a warning message on import
                  failure
      Returns
      -------
      Original function is all arg in args are importable, otherwise returns a
      function that passes.
      """
      v = kwargs.pop("verbose", True)
      wanted = copy.deepcopy(args)
  
      def inner(function):
          available = [simport(arg)[0] for arg in args]
          if all(available):
              return function
          else:
  
              def passer(*args, **kwargs):
                  if v:
                      missing = [
                          arg
                          for i, arg in enumerate(wanted)
                          if not available[i]
                      ]
                      print(
                          (
                              "missing dependencies: {d}".format(
                                  d=missing
                              )
                          )
                      )
                      print(
                          ("not running {}".format(function.__name__))
                      )
                  else:
                      pass
  
              return passer
  
      return inner
  
file_path: pysal/pysal/lib/common.py
imports: import copy
  import sys
  import time
  import numpy
  import numpy.linalg
  import scipy
  import scipy.stats
  from libpysal.cg.kdtree import KDTree
  from scipy.spatial.distance import pdist, cdist
  import pandas
label_desc: Use image node_id 2 for calling a global function with example usage: requires() and returns: inner, function, passer