Retrieves the data associated to a path.

    Args:
      path (str): path of the file entry.

    Returns:
      bytes: data or None if not available.
12166
def GetDataByPath(self, path):
    
    _, path_data = self._paths.get(path, (None, None))
    return path_data
1350023
def info(path):
  
  fh = None
  try:
    fh = open(path,'rb')
    return __readHeader(fh)
  finally:
    if fh:
      fh.close()
  return None
643216
def load_path(self, path):
        
        logger.debug("load_path(path=%s)" % path)
        if os.path.isfile(path):
            configtype = self.guess_type(path)
            logger.debug("Detected config type: %s" % self._type_to_str(configtype))
            if configtype in self.TYPES:
                logger.debug("Opening config for reading")
                with open(path, 'r') as f:
                    data = f.read()
                datadict = self.TYPES[configtype]().reverse(data)
                return self.load_data(datadict)
            else:
                raise ValueError("Unsupported config type")
        else:
            logger.warn("load_path couldn't find the path: %s" % path)
660616
def get(self, path, data=None, return_fields=None):
        
        return self.session.get(self._request_url(path, return_fields),
                                data=json.dumps(data),
                                auth=self.auth, verify=False)
356216
def read_bytes(self, path):
        """"""
        file = staticfiles_storage.open(path)
        content = file.read()
        file.close()
        return content
1037483
def GET(self, path):
        
        url = self._absolute_url(path)
        resp = requests.get(url, headers=self.headers, verify=self.verify_ssl)
        if resp.status_code != 200:
            raise MispTransportError('GET %s: returned status=%d', path, resp.status_code)
        return resp.content
1312768
def tar_files(self, path: Path) -> bytes:
        
        tarstream = BytesIO()
        tar = tarfile.TarFile(fileobj=tarstream, mode='w')
        tar.add(str(path), arcname="data", recursive=True)
        tar.close()
        return tarstream.getvalue()
580185
def contents(self, path):
        
        try:
            out, code, err = self.command_exec(['cat-file', '-p', self.ref_head+':'+path])
            if not code:
                return out.decode('utf-8')
        except Exception:
            pass

        return None
704952
def resource_string(self, path):
        
        opener = self.get_opener(path)
        filename = opener.get_filename
        try:
            size = os.path.getsize(filename)
            if size > 50 * 1024 * 1024:
                logger.warning(
                    'Reading large resource to memory: %s. Size: %s bytes',
                    filename, size)
        except Exception as exc:
            logger.debug('Unable to check resource size %s. %s', filename, exc)
        with opener(filename, 'r') as resource:
            content = resource.read()
        return content
808308
def _getpath(self, path):
        ""
        if is_blacklisted(path):
            raise JottaFuseError('Blacklisted file, refusing to retrieve it')

        return self.client.getObject(path)
1205384
def get_file_contents(self, path, ref=github.GithubObject.NotSet):
        
        assert isinstance(path, (str, unicode)), path
        assert ref is github.GithubObject.NotSet or isinstance(ref, (str, unicode)), ref
        url_parameters = dict()
        if ref is not github.GithubObject.NotSet:
            url_parameters["ref"] = ref
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.url + "/contents/" + urllib.quote(path),
            parameters=url_parameters
        )
        if isinstance(data, list):
            return [
                github.ContentFile.ContentFile(self._requester, headers, item, completed=False)
                for item in data
            ]
        return github.ContentFile.ContentFile(self._requester, headers, data, completed=True)
151452
def _get_reparse_data(path):
    '''
    
    '''
    # ensure paths are using the right slashes
    path = os.path.normpath(path)

    if not _is_reparse_point(path):
        return None

    fileHandle = None
    try:
        fileHandle = win32file.CreateFileW(
            path,
            0x80000000,  # GENERIC_READ
            1,  # share with other readers
            None,  # no inherit, default security descriptor
            3,  # OPEN_EXISTING
            0x00200000 | 0x02000000  # FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS
        )

        reparseData = win32file.DeviceIoControl(
            fileHandle,
            0x900a8,  # FSCTL_GET_REPARSE_POINT
            None,  # in buffer
            16384  # out buffer size (MAXIMUM_REPARSE_DATA_BUFFER_SIZE)
        )

    finally:
        if fileHandle:
            win32file.CloseHandle(fileHandle)

    return reparseData
646551
def stat(self, path):
        
        try:
            stat = self.exists(str(path))
        except (NoNodeError, NoAuthError):
            stat = None
        return stat
1080952
def GetFileEntryByPath(self, path):
    
    if path is None:
      return None

    file_entry_type, _ = self._paths.get(path, (None, None))
    if not file_entry_type:
      return None

    path_spec = fake_path_spec.FakePathSpec(location=path)
    return fake_file_entry.FakeFileEntry(
        self._resolver_context, self, path_spec,
        file_entry_type=file_entry_type)
639136
def get_version_details(path):
    

    with open(path, "r") as reader:
        lines = reader.readlines()
        data = {
            line.split(" = ")[0].replace("__", ""):
                line.split(" = ")[1].strip().replace("'", "")
            for line in lines
        }
        return data
391111
def read_text_from_file(path: str) -> str:
    
    with open(path) as text_file:
        content = text_file.read()

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