title: Decorator for functions with positional arguments, with commonly named argument
body: <p>I have a set of functions/methods that all have different set of positional arguments and- in some cases - keyword arguments too, but share one string argument named <em>lane_type</em>. It may be either positional or keyword argument.
  Due to design flaw (guilty as charged) the same value in different places may have capital letters in the string. Therefore for comparisons I have to convert it to lower case.
  Eventually I decided to try and make the conversion through the decorator:</p>
  
  <pre><code>def lt_dec(func):
      def _lt_lower(**kwargs):
          kwargs['lane_type'] = kwargs['lane_type'].lower()
          return func(**kwargs)
      return _lt_lower
  </code></pre>
  
  <p>Of course, I tried to test it - and it failed:</p>
  
  <pre><code>In [38]: @lt_dec
  def test1(lane_type):
      print lane_type
     ....:     
  
  In [39]: test1('Solid')
  ---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  /homes/markg/&lt;ipython-input-39-bb6cef5c7fad&gt; in &lt;module&gt;()
  ----&gt; 1 test1('Solid')
  
  TypeError: _lt_lower() takes exactly 0 arguments (1 given)
  </code></pre>
  
  <p>Obviously, I do not fully understand **kwargs substitution mechanism. I will really appreciate an explanation what I am missing and if there is an elegant solution for my problem.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I believe I should show some examples of function definitions for clarity:
  Here is one method from a class</p>
  
  <pre><code>def add_polygon(self, points, lane_type, color):
  </code></pre>
  
  <p>A method from another class:</p>
  
  <pre><code>def __init__(self, points, lane_type, color, side=None):
  </code></pre>
  
  <p>A function</p>
  
  <pre><code>def lane_weight(lane_type):
  </code></pre>
  
  <p>Of course, for a function with 1 argument (I have several of those) the solution is simple</p>
  
  <pre><code>def lt_dec(func):
      def _lt_lower(lane_type):
          return func(lane_type)
      return _lt_lower
  </code></pre>
  
  <p>As is have stated above - is there is a generic solution that for all of the examples shown? (I am ready to accept No as answer)</p>