code: def get_index_by_name(self, name):
          
          for i in range(self.n_blocks):
              if self.get_block_name(i) == name:
                  return i
          raise KeyError('Block name ({}) not found'.format(name))
docs: Find the index number by block name