query stringlengths 9 3.4k | document stringlengths 9 87.4k | metadata dict | negatives listlengths 4 101 | negative_scores listlengths 4 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Removes this object from the DBus connection and exits. | def Quit(self):
loop.quit() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __del__(self):\n self.disconnect()",
"def do_dbus_unregister(self, connection, object_path):\n logger.debug('::dbus_unregister')\n Gio.Application.do_dbus_unregister(self, connection, object_path)\n if self._dbus_id is not None:\n logger.info('removing DBus registration... | [
"0.710751",
"0.6853858",
"0.681389",
"0.6778176",
"0.67477846",
"0.6727602",
"0.6675209",
"0.6670973",
"0.66698843",
"0.6649901",
"0.6626865",
"0.6620622",
"0.6617923",
"0.6610494",
"0.6590113",
"0.65592587",
"0.6554885",
"0.6544599",
"0.653139",
"0.6523816",
"0.651824",
"0... | 0.0 | -1 |
Print the datapoint to stdout | def print_datapoint(parts):
t = datetime.fromtimestamp(parts[0])
humid = parts[1]
temp_c = parts[2]
temp_f = parts[3]
heat_c = parts[4]
heat_f = parts[5]
print output_tmpl % (t, humid, temp_c, temp_f, heat_c, heat_f) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dump(self, data_points):\n print(data_points)",
"def print(self):\n self.__print_local(self.dataset, 0)",
"def print_obs(self,obs):\n print(obs)",
"def print_data(place):\n raise NotImplementedError",
"def print_out():\n pass",
"def print_short(sp) :\n sp.print_p... | [
"0.72847927",
"0.68047684",
"0.6707549",
"0.661839",
"0.6293422",
"0.6155792",
"0.6120945",
"0.6088213",
"0.6088213",
"0.6088213",
"0.60739803",
"0.60412997",
"0.6026039",
"0.6009121",
"0.5982939",
"0.5969914",
"0.5951141",
"0.58676827",
"0.5866972",
"0.5864771",
"0.5838355",... | 0.6597161 | 4 |
Store the datapoint in the Database. | def store_datapoint(sql, parts):
t = datetime.fromtimestamp(parts[0])
humid = parts[1]
temp_c = parts[2]
temp_f = parts[3]
heat_c = parts[4]
heat_f = parts[5]
c = sql.cursor()
c.execute("INSERT INTO points VALUES (?,?,?,?,?,?)",
(t, humid, temp_c, temp_f, heat_c, heat_f))
sql... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _insert_datapoint(self):\n # Insert\n if db_datapoint.idx_datapoint_exists(1) is False:\n record = Datapoint(\n id_datapoint=general.encode(self.reserved),\n agent_label=general.encode(self.reserved),\n agent_source=general.encode(self.reser... | [
"0.7809628",
"0.6474018",
"0.6452069",
"0.6451785",
"0.6422399",
"0.64067936",
"0.63725233",
"0.6366098",
"0.63641155",
"0.6357713",
"0.6354461",
"0.6286375",
"0.6228851",
"0.6175777",
"0.61217165",
"0.60342234",
"0.60303307",
"0.6002851",
"0.5999837",
"0.5990769",
"0.59858",... | 0.75592405 | 1 |
This handles a single TCP connection. One is spawned for each new TCP stream. When the function returns the connection closes. | def handle(self):
try:
conn = sqlite.connect("temp.db")
while True:
data = self.request.recv(48)
if not data:
break
parts = struct.unpack("dddddd", data)
print_datapoint(parts)
store_datap... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def _tcp_server(self, host, port, backlog):\n addr = socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM)[0][-1]\n sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n sock.setblocking(False)\n sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n sock.bind(ad... | [
"0.60762167",
"0.6057587",
"0.59944934",
"0.59708226",
"0.5914621",
"0.5912125",
"0.58752435",
"0.5831691",
"0.5775596",
"0.5772817",
"0.5754908",
"0.5649614",
"0.56405836",
"0.56248313",
"0.56084853",
"0.55996567",
"0.55983645",
"0.5597154",
"0.5587037",
"0.5586598",
"0.5582... | 0.0 | -1 |
Make sure that the database exists and has the right schema. | def prepare_db():
conn = sqlite.connect("temp.db")
sql = conn.cursor()
sql.execute("SELECT sql FROM sqlite_master WHERE name='points'")
rows = sql.fetchall()
if len(rows) == 0:
print "Database does not exist. Creating Database..."
sql.execute('''CREATE TABLE points
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_db_schema(self):\n if not self.db.get_tables():\n self.create_db_schema()",
"def validate_db():\n if not os.path.exists(app.config['DATABASE']):\n print(\"Init database!\")\n init()",
"def test_creation_when_no_database_exists(self):\n database_filename = \"t... | [
"0.8582333",
"0.79351586",
"0.7479748",
"0.7268417",
"0.7252888",
"0.7145503",
"0.71359855",
"0.7081638",
"0.706344",
"0.7049726",
"0.70480025",
"0.7042619",
"0.70236886",
"0.70066184",
"0.6995802",
"0.6991577",
"0.69904494",
"0.69520545",
"0.69447505",
"0.6925676",
"0.689040... | 0.0 | -1 |
Gets the connection with the Amazon S3 server. Raises an error if conn cannot be established | def get_conn():
global S3Conn
S3Conn = tinys3.Connection(plug.options['aws_access_key'],
plug.options['aws_secret_key'],
default_bucket=plug.options['bucket'], tls=True)
# Check that the given bucket exists by doing a HEAD request
try:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_s3_connection(self):\n return connection.S3Connection(\n config.get('nereid_s3', 'access_key'),\n config.get('nereid_s3', 'secret_key')\n )",
"def _get_aws_s3_connection(cls, access_key, secret_access_key):\n return boto.connect_s3(access_key, secret_access_key)... | [
"0.82608676",
"0.81773007",
"0.78756386",
"0.7746647",
"0.7277447",
"0.7145592",
"0.7025781",
"0.69264907",
"0.6921318",
"0.6873866",
"0.68642884",
"0.6810215",
"0.6697892",
"0.6688311",
"0.6616437",
"0.6614548",
"0.6512589",
"0.6480621",
"0.6454841",
"0.6413643",
"0.63492787... | 0.8209997 | 1 |
Returns the float timestamp based on the date format timestamp stored by Amazon. Prefixes the given filename with Onitu's root. | def get_file_timestamp(filename):
plug.logger.debug(u"Getting timestamp of {}", filename)
metadata = S3Conn.head_object(u(filename))
timestamp = metadata.headers['last-modified']
# convert timestamp to timestruct...
timestamp = time.strptime(timestamp, HEAD_TIMESTAMP_FMT)
# ...timestruct to floa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getTimestamp(self, filename=None):\n if filename == None:\n return float(self.filename[:-4])\n else:\n return float(filename[:-4])",
"def get_timestamp_from_path(file_path):\n return int(file_path.split('_')[1].split('.')[0])",
"def timestamp(filename,... | [
"0.78132105",
"0.6773026",
"0.6582669",
"0.6577208",
"0.65521187",
"0.6412246",
"0.63317764",
"0.6314977",
"0.6306793",
"0.6304807",
"0.6289728",
"0.62649685",
"0.6254887",
"0.6239393",
"0.62276626",
"0.62186366",
"0.61868083",
"0.6158499",
"0.6081906",
"0.6031934",
"0.602073... | 0.7196581 | 1 |
Caches a multipart upload. Checks that the cache isn't growing past MAX_CACHE_SIZE and that it isn't in the cache yet. | def add_to_cache(multipart_upload):
if len(cache) < MAX_CACHE_SIZE:
if multipart_upload.uploadId not in cache:
cache[multipart_upload.uploadId] = multipart_upload | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_from_cache(multipart_upload):\n if multipart_upload.uploadId in cache:\n del cache[multipart_upload.uploadId]",
"def StoreOrUpdateInCache(self, filename, data):\n try:\n if not memcache.add('%s%s' % (self.CACHE_PREFIX, filename), data):\n memcache.replace('%s%s' % (self.CACHE_... | [
"0.6604833",
"0.5890147",
"0.5890147",
"0.5878093",
"0.58533037",
"0.5794422",
"0.55992955",
"0.55967",
"0.5541061",
"0.5466576",
"0.54418707",
"0.5400634",
"0.53629166",
"0.5326438",
"0.5253554",
"0.52396715",
"0.52342",
"0.5201345",
"0.51884687",
"0.51225877",
"0.50966024",... | 0.77208346 | 0 |
Removes the given MultipartUpload from the cache, if in it. | def remove_from_cache(multipart_upload):
if multipart_upload.uploadId in cache:
del cache[multipart_upload.uploadId] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_file_from_cache(self, md5_hash):\n self.used_space -= len(self.storage[md5_hash])\n self.storage.pop(md5_hash)\n self.remove_from_usage_queue(md5_hash)",
"def add_to_cache(multipart_upload):\n if len(cache) < MAX_CACHE_SIZE:\n if multipart_upload.uploadId not in cache:\n... | [
"0.6391853",
"0.6139608",
"0.57140166",
"0.5713958",
"0.56205344",
"0.5557041",
"0.5550686",
"0.5528383",
"0.5524926",
"0.552387",
"0.551779",
"0.5497478",
"0.54907894",
"0.54887533",
"0.544679",
"0.54364336",
"0.54243356",
"0.5414434",
"0.5392673",
"0.5388353",
"0.53837955",... | 0.8447665 | 0 |
Returns the multipart upload we have the ID of in metadata. As Amazon allows several multipart uploads at the same time for the same file, the ID is the only unique, reliable descriptor. | def get_multipart_upload(metadata):
multipart_upload = None
metadata_mp_id = None
filename = metadata.path
if filename.startswith(u"/"):
filename = filename[1:]
plug.logger.debug(u"Getting multipart upload of {}", filename)
# Retrieve the stored multipart upload ID
try:
metad... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initiate_multipart_upload(self):\n request = self.s3.create_request(\"OBJECT_POST\", uri = self.uri, headers = self.headers_baseline, extra = \"?uploads\")\n response = self.s3.send_request(request)\n data = response[\"data\"]\n self.upload_id = getTextFromXml(data, \"UploadId\")\n ... | [
"0.7365177",
"0.59189004",
"0.56275564",
"0.56237596",
"0.5594857",
"0.5565518",
"0.5528612",
"0.54932034",
"0.54911405",
"0.5483178",
"0.5480892",
"0.54717666",
"0.5466336",
"0.54513574",
"0.5451055",
"0.53193146",
"0.5319063",
"0.53091484",
"0.5307384",
"0.52786773",
"0.527... | 0.74951166 | 0 |
Return the 3D points present as 2D for making annotation box | def get_2d_points(image, rotation_vector, translation_vector, camera_matrix, val):
point_3d = []
dist_coeffs = np.zeros((4,1))
rear_size = val[0]
rear_depth = val[1]
point_3d.append((-rear_size, -rear_size, rear_depth))
point_3d.append((-rear_size, rear_size, rear_depth))
point_3d.append((re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_coords_2d(obj, P):\n bbox3 = get_coords_3d(obj)\n # Rl = obj.Rl\n # height = obj.height\n # width = obj.width\n # length = obj.length\n # x = obj.x\n # y = obj.y\n # z = obj.z\n # bbox = np.array([[-length, 0, -width],\n # [-length, 0, width],\n # ... | [
"0.67981875",
"0.6629033",
"0.6574332",
"0.65465367",
"0.65123063",
"0.65087306",
"0.65049124",
"0.6488631",
"0.633943",
"0.63145167",
"0.6305188",
"0.627898",
"0.62688553",
"0.6257839",
"0.61788964",
"0.6127555",
"0.6094218",
"0.6081849",
"0.6077122",
"0.6068751",
"0.6049012... | 0.6037158 | 23 |
Get the points to estimate head pose sideways | def head_pose_points(image, rotation_vector, translation_vector, camera_matrix):
rear_size = 1
rear_depth = 0
front_size = image.shape[1]
front_depth = front_size*2
val = [rear_size, rear_depth, front_size, front_depth]
point_2d = get_2d_points(image, rotation_vector, translation_vector, camera_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_oriented_points(self):\n return g.points_from_probe(self)",
"def pose_2d_pts(self,image):\n '''\n image- rgb image \n return:-\n pts - list of 2d pose landmarks as img coords\n image- rgb image on which the 2d pose landmarks are drawn\n ''' \n pts=... | [
"0.6658804",
"0.6222457",
"0.6192936",
"0.615454",
"0.61042935",
"0.60609454",
"0.6035024",
"0.6020878",
"0.60114807",
"0.59733033",
"0.5970817",
"0.59246963",
"0.58942825",
"0.58829874",
"0.5882882",
"0.5877781",
"0.58656156",
"0.58611846",
"0.58332133",
"0.5820129",
"0.5814... | 0.6316923 | 1 |
Decorator that logs function execution time. | def time_function_call(fn):
def wrapper(*args, **kwargs):
t1 = time.time()
r = fn(*args, **kwargs)
diff = time.time() - t1
logger.debug("%s, duration=%6fs", fn.__name__, diff)
return r
return wrapper | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def log_execution_time(func):\n @wraps(func)\n def _func(*args, **kwargs):\n start_time = time()\n func(*args, **kwargs)\n execution_time = time() - start_time\n print('Function {} took {:05.3f} seconds to run.'.format(\n func.__name__, execution_time))\n\n return ... | [
"0.8513157",
"0.8453859",
"0.8335596",
"0.82287204",
"0.818548",
"0.81641644",
"0.8148258",
"0.8087999",
"0.8076701",
"0.80759364",
"0.805166",
"0.8050689",
"0.80375975",
"0.8037093",
"0.7937904",
"0.79354346",
"0.79004085",
"0.7898569",
"0.7894216",
"0.7866981",
"0.78624505"... | 0.7542077 | 41 |
Update the current LogReviewStatus object using the status of another object. | def update_from_existing(self, existing_status=None):
if isinstance(existing_status, self.__class__):
self.status = self.status or existing_status.status
self.owner = self.owner or existing_status.owner
self.urgency = self.urgency or existing_status.urgency | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_review(self, new_review):\n new_review = new_review.convert_review_to_dict()\n self.review[\"status\"] = new_review[\"status\"]\n if new_review[\"last_reviewed_by\"]:\n self.review[\"last_reviewed_by\"] = new_review[\"last_reviewed_by\"]\n self._upd_reviewers(new_review[\"reviewers\"])\... | [
"0.6618746",
"0.64884007",
"0.5762504",
"0.5703911",
"0.56670755",
"0.56501067",
"0.5631108",
"0.5494112",
"0.53688085",
"0.529255",
"0.52876335",
"0.5260089",
"0.5240467",
"0.5230604",
"0.5218395",
"0.5217843",
"0.5210711",
"0.5210697",
"0.51754075",
"0.5090655",
"0.5088239"... | 0.5257153 | 12 |
Main function for REST call. | def handle(self, args):
logger.debug('ARGS: %s', args)
args = json.loads(args)
try:
logger.info('Handling %s request.' % args['method'])
method = 'handle_' + args['method'].lower()
if callable(getattr(self, method, None)):
return operator.met... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rest_main(*args) -> None:\n\n if not args:\n args = sys.argv\n\n parser = argparse.ArgumentParser(args)\n parser.add_argument(\n \"-c\",\n \"--config\",\n type=str, help=\"alternate config file\",\n default=None\n )\n parser.add_argument(\n \"--no-https\... | [
"0.7210845",
"0.68318874",
"0.6728305",
"0.6553978",
"0.6478397",
"0.6400629",
"0.6277448",
"0.6264182",
"0.62379634",
"0.623307",
"0.6230819",
"0.62096715",
"0.6176845",
"0.6172377",
"0.617072",
"0.6166141",
"0.60763985",
"0.6067683",
"0.60669935",
"0.60663295",
"0.6060872",... | 0.0 | -1 |
Main function for REST call. | def handle_post(self, args):
session_key = args['session']['authtoken']
current_user = args['session']['user']
post_args = args.get('form', [])
# Validate parameters (may raise ValueError).
status, comment, urgency, searchID, newOwner, ruleUIDs = self.validate_parameters(post_a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rest_main(*args) -> None:\n\n if not args:\n args = sys.argv\n\n parser = argparse.ArgumentParser(args)\n parser.add_argument(\n \"-c\",\n \"--config\",\n type=str, help=\"alternate config file\",\n default=None\n )\n parser.add_argument(\n \"--no-https\... | [
"0.7209631",
"0.6833457",
"0.67273086",
"0.65536886",
"0.64777595",
"0.6401173",
"0.62764704",
"0.626463",
"0.6237588",
"0.62311494",
"0.623093",
"0.62077636",
"0.6177017",
"0.6171183",
"0.6169025",
"0.6165892",
"0.60776436",
"0.60682905",
"0.6067724",
"0.6065071",
"0.6062258... | 0.0 | -1 |
Retrieve the chunk size for KV store updates. | def get_batch_save_limit(session_key):
limits = get_limits('kvstore', session_key)
NotableEventUpdate.BATCH_SAVE_LIMIT = limits.max_documents_per_batch_save | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def chunksize(self):\n\n return self._chunksize",
"def chunksize(self):\n\n return self.data.chunksize",
"def chunk_size(self) -> global___Expression:",
"def get_step_size(self):\r\n msg = struct.pack('>2B', 56, 6)\r\n response = self.query(msg)\r\n return response[1]",
"... | [
"0.74477947",
"0.74144053",
"0.7018384",
"0.69296706",
"0.6918584",
"0.6906604",
"0.68973416",
"0.68366694",
"0.66706586",
"0.66581976",
"0.6652871",
"0.663117",
"0.66143477",
"0.66143477",
"0.65773904",
"0.6571629",
"0.6566637",
"0.6564972",
"0.6564972",
"0.6564972",
"0.6548... | 0.0 | -1 |
Return a list of capabilities for the given user. | def getCapabilities4User(session_key, user=None):
roles = []
capabilities = []
# Get user info
if user is not None:
logger.debug('Retrieving role(s) for current user: %s', user)
userEntities = entity.getEntities('authentication/users/%s' % user, count=-1, sessio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def capabilities(self):\n return []",
"def capabilities(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"capabilities\")",
"def capabilities(self) -> Sequence['outputs.SkuCapabilityResponse']:\n return pulumi.get(self, \"capabilities\")",
"def capabilities(self):\n pa... | [
"0.6409061",
"0.6338583",
"0.6190463",
"0.59944904",
"0.5973943",
"0.59410274",
"0.5928636",
"0.58201957",
"0.581861",
"0.57884574",
"0.577865",
"0.57566994",
"0.5692723",
"0.5676897",
"0.5660047",
"0.56488127",
"0.56191415",
"0.5557506",
"0.5557506",
"0.55458957",
"0.5538102... | 0.80392367 | 0 |
Return a list of the review statuses in dictionary with the key set to the label (or stanza, if label is undefined). | def refreshStatusLabelMap(self, session_key, force_refresh=False):
if force_refresh or self.status_label_map is None:
logger.debug("Reloading the review statuses list")
reviewStatusesEntities = entity.getEntities('alerts/reviewstatuses', count=-1, sessionKey=session_key)
self... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_labels(pr_id):\n label_json = get_status_json(pr_id, 'labels')\n current_labels = [l['name'] for l in label_json]\n return current_labels",
"def labels_list(issue):\n return [x['name'] for x in issue['labels']]",
"def get_review_status(pr_id):\n reviews = get_status_json(pr_id, 'reviews'... | [
"0.561644",
"0.5421235",
"0.5323489",
"0.5313752",
"0.52700627",
"0.5267757",
"0.5250117",
"0.52430445",
"0.5184294",
"0.518364",
"0.5169982",
"0.50796485",
"0.50787926",
"0.5018987",
"0.5011362",
"0.4985156",
"0.49694437",
"0.49398953",
"0.49062294",
"0.48961285",
"0.4891105... | 0.5855251 | 0 |
Return the urgency override state. | def isUrgencyOverrideAllowed(session_key):
notable_en = entity.getEntity(NotableEventUpdate.LOG_REVIEW_REST_URL,
'notable_editing',
namespace=NotableEventUpdate.DEFAULT_NAMESPACE,
owner=NotableEvent... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def urgency(self):\n\n try:\n tts = self.raw_time_to_resolve\n except:\n tts = 666\n\n defcon = \"normal\"\n\n if tts < 1:\n defcon = \"critical\"\n elif tts < 2:\n defcon = \"warning\"\n\n return defcon",
"def get_level(self) ... | [
"0.7169567",
"0.555879",
"0.5551994",
"0.5436678",
"0.5436553",
"0.5412196",
"0.5387082",
"0.5367364",
"0.5339496",
"0.5331872",
"0.53277886",
"0.5325559",
"0.5320186",
"0.5314916",
"0.5301885",
"0.52887714",
"0.52858543",
"0.5284677",
"0.5282586",
"0.5275696",
"0.5273975",
... | 0.588646 | 1 |
Returns the length of the comment required. | def commentLengthRequired(session_key):
comment_en = entity.getEntity(NotableEventUpdate.LOG_REVIEW_REST_URL,
'comment',
namespace=NotableEventUpdate.DEFAULT_NAMESPACE,
owner=NotableEventUpdate.DEFA... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sent_count(comment):\n return comment.__len__()",
"def comments_count(self) -> int:\n return pulumi.get(self, \"comments_count\")",
"def get_comments_num(self): \n num=len(self.comments_set.all())\n return num",
"def count_... | [
"0.73293304",
"0.705401",
"0.6813874",
"0.67454207",
"0.6679172",
"0.6659644",
"0.65434384",
"0.65434384",
"0.64944047",
"0.648698",
"0.64770037",
"0.64671075",
"0.64671075",
"0.64651716",
"0.6432444",
"0.6423683",
"0.64124656",
"0.64124656",
"0.63907695",
"0.6389172",
"0.638... | 0.78513294 | 0 |
Returns the status ID of the default systemwide review status. | def getDefaultStatus(session_key):
# Get the list of statuses
logger.debug("Getting the default status")
statuses_list = entity.getEntities(NotableEventUpdate.REVIEW_STATUSES_REST_URL,
namespace=NotableEventUpdate.DEFAULT_NAMESPACE,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_default_status(self):\n return self.bot_data_file[\"bot_status\"][\"defaultStatus\"]",
"def get_review_status(self):\n if not hasattr(self, 'credential_review'):\n status = 'Awaiting review'\n elif self.credential_review.status <= 20:\n status = 'Awaiting review... | [
"0.68067926",
"0.6296829",
"0.60826635",
"0.60303974",
"0.5814972",
"0.5710746",
"0.5666026",
"0.56644005",
"0.5596166",
"0.5588872",
"0.5538899",
"0.5532661",
"0.5532661",
"0.5532661",
"0.5532661",
"0.5532661",
"0.5532661",
"0.5532661",
"0.5532661",
"0.5532661",
"0.5516928",... | 0.7114933 | 0 |
Read the current values from the incident review lookup file. | def getCurrentValues(self, session_key, rule_ids=None):
existing_statuses = {}
# Create single instance of maxtime function.
fn_maxtime = lambda y: y.get('time')
field_order = ['time', 'rule_id', 'owner', 'urgency', 'status', 'comment', 'user', 'rule_name']
logger.debug("Gett... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prepare_review_data():\n with open(REVIEW_FILE, 'r') as fread:\n reviews = fread.read()\n with open(LABEL_FILE, 'r') as fread:\n labels = fread.read()\n return reviews, labels",
"def _read_file(self, source_file, w2v, threshold):\n num_lines = sum(1 for _ in open(source_file, \"... | [
"0.55359054",
"0.5226236",
"0.5197768",
"0.5194913",
"0.50926816",
"0.5092374",
"0.50918776",
"0.50685436",
"0.50551426",
"0.5040456",
"0.5038496",
"0.50084436",
"0.4968545",
"0.49600053",
"0.49395093",
"0.49314776",
"0.4927627",
"0.4922302",
"0.48869392",
"0.48834524",
"0.48... | 0.5168897 | 4 |
Refresh the list of correlation searches from splunkd via REST. | def refreshCorrelationSearches(self, session_key):
logger.debug("Reloading the correlation searches")
self.correlation_searches = entity.getEntities('alerts/correlationsearches', count=-1, sessionKey=session_key)
self.correlation_search_info = {k: {'rule_name': v['rule_name'], 'default_status': ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def refresh(self):\n self.dto = self.res.get()\n log.debug(f\"Refreshed {self.url}\")",
"def repopall(ctx):\n c = ctx.obj['client']\n if not c.login:\n return False\n\n r = requests.request(\"GET\", urljoin(c.BASE_URL, '/apiproxy/JobService.js'), params={'accesskey': c.login, 'metho... | [
"0.59978175",
"0.575787",
"0.55191344",
"0.54884845",
"0.54615736",
"0.5445839",
"0.5445396",
"0.5445396",
"0.53740287",
"0.53508",
"0.5328238",
"0.5328238",
"0.5328238",
"0.53184426",
"0.53174514",
"0.53174514",
"0.531563",
"0.52705693",
"0.5265398",
"0.5265398",
"0.52478623... | 0.7061147 | 0 |
Get the status code for the notable event with the given ID. This function will return the first status it | def getStatus(self, rule_id, correlation_search, existing_statuses, session_key, force_refresh=False):
# Determine if the correlation search has an existing status in incident review
if rule_id in existing_statuses:
existing_status_entry = existing_statuses[rule_id]
logger.debug... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_status(id):\n task = run_ctx_request.AsyncResult(id)\n if task.state == states.PENDING:\n abort(404)\n if task.state == states.RECEIVED or task.state == states.STARTED:\n return '', 202, {'Location': url_for('api.get_status', id=id)}\n return task.info",
"def get_status_by_id(cl... | [
"0.7048",
"0.6798998",
"0.65008837",
"0.64891154",
"0.64891154",
"0.64891154",
"0.6236803",
"0.61848116",
"0.61243594",
"0.60952085",
"0.6075376",
"0.60645425",
"0.6058127",
"0.60578483",
"0.6046282",
"0.60344464",
"0.6018257",
"0.6017363",
"0.60162807",
"0.59580535",
"0.5918... | 0.5545541 | 64 |
Update the incident review history for a set of events. | def updateEvents(self, status_records, session_key, existing_statuses=None):
for status_record in status_records:
status_record.update_from_existing(existing_statuses.get(status_record.rule_id))
# Update.
unused_response, content = self.kv.batch_create([
vars(i) for i i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update(self, events):\n events = events",
"def update_event_attendance_from_tasks(event):\n learners = event.task_set.filter(role__name='learner').count()\n Event.objects \\\n .filter(pk=event.pk) \\\n .filter(Q(attendance__lt=learners) | Q(attendance__isnull=True)) \\\n .up... | [
"0.57322633",
"0.52894056",
"0.5253097",
"0.52350444",
"0.5074988",
"0.5047744",
"0.5033114",
"0.5019752",
"0.48424822",
"0.483954",
"0.48202956",
"0.479423",
"0.4758335",
"0.47403312",
"0.4727517",
"0.47211906",
"0.469999",
"0.46677616",
"0.46658024",
"0.46631622",
"0.465831... | 0.49258062 | 8 |
Create an audit record for a list of updated events. | def create_audit_records(self, status_records, session_key):
uri = '/services/receivers/simple'
getargs = {'index': '_audit', 'sourcetype': 'incident_review', 'output_mode': 'json'}
# Double list-comprehension:
# a. Comma-separate the fields in each record, replacing "None" with the
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def updateEvents(self, status_records, session_key, existing_statuses=None):\n\n for status_record in status_records:\n status_record.update_from_existing(existing_statuses.get(status_record.rule_id))\n\n # Update.\n unused_response, content = self.kv.batch_create([\n var... | [
"0.63237685",
"0.59012693",
"0.5659949",
"0.5493767",
"0.54725164",
"0.5468641",
"0.5305744",
"0.5234044",
"0.5232979",
"0.522035",
"0.5220307",
"0.52176887",
"0.5212649",
"0.51756454",
"0.5148049",
"0.51328814",
"0.5120397",
"0.51175773",
"0.5109951",
"0.50947446",
"0.504144... | 0.6022617 | 1 |
Get the search results for the given search ID. | def getSearchResults(searchID, session_key):
job = splunk.search.getJob(searchID, sessionKey=session_key)
if not job.isDone:
raise SearchNotDoneException("Search is not done, search must be completed before results can be processed")
if job.reportSearch:
logger.warn("T... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def get_search_results(search_string: str):\n database = get_db()\n result = []\n search_string = search_string.lower()\n search_strings = search_utils.preprocess_search_string(\n search_string[:150]\n )\n query_search = database.AQLQuery(\n query=search_queries.QUERY_SEARCH,\... | [
"0.6724352",
"0.65330744",
"0.64275545",
"0.6412478",
"0.63617796",
"0.6330999",
"0.6315197",
"0.6310618",
"0.630068",
"0.6298764",
"0.629138",
"0.62622744",
"0.6177091",
"0.6141086",
"0.6141086",
"0.6141086",
"0.6141086",
"0.6141086",
"0.6141086",
"0.6141086",
"0.6118462",
... | 0.71253186 | 0 |
Set the status of the events that match a search with the given ID. | def setStatusBySearchID(self, searchID, urgency, status, comment, newOwner, reviewTime, capabilities, session_key, currentUser=None, force_refresh=False, rule_ids_to_change=None, existing_statuses=None):
# This class instance will record the number of events successfully changed
status_change_meta = Lo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def id_status(self, id_status):\n self._id_status = id_status",
"def update_status(self, id, status):\n sql = f\"UPDATE incidences SET status = \\'{status}\\'\\\n WHERE incidences.id = {id}\"\n conn = Db().con\n curr = conn.cursor()\n curr.execute(sql)\n conn.com... | [
"0.6252509",
"0.5942144",
"0.59207493",
"0.5787411",
"0.5685566",
"0.56427914",
"0.5544263",
"0.5534634",
"0.5514875",
"0.54568875",
"0.5452327",
"0.5425086",
"0.531803",
"0.529227",
"0.5255102",
"0.52439374",
"0.5222686",
"0.52150995",
"0.52004564",
"0.51656383",
"0.51502025... | 0.6068505 | 1 |
Set the status of the events with the given rule IDs | def setStatusByIDs(self, rule_ids, urgency, status, comment, newOwner, reviewTime, session_key, currentUser=None, existing_statuses=None):
# This class provides information on the operations performed
status_change_meta = LogReviewStatusChanges()
# Make sure the comment is the minimum length (... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setStatuses(self, urgency, status, comment, newOwner, currentUser, ruleUIDs, searchID, reviewTime, existing_statuses, capabilities, session_key):\n\n # Print a log message noting that an operation is about to happen\n if ruleUIDs is not None and searchID is not None:\n logger.info(\"Ab... | [
"0.5960008",
"0.5552889",
"0.55509925",
"0.5498841",
"0.5445532",
"0.5359694",
"0.53434515",
"0.5335274",
"0.5285304",
"0.5277969",
"0.5243045",
"0.5196009",
"0.51921904",
"0.51836336",
"0.5173424",
"0.51620984",
"0.5158724",
"0.5099852",
"0.5083945",
"0.5045462",
"0.5029228"... | 0.66258126 | 0 |
Commit the changes to the incident review lookup. Returns a LogReviewStatusChanges instance that describes the result of the operation. | def setStatuses(self, urgency, status, comment, newOwner, currentUser, ruleUIDs, searchID, reviewTime, existing_statuses, capabilities, session_key):
# Print a log message noting that an operation is about to happen
if ruleUIDs is not None and searchID is not None:
logger.info("About to edi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def commit(self):\n params = {'commit': 'true'}\n\n return self.client.post(\n self._get_collection_url('update/json'), params=params)",
"def test_multiple_change_review_status(self):\n runid = self._runid\n logging.debug('Get all run results from the db for runid: ' +\n ... | [
"0.56830585",
"0.54204667",
"0.5252031",
"0.5154609",
"0.5154395",
"0.5125139",
"0.510645",
"0.5071308",
"0.5065389",
"0.50248367",
"0.49875844",
"0.49721166",
"0.49659967",
"0.48785013",
"0.48422068",
"0.4825068",
"0.4807924",
"0.47985798",
"0.47939518",
"0.47931632",
"0.478... | 0.0 | -1 |
Check and make sure that the user can transition the given rules. Returns a list of messages that describes the issues found. An empty list indicates that no issues were found. | def checkTransition(self, rule_id, correlation_search, status, capabilities, session_key, existing_statuses=None, force_refresh=False):
# Populate the existing_statuses if not pre-populated
if existing_statuses is None:
existing_statuses = self.getCurrentValues(session_key, [rule_id])
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def rules(self, ctx: commands.Context) -> None:\n if not ctx.channel.permissions_for(ctx.guild.me).embed_links:\n return\n rules = await self.config.guild(ctx.guild).rules()\n team = await self.config.guild(ctx.guild).team_rules()\n if rules == \"\":\n return... | [
"0.5980203",
"0.5978135",
"0.58789545",
"0.5401699",
"0.5359152",
"0.52318466",
"0.52254736",
"0.5203563",
"0.5178108",
"0.51427305",
"0.51394784",
"0.5100385",
"0.5100385",
"0.50928676",
"0.5068339",
"0.50373805",
"0.50248194",
"0.5017723",
"0.5015346",
"0.49988455",
"0.4997... | 0.56398183 | 3 |
Make changes to the notable events that are requested. | def makeChanges(self, status, comment, session_key, newOwner=None, urgency=None, ruleUIDs=None, searchID=None, currentUser=None):
response = {}
try:
# 0 -- Precondition checks
# 0.1 -- Make sure the search ID was provided
if searchID is None and ruleUIDs is Non... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update(self, events):\n events = events",
"def events(self):",
"def update_events(self, new_events):\n\n for new_event in new_events:\n self.__events.setdefault(new_event.type, []).append(new_event)",
"def InitOtherEvents(self):\n\n pass",
"def react_to_event(self):\n ... | [
"0.59233844",
"0.5914995",
"0.58297867",
"0.5732379",
"0.5711216",
"0.5678851",
"0.56554806",
"0.5611185",
"0.5600433",
"0.5528289",
"0.5518004",
"0.5507235",
"0.54905474",
"0.5456326",
"0.5440396",
"0.5428834",
"0.5420776",
"0.5404675",
"0.53718996",
"0.5351886",
"0.53475654... | 0.0 | -1 |
Calculates 1/ from fit data f and possibly stretch exponent s, with errors if given | def calculate_f(f, s = None, f_err = None, s_err = None, scale = 1000):
if s is None:
return f, f_err
else:
f0 = f * s / gamma(1./s)
if (f_err is not None) and (s_err is not None):
sigma = np.sqrt(f_err ** 2 + ((s + polygamma(0, 1/s))/s/gamma(1/s)* s_err)**2)
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ForceFitPowerlaw(p0, f, x, model='h'):\n hertz = ['h', 'H', 'hertz', 'Hertz']\n sneddon = ['s', 'S', 'sneddon', 'Sneddon']\n if model in hertz:\n model = 3./2\n def erf(p, f, x, model):\n return f - p[0]*np.power(x,model)\n elif model in sneddon:\n model = 2.\n ... | [
"0.6359497",
"0.630396",
"0.62164336",
"0.61789817",
"0.6004726",
"0.5962202",
"0.58648753",
"0.58410764",
"0.58384585",
"0.5783175",
"0.57613504",
"0.57225925",
"0.57216847",
"0.56861985",
"0.5686081",
"0.56694084",
"0.5659702",
"0.5622807",
"0.55963826",
"0.55789584",
"0.55... | 0.6419055 | 0 |
Update with another mapping of detectors | def update(self, *args, **kwargs):
other = dict(*args, **kwargs)
for key, value in other.items():
if not isinstance(value, Detector):
raise TypeError(
"Values must be {}, not {} for key {}".format(
Detector, type(value), key
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _update_farness_map(self,ind):",
"def update(self, detections):\n # Run matching cascade.\n matches, unmatched_tracks, unmatched_detections = \\\n self._match(detections)\n\n # Update track set.\n if len(matches) != 0:\n matched_track_means = []\n ... | [
"0.63471323",
"0.6246957",
"0.6175478",
"0.61736465",
"0.61223453",
"0.6106069",
"0.5949793",
"0.58956534",
"0.5883297",
"0.5872196",
"0.57903147",
"0.57832134",
"0.57500273",
"0.5749186",
"0.5734801",
"0.57011825",
"0.5676344",
"0.560204",
"0.5571893",
"0.55711484",
"0.55638... | 0.54451156 | 24 |
Load data from a Serpent output file | def fromSerpent(
cls, source, sourcename=None, postcheck=True, strict=True, names=None,
):
return super().fromSerpent(
source,
sourcename=sourcename,
postcheck=postcheck,
strict=strict,
names=names,
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load(filename):\r\n wholeTract= nib.streamlines.load(filename) \r\n wholeTract = wholeTract.streamlines\r\n return wholeTract",
"def load_dust_output(filepath):\n\n with open(filepath, 'r') as f:\n dust_output = pickle.load(f)\n\n return dust_output",
"def load_data(self) -> None:",... | [
"0.5915087",
"0.585913",
"0.57900023",
"0.57711977",
"0.5680528",
"0.5679303",
"0.5673912",
"0.56371534",
"0.5624755",
"0.5616993",
"0.5545882",
"0.5540813",
"0.5536881",
"0.5519733",
"0.54569066",
"0.54482543",
"0.54479986",
"0.5443087",
"0.542484",
"0.542114",
"0.54209703",... | 0.0 | -1 |
Process detectors from a Serpent output file | def read(self, source, sourcename=None, postcheck=True, strict=True):
if isinstance(source, str):
with open(source, mode="r") as stream:
return self.readTextStream(
stream,
sourcename or source,
postcheck=postcheck,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def main(path):\n logger.info(f'Processing video file {path}')\n # Extract audio\n audio_file = extract_audio(path, pipeline_config.audio_target_dir)\n\n # Generate sound classification results and speech recogniser results\n sound_results = SoundRecogniser().process_file(audio_file)\n sound_resu... | [
"0.57812935",
"0.57170874",
"0.5706254",
"0.5643354",
"0.5632157",
"0.55472153",
"0.5533138",
"0.54842997",
"0.5426165",
"0.5377879",
"0.53685",
"0.53535414",
"0.5340035",
"0.5339732",
"0.5335772",
"0.5320359",
"0.5303741",
"0.52992547",
"0.52926",
"0.5282647",
"0.5278365",
... | 0.0 | -1 |
Process detectors from a stream of text data | def readTextStream(
self, stream, sourcename=None, postcheck=True, strict=True
):
if not isinstance(stream, io.TextIOBase):
raise TypeError("Stream is not a source of text data")
elif not stream.readable():
raise AttributeError("Stream is not readable")
detec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data_preprocessing():\n lineid_content = get_lineid_content()\n print('Read movie_lines.txt file complete...')\n convos = get_convos()\n print('Read movie_conversations.txt file complete...')\n print('Building dataset')\n get_data(lineid_content, convos)",
"def infer():\n\n # Create Stre... | [
"0.59176165",
"0.5905736",
"0.56918573",
"0.5629905",
"0.5600295",
"0.55916744",
"0.558541",
"0.5556407",
"0.55540735",
"0.5542036",
"0.5529023",
"0.54705584",
"0.5440531",
"0.543348",
"0.54040974",
"0.53689724",
"0.53610826",
"0.5352985",
"0.5328044",
"0.53233397",
"0.531953... | 0.6518016 | 0 |
Return workflow history of this context, for all workflows in its chain. Taken from plone_scripts/getWorkflowHistory.py | def workflowHistory(self, complete=True):
context = aq_inner(self.context)
# Since switching to DCWorkflow's getInfoFor, we rely on its
# permission checks.
#if not (_checkPermission('Request review', context) or
# _checkPermission('Review portal content', context)):
#... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getProcessingHistoryList(context):\n projectDir = context.projectDir\n steps = []\n history = GenericMetadata._readEntriesForSection(projectDir, GenericMetadata.HISTORY_SECTION)\n try:\n idx = int(history['numsteps']) + 1\n for i in xrange(1, idx):\n ... | [
"0.6612526",
"0.6584411",
"0.65203327",
"0.6433324",
"0.639691",
"0.639691",
"0.6346261",
"0.62524766",
"0.6220365",
"0.618586",
"0.61093587",
"0.60434985",
"0.60136586",
"0.5986631",
"0.59849703",
"0.5923301",
"0.5921552",
"0.59123814",
"0.58308953",
"0.57951367",
"0.5791231... | 0.668929 | 0 |
Build a URI template using the url_key and constants from the API definition found in const.py | def build_uri_template(url_key: str) -> URITemplate:
_skeleton = ''.join([API_PATH['base'], API_PATH[url_key]])
_template = URITemplate(_skeleton)
return _template | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def uri_template(app, **kwargs):\n assert len(kwargs) == 1\n\n endpoint = kwargs.keys()[0]\n parameters = kwargs.values()[0]\n\n for url in app.url_map.iter_rules():\n if url.endpoint == endpoint:\n break\n else:\n return ''\n\n ut = url.rule\n\n for param, replacement... | [
"0.709884",
"0.6977214",
"0.67404443",
"0.66753805",
"0.662737",
"0.6527455",
"0.64493567",
"0.642962",
"0.6384027",
"0.63768953",
"0.63635385",
"0.63031346",
"0.63031346",
"0.6255533",
"0.6241023",
"0.62348884",
"0.6225104",
"0.6216448",
"0.6147686",
"0.6134802",
"0.6097601"... | 0.8198724 | 0 |
Used for caching objects returned in the RestClient class that take the arguments | def memoize_rc(func):
# shelf_file = '../resources/rccache'
logger.debug(f"Opening shelf file: {SHELF_FILE}")
def wrapper(*args, **kwargs):
key = '_'.join([func.__name__, *args[1:], *kwargs.values()])
today = datetime.date.today()
with shelve.open(str(SHELF_FILE)) as shelf:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, *args, **kwargs):\n self._cachedict = {}",
"def _cache(self):\n return self._class(self.client_servers, **self._options)",
"def dynCache(*args, **kwargs)->None:\n pass",
"def instance_cache(func):\n def _wrapper(self, *args, **kwargs):\n key = (func.__name__,) + ... | [
"0.71109164",
"0.68648815",
"0.6586375",
"0.64931995",
"0.6486344",
"0.6407061",
"0.63063335",
"0.6238268",
"0.62008035",
"0.6190578",
"0.6174971",
"0.6074458",
"0.60668087",
"0.6054034",
"0.6048802",
"0.6027336",
"0.60064465",
"0.6000669",
"0.59971035",
"0.5976839",
"0.59526... | 0.0 | -1 |
Validate some of the identities used in the Bricklink REST api. Items are optional passing on the ones to validate. Errors are raised on invalid. | def __validate(itemid: str = None,
itemtype: str = None,
color: str = None, # it's an integer as a string
vat: str = None,
region: str = None,
new_or_used: str = None,
guide_type: str = None)->bool:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _validate_item(self, item):\n try:\n self._validate_item_required_attrs(item=item)\n self._validate_item_link(item=item)\n except ValueError as ex:\n logger.info(str(ex))\n return False\n\n return True",
"def validate_user_input_for_items(func)... | [
"0.6011467",
"0.5993892",
"0.5772099",
"0.57665086",
"0.5734295",
"0.56898636",
"0.5583929",
"0.5569309",
"0.55531764",
"0.555009",
"0.55279905",
"0.55078435",
"0.5505699",
"0.54508495",
"0.54463",
"0.5445634",
"0.5428192",
"0.54227597",
"0.54058903",
"0.5381645",
"0.53469706... | 0.5686632 | 6 |
Create request and _get it for the passed url | def _get(self, url: str) -> requests.Response:
# todo: do some error checking here
if url.startswith(API_PATH['base']):
try:
# logger.debug(f"RestClient._get(): {url}") # log in calling function
response = requests.get(url, auth=self.auth)
rest... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_request(url):\n\tr = requests.get(url)\n\treturn(r)",
"def _get_request(url, params):\n request = requests.get(url, params=params)\n\n return request",
"def _get(self, url):\n return self._request(url)",
"def _request(self, url, **kwargs):\n headers = {'PRIVATE-TOKEN': self.token}... | [
"0.7739848",
"0.76722616",
"0.74815005",
"0.678988",
"0.67669636",
"0.6747699",
"0.6739794",
"0.66417694",
"0.66259664",
"0.6573079",
"0.6518146",
"0.6495604",
"0.6495604",
"0.64947146",
"0.64813745",
"0.647484",
"0.64390993",
"0.64240277",
"0.6423518",
"0.6423518",
"0.641317... | 0.617639 | 51 |
Get data from rest response @ url | def _get_data(self, url: str)->dict:
data = None
resp = self._get(url)
if resp:
data = resp.json()['data']
return data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_data(self, request, url):\n data = request.get(endpoint=url)\n return data[0], data[1]",
"def get_data(self, url):\n return self.get(url).get('data', [])",
"def _request_data(self, url):\n connection = httplib.HTTPConnection(self.url)\n connection.request(\"GET\", url)\n ... | [
"0.7180297",
"0.71662253",
"0.7147063",
"0.7011423",
"0.7007659",
"0.69978225",
"0.6939134",
"0.6913385",
"0.6910226",
"0.69027406",
"0.685094",
"0.68336797",
"0.6828539",
"0.67791396",
"0.67546266",
"0.6735764",
"0.67224765",
"0.67224765",
"0.67215157",
"0.6705441",
"0.66605... | 0.6805512 | 13 |
/items/{type}/{no} (see Bricklink API) | def get_item(self, itemid: str, itemtypeid: str)->dict:
self.__validate(itemid=itemid, itemtype=itemtypeid)
url = build_uri_template('get_item').expand(type=itemtypeid, no=itemid)
logger.info("Getting Item from: {}".format(url))
data = self._get_data(url)
return data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_item():\n # 404 reponses\n response = app.test_client().get('/v1/resources/menu?')\n assert response.status_code == 404\n\n response = app.test_client().get('/v1/resources/menu?itype=pizza')\n assert response.status_code == 404\n\n response = app.test_client().get('/v1/resources/menu?ity... | [
"0.6174779",
"0.6140287",
"0.6059457",
"0.59042364",
"0.58196825",
"0.5819385",
"0.57581115",
"0.5747379",
"0.5729421",
"0.5724586",
"0.5724586",
"0.57133585",
"0.5666344",
"0.5657577",
"0.5639711",
"0.56234604",
"0.55987",
"0.5578887",
"0.55758405",
"0.5552721",
"0.5541549",... | 0.0 | -1 |
/items/{type}/{no} (see Bricklink API) | def get_item_image(self, itemid: str, itemtypeid: str, colorid: str)->dict:
self.__validate(itemid=itemid, itemtype=itemtypeid, color=colorid)
url = build_uri_template('get_item_image').expand(type=itemtypeid, no=itemid, color_id=colorid)
logger.info("Getting image from: {}".format(url))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_item():\n # 404 reponses\n response = app.test_client().get('/v1/resources/menu?')\n assert response.status_code == 404\n\n response = app.test_client().get('/v1/resources/menu?itype=pizza')\n assert response.status_code == 404\n\n response = app.test_client().get('/v1/resources/menu?ity... | [
"0.6174779",
"0.6140287",
"0.6059457",
"0.59042364",
"0.58196825",
"0.5819385",
"0.57581115",
"0.5747379",
"0.5729421",
"0.5724586",
"0.5724586",
"0.57133585",
"0.5666344",
"0.5657577",
"0.5639711",
"0.56234604",
"0.55987",
"0.5578887",
"0.55758405",
"0.5552721",
"0.5541549",... | 0.0 | -1 |
/items/{type}/{no}/supersets (see Bricklink API) | def get_supersets(self, itemid: str, itemtypeid: str)->dict:
self.__validate(itemid=itemid, itemtype=itemtypeid)
url = build_uri_template('get_supersets').expand(type=itemtypeid, no=itemid)
logger.info("Getting supersets: {}".format(url))
data = self._get_data(url)
return data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_subsets(self, itemid: str, itemtypeid: str)->dict:\n self.__validate(itemid=itemid, itemtype=itemtypeid)\n url = build_uri_template('get_subsets').expand(type=itemtypeid, no=itemid)\n logger.info(\"Getting subsets: {}\".format(url))\n data = self._get_data(url)\n return d... | [
"0.5300971",
"0.5246067",
"0.5177095",
"0.49986303",
"0.49967286",
"0.49637622",
"0.49469367",
"0.49088362",
"0.48998055",
"0.4856261",
"0.48412782",
"0.48360786",
"0.48124474",
"0.47905272",
"0.47800264",
"0.47636992",
"0.46328634",
"0.4622482",
"0.4617957",
"0.4617109",
"0.... | 0.70193607 | 0 |
This is used to _get a set inventory /items/{type}/{no}/subsets (see Bricklink API) | def get_subsets(self, itemid: str, itemtypeid: str)->dict:
self.__validate(itemid=itemid, itemtype=itemtypeid)
url = build_uri_template('get_subsets').expand(type=itemtypeid, no=itemid)
logger.info("Getting subsets: {}".format(url))
data = self._get_data(url)
return data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_subsets(self, project):\n serializer = SubsetSerializer(project.subsets.all(), many=True)\n return serializer.data",
"def request_subset_edit(self, request):\n user_id = request['user_id']\n workspace_uuid = request['workspace']['uuid']\n request_list = None\n if... | [
"0.66228426",
"0.658018",
"0.6361112",
"0.621814",
"0.61558557",
"0.6032727",
"0.58454335",
"0.5843885",
"0.5832506",
"0.5706368",
"0.5574686",
"0.55048376",
"0.54442704",
"0.54374105",
"0.5397158",
"0.5358623",
"0.5331448",
"0.5311054",
"0.52144516",
"0.5145197",
"0.5139706"... | 0.7219529 | 0 |
Get the price guide from the catalog /items/{type}/{no}/price | def get_part_price_guide(self, itemid: str, colorid: int, new_or_used: str)->dict:
self.__validate(itemid=itemid, color=colorid, new_or_used=new_or_used)
data = self.get_price_guide(itemid, ItemType.PART, colorid, new_or_used=new_or_used)
return data | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_price(self, request, pk):\n return Response('20$')",
"def get_price(self, request, pk):\n return Response('20$')",
"def get_price(item):\n return float(item[1])",
"def getprice():\n\n print(\"Get price\")\n latest_price = get_latest_price(item_code)\n return latest_price",
... | [
"0.6840674",
"0.6840674",
"0.68250585",
"0.64556295",
"0.6416201",
"0.64048207",
"0.6391709",
"0.6244718",
"0.6238784",
"0.6237512",
"0.6231386",
"0.6176405",
"0.61756814",
"0.6138778",
"0.61362964",
"0.6124138",
"0.60760045",
"0.60630196",
"0.60630196",
"0.60624886",
"0.5985... | 0.55391574 | 42 |
Generic function to extract a list from a binary file. | def read_list_bin(file_name):
try:
extracted_list = []
with open(file_name, "rb") as binary_file:
extracted_list = pickle.load(binary_file)
return extracted_list
except FileNotFoundError:
print("File not found: ",file_name)
except Exception as e:
print(typ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _decode_list(fp):\n tag_id = _decode_byte(fp)\n size = _decode_int(fp)\n return [_MAP[tag_id](fp) for _ in range(size)]",
"def read_file_into_list(source_file):\n\twith open(source_file, 'r') as source:\n\t\tdata = base64.b64encode(source.read())\n\t\treturn [data[i:i+SPLIT_LENGTH] for i in range(0,... | [
"0.70250535",
"0.66882926",
"0.6643177",
"0.65935946",
"0.655588",
"0.6189796",
"0.61198866",
"0.6115346",
"0.609496",
"0.6092333",
"0.6032443",
"0.6011349",
"0.6009787",
"0.60039115",
"0.5989868",
"0.5981291",
"0.5955054",
"0.59242487",
"0.5908565",
"0.5890663",
"0.58747673"... | 0.7575874 | 0 |
Generic function to write a list to a binary file (replace content). | def write_list_bin(inserted_list, file_name):
try:
with open(file_name, "wb") as binary_file:
pickle.dump(inserted_list, binary_file)
except Exception as e:
print(type(e), e)
sys.exit() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write(lst):\n # TODO",
"def save_list_to_file(content: list, dst_path: str, append=False) -> None:\n with io.open(file=dst_path, mode=\"a\" if append else \"w\", encoding='utf-8') as destination_file:\n for element in content:\n destination_file.write(element + \"\\n\")",
"def save_... | [
"0.7168718",
"0.684559",
"0.680929",
"0.6803841",
"0.6670353",
"0.66512245",
"0.6639571",
"0.6587721",
"0.6537934",
"0.6437597",
"0.63995486",
"0.63601077",
"0.6337326",
"0.6311502",
"0.6271015",
"0.6202361",
"0.61834747",
"0.6147879",
"0.61425006",
"0.6129202",
"0.6047813",
... | 0.7379721 | 0 |
Generic function to check if an index already exists in a list of AutoBaseObject. | def index_already_there(index, given_list):
# check if ID already exists
already_there = False
if len(given_list)>0:
for item in given_list:
if isinstance(item, AutoBaseObject):
if item.ID == index:
already_there = True
break
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_object_repeated(lists, obj):\n for any_obj in lists:\n if check_tuples(any_obj['indexes'], obj['indexes']):\n return None\n return obj",
"def __contains__(self, item):\n return item in self._index_map",
"def __contains__(self, item: Any) -> bool:\n return item in... | [
"0.6840094",
"0.6636097",
"0.65430546",
"0.6385054",
"0.6328272",
"0.6273341",
"0.6229249",
"0.62248135",
"0.6148913",
"0.61416686",
"0.6109743",
"0.6041912",
"0.5994398",
"0.59898144",
"0.59320223",
"0.5921886",
"0.59082884",
"0.5905032",
"0.5897877",
"0.58703214",
"0.585462... | 0.80496514 | 0 |
Generic function to get an indexed entry from a list of AutoBaseObject. | def get_indexed_item_from_list(index, given_list):
returned_item = None
if len(given_list)>0:
for item in given_list:
if isinstance(item, AutoBaseObject):
if item.ID == index:
returned_item = item
break
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index_object(idxs=None):",
"def get_entry(obj, *path):\n\n try:\n for elem in path:\n is_index = isinstance(elem, int)\n is_list = isinstance(obj, list)\n if is_index != is_list:\n raise UpdateException('index given for non-list or vice versa')\n obj = obj[elem]\n... | [
"0.611796",
"0.5894193",
"0.5874042",
"0.58262813",
"0.57515997",
"0.573731",
"0.57367045",
"0.56926435",
"0.5678464",
"0.5667245",
"0.5613185",
"0.558198",
"0.55727726",
"0.55678636",
"0.5559255",
"0.55462104",
"0.5529028",
"0.5526751",
"0.552012",
"0.5509918",
"0.5496633",
... | 0.75683933 | 0 |
Generic function to get an indexed entry from a list of AutoBaseObject stored in a binary file. | def get_indexed_item_from_file(index, file_name):
list_in_file = read_list_bin(file_name)
return get_indexed_item_from_list(index, list_in_file) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_indexed_item_from_list(index, given_list):\n\n returned_item = None\n\n if len(given_list)>0:\n for item in given_list:\n if isinstance(item, AutoBaseObject):\n if item.ID == index:\n returned_item = item\n break\n else... | [
"0.6527637",
"0.57819504",
"0.56898844",
"0.56373376",
"0.5492448",
"0.53973085",
"0.5301742",
"0.5224329",
"0.52219355",
"0.52150476",
"0.51943016",
"0.51909566",
"0.51579016",
"0.51561844",
"0.5147235",
"0.51413095",
"0.51280373",
"0.50871134",
"0.5073669",
"0.5071198",
"0.... | 0.64558613 | 1 |
Print out all attributes, with an indentation level. | def printout_all(self, indent_level):
indent = " "*indent_level*INDENTATION_MULTIPLIER
print(indent, "Test Case ID:", self.ID, sep='')
print(indent, "|-name:", self.name, sep='')
print(indent, "|-JIRA URL:", self.JIRA_URL, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_attrs(self):\n for attribute in self.__dict__.keys():\n print(attribute)",
"def print_attribute(attributes):\n for attribute in attributes:\n print ' ',\n change_color_by_tag(attribute)\n if attribute['ExtAttributes']:\n print_extattributes_of_mem... | [
"0.79098475",
"0.76404846",
"0.71579635",
"0.7130595",
"0.7002356",
"0.6967273",
"0.6959917",
"0.68992954",
"0.6844863",
"0.6809012",
"0.6792403",
"0.6774788",
"0.6733136",
"0.6671675",
"0.6605866",
"0.6567369",
"0.651564",
"0.649377",
"0.64581263",
"0.64466727",
"0.6421849",... | 0.6648593 | 14 |
Function to add persistent data about test cases (in binary file). | def add_test_case_to_file(test_case_ID, test_case_name, test_case_JIRA_URL):
test_cases = read_list_bin(FILE_TEST_CASES)
if index_already_there(test_case_ID, test_cases):
print("Test Case ID=",test_case_ID," is already defined and can't be added")
else:
test_cases.append(TestCase(test_case... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _load_test_data(self):\n self._save_test_data()",
"def test_001_save_data(self):\n __test = chess_storage.ChessStorage()\n __test_data = list(range(consts.TEST_LIST_LENGHT))\n __test_filename = consts.TEST_FILENAME\n __test_filename_appended = consts.TEST_FILENAME + \"__1\"... | [
"0.68978393",
"0.61417586",
"0.6139318",
"0.6125945",
"0.6094655",
"0.6040593",
"0.6008519",
"0.6005113",
"0.6003242",
"0.59883",
"0.59775114",
"0.5938462",
"0.59265506",
"0.58904564",
"0.5847303",
"0.58462524",
"0.5840218",
"0.5803827",
"0.5786123",
"0.5697607",
"0.5681403",... | 0.60825294 | 5 |
Function to initialize test case data. | def init_test_cases():
test_cases = []
# add info to list in memory, one by one, following signature values
test_case_ID = 1
test_case_name = "auto-resiliency-pif-001"
test_case_JIRA_URL = "https://jira.opnfv.org/browse/AUTO-9"
test_cases.append(TestCase(test_case_ID, test_case_name, test_case_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setUpTestData(cls):\n # volunteer user\n common.initialize_empty_volunteer()",
"def setUp(self):\n self.dataset = get_test_dataset()",
"def setUpTestData(cls):\n data_gen.run()",
"def setUpTestData(cls):\n data_gen.run()",
"def setUpTestData(cls):\n data_gen.ru... | [
"0.76128685",
"0.75372815",
"0.7513062",
"0.7513062",
"0.7513062",
"0.7513062",
"0.72867423",
"0.72227305",
"0.72166383",
"0.71077645",
"0.70698",
"0.7060812",
"0.68932444",
"0.68592334",
"0.6827512",
"0.6818365",
"0.68055",
"0.6784938",
"0.6728202",
"0.6699266",
"0.6694796",... | 0.6497204 | 48 |
Run currently selected test code. Common code runs here, specific code is invoked through test_code_list and test_code_ID. Optional parameters can be passed if needed (unnamed or named), interpreted accordingly by selected test code. | def run_test_code(self, *test_code_args, **test_code_kwargs):
try:
# here, trigger start code from challenge def (to simulate VM failure), manage Recovery time measurement,
# specific monitoring of VNF, trigger stop code from challenge def
time1 = datetime.now() # get time ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_code001(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code001 from TestDefinition #\", self.ID, \", test case #\", self.test_case_ID, sep='')",
"def test_code010(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code010 from TestDefinition #\", self.ID... | [
"0.677512",
"0.67487895",
"0.6626339",
"0.6552723",
"0.6492401",
"0.64204943",
"0.64045966",
"0.6393247",
"0.6352505",
"0.6287673",
"0.62475413",
"0.62339044",
"0.62095606",
"0.6190819",
"0.6190053",
"0.6165832",
"0.60683763",
"0.60556114",
"0.6042067",
"0.60127425",
"0.59866... | 0.68803483 | 0 |
Test case code number 001. | def test_code001(self, *test_code_args, **test_code_kwargs):
print("This is test_code001 from TestDefinition #", self.ID, ", test case #", self.test_case_ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_code010(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code010 from TestDefinition #\", self.ID, \", test case #\", self.test_case_ID, sep='')",
"def test_code009(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code009 from TestDefinition #\", self.ID... | [
"0.6850627",
"0.66204584",
"0.646728",
"0.6306222",
"0.6301501",
"0.60464233",
"0.6036792",
"0.5991052",
"0.5896127",
"0.5882364",
"0.5882116",
"0.58683854",
"0.5861891",
"0.58524764",
"0.58049977",
"0.57959384",
"0.5779963",
"0.5769177",
"0.5752419",
"0.5743817",
"0.5742925"... | 0.6795745 | 1 |
Test case code number 002. | def test_code002(self, *test_code_args, **test_code_kwargs):
print("This is test_code002 from TestDefinition #", self.ID, ", test case #", self.test_case_ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_code010(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code010 from TestDefinition #\", self.ID, \", test case #\", self.test_case_ID, sep='')",
"def test_code008(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code008 from TestDefinition #\", self.ID... | [
"0.6688537",
"0.6581555",
"0.6571625",
"0.6417017",
"0.6344524",
"0.6341513",
"0.6299328",
"0.61171895",
"0.6096851",
"0.60762775",
"0.60589385",
"0.60426486",
"0.6013901",
"0.5999068",
"0.59957737",
"0.59762895",
"0.5971644",
"0.59639055",
"0.59605753",
"0.59593356",
"0.5910... | 0.648301 | 3 |
Test case code number 003. | def test_code003(self, *test_code_args, **test_code_kwargs):
print("This is test_code003 from TestDefinition #", self.ID, ", test case #", self.test_case_ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_code008(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code008 from TestDefinition #\", self.ID, \", test case #\", self.test_case_ID, sep='')",
"def test_code009(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code009 from TestDefinition #\", self.ID... | [
"0.65716606",
"0.6559461",
"0.6456624",
"0.63518673",
"0.6318272",
"0.62671703",
"0.62133527",
"0.6069862",
"0.6031914",
"0.6030209",
"0.5982141",
"0.5982141",
"0.5874074",
"0.58359516",
"0.5817474",
"0.5689604",
"0.5688705",
"0.56851476",
"0.56775486",
"0.56764436",
"0.56737... | 0.672484 | 0 |
Test case code number 004. | def test_code004(self, *test_code_args, **test_code_kwargs):
print("This is test_code004 from TestDefinition #", self.ID, ", test case #", self.test_case_ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_code010(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code010 from TestDefinition #\", self.ID, \", test case #\", self.test_case_ID, sep='')",
"def test_code009(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code009 from TestDefinition #\", self.ID... | [
"0.67048603",
"0.6592853",
"0.6474699",
"0.64421576",
"0.640215",
"0.6312405",
"0.62041426",
"0.61801666",
"0.6154687",
"0.6145559",
"0.61353433",
"0.6107601",
"0.6107601",
"0.6091312",
"0.6010107",
"0.5868794",
"0.5764935",
"0.5749172",
"0.5733635",
"0.57220316",
"0.567724",... | 0.6673887 | 1 |
Test case code number 005. | def test_code005(self, *test_code_args, **test_code_kwargs):
print("This is test_code005 from TestDefinition #", self.ID, ", test case #", self.test_case_ID, sep='')
# specific VNF recovery monitoring, specific metrics if any
# interact with ONAP, periodic query about VNF status; may also check... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_code010(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code010 from TestDefinition #\", self.ID, \", test case #\", self.test_case_ID, sep='')",
"def test_code008(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code008 from TestDefinition #\", self.ID... | [
"0.6484396",
"0.6256145",
"0.6194849",
"0.6110339",
"0.60885286",
"0.60697025",
"0.6061915",
"0.6060739",
"0.6049471",
"0.60086846",
"0.6007196",
"0.59025675",
"0.58421713",
"0.58218896",
"0.5773923",
"0.5757072",
"0.57544917",
"0.5753424",
"0.5608226",
"0.55939084",
"0.55851... | 0.53630275 | 44 |
Test case code number 006. | def test_code006(self, *test_code_args, **test_code_kwargs):
print("This is test_code006 from TestDefinition #", self.ID, ", test case #", self.test_case_ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_code010(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code010 from TestDefinition #\", self.ID, \", test case #\", self.test_case_ID, sep='')",
"def test_code008(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code008 from TestDefinition #\", self.ID... | [
"0.6523085",
"0.64991325",
"0.63460475",
"0.63168234",
"0.6221022",
"0.6153542",
"0.60899824",
"0.59823734",
"0.5976485",
"0.5955973",
"0.5943083",
"0.59364474",
"0.59303397",
"0.58882",
"0.5874332",
"0.586917",
"0.586421",
"0.58636475",
"0.5840483",
"0.5831648",
"0.5820608",... | 0.6790483 | 0 |
Test case code number 007. | def test_code007(self, *test_code_args, **test_code_kwargs):
print("This is test_code007 from TestDefinition #", self.ID, ", test case #", self.test_case_ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_code008(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code008 from TestDefinition #\", self.ID, \", test case #\", self.test_case_ID, sep='')",
"def test_code010(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code010 from TestDefinition #\", self.ID... | [
"0.66987306",
"0.6648345",
"0.6489203",
"0.6444564",
"0.62110287",
"0.61403537",
"0.6100074",
"0.5993487",
"0.59749377",
"0.5956436",
"0.5951756",
"0.5938374",
"0.5907481",
"0.5898534",
"0.58809346",
"0.5861907",
"0.5861846",
"0.58603644",
"0.5847938",
"0.5837277",
"0.5835848... | 0.66724545 | 1 |
Test case code number 008. | def test_code008(self, *test_code_args, **test_code_kwargs):
print("This is test_code008 from TestDefinition #", self.ID, ", test case #", self.test_case_ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_code010(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code010 from TestDefinition #\", self.ID, \", test case #\", self.test_case_ID, sep='')",
"def test_code009(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code009 from TestDefinition #\", self.ID... | [
"0.66395617",
"0.6468259",
"0.63304436",
"0.63040304",
"0.6262706",
"0.62446046",
"0.61053824",
"0.610493",
"0.60846525",
"0.6029461",
"0.594432",
"0.59217197",
"0.58982056",
"0.58890414",
"0.5867678",
"0.58675474",
"0.5841142",
"0.5817495",
"0.5798157",
"0.5797314",
"0.57347... | 0.70615834 | 0 |
Test case code number 009. | def test_code009(self, *test_code_args, **test_code_kwargs):
print("This is test_code009 from TestDefinition #", self.ID, ", test case #", self.test_case_ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_code010(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code010 from TestDefinition #\", self.ID, \", test case #\", self.test_case_ID, sep='')",
"def test_code008(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code008 from TestDefinition #\", self.ID... | [
"0.6565975",
"0.63169736",
"0.6043896",
"0.6002611",
"0.59514076",
"0.5924085",
"0.59237796",
"0.5869102",
"0.5832442",
"0.5831146",
"0.58268756",
"0.5801319",
"0.5710214",
"0.5684439",
"0.56668776",
"0.56509745",
"0.56207085",
"0.56201535",
"0.561961",
"0.56169426",
"0.56111... | 0.6604769 | 0 |
Test case code number 010. | def test_code010(self, *test_code_args, **test_code_kwargs):
print("This is test_code010 from TestDefinition #", self.ID, ", test case #", self.test_case_ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_code009(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code009 from TestDefinition #\", self.ID, \", test case #\", self.test_case_ID, sep='')",
"def test_code008(self, *test_code_args, **test_code_kwargs):\n print(\"This is test_code008 from TestDefinition #\", self.ID... | [
"0.6681018",
"0.6544875",
"0.6449573",
"0.6427582",
"0.6253291",
"0.6229338",
"0.61912423",
"0.6162741",
"0.60461193",
"0.60454655",
"0.60440755",
"0.6033385",
"0.6002442",
"0.5995288",
"0.5994924",
"0.5955519",
"0.5954421",
"0.5939371",
"0.5928967",
"0.59256786",
"0.59242517... | 0.70530176 | 0 |
Print out all attributes, with an indentation level. | def printout_all(self, indent_level):
indent = " "*indent_level*INDENTATION_MULTIPLIER
print(indent, "\nTest Definition ID:", self.ID, sep='')
print(indent, "|-name:", self.name, sep='')
print(indent, "|-associated test case ID:", self.test_case_ID, sep='')
test_case = get_inde... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_attrs(self):\n for attribute in self.__dict__.keys():\n print(attribute)",
"def print_attribute(attributes):\n for attribute in attributes:\n print ' ',\n change_color_by_tag(attribute)\n if attribute['ExtAttributes']:\n print_extattributes_of_mem... | [
"0.7907038",
"0.7637966",
"0.7155113",
"0.7127499",
"0.699982",
"0.69641304",
"0.6960341",
"0.6898987",
"0.684572",
"0.6805746",
"0.67901194",
"0.67732644",
"0.67293435",
"0.6668916",
"0.6649524",
"0.6606475",
"0.65686685",
"0.65122306",
"0.64923453",
"0.6455977",
"0.64494777... | 0.5804018 | 56 |
Function to initialize test definition data. | def init_test_definitions():
test_definitions = []
# add info to list in memory, one by one, following signature values
test_def_ID = 5
test_def_name = "VM failure impact on virtual firewall (vFW VNF)"
test_def_challengeDefID = 5
test_def_testCaseID = 5
test_def_VNFIDs = [1]
test_def_as... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_setup(self, test_data: list=None):\n print(\"[dataset]: using test setup ...\")\n self.vocabulary = [\"empty\"]\n self.eval_dataset = ABSADataset(data_path=self.dev_path, mode=self.in_mode, task=self.task,\n tokenizer=self.tokenizer, vocab=\"bert... | [
"0.7206878",
"0.69830936",
"0.69170666",
"0.6905432",
"0.68886626",
"0.68886626",
"0.68886626",
"0.68886626",
"0.6804058",
"0.6760746",
"0.67286724",
"0.6666416",
"0.6661453",
"0.66520184",
"0.6634772",
"0.66281074",
"0.6593501",
"0.6591871",
"0.657064",
"0.6567946",
"0.65450... | 0.7271976 | 0 |
Run currently selected challenge code, start portion. Optional parameters can be passed if needed (unnamed or named), interpreted accordingly by selected test code. | def run_start_challenge_code(self, *chall_code_args, **chall_code_kwargs):
try:
code_index = self.challenge_code_ID - 1 # lists are indexed from 0 to N-1
# invoke corresponding start method, via index
self.start_challenge_code_list[code_index](*chall_code_args, **chall_code... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_challenge_code001(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code001 from ChallengeDefinition #\",self.ID, sep='')",
"def start_challenge_code010(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code010 from ChallengeDefi... | [
"0.6356479",
"0.63256943",
"0.6307231",
"0.624422",
"0.6066037",
"0.5959313",
"0.5919837",
"0.5919461",
"0.5795596",
"0.57326335",
"0.57091653",
"0.5697462",
"0.5662525",
"0.5604493",
"0.5604493",
"0.5509749",
"0.5489085",
"0.5474635",
"0.5467004",
"0.54237247",
"0.5407435",
... | 0.66820836 | 0 |
Run currently selected challenge code, stop portion. Optional parameters can be passed if needed (unnamed or named), interpreted accordingly by selected test code. | def run_stop_challenge_code(self, *chall_code_args, **chall_code_kwargs):
try:
code_index = self.challenge_code_ID - 1 # lists are indexed from 0 to N-1
# invoke corresponding stop method, via index
self.stop_challenge_code_list[code_index](*chall_code_args, **chall_code_kwa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_test_code(self, *test_code_args, **test_code_kwargs):\n try:\n # here, trigger start code from challenge def (to simulate VM failure), manage Recovery time measurement,\n # specific monitoring of VNF, trigger stop code from challenge def\n\n time1 = datetime.now() #... | [
"0.66960603",
"0.6296914",
"0.6186369",
"0.61045015",
"0.60794216",
"0.60040975",
"0.5985018",
"0.59766287",
"0.58844936",
"0.5848492",
"0.584254",
"0.581427",
"0.5780125",
"0.5620953",
"0.55936074",
"0.5545952",
"0.5510592",
"0.5510592",
"0.5497748",
"0.54770064",
"0.5461811... | 0.65709126 | 1 |
Start Challenge code number 001. | def start_challenge_code001(self, *chall_code_args, **chall_code_kwargs):
print("This is start_challenge_code001 from ChallengeDefinition #",self.ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_challenge_code010(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code010 from ChallengeDefinition #\",self.ID, sep='')",
"def start_challenge_code009(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code009 from ChallengeDefi... | [
"0.6894425",
"0.67563266",
"0.6553159",
"0.639238",
"0.6259374",
"0.62578154",
"0.6103054",
"0.6056246",
"0.594367",
"0.5615532",
"0.55993485",
"0.5537023",
"0.5364862",
"0.53640056",
"0.5357535",
"0.5343135",
"0.5287774",
"0.524516",
"0.5242702",
"0.5179436",
"0.51720536",
... | 0.69719726 | 0 |
Stop Challenge code number 001. | def stop_challenge_code001(self, *chall_code_args, **chall_code_kwargs):
print("This is stop_challenge_code001 from ChallengeDefinition #",self.ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_challenge_code010(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code010 from ChallengeDefinition #\",self.ID, sep='')",
"def stop_challenge_code009(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code009 from ChallengeDefiniti... | [
"0.75793904",
"0.7471198",
"0.742199",
"0.7307441",
"0.7235597",
"0.71809566",
"0.7176245",
"0.7097188",
"0.6406136",
"0.6249265",
"0.5987562",
"0.5751092",
"0.56848633",
"0.56230175",
"0.5573714",
"0.55355936",
"0.55021286",
"0.5501443",
"0.5487698",
"0.5487698",
"0.5487698"... | 0.753365 | 1 |
Start Challenge code number 002. | def start_challenge_code002(self, *chall_code_args, **chall_code_kwargs):
print("This is start_challenge_code002 from ChallengeDefinition #",self.ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_challenge_code010(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code010 from ChallengeDefinition #\",self.ID, sep='')",
"def start_challenge_code001(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code001 from ChallengeDefi... | [
"0.6679503",
"0.6627237",
"0.652923",
"0.65010434",
"0.6282859",
"0.6205608",
"0.6064734",
"0.5908329",
"0.5576838",
"0.55553484",
"0.5486102",
"0.54477865",
"0.53849363",
"0.53847843",
"0.5319654",
"0.5254681",
"0.52102315",
"0.5167257",
"0.51639915",
"0.51303214",
"0.512043... | 0.6326598 | 4 |
Stop Challenge code number 002. | def stop_challenge_code002(self, *chall_code_args, **chall_code_kwargs):
print("This is stop_challenge_code002 from ChallengeDefinition #",self.ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_challenge_code010(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code010 from ChallengeDefinition #\",self.ID, sep='')",
"def stop_challenge_code008(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code008 from ChallengeDefiniti... | [
"0.7659465",
"0.7563398",
"0.746095",
"0.74526113",
"0.73793006",
"0.7279471",
"0.72096163",
"0.71670836",
"0.6668821",
"0.6116544",
"0.59985876",
"0.5971715",
"0.5966918",
"0.5966918",
"0.5966918",
"0.5966918",
"0.5919477",
"0.5878155",
"0.58719945",
"0.58171654",
"0.5800057... | 0.74613166 | 2 |
Start Challenge code number 003. | def start_challenge_code003(self, *chall_code_args, **chall_code_kwargs):
print("This is start_challenge_code003 from ChallengeDefinition #",self.ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_challenge_code009(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code009 from ChallengeDefinition #\",self.ID, sep='')",
"def start_challenge_code001(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code001 from ChallengeDefi... | [
"0.6734237",
"0.6724748",
"0.6606995",
"0.6605308",
"0.6318428",
"0.6281802",
"0.62515455",
"0.6119058",
"0.5727407",
"0.55563295",
"0.55146164",
"0.5311764",
"0.52792186",
"0.5264981",
"0.5255605",
"0.52215546",
"0.5201562",
"0.51962566",
"0.5196026",
"0.5144939",
"0.5139644... | 0.66241467 | 2 |
Stop Challenge code number 003. | def stop_challenge_code003(self, *chall_code_args, **chall_code_kwargs):
print("This is stop_challenge_code003 from ChallengeDefinition #",self.ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_challenge_code009(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code009 from ChallengeDefinition #\",self.ID, sep='')",
"def stop_challenge_code010(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code010 from ChallengeDefiniti... | [
"0.75077814",
"0.7498181",
"0.7494169",
"0.74157214",
"0.7281761",
"0.7267479",
"0.7252985",
"0.7197899",
"0.6610237",
"0.61040086",
"0.59455055",
"0.589671",
"0.57801723",
"0.5758748",
"0.5758748",
"0.5758748",
"0.5758748",
"0.5758144",
"0.572267",
"0.5587054",
"0.55375636",... | 0.74501896 | 3 |
Start Challenge code number 004. | def start_challenge_code004(self, *chall_code_args, **chall_code_kwargs):
print("This is start_challenge_code004 from ChallengeDefinition #",self.ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_challenge_code009(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code009 from ChallengeDefinition #\",self.ID, sep='')",
"def start_challenge_code001(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code001 from ChallengeDefi... | [
"0.66249907",
"0.66167706",
"0.660856",
"0.6371558",
"0.625915",
"0.61321294",
"0.60450536",
"0.6003993",
"0.597335",
"0.55251557",
"0.55198294",
"0.54818565",
"0.5462468",
"0.54547775",
"0.5364101",
"0.53625154",
"0.52530175",
"0.52228147",
"0.521231",
"0.5203257",
"0.519846... | 0.6677702 | 0 |
Stop Challenge code number 004. | def stop_challenge_code004(self, *chall_code_args, **chall_code_kwargs):
print("This is stop_challenge_code004 from ChallengeDefinition #",self.ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_challenge_code010(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code010 from ChallengeDefinition #\",self.ID, sep='')",
"def stop_challenge_code009(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code009 from ChallengeDefiniti... | [
"0.75250125",
"0.74801797",
"0.74294746",
"0.7384983",
"0.73195195",
"0.7241099",
"0.7205476",
"0.7192013",
"0.6681139",
"0.6135016",
"0.58822006",
"0.5804823",
"0.5710702",
"0.56781924",
"0.56563896",
"0.56563896",
"0.56563896",
"0.56563896",
"0.5545634",
"0.55392265",
"0.55... | 0.75243205 | 1 |
Start Challenge code number 005. | def start_challenge_code005(self, *chall_code_args, **chall_code_kwargs):
print("This is start_challenge_code005 from ChallengeDefinition #",self.ID, sep='')
# challenge #5, related to test case #5, i.e. test def #5
# cloud reference (name and region) should be in clouds.yaml file
# conn... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_challenge_code010(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code010 from ChallengeDefinition #\",self.ID, sep='')",
"def start_challenge_code001(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code001 from ChallengeDefi... | [
"0.636344",
"0.6322525",
"0.6250077",
"0.6177984",
"0.5957717",
"0.58752716",
"0.585645",
"0.5739223",
"0.5661414",
"0.5593473",
"0.5574513",
"0.5550685",
"0.5315099",
"0.53117967",
"0.5292697",
"0.52824104",
"0.52477556",
"0.52052397",
"0.51566",
"0.5146484",
"0.51380706",
... | 0.6165136 | 4 |
Stop Challenge code number 005. | def stop_challenge_code005(self, *chall_code_args, **chall_code_kwargs):
print("This is stop_challenge_code005 from ChallengeDefinition #",self.ID, sep='')
# challenge #5, related to test case #5, i.e. test def #5
# cloud reference (name and region) should be in clouds.yaml file
# conn =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_challenge_code010(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code010 from ChallengeDefinition #\",self.ID, sep='')",
"def stop_challenge_code008(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code008 from ChallengeDefiniti... | [
"0.73459095",
"0.7290437",
"0.71499264",
"0.71441287",
"0.70867497",
"0.7005053",
"0.6975546",
"0.6972961",
"0.6873716",
"0.60021645",
"0.59690833",
"0.5961356",
"0.595256",
"0.56568706",
"0.5570269",
"0.5570269",
"0.5570269",
"0.5570269",
"0.55065763",
"0.5491784",
"0.548756... | 0.7078612 | 5 |
Start Challenge code number 006. | def start_challenge_code006(self, *chall_code_args, **chall_code_kwargs):
print("This is start_challenge_code006 from ChallengeDefinition #",self.ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_challenge_code010(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code010 from ChallengeDefinition #\",self.ID, sep='')",
"def start_challenge_code008(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code008 from ChallengeDefi... | [
"0.65340734",
"0.6488615",
"0.6457808",
"0.6451548",
"0.62803596",
"0.609721",
"0.5928963",
"0.5832645",
"0.58285034",
"0.566085",
"0.55587",
"0.54121333",
"0.5318155",
"0.5305756",
"0.52829593",
"0.5197971",
"0.516507",
"0.516474",
"0.515549",
"0.5136996",
"0.510763",
"0.5... | 0.6653454 | 0 |
Stop Challenge code number 006. | def stop_challenge_code006(self, *chall_code_args, **chall_code_kwargs):
print("This is stop_challenge_code006 from ChallengeDefinition #",self.ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_challenge_code008(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code008 from ChallengeDefinition #\",self.ID, sep='')",
"def stop_challenge_code010(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code010 from ChallengeDefiniti... | [
"0.7457875",
"0.74417275",
"0.7335157",
"0.72823745",
"0.72266304",
"0.7116391",
"0.7089024",
"0.70095134",
"0.672087",
"0.598565",
"0.5982917",
"0.59029466",
"0.58384687",
"0.5725244",
"0.56605136",
"0.56605136",
"0.56605136",
"0.56605136",
"0.5588998",
"0.5563385",
"0.54503... | 0.7494622 | 0 |
Start Challenge code number 007. | def start_challenge_code007(self, *chall_code_args, **chall_code_kwargs):
print("This is start_challenge_code007 from ChallengeDefinition #",self.ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_challenge_code010(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code010 from ChallengeDefinition #\",self.ID, sep='')",
"def start_challenge_code008(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code008 from ChallengeDefi... | [
"0.6821114",
"0.68043447",
"0.6804157",
"0.6665605",
"0.6534664",
"0.6283093",
"0.6279665",
"0.61140895",
"0.60248095",
"0.58063847",
"0.5404702",
"0.53778434",
"0.536187",
"0.53492314",
"0.5340764",
"0.5323991",
"0.5285251",
"0.528188",
"0.5280253",
"0.5278187",
"0.52592504"... | 0.67693794 | 3 |
Stop Challenge code number 007. | def stop_challenge_code007(self, *chall_code_args, **chall_code_kwargs):
print("This is stop_challenge_code007 from ChallengeDefinition #",self.ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_challenge_code008(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code008 from ChallengeDefinition #\",self.ID, sep='')",
"def stop_challenge_code010(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code010 from ChallengeDefiniti... | [
"0.7636299",
"0.7608392",
"0.75365335",
"0.7411315",
"0.7376645",
"0.7234441",
"0.72018474",
"0.7186003",
"0.68174",
"0.60362023",
"0.59404767",
"0.581987",
"0.57942396",
"0.56278896",
"0.56278896",
"0.56278896",
"0.56278896",
"0.5539461",
"0.5510553",
"0.55001646",
"0.548943... | 0.75662583 | 2 |
Start Challenge code number 008. | def start_challenge_code008(self, *chall_code_args, **chall_code_kwargs):
print("This is start_challenge_code008 from ChallengeDefinition #",self.ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_challenge_code010(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code010 from ChallengeDefinition #\",self.ID, sep='')",
"def start_challenge_code009(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code009 from ChallengeDefi... | [
"0.6656827",
"0.6595131",
"0.6548328",
"0.6291659",
"0.6257462",
"0.6218843",
"0.6121715",
"0.59146804",
"0.59141225",
"0.5684973",
"0.55377156",
"0.55277926",
"0.5444801",
"0.5411079",
"0.5370827",
"0.53679067",
"0.5286541",
"0.52723044",
"0.52424043",
"0.52335536",
"0.52281... | 0.6907975 | 0 |
Stop Challenge code number 008. | def stop_challenge_code008(self, *chall_code_args, **chall_code_kwargs):
print("This is stop_challenge_code008 from ChallengeDefinition #",self.ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_challenge_code010(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code010 from ChallengeDefinition #\",self.ID, sep='')",
"def stop_challenge_code009(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code009 from ChallengeDefiniti... | [
"0.754257",
"0.7433333",
"0.73090404",
"0.7306642",
"0.7260581",
"0.7215979",
"0.7146896",
"0.70619434",
"0.6740347",
"0.61863214",
"0.60304695",
"0.59986854",
"0.58392316",
"0.5830099",
"0.5830099",
"0.5830099",
"0.5830099",
"0.5789749",
"0.57684064",
"0.5594122",
"0.5588689... | 0.7724662 | 0 |
Start Challenge code number 009. | def start_challenge_code009(self, *chall_code_args, **chall_code_kwargs):
print("This is start_challenge_code009 from ChallengeDefinition #",self.ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_challenge_code010(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code010 from ChallengeDefinition #\",self.ID, sep='')",
"def start_challenge_code001(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code001 from ChallengeDefi... | [
"0.6648422",
"0.640778",
"0.64032894",
"0.60787034",
"0.59268326",
"0.59111047",
"0.5875077",
"0.5706066",
"0.56907415",
"0.5675535",
"0.55911005",
"0.5429949",
"0.5295225",
"0.5281509",
"0.52547747",
"0.5254549",
"0.5201935",
"0.519219",
"0.5188961",
"0.517877",
"0.5177587",... | 0.6802339 | 0 |
Stop Challenge code number 009. | def stop_challenge_code009(self, *chall_code_args, **chall_code_kwargs):
print("This is stop_challenge_code009 from ChallengeDefinition #",self.ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_challenge_code010(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code010 from ChallengeDefinition #\",self.ID, sep='')",
"def stop_challenge_code008(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code008 from ChallengeDefiniti... | [
"0.749207",
"0.73590344",
"0.7186478",
"0.7128835",
"0.7005895",
"0.7001801",
"0.69926596",
"0.6907655",
"0.6287855",
"0.6134733",
"0.5850997",
"0.582932",
"0.5804916",
"0.57821167",
"0.5730547",
"0.56695604",
"0.5564659",
"0.5564659",
"0.5564659",
"0.5564659",
"0.55636364",
... | 0.75401205 | 0 |
Start Challenge code number 010. | def start_challenge_code010(self, *chall_code_args, **chall_code_kwargs):
print("This is start_challenge_code010 from ChallengeDefinition #",self.ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_challenge_code009(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code009 from ChallengeDefinition #\",self.ID, sep='')",
"def start_challenge_code001(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is start_challenge_code001 from ChallengeDefi... | [
"0.671225",
"0.6593957",
"0.6436121",
"0.62023723",
"0.601001",
"0.60060525",
"0.5793211",
"0.57471645",
"0.566537",
"0.5600813",
"0.5577354",
"0.55703545",
"0.54807603",
"0.5478958",
"0.54334855",
"0.5417967",
"0.5413426",
"0.5368082",
"0.53440857",
"0.5312565",
"0.5241798",... | 0.70041275 | 0 |
Stop Challenge code number 010. | def stop_challenge_code010(self, *chall_code_args, **chall_code_kwargs):
print("This is stop_challenge_code010 from ChallengeDefinition #",self.ID, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop_challenge_code009(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code009 from ChallengeDefinition #\",self.ID, sep='')",
"def stop_challenge_code008(self, *chall_code_args, **chall_code_kwargs):\n print(\"This is stop_challenge_code008 from ChallengeDefiniti... | [
"0.74246866",
"0.73739845",
"0.72364855",
"0.7176849",
"0.7037037",
"0.70282507",
"0.702119",
"0.6923483",
"0.6321979",
"0.6134291",
"0.6054497",
"0.60173416",
"0.60113186",
"0.6009146",
"0.59889483",
"0.59889483",
"0.59889483",
"0.59889483",
"0.5880148",
"0.5830737",
"0.5748... | 0.765452 | 0 |
Print out all attributes, with an indentation level. | def printout_all(self, indent_level):
indent = " "*indent_level*INDENTATION_MULTIPLIER
print(indent, "Challenge Definition ID:", self.ID, sep='')
print(indent, "|-name:", self.name, sep='')
print(indent, "|-challenge type:", self.challenge_type, sep='')
print(indent, "|-challe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_attrs(self):\n for attribute in self.__dict__.keys():\n print(attribute)",
"def print_attribute(attributes):\n for attribute in attributes:\n print ' ',\n change_color_by_tag(attribute)\n if attribute['ExtAttributes']:\n print_extattributes_of_mem... | [
"0.7907038",
"0.7637966",
"0.7155113",
"0.7127499",
"0.699982",
"0.69641304",
"0.6960341",
"0.6898987",
"0.684572",
"0.6805746",
"0.67901194",
"0.67732644",
"0.67293435",
"0.6668916",
"0.6649524",
"0.6606475",
"0.65686685",
"0.65122306",
"0.64923453",
"0.6455977",
"0.64494777... | 0.0 | -1 |
Function to initialize challenge definition data. | def init_challenge_definitions():
challenge_defs = []
# add info to list in memory, one by one, following signature values
chall_def_ID = 5
chall_def_name = "VM failure"
chall_def_challengeType = ChallengeType.CLOUD_COMPUTE_FAILURE
chall_def_recipientID = 1
chall_def_impactedCloudResourcesI... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, data=None):\n self.problems = {}\n if data is not None:\n self.update(data)",
"def _initialize_data(self):\n self.reset_count = 0\n self._idn_no_firmware = \"KEPCO,BOP 50-20,E1234,\"\n self._firmware = 2.6\n self._init_data()",
"def __init... | [
"0.6270538",
"0.61179715",
"0.6039615",
"0.59718883",
"0.59608895",
"0.5943203",
"0.5878078",
"0.5860947",
"0.5855922",
"0.5850166",
"0.58261216",
"0.58040184",
"0.5778829",
"0.5774496",
"0.5738343",
"0.57342714",
"0.5699423",
"0.56817144",
"0.5681485",
"0.5676142",
"0.565423... | 0.70936805 | 0 |
Print out all attributes, with an indentation level. | def printout_all(self, indent_level):
indent = " "*indent_level*INDENTATION_MULTIPLIER
print(indent, "Recipient ID:", self.ID, sep='')
print(indent, "|-name:", self.name, sep='')
print(indent, "|-version info:", self.version_info, sep='')
print(indent, "|-IP address:", self.acc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_attrs(self):\n for attribute in self.__dict__.keys():\n print(attribute)",
"def print_attribute(attributes):\n for attribute in attributes:\n print ' ',\n change_color_by_tag(attribute)\n if attribute['ExtAttributes']:\n print_extattributes_of_mem... | [
"0.79098475",
"0.76404846",
"0.71579635",
"0.7130595",
"0.7002356",
"0.6967273",
"0.6959917",
"0.68992954",
"0.6844863",
"0.6809012",
"0.6792403",
"0.6774788",
"0.6733136",
"0.6671675",
"0.6648593",
"0.6605866",
"0.651564",
"0.649377",
"0.64581263",
"0.64466727",
"0.6421849",... | 0.6567369 | 16 |
Function to initialize recipient data. | def init_recipients():
test_recipients = []
# add info to list in memory, one by one, following signature values
recipient_ID = 1
recipient_name = "OpenStack on Arm pod"
recipient_info = "controller resolves to one of the CTL VMs"
recipient_versionInfo = ""
recipient_accessIPAddress = "172.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, fromaddr, toaddrs, subject='', body='',\n smtphost='localhost'):\n\n if isinstance(toaddrs, StringType):\n self.toaddrs = [x.strip() for x in toaddrs.split(',') if x]\n else:\n self.toaddrs = toaddrs\n \n self.fromaddr = froma... | [
"0.6428627",
"0.64235",
"0.62196666",
"0.6182053",
"0.61726594",
"0.6099804",
"0.5981679",
"0.59092396",
"0.5873928",
"0.5860588",
"0.58200073",
"0.5800448",
"0.58002824",
"0.57671815",
"0.57571095",
"0.5746232",
"0.5722598",
"0.5720659",
"0.57187426",
"0.5717267",
"0.5710726... | 0.6166087 | 5 |
Print out all attributes, with an indentation level. | def printout_all(self, indent_level):
indent = " "*indent_level*INDENTATION_MULTIPLIER
print(indent, "Metric Definition ID:", self.ID, sep='')
print(indent, "|-name:", self.name, sep='')
print(indent, "|-info:", self.info, sep='') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_attrs(self):\n for attribute in self.__dict__.keys():\n print(attribute)",
"def print_attribute(attributes):\n for attribute in attributes:\n print ' ',\n change_color_by_tag(attribute)\n if attribute['ExtAttributes']:\n print_extattributes_of_mem... | [
"0.7907038",
"0.7637966",
"0.7155113",
"0.7127499",
"0.699982",
"0.69641304",
"0.6960341",
"0.684572",
"0.6805746",
"0.67901194",
"0.67732644",
"0.67293435",
"0.6668916",
"0.6649524",
"0.6606475",
"0.65686685",
"0.65122306",
"0.64923453",
"0.6455977",
"0.64494777",
"0.6420724... | 0.6898987 | 7 |
Function to initialize metric definition data. | def init_metric_definitions():
metric_definitions = []
# add info to list in memory, one by one, following signature values
metric_def_ID = 1
metric_def_name = "Recovery Time"
metric_def_info = "Measures time taken by ONAP to restore a VNF"
metric_definitions.append(RecoveryTimeDef(metric_def_I... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_metrics():\n metrics = {\n 'cd_losses': [],\n 'cd_corrects': [],\n 'cd_precisions': [],\n 'cd_recalls': [],\n 'cd_f1scores': [],\n }\n\n return metrics",
"def initialize(self, runInfo, inputs, initDict) :\n super().initialize(runInfo, inputs, initDict... | [
"0.7117321",
"0.69168526",
"0.6888356",
"0.66131765",
"0.6559224",
"0.653191",
"0.65315676",
"0.64484173",
"0.6444055",
"0.64089125",
"0.6371227",
"0.63554186",
"0.6349524",
"0.631591",
"0.6296783",
"0.62531286",
"0.6162134",
"0.6160958",
"0.61490244",
"0.612974",
"0.6121506"... | 0.70609146 | 1 |
Print out all attributes, with an indentation level. | def printout_all(self, indent_level):
indent = " "*indent_level*INDENTATION_MULTIPLIER
print(indent, "Physical Resource ID:", self.ID, sep='')
print(indent, "|-name:", self.name, sep='')
print(indent, "|-info:", self.info, sep='')
print(indent, "|-IP address:", self.IP_address,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_attrs(self):\n for attribute in self.__dict__.keys():\n print(attribute)",
"def print_attribute(attributes):\n for attribute in attributes:\n print ' ',\n change_color_by_tag(attribute)\n if attribute['ExtAttributes']:\n print_extattributes_of_mem... | [
"0.79098475",
"0.76404846",
"0.71579635",
"0.7130595",
"0.7002356",
"0.6967273",
"0.68992954",
"0.6844863",
"0.6809012",
"0.6792403",
"0.6774788",
"0.6733136",
"0.6671675",
"0.6648593",
"0.6605866",
"0.6567369",
"0.651564",
"0.649377",
"0.64581263",
"0.64466727",
"0.6421849",... | 0.6959917 | 6 |
Function to initialize physical resource data. | def init_physical_resources():
test_physical_resources = []
# add info to list in memory, one by one, following signature values
phys_resrc_ID = 1
phys_resrc_name = "small-cavium-1"
phys_resrc_info = "Jump server in Arm pod, 48 cores, 64G RAM, 447G SSD, aarch64 Cavium ThunderX, Ubuntu OS"
phys_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _initialize_data(self):\n self.reset_count = 0\n self._idn_no_firmware = \"KEPCO,BOP 50-20,E1234,\"\n self._firmware = 2.6\n self._init_data()",
"def set_resource_data(self, resource, meta):\n super().set_resource_data(resource, meta)\n self._set_resource_temperature... | [
"0.67553765",
"0.6618656",
"0.66008776",
"0.654145",
"0.65205157",
"0.65172935",
"0.6508107",
"0.6412315",
"0.6384554",
"0.6343454",
"0.62426376",
"0.62185234",
"0.62047946",
"0.6136138",
"0.61295336",
"0.6123724",
"0.6123724",
"0.6123724",
"0.6123724",
"0.6063587",
"0.605764... | 0.6915017 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.