code: def start_patching(name=None):
      # type: (Optional[str]) -> None
      
      global _factory_map, _patchers, _mocks
      if _patchers and name is None:
          warnings.warn('start_patching() called again, already patched')
  
      _pre_import()
  
      if name is not None:
          factory = _factory_map[name]
          items = [(name, factory)]
      else:
          items = _factory_map.items()
  
      for name, factory in items:
          patcher = mock.patch(name, new=factory())
          mocked = patcher.start()
          _patchers[name] = patcher
          _mocks[name] = mocked
docs: Initiate mocking of the functions listed in `_factory_map`.
  
      For this to work reliably all mocked helper functions should be imported
      and used like this:
  
          import dp_paypal.client as paypal
          res = paypal.do_paypal_express_checkout(...)
  
      (i.e. don't use `from dp_paypal.client import x` import style)
  
      Kwargs:
          name (Optional[str]): if given, only patch the specified path, else all
              defined default mocks