Returns the ancestry of this dict, back to the first dict that we don't
        recognize or that has more than one backer.
559790
def _ancestry_line(self):
        '''
        
        '''
        b = self._get_backers()

        while len(b) == 1:
            yield b[0]
            if not hasattr(b[0], '_get_backers'):
                break
            b = b[0]._get_backers()
108552
def getTradeHistory(pair, connection=None, info=None, count=None):
    """"""

    if info is not None:
        info.validate_pair(pair)

    if connection is None:
        connection = common.BTCEConnection()

    response = connection.makeJSONRequest("/api/3/trades/%s" % pair)
    if type(response) is not dict:
        raise TypeError("The response is not a dict.")

    history = response.get(pair)
    if type(history) is not list:
        raise TypeError("The response is a %r, not a list." % type(history))

    result = []

    # Limit the number of items returned if requested.
    if count is not None:
        history = history[:count]

    for h in history:
        h["pair"] = pair
        t = Trade(**h)
        result.append(t)
    return result
1268353
def get_ancestors(self):
        
        if self.is_root():
            return get_result_class(self.__class__).objects.none()

        paths = [
            self.path[0:pos]
            for pos in range(0, len(self.path), self.steplen)[1:]
        ]
        return get_result_class(self.__class__).objects.filter(
            path__in=paths).order_by('depth')
514098
def _contextualise(self):
        ''''''
        # loop through hierarchy identifying unique lineages
        # TODO: gain other contextual information, not just ident
        deja_vues = []
        for rank in reversed(self.taxonomy):
            # return named clades -- '' are ignored
            clades = [e for e in self.hierarchy[rank] if e[1]]
            # print 'Rank: {0} - {1}'.format(rank, len(clades))
            # get unique lineages at this level
            uniques = [e for e in clades if len(e[0]) == 1]
            # removed those already seen
            uniques = [e for e in uniques if e[0][0].ident not in deja_vues]
            # add each to self[ident]['cident']
            for e in uniques:
                ident = e[0][0].ident
                self[ident]['cident'] = e[1]
                deja_vues.append(ident)
708462
def _get_history_next(self):
        
        if self._has_history:
            ret = self._input_history.return_history(1)
            self.string = ret
            self._curs_pos = len(ret)
146861
def _check_for_inception(self, root_dict):
        '''
        
        '''

        for key, value in root_dict.items():
            if isinstance(value, dict):
                root_dict[key] = Response(value)

        return root_dict
360829
def lineage(self, h):
        

        lineage = [ ]

        predecessors = list(self._graph.predecessors(h))
        while len(predecessors):
            lineage.append(predecessors[0])
            predecessors = list(self._graph.predecessors(predecessors[0]))

        lineage.reverse()
        return lineage
525351
def family_name(self):
        
        def find_first(dict_, keys, default=None):
            for key in keys:
                value = dict_.get(key)
                if value is not None:
                    return value
            return default
        # keys for Unicode, Mac, and Windows family name, respectively
        return find_first(self._names, ((0, 1), (1, 1), (3, 1)))
1250599
def genealogic_ids(self):
        

        ids = []
        parent = self

        while parent:
            ids.append(parent.id)
            parent = parent.parent_object

        return ids
90457
def _get_ancestors(self, current=None):
        
        if not current:
            current = []
        current.insert(0, self)
        if self.is_root:
            if current:
                return current
        else:
            return self.parent._get_ancestors(current)
212337
def ancestor(self):
        
        ancestors = getattr(self.parsed_response, 'Ancestors', None)
        if hasattr(ancestors, 'BrowseNode'):
            return AmazonBrowseNode(ancestors['BrowseNode'])
        return None
575505
def get_image_ancestry(self, image_id):
        """"""
        return self._http_call(self.IMAGE_ANCESTRY, get, image_id=image_id)
351968
def toDict(self):
		

		# Init the dictionary we will return
		dRet = {
			"__name__": self._name
		}

		# Get the parents dict and add it to the return
		dRet.update(super(Tree,self).toDict())

		# Return
		return dRet
1049694
def no_missing_parents(data_wrapper):
    '''
    '''
    db = data_wrapper.data_block
    ids = np.setdiff1d(db[:, COLS.P], db[:, COLS.ID])[1:]
    return CheckResult(len(ids) == 0, ids.astype(np.int) + 1)
348137
def history(self):
        
        history = self.history_class
        if history:
            return self.session.query(history).filter(history.id == self.id)
        else:
            return None
73467
def get_attribute(self, name):
        
        for child, ancestry in self.attributes():
            if child.name == name:
                return (child, ancestry)
        return (None, [])
336643
def get_child(self, name):
        
        for child, ancestry in self.children():
            if child.any() or child.name == name:
                return (child, ancestry)
        return (None, [])