def is_ax_end(r):
 if isinstance(r, GlyphRenderer):
  try:
   if (r.data_source.data['name'] == 'ax_end'):
    return True
  except KeyError:
   return False
 else:
  return False

def is_ax_end ( r ) : if isinstance ( r , GlyphRenderer ) : try : if ( r . data_source . data [ 'name' ] == 'ax_end' ) : return True except KeyError : return False else : return False
check if the name in the glyphs datasource is ax_end .