Item from Python primitive.
422935
def primitive(self, dictionary):
        """"""
        self.__dict__ = {k: v for k, v in dictionary.items() if v}
1011484
def from_dict(self, d):
        
        self.length = d.get("length", 0)
        self.instanceHigh = d.get("instanceHigh", 0)
        self.instanceMid = d.get("instanceMid", 0)
        self.instanceLow = d.get("instanceLow", 0)

        material = d.get("material", {'Data1':0, 'Data2':0, 'Data3':0, 'Data4': [0 for i in range(8)]})

        self.Data1 = material.get('Data1', 0)
        self.Data2 = material.get('Data2', 0)
        self.Data3 = material.get('Data3', 0)

        self.Data4 = material.get("Data4", [0 for i in range(8)])
        self.SMPTELabel = d.get("SMPTELabel", [0 for i in range(12)])
534785
def __deserialize_primitive(self, data, klass):
        
        try:
            return klass(data)
        except UnicodeEncodeError:
            return text(data)
        except TypeError:
            return data
627661
def cast_item(cls, item):
        """"""
        if not isinstance(item, cls.subtype):
            incompatible = isinstance(item, Base) and not any(
                issubclass(cls.subtype, tag_type) and isinstance(item, tag_type)
                for tag_type in cls.all_tags.values()
            )
            if incompatible:
                raise IncompatibleItemType(item, cls.subtype)

            try:
                return cls.subtype(item)
            except EndInstantiation:
                raise ValueError('List tags without an explicit subtype must '
                                 'either be empty or instantiated with '
                                 'elements from which a subtype can be '
                                 'inferred') from None
            except (IncompatibleItemType, CastError):
                raise
            except Exception as exc:
                raise CastError(item, cls.subtype) from exc
        return item
1166350
def p_items(self, p):
        ''
        p[0] = p[1] + (p[2],)
        p.set_lineno(0, p.lineno(1))
60495
def OnGetItemAttr(self, item):
        """"""
        if self.indicated > -1 and item == self.indicated:
            return self.indicated_attribute
        return None
133266
def iteritems(d, **kw):
    """"""
    if not PY2:
        return iter(d.items(**kw))
    return d.iteritems(**kw)
278172
def get_as(self, cls: Type[MaybeBytesT]) -> Sequence[MaybeBytesT]:
        """"""
        _ = cls  # noqa
        return cast(Sequence[MaybeBytesT], self.items)
1365692
def getitem(source, index):
    
    if isinstance(index, builtins.slice):
        return slice.raw(source, index.start, index.stop, index.step)
    if isinstance(index, int):
        return item.raw(source, index)
    raise TypeError("Not a valid index (int or slice)")
927527
def primitive(self, primitive):
        """"""
        self.entry = Entry()
        self.entry.primitive = primitive

        primitive = copy(primitive)
        for field in self.entry.fields:
            del primitive[field]

        self.item = Item()
        self.item.primitive = primitive
545455
def curve_primitive(self):
        """"""
        curve = self.curve
        curve.axis_start = self.helix_start
        curve.axis_end = self.helix_end
        coords = curve.get_coords(
            n_points=(self.num_monomers + 1), spacing=self.minor_rise_per_residue)
        if self.orientation == -1:
            coords.reverse()
        return Primitive.from_coordinates(coords)
575883
def _take_values(self, item: Parameterized) -> DictBasicType:
        """"""

        values = super()._take_values(item)
        values = {k: v for k, v in values.items() if not k.startswith(AutoFlow.__autoflow_prefix__)}
        return values
159410
def serialize(self, value, **kwargs):
        """"""
        return [self.item_type.serialize(val, **kwargs) for val in value]
1108014
def item(*args):
    '''
    
    '''
    ret = {}
    for arg in args:
        try:
            ret[arg] = __pillar__[arg]
        except KeyError:
            pass
    return ret
88753
def primitive_form(obj, **kwargs):
    ''''''
    if isinstance(obj, type):
        return obj
    return Type.dispatch(obj).primitive_form(**kwargs)
1236333
def return_primitive(fn):
    
    @wraps(fn)
    def wrapped_fn(x):
        if isinstance(x, PRIMITIVE_TYPES):
            return x
        return fn(x)
    return wrapped_fn
20387
def _fromiter(it, dtype, count, progress, log):
    """"""
    if progress > 0:
        it = _iter_withprogress(it, progress, log)
    if count is not None:
        a = np.fromiter(it, dtype=dtype, count=count)
    else:
        a = np.fromiter(it, dtype=dtype)
    return a