from datetime import datetime


def parse_hh_mm(h):
    """
    :param h: str
        Hours and minutes in the form hh:mm to parse
    :return: datetime.time
        Time parsed
    """

    h = str(h).strip()  # discard jibberish
    split_count = h.count(":")
    if split_count == 1:  # hh:mm
        return datetime.strptime(str(h).strip(), "%H:%M").time()
    else:  # mm
        return datetime.strptime(str(h).strip(), "%M").time()