Create a .pyc by disassembling the file and assembling it again, printing
    a message that the reassembled file was loaded.
961583
def recompile(filename):
    """"""
    # Most of the code here based on the compile.py module.
    import os
    import imp
    import marshal
    import struct

    f = open(filename, 'U')
    try:
        timestamp = long(os.fstat(f.fileno()).st_mtime)
    except AttributeError:
        timestamp = long(os.stat(filename).st_mtime)
    codestring = f.read()
    f.close()
    if codestring and codestring[-1] != '\n':
        codestring = codestring + '\n'
    try:
        codeobject = compile(codestring, filename, 'exec')
    except SyntaxError:
        print >> sys.stderr, "Skipping %s - syntax error." % filename
        return
    cod = Code.from_code(codeobject)
    message = "reassembled %r imported.\n" % filename
    cod.code[:0] = [ # __import__('sys').stderr.write(message)
        (LOAD_GLOBAL, '__import__'),
        (LOAD_CONST, 'sys'),
        (CALL_FUNCTION, 1),
        (LOAD_ATTR, 'stderr'),
        (LOAD_ATTR, 'write'),
        (LOAD_CONST, message),
        (CALL_FUNCTION, 1),
        (POP_TOP, None),
        ]
    codeobject2 = cod.to_code()
    fc = open(filename+'c', 'wb')
    fc.write('\0\0\0\0')
    fc.write(struct.pack('<l', timestamp))
    marshal.dump(codeobject2, fc)
    fc.flush()
    fc.seek(0, 0)
    fc.write(imp.get_magic())
    fc.close()
229441
def create_append(filename: str, layers: Union[np.ndarray, Dict[str, np.ndarray], loompy.LayerManager], row_attrs: Dict[str, np.ndarray], col_attrs: Dict[str, np.ndarray], *, file_attrs: Dict[str, str] = None, fill_values: Dict[str, np.ndarray] = None) -> None:
	
	deprecated("'create_append' is deprecated. See https://github.com/linnarsson-lab/loompy/issues/42")
	if os.path.exists(filename):
		with connect(filename) as ds:
			ds.add_columns(layers, col_attrs, fill_values=fill_values)
	else:
		create(filename, layers, row_attrs, col_attrs, file_attrs=file_attrs)
1373448
def load_py(stream, filepath=None):
    
    with add_sys_paths(config.package_definition_build_python_paths):
        return _load_py(stream, filepath=filepath)
658812
def load_or_create(cls, filename=None, no_input=False, create_new=False, **kwargs):
        
        parser = argparse.ArgumentParser()
        parser.add_argument('--no_input', action='store_true')
        parser.add_argument('--create_new', action='store_true')
        args = parser.parse_args()

        if args.no_input:
            print('Parameter --no_input was given')
            no_input = True
        if args.create_new:
            print('Parameter --create_new was given')
            create_new = True
            no_input = True

        def savefile_more_recent():
            time_savefile = os.path.getmtime(filename)
            time_program = os.path.getmtime(sys.argv[0])
            return time_savefile > time_program

        def load_pickle():
            with open(filename, 'rb') as of:
                statefile_version, data = pickle.load(of)

            if statefile_version != STATEFILE_VERSION:
                raise RuntimeError(f'Wrong statefile version, please remove state file {filename}')
            return data

        def load():
            print('Loading %s' % filename)
            obj_list, config = load_pickle()
            system = System(load_state=obj_list, filename=filename, **kwargs)

            return system

        def create():
            print('Creating new system')
            config = None
            if filename:
                try:
                    obj_list, config = load_pickle()
                except FileNotFoundError:
                    config = None
            return cls(filename=filename, load_config=config, **kwargs)

        if filename and os.path.isfile(filename):
            if savefile_more_recent() and not create_new:
                return load()
            else:
                if no_input:
                    print('Program file more recent. Loading that instead.')
                    return create()
                while True:
                    answer = input('Program file more recent. Do you want to load it? (y/n) ')
                    if answer == 'y':
                        return create()
                    elif answer == 'n':
                        return load()
        else:
            return create()
99481
def WriteInit(self, out):
        """"""
        printer = self._GetPrinter(out)
        if self.__init_wildcards_file:
            printer('"""Common imports for generated %s client library."""',
                    self.__client_info.package)
            printer('# pylint:disable=wildcard-import')
        else:
            printer('"""Package marker file."""')
        printer()
        printer('import pkgutil')
        printer()
        if self.__init_wildcards_file:
            printer('from %s import *', self.__base_files_package)
            if self.__root_package == '.':
                import_prefix = ''
            else:
                import_prefix = '%s.' % self.__root_package
            printer('from %s%s import *',
                    import_prefix, self.__client_info.client_rule_name)
            printer('from %s%s import *',
                    import_prefix, self.__client_info.messages_rule_name)
            printer()
        printer('__path__ = pkgutil.extend_path(__path__, __name__)')
506298
def import_from_filename(obj, filename, silent=False):  # pragma: no cover
    """"""
    if filename in [item.filename for item in inspect.stack()]:
        raise ImportError(
            "Looks like you are loading dynaconf "
            "from inside the {} file and then it is trying "
            "to load itself entering in a circular reference "
            "problem. To solve it you have to "
            "invoke your program from another root folder "
            "or rename your program file.".format(filename)
        )

    _find_file = getattr(obj, "find_file", find_file)
    if not filename.endswith(".py"):
        filename = "{0}.py".format(filename)

    if filename in default_settings.SETTINGS_FILE_FOR_DYNACONF:
        silent = True
    mod = types.ModuleType(filename.rstrip(".py"))
    mod.__file__ = filename
    mod._is_error = False
    try:
        with io.open(
            _find_file(filename),
            encoding=default_settings.ENCODING_FOR_DYNACONF,
        ) as config_file:
            exec(compile(config_file.read(), filename, "exec"), mod.__dict__)
    except IOError as e:
        e.strerror = ("py_loader: error loading file (%s %s)\n") % (
            e.strerror,
            filename,
        )
        if silent and e.errno in (errno.ENOENT, errno.EISDIR):
            return
        raw_logger().debug(e.strerror)
        mod._is_error = True
    return mod
105714
def reload(self):
        
        new = self.__class__.pickle_load(self.workdir)
        self = new
42917
def processed_file(self, new_text, filename, old_text=None, write=False,
                       encoding=None):
        
        self.files.append(filename)
        if old_text is None:
            old_text = self._read_python_source(filename)[0]
            if old_text is None:
                return
        equal = old_text == new_text
        self.print_output(old_text, new_text, filename, equal)
        if equal:
            self.log_debug("No changes to %s", filename)
            if not self.write_unchanged_files:
                return
        if write:
            self.write_file(new_text, filename, old_text, encoding)
        else:
            self.log_debug("Not writing changes to %s", filename)
42211
def compile(source, name):
    
    cache = os.path.join(pycbc._cache_dir_path, name)
    hash_file = cache + ".hash"
    lib_file = cache + ".so"
    obj_file = cache + ".o"

    try:
        if int(open(hash_file, "r").read()) == hash(source):
            return lib_file
        raise ValueError
    except:
        pass

    src_file = cache + ".cu"
    fsrc = open(src_file, "w")
    fsrc.write(source)
    fsrc.close()

    cmd = ["nvcc", "-ccbin", "g++", "-dc", "-m64",
           "--compiler-options", "'-fPIC'",
           "-o", obj_file,
           "-c", src_file]
    print(" ".join(cmd))
    subprocess.check_call(cmd)

    cmd = ["nvcc", "-shared", "-ccbin", "g++", "-m64",
       "-o", lib_file, obj_file, "-lcufft_static", "-lculibos"]
    print(" ".join(cmd))

    subprocess.check_call(cmd)

    hash_file = cache + ".hash"
    fhash = open(hash_file, "w")
    fhash.write(str(hash(source)))
    return lib_file
105025
def build_and_run_file(filename):
    ''' 
    '''
    (directory, name, extension) = get_file_tuple(filename)
    if extension == 'c':
        print(" = = = = = = ", YELLOW, "GCC: Compiling " + filename + " file", \
              RESET, " = = = = = =\n")
        compiler = Compiler(filename)
        out = compiler.compile()
        if out != 0:
            print('Error while compiling. Code:', out, 'Please retry.')
            return out
        print("")

        out = compiler.run()
        return out

    elif extension == 'cpp':
        print(" = = = = = = ", YELLOW, "GPP: Compiling " + filename + " file", \
              RESET, " = = = = = =\n")
        compiler = Compiler(filename)
        out = compiler.compile()
        if out != 0:
            print('Error while compiling. Code:', out, 'Please retry.')
            return out
        print("")

        out = compiler.run()
        return out

    elif extension == 'py':
        print(" = = = = = = ", YELLOW, "PYTHON: Executing " + filename + " file", \
              RESET, " = = = = = =\n")
        compiler = Compiler(filename)
        out = compiler.run()
        return out
    elif extension == 'java':
        command = EXECUTABLE_JAVAC + ' ' + filename
        perform_system_command(command)
        command_run = EXECUTABLE_JAVA + ' ' + name
        test_file = directory + "/" + name + ".input"
        if os.path.exists(test_file):
            command_run += " < " + test_file
        return perform_system_command(command_run)
    else:
        print("Language yet not supported")
        return -1
771205
def create_or_open(file_name, initial_template_file_name, args):
    
    file = None
    if not os.path.isfile(
        os.path.join(
            args['django_application_folder'],
            file_name
        )
    ):
        # If file_name does not exists, create
        file = codecs.open(
            os.path.join(
                args['django_application_folder'],
                file_name
            ),
            'w+',
            encoding='UTF-8'
        )
        print("Creating {}".format(file_name))
        if initial_template_file_name:
            render_template_with_args_in_file(file, initial_template_file_name, **{})
    else:
        # If file exists, just load the file
        file = codecs.open(
            os.path.join(
                args['django_application_folder'],
                file_name
            ),
            'a+',
            encoding='UTF-8'
        )

    return file
892593
def create(self, remove_all_rc_files=False):
        
        # Check and create configuration directory
        if os.path.exists(self.config_dir):
            self.LOG.debug("Configuration directory %r already exists!" % (self.config_dir,))
        else:
            os.mkdir(self.config_dir)

        if remove_all_rc_files:
            for subdir in ('.', 'rtorrent.d'):
                config_files = list(glob.glob(os.path.join(os.path.abspath(self.config_dir), subdir, '*.rc')))
                config_files += list(glob.glob(os.path.join(os.path.abspath(self.config_dir), subdir, '*.rc.default')))
                for config_file in config_files:
                    self.LOG.info("Removing %r!" % (config_file,))
                    os.remove(config_file)

        # Create default configuration files
        for filepath in sorted(walk_resources("pyrocore", "data/config")):
            # Load from package data
            text = pymagic.resource_string("pyrocore", "data/config" + filepath)

            # Create missing subdirs
            config_file = self.config_dir + filepath
            if not os.path.exists(os.path.dirname(config_file)):
                os.makedirs(os.path.dirname(config_file))

            # Write configuration files
            config_trail = [".default"]
            if os.path.exists(config_file):
                self.LOG.debug("Configuration file %r already exists!" % (config_file,))
            else:
                config_trail.append('')
            for i in config_trail:
                with open(config_file + i, "w") as handle:
                    handle.write(text)
                self.LOG.info("Configuration file %r written!" % (config_file + i,))
1190934
def disassemble(self, offset, size):
        
        for i in DCode(
                self.CM, offset, size,
                self.get_buff()[offset:offset + size]).get_instructions():
            yield i
235507
def make(self, remake=False, dependencies=None,
             compiler="gfortran", debug=False, profile=False):
        
        self._check_lib(remake, compiler, debug, profile)
        
        from os import path
        if self.link is None or not path.isfile(self.link):
            msg.err("Can't create shared library; missing compiled original code: {}".format(self.link))
            exit(0)
        
        if remake or not path.isfile(self.libpath):
            if dependencies is None:
                dependencies = ["{}_c".format(self.module.name)]
                identifier = self.name
            else:
                identifier = "ftypes.{}".format(self.library)
                #We don't need to reorder these *wrapper* modules before compilation because each of
                #them should be independent of all the others.
                #dependencies = self._process_module_needs(dependencies)

            #append the dependency for the deallocation module to be included in the shared lib.
            dependencies.append("ftypes_dealloc")
                
            makename = "Makefile.{}".format(self.library if self.library else self.name)
            makepath = path.join(self.f90path, makename)
            extralinks = list(self.dependencies.values())
            extralinks.append(self.link)
            makefile(identifier, dependencies, makepath, "ftypes.{}".format(self.name),
                     False, False, self.module.parent, "so", extralinks)
            code = self._compile(self.f90path, makename, compiler, debug, profile)
            if code == 0:
                #Copy the shared library to the main directory out of the f90 directory
                from shutil import copy
                copy(path.join(self.f90path, "{}.so".format(identifier)), self.dirpath)
            return code
        else:
            return 0
1241517
def __to_file(self, message_no):
        
        filename = self.__create_file_name(message_no)
        try:
            with codecs.open(filename, mode='w',
                             encoding=self.messages[message_no].encoding)\
                    as file__:
                file__.write(self.messages[message_no].output)
        except IOError as excep:
            print 'Unable for open the file \'{0}\' for writing. The '\
                  'following exception was raised:'.format(filename)
            print excep
            print 'Exiting!'
            sys.exit(2)
        return filename
1225597
def create(rawmessage):
    """"""
    rawmessage = _trim_buffer_garbage(rawmessage)

    if len(rawmessage) < 2:
        return (None, rawmessage)

    code = rawmessage[1]
    msgclass = _get_msg_class(code)

    msg = None

    remaining_data = rawmessage
    if msgclass is None:
        _LOGGER.debug('Did not find message class 0x%02x', rawmessage[1])
        rawmessage = rawmessage[1:]
        rawmessage = _trim_buffer_garbage(rawmessage, False)
        if rawmessage:
            _LOGGER.debug('Create: %s', create)
            _LOGGER.debug('rawmessage: %s', binascii.hexlify(rawmessage))
            msg, remaining_data = create(rawmessage)
        else:
            remaining_data = rawmessage
    else:
        if iscomplete(rawmessage):
            msg = msgclass.from_raw_message(rawmessage)
            if msg:
                remaining_data = rawmessage[len(msg.bytes):]
    # _LOGGER.debug("Returning msg: %s", msg)
    # _LOGGER.debug('Returning buffer: %s', binascii.hexlify(remaining_data))
    return (msg, remaining_data)
1218080
def create(
    name,

    create_file,
    open_file,
    remove_file,

    create_directory,
    list_directory,
    remove_empty_directory,
    temporary_directory,

    stat,

    lstat,
    link,
    readlink,

    realpath=_realpath,
    remove=_recursive_remove,
):
    

    methods = dict(
        create=create_file,
        open=lambda fs, path, mode="r": open_file(
            fs=fs, path=path, mode=mode,
        ),
        remove_file=remove_file,

        create_directory=create_directory,
        list_directory=list_directory,
        remove_empty_directory=remove_empty_directory,
        temporary_directory=temporary_directory,

        get_contents=_get_contents,
        set_contents=_set_contents,
        create_with_contents=_create_with_contents,

        remove=remove,
        removing=_removing,

        stat=stat,

        lstat=lstat,
        link=link,
        readlink=readlink,
        realpath=realpath,

        exists=_exists,
        is_dir=_is_dir,
        is_file=_is_file,
        is_link=_is_link,

        touch=_touch,

        children=_children,
        glob_children=_glob_children,
    )
    return attr.s(hash=True)(type(name, (object,), methods))