@lru_cache()
def is_mock_available():
 try:
  import unittest.mock
  return True
 except ImportError:
  pass
 try:
  import mock
  if (not hasattr(mock.patch, 'dict')):
   raise ImportError()
  if ('new_callable' not in inspect.getargspec(mock.patch).args):
   raise ImportError()
  return True
 except ImportError:
  return False

@ lru_cache ( ) def is_mock_available ( ) : try : import unittest . mock return True except ImportError : pass try : import mock if ( not hasattr ( mock . patch , 'dict' ) ) : raise ImportError ( ) if ( 'new_callable' not in inspect . getargspec ( mock . patch ) . args ) : raise ImportError ( ) return True except ImportError : return False
checks if the mock module is available .