<commit_before># -*- coding:utf-8 -*-


"""
Usage:
Each function returns the format of the following.

[
    {
        "path": "/path",
        "qs": 'a=1&b=2'
    },
    ・
    ・
    {
        "path": "/path",
        "qs": ''
    }
]

"qs" never be None.
"""

import yaml
import csv


def from_format(file, format):
    """Transform any formatted file into request list.
       Support for
       * apache
       * yaml
       * csv

    Arguments:
        (file) file: file
        (Str)  format: format
<commit_msg>(refs #16) Add headers to usage<commit_after># -*- coding:utf-8 -*-


"""
Usage:
Each function returns the format of the following.

[
    {
        "path": "/path",
        "qs": 'a=1&b=2',
        "headers": {
            "key1": "value1",
            "key2": "value2"
        }
    },
    ・
    ・
    {
        "path": "/path",
        "qs": '',
        "headers": {}
    }
]

"qs" never be None.
"""

import yaml
import csv


def from_format(file, format):
    """Transform any formatted file into request list.
       Support for
       * apache
       * yaml
       * csv

    Arguments:
        (file) file: file
        (Str)  format: format

{'fraction_non_alphanumeric': 0.1541095890410959, 'fraction_numerical': 0.010273972602739725, 'mean_word_length': 1.6269662921348316, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6479465', 'n_tokens_mistral': 403, 'n_tokens_neox': 380, 'n_words': 111}