@staticmethod
def _find_prev_sample(sample, prev_samples):
    """Finds the previous VM Sample for a given current sample.

        :param sample: The current sample.
        :param prev_samples: The previous samples to search through.
        :return: The previous sample, if it exists.  None otherwise.
        """
    if prev_samples is None:
        return None
    for prev_sample in prev_samples:
        if prev_sample.id == sample.id and prev_sample.name == sample.name:
            return prev_sample
    return None
