Extracts the arguments from given frame.

    :param frame: Frame.
    :type frame: object
    :return: Arguments.
    :rtype: tuple

def extract_arguments(frame):
    """
    Extracts the arguments from given frame.

    :param frame: Frame.
    :type frame: object
    :return: Arguments.
    :rtype: tuple
    """

    arguments = ([], None, None)
    try:
        source = textwrap.dedent("".join(inspect.getsourcelines(frame)[0]).replace("\\\n", ""))
    except (IOError, TypeError) as error:
        return arguments

    try:
        node = ast.parse(source)
    except:
        return arguments

    if not node.body:
        return arguments

    node = node.body[0]
    if not isinstance(node, ast.FunctionDef):
        return arguments

    return [arg.id for arg in node.args.args], node.args.vararg, node.args.kwarg