# Path: studio/util/util.py
# def rand_string(length):
#     return "".join([random.choice(string.ascii_letters + string.digits)
#                     for n in range(length)])
# 
# def check_for_kb_interrupt():
#     current_exc = sys.exc_info()[1]
#     if current_exc is None:
#         return
#     if isinstance(current_exc, KeyboardInterrupt):
#         raise current_exc
#     return
# 
# Path: studio/pyrebase.py
#     RSA = None
# NUM_RETRIES = 3
# POOL_SIZE = 100
# def initialize_app(config):
#     def __init__(self, config):
#     def auth(self):
#     def database(self):
#     def storage(self):
#     def __init__(self, api_key, requests, credentials):
#     def sign_in_with_email_and_password(self, email, password):
#     def create_custom_token(self, uid, additional_claims=None):
#     def sign_in_with_custom_token(self, token):
#     def refresh(self, refresh_token):
#     def get_account_info(self, id_token):
#     def send_email_verification(self, id_token):
#     def send_password_reset_email(self, email):
#     def verify_password_reset_code(self, reset_code, new_password):
#     def create_user_with_email_and_password(self, email, password):
#     def __init__(self, credentials, api_key, database_url, requests):
#     def order_by_key(self):
#     def order_by_value(self):
#     def order_by_child(self, order):
#     def start_at(self, start):
#     def end_at(self, end):
#     def equal_to(self, equal):
#     def limit_to_first(self, limit_first):
#     def limit_to_last(self, limit_last):
#     def shallow(self):
#     def child(self, *args):
#     def build_request_url(self, token, shallow=False):
#     def build_headers(self, token=None):
#     def get(self, token=None, json_kwargs={}, shallow=False):
#     def push(self, data, token=None, json_kwargs={}):
#     def set(self, data, token=None, json_kwargs={}):
#     def update(self, data, token=None, json_kwargs={}):
#     def remove(self, token=None):
#     def stream(self, stream_handler, token=None, stream_id=None):
#     def check_token(self, database_url, path, token):
#     def generate_key(self):
#     def sort(self, origin, by_key):
#     def __init__(self, credentials, storage_bucket, requests):
#     def child(self, *args):
#     def put(self, file, token=None, userid='guest'):
#     def _put_file(self, path, file_object, token, userid):
#         def post_file(**kwargs):
#             def _post_file():
#                 def patch_owner():
#     def delete(self, name):
#     def download(self, filename, token=None):
#             def _download_internal():
#     def get_url(self, token):
#     def list_files(self):
#     def __init__(self, statuscode, message):
# def raise_detailed_error(request_object):
# def convert_to_pyre(items):
# def convert_list_to_pyre(items):
#     def __init__(self, pyres, query_key):
#     def val(self):
#     def key(self):
#     def each(self):
#     def __init__(self, item):
#     def val(self):
#     def key(self):
#     def rebuild_auth(self, prepared_request, response):
#     def __init__(self, *args, **kwargs):
#     def _connect(self):
#     def close(self):
#     def __init__(self, url, stream_handler, build_headers, stream_id):
#     def make_session(self):
#     def start(self):
#     def start_stream(self):
#     def close(self):
# class Firebase:
# class Auth:
# class Database:
# class Storage:
# class HTTPServerError(Exception):
# class PyreResponse:
# class Pyre:
# class KeepAuthSession(Session):
# class ClosableSSEClient(SSEClient):
# class Stream:
# 
# Path: studio/util/logs.py
# DEBUG = logging.DEBUG
# INFO = logging.INFO
# ERROR = logging.ERROR
# def get_logger(name):
# def debug(line):
# def error(line):
# def info(line):


import os
import getpass
import time
import json
import shutil
import atexit
import tempfile
import requests
import re
import uuid
import google.auth.transport.requests
import google.oauth2.id_token
from builtins import input
    from apscheduler.schedulers.background import BackgroundScheduler
from studio.util.util import rand_string, check_for_kb_interrupt
from studio import pyrebase
from studio.util import logs

            if response.status_code == 201:
                self.token = response.json()['token']
                self._save_token()
                print('Successfully created token with name: ' +
                      response.json()['app']['name'])
                return

            else:
                print("GitHub login failure")
                print(response.json())

    @staticmethod
    def verify_token(token, refresh_token=None):
        response = requests.get(
            'https://api.github.com/user',
            headers={"Authorization": "Bearer " + token}
        )

        if response.status_code != 200:
            return None
        else:
            return response.json()['login']


class FirebaseAuth(object):
    def __init__(
            self,
            config,
            blocking=True,

# Path: studio/util/util.py
# def rand_string(length):
#     return "".join([random.choice(string.ascii_letters + string.digits)
#                     for n in range(length)])
# 
# def check_for_kb_interrupt():
#     current_exc = sys.exc_info()[1]
#     if current_exc is None:
#         return
#     if isinstance(current_exc, KeyboardInterrupt):
#         raise current_exc
#     return
# 
# Path: studio/pyrebase.py
#     RSA = None
# NUM_RETRIES = 3
# POOL_SIZE = 100
# def initialize_app(config):
#     def __init__(self, config):
#     def auth(self):
#     def database(self):
#     def storage(self):
#     def __init__(self, api_key, requests, credentials):
#     def sign_in_with_email_and_password(self, email, password):
#     def create_custom_token(self, uid, additional_claims=None):
#     def sign_in_with_custom_token(self, token):
#     def refresh(self, refresh_token):
#     def get_account_info(self, id_token):
#     def send_email_verification(self, id_token):
#     def send_password_reset_email(self, email):
#     def verify_password_reset_code(self, reset_code, new_password):
#     def create_user_with_email_and_password(self, email, password):
#     def __init__(self, credentials, api_key, database_url, requests):
#     def order_by_key(self):
#     def order_by_value(self):
#     def order_by_child(self, order):
#     def start_at(self, start):
#     def end_at(self, end):
#     def equal_to(self, equal):
#     def limit_to_first(self, limit_first):
#     def limit_to_last(self, limit_last):
#     def shallow(self):
#     def child(self, *args):
#     def build_request_url(self, token, shallow=False):
#     def build_headers(self, token=None):
#     def get(self, token=None, json_kwargs={}, shallow=False):
#     def push(self, data, token=None, json_kwargs={}):
#     def set(self, data, token=None, json_kwargs={}):
#     def update(self, data, token=None, json_kwargs={}):
#     def remove(self, token=None):
#     def stream(self, stream_handler, token=None, stream_id=None):
#     def check_token(self, database_url, path, token):
#     def generate_key(self):
#     def sort(self, origin, by_key):
#     def __init__(self, credentials, storage_bucket, requests):
#     def child(self, *args):
#     def put(self, file, token=None, userid='guest'):
#     def _put_file(self, path, file_object, token, userid):
#         def post_file(**kwargs):
#             def _post_file():
#                 def patch_owner():
#     def delete(self, name):
#     def download(self, filename, token=None):
#             def _download_internal():
#     def get_url(self, token):
#     def list_files(self):
#     def __init__(self, statuscode, message):
# def raise_detailed_error(request_object):
# def convert_to_pyre(items):
# def convert_list_to_pyre(items):
#     def __init__(self, pyres, query_key):
#     def val(self):
#     def key(self):
#     def each(self):
#     def __init__(self, item):
#     def val(self):
#     def key(self):
#     def rebuild_auth(self, prepared_request, response):
#     def __init__(self, *args, **kwargs):
#     def _connect(self):
#     def close(self):
#     def __init__(self, url, stream_handler, build_headers, stream_id):
#     def make_session(self):
#     def start(self):
#     def start_stream(self):
#     def close(self):
# class Firebase:
# class Auth:
# class Database:
# class Storage:
# class HTTPServerError(Exception):
# class PyreResponse:
# class Pyre:
# class KeepAuthSession(Session):
# class ClosableSSEClient(SSEClient):
# class Stream:
# 
# Path: studio/util/logs.py
# DEBUG = logging.DEBUG
# INFO = logging.INFO
# ERROR = logging.ERROR
# def get_logger(name):
# def debug(line):
# def error(line):
# def info(line):


# Path: studio/auth.py
import os
import getpass
import time
import json
import shutil
import atexit
import tempfile
import requests
import re
import uuid
import google.auth.transport.requests
import google.oauth2.id_token
from builtins import input
    from apscheduler.schedulers.background import BackgroundScheduler
from studio.util.util import rand_string, check_for_kb_interrupt
from studio import pyrebase
from studio.util import logs


            if response.status_code == 201:
                self.token = response.json()['token']
                self._save_token()
                print('Successfully created token with name: ' +
                      response.json()['app']['name'])
                return

            else:
                print("GitHub login failure")
                print(response.json())

    @staticmethod
    def verify_token(token, refresh_token=None):
        response = requests.get(
            'https://api.github.com/user',
            headers={"Authorization": "Bearer " + token}
        )

        if response.status_code != 200:
            return None
        else:
            return response.json()['login']


class FirebaseAuth(object):
    def __init__(
            self,
            config,
            blocking=True,

            verbose=logs.DEBUG):