title: Reusing or creating a google storage.Client()
body: <p>I'm working with Google Cloud Storage. One of its best practices is to reuse the clients. I've written several functions which I would like to be run with the possibility of not reusing the client.
  The coder would be the one to decide that, by using the <code>reuse_cl</code> variable.</p>
  <p>I was wondering why the following script does not work:</p>
  <pre><code>def test_storage(bucket_name,reuse_cl=True):
      if not reuse_cl:
          storage_client = storage.Client()
      bucket = storage_client.bucket(bucket_name)
      list_blobs = list(bucket.list_blobs())
  
  if __name__ == &quot;__main__&quot;:
      storage_client = storage.Client()
      test_storage(BUCKET_NAME)
  </code></pre>
  <p>If I comment out the if in the test_storage, then everything works out fine. Is there a way of making the script work, and preserve the ability to create a client inside the function?</p>