def parse_time(time):
    """Given the time string, parse and turn into normalised minute count"""

    if type(time) in [int,float]:
        return time

    if time.endswith('m'):
        time = time[0:-1]

    if time.find('h') != -1:
        time = time.replace('h', ':')

    if time.find(':') != -1:
        hours, minutes = time.split(':')

        if minutes.strip() == "":
            minutes = 0

    else:
        hours = 0
        minutes = int(time.strip())

    total = int(minutes) + (int(hours) * 60)

    return total