instancelib.utils.to_key module

instancelib.utils.to_key.to_key(instance_or_key)[source]

Returns the identifier of the instance if instance_or_key is an Instance or return the key if instance_or_key is a KT

Parameters:

instance_or_key (Union[KT, Instance]) – An implementation of Instance or an identifier typed variable

Returns:

The identifer of the instance (or the input verbatim)

Return type:

KT