parameters: (self, piece_shape, source_shape_index_list)
return_statement: return ret
docstring: addPiece(piece_shape, source_shape_index_list): adds a piece. If the piece
          already exists, returns False, and only updates source<->piece map.
docstring_summary: addPiece(piece_shape, source_shape_index_list): adds a piece. If the piece
          already exists, returns False, and only updates source<->piece map.
docstring_tokens: addPiece ( piece_shape source_shape_index_list ) : adds a piece . If the piece already exists returns False and only updates source< - > piece map .
function: def addPiece(self, piece_shape, source_shape_index_list):
          """addPiece(piece_shape, source_shape_index_list): adds a piece. If the piece
          already exists, returns False, and only updates source<->piece map."""
  
          ret = False
          i_piece_existing = None
          hash = None
          if piece_shape.ShapeType != "Compound": # do not catch duplicate compounds
              hash = self.hasher_class(piece_shape)
              i_piece_existing, dummy = self._piece_to_index.get(hash, (None, None))
  
          if i_piece_existing is None:
              #adding
              self.pieces.append(piece_shape)
              i_piece_existing = len(self.pieces)-1
              if hash is not None:
                  self._piece_to_index[hash] = (i_piece_existing, piece_shape,)
              ret = True
          else:
              #re-adding
              ret = False
          for iSource in source_shape_index_list:
              if not i_piece_existing in self._pieces_from_source[iSource]:
                  self._pieces_from_source[iSource].append(i_piece_existing)
          return ret
function_tokens: def addPiece ( self , piece_shape , source_shape_index_list ) : ret = False i_piece_existing = None hash = None if piece_shape . ShapeType != "Compound" : # do not catch duplicate compounds hash = self . hasher_class ( piece_shape ) i_piece_existing , dummy = self . _piece_to_index . get ( hash , ( None , None ) ) if i_piece_existing is None : #adding self . pieces . append ( piece_shape ) i_piece_existing = len ( self . pieces ) - 1 if hash is not None : self . _piece_to_index [ hash ] = ( i_piece_existing , piece_shape , ) ret = True else : #re-adding ret = False for iSource in source_shape_index_list : if not i_piece_existing in self . _pieces_from_source [ iSource ] : self . _pieces_from_source [ iSource ] . append ( i_piece_existing ) return ret