def __contains__(self, chip_core_or_link):
        """Test if a given chip, core or link is present and alive.

        Parameters
        ----------
        chip_core_or_link : tuple
            * If of the form (x, y, :py:class:`~rig.links.Links`), checks the
              link is present.
            * If of the form (x, y, p), checks the core is present.
            * If of the form (x, y, p,
              :py:class:`~rig.machine_control.consts.AppState`), checks the
              core is present and in the specified state.
            * If of the form (x, y), checks the chip is present.
        """
        if len(chip_core_or_link) == 2:
            return super(SystemInfo, self).__contains__(chip_core_or_link)
        elif (len(chip_core_or_link) == 3 and
              isinstance(chip_core_or_link[2], Links)):
            x, y, link = chip_core_or_link
            chip = self.get((x, y))
            return chip is not None and link in chip.working_links
        elif (len(chip_core_or_link) == 3 and
              isinstance(chip_core_or_link[2], six.integer_types)):
            x, y, p = chip_core_or_link
            chip = self.get((x, y))
            return chip is not None and 0 <= p < chip.num_cores
        elif len(chip_core_or_link) == 4:
            x, y, p, state = chip_core_or_link
            chip = self.get((x, y))
            return (chip is not None and
                    0 <= p < chip.num_cores and
                    chip.core_states[p] == state)
        else:
            raise ValueError(
                "Expect either (x, y) (x, y, p), (x, y, p, state) "
                "or (x, y, link).")
def __contains__ ( self , chip_core_or_link ) : if len ( chip_core_or_link ) == 2 : return super ( SystemInfo , self ) . __contains__ ( chip_core_or_link ) elif ( len ( chip_core_or_link ) == 3 and isinstance ( chip_core_or_link [ 2 ] , Links ) ) : x , y , link = chip_core_or_link chip = self . get ( ( x , y ) ) return chip is not None and link in chip . working_links elif ( len ( chip_core_or_link ) == 3 and isinstance ( chip_core_or_link [ 2 ] , six . integer_types ) ) : x , y , p = chip_core_or_link chip = self . get ( ( x , y ) ) return chip is not None and 0 <= p < chip . num_cores elif len ( chip_core_or_link ) == 4 : x , y , p , state = chip_core_or_link chip = self . get ( ( x , y ) ) return ( chip is not None and 0 <= p < chip . num_cores and chip . core_states [ p ] == state ) else : raise ValueError ( "Expect either (x, y) (x, y, p), (x, y, p, state) " "or (x, y, link)." )
Test if a given chip, core or link is present and alive.

        Parameters
        ----------
        chip_core_or_link : tuple
            * If of the form (x, y, :py:class:`~rig.links.Links`), checks the
              link is present.
            * If of the form (x, y, p), checks the core is present.
            * If of the form (x, y, p,
              :py:class:`~rig.machine_control.consts.AppState`), checks the
              core is present and in the specified state.
            * If of the form (x, y), checks the chip is present.