class_docstr: Simple matrix data type.
  
  Of course there are much more advanced matrix data types for Python (for
  instance, the C{ndarray} data type of Numeric Python) and this implementation
  does not want to compete with them. The only role of this data type is to
  provide a convenient interface for the matrices returned by the C{Graph}
  object (for instance, allow indexing with tuples in the case of adjacency
  matrices and so on).
class_docstr_tok: ["Simple","matrix","data","type",".","Of","course","there","are","much","more","advanced","matrix","data","types","for","Python","(","for","instance",",","the","C","{","ndarray","}","data","type","of","Numeric","Python",")","and","this","implementation","does","not","want","to","compete","with","them",".","The","only","role","of","this","data","type","is","to","provide","a","convenient","interface","for","the","matrices","returned","by","the","C","{","Graph","}","object","(","for","instance",",","allow","indexing","with","tuples","in","the","case","of","adjacency","matrices","and","so","on",")","."]
docstr: Returns a single item, a row or a column of the matrix
  
  @param i: if a single integer, returns the M{i}th row as a list. If a
    slice, returns the corresponding rows as another L{Matrix} object. If
    a 2-tuple, the first element of the tuple is used to select a row and
    the second is used to select a column.
code: def __getitem__(self, i):
      """Returns a single item, a row or a column of the matrix
  
      @param i: if a single integer, returns the M{i}th row as a list. If a
        slice, returns the corresponding rows as another L{Matrix} object. If
        a 2-tuple, the first element of the tuple is used to select a row and
        the second is used to select a column.
      """
      if isinstance(i, int):
          return list(self._data[i])
      elif isinstance(i, slice):
          return self.__class__(self._data[i])
      elif isinstance(i, tuple):
          try:
              first = i[0]
          except IndexError:
              first = slice(None)
          try:
              second = i[1]
          except IndexError:
              second = slice(None)
          if type(first) == slice and type(second) == slice:
              return self.__class__(
                  row[second] for row in self._data[first]
              )
          elif type(first) == slice:
              return [row[second] for row in self._data[first]]
          else:
              return self._data[first][second]
      else:
          raise IndexError("invalid matrix index")
  
label_desc: Use image node_id 10 for calling the Matrix obj's underlying member method code with example usage: obj.__getitem__(i) and returns: list, self, self, unknown, self