Process a custom list types registered by plugins.
557513
protected function evalCustomListType($type, $record, $column, $value)
    {
        $plugins = PluginManager::instance()->getRegistrationMethodValues('registerListColumnTypes');

        foreach ($plugins as $availableTypes) {
            if (!isset($availableTypes[$type])) {
                continue;
            }

            $callback = $availableTypes[$type];

            if (is_callable($callback)) {
                return call_user_func_array($callback, [$value, $column, $record]);
            }
        }

        throw new ApplicationException(sprintf('List column type "%s" could not be found.', $type));
    }
1345887
def _match_type(self, i):
        """"""
        self.col_match = self.RE_TYPE.match(self._source[i])
        if self.col_match is not None:
            self.section = "types"
            self.el_type = CustomType
            self.el_name = self.col_match.group("name")
           
            return True
        else:
            return False
760936
def register_lists(self, category_lists, lists_init_kwargs=None, editor_init_kwargs=None):
        
        lists_init_kwargs = lists_init_kwargs or {}
        editor_init_kwargs = editor_init_kwargs or {}

        for lst in category_lists:
            if isinstance(lst, string_types):  # Spawn CategoryList object from base category alias.
                lst = self.list_cls(lst, **lists_init_kwargs)
            elif not isinstance(lst, CategoryList):
                raise SitecatsConfigurationError(
                    '`CategoryRequestHandler.register_lists()` accepts only '
                    '`CategoryList` objects or category aliases.'
                )

            if self._obj:
                lst.set_obj(self._obj)

            for name, val in lists_init_kwargs.items():  # Setting CategoryList attributes from kwargs.
                setattr(lst, name, val)

            lst.enable_editor(**editor_init_kwargs)

            self._lists[lst.get_id()] = lst
678082
function (type, name, callback) {
      if (type === 'modifier') {
        this.modifiers[name] = callback
      } else {
        this.plugins[name] = {'type': type, 'process': callback}
      }
    }
681478
def _type_container(self, value, _type):
        '  '
        if value is None:
            # normalize null containers to empty list
            return []
        elif not isinstance(value, list):
            raise ValueError("expected list type, got: %s" % type(value))
        else:
            return sorted(self._type_single(item, _type) for item in value)
612616
private static void addTypeToList(Type type, List<Type> typeList) {
        if (type instanceof ParameterizedType) {
            ParameterizedType parameterizedType = (ParameterizedType) type;
            addTypeToList(parameterizedType.getRawType(), typeList);
            for (Type actualTypeArgument : parameterizedType.getActualTypeArguments()) {
                addTypeToList(actualTypeArgument, typeList);
            }
        } else {
            typeList.add(type);
        }
    }
218065
def attr_category_postprocess(get_attr_category_func):
    """"""
    @functools.wraps(get_attr_category_func)
    def wrapped(
        name: str, attr: Any, obj: Any
    ) -> Tuple[AttrCategory, ...]:
        category = get_attr_category_func(name, attr, obj)
        category = list(category) if isinstance(category, tuple) else [category]
        if is_slotted_attr(obj, name):
            # Refactoring all tuples to lists is not easy
            # and pleasant. Maybe do this in future if necessary
            category.append(AttrCategory.SLOT)
        return tuple(category)

    return wrapped
401932
private function loadCustomTypes()
    {
        $customFields = (array) $this->getConfig('custom_fields');

        if (!empty($customFields)) {
            foreach ($customFields as $fieldName => $fieldClass) {
                $this->addCustomField($fieldName, $fieldClass);
            }
        }
    }
941693
def run_parser_plugins(self, url_data, pagetype):
        """"""
        run_plugins(self.parser_plugins, url_data, stop_after_match=True, pagetype=pagetype)
1191968
def change_type(self, func):
        """"""
        model = self.model()
        index_list = self.selectedIndexes()
        [model.setData(i, '', change_type=func) for i in index_list]
647278
protected function processExistingItems()
    {
        $loadedIndexes = $loadedGroups = [];
        $loadValue = $this->getLoadValue();

        // Ensure that the minimum number of items are preinitialized
        // ONLY DONE WHEN NOT IN GROUP MODE
        if (!$this->useGroups && $this->minItems > 0) {
            if (!is_array($loadValue)) {
                $loadValue = [];
                for ($i = 0; $i < $this->minItems; $i++) {
                    $loadValue[$i] = [];
                }
            } elseif (count($loadValue) < $this->minItems) {
                for ($i = 0; $i < ($this->minItems - count($loadValue)); $i++) {
                    $loadValue[] = [];
                }
            }
        }

        if (is_array($loadValue)) {
            foreach ($loadValue as $index => $loadedValue) {
                $loadedIndexes[] = $index;
                $loadedGroups[] = array_get($loadedValue, '_group');
            }
        }

        $itemIndexes = post($this->indexInputName, $loadedIndexes);
        $itemGroups = post($this->groupInputName, $loadedGroups);

        if (!count($itemIndexes)) {
            return;
        }

        $items = array_combine(
            (array) $itemIndexes,
            (array) ($this->useGroups ? $itemGroups : $itemIndexes)
        );

        foreach ($items as $itemIndex => $groupCode) {
            $this->makeItemFormWidget($itemIndex, $groupCode);
            $this->indexCount = max((int) $itemIndex, $this->indexCount);
        }
    }
379158
protected function process()
    {

        // initialize the array for the links
        $artefacts = array();

        // load the link type mappings
        $linkTypes = $this->getLinkTypeMappings();

        // prepare the links for the found link types and merge the found artefacts
        foreach ($linkTypes as $linkTypeCode => $columns) {
            $artefacts = array_merge($artefacts, $this->prepareArtefacts($linkTypeCode, $columns));
        }

        // append the links to the subject
        $this->addArtefacts($artefacts);
    }
818794
protected function loadPostTypes()
    {
        if ($config = $this->loadConfigFile('post_types.php')) {
            $callbacks = array();

            // Create one callback for each post type, and register in
            // init action

            foreach ($config as $postTypeName => $args) {
                $callbacks[] = $cb = function () use ($postTypeName, $args) {
                    register_post_type($postTypeName, $args);
                };

                add_action('init', $cb, 0);
            }

            // Flush URL caches for (you need to register custom post types
            // first)

            register_activation_hook($this->getPluginFile(), function () use ($callbacks) {
                foreach ($callbacks as $cb) {
                    $cb();
                }

                flush_rewrite_rules();
            });
        }

        return $this;
    }
210843
def _get_type_list(self, props):
        """"""
        type_list = []
        for k, v in list(props.items()):
            t = self._get_property_type(v)
            if t is not None:
                type_list.append(t)
        return sorted(type_list)
296725
function processItemtype(item, processedItems) {
  processedItems.push({
    'id':         md5($(item).html()),
    'name':       $(item).attr('itemtype'),
    'properties': {}
  });

}
1228541
def StripTypeInfo(rendered_data):
  """"""

  if isinstance(rendered_data, (list, tuple)):
    return [StripTypeInfo(d) for d in rendered_data]
  elif isinstance(rendered_data, dict):
    if "value" in rendered_data and "type" in rendered_data:
      return StripTypeInfo(rendered_data["value"])
    else:
      result = {}
      for k, v in iteritems(rendered_data):
        result[k] = StripTypeInfo(v)
      return result
  else:
    return rendered_data
767861
def process_result_value(self, value: Optional[str],
                             dialect: Dialect) -> List[int]:
        """"""
        retval = self._dbstr_to_intlist(value)
        return retval