<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dict_to_path(as_dict):
 """ Turn a pure dict into a dict containing entity objects that can be sent directly to a Path constructor. Parameters as_dict : dict Has keys: 'vertices', 'entities' Returns kwargs : dict Has keys: 'vertices', 'entities' """

    # start kwargs with initial value
    result = as_dict.copy()
    # map of constructors
    loaders = {'Arc': Arc, 'Line': Line}
    # pre- allocate entity array
    entities = [None] * len(as_dict['entities'])
    # run constructor for dict kwargs
    for entity_index, entity in enumerate(as_dict['entities']):
        entities[entity_index] = loaders[entity['type']](
            points=entity['points'], closed=entity['closed'])
    result['entities'] = entities

    return result