This function is here mainly for purposes of unittest

    Returns:
        list of str: Valid bases as they are used as URL parameters in links at
                     Aleph main page.
332646
def getListOfBases():
    
    downer = Downloader()
    data = downer.download(ALEPH_URL + "/F/?func=file&file_name=base-list")
    dom = dhtmlparser.parseString(data.lower())

    # from default aleph page filter links containing local_base in their href
    base_links = filter(
        lambda x: "href" in x.params and "local_base" in x.params["href"],
        dom.find("a")
    )

    # split links by & - we will need only XXX from link.tld/..&local_base=XXX
    base_links = map(
        lambda x: x.params["href"].replace("?", "&", 1).split("&"),
        base_links
    )

    # filter only sections containing bases
    bases = map(
        lambda link: filter(lambda base: "local_base=" in base, link)[0],
        base_links
    )

    # filter bases from base sections
    bases = map(lambda x: x.split("=")[1].strip(), bases)

    return list(set(bases))
319500
def all_bases (type):
    
    assert isinstance(type, basestring)
    result = []
    while type:
        result.append (type)
        type = __types [type]['base']

    return result
586528
def matching_base_url(self, url):
        

        n = len(self.baseurl)
        return url[0:n] == self.baseurl
832043
def _get_url_base(self, url):
        
        s = urlsplit(url)
        return urlunsplit([s.scheme, s.netloc, '', '', ''])
998341
def is_valid_url(url):
    """"""
    pieces = urlparse(url)
    return all([pieces.scheme, pieces.netloc])
366268
def list_reference_bases(self, id_, start=0, end=None):
        
        request = protocol.ListReferenceBasesRequest()
        request.start = pb.int(start)
        request.end = pb.int(end)
        request.reference_id = id_
        not_done = True
        # TODO We should probably use a StringIO here to make string buffering
        # a bit more efficient.
        bases_list = []
        while not_done:
            response = self._run_list_reference_bases_page_request(request)
            bases_list.append(response.sequence)
            not_done = bool(response.next_page_token)
            request.page_token = response.next_page_token
        return "".join(bases_list)
1093047
def get_default_base_template_names(self):
        
        return [self.object.detail_template,
                '%s.html' % self.object.slug,
                '%s_%s' % (self.object.slug, self.object.detail_template)]
425952
def _bse_cli_list_basis_sets(args):
    ''''''
    metadata = api.filter_basis_sets(args.substr, args.family, args.role, args.data_dir)

    if args.no_description:
        liststr = metadata.keys()
    else:
        liststr = format_columns([(k, v['description']) for k, v in metadata.items()])

    return '\n'.join(liststr)
1298649
def _get_bases(cls, ab):
        
        start_bases, end_bases = [], []
        for base in ('1B', '2B', '3B'):
            if ab.find('runner', start=base):
                start_bases.append(base[0:1])
            else:
                start_bases.append('_')
            if ab.find('runner', end=base):
                end_bases.append(base[0:1])
            else:
                end_bases.append('_')
        return ''.join(start_bases), ''.join(end_bases)
212398
def base_variables(self):
        """"""
        if isinstance(self.data, InteractiveList):
            return dict(chain(*map(
                lambda arr: six.iteritems(arr.psy.base_variables),
                self.data)))
        else:
            return self.data.psy.base_variables
227302
def get_atom_type_basisset(cls,calc,**kwargs):
        
        parameters = calc.out.output
        dictionary = parameters.get_dict()
        if 'basis_set' not in dictionary.keys():
            return None
        return [dictionary['basis_set'][x]['description']
                for x in cls.get_atom_type_symbol(calc,**kwargs)]
83293
def _get_bases(type_):
        # type: (type) -> Tuple[type, type]
        
        try:

            class _(type_):  # type: ignore
                """Check if type_ is subclassable."""

            BaseClass = type_
        except TypeError:
            BaseClass = object

        class MetaClass(_ValidationMeta, BaseClass.__class__):  # type: ignore
            """Use the type_ meta and include base validation functionality."""

        return BaseClass, MetaClass
991111
def _check_valid_basic(self, get_params):
        
        try:
            if get_params(self.variable):
                return self.default
        except:  # noqa e722
            pass
        return not self.default
586267
def get_context_data(self, **kwargs):
        '''
        
        '''
        context = super(PageDetail, self).get_context_data(**kwargs)
        page_base_template = "nupages/base.html"
        # if MultiTenantMiddleware is used, use a base template specific to 
        # the tenants SITE_ID
        if hasattr(self.request, 'site_id'):
            page_base_template = select_template(
                ["nupages/tenants/{}/base.html".format(self.request.site_id), 
                page_base_template])
        context['base_template'] = page_base_template
        return context
497141
def _generate_base_lsid(self):
        
        domain = self._generate_domain()
        namespace = self._generate_namespace()

        # Return the base LSID
        return "urn:lsid:" + domain + ":" + namespace
941711
def get_unit_by_name(self, unit_name: str) -> typing.Optional['BaseUnit']:
        
        VALID_STR.validate(unit_name, 'get_unit_by_name')
        for unit in self.units:

            if unit.unit_name == unit_name:
                return unit
        return None
74718
def iter_bases(bases):
        

        sequences = ([list(inspect.getmro(base)) for base in bases] +
                     [list(bases)])

        # Loop over sequences
        while True:
            sequences = [seq for seq in sequences if seq]
            if not sequences:
                return

            # Select a good head
            for seq in sequences:
                head = seq[0]

                tails = [seq for seq in sequences if head in seq[1:]]
                if not tails:
                    break
            else:
                raise TypeError('Cannot create a consistent method '
                                'resolution order (MRO) for bases %s' %
                                ', '.join([base.__name__ for base in bases]))

            # Yield this base class
            yield head

            # Remove base class from all the other sequences
            for seq in sequences:
                if seq[0] == head:
                    del seq[0]