<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def staticfy(html_file, args=argparse.ArgumentParser()):
 """ Staticfy method. Loop through each line of the file and replaces the old links """

    # unpack arguments
    static_endpoint = args.static_endpoint or 'static'
    framework = args.framework or os.getenv('STATICFY_FRAMEWORK', 'flask')
    add_tags = args.add_tags or {}
    exc_tags = args.exc_tags or {}
    namespace = args.namespace or {}

    # default tags
    tags = {('img', 'src'), ('link', 'href'), ('script', 'src')}

    # generate additional_tags
    add_tags = {(tag, attr) for tag, attr in add_tags.items()}
    tags.update(add_tags)

    # remove tags if any was specified
    exc_tags = {(tag, attr) for tag, attr in exc_tags.items()}
    tags = tags - exc_tags

    # get elements we're interested in
    matches = get_elements(html_file, tags)

    # transform old links to new links
    transformed = transform(matches, framework, namespace, static_endpoint)

    return replace_lines(html_file, transformed)