MCPcopy Create free account
hub / github.com/BabitMF/bmf / _inputs

Method _inputs

bmf/python_sdk/module_functor.py:14–31  ·  view source on GitHub ↗
(self, *args)

Source from the content-addressed store, hash-verified

12 self.otypes = otypes
13
14 def _inputs(self, *args):
15 if len(args) != len(self.itypes):
16 raise ValueError("Expect {} args, got {}".format(
17 len(self.itypes), len(args)))
18
19 # type check
20 ipkts = []
21 for i, v in enumerate(args):
22 if v is not None:
23 if self.itypes[i] is not None and not isinstance(
24 v, self.itypes[i]):
25 raise ValueError(
26 "Expect {}th arg type is {}, got {}".format(
27 i, self.itype[i], type(v)))
28 # else empty Packet will construct from None
29 ipkts.append(sdk.Packet(v))
30
31 return ipkts
32
33 def __call__(self, *args):
34 """

Callers 2

__call__Method · 0.95
executeMethod · 0.95

Calls 2

typeFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected