Read entire contents of file into a string.
769901
def read_string_from_file(path, encoding="utf8"):
  
  with codecs.open(path, "rb", encoding=encoding) as f:
    value = f.read()
  return value
11985
def file_to_string(path):
    
    if not os.path.exists(path):
        ui.error(c.MESSAGES["path_missing"], path)
        sys.exit(1)

    with codecs.open(path, "r", "UTF-8") as contents:
        return contents.read()
415590
def read_string(self):
        """"""
        length = self._stream.read_var_uint32()
        return self._stream.read_string(length)
198114
def read(self, _file):
        """"""
        with open(_file) as fh:
            data = fh.read()
            if self.verbose:
                sys.stdout.write("read %d bytes from %s\n"
                                 % (fh.tell(), _file))
        return data
258097
private static String readFile(final String fileName) throws IOException {
    return new String(Files.readAllBytes(Paths.get(fileName)), StandardCharsets.UTF_8);
  }
766595
def read_input_data(filename):
    """"""
    logging.info('Opening file %s for reading input', filename)
    input_file = open(filename, 'r')
    data = []
    labels = []
    for line in input_file:
        tokens = line.split(',', 1)
        labels.append(tokens[0].strip())
        data.append(tokens[1].strip())
    return labels, data
86076
public static String readFileToString(File f) throws IOException {
		StringWriter sw = new StringWriter();
		IO.copyAndCloseBoth(Common.asReaderUTF8Lenient(new FileInputStream(f)), sw);
		return sw.toString();
	}
1019485
def read_text(self, name):
        """"""
        with self.open_readable(name) as fp:
            res = fp.read()  # StringIO or file object
            # try:
            #     res = fp.getvalue()  # StringIO returned by FtpTarget
            # except AttributeError:
            #     res = fp.read()  # file object returned by FsTarget
            res = res.decode("utf-8")
            return res
1147290
def file_to_str(fname):
    
    data = None
    # rU = read with Universal line terminator
    with open(fname, 'rU') as fd:
        data = fd.read()
    return data
697789
def read(filename):
    """"""
    return codecs.open(os.path.join(__DIR__, filename), 'r').read()
1287275
def read_file(filename):
    """"""
    with open(join(abspath(dirname(__file__)), filename)) as file:
        return file.read()
186660
def read_file(file_path, mode = 'rt'):
    
    contents = ''
    with open(file_path, mode) as f:
        contents = f.read()
    return contents
608370
public static String readAllToString(final InputStream in) throws IOException {
    return new String(readAllToBytes(in), StandardCharsets.UTF_8);
  }
581369
def get_file_string(filepath):
    """"""
    with open(os.path.abspath(filepath)) as f:
        return f.read()
527447
def read_file(filename):
   

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

   return lines
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
652486
def read(cls, f):
    """"""
    header = WETHeader.read(f)
    if header is None:
      # EOF
      return None
    content = f.read(header.length)

    # Consume empty separators
    f.readline()
    f.readline()

    return cls(header.url, content)