code: def create_jlink(self, args):
          
          jlink = pylink.JLink()
          jlink.open(args.serial_no, args.ip_addr)
  
          if hasattr(args, 'tif') and args.tif is not None:
              if args.tif.lower() == 'swd':
                  jlink.set_tif(pylink.JLinkInterfaces.SWD)
              else:
                  jlink.set_tif(pylink.JLinkInterfaces.JTAG)
  
          if hasattr(args, 'device') and args.device is not None:
              jlink.connect(args.device)
  
          return jlink
docs: Creates an instance of a J-Link from the given arguments.
  
          Args:
            self (Command): the ``Command`` instance
            args (Namespace): arguments to construct the ``JLink`` instance from
  
          Returns:
            An instance of a ``JLink``.