def METHOD_NAME(tag_name, tags):
    """
    Return tags in a format that can be used as --tags argument value.
    """
    tags = sorted(list(tags))
    tags = ["'{}'".format(tag) if " " in tag else tag for tag in tags]
    if tag_name == SIMPLE:
        return " ".join(tags)
    return "{}={}".format(tag_name, ",".join(tags))