

def _extract_document(args=None, working_name=None, email_name=None, template_name=None, template_styles=None):
    args = (args or dict())
    working_name = (working_name or args.pop(WORKING_PARAM_NAME, working_name))
    if working_name:
        working_args = _get_working_args(working_name)
    else:
        working_args = _new_working_args()
    working_args.update(args)
    working_args[LAST_ACCESS_PARAM_NAME] = time.time()
    if email_name:
        working_args.update({
            EMAIL_PARAM_NAME: email_name,
        })
    if template_name:
        working_args.update({
            TEMPLATE_PARAM_NAME: template_name,
        })
    result_args = dict(working_args)
    working_name = working_name.pop(WORKING_PARAM_NAME)
    email_name = result_args.pop(EMAIL_PARAM_NAME, None)
    template_name = result_args.pop(TEMPLATE_PARAM_NAME, None)
    styles = (template_styles or _pop_styles(result_args) or [])
    working_args.update({
        STYLES_PARAM_NAME: ','.join(styles),
    })
    return Document(working_name, email_name, template_name, styles, result_args)

dataset/ETHPy150Open KeepSafe/ks-email-parser/email_parser/gui/gui.py _extract_document/VarMisuse@144/211 `result_args`->`working_name`