Returns the concrete content for a file by path.

        :param path: file path as string
        :param kwargs: passed to state.solver.eval
        :return: file contents as string
774438
def dump_file_by_path(self, path, **kwargs):
        
        file = self.state.fs.get(path)
        if file is None:
            return None
        return file.concretize(**kwargs)
503544
def get_json_content(file_path):
    
    try:
        with open(file_path, 'r') as file:
            return json.load(file)
    except TypeError as err:
        print('Error: ', err)
        return None
29836
def from_path(cls, path: pathlib.Path) -> 'File':
        
        if not path.is_file():
            raise ValueError('Path does not point to a file')
        return File(path.name, path.stat().st_size, cls._md5(path))
670886
def wrap(self, path, args=(), kws={}, scheme='', authority=''):
        
        # build dict of argument name+value
        AV = {}
        AV.update([A for A in kws.items() if A[1] is not None])
        AV.update([(N, V) for (N, _T), V in zip(self._args, args)])

        # list of argument name+type tuples for which a value was provided
        AT = [A for A in self._args if A[0] in AV]

        T = self.buildType(AT)
        try:
            return Value(T, {
                'scheme': scheme,
                'authority': authority,
                'path': path,
                'query': AV,
            })
        except Exception as e:
            raise ValueError('Unable to initialize NTURI %s from %s using %s' % (AT, AV, self._args))
255398
def get_file_checksum(self, path, **kwargs):
        
        metadata_response = self._get(
            path, 'GETFILECHECKSUM', expected_status=httplib.TEMPORARY_REDIRECT, **kwargs)
        assert not metadata_response.content
        data_response = self._requests_session.get(
            metadata_response.headers['location'], **self._requests_kwargs)
        _check_response(data_response)
        return FileChecksum(**_json(data_response)['FileChecksum'])
376109
def read_key_value_pairs_from_file(*path):
    
    with open(os.path.join(*path)) as f:
        for line in f:
            yield line.split(' ', 1)
484077
def generate_file_template_load(path):
        
        path = os.path.expanduser(os.path.abspath(
                path
        ))

        def read_file():
            """
            Read file from path and return file contents
            :return:
            """
            with open(path) as template:
                return template.read()

        return read_file
1075774
def get_email_content(file_path):
    
    with open(file_path, "r") as in_file:
        text = str(in_file.read())
        return text.replace("\n\n", "<br>")
15669
def _urlparse(path):
    
    url = urlparse.urlparse(path)
    _validate_url(url)
    if not url.scheme or url.scheme == 'file://':
        # Normalize path, and set scheme to "file" if missing
        path = os.path.abspath(
            os.path.expanduser(path))
        url = urlparse.urlparse('file://'+path)
    return url
410445
def get_file_meta(self, path):
        
        if self.tree is None:
            self.read_index()

        if path not in self.tree:
            raise KeyError("Path doesn't exist")

        return self._make_meta_dict(self.tree[path])
480187
def read_file(self, path):
        

        self.assert_valid_path(path)

        with open(path, 'rb') as file:
            contents = file.read().decode('UTF-8')

        return contents
735358
def load(path):
    '''
    
    '''
    ret = {}
    fmadm = _check_fmadm()
    cmd = '{cmd} load {path}'.format(
        cmd=fmadm,
        path=path
    )
    res = __salt__['cmd.run_all'](cmd)
    retcode = res['retcode']
    result = {}
    if retcode != 0:
        result['Error'] = res['stderr']
    else:
        result = True

    return result
516970
def load_data(cls, relpath):
        
        filepath = os.path.join(cls.data_path, relpath)
        with open(filepath) as fp:
            content = fp.read()

        return content
737007
def read_file_bytes(input_file_path):
    
    contents = None
    try:
        with io.open(input_file_path, "rb") as input_file:
            contents = input_file.read()
    except:
        pass
    return contents
1171252
def load_content(self, path):
        ""
        log.debug('Opening {0} in {1} load_content'.format(path, __name__))
        with open(path) as fin:
            self.path = path
            self.content = fin.read()
473082
def read(path):
    
    # This function implementation was chosen to be compatible across Python 2/3.
    f = open(path, 'rb')
    # We avoid use of the with keyword for Python 2.4 support.
    try:
        b = f.read()
    finally:
        f.close()

    return b.decode(FILE_ENCODING)
629299
def get(self, path):
        
        data = self.app.test_client().get("/%s" % path).data
        return data