parameters: (tupleName, files, numEventsWanted = 0)
return_statement: return chain
docstring: Given the tuple name and list of files, returns either a
          TChain or EventTree, and number of entries
docstring_summary: Given the tuple name and list of files, returns either a
          TChain or EventTree, and number of entries
docstring_tokens: Given the tuple name and list of files returns either a TChain or EventTree and number of entries
function: def prepareTuple (tupleName, files, numEventsWanted = 0):
          """Given the tuple name and list of files, returns either a
          TChain or EventTree, and number of entries"""
          if "GenObject" == tupleName:
              GenObject.prepareToLoadGenObject()            
          if not isinstance (files, list):
              # If this isn't a list, make it one
              files = [files]
              ntupleDict = GenObject._ntupleDict[tupleName]
          treeName = ntupleDict["_tree"]
          if ntupleDict.get('_useChain'):
              chain = ROOT.TChain (treeName)
              for filename in files:
                  chain.AddFile (filename)
                  numEntries = chain.GetEntries()
          # Are we using a chain or EventTree here?
          else:
              chain = Events (files, forceEvent=True)
              numEntries = chain.size()
          chainDict = GenObject._kitchenSinkDict.setdefault (chain, {})
          if numEventsWanted and numEventsWanted < numEntries:
              numEntries = numEventsWanted
          chainDict['numEntries'] = numEntries
          chainDict['tupleName' ] = tupleName
          return chain
function_tokens: def prepareTuple ( tupleName , files , numEventsWanted = 0 ) : if "GenObject" == tupleName : GenObject . prepareToLoadGenObject ( ) if not isinstance ( files , list ) : # If this isn't a list, make it one files = [ files ] ntupleDict = GenObject . _ntupleDict [ tupleName ] treeName = ntupleDict [ "_tree" ] if ntupleDict . get ( '_useChain' ) : chain = ROOT . TChain ( treeName ) for filename in files : chain . AddFile ( filename ) numEntries = chain . GetEntries ( ) # Are we using a chain or EventTree here? else : chain = Events ( files , forceEvent = True ) numEntries = chain . size ( ) chainDict = GenObject . _kitchenSinkDict . setdefault ( chain , { } ) if numEventsWanted and numEventsWanted < numEntries : numEntries = numEventsWanted chainDict [ 'numEntries' ] = numEntries chainDict [ 'tupleName' ] = tupleName return chain