code: def _set_locations(self, element, indices, mode, complete=False):
          r
          boss = self.project.find_full_domain(self)
          element = self._parse_element(element=element, single=True)
  
          # Make sure label array exists in boss
          if (element+'.'+self.name) not in boss.keys():
              boss[element+'.'+self.name] = False
  
          # Check to ensure indices aren't already assigned
          if mode == 'add':
              if self._isa('geometry'):
                  objs = self.project.geometries().keys()
              else:
                  objs = self.project.physics().keys()
              for name in objs:
                  if element+'.'+name in boss.keys():
                      if np.any(boss[element+'.'+name][indices]):
                          raise Exception('Given indices are already assigned ' +
                                          'to ' + name)
  
          # Find mask of existing locations (network indexing)
          mask = boss[element+'.'+self.name]
          # Update mask with new locations (either add or remove)
          if mode == 'add':
              mask = mask + boss._tomask(indices=indices, element=element)
          elif mode == 'drop':
              mask = mask * (~boss._tomask(indices=indices, element=element))
          # Change size of all arrays on self
          for item in self.keys(element=element, mode='all'):
              self.update({item: boss[item][mask]})
          # Update label array in network
          boss[element+'.'+self.name] = mask
          # Remove label from boss if ALL locations are removed
          if mode == 'drop':
              if ~np.any(boss[element+'.'+self.name]):
                  if complete:
                      del boss[element+'.'+self.name]
                  else:
                      boss[element+'.'+self.name] = False
docs: r"""
          This private method is called by ``set_locations`` and
          ``remove_locations`` as needed.