Gets a brief overview of statistics for all of your outbound email.
484719
def overview(self, tag=None, fromdate=None, todate=None):
        
        return self.call("GET", "/stats/outbound", tag=tag, fromdate=fromdate, todate=todate)
317408
def google(self, qs):
        """"""
        csvf = writer(sys.stdout)
        csvf.writerow(['Name', 'Email'])
        for ent in qs:
            csvf.writerow([full_name(**ent), ent['email']])
1271476
public void getTraceSummaryLine(StringBuilder buff) {
    buff.append("MESSAGE:");
    buff.append("type=");
    buff.append(getJsMessageType());
    buff.append(",id=");
    buff.append(getSystemMessageId());
    buff.append(",proto=");
    buff.append(getGuaranteedProtocolType());
    buff.append(",tick=");
    buff.append(getGuaranteedValueValueTick());
  }
1311625
def GetSummary(self):
    
    self.max_age = 0
    summary = rdf_client.ClientSummary(client_id=self.urn)
    summary.system_info.system = self.Get(self.Schema.SYSTEM)
    summary.system_info.release = self.Get(self.Schema.OS_RELEASE)
    summary.system_info.version = str(self.Get(self.Schema.OS_VERSION, ""))
    summary.system_info.kernel = self.Get(self.Schema.KERNEL)
    summary.system_info.fqdn = self.Get(self.Schema.FQDN)
    summary.system_info.machine = self.Get(self.Schema.ARCH)
    summary.system_info.install_date = self.Get(self.Schema.INSTALL_DATE)
    kb = self.Get(self.Schema.KNOWLEDGE_BASE)
    if kb:
      summary.users = kb.users
    summary.interfaces = self.Get(self.Schema.INTERFACES)
    summary.client_info = self.Get(self.Schema.CLIENT_INFO)
    hwi = self.Get(self.Schema.HARDWARE_INFO)
    if hwi:
      summary.serial_number = hwi.serial_number
      summary.system_manufacturer = hwi.system_manufacturer
      summary.system_uuid = hwi.system_uuid
    summary.timestamp = self.age
    cloud_instance = self.Get(self.Schema.CLOUD_INSTANCE)
    if cloud_instance:
      summary.cloud_type = cloud_instance.cloud_type
      if cloud_instance.cloud_type == "GOOGLE":
        summary.cloud_instance_id = cloud_instance.google.unique_id
      elif cloud_instance.cloud_type == "AMAZON":
        summary.cloud_instance_id = cloud_instance.amazon.instance_id
      else:
        raise ValueError("Bad cloud type: %s" % cloud_instance.cloud_type)

    return summary
250521
def get_stats(self, queue):
        
        uri = "/%s/%s/stats" % (self.uri_base, utils.get_id(queue))
        resp, resp_body = self.api.method_get(uri)
        return resp_body.get("messages")
1317352
def get_stats(self):
        '''
        
        '''
        resp = requests.get('%s/api/stats.json' % self.url)
        assert(resp.status_code == 200)
        return resp.json()
1336625
public static function emailReport() {		
		if(!isset($_REQUEST['email']) || !filter_var($_REQUEST['email'], FILTER_VALIDATE_EMAIL)) {
			echo json_encode(array('error'=>'Valid email address required'));
			return;
		}
		if(!isset($_REQUEST['url'])) {
			echo json_encode(array('error'=>'Report url required'));
			return;
		}
		if(!isset(PhpReports::$config['mail_settings']['enabled']) || !PhpReports::$config['mail_settings']['enabled']) {
			echo json_encode(array('error'=>'Email is disabled on this server'));
			return;
		}
		if(!isset(PhpReports::$config['mail_settings']['from'])) {
			echo json_encode(array('error'=>'Email settings have not been properly configured on this server'));
			return;
		}
		
		$from = PhpReports::$config['mail_settings']['from'];
		$subject = $_REQUEST['subject']? $_REQUEST['subject'] : 'Database Report';
		$body = $_REQUEST['message']? $_REQUEST['message'] : "You've been sent a database report!";
		$email = $_REQUEST['email'];
		$link = $_REQUEST['url'];
		$csv_link = str_replace('report/html/?','report/csv/?',$link);
		$table_link = str_replace('report/html/?','report/table/?',$link);
		$text_link = str_replace('report/html/?','report/text/?',$link);
		
		// Get the CSV file attachment and the inline HTML table
		$csv = self::urlDownload($csv_link);
		$table = self::urlDownload($table_link);
		$text = self::urlDownload($text_link);
		
		$email_text = $body."\n\n".$text."\n\nView the report online at $link";
		$email_html = "<p>$body</p>$table<p>View the report online at <a href=\"".htmlentities($link)."\">".htmlentities($link)."</a></p>";

		// Create the message
		$message = Swift_Message::newInstance()
		  ->setSubject($subject)
		  ->setFrom($from)
		  ->setTo($email)
		  //text body
		  ->setBody($email_text)
		  //html body
		  ->addPart($email_html, 'text/html')
		;
		
		$attachment = Swift_Attachment::newInstance()
			->setFilename('report.csv')
			->setContentType('text/csv')
			->setBody($csv)
		;
		
		$message->attach($attachment);
		
		// Create the Transport
		$transport = self::getMailTransport();
		$mailer = Swift_Mailer::newInstance($transport);

		try {
			// Send the message
			$result = $mailer->send($message);
		}
		catch(Exception $e) {
			echo json_encode(array(
				'error'=>$e->getMessage()
			));
			return;
		}
		
		if($result) {
			echo json_encode(array(
				'success'=>true
			));
		}
		else {
			echo json_encode(array(
				'error'=>'Failed to send email to requested recipient'
			));
		}
	}
43613
def get_email_context(self,**kwargs):
        '''  '''
        context = super(Customer,self).get_email_context(**kwargs)
        context.update({
            'first_name': self.first_name,
            'last_name': self.last_name,
            'email': self.email,
            'fullName': self.fullName,
            'phone': self.phone,
        })
        return context
369442
def total_msg_sent(self):
        
        return (self.get_count(PeerCounterNames.SENT_REFRESH) +
                self.get_count(PeerCounterNames.SENT_UPDATES))
1177822
def stats(self):
        
        with self._sock_ctx() as socket:
            self._send_message('stats', socket)
            body = self._receive_data_with_prefix(b'OK', socket)
            stats = yaml_load(body)
            return stats
847943
def getAllMetadata(self, remote, address):
        """"""
        if self._server is not None:
            return self._server.getAllMetadata(remote, address)
249209
def by_email_address(cls, email):
        """"""
        return DBSession.query(cls).filter_by(email_address=email).first()
1256309
def get_email_context(self,**kwargs):
        '''  '''
        context = super(Event,self).get_email_context(**kwargs)
        context.update({
            'id': self.id,
            'name': self.__str__(),
            'title': self.name,
            'start': self.firstOccurrenceTime,
            'next': self.nextOccurrenceTime,
            'last': self.lastOccurrenceTime,
            'url': self.url,
        })
        return context
39345
def emailclients(self, tag=None, fromdate=None, todate=None):
        
        return self.call("GET", "/stats/outbound/opens/emailclients", tag=tag, fromdate=fromdate, todate=todate)
326702
def _get_stats_files(data, out_dir=None):
    
    if not out_dir:
        out_dir = utils.safe_makedir(os.path.join(dd.get_work_dir(data),
                                                  "qc", dd.get_sample_name(data), "samtools"))
    stats_file = tz.get_in(["depth", "samtools", "stats"], data)
    idxstats_file = tz.get_in(["depth", "samtools", "idxstats"], data)
    if not stats_file:
        stats_file = os.path.join(out_dir, "%s.txt" % dd.get_sample_name(data))
    if not idxstats_file:
        idxstats_file = os.path.join(out_dir, "%s-idxstats.txt" % dd.get_sample_name(data))
    return stats_file, idxstats_file
735653
def summary(self, raw):
        """"""
        taxonomies = list()
        level = 'info'
        namespace = 'Backscatter.io'

        if self.service == 'observations':
            summary = raw.get('results', dict()).get('summary', dict())
            taxonomies = taxonomies + [
                self.build_taxonomy(level, namespace, 'Observations', summary.get('observations_count', 0)),
                self.build_taxonomy(level, namespace, 'IP Addresses', summary.get('ip_address_count', 0)),
                self.build_taxonomy(level, namespace, 'Networks', summary.get('network_count', 0)),
                self.build_taxonomy(level, namespace, 'AS', summary.get('autonomous_system_count', 0)),
                self.build_taxonomy(level, namespace, 'Ports', summary.get('port_count', 0)),
                self.build_taxonomy(level, namespace, 'Protocols', summary.get('protocol_count', 0))
            ]
        elif self.service == 'enrichment':
            summary = raw.get('results', dict())
            if self.data_type == 'ip':
                taxonomies = taxonomies + [
                    self.build_taxonomy(level, namespace, 'Network', summary.get('network')),
                    self.build_taxonomy(level, namespace, 'Network Broadcast', summary.get('network_broadcast')),
                    self.build_taxonomy(level, namespace, 'Network Size', summary.get('network_size')),
                    self.build_taxonomy(level, namespace, 'Country', summary.get('country_name')),
                    self.build_taxonomy(level, namespace, 'AS Number', summary.get('as_num')),
                    self.build_taxonomy(level, namespace, 'AS Name', summary.get('as_name')),
                ]
            elif self.data_type == 'network':
                taxonomies = taxonomies + [
                    self.build_taxonomy(level, namespace, 'Network Size', summary.get('network_size'))
                ]
            elif self.data_type == 'autonomous-system':
                taxonomies = taxonomies + [
                    self.build_taxonomy(level, namespace, 'Prefix Count', summary.get('prefix_count')),
                    self.build_taxonomy(level, namespace, 'AS Number', summary.get('as_num')),
                    self.build_taxonomy(level, namespace, 'AS Name', summary.get('as_name'))
                ]
            elif self.data_type == 'port':
                for result in raw.get('results', list()):
                    display = "%s (%s)" % (result.get('service'), result.get('protocol'))
                    taxonomies.append(self.build_taxonomy(level, namespace, 'Service', display))
            else:
                pass
        else:
            pass
        return {"taxonomies": taxonomies}
593245
def probes(self, fromtime, totime=None):
        """"""

        args = {'from': fromtime}
        if totime:
            args['to'] = totime

        response = self.pingdom.request('GET', 'summary.probes/%s' % self.id,
                                        args)

        return response.json()['probes']