TODO it would be nice to split this up more but everything appears to be "one off" or require ordering such that other bits are sprinkled in between parts that could be abstracted out as a group
506789
function( absUrl, triggerData, settings, deferred ) {
            var fileUrl = this._createFileUrl( absUrl );

            return $.proxy(function( html, textStatus, xhr ) {
                //pre-parse html to check for a data-url,
                //use it as the new fileUrl, base path, etc
                var content,

                    // TODO handle dialogs again
                    pageElemRegex = new RegExp( "(<[^>]+\\bdata-" + this._getNs() + "role=[\"']?page[\"']?[^>]*>)" ),

                    dataUrlRegex = new RegExp( "\\bdata-" + this._getNs() + "url=[\"']?([^\"'>]*)[\"']?" );

                // data-url must be provided for the base tag so resource requests
                // can be directed to the correct url. loading into a temprorary
                // element makes these requests immediately
                if ( pageElemRegex.test( html ) &&
                    RegExp.$1 &&
                    dataUrlRegex.test( RegExp.$1 ) &&
                    RegExp.$1 ) {
                    fileUrl = $.mobile.path.getFilePath( $("<div>" + RegExp.$1 + "</div>").text() );

                    // We specify that, if a data-url attribute is given on the page div, its value
                    // must be given non-URL-encoded. However, in this part of the code, fileUrl is
                    // assumed to be URL-encoded, so we URL-encode the retrieved value here
                    fileUrl = this.window[ 0 ].encodeURIComponent( fileUrl );
                }

                //dont update the base tag if we are prefetching
                if ( settings.prefetch === undefined ) {
                    this._getBase().set( fileUrl );
                }

                content = this._parse( html, fileUrl );

                this._setLoadedTitle( content, html );

                // Add the content reference and xhr to our triggerData.
                triggerData.xhr = xhr;
                triggerData.textStatus = textStatus;

                // DEPRECATED
                triggerData.page = content;

                triggerData.content = content;

                triggerData.toPage = content;

                // If the default behavior is prevented, stop here!
                // Note that it is the responsibility of the listener/handler
                // that called preventDefault(), to resolve/reject the
                // deferred object within the triggerData.
                if ( this._triggerWithDeprecated( "load", triggerData ).event.isDefaultPrevented() ) {
                    return;
                }

                // rewrite src and href attrs to use a base url if the base tag won't work
                if ( this._isRewritableBaseTag() && content ) {
                    this._getBase().rewrite( fileUrl, content );
                }

                this._include( content, settings );

                // Remove loading message.
                if ( settings.showLoadMsg ) {
                    this._hideLoading();
                }

                deferred.resolve( absUrl, settings, content );
            }, this);
        }
333838
function splitStr2Obj(source) {
    var result = {};
    each(
        source.split(','),
        function (key) {
            result[key] = key;
        }
    );
    return result;
}
1239741
function doHumanization (ms, options) {
    var i, len, piece

    // Make sure we have a positive number.
    // Has the nice sideffect of turning Number objects into primitives.
    ms = Math.abs(ms)

    var dictionary = options.languages[options.language] || languages[options.language]
    if (!dictionary) {
      throw new Error('No language ' + dictionary + '.')
    }

    var pieces = []

    // Start at the top and keep removing units, bit by bit.
    var unitName, unitMS, unitCount
    for (i = 0, len = options.units.length; i < len; i++) {
      unitName = options.units[i]
      unitMS = options.unitMeasures[unitName]

      // What's the number of full units we can fit?
      if (i + 1 === len) {
        unitCount = ms / unitMS
      } else {
        unitCount = Math.floor(ms / unitMS)
      }

      // Add the string.
      pieces.push({
        unitCount: unitCount,
        unitName: unitName
      })

      // Remove what we just figured out.
      ms -= unitCount * unitMS
    }

    var firstOccupiedUnitIndex = 0
    for (i = 0; i < pieces.length; i++) {
      if (pieces[i].unitCount) {
        firstOccupiedUnitIndex = i
        break
      }
    }

    if (options.round) {
      var ratioToLargerUnit, previousPiece
      for (i = pieces.length - 1; i >= 0; i--) {
        piece = pieces[i]
        piece.unitCount = Math.round(piece.unitCount)

        if (i === 0) { break }

        previousPiece = pieces[i - 1]

        ratioToLargerUnit = options.unitMeasures[previousPiece.unitName] / options.unitMeasures[piece.unitName]
        if ((piece.unitCount % ratioToLargerUnit) === 0 || (options.largest && ((options.largest - 1) < (i - firstOccupiedUnitIndex)))) {
          previousPiece.unitCount += piece.unitCount / ratioToLargerUnit
          piece.unitCount = 0
        }
      }
    }

    var result = []
    for (i = 0, pieces.length; i < len; i++) {
      piece = pieces[i]
      if (piece.unitCount) {
        result.push(render(piece.unitCount, piece.unitName, dictionary, options))
      }

      if (result.length === options.largest) { break }
    }

    if (result.length) {
      if (!options.conjunction || result.length === 1) {
        return result.join(options.delimiter)
      } else if (result.length === 2) {
        return result.join(options.conjunction)
      } else if (result.length > 2) {
        return result.slice(0, -1).join(options.delimiter) + (options.serialComma ? ',' : '') + options.conjunction + result.slice(-1)
      }
    } else {
      return render(0, options.units[options.units.length - 1], dictionary, options)
    }
  }
1040069
function splitAll(source, cb, rules) {
  var done = false
    , stash = '';
  do {
    splitNext( source, function(event, response) {
        response.stash = stash;
        if (event == 'end') done = true;
        else {
          
          source = response.rhs;
          stash += response.lhs + response.token;

          response.consume = function(length) {
            stash += source.substr( 0, length );
            source = source.substr( length, source.length );
          };

          response.resetStash = function() {
            stash = '';
          };
          
          response.break = function() {
            done = true; 
          };
        }
        cb( event, response );
      }, 
      rules );
  } 
  while(!done);
}
830056
function divide(bit) {
  var bitString = ((zeros + zeros) + (Number(bit).toString(2))).slice(-64);

  return [
    parseInt(bitString.slice(0, 32), 2), // hi
    parseInt(bitString.slice(-32), 2) // lo
  ];
}
1073967
function joinParts(entrances) {

        var parts = [];
        parts.push(Buffer(content.substring(0, matches.index)));
        parts.push(Buffer('styles: [`'));

        for (var i=0; i<entrances.length; i++) {
            parts.push(Buffer(entrances[i].replace(/\n/g, '')));
            if (i < entrances.length - 1) {
                parts.push(Buffer('`, `'));
            }
        }
        parts.push(Buffer('`]'));
        parts.push(Buffer(content.substr(matches.index + matches[0].length)));
        return Buffer.concat(parts);
    }
1011897
function groupIncludes(includes, body) {
    var root = rootName(body);
    var requestsByType = {};

    _.each(includes, function(include) {
      var type = ((body.links && body.links[root + "." + include]) || {}).type,
        split = include.split(".");

      if (_.isUndefined(body.links) || _.isUndefined(body.links[root + "." + split[0]])) {
        return;
      }

      if (type && body.linked[type] && body.linked[type] !== "external") {
        // The type exists but is not an external reference exit.
        return;
      }

      var ancestorType = body.links[root + "." + split[0]].type;
      var ids = linkedIds(body[root], split[0]);
      if (ids.length) {
        var requestData = requestsByType[ancestorType] || {ids: [], includes: []};
        requestData.ids = requestData.ids.concat(ids);
        requestData.includes.push(split);
        requestsByType[ancestorType] = requestData;
      }
    });

    return requestsByType;
  }
677069
private void organizeContent()
    {
        TableRowBox anonrow = null;
        
        for (Iterator<Box> it = nested.iterator(); it.hasNext(); )
        {
            Box box = it.next();
            if (box instanceof ElementBox && ((ElementBox) box).getDisplay() == ElementBox.DISPLAY_TABLE_ROW)
            {
                addRow((TableRowBox) box);
                //finish and add possible previous anonymous row
                if (anonrow != null)
                {
                    anonrow.endChild = anonrow.nested.size();
                    addSubBox(anonrow);
                }
                anonrow = null;
            }
            else
            {
                if (anonrow == null)
                {
                    Element anonelem = viewport.getFactory().createAnonymousElement(getParent().getParent().getElement().getOwnerDocument(), "tr", "table-row"); 
                    anonrow = new TableRowBox(anonelem, g, ctx);
                    anonrow.adoptParent(this);
                    anonrow.setStyle(viewport.getFactory().createAnonymousStyle("table-row"));
                    addRow(anonrow);
                }
                anonrow.addSubBox(box);
                anonrow.isempty = false;
                box.setContainingBlockBox(anonrow);
                box.setParent(anonrow);
                it.remove();
                endChild--;
            }
        }
        if (anonrow != null)
        {
            anonrow.endChild = anonrow.nested.size();
            addSubBox(anonrow);
        }
    }
699776
def splits(cls, fields, root=".data", train="train.txt",
               test="test.txt", validation_frac=0.1, **kwargs):
        

        train, test = super(CoNLL2000Chunking, cls).splits(
            fields=fields, root=root, train=train,
            test=test, separator=' ', **kwargs)

        # HACK: Saving the sort key function as the split() call removes it
        sort_key = train.sort_key

        # Now split the train set
        # Force a random seed to make the split deterministic
        random.seed(0)
        train, val = train.split(1 - validation_frac, random_state=random.getstate())
        # Reset the seed
        random.seed()

        # HACK: Set the sort key
        train.sort_key = sort_key
        val.sort_key = sort_key

        return train, val, test
868576
def _split_explanation(explanation):
    
    raw_lines = (explanation or u('')).split('\n')
    lines = [raw_lines[0]]
    for l in raw_lines[1:]:
        if l and l[0] in ['{', '}', '~', '>']:
            lines.append(l)
        else:
            lines[-1] += '\\n' + l
    return lines
71412
private void addCreatedSplit(List<InputSplit> splitList, 
                               List<String> locations, 
                               ArrayList<OneBlockInfo> validBlocks) {
    // create an input split
    Path[] fl = new Path[validBlocks.size()];
    long[] offset = new long[validBlocks.size()];
    long[] length = new long[validBlocks.size()];
    for (int i = 0; i < validBlocks.size(); i++) {
      fl[i] = validBlocks.get(i).onepath; 
      offset[i] = validBlocks.get(i).offset;
      length[i] = validBlocks.get(i).length;
    }

     // add this split to the list that is returned
    CombineFileSplit thissplit = new CombineFileSplit(fl, offset, 
                                   length, locations.toArray(new String[0]));
    splitList.add(thissplit); 
  }
1124859
public void split() {
        if (!needsSplitting()) {
            return;
        }

        Node parent = getParentNode();
        String[] parts = getData().split("\\]\\]>");
        parent.insertBefore(new CDATASectionImpl(document, parts[0] + "]]"), this);
        for (int p = 1; p < parts.length - 1; p++) {
            parent.insertBefore(new CDATASectionImpl(document, ">" + parts[p] + "]]"), this);
        }
        setData(">" + parts[parts.length - 1]);
    }
1098720
def split_pieces(piece_list, segments, num):
    
    piece_groups = []
    pieces = list(piece_list)
    while pieces:
        for i in range(segments):
            p = pieces[i::segments][:num]
            if not p:
                break
            piece_groups.append(p)
        pieces = pieces[num * segments:]

    return piece_groups
246695
function assembleOtherSeries(series) {
    return zrUtil.map(series, function (series) {
        var data = series.getRawData();
        var lines = [series.name];
        var vals = [];
        data.each(data.dimensions, function () {
            var argLen = arguments.length;
            var dataIndex = arguments[argLen - 1];
            var name = data.getName(dataIndex);
            for (var i = 0; i < argLen - 1; i++) {
                vals[i] = arguments[i];
            }
            lines.push((name ? (name + ITEM_SPLITER) : '') + vals.join(ITEM_SPLITER));
        });
        return lines.join('\n');
    }).join('\n\n' + BLOCK_SPLITER + '\n\n');
}
66672
def _partition_all_internal(s, sep):
    
    parts = list(s.partition(sep))

    # if sep found
    if parts[1] == sep:
        new_parts = partition_all(parts[2], sep)
        parts.pop()
        parts.extend(new_parts)
        return [p for p in parts if p]
    else:
        if parts[0]:
            return [parts[0]]
        else:
            return []
1310277
function _joinAndCanonicalizePath(parts) {
    var /** @type {?} */ path = parts[_ComponentIndex.Path];
    path = path == null ? '' : _removeDotSegments(path);
    parts[_ComponentIndex.Path] = path;
    return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);
}
28545
def split(self):
        
        if self.package_request.conflict or (len(self.variant_slice) == 1):
            return None
        else:
            r = self.variant_slice.split()
            if r is None:
                return None
            else:
                slice, next_slice = r
                scope = self._copy(slice)
                next_scope = self._copy(next_slice)
                return (scope, next_scope)