def pseudo_partial(func, **kwargs):
  """Does the same thing as functool.partial but returns a function.

  Useful if an API (e.g., Keras) uses getargspec which doesn't handle functions.

  Arguments:
    func: function
    **kwargs: additional keyword arguments

  Returns:
    new_func: function
      a function which behaves like func(**kwargs)
  """

  def new_func():
    return func(**kwargs)

  return new_func