syft.lib.python.collections package


syft.lib.python.collections.collections module

syft.lib.python.collections.ordered_dict module

class syft.lib.python.collections.ordered_dict.OrderedDict(*args, _id=<UID: 11b1f26e1efe4e839b5ede82ec908eff>, **kwds)[source]

Bases: collections.OrderedDict, syft.lib.python.PyPrimitive

property id

We reveal as a property to discourage users and developers of Syft from modifying .id attributes after an object has been initialized.


returns the unique id of the object

Return type


clear() None.  Remove all items from od.[source]
copy() a shallow copy of od[source]
classmethod FromKeys(iterable, value=None)[source]
fromkeys(iterable, value=None)[source]

Create a new ordered dictionary with keys from iterable and values set to value.

items() a set-like object providing a view on D's items[source]
keys() a set-like object providing a view on D's keys[source]
move_to_end(other, last=True)[source]

Move an existing element to the end (or beginning if last is false).

Raise KeyError if the element does not exist.

pop(key[, default]) v, remove specified key and return the corresponding value.[source]

If the key is not found, return the default if given; otherwise, raise a KeyError.


Remove and return a (key, value) pair from the dictionary.

Pairs are returned in LIFO order if last is true or FIFO order if false.

setdefault(key, default=None)[source]

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update([E, ]**F) None.  Update D from dict/iterable E and F.[source]

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values() an object providing a view on D's values[source]
static get_protobuf_schema()[source]

Return the type of protobuf object which stores a class of this type

As a part of serialization and deserialization, we need the ability to lookup the protobuf object type directly from the object type. This static method allows us to do this.

Importantly, this method is also used to create the reverse lookup ability within the metaclass of Serializable. In the metaclass, it calls this method and then it takes whatever type is returned from this method and adds an attribute to it with the type of this class attached to it. See the MetaSerializable class for details.


the type of protobuf object which corresponds to this class.

Return type



Add description to object.

  • self – object to add description to.

  • description – Description to add.



send(client, pointable=True, description='', tags=None, searchable=None)

Send obj to client and return pointer to the object.

  • self – Object to be sent.

  • client – Client to send object to.

  • pointable

  • description – Description for the object to send.

  • tags – Tags for the object to send.


Pointer to sent object.


searchable is deprecated please use pointable in the future.


Add tags to object.

  • self – object to add tags to.

  • *tags – List of tags to add.