Returns a dictionnary of {"fs_name": fs_class}, for each usable FileSystemProvider
493760
def get_filesystems_providers():
    
    providers = {"local": LocalFSProvider}
    plugged_providers = pkg_resources.iter_entry_points("inginious.filesystems")
    for pp in plugged_providers:
        providers[pp.name] = pp.load()
    return providers
1203202
def _getPFilename(self,native,prompt):
        
        return self.get(native=native,prompt=prompt)
779477
def filenames(self):
        
        fns = set()
        for fn2var in self._type2filename2variable.values():
            fns.update(fn2var.keys())
        return sorted(fns)
816123
def _initFilesystemInfo(self):
        """"""
        self._mapFSpathDev = {}
        fsinfo = FilesystemInfo()
        for fs in fsinfo.getFSlist():
            devpath = fsinfo.getFSdev(fs)
            dev = self._getUniqueDev(devpath)
            if dev is not None:
                self._mapFSpathDev[fs] = dev
831658
def name(cls, func):
        """""" 
        cls.count = cls.count + 1
        fpath = '{}_{}{}'.format(cls.count, func.__name__, cls.suffix)
        if cls.directory:
            fpath = os.path.join(cls.directory, fpath)
        return fpath
883123
def devices(self):
        ''
        return self.fs is not None and [JFSDevice(d, self, parentpath=self.rootpath) for d in self.fs.devices.iterchildren()] or [x for x in []]
1343270
def _get_py_dictionary(self, var, names=None, used___dict__=False):
        '''
        
        '''

        # TODO: Those should be options (would fix https://github.com/Microsoft/ptvsd/issues/66).
        filter_private = False
        filter_special = True
        filter_function = True
        filter_builtin = True

        if not names:
            names, used___dict__ = self.get_names(var)
        d = {}

        # Be aware that the order in which the filters are applied attempts to
        # optimize the operation by removing as many items as possible in the
        # first filters, leaving fewer items for later filters

        if filter_builtin or filter_function:
            for name in names:
                try:
                    name_as_str = name
                    if name_as_str.__class__ != str:
                        name_as_str = '%r' % (name_as_str,)

                    if filter_special:
                        if name_as_str.startswith('__') and name_as_str.endswith('__'):
                            continue

                    if filter_private:
                        if name_as_str.startswith('_') or name_as_str.endswith('__'):
                            continue
                    if not used___dict__:
                        attr = getattr(var, name)
                    else:
                        attr = var.__dict__[name]

                    # filter builtins?
                    if filter_builtin:
                        if inspect.isbuiltin(attr):
                            continue

                    # filter functions?
                    if filter_function:
                        if inspect.isroutine(attr) or isinstance(attr, MethodWrapperType):
                            continue
                except:
                    # if some error occurs getting it, let's put it to the user.
                    strIO = StringIO.StringIO()
                    traceback.print_exc(file=strIO)
                    attr = strIO.getvalue()

                d[name_as_str] = attr

        return d, used___dict__
789696
def IsHFS(self):
    
    tsk_fs_type = self.GetFsType()
    return tsk_fs_type in [
        pytsk3.TSK_FS_TYPE_HFS, pytsk3.TSK_FS_TYPE_HFS_DETECT]
692310
def get_open_fds():
    
    pid = os.getpid()
    procs = subprocess.check_output(["lsof", '-w', '-Ff', "-p", str(pid)])
    procs = procs.decode("utf-8")

    return len([s for s in procs.split('\n')
                if s and s[0] == 'f' and s[1:].isdigit()])
279970
def GrabFileSystem(self, path_spec):
    
    identifier = self._GetFileSystemCacheIdentifier(path_spec)
    self._file_system_cache.GrabObject(identifier)
235829
def storage_class(self):
        
        if not hasattr(self, '_storage_class'):
            self._storage_class = conf.lib.clang_Cursor_getStorageClass(self)

        return StorageClass.from_id(self._storage_class)
1372711
def _mkfs(root, fs_format, fs_opts=None):
    '''
    
    '''
    if fs_opts is None:
        fs_opts = {}

    if fs_format in ('ext2', 'ext3', 'ext4'):
        __salt__['extfs.mkfs'](root, fs_format, **fs_opts)
    elif fs_format in ('btrfs',):
        __salt__['btrfs.mkfs'](root, **fs_opts)
    elif fs_format in ('xfs',):
        __salt__['xfs.mkfs'](root, **fs_opts)
1044745
def ls(self):
        
        width = max([len(x) for x in self.namespace.keys()])
        for key, value in sorted(self.namespace.items()):
            if key == "_":
                continue
            info = ""
            if (isinstance(value, dict) or
                isinstance(value, list) or key == "services"):
                info = "data"
            elif type(value).__name__ == "module":
                info = value.__name__
            elif type(value).__name__ == "function":
                info = "%s.%s" % (value.__module__, value.__name__)
            elif type(value).__name__ == "instance":
                info = "%s.%s" % (value.__module__, value.__class__.__name__)
            else:
                info = "%s.%s.%s" % (
                    value.im_class.__module__, value.im_class.__name__, key)
            print "\t%s - %s" % (key.ljust(width), info)
1334249
def ParseFileSystemsStruct(struct_class, fs_count, data):
  """"""
  results = []
  cstr = lambda x: x.split(b"\x00", 1)[0]
  for count in range(0, fs_count):
    struct_size = struct_class.GetSize()
    s_data = data[count * struct_size:(count + 1) * struct_size]
    s = struct_class(s_data)
    s.f_fstypename = cstr(s.f_fstypename)
    s.f_mntonname = cstr(s.f_mntonname)
    s.f_mntfromname = cstr(s.f_mntfromname)
    results.append(s)
  return results
516558
def get_filename(cls):
        
        config_home = os.environ.get("XDG_CONFIG_HOME", "~/.config")
        config_home = os.path.expanduser(config_home)

        base_path = os.path.join(config_home, "PyPump")
        if not os.path.isdir(base_path):
            os.makedirs(base_path)

        return os.path.join(base_path, "credentials.json")
295558
def get_file_descriptor(self):
        
        return self._subscription.connection and self._subscription.connection._sock.fileno()
434628
def AsDict(self):
    
    source_type_attributes = {'paths': self.paths}
    if self.separator != '/':
      source_type_attributes['separator'] = self.separator

    return source_type_attributes