def filter_bonds(bonds, pocket_indices):
	"""Get the bond list of bonds between atoms in the target's pocket."""
	# Keep only the bonds in the processed bonds list that are in the
	# target's pocket.
	filtered_bonds = [
		entry
		for entry in bonds
		if entry[0] in pocket_indices and entry[2] in pocket_indices
	]
	# Remap the entry indices to be between 0-number of atoms remaining,
	# to correspond to their positions in the coordinates array.
	index_mapping = dict(zip(pocket_indices, range(1, len(pocket_indices) + 1)))
	return [
		[index_mapping[entry[0]], entry[1], index_mapping[entry[2]]]
		for entry in filtered_bonds
	]