def connectMsToNet(Facility_presence=0, ConnectedSubaddress_presence=0, UserUser_presence=0, SsVersionIndicator_presence=0):
 a = TpPd(pd=3)
 b = MessageType(mesType=7)
 packet = (a / b)
 if (Facility_presence is 1):
  c = FacilityHdr(ieiF=28, eightBitF=0)
  packet = (packet / c)
 if (ConnectedSubaddress_presence is 1):
  d = ConnectedSubaddressHdr(ieiCS=77, eightBitCS=0)
  packet = (packet / d)
 if (UserUser_presence is 1):
  e = UserUserHdr(ieiUU=127, eightBitUU=0)
  packet = (packet / e)
 if (SsVersionIndicator_presence is 1):
  f = SsVersionIndicatorHdr(ieiSVI=127, eightBitSVI=0)
  packet = (packet / f)
 return packet

def connectMsToNet ( Facility_presence = 0 , ConnectedSubaddress_presence = 0 , UserUser_presence = 0 , SsVersionIndicator_presence = 0 ) : a = TpPd ( pd = 3 ) b = MessageType ( mesType = 7 ) packet = ( a / b ) if ( Facility_presence is 1 ) : c = FacilityHdr ( ieiF = 28 , eightBitF = 0 ) packet = ( packet / c ) if ( ConnectedSubaddress_presence is 1 ) : d = ConnectedSubaddressHdr ( ieiCS = 77 , eightBitCS = 0 ) packet = ( packet / d ) if ( UserUser_presence is 1 ) : e = UserUserHdr ( ieiUU = 127 , eightBitUU = 0 ) packet = ( packet / e ) if ( SsVersionIndicator_presence is 1 ) : f = SsVersionIndicatorHdr ( ieiSVI = 127 , eightBitSVI = 0 ) packet = ( packet / f ) return packet
connect section 9 .