Gets the partition resolver associated with the database link

        :param str database_link:
            Database self link or ID based link.

        :return:
            An instance of PartitionResolver.
        :rtype: object
351441
def GetPartitionResolver(self, database_link):
        
        if not database_link:
            raise ValueError("database_link is None or empty.")

        return self.partition_resolvers.get(base.TrimBeginningAndEndingSlashes(database_link))
304829
def get_link_mappings(link_id, link_2_id=None, **kwargs):
    
    qry = db.DBSession.query(ResourceAttrMap).filter(
        or_(
            and_(
                ResourceAttrMap.resource_attr_id_a == ResourceAttr.id,
                ResourceAttr.link_id == link_id),
            and_(
                ResourceAttrMap.resource_attr_id_b == ResourceAttr.id,
                ResourceAttr.link_id == link_id)))

    if link_2_id is not None:
        aliased_ra = aliased(ResourceAttr, name="ra2")
        qry = qry.filter(or_(
            and_(
                ResourceAttrMap.resource_attr_id_a == aliased_ra.id,
                aliased_ra.link_id == link_2_id),
            and_(
                ResourceAttrMap.resource_attr_id_b == aliased_ra.id,
                aliased_ra.link_id == link_2_id)))

    return qry.all()
1123237
def _GetLink(self):
    
    if self._link is None:
      self._link = ''
      if not self._IsLink(self._fsntfs_file_entry.file_attribute_flags):
        return self._link

      link = self._fsntfs_file_entry.reparse_point_print_name
      if link:
        # Strip off the drive letter, we assume the link is within
        # the same volume.
        _, _, self._link = link.rpartition(':')

    return self._link
201184
def _get_db():
    
    with cd(env.remote_path):
        file_path = '/tmp/' + _sql_paths('remote', str(base64.urlsafe_b64encode(uuid.uuid4().bytes)).replace('=', ''))
        run(env.python + ' manage.py dump_database | gzip > ' + file_path)
        local_file_path = './backups/' + _sql_paths('remote', datetime.now())
    get(file_path, local_file_path)
    run('rm ' + file_path)
    return local_file_path
694493
def c14n_uri(sqluri):
    
    uri_c14n_method = _get_methods_by_uri(sqluri)[METHOD_C14N_URI]
    if not uri_c14n_method:
        return sqluri
    return uri_c14n_method(sqluri)
397792
def connect_db(database_name=":memory:"):
    
    db = repo.Repo.connect_db(database_name)
    base.Repo.db = db
    query.Repo.db = db
1122382
def get_partitions_ps(self, db_name, tbl_name, part_vals, max_parts):
    
    self.send_get_partitions_ps(db_name, tbl_name, part_vals, max_parts)
    return self.recv_get_partitions_ps()
1150696
def _GetLink(self):
    
    if self._link is None:
      self._link = ''
      if self.entry_type != definitions.FILE_ENTRY_TYPE_LINK:
        return self._link

      link = self._fsapfs_file_entry.symbolic_link_target
      if link and link[0] != self._file_system.PATH_SEPARATOR:
        # TODO: make link absolute.
        self._link = '/{0:s}'.format(link)

    return self._link
415945
def database(key='default', slave=False):
    
    if slave:
        key += '.slave'
        return choice(__db[key])
    return __db.get(key)
886590
def resolver(self):
        
        if self._resolver is None:
            self._resolver = RefResolver(self.base_uri, {})
        # if self.base_uri not in self._resolver.store:
        #    self._resolver.store[self.base_uri] = self.config
        return self._resolver
1215545
def DeleteDatabase(self, database_link, options=None):
        
        if options is None:
            options = {}

        path = base.GetPathFromLink(database_link)
        database_id = base.GetResourceIdOrFullNameFromLink(database_link)
        return self.DeleteResource(path,
                                   'dbs',
                                   database_id,
                                   None,
                                   options)
353335
def getLinkerDirectories(self, engineRoot, delimiter=' '):
		
		return delimiter.join(self.resolveRoot(self.linkDirs, engineRoot))
1105083
def get_partitions(self, db_name, tbl_name, max_parts):
    
    self.send_get_partitions(db_name, tbl_name, max_parts)
    return self.recv_get_partitions()
1223768
def resolving(self, ref: str):
        
        new_uri = urlparse.urljoin(self.resolution_scope, ref)
        uri, fragment = urlparse.urldefrag(new_uri)

        if normalize(uri) in self.store:
            schema = self.store[normalize(uri)]
        elif not uri or uri == self.base_uri:
            schema = self.schema
        else:
            schema = resolve_remote(uri, self.handlers)
            if self.cache:
                self.store[normalize(uri)] = schema

        old_base_uri, old_schema = self.base_uri, self.schema
        self.base_uri, self.schema = uri, schema
        try:
            with self.in_scope(uri):
                yield resolve_path(schema, fragment)
        finally:
            self.base_uri, self.schema = old_base_uri, old_schema
44449
def app_resolver(app_name=None, pattern_kwargs=None, name=None):
    '''
    
    '''
    urlconf = URLConf(app_name, pattern_kwargs)
    resolver = re_path(
        '^{}/?'.format(app_name) if app_name is not None else '',
        include(urlconf),
        name=urlconf.app_name,
    )
    # this next line is a workaround for Django's URLResolver class not having
    # a `name` attribute, which is expected in Django's technical_404.html.
    resolver.name = getattr(resolver, 'name', name or app_name)
    return resolver
1255294
def get_partitions_by_filter(self, db_name, tbl_name, filter, max_parts):
    
    self.send_get_partitions_by_filter(db_name, tbl_name, filter, max_parts)
    return self.recv_get_partitions_by_filter()
215041
def get_db(cls):
        """"""
        if cls._db:
            return getattr(cls._client, cls._db)
        return cls._client.get_default_database()