title: unboundlocalerror local variable 'result' referenced before assignment
body: <p>This error was asked many times but I can't solve my problem by reading them.
  My code is:</p>
  
  <pre><code>def show_preference_list_isolated(isolated):
      preference_list_isolated = {
      (240, 323): [(164, 108),(178, 422),(152, 77),(126, 431)],
      (396, 168): [(178, 422),(164, 108),(126, 431),(152, 77)],
      (288, 235): [(178, 422),(126, 431),(152, 77),(164, 108)],
      (88, 248): [(164, 108),(178, 422),(152, 77),(126, 431)],
      }
      if isolated in preference_list_isolated:
          result = preference_list_isolated[isolated]
      return result
  
  def begin_matching(isolated):
      preference_list_isolated = show_preference_list_isolated(isolated)
      print(preference_list_isolated)
      for relay in preference_list_isolated:
  ....
  </code></pre>