def issue_section(issue):
 labels = issue.get('labels', [])
 for label in labels:
  if (not label['name'].startswith('type: ')):
   continue
  if (label['name'] in LOG_SECTION):
   return LOG_SECTION[label['name']]
  elif (label['name'] in IGNORE_ISSUE_TYPE):
   return None
  else:
   logging.warn('unknown issue type: "{}" for: {}'.format(label['name'], issue_line(issue)))
 return None

def issue_section ( issue ) : labels = issue . get ( 'labels' , [ ] ) for label in labels : if ( not label [ 'name' ] . startswith ( 'type: ' ) ) : continue if ( label [ 'name' ] in LOG_SECTION ) : return LOG_SECTION [ label [ 'name' ] ] elif ( label [ 'name' ] in IGNORE_ISSUE_TYPE ) : return None else : logging . warn ( 'unknown issue type: "{}" for: {}' . format ( label [ 'name' ] , issue_line ( issue ) ) ) return None
returns the section heading for the issue .