If there is already a connection for this ssid, return the name of
    the connection; if there is not, return None.
8422
async def connection_exists(ssid: str) -> Optional[str]:
    
    nmcli_conns = await connections()
    for wifi in [c['name']
                 for c in nmcli_conns if c['type'] == 'wireless']:
        res, _ = await _call(['-t', '-f', '802-11-wireless.ssid',
                              '-m', 'tabular',
                              'connection', 'show', wifi])
        if res == ssid:
            return wifi
    return None
310739
def get_connection(self, id): # pylint: disable=invalid-name,redefined-builtin
        
        schema = ConnectionSchema()
        resp = self.service.get(self.base+str(id)+'/connect/')
        return self.service.decode(schema, resp)
1018855
def _vpc_peering_conn_id_for_name(name, conn):
    '''
    
    '''
    log.debug('Retrieving VPC peering connection id')
    ids = _get_peering_connection_ids(name, conn)
    if not ids:
        ids = [None]  # Let callers handle the case where we have no id
    elif len(ids) > 1:
        raise SaltInvocationError('Found multiple VPC peering connections '
                                  'with the same name!! '
                                  'Please make sure you have only '
                                  'one VPC peering connection named {0} '
                                  'or invoke this function with a VPC '
                                  'peering connection ID'.format(name))

    return ids[0]
464936
def _get_connection(self):
        
        if self._connection is None:
            uri = self.settings.SERVER_URI
            if callable(uri):
                uri = uri()

            self._connection = self.backend.ldap.initialize(uri)

            for opt, value in self.settings.CONNECTION_OPTIONS.items():
                self._connection.set_option(opt, value)

            if self.settings.START_TLS:
                logger.debug("Initiating TLS")
                self._connection.start_tls_s()

        return self._connection
1242616
def get_alias(self, using=None, **kwargs):
        
        return self._get_connection(using).indices.get_alias(index=self._name, **kwargs)
939220
def check_for_connection(self):
        
        for idx, arg in enumerate(self.args):
            if arg.startswith('@'):
                if arg[1:] not in config.connections:
                    self.parser.error("Undefined connection '{}'!".format(arg[1:]))
                config.scgi_url = config.connections[arg[1:]]
                self.LOG.debug("Switched to connection %s (%s)", arg[1:], config.scgi_url)
                del self.args[idx]
                break
865332
def get_default_connection_info(self, provider_name):
        
        provider = self._provider_client.get_by_name(provider_name)
        if provider:
            return provider['defaultConnectionInfo']
        else:
            return {}
243975
def get_available_name(self, name):
        
        local_available_name = self.local.get_available_name(name)
        remote_available_name = self.remote.get_available_name(name)

        if remote_available_name > local_available_name:
            return remote_available_name
        return local_available_name
864475
def get_connection(self, command_name, *keys, **options):
        """"""
        self._checkpid()
        try:
            connection = self._available_connections[self._pattern_idx].pop()
        except IndexError:
            connection = self.make_connection()
        self._in_use_connections[self._pattern_idx].add(connection)
        self._next_pattern()
        return connection
1228936
def exists_alias(self, using=None, **kwargs):
        
        return self._get_connection(using).indices.exists_alias(index=self._name, **kwargs)
1225586
def nonver_name(self):
        """"""
        nv = self.as_version(None)
        if not nv:
            import re
            nv = re.sub(r'-[^-]+$', '', self.name)

        return nv
425503
def _get_connection(self):
        
        if getattr(self, '_connection', None):
            logger.debug('Connection to sqlite db already exists. Using existing one.')
        else:
            dsn = self._dsn
            if dsn == 'sqlite://':
                dsn = ':memory:'
            else:
                dsn = dsn.replace('sqlite:///', '')

            logger.debug(
                'Creating new apsw connection.\n   dsn: {}, config_dsn: {}'
                .format(dsn, self._dsn))
            self._connection = apsw.Connection(dsn)

        return self._connection
260554
def get_connections(self, id, connection_name, **args):
        """"""
        return self.request(
            "{0}/{1}/{2}".format(self.version, id, connection_name), args
        )
623715
def get_cassandra_connection(alias=None, name=None):
    

    for _alias, connection in get_cassandra_connections():
        if alias is not None:
            if alias == _alias:
                return connection
        elif name is not None:
            if name == connection.settings_dict['NAME']:
                return connection
        else:
            return connection
1130877
public SICoreConnection getSICoreConnection()
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getSICoreConnection");
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getSICoreConnection", siCoreConnection);
      return siCoreConnection;
   }
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
892660
def _get_conn(ret=None):
    '''
    
    '''
    _options = _get_options(ret)
    dsn = _options.get('dsn')
    user = _options.get('user')
    passwd = _options.get('passwd')

    return pyodbc.connect('DSN={0};UID={1};PWD={2}'.format(
            dsn,
            user,
            passwd))