peng3d/util/__init__.py
def normalizeID(self,in_id):
        """
        Takes in an object and normalizes it to its ID/integer representation.
        
        Currently, only integers and strings may be passed in, else a :py:exc:`TypeError`
        will be thrown.
        """
        if isinstance(in_id,int):
            assert in_id in self._data["reg"]
            return in_id
        elif isinstance(in_id,str):
            assert in_id in self._data["reg"].inv
            return self._data["reg"].inv[in_id]
        else:
            raise TypeError("Only int and str can be converted to IDs")
def normalizeID(self,in_id):
        """
        Takes in an object and normalizes it to its ID/integer representation.
        
        Currently, only integers and strings may be passed in, else a :py:exc:`TypeError`
        will be thrown.
        """
        if isinstance(in_id,int):
            assert in_id in self._data["reg"]
            return in_id
        elif isinstance(in_id,str):
            assert in_id in self._data["reg"].inv
            return self._data["reg"].inv[in_id]
        else:
            raise TypeError("Only int and str can be converted to IDs")
def normalizeID ( self , in_id ) : if isinstance ( in_id , int ) : assert in_id in self . _data [ "reg" ] return in_id elif isinstance ( in_id , str ) : assert in_id in self . _data [ "reg" ] . inv return self . _data [ "reg" ] . inv [ in_id ] else : raise TypeError ( "Only int and str can be converted to IDs" )
Takes in an object and normalizes it to its ID/integer representation.
        
        Currently, only integers and strings may be passed in, else a :py:exc:`TypeError`
        will be thrown.
Takes in an object and normalizes it to its ID / integer representation . Currently only integers and strings may be passed in else a : py : exc : TypeError will be thrown .