from typing import Callable


def set_value(
        record: dict,
        column_name: str,
        setter: Callable) -> dict:
    """
    Sets the value of a column to either a fixed value or as the result of a
    function which recieves the row as a parameter.

    This method is of limited use by itself, it is used internally by
    `set_column`.

    Paramters:
    - record: a record
    - column_name: the name of the field
    - setter: a method or constant to update the field
    """
    copy = record.copy()
    if callable(setter):
        copy[column_name] = setter(copy)
    else:
        copy[column_name] = setter
    return copy