code: def get_default_connection():
    
    tid = id(threading.current_thread())
    conn = _conn_holder.get(tid)
    if not conn:
      with(_rlock):
        # No other thread would insert a value in our slot, so no need
        # to recheck existence inside the lock.
        if 'project_endpoint' not in _options and 'project_id' not in _options:
          _options['project_endpoint'] = helper.get_project_endpoint_from_env()
        if 'credentials' not in _options:
          _options['credentials'] = helper.get_credentials_from_env()
        # We still need the lock when caching the thread local connection so we
        # don't race with _conn_holder.clear() in set_options().
        _conn_holder[tid] = conn = connection.Datastore(**_options)
    return conn
docs: Returns the default datastore connection.
  
    Defaults endpoint to helper.get_project_endpoint_from_env() and
    credentials to helper.get_credentials_from_env().
  
    Use set_options to override defaults.