Loads the list of mails on folders,
 +options+ can have these values: size, page, attribute = ALL|NONE|GLOBALLISTER|SECONDARY|EXPLORER
 Returns a list of elements
 It returns nil if no element with this elementKey was found
761392
def mails(element_key, options = {})
      parameter = { query: options }
      parameter[:basic_auth] = @auth

      response = self.class.get("/elements/#{element_key}/mails", parameter)
      return response['ElementList'] if response.success?
    end
544491
def get_all(selector, separator)
      elements = @mechanize_page.search(selector)
      throw_if_empty(elements, "elements", selector)

      (elements.map &:text).join(separator)
    end
543536
def formatted
      list = element.addresses.map { |a| a.format }
      Mail::AddressContainer.new(self, list)
    end
786717
def list_url?(u = nil, parsed: nil)
      return false if (u.nil? || u.empty?) && parsed.nil?
      parsed ||= parse_url(u)
      child_type = parsed[:child_type]
      parsed[:type] == 'lists' && (child_type.nil? || child_type.empty?)
    end
1252323
def get_values(self):
        
        elements_selected = {}
        for index in range(self.tree_loaded_model.rowCount()):
            element_name = str(self.tree_loaded_model.item(index).text())
            if element_name in self.elements_old:
                elements_selected.update({element_name: self.elements_old[element_name]})
            elif element_name in self.elements_from_file:
                elements_selected.update({element_name: self.elements_from_file[element_name]})


        return elements_selected
1059190
def load
      resp = @client.describe_tags(filters: [
        {
          name: "key",
          values: [@key]
        },
        {
          name: "value",
          values: [@value]
        }
      ])
      @data = resp.tags[0]
      self
    end
1192002
def [](key)
      if self.map? && @data.has_key?(key)
        @data[key]
      elsif (self.map?  && @data.has_value?(key)) ||
            (self.list? && @data.include?(key))
        key
      else
        nil
      end
    end
1366253
def load_elements(self, elements):
        ""
        self.pg_no = 0
        self.elements = elements
        self.keys = [v['name'].lower() for v in self.elements]
738548
function () {
                var items = this.items;
                var itemsLength = items.length;
                var pageSize = this.pageSize;
                if (pageSize <= 0) {
                    pageSize = -1;
                }
                var pages = [], pageLength = 0;
                var pageIndex = 0;
                var nbElementsInPage = 0;
                var firstElement = -1;
                for (var i = 0; i < itemsLength; i++) {
                    var elt = items[i];
                    if (elt.filteredIn) {
                        if (nbElementsInPage === 0) {
                            firstElement = i;
                        }
                        nbElementsInPage++;
                        elt.pageIndex = pageIndex;
                        if (nbElementsInPage == pageSize) {
                            pages[pageLength++] = {
                                pageIndex : pageIndex,
                                pageNumber : pageIndex + 1,
                                firstItemIndex : firstElement,
                                lastItemIndex : i,
                                firstItemNumber : pageIndex * pageSize + 1,
                                lastItemNumber : (pageIndex + 1) * pageSize
                            };
                            pageIndex++;
                            nbElementsInPage = 0;
                        }
                    } else {
                        elt.pageIndex = -1;
                    }
                }
                this._currentState.pageSize = pageSize;
                this.pageMode = (pageSize > 0);
                this.filteredInCount = pageIndex * pageSize + nbElementsInPage; // true even when pageMode == false (as
                // pageIndex == 0)
                if (nbElementsInPage > 0) {
                    pages[pageLength++] = {
                        pageIndex : pageIndex,
                        pageNumber : pageIndex + 1,
                        firstItemIndex : firstElement,
                        lastItemIndex : itemsLength - 1,
                        firstItemNumber : pageIndex * pageSize + 1,
                        lastItemNumber : this.filteredInCount
                    };
                }
                if (pageLength === 0) {
                    // there always must be at least one page
                    pages = this.EMPTY_PAGES;
                }
                this.pages = pages;
            }
829254
def list( items, mode = :rows, option = nil )
    items = items.to_ary.map do |item|
      ERB.new(item, nil, "%").result(binding)
    end
    
    case mode
    when :inline
      option = " or " if option.nil?
      
      case items.size
      when 0
        ""
      when 1
        items.first
      when 2
        "#{items.first}#{option}#{items.last}"
      else
        items[0..-2].join(", ") + "#{option}#{items.last}"
      end
    when :columns_across, :columns_down
      max_length = actual_length(
        items.max { |a, b| actual_length(a) <=> actual_length(b) }
      )

      if option.nil?
        limit  = @wrap_at || 80
        option = (limit + 2) / (max_length + 2)
      end

      items     = items.map do |item|
        pad = max_length + (item.length - actual_length(item))
        "%-#{pad}s" % item
      end
      row_count = (items.size / option.to_f).ceil
      
      if mode == :columns_across
        rows = Array.new(row_count) { Array.new }
        items.each_with_index do |item, index|
          rows[index / option] << item
        end

        rows.map { |row| row.join("  ") + "\n" }.join
      else
        columns = Array.new(option) { Array.new }
        items.each_with_index do |item, index|
          columns[index / row_count] << item
        end
      
        list = ""
        columns.first.size.times do |index|
          list << columns.map { |column| column[index] }.
                          compact.join("  ") + "\n"
        end
        list
      end
    else
      items.map { |i| "#{i}\n" }.join
    end
  end
354184
def load(opts)
      doc = nil
      if(opts.has_key?(:file)) then
        File.open(opts[:file], "rb") { |fd| doc = Nokogiri::XML::Document.parse(fd, nil, nil, Nokogiri::XML::ParseOptions::NOBLANKS|Nokogiri::XML::ParseOptions::NOENT) }
      else
        doc = Nokogiri::XML::Document.parse(opts[:data], nil, nil, Nokogiri::XML::ParseOptions::NOBLANKS|Nokogiri::XML::ParseOptions::NOENT)
      end

      if doc
        root = doc.root.children.first
        return import_xml(root)
      end
    rescue Nokogiri::XML::SyntaxError => e
      raise CFFormatError.new('invalid XML: ' + e.message)
    end
289161
def load( self ):
        
        if self._loaded:
            return
        
        self._loaded = True
        self.setChildIndicatorPolicy(self.DontShowIndicatorWhenChildless)
        
        if not self.isFolder():
            return
        
        path = self.filepath()
        if not os.path.isdir(path):
            path = os.path.dirname(path)
        
        for name in os.listdir(path):
            # ignore 'hidden' folders
            if name.startswith('_') and not name.startswith('__'):
                continue
            
            # ignore special cases (only want modules for this)
            if '-' in name:
                continue
            
            # use the index or __init__ information
            if name in ('index.html', '__init__.html'):
                self._url = 'file:///%s/%s' % (path, name)
                continue
            
            # otherwise, load a childitem
            filepath = os.path.join(path, name)
            folder = os.path.isdir(filepath)
            XdkEntryItem(self, filepath, folder=folder)
165238
def load_docs
      @options[:flags] |= [:no_cursor_timeout] if @options[:no_timeout]
      options = @options.clone
      options[:limit] = request_limit

      reply, @node = read_preference.with_node(session.cluster) do |node|
        [ node.query(@database, @collection, @selector, query_options(options)), node ]
      end

      @limit -= reply.count if limited?
      @cursor_id = reply.cursor_id
      reply.documents
    end
702749
def emails(fields = nil)
      @emails = ActionMailer::Base.deliveries.select {|m| email_has_fields?(m, fields)}
    end
260589
def find_elements(self):
        
        es = []
        for element_id in self.find_element_ids():
            e = Element(self.http.new_client(''), element_id)
            es.append(e)
        return es
373668
def expanded_items(calendar_view_options)
      calendar_view = CalendarView.new(calendar_view_options)
      items = Item.find_calendar_view_set_by_folder_id(id, calendar_view)

      items.each { |item| item.parent_folder = self }
    end
73615
def has_many_elements(element, target_model)
      element.class.reflect_on_all_associations(:has_many).each do |assoc|
        if assoc.name.to_s == target_model.downcase.pluralize
          model = Object.const_get(target_model.singularize.camelize)
          return element.send(target_model.downcase.pluralize).paginate(:per_page => 10, :page => 1)
        end
      end
      return []
    end