class_docstr: This represents the origin of some object in some string.
  
  For example, if we have an object ``x1_obj`` that was produced by parsing
  the ``x1`` in the formula ``"y ~ x1:x2"``, then we conventionally keep
  track of that relationship by doing::
  
    x1_obj.origin = Origin("y ~ x1:x2", 4, 6)
  
  Then later if we run into a problem, we can do::
  
    raise PatsyError("invalid factor", x1_obj)
  
  and we'll produce a nice error message like::
  
    PatsyError: invalid factor
        y ~ x1:x2
            ^^
  
  Origins are compared by value, and hashable.
class_docstr_tok: ["This","represents","the","origin","of","some","object","in","some","string",".","For","example",",","if","we","have","an","object","``","x1_obj","``","that","was","produced","by","parsing","the","``","x1","``","in","the","formula","``","``","y","~","x1",":","x2","''","``",",","then","we","conventionally","keep","track","of","that","relationship","by","doing",":",":","x1_obj.origin","=","Origin","(","``","y","~","x1",":","x2","''",",","4",",","6",")","Then","later","if","we","run","into","a","problem",",","we","can","do",":",":","raise","PatsyError","(","``","invalid","factor","''",",","x1_obj",")","and","we","'ll","produce","a","nice","error","message","like",":",":","PatsyError",":","invalid","factor","y","~","x1",":","x2","^^","Origins","are","compared","by","value",",","and","hashable","."]
docstr: Class method for combining a set of Origins into one large Origin
  that spans them.
  
  Example usage: if we wanted to represent the origin of the "x1:x2"
  term, we could do ``Origin.combine([x1_obj, x2_obj])``.
  
  Single argument is an iterable, and each element in the iterable
  should be either:
  
  * An Origin object
  * ``None``
  * An object that has a ``.origin`` attribute which fulfills the above
    criteria.
    
  Returns either an Origin object, or None.
docstr_tok: ["Class","method","for","combining","a","set","of","Origins","into","one","large","Origin","that","spans","them",".","Example","usage",":","if","we","wanted","to","represent","the","origin","of","the","``","x1",":","x2","''","term",",","we","could","do","``","Origin.combine","(","[","x1_obj",",","x2_obj","]",")","``",".","Single","argument","is","an","iterable",",","and","each","element","in","the","iterable","should","be","either",":","*","An","Origin","object","*","``","None","``","*","An","object","that","has","a","``",".origin","``","attribute","which","fulfills","the","above","criteria",".","Returns","either","an","Origin","object",",","or","None","."]
code: def combine(cls, origin_objs):
      """Class method for combining a set of Origins into one large Origin
      that spans them.
  
      Example usage: if we wanted to represent the origin of the "x1:x2"
      term, we could do ``Origin.combine([x1_obj, x2_obj])``.
  
      Single argument is an iterable, and each element in the iterable
      should be either:
  
      * An Origin object
      * ``None``
      * An object that has a ``.origin`` attribute which fulfills the above
        criteria.
  
      Returns either an Origin object, or None.
      """
      origins = []
      for obj in origin_objs:
          if obj is not None and not isinstance(obj, Origin):
              obj = obj.origin
          if obj is None:
              continue
          origins.append(obj)
      if not origins:
          return None
      codes = set([o.code for o in origins])
      assert len(codes) == 1
      start = min([o.start for o in origins])
      end = max([o.end for o in origins])
      return cls(codes.pop(), start, end)
  
file_path: patsy/patsy/origin.py
label_desc: Use image node_id 2 for calling the Origin obj's underlying member method code with example usage: obj.combine(cls, origin_objs) and returns: cls, None