server/models/user_requests/data_classes.py
def deserialize(document):
        """
        Helper function for parsing a Firestore document to a Product object.

        Parameters:
            document (DocumentSnapshot): A snapshot of Firestore document.

        Output:
            A Product object.
        """
        data = document.to_dict()
        if data:
            return Product(
                id=document.id,
                top_k=data.get('top_k'),
                predicted_label=data.get('predicted_label'),
                prediction_probs=data.get('prediction_probs'),
                uploaded_filename=data.get('uploaded_filename'),
                prediction_runtime=data.get('prediction_runtime'),
                feature_extraction_runtime=data.get('feature_extraction_runtime'),
                get_neighbors_runtime=data.get('get_neighbors_runtime'),
                request_time=data.get('request_time')
            )

        return None

        Helper function for parsing a Firestore document to a Product object.

        Parameters:
            document (DocumentSnapshot): A snapshot of Firestore document.

        Output:
            A Product object.
        
Helper function for parsing a Firestore document to a Product object.
Helper function for parsing a Firestore document to a Product object .
def deserialize(document):
        data = document.to_dict()
        if data:
            return Product(
                id=document.id,
                top_k=data.get('top_k'),
                predicted_label=data.get('predicted_label'),
                prediction_probs=data.get('prediction_probs'),
                uploaded_filename=data.get('uploaded_filename'),
                prediction_runtime=data.get('prediction_runtime'),
                feature_extraction_runtime=data.get('feature_extraction_runtime'),
                get_neighbors_runtime=data.get('get_neighbors_runtime'),
                request_time=data.get('request_time')
            )
        return None
def deserialize ( document ) : data = document . to_dict ( ) if data : return Product ( id = document . id , top_k = data . get ( 'top_k' ) , predicted_label = data . get ( 'predicted_label' ) , prediction_probs = data . get ( 'prediction_probs' ) , uploaded_filename = data . get ( 'uploaded_filename' ) , prediction_runtime = data . get ( 'prediction_runtime' ) , feature_extraction_runtime = data . get ( 'feature_extraction_runtime' ) , get_neighbors_runtime = data . get ( 'get_neighbors_runtime' ) , request_time = data . get ( 'request_time' ) ) return None
Helper function for parsing a Firestore document to a Product object.
Helper function for parsing a Firestore document to a Product object .
"""
        Helper function for parsing a Firestore document to a Product object.

        Parameters:
            document (DocumentSnapshot): A snapshot of Firestore document.

        Output:
            A Product object.
        """
document
A snapshot of Firestore document.
A snapshot of Firestore document .