Serialize Python data to TOML.

    :param obj: the data structure to serialize.
    :param options: options given to lower pytoml module.

def serialize(obj, **options):
    '''
    Serialize Python data to TOML.

    :param obj: the data structure to serialize.
    :param options: options given to lower pytoml module.
    '''

    try:
        if 'file_out' in options:
            return toml.dump(obj, options['file_out'], **options)
        else:
            return toml.dumps(obj, **options)
    except Exception as error:
        raise SerializationError(error)