code: def dict_to_path(as_dict):
      
      # 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
docs: 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'