Returns an expander for DSLs (only if there is a DSL configured for this
package).
973388
public DefaultExpander getDslExpander() {
        DefaultExpander expander = new DefaultExpander();
        if (this.dslFiles == null || this.dslFiles.isEmpty()) {
            return null;
        }
        for (DSLMappingFile file : this.dslFiles) {
            expander.addDSLMapping(file.getMapping());
        }
        return expander;
    }
1338239
def expand_defaults(self, client=False, getenv=True, getshell=True):
        
        if not isinstance(self._default, six.string_types):
            self.expanded_default = self._default
        else:
            self.expanded_default = coerce(self.type, expand_defaults(
                self._default, client, getenv, getshell))
73071
private FedoraBinary getBinaryImplementation(final String extUrl) {
        String url = extUrl;
        if (url == null || url.isEmpty()) {
            url = getURLInfo();
        }

        if (url != null) {
            if (url.toLowerCase().startsWith(LOCAL_FILE_ACCESS_TYPE)) {
                return new LocalFileBinary(getNode());
            } else if (url.toLowerCase().startsWith(URL_ACCESS_TYPE)) {
                return new UrlBinary(getNode());
            }
        }

        return new InternalFedoraBinary(getNode());
    }
971220
def _expand_sources(sources):
    '''
    
    '''
    if sources is None:
        return []
    if isinstance(sources, six.string_types):
        sources = [x.strip() for x in sources.split(',')]
    elif isinstance(sources, (float, six.integer_types)):
        sources = [six.text_type(sources)]
    return [path
            for source in sources
            for path in _glob(source)]
417904
private List<GroovyExpression> expandOrs(GroovyExpression expr, OptimizationContext context) {

        if (GremlinQueryOptimizer.isOrExpression(expr)) {
            return expandOrFunction(expr, context);
        }
        return processOtherExpression(expr, context);
    }
687064
def expand(self):
        
        return SLH(self.S.expand(), self.L.expand(), self.H.expand())
281247
public boolean hasExtension(String namespace) {
        synchronized (packetExtensions) {
            for (ExtensionElement packetExtension : packetExtensions.values()) {
                if (packetExtension.getNamespace().equals(namespace)) {
                    return true;
                }
            }
        }
        return false;
    }
205334
def _expand(self, coeffsin, nmax):
        
        falpha = _shtools.SlepianCoeffs(self.tapers, coeffsin, nmax)

        return SlepianCoeffs(falpha, self)
453081
def expand_query(config, kwds):
    
    pattern = []
    for query in kwds.pop('pattern', []):
        expansion = config.search.alias.get(query)
        if expansion is None:
            pattern.append(query)
        else:
            parser = SafeArgumentParser()
            search_add_arguments(parser)
            ns = parser.parse_args(expansion)
            for (key, value) in vars(ns).items():
                if isinstance(value, (list, tuple)):
                    if not kwds.get(key):
                        kwds[key] = value
                    else:
                        kwds[key].extend(value)
                else:
                    kwds[key] = value
    kwds['pattern'] = pattern
    return config.search.kwds_adapter(kwds)
209734
def custom_expand(val, conf)
      val.gsub!(/\$\(([^()]+)\)/) do |var|
        key = $1
        if CONFIG.key? key
          custom_expand(conf[key], conf)
        else
          var
        end
      end
      val
    end
119354
private ExtensionLicense getExtensionLicense(License license)
    {
        if (license.getName() == null) {
            return new ExtensionLicense("noname", null);
        }

        return createLicenseByName(license.getName());
    }
1332977
def _expand_host(self, host):
        
        if isinstance(host, basestring):
            return (host, self.default_port)
        return tuple(host)
265848
def _get_pkg_ds_avail():
    '''
    
    '''
    avail = "/var/lib/dpkg/available"
    if not salt.utils.path.which('dselect') or not os.path.exists(avail):
        return dict()

    # Do not update with dselect, just read what is.
    ret = dict()
    pkg_mrk = "Package:"
    pkg_name = "package"
    with salt.utils.files.fopen(avail) as fp_:
        for pkg_info in salt.utils.stringutils.to_unicode(fp_.read()).split(pkg_mrk):
            nfo = dict()
            for line in (pkg_mrk + pkg_info).split(os.linesep):
                line = line.split(": ", 1)
                if len(line) != 2:
                    continue
                key, value = line
                if value.strip():
                    nfo[key.lower()] = value
            if nfo.get(pkg_name):
                ret[nfo[pkg_name]] = nfo

    return ret
283094
private StringBuffer expandConstructions(final String drl) {
        // display keys if requested
        if ( showKeyword ) {
            for ( DSLMappingEntry entry : this.keywords ) {
                logger.info( "keyword: " + entry.getMappingKey() );
                logger.info( "         " + entry.getKeyPattern() );
            }
        }
        if ( showWhen ) {
            for ( DSLMappingEntry entry : this.condition ) {
                logger.info( "when: " + entry.getMappingKey() );
                logger.info( "      " + entry.getKeyPattern() );
                //                logger.info( "      " + entry.getValuePattern() );
            }
        }
        if ( showThen ) {
            for ( DSLMappingEntry entry : this.consequence ) {
                logger.info( "then: " + entry.getMappingKey() );
                logger.info( "      " + entry.getKeyPattern() );
            }
        }

        // parse and expand specific areas
        final Matcher m = finder.matcher( drl );
        final StringBuffer buf = new StringBuffer();
        int drlPos = 0;
        int linecount = 0;
        while ( m.find() ) {
            final StringBuilder expanded = new StringBuilder();

            int newPos = m.start();
            linecount += countNewlines( drl,
                                        drlPos,
                                        newPos );
            drlPos = newPos;

            String constr = m.group().trim();
            if ( constr.startsWith( "rule" ) ) {
                String headerFragment = m.group( 1 );
                expanded.append( headerFragment ); // adding rule header and attributes
                String lhsFragment = m.group( 2 );
                expanded.append( this.expandLHS( lhsFragment,
                                                 linecount + countNewlines( drl,
                                                                            drlPos,
                                                                            m.start( 2 ) ) + 1 ) );
                String thenFragment = m.group( 3 );
                expanded.append( thenFragment ); // adding "then" header
                String rhsFragment = this.expandRHS( m.group( 4 ),
                                                     linecount + countNewlines( drl,
                                                                                drlPos,
                                                                                m.start( 4 ) ) + 1 );
                expanded.append( rhsFragment );
                expanded.append( m.group( 5 ) ); // adding rule trailer

            } else if ( constr.startsWith( "query" ) ) {
                String fragment = m.group( 6 );
                expanded.append( fragment ); // adding query header and attributes
                String lhsFragment = this.expandLHS( m.group( 7 ),
                                                     linecount + countNewlines( drl,
                                                                                drlPos,
                                                                                m.start( 7 ) ) + 1 );
                expanded.append( lhsFragment );
                expanded.append( m.group( 8 ) ); // adding query trailer

            } else {
                // strange behavior
                this.addError( new ExpanderException( "Unable to expand statement: " + constr,
                                                      0 ) );
            }
            m.appendReplacement( buf,
                                 Matcher.quoteReplacement( expanded.toString() ) );
        }
        m.appendTail( buf );
        return buf;
    }
1179459
public PackageDescr parse(boolean isEditor,
                              final String source,
                              final Reader dsl) throws DroolsParserException {
        DefaultExpanderResolver resolver = getDefaultResolver(dsl);

        final Expander expander = resolver.get( "*", null );
        final String expanded = expander.expand( source );
        if ( expander.hasErrors() ) {
            this.results.addAll( expander.getErrors() );
        }
        return this.parse(isEditor, expanded);
    }
317196
def rule_expand(component, text):
    ''''''
    global rline_mpstate
    if component[0] == '<' and component[-1] == '>':
        return component[1:-1].split('|')
    if component in rline_mpstate.completion_functions:
        return rline_mpstate.completion_functions[component](text)
    return [component]
113371
def _fusion_range_to_dsl(tokens) -> FusionRangeBase:
    
    if FUSION_MISSING in tokens:
        return missing_fusion_range()

    return fusion_range(
        reference=tokens[FUSION_REFERENCE],
        start=tokens[FUSION_START],
        stop=tokens[FUSION_STOP]
    )