from typing import Any, Dict, List def map_fields_by_dict_values(values: List[str], mapper: Dict[str, Any]) -> List[str]: """Map list of fields by a mapper or add particular value if it`s not mapped Args: values: List of fields needed to be mapped mapper: Dictionary Returns: List of mapped string values """ result = [] for i in values: v = mapper.get(i) if not v: result.append(i) continue result.append(v) return result