def _retrieve_grains(proxy):
 global GRAINS_CACHE
 if (not GRAINS_CACHE):
  GRAINS_CACHE = proxy['napalm.grains']()
 return GRAINS_CACHE

def _retrieve_grains ( proxy ) : global GRAINS_CACHE if ( not GRAINS_CACHE ) : GRAINS_CACHE = proxy [ 'napalm.grains' ] ( ) return GRAINS_CACHE
retrieves the grains from the network device if not cached already .