def yaml_time_serializer(dumper, data):
    """
    This function is required to serialize datetime.time as string objects
    when working with YAML as output format.
    """
    return dumper.represent_scalar('tag:yaml.org,2002:str', str(data))