# Path: expyriment/_internals.py
# def get_version():
# def pump_pygame_events():
#     def __init__(self):
#     def set_logging(self, onoff):
#     def logging(self):
#     def __init__(self, data=None):
#     def __str__(self):
# def run_py_file_command(path):
# def get_settings_folder():
# def get_plugins_folder():
# def import_plugins_code(package):
# def post_import_hook():
# def import_all_extras():
# class Expyriment_object(object):
# class CallbackQuitEvent(object):


import os
import sys
import glob
import random
import colorsys
import math
import pygame
    import time
    import threading
        import socket
from .._internals import android, get_settings_folder, get_version
    from locale import getdefaultlocale
    from ..misc import constants
    from .. import _internals
    from urllib.request import urlopen, Request
    from tempfile import TemporaryFile
    from zipfile import ZipFile
    from shutil import copyfileobj
    except Exception:
        raise RuntimeError("Download of {0} failed!".format(url))

    with TemporaryFile() as f:
        meta = u.info()
        try:
            file_size = int(u.getheader('Content-Length'))
            file_size_dl = 0
            block_sz = 8192
            while True:
                buffer = u.read(block_sz)
                if not buffer:
                    break
                file_size_dl += len(buffer)
                f.write(buffer)
                show_progress(file_size_dl, file_size,
                              "downloading stash ({0})".format(branch))
            sys.stdout.write("\n")
        except Exception:
            show_progress(0, 100,
                          "downloading stash ({0})".format(branch))
            chunk = u.read()
            while chunk:
                f.write(chunk)
                chunk = u.read()
            show_progress(100, 100,
                          "downloading stash ({0})".format(branch))

        if get_settings_folder() is None:
            os.makedirs(os.path.join(os.path.expanduser("~"), ".expyriment"))

# Path: expyriment/_internals.py
# def get_version():
# def pump_pygame_events():
#     def __init__(self):
#     def set_logging(self, onoff):
#     def logging(self):
#     def __init__(self, data=None):
#     def __str__(self):
# def run_py_file_command(path):
# def get_settings_folder():
# def get_plugins_folder():
# def import_plugins_code(package):
# def post_import_hook():
# def import_all_extras():
# class Expyriment_object(object):
# class CallbackQuitEvent(object):


# Path: expyriment/misc/_miscellaneous.py
import os
import sys
import glob
import random
import colorsys
import math
import pygame
    import time
    import threading
        import socket
from .._internals import android, get_settings_folder, get_version
    from locale import getdefaultlocale
    from ..misc import constants
    from .. import _internals
    from urllib.request import urlopen, Request
    from tempfile import TemporaryFile
    from zipfile import ZipFile
    from shutil import copyfileobj

    except Exception:
        raise RuntimeError("Download of {0} failed!".format(url))

    with TemporaryFile() as f:
        meta = u.info()
        try:
            file_size = int(u.getheader('Content-Length'))
            file_size_dl = 0
            block_sz = 8192
            while True:
                buffer = u.read(block_sz)
                if not buffer:
                    break
                file_size_dl += len(buffer)
                f.write(buffer)
                show_progress(file_size_dl, file_size,
                              "downloading stash ({0})".format(branch))
            sys.stdout.write("\n")
        except Exception:
            show_progress(0, 100,
                          "downloading stash ({0})".format(branch))
            chunk = u.read()
            while chunk:
                f.write(chunk)
                chunk = u.read()
            show_progress(100, 100,
                          "downloading stash ({0})".format(branch))

        if get_settings_folder() is None:
            os.makedirs(os.path.join(os.path.expanduser("~"), ".expyriment"))

        path = get_settings_folder()