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 |
|---|---|---|---|---|---|---|
Function called on to initiate a winner popup when user wins round and contain two buttons that allows user to continue to next round or exit game to main menu | def win_popup(self):
content = BoxLayout(orientation='vertical')
message_label = Label(text=self.win_message)
button_layer = BoxLayout(orientation='horizontal')
dismiss_button = Button(text='QUIT', size_hint=(1, 1))
next_button = Button(id='next', text='NEXT ROUND', size_hint=(1,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def winner():\n winning_lbl_zero.grid(row=0, column=LEFT_COL, rowspan=80, columnspan=2, sticky=N) # Placing the winning image\n messagebox.showinfo(title=\"**** WINNER! ****\", message=\"CONGRATS!!\\n\"\n \"You figured out the word/phrase\\n\"\n ... | [
"0.768392",
"0.75384045",
"0.6767224",
"0.66005224",
"0.64879036",
"0.64400345",
"0.64185804",
"0.64151794",
"0.63945717",
"0.63883054",
"0.6387684",
"0.6386436",
"0.63818055",
"0.63478565",
"0.6322512",
"0.6312019",
"0.63101774",
"0.6302236",
"0.62760574",
"0.62575775",
"0.6... | 0.7582336 | 1 |
Function called on to initiate a loss popup when user loses round and contain two buttons that allows user to continue to try again or to exit game to main menu | def lose_popup(self):
content = BoxLayout(orientation='vertical')
message_label = Label(text=self.loss_message)
button_layer = BoxLayout(orientation='horizontal')
dismiss_button = Button(text='QUIT', size_hint=(1, 1))
next_button = Button(id='try_again', text='TRY AGAIN', size_hi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def leave(self):\n p = GameOverPopup(self)\n p.open()",
"def game_lose(self):\n self.lose = True\n self.player.reset_animations()\n self.player.reset_actions()\n self.msg.set_text(u'YOU LOSE <Press Space>')\n self.msg.show(True)",
"def end_game_dialog(self):\n ... | [
"0.7293699",
"0.69518304",
"0.6932533",
"0.6843331",
"0.6744134",
"0.673536",
"0.66698796",
"0.65964085",
"0.6501822",
"0.64916044",
"0.644649",
"0.6423203",
"0.64067745",
"0.638538",
"0.63749623",
"0.63684434",
"0.6346926",
"0.63230807",
"0.63225436",
"0.6289587",
"0.6280748... | 0.78356975 | 0 |
Checks the memcheck suppressions files for bad data. | def CheckChange(input_api, output_api):
# Add the path to the Chrome valgrind dir to the import path:
tools_vg_path = os.path.join(input_api.PresubmitLocalPath(), '..', '..',
'valgrind')
sys.path.append(tools_vg_path)
import suppressions
sup_regex = re.compile('suppressions.*\... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def checkCopiedFiles(self):\n self.missingAiCopies = 0\n self.invalidAiCopies = 0\n self.invalidMapCopies = 0\n self.missingMapCopies = 0\n\n for iFile in self.inputFilesAll:\n if not (os.path.isfile(self.MAPCOPY + iFile + '.msb')):\n self.missingMapCopi... | [
"0.5656504",
"0.56052",
"0.5570039",
"0.55556875",
"0.5514735",
"0.550113",
"0.5471321",
"0.5454947",
"0.5442185",
"0.54322994",
"0.54322994",
"0.54322994",
"0.54322994",
"0.54322994",
"0.54322994",
"0.54322994",
"0.54322994",
"0.53943443",
"0.53749406",
"0.5364498",
"0.53509... | 0.6186575 | 0 |
Update aircraft's info with new_attrs from a message | def update(self, new_attrs):
self.last_update = round(time())
self.attrs.update(new_attrs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _update_attributes(self, data):\n self._set_avatar(data)\n self.boosts_since = parse_boosts_since(data)\n self.flags = parse_flags(data)\n self.nick = parse_nick(data)\n self.pending = parse_pending(data)\n self.role_ids = parse_role_ids(data)\n self.timed_out_u... | [
"0.5891239",
"0.57954097",
"0.5662246",
"0.5606774",
"0.5601481",
"0.55994266",
"0.5598443",
"0.55587447",
"0.553776",
"0.5533562",
"0.54907",
"0.5446939",
"0.54419214",
"0.5396784",
"0.5349467",
"0.53389066",
"0.5303995",
"0.5302427",
"0.5290836",
"0.5206714",
"0.52023214",
... | 0.5968565 | 0 |
Test locking the vehicle. | async def test_locking(hass: HomeAssistant) -> None:
client_mock = await init_integration(hass)
await hass.services.async_call(
LOCK_DOMAIN,
SERVICE_LOCK,
{ATTR_ENTITY_ID: "lock.my_mazda3_lock"},
blocking=True,
)
await hass.async_block_till_done()
client_mock.lock_d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testLock(self):\n self.assertTrue(self._lock.LockIfNotInUse())\n self.assertTrue(os.path.isfile(self._lock_path))\n self._lock.Unlock()\n\n self.assertTrue(self._lock.LockIfNotInUse(timeout_secs=0))\n self._lock.SetInUse(True)\n self._lock.Unlock()\n\n self.asse... | [
"0.7371348",
"0.7349617",
"0.7328333",
"0.72751856",
"0.7178092",
"0.7177597",
"0.71296316",
"0.7100444",
"0.7010818",
"0.6979256",
"0.6938307",
"0.6914827",
"0.68872154",
"0.68466413",
"0.6810663",
"0.6720512",
"0.6709727",
"0.6601707",
"0.65941644",
"0.65221196",
"0.651192"... | 0.77262414 | 0 |
Test unlocking the vehicle. | async def test_unlocking(hass: HomeAssistant) -> None:
client_mock = await init_integration(hass)
await hass.services.async_call(
LOCK_DOMAIN,
SERVICE_UNLOCK,
{ATTR_ENTITY_ID: "lock.my_mazda3_lock"},
blocking=True,
)
await hass.async_block_till_done()
client_mock.un... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def async_unlock(self, **kwargs: Any) -> None:\n if not await self._node.secure_unlock():\n raise HomeAssistantError(f\"Unable to unlock device {self._node.address}\")",
"def successful_unlock(self):\n print(\"\"\"\n ******************************\n * CAR SUCCESSFULLY... | [
"0.65449566",
"0.6500319",
"0.65002227",
"0.64990866",
"0.64909315",
"0.6379716",
"0.63030523",
"0.628642",
"0.62528795",
"0.6214859",
"0.62086934",
"0.6197339",
"0.618216",
"0.6161128",
"0.61483604",
"0.6148066",
"0.61459833",
"0.6116643",
"0.6100175",
"0.60609406",
"0.60381... | 0.72979593 | 0 |
Transforms a list of documents into a bag of words matrix suitable for the LDA model. | def docs2matrix(docs):
# [token for doc in docs for token in doc]
term_dictionary = corpora.Dictionary(docs)
doc_matrix = [term_dictionary.doc2bow(doc) for doc in docs]
logging.info("Len of raw corpus: %d | Len of matrix: %d" % (len(docs), len(doc_matrix)))
return doc_matrix, term_dictionary | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transform(self, documents):\n\t\tnouns, adjectives, verbs, adverbs = np.array([self.get_sentiments(d) for d in documents]).T\n\t\tresult = np.array([nouns, adjectives, verbs, adverbs]).T\n\t\treturn result",
"def vectorize_text(corpus):\n bag_of_words_model = CountVectorizer()\n\n # performs the above ... | [
"0.65713054",
"0.65127736",
"0.64627373",
"0.64159477",
"0.6356218",
"0.63448274",
"0.6284834",
"0.6224176",
"0.6219403",
"0.62165606",
"0.621492",
"0.62026554",
"0.61737967",
"0.6162823",
"0.61474174",
"0.611006",
"0.61096346",
"0.6096496",
"0.60751766",
"0.60673666",
"0.601... | 0.67008424 | 0 |
Cleans document of stopwords and punctuation. Stopwords are specified at initialization of Processing. Lemmatizes for all languages except Chinese. | def cleaning(self, document):
remove_punct = ''.join(i for i in document.lower() if i not in self.punctuation)
tokenized = [i for i in remove_punct.split() if i not in self.stopwords]
if self.lang is not 'chinese':
# Lemmatizes if not chinese
tokenized = [self.lemmatize.l... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_text(text):\n\n lemmizer = WordNetLemmatizer()\n stemmer = porter.PorterStemmer()\n\n stop = stopwords.words('english')\n stop += ['.', ',', ':', '...', '!\"', '?\"', \"'\", '\"', ' - ', ' — ', ',\"', '.\"', '!', ';', '♫♫', '♫', \\\n '.\\'\"', '[', ']', '—', \".\\'\", 'ok', 'okay'... | [
"0.7625325",
"0.7195707",
"0.70659137",
"0.70421284",
"0.70037323",
"0.6901292",
"0.68763566",
"0.68709326",
"0.68199193",
"0.6802392",
"0.6761715",
"0.6740753",
"0.673547",
"0.6725475",
"0.6722779",
"0.67183214",
"0.6692628",
"0.66864705",
"0.66829616",
"0.6656232",
"0.66502... | 0.7825676 | 0 |
Cleans all documents in a list | def clean_docs(self, docs):
cleaned = [self.cleaning(doc) for doc in docs]
print(cleaned[0])
return cleaned | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_all_documents(cls):\n for index, text in enumerate(cls.documents):\n text_processed = cls.clean_document(text)\n cls.processed_documents.append(text_processed)",
"def clean_wikidata_docs(docs: List[Dict]) -> List[Dict]:\n for doc in docs:\n try:\n yield... | [
"0.7630348",
"0.72793424",
"0.7144515",
"0.68905133",
"0.6687902",
"0.6479724",
"0.642885",
"0.6420459",
"0.6251878",
"0.6249945",
"0.62178916",
"0.62159264",
"0.61466366",
"0.6139568",
"0.61283255",
"0.6104236",
"0.609236",
"0.60918784",
"0.6083453",
"0.60796386",
"0.6030395... | 0.7797387 | 0 |
Return all tokens retrieved from raw sql text. | def get_tokens(self, sql_text):
parsed = sqlparse.parse(sql_text)[0]
return parsed.tokens | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_tokens(self, text):\n\t\treturn tuple(self._compiled_pattern.findall(text))",
"def tokenize(raw_text):\n def _xop(tokens):\n def _(x):\n return xop(x, \"op\", tokens)\n return _\n \n raw_tokens=xversa_split(raw_text, tokens=Op_Tokens+Group_Tokens)\n tokens=map(xto... | [
"0.68761116",
"0.63889736",
"0.63438416",
"0.63347995",
"0.6324797",
"0.63004404",
"0.62028176",
"0.6189613",
"0.6175202",
"0.6122846",
"0.60931",
"0.60501766",
"0.6048735",
"0.60041136",
"0.59980965",
"0.59953356",
"0.5974618",
"0.59277856",
"0.59134954",
"0.58998233",
"0.58... | 0.86128026 | 0 |
Get an existing ResolverRule resource's state with the given name, id, and optional extra properties used to qualify the lookup. | def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None) -> 'ResolverRule':
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = ResolverRuleArgs.__new__(ResolverRuleArgs)
__props__.__dict__["arn"]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n direction: Optional[pulumi.Input[str]] = None,\n dry_run: Optional[pulumi.Input[bool]] = None,\n listener_id: Optional[pulumi.Input[str]] = None,\n ... | [
"0.6719511",
"0.6532681",
"0.6080831",
"0.6042104",
"0.5868561",
"0.57383907",
"0.5715684",
"0.5545571",
"0.5542033",
"0.552981",
"0.54866755",
"0.5480718",
"0.5468526",
"0.5452355",
"0.536813",
"0.53439337",
"0.5298328",
"0.5257922",
"0.52240974",
"0.52226216",
"0.5218783",
... | 0.74160874 | 0 |
Return a hashable object that represents the identity of the item. By default this returns the position of the item in the tree. You may want to override this to return the item label (if you know that labels are unique and don't change), or return something that represents the underlying domain object, e.g. a database... | def GetItemIdentity(self, item):
return self.GetIndexOfItem(item) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __getitem__(self, item: int) -> int:\n return self.root[item].key",
"def get_key(self, item):\r\n return item[0]",
"def item_to_index(self, item_id):\n if item_id in self.item_dict:\n return self.item_dict[item_id]\n else:\n return -1",
"def get_item_inde... | [
"0.6718204",
"0.6554382",
"0.65462506",
"0.6530754",
"0.6441343",
"0.6328451",
"0.62762874",
"0.62707657",
"0.6197091",
"0.6179496",
"0.6170615",
"0.61524206",
"0.6140397",
"0.61041915",
"0.61041915",
"0.61041915",
"0.6083991",
"0.6075769",
"0.6046458",
"0.60321414",
"0.60292... | 0.72654194 | 0 |
Returns the expansion state of a tree item. | def GetExpansionStateOfItem(self, item):
listOfExpandedItems = []
if self._window.IsExpanded(item):
listOfExpandedItems.append(self.GetItemIdentity(item))
listOfExpandedItems.extend(self.GetExpansionStateOfChildren(item))
return listOfExpandedItems | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetExpansionStateOfChildren(self, item):\n \n listOfExpandedItems = []\n for child in self.GetItemChildren(item):\n listOfExpandedItems.extend(self.GetExpansionStateOfItem(child))\n\n return listOfExpandedItems",
"def GetExpansionState(self):\n \n root = s... | [
"0.68009245",
"0.6749021",
"0.6502228",
"0.61880314",
"0.6093805",
"0.5972188",
"0.5835174",
"0.57742083",
"0.5760115",
"0.5746234",
"0.56965125",
"0.5644115",
"0.5518905",
"0.55129206",
"0.5355323",
"0.5303246",
"0.52967566",
"0.5295659",
"0.52568346",
"0.5242998",
"0.523580... | 0.72322714 | 0 |
Returns the expansion state of the children of a tree item. | def GetExpansionStateOfChildren(self, item):
listOfExpandedItems = []
for child in self.GetItemChildren(item):
listOfExpandedItems.extend(self.GetExpansionStateOfItem(child))
return listOfExpandedItems | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetExpansionStateOfItem(self, item):\n \n listOfExpandedItems = []\n if self._window.IsExpanded(item):\n listOfExpandedItems.append(self.GetItemIdentity(item))\n listOfExpandedItems.extend(self.GetExpansionStateOfChildren(item))\n \n return listOfExp... | [
"0.7339136",
"0.7141751",
"0.65675384",
"0.6546476",
"0.6519548",
"0.6467223",
"0.6419005",
"0.6316439",
"0.62711555",
"0.567379",
"0.56596375",
"0.56364805",
"0.56343377",
"0.55782634",
"0.5571936",
"0.55346835",
"0.54945207",
"0.5483182",
"0.5475979",
"0.54457885",
"0.53961... | 0.8197934 | 0 |
Returns the checked/unchecked state of a tree item. | def GetCheckedStateOfItem(self, item):
listOfCheckedItems = []
if self._window.IsItemChecked(item):
listOfCheckedItems.append(self.GetItemIdentity(item))
listOfCheckedItems.extend(self.GetCheckedStateOfChildren(item))
return listOfCheckedIte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetCheckedState(self):\n \n root = self._window.GetRootItem()\n if not root:\n return []\n if self._window.HasFlag(wx.TR_HIDE_ROOT):\n return self.GetCheckedStateOfChildren(root)\n else:\n return self.GetCheckedStateOfItem(root)",
"def get_c... | [
"0.69177413",
"0.6791844",
"0.678748",
"0.6771581",
"0.6743726",
"0.6448472",
"0.61242646",
"0.61118394",
"0.5986325",
"0.5969601",
"0.58343244",
"0.58270293",
"0.58140105",
"0.57682854",
"0.5758146",
"0.5758146",
"0.5758146",
"0.57553107",
"0.573678",
"0.5687317",
"0.5669797... | 0.7260089 | 0 |
Returns the checked/unchecked state of the children of a tree item. | def GetCheckedStateOfChildren(self, item):
listOfCheckedItems = []
for child in self.GetItemChildren(item):
listOfCheckedItems.extend(self.GetCheckedStateOfItem(child))
return listOfCheckedItems | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetCheckedStateOfItem(self, item):\n \n listOfCheckedItems = []\n if self._window.IsItemChecked(item):\n listOfCheckedItems.append(self.GetItemIdentity(item))\n \n listOfCheckedItems.extend(self.GetCheckedStateOfChildren(item))\n \n return lis... | [
"0.7260259",
"0.72047126",
"0.7056311",
"0.64604676",
"0.6307374",
"0.62121433",
"0.62005514",
"0.61379164",
"0.60493106",
"0.59620893",
"0.5924182",
"0.59231454",
"0.5855594",
"0.57996655",
"0.5675221",
"0.56524885",
"0.54919386",
"0.5482519",
"0.54580134",
"0.53996307",
"0.... | 0.8160871 | 0 |
Returns the selection state of a tree item. | def GetSelectionStateOfItem(self, item):
listOfSelectedItems = []
if self._window.IsSelected(item):
listOfSelectedItems.append(self.GetItemIdentity(item))
listOfSelectedItems.extend(self.GetSelectionStateOfChildren(item))
return listOfSelectedItems | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_item_selection(self, item):\n ret_val, item.value = self._get_item_selection(item.value.encode())\n return ret_val",
"def GetSelectionState(self):\n \n root = self._window.GetRootItem()\n if not root:\n return []\n if self._window.HasFlag(wx.TR_HIDE_RO... | [
"0.71883625",
"0.71602774",
"0.6960345",
"0.68247837",
"0.67556065",
"0.6677732",
"0.66498303",
"0.6579105",
"0.65746766",
"0.654906",
"0.64982754",
"0.64833605",
"0.64229786",
"0.6341507",
"0.6303215",
"0.6299483",
"0.62860656",
"0.6243383",
"0.62416863",
"0.6188711",
"0.618... | 0.7413893 | 0 |
Returns the selection state of the children of a tree item. | def GetSelectionStateOfChildren(self, item):
listOfSelectedItems = []
for child in self.GetItemChildren(item):
listOfSelectedItems.extend(self.GetSelectionStateOfItem(child))
return listOfSelectedItems | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetSelectionStateOfItem(self, item):\n \n listOfSelectedItems = []\n if self._window.IsSelected(item):\n listOfSelectedItems.append(self.GetItemIdentity(item))\n \n listOfSelectedItems.extend(self.GetSelectionStateOfChildren(item))\n return listOfSelecte... | [
"0.7328241",
"0.7306327",
"0.66978",
"0.65647936",
"0.65523493",
"0.6396906",
"0.6159508",
"0.61271596",
"0.6056174",
"0.60181946",
"0.601578",
"0.594123",
"0.5846401",
"0.5823445",
"0.57642406",
"0.5698127",
"0.56921744",
"0.5663123",
"0.56184846",
"0.56048733",
"0.55852693"... | 0.8287663 | 0 |
Sets the expansion state of a tree item (expanded or collapsed). | def SetExpansionStateOfItem(self, listOfExpandedItems, item):
if self.GetItemIdentity(item) in listOfExpandedItems:
self._window.Expand(item)
self.SetExpansionStateOfChildren(listOfExpandedItems, item)
else:
self._window.Collapse(item) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetExpansionStateOfChildren(self, listOfExpandedItems, item):\n\n for child in self.GetItemChildren(item):\n self.SetExpansionStateOfItem(listOfExpandedItems, child)",
"def set_expand(self, expand):\n\n self.props[\"expand\"] = expand",
"def Expand(self, item):\r\n \r\n ... | [
"0.7201302",
"0.6974019",
"0.6939741",
"0.67632484",
"0.6716869",
"0.6409168",
"0.6371868",
"0.6108344",
"0.608381",
"0.6027692",
"0.599641",
"0.5957912",
"0.5843967",
"0.57430047",
"0.56472594",
"0.5647172",
"0.5645035",
"0.5475263",
"0.54090476",
"0.5383469",
"0.53289455",
... | 0.76232827 | 0 |
Sets the expansion state of the children of a tree item (expanded or collapsed). | def SetExpansionStateOfChildren(self, listOfExpandedItems, item):
for child in self.GetItemChildren(item):
self.SetExpansionStateOfItem(listOfExpandedItems, child) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetExpansionStateOfItem(self, listOfExpandedItems, item):\n \n if self.GetItemIdentity(item) in listOfExpandedItems:\n self._window.Expand(item)\n self.SetExpansionStateOfChildren(listOfExpandedItems, item)\n else:\n self._window.Collapse(item)",
"def Exp... | [
"0.71506",
"0.7129844",
"0.6733111",
"0.6503354",
"0.6447795",
"0.6433435",
"0.62760353",
"0.62180096",
"0.62055594",
"0.6154997",
"0.6148783",
"0.6066534",
"0.6039578",
"0.5943558",
"0.5924088",
"0.59110564",
"0.5891494",
"0.58890855",
"0.5868364",
"0.582769",
"0.572264",
... | 0.8290439 | 0 |
Sets the checked/unchecked state of a tree item. | def SetCheckedStateOfItem(self, listOfCheckedItems, item):
if self.GetItemIdentity(item) in listOfCheckedItems:
self._window.CheckItem2(item, True)
else:
self._window.CheckItem2(item, False)
self.SetCheckedStateOfChildren(listOfCheckedItems, item) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetCheckedStateOfChildren(self, listOfCheckedItems, item):\n\n for child in self.GetItemChildren(item):\n self.SetCheckedStateOfItem(listOfCheckedItems, child)",
"def set_checked(self, checked):\n self._checked = checked",
"def checked(self, checked):\n\n self._checked = che... | [
"0.71813804",
"0.716364",
"0.7032677",
"0.6966259",
"0.6475704",
"0.64652634",
"0.6398703",
"0.6395585",
"0.625779",
"0.625779",
"0.625779",
"0.6244843",
"0.6098419",
"0.60577786",
"0.6033443",
"0.6020115",
"0.59534526",
"0.59360486",
"0.5907047",
"0.58984256",
"0.5892282",
... | 0.7502984 | 0 |
Sets the checked/unchecked state of the children of a tree item. | def SetCheckedStateOfChildren(self, listOfCheckedItems, item):
for child in self.GetItemChildren(item):
self.SetCheckedStateOfItem(listOfCheckedItems, child) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetSelectedStateOfChildren(self, listOfSelectedItems, item):\n \n for child in self.GetItemChildren(item):\n self.SetSelectedStateOfItem(listOfSelectedItems, child)",
"def CheckChilds(self, item, checked=True):\r\n \r\n if checked == None:\r\n self.AutoToggle... | [
"0.73173887",
"0.72169894",
"0.6836318",
"0.66166",
"0.6586724",
"0.65155035",
"0.6477054",
"0.64115",
"0.63327813",
"0.63307124",
"0.60148406",
"0.594206",
"0.59199715",
"0.58798754",
"0.5870558",
"0.5833745",
"0.58151853",
"0.5798902",
"0.57454646",
"0.56009513",
"0.5600951... | 0.81554604 | 0 |
Sets the selection state of a tree item. | def SetSelectedStateOfItem(self, listOfSelectedItems, item):
if self.GetItemIdentity(item) in listOfSelectedItems:
if self._isTreeList:
self._window.SelectItem(item, unselect_others=False)
else:
self._window.SelectItem(item)
self.SetSelectedState... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_item_selection(self, item):\n self._set_item_selection(item.encode())",
"def setSelectedFromItem(self, item):\n row = self.model.indexFromItem(item).row()\n self.selectRow(row)",
"def SetSelected( self, node ):\n self.selected_node = node\n index = self.NodeToIndex( n... | [
"0.7764501",
"0.7261722",
"0.7116154",
"0.69432974",
"0.69059044",
"0.6853552",
"0.68199867",
"0.6765872",
"0.6736709",
"0.6677546",
"0.6639117",
"0.6633492",
"0.65966266",
"0.65135974",
"0.64935726",
"0.6469066",
"0.643534",
"0.63144565",
"0.6273102",
"0.62654555",
"0.618259... | 0.75070196 | 1 |
Sets the selection state of the children of a tree item. | def SetSelectedStateOfChildren(self, listOfSelectedItems, item):
for child in self.GetItemChildren(item):
self.SetSelectedStateOfItem(listOfSelectedItems, child) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SelectAllChildren(self, item):\r\n\r\n if not self.HasAGWFlag(TR_MULTIPLE) and not self.HasAGWFlag(TR_EXTENDED):\r\n raise Exception(\"SelectAllChildren can be used only with multiple selection enabled.\")\r\n \r\n if not item.IsSelected():\r\n item.SetHilight(True)\r... | [
"0.7001133",
"0.6924387",
"0.6789003",
"0.6406597",
"0.62851065",
"0.62208855",
"0.617409",
"0.6093207",
"0.6081716",
"0.607147",
"0.60488564",
"0.5938482",
"0.58359146",
"0.57971245",
"0.5777001",
"0.5775782",
"0.57293683",
"0.57173175",
"0.57135206",
"0.56820977",
"0.567017... | 0.8086504 | 0 |
Finds a suitable handler for the input `Persistent Object` depending on the widget kind. | def FindHandler(pObject):
window = pObject.GetWindow()
klass = window.__class__
if hasattr(window, "_persistentHandler"):
# if control has a handler, just return it
return window._persistentHandler
for handler, subclasses in STANDALONE_HANDLERS:
for subclass in subclasses:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __call__(self, obj):\n return getattr(self, 'handle_' + type(obj).__name__, self.__unknown)(obj)",
"def get_handler_object(class_name):\n\n if class_name not in HANDLER_OBJECTS:\n h_obj = get_callable_from_string(class_name)()\n if isinstance(h_obj, BaseHandler):\n pass # TOD... | [
"0.5921896",
"0.55865",
"0.556271",
"0.5520237",
"0.54912376",
"0.54912376",
"0.5468804",
"0.5452842",
"0.5402032",
"0.53631294",
"0.5316783",
"0.52162224",
"0.51591915",
"0.5142923",
"0.5137993",
"0.5133815",
"0.5113112",
"0.5107185",
"0.5077761",
"0.50560486",
"0.50514257",... | 0.7087867 | 0 |
Find an MBean using the provided template. Returns the first matching MBean, or 'None' if no matches are found. | def getFirstMatchingMBean(domain='WebSphere', **attributes):
template = '%s:*' % domain
for (k, v) in attributes.items():
template += ',%s=%s' % (k, v)
result = AdminControl.completeObjectName(template)
if result:
return MBean(result)
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getMBean(domain='WebSphere', **attributes):\n queryString = '%s:*' % domain\n for (k, v) in attributes.items():\n queryString += ',%s=%s' % (k, v)\n result = AdminControl.queryNames(queryString).splitlines()\n if len(result) == 1:\n return MBean(result[0])\n elif len(result) == 0:\... | [
"0.5785474",
"0.5580805",
"0.53508604",
"0.52835804",
"0.51971036",
"0.5145138",
"0.51250666",
"0.5085866",
"0.5033275",
"0.503021",
"0.49781528",
"0.4943675",
"0.49240518",
"0.48907915",
"0.48815778",
"0.48410466",
"0.48377475",
"0.48344296",
"0.48331168",
"0.48311174",
"0.4... | 0.6438993 | 0 |
Queries given the query criteria, retrieves an array of matching MBeans. | def queryMBeans(domain='WebSphere', **attributes):
queryString = '%s:*' % domain
for (k, v) in attributes.items():
queryString += ',%s=%s' % (k, v)
result = []
for name in AdminControl.queryNames(queryString).splitlines():
if name.strip() != '':
result.append(MBean(name))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def get_many(self, **query):\n\n return [await self._expand(obj) for obj in await self.db.get_many(**query)]",
"def query_all(cls)->List:\n database.cursor.execute(\"SELECT * FROM {}\".format(cls.table_name))\n items = database.cursor.fetchall()\n return [cls.to_object(item) for... | [
"0.56875765",
"0.56592846",
"0.56290203",
"0.55934703",
"0.55605483",
"0.552837",
"0.5515496",
"0.55014634",
"0.5466963",
"0.5456249",
"0.5431899",
"0.54005873",
"0.53922045",
"0.5371732",
"0.53474",
"0.5307757",
"0.5263457",
"0.5243657",
"0.5215515",
"0.5211952",
"0.52064025... | 0.6105486 | 0 |
Queries given the query criteria, retrieves single instance of MBean | def getMBean(domain='WebSphere', **attributes):
queryString = '%s:*' % domain
for (k, v) in attributes.items():
queryString += ',%s=%s' % (k, v)
result = AdminControl.queryNames(queryString).splitlines()
if len(result) == 1:
return MBean(result[0])
elif len(result) == 0:
retu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getMBean1(domain='WebSphere', **attributes):\n queryString = '%s:*' % domain\n for (k, v) in attributes.items():\n queryString += ',%s=%s' % (k, v)\n result = AdminControl.queryNames(queryString).splitlines()\n if len(result) == 1:\n return MBean(result[0])\n elif len(result) == 0:... | [
"0.68894833",
"0.6374556",
"0.61639565",
"0.6021707",
"0.577518",
"0.5740062",
"0.57281405",
"0.5705151",
"0.5654817",
"0.5635907",
"0.5612358",
"0.5534903",
"0.5532495",
"0.5516843",
"0.5489203",
"0.5452617",
"0.543559",
"0.53904796",
"0.5384171",
"0.5356615",
"0.5354988",
... | 0.6784485 | 1 |
Queries given the query criteria, retrieves single instance of MBean | def getMBean1(domain='WebSphere', **attributes):
queryString = '%s:*' % domain
for (k, v) in attributes.items():
queryString += ',%s=%s' % (k, v)
result = AdminControl.queryNames(queryString).splitlines()
if len(result) == 1:
return MBean(result[0])
elif len(result) == 0:
rai... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getMBean(domain='WebSphere', **attributes):\n queryString = '%s:*' % domain\n for (k, v) in attributes.items():\n queryString += ',%s=%s' % (k, v)\n result = AdminControl.queryNames(queryString).splitlines()\n if len(result) == 1:\n return MBean(result[0])\n elif len(result) == 0:\... | [
"0.6784485",
"0.6374556",
"0.61639565",
"0.6021707",
"0.577518",
"0.5740062",
"0.57281405",
"0.5705151",
"0.5654817",
"0.5635907",
"0.5612358",
"0.5534903",
"0.5532495",
"0.5516843",
"0.5489203",
"0.5452617",
"0.543559",
"0.53904796",
"0.5384171",
"0.5356615",
"0.5354988",
... | 0.68894833 | 0 |
Queries given the query criteria, retrieves an array of matching JMXMBeans. | def queryJMXMBeans(domain='WebSphere', **attributes):
queryString = '%s:*' % domain
for (k, v) in attributes.items():
queryString += ',%s=%s' % (k, v)
result = []
for name in AdminControl.queryNames(queryString).splitlines():
if name.strip() != '':
result.append(JMXMBean(name... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def queryMBeans(domain='WebSphere', **attributes):\n queryString = '%s:*' % domain\n for (k, v) in attributes.items():\n queryString += ',%s=%s' % (k, v)\n result = []\n for name in AdminControl.queryNames(queryString).splitlines():\n if name.strip() != '':\n result.append(MBea... | [
"0.6752434",
"0.55594444",
"0.55047584",
"0.53597003",
"0.5253638",
"0.5165562",
"0.5149899",
"0.5124796",
"0.5074249",
"0.50722194",
"0.5060724",
"0.49813414",
"0.49300736",
"0.49266",
"0.49263936",
"0.4917215",
"0.49120587",
"0.49006197",
"0.48921606",
"0.48867512",
"0.4860... | 0.69080985 | 0 |
Queries given the query criteria, retrieves single instance of JMXMBean | def getJMXMBean(domain='WebSphere', **attributes):
queryString = '%s:*' % domain
for (k, v) in attributes.items():
queryString += ',%s=%s' % (k, v)
result = AdminControl.queryNames(queryString).splitlines()
if len(result) == 1:
return JMXMBean(result[0])
elif len(result) == 0:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getJMXMBean1(domain='WebSphere', **attributes):\n queryString = '%s:*' % domain\n for (k, v) in attributes.items():\n queryString += ',%s=%s' % (k, v)\n result = AdminControl.queryNames(queryString).splitlines()\n if len(result) == 1:\n return JMXMBean(result[0])\n elif len(result)... | [
"0.7334735",
"0.71358246",
"0.7134528",
"0.6462053",
"0.6077876",
"0.605696",
"0.5324109",
"0.5309884",
"0.5279222",
"0.51865834",
"0.51440644",
"0.504639",
"0.50330067",
"0.49936026",
"0.49400496",
"0.49375793",
"0.49343252",
"0.49229",
"0.48805243",
"0.48736027",
"0.4836370... | 0.72401464 | 1 |
Queries given the query criteria, retrieves single instance of JMXMBean | def getJMXMBean1(domain='WebSphere', **attributes):
queryString = '%s:*' % domain
for (k, v) in attributes.items():
queryString += ',%s=%s' % (k, v)
result = AdminControl.queryNames(queryString).splitlines()
if len(result) == 1:
return JMXMBean(result[0])
elif len(result) == 0:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getJMXMBean(domain='WebSphere', **attributes):\n queryString = '%s:*' % domain\n for (k, v) in attributes.items():\n queryString += ',%s=%s' % (k, v)\n result = AdminControl.queryNames(queryString).splitlines()\n if len(result) == 1:\n return JMXMBean(result[0])\n elif len(result) ... | [
"0.72408557",
"0.7135426",
"0.713465",
"0.64633006",
"0.6077309",
"0.605785",
"0.5325425",
"0.5310609",
"0.5278784",
"0.5187089",
"0.5144109",
"0.5047253",
"0.50323886",
"0.49952137",
"0.49380806",
"0.49376193",
"0.49316886",
"0.49241972",
"0.48793107",
"0.48712507",
"0.48370... | 0.73349136 | 0 |
Return Quad info as dict | def getMyQuadInfo(self):
d = self.getMyInfoAsDict()
d['components'] = self.getMyDictInfo('components')
d['weapons'] = self.getMyDictInfo('weapons')
return d | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getMyShipInfo(self):\n d = self.getMyInfoAsDict()\n d['quads'] = self.getMyDictInfo('quads', 'getMyQuadInfo')\n d['targets'] = self.targets\n d['availSystems'] = self.availSystems\n d['oldAvailSystems'] = self.oldAvailSystems\n return d",
"def convertToQuad(self,qtyp... | [
"0.62370276",
"0.6025623",
"0.5985236",
"0.5810343",
"0.580122",
"0.5749631",
"0.5669064",
"0.55896413",
"0.55748254",
"0.55660295",
"0.55564976",
"0.5549236",
"0.55414456",
"0.5525335",
"0.5516048",
"0.5514436",
"0.54925764",
"0.54888916",
"0.54887503",
"0.5484064",
"0.54753... | 0.8078669 | 0 |
reload Ammo in any weapons in quad | def reloadAmmo(self):
for componentID, myComponent in self.components.iteritems():
if myComponent.myComponentData.maxAmmo > 0:
myComponent.currentAmount = myComponent.myComponentData.maxAmmo | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def updateWeapons(self):\n self.readyWeapons = []\n self.setWeaponStatus()\n\n for myWeapon in self.activeWeapons:\n if myWeapon.preFireCheck() == 1:\n self.readyWeapons.append(myWeapon)\n self.alternateTargets = []\n\n if self.amsTargets != []:\n ... | [
"0.6625979",
"0.6211111",
"0.61092025",
"0.5967693",
"0.566821",
"0.5659455",
"0.56429785",
"0.5621731",
"0.5611232",
"0.5610659",
"0.55739605",
"0.5562434",
"0.55401224",
"0.552979",
"0.5520981",
"0.5504022",
"0.54894924",
"0.5486972",
"0.54807013",
"0.5464994",
"0.54493535"... | 0.6569626 | 1 |
Take the current max AP and SP and reset the current AP SP | def resetDefences(self):
self.currentAP = self.maxAP
self.currentSP = self.maxSP | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def set_max_current(self, currentP1: int, currentP2: int = None, currentP3: int = None):\n json = {\n \"maxCircuitCurrentP1\": currentP1,\n \"maxCircuitCurrentP2\": currentP2 if currentP2 is not None else currentP1,\n \"maxCircuitCurrentP3\": currentP3 if currentP3 is ... | [
"0.59224015",
"0.56858754",
"0.5446402",
"0.5203912",
"0.5136569",
"0.511201",
"0.5109874",
"0.50721616",
"0.50598156",
"0.50587344",
"0.50034845",
"0.49657035",
"0.49413097",
"0.49398202",
"0.49118948",
"0.48954546",
"0.4888399",
"0.48800722",
"0.48725495",
"0.48675382",
"0.... | 0.7074212 | 0 |
Compute allunorderedpairs distances on the given list of hashes (ftr). If prfx is given, save the full dst matrix as mat_[prfx].npy (not recommended, as this can be a very large file). | def calc_distances(ftr, prfx=None):
print(time.asctime(), ' Computing distances')
start = time.time()
dst = util.compute_pair_distances(ftr)
end = time.time()
print(time.asctime(), ' Done Computing distances in ', end-start, ' seconds', flush=True)
# Only save if requested (this can be a very l... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def return_matches(self, hashes, batch_size: int=1000):\n # Create a dictionary of hash => offset pairs for later lookups\n mapper = {}\n for hsh, offset in hashes:\n if hsh in mapper.keys():\n mapper[hsh].append(offset)\n else:\n mapper[hsh]... | [
"0.53393155",
"0.53316146",
"0.5301879",
"0.52618647",
"0.5200537",
"0.505776",
"0.495091",
"0.49110228",
"0.4895826",
"0.4841598",
"0.4825106",
"0.48232505",
"0.48113883",
"0.47307628",
"0.47148523",
"0.47064218",
"0.46910277",
"0.46899813",
"0.4683801",
"0.4674038",
"0.4672... | 0.71996355 | 0 |
For the given distance matrix, return a tuple of two lists of indices such that dst[midx[0][i], midx[1][i]] are the minimumdistance values in dst, for i<n_matches. | def get_min_distances(dst, n_matches):
print(time.asctime(), ' Sorting distances')
start = time.time()
midx = util.mindist(dst, n=n_matches)
end = time.time()
print(time.asctime(), ' Done Sorting distances in ', end-start, ' seconds', flush=True)
return midx | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_min_distances_per_query(dst, n_matches_per_query):\n print(time.asctime(), ' Sorting distances')\n start = time.time()\n query_matches = []\n for i in range(dst.shape[0]):\n midx = util.mindist(dst[i,:], n=n_matches_per_query)\n query_matches.append(midx)\n end = time.time()\n ... | [
"0.7267911",
"0.6681349",
"0.62029773",
"0.6005278",
"0.5946712",
"0.5764068",
"0.5556734",
"0.5505898",
"0.54238474",
"0.54010665",
"0.53946984",
"0.52976424",
"0.52917266",
"0.5285391",
"0.52630347",
"0.52552134",
"0.5235199",
"0.5232916",
"0.5187829",
"0.51829076",
"0.5180... | 0.7322905 | 0 |
Find all pairs in dst with dst[i][j] < threshold | def get_matches(dst, threshold):
print(time.asctime(), ' Filtering and sorting distances')
start = time.time()
dup_dict = util.find_duplicates(dst, threshold)
n_matches = len(dup_dict)
end = time.time()
print(time.asctime(), ' Done Filtering distances for ', n_matches, ' matches in ', end-start,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_matches(src,dst,src_list, dst_list):\n matches=[]\n for src_conn in src_list:\n print src_conn\n if (src_conn in dst_list) & (src_conn<>dst):\n matches.append(src_conn)\n return matches",
"def find_dst_value2(target: int, targets: list):\n targets.sort()\n i, j = 0... | [
"0.5705626",
"0.54760784",
"0.5400847",
"0.5390576",
"0.53703153",
"0.5367165",
"0.53178775",
"0.5196935",
"0.51815856",
"0.51701236",
"0.51596904",
"0.51103455",
"0.50920427",
"0.50895417",
"0.5065128",
"0.50499475",
"0.5036982",
"0.50214386",
"0.501782",
"0.49948567",
"0.49... | 0.6802852 | 0 |
For every row of dst, find the n_matches_per_query smallest distances. | def get_min_distances_per_query(dst, n_matches_per_query):
print(time.asctime(), ' Sorting distances')
start = time.time()
query_matches = []
for i in range(dst.shape[0]):
midx = util.mindist(dst[i,:], n=n_matches_per_query)
query_matches.append(midx)
end = time.time()
print(time... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_min_distances(dst, n_matches):\n print(time.asctime(), ' Sorting distances')\n start = time.time()\n midx = util.mindist(dst, n=n_matches)\n end = time.time()\n print(time.asctime(), ' Done Sorting distances in ', end-start, ' seconds', flush=True)\n return midx",
"def exact_distance_ma... | [
"0.7166816",
"0.63671726",
"0.62152106",
"0.60216725",
"0.59264326",
"0.5909656",
"0.58222026",
"0.5687149",
"0.56036454",
"0.5591867",
"0.55875367",
"0.55642647",
"0.5460043",
"0.54389983",
"0.5427354",
"0.542551",
"0.54187053",
"0.5418057",
"0.5371993",
"0.53682864",
"0.534... | 0.83068514 | 0 |
Allows to connect force_averaging input to the operator | def force_averaging(self):
return self._force_averaging | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear_averaging(self):\n self.write('SENS:AVER:CLE')",
"def take_one_averaged(self):\n self.na.set_center_frequency(6.160574e9)\n self.na.set_span(10e6)\n self.na.set_power(-5, 1)\n self.na.set_ifbw(1e3)\n\n self.na.set_query_timeout(40e3)\n set_format = self.... | [
"0.5672419",
"0.5593715",
"0.55816936",
"0.55681705",
"0.54556394",
"0.5440781",
"0.54342127",
"0.5409358",
"0.5202979",
"0.5202979",
"0.5202979",
"0.5202979",
"0.5202979",
"0.5185027",
"0.516939",
"0.5164267",
"0.51630497",
"0.5081227",
"0.50514925",
"0.50442207",
"0.5030083... | 0.6824405 | 0 |
The set of arguments for constructing a ConfigurationSetEventDestination resource. | def __init__(__self__, *,
configuration_set_name: pulumi.Input[str],
event_destination: pulumi.Input['ConfigurationSetEventDestinationEventDestinationArgs'],
event_destination_name: pulumi.Input[str]):
pulumi.set(__self__, "configuration_set_name", configuratio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(__self__,\n resource_name: str,\n args: ConfigurationSetEventDestinationArgs,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...",
"def __init__(__self__, *,\n configuration_set_name: Optional[pulumi.Input[str]] = None,\n ... | [
"0.75985205",
"0.7049825",
"0.70204955",
"0.5792557",
"0.57815343",
"0.5305815",
"0.5297636",
"0.52165294",
"0.52129596",
"0.5206305",
"0.5197685",
"0.51821095",
"0.51218784",
"0.5053848",
"0.5035813",
"0.5012186",
"0.49678358",
"0.49653777",
"0.49653777",
"0.49653777",
"0.49... | 0.7203054 | 1 |
The name of the configuration set. | def configuration_set_name(self) -> pulumi.Input[str]:
return pulumi.get(self, "configuration_set_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def configuration_set_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"configuration_set_name\")",
"def configuration_set_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"configuration_set_name\")",
"def name(self):\n return self._config_name",
"def get... | [
"0.8910209",
"0.85829633",
"0.7802888",
"0.7365852",
"0.73557913",
"0.7333008",
"0.7228877",
"0.72088414",
"0.7096429",
"0.6935156",
"0.69316447",
"0.69316447",
"0.6804298",
"0.6754559",
"0.67136407",
"0.66942495",
"0.6688351",
"0.6658619",
"0.6658619",
"0.6658619",
"0.665105... | 0.880789 | 1 |
Input properties used for looking up and filtering ConfigurationSetEventDestination resources. | def __init__(__self__, *,
configuration_set_name: Optional[pulumi.Input[str]] = None,
event_destination: Optional[pulumi.Input['ConfigurationSetEventDestinationEventDestinationArgs']] = None,
event_destination_name: Optional[pulumi.Input[str]] = None):
if confi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(__self__, *,\n configuration_set_name: pulumi.Input[str],\n event_destination: pulumi.Input['ConfigurationSetEventDestinationEventDestinationArgs'],\n event_destination_name: pulumi.Input[str]):\n pulumi.set(__self__, \"configuration_set_name\", c... | [
"0.62399924",
"0.5841143",
"0.5775807",
"0.57446426",
"0.5482659",
"0.54423964",
"0.5347451",
"0.53202134",
"0.52754885",
"0.5270213",
"0.52479905",
"0.5194659",
"0.5180998",
"0.5155812",
"0.51550585",
"0.5127657",
"0.5127657",
"0.50552064",
"0.50449723",
"0.50312793",
"0.502... | 0.6009154 | 1 |
Get an existing ConfigurationSetEventDestination resource's state with the given name, id, and optional extra properties used to qualify the lookup. | def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
configuration_set_name: Optional[pulumi.Input[str]] = None,
event_destination: Optional[pulumi.Input[pulumi.InputType['ConfigurationSetEventDestinationEventDestinationArgs']]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None) -> 'EventSourceMapping':\n opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))\n\n __props__ = EventSourceMappingArgs.__new__(EventSourceMappingArgs)\n\n ... | [
"0.5371824",
"0.5080608",
"0.50552285",
"0.50445634",
"0.494875",
"0.48784494",
"0.483361",
"0.4816238",
"0.4755307",
"0.46765545",
"0.46324015",
"0.45912427",
"0.45845255",
"0.45782393",
"0.45759034",
"0.45655328",
"0.45566958",
"0.45457974",
"0.45392036",
"0.45382228",
"0.4... | 0.7593467 | 0 |
The name of the configuration set. | def configuration_set_name(self) -> pulumi.Output[str]:
return pulumi.get(self, "configuration_set_name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def configuration_set_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"configuration_set_name\")",
"def configuration_set_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"configuration_set_name\")",
"def name(self):\n return self._config_name",
"def get_... | [
"0.880789",
"0.85829633",
"0.7802888",
"0.7365852",
"0.73557913",
"0.7333008",
"0.7228877",
"0.72088414",
"0.7096429",
"0.6935156",
"0.69316447",
"0.69316447",
"0.6804298",
"0.6754559",
"0.67136407",
"0.66942495",
"0.6688351",
"0.6658619",
"0.6658619",
"0.6658619",
"0.6651058... | 0.8910209 | 0 |
(Computed) The policy data | def policy_data(self) -> str:
return pulumi.get(self, "policy_data") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def policy_data(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"policy_data\")",
"def policy_data(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"policy_data\")",
"def policy_data(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"policy_data\")",
"def pol... | [
"0.7901603",
"0.75085586",
"0.7170913",
"0.69509923",
"0.68334335",
"0.68303806",
"0.67462915",
"0.67462915",
"0.67462915",
"0.6618946",
"0.6614674",
"0.66118526",
"0.65324956",
"0.6481769",
"0.6452524",
"0.638728",
"0.6352222",
"0.6330633",
"0.62338537",
"0.62092125",
"0.620... | 0.7908844 | 0 |
Retrieves the current IAM policy data for a folder. example ```python import pulumi import pulumi_gcp as gcp test = gcp.folder.get_iam_policy(folder=google_folder["permissiontest"]["name"]) ``` | def get_iam_policy(folder: Optional[str] = None,
opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetIamPolicyResult:
__args__ = dict()
__args__['folder'] = folder
opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
__ret__ = pulumi.runtime.invoke('g... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_iam_policy_output(folder: Optional[pulumi.Input[str]] = None,\n opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetIamPolicyResult]:\n ...",
"def get_bucket_iam_policy_output(bucket: Optional[pulumi.Input[str]] = None,\n opts: Opti... | [
"0.7808515",
"0.59545475",
"0.5701744",
"0.5701744",
"0.5622661",
"0.55814654",
"0.5514655",
"0.54991233",
"0.5490814",
"0.5489322",
"0.5449522",
"0.5412184",
"0.54005504",
"0.5395967",
"0.53853446",
"0.5345304",
"0.5345304",
"0.5345304",
"0.5345304",
"0.5345304",
"0.5345304"... | 0.85667855 | 0 |
Retrieves the current IAM policy data for a folder. example ```python import pulumi import pulumi_gcp as gcp test = gcp.folder.get_iam_policy(folder=google_folder["permissiontest"]["name"]) ``` | def get_iam_policy_output(folder: Optional[pulumi.Input[str]] = None,
opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetIamPolicyResult]:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_iam_policy(folder: Optional[str] = None,\n opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetIamPolicyResult:\n __args__ = dict()\n __args__['folder'] = folder\n opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)\n __ret__ = pulumi.runtime... | [
"0.85676455",
"0.59558165",
"0.5703202",
"0.5703202",
"0.5623064",
"0.55799025",
"0.5515561",
"0.5500222",
"0.5488854",
"0.5487892",
"0.5450603",
"0.5412904",
"0.5402409",
"0.53977114",
"0.53847146",
"0.5348119",
"0.5348119",
"0.5348119",
"0.5348119",
"0.5348119",
"0.5348119"... | 0.78097117 | 1 |
Process the provided mango and setup all the structures. | def process_mango(self):
to_ret = False
curr_parser = MangoParser()
all_mango_types = curr_parser.Parse(self.target_mango_file, self.target_engine, self.target_blender_factory)
if len(all_mango_types) > 0:
to_ret = True
return to_ret | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_project_parser(self):\n\n # get Ansible project structure\n self.__get_ansible_project_content()\n self.__generate_graph('project', self.__project_content)\n\n # get Ansible roles\n self.__get_ansible_roles_content()\n self.__generate_graph('roles', self.__role_con... | [
"0.52250695",
"0.5117592",
"0.5079328",
"0.5026995",
"0.50116855",
"0.49568096",
"0.49372387",
"0.4911414",
"0.48996207",
"0.48258615",
"0.4806589",
"0.47886646",
"0.4787551",
"0.4781852",
"0.4781779",
"0.4765663",
"0.4749918",
"0.47467795",
"0.47307393",
"0.46920347",
"0.469... | 0.62756807 | 0 |
Jucify using the provided mango config. | def jucify(self):
to_ret = False
# TODO: finish this
return to_ret | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build(config):",
"def main(verb, language):\n conjugator = Conjugator(language)\n result = conjugator.conjugate(verb)\n pprint(result.conjug_info)\n return",
"def args2body_vim(config_param, vim):\n vim['vim_project'] = {'id': config_param.pop('project_id', ''),\n 'n... | [
"0.43025365",
"0.4184897",
"0.41613582",
"0.41223928",
"0.4104846",
"0.39829394",
"0.39228654",
"0.39228654",
"0.3915513",
"0.39144972",
"0.38978156",
"0.38895142",
"0.38872078",
"0.38818437",
"0.38744324",
"0.38405704",
"0.3839367",
"0.38391942",
"0.38163942",
"0.381597",
"0... | 0.5321229 | 0 |
this function save joints positions into json file | def savePositions():
home = expanduser("~")
jointPositionsList = []
jointPositions = {}
jsonPath = raw_input("Enter JSON file path in the following format: path_to_file/file_name\n")
while not rospy.is_shutdown():
prof = raw_input("Press the S-key and Enter to save position, or any key to e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_new_joint_angles(self,save_file):\n with open(directory + save_file, \"w\") as outfile:\n writer = csv.writer(outfile)\n writer.writerow(robot.joint_angles.values())\n outfile.close()",
"def save_joint_configurations_to_file(commander: moveit_commander.MoveGroupCo... | [
"0.71454954",
"0.69554406",
"0.668583",
"0.6456091",
"0.6439605",
"0.63773197",
"0.62585884",
"0.6143394",
"0.6121821",
"0.61066604",
"0.60567546",
"0.60116005",
"0.59937435",
"0.59748083",
"0.59702367",
"0.59327996",
"0.59110886",
"0.58923185",
"0.5884507",
"0.58557725",
"0.... | 0.72350353 | 0 |
Tests that we can create an approval object to access clients. | def testValidClientApprovalAllowsAccessToEverythingInsideClient(self):
self.InitDefaultRouter()
client_id = self.SetupClient(0)
gui_test_lib.CreateFileVersion(client_id, "fs/os/foo")
with self.assertRaises(grr_api_errors.AccessForbiddenError):
self.api.Client(client_id).File("fs/os/foo").Get()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testValidClientApprovalRequiredToStartFlowsOnClient(self):\n self.InitDefaultRouter()\n\n client_id = self.SetupClient(0)\n\n self.assertRaises(\n grr_api_errors.AccessForbiddenError,\n self.api.Client(client_id).CreateFlow,\n name=flow_test_lib.SendingFlow.__name__)\n\n self.R... | [
"0.7115546",
"0.69697076",
"0.69230336",
"0.68956727",
"0.6798241",
"0.673709",
"0.67172414",
"0.6675977",
"0.6628854",
"0.65286463",
"0.6512154",
"0.64991885",
"0.639502",
"0.6390853",
"0.63452005",
"0.625368",
"0.6225091",
"0.6215911",
"0.62148386",
"0.6201001",
"0.6195303"... | 0.7416084 | 0 |
Tests that we can create an approval object to run hunts. | def testValidHuntApprovalAllowsStartingHunt(self):
self.InitDefaultRouter()
hunt_id = self.CreateHunt()
self.assertRaises(grr_api_errors.AccessForbiddenError,
self.api.Hunt(hunt_id).Start)
self.CreateHuntApproval(hunt_id, self.test_username, admin=False)
self.assertRaisesReg... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_warranty(self):\n pass",
"def test_create_goal(self):\n pass",
"def test_approve_agreement(self):\n pass",
"def test_gerrit_project_approval_listing(create_user):\n signature = Signature()\n signature.get_email_whitelist = MagicMock(return_value={\"phillip.leigh@amd... | [
"0.6561738",
"0.6548262",
"0.6484971",
"0.64192384",
"0.64087296",
"0.6073679",
"0.6024349",
"0.5981987",
"0.59649503",
"0.59435356",
"0.59143263",
"0.5866909",
"0.58209354",
"0.5813709",
"0.58064276",
"0.5806133",
"0.58037925",
"0.57860476",
"0.5757701",
"0.5751582",
"0.5744... | 0.75424117 | 0 |
Takes in quiz length and determines proportion of q's allocated to each strand Returns a list of tuples representing strand id and num questions for each | def pick_strands(quiz_len):
strand_info = []
# checks how many strands there are and sees if the quiz can be evenly divided between them
# if the num_strands evenly goes into the quiz, you can divide q's evenly
num_strands = len(strands.keys())
if not quiz_len % num_strands:
for key in str... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lindivQ(sample, quantity, criteria=len):\n sizes = [criteria(dna) for dna in sample]\n return [size*quantity/sum(sizes) for size in sizes]",
"def gen_questions(self, number_of_questions):",
"def pick_questions(standard_info):\n\n questions = []\n\n # goes through each item in the standard into\... | [
"0.6141801",
"0.572388",
"0.57072407",
"0.5576187",
"0.5525675",
"0.5521635",
"0.5454546",
"0.53776205",
"0.53393304",
"0.5307534",
"0.52740395",
"0.524058",
"0.524058",
"0.524058",
"0.5121489",
"0.5111777",
"0.5088743",
"0.5087585",
"0.5084064",
"0.5077444",
"0.50756615",
... | 0.69728255 | 0 |
Takes in strand info from pick_strands function, returns new list of tuples with standard ids and number of questions for each | def pick_standards(strand_info):
standard_info = []
# goes through each item (aka strand) and looks at the standards available to it and how many questions
# that strand is supposed to get. if it can divide q's evenly, it does.
# otherwise, it goes through the "remainder" it can't evenly divide and pi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pick_questions(standard_info):\n\n questions = []\n\n # goes through each item in the standard into\n for item in standard_info:\n standard_id = item[0]\n count = item[1]\n options = standards[standard_id][\"Questions\"]\n # if the questions you have allocated to that stand... | [
"0.65655947",
"0.6513189",
"0.56941766",
"0.5675045",
"0.54843724",
"0.5461015",
"0.5461015",
"0.5461015",
"0.5368938",
"0.5294925",
"0.5265687",
"0.52613187",
"0.5257826",
"0.52399826",
"0.5214198",
"0.51909536",
"0.5184917",
"0.5148512",
"0.5132643",
"0.5118734",
"0.50949",... | 0.68160886 | 0 |
inserts or updates depending on id's value | def save(self):
if self.id is None:
self._insert()
else:
self._update() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save(self, id, **fields):\r\n # TODO : Effettuare la validazione prima di inserire\r\n user_id = current.auth.user_id\r\n record = self.table(auth_user=user_id, refs=id)\r\n if record:\r\n record.update(**fields)\r\n record.update_record()\r\n else:\r\n ... | [
"0.6431239",
"0.6222643",
"0.61054397",
"0.6041909",
"0.58638513",
"0.5818602",
"0.5808293",
"0.5745157",
"0.57210183",
"0.56953907",
"0.56874126",
"0.568563",
"0.5679119",
"0.56739223",
"0.56604546",
"0.56492436",
"0.5646006",
"0.5633927",
"0.5631943",
"0.56227",
"0.56175554... | 0.6300751 | 1 |
return the Position object for this account's holdings in a given stock, return a new 0 share position if it does not exist. Why? To make buy simple, you always just get the current position and add to it. | def get_position_for(self, ticker):
return position.Position.from_account_id_and_ticker(self.id, ticker) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def buy_to_open(self, symbol, date, price):\n\n # Figure out how much we are willing to spend\n cash_available = self.cash - self.trade_fee\n cash_to_spend = cash_available / self.free_position_slots\n \n # Calculate buy_price and number of shares. Fractional shares allowed.\n ... | [
"0.5891178",
"0.57069856",
"0.5575205",
"0.5542124",
"0.55224884",
"0.5493658",
"0.5478558",
"0.5377278",
"0.53511655",
"0.53399885",
"0.5335918",
"0.5329091",
"0.53086483",
"0.5302417",
"0.5294786",
"0.5293561",
"0.52920264",
"0.5289468",
"0.5276507",
"0.52735144",
"0.527059... | 0.63735276 | 0 |
return all Trade objects for this account and a given ticker | def get_trades_for(self, ticker):
return trade.Trade.all_from_account_id_and_ticker(self.id, ticker) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_all(self) -> List[Trade]:\n\n pass # pragma: no cover",
"def get_trades(self):\n return trade.Trade.all_from_account_id(self.id)",
"async def tickers(self, symbol):\n ticker = await self.client.get_public_ticker(symbol)\n return Ticker(\n bid=ticker[0],\n ... | [
"0.7131262",
"0.7022841",
"0.6538179",
"0.64611614",
"0.6228557",
"0.61725384",
"0.6166818",
"0.6158375",
"0.6149309",
"0.6129212",
"0.60846704",
"0.60832053",
"0.60674876",
"0.60651565",
"0.6052987",
"0.6011362",
"0.5992732",
"0.59909666",
"0.5986095",
"0.59813553",
"0.59800... | 0.7861252 | 0 |
return all Trades this account has made | def get_trades(self):
return trade.Trade.all_from_account_id(self.id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def my_trades(self, **params):\n return self._get('myTrades', signed=True, params=params)",
"def trades(self) -> list[TradeOffer]:\n return self._connection.trades",
"def trades(self) -> List[ClosedTrade]:\n return store.completed_trades.trades",
"async def get_trades(self) -> List[Trade... | [
"0.73008883",
"0.7237519",
"0.695225",
"0.69348365",
"0.68814236",
"0.679248",
"0.67862135",
"0.6598252",
"0.6593311",
"0.65473866",
"0.6507852",
"0.6428645",
"0.6424775",
"0.6363787",
"0.63394237",
"0.62827843",
"0.6268667",
"0.6070792",
"0.6054834",
"0.60313237",
"0.6003588... | 0.78107214 | 0 |
Search using the given ingredients and return the HTML | def search_recipe(ingredients):
params = '+'.join(ingredients.split())
url_search = SEARCH_URL.format(params)
response = req.get(url_search)
return response.content | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def search():\n query = request.form.get(\"query\")\n # pylint: disable=redefined-outer-name\n recipes = list(mongo.db.recipes.find({\"$text\": {\"$search\": query}}))\n return render_template(\"recipes.html\", recipes=recipes)",
"def search():\n query = request.form.get(\"query\")\n recipes = ... | [
"0.6995763",
"0.69688785",
"0.67555606",
"0.6749954",
"0.67258316",
"0.6685839",
"0.6643948",
"0.65534824",
"0.6449809",
"0.6359489",
"0.62784505",
"0.6243911",
"0.62177914",
"0.6139823",
"0.6054673",
"0.6026134",
"0.60191923",
"0.60167325",
"0.6004177",
"0.5978599",
"0.59735... | 0.79737985 | 0 |
initialize the battery's attributes | def __init__(self, battery_size=70):
self.battery_size = battery_size | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, battery_size=40):\n self.battery_size = battery_size",
"def __init__(self, battery_size=70):\n self.battery_size = battery_size",
"def __init__(self, battery_size=70):\n self.battery_size = battery_size",
"def __init__(self, battery_size=70):\n self.battery_size... | [
"0.76310897",
"0.76158583",
"0.76158583",
"0.76158583",
"0.7584304",
"0.7584304",
"0.75580996",
"0.7540261",
"0.7479749",
"0.7460258",
"0.735473",
"0.73212236",
"0.7293355",
"0.7260459",
"0.72088206",
"0.71193594",
"0.71193594",
"0.71193594",
"0.71193594",
"0.71193594",
"0.71... | 0.7669085 | 0 |
print a statement describing the battery size. | def describe_battery(self):
print("This car has a " + str(self.battery_size) + "-kWh battery.") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def describe_battery(self):\n print(\"This car has a \"+str(self.battery_size)+\"-KWh battery.\")",
"def describe_battery(self):\r\n print(\"This car has a \" + str(self.battery_size) + \"-kWh battery.\")",
"def describe_battery(self):\n print(\"This car has a \" + str(self.battery_size) +... | [
"0.8164135",
"0.81572473",
"0.8086049",
"0.8086049",
"0.8086049",
"0.8086049",
"0.8086049",
"0.8086049",
"0.8054243",
"0.794038",
"0.79118186",
"0.7894784",
"0.7894784",
"0.7894784",
"0.7890878",
"0.7673882",
"0.6703384",
"0.6501118",
"0.63764447",
"0.63185567",
"0.6268592",
... | 0.81860626 | 0 |
print a statement about the range this battery provides | def get_range(self):
if self.battery_size == 70:
range = 240
elif self.battery_size == 85:
range = 270
message = "This car can go approx. " + str(range)
message += " miles on a full charge."
print(message) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_range(self):\n if self.battery_size == 70:\n range = 240\n elif self.battery_size == 85:\n range = 270\n\n message = \"this car can go approximately \"+ str(range)\n message += \" miles on a full charge.\"\n print(message)",
"def get_range(self):\n... | [
"0.81450534",
"0.81152886",
"0.81118315",
"0.8078787",
"0.80609244",
"0.8008681",
"0.7995441",
"0.79687774",
"0.79577357",
"0.7785318",
"0.73786366",
"0.64320475",
"0.6344481",
"0.6282629",
"0.6257402",
"0.62521774",
"0.62521774",
"0.62521774",
"0.62507623",
"0.62507623",
"0.... | 0.81959087 | 0 |
electric cars don't have gas tanks we are pretending that this method is in the parent class | def fill_gas_tank(self):
print("This car doesn't need a gas tank.") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fill_gas_tank(self):\n print(\"This car doesn't have a gas tank!\")",
"def fill_gas_tank(self):\n print(\"This car doesn't need a gas tank!\")",
"def fill_gas_tank(self):\n print(\"This car doesn't need a gas tank!\")",
"def fill_gas_tank(self):\n print(\"\\nThis car doesn... | [
"0.67761564",
"0.6761548",
"0.6761548",
"0.6522342",
"0.6260783",
"0.62188023",
"0.60579014",
"0.60174483",
"0.5854004",
"0.58156025",
"0.5799897",
"0.5738411",
"0.5632526",
"0.5623338",
"0.5610071",
"0.5567943",
"0.55558026",
"0.5477331",
"0.54672855",
"0.54672855",
"0.54672... | 0.6910401 | 0 |
make_move() > int Makes a move for the reflex agent based on a set of rules. Returns 1 if blue wins; returns 1 if red wins; returns 0 if noone wins. | def make_move(self):
# If the agent is starting a game, make an
# initial move
if self.get_play_status() == False:
self.initial_move()
return
# for speeds sake, allow the reflex agent to respond to manual
# input. comment out for automatic running.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_move(self, move: int) -> None:\n if move not in self._valid_moves:\n raise ValueError(f'Move \"{move}\" is not valid')\n\n self._update_board(move)\n\n self._win_state = self._check_winner()\n self._is_red_active = not self._is_red_active\n self.move_number +=... | [
"0.64300597",
"0.62266284",
"0.6062095",
"0.6052056",
"0.5997169",
"0.5995663",
"0.5935645",
"0.5923972",
"0.59191597",
"0.5899061",
"0.5895689",
"0.58520454",
"0.58326465",
"0.5811508",
"0.5810371",
"0.57810247",
"0.5773502",
"0.5737988",
"0.5730854",
"0.5703152",
"0.5682173... | 0.66739994 | 0 |
initial_move() Makes the first move for the agent. Returns nothing. | def initial_move(self):
# Make the first move based on the game we
# are currently playing, otherwise return
if isinstance(self.get_game_space(), Gomoku):
# play one stone in the bottom left-hand corner
self.get_game_space().set_tile(0,6,self.get_affinity())
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_move(self):\n\n # If the agent is starting a game, make an \n # initial move\n if self.get_play_status() == False: \n self.initial_move()\n return\n\n # for speeds sake, allow the reflex agent to respond to manual\n # input. comment out for automati... | [
"0.6702486",
"0.64740413",
"0.6239853",
"0.6200199",
"0.618603",
"0.609189",
"0.6057635",
"0.6043189",
"0.60344046",
"0.5979716",
"0.5966254",
"0.5960819",
"0.59474576",
"0.59454024",
"0.59422565",
"0.5917137",
"0.5909199",
"0.5907787",
"0.59039295",
"0.5902483",
"0.58997124"... | 0.76166415 | 0 |
victory_check() > (int,int) Check if the agent can win by placing one more tile. If so, return the (x,y) position of where to place the tile. | def victory_check(self):
# get essential values
board = self.get_game_space()
affinity = self.get_affinity()
# pick the right check for the game we are playing
if isinstance(board, Gomoku):
# get the possible ways to win
possible_win... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_victory(board):\n\n for row in range(HEIGHT):\n for col in range(WIDTH):\n\n player = board[row][col]\n\n # not a player move\n if player == 0 or player == 9:\n continue\n\n # look right\n if col + 3 < WIDTH and player == boa... | [
"0.7377505",
"0.6846999",
"0.6589354",
"0.6530823",
"0.6401256",
"0.6306452",
"0.6291664",
"0.6262325",
"0.6245229",
"0.6194079",
"0.61813176",
"0.6179923",
"0.61717886",
"0.61689377",
"0.61603045",
"0.6155729",
"0.6155014",
"0.6143167",
"0.61216974",
"0.609533",
"0.6092077",... | 0.7078708 | 1 |
counter_opponent_win() > None Check if the opponent is about to win, and if so, counter that move which they will make. | def counter_opponent_win(self):
# get essential values
board = self.get_game_space()
affinity = self.get_opponent().get_affinity()
# pick the right check for the game we are playing
if isinstance(board, Gomoku):
# get the possible ways for the o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def counter_opponent_adv(self):\n\n # get essential values\n board = self.get_game_space()\n affinity = self.get_affinity()\n opaffinity = self.get_opponent().get_affinity()\n\n # pick the right check for the game we are playing\n if isinstance(board, Gomoku):\n\n ... | [
"0.681446",
"0.679821",
"0.6437016",
"0.6422247",
"0.6421646",
"0.63914686",
"0.6356751",
"0.6345408",
"0.6326176",
"0.63049984",
"0.63030833",
"0.6225929",
"0.62241375",
"0.6218724",
"0.61982656",
"0.61938566",
"0.61744547",
"0.6172062",
"0.612777",
"0.6112174",
"0.6103172",... | 0.8313787 | 0 |
counter_opponent_adv() > None Check if the opponent has a very adventageous move, i.e., a row of three tiles with no blockage on either end. Counter this. | def counter_opponent_adv(self):
# get essential values
board = self.get_game_space()
affinity = self.get_affinity()
opaffinity = self.get_opponent().get_affinity()
# pick the right check for the game we are playing
if isinstance(board, Gomoku):
# get advant... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def counter_opponent_win(self):\n\n # get essential values\n board = self.get_game_space()\n affinity = self.get_opponent().get_affinity()\n \n # pick the right check for the game we are playing\n if isinstance(board, Gomoku):\n \n # get the possible ... | [
"0.6904843",
"0.627492",
"0.6240595",
"0.61503714",
"0.61321735",
"0.61297816",
"0.60723734",
"0.6068206",
"0.6003702",
"0.6002434",
"0.59460545",
"0.5937627",
"0.5922639",
"0.586497",
"0.5857609",
"0.58356845",
"0.5834327",
"0.5816237",
"0.5801508",
"0.5800057",
"0.578685",
... | 0.808513 | 0 |
best_last_option() > None Pick a move for the agent to make which is the best based on a set of understood conditions. The best move is the mostleft, mostlow move in the block containing the most tiles of the same affinity. | def best_last_option(self):
# get essential values
board = self.get_game_space()
affinity = self.get_affinity()
# pick the right check for the game we are playing
if isinstance(board, Gomoku):
# get all possible blocks to make a move in
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _choose_best_option(self) -> None:\r\n pawn = choice(list(self._state.game.engine.get_movable_pawns()))\r\n move = choice(self._state.game.engine.get_moves_for_pawn(pawn))\r\n self._selected_pawn = pawn\r\n self._selected_move = move",
"def find_best_move(state: GameState) -> None... | [
"0.75304747",
"0.74330145",
"0.72918314",
"0.7272285",
"0.72112894",
"0.7112078",
"0.7042179",
"0.6928971",
"0.6868513",
"0.6696556",
"0.66623956",
"0.6647075",
"0.6642502",
"0.6618417",
"0.66124195",
"0.6606474",
"0.65773886",
"0.65719503",
"0.653631",
"0.65298855",
"0.65170... | 0.7553143 | 0 |
make_move() > None Makes a move for the minimax agent. Runs a search to the proper depth and prints the number of nodes expanded. Also picks the best move to make based on the search. | def make_move(self):
# get relavent information
affinity = self.get_affinity()
sample_space = self.get_game_space()
depth_limit = self.__search_depth
# run a minimax search and get the best value
bestval = MinimaxTree.minimax(self, sample_space, affinity, depth_limit, T... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_move(self):\n\n # get relavent information\n affinity = self.get_affinity()\n sample_space = self.get_game_space()\n depth_limit = self.__search_depth\n\n # run a minimax search and get the best value\n bestval = MinimaxTree.alphabeta(self, sample_space, affinity,... | [
"0.76901835",
"0.6771509",
"0.6545758",
"0.6540541",
"0.6478168",
"0.6389309",
"0.6309104",
"0.62535506",
"0.6253185",
"0.6216076",
"0.62073755",
"0.62032104",
"0.61945486",
"0.61852765",
"0.6184235",
"0.6134093",
"0.6118762",
"0.610002",
"0.6085031",
"0.6082694",
"0.607217",... | 0.76761436 | 1 |
make_move() > None Makes a move for the alphabeta agent. Runs a search to the proper depth and prints the number of nodes expanded. Also picks the best move to make based on the search. | def make_move(self):
# get relavent information
affinity = self.get_affinity()
sample_space = self.get_game_space()
depth_limit = self.__search_depth
# run a minimax search and get the best value
bestval = MinimaxTree.alphabeta(self, sample_space, affinity, depth_limit,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_move(self):\n\n # get relavent information\n affinity = self.get_affinity()\n sample_space = self.get_game_space()\n depth_limit = self.__search_depth\n\n # run a minimax search and get the best value\n bestval = MinimaxTree.minimax(self, sample_space, affinity, d... | [
"0.71351963",
"0.6256064",
"0.61843055",
"0.61543393",
"0.613425",
"0.6132665",
"0.61061144",
"0.6103348",
"0.60446316",
"0.60137665",
"0.60022223",
"0.5975775",
"0.5955318",
"0.59412754",
"0.5922895",
"0.5890029",
"0.5853521",
"0.5844915",
"0.58151066",
"0.5806238",
"0.57998... | 0.745854 | 0 |
Return number of occupied seats immediately adjacent to seat (r,c). | def occupied(r, c, layout):
occupy = 0
NW = (-1, -1)
NE = (-1, 1)
N = (-1, 0)
W = (0, -1)
E = (0, 1)
SW = (1, -1)
SE = (1, 1)
S = (1, 0)
for dirs in [NW, NE, N, W, E, SW, SE, S]:
dr, dc = r+dirs[0], c + dirs[1]
if (dr >= 0) and (dc >= 0) and (dr < ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _count_occupied_seats(grid: List[List[str]]) -> int:\n total = 0\n for row in grid:\n total += row.count('#')\n return total",
"def current_empty_seat_capacity(seats):\n\n count = 0\n for value in seats.values():\n if value is None:\n count += 1\n return count",
"def seats_... | [
"0.6715283",
"0.6524996",
"0.6408924",
"0.6402873",
"0.6360804",
"0.6327174",
"0.62909186",
"0.6258113",
"0.6242525",
"0.6229691",
"0.62004143",
"0.60982114",
"0.60528034",
"0.604524",
"0.60080475",
"0.5966134",
"0.58681643",
"0.5808522",
"0.5780155",
"0.5774151",
"0.56858176... | 0.6536511 | 1 |
Finds list of ages at which self is operable, given an action code and period index. | def operable_ages(self, acode, period):
if acode not in self.oper_expr: # action not defined for this development type
return None
if acode not in self.operability: # action not compiled yet...
if self.compile_action(acode) == -1: return None # never operable
#print ' '.j... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def operable_area(self, acode, period, age=None, cleanup=True):\n if acode not in self.oper_expr: # action not defined for this development type\n return 0.\n if acode not in self.operability: # action not xf yet...\n if self.compile_action(acode) == -1: return 0. # never operab... | [
"0.57310283",
"0.5494037",
"0.54118747",
"0.51305306",
"0.51187503",
"0.49973294",
"0.4975278",
"0.4958798",
"0.49460784",
"0.49432674",
"0.48911697",
"0.4885401",
"0.48824483",
"0.48414654",
"0.47789294",
"0.4757189",
"0.4733752",
"0.47196916",
"0.4679498",
"0.46779874",
"0.... | 0.72314113 | 0 |
Returns 0 if inoperable or no current inventory, operable area given action code and period (and optionally age) index otherwise. If cleanup switch activated (default True) and age specified, deletes the ageclass from the inventory dict if operable area is less than self.parent.area_epsilon. | def operable_area(self, acode, period, age=None, cleanup=True):
if acode not in self.oper_expr: # action not defined for this development type
return 0.
if acode not in self.operability: # action not xf yet...
if self.compile_action(acode) == -1: return 0. # never operable
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def operated_area(self, acode, period, dtype_key=None, age=None):\n aa = self.applied_actions\n acodes = [acode] if not self.actions[acode].components else self.actions[acode].components\n result = 0.\n for _acode in acodes:\n if not aa[period][_acode]: continue # acode not i... | [
"0.5982978",
"0.5829213",
"0.5593334",
"0.52672637",
"0.51853496",
"0.5139892",
"0.501493",
"0.49225226",
"0.48915955",
"0.48859534",
"0.4774885",
"0.4750933",
"0.46126634",
"0.45780426",
"0.45214644",
"0.4476918",
"0.43249077",
"0.43040457",
"0.42815745",
"0.4276488",
"0.425... | 0.7634237 | 0 |
If area not specified, returns area inventory for period (optionally age), else sets area for period and age. If delta switch active (default True), area value is interpreted as an increment on current inventory. | def area(self, period, age=None, area=None, delta=True):
#if area is not None:
# print area
# assert area > 0
if area is None: # return area for period and age
if age is not None:
try:
return self._areas[period][age]
e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def operable_area(self, acode, period, age=None, cleanup=True):\n if acode not in self.oper_expr: # action not defined for this development type\n return 0.\n if acode not in self.operability: # action not xf yet...\n if self.compile_action(acode) == -1: return 0. # never operab... | [
"0.6052793",
"0.5591807",
"0.55716765",
"0.5232068",
"0.51962745",
"0.5187001",
"0.5152284",
"0.5108339",
"0.5099686",
"0.5035934",
"0.501621",
"0.49866986",
"0.49677023",
"0.49651125",
"0.4946933",
"0.494232",
"0.4889495",
"0.48829818",
"0.4870416",
"0.48361272",
"0.48203772... | 0.7651682 | 0 |
Find lower and upper ages that correspond to lo and hi values of yname (interpreted as first occurence of yield value, reading curve from left and right, respectively). | def resolve_condition(self, yname, lo, hi):
return [x for x, y in enumerate(self.ycomp(yname)) if y >= lo and y <= hi] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_y_lims(ax, xlims):\n # Assuming that all objects have the same x coordinates\n x = ax.lines[0].get_data()[0]\n\n indexes = get_interval(x, xlims[0], xlims[1])\n xmax = x[indexes[-1]]\n xmin = x[indexes[0]]\n\n ymax_array = []\n ymin_array = []\n\n for function in ax.lines:\n ... | [
"0.55868065",
"0.55049986",
"0.5439196",
"0.5255182",
"0.51693994",
"0.5111991",
"0.51019424",
"0.50942266",
"0.50729465",
"0.506759",
"0.5050479",
"0.5050117",
"0.5047995",
"0.50241417",
"0.50070107",
"0.49804845",
"0.49706873",
"0.49690202",
"0.49561423",
"0.49334764",
"0.4... | 0.58015174 | 0 |
Compile action, given action code. This mostly involves resolving operability expression strings into lower and upper operability limits, defined as (alo, ahi) age pair for each period. Deletes action from self if not operable in any period. | def compile_action(self, acode, verbose=False):
self.operability[acode] = {}
for expr in self.oper_expr[acode]:
self._compile_oper_expr(acode, expr, verbose)
is_operable = False
for p in self.operability[acode]:
if self.operability[acode][p] is not None:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def apply_action(self,\n dtype_key,\n acode,\n period,\n age,\n area,\n override_operability=False,\n fuzzy_age=True,\n recourse_enabled=True,\n ... | [
"0.64787173",
"0.6218395",
"0.5926578",
"0.5614618",
"0.55862075",
"0.5527367",
"0.5463245",
"0.54156655",
"0.5375234",
"0.5361833",
"0.52600914",
"0.523041",
"0.51803124",
"0.5151889",
"0.511324",
"0.5086742",
"0.5080543",
"0.506999",
"0.5042478",
"0.50224036",
"0.50137955",... | 0.68223566 | 0 |
Compiles a ``ws3``compatible schedule data object from a solved ``ws3.opt.Problem`` instance. This is just a dispatcher functionthe actual compilation is done by a formulationspecific function (assumes Model I formulation if not specified). | def _compile_schedule_from_problem(self, problem, formulation=1, skip_null='null'):
cmp_sch_dsp = {1:self._cmp_sch_m1, 2:self._cmp_sch_m2}
return cmp_sch_dsp[formulation](problem, skip_null) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ParseSchedule(self, schedule_data):\n\n if self.verbose:\n\n print \"Parsing schedule data\"\n \n\n # Finds internal identifier for the schedule.\n if self._schedule_data.has_key('name'):\n\n self.name = schedule_data['name']\n\n if self.verbose:\n\n... | [
"0.5471679",
"0.54210335",
"0.52114284",
"0.5155557",
"0.5105128",
"0.5064243",
"0.50093895",
"0.49835217",
"0.49189463",
"0.4893358",
"0.48828745",
"0.48693562",
"0.48562363",
"0.4848915",
"0.4792907",
"0.47816586",
"0.4781495",
"0.47645974",
"0.4752894",
"0.4749579",
"0.473... | 0.6772769 | 0 |
Returns True if acode corresponds to a harvesting action. | def is_harvest(self, acode):
return self.actions[acode].is_harvest | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_action(self) -> bool:\n return self.is_action_str(self.content)",
"def is_operable(self, acode, period, age=None, verbose=False):\n if acode not in self.oper_expr: # action not defined for this development type\n if verbose: print('acode operability undefined', acode, self.oper_ex... | [
"0.59725296",
"0.5770838",
"0.56739867",
"0.56534123",
"0.55960196",
"0.5511425",
"0.54778045",
"0.54024774",
"0.54024774",
"0.53422105",
"0.52897286",
"0.52520436",
"0.5200968",
"0.51821417",
"0.51639044",
"0.5159332",
"0.51495326",
"0.5122392",
"0.5110338",
"0.50915223",
"0... | 0.7397736 | 0 |
Returns piece size, given development type key and age. | def piece_size(self, dtype_key, age):
return self.dtypes[dtype_key].ycomp(self.piece_size_yname)[age] * self.piece_size_factor | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def size(self, key):\n _id, feature = self._extract(key)\n return self.client.sound_feature_size(_id, feature)",
"def size(map):\n return map['size']",
"def format_length( self, key ) :\r\n\r\n return struct.calcsize( self[key] )",
"def size(self, key):\n with SessionContex... | [
"0.6205009",
"0.5990486",
"0.583302",
"0.57889605",
"0.5772121",
"0.5710032",
"0.5621882",
"0.5591637",
"0.5559694",
"0.5559439",
"0.55391383",
"0.55338615",
"0.55114245",
"0.55111974",
"0.549714",
"0.5463618",
"0.5455125",
"0.5455125",
"0.5411846",
"0.54018307",
"0.5396702",... | 0.79898787 | 0 |
Returns age class distribution (dict of areas, keys on age). | def age_class_distribution(self, period, mask=None, omit_null=False):
result = {age:0. for age in self.ages}
dtype_keys = self.unmask(mask) if mask else list(self.dtypes.keys())
for dtk in dtype_keys:
dt = self.dtypes[dtk]
for age in dt._areas[period]:
res... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_age_distribution(school_type, N_classes):\n\tage_bracket = get_age_bracket(school_type)\n\tclasses = list(range(1, N_classes + 1))\n\tN_age_bracket = len(age_bracket)\n\tclasses_per_age_bracket = int(N_classes / N_age_bracket)\n\t\n\tassert N_age_bracket <= N_classes, \\\n\t'not enough classes to accommoda... | [
"0.6470147",
"0.6168313",
"0.5975464",
"0.583923",
"0.583923",
"0.57348573",
"0.573085",
"0.5639778",
"0.55985576",
"0.54872036",
"0.5476976",
"0.5472595",
"0.5447628",
"0.54171705",
"0.5410002",
"0.54087645",
"0.5408529",
"0.538649",
"0.5312717",
"0.531071",
"0.53057885",
... | 0.71532667 | 0 |
Returns dict (keyed on development type key, values are lists of operable ages). | def operable_dtypes(self, acode, period, mask=None):
result = {}
dtype_keys = self.unmask(mask) if mask else list(self.dtypes.keys())
for dtk in dtype_keys:
dt = self.dtypes[dtk]
operable_ages = dt.operable_ages(acode, period)
if operable_ages:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_age_fields():\n under_18_fields = CensusFields.get_under_18_fields()\n\n age_18_to_29_fields = [ \n 'B01001_007E', # Male:!!18 and 19 years\n 'B01001_008E', # Male:!!20 years\n 'B01001_009E', # Male:!!21 years\n 'B010... | [
"0.55362785",
"0.5372546",
"0.51961905",
"0.5175087",
"0.5160347",
"0.51452124",
"0.5137768",
"0.51104254",
"0.51014876",
"0.50635105",
"0.50098515",
"0.49963596",
"0.49943766",
"0.49836385",
"0.4972278",
"0.49589777",
"0.495749",
"0.49408603",
"0.4924057",
"0.49073407",
"0.4... | 0.5507808 | 1 |
Flexible method that compiles inventory at given period. Unit of return data defaults to area if yname not given, but takes on unit of yield component otherwise. Can be constrained by age and development type mask. | def inventory(self, period, yname=None, age=None, mask=None, dtype_keys=None, verbose=0):
result = 0.
assert not (mask and dtype_keys) # too confusing to allow both to be specified...
if mask:
_dtype_keys = self.unmask(mask, verbose=verbose)
elif dtype_keys:
_dtyp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_inventory(inventory_acronym, year):\n if inventory_acronym not in config()['databases']:\n raise stewi.exceptions.InventoryNotAvailableError(\n message=f'\"{inventory_acronym}\" is not an available inventory')\n year = str(year)\n if inventory_acronym == 'DMR':\n impo... | [
"0.5300034",
"0.5109352",
"0.4844655",
"0.48236218",
"0.4789403",
"0.47848022",
"0.47692063",
"0.47642335",
"0.47508278",
"0.46735826",
"0.465337",
"0.46064305",
"0.4605901",
"0.460266",
"0.4598115",
"0.45961973",
"0.45831624",
"0.456988",
"0.45686674",
"0.45567507",
"0.45536... | 0.6550419 | 0 |
Reset areas for all development types. | def reset_areas(self, period=None):
for dtk in self.dtypes: self.dtypes[dtk].reset_areas(period) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_areas(self, reset_areas=True):\n if reset_areas: self.reset_areas()\n #for dt in list(self.dtypes.values()): dt.initialize_areas()\n for dtk in self.dtypes: self.dtypes[dtk].initialize_areas()",
"def initialize_areas(self):\n self._areas[1] = copy.copy(self._areas[0])",... | [
"0.66218",
"0.597099",
"0.59423006",
"0.5931105",
"0.5864978",
"0.58162785",
"0.57571673",
"0.57516545",
"0.5746114",
"0.57301205",
"0.5705987",
"0.5687439",
"0.56759906",
"0.56496674",
"0.5638841",
"0.562681",
"0.56082135",
"0.5584203",
"0.5565821",
"0.55646116",
"0.5555733"... | 0.70297825 | 0 |
Add curve to global curve hash map (uses result of Curve.points() to construct hash key). | def register_curve(self, curve):
key = tuple(curve.points())
if key not in self.curves:
# new curve (lock and register)
curve.is_locked = True # points list must not change, else not valid key
self.curves[key] = curve
return self.curves[key] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_curve(self, name, curve_type, xy_tuples_list):\n self._curve_reg.add_curve(name, curve_type, xy_tuples_list)",
"def add_curve(self):\n pv_name = self._get_full_pv_name(self.pv_name_line_edt.text())\n color = random_color()\n for k, v in self.channel_map.items():\n i... | [
"0.61740005",
"0.6057621",
"0.6029668",
"0.58368933",
"0.5535679",
"0.5424308",
"0.5347813",
"0.52841836",
"0.52598035",
"0.52575344",
"0.5251958",
"0.5174343",
"0.51616096",
"0.5108131",
"0.50955397",
"0.5092081",
"0.5068873",
"0.50653344",
"0.5061218",
"0.5051847",
"0.50376... | 0.72213733 | 0 |
Resets actions. By default resets, all actions in all periods (except for sticky actions, unless overridden), unless period or acode specified. | def reset_actions(self, period=None, acode=None, override_sticky=False):
periods = [period] if period else self.periods
acodes = [acode] if acode else list(self.actions.keys())
for p in periods:
if p not in self.applied_actions: self.applied_actions[p] = {}
for a in acode... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def interactive_reset(self):\n # Set the initial state\n\n self.dataset.reset()\n\n self.current_turn = 0\n self.current_function = None\n self.query = \"\"\n self.query_vector = np.ones(self.dataset.getVocabularySize())\n self.keywords={\"provided\":set(), \"reject... | [
"0.6504627",
"0.6461739",
"0.6323377",
"0.63229835",
"0.63126093",
"0.6239833",
"0.6236174",
"0.6196113",
"0.61621034",
"0.61560005",
"0.6109344",
"0.61011755",
"0.60995984",
"0.6093231",
"0.6092252",
"0.6092252",
"0.6092252",
"0.60766155",
"0.6063931",
"0.602806",
"0.6025277... | 0.79631025 | 0 |
Compiles products from applied actions in given period. Parses string expression, which resolves to a single coefficient. Operated area can be filtered on action code, development type key list, and age. Result is product of sum of filtered area and coefficient. | def compile_product(self,
period,
expr,
acode=None,
dtype_keys=None,
age=None,
coeff=False,
verbose=False):
aa = self.applied_actions
if... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def evaluate(compiled_expression):",
"def evaluate_cost_terms(\n self, x: Dict[str, ArrayType], p: Dict[str, ArrayType]\n ) -> List:\n\n x = self.opt.decision_variables.dict2vec(x)\n p = self.opt.parameters.dict2vec(p)\n\n @dataclass\n class CostTerm:\n label: str... | [
"0.5505961",
"0.5398151",
"0.52842385",
"0.5141982",
"0.51267755",
"0.507049",
"0.50524485",
"0.50483197",
"0.50053805",
"0.5002281",
"0.49944323",
"0.49923718",
"0.49911544",
"0.49653813",
"0.49071056",
"0.48969182",
"0.48801827",
"0.48533046",
"0.48529422",
"0.485053",
"0.4... | 0.7294837 | 0 |
Attempts to repair the action schedule for given period, using an AreaSelector object (defaults to classdefault areaselector, which is a simple greedy oldestfirst selector). | def repair_actions(self, period, areaselector=None, verbose=False):
if areaselector is None: # use default (greedy) selector
areaselector = self.areaselector
aa = copy.copy(self.applied_actions[period])
self.reset_actions(period)
for acode in aa:
if not aa[acode]:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def apply_schedule(self, schedule, max_period=None, verbose=False,\n fail_on_missingarea=False, force_integral_area=False,\n override_operability=False, fuzzy_age=True,\n recourse_enabled=True, areaselector=None,\n compile_t_yc... | [
"0.5839668",
"0.5197716",
"0.4876472",
"0.48549235",
"0.4759201",
"0.4750308",
"0.47344556",
"0.4682085",
"0.44912675",
"0.4439031",
"0.43764606",
"0.43261418",
"0.4285451",
"0.42804313",
"0.42797333",
"0.42369288",
"0.42270935",
"0.4224267",
"0.4219325",
"0.4215559",
"0.4212... | 0.69920784 | 0 |
Commits applied actions (i.e., apply transitions and grow, default starting at period 1). By default, will attempt to repair broken (infeasible) future actions, attempting to replace infeasiblea operated area using default AreaSelector. | def commit_actions(self, period=1, repair_future_actions=False, verbose=False):
while period < self.horizon:
if verbose: print('growing period', period)
self.grow(period, cascade=False)
period += 1
if repair_future_actions:
if verbose: print('repai... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def repair_actions(self, period, areaselector=None, verbose=False):\n if areaselector is None: # use default (greedy) selector\n areaselector = self.areaselector\n aa = copy.copy(self.applied_actions[period])\n self.reset_actions(period)\n for acode in aa:\n if not... | [
"0.62637275",
"0.61838186",
"0.5771203",
"0.55451816",
"0.5525394",
"0.55111825",
"0.54827845",
"0.53733814",
"0.526053",
"0.52534574",
"0.52534574",
"0.52534574",
"0.52534574",
"0.52534574",
"0.5247396",
"0.5244018",
"0.520151",
"0.5184016",
"0.5144568",
"0.5127912",
"0.5121... | 0.6935994 | 0 |
Applies action, given action code, development type, period, age, area. Can optionally override operability limits, optionally use fuzzy age (i.e., attempt to apply action to proximal age class if specified age is not operable), optionally use default AreaSelector to patch missing area (if recourse enabled). Applying a... | def apply_action(self,
dtype_key,
acode,
period,
age,
area,
override_operability=False,
fuzzy_age=True,
recourse_enabled=True,
area... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def operable_area(self, acode, period, age=None, cleanup=True):\n if acode not in self.oper_expr: # action not defined for this development type\n return 0.\n if acode not in self.operability: # action not xf yet...\n if self.compile_action(acode) == -1: return 0. # never operab... | [
"0.64110035",
"0.6302497",
"0.6214289",
"0.6048416",
"0.54773015",
"0.54648197",
"0.5331544",
"0.5252251",
"0.52433807",
"0.5145422",
"0.5086403",
"0.50728357",
"0.50485057",
"0.5018748",
"0.49619383",
"0.49356374",
"0.49290535",
"0.49275786",
"0.49135202",
"0.49135202",
"0.4... | 0.7931774 | 0 |
Creates a new development type, given a key (checks for existing, autoassigns yield compompontents, autoassign actions and transitions, checks for operability (filed under inoperable if applicable). | def create_dtype_fromkey(self, key):
assert key not in self.dtypes # should not be creating new dtypes from existing key
dt = DevelopmentType(key, self)
self.dtypes[key] = dt
# assign yields
for mask, t, ycomps in self.yields:
if self.match_mask(mask, key):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_model(self, key):\n pass",
"def new_key(self, key_name=None, key_type=Key.KEY_REGULAR_FILE):\r\n if key_name == '-':\r\n return Key(self.name, '-', key_type=Key.KEY_STREAM_WRITABLE)\r\n else:\r\n dir_name = os.path.dirname(key_name)\r\n if dir_nam... | [
"0.5487726",
"0.5322545",
"0.5309833",
"0.5286063",
"0.5168245",
"0.5166427",
"0.5119098",
"0.50685036",
"0.50529814",
"0.4999523",
"0.4945696",
"0.49058312",
"0.48480543",
"0.48184073",
"0.48131382",
"0.47808406",
"0.47745794",
"0.47577974",
"0.47450778",
"0.47206655",
"0.46... | 0.6473837 | 0 |
Imports OUTPUTS section from a Forest model. | def import_outputs_section(self, filename_suffix='out'):
with open('%s/%s.%s' % (self.model_path, self.model_name, filename_suffix)) as f:
s = f.read()
self._resolve_outputs_buffer(s) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def output_model(output_dir=\"./output\", model_out=None): \n # Find the path of MODEL_INIT via the parameter file\n par_file = os.path.join(output_dir, \"seisflows_paths.json\")\n with open(par_file) as f:\n model_init = json.load(f)[\"MODEL_INIT\"]\n\n assert(os.path.exists(model_init)), \\\n ... | [
"0.5724457",
"0.56440115",
"0.5359246",
"0.5340634",
"0.53270763",
"0.5315599",
"0.52801937",
"0.52633935",
"0.5192908",
"0.5178826",
"0.5173176",
"0.5161663",
"0.5144444",
"0.51305676",
"0.5097325",
"0.5075561",
"0.5069053",
"0.5043739",
"0.50332147",
"0.503114",
"0.5031023"... | 0.66379744 | 0 |
Return list of base codes, given theme index. | def theme_basecodes(self, theme_index):
return self._theme_basecodes[theme_index]
#return self._themes[theme_index] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def base_codes(self):\n bases = []\n\n if self.is_gas_giant:\n bases.append(\"G\")\n if self.is_naval_base:\n bases.append(\"N\")\n if self.is_scout_base:\n bases.append(\"S\")\n if self.is_research_base:\n bases.append(\"R\")\n ... | [
"0.5895152",
"0.5721587",
"0.52216053",
"0.5210536",
"0.5209015",
"0.5065608",
"0.49874663",
"0.49656355",
"0.49587414",
"0.49548954",
"0.49481997",
"0.49246532",
"0.48907596",
"0.48420018",
"0.4811012",
"0.4793229",
"0.47804096",
"0.47783545",
"0.47334346",
"0.4728971",
"0.4... | 0.87302667 | 0 |
Imports AREAS section from a Forest model. | def import_areas_section(self, model_path=None, model_name=None, filename_suffix='are', import_empty=False):
n = self.nthemes
model_path = self.model_path if not model_path else model_path
model_name = self.model_name if not model_name else model_name
with open('%s/%s.%s' % (model_path, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def importAovs(self):\n\t\tLayersInfo = pickle.load( open( self.aovsPath.path, \"rb\") )\n\t\tmc.refresh( su = 1 )\n\t\tfor ao in LayersInfo.keys():\n\t\t\taov.create( ao, LayersInfo[ao]['name'], LayersInfo[ao]['type'], LayersInfo[ao]['enabled'] )\n\t\tmc.refresh( su = 0 )",
"def import_model(file):\n fil... | [
"0.54224354",
"0.53636026",
"0.52923703",
"0.52473813",
"0.5118948",
"0.4977732",
"0.49688882",
"0.4935511",
"0.48683354",
"0.48439878",
"0.48425835",
"0.47981134",
"0.4795735",
"0.47888428",
"0.47816083",
"0.47655794",
"0.47630295",
"0.4756663",
"0.4752264",
"0.4738259",
"0.... | 0.673126 | 0 |
Returns True if key matches mask. | def match_mask(self, mask, key):
#dt = self.dtypes[key]
for ti, tac in enumerate(mask):
if tac == '?': continue # wildcard matches all keys
tacs = self._expand_theme(self._themes[ti], tac)
if key[ti] not in tacs: return False # reject key
return True # key mat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_mask(self):\r\n return hasattr(self, '_has_mask')",
"def set_mask_key(self, func):\r\n self.get_mask_key = func",
"def contains(self, key: int) -> bool:\n return key in self.data[key % self._MOD]",
"def __contains__(self, key):\n bits_per_slice = self.bits_per_slice\n ... | [
"0.62687284",
"0.6144325",
"0.60913515",
"0.60840225",
"0.6020554",
"0.5985479",
"0.5955989",
"0.5945683",
"0.59443605",
"0.5868401",
"0.58454764",
"0.58058375",
"0.5784072",
"0.5711109",
"0.5678629",
"0.56548256",
"0.56419176",
"0.5638721",
"0.56294066",
"0.5600069",
"0.5574... | 0.82043236 | 0 |
Iteratively filter list of development type keys using mask values. Accepts Woodstockstyle string masks to facilitate cutandpaste testing. | def unmask(self, mask, verbose=0):
if isinstance(mask, str): # Woodstock-style string mask format
mask = tuple(re.sub('\s+', ' ', mask).lower().split(' '))
assert len(mask) == self.nthemes # must be bad mask if wrong theme count
else:
try:
assert isins... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter_dict(fdict, mask):\n\n if fdict is None:\n fdict = dict()\n\n if mask is None:\n mask = []\n\n return {k: v for (k, v) in fdict.items() if k in mask}",
"def filter_record_keys(record_list, whitelist_keys):\n\n filtered = [{k: v for k, v in [y for y in list(x.items()) if y[0] ... | [
"0.5827519",
"0.55769837",
"0.5479636",
"0.53060806",
"0.5260053",
"0.5196186",
"0.51753443",
"0.5173389",
"0.515569",
"0.51295424",
"0.5088756",
"0.5082667",
"0.50534916",
"0.50424045",
"0.5040088",
"0.5039556",
"0.503773",
"0.5032465",
"0.50220805",
"0.5016471",
"0.50111955... | 0.6153337 | 0 |
Imports CONSTANTS section from a Forest model. | def import_constants_section(self, filename_suffix='con'):
with open('%s/%s.%s' % (self.model_path, self.model_name, filename_suffix)) as f:
for lnum, l in enumerate(f):
if re.match('^\s*(;|$)', l): continue # skip comments and blank lines
l = l.strip().partition(';')... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_from_constants(self):\n constant_settings = import_module('mindinsight.conf.constants')\n for setting in dir(constant_settings):\n if setting.isupper():\n setattr(self, setting, getattr(constant_settings, setting))",
"def materialize_import_flags(self, model: comm... | [
"0.5763958",
"0.519372",
"0.50305206",
"0.4999248",
"0.49318987",
"0.48889506",
"0.4856151",
"0.46824628",
"0.4678243",
"0.4672648",
"0.46313486",
"0.462175",
"0.46142548",
"0.46018723",
"0.45797747",
"0.45630202",
"0.45470962",
"0.45337692",
"0.45327327",
"0.45060423",
"0.45... | 0.66772157 | 0 |
Imports YIELDS section from a Forest model. | def import_yields_section(self, filename_suffix='yld', mask_func=None, verbose=False):
###################################################
# local utility functions #########################
def flush_ycomps(t, m, n, c):
#if verbose: print t, m, n, c
#self.ycomps.update(n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enaml_importer():\n print(imports, dir(imports))\n old = imports.get_importers()\n\n yield imports\n\n imports._imports__importers = old",
"def _import_elmo():\n\n elmo = hub.Module('https://storage.googleapis.com/az-nlp/elmo_ru-news_wmt11-16_1.5M_steps.tar.gz',\n trainable=Fa... | [
"0.55694664",
"0.4926263",
"0.48883265",
"0.4857116",
"0.4763702",
"0.47102526",
"0.46849427",
"0.46801615",
"0.46705833",
"0.4645941",
"0.4636692",
"0.45706296",
"0.45513415",
"0.4541428",
"0.45208028",
"0.4512938",
"0.45107028",
"0.45060354",
"0.44993657",
"0.44895953",
"0.... | 0.51335835 | 1 |
Imports ACTIONS section from a Forest model. | def import_actions_section(self, filename_suffix='act', mask_func=None, nthemes=None):
nthemes = nthemes if nthemes else self.nthemes
actions = {}
#oper = {}
aggregates = {}
partials = {}
keyword = ''
with open('%s/%s.%s' % (self.model_path, self.model_name, filen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def actions():\n pass",
"def actions(self):\n from moztrap.view.lists.actions import actions\n return actions",
"def actions(self):\n raise NotImplementedError",
"def actions() -> None:\n pass",
"def actions(self):\n self._actions = {}\n self._actions['getItems'] = ... | [
"0.55914086",
"0.55403864",
"0.5410568",
"0.53825384",
"0.5302345",
"0.524244",
"0.52243316",
"0.5222773",
"0.52000445",
"0.5166486",
"0.5131897",
"0.51089656",
"0.51089656",
"0.50976884",
"0.50939345",
"0.5052604",
"0.5052343",
"0.5022828",
"0.5022828",
"0.5022828",
"0.50077... | 0.6322886 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.