def _retrieve_channel_id(email, profile='telemetry'):
 key = 'telemetry.channels'
 auth = _auth(profile=profile)
 if (key not in __context__):
  get_url = (_get_telemetry_base(profile) + '/notification-channels?_type=EmailNotificationChannel')
  response = requests.get(get_url, headers=auth)
  if (response.status_code == 200):
   cache_result = {}
   for (index, alert) in enumerate(response.json()):
    cache_result[alert.get('email')] = alert.get('_id', 'false')
   __context__[key] = cache_result
 return __context__[key].get(email, False)

def _retrieve_channel_id ( email , profile = 'telemetry' ) : key = 'telemetry.channels' auth = _auth ( profile = profile ) if ( key not in __context__ ) : get_url = ( _get_telemetry_base ( profile ) + '/notification-channels?_type=EmailNotificationChannel' ) response = requests . get ( get_url , headers = auth ) if ( response . status_code == 200 ) : cache_result = { } for ( index , alert ) in enumerate ( response . json ( ) ) : cache_result [ alert . get ( 'email' ) ] = alert . get ( '_id' , 'false' ) __context__ [ key ] = cache_result return __context__ [ key ] . get ( email , False )
given an email address .