def METHOD_NAME(fobj, assets, *fields):
    '''
    Generates a CSV file from the fields specified and will pass the keywords
    on to the asset export.
    Args:
        fobj (str): The file object of the csv file to write.
        *fields (list): A listing of fields to export.
    Returns:
        None
    Examples:
        Basic Export:
        >>> export_assets_to_csv('example.csv')
        Choosing the Fields to Export for assets:
        >>> fields = ['plugin.id', 'plugin.name', 'asset.uuid']
        >>> vulns = tio.exports.assets()
        >>> with open('example.csv', 'w') as report:
        ...     export_assets_to_csv(report, vulns, *fields)
    '''
    if not fields:
        fields = [
            'id',
            'fqdns',
            'hostnames',
            'ipv4s',
            'ipv6s',
            'mac_addresses',
            'system_types',
            'created_at',
            'last_scan_time',
            'last_seen',
            'last_authenticated_scan_date',
            'last_licensed_scan_date',
            'updated_at',
            'tags',
        ]
    # Instantiate the dictionary writer, pass it the fields that we would like
    # to have recorded to the file, and inform the writer that we want it to
    # ignore the rest of the fields that may be passed to it.
    writer = DictWriter(fobj, fields, extrasaction='ignore')
    writer.writeheader()
    counter = 0
    for asset in assets:
        counter += 1
        # We need the vulnerability dictionary flattened out and all of the
        # lists converted into a pipe-delimited string.
        flat = flatten(asset)
        for k, v in flat.items():
            if isinstance(v, list):
                flat[k] = '|'.join([str(i) for i in v])
            if k == 'tags':
                flat[k] = '|'.join(['{}:{}'.format(i['key'], i['value']) for i in v])
        # Write the vulnerability to the CSV File.
        writer.writerow(flat)
    return counter