Expansion function for source map.
335638
@VisibleForTesting
  @GwtIncompatible("Unnecessary")
  String expandSourceMapPath(B options, JSModule forModule) {
    if (Strings.isNullOrEmpty(options.sourceMapOutputPath)) {
      return null;
    }
    return expandCommandLinePath(options.sourceMapOutputPath, forModule);
  }
1048164
function forEachExpansion(expansions, fn) {
    let impl = function(expansions) {
        expansions.forEach((expansion) => {
            fn(expansion);
            impl(expansion.expansions);
        });
    };

    impl(expansions);
}
839146
def map2x(func, *iterables):
    """"""
    zipped = zip_longest(*iterables)
    if func is None:
        return zipped
    return starmap(func, zipped)
313849
function contents(map, tight) {
    var minDepth = Infinity;
    var index = -1;
    var length = map.length;
    var table;

    /*
     * Find minimum depth.
     */

    while (++index < length) {
        if (map[index].depth < minDepth) {
            minDepth = map[index].depth;
        }
    }

    /*
     * Normalize depth.
     */

    index = -1;

    while (++index < length) {
        map[index].depth -= minDepth - 1;
    }

    /*
     * Construct the main list.
     */

    table = list();

    /*
     * Add TOC to list.
     */

    index = -1;

    while (++index < length) {
        insert(map[index], table, tight);
    }

    return table;
}
1027917
def _expand_vector(self,x):
        '''
        
        '''
        x = np.atleast_2d(x)
        x_expanded = np.zeros((x.shape[0],self.space.model_dimensionality))
        x_expanded[:,np.array(self.noncontext_index).astype(int)]  = x
        x_expanded[:,np.array(self.context_index).astype(int)]  = self.context_value
        return x_expanded
1194593
private static Map<String, Object> expandObject(Map<FieldPath, Object> data) {
    Map<String, Object> result = new HashMap<>();

    SortedSet<FieldPath> sortedFields = new TreeSet<>(data.keySet());

    FieldPath lastField = null;

    for (FieldPath field : sortedFields) {
      if (lastField != null && lastField.isPrefixOf(field)) {
        throw new IllegalArgumentException(
            String.format("Detected ambiguous definition for field '%s'.", lastField));
      }

      List<String> segments = field.getSegments();
      Object value = data.get(field);
      Map<String, Object> currentMap = result;

      for (int i = 0; i < segments.size(); ++i) {
        if (i == segments.size() - 1) {
          currentMap.put(segments.get(i), value);
        } else {
          if (!currentMap.containsKey(segments.get(i))) {
            currentMap.put(segments.get(i), new HashMap<>());
          }

          currentMap = (Map<String, Object>) currentMap.get(segments.get(i));
        }
      }

      lastField = field;
    }

    return result;
  }
119004
function baseMapArgs (fun, mapFun) {
    return _.arity(fun.length, function () {
      return fun.apply(this, __map.call(arguments, mapFun));
    });
  }
684863
def fit_apply(fit_result,vec_array):
    '''
    '''

    return map( lambda x,t1=fit_result[0],mt2=negate(fit_result[1]),
        m=fit_result[2]: add(t1,transform(m,add(mt2,x))),vec_array)
756095
def _expandDH(self, sampling, lmax, lmax_calc):
        """"""
        if self.normalization == '4pi':
            norm = 1
        elif self.normalization == 'schmidt':
            norm = 2
        elif self.normalization == 'unnorm':
            norm = 3
        elif self.normalization == 'ortho':
            norm = 4
        else:
            raise ValueError(
                "Normalization must be '4pi', 'ortho', 'schmidt', or " +
                "'unnorm'. Input value was {:s}"
                .format(repr(self.normalization)))

        data = _shtools.MakeGridDHC(self.coeffs, sampling=sampling,
                                    norm=norm, csphase=self.csphase, lmax=lmax,
                                    lmax_calc=lmax_calc)
        gridout = SHGrid.from_array(data, grid='DH', copy=False)
        return gridout
1374998
def map_over_glob(fn, path, pattern):
    """"""
    return [fn(x) for x in glob.glob(os.path.join(path, pattern))]
45083
def expand_array(data,
                 scans,
                 c_align,
                 c_exp,
                 scan_size=16,
                 tpz_size=16,
                 nties=200,
                 track_offset=0.5,
                 scan_offset=0.5):
    """"""
    nties = np.asscalar(nties)
    tpz_size = np.asscalar(tpz_size)
    s_scan, s_track = da.meshgrid(np.arange(nties * tpz_size),
                                  np.arange(scans * scan_size))
    s_track = (s_track.reshape(scans, scan_size, nties, tpz_size) % scan_size +
               track_offset) / scan_size
    s_scan = (s_scan.reshape(scans, scan_size, nties, tpz_size) % tpz_size +
              scan_offset) / tpz_size

    a_scan = s_scan + s_scan * (1 - s_scan) * c_exp + s_track * (
        1 - s_track) * c_align
    a_track = s_track

    data_a = data[:scans * 2:2, np.newaxis, :-1, np.newaxis]
    data_b = data[:scans * 2:2, np.newaxis, 1:, np.newaxis]
    data_c = data[1:scans * 2:2, np.newaxis, 1:, np.newaxis]
    data_d = data[1:scans * 2:2, np.newaxis, :-1, np.newaxis]

    fdata = ((1 - a_track) *
             ((1 - a_scan) * data_a + a_scan * data_b) + a_track * (
                 (1 - a_scan) * data_d + a_scan * data_c))
    return fdata.reshape(scans * scan_size, nties * tpz_size)
87851
function expand (base, sub) {
    var children = splitSelector(sub)
    return splitSelector(base).reduce(function (selectors, parent) {
      return selectors.concat(children.map(function (child) {
        return parent + ' ' + child
      }))
    }, []).join(', ')
  }
672929
function expandAliases(version, methods) {
    return _.flatMap(methods, method => expandAlias(version, method))
}
1077586
def expand(self, m):
        """"""

        if m is None:
            raise ValueError("Match is None!")

        sep = m.string[:0]
        if isinstance(sep, bytes) != self._bytes:
            raise TypeError('Match string type does not match expander string type!')
        text = []
        # Expand string
        for x in range(0, len(self.literals)):
            index = x
            l = self.literals[x]
            if l is None:
                g_index = self._get_group_index(index)
                span_case, single_case, capture = self._get_group_attributes(index)
                if not self.use_format:
                    # Non format replace
                    try:
                        l = m.group(g_index)
                    except IndexError:  # pragma: no cover
                        raise IndexError("'%d' is out of range!" % capture)
                else:
                    # String format replace
                    try:
                        obj = m.captures(g_index)
                    except IndexError:  # pragma: no cover
                        raise IndexError("'%d' is out of range!" % g_index)
                    l = _util.format_string(m, obj, capture, self._bytes)
                if span_case is not None:
                    if span_case == _LOWER:
                        l = l.lower()
                    else:
                        l = l.upper()
                if single_case is not None:
                    if single_case == _LOWER:
                        l = l[0:1].lower() + l[1:]
                    else:
                        l = l[0:1].upper() + l[1:]
            text.append(l)

        return sep.join(text)
425984
def map_plus(target: Callable, mi, ma, a, mk, k):
    """"""
    if a is None:
        a = []
    if k is None:
        k = {}

    if mi is None and ma is None and mk is None:
        return []
    elif mi is None and ma is None:
        return [target(*a, **mki, **k) for mki in mk]
    elif ma is None and mk is None:
        return [target(mii, *a, **k) for mii in mi]
    elif mk is None and mi is None:
        return [target(*mai, *a, **k) for mai in ma]
    elif mi is None:
        return [target(*mai, *a, **mki, **k) for mai, mki in zip(ma, mk)]
    elif ma is None:
        return [target(mii, *a, **mki, **k) for mii, mki in zip(mi, mk)]
    elif mk is None:
        return [target(mii, *mai, *a, **k) for mii, mai in zip(mi, ma)]
    else:
        return [target(mii, *mai, *a, **mki, **k) for mii, mai, mki in zip(mi, ma, mk)]
600318
function expand( v1, v2, pixels ) {

		var x = v2.x - v1.x, y = v2.y - v1.y,
		det = x * x + y * y, idet;

		if ( det === 0 ) return;

		idet = pixels / Math.sqrt( det );

		x *= idet; y *= idet;

		v2.x += x; v2.y += y;
		v1.x -= x; v1.y -= y;

	}
944672
function expand ( target, sources ) {
		sources = grunt.file.expand ( sources );
		return explode ( sources.map ( relpath ));
	}