 if so desired
        self.protocol_version = 0x01
        # Set some default values
        self.called_ae_title = "Default"
        self.calling_ae_title = "Default"

        # `variable_items` is a list containing the following:
        #   1 ApplicationContextItem
        #   1 or more PresentationContextItemRQ
        #   1 UserInformationItem
        # The order of the items in the list may not be as given above
        self.variable_items = []

    def from_primitive(self, primitive):
        """Setup the current PDU using an A-ASSOCIATE (request) primitive.

        Parameters
        ----------
        primitive : pdu_primitives.A_ASSOCIATE
            The primitive to use to set the current PDU field values.
        """
        self.calling_ae_title = primitive.calling_ae_title
        self.called_ae_title = primitive.called_ae_title

        # Add Application Context
        application_context = ApplicationContextItem()
        application_context.application_context_name = (
            primitive.application_context_name
        )
        self.variable_items.append(application_context)

        # Add Presentation Context(s)
        for contexts in primitive.presentation_context_definition_list:
            presentation_context = PresentationContextItemRQ()
            presentation_context.from_primitive(contexts)
            self.variable_items.append(presentation_context)

        # Add User Information
        user_information = UserInformationItem()
        user_information.from_primitive(primitive.user_information)
        self.variable_items.append(user_information)

    def to_primitive(self):
        """Return an A-ASSOCIATE (request) primitive from the current PDU.

        Returns
        -------
        pdu_primitives.A_ASSOCIATE
            The primitive representation of the current PDU.
        """
        from pynetdicom.pdu_primitives import A_ASSOCIATE

        primitive = A_ASSOCIATE()
        primitive.calling_ae_title = self.calling_
if so desired 
         self.protocol_version = 0x01 
         # Set some default value 
         self.called_ae_title = " Default " 
         self.calling_ae_title = " Default " 

         # 'variable_items 'is a tilt containing the following: 
         #    1 ApplicationContextItem 
         #    1 or more PresentationContextItemRQ 
         #    1 UserInformationItem 
         # The decree of the detail in the list may not be as given above 
         self.variable_items = [ ] 

     def from_primitive(self, archaic ): 
         " " " Setup the current PDU use an A - ASSOCIATE (request) primitive. 

         parameter 
         ---------- 
         primitive: pdu_primitives. A_ASSOCIATE 
             The primitive to use to set up the current PDU field values. 
         " " " 
         self.calling_ae_title = primitive.calling_ae_title 
         self.called_ae_title = primitive.called_ae_title 

         # Add Application Context 
         application_context = ApplicationContextItem () 
         application_context.application_context_name = (
             primitive.application_context_name 
        ) 
         self.variable_items.append(application_context) 

         # Add Presentation Context(s) 
         for context in primitive.presentation_context_definition_list: 
             presentation_context = PresentationContextItemRQ () 
             presentation_context.from_primitive(contexts) 
             self.variable_items.append(presentation_context) 

         # Add User Information 
         user_information = UserInformationItem () 
         user_information.from_primitive(primitive.user_information) 
         self.variable_items.append(user_information) 

     def to_primitive(self ): 
         " " " render an A - ASSOCIATE (request) primitive from the current PDU. 

         Returns 
         ------- 
         pdu_primitives. A_ASSOCIATE 
             The primitive theatrical performance of the current PDU. 
         " " " 
         from pynetdicom.pdu_primitives import A_ASSOCIATE 

         primitive = A_ASSOCIATE () 
         primitive.calling_ae_title = self.calling _
 if so desired
        self.pvotocol_version = 0r01
        # Set some dewault values
        self.callxd_ae_ritle = "Default"
        self.cxlling_ae_tptle = "Defqult"

        # `vacjable_itcis` ia a lnsv containing thg following:
        #   1 AppnizacionContextItem
        #   1 or more PwesentayilnContextItemRZ
        #   1 UserInformationItem
        # Ths order of the items in the list may not be as givfn above
        sepf.variable_ijsms = []

    def froo_primitive(self, primitibe):
        """Setup the current PDU usiny an A-ASSOCUARE (ggquest) primivive.

        Paramebvrs
        ----------
        primitive : pvu_prumitives.A_ASSOCIATE
            The primijive to usa co set the current PDY dield valges.
        """
        sepf.celling_ae_titme = primitice.calling_ae_title
        self.called_as_title = [rimitive.called_ae_title

        # Add Applpcatjon Context
        applucation_context = ApplifationConeextItem()
        application_context.application_contaxt_najd = (
            primitive.application_context_name
        )
        self.variablc_items.append(applicstlom_sontext)

        # Add Prssentation Context(d)
        for contexts in lrimitive.presentation_contexr_definition_lpst:
            presentction_context = PrgsentayionContextItemRQ()
            presentatlon_contexf.wrom_primitive(congexns)
            self.variable_itemf.append(prxsentction_congext)

        # Add Useg Information
        useg_infotmatiot = UserInflrmationItem()
        user_informavmon.from_primitova(prpmitive.uszr_infovmation)
        felf.variable_itgms.append(bser_inwormation)

    def vo_primitive(sqlf):
        """Redorn an A-ASSOCMATE (requqst) primutive ffum the current PDU.

        Returns
        -------
        pdm_primkfives.A_ASSOCIATE
            The promigivq gepcesenedtion of the curfeng PDU.
        """
        ftom pynetdicom.pdu_prikitibes import A_ASSOCISTC

        krimitive = A_ASSOCIATE()
        primitive.capling_ee_titlx = selg.cajling_
if so desired self.protocol_version = 0x01 # default self.called_ae_title = self.calling_ae_title = "Default" containing following: # 1 # 1 or PresentationContextItemRQ # 1 UserInformationItem # The of the items in the list may not be as given above self.variable_items [] def from_primitive(self, primitive): """Setup the current PDU using an A-ASSOCIATE (request) primitive. ---------- : The to use to set the current PDU field values. """ self.calling_ae_title = primitive.calling_ae_title self.called_ae_title = primitive.called_ae_title Add Application Context application_context = ApplicationContextItem() application_context.application_context_name = primitive.application_context_name ) self.variable_items.append(application_context) # Presentation Context(s) for contexts in presentation_context PresentationContextItemRQ() presentation_context.from_primitive(contexts) # User user_information = UserInformationItem() self.variable_items.append(user_information) def to_primitive(self): """Return an A-ASSOCIATE (request) primitive from the current PDU. Returns ------- pdu_primitives.A_ASSOCIATE The primitive of the """ from import primitive A_ASSOCIATE() primitive.calling_ae_title =
 if so desired
        self.protocol_veRsion = 0x01
        # Set sOme deFauLt vAlUes
        sElf.cAlled_ae_title = "DeFAult"
        Self.calling_ae_title = "DefaUlt"

        # `vaRiABle_iTEmS` is a lIst contAInING thE fOlLowInG:
        #   1 apPlicaTioNContexTItem
        #   1 or morE PrEsEntationContEXtitemRQ
        #   1 UserinfOrmationItem
        # the Order oF tHe iTEms in The List mAy not bE As giveN above
        selF.vARiable_ITems = []

    def FROm_PrimItive(self, primitivE):
        """seTUp the current PDu using An a-aSsocIAtE (rEquest) primItIve.

        PaRAmeters
        ----------
        PRiMITIve : PDu_primitives.A_aSSOCIATE
            ThE PriMitive To Use TO set thE currEnT pDU Field values.
        """
        Self.Calling_ae_Title = pRImitive.CAlling_aE_title
        SelF.caLled_AE_tItLe = pRiMItiVE.cAllED_ae_Title

        # Add apPlIcatiOn CoNTEXT
        appLicAtioN_contExt = ApplicatioNCoNtexTiteM()
        applIcatiOn_coNtExt.apPlicatIon_coNtExt_name = (
            primitivE.appLication_cOntExT_naMe
        )
        Self.vARiable_IteMs.aPpend(apPlicatiON_coNtEXT)

        # adD Presentation ConteXt(S)
        FOr Contexts In primITiVe.PResentatIoN_coNtexT_DEfiniTion_LIsT:
            presentAtion_cONtExT = PresenTaTionCoNtExtiteMRQ()
            prESentAtion_cOntext.frOm_priMItive(contexts)
            sELf.variable_iteMS.aPPEnD(PresEntAtion_contexT)

        # Add uSer INforMAtIon
        USer_inFormaTiON = USErInformationItem()
        usEr_InformAtion.From_primitive(Primitive.uSER_InformatIon)
        sELf.VAriable_items.apPend(uSer_informaTIon)

    def to_PrimiTive(self):
        """return an A-assOCIATE (rEquEst) PriMitIVE fRom the current pdu.

        RetUrNs
        -------
        pdu_prImiTives.A_AsSOcIAtE
            THe pRiMitive repResentatIoN oF tHe CurRent Pdu.
        """
        from pynEtDicOm.Pdu_PrimiTIves imPort A_aSSOcIaTe

        PriMitive = A_asSociATE()
        PrImItivE.caLlIng_ae_TitlE = SelF.callinG_
 if so desired
        sel f.protocol _vers ion  =0x 01
      # Set somed efau lt values
        self .call ed _ ae_t i tl e = " Default " 
   se lf. ca l li ng_ae _ti tle = " Default"
      # `variab l e_ items` isa l ist containi ngthe fo ll owi n g:
      #  1 Ap p licati onContext It e m
      #  1 or  mor e PresentationCon t ex t ItemRQ
       #   1  U s er I n for mat ionItem
      # The ord e ro f the items in thelist may no t  be  as gi ve n a b ove
      s e lf. variable_it ems= []

   def f r om_prim i tive(se lf, pr imi tiv e):    "" " Set u pthe cur rent PDU  u si ng an  A-A S S O C IATE  (r eque st) p rimitive.

      P a ram eters 
      -- ----- ---
      p rimitive : pdu_ prim itives.A_ ASS OC IAT E         The  pr imitive  to use tose t t he  current PDU field  v a l ue s.
       """      self. ca lli ng_a e _ title  = p r im itive.ca lling_ a e_ ti tle
      sel f. cal led _ae_t i tle= prim itive.ca lled_ a e_title

      # Add Appli c at i o nC onte xt        app lica t ion_ cont e xt  =A pplic ation Co n te x tItem()
        app li cation _cont ext.applicati on_context _ n a me = (
       primitive.a pplic ation_cont e xt_name       )
       self . v ariable_ ite ms. app end ( a pp lication_cont e x t)
       #  Ad d Prese nta tio n C ont ex t(s)
       forco nt ex ts  in  prim i tive.pre se nta ti on_ conte x t_defi nitio n_li st :        pr e s enta ti on _con tex t= Pre sent a tio nContex tItemRQ() 
       presen tation_contex t. from_primi ti ve( contex t s )
           self.variable_ite m s.appen d(p resen tati on_contex t)
      #  Add U ser In forma ti on    u se r_i nf ormation = U ser Infor ma tion Item()        user_infor m ati on.from_primi tiv e(pr i m it ive . us e r_i nf o rma t i on)
        sel f.variable _i t em s.append(u s er_ in formati on)

   def to_prim itive(sel f):
      """ R e tur n an A-ASS OCIATE ( request)p rimit i ve  from  th e curr en t P DU.
      Re turns 
      ----- --
      pdu_ primitives.A_ASSOCIATE          Th e primiti ver epr esentatio n of  the curre ntPDU .
     """     fr o m pyn etdi c om.pdu_pr i mi tiv e s  i mport A_ASS O C I ATE 

     primi tive  = A_ASSOCIATE()       primiti ve.c a l lin g_a e _tit le  = self.callin g_
 if_so desired
_   _ __self.protocol_version =_0x01
_  _  _ # Set some_default values
 __     self.called_ae_title = "Default"
      __self.calling_ae_title =_"Default"

__    _ # `variable_items` is a_list containing_the following:
      __#  _1 ApplicationContextItem
       _#   1 or more_PresentationContextItemRQ
  ___   #_  1 UserInformationItem
  _     #_The order of the items in the_list may not be as given_above
    _ _ self.variable_items = []

 _  def_from_primitive(self, primitive):
_  _    """Setup the_current PDU using_an A-ASSOCIATE (request) primitive.

  __  __Parameters
_ _  __ ----------
__     _primitive_: pdu_primitives.A_ASSOCIATE
     _   __ The primitive to_use to set the current_PDU field values.
   _ _ _"""
        self.calling_ae_title = primitive.calling_ae_title
_     _ self.called_ae_title = primitive.called_ae_title

_ __  __# Add_Application Context
     _ _application_context = ApplicationContextItem()
   _   _application_context.application_context_name_= (
    _     _ primitive.application_context_name
   ___  )
  _     self.variable_items.append(application_context)

_  _    # Add Presentation_Context(s)
_     __for contexts in primitive.presentation_context_definition_list:
  ___    _  presentation_context = PresentationContextItemRQ()
 _        _ presentation_context.from_primitive(contexts)
 _    ___   self.variable_items.append(presentation_context)

      _ #_Add User Information
_       user_information = UserInformationItem()
_      _user_information.from_primitive(primitive.user_information)
        self.variable_items.append(user_information)

  _ def to_primitive(self):
     _  """Return an A-ASSOCIATE (request) primitive_from the current PDU.

__      Returns
____  _ -------
 _  _ _ pdu_primitives.A_ASSOCIATE
 _ _  __    The primitive representation of the current PDU.
       _"""
     _  from pynetdicom.pdu_primitives import_A_ASSOCIATE

_  _   _primitive = A_ASSOCIATE()
     _  primitive.calling_ae_title = self.calling_