Return event data via SMTP
356910
def event_return(events):
    '''
    
    '''

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

        if ret:
            returner(ret)
195056
async def data(
        self, message: Union[str, bytes], timeout: DefaultNumType = _default
    ) -> SMTPResponse:
        
        await self._ehlo_or_helo_if_needed()
        # As data accesses protocol directly, some handling is required
        self._raise_error_if_disconnected()

        if timeout is _default:
            timeout = self.timeout  # type: ignore

        if isinstance(message, str):
            message = message.encode("ascii")

        async with self._command_lock:
            start_response = await self.execute_command(b"DATA", timeout=timeout)

            if start_response.code != SMTPStatus.start_input:
                raise SMTPDataError(start_response.code, start_response.message)

            try:
                await self.protocol.write_message_data(  # type: ignore
                    message, timeout=timeout
                )
                response = await self.protocol.read_response(  # type: ignore
                    timeout=timeout
                )
            except SMTPServerDisconnected as exc:
                self.close()
                raise exc

        if response.code != SMTPStatus.completed:
            raise SMTPDataError(response.code, response.message)

        return response
931273
def get_event(self, param):
        

        if param is None:
            return None
        if isinstance(param, str):
            url = self.build_url(
                self._endpoints.get('get_event').format(id=self.calendar_id,
                                                        ide=param))
            params = None
            by_id = True
        else:
            url = self.build_url(
                self._endpoints.get('get_events').format(id=self.calendar_id))
            params = {'$top': 1}
            params.update(param.as_params())
            by_id = False

        response = self.con.get(url, params=params,
                                headers={'Prefer': 'outlook.timezone="UTC"'})
        if not response:
            return None

        if by_id:
            event = response.json()
        else:
            event = response.json().get('value', [])
            if event:
                event = event[0]
            else:
                return None
        return self.event_constructor(parent=self,
                                      **{self._cloud_data_key: event})
1129935
def event_return(events):
    '''
    
    '''
    with _get_serv(events, commit=True) as cur:
        for event in events:
            tag = event.get('tag', '')
            data = event.get('data', '')
            sql = '''INSERT INTO salt_events (tag, data, master_id, alter_time)
                     VALUES (%s, %s, %s, to_timestamp(%s))'''
            cur.execute(sql, (tag, psycopg2.extras.Json(data),
                              __opts__['id'], time.time()))
42637
def get_user_events(self, id, **data):
        
        
        return self.get("/users/{0}/events/".format(id), data=data)
1105357
def event_return(events):
    '''
    
    '''
    options = _get_options()

    index = options['master_event_index']
    doc_type = options['master_event_doc_type']

    if options['index_date']:
        index = '{0}-{1}'.format(index,
            datetime.date.today().strftime('%Y.%m.%d'))

    _ensure_index(index)

    for event in events:
        data = {
            'tag': event.get('tag', ''),
            'data': event.get('data', '')
        }

    ret = __salt__['elasticsearch.document_create'](index=index,
                                                    doc_type=doc_type,
                                                    id=uuid.uuid4(),
                                                    body=salt.utils.json.dumps(data))
528156
def _get_event(receiver_id, event_id):
        """"""
        event = Event.query.filter_by(
            receiver_id=receiver_id, id=event_id
        ).first_or_404()

        try:
            user_id = request.oauth.access_token.user_id
        except AttributeError:
            user_id = current_user.get_id()

        if event.user_id != int(user_id):
            abort(401)

        return event
453119
def event_return(events):
    '''
    
    '''
    opts = _get_options({})  # Pass in empty ret, since this is a list of events
    opts['skip'] = True
    for event in events:
        log.trace('Carbon returner received event: %s', event)
        metric_base = event['tag']
        saltdata = event['data'].get('data')
        _send(saltdata, metric_base, opts)
337187
function SMTP() {
    $this->smtp_conn = 0;
    $this->error = null;
    $this->helo_rply = null;

    $this->do_debug = 0;
  }
1368819
function getData(event) {
        var types = toArray(event.dataTransfer.types);

        return types.reduce(function (collection, type) {
          // Get data.
          var data = event.dataTransfer.getData(type);

          // Get data format.
          var format = /(.*)\//.exec(type);
          format = format ? format[1] : null;

          // Parse data.
          if (format === 'json') data = JSON.parse(data);

          collection[type] = data;

          return collection;
        }, {});
      }
1298816
def get(self, receiver_id=None, event_id=None):
        """"""
        event = self._get_event(receiver_id, event_id)
        return make_response(event)
964133
def send_mail(self, event):
        """"""

        mime_mail = MIMEText(event.text)
        mime_mail['Subject'] = event.subject

        if event.account == 'default':
            account_name = self.config.default_account
        else:
            account_name = event.account

        account = list(filter(lambda account: account['name'] == account_name, self.config.accounts))[0]

        mime_mail['From'] = render(account['mail_from'], {'server': account['server'], 'hostname': self.hostname})
        mime_mail['To'] = event.to_address

        self.log('MimeMail:', mime_mail, lvl=verbose)
        if self.config.mail_send is True:
            self.log('Sending mail to', event.to_address)

            self.fireEvent(task(send_mail_worker, account, mime_mail, event), "mail-transmit-workers")
        else:
            self.log('Not sending mail, here it is for debugging info:', mime_mail, pretty=True)
937426
function getEventType(inboundMessage) {
    let recipientAddresses = _.map(inboundMessage.recipients, 'email');
    let ccAddresses = _.map(inboundMessage.cc, 'email');

    if (_.max([recipientAddresses.indexOf(fuse.config.inbound_address),
               recipientAddresses.indexOf(inboundMessage.to.email)]) >= 0) {
      return 'direct_email';
    }
    else if (_.max([ccAddresses.indexOf(fuse.config.inbound_address),
                    ccAddresses.indexOf(inboundMessage.to.email)]) >= 0) {
      return 'cc_email';
    }
    else {
      return 'bcc_email';
    }
  }
104991
def echo_event(data):
    """"""
    return click.echo(json.dumps(data, sort_keys=True, indent=2))
262794
def _smtp_server(self):
        """"""

        if self._use_ssl:
            server = smtplib.SMTP_SSL(**self._smtp_vars)
        else:
            server = smtplib.SMTP(**self._smtp_vars)

        if self._use_tls:
            server.starttls()

        if self._credentials is not None:
            passwd = self._credentials[1]
            if passwd is None:
                passwd = self._interface.input( \
                    'Password for %s' % (self._credentials[0],), no_echo=True)
            server.login(*self._credentials)

            # if we succeeded, cache the password
            self._credentials = (self._credentials[0], passwd)

        return server
1036030
function event_list($params) {
		if ($this->version == 1) {
			// not supported currently.
			//$request_url = "{$this->url}&api_action=contact_delete_list&api_output={$this->output}&{$params}";
		} elseif ($this->version == 2) {
			$request_url = "{$this->url_base}/track/event";
		}
		$response = $this->curl($request_url, array(), "GET", "tracking_event_list");
		return $response;
	}
99715
def event_return(events):
    '''
    
    '''
    conn, mdb = _get_conn(ret=None)

    if isinstance(events, list):
        events = events[0]

    if isinstance(events, dict):
        log.debug(events)

        if PYMONGO_VERSION > _LooseVersion('2.3'):
            mdb.events.insert_one(events.copy())
        else:
            mdb.events.insert(events.copy())