Removes a match between left and right tuple
437424
private static void removeMatch(final AccumulateNode accNode,
                                    final Accumulate accumulate,
                                    final RightTuple rightTuple,
                                    final LeftTuple match,
                                    final InternalWorkingMemory wm,
                                    final AccumulateMemory am,
                                    final AccumulateContext accctx,
                                    final boolean reaccumulate) {
        // save the matching tuple
        LeftTuple leftTuple = match.getLeftParent();

        // removing link between left and right
        match.unlinkFromLeftParent();
        match.unlinkFromRightParent();

        // if there is a subnetwork, we need to unwrap the object from inside the tuple
        InternalFactHandle handle = rightTuple.getFactHandle();
        LeftTuple tuple = leftTuple;
        if (accNode.isUnwrapRightObject()) {
            tuple = (LeftTuple) rightTuple;
            handle = rightTuple.getFactHandleForEvaluation();
        }

        if (accumulate.supportsReverse()) {
            // just reverse this single match
            accumulate.reverse(am.workingMemoryContext,
                               accctx.context,
                               tuple,
                               handle,
                               wm);
        } else {
            // otherwise need to recalculate all matches for the given leftTuple
            if (reaccumulate) {
                reaccumulateForLeftTuple(accNode,
                                         accumulate,
                                         leftTuple,
                                         wm,
                                         am,
                                         accctx);

            }
        }
    }
946541
def _strip_line_sep(self, s):
        """"""
        if s[-2:] == b'\r\n':
            return s[:-2]
        elif s[-1:] == b'\n':
            return s[:-1]
        else:
            return s
1150462
def match(self, other):
        """"""

        if len(self) != len(other):
            raise ValueError()
        for s1, s2 in zip(self, other):
            i = s2.position - s1.position
            if i < 0:
                return False
            n = len(s1)
            while i+n > len(s2) and s1[n-1] == syntax.BLANK:
                n -= 1
            if s2.values[i:i+n] != s1.values[:n]:
                return False
        return True
208275
def _string_remove_slice(input_str, start, end):
        
        if 0 <= start < end <= len(input_str):
            return input_str[:start] + input_str[end:]
        return input_str
437741
def replace (inlst,oldval,newval):
    
    lst = inlst*1
    for i in range(len(lst)):
        if type(lst[i]) not in [ListType,TupleType]:
            if lst[i]==oldval: lst[i]=newval
        else:
            lst[i] = replace(lst[i],oldval,newval)
    return lst
1109620
def _match(self):
        """"""
        #disable optimized matching
        optimized_rows = None
        optimized_columns = None
        for match in self.__match_rows(optimized_rows):
            #match in rows
            yield match
        for match in self.__match_rows(optimized_columns,
                                       transpose=True):
            #match in columns and transpose coordinates
            yield match
372469
def _strip(self, tokens, criteria, prop, rev=False):
        """"""
        num = len(tokens)
        res = []
        for i, token in enumerate(reversed(tokens) if rev else tokens):
            if criteria(token) and num > i + 1:
                res.insert(0, tokens.pop()) if rev else res.append(tokens.pop(0))
            else:
                break
        if res:
            self[prop] = self._clean(' '.join(res))
        return tokens
909367
def range_matches(self, other):
        
        return (
            self.begin == other.begin and 
            self.end == other.end
        )
810812
def squash(self, a, b):
        

        return ((''.join(x) if isinstance(x, tuple) else x) for x in itertools.product(a, b))
369409
function removeUnderscore (filepath) {
  const parts = filepath.split(path.sep)
  const filename = parts.pop().replace(/^_/, '')
  return parts.concat([filename]).join(path.sep)
}
175203
def strip_stop(tokens, start, result):
    """"""
    for e in result:
        for child in e.iter():
            if child.text.endswith('.'):
                child.text = child.text[:-1]
    return result
980595
def _trim_after_first_match(self, pattern, candidate):
        """"""
        trailing_chars_match = pattern.search(candidate)
        if trailing_chars_match:
            candidate = candidate[:trailing_chars_match.start()]
        return candidate
483887
def removeblanklines(astr):
    """"""
    lines = astr.splitlines()
    lines = [line for line in lines if line.strip() != ""]
    return "\n".join(lines)
818104
public static <L, R> Tuple<L, R> newTuple (L left, R right)
    {
        return new Tuple<L, R>(left, right);
    }
1072694
def stripped_step(step, left_delimiter, right_delimiter)
      unless left_delimiter.nil? || right_delimiter.nil?
        pattern = Regexp.new(Regexp.escape(left_delimiter) + '.*?' + Regexp.escape(right_delimiter))
        step = step.gsub(pattern, left_delimiter + right_delimiter)
      end

      step
    end
1127121
def nv_tuple_list_replace(l, v):
    
    _found = False
    for i, x in enumerate(l):
        if x[0] == v[0]:
            l[i] = v
            _found = True

    if not _found:
        l.append(v)
602232
def strip_rows(array,invalid=None):
    ''' '''
    array = np.array(array)
    none_indices = np.where(np.any(np.equal(array,invalid),axis=0))
    return tuple(np.delete(array,none_indices,axis=1))