def _filter_kwargs(prefix, kwargs):
  """Return new kwargs matching a prefix, or empty dict if no matches."""
  tmp_kwargs = {}
  for kwarg, value in kwargs.items():
    if prefix in kwarg:
      kwarg = kwarg.lstrip(prefix)
      kwarg = kwarg.lstrip('_')
      tmp_kwargs[kwarg] = value
  return tmp_kwargs