code: def compute_effsize_from_t(
      tval, nx=None, ny=None, N=None, eftype="cohen"
  ):
      """Compute effect size from a T-value.
  
      Parameters
      ----------
      tval : float
          T-value
      nx, ny : int, optional
          Group sample sizes.
      N : int, optional
          Total sample size (will not be used if nx and ny are specified)
      eftype : string, optional
          Desired output effect size.
  
      Returns
      -------
      ef : float
          Effect size
  
      See Also
      --------
      compute_effsize : Calculate effect size between two set of observations.
      convert_effsize : Conversion between effect sizes.
  
      Notes
      -----
      If both nx and ny are specified, the formula to convert from *t* to *d* is:
  
      .. math:: d = t * \\sqrt{\\frac{1}{n_x} + \\frac{1}{n_y}}
  
      If only N (total sample size) is specified, the formula is:
  
      .. math:: d = \\frac{2t}{\\sqrt{N}}
  
      Examples
      --------
      1. Compute effect size from a T-value when both sample sizes are known.
  
      >>> from pingouin import compute_effsize_from_t
      >>> tval, nx, ny = 2.90, 35, 25
      >>> d = compute_effsize_from_t(tval, nx=nx, ny=ny, eftype='cohen')
      >>> print(d)
      0.7593982580212534
  
      2. Compute effect size when only total sample size is known (nx+ny)
  
      >>> tval, N = 2.90, 60
      >>> d = compute_effsize_from_t(tval, N=N, eftype='cohen')
      >>> print(d)
      0.7487767802667672
      """
      if not _check_eftype(eftype):
          err = f"Could not interpret input '{eftype}'"
          raise ValueError(err)
  
      if not isinstance(tval, float):
          err = "T-value must be float"
          raise ValueError(err)
  
      # Compute Cohen d (Lakens, 2013)
      if nx is not None and ny is not None:
          d = tval * np.sqrt(1 / nx + 1 / ny)
      elif N is not None:
          d = 2 * tval / np.sqrt(N)
      else:
          raise ValueError("You must specify either nx + ny, or just N")
      return convert_effsize(d, "cohen", eftype, nx=nx, ny=ny)
  
file_path: pingouin/pingouin/effsize.py
imports: import warnings
  import numpy
  from scipy.stats import pearsonr
  from pingouin.utils import _check_eftype, remove_na
label_desc: Use image node_id 5 for calling a global function with example usage: compute_effsize_from_t(tval, nx, ny, N, eftype) and returns: convert_effsize