The raw file contents as a string.
182196
def contents(self):
        """"""
        if not self._contents:
            if self._path:
                # Read file into memory so we don't run out of file descriptors
                f = open(self._path, "rb")
                self._contents = f.read()
                f.close()
            elif self._pil_image:
                # Write PIL image to string
                f = StringIO()
                self._pil_image.save(f, self.format)
                self._contents = f.getvalue()
        return self._contents
553226
def raw(self):
        
        if self._raw:
            return text_type(self._raw).strip("\r\n")
        else:
            return text_type(base64decode(self._b64encoded)).strip("\r\n")
87356
def file_contents(self, filename, binary=False):
        
        if binary:
            mode = 'rb'
        else:
            mode = 'r'
        try:
            with open(filename, mode) as f:
                return f.read()
        except (OSError, IOError) as e:
            raise FileReadError(str(e))
1217826
def to_string(self, limit=None):
        
        header = self.short_string()
        if len(self) == 0:
            return header
        contents = ""
        element_lines = [
            "  -- %s" % (element,)
            for element in self.elements[:limit]
        ]
        contents = "\n".join(element_lines)

        if limit is not None and len(self.elements) > limit:
            contents += "\n  ... and %d more" % (len(self) - limit)
        return "%s\n%s" % (header, contents)
989706
def dump_raw(self, text, stream=None):
        """"""
        encrypted = self.vault.encrypt(text)
        if stream:
            stream.write(encrypted)
        else:
            return encrypted
678812
def format_info(raw):
    
    logging.debug(_('raw[0]: %s'), raw[0])
    results, sense = raw
    # A scenario where ORM really stands out.
    new = '\n'.join(
        '{} {} {} {}'.format(
            i[0], sense.kind_id_to_name(i[1]),
            sense.file_id_to_name(i[2]).lower(),
            i[3] + ' ' if i[3] else '').strip()
        for i in results)
    return new
940933
def encoded_content(self, path):
        """"""
        if path in self.__class__.asset_contents:
            return self.__class__.asset_contents[path]
        data = self.read_bytes(path)
        self.__class__.asset_contents[path] = force_text(base64.b64encode(data))
        return self.__class__.asset_contents[path]
391992
function read_raw_string(buf, encoding) {
  var len = buf.readUInt16BE();
  return buf.toString(encoding || 'utf8', len);
}
374045
def get_string(string):
   
   truestring = string
   if string is not None:
      if '/' in string:
         if os.path.isfile(string):
            try:
               with open_(string,'r') as f:
                  truestring = ' '.join(line.strip() for line in f)
            except: pass
      if truestring.strip() == '': truestring = None
   return truestring
947847
def get_raw_file():
    
    with open("{0}/dividers.txt".format(
        os.path.abspath(
            os.path.dirname(__file__)
        )
    ), mode="r") as file_handler:
        lines = file_handler.readlines()
        lines[35] = str(
            random.randint(0, 999999999999)
        )
        return lines
831875
def _safe_read(path, length):
    """"""
    if not os.path.exists(os.path.join(HERE, path)):
        return ''
    file_handle = codecs.open(os.path.join(HERE, path), encoding='utf-8')
    contents = file_handle.read(length)
    file_handle.close()
    return contents
436256
def raw(self, output):
        """"""
        if isinstance(output, (list, tuple)):
            output = '\n'.join(map(str, output))
        self.outfile.write(str(output))
1291481
def raw_file(client, src, dest, opt):
    """"""
    path, key = path_pieces(src)
    resp = client.read(path)
    if not resp:
        client.revoke_self_token()
        raise aomi.exceptions.VaultData("Unable to retrieve %s" % path)
    else:
        if 'data' in resp and key in resp['data']:
            secret = resp['data'][key]
            if is_base64(secret):
                LOG.debug('decoding base64 entry')
                secret = portable_b64decode(secret)

            if is_aws(resp['data']) and 'sts' not in path:
                renew_secret(client, resp, opt)

            write_raw_file(secret, dest)
        else:
            client.revoke_self_token()
            e_msg = "Key %s not found in %s" % (key, path)
            raise aomi.exceptions.VaultData(e_msg)
221149
def from_string(cls, id, format, raw_content, compressed=False,
                    encoded=False):
        """"""
        content = cls(id, format, compressed, encoded)
        content._raw_content = raw_content
        return content
1086989
def raw_data(self, value):
        """"""
        if value:
            try:
                value = value.read()
            except AttributeError:
                pass
            b64 = base64.b64encode(value.encode('utf-8'))
            self.data = b64.decode('utf-8')
29828
def _input_as_multiline_string(self, data):
        
        filename = self._input_filename = \
            FilePath(self.getTmpFilename(self.TmpDir))
        data_file = open(filename, 'w')
        data_file.write(data)
        data_file.close()
        return filename
601133
def read_rawFilesTable(filename):
    """"""
    exp = pd.read_table(filename)
    expected_columns = {'File', 'Exists', 'Size', 'Data format', 'Parameter group', 'Experiment', 'Fraction'}
    found_columns = set(exp.columns)
    if len(expected_columns - found_columns) > 0:
        message = '\n'.join(['The raw files table has the wrong format!',
            'It should contain columns:',
            ', '.join(sorted(expected_columns)),
            'Found columns:',
            ', '.join(sorted(found_columns))])
        raise ValueError(message)
    exp['Raw file'] = exp['File'].apply(path.basename).apply(path.splitext).str.get(0)
    exp['Experiment'] = exp['Experiment'].astype(str)
    return exp