Combines existing media query with 2x media query.
541605
function combineMediaQuery(base, additional) {
  var finalQuery = [];
  base.forEach(function(b) {
    additional.forEach(function(a) {
      finalQuery.push(b + ' and ' + a);
    });
  });
  return finalQuery.join(', ');
}
634559
function (media) {
            // screen and (min-width: 400px), screen and (max-width: 500px)
            var mql         = (media.indexOf(',') !== -1 && media.split(',')) || [media],
                mqIndex     = mql.length - 1,
                mqLength    = mqIndex,
                mq          = null,

                // not screen, screen
                negateType      = null,
                negateTypeFound = '',
                negateTypeIndex = 0,
                negate          = false,
                type            = '',

                // (min-width: 400px), (min-width)
                exprListStr = '',
                exprList    = null,
                exprIndex   = 0,
                exprLength  = 0,
                expr        = null,

                prefix      = '',
                length      = '',
                unit        = '',
                value       = '',
                feature     = '',

                match       = false;

            if (media === '') {
                return true;
            }

            do {
                mq          = mql[mqLength - mqIndex];
                negate      = false;
                negateType  = mq.match(_typeExpr);

                if (negateType) {
                    negateTypeFound = negateType[0];
                    negateTypeIndex = negateType.index;
                }

                if (!negateType || ((mq.substring(0, negateTypeIndex).indexOf('(') === -1) && (negateTypeIndex || (!negateType[3] && negateTypeFound !== negateType.input)))) {
                    match = false;
                    continue;
                }

                exprListStr = mq;

                negate = negateType[1] === 'not';

                if (!negateTypeIndex) {
                    type        =  negateType[2];
                    exprListStr = mq.substring(negateTypeFound.length);
                }

                // Test media type
                // Test type against this device or if 'all' or empty ''
                match       = type === _type || type === 'all' || type === '';

                exprList    = (exprListStr.indexOf(' and ') !== -1 && exprListStr.split(' and ')) || [exprListStr];
                exprIndex   = exprList.length - 1;
                exprLength  = exprIndex;

                if (match && exprIndex >= 0 && exprListStr !== '') {
                    do {
                        expr = exprList[exprIndex].match(_mediaExpr);

                        if (!expr || !_features[expr[3]]) {
                            match = false;
                            break;
                        }

                        prefix  = expr[2];
                        length  = expr[5];
                        value   = length;
                        unit    = expr[7];
                        feature = _features[expr[3]];

                        // Convert unit types
                        if (unit) {
                            if (unit === 'px') {
                                // If unit is px
                                value = Number(length);
                            } else if (unit === 'em' || unit === 'rem') {
                                // Convert relative length unit to pixels
                                // Assumed base font size is 16px
                                value = 16 * length;
                            } else if (expr[8]) {
                                // Convert aspect ratio to decimal
                                value = (length / expr[8]).toFixed(2);
                            } else if (unit === 'dppx') {
                                // Convert resolution dppx unit to pixels
                                value = length * 96;
                            } else if (unit === 'dpcm') {
                                // Convert resolution dpcm unit to pixels
                                value = length * 0.3937;
                            } else {
                                // default
                                value = Number(length);
                            }
                        }

                        // Test for prefix min or max
                        // Test value against feature
                        if (prefix === 'min-' && value) {
                            match = feature >= value;
                        } else if (prefix === 'max-' && value) {
                            match = feature <= value;
                        } else if (value) {
                            match = feature === value;
                        } else {
                            match = !!feature;
                        }

                        // If 'match' is false, break loop
                        // Continue main loop through query list
                        if (!match) {
                            break;
                        }
                    } while (exprIndex--);
                }

                // If match is true, break loop
                // Once matched, no need to check other queries
                if (match) {
                    break;
                }
            } while (mqIndex--);

            return negate ? !match : match;
        }
49060
def location_media(location_id, request_parameters: {limit: 1000}, limit: 10)
      location = extract_location_media(location_id, request_parameters: request_parameters)
      # check if we should get more data
      paging_info = location.paging_info
      # poll more data
      while location.total_media_count < limit && paging_info[:has_next_page] do
        request_opts = {}.merge(request_parameters)
        if paging_info && paging_info[:end_cursor]
          request_opts[:max_id] = paging_info[:end_cursor]
        end
        next_page_location = extract_location_media(location_id, request_parameters: request_opts)
        location.add_media(next_page_location.media)
        paging_info = next_page_location.paging_info
        location
      end
      location
    end
513781
def _continued_query(self, query_params, key="pages"):
        
        query_params.update(self.__title_query_param())

        last_cont = dict()
        prop = query_params.get("prop")

        while True:
            params = query_params.copy()
            params.update(last_cont)

            request = self.mediawiki.wiki_request(params)

            if "query" not in request:
                break

            pages = request["query"][key]
            if "generator" in query_params:
                for datum in pages.values():
                    yield datum
            elif isinstance(pages, list):
                for datum in list(enumerate(pages)):
                    yield datum[1]
            else:
                for datum in pages[self.pageid].get(prop, list()):
                    yield datum

            if "continue" not in request or request["continue"] == last_cont:
                break

            last_cont = request["continue"]
409014
function combineStatsAndIndexes(done, results) {
  var indexes = results.getIndexes;
  var stats = results.getIndexStats;
  var sizes = results.getIndexSizes;
  _.each(indexes, function(idx, i) {
    _.assign(indexes[i], stats[idx.name]);
    _.assign(indexes[i], sizes[idx.name]);
  });
  done(null, indexes);
}
25563
private QueryResultImpl combineResults(QueryResultImpl a, QueryResultImpl b, boolean distinct) {
        QueryResultImpl result = new QueryResultImpl(a.getQuery());

        for (QueryBindingImpl bindingA : a.getBindings()) {
            for (QueryBindingImpl bindingB : b.getBindings()) {
                QueryBindingImpl binding = new QueryBindingImpl();
                binding.set(bindingA);
                binding.set(bindingB);
                result.add(binding);
            }
        }

        if (distinct) {
            return eliminateDuplicates(result);
        }
        return result;
    }
778726
def load_media(self, max_pages=150):
        
        logger.info("loading media")

        # clear them all out so we don't get dupes
        if self.purge_first:
            logger.warning("purging ALL media from site %s", self.site_id)
            Media.objects.filter(site_id=self.site_id).delete()

        path = "sites/{}/media".format(self.site_id)
        params = {"number": 100}
        self.set_media_params_after(params)
        page = 1

        response = self.get(path, params)

        if not response.ok:
            logger.warning("Response NOT OK! status_code=%s\n%s", response.status_code, response.text)

        while response.ok and response.text and page < max_pages:
            logger.info(" - page: %d", page)

            api_medias = response.json().get("media")
            if not api_medias:
                # we're done here
                break

            medias = []
            for api_media in api_medias:

                # exclude media items that are not attached to posts (for now)
                if api_media["post_ID"] != 0:

                    # if it exists locally, update local version if anything has changed
                    existing_media = Media.objects.filter(site_id=self.site_id, wp_id=api_media["ID"]).first()
                    if existing_media:
                        self.update_existing_media(existing_media, api_media)
                    else:
                        medias.append(self.get_new_media(api_media))

            if medias:
                Media.objects.bulk_create(medias)

            # get next page
            page += 1
            params["page"] = page
            response = self.get(path, params)

            if not response.ok:
                logger.warning("Response NOT OK! status_code=%s\n%s", response.status_code, response.text)
                return
1178125
public void combine(Vector new_filters, int op) throws DBException
    {
        // If this is not a logical operator, throw an exception
        if ((op & LOGICAL_OPER_MASK) == 0)
        {
            throw new DBException();
            // Create a new vector consisting of just the filters
            // from the SearchFilter classes in new_filters
        }
        Vector filters = new Vector();
        // Now add in all the nodes of the new filters
        for (Enumeration e = new_filters.elements(); e.hasMoreElements();)
        {
            // Get the search filter from the vector
            SearchFilter f = (SearchFilter) e.nextElement();
            filters.addElement(f.getFilter());
        }
        // Create a node for this list and return it
        m_filter = new SearchBaseNode(op, m_filter, filters);
    }
972024
public void combine(SearchFilter new_filter, int op) throws DBException
    {

        // cast down to OJBSearchFilter
        OJBSearchFilter ojbFilter = (OJBSearchFilter) new_filter;

        switch (op)
        {

            case OR:
                {
                    criteria.addOrCriteria(ojbFilter.getCriteria());
                    break;
                }

            case AND:
                {
                    criteria.addAndCriteria(ojbFilter.getCriteria());
                    break;
                }

            default:
                {
                    throw new DBException();
                }
        }
    }
243367
function(){
                /*
                 * media_query_list
                 *   : S* [media_query [ ',' S* media_query ]* ]?
                 *   ;
                 */
                var tokenStream = this._tokenStream,
                    mediaList   = [];

                this._readWhitespace();
                if (tokenStream.peek() === Tokens.IDENT || tokenStream.peek() === Tokens.LPAREN){
                    mediaList.push(this._media_query());
                }

                while(tokenStream.match(Tokens.COMMA)){
                    this._readWhitespace();
                    mediaList.push(this._media_query());
                }
                return mediaList;
            }
942968
function(media) {
      if (options.use_external) {
        media.forEach(function(item) {
          strMediaStyles += processMedia(item);
        });
      } else {
        media.forEach(function(item) {
          strStyles += processMedia(item);
        });
      }

    }
530079
public void combine(@NonNull EnhancedDoubleStatistics other) {
      count += other.count;
      sum += other.sum;
      sumOfSq += other.sumOfSq;
      min = Math.min(min, other.min);
      max = Math.max(max, other.max);
   }
297319
private void loadMultimediaFile(URL mediaFileURL)
	{
    	try
    	{
    		if (mediaFileURL!=null)
    		{
    			MultimediaContainer newContainer = MultimediaContainerManager.getMultimediaContainer(mediaFileURL);
    			if (newContainer!=null) currentContainer = newContainer;
    		}
    	}
    	catch (Throwable ex)
    	{
			Log.error("[MainForm::loadMultimediaFile] Loading of " + mediaFileURL + " failed!", ex);
			currentContainer = null;
    	}
    	finally
    	{
			// if we are currently playing, start the current piece:
			if (playerThread!=null) doStartPlaying();
    	}
	}
850303
public void combine(WSStatistic otherStat) {
        if (!validate(otherStat))
            return;

        DoubleStatisticImpl other = (DoubleStatisticImpl) otherStat;
        count += other.count;
        //TODO: how to update lastSampleTime???
        //if (other.lastSampleTime > lastSampleTime)
        //  lastSampleTime = other.lastSampleTime;
    }
86407
def _mp_embeds_into(mp1, mp2):
    """"""
    sc_matches = []
    if mp1.monomer.name != mp2.monomer.name:
        return False
    # Check that all conditions in mp2 are met in mp1
    for site_name, site_state in mp2.site_conditions.items():
        if site_name not in mp1.site_conditions or \
           site_state != mp1.site_conditions[site_name]:
            return False
    return True
509792
def media(self):
        
        media_list = []
        media_list.append(super(SuperFormMixin, self).media)
        for composite_name in self.composite_fields.keys():
            form = self.get_composite_field_value(composite_name)
            media_list.append(form.media)
        return reduce(lambda a, b: a + b, media_list)
151915
private QueryResultImpl combineResults(Queue<QueryResultImpl> results, boolean distinct) {
        while (results.size() > 1) {
            QueryResultImpl a = results.remove();
            QueryResultImpl b = results.remove();
            results.add(combineResults(a, b, distinct));
        }

        return results.remove();
    }