:rtype: VPCConnection
973666
def vpc(self):
        
        if self.__vpc is None:
            self.__vpc = self.__aws_connect(vpc)
        return self.__vpc
326490
public void setVpcPeeringConnections(java.util.Collection<VpcPeeringConnection> vpcPeeringConnections) {
        if (vpcPeeringConnections == null) {
            this.vpcPeeringConnections = null;
            return;
        }

        this.vpcPeeringConnections = new java.util.ArrayList<VpcPeeringConnection>(vpcPeeringConnections);
    }
1372658
def onConnect(self, client, userdata, flags, rc):
        
        for sub in self.subsciption:
            (result, mid) = self.client.subscribe(sub)
388971
def connectPeer(self, peer):
        
        return self.conns.connectCached(endpoint.Q2QEndpoint(self.svc,
                                                             self.addr,
                                                             peer,
                                                             PROTOCOL_NAME),
                                        self.clientFactory)
375232
def connection(self):
        
        connection = getattr(self.state, "connection", None)
        if connection is None:
            connection = self.state.connection = pika.BlockingConnection(
                parameters=self.parameters)
            self.connections.add(connection)
        return connection
25703
def _vpn_signal_handler(self, args):
        """"""
        # Args is a dictionary of changed properties
        # We only care about changes in ActiveConnections
        active = "ActiveConnections"
        # Compare current ActiveConnections to last seen ActiveConnections
        if active in args.keys() and sorted(self.active) != sorted(args[active]):
            self.active = args[active]
            self.py3.update()
1329941
def client_connected(
        self, reader: asyncio.StreamReader, writer: asyncio.StreamWriter
    ) -> None:
        
        self.reader = reader
        self.writer = writer
271747
def main():
   

   args = GetArgs()
   if args.password:
      password = args.password
   else:
      password = getpass.getpass(prompt='Enter password for host %s and '
                                        'user %s: ' % (args.host,args.user))

   context = None
   if hasattr(ssl, '_create_unverified_context'):
      context = ssl._create_unverified_context()
   si = SmartConnect(host=args.host,
                     user=args.user,
                     pwd=password,
                     port=int(args.port),
                     sslContext=context)
   if not si:
       print("Could not connect to the specified host using specified "
             "username and password")
       return -1

   atexit.register(Disconnect, si)

   content = si.RetrieveContent()
   for child in content.rootFolder.childEntity:
      if hasattr(child, 'vmFolder'):
         datacenter = child
         vmFolder = datacenter.vmFolder
         vmList = vmFolder.childEntity
         for vm in vmList:
            PrintVmInfo(vm)
   return 0
357451
def client_connection_made(self, transport):
        
        with self.lock:
            self.is_closed = False
        self.transport = transport
        self._send_options_message()
833147
def connect(self):
        
        logger.debug('Connecting to %s', self._url)
        return pika.SelectConnection(pika.URLParameters(self._url),
                                     self.on_connection_open,
                                     stop_ioloop_on_close=False)
1095776
def connection_made(self, transport):
        

        # Save the underlying transport
        self._transport = transport

        # Call connection_made() on the client protocol, passing
        # ourself as the transport
        self._client.connection_made(self)
229335
def alloc_vpcid(nexus_ips):
    """"""

    LOG.debug("alloc_vpc() called")

    vpc_id = 0
    intersect = _get_free_vpcids_on_switches(nexus_ips)
    for intersect_tuple in intersect:
        try:
            update_vpc_entry(nexus_ips, intersect_tuple.vpc_id,
                             False, True)
            vpc_id = intersect_tuple.vpc_id
            break
        except Exception:
            LOG.exception(
                "This exception is expected if another controller "
                "beat us to vpcid %(vpcid)s for nexus %(ip)s",
                {'vpcid': intersect_tuple.vpc_id,
                 'ip': ', '.join(map(str, nexus_ips))})

    return vpc_id
817011
def connect(self, port=None) -> str:
        '''
        
        '''
        if environ.get('ENABLE_VIRTUAL_SMOOTHIE', '').lower() == 'true':
            return ''
        try:
            self.disconnect()
            self._connect_to_port(port)
            self._wait_for_ack()    # verify the device is there
        except (SerialException, SerialNoResponse) as e:
            return str(e)
        return ''
1164316
public void setVpcEndpointConnections(java.util.Collection<VpcEndpointConnection> vpcEndpointConnections) {
        if (vpcEndpointConnections == null) {
            this.vpcEndpointConnections = null;
            return;
        }

        this.vpcEndpointConnections = new com.amazonaws.internal.SdkInternalList<VpcEndpointConnection>(vpcEndpointConnections);
    }
669189
def start_capture(self, port_number, output_file):
        

        if not self._ethernet_adapter.port_exists(port_number):
            raise VPCSError("Port {port_number} doesn't exist in adapter {adapter}".format(adapter=self._ethernet_adapter,
                                                                                           port_number=port_number))

        nio = self._ethernet_adapter.get_nio(0)

        if not nio:
            raise VPCSError("Port {} is not connected".format(port_number))

        if nio.capturing:
            raise VPCSError("Packet capture is already activated on port {port_number}".format(port_number=port_number))

        nio.startPacketCapture(output_file)

        if self.ubridge:
            yield from self._ubridge_send('bridge start_capture {name} "{output_file}"'.format(name="VPCS-{}".format(self._id),
                                                                                               output_file=output_file))

        log.info("VPCS '{name}' [{id}]: starting packet capture on port {port_number}".format(name=self.name,
                                                                                              id=self.id,
                                                                                              port_number=port_number))
675844
def connection_made(self, transport):
        
        self.transport = transport
        self.loop = transport.loop
        self._cmd_lock = asyncio.Lock(loop=self.loop)
        self._wd_lock = asyncio.Lock(loop=self.loop)
        self._cmdq = asyncio.Queue(loop=self.loop)
        self._msgq = asyncio.Queue(loop=self.loop)
        self._updateq = asyncio.Queue(loop=self.loop)
        self._readbuf = b''
        self._update_cb = None
        self._received_lines = 0
        self._msg_task = self.loop.create_task(self._process_msgs())
        self._report_task = None
        self._watchdog_task = None
        self.status = {}
        self.connected = True
227805
def connect(self):
        

        if self._conn:
            return self._conn

        self._conn = psycopg2.connect(
            self.config,
            cursor_factory=psycopg2.extras.RealDictCursor,
        )

        self._conn.set_session(autocommit=True)
        psycopg2.extras.register_hstore(self._conn)

        return self._conn