import collections


def params_to_parameters_dict(*args, **kwargs):
    """
     Capture a function's parameters, return a dict that stores parameters and arguments.
     Filepath arguments will be parsed into python object, and then turned into a dict. Now we support pf files
     and yaml files.
    :param args: Non-keyworded arguments
    :param kwargs: Keyworded arguments
    :return: An OrderedDict of parameters and arguments.
    """
    parameters_dict = collections.OrderedDict()
    #   Iterate over non-keyworded args and store them in dict, each one is assigned a key "arg_1" "arg_2" ...
    i = 0
    for value in args:
        key = "arg_{index:d}".format(index=i)
        parameters_dict[key] = str(value)
        i += 1
    #   Iterate over keyworded args and store them in dict
    for key, value in kwargs.items():
        parameters_dict[key] = str(value)

    return parameters_dict