def clock_emoji(time):
    """
    Accepts an hour (in 12 or 24 hour format) and returns the correct clock emoji.

    Args:
        time: 12 or 24 hour format time (:00 or :30)

    Returns:
        clock: corresponding clock emoji.
    """

    hour_emojis = {
        "0": "🕛",
        "1": "🕐",
        "2": "🕑",
        "3": "🕒",
        "4": "🕓",
        "5": "🕔",
        "6": "🕕",
        "7": "🕖",
        "8": "🕗",
        "9": "🕘",
        "10": "🕙",
        "11": "🕚",
    }

    half_emojis = {
        "0": "🕧",
        "1": "🕜",
        "2": "🕝",
        "3": "🕞",
        "4": "🕟",
        "5": "🕠",
        "6": "🕡",
        "7": "🕢",
        "8": "🕣",
        "9": "🕤",
        "10": "🕥",
        "11": "🕦",
    }

    # Split up the time to get the hours & minutes sections
    time_split = time.split(":")
    hour = int(time_split[0])
    minutes = time_split[1].split(" ")[0]

    # We need to adjust the hour if we use 24 hour-time.
    hour = 12 - hour if hour > 11 else hour
    clock = half_emojis[str(hour)] if int(minutes) == 30 else hour_emojis[str(hour)]
    return clock