Accepts dictionary of 'client' and 'api' modules and creates
    the corresponding files.
341944
def process_modules(modules):
    '''
    '''
    for mod in modules['client']:
        directory = '%s/client_modules' % HERE
        if not exists(directory):
            makedirs(directory)
        write_module_file(mod, directory, 'pyeapi')

    for mod in modules['api']:
        directory = '%s/api_modules' % HERE
        if not exists(directory):
            makedirs(directory)
        write_module_file(mod, directory, 'pyeapi.api')

    create_index(modules)
1205041
def instantiate_client(self, config):
        
        modules = config.module.split('.')
        class_name = modules.pop()
        module_path = '.'.join(modules)

        client_instance = getattr(
            __import__(module_path, {}, {}, ['']),
            class_name
        )()

        client_instance.add_config(config)

        return client_instance
30281
def create_zip(self, clean=True, increment_version=True, register=True):
        
        # First validate the attributes
        self.validate()

        # Check to see if an existing interferes with module creation
        if os.path.exists(MANIFEST_FILE_NAME):
            raise OSError("existing manifest blocks manifest file creation")

        # Write the manifest
        self.write_manifest()

        # Create the zip
        self._zip_files()

        # Increment the version of the module
        if increment_version:
            self.version += 1

        # Register the module with the LSID authority
        if register and self.lsid_authority:
            self.lsid_authority.register(self)

        # Clean up the manifest
        if clean:
            os.remove(MANIFEST_FILE_NAME)
1185846
def create(client, mosaic=False, **kw):
    '''
    '''
    if mosaic:
        return _MosaicDownloader(client, **kw)
    else:
        return _Downloader(client, **kw)
197192
def main(directories):
    ''''''
    msg = 'Checking module "{}" from directory "{}" for coding errors.'
    api_checker = ApiChecker()
    resource_checker = ResourceChecker()
    errors = []
    modules = []
    for loader, mname, _ in pkgutil.walk_packages(directories):
        sys.path.append(os.path.abspath(loader.path))
        log.info(msg.format(mname, loader.path))
        modules.append(mname)
        import_module(mname)
    for api in Api:
        if api.__module__.split('.')[-1] not in modules:
            continue
        log.debug('Anlysing Api class: {}'.format(api.__name__))
        errors.extend(api_checker(api))
    for res in Resource:
        if res.__module__.split('.')[-1] not in modules:
            continue
        log.debug('Anlysing Resource class: {}'.format(res.__name__))
        errors.extend(resource_checker(res))
    else:
        log.info('All modules tested, no problem detected.')
    return errors
1251319
def create_output_modules(self):
        
        py3_config = self.config["py3_config"]
        i3modules = self.i3status_thread.i3modules
        output_modules = self.output_modules
        # position in the bar of the modules
        positions = {}
        for index, name in enumerate(py3_config["order"]):
            if name not in positions:
                positions[name] = []
            positions[name].append(index)

        # py3status modules
        for name in self.modules:
            if name not in output_modules:
                output_modules[name] = {}
                output_modules[name]["position"] = positions.get(name, [])
                output_modules[name]["module"] = self.modules[name]
                output_modules[name]["type"] = "py3status"
                output_modules[name]["color"] = self.mappings_color.get(name)
        # i3status modules
        for name in i3modules:
            if name not in output_modules:
                output_modules[name] = {}
                output_modules[name]["position"] = positions.get(name, [])
                output_modules[name]["module"] = i3modules[name]
                output_modules[name]["type"] = "i3status"
                output_modules[name]["color"] = self.mappings_color.get(name)

        self.output_modules = output_modules
318320
function createModuleConfig(loader) {
	var tmp = require("tmp");
	var config = {};
	var virtualModules = loader.virtualModules || {};
	for(var moduleName in virtualModules) {
		var filename = tmp.fileSync().name;
		var source = virtualModules[moduleName];
		fs.writeFileSync(filename, source, "utf8");

		var paths = config.paths = config.paths || {};
		paths[moduleName] = "file:"+filename;
	}
	return config;
}
720811
def create_local_module_dir(cache_dir, module_name):
  """"""
  tf_v1.gfile.MakeDirs(cache_dir)
  return os.path.join(cache_dir, module_name)
1201561
def _register_resources(self, api_dirs, do_checks):
        ''''''
        msg = 'Looking-up for APIs in the following directories: {}'
        log.debug(msg.format(api_dirs))
        if do_checks:
            check_and_load(api_dirs)
        else:
            msg = 'Loading module "{}" from directory "{}"'
            for loader, mname, _ in pkgutil.walk_packages(api_dirs):
                sys.path.append(os.path.abspath(loader.path))
                log.debug(msg.format(mname, loader.path))
                import_module(mname)
786472
def generate_py():
    """"""
    model = {}

    vk = init()
    format_vk(vk)
    model_alias(vk, model)
    model_typedefs(vk, model)
    model_enums(vk, model)
    model_macros(vk, model)
    model_funcpointers(vk, model)
    model_exceptions(vk, model)
    model_constructors(vk, model)
    model_functions(vk, model)
    model_ext_functions(vk, model)

    env = jinja2.Environment(
        autoescape=False,
        trim_blocks=True,
        lstrip_blocks=True,
        loader=jinja2.FileSystemLoader(HERE)
    )

    out_file = path.join(HERE, path.pardir, 'vulkan', '_vulkan.py')
    with open(out_file, 'w') as out:
        out.write(env.get_template('vulkan.template.py').render(model=model))
1191387
function (options, callback) {
        options = extend({}, MODULE_LOADER_DEFAULTS, options)
        var modulesFolder = options.uri

        iterateFiles(modulesFolder, loadModule, callback, isJsFile)

        function loadModule(fileName) {
            if (options.skip && options.skip.test(fileName)) {
                return
            }
            var module = require(fileName)
            var name = path.relative(options.uri, fileName)
            options.core.add(name, module)
        }
    }
189174
def create(self, environments):
        

        data = {'environments': environments}
        return super(ApiEnvironment, self).post('api/v3/environment/', data)
635143
def load(self, client, webpy_app, course_factory, task_factory, database, user_manager, submission_manager, config):
        
        self._app = webpy_app
        self._task_factory = task_factory
        self._database = database
        self._user_manager = user_manager
        self._submission_manager = submission_manager
        self._loaded = True
        for entry in config:
            module = importlib.import_module(entry["plugin_module"])
            module.init(self, course_factory, client, entry)
869128
def create_module(project, name, sourcefolder=None):
    """"""
    if sourcefolder is None:
        sourcefolder = project.root
    packages = name.split('.')
    parent = sourcefolder
    for package in packages[:-1]:
        parent = parent.get_child(package)
    return parent.create_file(packages[-1] + '.py')
1004520
def apps_upload_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/apps/uploads.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
503929
def refresh_files(self):
        
        plugins = {}
        _plugin_files = glob.glob(os.path.join(self.dir_path, '[!_]*.pyc'))
        for f in glob.glob(os.path.join(self.dir_path, '[!_]*.py')):
            if not any(os.path.splitext(f)[0] == os.path.splitext(x)[0]
                    for x in _plugin_files):
                logging.debug('Adding plugin {0}'.format(f))
                _plugin_files.append(f)
        for f in _plugin_files:
            plugin = self._load_compiled(f)
            plugins[plugin.__name__] = plugin
            logging.debug('Loaded module object for plugin: {0}'.format(f))
        return plugins
49773
def setup(api=None):
    
    global tmp_dir_object

    tmp_dir_object = tempfile.TemporaryDirectory()

    dir_name = tmp_dir_object.name

    dir_a = os.path.join(dir_name, "a")
    os.mkdir(dir_a)
    dir_b = os.path.join(dir_name, "b")
    os.mkdir(dir_b)

    # populate directory a with text files
    file_list = [
            ["hi.txt", """Hi World!"""],
            ["hi.html", """<strong>Hi World!</strong>"""],
            ["hello.html", """
                <img src='/static/b/smile.png'</img>
                pop-up
                <script src='/static/a/hi.js'></script>"""],
            ["hi.js", """alert('Hi World')""" ]
    ]

    for f in file_list:
        with open(os.path.join(dir_a, f[0]), mode="wt") as fo:
            fo.write(f[1])

    # populate directory b with binary file
    image = b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\n\x00\x00\x00\n\x08\x02\x00\x00\x00\x02PX\xea\x00\x00\x006IDAT\x18\xd3c\xfc\xff\xff?\x03n\xc0\xc4\x80\x170100022222\xc2\x85\x90\xb9\x04t3\x92`7\xb2\x15D\xeb\xc6\xe34\xa8n4c\xe1F\x120\x1c\x00\xc6z\x12\x1c\x8cT\xf2\x1e\x00\x00\x00\x00IEND\xaeB`\x82'

    with open(os.path.join(dir_b, "smile.png"), mode="wb") as fo:
            fo.write(image)