Same as str.rpartition(), except that the partitioning is done case insensitive.
169010
def _case_insensitive_rpartition(input_string: str, separator: str) -> typing.Tuple[str, str, str]:
        """"""
        lowered_input_string = input_string.lower()
        lowered_separator = separator.lower()
        try:
            split_index = lowered_input_string.rindex(lowered_separator)
        except ValueError:
            # Did not find the separator in the input_string.
            # Follow https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str
            # str.rpartition documentation and return the tuple ("", "", unmodified_input) in this case
            return "", "", input_string
        else:
            split_index_2 = split_index+len(separator)
            return input_string[:split_index], input_string[split_index: split_index_2], input_string[split_index_2:]
1036895
def partition_t(wrap, func):
    
    return Transformation(
        'partition({0})'.format(name(func)),
        partial(partition_impl, wrap, func),
        None
    )
585842
def casefold_parts(self, parts):
        """"""
        if self.filesystem.is_windows_fs:
            return [p.lower() for p in parts]
        return parts
1081244
function checkPartition(obj) {
  var count = 0
  Object.keys(obj).forEach(key=> {
    if (obj[key] === '*String') count += 1
    if (obj[key] === '*Number') count += 1
  })
  return count === 1
}
650345
private static <T> Iterable<List<T>> partitionExponentially(List<T> values, int minBatchSize, int maxBatchSize)
    {
        return () -> new AbstractIterator<List<T>>()
        {
            private int currentSize = minBatchSize;
            private final Iterator<T> iterator = values.iterator();

            @Override
            protected List<T> computeNext()
            {
                if (!iterator.hasNext()) {
                    return endOfData();
                }

                int count = 0;
                ImmutableList.Builder<T> builder = ImmutableList.builder();
                while (iterator.hasNext() && count < currentSize) {
                    builder.add(iterator.next());
                    ++count;
                }

                currentSize = min(maxBatchSize, currentSize * 2);
                return builder.build();
            }
        };
    }
430376
private int ssPartition(int PA, int first, int last, int depth) {
        int a, b;// SA pointer
        int t;
        for (a = first - 1, b = last; ; ) {
            for (; (++a < b) && ((SA[PA + SA[a]] + depth) >= (SA[PA + SA[a] + 1] + 1)); ) {
                SA[a] = ~SA[a];
            }
            for (; (a < --b) && ((SA[PA + SA[b]] + depth) < (SA[PA + SA[b] + 1] + 1)); ) {
            }
            if (b <= a) {
                break;
            }
            t = ~SA[b];
            SA[b] = SA[a];
            SA[a] = t;
        }
        if (first < a) {
            SA[first] = ~SA[first];
        }
        return a;
    }
1273114
def _to_s(val, sep=", "):
    
    if anyconfig.utils.is_iterable(val):
        return sep.join(str(x) for x in val)

    return str(val)
52385
public static void copyPartialContent(InputStream in, OutputStream out, Range r) throws IOException {
    IOUtils.copyLarge(in, out, r.start, r.length);
  }
324933
def partition(self):
        """"""

        if not self.partitions:
            return None

        if len(self.partitions) > 1:
            raise ValueError(
                "Can't use this method when there is more than one partition")

        return list(self.partitions.values())[0]
698777
public boolean setPartitions(Collection<Collection<Node>> parts) {
        if (!isDisjoint(parts)) {
            return false;
        }
        partitions = parts;
        return true;
    }
1227327
private boolean isInvPart(List<InvPair> v) {
        if (((InvPair) v.get(v.size() - 1)).getCurr() == v.size()) return true;
        Iterator<InvPair> it = v.iterator();
        InvPair curr;
        while (it.hasNext()) {
            curr = (InvPair) it.next();
            if (curr.getCurr() != curr.getLast()) return false;
        }
        return true;
    }
1125801
def partition(pred, iterable, tolist=False):
    ''
    # partition(is_odd, range(10)) --> 0 2 4 6 8   and  1 3 5 7 9
    t1, t2 = itertools.tee(iterable)
    ifalse = six.moves.filterfalse(pred, t1)
    itrue = six.moves.filter(pred, t2)
    if tolist:
        return list(ifalse), list(itrue)
    else:
        return ifalse, itrue
1051027
function parsePart( str ){

    if ( str ){
        return getFullLines( str ).reduce( getDict, {} );
    } else {
        return {};
    }

    function getDict( r, line ){

        if ( line.indexOf( ":" ) === -1 ){
            r[line] =           line;
        } else {
            line =              line.split( ":" );
            r[line.shift().trim()] =   line.join( ":" ).trim();
        }

        return r;
    }///
}
512101
def partition(predicate, iterable):
    

    t1, t2 = tee(iterable)

    return filterfalse(predicate, t1), filter(predicate, t2)
848102
def partition_source(src):
    
    # In python2, ast.parse(text_string_with_encoding_pragma) raises
    # SyntaxError: encoding declaration in Unicode string
    ast_obj = ast.parse(src.encode('UTF-8'))
    visitor = TopLevelImportVisitor()
    visitor.visit(ast_obj)

    line_offsets = get_line_offsets_by_line_no(src)

    chunks = []
    startpos = 0
    pending_chunk_type = None
    possible_ending_tokens = None
    seen_import = False
    for (
            token_type, token_text, (srow, scol), (erow, ecol), _,
    ) in tokenize.generate_tokens(io.StringIO(src).readline):
        # Searching for a start of a chunk
        if pending_chunk_type is None:
            if not seen_import and token_type == tokenize.COMMENT:
                if 'noreorder' in token_text:
                    chunks.append(CodePartition(CodeType.CODE, src[startpos:]))
                    break
                else:
                    pending_chunk_type = CodeType.PRE_IMPORT_CODE
                    possible_ending_tokens = TERMINATES_COMMENT
            elif not seen_import and token_type == tokenize.STRING:
                pending_chunk_type = CodeType.PRE_IMPORT_CODE
                possible_ending_tokens = TERMINATES_DOCSTRING
            elif scol == 0 and srow in visitor.top_level_import_line_numbers:
                seen_import = True
                pending_chunk_type = CodeType.IMPORT
                possible_ending_tokens = TERMINATES_IMPORT
            elif token_type == tokenize.NL:
                # A NL token is a non-important newline, we'll immediately
                # append a NON_CODE partition
                endpos = line_offsets[erow] + ecol
                srctext = src[startpos:endpos]
                startpos = endpos
                chunks.append(CodePartition(CodeType.NON_CODE, srctext))
            elif token_type == tokenize.COMMENT:
                if 'noreorder' in token_text:
                    chunks.append(CodePartition(CodeType.CODE, src[startpos:]))
                    break
                else:
                    pending_chunk_type = CodeType.CODE
                    possible_ending_tokens = TERMINATES_COMMENT
            elif token_type == tokenize.ENDMARKER:
                # Token ended right before end of file or file was empty
                pass
            else:
                # We've reached a `CODE` block, which spans the rest of the
                # file (intentionally timid).  Let's append that block and be
                # done
                chunks.append(CodePartition(CodeType.CODE, src[startpos:]))
                break
        # Attempt to find ending of token
        elif token_type in possible_ending_tokens:
            endpos = line_offsets[erow] + ecol
            srctext = src[startpos:endpos]
            startpos = endpos
            chunks.append(CodePartition(pending_chunk_type, srctext))
            pending_chunk_type = None
            possible_ending_tokens = None
        elif token_type == tokenize.COMMENT and 'noreorder' in token_text:
            chunks.append(CodePartition(CodeType.CODE, src[startpos:]))
            break

    chunks = [chunk for chunk in chunks if chunk.src]

    # Make sure we're not removing any code
    assert _partitions_to_src(chunks) == src
    return chunks
1347407
function caseInsensitivePart(value) {
    let result = [];
    for(let i=0; i<value.length; i++) {
        const c = value[i];
        const l = c.toLowerCase();
        const u = c.toUpperCase();

        if(l !== u) {
            result.push('[' + l + u + ']');
        } else {
            result.push(l);
        }
    }
    return result.join('');
}
1144000
def partition(f, xs):
    
    t = type(xs)
    true = filter(f, xs)
    false = [x for x in xs if x not in true]
    return t(true), t(false)