def normalize_network_threshold(threshold):
    unit = "Bytes"
    if threshold is None:
        return []
    if isinstance(threshold, int):
        return [str(threshold), unit]
    amount = 1024
    shortcuts = {
        "B": "Bytes",
        "KB": "Kilobytes",
        "MB": "Megabytes",
        "GB": "Gigabytes",
        "TB": "Terabytes"
    }
    try:
        # if someone write just Threshold: 10
        amount = int(threshold)
        return [threshold, unit]
    except __HOLE__:
        # check if there is a space as if somebody wrote Threshold: 20 GB
        if " " in threshold:
            # okay, so split it
            amount, unit = threshold.split()
            if unit in shortcuts:
                unit = shortcuts[unit]
            allowed_units = shortcuts.values()
            if unit not in allowed_units:
                raise click.UsageError("Network threshold unit must be one of {}".format(list(allowed_units)))
        else:
            raise click.UsageError('Unknown network threshold "{}". Use something like "20 GB".'.format(threshold))
    return [amount, unit]
dataset/ETHPy150Open zalando-stups/senza/senza/components/auto_scaling_group.py/normalize_network_threshold