# Path: artman/tasks/task_base.py
# class TaskBase(Task):
# class EmptyTask(TaskBase):
#     def __init__(self, *args, **kwargs):
#     def log(self, msg, logger=artman_logger, level=logging.INFO):
#     def exec_command(self, args):
#     def execute(self):
#     def validate(self):
# 
# Path: artman/utils/logger.py
# OUTPUT = 22
# SUCCESS = 25
# COLORS = {
#     'DEBUG': 'blue',
#     'INFO': 'cyan',
#     'OUTPUT': 'white',
#     'SUCCESS': 'green',
#     'WARNING': 'yellow',
#     'ERROR': 'red',
#     'CRITICAL': 'red,bold',
# }
# class Logger(logging.getLoggerClass()):
#     def __init__(self, name, level=logging.NOTSET):
#     def output(self, message, *args, **kwargs):
#     def success(self, message, *args, **kwargs):
# def setup_logging(level=logging.DEBUG):  # pragma: no cover
# def setup_logger(name, level, colors=COLORS,
#                  format_string="%(purple)s%(name)s> %(log_color)s%(message)s"):


import base64
import io
import os
import shutil
import zipfile
from six.moves import urllib
from gcloud import storage
from artman.tasks import task_base
from artman.utils.logger import logger
            # artman is running locally.
            return
        logger.info('root repo: %s' % repo_root)
        try:
            os.makedirs(repo_root)
        except OSError as e:
            raise e
        testfile = urllib.request.FancyURLopener()
        tmp_repo_file = os.path.join(repo_root, "file.zip")
        testfile.retrieve(
            "https://github.com/googleapis/googleapis/archive/master.zip",
            tmp_repo_file)
        zip_ref = zipfile.ZipFile(tmp_repo_file, 'r')
        zip_ref.extractall(repo_root)
        zip_ref.close()
        os.remove(tmp_repo_file)
        shutil.move(os.path.join(repo_root, "googleapis-master"),
                    os.path.join(repo_root, "googleapis"))
        remote_repo_dir = os.path.join(repo_root, "googleapis")
        # Write/overwrite the additonal files into the remote_repo_dir so that
        # user can include additional files which are not in the public repo.
        for f, content in files_dict.items():
            filename = os.path.join(remote_repo_dir, f)
            if not os.path.exists(os.path.dirname(filename)):
                os.makedirs(os.path.dirname(filename))
            with io.open(filename, "w+", encoding='UTF-8') as text_file:
                text_file.write(base64.b64decode(content))
        return remote_repo_dir



# Path: artman/tasks/task_base.py
# class TaskBase(Task):
# class EmptyTask(TaskBase):
#     def __init__(self, *args, **kwargs):
#     def log(self, msg, logger=artman_logger, level=logging.INFO):
#     def exec_command(self, args):
#     def execute(self):
#     def validate(self):
# 
# Path: artman/utils/logger.py
# OUTPUT = 22
# SUCCESS = 25
# COLORS = {
#     'DEBUG': 'blue',
#     'INFO': 'cyan',
#     'OUTPUT': 'white',
#     'SUCCESS': 'green',
#     'WARNING': 'yellow',
#     'ERROR': 'red',
#     'CRITICAL': 'red,bold',
# }
# class Logger(logging.getLoggerClass()):
#     def __init__(self, name, level=logging.NOTSET):
#     def output(self, message, *args, **kwargs):
#     def success(self, message, *args, **kwargs):
# def setup_logging(level=logging.DEBUG):  # pragma: no cover
# def setup_logger(name, level, colors=COLORS,
#                  format_string="%(purple)s%(name)s> %(log_color)s%(message)s"):


# Path: artman/tasks/io_tasks.py
import base64
import io
import os
import shutil
import zipfile
from six.moves import urllib
from gcloud import storage
from artman.tasks import task_base
from artman.utils.logger import logger

            # artman is running locally.
            return
        logger.info('root repo: %s' % repo_root)
        try:
            os.makedirs(repo_root)
        except OSError as e:
            raise e
        testfile = urllib.request.FancyURLopener()
        tmp_repo_file = os.path.join(repo_root, "file.zip")
        testfile.retrieve(
            "https://github.com/googleapis/googleapis/archive/master.zip",
            tmp_repo_file)
        zip_ref = zipfile.ZipFile(tmp_repo_file, 'r')
        zip_ref.extractall(repo_root)
        zip_ref.close()
        os.remove(tmp_repo_file)
        shutil.move(os.path.join(repo_root, "googleapis-master"),
                    os.path.join(repo_root, "googleapis"))
        remote_repo_dir = os.path.join(repo_root, "googleapis")
        # Write/overwrite the additonal files into the remote_repo_dir so that
        # user can include additional files which are not in the public repo.
        for f, content in files_dict.items():
            filename = os.path.join(remote_repo_dir, f)
            if not os.path.exists(os.path.dirname(filename)):
                os.makedirs(os.path.dirname(filename))
            with io.open(filename, "w+", encoding='UTF-8') as text_file:
                text_file.write(base64.b64decode(content))
        return remote_repo_dir



class PrepareOutputDirectoryTask(task_base.TaskBase):