title: Sort a dictionary depending of some value
body: <pre><code>&quot;users&quot;: {
      &quot;673336994218377285&quot;: {&quot;votes&quot;: 5},
      &quot;541388453708038165&quot;: {&quot;votes&quot;: 1},
      &quot;845444326065700865&quot;: {&quot;votes&quot;: 9}
  }
  </code></pre>
  <p>How can I sort a dictionary depending on the &quot;votes&quot; key of the nested dictionary? The dictionary should look like this:</p>
  <pre><code>&quot;users&quot;: {
      &quot;845444326065700865&quot;: {&quot;votes&quot;: 9},
      &quot;673336994218377285&quot;: {&quot;votes&quot;: 5},
      &quot;541388453708038165&quot;: {&quot;votes&quot;: 1}
  }
  </code></pre>