Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _listarray(self, counts, content, recordparams):
offsets = awkward1.layout.Index32(
numpy.concatenate([[0], numpy.cumsum(counts)])
)
length = offsets[-1]
return awkward1.layout.ListOffsetArray32(
offsets,
awkward1.layout.RecordArray(
{k: _with_length(v, length) for k, v in content.items()},
parameters=recordparams,
),
def _listarray(self, offsets, content, params):
offsets = awkward1.layout.Index32(offsets)
length = offsets[-1]
if isinstance(content, dict):
content = awkward1.layout.RecordArray(
{k: _with_length(v, length) for k, v in content.items()},
parameters=params,
)
return awkward1.layout.ListOffsetArray32(offsets, content)
return awkward1.layout.ListOffsetArray32(offsets, content, parameters=params)
def globalindex():
gidx = awkward1.Array(
awkward1.layout.ListOffsetArray32(
awkward1.layout.Index32(source_offsets), index.generator(),
)
)
gidx = gidx.mask[gidx >= 0] + target_offsets[:-1]
return awkward1.fill_none(awkward1.flatten(gidx), -1)
def _listarray(self, offsets, content, params):
offsets = awkward1.layout.Index32(offsets)
length = offsets[-1]
if isinstance(content, dict):
content = awkward1.layout.RecordArray(
{k: _with_length(v, length) for k, v in content.items()},
parameters=params,
)
return awkward1.layout.ListOffsetArray32(offsets, content)
return awkward1.layout.ListOffsetArray32(offsets, content, parameters=params)