def spice_junction(jc, nc, isc, j01, j02, n1, n2, Eg, rsh):
    """ Creates the string representation in SPICE of the junciton defined by the input values.

    :param jc: junction counter
    :param nc: node counter
    :param isc: Short circuit current
    :param j01: Reverse saturation current corresponding to ideality factor n1
    :param j02: Reverse saturation current corresponding to ideality factor n2
    :param n1: Ideality factor, typically = 1
    :param n2: Ideality factor, typically = 2
    :param Eg: Bandgap of the material the junction is made off
    :param rsh: Shunt resistance in the junction
    :return: A string representation of the junciton in SPICE
    """
    isource = 'i{0} {1} {2} dc {3}\n'.format(jc, nc, nc + 1, isc)
    d1 = 'd{0} {1} {2} diode{3} OFF\n'.format(2 * jc - 1, nc + 1, nc, 2 *
        jc - 1)
    d1deff = '.model diode{0} d(is={1},n={2},eg={3})\n'.format(2 * jc - 1,
        j01, n1, Eg)
    d2 = 'd{0} {1} {2} diode{3} OFF\n'.format(2 * jc, nc + 1, nc, 2 * jc)
    d2deff = '.model diode{0} d(is={1},n={2},eg={3})\n'.format(2 * jc, j02,
        n2, Eg)
    rshunt = 'r{0} {1} {2} {3}\n'.format(2 * jc, nc + 1, nc, rsh)
    junction = isource + d1 + d1deff + d2 + d2deff + rshunt
    return junction
