<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def washburn(target, surface_tension='pore.surface_tension', contact_angle='pore.contact_angle', diameter='throat.diameter'):
 r""" Computes the capillary entry pressure assuming the throat in a cylindrical tube. Parameters target : OpenPNM Object The object for which these values are being calculated. This controls the length of the calculated array, and also provides access to other necessary thermofluid properties. surface_tension : string The dictionary key containing the surface tension values to be used. If a pore property is given, it is interpolated to a throat list. contact_angle : string The dictionary key containing the contact angle values to be used. If a pore property is given, it is interpolated to a throat list. diameter : string The dictionary key containing the throat diameter values to be used. Notes ----- The Washburn equation is: .. math:: P_c = -\frac{2\sigma(cos(\theta))}{r} This is the most basic approach to calculating entry pressure and is suitable for highly non-wetting invading phases in most materials. """

    network = target.project.network
    phase = target.project.find_phase(target)
    element, sigma, theta = _get_key_props(phase=phase,
                                           diameter=diameter,
                                           surface_tension=surface_tension,
                                           contact_angle=contact_angle)
    r = network[diameter]/2
    value = -2*sigma*_sp.cos(_sp.radians(theta))/r
    if diameter.split('.')[0] == 'throat':
        value = value[phase.throats(target.name)]
    else:
        value = value[phase.pores(target.name)]
    value[_sp.absolute(value) == _sp.inf] = 0
    return value