def random_string_generator(size=6, chars=string.ascii_uppercase):
    """Generates a random string from a set of characters.

    Args:
        size (int): The length of the resultant string. Defaults to 6.
        chars (str): The characters to be used by :py:func:`random.choice`. Defaults to :py:const:`string.ascii_uppercase`.

    Returns:
        str: The randomly generated string.

    Examples:
        >>> arcresthelper.common.random_string_generator()
        'DCNYWU'
        >>> arcresthelper.common.random_string_generator(12, "arcREST")
        'cESaTTEacTES'

    """
    try:
        return ''.join(random.choice(chars) for _ in range(size))
    except:
        line, filename, synerror = trace()
        raise ArcRestHelperError({
                    "function": "random_string_generator",
                    "line": line,
                    "filename":  filename,
                    "synerror": synerror,
                                    }
                                    )
    finally:
        pass
Generates a random string from a set of characters.

    Args:
        size (int): The length of the resultant string. Defaults to 6.
        chars (str): The characters to be used by :py:func:`random.choice`. Defaults to :py:const:`string.ascii_uppercase`.

    Returns:
        str: The randomly generated string.

    Examples:
        >>> arcresthelper.common.random_string_generator()
        'DCNYWU'
        >>> arcresthelper.common.random_string_generator(12, "arcREST")
        'cESaTTEacTES'