Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def descend(layout, depth):
islistarray = isinstance(
layout,
(awkward1.layout.ListOffsetArray32, awkward1.layout.ListOffsetArray64,),
)
if islistarray and layout.content.parameter("collection_name") is not None:
return lambda: layout
def nestedindex():
# idx = awkward1.concatenate([idx[:, None] for idx in indexers], axis=1)
n = len(indexers)
out = numpy.empty(n * len(indexers[0]), dtype="int64")
for i, idx in enumerate(indexers):
out[i::n] = idx
offsets = numpy.arange(0, len(out) + 1, n, dtype=numpy.int64)
return awkward1.layout.ListOffsetArray64(
awkward1.layout.Index64(offsets), awkward1.layout.NumpyArray(out),
)