title: Retrieve specific dictionary of a larger one in Python
body: <p>I'm new to Python so I apologize is I confuse the terminology a bit...
  I'm given the following dictionary:</p>
  <pre><code>[
     {
        &quot;responseData&quot;:true,
        &quot;requestClass&quot;:&quot;MessageService&quot;,
        &quot;requestMethod&quot;:&quot;newMessage&quot;,
        &quot;requestId&quot;:1,
        &quot;__class__&quot;:&quot;ServerResponse&quot;
     },
     {
        &quot;responseData&quot;:{
           &quot;time&quot;:1590429080,
           &quot;__class__&quot;:&quot;Time&quot;
        },
        &quot;requestClass&quot;:&quot;TimeService&quot;,
        &quot;requestMethod&quot;:&quot;updateTime&quot;,
        &quot;requestId&quot;:1,
        &quot;__class__&quot;:&quot;ServerResponse&quot;
     },
     {
        &quot;responseData&quot;:[
           {
              &quot;value&quot;:16,
              &quot;type&quot;:&quot;recruitment_acceleration&quot;,
              &quot;__class__&quot;:&quot;RecruitmentAccelerationBonus&quot;
           },
           {
              &quot;value&quot;:3,
              &quot;type&quot;:&quot;daily_strategypoint&quot;,
              &quot;__class__&quot;:&quot;DailyStrategyPointBonus&quot;
           }
        ],
        &quot;requestClass&quot;:&quot;BonusService&quot;,
        &quot;requestMethod&quot;:&quot;getBonuses&quot;,
        &quot;requestId&quot;:1,
        &quot;__class__&quot;:&quot;ServerResponse&quot;
     },
     {
        &quot;responseData&quot;:{
           &quot;resources&quot;:{
              &quot;diplomacy&quot;:372,
              &quot;brush&quot;:0,
              &quot;marble&quot;:559
           },
           &quot;__class__&quot;:&quot;Resources&quot;
        },
        &quot;requestClass&quot;:&quot;ResourceService&quot;,
        &quot;requestMethod&quot;:&quot;getPlayerResources&quot;,
        &quot;requestId&quot;:1,
        &quot;__class__&quot;:&quot;ServerResponse&quot;
     },
     { # added missing bracket
        &quot;responseData&quot;:[
           {
              &quot;gridId&quot;:&quot;main&quot;,
              &quot;type&quot;:&quot;antiquesExchange&quot;,
              &quot;time&quot;:1590481057,
              &quot;__class__&quot;:&quot;Timer&quot;
           }
        ],
        &quot;requestClass&quot;:&quot;TimerService&quot;,
        &quot;requestMethod&quot;:&quot;getTimers&quot;,
        &quot;requestId&quot;:1,
        &quot;__class__&quot;:&quot;ServerResponse&quot;
     }
  ]
  </code></pre>
  <p>And need to extract the part contained in the same array as the <code>requestMethod</code> named <code>getPlayerResources</code>, in the current case:</p>
  <pre><code>{
     &quot;diplomacy&quot;:372,
     &quot;brush&quot;:0,
     &quot;marble&quot;:559
    }
  </code></pre>
  <p>I have tried multiple things with <code>find</code> or the sample below but never managed to get what I want.
  The position of the <code>getPlayerResources</code> may not always be the same, which complicate things.</p>
  <pre><code>    def search(values, searchFor):
          for k in values:
              print (values)
              print (k)
              for v in values[k]:
                  if searchFor in v:
                      return k
          return None
  
  
  if '/game/json' in request.path:
              responsestring = request.response.body
              response_json_object = json.loads(responsestring)
              
              for object in response_json_object:
                  for attribute, value in object.items():
                      if value != True and value != False:
                          result = search(value, 'getPlayerResources')
  </code></pre>