Returns an event for a given client & check name.
770004
def get_event(self, client, check):
        
        data = self._request('GET', '/events/{}/{}'.format(client, check))
        return data.json()
441623
async def send_event(self, client_id, service_name, event_name, event_info, directed_client=None):
        """"""

        if directed_client is not None and directed_client != client_id:
            return

        client_info = self.clients.get(client_id)
        if client_info is None:
            self._logger.warning("Attempted to send event to invalid client id: %s", client_id)
            return

        conn = client_info['connection']

        event = dict(service=service_name)
        if event_info is not None:
            event['payload'] = event_info

        self._logger.debug("Sending event: %s", event)

        await self.server.send_event(conn, event_name, event)
143094
public static synchronized IClient getNamedClient(String name) {
        if (simpleClientMap.get(name) != null) {
            return simpleClientMap.get(name);
        }
        try {
            return registerClientFromProperties(name, getNamedConfig(name));
        } catch (ClientException e) {
            throw new RuntimeException("Unable to create client", e);
        }
    }
1351982
def _get_event(event_file_name):
    

    if event_file_name == STDIN_FILE_NAME:
        # If event is empty, listen to stdin for event data until EOF
        LOG.info("Reading invoke payload from stdin (you can also pass it from file with --event)")

    # click.open_file knows to open stdin when filename is '-'. This is safer than manually opening streams, and
    # accidentally closing a standard stream
    with click.open_file(event_file_name, 'r') as fp:
        return fp.read()
1227464
def find_event(name):
    
    try:
        module, klass = parse_event_name(name)
        return getattr(import_module(module), klass)
    except (ImportError, AttributeError):
        raise EventNotFoundError(
            ('Event "{}" not found. '
             'Make sure you have a class called "{}" inside the "{}" '
             'module.'.format(name, klass, module)))
894807
private EventHandler getEventHandler(Connection connection, String name) {
        final String READ_ONE_EVENT_HANDLER_QUERY = "SELECT json_data FROM meta_event_handler WHERE name = ?";

        return query(connection, READ_ONE_EVENT_HANDLER_QUERY,
                q -> q.addParameter(name).executeAndFetchFirst(EventHandler.class));
    }
815702
def client(self, name=None):
        """"""
        name = name or self.default
        if not name:
            return NullClient(self, None, None)
        params = self.backends_hash[name]
        ccls = self.backends_schemas.get(params.scheme, TCPClient)
        return (yield from ccls(self, params.hostname, params.port).connect())
561022
def get_client(self, client_id):
        ''''''
        client_response = self.get_request('clients/%s' % client_id)
        return Client(self, client_response['client'])
1017875
def event(self, name, owner=None, **kwargs):
        
        return Event(self.tcex, name, owner=owner, **kwargs)
142190
function(event, name) {

            var eventListeners = this.__getEventListeners(event);

            if (!(name in eventListeners)) {
                throw new Error('Event listener for event "' + event + '" with name "' + name + '" does not exist!');
            }

            return eventListeners[event][name];
        }
421871
def _start_event_client(self):
        """"""
        event_client = SnippetClient(package=self.package, ad=self._ad)
        event_client.host_port = self.host_port
        event_client.device_port = self.device_port
        event_client.connect(self.uid,
                             jsonrpc_client_base.JsonRpcCommand.CONTINUE)
        return event_client
8275
def get_all_client_events(self, client):
        
        data = self._request('GET', '/events/{}'.format(client))
        return data.json()
725516
def getEvent(self, dev_id, starttime, endtime):
        """"""
        path = 'device/%s/event?startTime=%s&endTime=%s' % \
            (dev_id, starttime, endtime)
        return self.rachio.get(path)
1012119
def delete_event(self, client, check):
        
        self._request('DELETE', '/events/{}/{}'.format(client, check))
        return True
31876
def get_client(self, name):
        
        mech = self.get(name)
        return mech if isinstance(mech, ClientMechanism) else None
356910
def event_return(events):
    '''
    
    '''

    for event in events:
        ret = event.get('data', False)

        if ret:
            returner(ret)
359582
def trigger(self, event_name, data):
        
        if self.connection:
            if event_name.startswith("client-"):
                if self.name.startswith("private-") or self.name.startswith("presence-"):
                    self.connection.send_event(event_name, data, channel_name=self.name)