load waypoints from a file
195992
def load_waypoints(self, filename):
        ''''''
        self.wploader.target_system = self.target_system
        self.wploader.target_component = self.target_component
        try:
            self.wploader.load(filename)
        except Exception as msg:
            print("Unable to load %s - %s" % (filename, msg))
            return
        print("Loaded %u waypoints from %s" % (self.wploader.count(), filename))
        self.send_all_waypoints()
1089852
def load_dotfiles(self):
        """"""
        if self.args.map and path.exists(self.args.map):
            dotfiles_path = self.args.map
        else:
            dotfiles_path = self.source

        self.log.debug('Loading dotfile mapping from %s', dotfiles_path)

        return self.parse_mapping(dotfiles_path, source=self.source)
863279
def load_file(path):
    ''''''
    path = pathlib.Path(path)
    data = path.open().readlines()
    # remove comments and empty lines
    data = [l for l in data if len(l.strip()) and not l.startswith("#")]
    # determine data shape
    n = len(data)
    m = len(data[0].strip().split())
    res = np.zeros((n, m), dtype=np.dtype(float))
    # write data to array, replacing comma with point decimal separator
    for ii in range(n):
        res[ii] = np.array(data[ii].strip().replace(",", ".").split(),
                           dtype=float)
    return res
938546
function (callback) {
            async.map([ "unk.dat.gz", "unk_pos.dat.gz", "unk_map.dat.gz", "unk_char.dat.gz", "unk_compat.dat.gz", "unk_invoke.dat.gz" ], function (filename, _callback) {
                loadArrayBuffer(path.join(dic_path, filename), function (err, buffer) {
                    if(err) {
                        return _callback(err);
                    }
                    _callback(null, buffer);
                });
            }, function (err, buffers) {
                if(err) {
                    return callback(err);
                }
                var unk_buffer = new Uint8Array(buffers[0]);
                var unk_pos_buffer = new Uint8Array(buffers[1]);
                var unk_map_buffer = new Uint8Array(buffers[2]);
                var cat_map_buffer = new Uint8Array(buffers[3]);
                var compat_cat_map_buffer = new Uint32Array(buffers[4]);
                var invoke_def_buffer = new Uint8Array(buffers[5]);

                dic.loadUnknownDictionaries(unk_buffer, unk_pos_buffer, unk_map_buffer, cat_map_buffer, compat_cat_map_buffer, invoke_def_buffer);
                // dic.loadUnknownDictionaries(char_buffer, unk_buffer);
                callback(null);
            });
        }
1344901
def link(source_path):
    """"""
    if not os.path.isfile(source_path):
        raise SourceNotFound(source_path)
    with open(source_path, 'r') as f:
        content = f.read()
    block_map = BlockMap()  # The map will be populated with the following function call.
    all_block = convert_lines_to_block(
            content.splitlines(), block_map, LinkStack(source_path), source_path)
    return all_block, block_map.get_variables()
79695
def from_file(self, vasprun_file):
        """"""
        vrun_obj = Vasprun(vasprun_file, parse_projected_eigen=True)
        return VasprunLoader(vrun_obj)
170076
function safeGetWaypoints(connection) {

  var waypoints = connection.waypoints;

  if (!waypoints.length) {
    throw new Error('connection#' + connection.id + ': no waypoints');
  }

  return waypoints;
}
740649
def _load_file(self, f):
        """"""
        try:
            with open(f, 'r') as _fo:
                _seria_in = seria.load(_fo)
                _y = _seria_in.dump('yaml')
        except IOError:
            raise FiggypyError("could not open configuration file")
        self.values.update(yaml.load(_y))
463926
def load_yaml_by_path(cls, path, log_debug=False):
        """"""
        try:
            if isinstance(path, six.string_types):
                return yaml.load(open(path, 'r'), Loader=Loader) or {}
            else:
                return yaml.load(path, Loader=Loader) or {}
        except (yaml.scanner.ScannerError, yaml.parser.ParserError) as e:
            log_level = logging.DEBUG if log_debug else logging.WARNING
            logger.log(log_level, 'Yaml error in {path} (line {ln}, column {col}): {err}'.
                       format(path=path,
                              ln=e.problem_mark.line,
                              col=e.problem_mark.column,
                              err=e.problem))
            return None
153006
def load_locations(self, location_file=None):
        """"""
        if location_file is None:
            contents = pkgutil.get_data(__package__, 'data/locations.json')
            contents_string = contents.decode("ascii")
            locations = contents_string.split('\n')
        else:
            from .cli import open_file
            with open_file(location_file, 'rb') as input:
                locations = input.readlines()
        
        for location_string in locations:
            if location_string.strip():
                location = Location(known=True, **json.loads(location_string))
                self.location_id_to_location[location.id] = location
                self.add_location(location)
807283
def from_file(cls, filepath):
        """"""
        with open(filepath, "rt") as fh:
            return cls(**yaml.safe_load(fh))
550970
def load_features(paths: List[str],
                  expected_shape: Optional[tuple] = None) -> List[np.ndarray]:
    
    data = []  # type: List[np.ndarray]
    for path in paths:
        data.append(load_feature(path, expected_shape))
    return data
1218834
def load(self, path="chain.dat"):
        
        # read data from file
        file = open(path, 'r')
        dic = json.load(file)
        file.close()

        # get data from dictionary
        self._chain = np.array(dic['chain'])
        self._step_count = np.array(dic['step_count'])
        self._n_samples = dic['n_samples']
        self._n_accepted = dic['n_accepted']
        self._X = {}
        self._X['x'] = dic['x']
        self._X['f'] = dic['f']
        self._X['J'] = dic['J']
1249771
def send_all_waypoints(self):
        ''''''
        self.master.waypoint_clear_all_send()
        if self.wploader.count() == 0:
            return
        self.loading_waypoints = True
        self.loading_waypoint_lasttime = time.time()
        self.master.waypoint_count_send(self.wploader.count())
777371
def _load_from_file(self, filename):
    """"""
    if not tf.gfile.Exists(filename):
      raise ValueError("File %s not found" % filename)
    with tf.gfile.Open(filename) as f:
      self._load_from_file_object(f)
240318
def load(cls, path):
        """"""
        with open(path) as f:
            context = cls.read_from_buffer(f, path)
        context.set_load_path(path)
        return context
1138710
def load(self, arguments):
        ""
        features = arguments[1:-1]
        list(map(self.load_feature, features))