Returns if given path is readable.

    :param path: Path to check access.
    :type path: unicode
    :return: Is path writable.
    :rtype: bool
426866
def is_readable(path):
    

    if os.access(path, os.R_OK):
        LOGGER.debug("> '{0}' path is readable.".format(path))
        return True
    else:
        LOGGER.debug("> '{0}' path is not readable.".format(path))
        return False
901008
def is_writable(filename):
    
    if not os.path.exists(filename):
        parentdir = os.path.dirname(filename)
        return os.path.isdir(parentdir) and os.access(parentdir, os.W_OK)
    return os.path.isfile(filename) and os.access(filename, os.W_OK)
1123460
def read(self, path, encoding=None):
        
        b = common.read(path)

        if encoding is None:
            encoding = self.file_encoding

        return self.unicode(b, encoding)
805279
def _get_path(path):
    

    if isinstance(path, (six.string_types, bytes)):
        return path
    path_type = type(path)
    try:
        path_repr = path_type.__fspath__(path)
    except AttributeError:
        return
    if isinstance(path_repr, (six.string_types, bytes)):
        return path_repr
    return
634416
def is_readable_dir(path):
  """"""
  return os.path.isdir(path) and os.access(path, os.R_OK) and os.access(path, os.X_OK)
317779
def _checkpath(self, path):
        
        if path.startswith("/") or ".." in path or path.strip() != path:
            raise NotFoundException()
215593
def read_file(*path):
    
    with open(os.path.join(*path)) as f:
        return f.read().strip()
1105802
private boolean isReadOnly(Session session, String path)
   {
      try
      {
         session.checkPermission(path, PermissionType.SET_PROPERTY);
         return false;
      }
      catch (AccessControlException e)
      {
         return true;
      }
      catch (RepositoryException e)
      {
         return false;
      }
   }
882297
public static function isWritable($path)
    {
        // recursively return a temporary file path
        if ($path{strlen($path) - 1} == '/') {
            return self::isWritable($path . uniqid(mt_rand()) . '.tmp');
        } elseif (is_dir($path)) {
            return self::isWritable($path . '/' . uniqid(mt_rand()) . '.tmp');
        }

        // check file for read/write capabilities
        $rm = file_exists($path);
        $handle = @fopen($path, 'a');

        if ($handle === false) {
            return false;
        }

        fclose($handle);

        if (!$rm) {
            unlink($path);
        }

        return true;
    }
1197590
def is_valid_path(path):
    
    if not path.startswith('/'):
        msg = 'Invalid path "%s". Paths need to start with "/".'
        raise ValueError(msg % path[:40])

    for c in ' \t':
        if c in path:
            msg = ('Invalid character "%s" found in path. Paths need to be'
                   ' URL-encoded.')
            raise ValueError(msg % c)

    return True
154921
def is_readable(fpath):
    
    return os.path.isfile(fpath) and os.access(fpath, os.R_OK)
179859
function writable(file) {
  if (!exists(file)) {
    return writable(path.dirname(file));
  } else {
    try {
      fs.accessSync(file, fs.W_OK);
    } catch (e) {
      return false;
    }
    return true;
  }
}
674350
def is_enabled_path(path):
    
    for enabled_path in ENABLED_PATHS:
        match = re.search(enabled_path, path[1:])
        if match:
            return True
    return False
849902
def _path_has_ok_chars(path):
    
    basename = os.path.basename(path)
    if any([bad_char in basename for bad_char in INVALID_PATH_CHARS]):
            raise argparse.ArgumentTypeError("{} contains invalid characters for a directory.".format(path))
    return path
1028383
protected function isFilesystemWritable(/*# string */ $path)/*# : bool */
    {
        if ($this->getFilesystem()->isWritable()) {
            return true;
        } else {
            return $this->setError(
                Message::get(Message::STR_FS_NONWRITABLE, $path),
                Message::STR_FS_NONWRITABLE
            );
        }
    }
24926
def read_from_file(self, path):
        
        if not os.path.exists(path):
            slog.warning("The file %s is not exist.", path)
            return False
        txt = read_file(path)
        dic = eval(txt)
        self.copy_from_dict(dic)
        return True
868676
def is_prefix(cls, path):
        
        lagofile = paths.Paths(path).prefix_lagofile()
        return os.path.isfile(lagofile)