CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
utilities Namespace Reference

Functions

def cache
 

Function Documentation

def utilities.cache (   function)

Definition at line 3 of file utilities.py.

References callgraph.function, and print().

Referenced by EcalHitResponse.analogSignalAmplitude(), SiStripLAProfileBooker.analyze(), edm::RepeatingCachedRootSource.beginJob(), edm::ConcurrentGeneratorFilter< HAD, DEC >.beginStream(), edm::ConcurrentHadronizerFilter< HAD, DEC >.beginStream(), ExternalGeneratorFilter.beginStream(), edm::ConcurrentGeneratorFilter< HAD, DEC >.filter(), edm::ConcurrentHadronizerFilter< HAD, DEC >.filter(), DTCalibrationMap.getConsts(), edm::RootTree.getEntry(), cms::cuda.getEventCache(), cms::cuda.getStreamCache(), ExternalGeneratorFilter.globalBeginLuminosityBlockSummary(), RectangularEtaPhiTrackingRegion.hits(), CosmicTrackingRegion.hits_(), MLPFProducer.initializeGlobalCache(), DeepMETProducer.initializeGlobalCache(), L1NNTauProducer.initializeGlobalCache(), TrackstersMergeProducer.initializeGlobalCache(), TrackstersProducer.initializeGlobalCache(), DeepCoreSeedGenerator.initializeGlobalCache(), L1NNTauProducer.L1NNTauProducer(), trackMVAClassifierImpl::ComputeMVA< EventCache >.operator()(), ticl::PatternRecognitionbyCA< TILES >.PatternRecognitionbyCA(), ticl::PatternRecognitionbyCLUE3D< TILES >.PatternRecognitionbyCLUE3D(), ClusterShapeTrackFilterProducer.produce(), HIPixelTrackFilterProducer.produce(), SiPixelDigiToRaw.produce(), edm::PtrVectorBase.PtrVectorBase(), edm::RootEmbeddedFileSequence.readOneEvent(), edm::RepeatingCachedRootSource.RepeatingCachedRootSource(), EcalSignalGenerator< EBDigitizerTraits >.samplesInPE(), EcalSignalGenerator< EEDigitizerTraits >.samplesInPE(), ExternalGeneratorFilter.streamBeginLuminosityBlock(), edm::ConcurrentGeneratorFilter< HAD, DEC >.streamEndLuminosityBlockSummary(), edm::ConcurrentHadronizerFilter< HAD, DEC >.streamEndRun(), edm::ConcurrentGeneratorFilter< HAD, DEC >.streamEndRun(), TrackstersMergeProducer.TrackstersMergeProducer(), and edm::refcoreimpl.tryToSetCacheItemForFirstTime().

3 
4 def cache(function):
5  cache = {}
6  def newfunction(*args, **kwargs):
7  try:
8  return cache[args, tuple(sorted(kwargs.iteritems()))]
9  except TypeError:
10  print(args, tuple(sorted(kwargs.iteritems())))
11  raise
12  except KeyError:
13  cache[args, tuple(sorted(kwargs.iteritems()))] = function(*args, **kwargs)
14  return newfunction(*args, **kwargs)
15  newfunction.__name__ = function.__name__
16  return newfunction
string function
Definition: callgraph.py:50
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def cache
Definition: utilities.py:3