pyJoules/handler/mongo_handler.py
def sample_to_dict(sample: EnergySample) -> Dict:
    """
    convert a sample to a dictionary that could be inserted in a mongodb database
    """
    return {
        'timestamp': sample.timestamp,
        'tag': sample.tag,
        'duration': sample.duration,
        'energy': sample.energy,
    }

    convert a sample to a dictionary that could be inserted in a mongodb database
    
convert a sample to a dictionary that could be inserted in a mongodb database
convert a sample to a dictionary that could be inserted in a mongodb database
def sample_to_dict(sample: EnergySample) -> Dict:
    return {
        'timestamp': sample.timestamp,
        'tag': sample.tag,
        'duration': sample.duration,
        'energy': sample.energy,
    }
def sample_to_dict ( sample : EnergySample ) -> Dict : return { 'timestamp' : sample . timestamp , 'tag' : sample . tag , 'duration' : sample . duration , 'energy' : sample . energy , }
convert a sample to a dictionary that could be inserted in a mongodb database
convert a sample to a dictionary that could be inserted in a mongodb database
"""
    convert a sample to a dictionary that could be inserted in a mongodb database
    """
sample
EnergySample