class_docstr: A union of a number of sub restrictions.
  
  Parameters
  ----------
  sub_restrictions : iterable of Restrictions (but not _UnionRestrictions)
      The Restrictions to be added together
  
  Notes
  -----
  - Consumers should not construct instances of this class directly, but
    instead use the `|` operator to combine restrictions
class_docstr_tok: ["A","union","of","a","number","of","sub","restrictions",".","Parameters","--","--","--","--","--","sub_restrictions",":","iterable","of","Restrictions","(","but","not","_UnionRestrictions",")","The","Restrictions","to","be","added","together","Notes","--","--","-","-","Consumers","should","not","construct","instances","of","this","class","directly",",","but","instead","use","the","`","|","`","operator","to","combine","restrictions"]
code: def __new__(cls, sub_restrictions):
      # Filter out NoRestrictions and deal with resulting cases involving
      # one or zero sub_restrictions
      sub_restrictions = [
          r
          for r in sub_restrictions
          if not isinstance(r, NoRestrictions)
      ]
      if len(sub_restrictions) == 0:
          return NoRestrictions()
      elif len(sub_restrictions) == 1:
          return sub_restrictions[0]
  
      new_instance = super(_UnionRestrictions, cls).__new__(cls)
      new_instance.sub_restrictions = sub_restrictions
      return new_instance
  
imports: import abc
  from numpy import vectorize
  from functools import partial, reduce
  import operator
  import pandas
  from six import with_metaclass, iteritems
  from collections import namedtuple
  from toolz import groupby
  from catalyst.utils.enum import enum
  from catalyst.utils.numpy_utils import vectorized_is_element
  from catalyst.assets import Asset
label_desc: Use image node_id 1 for calling the _UnionRestrictions obj's underlying member method code with example usage: obj.__new__(cls, sub_restrictions) and returns: new_instance, NoRestrictions, sub_restrictions