# Path: internetarchive/auth.py
# class S3Auth(AuthBase):
# class S3PostAuth(AuthBase):
#     def __init__(self, access_key=None, secret_key=None):
#     def __call__(self, r):
#     def __init__(self, access_key=None, secret_key=None):
#     def __call__(self, r):
# 
# Path: internetarchive/utils.py
# def deep_update(d, u):
# def validate_s3_identifier(string):
# def needs_quote(s):
# def norm_filepath(fp):
# def get_md5(file_object):
# def chunk_generator(fp, chunk_size):
# def suppress_keyboard_interrupt_message():
#     def new_hook(type, value, traceback):
#     def __init__(self, iterable, size):
#     def read(self, size=-1):  # TBD: add buffer for `len(data) > size` case
#     def __len__(self):
#     def __init__(self, id_list_or_single_id, session):
#     def __len__(self):
#     def __getitem__(self, idx):
#     def __getattr__(self, name):
#     def __repr__(self):
# def get_s3_xml_text(xml_str):
#     def _get_tag_text(tag_name, xml_obj):
# def get_file_size(file_obj):
# def iter_directory(directory):
# def recursive_file_count(files, item=None, checksum=False):
# def is_dir(obj):
# def reraise_modify(caught_exc, append_msg, prepend=False):
# def remove_none(obj):
# def delete_items_from_dict(d, to_delete):
# def is_valid_metadata_key(name):
# def merge_dictionaries(dict0, dict1, keys_to_drop=None):
# def parse_dict_cookies(value):
# class InvalidIdentifierException(Exception):
# class IterableToFileAdapter:
# class IdentifierListAsItems:


from logging import getLogger
from datetime import datetime
from requests.exceptions import HTTPError
from internetarchive import auth
from internetarchive.utils import json
import collections

    def get_tasks(self, identifier=None, params=None):
        """Get a list of all tasks meeting all criteria.
        The list is ordered by submission time.

        :type identifier: str
        :param identifier: (optional) The item identifier, if provided
                           will return tasks for only this item filtered by
                           other criteria provided in params.

        :type params: dict
        :param params: (optional) Query parameters, refer to
                       `Tasks API
                        <https://archive.org/services/docs/api/tasks.html>`_
                       for available parameters.

        :rtype: List[CatalogTask]
        """
        params = params if params else {}
        if identifier:
            params.update({'identifier': identifier})
        params.update({'limit': 0})
        if not params.get('summary'):
            params['summary'] = 0
        r = self.make_tasks_request(params)
        line = ''
        tasks = []
        for c in r.iter_content():
            c = c.decode('utf-8')
            if c == '\n':

# Path: internetarchive/auth.py
# class S3Auth(AuthBase):
# class S3PostAuth(AuthBase):
#     def __init__(self, access_key=None, secret_key=None):
#     def __call__(self, r):
#     def __init__(self, access_key=None, secret_key=None):
#     def __call__(self, r):
# 
# Path: internetarchive/utils.py
# def deep_update(d, u):
# def validate_s3_identifier(string):
# def needs_quote(s):
# def norm_filepath(fp):
# def get_md5(file_object):
# def chunk_generator(fp, chunk_size):
# def suppress_keyboard_interrupt_message():
#     def new_hook(type, value, traceback):
#     def __init__(self, iterable, size):
#     def read(self, size=-1):  # TBD: add buffer for `len(data) > size` case
#     def __len__(self):
#     def __init__(self, id_list_or_single_id, session):
#     def __len__(self):
#     def __getitem__(self, idx):
#     def __getattr__(self, name):
#     def __repr__(self):
# def get_s3_xml_text(xml_str):
#     def _get_tag_text(tag_name, xml_obj):
# def get_file_size(file_obj):
# def iter_directory(directory):
# def recursive_file_count(files, item=None, checksum=False):
# def is_dir(obj):
# def reraise_modify(caught_exc, append_msg, prepend=False):
# def remove_none(obj):
# def delete_items_from_dict(d, to_delete):
# def is_valid_metadata_key(name):
# def merge_dictionaries(dict0, dict1, keys_to_drop=None):
# def parse_dict_cookies(value):
# class InvalidIdentifierException(Exception):
# class IterableToFileAdapter:
# class IdentifierListAsItems:


# Path: internetarchive/catalog.py
from logging import getLogger
from datetime import datetime
from requests.exceptions import HTTPError
from internetarchive import auth
from internetarchive.utils import json
import collections


    def get_tasks(self, identifier=None, params=None):
        """Get a list of all tasks meeting all criteria.
        The list is ordered by submission time.

        :type identifier: str
        :param identifier: (optional) The item identifier, if provided
                           will return tasks for only this item filtered by
                           other criteria provided in params.

        :type params: dict
        :param params: (optional) Query parameters, refer to
                       `Tasks API
                        <https://archive.org/services/docs/api/tasks.html>`_
                       for available parameters.

        :rtype: List[CatalogTask]
        """
        params = params if params else {}
        if identifier:
            params.update({'identifier': identifier})
        params.update({'limit': 0})
        if not params.get('summary'):
            params['summary'] = 0
        r = self.make_tasks_request(params)
        line = ''
        tasks = []
        for c in r.iter_content():
            c = c.decode('utf-8')
            if c == '\n':

                j = json.loads(line)