(
    attributes: List[Dict[str, Any]],
    attr_id: str,
    value: Any
)
Updates a list of tracked entity attributes by reference

    >>> attrs = [{"attribute": "abc123", "value": "ham"}]
    >>> set_te_attr(attrs, "abc123", "spam")
    >>> set_te_attr(attrs, "def456", "spam")
    >>> attrs
    [{'attribute': 'abc123', 'value': 'spam'}, {'attribute': 'def456', 'value': 'spam'}]
Updates a list of tracked entity attributes by reference
Updates a list of tracked entity attributes by reference
def set_te_attr(
    attributes: List[Dict[str, Any]],
    attr_id: str,
    value: Any
):
    """
    Updates a list of tracked entity attributes by reference

    >>> attrs = [{"attribute": "abc123", "value": "ham"}]
    >>> set_te_attr(attrs, "abc123", "spam")
    >>> set_te_attr(attrs, "def456", "spam")
    >>> attrs
    [{'attribute': 'abc123', 'value': 'spam'}, {'attribute': 'def456', 'value': 'spam'}]

    """
    for attr in attributes:
        if attr["attribute"] == attr_id:
            attr["value"] = value
            break
    else:
        attributes.append(
            {"attribute": attr_id, "value": value}
        )
def set_te_attr ( attributes : List [ Dict [ str , Any ] ] , attr_id : str , value : Any ) : for attr in attributes : if attr [ "attribute" ] == attr_id : attr [ "value" ] = value break else : attributes . append ( { "attribute" : attr_id , "value" : value } )