function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def __init__(self, component):
self._component = component | rwl/muntjac | [
43,
14,
43,
5,
1316308871
] |
def __init__(self, component):
super(BackgroundProcess, self).__init__()
self._component = component | rwl/muntjac | [
43,
14,
43,
5,
1316308871
] |
def assume_role(
role_arn: str, aws_region: str, credentials: Optional[dict] = None | linkedin/WhereHows | [
7356,
2096,
7356,
166,
1447825660
] |
def get_session(self) -> Session:
if (
self.aws_access_key_id
and self.aws_secret_access_key
and self.aws_session_token
):
return Session(
aws_access_key_id=self.aws_access_key_id,
aws_secret_access_key=self.aws_secret_acces... | linkedin/WhereHows | [
7356,
2096,
7356,
166,
1447825660
] |
def get_glue_client(self) -> "GlueClient":
return self.get_session().client("glue") | linkedin/WhereHows | [
7356,
2096,
7356,
166,
1447825660
] |
def __init__(self, message, cause=None):
super(CStorageError, self).__init__(message)
self.cause = cause | netheosgithub/pcs_api | [
8,
5,
8,
4,
1401784319
] |
def __init__(self, c_path, expected_blob, message=None):
""":param c_path: the problematic path
:param expected_blob: if True, a blob was expected but a folder was found.
if False, a folder was expected but a blob was found
:param message: optional message"""
... | netheosgithub/pcs_api | [
8,
5,
8,
4,
1401784319
] |
def __init__(self, cause, delay=None):
super(CRetriableError, self).__init__(message=None, cause=cause)
self.delay = delay | netheosgithub/pcs_api | [
8,
5,
8,
4,
1401784319
] |
def __init__(self, message, c_path):
super(CFileNotFoundError, self).__init__(message)
self.path = c_path | netheosgithub/pcs_api | [
8,
5,
8,
4,
1401784319
] |
def __init__(self, request_method,
request_path,
status_code, reason,
message=None):
super(CHttpError, self).__init__(message)
self.request_method = request_method
self.request_path = request_path
self.status_code = status_code
s... | netheosgithub/pcs_api | [
8,
5,
8,
4,
1401784319
] |
def _get_registered_content(obj, method, template_context):
"""
Given an object and a PluginTemplateExtension method name and the template context, return all the
registered content for the object's model.
"""
html = ''
context = {
'object': obj,
'request': template_context['requ... | digitalocean/netbox | [
12158,
2099,
12158,
303,
1456755346
] |
def plugin_buttons(context, obj):
"""
Render all buttons registered by plugins
"""
return _get_registered_content(obj, 'buttons', context) | digitalocean/netbox | [
12158,
2099,
12158,
303,
1456755346
] |
def plugin_left_page(context, obj):
"""
Render all left page content registered by plugins
"""
return _get_registered_content(obj, 'left_page', context) | digitalocean/netbox | [
12158,
2099,
12158,
303,
1456755346
] |
def plugin_right_page(context, obj):
"""
Render all right page content registered by plugins
"""
return _get_registered_content(obj, 'right_page', context) | digitalocean/netbox | [
12158,
2099,
12158,
303,
1456755346
] |
def send_email(token_id, user, domain):
try:
sparkpost = SparkPost()
default_app_name = "INFOSYSTEM"
default_email_use_sandbox = False
default_reset_url = 'http://objetorelacional.com.br/#/reset'
default_noreply_email = 'noreply@objetorelacional.com.br'
default_email... | samueldmq/infosystem | [
3,
2,
3,
107,
1462652014
] |
def do(self, session, **kwargs):
self.entity = super().do(session, **kwargs)
self.token = self.manager.api.tokens.create(
session=session, user=self.entity)
self.domain = self.manager.api.domains.get(id=self.entity.domain_id)
if not self.domain:
raise exception.... | samueldmq/infosystem | [
3,
2,
3,
107,
1462652014
] |
def do(self, session, **kwargs):
password = kwargs.get('password', None)
if password:
kwargs['password'] = hashlib.sha256(
password.encode('utf-8')).hexdigest()
self.entity = super().do(session, **kwargs)
return self.entity | samueldmq/infosystem | [
3,
2,
3,
107,
1462652014
] |
def pre(self, **kwargs):
email = kwargs.get('email', None)
domain_name = kwargs.get('domain_name', None)
infosystem_reset_url = os.environ.get(
'INFOSYSTEM_RESET_URL', 'http://objetorelacional.com.br/#/reset/')
self.reset_url = kwargs.get('reset_url', infosystem_reset_url)
... | samueldmq/infosystem | [
3,
2,
3,
107,
1462652014
] |
def pre(self, **kwargs):
self.token = flask.request.headers.get('token')
self.password = kwargs.get('password')
if not (self.token and self.password):
raise exception.OperationBadRequest()
return True | samueldmq/infosystem | [
3,
2,
3,
107,
1462652014
] |
def post(self):
self.manager.api.tokens.delete(id=self.token) | samueldmq/infosystem | [
3,
2,
3,
107,
1462652014
] |
def do(self, session, user_id, **kwargs):
grants = self.manager.api.grants.list(user_id=user_id)
grants_ids = [g.role_id for g in grants]
roles = self.manager.api.roles.list()
user_roles_id = [r.id for r in roles if r.id in grants_ids]
# FIXME(fdoliveira) Try to send user_roles... | samueldmq/infosystem | [
3,
2,
3,
107,
1462652014
] |
def __init__(
self,
*,
host: str = DEFAULT_HOST,
credentials: ga_credentials.Credentials = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.Clien... | googleapis/python-scheduler | [
28,
10,
28,
2,
1575936606
] |
def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
self.list_jobs: gapic_v1.method.wrap_method(
self.list_jobs,
default_retry=retries.Retry(
initial=0.1,
maximum=60... | googleapis/python-scheduler | [
28,
10,
28,
2,
1575936606
] |
def list_jobs(
self, | googleapis/python-scheduler | [
28,
10,
28,
2,
1575936606
] |
def get_job(
self, | googleapis/python-scheduler | [
28,
10,
28,
2,
1575936606
] |
def create_job(
self, | googleapis/python-scheduler | [
28,
10,
28,
2,
1575936606
] |
def update_job(
self, | googleapis/python-scheduler | [
28,
10,
28,
2,
1575936606
] |
def delete_job(
self, | googleapis/python-scheduler | [
28,
10,
28,
2,
1575936606
] |
def pause_job(
self, | googleapis/python-scheduler | [
28,
10,
28,
2,
1575936606
] |
def resume_job(
self, | googleapis/python-scheduler | [
28,
10,
28,
2,
1575936606
] |
def run_job(
self, | googleapis/python-scheduler | [
28,
10,
28,
2,
1575936606
] |
def __init__(self, db):
idtable.CachedIdTable.__init__(self, db, "Tags", "tagId", "tag") | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def get(self, vs, ts):
key = vs, ts
if self.has_key(key):
return self[key]
ts = [ float(x) for x in ts.split(":") ]
v = versions.VersionFromString(vs, timeStamps = ts)
self[key] = v
return v | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def get(self, frozen):
if self.has_key(frozen):
return self[frozen]
if frozen is None:
f = deps.deps.Flavor()
else:
f = deps.deps.ThawFlavor(frozen)
self[frozen] = f
return f | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def __init__(self, db):
self.db = db
schema.createDBTroveFiles(db)
self.tags = Tags(self.db) | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def getByInstanceId(self, instanceId, justPresent = True):
cu = self.db.cursor()
if justPresent:
cu.execute("SELECT path, stream FROM DBTroveFiles "
"WHERE instanceId=? and isPresent=1", instanceId)
else:
cu.execute("SELECT path, stream FROM DBTrov... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def getFileByFileId(self, fileId, justPresent = True):
cu = self.db.cursor()
if justPresent:
cu.execute("SELECT path, stream FROM DBTroveFiles "
"WHERE fileId=? AND isPresent = 1", fileId)
else:
cu.execute("SELECT path, stream FROM DBTroveFiles "
... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def iterPath(self, path):
cu = self.db.cursor()
cu.execute("SELECT instanceId FROM DBTroveFiles WHERE "
"isPresent=1 AND path=?", path)
for instanceId in cu:
yield instanceId[0] | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def _updatePathIdsPresent(self, instanceId, pathIdList, isPresent):
# Max number of bound params
chunkSize = 990
plen = len(pathIdList)
cu = self.db.cursor()
i = 0
while i < plen:
clen = min(chunkSize, plen - i)
bvals = [ isPresent, instanceId ] + ... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def restorePathIds(self, instanceId, pathIdList):
self._updatePathIdsPresent(instanceId, pathIdList, isPresent = 1) | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def __init__(self, db):
self.db = db
schema.createInstances(db) | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def hasName(self, name):
cu = self.db.cursor()
cu.execute("SELECT instanceId FROM Instances "
"WHERE troveName=? AND isPresent=1",
name)
return cu.fetchone() != None | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def addId(self, troveName, versionId, flavorId, timeStamps,
isPresent = True, pinned = False):
assert(min(timeStamps) > 0)
if isPresent:
isPresent = 1
else:
isPresent = 0
cu = self.db.cursor()
cu.execute("INSERT INTO Instances(troveName, ver... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def getId(self, theId, justPresent = True):
cu = self.db.cursor()
if justPresent:
pres = "AND isPresent=1"
else:
pres = ""
cu.execute("SELECT troveName, versionId, flavorId, isPresent "
"FROM Instances WHERE instanceId=? %s" % pres, theId)
... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def idIsPresent(self, instanceId):
cu = self.db.cursor()
cu.execute("SELECT isPresent FROM Instances WHERE "
"instanceId=?", instanceId)
val = cu.fetchone()
if not val:
return 0
return val[0] | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def has_key(self, item):
cu = self.db.cursor()
cu.execute("SELECT instanceId FROM Instances WHERE "
"troveName=? AND versionId=? AND flavorId=?",
item)
return not(cu.fetchone() == None) | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def get(self, item, defValue, justPresent = True):
cu = self.db.cursor()
if justPresent:
pres = " AND isPresent=1"
else:
pres = ""
cu.execute("SELECT instanceId FROM Instances WHERE "
"troveName=? AND versionId=? AND "
... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def addId(self, flavor):
return idtable.IdTable.addId(self, flavor.freeze()) | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def getId(self, flavorId):
return deps.deps.ThawFlavor(idtable.IdTable.getId(self, flavorId)) | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def __delitem__(self, flavor):
# XXX: We really should be testing for a deps.deps.Flavor
# instance, but the split of Flavor from DependencySet would
# cause too much code breakage right now....
assert(isinstance(flavor, deps.deps.DependencySet))
if flavor.isEmpty():
... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def __init__(self, db):
idtable.IdTable.__init__(self, db, "Flavors", "flavorId", "flavor")
cu = db.cursor()
cu.execute("SELECT FlavorID from Flavors")
if cu.fetchone() == None:
# reserve flavor 0 for "no flavor information"
cu.execute("INSERT INTO Flavors (flavor... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def __init__(self, db):
idtable.IdMapping.__init__(self, db, "DBFlavorMap", "instanceId",
"flavorId") | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def __init__(self, path, timeout = None):
if timeout is not None:
self.timeout = timeout
self.db = None
try:
self.db = dbstore.connect(path, driver = "sqlite",
timeout=self.timeout)
self.schemaVersion = self.db.getVersion(... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def begin(self):
"""
Force the database to begin a transaction; this locks the database
so no one can touch it until a commit() or rollback().
"""
return self.db.transaction() | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def iterAllTroveNames(self):
return self.instances.iterNames() | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def iterVersionByName(self, name, withFlavors):
cu = self.db.cursor()
if withFlavors:
flavorCol = "flavor"
flavorClause = """INNER JOIN Flavors ON
Flavors.flavorId = Instances.flavorId"""
else:
flavorCol = "NULL"
flavor... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def iterAllTroves(self, withPins = False):
cu = self.db.cursor()
cu.execute("""
SELECT troveName, version, timeStamps, flavor, pinned
FROM Instances NATURAL JOIN Versions
INNER JOIN Flavors
ON Instances.flavorid = Flavors.flavorid
... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def trovesArePinned(self, troveList):
"""
Get a list of which troves in troveList are pinned
@param troveList: a list of troves in (name, version, flavor) form
@type troveList: list
@note:
This function makes database calls and may raise any exceptions
d... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def hasByName(self, name):
return self.instances.hasName(name) | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def getInstanceId(self, troveName, versionId, flavorId,
timeStamps, isPresent = True):
theId = self.instances.get((troveName, versionId, flavorId),
None)
if theId is None:
theId = self.instances.addId(troveName, versionId, flavorId,
... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def addTrove(self, trove, pin = False, oldTroveSpec = None):
cu = self.db.cursor()
troveName = trove.getName()
troveVersion = trove.getVersion()
troveVersionId = self.getVersionId(troveVersion, {})
self.addVersionCache[troveVersion] = troveVersionId
if oldTroveSpec is n... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def addFile(self, troveInfo, pathId, path, fileId, fileVersion,
fileStream = None, isPresent = True):
(cu, troveInstanceId, addFileStmt, oldInstanceId) = troveInfo
versionId = self.getVersionId(fileVersion, self.addVersionCache)
if fileStream:
cu.execstmt(addFileStmt... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def markUserReplacedFiles(self, userReplaced):
cu = self.db.cursor()
cu.execute("""CREATE TEMPORARY TABLE UserReplaced(
name STRING, version STRING, flavor STRING,
pathId BLOB)""")
for (name, version, flavor), fileList in userReplaced.iteritems():
... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def getFile(self, pathId, fileId, pristine = False):
stream = self.troveFiles.getFileByFileId(fileId,
justPresent = not pristine)[1]
return files.ThawFile(stream, pathId) | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def findFileVersion(self, fileId):
cu = self.db.cursor()
cu.execute("""SELECT stream FROM DBTroveFiles
INNER JOIN Versions ON
DBTroveFiles.versionId == Versions.versionId
WHERE fileId == ?""", fileId)
for (stream,) in... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def hasTroves(self, troveList):
instances = self._lookupTroves(troveList)
result = [ False ] * len(troveList)
for i, instanceId in enumerate(instances):
if instanceId is not None:
result[i] = True
return result | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def getTroveFiles(self, troveList, onlyDirectories = False):
instanceIds = self._lookupTroves(troveList)
if None in instanceIds:
raise KeyError
trvByInstanceId = dict([ (instId, trvInfo) for
instId, trvInfo in itertools.izip(instanceIds, troveList)
if... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def _iter(tl):
for i, (name, version, flavor) in enumerate(tl):
yield (i, name, str(version), flavor.freeze()) | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def _iterTroves(self, pristine, instanceIds, withFiles = True,
withDeps = True, errorOnMissing=True,
withFileObjects = False):
"""
Iterates over the troves associated with a list of instanceIds.
@param pristine: Return the trove unmodified based on the lo... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def commit(self):
if self.needsCleanup:
# this join could be slow; it would be much better if we could
# restrict the select on Instances by instanceId, but that's
# not so easy and may require multiple passes (since we may
# now be able to remove a trove which wa... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def pathIsOwned(self, path):
for instanceId in self.troveFiles.iterPath(path):
if self.instances.idIsPresent(instanceId):
return True
return False | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def pathsOwned(self, pathList):
if not pathList:
return []
cu = self.db.cursor()
cu.execute("""
CREATE TEMPORARY TABLE pathList(
path %(STRING)s
)""" % self.db.keywords, start_transaction = False)
self.db.bulkload("pathList", [ (x,) for x i... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def removeFileFromTrove(self, trove, path):
versionId = self.versionTable[trove.getVersion()]
flavorId = self.flavors[trove.getFlavor()]
instanceId = self.instances[(trove.getName(), versionId, flavorId)]
self.troveFiles.removePath(instanceId, path) | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def restorePathIdsToTrove(self, troveName, troveVersion, troveFlavor,
pathIdList):
versionId = self.versionTable[troveVersion]
flavorId = self.flavors[troveFlavor]
instanceId = self.instances[(troveName, versionId, flavorId)]
self.troveFiles.restorePathIds(i... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def mapPinnedTroves(self, mapList):
if not mapList:
return
cu = self.db.cursor()
cu.execute("""
CREATE TEMPORARY TABLE mlt(
name %(STRING)s,
pinnedVersion %(STRING)s,
pinnedFlavor %(STRING)s,
mappedVersion ... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def getTroveTroves(self, l, weakRefs = False, justPresent = False,
pristineOnly = True):
"""
Return the troves which the troves in l include as strong references.
If weakRefs is True, also include the troves included as weak
references. If justPresent is True, ... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def _iter(infoList, resultList):
for idx, info in enumerate(infoList):
resultList.append([])
yield (idx, info[0], info[1].asString(), info[2].freeze()) | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def findTroveContainers(self, names):
# XXX this fn could be factored out w/ getTroveContainers above
cu = self.db.cursor()
cu.execute("""
CREATE TEMPORARY TABLE ftc(
idx INTEGER,
name %(STRING)s
)""" % self.db.keywords, start_transaction = False)
... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def findUnreferencedTroves(self):
cu = self.db.cursor()
cu.execute("""
SELECT troveName, version, flavor FROM Instances
LEFT OUTER JOIN TroveTroves ON
Instances.instanceId = TroveTroves.includedId
JOIN Versions ON
... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def getAllTroveInfo(self, troveInfoTag):
cu = self.db.cursor()
cu.execute("""
SELECT troveName, version, timeStamps, flavor, data FROM TroveInfo
JOIN Instances USING (instanceId)
JOIN Flavors USING (flavorId)
JOIN Versions ON Instances.versionI... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def _iter(tl, r):
for i, (name, version, flavor) in enumerate(tl):
flavorId = self.flavors.get(flavor, None)
if flavorId is None:
continue
versionId = self.versionTable.get(version, None)
if versionId is None:
... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def getPathHashesForTroveList(self, troveList):
"""
Returns the pathHashes for the given trove list.
"""
return self._getTroveInfo(troveList, trove._TROVEINFO_TAG_PATH_HASHES) | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def getTroveScripts(self, troveList):
"""
Returns the trove scripts for the given trove list. None is
returned for troves with no scripts. Returns a list of
trove.TroveScripts objects.
"""
return self._getTroveInfo(troveList, trove._TROVEINFO_TAG_SCRIPTS) | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def findRemovedByName(self, name):
"""
Returns information on erased troves with a given name.
"""
cu = self.db.cursor()
cu.execute("""SELECT troveName, version, flavor FROM
Instances JOIN Versions ON
Instances.version... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def troveIsIncomplete(self, name, version, flavor):
cu = self.db.cursor()
if isinstance(flavor, deps.deps.Flavor) and not flavor.isEmpty():
flavorStr = 'flavor = ?'
flavorArgs = [flavor.freeze()]
else:
flavorStr = 'flavor IS NULL'
flavorArgs = []
... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def getTrovesWithProvides(self, depSetList):
return self.depTables.getLocalProvides(depSetList) | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def getMissingPathIds(self, name, version, flavor):
cu = self.db.cursor()
flavorId = self.flavors.get(flavor, None)
if flavorId is None:
raise KeyError
versionId = self.versionTable.get(version, None)
if versionId is None:
raise KeyError
cu.execu... | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def getTransactionCounter(self):
"""Get transaction counter"""
field = "transaction counter"
return self._getTransactionCounter(field)[1] | sassoftware/conary | [
47,
9,
47,
4,
1396904066
] |
def __init__(self, language='hr'):
super(Lexicon, self).__init__()
self.language = language | clarinsi/reldi-lib | [
9,
3,
9,
3,
1474892492
] |
def get_3d_input(self):
input_shape = (2, 16, 16, 16, 8)
x = tf.ones(input_shape)
return x | NifTK/NiftyNet | [
1325,
408,
1325,
103,
1504079743
] |
def _test_nd_downsample_output_shape(self,
rank,
param_dict,
output_shape):
if rank == 2:
input_data = self.get_2d_input()
elif rank == 3:
input_data = self.... | NifTK/NiftyNet | [
1325,
408,
1325,
103,
1504079743
] |
def test_3d_avg_shape(self):
input_param = {'func': 'AVG',
'kernel_size': [3, 3, 2],
'stride': [3, 2, 1]}
self._test_nd_downsample_output_shape(rank=3,
param_dict=input_param,
... | NifTK/NiftyNet | [
1325,
408,
1325,
103,
1504079743
] |
def test_2d_max_shape(self):
input_param = {'func': 'CONSTANT',
'kernel_size': [1, 3],
'stride': 3}
self._test_nd_downsample_output_shape(rank=2,
param_dict=input_param,
... | NifTK/NiftyNet | [
1325,
408,
1325,
103,
1504079743
] |
def test_2d_const_shape(self):
input_param = {'func': 'CONSTANT',
'kernel_size': [2, 3],
'stride': [2, 3]}
self._test_nd_downsample_output_shape(rank=2,
param_dict=input_param,
... | NifTK/NiftyNet | [
1325,
408,
1325,
103,
1504079743
] |
def get_next_command_id():
global _command_counter
_command_counter += 1
return _command_counter | GoogleChromeLabs/chromium-bidi | [
46,
11,
46,
58,
1623839211
] |
def recursiveCompare(expected, actual, ignore_attributes=[]):
assert type(expected) == type(actual)
if type(expected) is list:
assert len(expected) == len(actual)
for index, val in enumerate(expected):
recursiveCompare(expected[index], actual[index], ignore_attributes)
return... | GoogleChromeLabs/chromium-bidi | [
46,
11,
46,
58,
1623839211
] |
def __init__(self,
datacatalog_project_id,
datacatalog_location_id,
atlas_connection_args,
atlas_entity_types=None,
enable_monitoring=None):
self._project_id = datacatalog_project_id
self._location_id = datacatalog_loca... | GoogleCloudPlatform/datacatalog-connectors-hive | [
20,
14,
20,
3,
1588024316
] |
def _extract_instance_url(cls, atlas_connection_args):
return atlas_connection_args['host'] | GoogleCloudPlatform/datacatalog-connectors-hive | [
20,
14,
20,
3,
1588024316
] |
def _sync_assembled_entries(self, assembled_entries, tag_templates_dict):
self._log_entries(assembled_entries)
if assembled_entries:
logging.info('')
logging.info('===> Mapping Data Catalog entries relationships...')
self._map_datacatalog_relationships(assembled_entri... | GoogleCloudPlatform/datacatalog-connectors-hive | [
20,
14,
20,
3,
1588024316
] |
def _log_metadata(self, metadata):
self._metrics_processor.process_metadata_payload_bytes_metric(metadata) | GoogleCloudPlatform/datacatalog-connectors-hive | [
20,
14,
20,
3,
1588024316
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.