Load the SLSTR relative spectral responses
358036
def _load(self, scale=1.0):
        

        LOG.debug("File: %s", str(self.requested_band_filename))
        ncf = Dataset(self.requested_band_filename, 'r')

        wvl = ncf.variables['wavelength'][:] * scale
        resp = ncf.variables['response'][:]

        self.rsr = {'wavelength': wvl, 'response': resp}
680171
def _iter_content_generator(response, decode_unicode):
    """"""
    for chunk in response.iter_content(100 * 1024, decode_unicode=decode_unicode):
        if decode_unicode:
            # Replace CRLF newlines with LF, Python will handle
            # platform specific newlines if written to file.
            chunk = chunk.replace('\r\n', '\n')
            # Chunk could be ['...\r', '\n...'], stril trailing \r
            chunk = chunk.rstrip('\r')
        yield chunk
517881
def _load_data(self, band):
        
        # `band` should be 'nuv' or 'fuv'
        df = bandpass_data_frame('filter_galex_' + band + '.dat', 'wlen resp')
        df.resp *= df.wlen # QE -> EE response convention.
        return df
407453
async def load(self):
        """"""
        json_response = await self.pyvlx.interface.api_call('scenes', 'get')
        self.data_import(json_response)
213560
def loads(s):
    
    p = Parser(current_type=glyphsLib.classes.GSFont)
    logger.info("Parsing .glyphs file")
    data = p.parse(s)
    return data
205800
def load_vstr(buf, pos):
    """"""
    slen, pos = load_vint(buf, pos)
    return load_bytes(buf, slen, pos)
199940
def load_vcoef(filename):
    """"""

    with open(filename) as f: 
        lines = f.readlines()

        lst = lines[0].split(',')

        nmax = int(lst[0])
        mmax = int(lst[1])
        directivity = float(lst[2])

        L = (nmax + 1) + mmax * (2 * nmax - mmax + 1);

        vec1 = np.zeros(L, dtype=np.complex128)
        vec2 = np.zeros(L, dtype=np.complex128)
   
        lines.pop(0)

        n = 0
        in_vec2 = False
        for line in lines:

            if line.strip() == 'break':
                n = 0
                in_vec2 = True;
            else:
                lst = line.split(',')
                re = float(lst[0])
                im = float(lst[1])

                if in_vec2:
                    vec2[n] = re + 1j * im
                else:
                    vec1[n] = re + 1j * im

                n += 1

    return (sp.VectorCoefs(vec1, vec2, nmax, mmax), directivity)
1005362
def _load_general(data, targets):
    """"""
    for d_src, d_targets in zip(data, targets):
        if isinstance(d_targets, nd.NDArray):
            d_src.copyto(d_targets)
        else:
            assert d_targets[-1][0].stop == d_src.shape[0], \
                "Batch size miss match. Expected %d, got %d"%( \
                    d_targets[-1][0].stop, d_src.shape[0])
            for slice_idx, d_dst in d_targets:
                d_src[slice_idx].copyto(d_dst)
1220050
def load(self, dtype_out_time, dtype_out_vert=False, region=False,
             plot_units=False, mask_unphysical=False):
        """"""
        msg = ("Loading data from disk for object={0}, dtype_out_time={1}, "
               "dtype_out_vert={2}, and region="
               "{3}".format(self, dtype_out_time, dtype_out_vert, region))
        logging.info(msg + ' ({})'.format(ctime()))
        # Grab from the object if its there.
        try:
            data = self.data_out[dtype_out_time]
        except (AttributeError, KeyError):
            # Otherwise get from disk.  Try scratch first, then archive.
            try:
                data = self._load_from_disk(dtype_out_time, dtype_out_vert,
                                            region=region)
            except IOError:
                data = self._load_from_tar(dtype_out_time, dtype_out_vert)
        # Copy the array to self.data_out for ease of future access.
        self._update_data_out(data, dtype_out_time)
        # Apply desired plotting/cleanup methods.
        if mask_unphysical:
            data = self.var.mask_unphysical(data)
        if plot_units:
            data = self.var.to_plot_units(data, dtype_vert=dtype_out_vert)
        return data
691406
def load(self, **descr):
        '''
        
        '''
        for obj, data in descr.items():
            setattr(self._data, obj, data)

        return self
1064814
def _load(self, scale=1.0):
        """"""
        data = np.genfromtxt(self.requested_band_filename,
                             unpack=True,
                             names=['wavenumber',
                                    'response'],
                             skip_header=4)

        # Data are wavenumbers in cm-1:
        wavelength = 1. / data['wavenumber'] * 10000.
        response = data['response']

        # The real MetImage has 24 detectors. However, for now we store the
        # single rsr as 'detector-1', indicating that there will be multiple
        # detectors in the future:
        detectors = {}
        detectors['det-1'] = {'wavelength': wavelength, 'response': response}
        self.rsr = detectors
759017
def _load_converted_gssha_data_from_lsm(self, gssha_var, lsm_var, load_type):
        
        super(NWMtoGSSHA, self).\
            _load_converted_gssha_data_from_lsm(gssha_var, lsm_var, load_type)
        self.data.lsm.coords_projected = True
448278
def construct_sls_str(self, node):
        '''
        
        '''

        # Ensure obj is str, not py2 unicode or py3 bytes
        obj = self.construct_scalar(node)
        if six.PY2:
            obj = obj.encode('utf-8')
        return SLSString(obj)
1044368
def _load_text(handle, split=False, encoding="utf-8"):
    """"""
    string = handle.read().decode(encoding)
    return string.splitlines() if split else string
251606
def _load_general(data, targets, major_axis):
    """"""
    for d_src, d_targets, axis in zip(data, targets, major_axis): # pylint: disable=too-many-nested-blocks
        if isinstance(d_targets, nd.NDArray):
            d_src.copyto(d_targets)
        elif isinstance(d_src, (list, tuple)):
            for src, dst in zip(d_src, d_targets):
                src.copyto(dst)
        else:
            for slice_idx, d_dst in d_targets:
                if axis >= 0:
                    # copy slice
                    shape = d_src.shape
                    do_crop = (slice_idx.start != 0 or shape[axis] != slice_idx.stop)
                    # pylint: disable=no-member,protected-access
                    if do_crop:
                        if axis == 0:
                            d_src[slice_idx.start:slice_idx.stop].copyto(d_dst)
                        else:
                            if d_src.context == d_dst.context:
                                nd.slice_axis(d_src, axis=axis, begin=slice_idx.start,
                                              end=slice_idx.stop, out=d_dst)
                            else:
                                # on different device, crop and then do cross device copy
                                d_dst_copy = nd.slice_axis(d_src, axis=axis, begin=slice_idx.start,
                                                           end=slice_idx.stop)
                                d_dst_copy.copyto(d_dst)
                    else:
                        d_src.copyto(d_dst)
                    # pylint: enable=no-member,protected-access
                else:
                    d_src.copyto(d_dst)
368556
def _fill_slices(self, sls):
        """"""
        # Fill '...' entries with ':'
        nfill = self.ndim - len(sls)
        fsls = list()
        for sl in sls:
            if sl is Ellipsis:
                while nfill:
                    fsls.append(slice(None, None))
                    nfill -= 1
                fsls.append(slice(None, None))
            else:
                fsls.append(sl)

        # Append ':' to the end
        for _ in range(self.ndim - len(fsls)):
            fsls.append(slice(None, None))

        return fsls
135018
def loads(s, single=False):
    
    corpus = etree.fromstring(s)
    if single:
        ds = _deserialize_mrs(next(corpus))
    else:
        ds = (_deserialize_mrs(mrs_elem) for mrs_elem in corpus)
    return ds