get and parse data stored in self.path.
16937
def _get(self):
        """"""

        data, stat = self.zk.get(self.path)
        if not len(data):
            return {}, stat.version
        if self.OLD_SEPARATOR in data:
            return self._get_old()
        return json.loads(data), stat.version
565559
def get(self, path, params=None):
        """"""
        r = requests.get(url=self.url + path, params=params, timeout=self.timeout)
        r.raise_for_status()
        return r.json()
582979
def _get_path(dict_, path):
    '''
    
    '''
    cur = dict_
    for part in path.split('/'):
        cur = cur[part]
    return cur
355921
def retrieve_data(file_paths):

    
    data_dict = {}
    for file_path in file_paths:
        with open(file_path) as fh:
            try:
                content = yaml.load(fh.read())
            except yaml.YAMLError as e:
                raise MiuraException(
                    "Unable to parse yaml at {0}: \n {1}".format(
                        file_path,
                        str(e)
                    ))
            if not isinstance(content, dict):
                raise MiuraException(
                    "{0} is does not translate to a dictionary!".format(file_path)
                )
            data_dict.update(content)
    return data_dict
716948
def _parse(self, stream, context, path):
        """"""
        objs = []
        while True:
            start = stream.tell()
            test = stream.read(len(self.find))
            stream.seek(start)
            if test == self.find:
                break
            else:
                subobj = self.subcon._parse(stream, context, path)
                objs.append(subobj)
        return objs
1091869
def load(self, path):
        
        with open(path) as f:
            code = f.read()
            exec(code, {}, self.__dict__)
884362
def load(data_path):
        
        with open(data_path, "r") as data_file:
            raw_data = data_file.read()

        data_file.close()
        return raw_data
402255
def _read_raw_data(path):
    

    with zipfile.ZipFile(path) as datafile:
        return (
            datafile.read("ml-100k/ua.base").decode().split("\n"),
            datafile.read("ml-100k/ua.test").decode().split("\n"),
            datafile.read("ml-100k/u.item").decode(errors="ignore").split("\n"),
            datafile.read("ml-100k/u.genre").decode(errors="ignore").split("\n"),
        )
964504
async def get_data(self, path, headers=None, timeout=None):
        """"""
        url = self.base_url + path
        _LOGGER.debug('GET URL: %s', url)
        resp = None
        try:
            resp = await self._session.get(
                url, headers=headers,
                timeout=DEFAULT_TIMEOUT if timeout is None else timeout)
            if resp.content_length is not None:
                resp_data = await resp.read()
            else:
                resp_data = None
            return resp_data, resp.status
        except Exception as ex:
            if resp is not None:
                resp.close()
            raise ex
        finally:
            if resp is not None:
                await resp.release()
1222992
def load(cls, path):
        
        try:
            with open(path, "rb") as f:
                return cls(__data__=json.loads(f.read().decode("utf-8")))
        except:
            pass

        with open(path, "rb") as f:
            return cls(__data__=pickle.load(f))
631662
def load(cls, path):
        ""
        itos = pickle.load(open(path, 'rb'))
        return cls(itos)
973626
def _parse_path(self, path):
        
        run = self.settings['run']
        project = self.settings['project']
        username = self.settings['username']
        parts = path.replace("/runs/", "/").split("/")
        if ":" in parts[-1]:
            run = parts[-1].split(":")[-1]
            parts[-1] = parts[-1].split(":")[0]
        elif parts[-1]:
            run = parts[-1]
        if len(parts) > 1:
            project = parts[1]
            if username and run == project:
                project = parts[0]
            else:
                username = parts[0]
        else:
            project = parts[0]
        return (username, project, run)
1033817
def parse_file_path(cls, file_path):
    """"""
    address = None
    pattern = cls.file_regex.match(file_path)
    if pattern:
      address = pattern.group(1)
    return address
1285756
def get(self, name):
        
        # load the file by path name
        with open(os.path.join(self.parent,
                               name.strip()), 'rb') as f:
            data = f.read()
        return data
792411
def load(cls, path):
        
        data = json.load(open(path))

        weights = data['weights']
        weights = np.asarray(weights, dtype=np.float64)

        s = cls(data['map_dimensions'],
                data['params']['lr']['orig'],
                data['data_dimensionality'],
                influence=data['params']['infl']['orig'],
                lr_lambda=data['params']['lr']['factor'],
                infl_lambda=data['params']['infl']['factor'])

        s.weights = weights
        s.trained = True

        return s
406271
def gather_data(mypath, key="width"):
    
    filenames = [join(mypath, f) for f in listdir(mypath) if isfile(join(mypath, f))]
    filenames = [f for f in filenames if f.endswith(".p")] 
    W = []
    for filename in filenames:
        with open(filename, 'r') as f:
            data = pickle.load(f)
            W.append(np.expand_dims(data[key], axis=-1) )

    W = np.concatenate(W, axis=-1)
    return W
610709
function (path, data) {
        var i = 0,
            len = path.length;
        for (;i<len;i++) {
            if (isObject(data) && (path[i] in data)) {
                data = data[path[i]];
            } else {
                data = undefined;
                break;
            }
        }
        return data;
    }