Returns the high data derived from the top file
435695
def get_top(self):
        '''
        
        '''
        tops, errors = self.get_tops()
        try:
            merged_tops = self.merge_tops(tops)
        except TypeError as err:
            merged_tops = OrderedDict()
            errors.append('Error encountered while rendering pillar top file.')
        return merged_tops, errors
313836
def _file_details(filename):
    
    max_head, max_foot = _max_lengths()
    with open(filename, "rb") as fin:
        head = fin.read(max_head)
        try:
            fin.seek(-max_foot, os.SEEK_END)
        except IOError:
            fin.seek(0)
        foot = fin.read()
    return head, foot
417000
def top(self):
        
        nodes = []
        for node in self.nodes():
            nodes.append(self.http_client.get(API_TOP % node['name']))
        return nodes
1041758
def top_directory(self):
        """"""
        if self.handle:
            return os.path.commonprefix(self.handle.getnames()).rstrip('/')
224995
def get_top_gainers(self, as_json=False):
        
        url = self.top_gainer_url
        req = Request(url, None, self.headers)
        # this can raise HTTPError and URLError
        res = self.opener.open(req)
        # for py3 compat covert byte file like object to
        # string file like object
        res = byte_adaptor(res)
        res_dict = json.load(res)
        # clean the output and make appropriate type conversions
        res_list = [self.clean_server_response(item) for item in res_dict['data']]
        return self.render_response(res_list, as_json)
1131395
def getTopdir(topfile, start=None):
    """"""
    if not start:
        start = os.getcwd()
    here = start
    toomany = 20
    while toomany > 0:
        if os.path.exists(os.path.join(here, topfile)):
            return here
        next = os.path.dirname(here)
        if next == here:
            break                       # we've hit the root
        here = next
        toomany -= 1
    output("Unable to find topfile '{}' anywhere "
           "from {} upwards".format(topfile, start))
    sys.exit(1)
500233
def data(self):
        
        return self._buf[self.offset():self.offset() + self.size()]
730567
def upper(self):
        
        q = self.copy()
        q.addFunction(Query.Function.Upper)
        return q
567673
def get_top(self, stat, n):
        """'"""
        return sorted(self.stats, key=lambda x: getattr(x, stat), reverse=True)[:n]
549195
def GetRootFileEntry(self):
    
    path_spec = data_range_path_spec.DataRangePathSpec(
        range_offset=self._range_offset,
        range_size=self._range_size,
        parent=self._path_spec.parent)
    return self.GetFileEntryByPathSpec(path_spec)
366842
def _get_header(self):
        """"""

        try:
            header_lines = [int(e) for e in str(self.get_value('headerlines', 0)).split(',')]
        except ValueError as e:
            header_lines = [0]

        # We're processing the raw datafile, with no schema.
        header_rows = islice(self.row_generator, min(header_lines), max(header_lines) + 1)

        from tableintuit import RowIntuiter
        headers = RowIntuiter.coalesce_headers(header_rows)

        return headers
714435
def _tab(max_i=None):
    

    filepath = Path(__file__).parent / "data" / "tab5.1.txt"

    result = []
    with filepath.open() as fhd:
        i = 0
        for line in fhd.read().splitlines():
            if line.startswith("#") or not line.strip():
                continue

            fields = line.split()
            result.append(([int(x) for x in fields[:5]], [float(x) for x in fields[6:]]))

            i += 1
            if max_i and i >= max_i:
                break

    return result
101020
def _top_element(self):
        """"""
        top = etree.Element("testsuites")
        comment = etree.Comment("Generated for testrun {}".format(self.testrun_id))
        top.append(comment)
        return top
471229
def top_class(self):
        """"""
        curr = self
        parent = self.parent
        while isinstance(parent, class_t):
            curr = parent
            parent = parent.parent
        return curr
94594
def _detect_toplevels(self):
        
        return tuple(e for e in toplevels.identify(self.elements) if isinstance(e, toplevels.Table))
319708
function() {
    // Make sure the true largest value is used for max
    return this.options.line ? { start_value: 0, max: Helpers.max([Helpers.max(this.options.line), Helpers.max(this.flat_data)]) } : { start_value: 0 };
  }
299431
def topLevelItems(self):
        
        try:
            for i in xrange(self.topLevelItemCount()):
                yield self.topLevelItem(i)
        except RuntimeError:
            # can be raised when iterating on a deleted tree widget.
            return