text: 
  from cProfile import label
  import numpy as np
  import matplotlib.pyplot as plt
  
  def p1():
      
      x = np.arange(0, 100, 1)
      y1 = np.array([0.3956,0.4062,0.4597,0.475,0.5045,0.5223,0.5504,0.5555,0.5616,0.5771,0.5832,0.5762,0.6068,0.6091,0.6,0.6061,0.6237,0.6215,0.6209,0.6397,0.6385,0.6334,0.6353,0.6537,0.6522,0.6561,0.6535,0.643,0.6484,0.6652,0.6585,0.6691,0.6706,0.6576,0.6864,0.6698,0.6863,0.6787,0.6976,0.6791,0.6857,0.6961,0.6766,0.7011,0.6842,0.6952,0.7084,0.6699,0.7114,0.7091,0.7239,0.7238,0.7264,0.7271,0.723,0.7257,0.7234,0.7246,0.7284,0.7233,0.7272,0.7259,0.7278,0.7256,0.7286,0.7247,0.7262,0.7268,0.7254,0.7273,0.7267,0.7288,0.7259,0.7271,0.7271,0.7295,0.7266,0.7266,0.7278,0.7273,0.7276,0.7285,0.7269,0.729,0.7275,0.7288,0.7263,0.7317,0.7286,0.7293,0.7276,0.726,0.7233,0.7296,0.7319,0.7297,0.7271,0.7316,0.7303,0.7279])
      plt.plot(x, y1, label='centralized', color='green')
      y2 = np.array([0.1599,0.2613,0.3608,0.4013,0.4233,0.4446,0.4592,0.4648,0.4754,0.4878,0.5024,0.5095,0.5134,0.5306,0.5387,0.545,0.5477,0.5544,0.561,0.5661,0.5669,0.5719,0.5804,0.5868,0.5848,0.5898,0.5922,0.5956,0.5938,0.6058,0.6056,0.6093,0.6098,0.6139,0.6121,0.6195,0.6244,0.6248,0.6302,0.6307,0.6294,0.6284,0.6299,0.6345,0.6355,0.6443,0.6406,0.6437,0.6438,0.6499,0.6485,0.65,0.6499,0.6493,0.6498,0.6524,0.6523,0.6531,0.6532,0.6519,0.6521,0.6512,0.6527,0.6527,0.6522,0.654,0.6523,0.6521,0.6531,0.6529,0.6557,0.654,0.6542,0.6542,0.6548,0.653,0.6546,0.6556,0.6559,0.6559,0.655,0.6551,0.6565,0.6567,0.6566,0.659,0.659,0.6581,0.6596,0.66,0.6588,0.6603,0.6594,0.6585,0.6581,0.6598,0.6598,0.6585,0.6598,0.6597])
      plt.plot(x, y2, label='iid', color='blue')
      y3 = np.array([0.1029,0.0998,0.1196,0.1956,0.2037,0.2515,0.2648,0.2844,0.2731,0.3117,0.2906,0.3148,0.3246,0.3131,0.3339,0.3301,0.3471,0.3514,0.3474,0.3679,0.3583,0.3683,0.3684,0.3684,0.3853,0.3724,0.3943,0.3707,0.3779,0.3865,0.3975,0.4025,0.4029,0.4079,0.4116,0.4092,0.4162,0.4187,0.4213,0.4321,0.4218,0.4418,0.4336,0.4417,0.4419,0.431,0.44,0.4537,0.4114,0.4535,0.4801,0.4805,0.4831,0.4814,0.4835,0.4832,0.4822,0.4857,0.4865,0.4885,0.4884,0.4868,0.4895,0.4886,0.4887,0.4902,0.4898,0.4901,0.4898,0.4921,0.4906,0.4908,0.4946,0.4947,0.4933,0.494,0.4947,0.494,0.4943,0.4925,0.4928,0.4974,0.4941,0.4936,0.4933,0.4958,0.4928,0.4956,0.4961,0.4958,0.4966,0.4949,0.4963,0.4971,0.4952,0.4976,0.4945,0.4949,0.4938,0.4968])
      plt.plot(x, y3, label='noniid', color='red')
  
      plt.rc('font', size=16)
      plt.subplots_adjust(0.15, 0.15, 0.95, 0.95)
  
      plt.xlabel('Training Round', fontsize=20)
      plt.ylabel('Accuracy', fontsize=20)
      plt.xticks(fontsize=16)
      plt.yticks(fontsize=16)
      plt.grid(True)
      plt.legend()
  
      plt.savefig('no_selection.pdf')
      plt.savefig('no_selection.png')
  
  
  def p2():
      full = np.array([0.101,0.2627,0.3495,0.3939,0.4185,0.4365,0.4519,0.4622,0.4785,0.4901,0.5014,0.504,0.5122,0.5256,0.5288,0.5298,0.5399,0.5421,0.5483,0.5577,0.5584,0.5665,0.5689,0.5698,0.5818,0.5872,0.5797,0.5962,0.5948,0.6012,0.6027,0.6062,0.6013,0.6025,0.6162,0.6132,0.6151,0.6192,0.62,0.6215,0.6203,0.6301,0.6326,0.6304,0.6314,0.6382,0.6411,0.6405,0.6431,0.6351,0.649,0.6506,0.6506,0.6524,0.6531,0.653,0.6534,0.6556,0.6542,0.6541,0.6551,0.658,0.6564,0.6546,0.6546,0.6565,0.6565,0.6577,0.658,0.6584,0.6579,0.6596,0.6574,0.6585,0.6579,0.6587,0.6605,0.6622,0.6616,0.66,0.662,0.662,0.6617,0.6642,0.6636,0.6656,0.6649,0.6644,0.6662,0.665,0.6662,0.6664,0.6653,0.6645,0.6653,0.6655,0.6658,0.6676,0.6673,0.6677])
      half = np.array([0.1007,0.2079,0.2585,0.3023,0.3414,0.359,0.3841,0.3964,0.4142,0.4301,0.4393,0.4481,0.4642,0.4738,0.4837,0.4898,0.4961,0.5064,0.5127,0.5163,0.5269,0.5313,0.5332,0.5341,0.5475,0.543,0.544,0.5444,0.5642,0.5548,0.5674,0.5696,0.5752,0.5774,0.5805,0.5767,0.5873,0.5855,0.5908,0.5957,0.5885,0.5918,0.6008,0.603,0.5978,0.6025,0.6066,0.6113,0.6101,0.6171,0.6205,0.6209,0.6224,0.6223,0.6234,0.6236,0.6261,0.6261,0.6246,0.6263,0.6257,0.6267,0.6273,0.6245,0.6271,0.6263,0.6289,0.6283,0.6278,0.63,0.6289,0.6297,0.6294,0.629,0.6297,0.6301,0.6295,0.6324,0.6288,0.6344,0.6323,0.6321,0.6329,0.6336,0.6326,0.6329,0.6331,0.634,0.6334,0.6344,0.6346,0.6342,0.6347,0.6367,0.6368,0.6358,0.6368,0.6361,0.6367,0.6358])
      single = np.array([0.1225,0.2831,0.3382,0.3667,0.387,0.3987,0.4138,0.4179,0.4264,0.4317,0.4322,0.438,0.4467,0.4477,0.4531,0.4511,0.457,0.4634,0.4703,0.4674,0.473,0.4805,0.4777,0.4838,0.4834,0.481,0.4804,0.4875,0.4823,0.4898,0.4903,0.4927,0.4928,0.4912,0.4937,0.4946,0.4952,0.4977,0.487,0.4964,0.4967,0.4933,0.4962,0.4963,0.4958,0.5017,0.5043,0.4995,0.5018,0.501,0.5068,0.5057,0.5042,0.5051,0.504,0.5024,0.5037,0.5041,0.5023,0.5016,0.5013,0.502,0.5,0.5012,0.5008,0.4987,0.5013,0.4981,0.5001,0.5001,0.5003,0.4988,0.4981,0.4992,0.4999,0.4986,0.4979,0.4985,0.4972,0.4969,0.4994,0.499,0.4992,0.5001,0.4969,0.4971,0.4975,0.4983,0.498,0.4965,0.4958,0.4975,0.4952,0.4968,0.4983,0.4945,0.4934,0.4954,0.4947,0.4958])
  
      x = np.arange(0, 100, 1)
      plt.plot(x, full, label='full', color='green')
      y2 = np.array([0.1599,0.2613,0.3608,0.4013,0.4233,0.4446,0.4592,0.4648,0.4754,0.4878,0.5024,0.5095,0.5134,0.5306,0.5387,0.545,0.5477,0.5544,0.561,0.5661,0.5669,0.5719,0.5804,0.5868,0.5848,0.5898,0.5922,0.5956,0.5938,0.6058,0.6056,0.6093,0.6098,0.6139,0.6121,0.6195,0.6244,0.6248,0.6302,0.6307,0.6294,0.6284,0.6299,0.6345,0.6355,0.6443,0.6406,0.6437,0.6438,0.6499,0.6485,0.65,0.6499,0.6493,0.6498,0.6524,0.6523,0.6531,0.6532,0.6519,0.6521,0.6512,0.6527,0.6527,0.6522,0.654,0.6523,0.6521,0.6531,0.6529,0.6557,0.654,0.6542,0.6542,0.6548,0.653,0.6546,0.6556,0.6559,0.6559,0.655,0.6551,0.6565,0.6567,0.6566,0.659,0.659,0.6581,0.6596,0.66,0.6588,0.6603,0.6594,0.6585,0.6581,0.6598,0.6598,0.6585,0.6598,0.6597])
      plt.plot(x, half, label='half', color='blue')
      y3 = np.array([0.1029,0.0998,0.1196,0.1956,0.2037,0.2515,0.2648,0.2844,0.2731,0.3117,0.2906,0.3148,0.3246,0.3131,0.3339,0.3301,0.3471,0.3514,0.3474,0.3679,0.3583,0.3683,0.3684,0.3684,0.3853,0.3724,0.3943,0.3707,0.3779,0.3865,0.3975,0.4025,0.4029,0.4079,0.4116,0.4092,0.4162,0.4187,0.4213,0.4321,0.4218,0.4418,0.4336,0.4417,0.4419,0.431,0.44,0.4537,0.4114,0.4535,0.4801,0.4805,0.4831,0.4814,0.4835,0.4832,0.4822,0.4857,0.4865,0.4885,0.4884,0.4868,0.4895,0.4886,0.4887,0.4902,0.4898,0.4901,0.4898,0.4921,0.4906,0.4908,0.4946,0.4947,0.4933,0.494,0.4947,0.494,0.4943,0.4925,0.4928,0.4974,0.4941,0.4936,0.4933,0.4958,0.4928,0.4956,0.4961,0.4958,0.4966,0.4949,0.4963,0.4971,0.4952,0.4976,0.4945,0.4949,0.4938,0.4968])
      plt.plot(x, single, label='single', color='red')
  
      plt.rc('font', size=16)
      plt.subplots_adjust(0.15, 0.15, 0.95, 0.95)
  
      plt.xlabel('Training Round', fontsize=20)
      plt.ylabel('Accuracy', fontsize=20)
      plt.xticks(fontsize=16)
      plt.yticks(fontsize=16)
      plt.grid(True)
      plt.legend()
  
      plt.savefig('selection.pdf')
      plt.savefig('selection.png')
  
  def p3():
      fedavg = np.array([7.80584,0.21873,0.03724,0.01371,0.01204,0.00839,0.00575,0.00486,0.00370,0.00285,0.00245,0.00241,0.00235,0.00230,0.00225,0.00221,0.00220,0.00219,0.00218,0.00217,0.00216,0.00215,0.00214,0.00213,0.00212,0.00212,0.00210,0.00210,0.00209,0.00209,0.00208,0.00207,0.00207,0.00206,0.00205,0.00205,0.00204,0.00203,0.00203,0.00202,0.00202,0.00201,0.00201,0.00200,0.00200,0.00199,0.00199,0.00198,0.00198,0.00197,0.00197,0.00197,0.00196,0.00196,0.00197,0.00197,0.00197,0.00197,0.00197,0.00197,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00195,0.00195,0.00195,0.00195,0.00195,0.00195,0.00195,0.00195,0.00195,0.00195,0.00195,0.00195,0.00195,0.00195,0.00195])
      grouping = np.array([9.16833,0.11449,0.00906,0.00642,0.00358,0.00304,0.00262,0.00234,0.00226,0.00225,0.00220,0.00216,0.00216,0.00215,0.00214,0.00213,0.00212,0.00211,0.00210,0.00209,0.00208,0.00208,0.00207,0.00207,0.00206,0.00206,0.00205,0.00205,0.00204,0.00204,0.00203,0.00203,0.00202,0.00202,0.00202,0.00201,0.00201,0.00201,0.00200,0.00200,0.00200,0.00200,0.00200,0.00199,0.00199,0.00198,0.00198,0.00198,0.00197,0.00197,0.00197,0.00197,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00196,0.00195,0.00195,0.00195,0.00195,0.00195,0.00195,0.00195,0.00195,0.00195,0.00195,0.00195,0.00195,0.00195])
  
      x = np.arange(0, 100, 1)
      plt.ylim(0, 0.01)
      plt.xlim(0, 50)
      plt.plot(x, fedavg, label='FedAvg', color='red')
      plt.plot(x, grouping, label='Grouped', color='blue')
  
      plt.rc('font', size=16)
      plt.subplots_adjust(0.18, 0.15, 0.95, 0.95)
  
      plt.xlabel('Training Round', fontsize=20)
      plt.ylabel('Loss', fontsize=20)
      plt.xticks(fontsize=16)
      plt.yticks(fontsize=16)
      plt.grid(True)
      plt.legend()
  
      plt.savefig('report.pdf')
      plt.savefig('report.png')
  
  p3()