query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
If no start_params are given, use reasonable defaults. | def _get_start_params(self, start_params=None):
if start_params is None:
if hasattr(self, 'start_params'):
start_params = self.start_params
elif self.exog is not None:
# fails for shape (K,)?
start_params = [0] * self.exog.shape[1]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _apply_params(self):\n config = self.get_startup_config()\n # Pass true to _set_params so we know these are startup values\n self._set_params(config, True)",
"def start( *args, **kwargs ):",
"def ReviewServiceArgs(cls, start = False):\n return (start,)",
"def prep_streamin... | [
"0.6189463",
"0.596062",
"0.5936523",
"0.5922948",
"0.5908743",
"0.5905468",
"0.58663934",
"0.5828694",
"0.5814522",
"0.5814522",
"0.5756695",
"0.5748159",
"0.5678698",
"0.5660043",
"0.5645459",
"0.56087685",
"0.56059563",
"0.5576346",
"0.5533934",
"0.5510091",
"0.55027384",
... | 0.73069286 | 0 |
Compute a sequence of Wald tests for terms over multiple columns This computes joined Wald tests for the hypothesis that all coefficients corresponding to a `term` are zero. `Terms` are defined by the underlying formula or by string matching. | def wald_test_terms(self, skip_single=False, extra_constraints=None,
combine_terms=None): # noqa:E501
result = self
if extra_constraints is None:
extra_constraints = []
if combine_terms is None:
combine_terms = []
design_info = getattr(res... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_all(any, shard, shard_term_features, qterms):\n tmp = 1\n for t in qterms:\n if t in shard_term_features[shard]:\n cdf = shard_term_features[shard][t].df\n else:\n cdf = 0\n tmp *= cdf/any\n all = tmp * any\n return all",
"def evaluate_terms(terms):\... | [
"0.5098105",
"0.49435574",
"0.49396107",
"0.4900988",
"0.4857589",
"0.4845605",
"0.46524802",
"0.4648548",
"0.4620158",
"0.46167716",
"0.46052644",
"0.45635396",
"0.45390478",
"0.45198467",
"0.45163706",
"0.4515403",
"0.4504055",
"0.45020077",
"0.44826326",
"0.44797707",
"0.4... | 0.61136484 | 0 |
Formats dictated text to camel case. | def camel_case_text(text):
newText = format_camel_case(text)
Text("%(text)s").execute({"text": newText}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format_camel(text):\r\n\toutput = \"\"\r\n\tfor i,w in enumerate(text.split(\" \")):\r\n\t\tif i > 0:\r\n\t\t\toutput += w[0].upper() + w[1:]\r\n\t\telse:\r\n\t\t\toutput += w\r\n\treturn output",
"def _to_camel_case(text: str) -> str:\n return \"\".join(word.title() for word in text.split(\"_\"))",
"de... | [
"0.7785462",
"0.7445175",
"0.72581625",
"0.7184089",
"0.71070236",
"0.70822126",
"0.6964225",
"0.69159365",
"0.6845309",
"0.68369484",
"0.683591",
"0.67920893",
"0.6758114",
"0.6714242",
"0.66896963",
"0.6676171",
"0.6648838",
"0.6558678",
"0.6504255",
"0.6491712",
"0.6463216... | 0.77859265 | 0 |
Formats n words to the left of the cursor to camel case. Note that word count differs between editors and programming languages. The examples are all from Eclipse/Python. | def camel_case_count(n):
saveText = _get_clipboard_text()
cutText = _select_and_cut_text(n)
if cutText:
endSpace = cutText.endswith(' ')
text = _cleanup_text(cutText)
newText = _camelify(text.split(' '))
if endSpace:
newText = newText + ' '
newText = newTe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pascal_case_count(n):\n saveText = _get_clipboard_text()\n cutText = _select_and_cut_text(n)\n if cutText:\n endSpace = cutText.endswith(' ')\n text = _cleanup_text(cutText)\n newText = text.title().replace(' ', '')\n if endSpace:\n newText = newText + ' '\n ... | [
"0.73462373",
"0.6970347",
"0.6930063",
"0.69166636",
"0.66168064",
"0.6470583",
"0.6462862",
"0.6323668",
"0.6291367",
"0.6219177",
"0.61823606",
"0.61714643",
"0.6143847",
"0.6097175",
"0.60751027",
"0.60740274",
"0.60687244",
"0.6060768",
"0.6060067",
"0.6053927",
"0.59890... | 0.7841125 | 0 |
Takes a list of words and returns a string formatted to camel case. | def _camelify(words):
newText = ''
for word in words:
if newText == '':
newText = word[:1].lower() + word[1:]
else:
newText = '%s%s' % (newText, word.capitalize())
return newText | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render_camel(var_words):\n return ''.join([word.capitalize() for word in var_words])",
"def format_camel(text):\r\n\toutput = \"\"\r\n\tfor i,w in enumerate(text.split(\" \")):\r\n\t\tif i > 0:\r\n\t\t\toutput += w[0].upper() + w[1:]\r\n\t\telse:\r\n\t\t\toutput += w\r\n\treturn output",
"def camel_case... | [
"0.8251883",
"0.7825327",
"0.7563968",
"0.7526195",
"0.7506611",
"0.7506611",
"0.7482835",
"0.72373885",
"0.7220596",
"0.7182877",
"0.7105976",
"0.7050961",
"0.70338947",
"0.7015833",
"0.70085067",
"0.6960694",
"0.6957555",
"0.6947957",
"0.69223166",
"0.69102275",
"0.6900598"... | 0.8511594 | 0 |
Formats dictated text to pascal case. | def pascal_case_text(text):
newText = format_pascal_case(text)
Text("%(text)s").execute({"text": newText}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_pascal_case_to_readable_format(text):\n return \"\".join(list(map(lambda x : \" \" + x.lower() if x.isupper() else x, list(text))))",
"def pascal_case(value: str, **kwargs: Any) -> str:\n return \"\".join(map(str.title, split_words(value)))",
"def mixed_pascal_case(value: str, **kwargs: A... | [
"0.8325709",
"0.7577789",
"0.7054179",
"0.6948193",
"0.67188567",
"0.66129065",
"0.64995056",
"0.64025515",
"0.6349463",
"0.633064",
"0.6246584",
"0.6222095",
"0.6209781",
"0.6185109",
"0.61772996",
"0.6169017",
"0.6150109",
"0.6128363",
"0.6115912",
"0.6075849",
"0.60635227"... | 0.8074431 | 1 |
Formats n words to the left of the cursor to pascal case. Note that word count differs between editors and programming languages. The examples are all from Eclipse/Python. | def pascal_case_count(n):
saveText = _get_clipboard_text()
cutText = _select_and_cut_text(n)
if cutText:
endSpace = cutText.endswith(' ')
text = _cleanup_text(cutText)
newText = text.title().replace(' ', '')
if endSpace:
newText = newText + ' '
newText = n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pascal_case_text(text):\n newText = format_pascal_case(text)\n Text(\"%(text)s\").execute({\"text\": newText})",
"def convert_pascal_case_to_readable_format(text):\n return \"\".join(list(map(lambda x : \" \" + x.lower() if x.isupper() else x, list(text))))",
"def pascal_case(value: str, **kwa... | [
"0.6748049",
"0.668678",
"0.66685766",
"0.65173775",
"0.6507821",
"0.64246476",
"0.62588936",
"0.5990105",
"0.5817989",
"0.5803157",
"0.5715056",
"0.5696685",
"0.5679296",
"0.5647844",
"0.56197363",
"0.56024784",
"0.5598668",
"0.5587423",
"0.5575231",
"0.5562862",
"0.5554474"... | 0.7799282 | 0 |
Formats dictated text to snake case. | def snake_case_text(text):
newText = format_snake_case(text)
Text("%(text)s").execute({"text": newText}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def CamelCase_to_snake_case(text):\n s1 = re.sub('(.)([A-Z][a-z]+)', r'\\1_\\2', text)\n return re.sub('([a-z0-9])([A-Z])', r'\\1_\\2', s1).lower()",
"def _camel_case_to_snake_case(text: str) -> str:\n return re.sub(r\"(?<!^)(?=[A-Z])\", \"_\", text).lower()",
"def snake_case(value: str, **kwargs: Any... | [
"0.70693374",
"0.7003121",
"0.69320387",
"0.6745865",
"0.67148775",
"0.6688143",
"0.66141355",
"0.65758014",
"0.65488815",
"0.64430827",
"0.6417229",
"0.6416612",
"0.63867706",
"0.63755894",
"0.6365438",
"0.63618255",
"0.6327051",
"0.6304511",
"0.6293115",
"0.62793934",
"0.62... | 0.7620087 | 0 |
Formats n words to the left of the cursor to snake case. Note that word count differs between editors and programming languages. The examples are all from Eclipse/Python. | def snake_case_count(n):
saveText = _get_clipboard_text()
cutText = _select_and_cut_text(n)
if cutText:
endSpace = cutText.endswith(' ')
text = _cleanup_text(cutText.lower())
newText = '_'.join(text.split(' '))
if endSpace:
newText = newText + ' '
newText ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pascal_case_count(n):\n saveText = _get_clipboard_text()\n cutText = _select_and_cut_text(n)\n if cutText:\n endSpace = cutText.endswith(' ')\n text = _cleanup_text(cutText)\n newText = text.title().replace(' ', '')\n if endSpace:\n newText = newText + ' '\n ... | [
"0.7383346",
"0.7166221",
"0.6926944",
"0.6357526",
"0.62876",
"0.6222895",
"0.5993043",
"0.5974094",
"0.5933266",
"0.5884368",
"0.5855512",
"0.58387643",
"0.57972294",
"0.57646835",
"0.574676",
"0.57403195",
"0.57358956",
"0.5729549",
"0.5655932",
"0.5653761",
"0.56503767",
... | 0.7747876 | 0 |
Formats n words to the left of the cursor to upper case. Note that word count differs between editors and programming languages. The examples are all from Eclipse/Python. | def uppercase_count(n):
saveText = _get_clipboard_text()
cutText = _select_and_cut_text(n)
if cutText:
newText = cutText.upper()
newText = newText.replace("%", "%%") # Escape any format chars.
Text(newText).execute()
else: # Failed to get text from clipboard.
Key('c-v')... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pascal_case_count(n):\n saveText = _get_clipboard_text()\n cutText = _select_and_cut_text(n)\n if cutText:\n endSpace = cutText.endswith(' ')\n text = _cleanup_text(cutText)\n newText = text.title().replace(' ', '')\n if endSpace:\n newText = newText + ' '\n ... | [
"0.7106559",
"0.6925886",
"0.6874002",
"0.66543984",
"0.64259547",
"0.60723484",
"0.6036499",
"0.6025138",
"0.59689647",
"0.5953917",
"0.58584684",
"0.5850111",
"0.58310604",
"0.58229566",
"0.5809339",
"0.57956696",
"0.5791785",
"0.5782367",
"0.57508373",
"0.5699419",
"0.5694... | 0.6954752 | 1 |
Formats dictated text to lower case. | def lowercase_text(text):
newText = format_lower_case(text)
Text("%(text)s").execute({"text": newText}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_lower(self, text):\n return text.lower()",
"def LOWER(text):\n return text.lower()",
"def LCase(text):\n return text.lower()",
"def lower(text):\n text = text.lower()\n return text",
"def toLowerCase(self) -> None:\n self.text = self.text.lower()",
"def normalize_case(text)... | [
"0.7950047",
"0.7778725",
"0.76062495",
"0.757439",
"0.7487152",
"0.7474553",
"0.744533",
"0.73600155",
"0.7350697",
"0.7326691",
"0.72125846",
"0.7002865",
"0.6945686",
"0.6917932",
"0.68785036",
"0.68477106",
"0.68410075",
"0.670077",
"0.6686607",
"0.66477966",
"0.6613953",... | 0.7870158 | 1 |
Formats n words to the left of the cursor to lower case. Note that word count differs between editors and programming languages. The examples are all from Eclipse/Python. | def lowercase_count(n):
saveText = _get_clipboard_text()
cutText = _select_and_cut_text(n)
if cutText:
newText = cutText.lower()
newText = newText.replace("%", "%%") # Escape any format chars.
Text(newText).execute()
else: # Failed to get text from clipboard.
Key('c-v')... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pascal_case_count(n):\n saveText = _get_clipboard_text()\n cutText = _select_and_cut_text(n)\n if cutText:\n endSpace = cutText.endswith(' ')\n text = _cleanup_text(cutText)\n newText = text.title().replace(' ', '')\n if endSpace:\n newText = newText + ' '\n ... | [
"0.68059164",
"0.67174524",
"0.6428881",
"0.612785",
"0.60862404",
"0.60718983",
"0.6050795",
"0.59884626",
"0.59352654",
"0.59344274",
"0.5890492",
"0.58382356",
"0.5795074",
"0.5784348",
"0.5748356",
"0.5746969",
"0.5746722",
"0.57407844",
"0.57185817",
"0.5685551",
"0.5658... | 0.73799914 | 0 |
Cleans up the text before formatting to camel, pascal or snake case. Removes dashes, underscores, single quotes (apostrophes) and replaces them with a space character. Multiple spaces, tabs or new line characters are collapsed to one space character. Returns the result as a string. | def _cleanup_text(text):
prefixChars = ""
suffixChars = ""
if text.startswith("-"):
prefixChars += "-"
if text.startswith("_"):
prefixChars += "_"
if text.endswith("-"):
suffixChars += "-"
if text.endswith("_"):
suffixChars += "_"
text = text.strip()
text ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_review(self, text):\n text = text.lower() # lowercase capital letters\n\n if self.remove_stopwords:\n text = self.remove_stopwords_f(text, keep_neg_words=True)\n\n text = re.sub('[^a-zA-Z]+', ' ', text) # select only alphabet characters (letters only)\n # text = r... | [
"0.6987627",
"0.69115055",
"0.68299866",
"0.68170524",
"0.6792189",
"0.6779221",
"0.6683785",
"0.6663541",
"0.66497254",
"0.661544",
"0.66122067",
"0.6598049",
"0.65703285",
"0.6562379",
"0.6545204",
"0.6541442",
"0.6536878",
"0.6534535",
"0.6511388",
"0.64796376",
"0.6465856... | 0.7590578 | 0 |
Returns the text contents of the system clip board. | def _get_clipboard_text():
clipboard = Clipboard()
return clipboard.get_system_text() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getTextFromClipboard(self) -> str:\n cb = self.qtApp.clipboard()\n if cb:\n QtWidgets.QApplication.processEvents()\n return cb.text()\n g.trace('no clipboard!')\n return ''",
"def read_all_screen(self):\n full_text = \"\"\n for ypos in range(sel... | [
"0.65942186",
"0.6435534",
"0.63300586",
"0.61199254",
"0.6119129",
"0.61073905",
"0.6069073",
"0.5950574",
"0.5950574",
"0.5950574",
"0.5950574",
"0.5950574",
"0.58960754",
"0.58941376",
"0.588573",
"0.5876206",
"0.5874571",
"0.5853478",
"0.58394194",
"0.58292186",
"0.581609... | 0.68701446 | 0 |
Selects wordCount number of words to the left of the cursor and cuts them out of the text. Returns the text from the system clip board. | def _select_and_cut_text(wordCount):
clipboard = Clipboard()
clipboard.set_system_text('')
Key('cs-left/3:%s/10, c-x/10' % wordCount).execute()
return clipboard.get_system_text() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cut_in_words(self,linea):\n length = 0\n res = ''\n limit_screen = 30\n for word in linea.split(' '):\n if length + len(word) <= limit_screen:\n new_word = word + ' '\n length += len(new_word)\n else:\n new_word = '\... | [
"0.5991796",
"0.5976473",
"0.5937633",
"0.59360015",
"0.5921066",
"0.56286114",
"0.5511649",
"0.54804397",
"0.54544324",
"0.53912175",
"0.53642124",
"0.5343262",
"0.5335321",
"0.53241056",
"0.5289842",
"0.52851576",
"0.52594143",
"0.5233265",
"0.52057403",
"0.5187018",
"0.516... | 0.808763 | 0 |
Generates a plot of the specified data file and sets the ThumbnailPanel's bitmap accordingly | def plot_thumb(self, data_fname):
thumbnail = self.controller.plot_thumb(data_fname, self.bitmap_width, self.bitmap_height)
if thumbnail is not None:
self.figure_bmp.SetBitmap(thumbnail)
else:
self.plot_blank() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _generate_plot(ax, power_data, title, min_db, max_db):\n # only generate plots for the transducers that have data\n if power_data.size <= 0:\n return\n\n ax.set_title(title, fontsize=ZPLSCCPlot.font_size_large)\n return imshow(ax, power_data, interpolation='none', aspect=... | [
"0.6426788",
"0.63435924",
"0.6265439",
"0.62604624",
"0.62195396",
"0.62031156",
"0.6172043",
"0.613385",
"0.61045796",
"0.60914683",
"0.60585433",
"0.6013517",
"0.5999623",
"0.5993755",
"0.5926441",
"0.5907435",
"0.58943826",
"0.58767754",
"0.5841144",
"0.5835282",
"0.58277... | 0.7840498 | 0 |
Method to invoke Disable command on SDP Master. | def do(self):
this_server = TangoServerHelper.get_instance()
try:
sdp_master_ln_fqdn = ""
property_val = this_server.read_property("SdpMasterFQDN")[0]
sdp_master_ln_fqdn = sdp_master_ln_fqdn.join(property_val)
sdp_mln_client_obj = TangoClient(sdp_master_ln... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Disable(self):\n handler = self.get_command_object(\"Disable\")\n handler()",
"def cmd_disable(self, app_name=None):\n rc = self.socket_command_with_project('disable', app_name)\n return rc",
"def disable(self, sid):\n return",
"def disable(self):\n logging.debug... | [
"0.72543144",
"0.682667",
"0.6537114",
"0.6527344",
"0.6507283",
"0.6505277",
"0.64890575",
"0.64763004",
"0.6459875",
"0.6419226",
"0.63770306",
"0.637017",
"0.6363984",
"0.63474035",
"0.62944055",
"0.6292118",
"0.6276801",
"0.627648",
"0.627209",
"0.62699884",
"0.62642103",... | 0.795008 | 0 |
Returns whether the current instance is an edge server in crosssilo FL. | def is_edge_server() -> bool:
return Config().args.port is not None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_edge_site(self) -> bool:\n return self.config.edge",
"def is_connected_to(self, receiver: SkupperSite) -> bool:\n return receiver in self.connected_sites",
"def isEdge(self,x,y):\n\t\treturn y in self._dictOut[x]",
"def isEdge(self,x,y):\n\t\treturn y in self._dict[x]",
"def isEdge(sel... | [
"0.7256668",
"0.65036786",
"0.6496777",
"0.6456621",
"0.64283705",
"0.63906115",
"0.6335268",
"0.63215107",
"0.6301984",
"0.6286371",
"0.62700874",
"0.6203978",
"0.61531115",
"0.6063415",
"0.60367393",
"0.60330695",
"0.5981147",
"0.5979535",
"0.5975428",
"0.5965382",
"0.59630... | 0.7117317 | 1 |
Returns whether the current instance is a central server in crosssilo FL. | def is_central_server() -> bool:
return hasattr(Config().algorithm,
'cross_silo') and Config().args.port is None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_remote(self):\n if socket.gethostbyname(socket.gethostname()).startswith('10.7'):\n return False\n else:\n return True",
"def is_on(self) -> bool:\n val = bool(self._cluster_handler.cluster.get(self._zcl_attribute))\n return (not val) if self.inverted else... | [
"0.66080767",
"0.65418833",
"0.6524869",
"0.6519794",
"0.6491021",
"0.64296925",
"0.639115",
"0.63826996",
"0.6380103",
"0.6369597",
"0.63640034",
"0.6328281",
"0.6286668",
"0.62676233",
"0.6239149",
"0.6202125",
"0.61955136",
"0.61894524",
"0.61597776",
"0.6134595",
"0.61243... | 0.83141166 | 0 |
Returns the device to be used for training. | def device() -> str:
import torch
if torch.cuda.is_available() and torch.cuda.device_count() > 0:
if hasattr(Config().trainer,
'parallelized') and Config().trainer.parallelized:
device = 'cuda'
else:
device = 'cuda:' + str(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device(self) -> torch.device:\n for param in self.parameters():\n return param.device\n return get_device(\"cpu\")",
"def get_device():\n import torch\n\n if torch.cuda.is_available():\n return torch.device('cuda')\n return torch.device('cpu')",
"def... | [
"0.8276948",
"0.8204713",
"0.81753296",
"0.80565923",
"0.79779685",
"0.79452527",
"0.79452527",
"0.79452527",
"0.79452527",
"0.79452527",
"0.78916585",
"0.78675044",
"0.7835675",
"0.77565765",
"0.77542937",
"0.77542937",
"0.77542937",
"0.77542937",
"0.7713507",
"0.7709037",
"... | 0.8220512 | 1 |
Check if the hardware and OS support data parallelism. | def is_parallel() -> bool:
import torch
return hasattr(Config().trainer, 'parallelized') and Config(
).trainer.parallelized and torch.cuda.is_available(
) and torch.distributed.is_available(
) and torch.cuda.device_count() > 1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parallel_safe(self):\n return True",
"def is_multiprocessing_problematic():\n # Handling numpy linked against accelerate.\n config_info = str([value for key, value in\n np.__config__.__dict__.items()\n if key.endswith(\"_info\")]).lower()\n\n if \"a... | [
"0.63122064",
"0.6217546",
"0.6193051",
"0.61780185",
"0.61725044",
"0.61503655",
"0.6127145",
"0.6078269",
"0.6058447",
"0.603029",
"0.6027548",
"0.59874004",
"0.5955343",
"0.5927671",
"0.58607745",
"0.58542687",
"0.58361876",
"0.58319396",
"0.58313346",
"0.58165216",
"0.580... | 0.66771305 | 0 |
return True if the number_str can be truncated from both left and right and always be prime, e.g. 3797 | def is_left_right_truncatable(number_str, prime_str_set):
l = len(number_str)
#left truncatable?
for i in range(l):
if number_str[i:] not in prime_str_set or number_str[:l-i] not in prime_str_set:
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_truncatable(number: int):\n\n str_number = str(number)\n index = 0\n\n # Left shift:\n while index < len(str_number):\n if not is_prime(int(str_number[index:])):\n return False\n\n index += 1\n\n # Right shift:\n index = len(str_number)\n while index > 0:\n ... | [
"0.8172049",
"0.72789836",
"0.69700235",
"0.6308689",
"0.61999017",
"0.6155211",
"0.6115153",
"0.6111989",
"0.6109884",
"0.6073659",
"0.6044184",
"0.6039048",
"0.60375977",
"0.60341597",
"0.60208774",
"0.6020748",
"0.601937",
"0.60004914",
"0.5998233",
"0.5982962",
"0.5968794... | 0.7736553 | 1 |
Determine fixed modifications in case the reference shift is at zero. Does not need localization. | def determine_fixed_mods_zero(aastat_result, data, params_dict):
fix_mod_zero_thresh = params_dict['fix_mod_zero_thresh']
min_fix_mod_pep_count_factor = params_dict['min_fix_mod_pep_count_factor']
fix_mod_dict = {}
reference = utils.mass_format(0)
aa_rel = aastat_result[reference][2]
utils.inte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def determine_fixed_mods_nonzero(reference, locmod_df, data):\n utils.internal('Localizations for %s: %s', reference, locmod_df.at[reference, 'localization'])\n loc = get_fix_mod_from_l10n(reference, locmod_df)\n label = reference\n data_dict = data.ms_stats().copy()\n while loc is None:\n de... | [
"0.6245811",
"0.5993922",
"0.58981633",
"0.54384756",
"0.5420952",
"0.5370132",
"0.5319682",
"0.52733696",
"0.52633834",
"0.5207875",
"0.5174516",
"0.5168301",
"0.5162118",
"0.5160096",
"0.5155298",
"0.5127173",
"0.5121005",
"0.50911295",
"0.49932376",
"0.4955329",
"0.4909749... | 0.63415945 | 0 |
r"""Compute the Einstein radius for a given isotropic velocity dispersion assuming a singular isothermal sphere (SIS) mass profile | def approximate_theta_E_for_SIS(vel_disp_iso, z_lens, z_src, cosmo):
lens_cosmo = LensCosmo(z_lens, z_src, cosmo=cosmo)
theta_E_SIS = lens_cosmo.sis_sigma_v2theta_E(vel_disp_iso)
return theta_E_SIS | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _calculate_residual_sphere(parameters, x_values, y_values, z_values):\n #extract the parameters\n x_centre, y_centre, z_centre, radius = parameters\n\n #use numpy's sqrt function here, which works by element on arrays\n distance_from_centre = numpy.sqrt((x_values - x_centre)**2 +\n ... | [
"0.59292984",
"0.5824991",
"0.5817226",
"0.58086616",
"0.57849306",
"0.57736725",
"0.5735249",
"0.57111436",
"0.5704036",
"0.56862265",
"0.5664737",
"0.5664737",
"0.56512725",
"0.5550405",
"0.5496292",
"0.5456463",
"0.5426158",
"0.54168355",
"0.53976965",
"0.5365244",
"0.5362... | 0.6008606 | 0 |
Evaluate the Vband luminosity L_V expected from the FJ relation for a given velocity dispersion | def get_luminosity(self, vel_disp):
log_L_V = self.slope*np.log10(vel_disp) + self.intercept
return log_L_V | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_vcond(lambdam, taum):\n return 2 * lambdam / taum",
"def V_hipass(V, R_S, C, L, R_L, f):\n # current in circuit\n I = V/(R_S + Z_hipass(C, L, R_L, f))\n # voltage across circuit\n V_out = V - I*R_S\n I_L = V_out/Z_high(C, R_L, f) # current through load branch\n V_L = I_L*R_L # voltage across loa... | [
"0.63736004",
"0.5998151",
"0.5983169",
"0.5946282",
"0.58367145",
"0.5795854",
"0.5793172",
"0.57542485",
"0.571141",
"0.57062334",
"0.56781685",
"0.5638643",
"0.5626958",
"0.5622531",
"0.56085986",
"0.5567615",
"0.5557632",
"0.5544373",
"0.55408514",
"0.5531132",
"0.553042"... | 0.64296955 | 0 |
Set the parameters fit on SDSS DR4 Note The values of slope and intercept are taken from the rband orthogonal fit on SDSS DR4. See Table 2 of [1]_. References .. [1] Hyde, Joseph B., and Mariangela Bernardi. "The luminosity and stellar mass Fundamental Plane of earlytype galaxies." | def _define_SDSS_fit_params(self):
self.a = 1.4335
self.b = 0.3150
self.c = -8.8979
self.intrinsic_scatter = 0.0578
#self.delta_a = 0.02
#self.delta_b = 0.01 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _define_SLACS_fit_params(self):\n\t\t# Fit params from R_eff\n\t\tself.a = -0.41\n\t\tself.b = 0.39\n\t\t#self.delta_a = 0.12\n\t\t#self.delta_b = 0.10\n\t\tself.intrinsic_scatter = 0.14\n\t\t# Fit params from vel_disp\n\t\tself.a_v = 0.07\n\t\tself.b_v = -0.12\n\t\tself.int_v = 0.17",
"def doParametersOfInt... | [
"0.6524372",
"0.5828944",
"0.5815241",
"0.5792441",
"0.5774732",
"0.5649416",
"0.560434",
"0.5591655",
"0.55806255",
"0.5562633",
"0.5548635",
"0.5524629",
"0.5523357",
"0.5509879",
"0.5508611",
"0.5453511",
"0.544221",
"0.54013795",
"0.54003555",
"0.53875685",
"0.5369344",
... | 0.6969803 | 0 |
Set the parameters fit on the Sloan Lens Arcs Survey (SLACS) sample of 73 ETGs Note See Table 4 of [1]_ for the fit values, taken from the empirical correlation derived from the SLACS lens galaxy sample. References | def _define_SLACS_fit_params(self):
# Fit params from R_eff
self.a = -0.41
self.b = 0.39
#self.delta_a = 0.12
#self.delta_b = 0.10
self.intrinsic_scatter = 0.14
# Fit params from vel_disp
self.a_v = 0.07
self.b_v = -0.12
self.int_v = 0.17 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _define_SDSS_fit_params(self):\n\t\tself.a = 1.4335\n\t\tself.b = 0.3150 \n\t\tself.c = -8.8979\n\t\tself.intrinsic_scatter = 0.0578\n\t\t#self.delta_a = 0.02\n\t\t#self.delta_b = 0.01",
"def set_fit_params(self):\n\n self.p0 = np.array([self.A_arr, self.T_a])\n # initial guess at A_arr and T_a\n\n ... | [
"0.66335446",
"0.6191415",
"0.59800696",
"0.58964324",
"0.5816966",
"0.5668345",
"0.56514496",
"0.5646242",
"0.5645791",
"0.561993",
"0.56091666",
"0.55902165",
"0.55819917",
"0.55689085",
"0.5561756",
"0.5520965",
"0.5512555",
"0.5506377",
"0.550578",
"0.549302",
"0.54860383... | 0.750283 | 0 |
Sample (one minus) the axis ratio of the lens galaxy from the Rayleigh distribution with scale that depends on velocity dispersion | def get_axis_ratio(self, vel_disp):
scale = self.a*vel_disp + self.b
q = 0.0
while q < self.lower:
q = 1.0 - np.random.rayleigh(scale, size=None)
return q | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getRatio(probe_num, position_vector, shot_range, dir, day ='050119r'):\n ratio_x = 0\n ratio_y = 0\n ratio_z = 0\n # helm_B = [0,0,0]\n divideby = 0\n for shot in range(shot_range[0], shot_range[1]+1):\n print( 'On shot ', day+str(shot), ' for probe ',probe_num)\n x,y,z, currma... | [
"0.5984484",
"0.5951197",
"0.5821933",
"0.5732663",
"0.57284033",
"0.567641",
"0.56427747",
"0.56382126",
"0.5614669",
"0.56115395",
"0.5601904",
"0.5573603",
"0.5534662",
"0.55199206",
"0.54970366",
"0.54887855",
"0.5470825",
"0.5469452",
"0.5453029",
"0.54443336",
"0.543773... | 0.7055274 | 0 |
Sample the AGN luminosity from the redshiftbinned luminosity function | def sample_agn_luminosity(self, z):
# Assign redshift bin
is_less_than_right_edge = (z < self.z_bins)
alpha = self.alphas[is_less_than_right_edge][0]
beta = self.betas[is_less_than_right_edge][0]
M_star = self.M_stars[is_less_than_right_edge][0]
# Evaluate function
pmf = self.get_double_power_law(alpha, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_luminosity(red, green, blue):\r\n return (0.299 * red) + (0.587 * green) + (0.114 * blue)",
"def luminance(self):\n \n return (self.r + self.g + self.b) // 3",
"def compute_radiocore_luminosity(MBH, L_AGN):\n\tL_X = bolcorr_hardX(L_AGN)\n\tm = log10(MBH / u.Msun)\n\t# Merloni, Hein... | [
"0.6417541",
"0.63884014",
"0.6198883",
"0.5988071",
"0.58689255",
"0.5791698",
"0.5777783",
"0.57607454",
"0.5741125",
"0.5704976",
"0.5666426",
"0.56387365",
"0.56344163",
"0.5579416",
"0.5577653",
"0.55769515",
"0.5561606",
"0.5552182",
"0.55497104",
"0.554356",
"0.5517453... | 0.7363408 | 0 |
expects 2 arrays of shape (3, N) rigid transform algorithm from | def rigid_transform_3d(xs,ys):
assert xs.shape == ys.shape
assert xs.shape[0] == 3, 'The points must be of dimmensionality 3'
# find centroids and H
x_centroid = np.mean(xs, axis=1)[:, np.newaxis]
y_centroid = np.mean(ys, axis=1)[:, np.newaxis]
H = (xs - x_centroid)@(ys - y_centroid).T
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compose_transform(T1, T2):\n aux_vec = np.array([0, 0, 1]).reshape(1, 3)\n\n T1 = np.concatenate((T1, aux_vec), axis=0)\n T2 = np.concatenate((T2, aux_vec), axis=0)\n\n T1_inv = np.linalg.inv(T1)\n T = T1_inv@T2\n\n return T[0:2]",
"def transform(tvec1, rvec1, tvec2, rvec2):\n op = local... | [
"0.64119685",
"0.6391706",
"0.637345",
"0.63456833",
"0.6247986",
"0.61719114",
"0.6155749",
"0.6147075",
"0.60972595",
"0.60801315",
"0.607085",
"0.607085",
"0.6059854",
"0.6050465",
"0.6016514",
"0.59902495",
"0.59778076",
"0.59692",
"0.59610087",
"0.5923086",
"0.5920455",
... | 0.6508242 | 0 |
Synchronize this instance data with that of its parent | def _syncDataWithParent(self):
parent = self.parent()
if parent is None:
data, range_ = None, None
else:
data = parent.getData(copy=False)
range_ = parent.getDataRange()
self._updateData(data, range_) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _syncDataWithParent(self):\n parent = self.parent()\n if parent is None:\n self._data = None\n else:\n self._data = parent.getData(copy=False)\n self._updateScenePrimitive()",
"def _syncDataWithParent(self):\n parent = self.parent()\n if parent ... | [
"0.8105605",
"0.7977319",
"0.7733652",
"0.71153784",
"0.71153784",
"0.70563495",
"0.7043718",
"0.674526",
"0.65729344",
"0.6530828",
"0.64562",
"0.6451494",
"0.6362502",
"0.6362502",
"0.6325555",
"0.63112843",
"0.6255493",
"0.6245364",
"0.6242624",
"0.619789",
"0.61851496",
... | 0.80830806 | 1 |
Return whether values <= colormap min are displayed or not. | def getDisplayValuesBelowMin(self):
return self._getPlane().colormap.displayValuesBelowMin | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setDisplayValuesBelowMin(self, display):\n display = bool(display)\n if display != self.getDisplayValuesBelowMin():\n self._getPlane().colormap.displayValuesBelowMin = display\n self._updated(ItemChangedType.ALPHA)",
"def visible(self):\n return -PipePair.WIDTH < se... | [
"0.6101894",
"0.606636",
"0.5966878",
"0.59301066",
"0.5888018",
"0.58112633",
"0.58078593",
"0.5752245",
"0.5747372",
"0.57274777",
"0.57218593",
"0.5695929",
"0.55961335",
"0.5590847",
"0.5554003",
"0.5551317",
"0.55380684",
"0.5532524",
"0.55230325",
"0.5503854",
"0.550056... | 0.7410294 | 0 |
Set whether to display values <= colormap min. | def setDisplayValuesBelowMin(self, display):
display = bool(display)
if display != self.getDisplayValuesBelowMin():
self._getPlane().colormap.displayValuesBelowMin = display
self._updated(ItemChangedType.ALPHA) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_colormap_full_range(self):\n if(self.plot.image is None):\n return\n \n cmin = self.settingsWidget.ui.colormap_min\n cmax = self.settingsWidget.ui.colormap_max\n data_min = numpy.min(self.plot.image)\n data_max = numpy.max(self.plot.image)\n cmin.... | [
"0.6897544",
"0.68503755",
"0.6472414",
"0.64165556",
"0.6364885",
"0.6256008",
"0.6017445",
"0.6017445",
"0.5980322",
"0.5958103",
"0.59348243",
"0.58880955",
"0.58671427",
"0.5842141",
"0.580647",
"0.57340556",
"0.57123756",
"0.56508297",
"0.56315273",
"0.5560471",
"0.55498... | 0.77897596 | 0 |
Synchronize this instance data with that of its parent | def _syncDataWithParent(self):
parent = self.parent()
if parent is None:
self._data = None
else:
self._data = parent.getData(copy=False)
self._updateScenePrimitive() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _syncDataWithParent(self):\n parent = self.parent()\n if parent is None:\n data, range_ = None, None\n else:\n data = parent.getData(copy=False)\n range_ = parent.getDataRange()\n self._updateData(data, range_)",
"def _syncDataWithParent(self):\n ... | [
"0.80830806",
"0.7977319",
"0.7733652",
"0.71153784",
"0.71153784",
"0.70563495",
"0.7043718",
"0.674526",
"0.65729344",
"0.6530828",
"0.64562",
"0.6451494",
"0.6362502",
"0.6362502",
"0.6325555",
"0.63112843",
"0.6255493",
"0.6245364",
"0.6242624",
"0.619789",
"0.61851496",
... | 0.8105605 | 0 |
Return the level of this isosurface (float) | def getLevel(self):
return self._level | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def level(self):\n return self.game_data['player stats']['Level']",
"def level(self):\n return self.init_v[2]",
"def getLevel(self):\n return _libsbml.SBasePlugin_getLevel(self)",
"def level(self):\n return self._level",
"def level(self):\n return self._level",
"def lev... | [
"0.692961",
"0.68555295",
"0.68304414",
"0.67786837",
"0.67786837",
"0.67786837",
"0.67786837",
"0.67447656",
"0.67447656",
"0.673165",
"0.6729187",
"0.67290646",
"0.67083573",
"0.6660453",
"0.66239667",
"0.66239667",
"0.65987796",
"0.6588329",
"0.65245295",
"0.65243083",
"0.... | 0.68635625 | 1 |
Set the value at which to build the isosurface. Setting this value reset autolevel function | def setLevel(self, level):
self._autoLevelFunction = None
level = float(level)
if level != self._level:
self._level = level
self._updateScenePrimitive()
self._updated(Item3DChangedType.ISO_LEVEL) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetLevelSetValue(self, _arg: 'double const') -> \"void\":\n return _itkReinitializeLevelSetImageFilterPython.itkReinitializeLevelSetImageFilterIF3_SetLevelSetValue(self, _arg)",
"def SetLevelSetValue(self, _arg: 'double const') -> \"void\":\n return _itkReinitializeLevelSetImageFilterPython.itk... | [
"0.59382164",
"0.58852255",
"0.5742166",
"0.5726637",
"0.57214034",
"0.571938",
"0.5709026",
"0.56838727",
"0.56748176",
"0.5579223",
"0.55515665",
"0.55400157",
"0.55338275",
"0.5522072",
"0.54870933",
"0.5481656",
"0.5459882",
"0.5447825",
"0.54363453",
"0.5433698",
"0.5425... | 0.6042807 | 0 |
Return the function computing the isolevel (callable or None) | def getAutoLevelFunction(self):
return self._autoLevelFunction | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _func(self):\n return self._get_flint_func(self.domain)",
"def _get_isis_level(self):\n return self.__isis_level",
"def poly_level(f):\n if poly_univariate_p(f):\n return 1\n else:\n return 1 + poly_level(poly_LC(f))",
"def getFunction(self) -> ghidra.program.model.listing.F... | [
"0.6047651",
"0.5671476",
"0.5463008",
"0.54624134",
"0.5348979",
"0.53289545",
"0.5268753",
"0.5257093",
"0.52481455",
"0.5203101",
"0.5194863",
"0.51774395",
"0.51627976",
"0.5157307",
"0.51524407",
"0.5147835",
"0.513994",
"0.51247656",
"0.5106995",
"0.5046533",
"0.5028735... | 0.5753576 | 1 |
Return the color of this isosurface (QColor) | def getColor(self):
return qt.QColor.fromRgbF(*self._color) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getColor(self):\n return self.color",
"def getColor(self):\r\n return self.color",
"def get_color(self):\r\n return self._color",
"def getColor(self):\n return self.__color",
"def getColor(self):\n return self.__color",
"def getColor(self):\n return self.__co... | [
"0.70161194",
"0.6997709",
"0.69830304",
"0.6970522",
"0.6970522",
"0.6970522",
"0.69664246",
"0.6958327",
"0.69552636",
"0.69552636",
"0.69544834",
"0.6918692",
"0.6895953",
"0.68916535",
"0.68916535",
"0.68693244",
"0.68693244",
"0.68580174",
"0.680577",
"0.67948073",
"0.67... | 0.77090704 | 0 |
Compute isosurface for current state. | def _computeIsosurface(self):
data = self.getData(copy=False)
if data is None:
if self.isAutoLevel():
self._level = float('nan')
else:
if self.isAutoLevel():
st = time.time()
try:
level = float(self.get... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isosurface(self):\n return self._isosurface()",
"def get_fsurface(self, path):\n raise NotImplementedError",
"def _isosurfaceItemChanged(self, event):\n if event == Item3DChangedType.ISO_LEVEL:\n self._updateIsosurfaces()",
"def isosurface(grd_name, isosurface_name, level,... | [
"0.7749475",
"0.64308286",
"0.6121801",
"0.6089994",
"0.5459395",
"0.5374221",
"0.49754205",
"0.49631813",
"0.494308",
"0.49310347",
"0.49100575",
"0.48892054",
"0.4882994",
"0.48674196",
"0.4839715",
"0.47886744",
"0.4778599",
"0.476231",
"0.47320402",
"0.47290966",
"0.47155... | 0.71063083 | 1 |
Compute range info (min, min positive, max) from data | def _computeRangeFromData(data):
if data is None:
return None
dataRange = min_max(data, min_positive=True, finite=True)
if dataRange.minimum is None: # Only non-finite data
return None
if dataRange is not None:
min_positive = dataRange.min_positive
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_range(cls, data: tuple or list) -> float:\n cls._data_validation(data)\n max_ = cls.get_max(data)\n min_ = cls.get_min(data)\n return float(max_ - min_)",
"def data_range(x):\n return max(x)-min(x)",
"def m_to_range(self, data):\n return (data - self._min_range_m) / se... | [
"0.74131215",
"0.7375797",
"0.7371305",
"0.73698366",
"0.7079913",
"0.69400847",
"0.6933809",
"0.68565273",
"0.6837749",
"0.6828716",
"0.68116766",
"0.677769",
"0.6730659",
"0.66858673",
"0.6631129",
"0.661481",
"0.66129404",
"0.6605451",
"0.65986764",
"0.65552515",
"0.654875... | 0.80179286 | 0 |
Add an isosurface to this item. | def addIsosurface(self, level, color):
isosurface = self._Isosurface(parent=self)
isosurface.setColor(color)
if callable(level):
isosurface.setAutoLevelFunction(level)
else:
isosurface.setLevel(level)
isosurface.sigItemChanged.connect(self._isosurfaceItemC... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_surface(self,s):\n self.surfaces.append(s)\n s.system=self.surfaces",
"def _addClicked(self):\n volume = self.volume()\n if volume is not None:\n dataRange = volume.getDataRange()\n if dataRange is None:\n dataRange = 0., 1.\n\n ... | [
"0.6740248",
"0.62558913",
"0.60210866",
"0.5904212",
"0.5893358",
"0.577374",
"0.53729206",
"0.52408725",
"0.519066",
"0.5183285",
"0.5161759",
"0.5116448",
"0.5109245",
"0.5073585",
"0.5032729",
"0.5032729",
"0.5009403",
"0.4923389",
"0.49232364",
"0.4879343",
"0.48575088",... | 0.72267526 | 0 |
Remove an isosurface from this item. | def removeIsosurface(self, isosurface):
if isosurface not in self.getIsosurfaces():
_logger.warning(
"Try to remove isosurface that is not in the list: %s",
str(isosurface))
else:
isosurface.sigItemChanged.disconnect(self._isosurfaceItemChanged)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _removeClicked(self):\n isosurface = self.isosurface()\n if isosurface is not None:\n volume = isosurface.parent()\n if volume is not None:\n volume.removeIsosurface(isosurface)",
"def isosurface(self):\n return self._isosurface()",
"def remove(self... | [
"0.7447585",
"0.58254415",
"0.5618442",
"0.557807",
"0.5543547",
"0.54468757",
"0.5415708",
"0.54150975",
"0.53558755",
"0.533654",
"0.53338057",
"0.5329659",
"0.53128797",
"0.5312818",
"0.5301393",
"0.52970207",
"0.52678525",
"0.5265467",
"0.52498937",
"0.5239983",
"0.523310... | 0.8135996 | 0 |
Handle update of isosurfaces upon level changed | def _isosurfaceItemChanged(self, event):
if event == Item3DChangedType.ISO_LEVEL:
self._updateIsosurfaces() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _updated(self, event=None):\n if event == ItemChangedType.COMPLEX_MODE:\n self._syncDataWithParent()\n\n elif event in (ItemChangedType.COLORMAP,\n Item3DChangedType.INTERPOLATION):\n self._updateScenePrimitive()\n super(ComplexIsosurface, self).... | [
"0.6973583",
"0.6578195",
"0.6466973",
"0.62059677",
"0.6089591",
"0.5909208",
"0.5899945",
"0.5825903",
"0.57568187",
"0.5703271",
"0.5698263",
"0.5687134",
"0.56855094",
"0.5576002",
"0.55106765",
"0.547519",
"0.54643226",
"0.54612565",
"0.5458047",
"0.5452608",
"0.54472446... | 0.81053317 | 0 |
Handle updates of isosurfaces level and add/remove | def _updateIsosurfaces(self):
# Sorting using minus, this supposes data 'object' to be max values
sortedIso = sorted(self.getIsosurfaces(),
key=lambda isosurface: - isosurface.getLevel())
self._isogroup.children = [iso._getScenePrimitive() for iso in sortedIso] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _isosurfaceItemChanged(self, event):\n if event == Item3DChangedType.ISO_LEVEL:\n self._updateIsosurfaces()",
"def _updated(self, event=None):\n if event == ItemChangedType.COMPLEX_MODE:\n self._syncDataWithParent()\n\n elif event in (ItemChangedType.COLORMAP,\n ... | [
"0.7572625",
"0.6483485",
"0.62844723",
"0.6087187",
"0.60834914",
"0.5838356",
"0.58052474",
"0.57790345",
"0.57654625",
"0.56409895",
"0.5590038",
"0.5531311",
"0.552662",
"0.55226326",
"0.54919386",
"0.5402099",
"0.5401069",
"0.53722477",
"0.5337533",
"0.5290507",
"0.52768... | 0.6803121 | 1 |
Handle update of the cut plane (and take care of mode change | def _updated(self, event=None):
if event == ItemChangedType.COMPLEX_MODE:
self._syncDataWithParent()
super(ComplexCutPlane, self)._updated(event) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plane_update(self):\n self.plane.update()",
"def _update(self):\n self.cv.update()",
"def onUpdateFactors(self, evt):\n\t\tif self.blockFactorUpdate:\n\t\t\tprint \"Blocking factor update\"\n\t\t\treturn\n\t\tx, y, z = self.dataUnits[0].dataSource.getOriginalDimensions()\n\t\tfx = 1\n\t\tfy =... | [
"0.6893299",
"0.60525465",
"0.58858526",
"0.5834753",
"0.5762848",
"0.5702077",
"0.5648497",
"0.5648258",
"0.56118804",
"0.56109047",
"0.55797815",
"0.55794543",
"0.55765516",
"0.5570159",
"0.5562381",
"0.55067044",
"0.550493",
"0.54722816",
"0.54584134",
"0.5452447",
"0.5450... | 0.6976842 | 0 |
Handle data change in the parent this isosurface belongs to | def _parentChanged(self, event):
if event == ItemChangedType.COMPLEX_MODE:
self._syncDataWithParent()
super(ComplexIsosurface, self)._parentChanged(event) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _updated(self, event=None):\n if event == ItemChangedType.COMPLEX_MODE:\n self._syncDataWithParent()\n\n elif event in (ItemChangedType.COLORMAP,\n Item3DChangedType.INTERPOLATION):\n self._updateScenePrimitive()\n super(ComplexIsosurface, self).... | [
"0.7281809",
"0.6798219",
"0.663362",
"0.6617056",
"0.6495038",
"0.63887423",
"0.63887423",
"0.63203007",
"0.6309291",
"0.62671393",
"0.6239306",
"0.6219209",
"0.6177352",
"0.6040155",
"0.59989554",
"0.5994137",
"0.59767103",
"0.5967239",
"0.5934066",
"0.5895432",
"0.58403164... | 0.78250813 | 0 |
Handle update of the isosurface (and take care of mode change) | def _updated(self, event=None):
if event == ItemChangedType.COMPLEX_MODE:
self._syncDataWithParent()
elif event in (ItemChangedType.COLORMAP,
Item3DChangedType.INTERPOLATION):
self._updateScenePrimitive()
super(ComplexIsosurface, self)._updated(eve... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _isosurfaceItemChanged(self, event):\n if event == Item3DChangedType.ISO_LEVEL:\n self._updateIsosurfaces()",
"def update_flags(self):\n # view mode, filled vs wirefrom\n if self.view['wireframe']:\n gl.glPolygonMode(gl.GL_FRONT_AND_BACK, gl.GL_LINE)\n else:\... | [
"0.72574514",
"0.6297322",
"0.62271756",
"0.6138882",
"0.6094875",
"0.6022466",
"0.6002216",
"0.6002216",
"0.5986893",
"0.5943191",
"0.59352255",
"0.59275275",
"0.59257054",
"0.5873895",
"0.58552265",
"0.5850752",
"0.5833824",
"0.57953125",
"0.5777924",
"0.5773839",
"0.577058... | 0.750728 | 0 |
Return 3D dataset. This method does not cache data converted to a specific mode, it computes it for each request. | def getData(self, copy=True, mode=None):
if mode is None:
return super(ComplexField3D, self).getData(copy=copy)
else:
return self._convertComplexData(self._data, mode) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def D3(self, *args):\n return _Adaptor3d.Adaptor3d_Surface_D3(self, *args)",
"def get_3d_train(self, jnts=14):\n\n to_select, to_sort = dataset_indices(self.dataset_name, jnts)\n\n return self._data_train['3d'][:, to_select, :][:, to_sort, :]",
"def get_dataset(self, cid, type=\"train\"):\... | [
"0.60187584",
"0.59878784",
"0.58777374",
"0.58265644",
"0.58206046",
"0.5816656",
"0.5816164",
"0.57970816",
"0.57919204",
"0.5772738",
"0.57650393",
"0.57250017",
"0.5724938",
"0.5707195",
"0.5686548",
"0.5647479",
"0.5564669",
"0.55568475",
"0.5537837",
"0.5516145",
"0.550... | 0.6331602 | 0 |
Population prior, i.e. $Categorical(\pi)$. | def prior_z(self) -> distributions.Distribution:
return distributions.Categorical(self.pi) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_prior_name(self):\n dim = Dimension(\"yolo\", \"reciprocal\", 1e-10, 1)\n assert dim.prior_name == \"reciprocal\"\n\n dim = Dimension(\"yolo\", \"norm\", 0.9)\n assert dim.prior_name == \"norm\"\n\n dim = Real(\"yolo\", \"uniform\", 1, 2)\n assert dim.prior_name =... | [
"0.6308094",
"0.6022625",
"0.5991592",
"0.5984886",
"0.5965109",
"0.5834765",
"0.58280075",
"0.57996655",
"0.57636964",
"0.57478815",
"0.57455534",
"0.56727767",
"0.56464076",
"0.559691",
"0.5589314",
"0.55594623",
"0.5548906",
"0.55311286",
"0.55226177",
"0.5502985",
"0.5502... | 0.6626557 | 0 |
Test vertex_areas. Vertex area is the area of all of the triangles who are in contact | def test_vertex_areas(self, faces, point):
number_of_contact_faces = gs.array([3, 5, 5, 5, 5, 5, 3, 5])
triangle_area = 0.5 * 2 * 2
expected = 2 * (number_of_contact_faces * triangle_area) / 3
space = self.Space(faces)
result = space.vertex_areas(point)
assert result.sha... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_triangle_area():\n v1 = (0,0); v2 = (1,0); v3 = (0,2)\n verticies = [v1,v2,v3]\n expected = 1\n computed = get_triangle_area(verticies)\n tol = 1E-14\n success = abs(expected-computed) < tol\n msg = 'computed area={} != {} (expected)'.format(computed,expected)\n assert success,... | [
"0.7278366",
"0.7158183",
"0.68438345",
"0.67501736",
"0.66490245",
"0.6619761",
"0.658673",
"0.6489864",
"0.64847827",
"0.63019234",
"0.6286598",
"0.6198661",
"0.618283",
"0.61759",
"0.61708784",
"0.61697274",
"0.61374867",
"0.6110089",
"0.606067",
"0.59845203",
"0.5979044",... | 0.8256436 | 0 |
Test normals. We test this on a space whose initializing point is a cube, and we test the function on a cube with sides of length 2 centered at the origin. The cube is meshed with 12 triangles (2 triangles per face.) Recall that the magnitude of each normal vector is equal to the area of the face it is normal to. | def test_normals(self, faces, point):
space = self.Space(faces=faces)
cube_normals = gs.array(
[
[0.0, 0.0, 2.0],
[0.0, 0.0, 2.0],
[0.0, 2.0, 0.0],
[0.0, 2.0, 0.0],
[2.0, 0.0, 0.0],
[2.0, 0.0, 0.0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_surface_normal(self):\n vertices = np.array([[0, 1, 0], [0, 0, 0], [1, 0, 0]])\n expected = np.array([0, 0, 1])\n np.testing.assert_almost_equal(surface_normal(vertices), expected)\n\n # Test against multiple triangles\n vertices = np.r_[vertices[np.newaxis, :, :], [[[0,... | [
"0.7417501",
"0.7163587",
"0.71501",
"0.7141003",
"0.6889132",
"0.6833686",
"0.6778833",
"0.66802526",
"0.6537442",
"0.65106905",
"0.64550817",
"0.64479667",
"0.6442539",
"0.6430552",
"0.6334144",
"0.6329478",
"0.6270688",
"0.62549996",
"0.6243213",
"0.6220221",
"0.61403275",... | 0.7896348 | 0 |
Test surface metric matrices. | def test_surface_metric_matrices(self, faces, point):
space = self.Space(faces=faces)
result = space.surface_metric_matrices(point=point)
assert result.shape == (
space.n_faces,
2,
2,
), result.shape
point = gs.array([point, point])
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def surface_metric_matrices(self, point):\n one_forms = self.surface_one_forms(point)\n\n return self._surface_metric_matrices_from_one_forms(one_forms)",
"def test_symmetry_surface_average_2(self):\n\n def test(grid, basis, true_avg=1):\n transform = Transform(grid, basis)\n\n ... | [
"0.6212602",
"0.60263664",
"0.6011479",
"0.59304386",
"0.5858633",
"0.5743929",
"0.5703311",
"0.5686523",
"0.5677409",
"0.56035334",
"0.55897456",
"0.5561343",
"0.5554519",
"0.55176467",
"0.5503147",
"0.5501849",
"0.5489476",
"0.5488244",
"0.5445561",
"0.5432928",
"0.54146785... | 0.743953 | 0 |
Check that energy of a path of surfaces is positive at each timestep. | def test_path_energy_per_time_is_positive(
self, space, a0, a1, b1, c1, d1, a2, path, atol
):
n_times = len(path)
space.equip_with_metric(self.Metric, a0=a0, a1=a1, b1=b1, c1=c1, d1=d1, a2=a2)
energy = space.metric.path_energy_per_time(path)
self.assertAllEqual(energy.shape... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_path_energy_is_positive(self, space, a0, a1, b1, c1, d1, a2, path, atol):\n space.equip_with_metric(self.Metric, a0=a0, a1=a1, b1=b1, c1=c1, d1=d1, a2=a2)\n\n energy = space.metric.path_energy(path)\n self.assertAllEqual(energy.shape, ())\n result = gs.all(energy > -1 * atol)\n... | [
"0.728073",
"0.589016",
"0.58340615",
"0.56767166",
"0.5647796",
"0.56435287",
"0.56361413",
"0.5609778",
"0.5564585",
"0.55382043",
"0.5497689",
"0.5426183",
"0.5391233",
"0.5343787",
"0.5343612",
"0.5332643",
"0.5260981",
"0.5248749",
"0.5233796",
"0.52206767",
"0.5216022",... | 0.719298 | 1 |
Check that energy of a path of surfaces is positive at each timestep. | def test_path_energy_is_positive(self, space, a0, a1, b1, c1, d1, a2, path, atol):
space.equip_with_metric(self.Metric, a0=a0, a1=a1, b1=b1, c1=c1, d1=d1, a2=a2)
energy = space.metric.path_energy(path)
self.assertAllEqual(energy.shape, ())
result = gs.all(energy > -1 * atol)
sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_path_energy_per_time_is_positive(\n self, space, a0, a1, b1, c1, d1, a2, path, atol\n ):\n n_times = len(path)\n space.equip_with_metric(self.Metric, a0=a0, a1=a1, b1=b1, c1=c1, d1=d1, a2=a2)\n\n energy = space.metric.path_energy_per_time(path)\n\n self.assertAllEqual... | [
"0.719298",
"0.589016",
"0.58340615",
"0.56767166",
"0.5647796",
"0.56435287",
"0.56361413",
"0.5609778",
"0.5564585",
"0.55382043",
"0.5497689",
"0.5426183",
"0.5391233",
"0.5343787",
"0.5343612",
"0.5332643",
"0.5260981",
"0.5248749",
"0.5233796",
"0.52206767",
"0.5216022",... | 0.728073 | 0 |
goes through each neuron, each neuron has a chance of mutating equal to the learning rate of the network. There is a 20% chance of a physical mutation. | def mutate(self):
#First, mutate masses
for neuronNum in range(self.neuronCounter - 1):
if self.learningRate > random.random():
self.neurons[neuronNum].mutate()
else:
continue
#Now determine physical mutations
if random.random() < ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mutate_nonstructural(self):\n # TODO consider clamping weights and biases?\n for link in self.gene_links:\n # Disable/Enable links\n if event(link_toggle_prob): # Chance of toggling link\n link.enabled = True if link.enabled is False else False\n i... | [
"0.7139885",
"0.6918553",
"0.6862937",
"0.67987317",
"0.6480224",
"0.6446079",
"0.64306605",
"0.63981",
"0.6360692",
"0.6357444",
"0.62559646",
"0.62238425",
"0.61995184",
"0.61872697",
"0.6183759",
"0.6120707",
"0.6096974",
"0.6002629",
"0.60015005",
"0.599701",
"0.59915847"... | 0.78212637 | 0 |
Check if a CLOUD device has already been added. | def is_cloud_device_already_added(self):
for entry in self._async_current_entries():
if entry.unique_id is not None and entry.unique_id == f"{DOMAIN}Cloud":
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device_exists(device):\n return os.path.exists('/sys/class/net/%s' % device)",
"def addDevice(self, device):\n if device.name in self.devices:\n log.error(\"'%s' already part of '%s'\", device.name, self.name)\n else:\n self.devices[device.name] = device\n return... | [
"0.6239254",
"0.609345",
"0.609345",
"0.609345",
"0.6073092",
"0.6065576",
"0.6047093",
"0.5987568",
"0.5987568",
"0.5947811",
"0.58741647",
"0.58736914",
"0.58404255",
"0.58278227",
"0.5810434",
"0.5785578",
"0.5772156",
"0.57598025",
"0.5751442",
"0.5747727",
"0.57093596",
... | 0.8269784 | 0 |
Load the IMDB reviews dataset. Code adapted from the code for | def load_imdb_dataset():
(x_train, y_train), (x_test, y_test) = imdb.load_data(
path="./datasets", num_words=_IMDB_CONFIG["max_features"])
num_train = _IMDB_CONFIG["num_train"]
x_train, x_val = x_train[:num_train], x_train[num_train:]
y_train, y_val = y_train[:num_train], y_train[num_train:]
def prepro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_data(path='./data/train'):\n print(\"Loading IMDB Data...\")\n data = []\n\n dir = os.path.dirname(__file__)\n file_list = glob.glob(os.path.join(dir, path + '/pos/*'))\n file_list.extend(glob.glob(os.path.join(dir, path + '/neg/*')))\n print(\"Parsing %s files\" % len(file_list))\n f... | [
"0.75287616",
"0.66760135",
"0.65806144",
"0.6317917",
"0.6313057",
"0.6215495",
"0.61960655",
"0.61669785",
"0.6146301",
"0.6112559",
"0.60396117",
"0.5993801",
"0.59847677",
"0.59646434",
"0.59450567",
"0.5916073",
"0.59076846",
"0.5888437",
"0.5850578",
"0.5838023",
"0.583... | 0.6858757 | 1 |
Parse name and seed for uci regression data. E.g. yacht_2 is the yacht dataset with seed 2. | def _parse_uci_regression_dataset(name_str):
pattern_string = "(?P<name>[a-z]+)_(?P<seed>[0-9]+)"
pattern = re.compile(pattern_string)
matched = pattern.match(name_str)
if matched:
name = matched.group("name")
seed = matched.group("seed")
return name, seed
return None, None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_uci_regression_dataset(name,\n split_seed,\n train_fraction=0.9,\n data_dir=\"uci_datasets\"):\n path = os.path.join(data_dir,\n _UCI_REGRESSION_FILENAMES[UCIRegressionDatasets(name)])\n dat... | [
"0.6082497",
"0.5352037",
"0.5263292",
"0.5021193",
"0.49601898",
"0.48798177",
"0.4859456",
"0.48388806",
"0.48280886",
"0.48230565",
"0.48205665",
"0.4811698",
"0.4808677",
"0.4778711",
"0.477406",
"0.4759555",
"0.47592923",
"0.47398236",
"0.47390524",
"0.4733845",
"0.47287... | 0.730633 | 0 |
Reshapes batch to have first axes size equal n_split. | def batch_split_axis(batch, n_split):
x, y = batch
n = x.shape[0]
n_new = n / n_split
assert n_new == int(n_new), (
"First axis cannot be split: batch dimension was {} when "
"n_split was {}.".format(x.shape[0], n_split))
n_new = int(n_new)
return tuple(arr.reshape([n_split, n_new, *arr.shape[1:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reshape_output_batch(self, number, output):\n #tt = cutotime('reshape')\n #tt.start()\n output = output.reshape(self.output_shapes[number]) # batch, h, w, 3, (5 + 80)\n #tt.stop()\n return output",
"def split_last_dimension(x, n):\n x_shape = shape_list(x)\n m = x_s... | [
"0.69617146",
"0.68236685",
"0.66688055",
"0.6664411",
"0.65866363",
"0.65084076",
"0.65084076",
"0.65084076",
"0.6464381",
"0.6412519",
"0.6412519",
"0.6395728",
"0.6334293",
"0.630652",
"0.6277924",
"0.62474674",
"0.61763036",
"0.61714095",
"0.6166665",
"0.61203986",
"0.608... | 0.72161376 | 0 |
Iterate through the spike waveforms belonging in the current trace view. | def _iter_spike_waveforms(
interval=None, traces_interval=None, model=None, supervisor=None,
n_samples_waveforms=None, get_best_channels=None, show_all_spikes=False):
m = model
p = supervisor
sr = m.sample_rate
a, b = m.spike_times.searchsorted(interval)
s0, s1 = int(round(interval[0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_waveforms(self, key, _):\n if key == self.controls.Arrays.WAVEFORMS:\n self.trace_lines[0].set_ydata(self.pv_monitor.arrays[key][0])\n self.trace_lines[1].set_ydata(self.pv_monitor.arrays[key][1])\n self.draw()",
"def waveforms(self):\n return list(self._... | [
"0.60995203",
"0.60207593",
"0.58172476",
"0.56029576",
"0.5505114",
"0.5358715",
"0.5346913",
"0.53436625",
"0.5329249",
"0.5252956",
"0.52186084",
"0.5192006",
"0.5182989",
"0.5122417",
"0.5108391",
"0.50970674",
"0.5088726",
"0.5059595",
"0.5016616",
"0.5011529",
"0.500940... | 0.71562934 | 0 |
Switch between top and bottom origin for the channels. | def switch_origin(self):
self.origin = 'bottom' if self.origin == 'top' else 'top' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reshape(self, bottom, top):\r\n pass",
"def reshape(self, bottom, top):\n\t\tpass",
"def reshape(self, bottom, top):\n pass",
"def reshape(self, bottom, top):\n pass",
"def reshape(self, bottom, top):\n pass",
"def reshape(self, bottom, top):\n pass",
"def reshape... | [
"0.5853456",
"0.58374345",
"0.57300776",
"0.57300776",
"0.57300776",
"0.57300776",
"0.57300776",
"0.57300776",
"0.57300776",
"0.57300776",
"0.57300776",
"0.57300776",
"0.57300776",
"0.56316376",
"0.56309074",
"0.5490777",
"0.5398423",
"0.5386707",
"0.53046316",
"0.5291994",
"... | 0.7755325 | 0 |
Half of the duration of the current interval. | def half_duration(self):
if self._interval is not None:
a, b = self._interval
return (b - a) * .5
else:
return self.interval_duration * .5 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def half_step_time(self):\n\n return self.full_step_time() * self.half_to_full_step_time_ratio",
"def _get_half_time(self):\n return self.__half_time",
"def widen(self):\n t, h = self.time, self.half_duration\n h *= self.scaling_coeff_x\n self.set_interval((t - h, t + h))",
"de... | [
"0.72750044",
"0.70751405",
"0.6361613",
"0.6327403",
"0.63129026",
"0.6184249",
"0.61641526",
"0.61528426",
"0.6123823",
"0.6084359",
"0.608264",
"0.6048802",
"0.6041668",
"0.603156",
"0.60129833",
"0.60048217",
"0.59908354",
"0.5974596",
"0.59592074",
"0.5935029",
"0.593502... | 0.8561854 | 0 |
Go to a specific time (in seconds). | def go_to(self, time):
half_dur = self.half_duration
self.set_interval((time - half_dur, time + half_dur)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def jump(self, seconds: float) -> None:\n if seconds < 0:\n raise ValueError(\"time can't go backwards\")\n self._virtual_base += seconds",
"def set_time(self, sec):\n self.set_timed(round(sec * 10.0))",
"def pass_time(self, t):\n cont = time.time() + t\n while tim... | [
"0.6700288",
"0.66491824",
"0.6632575",
"0.6577623",
"0.65731984",
"0.629269",
"0.62756586",
"0.62237495",
"0.6199625",
"0.6169536",
"0.6169536",
"0.6143821",
"0.6137382",
"0.6088691",
"0.60664135",
"0.602092",
"0.6020566",
"0.60139376",
"0.6013062",
"0.593964",
"0.5881879",
... | 0.6876498 | 0 |
Shift the interval by a given delay (in seconds). | def shift(self, delay):
self.go_to(self.time + delay) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shift(self, delay):\n self.__begin.shift(delay)\n self.__end.shift(delay)",
"def delay(interval):\n time.sleep(interval / 1000.0)",
"def delay(seconds):\n\n # Perform the delay\n time.sleep(seconds)",
"def delay():\r\n time.sleep(2)",
"async def sleep(cls, delay: float) ->... | [
"0.7768829",
"0.7139381",
"0.6876155",
"0.6494857",
"0.649145",
"0.64053226",
"0.6397227",
"0.6366633",
"0.63602847",
"0.6356303",
"0.6325486",
"0.6317313",
"0.6315866",
"0.62965715",
"0.62463284",
"0.6218299",
"0.61278665",
"0.6077595",
"0.60770804",
"0.60277456",
"0.6008311... | 0.82353926 | 0 |
Go to end of the recording. | def go_to_end(self):
self.go_to(self.duration) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end(self) -> None:",
"def end(self):\n pass",
"def end(self):\n pass",
"def end(self):\n pass",
"def handle_record_end():\n LOG.info(\"End Recording...\")\n context = {'client_name': 'mycroft_listener',\n 'source': 'audio',\n 'destination': [\"skil... | [
"0.71201277",
"0.709415",
"0.709415",
"0.709415",
"0.7093299",
"0.7023222",
"0.6937872",
"0.6920976",
"0.6730083",
"0.6668539",
"0.6595177",
"0.652316",
"0.6494475",
"0.6478494",
"0.6469474",
"0.64187795",
"0.6406178",
"0.6406178",
"0.63864815",
"0.63863313",
"0.636873",
"0... | 0.7161482 | 0 |
Jump to the next spike from the first selected cluster. | def go_to_next_spike(self, ):
self._jump_to_spike(+1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def go_to_previous_spike(self, ):\n self._jump_to_spike(-1)",
"def _jump_to_spike(self, delta=+1):\n spike_times = self.get_spike_times()\n if spike_times is not None and len(spike_times):\n ind = np.searchsorted(spike_times, self.time)\n n = len(spike_times)\n ... | [
"0.68979293",
"0.6640994",
"0.6507172",
"0.5977406",
"0.5866238",
"0.5749817",
"0.57480246",
"0.568603",
"0.5647011",
"0.5641555",
"0.56349427",
"0.55913675",
"0.5588329",
"0.5521469",
"0.54015243",
"0.5398123",
"0.5389734",
"0.53794944",
"0.5359989",
"0.53176546",
"0.528841"... | 0.7934081 | 0 |
Jump to the previous spike from the first selected cluster. | def go_to_previous_spike(self, ):
self._jump_to_spike(-1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def go_to_next_spike(self, ):\n self._jump_to_spike(+1)",
"def _jump_to_spike(self, delta=+1):\n spike_times = self.get_spike_times()\n if spike_times is not None and len(spike_times):\n ind = np.searchsorted(spike_times, self.time)\n n = len(spike_times)\n s... | [
"0.714149",
"0.63978726",
"0.63840806",
"0.61748135",
"0.60427266",
"0.5830913",
"0.5813735",
"0.5735725",
"0.57223296",
"0.57025665",
"0.57012117",
"0.55288374",
"0.5477547",
"0.547428",
"0.5469675",
"0.5461348",
"0.5453362",
"0.5451666",
"0.5414452",
"0.534706",
"0.5315017"... | 0.79967767 | 0 |
Toggle between showing all spikes or selected spikes. | def toggle_highlighted_spikes(self, checked):
self.show_all_spikes = checked
self.set_interval() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ToggleOff(self):\n for s in self.sensors:\n self.gSetpt[s.GetID()].Disable()\n\n self.top_sizer.Layout()\n print(\"Toggle off\")",
"def hidden_singles(self):\n self.change = True\n while self.change:\n self.hidden_round()",
"def toggle_surface_mode(s... | [
"0.6208926",
"0.6050148",
"0.5986689",
"0.5931181",
"0.5903119",
"0.5903119",
"0.5695317",
"0.56854576",
"0.56528676",
"0.56528676",
"0.56507105",
"0.5585108",
"0.5578206",
"0.557582",
"0.5550592",
"0.55118",
"0.5508104",
"0.5504786",
"0.5502983",
"0.55022866",
"0.54935396",
... | 0.69948447 | 0 |
Toggle automatic scaling of the traces. | def toggle_auto_scale(self, checked):
logger.debug("Set auto scale to %s.", checked)
self.auto_scale = checked | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _onToggleScale(self, event):\r\n if self.get_yscale() == 'log':\r\n self.set_yscale('linear')\r\n else:\r\n self.set_yscale('log')\r\n self.subplot.figure.canvas.draw_idle()",
"def clickAutoscale(self, event):\n self.axes.autoscale_view()",
"def scaling_ena... | [
"0.7329849",
"0.7177367",
"0.65722066",
"0.61756915",
"0.61486137",
"0.6119862",
"0.6056649",
"0.6035681",
"0.6035681",
"0.6006283",
"0.5996011",
"0.5986425",
"0.597488",
"0.5941395",
"0.5927027",
"0.5925209",
"0.5909223",
"0.5884189",
"0.5856268",
"0.5849367",
"0.5846804",
... | 0.72248846 | 1 |
Select a cluster by clicking on a spike. | def on_mouse_click(self, e):
if 'Control' in e.modifiers:
# Get mouse position in NDC.
box_id, _ = self.canvas.stacked.box_map(e.pos)
channel_id = np.nonzero(self.channel_y_ranks == box_id)[0]
# Find the spike and cluster closest to the mouse.
db = sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def click(self, event):\n x, y = self.canvas.invert([event.x, event.y])\n i, j = int(floor(x)), int(floor(y))\n patch = self.get_cell(i, j)\n if patch and patch.state == \"green\":\n cluster = self.get_cluster(patch)\n self.show_cluster(cluster)",
"def selectPoin... | [
"0.64221257",
"0.58902055",
"0.56319547",
"0.55411613",
"0.5464253",
"0.5434376",
"0.5432982",
"0.5413814",
"0.54018533",
"0.5387682",
"0.5354226",
"0.5342046",
"0.5314084",
"0.5284342",
"0.5284342",
"0.5258224",
"0.52542984",
"0.5254069",
"0.5253677",
"0.5247113",
"0.5224413... | 0.6448263 | 0 |
Overloading the addition operator for particles types | def __add__(self, other):
if isinstance(other, type(self)):
# always create new particles, since otherwise c = a + b changes a as well!
p = particles(self)
p.pos[:] = self.pos + other.pos
p.vel[:] = self.vel + other.vel
p.m = self.m
p.q = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __add__(self, other: PointOrIterableOrScalar) -> PointType:\n return self.__op(other, operator.add)",
"def __iadd__(self, other: PointOrIterableOrScalar) -> PointType:\n return self.__iop(other, operator.add)",
"def __add__(self, other):\r\n if isinstance(other, vec4):\r\n r... | [
"0.7108404",
"0.70331186",
"0.7007142",
"0.69473356",
"0.6846601",
"0.6845393",
"0.68245333",
"0.6748368",
"0.671954",
"0.66836524",
"0.6639666",
"0.6628716",
"0.6572368",
"0.6572368",
"0.65575284",
"0.65301085",
"0.65287226",
"0.6522699",
"0.64960563",
"0.64930576",
"0.649",... | 0.7784703 | 0 |
Overloading the subtraction operator for particles types | def __sub__(self, other):
if isinstance(other, type(self)):
# always create new particles, since otherwise c = a - b changes a as well!
p = particles(self)
p.pos[:] = self.pos - other.pos
p.vel[:] = self.vel - other.vel
p.m = self.m
p.q = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __sub__(self, other):\r\n if isinstance(other, vec4):\r\n return vec4(self.x-other.x, self.y-other.y, self.z-other.z, self.w-other.w)\r\n else:\r\n raise TypeError, \"unsupported operand type for -\"",
"def __sub__(self, other):\n\t\tif isinstance(other, int) or isinstance... | [
"0.7190107",
"0.69218826",
"0.6909827",
"0.6842003",
"0.6795763",
"0.6745326",
"0.6738838",
"0.666937",
"0.6658452",
"0.6623842",
"0.66205114",
"0.6617514",
"0.66050494",
"0.65911543",
"0.65911543",
"0.658858",
"0.65842706",
"0.6576843",
"0.65648913",
"0.654615",
"0.654368",
... | 0.7674791 | 0 |
Overloading the addition operator for fields types | def __add__(self, other):
if isinstance(other, type(self)):
# always create new fields, since otherwise c = a - b changes a as well!
p = fields(self)
p.elec[:] = self.elec + other.elec
p.magn[:] = self.magn + other.magn
return p
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __add__(self, other: Any) -> ColumnOperators:\n return self.operate(add, other)",
"def __add__(self, other):\n try:\n total = {self.var: 1, other.var: 1}\n return AutoDiffReverse(self.val + other.val, None, der=total)\n except AttributeError:\n return Aut... | [
"0.70417506",
"0.69787914",
"0.688292",
"0.6869126",
"0.6797251",
"0.67966515",
"0.67823577",
"0.6694425",
"0.66731805",
"0.6661316",
"0.6661316",
"0.66475755",
"0.6635631",
"0.6635631",
"0.6613988",
"0.66052085",
"0.65744835",
"0.6570402",
"0.6558253",
"0.65581644",
"0.65564... | 0.7395196 | 0 |
Overloading the subtraction operator for fields types | def __sub__(self, other):
if isinstance(other, type(self)):
# always create new fields, since otherwise c = a - b changes a as well!
p = fields(self)
p.elec[:] = self.elec - other.elec
p.magn[:] = self.magn - other.magn
return p
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __sub__(self, other):\n try:\n total = {self.var: 1, other.var: -1}\n return AutoDiffReverse(self.val - other.val, None, der=total)\n except AttributeError:\n return AutoDiffReverse(self.val - other, None, {self.var: 1})",
"def __rsub__(self, other):\n tr... | [
"0.68123215",
"0.65827966",
"0.658205",
"0.65601283",
"0.6536032",
"0.6514197",
"0.6397643",
"0.6376854",
"0.6373891",
"0.63729715",
"0.6359867",
"0.6323568",
"0.63116324",
"0.6266902",
"0.62532926",
"0.624705",
"0.624705",
"0.6241416",
"0.62308973",
"0.6229982",
"0.6229982",... | 0.7506139 | 0 |
The names of the roles performed by the model. This is required by QtQuick | def roleNames(self):
return self._roles | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def roles(self):\n return self._roles",
"def roles(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:\n return pulumi.get(self, \"roles\")",
"def roles(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:\n return pulumi.get(self, \"roles\")",
"def object_role_names(s... | [
"0.7476474",
"0.73596126",
"0.73596126",
"0.73139435",
"0.7310977",
"0.7254139",
"0.7241115",
"0.7161311",
"0.7130106",
"0.71001154",
"0.7057589",
"0.7041748",
"0.7031347",
"0.69231516",
"0.69207555",
"0.68998986",
"0.6880031",
"0.6854992",
"0.6836892",
"0.6824553",
"0.679437... | 0.7644932 | 0 |
The outline of the command used to perform a horizontal run | def horizontalCommand(self):
return self._horizontal_command | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hr() -> None:\n width, _ = click.get_terminal_size()\n click.echo('-' * width)",
"def _display_command(self):\n idx = self.current_idx # Local copy to avoid race condition updates\n output = self.outputs[idx]\n if output is None:\n self.screen.addstr('Waiting for comman... | [
"0.6144864",
"0.60430384",
"0.60299814",
"0.59511566",
"0.5867638",
"0.5822455",
"0.5822455",
"0.5822455",
"0.5822455",
"0.5822455",
"0.5822455",
"0.5822455",
"0.5822455",
"0.5822455",
"0.5822455",
"0.5822455",
"0.5822455",
"0.5822455",
"0.5822455",
"0.5822455",
"0.5822455",
... | 0.64010274 | 0 |
The outline of the command used to perform a vertical run | def verticalCommand(self):
return self._vertical_command | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cli():",
"def cli():",
"def cli():",
"def cli():",
"def cli():",
"def cli():",
"def cli():",
"def cli():",
"def cli():",
"def cli():",
"def cli():",
"def cli():",
"def cli():",
"def cli():",
"def cli():",
"def cli():",
"def cli():",
"def cli():",
"def cli():",
"def cli():"... | [
"0.59563714",
"0.59563714",
"0.59563714",
"0.59563714",
"0.59563714",
"0.59563714",
"0.59563714",
"0.59563714",
"0.59563714",
"0.59563714",
"0.59563714",
"0.59563714",
"0.59563714",
"0.59563714",
"0.59563714",
"0.59563714",
"0.59563714",
"0.59563714",
"0.59563714",
"0.59563714"... | 0.6988323 | 0 |
The current number of runs | def count(self):
return len(self._runs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next_run_idx(self):\n return self.num_runs",
"def number_of_launches(self):\n return self._number_of_launches",
"def number_of_iterations(self) -> int:\n pass",
"def num_runs(self):\n return len(self._h5[RUNS])",
"def run(self) -> int:\n self._times_called += 1\n ... | [
"0.76630276",
"0.75599295",
"0.74130595",
"0.7332917",
"0.73038995",
"0.72296184",
"0.7181953",
"0.7181953",
"0.71678597",
"0.7135644",
"0.6975584",
"0.6965288",
"0.6940288",
"0.6895412",
"0.6895412",
"0.68646985",
"0.68560135",
"0.68351436",
"0.6822677",
"0.68223685",
"0.682... | 0.77989334 | 0 |
Function to perform a 5 year moving window filter for a single land cover value (such as Forest as 1) for all years in an image. Calls the function mask5. The image bands do not need to be in order, but the bandNames argument must be in chronological order. The temporal filter inspects the central position of five cons... | def applyWindow5years(imagem, value, bandNames):
img_out = imagem.select(bandNames[0])
for i in np.arange(1, len(bandNames)-3):
img_out = img_out.addBands(mask5(imagem, value,bandNames[(i-1):(i+4)]))
img_out = img_out.addBands(imagem.select(bandNames[-3]))
img_out = img_out.addBands(imagem.selec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mask5(imagem, value, bandNames):\n mask = imagem.select(bandNames[0]).eq(value) \\\n .bitwiseAnd(imagem.select(bandNames[1]).neq(value)) \\\n .bitwiseAnd(imagem.select(bandNames[2]).neq(value)) \\\n .bitwiseAnd(imagem.select(bandNames[3]).neq(value)) \\\n .bitwiseAnd(imagem.selec... | [
"0.66861373",
"0.65514684",
"0.6478541",
"0.5613955",
"0.54316807",
"0.5428405",
"0.5313811",
"0.520505",
"0.51899797",
"0.50904",
"0.50412196",
"0.5036899",
"0.49864736",
"0.47982645",
"0.4767842",
"0.47645608",
"0.4758746",
"0.47383195",
"0.46717232",
"0.46011153",
"0.45707... | 0.80881137 | 0 |
Function to perform a 4 year moving window filter for a single land cover value (such as Forest as 1) for all years in an image. Calls the function mask4. The image bands do not need to be in order, but the bandNames argument must be in chronological order. The temporal filter inspects the central position of four cons... | def applyWindow4years(imagem, value, bandNames):
img_out = imagem.select(bandNames[0])
for i in np.arange(1, len(bandNames)-2):
img_out = img_out.addBands(mask4(imagem, value,bandNames[(i-1):(i+3)]))
img_out = img_out.addBands(imagem.select(bandNames[-2]))
img_out = img_out.addBands(imagem.selec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applyWindow5years(imagem, value, bandNames):\n img_out = imagem.select(bandNames[0])\n for i in np.arange(1, len(bandNames)-3):\n img_out = img_out.addBands(mask5(imagem, value,bandNames[(i-1):(i+4)]))\n img_out = img_out.addBands(imagem.select(bandNames[-3]))\n img_out = img_out.addBands(im... | [
"0.6658748",
"0.64081764",
"0.6048875",
"0.5828636",
"0.53740543",
"0.5318547",
"0.5314894",
"0.5258221",
"0.5224046",
"0.49241713",
"0.48995483",
"0.48989847",
"0.48840585",
"0.47406876",
"0.47206843",
"0.4713083",
"0.46992207",
"0.46542522",
"0.4640126",
"0.4630526",
"0.462... | 0.76945615 | 0 |
Function to perform a 3 year moving window filter for a single land cover value (such as Forest as 1) for all years in an image. Calls the function mask3. The image bands do not need to be in order, but the bandNames argument must be in chronological order. The temporal filter inspects the central position of three con... | def applyWindow3years(imagem, value, bandNames):
img_out = imagem.select(bandNames[0])
for i in np.arange(1, len(bandNames)-1):
img_out = img_out.addBands(mask3(imagem, value,bandNames[(i-1):(i+2)]))
img_out = img_out.addBands(imagem.select(bandNames[-1]))
return img_out | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applyWindow4years(imagem, value, bandNames):\n img_out = imagem.select(bandNames[0])\n for i in np.arange(1, len(bandNames)-2):\n img_out = img_out.addBands(mask4(imagem, value,bandNames[(i-1):(i+3)]))\n img_out = img_out.addBands(imagem.select(bandNames[-2]))\n img_out = img_out.addBands(im... | [
"0.6262926",
"0.61455876",
"0.6122352",
"0.59712267",
"0.5810346",
"0.56390077",
"0.5292091",
"0.5260056",
"0.52369714",
"0.5159779",
"0.5131087",
"0.50615054",
"0.49572933",
"0.48659185",
"0.4854936",
"0.4852849",
"0.48406282",
"0.48388356",
"0.47845525",
"0.47620434",
"0.47... | 0.7711574 | 0 |
Function to perform a forward moving gap fill for all years in an image. The image bands do not need to be in order, but the bandNames argument must be in chronological order. The forward gap fill is applied iteratively from the first year of bandNames through the final year, where if the current image has missing data... | def applyForwardNoDataFilter(image, bandNames):
#Get a list of band names from year(1) through the last year
bandNamesEE = ee.List(bandNames[1:])
#Define forwards filter
#In first iteration, bandName=bandNames[1] and previousImage is image.select(bandNames[0]), or the classifications for the first ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applyBackwardNoDataFilter(image, bandNames):\n #Get a list of band names to iterate over, from year(-2) through year(0)\n bandNamesEE = ee.List(bandNames[:-1]).reverse()\n \n #Define backwards filter\n #In first iteration, bandName=bandNames[-2] and followingImage is image.select(bandNames[-1]),... | [
"0.65311575",
"0.5876845",
"0.5747447",
"0.5284138",
"0.52226",
"0.5096014",
"0.5058866",
"0.5047209",
"0.49857956",
"0.49474898",
"0.48613372",
"0.48247787",
"0.47784477",
"0.46002764",
"0.45790556",
"0.45642906",
"0.4548984",
"0.4521293",
"0.45085937",
"0.44796604",
"0.4468... | 0.70489925 | 0 |
Function to perform a backward moving gap fill for all years in an image. The image bands do not need to be in order, but the bandNames argument must be in chronological order. The backward gap fill is applied iteratively from the last year of bandNames through the first year, where if the current image has missing dat... | def applyBackwardNoDataFilter(image, bandNames):
#Get a list of band names to iterate over, from year(-2) through year(0)
bandNamesEE = ee.List(bandNames[:-1]).reverse()
#Define backwards filter
#In first iteration, bandName=bandNames[-2] and followingImage is image.select(bandNames[-1]), or the cl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applyForwardNoDataFilter(image, bandNames):\n #Get a list of band names from year(1) through the last year\n bandNamesEE = ee.List(bandNames[1:])\n \n #Define forwards filter\n #In first iteration, bandName=bandNames[1] and previousImage is image.select(bandNames[0]), or the classifications for ... | [
"0.7032449",
"0.5949247",
"0.5812707",
"0.5253641",
"0.51127684",
"0.49725264",
"0.47500893",
"0.46962532",
"0.46487218",
"0.45113215",
"0.44795865",
"0.44701588",
"0.4448179",
"0.4420199",
"0.4388033",
"0.43850613",
"0.43616962",
"0.4360365",
"0.43425742",
"0.43269235",
"0.4... | 0.7573101 | 0 |
Function to apply forward gap filling and backward gap filling to an image. The image bands do not need to be in order, but the bandNames argument must be in chronological order. This funciton calls applyForwardNoDataFilter then applyBackwardNoDataFilter | def applyGapFilter(image, bandNames):
filtered = applyForwardNoDataFilter(image, bandNames)
filtered = applyBackwardNoDataFilter(filtered, bandNames)
return filtered | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applyForwardNoDataFilter(image, bandNames):\n #Get a list of band names from year(1) through the last year\n bandNamesEE = ee.List(bandNames[1:])\n \n #Define forwards filter\n #In first iteration, bandName=bandNames[1] and previousImage is image.select(bandNames[0]), or the classifications for ... | [
"0.7110317",
"0.704121",
"0.5153824",
"0.51472473",
"0.50976783",
"0.5092685",
"0.50910985",
"0.5038838",
"0.4983372",
"0.4950319",
"0.48741138",
"0.48643586",
"0.4801015",
"0.47917843",
"0.47886074",
"0.47822264",
"0.4780743",
"0.47651857",
"0.47144574",
"0.4703689",
"0.4698... | 0.745405 | 0 |
Function to apply an incidence filter. The incidence filter finds all pixels that changed more than numChangesCutoff times and is connected to less than connectedPixelCutoff pixels, then replaces those pixels with the MODE value of that given pixel position in the stack of years. | def applyIncidenceFilter(image, bandNames, classDictionary, numChangesCutoff = 8, connectedPixelCutoff=6):
#Calculate the number of times a pixel changes throughout the time series and determine if it is over the numChangesCutoff
num_changes = calculateNumberOfChanges(image, bandNames)
too_many_changes = nu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applyFrequencyFilter(image, yearBandNames, classDictionary, filterParams): \n #Grab land cover classes as a list of strings\n lc_classes = classDictionary.keys().getInfo()\n \n #Get binary images of the land cover classifications for the current year\n binary_class_images = npv.convertClassif... | [
"0.52584434",
"0.501605",
"0.50095785",
"0.5009003",
"0.5002469",
"0.49740124",
"0.49180493",
"0.49099478",
"0.48357704",
"0.47827873",
"0.47746482",
"0.47566548",
"0.4741615",
"0.4737234",
"0.46963915",
"0.46842596",
"0.4639385",
"0.46338367",
"0.46156648",
"0.46046755",
"0.... | 0.7578108 | 0 |
Function to apply an frequency filter. This filter takes into consideration the occurrence frequency throughout the entire time series. Thus, all class occurrence with less than given percentage of temporal persistence (eg. 3 years or fewer out of 33) are replaced with the MODE value of that given pixel position in the... | def applyFrequencyFilter(image, yearBandNames, classDictionary, filterParams):
#Grab land cover classes as a list of strings
lc_classes = classDictionary.keys().getInfo()
#Get binary images of the land cover classifications for the current year
binary_class_images = npv.convertClassificationsTo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def frequency_filter(fc, L, srf, KIND=2):\n\n if hasattr(KIND, \"__len__\"):\n PASS = KIND\n KIND = 2\n else:\n PASS = [2,3]\n KIND = [KIND]\n\n # fourier transform of lateral inhibitory function \n\n # tonotopic axis\n if issubclass(type(fc), str):\n fc = float(fc... | [
"0.60981953",
"0.56942517",
"0.5577544",
"0.5543279",
"0.55281085",
"0.5500619",
"0.5476223",
"0.5473143",
"0.54327935",
"0.5337489",
"0.5303522",
"0.5286453",
"0.52189946",
"0.521232",
"0.5156549",
"0.51182044",
"0.51102227",
"0.50913894",
"0.5088179",
"0.5085512",
"0.501948... | 0.69544667 | 0 |
Function to apply a probability filter to land cover probabilities in each image of imageCollection. The user defines which classes will be filtered and how to filter them in the params list. The params list is a list of dictionaries, one for each class the user wants to filter. | def applyProbabilityCutoffs(imageCollection, params):
#Define function to map across imageCollection
def probabilityFilter(image):
#Get the classifications from the class with the highest probability
classifications = npv.probabilityToClassification(image)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applyFrequencyFilter(image, yearBandNames, classDictionary, filterParams): \n #Grab land cover classes as a list of strings\n lc_classes = classDictionary.keys().getInfo()\n \n #Get binary images of the land cover classifications for the current year\n binary_class_images = npv.convertClassif... | [
"0.6045485",
"0.5797399",
"0.5739651",
"0.57369685",
"0.5731208",
"0.56458217",
"0.55604017",
"0.55141634",
"0.5474806",
"0.5470038",
"0.5451431",
"0.5425758",
"0.53987706",
"0.53475237",
"0.5286839",
"0.52788055",
"0.52607375",
"0.5203152",
"0.5157591",
"0.5144034",
"0.51254... | 0.79373574 | 0 |
Returns the number of features in the processed data. Returns int Feature size. | def get_num_features(self):
return len(self[0]['x']) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def features_size(self) -> int:\n return len(self.data[0].features) if len(self.data) > 0 and self.data[0].features is not None else None",
"def getNrFeatures(self):\n return self.featureNames.size",
"def num_features(self):\n if self.x is None:\n return 0\n return 1 if s... | [
"0.8408814",
"0.83368707",
"0.8241575",
"0.8142289",
"0.80863315",
"0.80641556",
"0.8048011",
"0.79128486",
"0.7869567",
"0.7836357",
"0.78265285",
"0.78225327",
"0.77721834",
"0.7672442",
"0.75243306",
"0.74740946",
"0.7469065",
"0.7446943",
"0.74352556",
"0.7432964",
"0.742... | 0.8641283 | 0 |
Returns the index corresponding to the given class label. | def lookup_class_idx(self,label):
return self.class_labels[label] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_class_index(self, label):\n assert label in CLASSES\n return CLASSES.index(label)",
"def get_class_index(label):\n if isinstance(label,str) is False:\n basic.outputlogMessage('input label must be a string')\n assert(False)\n length = len(class_label)\n for i in range(... | [
"0.8939161",
"0.8781351",
"0.8290658",
"0.79299194",
"0.75193024",
"0.7453748",
"0.7260702",
"0.7260702",
"0.7200521",
"0.7144214",
"0.6997018",
"0.6986183",
"0.6928649",
"0.68628794",
"0.67985356",
"0.6562468",
"0.64826816",
"0.6404319",
"0.6269193",
"0.6264292",
"0.62591416... | 0.9071037 | 0 |
Applies a function mapping to each element in the feature data. | def apply_fn(self,fn):
self.check_Data()
for split,data_ in self.processed_data.items():
x = data_['x']
x = np.array([fn(xi) for xi in x])
data_['x'] = x | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def map(self, function=lambda value: value):\n for j, value in enumerate(self):\n self[j] = function(value)",
"def map(self, function=lambda item: item):\n for i, row in enumerate(self):\n for j, item in enumerate(row):\n row[j] = function(item)",
"def map(sel... | [
"0.73664135",
"0.7220546",
"0.70397",
"0.70174754",
"0.685345",
"0.684726",
"0.68348914",
"0.6801942",
"0.6742367",
"0.6730765",
"0.6695242",
"0.6670184",
"0.6574957",
"0.6559686",
"0.6507356",
"0.6469651",
"0.6460323",
"0.6443097",
"0.64101386",
"0.64018846",
"0.63930345",
... | 0.7359208 | 1 |
Generates a new MLP using the nn.Sequential class. Returns | def generate(self):
components = []
components.append(nn.Linear(self.n_features,self.hidden_sizes[0]))
self._activation(components,self.activation)
self._dropout(components,self.dropout)
for i in range(1,len(self.hidden_sizes)):
components.append... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_mlp_model():\n return snt.Sequential([\n snt.nets.MLP([LATENT_SIZE] * NUM_LAYERS, activate_final=True),\n snt.LayerNorm()\n ])",
"def mlp_model(self):\n\n model = Sequential()\n model.add(Dense(self.dense1, input_shape=(784,)))\n model.add(Activation(self... | [
"0.7659937",
"0.75626165",
"0.74614346",
"0.7456196",
"0.7027464",
"0.70230585",
"0.6835712",
"0.67514044",
"0.67060864",
"0.6647528",
"0.6643573",
"0.659611",
"0.6572788",
"0.6491478",
"0.6484547",
"0.6470002",
"0.64629227",
"0.64441985",
"0.64162695",
"0.6321424",
"0.628487... | 0.8253452 | 0 |
Creates a new activation function and adds it to the list of components. | def _activation(self,components,activation):
if activation == "ReLU":
components.append(nn.ReLU())
elif activation == "Sigmoid":
components.append(nn.Sigmoid())
else:
raise Exception("Invalid activation fn: "+activation) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def construct_activation_function(self):\n # Add the activation function\n if not self.activation_function is None:\n # Check if it is a string\n if isinstance(self.activation_function, str):\n activation_function = get_activation_function_by_name(\n ... | [
"0.7639841",
"0.6542784",
"0.61630833",
"0.6001237",
"0.6001181",
"0.59439",
"0.591768",
"0.5908562",
"0.58893776",
"0.58730316",
"0.5850897",
"0.5848719",
"0.58140385",
"0.58140385",
"0.5795392",
"0.5792487",
"0.5785407",
"0.57467926",
"0.57267064",
"0.5675934",
"0.5668909",... | 0.7331862 | 1 |
Adds a dropout object to the list of components | def _dropout(self,components,dropout=None):
if dropout is not None:
components.append(nn.Dropout(dropout)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add(self, component) -> None:\n pass",
"def add_component(self, componentInstance):\n\n #print \"Componet being added to %s entity.\"%(self._sName)\n #print componentInstance\n \n self._dComponents[componentInstance.get_name()] = componentInstance\n\n #These if state... | [
"0.63641316",
"0.56994003",
"0.5660805",
"0.5521632",
"0.5519748",
"0.5501247",
"0.54634714",
"0.5435919",
"0.53915066",
"0.5373497",
"0.53394043",
"0.53063345",
"0.5302059",
"0.52375495",
"0.52294815",
"0.5180793",
"0.51650107",
"0.51634353",
"0.515684",
"0.51533777",
"0.514... | 0.673964 | 0 |
Splits a DataFrame into 3 distinct DataFrames based on the given percentages and returns a dict of the data. | def split_data(text_df,splits=None,rand_perm=True):
if splits is None:
splits = {'train':0.6,'val':0.1,'test':0.3}
if np.round(np.sum(list(splits.values())),4) != 1:
raise Exception("Split percentages do not sum to 1")
size = len(text_df)
if rand_perm:
pe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_data(df_data, clusters):\n\n if clusters is None:\n\n return {0: df_data}\n\n return {\n k: df_data.loc[clusters.index[clusters == k]]\n for k in clusters.unique()\n }",
"def split_train_dev_set(df, percent=0.2):\n train = []\n dev = []\n for k, g in df.groupby(\"... | [
"0.59946746",
"0.5814314",
"0.5597616",
"0.55113435",
"0.5504025",
"0.54890805",
"0.5455985",
"0.54370016",
"0.54187405",
"0.54187405",
"0.54108846",
"0.54088694",
"0.5390827",
"0.5368966",
"0.53635633",
"0.53455263",
"0.53044295",
"0.5286926",
"0.52688",
"0.5268422",
"0.5253... | 0.58939797 | 1 |
Reads a English > French text file and filters the lines based on the given filter_fn. If filter_fn is None, the default filter will be | def filter_nmt_file(filename,filter_fn=None):
if filter_fn is None:
filter_fn = lambda en : en.lower().startswith('i am') or \
en.lower().startswith('he is') or \
en.lower().startswith('she is') or \
en.lower().startswith('they are') or \
en.lower(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _load_filter(self, fname, interp=True, lamb=None, *args, **kwargs):\n try:\n fil = UnitFilter.from_ascii(fname, *args, **kwargs)\n except Exception:\n content = self.content\n r = [k for k in content if fname in k]\n\n if len(r) <= 0: # try all lower f... | [
"0.594911",
"0.5432073",
"0.5307598",
"0.5264026",
"0.5253835",
"0.52506196",
"0.5130263",
"0.49939936",
"0.49880716",
"0.49808767",
"0.4957064",
"0.494303",
"0.49124965",
"0.49102247",
"0.49089",
"0.48704535",
"0.48687115",
"0.48383683",
"0.48080763",
"0.47974768",
"0.479605... | 0.73677015 | 0 |
Given a list of lines of English/French text, creates a DataFrame with train/val/test split labels. | def create_nmt_data(text,train_pct=0.7,val_pct=0.15):
if train_pct + val_pct >= 1:
raise Exception("train_pct + val_pct must be < 1.0")
source = []
target = []
for line in text:
text = line.split('\t')
source.append(text[0])
target.append(text[1])
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_training_data_file(list_of_word_lines, language):\r\n # To store each feature vector\r\n feature_vector = []\r\n\r\n # To store the entire dataset\r\n data = []\r\n\r\n for sentence in list_of_word_lines:\r\n\r\n # Contains Q\r\n CONTAINS_Q = 'N'\r\n\r\n # Contains Q\... | [
"0.6267126",
"0.6177644",
"0.6156957",
"0.614642",
"0.6129366",
"0.612271",
"0.6122403",
"0.60591143",
"0.5948062",
"0.59287256",
"0.592589",
"0.5915757",
"0.58811563",
"0.5854081",
"0.58518916",
"0.5847722",
"0.58189434",
"0.58174044",
"0.58112806",
"0.58017504",
"0.5774996"... | 0.6742829 | 0 |
Reads a glove word embedding text file and generates a DataFrame with the embeddings. | def process_glove_data(filename):
word_list = []
embed_list = []
with open(filename,encoding="utf8") as file:
lines = file.readlines()
for line in lines:
toks = line.split(' ')
word_list.append(toks[0])
vec = [float(tok) for tok in toks[1:]]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_embeddings(filename):\n labels = []\n rows = []\n with open(filename, encoding='utf-8') as infile:\n for i, line in enumerate(infile):\n items = line.rstrip().split(' ')\n if len(items) == 2:\n # This is a header row giving the shape of the matrix\n ... | [
"0.7637871",
"0.72984564",
"0.72906333",
"0.7238396",
"0.7030938",
"0.6931128",
"0.69254005",
"0.6910939",
"0.6879712",
"0.6877971",
"0.68639934",
"0.6831232",
"0.6824664",
"0.68067014",
"0.679522",
"0.6794145",
"0.6751845",
"0.67482585",
"0.67427385",
"0.66889936",
"0.666392... | 0.7851951 | 0 |
Processes a list of splits by modifying any positions as needed. | def handle_splits(self, splits):
total_leftover_cash = 0
for instrument, ratio in splits:
if instrument in self.positions:
self._dirty_stats = True
# Make the position object handle the split. It returns the
# leftover cash from a fractional ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split(self, splits, catchall=False):\r\n raise NotImplementedError()",
"def _setup_splits(self):\n #ntot = self.reredux_conf['nperfile']\n ntot = self.reredux_conf['Ngals']\n npersplit = self.runconf['nper']\n\n self.beglist, self.endlist = get_splits(ntot, npersplit)",
"def ... | [
"0.69268346",
"0.57384413",
"0.5705373",
"0.5634635",
"0.56108665",
"0.5545612",
"0.5541551",
"0.5517076",
"0.5466351",
"0.54659456",
"0.54127634",
"0.5412377",
"0.53936285",
"0.5370275",
"0.53439856",
"0.5326818",
"0.53085357",
"0.5286673",
"0.5274086",
"0.5254431",
"0.52331... | 0.6112161 | 1 |
Given a list of dividends whose ex_dates are all the next trading day, calculate and store the cash and/or stock payments to be paid on each dividend's pay date. | def earn_dividends(self, cash_dividends, stock_dividends):
for cash_dividend in cash_dividends:
self._dirty_stats = True # only mark dirty if we pay a dividend
# Store the earned dividends so that they can be paid on the
# dividends' pay_dates.
div_owed = self.p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pay_dividends(self, next_trading_day):\n net_cash_payment = 0.0\n\n try:\n payments = self._unpaid_dividends[next_trading_day]\n # Mark these dividends as paid by dropping them from our unpaid\n del self._unpaid_dividends[next_trading_day]\n except KeyError... | [
"0.6943807",
"0.61015797",
"0.59446824",
"0.5888466",
"0.575217",
"0.57305545",
"0.57155085",
"0.55656976",
"0.5565659",
"0.55222803",
"0.55169284",
"0.54701203",
"0.5462021",
"0.53821945",
"0.53751284",
"0.53381366",
"0.5314847",
"0.53086144",
"0.5304677",
"0.529244",
"0.526... | 0.62604964 | 1 |
Returns a cash payment based on the dividends that should be paid out according to the accumulated bookkeeping of earned, unpaid, and stock dividends. | def pay_dividends(self, next_trading_day):
net_cash_payment = 0.0
try:
payments = self._unpaid_dividends[next_trading_day]
# Mark these dividends as paid by dropping them from our unpaid
del self._unpaid_dividends[next_trading_day]
except KeyError:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cash_flow(self):\n _cash_flow = self.after_tax_profit() + self.depreciation()\n return _cash_flow",
"def cash(self, qtt_100s, qtt_50s, qtt_20s):\n return (qtt_100s * 100) + (qtt_50s * 50) + (qtt_20s * 20)",
"def test_discounted_payment_below_debit(self):\n debit_jobs([(self.job,... | [
"0.65616626",
"0.6471666",
"0.6241464",
"0.6134051",
"0.6083674",
"0.6017929",
"0.59529567",
"0.59450686",
"0.57963526",
"0.5787191",
"0.5777359",
"0.57426834",
"0.5719649",
"0.56672525",
"0.5616136",
"0.5607058",
"0.55491143",
"0.5521608",
"0.5502035",
"0.5492246",
"0.545119... | 0.7525171 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.