Return a shallow copy of a RangeSet.
504452
def copy(self):
        """"""
        cpy = self.__class__()
        cpy._autostep = self._autostep
        cpy.padding = self.padding
        cpy.update(self)
        return cpy
160016
def visit_Set(self, node: ast.Set) -> Set[Any]:
        """"""
        result = set(self.visit(node=elt) for elt in node.elts)

        self.recomputed_values[node] = result
        return result
490630
function extractRange(ranges, coord) {
            var axis, from, to, key, axes = plot.getAxes();

            for (var k in axes) {
                axis = axes[k];
                if (axis.direction == coord) {
                    key = coord + axis.n + "axis";
                    if (!ranges[key] && axis.n == 1)
                        key = coord + "axis"; // support x1axis as xaxis
                    if (ranges[key]) {
                        from = ranges[key].from;
                        to = ranges[key].to;
                        break;
                    }
                }
            }

            // backwards-compat stuff - to be removed in future
            if (!ranges[key]) {
                axis = coord == "x" ? plot.getXAxes()[0] : plot.getYAxes()[0];
                from = ranges[coord + "1"];
                to = ranges[coord + "2"];
            }

            // auto-reverse as an added bonus
            if (from != null && to != null && from > to) {
                var tmp = from;
                from = to;
                to = tmp;
            }
            
            return { from: from, to: to, axis: axis };
        }
1252479
@SuppressWarnings("unchecked")
    public static List<Double> getAt(double[] array, ObjectRange range) {
        return primitiveArrayGet(array, range);
    }
440585
@SuppressWarnings("unchecked")
    private static <T> Set<T> cast(Set<?> set) {
        return (Set<T>)set;
    }
679467
def from_range(cls, range_list, register_flag=True):
        
        s = dict_from_range(range_list)
        obj = cls.from_serializable(s, register_flag)
        return obj
269260
def getrange(bch, fieldname):
    """"""
    keys = ['maximum', 'minimum', 'maximum<', 'minimum>', 'type']
    index = bch.objls.index(fieldname)
    fielddct_orig = bch.objidd[index]
    fielddct = copy.deepcopy(fielddct_orig)
    therange = {}
    for key in keys:
        therange[key] = fielddct.setdefault(key, None)
    if therange['type']:
        therange['type'] = therange['type'][0]
    if therange['type'] == 'real':
        for key in keys[:-1]:
            if therange[key]:
                therange[key] = float(therange[key][0])
    if therange['type'] == 'integer':
        for key in keys[:-1]:
            if therange[key]:
                therange[key] = int(therange[key][0])
    return therange
393913
function reduceSet(set) {
  return set.map(member => member && member.uri).filter(Boolean)
}
595506
public static <T extends Comparable<T>> RangeSet<T> intersectRangeSets(final Iterable<RangeSet<T>> rangeSets)
  {
    RangeSet<T> rangeSet = null;
    for (final RangeSet<T> set : rangeSets) {
      if (rangeSet == null) {
        rangeSet = TreeRangeSet.create();
        rangeSet.addAll(set);
      } else {
        rangeSet.removeAll(set.complement());
      }
    }
    return rangeSet;
  }
188660
def copy(self):
        """"""
        return Interval(self._lower, self._lower_value, self._upper_value, self._upper)
845723
def copy(self):
        

        vs = ValueSet(bits=self.bits)
        vs._regions = self._regions.copy()
        vs._region_base_addrs = self._region_base_addrs.copy()
        vs._reversed = self._reversed
        vs._si = self._si.copy()

        return vs
1311255
public static <T> Set<T> immutableSetCopy(Set<T> set) {
      if (set == null) return null;
      if (set.isEmpty()) return Collections.emptySet();
      if (set.size() == 1) return Collections.singleton(set.iterator().next());
      Set<? extends T> copy = ObjectDuplicator.duplicateSet(set);
      if (copy == null)
         // Set uses Collection copy-ctor
         copy = attemptCopyConstructor(set, Collection.class);
      if (copy == null)
         copy = new HashSet<>(set);

      return new ImmutableSetWrapper<>(copy);
   }
906777
public static RangeSet merge(RangeSet rs)
    {
        RangeSet result = new RangeSet();
        int from = -1;
        int to = -1;
        for (CharRange r : rs)
        {
            if (from == -1) // first
            {
                from = r.getFrom();
                to = r.getTo();
            }
            else
            {
                if (r.getFrom() == to)
                {
                    to = r.getTo();
                }
                else
                {
                    result.add(from, to);
                    from = r.getFrom();
                    to = r.getTo();
                }
            }
        }
        result.add(from, to);
        return result;
    }
1035149
public Object shallowCopy() {
        Object copy = null;
        try {
            copy = super.clone();
        } catch (Exception e) {
            e.printStackTrace(System.err);
        }
        return copy;
    }
607829
def copy(self):
        """"""
        if self._pre_computed_hash is None:
            temp = ssdeep(buf="")
        else:
            temp = ssdeep(hash=hash)
        libssdeep_wrapper.fuzzy_free(temp._state)
        temp._state = libssdeep_wrapper.fuzzy_clone(self._state)
        temp._updatable = self._updatable
        temp._pre_computed_hash = self._pre_computed_hash
        return temp
1042012
public @Nonnull RangeSet getRangeSet(String jobFullName) {
        RangeSet r = usages.get(jobFullName);
        if(r==null) r = new RangeSet();
        return r;
    }
1043748
def copy(self):
        """"""
        return self.__class__(key=self._key, load=self._load, _set=set(self._set))