docs: def _get_candidate_swap(resources, location,
                          l2v, vertices_resources, fixed_vertices, machine):
      """Given a chip location, select a set of vertices which would have to be
      moved elsewhere to accommodate the arrival of the specified set of
      resources.
  
      Parameters
      ----------
      resources : {resource: value, ...}
          The amount of resources which are required at the specified location.
      location : (x, y)
          The coordinates of the chip where the resources are sought.
      l2v : {(x, y): [vertex, ...], ...}
      vertices_resources : {vertex: {resource: value, ...}, ...}
      fixed_vertices : {vertex, ...}
      machine : :py:class:`rig.place_and_route.Machine`
  
      Returns
      -------
      [Vertex, ...] or None
          If a (possibly empty) list, gives the set of vertices which should be
          removed from the specified location to make room.
  
          If None, the situation is impossible.
      """
      # The resources already available at the given location
      chip_resources = machine[location]
  
      # The set of vertices at that location
      vertices = l2v[location]
  
      # The set of vertices to be moved from the location to free up the
      # specified amount of resources
      to_move = []
  
      # While there's not enough free resource, remove an arbitrary (movable)
      # vertex from the chip.
      i = 0
      while overallocated(subtract_resources(chip_resources, resources)):
          if i >= len(vertices):
              # Run out of vertices to remove from this chip, thus the situation
              # must be impossible.
              return None
          elif vertices[i] in fixed_vertices:
              # Can't move fixed vertices, just skip them.
              i += 1
              continue
          else:
              # Work out the cost change when we remove the specified vertex
              vertex = vertices[i]
              chip_resources = add_resources(chip_resources,
                                             vertices_resources[vertex])
              to_move.append(vertex)
              i += 1
  
      return to_move