def dict_from_yaml(yaml_str):
 try:
  retrieved_dict = yaml.safe_load(yaml_str)
  assert isinstance(retrieved_dict, dict)
  return retrieved_dict
 except yaml.YAMLError as e:
  raise InvalidInputException(e)

def dict_from_yaml ( yaml_str ) : try : retrieved_dict = yaml . safe_load ( yaml_str ) assert isinstance ( retrieved_dict , dict ) return retrieved_dict except yaml . YAMLError as e : raise InvalidInputException ( e )
gets the dict representation of a yaml string .