code: def getphase(Tc, Pc, T, P, x, region):
      
      # Avoid round problem
      P = round(P, 8)
      T = round(T, 8)
      if P > Pc and T > Tc:
          phase = "Supercritical fluid"
      elif T > Tc:
          phase = "Gas"
      elif P > Pc:
          phase = "Compressible liquid"
      elif P == Pc and T == Tc:
          phase = "Critical point"
      elif region == 4 and x == 1:
          phase = "Saturated vapor"
      elif region == 4 and x == 0:
          phase = "Saturated liquid"
      elif region == 4:
          phase = "Two phases"
      elif x == 1:
          phase = "Vapour"
      elif x == 0:
          phase = "Liquid"
      return phase
docs: Return fluid phase string name
  
      Parameters
      ----------
      Tc : float
          Critical temperature, [K]
      Pc : float
          Critical pressure, [MPa]
      T : float
          Temperature, [K]
      P : float
          Pressure, [MPa]
      x : float
          Quality, [-]
      region: int
          Region number, used only for IAPWS97 region definition
  
      Returns
      -------
      phase : str
          Phase name