title: Where does `gcloud.datastore` persist its local dev state, and how do I clear it?
body: <p>I am experimenting with <a href="https://cloud.google.com/appengine/docs/flexible/python/using-cloud-datastore" rel="nofollow">Google App Engine's flexible Python 3 environment and Cloud Datastore</a>. When testing locally, this (generally) calls for running your app in something like Gunicorn and accessing the Datastore API from <code>gcloud.datastore</code>. For example:</p>
  
  <pre class="lang-py prettyprint-override"><code>import gcloud.datastore as g_datastore
  ds = g_datastore.Client(...)
  entity = datastore.Entity(key=ds.key(...))
  ds.put(entity)
  </code></pre>
  
  <p>When run locally (in dev mode), Entities' states are persisted between runs. I can't for the life of me figure out where they are stored or how to clear the dev datastore that is created after creating/accessing <code>gcloud.datastore.Client</code>. As far as I can tell, it does not use the same place that <code>ndb</code> uses when run via <code>dev_appserver.py</code>.</p>
  
  <p>I've tried to figure it out with something like this (when running OS X):</p>
  
  <pre class="lang-sh prettyprint-override"><code>$ touch foo
  $ GCLOUD_PROJECT=... python .../main.py
   * Running on http://127.0.0.1:8080/ (Press CTRL+C to quit)
   * Restarting with stat
   * Debugger is active!
   * Debugger pin code: ...
  127.0.0.1 - - [04/Jul/2016 10:36:01] "GET / HTTP/1.1" 200 -
  ...
  ^C
  $ sudo find /private/tmp /var/db /var/tmp ~/.config/gcloud ~/Library -newer foo
  ...
  # nothing meaningful
  </code></pre>
  
  <p>I tried looking at the source code, and found <a href="https://github.com/GoogleCloudPlatform/gcloud-python/blob/master/system_tests/clear_datastore.py" rel="nofollow">some unit test cleanup code</a> that: a) isn't distributed with <code>pip install gcloud</code>; and (more important for me) b) doesn't give any clue as to where that stuff is actually stored.</p>
  
  <p>I've even tried this while Gunicorn was running:</p>
  
  <pre class="lang-sh prettyprint-override"><code>$ sudo lsof | grep -Ei 'python'
  # nothing meaningful
  </code></pre>
  
  <p>Where the foo does <code>gcloud.datastore</code> store its state between runs when run locally (in dev mode)?!</p>