def _get_channel_or_create(self, channel: str) -> subject.Subject:
    """Create a channel if one doesn't already exist.

    Assumes the channels lock has been acquired. Raises RuntimeError if not.

    Args:
      channel: The channel name to create.

    Returns:
      The channel with the given name.

    Raises:
      RuntimeError: if the channels lock is not acquired.
    """
    if not self._channels_lock.locked():
      raise RuntimeError('Channels lock is not acquired.')
    if channel not in self._channels:
      # TODO(b/313610238): Maybe limit the number of new channels
      self._channels[channel] = subject.ReplaySubject()
    return self._channels[channel]
Create a channel if one doesn't already exist.

    Assumes the channels lock has been acquired. Raises RuntimeError if not.

    Args:
      channel: The channel name to create.

    Returns:
      The channel with the given name.

    Raises:
      RuntimeError: if the channels lock is not acquired.
    
concordia/utils/deprecated/measurements.py