Merge information from another NumberFormat object into this one.
327110
def merge_from(self, other):
        """"""
        if other.pattern is not None:
            self.pattern = other.pattern
        if other.format is not None:
            self.format = other.format
        self.leading_digits_pattern.extend(other.leading_digits_pattern)
        if other.national_prefix_formatting_rule is not None:
            self.national_prefix_formatting_rule = other.national_prefix_formatting_rule
        if other.national_prefix_optional_when_formatting is not None:
            self.national_prefix_optional_when_formatting = other.national_prefix_optional_when_formatting
        if other.domestic_carrier_code_formatting_rule is not None:
            self.domestic_carrier_code_formatting_rule = other.domestic_carrier_code_formatting_rule
250385
def merge(self, other):
        """"""
        log.debug('Merging: %s and %s' % (self.serialize(), other.serialize()))
        for k in self.keys():
            for new_item in other[k]:
                if new_item not in self[k]:
                    self[k].append(new_item)
        log.debug('Result: %s' % self.serialize())
        return self
1361882
def _stringify_number(v):
    '''
    
    '''
    if isinstance(v, (float, Decimal)):
        if math.isinf(v) and v > 0:
            v = 'Infinity'
        elif math.isinf(v) and v < 0:
            v = '-Infinity'
        else:
            v = '{:f}'.format(v)
    elif isinstance(v, BinarySize):
        v = '{:d}'.format(int(v))
    elif isinstance(v, int):
        v = '{:d}'.format(v)
    else:
        v = str(v)
    return v
390153
def merge(data,skip=50,fraction=1.0):
    """"""

    w,s,d = data.chains.shape
    
    start = int((1.0 - fraction) * s)
    total = int((s - start) / skip)
        
    return data.chains[:,start::skip,:].reshape((w*total,d))
838098
public LCMSDataSubset merge(LCMSDataSubset other) {
    LCMSDataSubset merged = new LCMSDataSubset();

    Set<Integer> msLvlsThis = getMsLvls();
    Set<Integer> msLvlsThat = other.getMsLvls();
    // only merge if both are not null, otherwise null signifies the whole
    // run, so we can keep it null in the merged version
    if (msLvlsThis != null && msLvlsThat != null) {
      HashSet<Integer> mergedMsLvls = new HashSet<>(msLvlsThis);
      mergedMsLvls.addAll(msLvlsThat);
      merged.setMsLvls(mergedMsLvls);
    }

    // merge mz ranges
    List<DoubleRange> mzRangesThis = getMzRanges();
    List<DoubleRange> mzRangesThat = other.getMzRanges();
    if (mzRangesThis != null && mzRangesThat != null) {
      ArrayList<DoubleRange> mergedMzRanges = new ArrayList<>(mzRangesThis);
      mergedMzRanges.addAll(mzRangesThat);
      merged.setMzRanges(mergedMzRanges);
    }

    // compare scan number ranges
    Integer scanNumLoThis = getScanNumLo();
    Integer scanNumLoThat = other.getScanNumLo();
    if (scanNumLoThis != null && scanNumLoThat != null) {
      merged.setScanNumLo(Math.min(scanNumLoThis, scanNumLoThat));
    }
    Integer scanNumHiThis = getScanNumHi();
    Integer scanNumHiThat = other.getScanNumHi();
    if (scanNumHiThis != null && scanNumHiThat != null) {
      merged.setScanNumHi(Math.max(scanNumHiThis, scanNumHiThat));
    }

    return merged;
  }
810776
def combine(self, pattern, variable):
        """"""
        inter_zip = izip_longest(variable, pattern, fillvalue='')
        interleaved = [elt for pair in inter_zip for elt in pair]
        return ''.join(interleaved)
1141007
def merge_INIConf(a, b):
    
    for sname in b.sections():
        if a.has_section(sname):
            for oname in b.options(sname):
                a[sname][oname] = b[sname][oname]
        else:
            a[sname] = b[sname]
    return a
295231
def merge(s, t):
    """"""

    for k, v in t.items():
        if isinstance(v, dict):
            if k not in s:
                s[k] = v
                continue

            s[k] = merge(s[k], v)
            continue

        s[k] = v

    return s
287226
def _format_numer(number_format, prefix='', suffix=''):
    """"""
    @_surpress_formatting_errors
    def inner(v):
        if isinstance(v, Number):
            return ("{{}}{{:{}}}{{}}"
                    .format(number_format)
                    .format(prefix, v, suffix))
        else:
            raise TypeError("Numberic type required.")
    return inner
1118593
def add_numbers():
    """"""
    a = request.params.get('a', 0, type=int)
    b = request.params.get('b', 0, type=int)
    return json.dumps({'result': a+b})
1032926
def union(self, other, ignore_conflicts=False):
        """"""
        result = self.copy()
        result.union_update(other, ignore_conflicts)
        return result
478727
def add(self, *number):
        """"""
        return self._format_result(sum(
            # positional arguments are always strings
            [int(n) for n in number]))
758721
def _combine_ngrams(ngrams, joiner) -> str:
        """"""
        if isinstance(ngrams, str):
            return ngrams
        else:
            combined = joiner.join(ngrams)
            return combined
576937
def add2format_coord(self, x, y):
        """"""
        u, v = self.data
        uname, vname = self.data.coords['variable'].values
        xcoord = self.xcoord
        ycoord = self.ycoord
        if self.decoder.is_triangular(self.raw_data[0]):
            x, y, z1, z2 = self.get_xyz_tri(xcoord, x, ycoord, y, u, v)
        elif xcoord.ndim == 1:
            x, y, z1, z2 = self.get_xyz_1d(xcoord, x, ycoord, y, u, v)
        elif xcoord.ndim == 2:
            x, y, z1, z2 = self.get_xyz_2d(xcoord, x, ycoord, y, u, v)
        speed = (z1**2 + z2**2)**0.5
        xunit = xcoord.attrs.get('units', '')
        if xunit:
            xunit = ' ' + xunit
        yunit = ycoord.attrs.get('units', '')
        if yunit:
            yunit = ' ' + yunit
        zunit = u.attrs.get('units', '')
        if zunit:
            zunit = ' ' + zunit
        return (', vector data: %s: %.4g%s, %s: %.4g%s, %s: %.4g%s, '
                '%s: %.4g%s, absolute: %.4g%s') % (
                    xcoord.name, x, xunit, ycoord.name, y, yunit,
                    uname, z1, zunit, vname, z2, zunit,
                    speed, zunit)
1262575
def combine_data(self, command2):
        """"""
        if command2 is None:
            return
        self._data = self._merge(command2._data, self._data)
13518
public void combine(IntSummaryStatistics other) {
        count += other.count;
        sum += other.sum;
        min = Math.min(min, other.min);
        max = Math.max(max, other.max);
    }
1000507
def merge (dst, src):
        """"""
        for key in src.keys():
                if key not in dst:
                        dst[key] = src[key]