Leaves only versions of those objects that has some version with
        `_end == None` or with `_end > right cutoff`.
19468
def unfinished_objects(self):
        '''
        
        '''
        mask = self._end_isnull
        if self._rbound is not None:
            mask = mask | (self._end > self._rbound)
        oids = set(self[mask]._oid.tolist())
        return self[self._oid.apply(lambda oid: oid in oids)]
1313547
public boolean removeObjectEquals (Object object)
    {
        for (int i = 0; i < _size; i++) {
            if (_records[i].object.equals(object)) {
                // shift everything down
                System.arraycopy(_records, i+1, _records, i, _size-(i+1));
                // clear out the trailing reference
                _records[--_size] = null;
                return true;
            }
        }

        return false;
    }
820971
private static String trimVersion(String apiVersion) {
    if (apiVersion != null && apiVersion.contains("/")) {
      String[] versionParts = apiVersion.split("/");
      return versionParts[versionParts.length - 1];
    }
    return apiVersion;
  }
457919
def strip_empty_values(obj):
    """"""
    if isinstance(obj, dict):
        new_obj = {}
        for key, val in obj.items():
            new_val = strip_empty_values(val)
            if new_val is not None:
                new_obj[key] = new_val
        return new_obj or None
    elif isinstance(obj, (list, tuple, set)):
        new_obj = []
        for val in obj:
            new_val = strip_empty_values(val)
            if new_val is not None:
                new_obj.append(new_val)
        return type(obj)(new_obj) or None
    elif obj or obj is False or obj == 0:
        return obj
    else:
        return None
1055421
function compareVersion(version1, version2) {
  version1 = cleanupVersion(version1).split('.');
  version2 = cleanupVersion(version2).split('.');
  for (let i = 0; i < 3; i++) {
    let compared = compare(+version1[i], +version2[i]);
    if (compared !== 0) {
      return compared;
    }
  }
  return 0;
}
351322
def delete(cls, object_version, key=None):
        
        with db.session.begin_nested():
            q = cls.query.filter_by(
                version_id=as_object_version_id(object_version))
            if key:
                q = q.filter_by(key=key)
            q.delete()
528902
function sortDjangoVersions(versions) {
  return versions.sort((a, b) => {
    if (
      parseDjangoVersionString(a).major === parseDjangoVersionString(b).major
    ) {
      return (
        parseDjangoVersionString(a).minor - parseDjangoVersionString(b).minor
      )
    } else {
      return (
        parseDjangoVersionString(a).major - parseDjangoVersionString(b).major
      )
    }
  })
}
1218186
def _strip_version_from_dependency(dep):
    ''''''
    usedmark = ''
    for mark in '< > ='.split():
        split = dep.split(mark)
        if len(split) > 1:
            usedmark = mark
            break
    if usedmark:
        return split[0].strip()
    else:
        return dep.strip()
420481
def cleanup(parent = Object, current = @top)
      return unless all_project_objects_lookup[current]
      current.constants.each {|const| cleanup current, current.const_get(const)}
      parent.send(:remove_const, current.to_s.split('::').last.to_sym)
    end
1176173
def strip_end(text, suffix):
    """"""
    if not text.endswith(suffix):
        return text
    return text[:len(text)-len(suffix)]
554259
def minusExtras(self):
        
        assert self.isOpen()
        
        trimmed = self.clone()
        
        equals = {}
        
        for test in trimmed.tests:
            if test.op == '=':
                equals[test.property] = test.value

        extras = []

        for (i, test) in enumerate(trimmed.tests):
            if test.op == '!=' and equals.has_key(test.property) and equals[test.property] != test.value:
                extras.append(i)

        while extras:
            trimmed.tests.pop(extras.pop())

        return trimmed
326411
def trim(self, len_):
        
        other = Version(None)
        other.tokens = self.tokens[:len_]
        other.seps = self.seps[:len_ - 1]
        return other
572681
function excludeIncludeKeys(objA, objB, excludeKeys, includeKeys) {
  let keysA = Object.keys(objA);
  let keysB = Object.keys(objB);

  if (excludeKeys) {
    keysA = keysA.filter(key => excludeKeys.indexOf(key) === -1);
    keysB = keysB.filter(key => excludeKeys.indexOf(key) === -1);
  } else if (includeKeys) {
    keysA = keysA.filter(key => includeKeys.indexOf(key) !== -1);
    keysB = keysB.filter(key => includeKeys.indexOf(key) !== -1);
  }

  return [keysA, keysB];
}
1280731
function versions(a, b) {
    if (!a || !b) return false;

    a = Array.isArray(a) ? a : Object.keys(a);
    b = Array.isArray(a) ? a : Object.keys(a);

    return a.length === b.length && a.reduce(function has(memo, item) {
      return memo && ~b.indexOf(item);
    }, true);
  }
1355339
def delete_all(obj):
    ''''''
    types = tuple([
        Shader,
        Mesh,
        VertexBuffer,
        IndexBuffer,
        Texture,
        Program,
        Context,
    ])
    for name in dir(obj):
        child = getattr(obj, name)
        if isinstance(child, types):
            child.delete()
1314666
private static void removeRedundant(Node nodeVersioning) throws Exception{
    VersionHistory versionHistory = nodeVersioning.getVersionHistory();
    String baseVersion = nodeVersioning.getBaseVersion().getName();
    String rootVersion = nodeVersioning.getVersionHistory().getRootVersion().getName();
    VersionIterator versions = versionHistory.getAllVersions();
    Date currentDate = new Date();
    Map<String, String> lstVersions = new HashMap<String, String>();
    List<String> lstVersionTime = new ArrayList<String>();
    while (versions.hasNext()) {
      Version version = versions.nextVersion();
      if(rootVersion.equals(version.getName()) || baseVersion.equals(version.getName())) continue;

      if (maxLiveTime!= DOCUMENT_AUTO_DEFAULT_VERSION_EXPIRED &&
              currentDate.getTime() - version.getCreated().getTime().getTime() > maxLiveTime) {
        versionHistory.removeVersion(version.getName());
      } else {
        lstVersions.put(String.valueOf(version.getCreated().getTimeInMillis()), version.getName());
        lstVersionTime.add(String.valueOf(version.getCreated().getTimeInMillis()));
      }
    }
    if (maxAllowVersion <= lstVersionTime.size() && maxAllowVersion!= DOCUMENT_AUTO_DEFAULT_VERSION_MAX) {
      Collections.sort(lstVersionTime);
      String[] lsts = lstVersionTime.toArray(new String[lstVersionTime.size()]);
      for (int j = 0; j <= lsts.length - maxAllowVersion; j++) {
        versionHistory.removeVersion(lstVersions.get(lsts[j]));
      }
    }
  }
1103540
def exclude_specs(full, to_be_excluded)
      full.clone.delete_if { |s| to_be_excluded.find { |d| s.name == d.name } }
    end