code: def FitAndPrint(N, D, Curves):
      from scipy.optimize import curve_fit
      import matplotlib.pyplot as plt
  
      try:
          coeffs_Amdahl, matcov_Amdahl = curve_fit(Amdahl, N, D)
  
          D_Amdahl = Amdahl(
              N, coeffs_Amdahl[0], coeffs_Amdahl[1], coeffs_Amdahl[2]
          )
          coeffs_Amdahl[1] = coeffs_Amdahl[1] * coeffs_Amdahl[0] / D[0]
          coeffs_Amdahl[2] = coeffs_Amdahl[2] * coeffs_Amdahl[0] / D[0]
          coeffs_Amdahl[0] = D[0]
          print(
              "Amdahl Normalized: T=%.2f(%.6f+%.6f/N)"
              % (coeffs_Amdahl[0], coeffs_Amdahl[1], coeffs_Amdahl[2])
          )
      except Exception:
          print(
              "Impossible to fit for Amdahl law : only %i elements"
              % len(D)
          )
  
      try:
          coeffs_AmdahlR, matcov_AmdahlR = curve_fit(AmdahlR, N, D)
  
          # D_AmdahlR = AmdahlR(N, coeffs_AmdahlR[0], coeffs_AmdahlR[1])
          coeffs_AmdahlR[1] = (
              coeffs_AmdahlR[1] * coeffs_AmdahlR[0] / D[0]
          )
          coeffs_AmdahlR[0] = D[0]
          print(
              "Amdahl Reduced Normalized: T=%.2f(%.6f+%.6f/N)"
              % (
                  coeffs_AmdahlR[0],
                  1 - coeffs_AmdahlR[1],
                  coeffs_AmdahlR[1],
              )
          )
  
      except Exception:
          print(
              "Impossible to fit for Reduced Amdahl law : only %i elements"
              % len(D)
          )
  
      try:
          coeffs_Mylq, matcov_Mylq = curve_fit(Mylq, N, D)
  
          coeffs_Mylq[1] = coeffs_Mylq[1] * coeffs_Mylq[0] / D[0]
          # coeffs_Mylq[2]=coeffs_Mylq[2]*coeffs_Mylq[0]/D[0]
          coeffs_Mylq[3] = coeffs_Mylq[3] * coeffs_Mylq[0] / D[0]
          coeffs_Mylq[0] = D[0]
          print(
              "Mylq Normalized : T=%.2f(%.6f+%.6f/N)+%.6f*N"
              % (
                  coeffs_Mylq[0],
                  coeffs_Mylq[1],
                  coeffs_Mylq[3],
                  coeffs_Mylq[2],
              )
          )
          D_Mylq = Mylq(
              N,
              coeffs_Mylq[0],
              coeffs_Mylq[1],
              coeffs_Mylq[2],
              coeffs_Mylq[3],
          )
      except Exception:
          print(
              "Impossible to fit for Mylq law : only %i elements"
              % len(D)
          )
  
      try:
          coeffs_Mylq2, matcov_Mylq2 = curve_fit(Mylq2, N, D)
  
          coeffs_Mylq2[1] = coeffs_Mylq2[1] * coeffs_Mylq2[0] / D[0]
          # coeffs_Mylq2[2]=coeffs_Mylq2[2]*coeffs_Mylq2[0]/D[0]
          # coeffs_Mylq2[3]=coeffs_Mylq2[3]*coeffs_Mylq2[0]/D[0]
          coeffs_Mylq2[4] = coeffs_Mylq2[4] * coeffs_Mylq2[0] / D[0]
          coeffs_Mylq2[0] = D[0]
          print(
              "Mylq 2nd order Normalized: T=%.2f(%.6f+%.6f/N)+%.6f*N+%.6f*N^2"
              % (
                  coeffs_Mylq2[0],
                  coeffs_Mylq2[1],
                  coeffs_Mylq2[4],
                  coeffs_Mylq2[2],
                  coeffs_Mylq2[3],
              )
          )
  
      except Exception:
          print(
              "Impossible to fit for 2nd order Mylq law : only %i elements"
              % len(D)
          )
  
      if Curves:
          plt.xlabel("Number of Threads/work Items")
          plt.ylabel("Total Elapsed Time")
  
          (Experience,) = plt.plot(N, D, "ro")
      try:
          (pAmdahl,) = plt.plot(N, D_Amdahl, label="Loi de Amdahl")
          (pMylq,) = plt.plot(N, D_Mylq, label="Loi de Mylq")
      except Exception:
          print("Fit curves seem not to be available")
  
      plt.legend()
      plt.show()
  
imports: import numpy
  import sys
  import getopt
  import time
  import itertools
  from socket import gethostname
label_desc: Use image node_id 12 for calling a global function with example usage: FitAndPrint(N, D, Curves) without return types