def get_time_delta(time_stamp):
    difference = timezone.now() - time_stamp
    days = difference.days
    hours = difference.seconds // 3600
    minutes = (difference.seconds // 60) % 60
    if minutes > 0 and hours == 0 and days == 0:
        minutes_calculated = str(minutes) + " minutes "
    elif minutes > 0 and (hours != 0 or days != 0):
        minutes_calculated = ""
    else:
        minutes_calculated = "1 minute "
    return "{days}{hours}{minutes}".format(days=str(days) + " day(s) " if days > 0 else "",
                                           hours=str(hours) + " hour(s) " if hours > 0 and days == 0 else "",
                                           minutes=minutes_calculated) + "ago"
dataset/ETHPy150Open crowdresearch/crowdsource-platform/crowdsourcing/utils.py/get_time_delta/original