title: How to extract the dictionary from list of dictionary with condition
body: <p>How to extract from the json with condition</p>
  <p>I have  a list of dictionary. I need extract some of the dictionary with some conditions</p>
  <ul>
  <li><p>If for cross field I need &quot;AND&quot; condition</p>
  </li>
  <li><p>for same field array I need to OR condition</p>
  </li>
  </ul>
  <ol>
  <li><p>I need to search <code>subject</code> which is <code>Physics</code> or <code>Accounting</code> this is array of fields(OR) statement</p>
  <p>AND</p>
  </li>
  <li><p>I need to search <code>type</code> is <code>Permanent</code> or <code>GUEST</code> condition this is array of fields(OR) statement</p>
  <p>AND</p>
  </li>
  <li><p>I need to search <code>Location</code> is <code>NY</code>(&amp;) condition</p>
  </li>
  </ol>
  <pre><code>test = [{'id':1,'name': 'A','subject': ['Maths','Accounting'],'type':'Contract', 'Location':'NY'},
        { 'id':2,'name': 'AB','subject': ['Physics','Engineering'],'type':'Permanent','Location':'NY'},
      {'id':3,'name': 'ABC','subject': ['Maths','Engineering'],'type':'Permanent','Location':'NY'},
  {'id':4,'name':'ABCD','subject': ['Physics','Engineering'],'type':['Contract','Guest'],'Location':'NY'}]
  </code></pre>
  <p>Expected out is id <code>[{ 'id':2,'name': 'AB','subject': ['Physics','Engineering'],'type':'Permanent','Location':'NY'},{'id':4,'name':'ABCD','subject': ['Physics','Engineering'],'type':['Contract','Guest'],'Location':'NY'}]</code></p>