query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Build the decision tree
def buildTree(data, level): node = maxIG(data) subsets = splitBy(data, node[0]) header = ["Outlook", "Temp", "Humidity", "Wind", "Play"] if node[1] == 0: print("\t" * level, level, getColumn(data, node[0])[0], ":", getColumn(data, -1)[0]) elif level < 4: p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_decision_tree():\n\n decision_tree_root = None\n decision_tree_root = DecisionNode(None,None,lambda feature:feature[0]==1)\n decision_tree_root.left = DecisionNode(None,None,None,1)\n decision_tree_root.right = DecisionNode(None,None,lambda feature:feature[3]==1)\n decision_tree_root.right...
[ "0.7623397", "0.73653334", "0.72419083", "0.7224621", "0.701551", "0.69989246", "0.68689287", "0.6819133", "0.6815177", "0.67908794", "0.675017", "0.67482513", "0.67481315", "0.6737991", "0.67176723", "0.6646255", "0.65618885", "0.65146697", "0.6460597", "0.6337855", "0.63327...
0.0
-1
Returns the definition for unit with name `definition_name`.
def get_definition(self, definition_name, unit_type): if unit_type == pu.UnitType.alias: relevant_dict = self.alias_definitions elif unit_type == pu.UnitType.slot: relevant_dict = self.slot_definitions elif unit_type == pu.UnitType.intent: relevant_dict = self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_definition(self, name):\n if self.is_defined(name):\n return self._definitions[name]\n return None", "def get_def(self, def_name):\n if not def_name:\n return None\n for defi in self._definitions:\n if defi._name == def_name:\n r...
[ "0.72344184", "0.63266414", "0.63032293", "0.6179592", "0.6067163", "0.6035977", "0.58439296", "0.5780957", "0.57687986", "0.5746453", "0.5741409", "0.5714593", "0.56843793", "0.5671426", "0.5670899", "0.5664608", "0.5657939", "0.56444097", "0.5607851", "0.5600935", "0.557700...
0.7419221
0
Parses the master file and subsequent files and transforms the information parsed into a dictionary of declaration names > rules.
def parse(self): print_DBG("Parsing master file: "+self.tokenizer.get_file_information()[0]) for token_line in self.tokenizer.next_tokenized_line(): if not token_line[0].isspace(): if token_line[0] == pu.INCLUDE_FILE_SYM: self.tokenizer.open_file(token_lin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_master_mapping_file(master_mapping_file, bcos):\n bco_names = []\n\n mapping_dict = {\n }\n\n for bco in bcos:\n bco_names.append(os.path.splitext(os.path.basename(bco))[0])\n mapping_dict[os.path.splitext(os.path.basename(bco))[0]] = {\n \"missing\": {\n\n ...
[ "0.60867506", "0.578407", "0.5697687", "0.5682963", "0.5680399", "0.5605115", "0.55050564", "0.5500258", "0.54917365", "0.54871374", "0.54120314", "0.5396366", "0.53410786", "0.5339711", "0.5313843", "0.5282944", "0.52651393", "0.52578163", "0.52340865", "0.52198327", "0.5214...
0.74442387
0
Parses a line (as tokens) that contains a declaration initiator.
def _parse_declaration_initiator(self, token_line): if self._expecting_rule: self.tokenizer.syntax_error("Expected a generation rule, got a "+ "unit declaration instead.") unit_type = pu.get_unit_type_from_sym(token_line[0]) declaration_inter...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Declaration(self):\n type = self.Type()\n if self.currtok[1].name == \"IDENT\":\n self.ids[self.currtok[0]] = type\n id = self.primary()\n\n if self.currtok[1].name == \"SEMI\":\n self.currtok = next(self.tg)\n return DeclarationExpr(...
[ "0.60595083", "0.57688266", "0.57019955", "0.5691983", "0.5684513", "0.56226003", "0.552998", "0.55017716", "0.5465409", "0.5453657", "0.5441814", "0.52609015", "0.5220658", "0.520444", "0.5193987", "0.5159767", "0.5131876", "0.5129617", "0.5114839", "0.51058304", "0.5096995"...
0.8207203
0
Creates a unit of type `unit_type` with name `unit_name` and modifiers `modifiers` inside the relevant dictionary (`alias_definitions`, `slot_definitions` or `intent_definitions`). `modifiers` is a `UnitDeclarationModifiersRepr` and `nb_examples_asked` is a tuple (training, test).
def create_unit(self, unit_type, unit_name, modifiers, nb_examples_asked=None): new_unit = None relevant_dict = None if unit_type == pu.UnitType.alias: new_unit = AliasDefinition(unit_name, modifiers) # new_unit = AliasDefinition(unit_name, [], modifie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_unit(self, unit_type):\n unit = None\n\n if unit_type == 'ElfRider':\n unit = ElfRider()\n elif unit_type == 'Knight':\n unit = Knight()\n elif unit_type == \"DwarfFighter\":\n unit = DwarfFighter()\n elif unit_type == 'OrcRider':\n ...
[ "0.6863574", "0.62725776", "0.6256398", "0.6254103", "0.60253644", "0.5939342", "0.58484507", "0.57158554", "0.56877196", "0.5604188", "0.5513164", "0.5367513", "0.5357851", "0.53299356", "0.5321212", "0.5317357", "0.52819335", "0.5246464", "0.51694965", "0.5160825", "0.51535...
0.8705934
0
Parses the list of string `tokens` that represents a rule in a template file and add the rule to the declaration currently being parsed.
def _parse_rule(self, tokens): if self._currently_parsed_declaration is None: self.tokenizer.syntax_error("Got a rule outside of "+ "a unit declaration.") self._check_indentation(tokens[0]) sub_rules = self.tokens_to_sub_rules(tokens[1:]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_rules(self, rules: List):\n self.template.extend(rules)", "def insert_tokens(self, token_list):\n\n assert type(token_list) == list, \"Token list should be a list of tuples of the format (token_name, regex).\"\n\n self.tokens += token_list\n self.__create_regex()", "def appl...
[ "0.6217032", "0.5957868", "0.57224643", "0.56512535", "0.5468249", "0.5428751", "0.54161507", "0.5412818", "0.5250332", "0.5239056", "0.5192862", "0.507564", "0.50741833", "0.50386393", "0.5019195", "0.4952552", "0.4938836", "0.49024025", "0.4873259", "0.4867532", "0.48509473...
0.58242035
2
Checks that the str `indentation` is the same as the expected indentation from the last parsed rule. Raises a `SyntaxError` if it isn't.
def _check_indentation(self, indentation): if self._expected_indentation is None: self._expected_indentation = indentation return if indentation != self._expected_indentation: self.tokenizer.syntax_error("Inconsistent indentation.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_indentation(code: str, path: pathlib.Path = None):\n if not isinstance(code, str):\n raise TypeError('code must be string but {} given'.format(type(code)))\n assert path is None or isinstance(path, pathlib.Path), type(path)\n\n lines = code.splitlines(keepends=True)\n whitespace = r...
[ "0.6527587", "0.598616", "0.598616", "0.5967331", "0.57532173", "0.5659602", "0.56493586", "0.5569273", "0.550822", "0.53785354", "0.53224736", "0.5262904", "0.52626956", "0.51944107", "0.5175933", "0.5161552", "0.51611274", "0.5155272", "0.51426595", "0.5091848", "0.50561875...
0.78708684
0
Transforms a list of tokens into a list of subrules
def tokens_to_sub_rules(self, tokens): # Remove alternative slot rule if necessary alt_slot_value = None # TODO DummySlotVal absolutely need to be managed differently if self._currently_parsed_declaration[0] == pu.UnitType.slot: answer = pu.find_alt_slot_and_index(tokens) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_rules(self, token_parse_list):\r\n return token_parse_list", "def extract_rules(self, labels=None):\n # Extract flat list of rules in array form\n if isinstance(self.base_estimator, RandomForestClassifier):\n rules = list(it.chain(*[self.__extract_dt_rules__(dt) for dt i...
[ "0.6186922", "0.60484374", "0.5945183", "0.5885389", "0.5819015", "0.56935894", "0.56846756", "0.5673392", "0.5631876", "0.55965734", "0.55585086", "0.5541569", "0.5531376", "0.5428534", "0.53792447", "0.53696585", "0.53554046", "0.53478056", "0.53404236", "0.534006", "0.5325...
0.6196971
0
Checks that the subrule represented by `interior_tokens` is syntactically valid.
def _check_sub_rule_validity(self, interior_tokens, sub_rule_type): try: if sub_rule_type == pu.SubRuleType.word_group: pu.check_word_group_validity(interior_tokens) elif sub_rule_type == pu.SubRuleType.choice: pu.check_choice_validity(interior_tokens) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_composite_tokens(self, name, tokens):\n assert len(tokens) >= 2\n key = tokens[0]\n\n assert key.value.lower() == name\n assert tokens[-1].value.lower() == \"end\"\n\n if len(tokens) == 2:\n body = [] # empty TYPE..END block\n else:\n body ...
[ "0.5497027", "0.5389574", "0.5389574", "0.51875174", "0.5152841", "0.5063203", "0.49809048", "0.49645007", "0.49629456", "0.49387994", "0.49272373", "0.49200037", "0.49097204", "0.48745412", "0.48715726", "0.48682913", "0.48433882", "0.48420814", "0.48327184", "0.4830428", "0...
0.7403252
0
Renames the unit declaration of type `unit_type` from `old_name` to `new_name` (possibly replacing the unit with that name). Raises a `KeyError` if `old_name` is not a declared unit.
def rename_unit(self, unit_type, old_name, new_name): if unit_type == pu.UnitType.alias: relevant_dict = self.alias_definitions elif unit_type == pu.UnitType.slot: relevant_dict = self.slot_definitions elif unit_type == pu.UnitType: relevant_dict = self.intent...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def renameKey(self, oldKey, newKey, meta=None, units=None):\n\n if meta:\n if oldKey not in meta:\n return\n meta.replaceKey(oldKey, newKey)\n if units:\n if oldKey not in units:\n return\n units.replaceKey(oldKey, newKey)", ...
[ "0.6078044", "0.60575974", "0.5870249", "0.58238894", "0.57904357", "0.56272036", "0.5613752", "0.551229", "0.551229", "0.54903346", "0.54142356", "0.541372", "0.5401158", "0.53964615", "0.5391015", "0.538513", "0.533361", "0.5305564", "0.52826214", "0.52747434", "0.5249805",...
0.8716253
0
Deletes a unit definition.
def delete(self, unit_type, unit_name, variation_name=None): if unit_type == pu.UnitType.alias: relevant_dict = self.alias_definitions stat_key = "#aliases" elif unit_type == pu.UnitType.slot: relevant_dict = self.slot_definitions stat_key = "#slots" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def removeUnitDefinition(self, *args):\n return _libsbml.Model_removeUnitDefinition(self, *args)", "def delete(self):\n key = self.request.get('key')\n\n if not self.assert_xsrf_token_or_fail(\n self.request, 'delete-unit', {'key': key}):\n return\n\n if not ...
[ "0.732434", "0.6751945", "0.6362059", "0.6315331", "0.62406754", "0.6101216", "0.6085688", "0.5932826", "0.5915547", "0.58609813", "0.57939345", "0.56276876", "0.5566255", "0.5560605", "0.55542415", "0.5517972", "0.5458577", "0.5439751", "0.5436361", "0.54343516", "0.54220444...
0.6920054
1
Adds an already built definition to the list of declared units.
def add_definition(self, unit_type, unit_name, definition): if unit_type == pu.UnitType.alias: relevant_dict = self.alias_definitions stat_key = "#aliases" elif unit_type == pu.UnitType.slot: relevant_dict = self.slot_definitions stat_key = "#slots" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addUnitDefinition(self, *args):\n return _libsbml.Model_addUnitDefinition(self, *args)", "def insert_definition(self, definition):\r\n self.definitions.insert(definition)", "def add_definition(self, definition):\n self._definitions[definition.name] = definition", "def addUnit(self, *...
[ "0.6652101", "0.62057215", "0.61890745", "0.5981908", "0.597683", "0.59402233", "0.58646315", "0.58580893", "0.5674745", "0.5613364", "0.545894", "0.5456516", "0.5444362", "0.53415227", "0.52771723", "0.527371", "0.52607644", "0.525298", "0.52528954", "0.52448136", "0.5241117...
0.6550536
1
Do whatever is needed to have the box Working, like connecting to databases, getting needed parameters, etc
def __init__(self, *args, **kwargs): self.update(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def os_start_db( self, ):\r\n pass", "def connect(self):\n pwd = self.passwordEdit.text()\n user = self.usernameEdit.text()\n url = self.backendEdit.text()\n\n if user == \"\":\n user = None\n if pwd == \"\":\n pwd = None\n\n auth = self.con...
[ "0.6297941", "0.62816715", "0.62472177", "0.6076363", "0.60625684", "0.60310054", "0.6024862", "0.60142833", "0.6013913", "0.6013913", "0.6003923", "0.5982284", "0.597791", "0.59599304", "0.5925516", "0.59009486", "0.58777225", "0.5855192", "0.5825399", "0.5779079", "0.577830...
0.0
-1
Let's display our Box content
def __repr__(self, *args, **kwargs): result ='{' for (k, v) in self.items(*args, **kwargs): result += repr(k) + ": " + repr(v) + "," result = result[:-1] + '}' return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def box(self) -> None:\n self.screen.box()", "def show(self):\r\n display(self.grid_part)", "def display(self):\n width = 1 + max(len(self.values[s]) for s in self.boxes)\n line = 'x'.join(['-'*(width*3)]*3)\n for r in self.rows:\n print(''.join(self.values[r+c].ce...
[ "0.6970078", "0.66412747", "0.65527636", "0.654283", "0.6489814", "0.6355681", "0.6348469", "0.61675423", "0.61346054", "0.611562", "0.6096315", "0.60569906", "0.6044113", "0.60230255", "0.60131484", "0.5989969", "0.5946924", "0.594632", "0.59206116", "0.5901945", "0.58962774...
0.0
-1
Return the length of the box, ie the number of keys
def __len__(self, *args, **kwargs): return len(self._list(*args, **kwargs))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __len__(self):\n return len(self.name_and_box_index)", "def length(self):\n return pyvista.Box(self.bounds).length", "def length(self):\n # TODO: Count number of key-value entries in each of the buckets\n return self.size\n # for bucket in self.buckets():", "def getNumb...
[ "0.7549395", "0.73779494", "0.7292861", "0.7270157", "0.71937984", "0.71814114", "0.7116411", "0.70783395", "0.7069969", "0.7034821", "0.7034821", "0.7034821", "0.70135105", "0.69604254", "0.6941469", "0.69326866", "0.6927963", "0.69122046", "0.689848", "0.689801", "0.689801"...
0.0
-1
Return the File like object associated to a key
def __getitem__(self, key, *args, **kwargs): # And if it exist if not self.has_key(key, *args, **kwargs): raise IndexError return self._get(key, *args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file(self, key):\n result = (None, None)\n path = os.path.join(self.directory, self.subdirectory, key)\n if os.path.isfile(path):\n content_type, _ = mimetypes.guess_type(path)\n with open(path, \"rb\") as file:\n result = content_type, file.read()\...
[ "0.7402981", "0.7396121", "0.67223567", "0.6574202", "0.6513079", "0.6461926", "0.63906527", "0.6378118", "0.6342053", "0.6300237", "0.6271362", "0.6247083", "0.62446433", "0.6169464", "0.6167233", "0.6167233", "0.6164922", "0.6126087", "0.61220825", "0.6080943", "0.60761184"...
0.0
-1
Let's assign the document to a specific place in the Box
def __setitem__(self, key, document, *args, **kwargs): self._put(key, document, *args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_document():", "def define_box_location(self):\n self.contents['Box_ID'] = np.ones(self.numatom) * self.num_box", "def _put(self, name, document):\n raise NotImplementedError", "def document(self, document):\n\n self._document = document", "def document(self, document):\n\n ...
[ "0.6500657", "0.6379893", "0.5859167", "0.58119535", "0.58119535", "0.5648817", "0.5648132", "0.5608137", "0.55838746", "0.5473571", "0.54608184", "0.5435312", "0.5435312", "0.5435312", "0.5435312", "0.5435312", "0.5435312", "0.5435312", "0.5435312", "0.5435312", "0.5435312",...
0.0
-1
Delete an item from the box
def __delitem__(self, key, *args, **kwargs): self._del(key, *args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, box):\n boom = box.GetSelection()\n if boom == box.GetRootItem():\n return\n\n item_data = box.GetItemData(boom).GetData()\n\n if isinstance(item_data, data_types.ProductData):\n boom = box.GetItemParent(boom)\n item_data = box.GetItemDa...
[ "0.799132", "0.7552727", "0.74391794", "0.7338039", "0.72282916", "0.71293783", "0.70990616", "0.7088416", "0.7064737", "0.70392716", "0.70376575", "0.69746894", "0.69746894", "0.69288194", "0.69267917", "0.6904008", "0.6899043", "0.6876089", "0.6865989", "0.6847135", "0.6844...
0.0
-1
Let's iterate over keys
def __iter__(self, *args, **kwargs): for key in self.keys(*args, **kwargs): yield key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iterkeys(self):", "def iterkeys(self):", "def iterate_keys(\n self,\n keys: istr = None,\n terms: istr = None,\n prefixes: istr = None,\n labels: istr = None,\n ) -> Iterable[str]:", "def keysAll():", "def iterkeys(d):\r\n return iter(getattr(d, _iterkeys)())", ...
[ "0.8028127", "0.8028127", "0.75702435", "0.7447725", "0.7096699", "0.7065386", "0.7054807", "0.7042659", "0.70120496", "0.69577056", "0.68988377", "0.6898542", "0.6833501", "0.681694", "0.6812973", "0.67881155", "0.67873925", "0.67873925", "0.67829543", "0.67829543", "0.67823...
0.71602553
4
Do we have a key in our Box
def __contains__(self, key, *args, **kwargs): if key in self._list(*args, **kwargs): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_keys(self):", "def __contains__(self, key):\n if not isinstance(key, pm.general.Attribute):\n return super(ChannelBox, self).__contains__(key)\n else:\n for attr in self:\n if key.longName() == attr.longName():\n return True\n ...
[ "0.6986122", "0.6938919", "0.6731619", "0.67175514", "0.65140647", "0.649861", "0.6473597", "0.6459295", "0.64445496", "0.6423036", "0.6414411", "0.6403864", "0.63690263", "0.63574445", "0.6352781", "0.63443744", "0.6337839", "0.6337052", "0.6315151", "0.62985957", "0.6284299...
0.0
-1
Let's iterate over keys
def iterkeys(self, *args, **kwargs): self.__iter__(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iterkeys(self):", "def iterkeys(self):", "def iterate_keys(\n self,\n keys: istr = None,\n terms: istr = None,\n prefixes: istr = None,\n labels: istr = None,\n ) -> Iterable[str]:", "def keysAll():", "def __iter__(self, *args, **kwargs):\n for key in self.k...
[ "0.8028127", "0.8028127", "0.75702435", "0.7447725", "0.71602553", "0.7096699", "0.7065386", "0.7042659", "0.70120496", "0.69577056", "0.68988377", "0.6898542", "0.6833501", "0.681694", "0.6812973", "0.67881155", "0.67873925", "0.67873925", "0.67829543", "0.67829543", "0.6782...
0.7054807
7
Let's iterate over values
def itervalues(self, *args, **kwargs): for key in self.iterkeys(): yield self._get(key, *args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n for val in self.value:\n yield val", "def iter_values(self):\n values = self.values\n if (values is not None):\n yield from values", "def values():", "def values(self):\n return iter(util.annotate(v) for _, v in self._pairs())", "def _...
[ "0.75258666", "0.7508892", "0.7246989", "0.7126353", "0.70811474", "0.69964606", "0.6943839", "0.6941814", "0.6876169", "0.6856465", "0.6845299", "0.6784815", "0.6760413", "0.6748729", "0.67412543", "0.6608278", "0.66009533", "0.65879375", "0.6520216", "0.6509102", "0.6483587...
0.6520901
18
Returns the ordered file list contained in the box, which are the keys.
def keys(self, *args, **kwargs): return self._list(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keys(self):\n self._load()\n return list(self._file_openers.keys())", "def _keys(self):\n for name in listdir(abspath(self._path)):\n key, ext = splitext(name)\n if ext == \".pkl\":\n yield key", "def get_key_list(self) -> list:\n return self...
[ "0.6447488", "0.6203259", "0.59547013", "0.5950618", "0.591363", "0.59093", "0.58849907", "0.5868697", "0.5834718", "0.58314633", "0.5818464", "0.5811564", "0.57635695", "0.5761299", "0.5735301", "0.5695829", "0.56861126", "0.5675353", "0.5649169", "0.5625992", "0.5604739", ...
0.5268028
96
Returns the ordered file content in the box, values are File like object.
def values(self, *args, **kwargs): return [ self._get(doc, *args, **kwargs) for doc in self.keys(*args, **kwargs) ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file_content(self):\n after = self.file.revisions.filter(\n revision_number__gt=self.revision_number)\n content = self.file.content\n\n for revision in after:\n patch = dmp.patch_fromText(revision.diff)\n content = dmp.patch_apply(patch, content)[0]\n\n...
[ "0.6578323", "0.6195132", "0.6158609", "0.6130001", "0.60816914", "0.6070722", "0.5900003", "0.58784735", "0.5852176", "0.5815309", "0.5789908", "0.57732135", "0.5750775", "0.57497567", "0.570029", "0.5668922", "0.5662288", "0.564425", "0.56397945", "0.5639734", "0.5627384", ...
0.0
-1
Return the tuples (key, value) of the document in the Box
def items(self, *args, **kwargs): return [ (key, self._get(key, *args, **kwargs),) for key in self.keys(*args, **kwargs) ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tag_dict_values (self):\r\n\r\n if self.using_database:\r\n value_tuple = (notebookname,)\r\n db_cursor.execute(\"SELECT keyword \"\r\n +\"FROM keys_to_indexes\"\r\n +\" WHERE notebook=?;\",\r\n ...
[ "0.5800763", "0.5605774", "0.55930257", "0.55834126", "0.5575003", "0.5566999", "0.55480194", "0.55251276", "0.55248296", "0.54984486", "0.54984283", "0.5479217", "0.54744464", "0.5467374", "0.54591835", "0.5444327", "0.5435902", "0.54260826", "0.539782", "0.53727955", "0.536...
0.0
-1
Check if a document with name exist in the box. Name must be a UUID.
def has_key(self, name, *args, **kwargs): if not name in self._list(*args, **kwargs): return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _document_exists(self, document_name):\n return len(self.ssm_client.list_document_versions(Name=document_name)['DocumentVersions']) >= 1", "def document_exists(self, docid):\n raise NotImplementedError", "async def exists(self, tag_name):\n try:\n if await self.get_id(tag_na...
[ "0.7135397", "0.6594063", "0.65436053", "0.64406437", "0.6437423", "0.64143556", "0.6381167", "0.62394005", "0.6217442", "0.6199171", "0.6186326", "0.61659366", "0.6156692", "0.61054975", "0.61047465", "0.59580827", "0.59065944", "0.5855192", "0.58499634", "0.5817798", "0.579...
0.0
-1
Returns the list of all items in the box.
def _list(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_items(self):\n return self.api.state['items']", "def get_items(self) -> list:\r\n return self._items", "def getAllItemsList():\n return Gw2Spidy._request('all-items', 'all')['results']", "def items(self):\n return list(self.items_generator())", "def get_all(self):\n ...
[ "0.7333024", "0.72668177", "0.72242326", "0.71624315", "0.71111107", "0.70891744", "0.70159924", "0.6920204", "0.691704", "0.6915142", "0.6856909", "0.6847854", "0.6846284", "0.6830232", "0.6828449", "0.68206275", "0.6808724", "0.67803705", "0.6778643", "0.674152", "0.6718216...
0.0
-1
Get a document from the box, should return a File like object
def _get(self, name): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetDocument(self):\n return self.file", "def getDocument(cred, documentPath):\n url = cred.base_url + \"documents/\" + documentPath\n\n return makeRequest(cred, url, 'GET')", "def get_document(self):\n return self.document", "def retrieve_document(self, format):\n self._validat...
[ "0.76784086", "0.6944488", "0.6931573", "0.6773835", "0.67368263", "0.6678726", "0.6640609", "0.6607192", "0.65544736", "0.65524936", "0.65454", "0.65300834", "0.6474754", "0.64528465", "0.6449089", "0.6386817", "0.6363929", "0.6361937", "0.6354846", "0.6332822", "0.6315605",...
0.0
-1
Put a document in a box. document are, generally, File like objects. If a document with this name exist, it will be overwritten.
def _put(self, name, document): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_document():", "def add_doc(self, name, boring):\n\n self.documents[name] = boring", "def create_document(file_name):\n path = INPUT_DIR+file_name # assemble the file descriptor\n file = open(path) # open in read mode\n doc = Document() # create a new document\n # add the title fi...
[ "0.61639756", "0.6162539", "0.59793246", "0.5963256", "0.590264", "0.58933574", "0.58044666", "0.5765277", "0.5765277", "0.5704316", "0.5627359", "0.5610905", "0.55908906", "0.5577505", "0.5577505", "0.5577505", "0.55759597", "0.5559141", "0.55538213", "0.55373514", "0.552513...
0.7024438
0
Remove a document from the box.
def _del(self, name): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def remove_doc(self, *args, **kwargs):\n pass", "def delete_document(self):\n pass", "def remove_document(request, pk, doc_name):\n\n refresh_template = request.session[constants.ACTUAL_TEMPLATE]\n\n docs = request.session[constants.ADD_DOCS]\n document = next(el for el in docs if ...
[ "0.76537997", "0.73871493", "0.6808508", "0.68083537", "0.667", "0.64736843", "0.63695973", "0.62124866", "0.61931455", "0.6146125", "0.61168104", "0.61005217", "0.6050102", "0.6044907", "0.60415405", "0.602878", "0.59733033", "0.5963243", "0.5946144", "0.58676904", "0.584129...
0.0
-1
Initialize the DFTimewolf console output object.
def __init__(self, sender, verbose): super(DFTimewolfConsoleOutput, self).__init__() self._sender = sender self._verbose = verbose
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, console_output, console_stream):\n self.console_output = console_output\n self.console_stream = console_stream", "def __init__(self):\n self.start = datetime.datetime.now()\n self.linecount = 0\n if sys.stdout.isatty():\n self.term = Terminal()\n ...
[ "0.7273711", "0.6603541", "0.63445574", "0.62620664", "0.6247948", "0.6224108", "0.62141013", "0.6183469", "0.6162597", "0.6135037", "0.6121743", "0.6066026", "0.6051641", "0.60458225", "0.6029775", "0.60186225", "0.5972186", "0.59671825", "0.5889796", "0.58682", "0.5840445",...
0.7100504
1
Format message with timestamp, script name and sender name.
def _FormatMessage(self, message): script_name = os.path.basename(sys.argv[0]) timestamp = datetime.now().isoformat() formatted_message = '[{0:s}] {1:s}: {2:s} - {3:s}\n'.format( timestamp, script_name, self._sender, message) return formatted_message
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_message(self, message):\n return \"%s at %s\" % (\n message[0], time.asctime(time.localtime(message[1])))", "def format(self, message):", "def _format_msg(self, format_str, *args):\r\n return u\"{0} - - [{1}] {2}\\n\".format(\r\n self.client_address[0],\r\n ...
[ "0.71702343", "0.63822514", "0.6338278", "0.6299789", "0.6249407", "0.6240023", "0.61700153", "0.61387986", "0.61233366", "0.6073101", "0.60591334", "0.5941699", "0.58731693", "0.5831379", "0.58288723", "0.5788805", "0.57774264", "0.57669884", "0.5763617", "0.5748114", "0.572...
0.81965363
0
Send message to standard out.
def StdOut(self, message): sys.stdout.write('{0:s}\n'.format(message)) sys.stdout.flush()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send(self, msg):\n if self.verbose:\n print('<- out ' + msg)\n self._socket.send_string(msg)\n return", "def write(self, msg, *_):\n if self.out is not None:\n self.out.write(msg)\n self.out.flush()", "def stdout(msg):\n sys.stdout.write(msg)\n sys.stdout....
[ "0.73845494", "0.72514176", "0.71020246", "0.6914435", "0.6861263", "0.6831616", "0.6803821", "0.6777944", "0.6777944", "0.67456704", "0.66035986", "0.6591568", "0.6567837", "0.656644", "0.656644", "0.6550436", "0.65137446", "0.6496491", "0.6481694", "0.6435243", "0.6383848",...
0.75261456
0
Send formatted message to standard error.
def StdErr(self, message, die=False): error_message = self._FormatMessage(message) if die: exit_message = error_message.rstrip('\n') sys.exit(exit_message) sys.stderr.write(error_message) sys.stderr.flush()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_error(msg):\n\n print(msg)", "def error(message):\n print str(message)", "def error(msg):\n sys.stdout.write('%s[ ERROR ]%s %s\\n' % (colors.RED, colors.RESET, msg))", "def send_error(self, e):\n self._send({'error': e.payload})", "def error(cls, message):\n print('[ERRO...
[ "0.7451318", "0.7334253", "0.72953176", "0.71933055", "0.71841633", "0.70832545", "0.70167476", "0.7006353", "0.69829154", "0.6961286", "0.6953911", "0.69475806", "0.69462806", "0.6946146", "0.69442457", "0.68781567", "0.68722326", "0.68413025", "0.68083096", "0.68083096", "0...
0.6524549
60
Send verbose output to standard error.
def VerboseOut(self, message): if self._verbose: self.StdErr(message, die=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error(message):\n print(message, file=sys.stderr)", "def error(*args, **kwargs):\n print(*args, file=sys.stderr, **kwargs)", "def err(self, text):\n if not self.is_quiet_err:\n self.__emit(\"ERROR: \" + text, sys.stderr)", "def _print_error(message):\n sys.stderr.write(str(mess...
[ "0.7068845", "0.69946826", "0.69232833", "0.68590796", "0.6770286", "0.6770286", "0.6770286", "0.66918993", "0.6639223", "0.66315615", "0.66117066", "0.65715766", "0.6510242", "0.6505283", "0.64945483", "0.6488714", "0.648618", "0.6482448", "0.64809734", "0.6477335", "0.64744...
0.73082143
0
Convenience function to read input from stdin.
def ReadFromStdin(): for line in sys.stdin: path_name = line.strip('\n').split() try: path = path_name[0] name = path_name[1] except IndexError: raise IndexError('Malformed input on stdin') yield (path, name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_stdin():\n return \"\".join(sys.stdin.readlines()).strip()", "def read_input(args, parser):\n if args.text == sys.stdin:\n # check if stdin is empty\n stdin_ready, _, _ = select.select([sys.stdin], [], [], 0)\n if stdin_ready:\n return sys.stdin.read().strip()\n\n ...
[ "0.760807", "0.75703275", "0.72676516", "0.721318", "0.7152076", "0.69860023", "0.6639193", "0.6587536", "0.64938253", "0.64057076", "0.6331568", "0.6262105", "0.623257", "0.6206357", "0.62016064", "0.6172127", "0.6170546", "0.61641914", "0.6152224", "0.61395735", "0.6136844"...
0.64873475
9
Check timezone string against known timezones in the pytz package.
def IsValidTimezone(timezone): return timezone in pytz.all_timezones
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_timezone(tzstring):\n if not tzstring:\n return get_localzone()\n try:\n return pytz.timezone(tzstring)\n except pytz.UnknownTimeZoneError:\n raise VdtValueError(\"Unknown timezone {}\".format(tzstring))", "def is_tz_valid(self, tz : str):\n # check tz is a string\n ...
[ "0.7579308", "0.74548393", "0.72705984", "0.6789601", "0.66779983", "0.6512265", "0.64019895", "0.63673794", "0.6315279", "0.62908083", "0.6286167", "0.62601435", "0.62428313", "0.6206581", "0.6180309", "0.6156222", "0.60593784", "0.6052749", "0.6025556", "0.6025556", "0.6025...
0.74890524
1
Replaces some arguments by those specified by a keyvalue dictionary. This function will be recursively called on a dictionary looking for any value containing a "$" variable. If found, the value will be replaced by the attribute in "args" of the same name. It is used to load arguments from the CLI and any extra configu...
def import_args_from_dict(value, args, config): if isinstance(value, six.string_types): for match in TOKEN_REGEX.finditer(str(value)): token = match.group(1) if token in args: actual_param = args[token] if isinstance(actual_param, six.string_types): value = value.replace("@"+...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_args(self, args):\n for cfg in args:\n keys, v = cfg.split('=', maxsplit=1)\n keylist = keys.split('.')\n dic = self\n for i, k in enumerate(keylist[:-1]):\n assert k in dir(dic), \"Unknown config key: {}\".format(keys)\n d...
[ "0.68151176", "0.6694366", "0.62639254", "0.6206691", "0.5526846", "0.5518324", "0.54716885", "0.54171", "0.54088897", "0.5379822", "0.5378015", "0.53294635", "0.5300866", "0.52824336", "0.5280397", "0.52757204", "0.5272755", "0.52654624", "0.5264887", "0.5236045", "0.5231624...
0.57869947
4
Checks if any values in a given dictionary still contain @ parameters.
def check_placeholders(value): if isinstance(value, six.string_types): if TOKEN_REGEX.search(value): raise ValueError('{0:s} must be replaced in dictionary'.format(value)) elif isinstance(value, list): return [check_placeholders(item) for item in value] elif isinstance(value, dict): return {key:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_implied_parameters(self, parameters):\n for key, values, implied_keys in self.IMPLIED_PARAMETERS:\n self.log([u\"Checking implied parameters by '%s'='%s'\", key, values])\n if (key in parameters) and (parameters[key] in values):\n found = False\n ...
[ "0.62755895", "0.59351057", "0.58636785", "0.58431524", "0.5831259", "0.5828135", "0.5820753", "0.57764626", "0.57671577", "0.5734962", "0.5709924", "0.5636245", "0.5611094", "0.5594863", "0.5587707", "0.55796117", "0.55698526", "0.5558164", "0.5509387", "0.55067164", "0.5503...
0.0
-1
Catches Ctrl + C to exit cleanly.
def signal_handler(*unused_argvs): sys.stderr.write("\nCtrl^C caught, bailing...\n") sys.exit(0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ctrl_c(signum, frame):\n global shutdown_event\n raise SystemExit('\\nCancelling...')", "def allowCtrlC():\n signal.signal(signal.SIGINT, signal.SIG_DFL)", "def signal_handler(self, signal, frame):\r\n print 'You pressed Ctrl+C!'\r\n sys.exit(0)", "def ctrl_c_trapper(signum: int, s...
[ "0.80725306", "0.789612", "0.78671515", "0.77578425", "0.7625408", "0.75891113", "0.7430562", "0.7410401", "0.729414", "0.7250938", "0.7194444", "0.7110748", "0.70975953", "0.679413", "0.67453665", "0.66968954", "0.6669376", "0.66400564", "0.66031146", "0.6600431", "0.6469647...
0.8342945
0
Distort one image for training a network.
def preprocess_for_train( image, height, width, bbox, do_distort_color=True, do_flip_horizontal=True, do_flip_vertical=False, area_range=(0.2, 1.0), aspect_ratio_range=(0.75, 1.333), normalize_method='inception', fast_mode=True, scope=None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distort_images(self, images, seed):\n if self.mode == \"train\":\n images = image_processing.distort_image(images, seed)\n\n # Rescale to [-1,1] instead of [0, 1]\n images = tf.subtract(images, 0.5)\n images = tf.multiply(images, 2.0)\n return images", "def undistort(self,src):\n #...
[ "0.73022383", "0.6604408", "0.6493764", "0.6346601", "0.63008636", "0.62407595", "0.6238941", "0.61212516", "0.6048554", "0.6030431", "0.6009535", "0.600286", "0.597758", "0.5952197", "0.5927538", "0.5903251", "0.58237195", "0.58088666", "0.5779274", "0.5659034", "0.5553383",...
0.61765313
7
Prepare one image for evaluation. If height and width are specified it would output an image with that size by applying resize_bilinear. If central_fraction is specified it would crop the central fraction of the input image.
def preprocess_for_eval(image, height, width, central_fraction=0.875, scope=None): with tf.name_scope(scope, 'eval_image', [image, height, width]): if image.dtype != tf.float32: image = tf.image.convert_image_dtype(image, dtype=tf.float32) # Crop the central region of the image w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess(image, height, width,\n central_fraction=0.875, scope=None):\n with tf.name_scope(scope, 'eval_image', [image, height, width]):\n if image.dtype != tf.float32:\n image = tf.image.convert_image_dtype(image, dtype=tf.float32)\n # Crop the central region of the image ...
[ "0.6689361", "0.65859485", "0.5938244", "0.57086855", "0.56061655", "0.5604108", "0.55377597", "0.5537046", "0.5517595", "0.54937977", "0.54748225", "0.5371019", "0.53591627", "0.535385", "0.5330709", "0.5325815", "0.5318338", "0.53006196", "0.52887845", "0.52764225", "0.5267...
0.6445598
2
Preprocess one image for training or evaluation.
def preprocess_image( image, height, width, is_training=False, bbox=None, fast_mode=True, add_image_summaries=True, **kwargs): do_distort_color = kwargs.pop('do_distort_color', False) do_flip_horizontal = kwargs.pop('do_flip_horizontal', True) do_flip_vertical = kwa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess(self, img):\n img_ = image.load_img(img, target_size=(299, 299))\n img_ = image.img_to_array(img_)\n img_ = np.expand_dims(img_, axis=0)\n img_ = preprocess_input(img_)\n return img_", "def preprocess_image(self, inputs):\n raise NotImplementedError('prepr...
[ "0.74826854", "0.730003", "0.72899485", "0.7244322", "0.7049938", "0.69764584", "0.6940527", "0.6870593", "0.684732", "0.6824978", "0.68106574", "0.6790526", "0.6737742", "0.67320675", "0.67121994", "0.6706478", "0.6687464", "0.6673582", "0.66599274", "0.6629511", "0.661788",...
0.6436267
32
Adds the two vectors, v and u.
def add_vectors(v, u): return (v[0] + u[0], v[1] + u[1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_vectors(u, v): #11.22.5\r\n new_vector = []\r\n \"\"\"Because they have same length so we\r\n should take advantage from this one\"\"\"\r\n for i in range(len(u)):\r\n m = u[i] + v[i] # Get their value of i index at the same time!\r\n new_vector.append(m)\r\n return new_vector"...
[ "0.81809795", "0.81132114", "0.74564755", "0.7385315", "0.7307801", "0.7250798", "0.7221409", "0.72022974", "0.7178813", "0.7116212", "0.71116716", "0.71053827", "0.7038589", "0.702951", "0.70047545", "0.68703395", "0.68566346", "0.68371874", "0.6800543", "0.6782561", "0.6777...
0.8510088
0
Returns the (x,y) tile of room.
def room_xy(room, x, y, value=None): return room[x][y]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tile(self, x: int, y: int):\n return self.awmap.tile(x, y)", "def get_tile(self, row, col):\n return self.grid[row][col]", "def get_tile(self, row, col):\n #print 'The value of tile at position: (',row,',',col,') is: ',self.grid[row][col]\n return self.grid[row][col]", "def ge...
[ "0.7695231", "0.7685104", "0.7619274", "0.758384", "0.7560093", "0.754351", "0.7527224", "0.752072", "0.752072", "0.752072", "0.75105745", "0.750853", "0.74337506", "0.743131", "0.7421612", "0.74162275", "0.7416172", "0.7408059", "0.7405969", "0.7388739", "0.7369988", "0.73...
0.7127098
29
Returns the width and height of room.
def room_wh(room): if isinstance(room, str): room = dungeon[room] return len(room), len(room[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dimensions (self):\n return (self.width, self.height)", "def size(self):\n return (self.width(), self.height())", "def size(self):\n return (self.width, self.height)", "def size(self):\n return self.width, self.height", "def getDims(self):\n size = self.screenSize\n ...
[ "0.7284312", "0.72340363", "0.7229903", "0.7218242", "0.71061677", "0.7099479", "0.7098856", "0.70988137", "0.7063528", "0.69398564", "0.69301516", "0.6902028", "0.6874542", "0.68626475", "0.6828495", "0.68002677", "0.6784956", "0.6776988", "0.67632365", "0.67047834", "0.6679...
0.62047046
79
Creates a new room. The rooms is a list of lists, where every list represents a column. Tiles
def create_room(w, h): # map[0] gives a list which represents the row, or the x. Then map[x][y] # gives the yth place in the column x. room = [[' ' for j in range(h)] for i in range(w)] for x in range(w): for y in range(h): if y == 0 or y == (h-1): room[x][y] = '-' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_rooms(width=10, height=10):\n # create blank rooms\n rooms = [Room(id) for id in range(1, (width * height + 1))]\n\n # make some rooms inaccessible\n for _ in range(0, height*width//10):\n rand_num = randint(0, height*width-1)\n while rooms[rand_num].is_accessible == False:\n ...
[ "0.7591706", "0.71845305", "0.71760666", "0.7051529", "0.69662994", "0.66109204", "0.6405384", "0.6376221", "0.63713443", "0.630056", "0.6272139", "0.62588125", "0.62555104", "0.6243304", "0.6191843", "0.6115295", "0.6084862", "0.60528034", "0.6038224", "0.6000447", "0.596918...
0.7119422
3
Finds the name of a given room. If the room doesn't exist returns None.
def get_room_name(dungeon, room): for n in dungeon: if dungeon[n] == room: return n return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_room(self, room_name):\r\n try:\r\n return self._rooms[room_name]\r\n except KeyError:\r\n return None", "def get_room(self, name):\n for i in self.rooms:\n if self.rooms[i].name == name:\n return self.rooms[i]\n raise RuntimeErr...
[ "0.75425893", "0.7537608", "0.7521715", "0.7370273", "0.7260868", "0.7102111", "0.7077929", "0.69465464", "0.6901336", "0.6713058", "0.6378655", "0.63167995", "0.62781125", "0.62456167", "0.62415075", "0.6202007", "0.6202007", "0.6162853", "0.6153098", "0.61020285", "0.607822...
0.801243
0
Prints out the room. This is the basic graphics function. Clear(), stdout.flush() arn't entirely clear to me.
def print_room(dungeon, room): if not isinstance(room, str): name = get_room_name(dungeon, room) else: name = room room = dungeon[name] w, h = room_wh(room) room_str = '' for y in range(h): row = '' for x in range(w): #print room tile =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw(self):\n\t\tfor i in range(0, self.size):\n\t\t\tprint('\\n' + \"----\" * self.size)\n\t\t\tfor j in range(0, self.size):\n\t\t\t\tprint(self.grid[i][j] + ' |', end=\" \")\n\t\tprint('\\n'+ \"----\" * self.size + '\\n')", "def display(self):\n for r in range(len(self.grid)):\n for c in...
[ "0.7538773", "0.7269248", "0.72002727", "0.71958214", "0.7131456", "0.70858586", "0.69819885", "0.6970632", "0.6965393", "0.6960884", "0.69436365", "0.69365036", "0.69221085", "0.6880478", "0.6877629", "0.6868829", "0.685913", "0.6822707", "0.6803275", "0.67974323", "0.678989...
0.6630154
37
Creates a new dungeon out of the graph rooms. The size of each room depends on it's rank.
def create_dungeon(graph, ranks): dungeon = {} w, h = 150, 100 for r in graph: name, w, h = r, int(w*ranks[r]+10), int(h*ranks[r]+10) dungeon[name] = create_room(w, h) return dungeon
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_dungeon(self):\r\n # Total number of rooms\r\n n = self.__nx * self.__ny\r\n room_stack = []\r\n current_room = self.room_at(self.__ix, self.__iy)\r\n # Total number of visited rooms during maze construction\r\n nv = 1\r\n\r\n # iterate over all rooms of du...
[ "0.79936665", "0.743523", "0.673504", "0.6677515", "0.6576027", "0.65215296", "0.64986736", "0.646819", "0.64603704", "0.6405314", "0.63618886", "0.6356892", "0.6314918", "0.6306273", "0.6300013", "0.6290147", "0.6279687", "0.6276442", "0.6262408", "0.62097096", "0.62089825",...
0.7741939
1
Prints out the whole dungeon... Kind of useless cause I couldn't get it to build all the rooms as a single dungeon with hallways and all.
def print_dungeon(dungeon): for r in dungeon: print_room(dungeon[r])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_room(dungeon, room):\n if not isinstance(room, str):\n name = get_room_name(dungeon, room)\n else:\n name = room\n room = dungeon[name]\n w, h = room_wh(room)\n room_str = ''\n for y in range(h):\n row = ''\n for x in range(w):\n #print room\n ...
[ "0.7222498", "0.7206108", "0.68528926", "0.6848333", "0.66115516", "0.6574171", "0.65262556", "0.6516744", "0.6489489", "0.6471107", "0.6433852", "0.6400976", "0.63732857", "0.63092345", "0.628924", "0.62752634", "0.6267731", "0.62479174", "0.6238725", "0.62261903", "0.621193...
0.77093595
0
The basic crit. Its type can be 'player' or 'crawler'.
def create_crit(dungeon, room, pos, symbol, type, hp=1, dir=None, score=None): crit = {'dungeon': dungeon, 'room': dungeon[room], 'room_name': room, 'symbol': symbol, 'pos': (pos[0], pos[1]), 'lastpos': (pos[0], pos[1]), 'hp': hp, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def crit_ai(crit):\n if crit['type'] == 'crawler':\n # Crawlers move at random.\n return random.choice(['left','right','up','down'])\n #if crit['type'] == 'bullet':\n # return crit['dir']\n return None", "def critic(self) -> CriticType:\n if not self._critic:\n rais...
[ "0.7114849", "0.6818957", "0.61771935", "0.6091296", "0.5658373", "0.5643586", "0.5643586", "0.56431574", "0.5410564", "0.5399258", "0.5377942", "0.53656733", "0.52876395", "0.50784194", "0.5024129", "0.49956137", "0.4870065", "0.48335576", "0.48329183", "0.4807755", "0.47434...
0.61057764
3
Create a new door. A door is a list with a symbol and a destination room. It is saved in the room's list and no where else.
def create_door(dungeon, room, pos, symbol, destination): dungeon[room][pos[0]][pos[1]] = [symbol, destination]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_door(self, room=None, status=\"open\", tile=None, name=\"door\", color=None, random=False, x=None, y=None):\n\n walls = room.get_walls()\n if random:\n door_seed = randint(0, len(room.get_walls()) - 1)\n\n while walls[door_seed][0] == 1 or walls[door_seed][0] == room....
[ "0.69796914", "0.6737017", "0.6626829", "0.63650703", "0.632819", "0.6296616", "0.628974", "0.619405", "0.6189811", "0.6084912", "0.5908753", "0.5863805", "0.5863573", "0.58631283", "0.5750759", "0.5719418", "0.56915903", "0.56372154", "0.56128436", "0.5598879", "0.5522017", ...
0.79109216
0
Blits the obj unto the room it is in. An obj is a dictionary with all the relevent keys.
def blit(obj): # An object is a dictionary with the keys: 'dungeon', 'room', 'symbol', 'pos', 'lastpos' x = obj['pos'][0] y = obj['pos'][1] lastx= obj['lastpos'][0] lasty = obj['lastpos'][1] room = obj['room'] if x < len(room) and y < len(room[0]): room[lastx][lasty] = ' ' ro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_dict(self, obj):\n\n for attr, value in obj.__dict__.items():\n self.__dict__[attr] = value", "def _update_loose (self, dict):\n self.__dict__.update(dict)", "def put(self, obj):\n\n if obj is None:\n return\n\n return obj", "def _restore_objs_from_I...
[ "0.55141205", "0.5455272", "0.5451394", "0.5428932", "0.53700477", "0.5302088", "0.527134", "0.5265598", "0.5256817", "0.52297986", "0.5223485", "0.51562405", "0.51516265", "0.5151293", "0.5136837", "0.5135862", "0.507945", "0.50718594", "0.50638777", "0.5061924", "0.5055992"...
0.59469885
0
Moves obj according to the vector v.
def move(dungeon, obj, v, crits): # An object is a dictionary with the keys: 'dungeon', 'room', 'symbol', 'pos', 'lastpos' if v == None: return room = obj['room'] newpos = add_vectors(obj['pos'], v) tile = room[newpos[0]][newpos[1]] if obj['type'] == 'bullet' and (tile == '-' or tile == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_vertex(self, p, v, x, y, z):\n self._move_vertex(p, v, x, y, z)", "def move(self, _vec):\n\n\t\t_dest = self._grid[0] + _vec[0], self._grid[1] + _vec[1], self._grid[2] + _vec[2]\n\t\tif _vec[2]: # jeśli ruszamy się w z to znaczy że wchodzimy po schodach\n\t\t\tself._map.getLayer('Fields').get(sel...
[ "0.68294024", "0.65596116", "0.6420798", "0.62307125", "0.5968462", "0.5814363", "0.57445145", "0.57445145", "0.56720877", "0.566532", "0.5644781", "0.5639692", "0.5605438", "0.55740774", "0.5565334", "0.5545422", "0.5524349", "0.5501914", "0.549206", "0.54794955", "0.5427554...
0.630317
3
Returns an action for the crit to follow.
def crit_ai(crit): if crit['type'] == 'crawler': # Crawlers move at random. return random.choice(['left','right','up','down']) #if crit['type'] == 'bullet': # return crit['dir'] return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_action_critic(self, x): \n x = x.to(self.dummy_param.device)\n encoder_output, actor_output = self.get_penultimate(x)\n critic_output = self.critic_decoder(encoder_output)\n return actor_output, critic_output", "def request_action(self):\n\n # Determine the compu...
[ "0.6199234", "0.6157312", "0.61139256", "0.60479057", "0.60223484", "0.5996251", "0.5987789", "0.58963466", "0.5876293", "0.5801321", "0.5761508", "0.5742031", "0.5710618", "0.5710618", "0.5710618", "0.57095194", "0.56798005", "0.5675119", "0.5675119", "0.5675119", "0.5675119...
0.552107
34
initialize your data structure here.
def __init__(self): self.stack = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_empty(self):\n self._data = []", "def __init__(self):\n self.data = []\n self.record = {}", "def __init__(self):\n self.structure = {}", "def __init__(self):\n self._data = []", "def __init__(self):\n self._data = []", "def __init__(self):\n self...
[ "0.7761043", "0.76102185", "0.7555967", "0.7549892", "0.7549892", "0.7549892", "0.7549892", "0.7549892", "0.7549892", "0.752797", "0.7446006", "0.7446006", "0.7446006", "0.7446006", "0.7446006", "0.743338", "0.743338", "0.7408609", "0.7385719", "0.737986", "0.737986", "0.73...
0.0
-1
Design the model with Multilevel Perceptrons
def get_model(neurons_in_layer, number_of_layers=2, lr=0.1, activation_function='relu', dropout_rates=0.2): model = Sequential() model.add(Dense(neurons_in_layer, activation=activation_function, input_shape=(3072,))) model.add(Dropout(dropout_rates)) for i in range(number_of_layers-1): model.ad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, hidden_layer_sizes, activation='relu', reg=0.001, k_fold=5, random_state=0):\n print(\"Initialize model Multi-layer Perceptron\")\n self.hidden_layer_sizes = hidden_layer_sizes\n self.activation = activation\n self.reg = reg\n self.k_fold = k_fold\n self...
[ "0.7173574", "0.6657019", "0.65320843", "0.6526806", "0.64745086", "0.63801926", "0.6337982", "0.6330352", "0.63216627", "0.62055063", "0.6185266", "0.6155439", "0.614831", "0.6130537", "0.6128191", "0.6096416", "0.6073686", "0.606398", "0.6046298", "0.6005055", "0.6001098", ...
0.0
-1
Preprocess images. convert them into vector.
def get_preprocessed_data(x_train, x_test, y_train, y_test): x_train = x_train.reshape(50000, 3072) x_test = x_test.reshape(10000, 3072) x_train = x_train.astype('float32') x_test = x_test.astype('float32') x_train /= 255 x_test /= 255 y_train = np_utils.to_categorical(y_train, num_classes)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pre_process(self, images: Union[np.ndarray, List]) -> np.ndarray:\n images = validate_image(images)\n image_sizes = []\n image_arr = []\n for image in images:\n image_sizes.append(image.shape)\n image = resize(image,\n height=self.in_h...
[ "0.7123236", "0.71175474", "0.71103907", "0.71058273", "0.7010947", "0.69705945", "0.680906", "0.6789942", "0.6776293", "0.676025", "0.6729897", "0.672513", "0.66972786", "0.6683716", "0.6600654", "0.65509903", "0.65455157", "0.6541596", "0.65228456", "0.65175027", "0.6517117...
0.0
-1
Train for one epoch on the training set
def train(train_loader, model, criterion, optimizer, epoch, noise_decay_rate, noise_param_list, noise_decay, random_noise=False, sparsity=0): global total_steps, exp_flops, exp_l0, args, writer batch_time = AverageMeter() data_time = AverageMeter() losses = AverageMeter() top1 = AverageMeter...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_one_epoch(self):\n raise NotImplementedError", "def train_one_epoch(self):\n\t\tself.model.train()\n\t\ttrain_loss = 0\n\n\t\tfor batch_idx, data in enumerate(self.data_loader.train_loader):\n\t\t\tInput = data[0].float().to(self.device)\n\t\t\tOutput = data[1].float().to(self.device)\n\n\t\t\ts...
[ "0.85638434", "0.81158483", "0.79524827", "0.7938271", "0.7938271", "0.7938271", "0.7938271", "0.7749522", "0.77110666", "0.76998925", "0.7698468", "0.76657456", "0.7661316", "0.7612038", "0.75879216", "0.75706774", "0.7550792", "0.75401384", "0.74804544", "0.74505657", "0.74...
0.0
-1
Perform validation on the validation set
def validate(val_loader, model, criterion, epoch): global args, writer batch_time = AverageMeter() losses = AverageMeter() top1 = AverageMeter() # switch to evaluate mode model.eval() #if not args.multi_gpu: # if model.beta_ema > 0: # old_params = model.get_params() # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate(self):\n for rule in self.get_rules():\n rule.validate(self.get_val())", "def validate():", "def validate(self):", "def validate(self):", "def _validate(self):\n pass", "def validate(self):\n raise NotImplementedError(\"validate function needs to be implemente...
[ "0.7935849", "0.7611668", "0.7374195", "0.7374195", "0.7308814", "0.7305275", "0.729531", "0.729531", "0.729531", "0.729531", "0.729531", "0.729531", "0.729531", "0.729531", "0.7230471", "0.722908", "0.71874404", "0.7187279", "0.71682346", "0.7132424", "0.70742506", "0.7050...
0.0
-1
Perform validation on the validation set
def test(test_loader, model, criterion, epoch): global args, writer batch_time = AverageMeter() losses = AverageMeter() top1 = AverageMeter() # switch to evaluate mode model.eval() #if not args.multi_gpu: # if model.beta_ema > 0: # old_params = model.get_params() # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate(self):\n for rule in self.get_rules():\n rule.validate(self.get_val())", "def validate():", "def validate(self):", "def validate(self):", "def _validate(self):\n pass", "def validate(self):\n raise NotImplementedError(\"validate function needs to be implemente...
[ "0.7935849", "0.7611668", "0.7374195", "0.7374195", "0.7308814", "0.7305275", "0.729531", "0.729531", "0.729531", "0.729531", "0.729531", "0.729531", "0.729531", "0.729531", "0.7230471", "0.722908", "0.71874404", "0.7187279", "0.71682346", "0.7132424", "0.70742506", "0.7050...
0.0
-1
Sort the given list in the way that humans expect.
def natural_sort( l ): convert = lambda text: int(text) if text.isdigit() else text alphanum_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ] l.sort( key=alphanum_key ) return l
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_list(self,list_):\r\n list_.sort()", "def sort(self):\r\n self.list.sort(key=lambda x: ''.join(x))", "def sort(self):\n self.list.sort(key=lambda x: ''.join)", "def sort_list(list, key):\r\n list.sort(lambda x,y: cmp(key(x), key(y))) # Python < 2.4 hack\r\n return list", "de...
[ "0.8292916", "0.76561475", "0.757362", "0.7467298", "0.744403", "0.7396385", "0.73923665", "0.7373652", "0.73097515", "0.7273553", "0.72724366", "0.7242809", "0.723442", "0.7208328", "0.7205921", "0.7205823", "0.7152361", "0.71513903", "0.71511674", "0.71472865", "0.71407837"...
0.0
-1
Constructs a QGraphicsItem displaying streams in a timeline
def __init__(self, parent, streams): super(TimelineItem, self).__init__() self._parent = parent # Timeline boundries self._start_stamp = None # earliest of all stamps self._end_stamp = None # latest of all stamps self._stamp_left = None # earliest timestamp currently visible self._stamp_right = None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, streams, parent=None):\n\n\t\t# Initialize class\n\t\tQtGui.QWidget.__init__(self, parent)\n\t\tself.main_layout = QtGui.QVBoxLayout(self)\n\t\tself.setLayout(self.main_layout)\n\n\t\t# Retrieve first and last timestamps\n\t\t_streams_ts_float = dict()\n\t\tfor stream_name in streams.keys():\n\t...
[ "0.8026527", "0.6497834", "0.5820398", "0.5699911", "0.5643354", "0.55481607", "0.5530482", "0.5490387", "0.5429456", "0.53892124", "0.5310036", "0.528807", "0.52612", "0.51812494", "0.51704144", "0.5135293", "0.5133683", "0.51331383", "0.51291114", "0.50970054", "0.50852877"...
0.77844894
1
Recalculates the layout of the timeline to take into account any changes that have occured
def _layout(self): # Calculate history left and history width self._scene_width = self.scene().views()[0].size().width() max_stream_name_width = -1 for stream_name in self.streams: stream_width = self._qfont_width(stream_name) if max_stream_name_width <= stream_width: max_stream_name_width = stream_w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_timeline_view(self):\n self.t2.setGeometry(self.t1.vb.sceneBoundingRect())\n self.t2.linkedViewChanged(self.t1.vb, self.t2.XAxis)", "def refreshView(self):\n chldn = self.tDisp.get_children()\n for chld in chldn:\n self.tDisp.delete(chld)\n if len(self.con...
[ "0.65964925", "0.6024597", "0.58769494", "0.5846595", "0.57629436", "0.5730918", "0.5716509", "0.5535949", "0.55330044", "0.54991317", "0.54743934", "0.5464647", "0.5434402", "0.540857", "0.5375012", "0.53379875", "0.53152764", "0.53030854", "0.5293149", "0.52806264", "0.5271...
0.6831872
0
Draw all stream messages
def _draw_stream_histories(self, painter): for stream in sorted(self._history_boundaries.keys()): self._draw_stream_history(painter, stream)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _draw_stream_history(self, painter, stream_name):\n\n\t\t# x, y, w, h = self._history_boundaries[stream]\n\t\t_, y, _, h = self._history_boundaries[stream_name]\n\n\t\tmsg_y = y\n\t\tmsg_height = h\n\n\t\t# Get the renderer and the message combine interval\n\t\tmsg_combine_interval = self.map_dx_to_dstamp(self...
[ "0.693785", "0.6424569", "0.6293783", "0.62174135", "0.6211622", "0.6183592", "0.60616964", "0.6001059", "0.59859204", "0.5963548", "0.59148", "0.5900497", "0.58060837", "0.57852465", "0.577698", "0.5775494", "0.57620776", "0.5743451", "0.573396", "0.5727461", "0.5727461", ...
0.6337151
2
Draw boxes corresponding to message regions on the timeline.
def _draw_stream_history(self, painter, stream_name): # x, y, w, h = self._history_boundaries[stream] _, y, _, h = self._history_boundaries[stream_name] msg_y = y msg_height = h # Get the renderer and the message combine interval msg_combine_interval = self.map_dx_to_dstamp(self._default_msg_combine_px) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_message_box(self):\r\n length = len(self.__lines)\r\n\r\n # Build the Dialogue Box\r\n background = pygame.transform.scale(BACKGROUND_PNG, (WINDOW_WIDTH, WINDOW_HEIGHT // 3))\r\n rect = background.get_rect()\r\n rect.center = (WINDOW_WIDTH // 2, 2 * WINDOW_HEIGHT // 3 + ...
[ "0.68003374", "0.6561625", "0.6500125", "0.6344254", "0.618181", "0.6083605", "0.6078848", "0.6063363", "0.6002534", "0.59684235", "0.5890529", "0.5880073", "0.58771783", "0.5864927", "0.5861873", "0.58615", "0.5853589", "0.5806285", "0.5789888", "0.5786381", "0.57839763", ...
0.5819884
17
Draw markers to indicate the area covered by all the streams within the current visible area.
def _draw_stream_ends(self, painter): x_start = self.map_stamp_to_x(self._start_stamp) x_end = self.map_stamp_to_x(self._end_stamp) painter.setBrush(QtGui.QBrush(self._history_external_color)) painter.drawRect(self._history_left, self._history_top, x_start - self._history_l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_points(self, video, roi_size=None):\n if roi_size is None:\n if hasattr(self, 'roi_size'):\n roi_size = self.roi_size\n\n fig, ax = plt.subplots(figsize=(15, 5))\n ax.imshow(video.mraw[0].astype(float), cmap='gray')\n ax.scatter(video.points[:, 1],\n ...
[ "0.5892175", "0.5860346", "0.56598705", "0.56319463", "0.5599937", "0.55717206", "0.55695695", "0.55595607", "0.55528086", "0.54748017", "0.5459466", "0.54485136", "0.5441773", "0.5423518", "0.54149544", "0.54016405", "0.53898364", "0.5385444", "0.5380194", "0.53659046", "0.5...
0.5139556
41
Draws boxes to separate the different stream lines
def _draw_stream_dividers(self, painter): clip_left = self._history_left clip_right = self._history_left + self._history_width row = 0 for stream_name in self.streams: (x, y, w, h) = self._history_boundaries[stream_name] if row % 2 == 0: painter.setPen(QtCore.Qt.lightGray) painter.setBrush(QtGui...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw(self):\n # 5 is the number of characters per box add one for the header column\n sepreator_line = \"-\" * (len(self.letters) + 1) * 5 + \"-\"\n print(sepreator_line)\n print(\n \"| \" + \"\".join([f\"| {letter} \" for letter in self.letters]) + \"|\")\n pri...
[ "0.68568236", "0.67817307", "0.6709467", "0.660299", "0.65354925", "0.6516649", "0.64493024", "0.64444536", "0.643776", "0.64299077", "0.6425775", "0.64102346", "0.63965875", "0.63838845", "0.63773304", "0.6371379", "0.6348268", "0.63384986", "0.6333496", "0.632072", "0.63206...
0.67708635
2
Draw a line and 2 triangles to denote the current position being viewed
def _draw_current_pos(self, painter): if self.current_pos is None: return px = self.map_stamp_to_x(self.current_pos) pw, ph = self._current_pos_pointer_size # Line painter.setPen(QtGui.QPen(self._current_pos_color)) painter.setBrush(QtGui.QBrush(self._current_pos_color)) painter.drawLine(px, self._his...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw(self):\n if len(self.__points) >= 2:\n self._total_length = 0\n for i in range(len(self.__points) - 1):\n p1 = self.__points[i]\n p2 = self.__points[i + 1]\n coords = self.__line_segment(p1, p2)\n if not coords is None:\n pyglet.graphics.draw_indexed(4, py...
[ "0.73082083", "0.72350454", "0.72212887", "0.7208003", "0.71741086", "0.71650916", "0.714153", "0.7035961", "0.7022858", "0.6951389", "0.6932027", "0.6917848", "0.6891519", "0.68568385", "0.6823802", "0.67701685", "0.6716448", "0.6708265", "0.6707591", "0.6677401", "0.6676562...
0.6822145
15
Draw a simple black rectangle frame around the timeline view area
def _draw_history_border(self, painter): x = self._history_left y = self._history_top w = self._history_width h = self._history_bottom - self._history_top painter.setBrush(QtCore.Qt.NoBrush) painter.setPen(QtCore.Qt.black) painter.drawRect(x, y, w, h) painter.setBrush(self._default_brush) painter.set...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render(self, context):\n pygame.draw.rect(context, (255, 0, 0), self.box)", "def draw_rectangle(t, w, h):\r\n for i in range(2):\r\n t.forward(w)\r\n t.left(90)\r\n t.forward(h)\r\n t.left(90)", "def draw_rect(t, rect):\n t.pu()\n t.goto(rect.corner.x, rect.corne...
[ "0.6589045", "0.65832454", "0.64691156", "0.62886983", "0.6278969", "0.6278481", "0.625346", "0.62273216", "0.6219932", "0.62083167", "0.61804396", "0.6173406", "0.6169983", "0.61535484", "0.6110812", "0.6101094", "0.608499", "0.6075405", "0.6047118", "0.6037817", "0.6027269"...
0.0
-1
Calculate positions of existing stream names and draw them on the left, one for each row
def _draw_stream_names(self, painter): streams = self._history_boundaries.keys() coords = [(self._margin_left, y + (h / 2) + (self._stream_font_height / 2))\ for (_, y, _, h) in self._history_boundaries.values()] for text, coords in zip([t.lstrip('/') for t in streams], coords): painter.setBru...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _draw_stream_history(self, painter, stream_name):\n\n\t\t# x, y, w, h = self._history_boundaries[stream]\n\t\t_, y, _, h = self._history_boundaries[stream_name]\n\n\t\tmsg_y = y\n\t\tmsg_height = h\n\n\t\t# Get the renderer and the message combine interval\n\t\tmsg_combine_interval = self.map_dx_to_dstamp(self...
[ "0.6044906", "0.6034543", "0.5864108", "0.57839006", "0.55741054", "0.55496025", "0.5518214", "0.53334785", "0.53273594", "0.5275547", "0.52673393", "0.52578425", "0.52254885", "0.52020663", "0.51958114", "0.5169469", "0.5148948", "0.5139718", "0.5129087", "0.511747", "0.5115...
0.6857854
0
Draw vertical gridlines showing major and minor time divisions.
def _draw_time_divisions(self, painter): x_per_sec = self.map_dstamp_to_dx(1.0) major_divisions = [s for s in self._sec_divisions\ if x_per_sec * s >= self._major_spacing] if len(major_divisions) == 0: major_division = max(self._sec_divisions) else: major_division = min(major_di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _render_grid_lines(self, w, h, x2, y2, w2, h2):\n # 1. find sample value of top/bottom pixel coordinate\n # 2. calc sample values that need a line and draw them using pixel-coordinates\n # 3. find time values of left/right pixel coordinate\n # 2. calc time values that need a line an...
[ "0.70710504", "0.67601466", "0.6702512", "0.6604961", "0.64861846", "0.64794636", "0.6436664", "0.6410128", "0.64027077", "0.6334597", "0.6321969", "0.6250417", "0.62492687", "0.619716", "0.61785114", "0.6158972", "0.6153642", "0.6151999", "0.61019206", "0.6064893", "0.604629...
0.6433868
7
Draw black hashed vertical gridlines showing major time divisions.
def _draw_major_divisions(self, painter, stamps, start_stamp, division): label_y = self._history_top - self._current_pos_pointer_size[1] - 5 for stamp in stamps: x = self.map_stamp_to_x(stamp, False) label = self._get_label(division, stamp - start_stamp) label_x = x + self._major_divisions_label_indent ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_gray_grid(self):\n gray = \"#D3D3D3\"\n # Draw the vertical lines\n for x in range(0, self.width, self.scale):\n self.canvas.create_line(x, 0, x, self.height, fill=gray)\n\n # Draw the horizontal lines\n for y in range(0, self.height, self.scale):\n ...
[ "0.69875175", "0.68149954", "0.6810751", "0.6640372", "0.6640368", "0.6514969", "0.64459324", "0.6404875", "0.63303", "0.6300145", "0.62667954", "0.6247951", "0.6237642", "0.6236573", "0.6233812", "0.62030315", "0.61506754", "0.6144414", "0.61432195", "0.61411273", "0.6073863...
0.5688038
50
Draw grey hashed vertical gridlines showing minor time divisions.
def _draw_minor_divisions(self, painter, stamps, start_stamp, division): xs = [self.map_stamp_to_x(stamp) for stamp in stamps] painter.setPen(self._minor_division_pen) for x in xs: painter.drawLine(x, self._history_top, x, self._history_bottom) painter.setPen(self._minor_division_tick_pen) for x in xs: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nicegrid():\n pl.grid(b=True, which='major', color='black', linestyle='-')\n\n pl.grid(b=True, which='minor', color='silver', linestyle=':')", "def draw_gray_grid(self):\n gray = \"#D3D3D3\"\n # Draw the vertical lines\n for x in range(0, self.width, self.scale):\n self....
[ "0.6914279", "0.6753478", "0.67506677", "0.63327754", "0.6317481", "0.6279112", "0.6270952", "0.6231856", "0.62011725", "0.61593866", "0.61234695", "0.60951996", "0.60335577", "0.60326385", "0.5998049", "0.5859148", "0.5859122", "0.58522", "0.5829957", "0.58120954", "0.581029...
0.6185247
9
Group timestamps closer from each other than `max_interval` into one region
def _group_close_stamps(self, stamps, max_interval): region_start, prev_stamp = None, None for stamp in stamps: if prev_stamp: if stamp - prev_stamp > max_interval: region_end = prev_stamp yield (region_start, region_end) region_start = stamp else: region_start = stamp prev_stamp = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MaxToMin(min_lev, max_lev, datetime_maxes):\r\n y_res_mins = []\r\n deltaT_ranges = []\r\n for row in range(len(max_lev)-1):\r\n range_length = (datetime_maxes.iloc[row+1]-datetime_maxes.iloc[row]).seconds/3600 # hours\r\n if ~np.isnan(max_lev.iloc[row]) & (range_length>=3.5) & (range_le...
[ "0.5671331", "0.563569", "0.5533073", "0.5493953", "0.54180735", "0.53772825", "0.536929", "0.5356859", "0.53497636", "0.5327543", "0.531671", "0.5242983", "0.5203973", "0.51983154", "0.513029", "0.5128987", "0.5108332", "0.50875574", "0.50568986", "0.5040786", "0.502568", ...
0.7114516
0
Generate visible stamps every `stamp_step`
def _get_stamps(self, start_stamp, stamp_step): if start_stamp >= self._stamp_left: stamp = start_stamp else: stamp = start_stamp\ + int((self._stamp_left - start_stamp) / stamp_step)\ * stamp_step\ + stamp_step while stamp < self._end_stamp: yield stamp stamp += st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _step_plot_closure(self, step_number):\n if self.watermark_hint is not None:\n plot_image_grid(\"watermark_hint_and_mask_{}\".format(step_number),\n [np.clip(self.watermark_hint, 0, 1),\n np.clip(torch_to_np(self.mask_net_output), 0, 1)])...
[ "0.51510036", "0.5127864", "0.5116933", "0.50611883", "0.50135565", "0.49733168", "0.4951268", "0.49507222", "0.49395362", "0.49356547", "0.49340758", "0.49257594", "0.49197146", "0.4887233", "0.4885607", "0.48852775", "0.4877723", "0.48731306", "0.48653987", "0.48653987", "0...
0.6394511
0
Generates a label representing the elapsed time
def _get_label(self, division, elapsed): secs = int(elapsed) % 60 mins = int(elapsed) / 60 hrs = mins / 60 days = hrs / 24 weeks = days / 7 if division >= 7 * 24 * 60 * 60: # >1wk divisions: show weeks return '%dw' % weeks elif division >= 24 * 60 * 60: # >24h divisions: show days return '%dd' %...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return str(self.elapsed) + ' sec'", "def message(self):\n if self.display_time:\n return \"Time: {}\".format(int(self.physics_engine.time_since_start()%self.time_cycle_secs))", "def time_unit(self):\n self.skip_over_label['text'] = \"Start at (mins:secs): \"...
[ "0.7150838", "0.6989443", "0.6914872", "0.67797524", "0.6740108", "0.6696059", "0.6665888", "0.66028243", "0.6594788", "0.6568519", "0.6528017", "0.65170825", "0.64268756", "0.6359626", "0.63095796", "0.62881374", "0.6244882", "0.62107897", "0.61800116", "0.61648136", "0.6146...
0.68177
3
Converts a pixel x value to a stamp
def map_x_to_stamp(self, x, clamp_to_visible=True): fraction = float(x - self._history_left) / self._history_width if clamp_to_visible: if fraction <= 0.0: return self._stamp_left elif fraction >= 1.0: return self._stamp_right return self._stamp_left + fraction * (self._stamp_right - self._stamp_l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map_stamp_to_x(self, stamp, clamp_to_visible=True):\n\t\tif self._stamp_left is None:\n\t\t\treturn None\n\t\tfraction = (stamp - self._stamp_left) / (self._stamp_right - self._stamp_left)\n\n\t\tif clamp_to_visible:\n\t\t\tfraction = min(1.0, max(0.0, fraction))\n\n\t\treturn self._history_left + fraction * s...
[ "0.6354424", "0.60428345", "0.6025354", "0.59755665", "0.5949464", "0.5905613", "0.5802552", "0.574917", "0.5697909", "0.5613637", "0.5608171", "0.5599196", "0.5548162", "0.5536649", "0.5518662", "0.54913527", "0.5478743", "0.5445028", "0.5438126", "0.5430467", "0.54274035", ...
0.6221601
1
Converts a distance in pixel space to a distance in stamp space
def map_dx_to_dstamp(self, dx): return float(dx) * (self._stamp_right - self._stamp_left) / self._history_width
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distMap(frame1, frame2):\r\n frame1_32 = np.float32(frame1)\r\n frame2_32 = np.float32(frame2)\r\n diff32 = frame1_32 - frame2_32\r\n norm32 = np.sqrt(diff32[:,:,0]**2 + diff32[:,:,1]**2 + diff32[:,:,2]**2)/np.sqrt(255**2 + 255**2 + 255**2)\r\n dist = np.uint8(norm32*255)\r\n return dist", ...
[ "0.6133821", "0.60676736", "0.60676736", "0.6032651", "0.60021335", "0.5997194", "0.58633155", "0.5827517", "0.57786804", "0.57726216", "0.5743113", "0.57406116", "0.5637086", "0.56176287", "0.5610416", "0.55981433", "0.55748016", "0.55701214", "0.55482084", "0.5545479", "0.5...
0.5823158
8
Converts a timestamp to the x value where that stamp exists in the timeline
def map_stamp_to_x(self, stamp, clamp_to_visible=True): if self._stamp_left is None: return None fraction = (stamp - self._stamp_left) / (self._stamp_right - self._stamp_left) if clamp_to_visible: fraction = min(1.0, max(0.0, fraction)) return self._history_left + fraction * self._history_width
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_timestamp(self, timestamp):\n return int(timestamp * 1e6)", "def map_x_to_stamp(self, x, clamp_to_visible=True):\n\t\tfraction = float(x - self._history_left) / self._history_width\n\n\t\tif clamp_to_visible:\n\t\t\tif fraction <= 0.0:\n\t\t\t\treturn self._stamp_left\n\t\t\telif fraction >= 1.0:...
[ "0.59893584", "0.595037", "0.59041595", "0.5840616", "0.57994235", "0.5774577", "0.5716677", "0.5689685", "0.56540406", "0.5592866", "0.55166227", "0.5504513", "0.53762025", "0.536753", "0.5366946", "0.53652966", "0.5351976", "0.53115314", "0.53014266", "0.5296015", "0.529426...
0.6297501
0
Converts a distance in pixel space to a distance in stamp space
def map_dstamp_to_dx(self, dstamp): return (float(dstamp) * self._history_width) / (self._stamp_right - self._stamp_left)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distMap(frame1, frame2):\r\n frame1_32 = np.float32(frame1)\r\n frame2_32 = np.float32(frame2)\r\n diff32 = frame1_32 - frame2_32\r\n norm32 = np.sqrt(diff32[:,:,0]**2 + diff32[:,:,1]**2 + diff32[:,:,2]**2)/np.sqrt(255**2 + 255**2 + 255**2)\r\n dist = np.uint8(norm32*255)\r\n return dist", ...
[ "0.6133821", "0.60676736", "0.60676736", "0.6032651", "0.5997194", "0.58633155", "0.5827517", "0.5823158", "0.57786804", "0.57726216", "0.5743113", "0.57406116", "0.5637086", "0.56176287", "0.5610416", "0.55981433", "0.55748016", "0.55701214", "0.55482084", "0.5545479", "0.55...
0.60021335
4
Constructs a widget displaying data streams.
def __init__(self, streams, parent=None): # Initialize class QtGui.QWidget.__init__(self, parent) self.main_layout = QtGui.QVBoxLayout(self) self.setLayout(self.main_layout) # Retrieve first and last timestamps _streams_ts_float = dict() for stream_name in streams.keys(): tuple_ts = streams[stream_na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, arg=None, maxpoints=None, token=None, **kwargs):\n super(Stream, self).__init__(\"stream\")\n\n # Validate arg\n # ------------\n if arg is None:\n arg = {}\n elif isinstance(arg, self.__class__):\n arg = arg.to_plotly_json()\n elif...
[ "0.60662293", "0.60183984", "0.5765122", "0.57445544", "0.5743239", "0.5712016", "0.5709956", "0.5702659", "0.5701964", "0.5619593", "0.5604423", "0.55646557", "0.55324537", "0.5525624", "0.5523583", "0.54967433", "0.5460502", "0.5456427", "0.5456427", "0.54321116", "0.542418...
0.6148988
0
Return the latest file activated at a specific timestamp
def getFileAtStamp(self, timestamp): out = "" out_ts = (0,0) for stream_name in self.stamps_by_stream.keys(): ts_index = bisect.bisect_right(self.stamps_by_stream[stream_name], timestamp)-1 if ts_index < 0: continue tuple_ts = self.streams[stream_name].keys() tuple_ts.sort() if tuple_ts[ts_inde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getRecentFile(*p):\n\tfrom os import stat\n\tfrom os.path import join\n\tfrom glob import glob\n\tresult = \"\"\n\tfiles = glob(join(p[0],*p[1:]))\n\tfor file in files:\n\t\tif result == \"\":\n\t\t\tresult = file\n\t\telse:\n\t\t\tif stat(file).st_mtime > stat(result).st_mtime:\n\t\t\t\tresult = file\n\tretur...
[ "0.6752036", "0.66719294", "0.6483359", "0.64500797", "0.6422892", "0.64227515", "0.6416471", "0.6395238", "0.6394504", "0.62854326", "0.62306523", "0.62281126", "0.61313367", "0.6093726", "0.6092767", "0.60853755", "0.6073606", "0.6070921", "0.60552466", "0.6004467", "0.5956...
0.65377134
2
Return the list of files active at a specific timestamp
def getFilesAtStamp(self, timestamp): out = [] for stream_name in self.stamps_by_stream.keys(): ts_index = bisect.bisect_right(self.stamps_by_stream[stream_name], timestamp)-1 if ts_index < 0: continue tuple_ts = self.streams[stream_name].keys() tuple_ts.sort() out.append(self.streams[stream_name...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_superseded_by_timestamp(logfiles, current_timestamp):\n return [\n lf for lf in logfiles\n if current_timestamp - lf.timestamp > ONE_HOUR_PLUS\n ]", "def list_files(line_id, datetime_, len_):\n the_dir = pathlib.Path(data_dir())/str(line_id)\n format_spec= \"%Y-%m-%d %H:%M\"\...
[ "0.66932845", "0.66161937", "0.63355404", "0.6247447", "0.62039196", "0.6180368", "0.6078104", "0.6065711", "0.5992878", "0.59065336", "0.5900509", "0.5812714", "0.57897043", "0.5761614", "0.5710695", "0.5701943", "0.5648884", "0.56379694", "0.5618448", "0.55972624", "0.55963...
0.6878091
0
Slides the cursor to the previous frame. Does nothing if there is no frame before the current position
def moveToPreviousFrame(self): all_ts = [s for t in self.stamps_by_stream.values() for s in t] all_ts.sort() first_frame = all_ts[0] selected_index = bisect.bisect_right(all_ts, self._timeline.current_pos)-1 if selected_index <= 0 or all_ts[selected_index-1] < first_frame: # There is no data before, or no...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MoveToPreviousSlide(self, event):\n pass", "def move_previous():\n self.variables.table.set_joystick(False)\n self.variables.table.set_axis(\n [True, True, True]\n ) # so all axis can be adressed\n errorcode = self.variables.table.move_to(\n ...
[ "0.67286366", "0.6641986", "0.66257024", "0.66009825", "0.6596117", "0.649492", "0.64684224", "0.6314484", "0.63081133", "0.62761515", "0.6240718", "0.62358576", "0.6189635", "0.618176", "0.61055577", "0.60551465", "0.6049198", "0.602905", "0.6027203", "0.59977496", "0.598562...
0.67099565
1
Slides the cursor to the next frame. Does nothing if there is no frame after the current position
def moveToNextFrame(self): all_ts = [s for t in self.stamps_by_stream.values() for s in t] all_ts.sort() first_frame = all_ts[0] selected_index = bisect.bisect_right(all_ts, self._timeline.current_pos)-1 if len(all_ts)-1 == selected_index: # We are already at the last frame return # Move forward eno...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Advance(self):\n\t\t\n\t\tself.present_frame += 1\n\t\t\n\t\tif self.present_frame < len(self.frames):\n\t\t\tself.frames[self.present_frame].Draw()\n\t\t\t\n\t\telse if self.loop:\n\t\t\tself.present_frame = 0\n\t\t\tself.frames[self.present_frame].Draw()\n\t\t\n\t\telse:\n\t\t\tself.Stop()", "def moveFrame...
[ "0.68434274", "0.6700361", "0.66485", "0.66261816", "0.63143", "0.62346226", "0.6141126", "0.61278856", "0.60991865", "0.6071463", "0.6062554", "0.6061215", "0.6060542", "0.6012689", "0.60106057", "0.6004812", "0.59986347", "0.59896463", "0.59786433", "0.5969532", "0.5899186"...
0.66077775
4
creates the solvent coupling array given the input efields values for a specific time, t w1first selects whether w1 or w2p is the first interacting positive field accounts for CARS interactions
def sOmega(E1, E2, E3, t, wvg, mu_vg, w1first = True): if w1first==True: first = E1 else: first = E3 O = np.zeros((len(t),3,3),dtype=np.complex64) # from gg O[:,1,0] = 0.5*mu_vg * E2 * first * rotor(-wvg*t) O[:,2,0] = 0.5*mu_vg * E2 * first * rotor( wvg*t) return O
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spikingModel(wEE, wEI, wIE, wII, stim_e, stim_i,\n time=1000, dt=0.1, Vth=1.0, Vre=0.0,\n tau_e=15.0, tau_i=10.0, ref_e=5.0, ref_i=5.0, \n syntau2_e=3.0, syntau2_i=2.0, syntau1=1.0):\n\n T = np.arange(0,time,dt)\n nE = wEE.shape[0]\n nI = wII.shape[0]\n\...
[ "0.54710454", "0.54353726", "0.53806365", "0.5359551", "0.53592795", "0.53414726", "0.526344", "0.5240726", "0.52171093", "0.5178414", "0.51758915", "0.5162229", "0.5154969", "0.5150186", "0.5112925", "0.510639", "0.50983155", "0.5083747", "0.5056256", "0.50537574", "0.504135...
0.0
-1
A list of references to all availability sets in the proximity placement group.
def availability_sets(self) -> Sequence['outputs.SubResourceWithColocationStatusResponse']: return pulumi.get(self, "availability_sets")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSets():", "def available_sets(self, data=None, remote=False):\n if data is None:\n data = [SET_LABELS.RELEASE_DATE, SET_LABELS.BLOCK]\n else:\n if SET_LABELS.RELEASE_DATE not in data:\n data.append(SET_LABELS.RELEASE_DATE)\n if SET_LABELS.BLOCK...
[ "0.6209047", "0.61726505", "0.6001793", "0.58266896", "0.57690054", "0.5768825", "0.5753576", "0.5750528", "0.5735078", "0.573019", "0.57248986", "0.5633302", "0.55227154", "0.5505786", "0.5500121", "0.5497109", "0.54799634", "0.5475461", "0.54534113", "0.5427677", "0.5427677...
0.6932559
0
Describes colocation status of the Proximity Placement Group.
def colocation_status(self) -> Optional['outputs.InstanceViewStatusResponse']: return pulumi.get(self, "colocation_status")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_proximity_placement_group_output(include_colocation_status: Optional[pulumi.Input[Optional[str]]] = None,\n proximity_placement_group_name: Optional[pulumi.Input[str]] = None,\n resource_group_name: Optional[pulumi.Input[str]] ...
[ "0.60518825", "0.55944324", "0.51280826", "0.5106413", "0.4960813", "0.4956404", "0.48696086", "0.4845193", "0.48329565", "0.48307562", "0.48002636", "0.47613734", "0.47556528", "0.47326788", "0.47120273", "0.46764436", "0.46637207", "0.46574867", "0.46571022", "0.46519265", ...
0.6535979
0
Specifies the user intent of the proximity placement group.
def intent(self) -> Optional['outputs.ProximityPlacementGroupPropertiesResponseIntent']: return pulumi.get(self, "intent")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def proximity_placement_group_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"proximity_placement_group_id\")", "def set_target_org_favor(self, target, org, amount, gossip):\n rep, _ = target.Dominion.reputations.get_or_create(organization=org)\n rep.favor = amount\n ...
[ "0.51500684", "0.5134789", "0.49458975", "0.49388775", "0.49299842", "0.48332885", "0.47327837", "0.4717751", "0.47022802", "0.4651362", "0.46352458", "0.45787394", "0.45650944", "0.45557648", "0.4527954", "0.45201847", "0.4517139", "0.45151445", "0.4511541", "0.45032752", "0...
0.66879284
0
A list of references to all virtual machine scale sets in the proximity placement group.
def virtual_machine_scale_sets(self) -> Sequence['outputs.SubResourceWithColocationStatusResponse']: return pulumi.get(self, "virtual_machine_scale_sets")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSets():", "def getscales(self):\n return self.scales", "def scale_model(self) -> List[ClsSetInfo]:\n # Find layer groups\n connected_graph = ConnectedGraph(self._model)\n ordered_module_list = get_ordered_list_of_conv_modules(connected_graph.starting_ops)\n graph_searc...
[ "0.5751221", "0.5642852", "0.5589611", "0.55564994", "0.552904", "0.54642105", "0.5410798", "0.5333115", "0.53124064", "0.528538", "0.5217663", "0.52064294", "0.5205053", "0.5187349", "0.5155125", "0.5154665", "0.5090085", "0.5086139", "0.5064288", "0.50516343", "0.50274223",...
0.6637517
0
A list of references to all virtual machines in the proximity placement group.
def virtual_machines(self) -> Sequence['outputs.SubResourceWithColocationStatusResponse']: return pulumi.get(self, "virtual_machines")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def virtual_machines(self):\n return self._virtual_machines", "def VirtualMachines(self):\n if not self._vms:\n vms = self._get_objects(vim.VirtualMachine)\n for vm in vms:\n self._vms[vm.name] = VirtualMachine(vm, self.service_instance)\n return self._vm...
[ "0.639447", "0.60194457", "0.5924702", "0.57988507", "0.57118845", "0.57008165", "0.56512684", "0.55621773", "0.5538973", "0.54351383", "0.5410967", "0.53850055", "0.5377102", "0.5369306", "0.5311894", "0.52921194", "0.5284723", "0.52809006", "0.52809006", "0.5277062", "0.527...
0.5576687
7
Specifies the Availability Zone where virtual machine, virtual machine scale set or availability set associated with the proximity placement group can be created.
def zones(self) -> Optional[Sequence[str]]: return pulumi.get(self, "zones")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def availability_zone(self) -> str:\n return pulumi.get(self, \"availability_zone\")", "def availability_zone(self) -> Optional[str]:\n return pulumi.get(self, \"availability_zone\")", "def availability_zone(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"availability_zone\")", "...
[ "0.5842643", "0.5806106", "0.57767004", "0.572297", "0.572297", "0.5708085", "0.56195277", "0.56034905", "0.55768645", "0.53280735", "0.53220266", "0.53134626", "0.5304716", "0.53038365", "0.53038365", "0.5241365", "0.51650095", "0.51525104", "0.51333594", "0.5128593", "0.511...
0.0
-1
Retrieves information about a proximity placement group .
def get_proximity_placement_group(include_colocation_status: Optional[str] = None, proximity_placement_group_name: Optional[str] = None, resource_group_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_proximity_placement_group_output(include_colocation_status: Optional[pulumi.Input[Optional[str]]] = None,\n proximity_placement_group_name: Optional[pulumi.Input[str]] = None,\n resource_group_name: Optional[pulumi.Input[str]] ...
[ "0.7122391", "0.6447593", "0.5987146", "0.5548576", "0.5290991", "0.5241569", "0.51601255", "0.5140031", "0.5072342", "0.50679076", "0.5049934", "0.50372356", "0.503405", "0.4999213", "0.49940577", "0.49926674", "0.49398476", "0.49374238", "0.4922861", "0.49130318", "0.491201...
0.6372414
2
Retrieves information about a proximity placement group .
def get_proximity_placement_group_output(include_colocation_status: Optional[pulumi.Input[Optional[str]]] = None, proximity_placement_group_name: Optional[pulumi.Input[str]] = None, resource_group_name: Optional[pulumi.Input[str]] = None,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def proximity_placement_group_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"proximity_placement_group_id\")", "def get_proximity_placement_group(include_colocation_status: Optional[str] = None,\n proximity_placement_group_name: Optional[str] = None,\...
[ "0.6448816", "0.6372465", "0.59885687", "0.5547061", "0.52896416", "0.5240235", "0.5159709", "0.514106", "0.50733167", "0.50714", "0.50509393", "0.50364816", "0.50350046", "0.5000382", "0.49950966", "0.49934098", "0.49427128", "0.49386653", "0.49252462", "0.4914164", "0.49125...
0.71223414
0
This function constructs VGG_CNN_F and is based on
def VGG_CNN_F(arch_mode='full', weights='imagenet', input_shape=(224, 224, 3), pooling=None, classes=1000): if not (weights in {'imagenet', None} or os.path.exists(weights)): raise ValueError('The `weights` argument should be either ' '`None` (random initialization), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_vgg16(self):\n use_batch_norm = self.use_batch_norm\n\n imgs = tf.placeholder(tf.float32, [self.batch_size]+self.img_shape)\n is_train = tf.placeholder(tf.bool)\n\n conv1_1_feats = convolution(imgs, 3, 3, 64, 1, 1, 'conv1_1')\n conv1_1_feats = nonlinear(conv1_1_feats, '...
[ "0.7441737", "0.7329161", "0.6902189", "0.6832145", "0.6800463", "0.6664944", "0.66505325", "0.6622111", "0.66121346", "0.6557664", "0.6509413", "0.6507075", "0.6500263", "0.6457403", "0.6448143", "0.64436185", "0.63982594", "0.63637847", "0.6361868", "0.6351918", "0.63231635...
0.679927
5
Return JSONserializable representation of the object.
def to_dict(self): out = super().to_dict() out["connections"] = self.connections return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize(self, obj):\n return json.dumps(obj)", "def toJSON(self):\n return json.dumps(self, default=lambda o: o.__dict__)", "def serialize(self):\n return json.dumps(self.as_dict())", "def toJSON(cls, obj):\n return json.dumps(obj)", "def serialize(self) -> str:\n r...
[ "0.8475618", "0.84085596", "0.83957154", "0.838217", "0.83239555", "0.8288305", "0.8275888", "0.8227394", "0.81710005", "0.81556803", "0.8117269", "0.8117269", "0.81065536", "0.81065536", "0.81065536", "0.80988455", "0.80659264", "0.8029448", "0.7999212", "0.799741", "0.79870...
0.0
-1
converts 1Dnumpy array to string readable py plotly.js
def numpy_to_plotlystring(numpy_array, precision=4): np.set_printoptions(threshold=np.nan) # enables full printing n_data = np.shape(numpy_array)[0] # prevent array2string to cut string by ofsestting maximal width max_line_width=n_data*(8) # Output Format [#.####, ...], thus 7 chars per entry, added 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def np2str(a: np.ndarray) -> str:\n return json.dumps(a.tolist())", "def z_as_plotly(self):\n xs = np.asarray(self.position)[:,2]\n return numpy_to_plotlystring(xs)", "def x_as_plotly(self):\n xs = np.asarray(self.position)[:,0]\n return numpy_to_plotlystring(xs)", "def y_as_pl...
[ "0.7462204", "0.73186773", "0.71991277", "0.692029", "0.65574473", "0.6528165", "0.64883965", "0.64638263", "0.64638263", "0.63993347", "0.6335", "0.6298709", "0.6124041", "0.6007191", "0.59757954", "0.5960761", "0.5929254", "0.588368", "0.58670706", "0.58461416", "0.5804916"...
0.78322643
0
Right hand side of ODE
def rhs(self, q, m): # Number of bodies N = self.n_planets # Empty np.arrays for computed data dp = np.zeros_like(q) for k in range(N): dp_k = np.zeros(self.D) for i in range(N): if k != i: qi_qk = q[i*self.D:(i+1)*self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ode(self, **kwargs):\n pass", "def rightSideOfODE(self, Y, t):\n\t\ttemperature = Y[-1]\n\t\tamounts = Y[:-1]\n\t\tself.amounts = amounts\n\t\t# first get the species amount changes (as an array)\n\t\tdNdt = -1 * self.getMolarFluxes(temperature)\n\t\t# then get the temperature change, and append it to...
[ "0.75142777", "0.7181643", "0.69310933", "0.6536001", "0.646115", "0.6173939", "0.6170267", "0.6157919", "0.6156554", "0.6128975", "0.6113935", "0.60999966", "0.60107154", "0.5988227", "0.59345883", "0.59310585", "0.583424", "0.5826762", "0.5802471", "0.5792491", "0.578822", ...
0.0
-1