def generic_cdp_parser(pattern, cdp):
 cdp = cdp.split('\n')
 for line in cdp:
  re_pattern = re.search(pattern, line)
  if re_pattern:
   return_val = re_pattern.group(1)
   return return_val.strip()
 return ''

def generic_cdp_parser ( pattern , cdp ) : cdp = cdp . split ( '\n' ) for line in cdp : re_pattern = re . search ( pattern , line ) if re_pattern : return_val = re_pattern . group ( 1 ) return return_val . strip ( ) return ''
search for pattern in the cdp data return relevant .