from typing import Dict
from typing import Any


def extract_field(main_args: Dict[str, Any], benchmark_conf: Dict[str, Any], field_name: str) -> Any:
    """Extracts a field from the given parameters, preferring main_args if it is supplied."""
    field = main_args.get(field_name, None)
    if field is None:
        field = benchmark_conf.get(field_name, None)
    return field