Determine which converters to use based on this document's
 extension.

 Returns Array of Converter instances.
425939
def converters
      @converters ||= site.converters.select { |c| c.matches(document.extname) }.sort
    end
255540
public Converter getDefaultConverter() {
        if (getPm().getDefaultConverter() == null) {
            Converter c = new GenericConverter();
            Properties properties = new Properties();
            properties.put("filename", "converters/show.tostring.converter");
            c.setProperties(properties);
            return c;
        } else {
            return getPm().getDefaultConverter();
        }
    }
994806
private List<ParameterConverter> findConverters(Injector injector) {
        List<Binding<ParameterConverter>> bindingsByType = injector
                .findBindingsByType(new TypeLiteral<ParameterConverter>() {
                });
        if (bindingsByType.isEmpty() && injector.getParent() != null) {
            return findConverters(injector.getParent());
        }
        List<ParameterConverter> converters = new ArrayList<>();
        for (Binding<ParameterConverter> binding : bindingsByType) {
            converters.add(binding.getProvider().get());
        }
        return converters;
    }
513176
private Map < String, String > generateConverterClasses(
            String xmlSchemaSource, String targetPackageName) {

        log.debug("Converter support classes generation started");
        Map < String, String > codeMap = xsd2CobolTypes.generate(
                new StringReader(xmlSchemaSource), targetPackageName);
        if (log.isDebugEnabled()) {
            log.debug("Generated converter support classes: ");
            for (String code : codeMap.values()) {
                log.debug(code);
                log.debug("\n");
            }
        }
        log.debug("Converter support classes generation ended");
        return codeMap;
    }
1064633
public List<FacesConfigConverterType<WebFacesConfigDescriptor>> getAllConverter()
   {
      List<FacesConfigConverterType<WebFacesConfigDescriptor>> list = new ArrayList<FacesConfigConverterType<WebFacesConfigDescriptor>>();
      List<Node> nodeList = model.get("converter");
      for(Node node: nodeList)
      {
         FacesConfigConverterType<WebFacesConfigDescriptor>  type = new FacesConfigConverterTypeImpl<WebFacesConfigDescriptor>(this, "converter", model, node);
         list.add(type);
      }
      return list;
   }
669588
protected function loadConverters()
    {
        foreach ($this->projection as $name => $type) {
            if ($this->projection->isArray($name)) {
                $this->converters[$name] = $this
                    ->session
                    ->getClientUsingPooler('converter', 'array')
                    ->getConverter()
                    ;
            } else {
                $this->converters[$name] = $this
                    ->session
                    ->getClientUsingPooler('converter', $type)
                    ->getConverter()
                    ;
            }

            $this->field_types[$name] = $type;
        }

        return $this;
    }
1202568
public function getTypeConverters()
    {
        if (null === $this->typeConverters) {
            $this->typeConverters = new TypeConverter\TypeConverterCollection(
                array(
                    new TypeConverter\DateTimeTypeConverter(),
                    new TypeConverter\DateTypeConverter()
                )
            );
        }

        return $this->typeConverters;
    }
376304
def doc_children(self, doctype, limiters=[]):
        
        result = []
        for doc in self.docstring:
            if len(limiters) == 0 or doc.doctype in limiters:
                result.extend(doc.children(doctype))

        return result
545249
def read_source_models(fnames, converter, monitor):
    
    for fname in fnames:
        if fname.endswith(('.xml', '.nrml')):
            sm = to_python(fname, converter)
        elif fname.endswith('.hdf5'):
            sm = sourceconverter.to_python(fname, converter)
        else:
            raise ValueError('Unrecognized extension in %s' % fname)
        sm.fname = fname
        yield sm
73230
public function getMediaConversionNames(): array
    {
        $conversions = ConversionCollection::createForMedia($this);

        return $conversions->map(function (Conversion $conversion) {
            return $conversion->getName();
        })->toArray();
    }
789713
public final Method[] getStringConverterMethods() {
        if (mStringConverters == null) {
            String name = getRuntimeStringConverter();

            Vector<Method> methods = new Vector<Method>();

            if (name != null) {
                Method[] contextMethods = getRuntimeContextMethods();
                for (int i=0; i<contextMethods.length; i++) {
                    Method m = contextMethods[i];
                    if (m.getName().equals(name) &&
                            m.getReturnType() == String.class &&
                            m.getParameterTypes().length == 1) {

                        methods.addElement(m);
                    }
                }
            }

            int customSize = methods.size();

            Method[] stringMethods = String.class.getMethods();
            for (int i=0; i<stringMethods.length; i++) {
                Method m = stringMethods[i];
                if (m.getName().equals("valueOf") &&
                        m.getReturnType() == String.class &&
                        m.getParameterTypes().length == 1 &&
                        Modifier.isStatic(m.getModifiers())) {

                    // Don't add to list if a custom converter already handles
                    // this method's parameter type.
                    Class<?> type = m.getParameterTypes()[0];
                    int j;
                    for (j=0; j<customSize; j++) {
                        Method cm = methods.elementAt(j);
                        if (cm.getParameterTypes()[0] == type) {
                            break;
                        }
                    }

                    if (j == customSize) {
                        methods.addElement(m);
                    }
                }
            }

            mStringConverters = new Method[methods.size()];
            methods.copyInto(mStringConverters);
        }

        return mStringConverters.clone();
    }
45233
def find_needed_formatter(input_format, output_format):
    
    #Only take the formatters in the registry
    selected_registry = [re.cls for re in registry if re.category==RegistryCategories.formatters]
    needed_formatters = []
    for formatter in selected_registry:
        #Initialize the formatter (needed so it can discover its formats)
        formatter_inst = formatter()
        if input_format in formatter_inst.input_formats and output_format in formatter_inst.output_formats:
            needed_formatters.append(formatter)
    if len(needed_formatters)>0:
        return needed_formatters[0]
    return None
729294
public Converter getConverterForOperation(String operId) {
        if (getConverters() != null) {
            for (Converter converter : getConverters()) {
                if (check(converter, converter.getOperations(), operId)) {
                    return converter;
                }
            }
        }
        if (getExternalConverters() != null) {
            for (ExternalConverter ecs : getExternalConverters()) {
                final Converter c = PresentationManager.getPm().findExternalConverter(ecs.getId());
                if (c != null && check(c, (ecs.getOperations() == null) ? c.getOperations() : ecs.getOperations(), operId)) {
                    //TODO Add override of properties.
                    return c;
                }
            }
        }
        return null;
    }
410749
def converter_options(inputformat ="", outputformat = "")
      response = @conversion_connection.get "conversiontypes", {:inputformat => inputformat,:outputformat => outputformat }
      parse_response(response.body)
    end
980563
public static function get_enabled_plugins() {
        global $CFG;

        $order = (!empty($CFG->converter_plugins_sortorder)) ? explode(',', $CFG->converter_plugins_sortorder) : [];
        if ($order) {
            $plugins = \core_plugin_manager::instance()->get_installed_plugins('fileconverter');
            $order = array_intersect($order, array_keys($plugins));
        }

        return array_combine($order, $order);
    }
865193
def get_all_supported_exts_for_type(self, type_to_match: Type[Any], strict: bool) -> Set[str]:
        
        matching = self.find_all_matching_parsers(desired_type=type_to_match, strict=strict)[0]
        return {ext for exts in [p.supported_exts for p in (matching[0] + matching[1] + matching[2])]
                for ext in exts}
465678
def _refresh_converters(self):
        
        self._converters.clear()
        return reduce(lambda a, b: a and b, [self._add_converter(k) for k in list(self._xsltLibrary.keys())], True)