<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def conduit_lengths(target, throat_endpoints='throat.endpoints', throat_length='throat.length'):
 r""" Calculate conduit lengths. A conduit is defined as half pore + throat + half pore. Parameters target : OpenPNM Object The object which this model is associated with. This controls the length of the calculated array, and also provides access to other necessary properties. throat_endpoints : string Dictionary key of the throat endpoint values. throat_diameter : string Dictionary key of the throat length values. throat_length : string (optional) Dictionary key of the throat length values. If not given then the direct distance bewteen the two throat end points is used. Returns ------- Dictionary containing conduit lengths, which can be accessed via the dict keys 'pore1', 'pore2', and 'throat'. """

    _np.warnings.filterwarnings('ignore', category=RuntimeWarning)

    network = target.project.network
    throats = network.map_throats(throats=target.Ts, origin=target)
    cn = network['throat.conns'][throats]
    # Get pore coordinates
    C1 = network['pore.coords'][cn[:, 0]]
    C2 = network['pore.coords'][cn[:, 1]]
    # Get throat endpoints and length
    EP1 = network[throat_endpoints + '.head'][throats]
    EP2 = network[throat_endpoints + '.tail'][throats]
    try:
        # Look up throat length if given
        Lt = network[throat_length][throats]
    except KeyError:
        # Calculate throat length otherwise
        Lt = _sqrt(((EP1 - EP2)**2).sum(axis=1))
    # Calculate conduit lengths
    L1 = _sqrt(((C1 - EP1)**2).sum(axis=1))
    L2 = _sqrt(((C2 - EP2)**2).sum(axis=1))

    _np.warnings.filterwarnings('default', category=RuntimeWarning)

    return {'pore1': L1, 'throat': Lt, 'pore2': L2}