def _place_bond(self, a1, a2, btype):
    """Possibly add a new bond to the current config.

    If the bond can be placed, updates self._current_bonds_attached for
    both `a`` and `a2`.
    Args:
      a1:
      a2:
      btype:

    Returns:
      Bool.
    """
    if self._current_bonds_attached[a1] + btype > self._max_bonds[a1]:
      return False
    if self._current_bonds_attached[a2] + btype > self._max_bonds[a2]:
      return False

    self._current_bonds_attached[a1] += btype
    self._current_bonds_attached[a2] += btype
    return True