query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
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
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
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
/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
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
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 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 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
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 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 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 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
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
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
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
Function to initialize cloud virtual resource data.
def init_cloud_virtual_resources(): test_cldvirt_resources = [] # add info to list in memory, one by one, following signature values cldvirtres_ID = 1 cldvirtres_name = "nova-compute-1" cldvirtres_info = "nova VM in Arm pod" cldvirtres_IPAddress = "50.60.70.80" cldvirtres_URL = "http://50.6...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__,\n resource_name: str,\n args: VirtualHardDiskArgs,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...", "def pre_virtual_machine_create(self, resource_dict):\n pass", "def __init__(__self__,\n resource_nam...
[ "0.65209603", "0.64640987", "0.63841754", "0.63472927", "0.63000673", "0.62648845", "0.625409", "0.62490654", "0.62399304", "0.6233856", "0.62064767", "0.61925113", "0.61889744", "0.61788136", "0.6159353", "0.6158444", "0.61480516", "0.6146311", "0.6145305", "0.6139789", "0.6...
0.7303633
0
Function to initialize VNFs and e2e Services data.
def init_VNFs_Services(): test_VNFs_Services = [] # add info to list in memory, one by one, following signature values vnf_serv_ID = 1 vnf_serv_name = "vCPE-1" vnf_serv_info = "virtual CPE in Arm pod" vnf_serv_IPAddress = "5.4.3.2" vnf_serv_URL = "http://5.4.3.2:8080" vnf_serv_related_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(self):\n self.initialize_edges()\n self.initialize_prob()\n self.initialize_total_input_dict()\n\n self.initialize_fpmusigv_dict()", "def _initialize_data(self):\n self.reset_count = 0\n self._idn_no_firmware = \"KEPCO,BOP 50-20,E1234,\"\n self._fir...
[ "0.6000072", "0.5982209", "0.59133905", "0.58482045", "0.5846955", "0.5802692", "0.57983714", "0.57908916", "0.57861805", "0.57234365", "0.5716901", "0.57001555", "0.56514275", "0.5569302", "0.553498", "0.5508897", "0.5441034", "0.54278976", "0.5421931", "0.5419489", "0.54168...
0.6732011
0
Append an object to a list of strings and adds a timestamp.
def append_to_list(self, string_to_append): if type(string_to_append)==str: current_time = datetime.now() self.__string_list.append(string_to_append) self.__timestamp_list.append(current_time) # timestamp will have the same index as string else: print("ap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, timestamp):\n self.total_count += 1\n self.times.append(timestamp)", "def append(self, object):\r\n raise NotImplementedError()", "def append(self, obj):\r\n raise NotImplementedError", "def append(self, ts: Union[str, datetime.datetime, None], attribute: Any, raise_...
[ "0.63131636", "0.60031503", "0.5990919", "0.5893538", "0.58589745", "0.58204615", "0.5716781", "0.56838316", "0.5644069", "0.56173307", "0.56059915", "0.5589093", "0.5588692", "0.55833554", "0.55797154", "0.5551652", "0.55227566", "0.55158985", "0.5504161", "0.5495428", "0.54...
0.78029543
0
return a list of strings with timestamps as prefixes (not showing microseconds).
def get_timestamped_strings(self): ret_list = [] i = 0 while i < len(self.__string_list): ret_list.append(self.__timestamp_list[i].strftime("%Y-%m-%d %H:%M:%S")+" "+self.__string_list[i]) i += 1 return ret_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time_strs(self):\n\n log(\"Getting time strings starting at {}\".format(self._t0))\n tz = dt.timezone.utc\n mkdt = lambda n: dt.datetime.fromtimestamp(\n self._t0 - (self._delta * n),\n tz=tz\n )\n ns = range(self._frames, 0, -1)\n return [mkd...
[ "0.7256951", "0.6693242", "0.6453684", "0.6298663", "0.62940955", "0.61848104", "0.6147845", "0.6098919", "0.6096851", "0.6066497", "0.6043481", "0.603737", "0.59519106", "0.58646226", "0.5857015", "0.58160734", "0.5814002", "0.5814002", "0.5812247", "0.5737909", "0.57244587"...
0.78146636
0
Generic function to dump all Challenge Execution data in a CSV file.
def write_to_csv(self): dump_list = [] # add rows one by one, each as a list, even if only 1 element dump_list.append(["challenge execution ID",self.ID]) dump_list.append(["challenge execution name",self.name]) dump_list.append(["challenge definition ID",self.challenge_def_ID...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_to_csv(self):\n\n dump_list = []\n\n # add rows one by one, each as a list, even if only 1 element\n\n dump_list.append([\"test execution ID\",self.ID])\n dump_list.append([\"test execution name\",self.name])\n\n dump_list.append([\"test definition ID\",self.test_def_ID...
[ "0.67913586", "0.6477758", "0.6425062", "0.62495226", "0.6236619", "0.6227798", "0.6211598", "0.61715055", "0.6133314", "0.61221945", "0.6114023", "0.6110165", "0.60603863", "0.6050782", "0.6025989", "0.5951282", "0.5934519", "0.5933892", "0.59329176", "0.59259146", "0.591796...
0.75044805
0
Append a metric value (MetricValue) to the list. MetricValue already has a timestamp attribute.
def append_to_list(self, metric_value_to_append): if type(metric_value_to_append)==MetricValue: self.__metric_value_list.append(metric_value_to_append) else: print("appended object must be a MetricValue, metric_value_to_append=",metric_value_to_append) sys.exit() # s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append(self, value):\n self.values.append(value)\n return value", "def log(self, metric_name: str, value: float) -> None:\n if metric_name in self.metrics:\n self.metrics[metric_name].append(value)\n else:\n self.metrics[metric_name] = [value]", "def append...
[ "0.6807644", "0.67213684", "0.6580341", "0.65766835", "0.6570106", "0.6512985", "0.6349774", "0.62712246", "0.62586963", "0.6248036", "0.6227115", "0.62080497", "0.6151301", "0.6121657", "0.6113878", "0.60947984", "0.6074452", "0.60592484", "0.6024408", "0.6023302", "0.600047...
0.7759538
0
Return a list of strings with metric values and timestamps as prefixes (not showing microseconds). Also show the metric def ID in parentheses.
def get_timestamped_metric_values_as_strings(self): ret_list = [] i = 0 while i < len(self.__metric_value_list): ret_list.append(self.__metric_value_list[i].timestamp.strftime("%Y-%m-%d %H:%M:%S") + " " + str(self.__metric_value_list[i].value) + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_metric_list(self) -> List[str]:\n ...", "def get_metric(ms):\n\treturn '['+','.join(str(m) for m in ms)+']'", "def __str__(self):\n columns = list(self.metrics.keys())\n columns.sort()\n out = '%s\\n' % ','.join(columns)\n values = [str(self.metrics[c]) for c in columns]\n out += ...
[ "0.7170015", "0.7163434", "0.614878", "0.598899", "0.5964182", "0.5915469", "0.5894196", "0.5894196", "0.5894196", "0.58587414", "0.58564055", "0.5797499", "0.5731772", "0.5715355", "0.57042557", "0.56763", "0.5675049", "0.56671524", "0.565569", "0.5654457", "0.5632019", "0...
0.73370224
0
Generic function to dump all Test Execution data in a CSV file.
def write_to_csv(self): dump_list = [] # add rows one by one, each as a list, even if only 1 element dump_list.append(["test execution ID",self.ID]) dump_list.append(["test execution name",self.name]) dump_list.append(["test definition ID",self.test_def_ID]) test_def_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Dump():\n with open(path.join(MAIN_PATH, INST), \"wb\") as f:\n writer = csv.writer(f, delimiter=\",\")\n\n for inst in instances:\n writer.writerow(inst)\n \n with open(path.join(MAIN_PATH, \"test_instances.csv\"), \"wb\") as f:\n writer = csv.writer(f, delimit...
[ "0.67293197", "0.6513849", "0.6487891", "0.633611", "0.62388986", "0.6189851", "0.61873883", "0.6097543", "0.608892", "0.6053703", "0.60277325", "0.5961769", "0.5952618", "0.5923491", "0.59027004", "0.588059", "0.58773726", "0.5876296", "0.5853088", "0.583685", "0.5753217", ...
0.7351433
0
Save the codes and configuration file. During the training, we may modify the codes. It will be problematic when we try to extract embeddings using the old model and the new code. So we save the codes when we train the model and use the saved codes to extract embeddings.
def save_codes_and_config(cont, model, config): if cont: # If we want to continue the model training, we need to check the existence of the checkpoint. if not os.path.isdir(os.path.join(model, "nnet")) or not os.path.isdir(os.path.join(model, "codes")): sys.exit("To continue training the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def saveOutput(self,code):\r\n\t\tCodeSaver().save(code,self.savePath)", "def save_model(self):\n filename=self.name + '_words'\n file_write(filename, self.words)\n\n filename2=self.name+'_word_lengths'\n file_write(filename2, self.word_lengths)\n\n filename3=self.name+'_stems'...
[ "0.66678596", "0.65298474", "0.65280056", "0.65230376", "0.65037274", "0.64659584", "0.6451233", "0.6426465", "0.6415432", "0.63984126", "0.6397235", "0.6397206", "0.6392341", "0.63780564", "0.63757557", "0.6353628", "0.63431454", "0.62933993", "0.627987", "0.6270623", "0.625...
0.7381167
0
Get the pretrained model and copy to the target model as the initial version.
def get_pretrain_model(pretrain_model, target_model, checkpoint='-1'): if not os.path.isfile(os.path.join(pretrain_model, "checkpoint")): sys.exit("[ERROR] Cannot find checkpoint in %s." % pretrain_model) ckpt = tf.train.get_checkpoint_state(pretrain_model) model_checkpoint_path = ckpt.model_checkp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pretrained_model(destination):\n url = \"https://storage.googleapis.com/download.magenta.tensorflow.org/models/ \\\n arbitrary_style_transfer.tar.gz\"\n\n os.system(\"curl -o arbitrary_style_transfer.tar.gz {0}\".format(url))\n with tarfile.open(\"arbitrary_style_transfer.tar.gz\") as ta...
[ "0.6822754", "0.6722586", "0.6549904", "0.6507627", "0.6432653", "0.64292246", "0.6409875", "0.6334059", "0.6267043", "0.6259309", "0.6258022", "0.6249631", "0.6218196", "0.6192777", "0.618744", "0.6157598", "0.6148145", "0.6140525", "0.61373776", "0.6136138", "0.6130443", ...
0.69689536
0
Load learning rate from a saved file
def load_lr(filename): learning_rate_array = [] with open(filename, "r") as f: for line in f.readlines(): _, lr = line.strip().split(" ") learning_rate_array.append(float(lr)) return learning_rate_array
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(self, filename):\n param_dict = pickle.load(open('%s' % filename, 'rb'))\n self.learningrate = param_dict['learningrate']\n self.verbose = param_dict['verbose']\n self._loadsize = param_dict['loadsize']\n self._batchsize = param_dict['batchsize']\n self.momentum =...
[ "0.67811286", "0.6583575", "0.6550467", "0.6278531", "0.62552196", "0.619063", "0.61676574", "0.6159735", "0.61502033", "0.614148", "0.61373883", "0.61225915", "0.61004525", "0.6077979", "0.605477", "0.59805137", "0.59794164", "0.5961897", "0.5954225", "0.5944981", "0.5944981...
0.71505105
0
Load valid loss from a saved file
def load_valid_loss(filename): min_loss = ValidLoss() with open(filename, "r") as f: for line in f.readlines(): epoch, loss = line.strip().split(" ")[:2] epoch = int(epoch) loss = float(loss) if loss < min_loss.min_loss: min_loss.min_loss =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_checkpoint(self, file):\n \"\"\"Load \"\"\"\n chkpnt = torch.load(file)\n self.load_state_dict(chkpnt['model_state_dict'])", "def load_network(self, sess, filename):\n dir_path = os.path.dirname(os.path.realpath(__file__))\n dir_path += '/Models/'\n dir_path += ...
[ "0.6473382", "0.63657707", "0.61991316", "0.6178769", "0.6170918", "0.59643334", "0.5960667", "0.5960353", "0.5944361", "0.59310794", "0.5908972", "0.5874426", "0.58355534", "0.5824624", "0.5812557", "0.5805543", "0.580154", "0.57972693", "0.5791554", "0.57738537", "0.5772561...
0.75367886
0
Compute pairwise EER using cosine similarity. The EER is estimated by interp1d and brentq, so it is not the exact value and may be a little different each time.
def compute_cos_pairwise_eer(embeddings, labels, max_num_embeddings=1000): embeddings /= np.sqrt(np.sum(embeddings ** 2, axis=1, keepdims=True) + 1e-12) num_embeddings = embeddings.shape[0] if num_embeddings > max_num_embeddings: # Downsample the embeddings and labels step = num_embeddings /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_EER(self, FAR, FRR):\r\n print('Computing EER')\r\n distance = abs(FAR - FRR)\r\n min_distance = min(distance)\r\n idx = np.where(distance == min_distance)\r\n return np.mean((FAR[idx] + FRR[idx]) / 2)", "def similarity(self, e1, e2):\n\t\tpass", "def E(q, r0, x, ...
[ "0.61746013", "0.58410585", "0.56296", "0.55749977", "0.55027765", "0.545726", "0.5402459", "0.5398751", "0.5388317", "0.5339811", "0.533653", "0.5312333", "0.5311478", "0.52783436", "0.5232789", "0.522407", "0.52214503", "0.52191997", "0.5212163", "0.52099633", "0.52089626",...
0.5987465
1
Check whether part of the string s appears in the list.
def substring_in_list(s, varlist): if varlist is None: return False is_sub = False for v in varlist: if v in s: is_sub = True break return is_sub
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_string(s, strings):\n for string in strings:\n if string not in s:\n return False\n return True", "def check(s,l):\n if len(s)==1:\n if s[0] in l:\n return False\n else:\n return True\n else:\n if s[0] in l:\n return Fa...
[ "0.72143257", "0.71113634", "0.7025717", "0.6971482", "0.6968255", "0.6905735", "0.6830441", "0.68250275", "0.6770632", "0.6740407", "0.67399365", "0.66369486", "0.6623817", "0.65804917", "0.657662", "0.6519753", "0.64646107", "0.6462173", "0.6444658", "0.6384393", "0.6381318...
0.72698176
0
Create a summary for activations given the endpoints.
def activation_summaries(endpoints): sum = [] with tf.name_scope('summaries'): for act in endpoints.values(): tensor_name = act.op.name sum.append(tf.summary.histogram(tensor_name + '/activations', act)) # sum.append(tf.summary.scalar(tensor_name + '/sparsity', tf.nn....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _activation_summary(x):\n tensor_name = re.sub('%s_[0-9]*/' % TOWER_NAME, '', x.op.name)\n tf.summary.histogram(tensor_name + '/activations', x)\n tf.summary.scalar(tensor_name + '/sparsity', tf.nn.zero_fraction(x))", "def _activation_summary(x):\n # Remove 'tower_[0-9]/' from the name in case th...
[ "0.59474593", "0.5940539", "0.59343994", "0.59330446", "0.5931891", "0.59268993", "0.5921793", "0.59189427", "0.58822054", "0.56461763", "0.5312166", "0.5241216", "0.51119596", "0.51063263", "0.50800484", "0.50588953", "0.50553143", "0.5045727", "0.5015067", "0.501194", "0.49...
0.7658504
0
Executes SSM document for given document name and input parameters.
def execute(self, document_name, input_params): if self._document_exists(document_name): self.logger.info("Executing SSM document [%s] with parameters: [%s]", document_name, input_params) # Executing SSM document execution_id = self.ssm_client.start_automation_execution( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def runQuery(cred, structuredQuery):\n url = cred.base_url + \"documents:runQuery\"\n\n makeRequest(cred, url, 'POST', structuredQuery)", "def _send_command_to_nodes(self, document_name, parameters, node_ids):\n logger.debug(\"Sending SSM command to {} node(s). Document name: {}. \"\n ...
[ "0.5480394", "0.5434591", "0.5376649", "0.52243423", "0.5214718", "0.52023363", "0.5189893", "0.5051979", "0.5050216", "0.49367806", "0.49262178", "0.49162", "0.4915455", "0.48682842", "0.48337287", "0.4806876", "0.48034984", "0.47985923", "0.47829112", "0.47478285", "0.47474...
0.8131812
0
Returns SSM document final execution status, if status is in PROGRESS/PENDING it will wait till SSM document execution will be completed.
def wait_for_execution_completion(self, execution_id, document_name=None): # Fetch ssm execution status status = self._get_execution_status(execution_id, document_name) # Wait for execution to be completed while status == 'InProgress' or status == 'Pending' or status == 'Cancelling' or ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_execution_status(self, execution_id, document_name=None):\n execution = self.ssm_client.get_automation_execution(\n AutomationExecutionId=execution_id\n )\n # TODO(semiond): we can remove document name as parameter, can take it by execution id.\n document_name = docu...
[ "0.68110305", "0.6518064", "0.65054107", "0.6139724", "0.6080517", "0.6051617", "0.59565747", "0.59161776", "0.58984363", "0.586592", "0.5834591", "0.58224225", "0.57734585", "0.57674146", "0.5753716", "0.5740925", "0.5731959", "0.57306814", "0.57306814", "0.5700119", "0.5700...
0.6551534
1
Returns SSM document step output for given execution id, step name and output key.
def get_step_output(self, execution_id, step_name, output_key): execution = self.ssm_client.get_automation_execution( AutomationExecutionId=execution_id ) step_executions = execution['AutomationExecution']['StepExecutions'] step = self._get_step_by_name(step_executions, step_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_step_output_uri(self, step):\n # parse in reverse order, in case there are multiple -output args\n args = step.args()\n for i, arg in reversed(list(enumerate(args[:-1]))):\n if arg == '-output':\n return args[i + 1]\n else:\n return None", ...
[ "0.59275943", "0.5889858", "0.58484614", "0.57326436", "0.56344503", "0.55983704", "0.55777663", "0.5569992", "0.5539353", "0.5533122", "0.54646003", "0.54497415", "0.5416543", "0.5371535", "0.53153986", "0.5273433", "0.52668524", "0.522895", "0.5222754", "0.5222012", "0.5202...
0.79215145
0
Cancels SSM document execution in waits till 'TriggerRollback' step triggered SSM execution is completed.
def cancel_execution_with_rollback(self, execution_id: str): execution_url = self.get_execution_url(execution_id) try: self.logger.info("Canceling SSM execution: {}".format(execution_url)) self.ssm_client.stop_automation_execution(AutomationExecutionId=execution_id, Type='Cancel'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cancel(self):\n self.session.rollback()", "def rollback(self) -> None:\n with self.lock:\n self.wait(self._rollback_gen())", "def test_cancel(self) -> None:\n context: Dict[str,ArtifactDescriptor] = dict()\n cmd = pycell.python_cell(\n source='import time\\...
[ "0.60639095", "0.5988455", "0.581982", "0.5772934", "0.5643513", "0.56363535", "0.56363535", "0.56363535", "0.56363535", "0.5620277", "0.56076694", "0.5583796", "0.55767006", "0.5570505", "0.55680966", "0.5564965", "0.5541141", "0.5533509", "0.55272144", "0.54791105", "0.5477...
0.62550855
0
Returns SSM document execution status for given execution id.
def _get_execution_status(self, execution_id, document_name=None): execution = self.ssm_client.get_automation_execution( AutomationExecutionId=execution_id ) # TODO(semiond): we can remove document name as parameter, can take it by execution id. document_name = document_name ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait_for_execution_completion(self, execution_id, document_name=None):\n # Fetch ssm execution status\n status = self._get_execution_status(execution_id, document_name)\n\n # Wait for execution to be completed\n while status == 'InProgress' or status == 'Pending' or status == 'Cance...
[ "0.6311759", "0.62737817", "0.624106", "0.6151789", "0.61108553", "0.6006403", "0.59510785", "0.5879625", "0.585945", "0.56999177", "0.56882", "0.5642697", "0.5611689", "0.5606932", "0.55757666", "0.5573651", "0.5539164", "0.5529198", "0.5528047", "0.5503078", "0.5492322", ...
0.7906296
0
Returns execution step status for given execution id and step name.
def _get_execution_step_status(self, execution_id, step_name): execution = self.ssm_client.get_automation_execution( AutomationExecutionId=execution_id ) step_executions = execution['AutomationExecution']['StepExecutions'] step = self._get_step_by_name(step_executions, step_n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_successfully_executed_steps_by_order(self, execution_id):\n execution = self.ssm_client.get_automation_execution(\n AutomationExecutionId=execution_id\n )\n step_executions = execution['AutomationExecution']['StepExecutions']\n step_names: List = []\n if step_e...
[ "0.6936771", "0.6909824", "0.6842648", "0.6689437", "0.65554833", "0.6498717", "0.6436358", "0.63689363", "0.62805057", "0.6166205", "0.61314565", "0.5980744", "0.5944853", "0.58768517", "0.5850708", "0.58459425", "0.5805325", "0.57995373", "0.5733456", "0.5710865", "0.569416...
0.85641456
0
Returns successfully executed steps by order of their execution
def get_successfully_executed_steps_by_order(self, execution_id): execution = self.ssm_client.get_automation_execution( AutomationExecutionId=execution_id ) step_executions = execution['AutomationExecution']['StepExecutions'] step_names: List = [] if step_executions: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSteps():", "def test_by_order(self):\n # addon_executor = AddonExecutor(execute_order, stop_order)\n # self.assertEqual(expected, addon_executor.execute_with_order(addon, execute_order, stop_order))\n self.run_mgr.by_order(self.cli_inst, ['execute', 'start'], ['stop'])\n output...
[ "0.6670046", "0.6322163", "0.6297291", "0.6226086", "0.619969", "0.6090397", "0.6030043", "0.6016758", "0.6015137", "0.59943765", "0.5981895", "0.5952482", "0.5910737", "0.5910737", "0.5741957", "0.57394445", "0.57195204", "0.5695635", "0.5670944", "0.5652498", "0.56230104", ...
0.6954507
0
Returns SSM document step by given status.
def _get_step_by_status(self, steps, status): if steps: for s in steps: if s['StepStatus'] == status: return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_step_with_status(status, steps):\n for step in steps:\n assert isinstance(step, model.Step), \"TYPE-MISMATCH: \"+\\\n \"step.class={0}\".format(step.__class__.__name__)\n if step.status == status:\n return step\n # -- OTHERWISE: No step with the give...
[ "0.6839485", "0.6071293", "0.55562955", "0.5460878", "0.53241044", "0.5310991", "0.53065586", "0.52873224", "0.5144956", "0.5040669", "0.503265", "0.503265", "0.5010804", "0.49962842", "0.49321508", "0.48371494", "0.4831955", "0.4813281", "0.48044667", "0.47959918", "0.479289...
0.7587236
0
Returns SSM document step by a given name.
def _get_step_by_name(self, steps, step_name): if steps: for s in steps: if s['StepName'] == step_name: return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_step_by_name(self, name):\n self._validate_step_name(name)\n name = str(name)\n try:\n return self.all_upstream_steps[name]\n except KeyError as e:\n msg = 'No Step with name \"{}\" found. ' \\\n 'You have following Steps: {}'.format(name, ...
[ "0.69454134", "0.6490663", "0.61872965", "0.6077294", "0.6018053", "0.58520585", "0.57159656", "0.5648309", "0.5618685", "0.5614397", "0.5590065", "0.54544705", "0.5426001", "0.54098606", "0.5397997", "0.5348861", "0.53418255", "0.5339116", "0.5339116", "0.53089184", "0.52940...
0.7589914
0
Returns True if SSM document for given name exist, False otherwise.
def _document_exists(self, document_name): return len(self.ssm_client.list_document_versions(Name=document_name)['DocumentVersions']) >= 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def object_exists(self, name: str):\n file_path = self.__get_file_path(name)\n return os.path.exists(file_path)", "def exists(self) -> bool:\n doc_ref = self.doc_ref\n if isinstance(doc_ref, DocumentReference):\n return doc_ref.get().exists\n return False", "def do...
[ "0.6926537", "0.67250514", "0.6712991", "0.67112947", "0.6679739", "0.6626868", "0.6602372", "0.65388644", "0.6513464", "0.65095633", "0.650585", "0.649972", "0.64888805", "0.6445123", "0.64327896", "0.6388695", "0.6188683", "0.61496204", "0.61428565", "0.6134926", "0.6089026...
0.7727576
0
Return ssm document execution step URL.
def get_execution_step_url(self, execution_id: str, step_name: str, steps: [] = None) -> str: if not steps or len(steps) < 1: execution = self.ssm_client.get_automation_execution(AutomationExecutionId=execution_id) steps = execution['AutomationExecution']['StepExecutions'] step ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invoke_url(self) -> pulumi.Output[str]:\n return self.stage.invoke_url # type: ignore[no-any-return]", "def get_redirect_url(self, *args, **kwargs):\n return self.document.file.url", "def runbook_url(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"runbook_url\")", ...
[ "0.6653019", "0.6429969", "0.6305271", "0.6265999", "0.6141591", "0.60876673", "0.60876673", "0.60759395", "0.6074171", "0.597044", "0.5946428", "0.5923328", "0.5830999", "0.5830999", "0.5830999", "0.5830999", "0.5830999", "0.5830999", "0.5830999", "0.5813061", "0.5805103", ...
0.6712275
0
Returns SSM document step execution sequence index
def _get_step_execution_index(self, step_executions: [], step_name): index = 1 for step_execution in step_executions: if step_name == step_execution['StepName']: return index index += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sequence_index(self):\n\t\treturn call_sdk_function('PrlBootDev_GetSequenceIndex', self.handle)", "def step_index(self, step):\n return self.steps.index(step)", "def get_step_idx(self, step_id: str) -> int:\n return self.step_id2idx.get(step_id, None)", "def step_id(self) -> pulumi.Outp...
[ "0.68235666", "0.6603684", "0.6303389", "0.63007843", "0.627349", "0.61597484", "0.6039806", "0.60359675", "0.60088104", "0.59596723", "0.595375", "0.5940087", "0.5922751", "0.59192324", "0.5902262", "0.5867469", "0.5863946", "0.58638436", "0.58619946", "0.58510906", "0.58207...
0.7016882
0
Eviction filings broken down into a weekbyweek basis
def weekly(evictiondata): evictions_per_week = {} for index, row in evictiondata.iterrows(): if row['week_date'] not in evictions_per_week.keys(): evictions_per_week[row['week_date']] = row['filings_2020'] else: evictions_per_week[row['week_date']] += row['filings_2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weekly():", "def weekly():\n\n response = {}\n\n # 0..6 => Sunday..Saturday\n for i in range(7):\n hours = []\n interactions = 0\n\n for j in range(25):\n try:\n wfile = open(common.stats_path + '/weekly-average/' + str(i) + '/' + str(j))\n ...
[ "0.7323955", "0.62316436", "0.6126304", "0.6112387", "0.6050204", "0.6010439", "0.5954555", "0.59421486", "0.5924618", "0.59082824", "0.5864308", "0.5844851", "0.5800671", "0.57960045", "0.57312167", "0.5713384", "0.5708791", "0.568154", "0.5680631", "0.56350195", "0.56308794...
0.7517364
0
Visualizes the week by week eviction data into a graph
def graphify(evictions_per_week): weeks = [] for week in evictions_per_week.keys(): if '2020' in week: weeks.append(week) evictions_filed = [] for week in weeks: evictions_filed.append(evictions_per_week[week]) plt.figure(figsize=(50, 10)) plt.plot(weeks, evi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def graph_baseline(evictiondata, weeks):\r\n base_evictions_per_week = {}\r\n for index, row in evictiondata.iterrows():\r\n if row['week_date'] not in base_evictions_per_week.keys():\r\n base_evictions_per_week[row['week_date']] = row['filings_avg']\r\n elif row['GEOID'] != 'sealed'...
[ "0.7287062", "0.7240408", "0.7095925", "0.67528796", "0.6648603", "0.6480761", "0.62646145", "0.62237006", "0.6187958", "0.6187809", "0.613508", "0.60985005", "0.60869294", "0.6011801", "0.59913427", "0.59690994", "0.59242606", "0.59085816", "0.5906574", "0.5892883", "0.58743...
0.81232464
0
Graphs the baseline eviction data of 20152016 in the same format
def graph_baseline(evictiondata, weeks): base_evictions_per_week = {} for index, row in evictiondata.iterrows(): if row['week_date'] not in base_evictions_per_week.keys(): base_evictions_per_week[row['week_date']] = row['filings_avg'] elif row['GEOID'] != 'sealed': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cross_analyze(evictions_filed, base_evictions_filed, weeks):\r\n plt.figure(figsize=(50, 10))\r\n plt.plot(weeks, evictions_filed, label = '2020')\r\n plt.plot(weeks, base_evictions_filed, label = '2015-2016')\r\n plt.xlabel('Date', fontsize = 25)\r\n plt.ylabel('Evictions filed', fontsize = 25)...
[ "0.61644155", "0.6124098", "0.6031411", "0.5979967", "0.59787333", "0.5971069", "0.5943029", "0.59208447", "0.58984315", "0.58976746", "0.5869825", "0.5843553", "0.5836322", "0.5829148", "0.5803515", "0.57898813", "0.5787882", "0.5771819", "0.57714844", "0.57601196", "0.57472...
0.73401976
0
Cross analyzes the baseline with 2020's eviction data. NOTE Requires you to run the above functions
def cross_analyze(evictions_filed, base_evictions_filed, weeks): plt.figure(figsize=(50, 10)) plt.plot(weeks, evictions_filed, label = '2020') plt.plot(weeks, base_evictions_filed, label = '2015-2016') plt.xlabel('Date', fontsize = 25) plt.ylabel('Evictions filed', fontsize = 25) plt.title...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CrossCheck(dataloader):", "def do_crossval():\n df = read_df()\n # X = df['review'].apply(remove_html_lower)\n\n X = df['review']\n y = df['sentiment']\n X_train, X_holdout, y_train, y_holdout = train_test_split(X, y, test_size=0.3, shuffle=True, stratify=y, random_state=222 )\n\n tfidf = T...
[ "0.5959022", "0.5762439", "0.57529324", "0.5593366", "0.55377454", "0.5520248", "0.5454742", "0.5441111", "0.53812", "0.53765136", "0.5361948", "0.5333665", "0.5293056", "0.5286", "0.52654094", "0.52570784", "0.52462506", "0.523822", "0.5229423", "0.52216583", "0.5211983", ...
0.6554467
0
Check if a switch exist for device.
def _switch_exist(lge_device: LGEDevice, switch_desc: ThinQSwitchEntityDescription) -> bool: if switch_desc.value_fn is not None: return True feature = switch_desc.key if feature in lge_device.available_features: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_switch(self):\n\n svc = \"urn:upnp-org:serviceId:SwitchPower1\"\n if not svc in self.services:\n raise RuntimeError, \"Device doesn't support the service\"\n \n status = self.get_variable(svc, \"Status\")\n return status == 1", "def _verify_switch_created(sel...
[ "0.6747511", "0.6441467", "0.6203834", "0.6106376", "0.60789245", "0.60287935", "0.59896916", "0.58936965", "0.58648187", "0.58274436", "0.5758467", "0.5728313", "0.57069063", "0.5637247", "0.56260467", "0.56259376", "0.56258166", "0.5610697", "0.55567384", "0.55409193", "0.5...
0.7844338
0
Return True if entity is available.
def available(self) -> bool: is_avail = True if self.entity_description.available_fn is not None: is_avail = self.entity_description.available_fn(self._wrap_device) return self._api.available and is_avail
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def available(self) -> bool:\n return super().available and (\n self.coordinator.data.get(self.entity_description.key) is not None\n )", "def available(self) -> bool:\n if self.entity_description.always_available:\n return True\n return self.knx.xknx.connection_m...
[ "0.8291221", "0.8025913", "0.7288025", "0.724847", "0.7247756", "0.7247756", "0.72361225", "0.7186925", "0.7186925", "0.71700346", "0.7118156", "0.7103858", "0.7103858", "0.7103858", "0.71023947", "0.7093814", "0.7093814", "0.7093814", "0.70866835", "0.7074035", "0.70578057",...
0.8099782
1
Get current switch state
def _get_switch_state(self): if self.entity_description.value_fn is not None: return self.entity_description.value_fn(self._wrap_device) if self._api.state: feature = self.entity_description.key return self._api.state.device_features.get(feature) return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_state(self):\n return self.controller.get_state()", "def get_current_state(self):\n return self._current_state", "def get_current_state(self):\n return self.game.get_current_state()", "def state(self) -> bool:\n return self.get_state(self.entity_ids[\"switch\"])", "def r...
[ "0.74889183", "0.73827314", "0.73482925", "0.7328623", "0.7303987", "0.72895473", "0.72895473", "0.7262649", "0.72144073", "0.72110635", "0.71496564", "0.7141653", "0.71394473", "0.71338475", "0.7104394", "0.7095693", "0.70940304", "0.70775414", "0.7067311", "0.7067311", "0.7...
0.7429907
1
Takes a List of Tensors and returns a List of mask Tensor with 1 if the input was all zeros (on dimension 2) and 0 otherwise. This is used in the Attention layer to mask the padding observations.
def get_zero_entities_mask(entities: List[torch.Tensor]) -> List[torch.Tensor]: with torch.no_grad(): if exporting_to_onnx.is_exporting(): with warnings.catch_warnings(): # We ignore a TracerWarning from PyTorch that warns that doing # shape[n].item() will cause ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_attention_mask(input_ids): \n attention_masks = [] \n\n # 1 for input and 0 for pad\n for seq in input_ids: \n attention_masks.append([float(i>0) for i in seq])\n\n return attention_masks", "def get_padding_mask(inputs, padding_value=0):\n mask = tf.cast(tf.equal(inputs, padding_val...
[ "0.7192867", "0.68340164", "0.6609743", "0.651477", "0.64316094", "0.63892573", "0.62922674", "0.6264108", "0.6230588", "0.62144625", "0.61776084", "0.61677283", "0.61438", "0.6140973", "0.61276275", "0.611358", "0.6040983", "0.6023705", "0.6021974", "0.60033125", "0.59760505...
0.684822
1
Load the configuration file that manage raw data. conf is a dictionary
def load_config_raw_data(conf): path = Path(conf["conf_raw_data"]) with open(path) as f: txt = f.read() conf = json.loads(txt) return conf
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_from_conf(self):\r\n raise NotImplementedError", "def load_from_conf(self):\n raise NotImplementedError", "def loadConf(self):\n\n with open(self.configFile) as f:\n self.config = json.load(f)", "def load_conf(self):\n self._read_uconf()", "def _load_conf(sel...
[ "0.7817127", "0.77862626", "0.7596874", "0.74215615", "0.73315775", "0.7204006", "0.7175266", "0.71260387", "0.6957915", "0.6763186", "0.6753021", "0.6738471", "0.6700064", "0.6662929", "0.6654338", "0.6623613", "0.66206634", "0.66160893", "0.6608538", "0.66063255", "0.655592...
0.80604255
0
Load as a pandas Dataframe the table specified by the name 'table' (string). Must match one of the keys in the \ conf raw data file
def load_raw_table(conf, table): confrd = load_config_raw_data(conf) path_table = Path(confrd[table]["path"]) sep = confrd[table]["sep"] encoding = confrd[table]["encoding"] df = pd.read_csv(path_table, sep=sep, encoding=encoding) return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_table(**kargs):\n from transformer import dehyphenate\n sep = LoincMTRT.delimit # kargs.get('sep', ',')\n input_dir = kargs.get('input_dir', 'data')\n dehyphen = kargs.get('dehyphenate', True)\n deq = kargs.get('dequote', True)\n one_to_one = kargs.get('one_to_one...
[ "0.68337256", "0.66754687", "0.6670916", "0.6593603", "0.65836316", "0.65808636", "0.6576015", "0.65135646", "0.64685476", "0.6413054", "0.6406398", "0.6404005", "0.6317207", "0.6181754", "0.6180371", "0.6171104", "0.61608464", "0.615348", "0.6132976", "0.6097652", "0.6096849...
0.8200111
0
lists contents of hydroshare irods userspace
def ils(self): cmd = Popen(['ils'], stdout=PIPE, stderr=STDOUT, shell=True) stdout = cmd.communicate()[0].decode('ascii') if cmd.returncode != 0: print('Failed to fetch irods file list: %s' % stdout) return [] return [s.replace('C-', '').strip() for s in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list():\n rino.remote.list()", "def list_data(self):\n with self.read():\n keys = self.handle.keys()\n return [i.lstrip('/') for i in keys]", "def list():", "def list():", "def list(self):", "def list():\n data = getInstaData()\n return render_template(\"list.htm...
[ "0.6433237", "0.6131444", "0.6028496", "0.6028496", "0.60075146", "0.5948483", "0.5939381", "0.591174", "0.58719695", "0.5800662", "0.5770601", "0.56504005", "0.5648978", "0.5616612", "0.55690056", "0.5552401", "0.5549238", "0.55253196", "0.54935414", "0.5482844", "0.5472509"...
0.6275398
1
Prints help for a specified tool.
def print_specific_help(tool_name): if tool_name not in AvailableCommands.commands: print 'Command is not supported: {0}'.format(tool_name) return cmd = AvailableCommands.commands[tool_name] print 'Usage of {0}:'.format(cmd.name) print '\nAccepted input types:\n{0}'.format(str(li...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_generic_help():\r\n print ART_NAME\r\n print 'Version {1}\\nby {2}'.format(NAME, VERSION, AUTHOR)\r\n print DESCRIPTION\r\n tools = sorted(AvailableCommands.commands.keys(), key=lambda v: v.upper())\r\n # Do not show CUSTOM command in the help\r\n tools.remove('CUSTOM')\r\n tools.rem...
[ "0.7634922", "0.72920835", "0.72188467", "0.71694416", "0.7161719", "0.71323955", "0.70277065", "0.7019475", "0.7019475", "0.7019475", "0.69998395", "0.69744694", "0.6969143", "0.6901238", "0.6899467", "0.6888493", "0.68664163", "0.6864778", "0.68607914", "0.6853852", "0.6775...
0.83063513
0
Generates command line objects to compress/decompress a workflow.
def generate_compression_command_line_objects(dir_stack, command_line_parameters): # Generate command lines threads = [] thread_sizes = [] first_d = True for d in dir_stack: if first_d: first_d = False continue if not os.path.isdir(d.path): continue...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n import argparse\n\n parser = argparse.ArgumentParser(\n description='Use the machine learning meta library shrynk to compress'\n )\n subparsers = parser.add_subparsers(dest=\"command\")\n compress = subparsers.add_parser('compress')\n compress.add_argument('file', help='file ...
[ "0.636741", "0.61607385", "0.6109988", "0.5978106", "0.5915388", "0.58942014", "0.58697283", "0.58455306", "0.5824884", "0.58116597", "0.5769307", "0.5750805", "0.57481354", "0.5736904", "0.57217336", "0.5676748", "0.5655071", "0.5651055", "0.5635633", "0.5598006", "0.5588914...
0.65829694
0
Generates commands to execute workflow for each input file.
def generate_command_line_objects(input_file_parameters, dir_stack, auto_split_workflows): workflows = [] prev_number_of_ids_per_command = None prev_command_had_output_dir = True first_command = True # Bools for splitting workflow. Separate values for automatically splitting workflow and #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute(self):\n for line in fileinput.input():\n line = line.rstrip()\n self._process_command(line)", "def regenerate_command_line_objects(input_file_parameters, dir_stack,\r\n auto_split_workflows):\r\n workflows = []\r\n prev_number_of_i...
[ "0.65493697", "0.61751366", "0.61644983", "0.6146389", "0.58796287", "0.58742994", "0.5830146", "0.5827008", "0.5818108", "0.5804637", "0.57874596", "0.5779958", "0.5779178", "0.57518756", "0.571343", "0.56952333", "0.5652398", "0.56454384", "0.56206775", "0.5620343", "0.5577...
0.6298623
1
Reports which commands have not been successfully run. Commands found in staplefile are compared with files found in directory stack to identify which commands have failed.
def validate_run_results(input_file_parameters, dir_stack): prev_command_had_output_dir = True dir_stack_index = -1 command_index = 0 for current_command in input_file_parameters.commands: # Skip over SPLIT commands if current_command == 'SPLIT': continue co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_run_logs(input_file_parameters, dir_stack):\r\n # Check resource manager produced .out and .err files for assumed error\r\n # messages.\r\n print 'Checking runtime log files for error messages...'\r\n file_names = os.listdir(input_file_parameters.output_dir)\r\n\r\n newest_fix_index = 0\r\...
[ "0.6216581", "0.5714732", "0.56718695", "0.56527007", "0.5601208", "0.55626947", "0.5551729", "0.5527082", "0.5517359", "0.54875124", "0.5445772", "0.5432267", "0.54280514", "0.54172146", "0.5366206", "0.5357607", "0.5353905", "0.5338872", "0.5335011", "0.5333496", "0.5318811...
0.67288995
0
Writes the output in simple shell script format. The default format is a shell script file containing the command lines.
def write_default(workflows, output_dir): # Calculate the total number of commands number_of_commands = 0 for workflow in workflows: number_of_commands += sum(map(len, workflow)) # Create command line strings i = 0 out_lines = ['echo Started executing shell script at:', 'date'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_subshell_file_contents(cmd, skip_module_loading, skip_module_unloading):\r\n\r\n\r\n out_lines = []\r\n\r\n # Invoke commands to produce their output command string(s)\r\n cmd_list = cmd.command_lines\r\n cmd_list = map(clean_command_lines, cmd_list)\r\n\r\n # Write current command to s...
[ "0.6161045", "0.5830803", "0.5830141", "0.5728146", "0.5581661", "0.5542562", "0.5534459", "0.5473914", "0.5465518", "0.54606724", "0.5454724", "0.54491675", "0.5440373", "0.54200655", "0.54052734", "0.5380631", "0.53805697", "0.53546333", "0.534062", "0.5320091", "0.53145796...
0.6917708
0
Writes the output in LSF job array format. Creates sub shell scripts that contain the workflow for each input file separately. After this main shell script containing TORQUE configuration is created. This script is responsible for starting the sub shells as separate processes.
def write_lsf(workloads, input_file_parameters, command_line_parameters): workload_index = 0 workload_zfill_amount = len(str(len(workloads))) workload_file_paths = [] for workload in workloads: # Each workflow part will have separate file to submit to TORQUE with # sbatch command. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_unix(workloads, input_file_parameters, command_line_parameters):\r\n\r\n workload_index = 0\r\n workload_zfill_amount = len(str(len(workloads)))\r\n background_process_list = []\r\n for workload in workloads:\r\n # Each workflow part will have separate file to submit to TORQUE with\r\n...
[ "0.7333931", "0.71901464", "0.67998576", "0.6780292", "0.63524926", "0.63199294", "0.6265143", "0.6096322", "0.6079112", "0.588439", "0.58698326", "0.58114004", "0.5785257", "0.57349914", "0.56735706", "0.5660371", "0.56586134", "0.5653163", "0.56474715", "0.5637175", "0.5635...
0.73390156
0
Writes the output in Sun Grid Engine job array submission format. Creates sub shell scripts that contain the workflow for each input file separately. After this main shell script containing SGE configuration is created. This script is responsible for starting the sub shells as separate processes.
def write_sge(workloads, input_file_parameters, command_line_parameters): validate_resource_manager_parameters( input_file_parameters.resource_manager_params, ['# -o', '# -e', '# -t']) workload_index = 0 workload_zfill_amount = len(str(len(workloads))) workload_file_paths = [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_jobs(fpath, num_runs, netid):\n\n run = \"\"\n run += \"import sys\\n\"\n run += \"import subprocess\\n\"\n run += \"cmd_array = (\"\n for i in range(num_runs):\n run += \"r\\\"python test.py %d\\\"\" % i\n run += \",\\n\"\n\n run += \")\\n\"\n run += \"p = subprocess.Pop...
[ "0.6961429", "0.67148894", "0.6494868", "0.6412396", "0.62112385", "0.6205976", "0.61844945", "0.6169179", "0.611067", "0.60501873", "0.6024691", "0.5989451", "0.59104246", "0.5877937", "0.5877124", "0.58605266", "0.5851678", "0.5838534", "0.5806282", "0.5746106", "0.573468",...
0.69199365
1
Writes the output in SLURM array job format. Creates sub shell scripts that contain the workflow for each input file separately. After this main shell script containing SLURM configuration is created. This script is responsible for starting the sub shells as separate processes.
def write_slurm(workloads, input_file_parameters, command_line_parameters): workload_index = 0 workload_zfill_amount = len(str(len(workloads))) workload_file_paths = [] for workload in workloads: # Each workflow part will have separate file to submit to SLURM with # sbatch command....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_sge(workloads, input_file_parameters, command_line_parameters):\r\n validate_resource_manager_parameters(\r\n input_file_parameters.resource_manager_params,\r\n ['# -o', '# -e', '# -t'])\r\n\r\n workload_index = 0\r\n workload_zfill_amount = len(str(len(workloads)))\r\n workload...
[ "0.6855347", "0.68422127", "0.6675286", "0.650287", "0.645152", "0.6278125", "0.6242975", "0.6226567", "0.61965185", "0.61401135", "0.60027885", "0.59648293", "0.5838186", "0.58326197", "0.5755615", "0.5729635", "0.57208526", "0.5701956", "0.56957155", "0.5687705", "0.5686899...
0.7628179
0
Writes the output in TORQUE multiple job submission format. Creates sub shell scripts that contain the workflow for each input file separately. After this main shell script containing TORQUE configuration is created. This script is responsible for starting the sub shells as separate processes.
def write_torque(workloads, input_file_parameters, command_line_parameters): validate_resource_manager_parameters( input_file_parameters.resource_manager_params, ['#PBS -k', '#PBS -N', '#PBS -d', '#PBS -e', '#PBS -t']) workload_index = 0 workload_zfill_amount = len(str(len(workloads))...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_unix(workloads, input_file_parameters, command_line_parameters):\r\n\r\n workload_index = 0\r\n workload_zfill_amount = len(str(len(workloads)))\r\n background_process_list = []\r\n for workload in workloads:\r\n # Each workflow part will have separate file to submit to TORQUE with\r\n...
[ "0.7209775", "0.6585105", "0.6554315", "0.64478266", "0.6284272", "0.62066483", "0.61065704", "0.60671365", "0.6054951", "0.60292995", "0.5986418", "0.597275", "0.59198385", "0.5856972", "0.5800811", "0.577773", "0.5759242", "0.57556045", "0.5738472", "0.5737264", "0.5733993"...
0.73230857
0
Writes a parallelized workflow by using UNIX run background feature (&). Creates sub shell scripts that contain the workflow for each input file separately. After this main shell script is written, where each workflow is set to run as background process by using the shell & character. Workflow parts are separated by wa...
def write_unix(workloads, input_file_parameters, command_line_parameters): workload_index = 0 workload_zfill_amount = len(str(len(workloads))) background_process_list = [] for workload in workloads: # Each workflow part will have separate file to submit to TORQUE with # sbatch co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_slurm(workloads, input_file_parameters, command_line_parameters):\r\n workload_index = 0\r\n workload_zfill_amount = len(str(len(workloads)))\r\n workload_file_paths = []\r\n for workload in workloads:\r\n # Each workflow part will have separate file to submit to SLURM with\r\n ...
[ "0.6447484", "0.6394443", "0.62565774", "0.6216091", "0.6154703", "0.6106836", "0.608601", "0.5807879", "0.57455873", "0.57444465", "0.5742326", "0.569049", "0.5653086", "0.5634561", "0.5627084", "0.56151015", "0.5591978", "0.54646945", "0.5456538", "0.5420467", "0.5411606", ...
0.74553514
0
test all ssh kwargs are not excluded from kwargs when preparing the SSH opts
def test_ssh_kwargs(test_opts): opt_key = test_opts[0] opt_value = test_opts[1] # Is the kwarg in salt.utils.parsers? in_parser = test_opts[2] opts = { "eauth": "auto", "username": "test", "password": "test", "client": "ssh", "tgt": "localhost", "fun"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _BuildSshOptions(self, batch, ask_key, use_cluster_key,\n strict_host_check, private_key=None, quiet=True,\n port=None):\n options = [\n \"-oEscapeChar=none\",\n \"-oHashKnownHosts=no\",\n \"-oGlobalKnownHostsFile=%s\" % pathutils.SSH_KNOWN_HOSTS_FI...
[ "0.61168206", "0.6079297", "0.59761137", "0.5973248", "0.5916606", "0.58925116", "0.57788223", "0.5721382", "0.56176704", "0.55686975", "0.5542059", "0.5488901", "0.54882175", "0.54571706", "0.544993", "0.5444227", "0.5437077", "0.54274124", "0.54254705", "0.53893155", "0.538...
0.7008141
0
test expand_target when host is not included in the rosterdata
def test_expand_target_no_host(opts, tmp_path): host = "127.0.0.1" user = "test-user@" opts["tgt"] = user + host roster = """ localhost: 127.0.0.1 """ roster_file = str(tmp_path / "test_roster_no_host") with salt.utils.files.fopen(roster_file, "w") as fp: salt.utils.yaml...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_expand_target_no_user(opts, roster):\n host = \"127.0.0.1\"\n opts[\"tgt\"] = host\n\n with patch(\"salt.utils.network.is_reachable_host\", MagicMock(return_value=False)):\n client = ssh.SSH(opts)\n assert opts[\"tgt\"] == host\n\n with patch(\n \"salt.roster.get_roster_file\"...
[ "0.7059753", "0.6958238", "0.6752136", "0.6731314", "0.5922972", "0.5872034", "0.5807112", "0.57836884", "0.57331073", "0.57315934", "0.57153296", "0.5710335", "0.5678303", "0.56106454", "0.55797064", "0.55640423", "0.5553922", "0.55535734", "0.553814", "0.5440517", "0.536293...
0.7415296
0
test update_targets when host is ip address
def test_update_targets_ip_address(opts): host = "127.0.0.1" user = "test-user@" opts["tgt"] = user + host with patch("salt.utils.network.is_reachable_host", MagicMock(return_value=False)): client = ssh.SSH(opts) assert opts["tgt"] == user + host client._update_targets() assert opts...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_targets_dns(opts):\n host = \"localhost\"\n user = \"test-user@\"\n opts[\"tgt\"] = user + host\n\n with patch(\"salt.utils.network.is_reachable_host\", MagicMock(return_value=False)):\n client = ssh.SSH(opts)\n assert opts[\"tgt\"] == user + host\n client._update_targets()...
[ "0.7464471", "0.71415", "0.6910683", "0.6657661", "0.64958376", "0.64322263", "0.6429889", "0.6385466", "0.6237695", "0.61982393", "0.61476934", "0.61162746", "0.6114164", "0.610654", "0.6072472", "0.6027562", "0.6008352", "0.598404", "0.5966812", "0.5915929", "0.5911148", ...
0.8039261
0
test update_targets when host is dns
def test_update_targets_dns(opts): host = "localhost" user = "test-user@" opts["tgt"] = user + host with patch("salt.utils.network.is_reachable_host", MagicMock(return_value=False)): client = ssh.SSH(opts) assert opts["tgt"] == user + host client._update_targets() assert opts["tgt"]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_targets_ip_address(opts):\n host = \"127.0.0.1\"\n user = \"test-user@\"\n opts[\"tgt\"] = user + host\n\n with patch(\"salt.utils.network.is_reachable_host\", MagicMock(return_value=False)):\n client = ssh.SSH(opts)\n assert opts[\"tgt\"] == user + host\n client._update_ta...
[ "0.7475771", "0.7439883", "0.6938763", "0.674091", "0.6428459", "0.61800534", "0.6096695", "0.60605717", "0.58983433", "0.5897955", "0.58913845", "0.5874283", "0.585102", "0.58426744", "0.5839361", "0.5837791", "0.5811867", "0.5776639", "0.5776224", "0.5753839", "0.5708274", ...
0.8254757
0
test update_targets when no user defined
def test_update_targets_no_user(opts): host = "127.0.0.1" opts["tgt"] = host with patch("salt.utils.network.is_reachable_host", MagicMock(return_value=False)): client = ssh.SSH(opts) assert opts["tgt"] == host client._update_targets() assert opts["tgt"] == host
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_targets_ip_address(opts):\n host = \"127.0.0.1\"\n user = \"test-user@\"\n opts[\"tgt\"] = user + host\n\n with patch(\"salt.utils.network.is_reachable_host\", MagicMock(return_value=False)):\n client = ssh.SSH(opts)\n assert opts[\"tgt\"] == user + host\n client._update_ta...
[ "0.6914559", "0.66063684", "0.65769297", "0.65296984", "0.65164536", "0.64756906", "0.6462618", "0.6382679", "0.6335945", "0.633125", "0.633125", "0.633125", "0.6292728", "0.6273413", "0.62559766", "0.62496156", "0.62388134", "0.6209271", "0.6199935", "0.61500025", "0.614538"...
0.7098015
0
test update_targets and expand_target when host is dns
def test_update_expand_target_dns(opts, roster): host = "localhost" user = "test-user@" opts["tgt"] = user + host with patch("salt.utils.network.is_reachable_host", MagicMock(return_value=False)): client = ssh.SSH(opts) assert opts["tgt"] == user + host with patch( "salt.roster....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_targets_dns(opts):\n host = \"localhost\"\n user = \"test-user@\"\n opts[\"tgt\"] = user + host\n\n with patch(\"salt.utils.network.is_reachable_host\", MagicMock(return_value=False)):\n client = ssh.SSH(opts)\n assert opts[\"tgt\"] == user + host\n client._update_targets()...
[ "0.79298717", "0.7271698", "0.7193563", "0.66447264", "0.6619049", "0.63972855", "0.6149345", "0.6114023", "0.601661", "0.5973573", "0.59198385", "0.59094423", "0.5870842", "0.58562446", "0.5788324", "0.5756256", "0.57487756", "0.57337517", "0.5731826", "0.57180697", "0.56830...
0.7761494
1
test parse_tgt when user and host set on the ssh cli tgt
def test_parse_tgt(opts): host = "localhost" user = "test-user@" opts["tgt"] = user + host with patch("salt.utils.network.is_reachable_host", MagicMock(return_value=False)): assert not opts.get("ssh_cli_tgt") client = ssh.SSH(opts) assert client.parse_tgt["hostname"] == host ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_parse_tgt_no_user(opts):\n host = \"localhost\"\n opts[\"ssh_user\"] = \"ssh-usr\"\n opts[\"tgt\"] = host\n\n with patch(\"salt.utils.network.is_reachable_host\", MagicMock(return_value=False)):\n assert not opts.get(\"ssh_cli_tgt\")\n client = ssh.SSH(opts)\n assert clien...
[ "0.7891038", "0.66818714", "0.64358", "0.626521", "0.62499535", "0.6192972", "0.6165336", "0.6032608", "0.599522", "0.59491026", "0.5891626", "0.5764562", "0.56263566", "0.5608297", "0.554224", "0.5528934", "0.55157524", "0.5487462", "0.54454535", "0.5427359", "0.5413081", ...
0.84123373
0
test parse_tgt when only the host set on the ssh cli tgt
def test_parse_tgt_no_user(opts): host = "localhost" opts["ssh_user"] = "ssh-usr" opts["tgt"] = host with patch("salt.utils.network.is_reachable_host", MagicMock(return_value=False)): assert not opts.get("ssh_cli_tgt") client = ssh.SSH(opts) assert client.parse_tgt["hostname"] =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_parse_tgt(opts):\n host = \"localhost\"\n user = \"test-user@\"\n opts[\"tgt\"] = user + host\n\n with patch(\"salt.utils.network.is_reachable_host\", MagicMock(return_value=False)):\n assert not opts.get(\"ssh_cli_tgt\")\n client = ssh.SSH(opts)\n assert client.parse_tgt[...
[ "0.7992045", "0.6546669", "0.64141375", "0.6399565", "0.6154963", "0.608924", "0.60557365", "0.594483", "0.58621407", "0.5818358", "0.58130467", "0.5710715", "0.5646345", "0.56421787", "0.55266964", "0.5521712", "0.55002075", "0.54592144", "0.5452184", "0.5410033", "0.5379215...
0.7612063
1
test "extra_filerefs" are not excluded from kwargs when preparing the SSH opts
def test_extra_filerefs(tmp_path, opts): ssh_opts = { "eauth": "auto", "username": "test", "password": "test", "client": "ssh", "tgt": "localhost", "fun": "test.ping", "ssh_port": 22, "extra_filerefs": "salt://foobar", } roster = str(tmp_path /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ssh_kwargs(test_opts):\n opt_key = test_opts[0]\n opt_value = test_opts[1]\n # Is the kwarg in salt.utils.parsers?\n in_parser = test_opts[2]\n\n opts = {\n \"eauth\": \"auto\",\n \"username\": \"test\",\n \"password\": \"test\",\n \"client\": \"ssh\",\n \...
[ "0.585128", "0.5742932", "0.5614613", "0.55098736", "0.5377966", "0.53588086", "0.5335075", "0.5329998", "0.5300597", "0.52753556", "0.5273424", "0.5244408", "0.523141", "0.52186584", "0.52164793", "0.5213526", "0.5114157", "0.50991726", "0.5093965", "0.50867444", "0.50815296...
0.6820886
0
The main function used to produce a model ready for compression finetuning from an original PyTorch model and a configuration object. dummy_forward_fn
def create_compressed_model( model: Module, config: NNCFConfig, compression_state: Optional[Dict[str, Any]] = None, dummy_forward_fn: Callable[[Module], Any] = None, wrap_inputs_fn: Callable[[Tuple, Dict], Tuple[Tuple, Dict]] = None, wrap_outputs_fn: Callable[[Tuple, Dict], Tuple[Tuple, Dict]] =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_export_pytorch_model(self):\n pytorch_model = PyTorchLinear()\n dummy_input = torch.empty(10, 10)\n\n with io.BytesIO() as f:\n onnx_converter._export_pytorch_model(f, pytorch_model, dummy_input)", "def __init__(\n self,\n d_model,\n ff1_hsize=1024,\n...
[ "0.6455248", "0.64005536", "0.63606685", "0.6281817", "0.6148253", "0.614193", "0.6059045", "0.60385054", "0.6027797", "0.60148734", "0.60109484", "0.59764093", "0.5941529", "0.5936054", "0.59347934", "0.59182537", "0.59015125", "0.5899236", "0.58604336", "0.58340454", "0.582...
0.68160737
0
Create compression algorithm builders by a given list of algorithm names.
def create_compression_algorithm_builder(config: NNCFConfig, should_init=True) -> PTCompressionAlgorithmBuilder: algo_names = extract_algorithm_names(config) return create_compression_algorithm_builder_from_algo_names(algo_names, config, should_init)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_compression_algorithm_builder_from_algo_names(\n algo_names: List[str], config: NNCFConfig, should_init: bool\n) -> PTCompressionAlgorithmBuilder:\n if not algo_names:\n algo_builder_classes = [NoCompressionAlgorithmBuilder]\n else:\n algo_builder_classes = [PT_COMPRESSION_ALGORIT...
[ "0.8176492", "0.58072144", "0.56273663", "0.5360396", "0.5243267", "0.5199738", "0.5186726", "0.5184808", "0.5183975", "0.5176187", "0.5148908", "0.51379925", "0.51363987", "0.5109506", "0.5105624", "0.51028985", "0.5090822", "0.50801146", "0.50719637", "0.5062348", "0.505617...
0.62809783
1
Create compression algorithm builders by a given list of algorithm names.
def create_compression_algorithm_builder_from_algo_names( algo_names: List[str], config: NNCFConfig, should_init: bool ) -> PTCompressionAlgorithmBuilder: if not algo_names: algo_builder_classes = [NoCompressionAlgorithmBuilder] else: algo_builder_classes = [PT_COMPRESSION_ALGORITHMS.get(alg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_compression_algorithm_builder(config: NNCFConfig, should_init=True) -> PTCompressionAlgorithmBuilder:\n algo_names = extract_algorithm_names(config)\n return create_compression_algorithm_builder_from_algo_names(algo_names, config, should_init)", "def algorithms_factory():\n all_algorithms = [...
[ "0.62809783", "0.58072144", "0.56273663", "0.5360396", "0.5243267", "0.5199738", "0.5186726", "0.5184808", "0.5183975", "0.5176187", "0.5148908", "0.51379925", "0.51363987", "0.5109506", "0.5105624", "0.51028985", "0.5090822", "0.50801146", "0.50719637", "0.5062348", "0.50561...
0.8176492
0
Helper to call ``ir.actions.report.xml.render_report()``.
def render_report(cr, uid, ids, name, data, context=None): registry = yuancloud.modules.registry.RegistryManager.get(cr.dbname) return registry['ir.actions.report.xml'].render_report(cr, uid, ids, name, data, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_xml_report(self, parser, data, objects,context=None):\n raise NotImplementedError()", "def display_reports(self, layout): # pylint: disable=arguments-differ", "def _generate_report(self):\n raise NotImplementedError", "def render_report(self, res_ids, name, data):\n report =...
[ "0.6349062", "0.63135356", "0.60601676", "0.60378766", "0.59094083", "0.59055895", "0.58374727", "0.57946086", "0.57253027", "0.56983304", "0.5696021", "0.5689943", "0.56596303", "0.5653516", "0.56528664", "0.56278044", "0.5620049", "0.56102747", "0.55857426", "0.55817837", "...
0.7703999
0