def _target(self, target: str | None) -> str:
        """Returns the target if not None or the default target.

        Raises:
            AssertionError: if both `target` and `default_target` are not set.
        """
        assert target is not None or self.default_target is not None, (
            'One must specify a target on this call, or a default_target on the service/client, '
            'but neither were set.'
        )
        return cast(str, target or self.default_target)
Returns the target if not None or the default target.

        Raises:
            AssertionError: if both `target` and `default_target` are not set.
        
cirq-ionq/cirq_ionq/ionq_client.py