@combomethod<EOL><INDENT>def _parsePrivateKey(self, key):<DEDENT>
if isinstance(key, self._keys.PrivateKey):<EOL><INDENT>return key<EOL><DEDENT>try:<EOL><INDENT>return self._keys.PrivateKey(HexBytes(key))<EOL><DEDENT>except ValidationError as original_exception:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" % len(key)<EOL>) from original_exception<EOL><DEDENT>
Generate a :class:`eth_keys.datatypes.PrivateKey` from the provided key. If the
key is already of type :class:`eth_keys.datatypes.PrivateKey`, return the key.

:param key: the private key from which a :class:`eth_keys.datatypes.PrivateKey`
            will be generated
:type key: hex str, bytes, int or :class:`eth_keys.datatypes.PrivateKey`
:returns: the provided key represented as a :class:`eth_keys.datatypes.PrivateKey`