Return an enumerator that knows how to read a physical file.
195608
def file_enumerator(filepath, block_size=10240, *args, **kwargs):
    """"""

    _LOGGER.debug("Enumerating through archive file: %s", filepath)

    def opener(archive_res):
        _LOGGER.debug("Opening from file (file_enumerator): %s", filepath)
        _archive_read_open_filename(archive_res, filepath, block_size)

    if 'entry_cls' not in kwargs:
        kwargs['entry_cls'] = _ArchiveEntryItReadable

    return _enumerator(opener,
                       *args,
                       **kwargs)
272388
def read_file(fpath):
    """"""
    with io.open(os.path.join(PATH_BASE, fpath)) as f:
        return f.read()
486174
def get_readme():
    """"""
    base_dir = path.abspath(path.dirname(__file__))
    with open(path.join(base_dir, 'README.md'), encoding='utf-8') as readme_f:
        return readme_f.read()
1293886
def decode_from_file(path: str) -> Iterable:
    """"""
    with open(path, 'rb') as f:
        b = f.read()
    return decode(b)
321124
def readme(fname):
    """"""
    md = open(os.path.join(os.path.dirname(__file__), fname)).read()
    output = md
    try:
        import pypandoc
        output = pypandoc.convert(md, 'rst', format='md')
    except ImportError:
        pass
    return output
904454
private Iterable<URL> createServiceFileIterator() {
        if (classLoader == null) {
            ClassLoader classLoader = SchemaFactoryFinder.class.getClassLoader();
            return Collections.singleton(classLoader.getResource(SERVICE_ID));
        } else {
            try {
                Enumeration<URL> e = classLoader.getResources(SERVICE_ID);
                if (debug && !e.hasMoreElements()) {
                    debugPrintln("no "+SERVICE_ID+" file was found");
                }

                // wrap it into an Iterator.
                return Collections.list(e);
            } catch (IOException e) {
                if (debug) {
                    debugPrintln("failed to enumerate resources "+SERVICE_ID);
                    e.printStackTrace();
                }
                return Collections.emptySet();
            }
        }
    }
1268493
def bytes(self, count):
        """"""

        if count < 0:
            raise ValueError

        # fast path
        if self._bits == 0:
            data = self._fileobj.read(count)
            if len(data) != count:
                raise BitReaderError("not enough data")
            return data

        return bytes(bytearray(self.bits(8) for _ in xrange(count)))
915125
def read(self):
        """"""
        # Validate file path
        assert os.path.isfile(self.file_path), 'No such file exists: ' + str(self.file_path)

        # Open CSV file and read contents
        with open(self.file_path, 'r') as f:
            reader = csv_builtin.reader(f)
            loaded_data = list(reader)

        # Force digits to become integers
        return juggle_types(loaded_data)
864238
def read_int(nbytes: int, *, byteorder: str = "big", from_=None) -> int:
    
    return (yield (Traps._read_int, nbytes, byteorder, from_))
602135
def read(*p):
    """"""
    with open(os.path.join(*p), 'r') as fi:
        return fi.read()
1314434
def read(filename, loader=None, implicit_tuple=True, allow_errors=False):
  """"""
  with open(filename, 'r') as f:
    return reads(f.read(),
                 filename=filename,
                 loader=loader,
                 implicit_tuple=implicit_tuple,
                 allow_errors=allow_errors)
724340
def readPlist(filepath):
    
    plistData = NSData.dataWithContentsOfFile_(filepath)
    dataObject, dummy_plistFormat, error = (
        NSPropertyListSerialization.
        propertyListFromData_mutabilityOption_format_errorDescription_(
            plistData, NSPropertyListMutableContainers, None, None))
    if dataObject is None:
        if error:
            error = error.encode('ascii', 'ignore')
        else:
            error = "Unknown error"
        errmsg = "%s in file %s" % (error, filepath)
        raise NSPropertyListSerializationException(errmsg)
    else:
        return dataObject
1308488
def read(filename):
    """"""
    path = join(here, filename)
    with open(path, "r") as fin:
        return fin.read().strip()
789606
private EnumElement readEnumElement(String documentation) {
    String name = readName();
    EnumElement.Builder builder = EnumElement.builder()
        .name(name)
        .qualifiedName(prefix + name)
        .documentation(documentation);

    if (readChar() != '{') throw unexpected("expected '{'");
    while (true) {
      String valueDocumentation = readDocumentation();
      if (peekChar() == '}') {
        pos++;
        break;
      }
      Object declared = readDeclaration(valueDocumentation, Context.ENUM);
      if (declared instanceof EnumConstantElement) {
        builder.addConstant((EnumConstantElement) declared);
      } else if (declared instanceof OptionElement) {
        builder.addOption((OptionElement) declared);
      }
    }
    return builder.build();
  }
664484
def get_reader(self):
        """"""
        assert self._closed, "Archive not closed"
        buf = io.BytesIO(self.get_bytes())
        return zipfile.ZipFile(buf, mode='r')
735366
def _net_read(sock, count, expiration):
    
    s = ''
    while count > 0:
        _wait_for_readable(sock, expiration)
        n = sock.recv(count)
        if n == '':
            raise EOFError
        count = count - len(n)
        s = s + n
    return s
356216
def read_bytes(self, path):
        """"""
        file = staticfiles_storage.open(path)
        content = file.read()
        file.close()
        return content