title: Sort JSON Array in Python by proximity to a value
body: <p>i want to sort a JSON Array in a very specific way using python.
  This is an example of the JSON i want to sort:</p>
  
  <pre><code>[
  {'name': 'ZARA', 'risk': {'long': 3.9119195349019025, 'medium': 5, 'short': 4.485673554927903}}, 
  {'name': 'SANTANDER', 'risk': {'long': 4.712942479560081, 'medium': 5, 'short': 4.348982243206375}}, 
  {'name': 'BBC', 'risk': {'long': 5, 'medium': 5, 'short': 5}}, 
  {'name': 'DISNEY', 'risk': {'long': 5, 'medium': 5, 'short': 5}}, 
  {'name': 'BBVA', 'risk': {'long': 5, 'medium': 5, 'short': 5}}, 
  {'name': 'IBEX35', 'risk': {'long': 4.8565761936412235, 'medium': 1.9216799766282, 'short': 1.3943451064412182}}
  ]
  </code></pre>
  
  <p>on the other side i have a value given, for example 3.
  What I need is to order the elements of the given array according to the proximity of the risk short to the given value (3 in this case).
  The result given must be the JSON array given ordered, in this  case the order must be that:</p>
  
  <pre><code>1º:
  {'name': 'SANTANDER', 'risk': {'long': 4.712942479560081, 'medium': 5, 'short': 4.348982243206375}}
  
  2º:
  {'name': 'ZARA', 'risk': {'long': 3.9119195349019025, 'medium': 5, 'short': 4.485673554927903}}´
  
  3º:
  {'name': 'IBEX35', 'risk': {'long': 4.8565761936412235, 'medium': 1.9216799766282, 'short': 1.3943451064412182}}
  
  4º:
  {'BBC', 'risk': {'long': 5, 'medium': 5, 'short': 5}}
  
  5º:
  {'name': 'DISNEY', 'risk': {'long': 5, 'medium': 5, 'short': 5}}
  
  6º:
  {'name': 'BBVA', 'risk': {'long': 5, 'medium': 5, 'short': 5}}
  </code></pre>