Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get(self, name, recursive=True, filtername=nofilter, filtertitle=nofilter, aliases=True):
name = _bytesid(name)
for n, b in self.iteritems(recursive=recursive, filtername=filtername, filtertitle=filtertitle):
if n == name:
return b
raise uproot.rootio._KeyError("not found: {0}\n in file: {1}".format(repr(name), self._context.sourcepath))
def get(self, name, recursive=True, filtername=nofilter, filtertitle=nofilter, aliases=True):
name = _bytesid(name)
try:
return self._branchlookup[name]
except KeyError:
for n, b in self.iteritems(recursive=recursive, filtername=filtername, filtertitle=filtertitle, aliases=aliases):
if n == name:
self._branchlookup[name] = b
return b
raise uproot.rootio._KeyError("not found: {0}\n in file: {1}".format(repr(name), self._context.sourcepath))
def keys(self, recursive=False, filtername=nofilter, filtertitle=nofilter, aliases=True):
return list(self.iterkeys(recursive=recursive, filtername=filtername, filtertitle=filtertitle, aliases=aliases))
def iterkeys(self, recursive=False, filtername=nofilter, filtertitle=nofilter, aliases=True):
for branch in self.itervalues(recursive, filtername, filtertitle):
if aliases:
for aliasname, branchname in self.aliases.items():
if branch.name == branchname:
yield aliasname
yield branch.name
def get(self, name, recursive=True, filtername=nofilter, filtertitle=nofilter, aliases=True):
t = uproot.open(self._file._path)[self.name]
return t.get(name, recursive, filtername, filtertitle, aliases)
def iterkeys(self, recursive=False, filtername=nofilter, filtertitle=nofilter, aliases=True):
t = uproot.open(self._file._path)[self.name]
return t.iterkeys(recursive, filtername, filtertitle, aliases)
def iteritems(self, recursive=False, filtername=nofilter, filtertitle=nofilter, aliases=True):
for branch in self.itervalues(recursive, filtername, filtertitle):
if aliases:
for aliasname, branchname in self.aliases.items():
if branch.name == branchname:
yield aliasname, branch
yield branch.name, branch