MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / _reshape

Function _reshape

opcua/ua/ua_binary.py:400–411  ·  view source on GitHub ↗
(flat, dims)

Source from the content-addressed store, hash-verified

398
399
400def _reshape(flat, dims):
401 subdims = dims[1:]
402 subsize = 1
403 for i in subdims:
404 if i == 0:
405 i = 1
406 subsize *= i
407 while dims[0] * subsize > len(flat):
408 flat.append([])
409 if not subdims or subdims == [0]:
410 return flat
411 return [_reshape(flat[i:i + subsize], subdims) for i in range(0, len(flat), subsize)]
412
413
414def extensionobject_from_binary(data):

Callers 3

test_flattenMethod · 0.90
variant_from_binaryFunction · 0.85

Calls

no outgoing calls

Tested by 2

test_flattenMethod · 0.72