def _GetDatastoreStats(kinds_list, use_stats_kinds=False):
 global_stat = stats.GlobalStat.all().fetch(1)
 if (not global_stat):
  return _KindsListToTuple(kinds_list)
 global_ts = global_stat[0].timestamp
 kind_stats = stats.KindStat.all().filter('timestamp =', global_ts).fetch(1000)
 if (not kind_stats):
  return _KindsListToTuple(kinds_list)
 results = {}
 for kind_ent in kind_stats:
  if ((not kind_ent.kind_name.startswith('__')) and (use_stats_kinds or (kind_ent.kind_name in kinds_list)) and (kind_ent.count > 0)):
   results[kind_ent.kind_name] = _PresentatableKindStats(kind_ent)
 utils.CacheStats(results.values())
 for kind_str in (kinds_list or []):
  if (kind_str not in results):
   results[kind_str] = {'kind_name': kind_str}
 return (global_ts, sorted(results.values(), key=(lambda x: x['kind_name'])))

def _GetDatastoreStats ( kinds_list , use_stats_kinds = False ) : global_stat = stats . GlobalStat . all ( ) . fetch ( 1 ) if ( not global_stat ) : return _KindsListToTuple ( kinds_list ) global_ts = global_stat [ 0 ] . timestamp kind_stats = stats . KindStat . all ( ) . filter ( 'timestamp =' , global_ts ) . fetch ( 1000 ) if ( not kind_stats ) : return _KindsListToTuple ( kinds_list ) results = { } for kind_ent in kind_stats : if ( ( not kind_ent . kind_name . startswith ( '__' ) ) and ( use_stats_kinds or ( kind_ent . kind_name in kinds_list ) ) and ( kind_ent . count > 0 ) ) : results [ kind_ent . kind_name ] = _PresentatableKindStats ( kind_ent ) utils . CacheStats ( results . values ( ) ) for kind_str in ( kinds_list or [ ] ) : if ( kind_str not in results ) : results [ kind_str ] = { 'kind_name' : kind_str } return ( global_ts , sorted ( results . values ( ) , key = ( lambda x : x [ 'kind_name' ] ) ) )
retrieves stats for kinds .