Returns an array with the clients which can be easily used within ERB.
181581
def clients_erb
      retdict = {
        enabled: @config[:clients][:enabled],
        top: [],
        nottop: []
      }

      if @config[:clients][:enabled]
        top = @parsed[:clients].slice(0, @config[:clients][:top]) # top X clients
        top.each do |client|
          retdict[:top] << {
            name: client[1][:name],
            url: client[1][:url],
            count: client[1][:count],
            percentage: (client[1][:count] * 100 / @parsed[:tweet_count].to_f).round(2)
          }
        end

        nottop = @parsed[:clients].slice(@config[:clients][:top], @config[:clients][:notop]) # not in the top X
        unless nottop.nil?
          nottop.each do |client|
            client[1].delete(:example)
            retdict[:nottop] << {
              name: client[1][:name],
              url: client[1][:url],
              count: client[1][:count],
              percentage: (client[1][:count] * 100 / @parsed[:tweet_count].to_f).round(2)
            }
          end
        end
      end

      retdict
    end
552885
def to_array
      self.instance_variables.map do |var|
        if var == :@hosts
          self.instance_variable_get(var).map {|host| host.to_array}
        else
          self.instance_variable_get(var)
        end
      end
    end
781935
def get_clients_per_page(self, per_page=1000, page=1, params=None):
        
        return self._get_resource_per_page(resource=CLIENTS, per_page=per_page, page=page, params=params)
327591
def subscriptions(options = {})
      batches = Enumerator.new do |y|
        resp = @client.list_subscriptions(options)
        resp.each_page do |page|
          batch = []
          page.data.subscriptions.each do |s|
            batch << Subscription.new(
              arn: s.subscription_arn,
              client: @client
            )
          end
          y.yield(batch)
        end
      end
      Subscription::Collection.new(batches)
    end
1088609
@SuppressWarnings("unchecked")
    protected Collection<IClient> getClients() {
        if (!hasClients()) {
            // avoid creating new Collection object if no clients exist.
            return Collections.EMPTY_SET;
        }
        return Collections.unmodifiableCollection(clients.values());
    }
670257
def serialize stuff
			if stuff.is_a? Array or stuff.is_a? ActiveRecord::Relation
				json = render_to_string json:QuickDryArraySerializer.new(stuff, root:get_model.model_name.route_key )
				hash = JSON.parse(json)
				temp = []
				if hash[get_model.model_name.route_key].first.has_key? get_model.model_name.route_key
					hash[get_model.model_name.route_key].each{|x| temp << x[get_model.model_name.route_key]}
					hash[get_model.model_name.route_key] = temp
					return hash.to_json
				end
				return json
			elsif stuff.is_a? get_model

			end
		end
178075
def get_clients(self, limit=None, offset=None):
        
        data = {}
        if limit:
            data['limit'] = limit
        if offset:
            data['offset'] = offset
        result = self._request('GET', '/clients', data=json.dumps(data))
        return result.json()
652659
def available_services(index = nil)
      loop do
        begin
          resp, nindex = _service.get_all(index: index)
          return [resp.keys - ['consul'], nindex] if nindex != index
        rescue Diplomat::Timeout
          # Continue waiting
        end
      end
    end
1180465
def client
      return @client unless @client.nil?
      @client = ::Elasticsearch::Client.new(
        hosts: hosts,
        retry_on_failure: true,
        log: true,
        logger: ::Logger.new('es_client.log', 10, 1_024_000)
      )
    end
705835
def get_machines(fields={}, less=[])
      list = get_metadata Rudy::Machines, fields, less
      if list.empty?
        if @@global.position.nil?
          raise Rudy::MachineGroupNotRunning, (@option.all ? nil : current_machine_group)
        else
          raise Rudy::MachineNotRunning, current_machine_name 
        end
      end
      list
    end
498950
def run_clients():
    
    clients = request.form.get('clients')
    if not clients:
        return jsonify({'Error': 'no clients provided'})

    result = {}
    for client_id in clients.split(','):
        if client_id not in drivers:
            init_client(client_id)
            init_timer(client_id)

        result[client_id] = get_client_info(client_id)

    return jsonify(result)
277537
def client_list(self, _type=None):
        
        "Returns a list of currently connected clients"
        if _type is not None:
            client_types = ('normal', 'master', 'replica', 'pubsub')
            if str(_type).lower() not in client_types:
                raise DataError("CLIENT LIST _type must be one of %r" % (
                                client_types,))
            return self.execute_command('CLIENT LIST', Token.get_token('TYPE'),
                                        _type)
        return self.execute_command('CLIENT LIST')
990538
def subscribers(options = {})
      load
      return [] if info['push'].nil? || info['push']['subscribers'].nil?

      info['push']['subscribers'].map { |s| Subscriber.new(s, self, options) }
    end
310508
function clientRes(res) {
    if (!res || !res.statusCode) {
        return (res);
    }

    return ({
        statusCode: res.statusCode,
        headers: res.headers
    });
}
1341962
def list_clients(self, instance=None):
        
        # Server does not do pagination on listings of this resource.
        # Return an iterator anyway for similarity with other API methods
        url = '/clients'
        if instance:
            url = '/instances/{}/clients'.format(instance)
        response = self.get_proto(path=url)
        message = rest_pb2.ListClientsResponse()
        message.ParseFromString(response.content)
        clients = getattr(message, 'client')
        return iter([Client(client) for client in clients])
926276
def load! parse_client=Parse::Client.default
      unless @objects
        pointer = @parent_object.pointer
        key = @column_name
        related_class = Parse::Object @raw_hash['className']
        @objects = related_class.find! :where => proc {
          related_to key, pointer
        }
      end
      @objects
    end
571160
protected function getSubClients()
	{
		if( !isset( $this->subclients ) )
		{
			$this->subclients = [];

			foreach( $this->getSubClientNames() as $name ) {
				$this->subclients[] = $this->getSubClient( $name );
			}
		}

		return $this->subclients;
	}