cli/streamingphish/streamingphish/database.py
def restore_python_object(blob):
        """
        Objects like the feature vector, feature exraction object, and classifier are converted to
        a Binary object then patched by pymongo as a bytes instance. This routine restores the
        original object.

        Additional info:
            https://stackoverflow.com/questions/22077720/pymongo-bson-binary-save-and-retrieve

        Also could look into using mongoengine for operations like this.

        Args:
            blob (bytes): Representation of python object to be decoded.

        Returns:
            result (decoded bytes): Could be Index(), PhishFeatures(), LogisticRegression()
        """
        result = pickle.loads(data=blob, encoding='bytes')
        return result

        Objects like the feature vector, feature exraction object, and classifier are converted to
        a Binary object then patched by pymongo as a bytes instance. This routine restores the
        original object.

        Additional info:
            https://stackoverflow.com/questions/22077720/pymongo-bson-binary-save-and-retrieve

        Also could look into using mongoengine for operations like this.

        Args:
            blob (bytes): Representation of python object to be decoded.

        Returns:
            result (decoded bytes): Could be Index(), PhishFeatures(), LogisticRegression()
        
Objects like the feature vector, feature exraction object, and classifier are converted to
a Binary object then patched by pymongo as a bytes instance. This routine restores the
original object.



Also could look into using mongoengine for operations like this.
Objects like the feature vector feature exraction object and classifier are converted to a Binary object then patched by pymongo as a bytes instance . This routine restores the original object . Also could look into using mongoengine for operations like this .
def restore_python_object(blob):
        result = pickle.loads(data=blob, encoding='bytes')
        return result
def restore_python_object ( blob ) : result = pickle . loads ( data = blob , encoding = 'bytes' ) return result
Objects like the feature vector, feature exraction object, and classifier are converted to
a Binary object then patched by pymongo as a bytes instance.
Objects like the feature vector feature exraction object and classifier are converted to a Binary object then patched by pymongo as a bytes instance .
"""
        Objects like the feature vector, feature exraction object, and classifier are converted to
        a Binary object then patched by pymongo as a bytes instance. This routine restores the
        original object.

        Additional info:
            https://stackoverflow.com/questions/22077720/pymongo-bson-binary-save-and-retrieve

        Also could look into using mongoengine for operations like this.

        Args:
            blob (bytes): Representation of python object to be decoded.

        Returns:
            result (decoded bytes): Could be Index(), PhishFeatures(), LogisticRegression()
        """
result (decoded bytes): Could be Index(), PhishFeatures(), LogisticRegression()
result ( decoded bytes ) : Could be Index () PhishFeatures () LogisticRegression ()
blob
Representation of python object to be decoded.
Representation of python object to be decoded .