title: How can I pass key-value to decorator in python?
body: <p>I am trying to validate the dictionary parameter.</p>
  
  <pre class="lang-py prettyprint-override"><code>import logging
  import os
  # decorator
  def file_validator(f):
      def wrapped(*args):
          """
          Once there is passed values,
          file_path = os.path.join(path_info, file_info)
          if os.path.exists(file_path):
              logging.info('{} exists'.format(file_info))
          else:
              logging.info('{} does not exist'.format(file_info))
          """
  
  # original function
  @file_validator
  def original_function(file_dict):
      # pass only specific element to file_validator decorator for checking
      # for example only "pathA": "/files", "fileA": "bar.csv"
  
  sample_dict = {"pathA": "/files", "fileA": "bar.csv", "fileB": "hello.txt"}
  original_function(sample_dict)
  </code></pre>
  
  <p>Is there a way to check this way using decorator?<br/>
  <strong>EDIT</strong>
  This could be equivalent to what I want to do.</p>
  
  <pre class="lang-py prettyprint-override"><code>def file_validator(filepath, filename):
      file_path = os.path.join(filepath + filename)
      if os.path.exists(file_path):
          logging.info('{} exists'.format(filename))
      else:
          logging.info('{} does not exist'.format(filename))
  
  def original_function(file_dict):
      file_validator(file_dict['pathA'], file_dict['fileA'])
      file_validator(file_dict['pathA'], file_dict['fileB'])
  
  sample_dict = {"pathA": "/files", "fileA": "bar.csv", "fileB": "hello.txt"}
  original_function(sample_dict)
  </code></pre>