Read text from file ('filename')
    Return text and encoding
433074
def read(filename, encoding='utf-8'):
    
    text, encoding = decode( open(filename, 'rb').read() )
    return text, encoding
815576
def _read_file(self, filename):
        
        with open(filename, 'r') as stream:
            return self._read_stream(stream=stream)
527447
def read_file(filename):
   

   infile = open(filename, 'r')
   lines = infile.readlines()
   infile.close()

   return lines
668005
function _readFile(fileName, callback) {
    fs.readFile(fileName, "utf8", function (err, data) {
        var content = "";
        if (!err) {
            content = data;
        }
        callback.apply(null, [fileName, content]);
    });
}
1049233
def read_all(self, encoding='utf-8'):
        
        logger.info("Reading everything from %s" % self)
        with codecs.open(self.path, 'r', encoding) as fin:
            read_text = fin.read()
        return read_text
551873
def read(fname):
    
    path = os.path.join(SCRIPTDIR, fname)
    if PY3:
        f = open(path, 'r', encoding='utf8')
    else:
        f = open(path, 'r')
    content = f.read()
    f.close()
    return content
62162
def read(path, encoding="utf-8"):
    
    try:
        with io.open(path, encoding=encoding) as f:
            return f.read()
    except Exception as e:
        logger.error("read: %s failed. Error: %s", path, e)
        return ""
142993
function readFile(fileName) {
  try {
    return read(fileName);
  } catch (e) {
    print(fileName + ': ' + (e.message || e));
    throw e;
  }
}
258097
private static String readFile(final String fileName) throws IOException {
    return new String(Files.readAllBytes(Paths.get(fileName)), StandardCharsets.UTF_8);
  }
820412
def read_text(self, encoding='utf-8') -> str:
        '''  '''
        with self.open('r', encoding=encoding) as fp:
            return fp.read()
535046
def write(text, filename, encoding='utf-8', mode='wb'):
    
    text, encoding = encode(text, encoding)
    with open(filename, mode) as textfile:
        textfile.write(text)
    return encoding
1167840
def read_file(filename):
    
    if os.path.isfile(filename):
        with open(filename, 'r') as f:
            return f.read()
697789
def read(filename):
    """"""
    return codecs.open(os.path.join(__DIR__, filename), 'r').read()
329207
def Read(self):
    
    input_string = self._file_object.readline()

    if isinstance(input_string, py2to3.BYTES_TYPE):
      try:
        input_string = codecs.decode(input_string, self._encoding, self._errors)
      except UnicodeDecodeError:
        if self._errors == 'strict':
          logging.error(
              'Unable to properly read input due to encoding error. '
              'Switching to error tolerant encoding which can result in '
              'non Basic Latin (C0) characters to be replaced with "?" or '
              '"\\ufffd".')
          self._errors = 'replace'

        input_string = codecs.decode(input_string, self._encoding, self._errors)

    return input_string
989671
def read_file(filename, content_type = nil)
      data = File.binread(filename)

      if detect = mime_type_charset_detecter(content_type)
        detect.call(data).encode(Encoding::UTF_8, universal_newline: true)
      else
        data
      end
    end
579350
def _readfile(cls, filename):
        
        f = codecs.open(filename, encoding='utf-8')
        filedata = f.read()
        f.close()
        tokenz = LM.tokenize(filedata, mode='c')
        #print tokenz
        return tokenz
68205
def read(fname, fail_silently=False):
        
        try:
            filepath = os.path.join(os.path.dirname(__file__), fname)
            with io.open(filepath, 'rt', encoding='utf8') as f:
                return f.read()
        except:
            if not fail_silently:
                raise
            return ''