Load a previously saved ascii representation of this simulation trace.

        Args:
            in_path (str): The path of the input file that we should load.

        Returns:
            SimulationTrace: The loaded trace object.
15903
def FromFile(cls, in_path):
        

        with open(in_path, "rb") as infile:
            in_data = json.load(infile)

        if not ('trace', 'selectors') in in_data:
            raise ArgumentError("Invalid trace file format", keys=in_data.keys(), expected=('trace', 'selectors'))

        selectors = [DataStreamSelector.FromString(x) for x in in_data['selectors']]
        readings = [IOTileReading(x['time'], DataStream.FromString(x['stream']).encode(), x['value'], reading_id=x['reading_id']) for x in in_data['trace']]

        return SimulationTrace(readings, selectors=selectors)
291405
def load_from_file(filepath):
        
        class_inst = None
        expected_class = "Py3status"
        module_name, file_ext = os.path.splitext(os.path.split(filepath)[-1])
        if file_ext.lower() == ".py":
            py_mod = imp.load_source(module_name, filepath)
            if hasattr(py_mod, expected_class):
                class_inst = py_mod.Py3status()
        return class_inst
811492
def load(self, path):
        
        path = os.path.expandvars(os.path.expanduser(path))

        gdg = cgaddag.gdg_load(path.encode("ascii"))
        if not gdg:
            errno = ctypes.c_int.in_dll(ctypes.pythonapi, "errno").value
            raise OSError(errno, os.strerror(errno), path)

        self.__del__()
        self.gdg = gdg.contents
733410
def downloaded_reqs_from_path(path, argv):
    
    finder = package_finder(argv)
    return [DownloadedReq(req, argv, finder) for req in
            _parse_requirements(path, finder)]
738610
def load_mirteFile(path, m, logger=None):
    
    l = logging.getLogger('load_mirteFile') if logger is None else logger
    had = set()
    for name, path, d in walk_mirteFiles(path, logger):
        if os.path.realpath(path) in m.loaded_mirteFiles:
            continue
        identifier = name
        if name in had:
            identifier = path
        else:
            had.add(name)
        l.info('loading %s' % identifier)
        m.loaded_mirteFiles.add(os.path.realpath(path))
        _load_mirteFile(d, m)
281686
def _path_to_str(self, path):
        
        inp = ''
        for arc in path:
            i = self.isyms.find(arc.ilabel)
            # Ignore \epsilon transitions both on input
            if i != fst.EPSILON:
                inp += i
        return inp
1345036
def load_file(self, path=None, env=None, silent=True, key=None):
        
        env = (env or self.current_env).upper()
        files = ensure_a_list(path)
        if files:
            self.logger.debug("Got %s files to process", files)
            already_loaded = set()
            for _filename in files:
                self.logger.debug("Processing file %s", _filename)
                filepath = os.path.join(self._root_path, _filename)
                self.logger.debug("File path is %s", filepath)
                # Handle possible *.globs sorted alphanumeric
                for path in sorted(glob.glob(filepath)):
                    self.logger.debug("Loading %s", path)
                    if path in already_loaded:  # pragma: no cover
                        self.logger.debug("Skipping %s, already loaded", path)
                        continue
                    settings_loader(
                        obj=self,
                        env=env,
                        silent=silent,
                        key=key,
                        filename=path,
                    )
                    already_loaded.add(path)
            if not already_loaded:
                self.logger.warning(
                    "Not able to locate the files %s to load", files
                )
549558
def load_config(path):
    
    args = []
    with open(path, 'r') as fp:
        for line in fp.readlines():
            if line.strip() and not line.startswith("#"):
                args.append(line.replace("\n", ""))

    return args
443335
def from_file(filepath: str):
        
        trace = TrainingTrace()
        trace._trace = load_config(filepath)
        return trace
1217868
def load(path):
    '''
    
    '''
    ret = False
    cmd = 'vmctl load {0}'.format(path)
    result = __salt__['cmd.run_all'](cmd,
                                     output_loglevel='trace',
                                     python_shell=False)
    if result['retcode'] == 0:
        ret = True
    else:
        raise CommandExecutionError(
            'Problem encountered running vmctl',
            info={'errors': [result['stderr']], 'changes': ret}
        )

    return ret
1328396
def _load(self, file_path: Text) -> None:
        

        # noinspection PyUnresolvedReferences
        module_ = types.ModuleType('settings')
        module_.__file__ = file_path

        try:
            with open(file_path, encoding='utf-8') as f:
                exec(compile(f.read(), file_path, 'exec'), module_.__dict__)
        except IOError as e:
            e.strerror = 'Unable to load configuration file ({})'\
                .format(e.strerror)
            raise

        for key in dir(module_):
            if CONFIG_ATTR.match(key):
                self[key] = getattr(module_, key)
329210
def load(self, path):
        
        with open(path) as f:
            self.config = full_load(f)
            if self.config is None:
                sys.stderr.write("Warning: config file is empty!\n")
                self.config = {}
1330345
def load_pyfile(self, path):
        
        with open(path) as config_file:
            contents = config_file.read()
            try:
                exec(compile(contents, path, 'exec'), self)
            except Exception as e:
                raise MalformedConfig(path, six.text_type(e))
89334
def loadFromFile(self, path):
        
        if '~' in path:
            path = os.path.expanduser(path)
        f = open(path)
        body = f.read()
        f.close()
        self._path = path
        self.loadFromString(body)
70005
def load_path(self, path):
        

        if not foundations.common.path_exists(path):
            return False

        if os.path.isfile(path):
            if path in self.list_files():
                self.set_current_editor(path)
            else:
                self.load_file(path)
        else:
            if not path in self.list_projects():
                self.add_project(path)
        return True
1931
def read(in_path):
    
    assert os.path.exists(in_path), "The following GRP file can't be found. in_path: {}".format(in_path)

    with open(in_path, "r") as f:
        lines = f.readlines()
        # need the second conditional to ignore comment lines
        grp = [line.strip() for line in lines if line and not re.match("^#", line)]

    return grp
754197
def _load_file(path):
    
    if not os.path.exists(path):
        parser.error("{} was not found!".format(path))
    if USING_PYTHON2:
        mode = "r"
    else:
        mode = "rb"
    try:
        f = open(path, mode)
        return f
    except IOError as ex:
        parser.error("{path} could not be read due to an I/O error! ({ex})".format(path=path, ex=ex))