def METHOD_NAME(tag, data):
    """
    Fixing Tag object.
    Args:
        tag (obj): Tag object
        data (dict): parameters of tag
    """
    # set icon if any available in input data
    if data.get("icon"):
        tag.setIcon(str(data["icon"]))
    # get metadata of tag
    mtd = tag.metadata()
    # get metadata key from data
    data_mtd = data.get("metadata", {})
    # set all data metadata to tag metadata
    for _k, _v in data_mtd.items():
        value = str(_v)
        if type(_v) == dict:
            value = json.dumps(_v)
        # set the value
        mtd.setValue(
            "tag.{}".format(str(_k)),
            value
        )
    # set note description of tag
    tag.setNote(str(data["note"]))
    return tag