Open a DAF for subsequent read requests.

    http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafopr_c.html

    :param fname: Name of DAF to be opened.
    :type fname: str
    :return: Handle assigned to DAF.
    :rtype: int
185894
def dafopr(fname):
    
    fname = stypes.stringToCharP(fname)
    handle = ctypes.c_int()
    libspice.dafopr_c(fname, ctypes.byref(handle))
    return handle.value
652535
def read_file(fname, *args, **kwargs):
    
    if not isstr(fname):
        raise ValueError('reading multiple files not supported, '
                         'please use `pyam.IamDataFrame.append()`')
    logger().info('Reading `{}`'.format(fname))
    format_kwargs = {}
    # extract kwargs that are intended for `format_data`
    for c in [i for i in IAMC_IDX + ['year', 'time', 'value'] if i in kwargs]:
        format_kwargs[c] = kwargs.pop(c)
    return format_data(read_pandas(fname, *args, **kwargs), **format_kwargs)
185656
def read_fwf(self, *args, **kwargs):
        
        import pandas

        t = self.resolved_url.get_resource().get_target()

        return pandas.read_fwf(t.fspath, *args, **kwargs)
100972
def load(self, fname):
        '''
        
        '''
        # Magic files must be ASCII, else encoding issues can arise.
        fp = open(fname, "r")
        lines = fp.readlines()
        self.parse(lines)
        fp.close()
851525
def load(fname: str) -> 'Config':
        
        with open(fname) as inp:
            obj = yaml.load(inp)
            obj.__add_frozen()
            return obj
770839
def open(fname):
    
    with _builtin_open(fname) as fh:
        region_string = fh.read()
    return parse(region_string)
909726
def load_from_file(self, fname):
        
        with open(fname, 'r') as f:
            for line in f:
                k,v = line.split(' = ')
                self._parse_char_line_to_self(k,v)
1301768
def read(self, *args, **kwargs):
        
        with self.open('r') as f:
            return f.read(*args, **kwargs)
1311839
def read(f):
    
    try:
      return PyVDF.reads(f.read())
    except AttributeError:
      pass

    try:
      with open(f, 'r') as filec:
        data = PyVDF.reads(filec.read())
        filec.close()
        return data
    except IOError as e:
      print("Could not open '" + f + "' for reading.")
      print("Ignore this if you are creating a new file.")

    return PyVDF.__UseDict()
464897
def open_readable(self, name):
        
        # print("FTP open_readable({})".format(name))
        assert compat.is_native(name)
        out = SpooledTemporaryFile(max_size=self.MAX_SPOOL_MEM, mode="w+b")
        self.ftp.retrbinary(
            "RETR {}".format(name), out.write, FtpTarget.DEFAULT_BLOCKSIZE
        )
        out.seek(0)
        return out
58459
def _read_file(fname):
    
    with open(fname) as input_file:
        re_grammar = [x.strip('\n') for x in input_file.readlines()]
    return re_grammar
1029096
def tar_open(f):
    
    if isinstance(f, six.string_types):
        return tarfile.open(name=f)
    else:
        return tarfile.open(fileobj=f)
1049484
def open(self, filename):
        '''  '''
        # Ensure old file is closed before opening a new one
        self.close()

        self._f = open(filename, 'rb')
        self._dbtype = struct.unpack('B', self._f.read(1))[0]
        self._dbcolumn = struct.unpack('B', self._f.read(1))[0]
        self._dbyear = struct.unpack('B', self._f.read(1))[0]
        self._dbmonth = struct.unpack('B', self._f.read(1))[0]
        self._dbday = struct.unpack('B', self._f.read(1))[0]
        self._ipv4dbcount = struct.unpack('<I', self._f.read(4))[0]
        self._ipv4dbaddr = struct.unpack('<I', self._f.read(4))[0]
        self._ipv6dbcount = struct.unpack('<I', self._f.read(4))[0]
        self._ipv6dbaddr = struct.unpack('<I', self._f.read(4))[0]
        self._ipv4indexbaseaddr = struct.unpack('<I', self._f.read(4))[0]
        self._ipv6indexbaseaddr = struct.unpack('<I', self._f.read(4))[0]
658556
def safe_load(fname):
    
    lock = fasteners.InterProcessLock(fname + '.lck')
    lock.acquire()
    try:
        with open(fname) as f:
            return ordered_yaml_load(f)
    except:
        raise
    finally:
        lock.release()
27988
def read(fname):
    
    fpath = os.path.join(os.path.dirname(__file__), fname)
    with codecs.open(fpath, 'r', 'utf8') as fhandle:
        return fhandle.read().strip()
526045
def parse_file(self, f):
        

        if type(f) is str:
            self.f = open(f, 'rb')
        else:
            self.f = f
        self._parse_header(self.f.read(64))
689330
def eklef(fname):
    
    fname = stypes.stringToCharP(fname)
    handle = ctypes.c_int()
    libspice.eklef_c(fname, ctypes.byref(handle))
    return handle.value