title: Pythonic conditional context management
body: <p>Is there a better way of achieving this:</p>
  
  <pre><code>if condition:                                                                                                                                      
      with context:                                                                                                       
          do_the_thing()                                                                                                                           
  else:                                                                                                                                            
      do_the_thing() 
  </code></pre>
  
  <p>Essentially, in both cases of the condition, the same thing is done, except that if the condition is true, it is done with a certain context.</p>