List the containers in this account, using the parameters to control
        the pagination of containers, since by default only the first 10,000
        containers are returned.
772695
def list(self, limit=None, marker=None, end_marker=None, prefix=None):
        
        return self._manager.list(limit=limit, marker=marker,
                end_marker=end_marker, prefix=prefix)
205970
def list(self, request):
        

        max_items_per_page = getattr(self, 'max_per_page',
                                      getattr(settings, 'AJAX_MAX_PER_PAGE', 100))
        requested_items_per_page = request.POST.get("items_per_page", 20)
        items_per_page = min(max_items_per_page, requested_items_per_page)
        current_page = request.POST.get("current_page", 1)

        if not self.can_list(request.user):
            raise AJAXError(403, _("Access to this endpoint is forbidden"))

        objects = self.get_queryset(request)

        paginator = Paginator(objects, items_per_page)

        try:
            page = paginator.page(current_page)
        except PageNotAnInteger:
            # If page is not an integer, deliver first page.
            page = paginator.page(1)
        except EmptyPage:
            # If page is out of range (e.g. 9999), return empty list.
            page = EmptyPageResult()

        data = [encoder.encode(record) for record in page.object_list]
        return EnvelopedResponse(data=data, metadata={'total': paginator.count})
621887
def container_list_folder(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/listFolder' % object_id, input_params, always_retry=always_retry, **kwargs)
937590
def filter(self, containers=True, images=True, stopped=True, cached=False, sort_by_created=True):
        
        content = []
        containers_o = None
        images_o = None
        # return containers when containers=False and running=True
        if containers or not stopped:
            containers_o = self.get_containers(cached=cached, stopped=stopped)
            content += containers_o.response
        if images:
            images_o = self.get_images(cached=cached)
            content += images_o.response
        if sort_by_created:
            content.sort(key=attrgetter("natural_sort_value"), reverse=True)
        return content, containers_o, images_o
1062391
function(cid) {

    // Get list of generic containers.
    return list()
    // Filter by container id and container name.
    .filter(function(container) {
      return container.id === cid || container.name === cid;
    })
    // Return head on results.
    .then(function(results) {
      assert(results.length < 2);
      return _.head(results);
    });

  }
1002339
def paginate(self, request, offset=0, limit=None):
        """"""
        return self.collection.offset(offset).limit(limit), self.collection.count()
1026027
def paginate(objects, page_num, per_page, max_paging_links):
    
    if not per_page:
        return Paginator(objects, 0)
    paginator = Paginator(objects, per_page)
    try:
        page_num = int(page_num)
    except ValueError:
        page_num = 1
    try:
        objects = paginator.page(page_num)
    except (EmptyPage, InvalidPage):
        objects = paginator.page(paginator.num_pages)
    page_range = objects.paginator.page_range
    if len(page_range) > max_paging_links:
        start = min(objects.paginator.num_pages - max_paging_links,
            max(0, objects.number - (max_paging_links // 2) - 1))
        page_range = list(page_range)[start:start + max_paging_links]
    objects.visible_page_range = page_range
    return objects
558438
def list_instances(self):
        
        # Server does not do pagination on listings of this resource.
        # Return an iterator anyway for similarity with other API methods
        response = self.get_proto(path='/instances')
        message = rest_pb2.ListInstancesResponse()
        message.ParseFromString(response.content)
        instances = getattr(message, 'instance')
        return iter([Instance(instance) for instance in instances])
960598
@Override
  public void onContainersAllocated(final List<Container> allocatedContainers) {

    String id = null; // ID is used for logging only

    if (LOG.isLoggable(Level.FINE)) {

      id = String.format("%s:%d", Thread.currentThread().getName().replace(' ', '_'), System.currentTimeMillis());

      LOG.log(Level.FINE, "TIME: Allocated Containers {0} {1} of {2}",
          new Object[] {id, allocatedContainers.size(), this.containerRequestCounter.get()});
    }

    for (final Container container : allocatedContainers) {
      this.handleNewContainer(container);
    }

    LOG.log(Level.FINE, "TIME: Processed Containers {0}", id);
  }
495779
def get_account_info(self):
        
        headers = self._manager.get_account_headers()
        return (headers.get("x-account-container-count"),
                headers.get("x-account-bytes-used"))
1140541
def pagination_for(list, options={})
      if list.respond_to? :total_pages
        options = {
          max_per_page: detail['pagination.max_per_page'] || 500,
          depaginate: true
        }.merge(options.symbolize_keys)
        depaginate = options.delete(:depaginate)                                     # supply depaginate: false to omit the 'show all' link
        depagination_limit = options.delete(:max_per_page)                           # supply max_per_page: false to include the 'show all' link no matter how large the collection
        html = will_paginate(list, will_paginate_options.merge(options))
        if depaginate && list.total_pages > 1 && (!depagination_limit.blank? || list.total_entries <= depagination_limit.to_i)
          html << content_tag(:div, link_to(t('show_all'), pp: 'all'), class: 'depaginate')
        elsif depaginate && list.total_entries > depagination_limit.to_i
          html = content_tag(:div, link_to("paginate", p: 1), class: 'pagination')
        end
        html
      end
    end
984736
def paginate(self, request, collection):
        
        p = Paginator(request, self, collection)
        return p.paginator and p or UpdatedList(collection)
1368420
def get_containers(self):
        """"""
        permitted = lambda c: settings.container_permitted(c.name)
        return [c for c in self._get_containers() if permitted(c)]
1033631
def list(self, count=10):
    
    import IPython
    data = []
    # Add range(count) to loop so it will stop either it reaches count, or iteration
    # on self is exhausted. "self" is iterable (see __iter__() method).
    for _, model in zip(range(count), self.get_iterator()):
      element = {'name': model['name']}
      if 'defaultVersion' in model:
        version_short_name = model['defaultVersion']['name'].split('/')[-1]
        element['defaultVersion'] = version_short_name
      data.append(element)

    IPython.display.display(
        datalab.utils.commands.render_dictionary(data, ['name', 'defaultVersion']))
1153963
def paginate_results(self, results, options):
        ""
        limit = options.get('limit', settings.SELECTABLE_MAX_LIMIT)
        paginator = Paginator(results, limit)
        page = options.get('page', 1)
        try:
            results = paginator.page(page)
        except (EmptyPage, InvalidPage):
            results = paginator.page(paginator.num_pages)
        return results
519479
public function paging()
    {
        $limit = (int) $this->request->input('length') > 0 ? $this->request->input('length') : 10;
        if (is_callable($this->limitCallback)) {
            $this->query->limit($limit);
            call_user_func_array($this->limitCallback, [$this->query]);
        } else {
            $this->query->skip($this->request->input('start'))->take($limit);
        }
    }
713990
def list_services(self, instance):
        
        # Server does not do pagination on listings of this resource.
        # Return an iterator anyway for similarity with other API methods
        url = '/services/{}'.format(instance)
        response = self.get_proto(path=url)
        message = rest_pb2.ListServiceInfoResponse()
        message.ParseFromString(response.content)
        services = getattr(message, 'service')
        return iter([Service(service) for service in services])