def METHOD_NAME(
    txloc,
    rxloc,
    xc,
    radius,
    sigma,
    sigma1,
    field_type="secondary",
    order=12,
    halfspace=False,
):
    """
    Parameters:
    :param array txloc: A (+) current electrode location (x, y, z)
    :param array xc: x center of depressed sphere
    :param array rxloc: M(+) electrode locations / (Nx3 array, # of electrodes)
    :param float radius: radius (float): radius of the sphere (m)
    :param float rho: resistivity of the background (ohm-m)
    :param float rho1: resistivity of the sphere
    :param string field_type: : "secondary", "total", "primary"
          (default="secondary")
          "secondary": secondary potential only due to sphere
          "primary": primary potential from the point source
          "total": "secondary"+"primary"
    :param float order: maximum order of Legendre polynomial (default=12)
    Written by Seogi Kang (skang@eos.ubc.ca)
    Ph.D. Candidate of University of British Columbia, Canada
    """
    Pleg = []
    # Compute Legendre Polynomial
    for i in range(order):
        Pleg.append(special.legendre(i, monic=0))
    rho = 1.0 / sigma
    rho1 = 1.0 / sigma1
    # Center of the sphere should be aligned in txloc in y-direction
    yc = txloc[1]
    xyz = np.c_[rxloc[:, 0] - xc, rxloc[:, 1] - yc, rxloc[:, 2]]
    r = np.sqrt((xyz**2).sum(axis=1))
    x0 = abs(txloc[0] - xc)
    costheta = xyz[:, 0] / r * (txloc[0] - xc) / x0
    # phi = np.zeros_like(r)
    R = (r**2 + x0**2.0 - 2.0 * r * x0 * costheta) ** 0.5
    # primary potential in a whole space
    prim = rho * 1.0 / (4 * np.pi * R)
    if field_type == "primary":
        return prim
    sphind = r < radius
    out = np.zeros_like(r)
    for n in range(order):
        An, Bn = AnBnfun(n, radius, x0, rho, rho1)
        dumout = An * r[~sphind] ** (-n - 1.0) * Pleg[n](costheta[~sphind])
        out[~sphind] += dumout
        dumin = Bn * r[sphind] ** (n) * Pleg[n](costheta[sphind])
        out[sphind] += dumin
    out[~sphind] += prim[~sphind]
    if halfspace:
        scale = 2
    else:
        scale = 1
    if field_type == "secondary":
        return scale * (out - prim)
    elif field_type == "total":
        return scale * out