def adapt(chart, data):
 if isinstance(chart, pygal.XY):
  return data
 data = cut(data)
 if isinstance(chart, BaseMap):
  return list(map((lambda x: (chart.__class__.x_labels[(int(x) % len(chart.__class__.x_labels))] if (x is not None) else None)), data))
 return data

def adapt ( chart , data ) : if isinstance ( chart , pygal . XY ) : return data data = cut ( data ) if isinstance ( chart , BaseMap ) : return list ( map ( ( lambda x : ( chart . __class__ . x_labels [ ( int ( x ) % len ( chart . __class__ . x_labels ) ) ] if ( x is not None ) else None ) ) , data ) ) return data
adapt data to chart type .