Like the second link shows you can use this from MEPover package:
If the result is an empty list or only a single element then the pipes is not connected on both sides.
Alternatively you could change the python code a bit like this, so you will end up wil a list of booleans indicating whether or not the connectors are connected or not:
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
#The inputs to this node will be stored as a list in the IN variables.
if isinstance(IN[0], list):
curves = UnwrapElement(IN[0])
else:
curves = [UnwrapElement(IN[0])]
bools = []
for curve in curves:
connMan = curve.ConnectorManager
bool = []
for conn in connMan.Connectors:
if conn.IsConnected:
bool.append(True)
else:
bool.append(False)
bools.append(bool)
#Assign your output to the OUT variable.
OUT = bools