title: Reformating a dictionary of list based on items in another list
body: <p>I have a dictionary of lists like</p>
  <pre><code>source = {&quot;name&quot;:[&quot;hans&quot;,&quot;james&quot;,&quot;mat&quot;],&quot;country&quot;:[&quot;spain&quot;],&quot;language&quot;:[&quot;english&quot;,&quot;french&quot;]}
  </code></pre>
  <p>and another list like</p>
  <pre><code>data_not_avail = [&quot;hans&quot;,&quot;spain&quot;,&quot;mat&quot;]
  </code></pre>
  <p>How is it possible to reformat source dictionary into the following format</p>
  <pre><code>{
   &quot;exist&quot;:{&quot;name&quot;:[&quot;james&quot;], &quot;language&quot;:[&quot;english&quot;,&quot;french&quot;]},
   &quot;not_exist&quot;:{&quot;name&quot;:[&quot;hans&quot;,&quot;mat&quot;], &quot;country&quot;:[&quot;spain&quot;]}
  }
  </code></pre>
  <p>I was trying to solve by finding the key of item which are present in list but it was not a success</p>
  <pre><code>data_result = {}
  keys_list = []
  for v in data_not_avail:
      keys = [key for key, value in source.items() if v in value]
      data_result.update({keys[0]:[v]})
      keys_list.extend(keys)
  </code></pre>