Returns a list of PingdomEmailReport instances.
328047
def getEmailReports(self):
        """"""

        reports = [PingdomEmailReport(self, x) for x in
                   self.request('GET',
                                'reports.email').json()['subscriptions']]

        return reports
87205
def get_queues(self):
        """"""
        res = self.celery.control.inspect().active_queues() or dict()
        return [result.get('name') for host in res.values() for result in host]
801270
def ThreadsWithRunningExecServers(self):
    """"""
    socket_dir = '/tmp/pyringe_%s' % self.inferior.pid
    if os.path.isdir(socket_dir):
      return [int(fname[:-9])
              for fname in os.listdir(socket_dir)
              if fname.endswith('.execsock')]
    return []
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']
613683
def ips(self):
        """"""
        r = []
        names = ['X_FORWARDED_FOR', 'CLIENT_IP', 'X_REAL_IP', 'X_FORWARDED', 
               'X_CLUSTER_CLIENT_IP', 'FORWARDED_FOR', 'FORWARDED', 'VIA',
               'REMOTE_ADDR']

        for name in names:
            vs = self.get_header(name, '')
            if vs:
                r.extend(map(lambda v: v.strip(), vs.split(',')))

            vs = self.environ.get(name, '')
            if vs:
                r.extend(map(lambda v: v.strip(), vs.split(',')))

        return r
441228
def network_profiles(self, obj):
        """"""

        networks = []
        network_ids = []
        network_summary = self._send_cmd_to_wpas(
            obj['name'],
            'LIST_NETWORKS',
            True)
        network_summary = network_summary[:-1].split('\n')
        if len(network_summary) == 1:
            return networks

        for l in network_summary[1:]:
            network_ids.append(l.split()[0])

        for network_id in network_ids:
            network = Profile()

            network.id = network_id

            ssid = self._send_cmd_to_wpas(
                obj['name'],
                'GET_NETWORK {} ssid'.format(network_id), True)
            if ssid.upper().startswith('FAIL'):
                continue
            else:
                network.ssid = ssid[1:-1]

            key_mgmt = self._send_cmd_to_wpas(
                obj['name'],
                'GET_NETWORK {} key_mgmt'.format(network_id),
                True)

            network.akm = []
            if key_mgmt.upper().startswith('FAIL'):
                continue
            else:
                if key_mgmt.upper() in ['WPA-PSK']:
                    proto = self._send_cmd_to_wpas(
                        obj['name'],
                        'GET_NETWORK {} proto'.format(network_id),
                        True)

                    if proto.upper() == 'RSN':
                        network.akm.append(AKM_TYPE_WPA2PSK)
                    else:
                        network.akm.append(AKM_TYPE_WPAPSK)
                elif key_mgmt.upper() in ['WPA-EAP']:
                    proto = self._send_cmd_to_wpas(
                        obj['name'],
                        'GET_NETWORK {} proto'.format(network_id),
                        True)

                    if proto.upper() == 'RSN':
                        network.akm.append(AKM_TYPE_WPA2)
                    else:
                        network.akm.append(AKM_TYPE_WPA)

            ciphers = self._send_cmd_to_wpas(
                obj['name'],
                'GET_NETWORK {} pairwise'.format(network_id),
                True).split(' ')

            if ciphers[0].upper().startswith('FAIL'):
                continue
            else:
                # Assume the possible ciphers TKIP and CCMP
                if len(ciphers) == 1:
                    network.cipher = cipher_str_to_value(ciphers[0].upper())
                elif 'CCMP' in ciphers:
                    network.cipher = CIPHER_TYPE_CCMP

            networks.append(network)

        return networks
637235
def ping_directories(self, request, queryset, messages=True):
        
        for directory in settings.PING_DIRECTORIES:
            pinger = DirectoryPinger(directory, queryset)
            pinger.join()
            if messages:
                success = 0
                for result in pinger.results:
                    if not result.get('flerror', True):
                        success += 1
                    else:
                        self.message_user(request,
                                          '%s : %s' % (directory,
                                                       result['message']))
                if success:
                    self.message_user(
                        request,
                        _('%(directory)s directory succesfully '
                          'pinged %(success)d entries.') %
                        {'directory': directory, 'success': success})
1119982
def get_ntp_stats(self):
        """"""
        ntp_stats = []

        command = "show ntp associations"
        output = self._send_command(command)

        for line in output.splitlines():
            # Skip first two lines and last line of command output
            if line == "" or "address" in line or "sys.peer" in line:
                continue

            if "%NTP is not enabled" in line:
                return []

            elif len(line.split()) == 9:
                address, ref_clock, st, when, poll, reach, delay, offset, disp = (
                    line.split()
                )
                address_regex = re.match(r"(\W*)([0-9.*]*)", address)
            try:
                ntp_stats.append(
                    {
                        "remote": py23_compat.text_type(address_regex.group(2)),
                        "synchronized": ("*" in address_regex.group(1)),
                        "referenceid": py23_compat.text_type(ref_clock),
                        "stratum": int(st),
                        "type": "-",
                        "when": py23_compat.text_type(when),
                        "hostpoll": int(poll),
                        "reachability": int(reach),
                        "delay": float(delay),
                        "offset": float(offset),
                        "jitter": float(disp),
                    }
                )
            except Exception:
                continue

        return ntp_stats
869743
def get_all_instance_profiles(path_prefix='/', region=None, key=None,
                              keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    marker = False
    profiles = []
    while marker is not None:
        marker = marker if marker else None
        p = conn.list_instance_profiles(path_prefix=path_prefix,
                                                   marker=marker)
        res = p.list_instance_profiles_response.list_instance_profiles_result
        profiles += res.instance_profiles
        marker = getattr(res, 'marker', None)
    return profiles
184377
def get_subscriptions(self, socket_id):
        """"""
        con = self._get_connection(socket_id, create=False)
        if con is None:
            return []
        return sorted(con.subscriptions)
28004
def groups(self):
        
        if len(self.groupings) == 1:
            return self.groupings[0].groups
        else:
            to_groupby = lzip(*(ping.grouper for ping in self.groupings))
            to_groupby = Index(to_groupby)
            return self.axis.groupby(to_groupby)
581517
def get_servers_list(self):
        
        ret = []

        if self.args.browser:
            ret = self.static_server.get_servers_list()
            if self.autodiscover_server is not None:
                ret = self.static_server.get_servers_list() + self.autodiscover_server.get_servers_list()

        return ret
361316
def get_instances(self, state_filter=None):
    

    instances = []
    for instance in self._get_instances(self._get_cluster_group_name(), 
                                        state_filter):
      instances.append(Instance(instance.id, instance.dns_name, 
                                instance.private_dns_name, 
                                instance.private_ip_address))
    return instances
569065
def get_instances(self):
        
        if self._update_members: self.update()
        return iter(sorted(self.members.iteritems()))
476563
private static String getHostnamesFromInstances(Iterable<TaskManagerLocation> locations) {
		StringBuilder bld = new StringBuilder();

		boolean successive = false;
		for (TaskManagerLocation loc : locations) {
			if (successive) {
				bld.append(", ");
			} else {
				successive = true;
			}
			bld.append(loc.getHostname());
		}

		return bld.toString();
	}
785442
def get_urlpatterns(self):
        
        return [
            path(
                _('mark/forums/'),
                self.mark_forums_read_view.as_view(),
                name='mark_all_forums_read',
            ),
            path(
                _('mark/forums/<int:pk>/'),
                self.mark_forums_read_view.as_view(),
                name='mark_subforums_read',
            ),
            path(
                _('mark/forum/<int:pk>/topics/'),
                self.mark_topics_read_view.as_view(),
                name='mark_topics_read',
            ),
            path(
                _('unread-topics/'),
                self.unread_topics_view.as_view(),
                name='unread_topics',
            ),
        ]
661507
def floating_ip_list(self):
        '''
        
        '''
        nt_ks = self.compute_conn
        floating_ips = nt_ks.floating_ips.list()
        response = {}
        for floating_ip in floating_ips:
            response[floating_ip.ip] = {
                'ip': floating_ip.ip,
                'fixed_ip': floating_ip.fixed_ip,
                'id': floating_ip.id,
                'instance_id': floating_ip.instance_id,
                'pool': floating_ip.pool
            }
        return response