code: def with_defaults(**default_funcs):
      """
      Decorator for providing dynamic default values for a method.
  
      Usages:
  
      @with_defaults(foo=lambda self: self.x + self.y)
      def func(self, foo):
          ...
  
      If a value is passed for `foo`, it will be used. Otherwise the function
      supplied to `with_defaults` will be called with `self` as an argument.
      """
  
      def decorator(f):
          @wraps(f)
          def method(self, *args, **kwargs):
              for name, func in iteritems(default_funcs):
                  if name not in kwargs:
                      kwargs[name] = func(self)
              return f(self, *args, **kwargs)
  
          return method
  
      return decorator
  
imports: from functools import wraps
  import numpy
  from numpy import arange, prod
  from pandas import DataFrame, Timestamp
  from six import iteritems
  from catalyst.pipeline.engine import SimplePipelineEngine
  from catalyst.pipeline import ExecutionPlan
  from catalyst.pipeline.term import AssetExists, InputDates
  from catalyst.testing import check_arrays, ExplodingObject
  from catalyst.testing.fixtures import WithAssetFinder, WithTradingSessions, CatalystTestCase
  from catalyst.utils.functional import dzip_exact
  from catalyst.utils.pandas_utils import explode
label_desc: Use image node_id 1 for calling a global function with example usage: with_defaults() and returns: decorator, method, f