Fixture's category (the containing testing module name)

        **Examples**

        :module:   test_torment.test_unit.test_fixtures.fixture_a44bc6dda6654b1395a8c2cbd55d964d
        :category: fixtures
199106
def category(self) -> str:
        '''

        '''

        logger.debug('dir(self.__module__): %s', dir(self.__module__))

        return self.__module__.__name__.rsplit('.', 2)[-2].replace('test_', '')
569107
def get_module_name(module: types.ModuleType) -> str:
    
    try:
        return module.__spec__.name
    except AttributeError:
        return module.__name__
114254
def list_categories(self, package_keyname, **kwargs):
        
        get_kwargs = {}
        get_kwargs['mask'] = kwargs.get('mask', CATEGORY_MASK)

        if 'filter' in kwargs:
            get_kwargs['filter'] = kwargs['filter']

        package = self.get_package_by_key(package_keyname, mask='id')
        categories = self.package_svc.getConfiguration(id=package['id'], **get_kwargs)
        return categories
702751
def got_a(self, _type):
        
        if _type not in self.modules:
            raise ValueError("No such module, %s" % _type)
        return (_type in self.insts_implementing and
                self.insts_implementing[_type])
374633
def _GetParsersFromPresetCategory(cls, category):
    
    preset_definition = cls._presets.GetPresetByName(category)
    if preset_definition is None:
      return []

    preset_names = cls._presets.GetNames()
    parser_names = set()

    for element_name in preset_definition.parsers:
      if element_name in preset_names:
        category_parser_names = cls._GetParsersFromPresetCategory(element_name)
        parser_names.update(category_parser_names)
      else:
        parser_names.add(element_name)

    return sorted(parser_names)
689803
def category(self) -> Optional[str]:
        ''''''
        if self.statements:
            if self.statements[-1][0] == ':':
                # a hack. ... to avoid calling isValid recursively
                def validDirective():
                    if not self.values:
                        return True
                    if self.values[-1].strip().endswith(','):
                        return False
                    try:
                        compile(
                            'func(' + ''.join(self.values) + ')',
                            filename='<string>',
                            mode='eval')
                    except Exception:
                        return False
                    return True

                if validDirective() and self._action is not None:
                    return 'script'
                return 'directive'
            return 'statements'
        return None
1196391
def use_fixture(name)
      path = File.join spec_root, 'fixtures', name.to_s
      copy_fixture path, active_fixture_dir
      Dir.chdir active_fixture_dir
      nil
    end
799754
def fixtures_directory
      @fixtures_directory ||= begin
        candidates = config.fixtures_directories.map { |dir| File.join(root_directory, dir) }
        directory = candidates.find { |d| Aruba.platform.directory? d }

        fail "No existing fixtures directory found in #{candidates.map { |d| format('"%s"', d) }.join(', ')}." unless directory
        directory
      end

      fail %(Fixtures directory "#{@fixtures_directory}" is not a directory) unless Aruba.platform.directory?(@fixtures_directory)

      ArubaPath.new(@fixtures_directory)
    end
16307
def get_categories(self):
        
        sdb_resp = get_with_retry(self.cerberus_url + '/v1/category',
                                headers=self.HEADERS)

        throw_if_bad_response(sdb_resp)
        return sdb_resp.json()
1219855
def module(self, value):
        

        if value is not None:
            assert type(value) is type(sys), "'{0}' attribute: '{1}' type is not 'module'!".format("module", value)
        self.__module = value
519988
def parse_category
      cat =
        if self.class::CATEGORY_SUBSET == :top
          @init_data[:category]
        else
          @init_data[self.class::CATEGORY_SUBSET][:category]
        end

      if cat.is_a? String
        @category_name = cat
        @category_id = JSS::Category.category_id_from_name @category_name
      else
        @category_name = cat[:name]
        @category_id = cat[:id]
      end
      clean_raw_categories
    end
227557
def category(self, category):
        
        self.url.category = category
        self.url.set_page(1)
        return self
526765
def get_directory_modules(directory):
    
    if _local_modules and os.path.dirname(_local_modules[0][1]) == directory:
        return _local_modules

    if not os.path.isdir(directory):
        # example/import_test_project/A.py -> example/import_test_project
        directory = os.path.dirname(directory)

    if directory == '':
        return _local_modules

    for path in os.listdir(directory):
        if _is_python_file(path):
            # A.py -> A
            module_name = os.path.splitext(path)[0]
            _local_modules.append((module_name, os.path.join(directory, path)))

    return _local_modules
1158472
def get_module_toc(mod_name):
    ""
    mod = import_mod(mod_name)
    ft_names = mod.__all__ if hasattr(mod,'__all__') else get_ft_names(mod)
    ft_names.sort(key = str.lower)
    tabmat = ''
    for ft_name in ft_names:
        tabmat += f'- [{ft_name}](#{ft_name})\n'
        elt = getattr(mod, ft_name)
        if inspect.isclass(elt) and not is_enum(elt.__class__):
            in_ft_names = get_inner_fts(elt)
            for name in in_ft_names:
                tabmat += f'  - [{name}](#{name})\n'
    display(Markdown(tabmat))
612332
function addonsManager_setCategory(aSpec) {
    var spec = aSpec || { };
    var category = spec.category;
    var waitFor = (spec.waitFor == undefined) ? true : spec.waitFor;

    if (!category)
      throw new Error(arguments.callee.name + ": Category not specified.");

    this._controller.click(category);

    if (waitFor)
      this.waitForCategory({category: category});
  }
553678
def getAnalysisCategories(self):
        
        bsc = getToolByName(self, 'bika_setup_catalog')
        cats = bsc(portal_type='AnalysisCategory', is_active=True)
        items = [(o.UID, o.Title) for o in cats]
        o = self.getCategory()
        if o and o.UID() not in [i[0] for i in items]:
            items.append((o.UID(), o.Title()))
        items.sort(lambda x, y: cmp(x[1], y[1]))
        return DisplayList(list(items))
825022
def group_plugins_into_categories(plugins):
    
    if not plugins:
        return {}
    plugins = sorted(plugins, key=lambda p: p.verbose_name)
    categories = {}

    for plugin in plugins:
        title = str(plugin.category or u"")  # enforce resolving ugettext_lazy proxies.
        if title not in categories:
            categories[title] = []
        categories[title].append(plugin)

    return categories