title: Pass **kwargs through to inner function
body: <p>I have a function</p>
  
  <pre><code>def wrapper_function(url, **kwargs)
     def foo():
        if kwargs:
            return do_something(url, kwargs)
        else:
            return do_something(url)
  </code></pre>
  
  <p>The <code>do_something()</code> function can either have one or more parameters.</p>
  
  <p>When I call the <code>wrapper_function()</code>, want to call it either like </p>
  
  <pre><code>wrapper_function('www.bar.com')
  </code></pre>
  
  <p>or </p>
  
  <pre><code>wrapper_function('www.bar.com', selected_clients=clients)
  </code></pre>
  
  <p>so that <code>do_something('www.bar.com', selected_clients=clients)</code>.</p>
  
  <p>However, when I approach it like this, I get an error
  <code>clients is not defined</code>.</p>
  
  <p>How can I pass on the params exactly like they are with the keyword into an inner function? Important, that keyword needs to be variable as well.</p>