code: def _cast_to_frameset(cls, other):
          
          if isinstance(other, FrameSet):
              return other
          try:
              return FrameSet(other)
          except Exception:
              return NotImplemented
docs: Private method to simplify comparison operations.
  
          Args:
              other (:class:`FrameSet` or set or frozenset or or iterable): item to be compared
  
          Returns:
              :class:`FrameSet`
  
          Raises:
              :class:`NotImplemented`: if a comparison is impossible