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
Visualise colorspace vector as an interactive 3D figure. Colorspace can have extra columns By default RGB channels are clipped to the range [0,1]. Extra arguments can be used to control the appearance of ipyvolume.scatter
def show_colorspace(cspace: np.array, clip=True, size = 0.5, marker='sphere', **kwargs) -> None: assert isinstance(cspace, DataFrame), "Colorspace must be a dataframe" assert all(np.isin(['R', 'G', 'B'], cspace.columns)), "Colorspace must contain RGB columns" fig = ipv.figure() if clip: ipv.sc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drawColorColumn(x, yseq, zseq):\n dislin.curvy3(x, yseq, zseq, len(yseq))", "def plot3D(x):\n cycol = cycle('bgrcmk')\n fig = plt.figure()\n ax = Axes3D(fig)\n for i in range(5):\n ax.scatter(x[:, i, 0], x[:, i, 1], x[:, i, 2], c=next(cycol),\n marker='.')\n plt.sho...
[ "0.59832585", "0.5860537", "0.58340544", "0.57691926", "0.5764829", "0.5710427", "0.5683266", "0.5635767", "0.5606914", "0.55751276", "0.5560233", "0.5559747", "0.55588275", "0.55202836", "0.5513298", "0.55122715", "0.5509551", "0.5489844", "0.5477256", "0.5471932", "0.544747...
0.69867015
0
Tests that constructed signals are actual proportions.
def test_construct_signals_proportions(self): cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'), SIGNALS) assert np.all(cbg_df['completely_home_prop'].values <= 1) assert np.all(cbg_df['full_time_work_prop'].values <= 1) assert np.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_proportions(self):\r\n\r\n proportions = [\r\n v['proportion'] for k, v in self.composition.items()\r\n ]\r\n\r\n if sum(proportions) < 1.0:\r\n raise ValueError('Sum of proportions between host and pathogen must be 1.0.')\r\n elif sum(proportions) > 1.0:...
[ "0.66484034", "0.6311004", "0.61575395", "0.6049411", "0.5846437", "0.57422686", "0.5709035", "0.5704337", "0.5583857", "0.5583857", "0.5528866", "0.5524776", "0.55001354", "0.54795945", "0.5478572", "0.54679793", "0.54651594", "0.544234", "0.543187", "0.5401828", "0.5401828"...
0.7607326
0
Tests that aggregation at the county level creates nonzerovalued signals.
def test_aggregate_county(self): cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'), SIGNALS) df = aggregate(cbg_df, SIGNALS, 'county') assert np.all(df[f'{SIGNALS[0]}_n'].values > 0) x = df[f'{SIGNALS[0]}_se'].values assert...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_aggregate_nation(self):\n cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'),\n SIGNALS)\n df = aggregate(cbg_df, SIGNALS, 'nation')\n\n assert np.all(df[f'{SIGNALS[0]}_n'].values > 0)\n x = df[f'{SIGNALS[0]}_se'].values\n ...
[ "0.68716997", "0.6666926", "0.61090475", "0.57431424", "0.5742255", "0.5667957", "0.5607133", "0.5604635", "0.55638605", "0.55366623", "0.5536144", "0.55044466", "0.54993826", "0.5419435", "0.5376306", "0.53653294", "0.53649396", "0.5341991", "0.5326681", "0.53014153", "0.529...
0.7612559
0
Tests that aggregation at the state level creates nonzerovalued signals.
def test_aggregate_state(self): cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'), SIGNALS) df = aggregate(cbg_df, SIGNALS, 'state') assert np.all(df[f'{SIGNALS[0]}_n'].values > 0) x = df[f'{SIGNALS[0]}_se'].values assert n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_aggregate_nation(self):\n cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'),\n SIGNALS)\n df = aggregate(cbg_df, SIGNALS, 'nation')\n\n assert np.all(df[f'{SIGNALS[0]}_n'].values > 0)\n x = df[f'{SIGNALS[0]}_se'].values\n ...
[ "0.61210126", "0.5934089", "0.589467", "0.5892433", "0.5861224", "0.5711701", "0.5653383", "0.5630056", "0.5579708", "0.5577906", "0.5550419", "0.5545783", "0.55085456", "0.5499616", "0.5489012", "0.5481875", "0.5469063", "0.5461217", "0.54575956", "0.5446156", "0.5441203", ...
0.748049
0
Tests that aggregation at the state level creates nonzerovalued signals.
def test_aggregate_nation(self): cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'), SIGNALS) df = aggregate(cbg_df, SIGNALS, 'nation') assert np.all(df[f'{SIGNALS[0]}_n'].values > 0) x = df[f'{SIGNALS[0]}_se'].values assert...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_aggregate_state(self):\n cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'),\n SIGNALS)\n df = aggregate(cbg_df, SIGNALS, 'state')\n\n assert np.all(df[f'{SIGNALS[0]}_n'].values > 0)\n x = df[f'{SIGNALS[0]}_se'].values\n ...
[ "0.74812746", "0.59329057", "0.5895889", "0.58929867", "0.58616966", "0.5710675", "0.565309", "0.5629537", "0.557881", "0.5575357", "0.5549657", "0.55448717", "0.55095005", "0.54987305", "0.54884887", "0.54829407", "0.5467536", "0.54628205", "0.5458857", "0.5445779", "0.54409...
0.6122557
1
Method for reading a nordic file and parsing it to a string array while also checking the integrity of the file(Will give errors when lines are too long). It also wil parse empty space on the file if it is too short.
def readNordicFile(f): nordics = [] emsg = "Nordic Read: The following line is too short: {0}\n{1}" i = 0 nordics.append([]) for line in f: if line.strip() == "" or line is None: if len(nordics[i]) == 0: continue i += 1; nordics.append([])...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readP(path, encoding='iso-8859-1', n=0):\n with open(path, encoding=encoding) as f:\n raw = [x.strip() for x in f if x]\n if n:\n raw = [x for x in raw if len(x) <= n]\n return raw", "def read(read_file) -> list:\n result = []\n try:\n with open(read_file) as file:...
[ "0.60678965", "0.6035607", "0.6027674", "0.6023274", "0.598013", "0.5867823", "0.586583", "0.58537155", "0.58469784", "0.5815171", "0.5806846", "0.58053046", "0.5800402", "0.5777913", "0.5765686", "0.57436544", "0.57398486", "0.57300663", "0.57231325", "0.57182133", "0.568593...
0.760024
0
Returns the text in the example's document in the given span.
def get_text_span(example, span): byte_positions = [] # `text` is a byte string since `document_plaintext` is also a byte string. start = span["plaintext_start_byte"] end = span["plaintext_end_byte"] text = byte_slice(example["document_plaintext"], start, end) for i in range(start, end): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_span_text(self, span: Span) -> str:\n return self._text[span.begin: span.end]", "def read_text_from_span_id(html, span_id):\n return html.find('span', {'id': span_id}).text", "def get_span_text(element, name):\n try:\n return (\n element.find_element_by_css_selector(name)...
[ "0.82889014", "0.7150462", "0.6169565", "0.59940624", "0.59328765", "0.5892914", "0.58556867", "0.583677", "0.5791252", "0.5784249", "0.57462", "0.5718208", "0.5718208", "0.5718208", "0.5718208", "0.5718208", "0.5707402", "0.564645", "0.56462574", "0.5600071", "0.5583564", ...
0.77947813
1
Returns a text representation of the candidate at the given index.
def get_candidate_text(json_dict, idx): # No candidate at this index. if idx < 0 or idx >= len(json_dict["passage_answer_candidates"]): raise ValueError("Invalid index for passage candidate: {}".format(idx)) return get_text_span(json_dict, json_dict["passage_answer_candidates"][idx])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetString(self, index):\n \n return self.choices[index].GetLabel()", "def __getitem__(self, index):\n return str(self.cpf[index])", "def _printFromIndex(self, index):\n ret = str(self.arr[index])\n iterator = index + 1\n while iterator != index:\n ret +=...
[ "0.6410651", "0.6363077", "0.6317435", "0.6307074", "0.61769325", "0.6108662", "0.61011386", "0.6054563", "0.6041569", "0.5981198", "0.58085775", "0.576806", "0.57276076", "0.5684942", "0.5660255", "0.5657564", "0.56432194", "0.5622297", "0.56197083", "0.56084627", "0.5603121...
0.7112093
0
Converts a TyDi 'entry' from `create_entry_from_json` to `TyDiExample`.
def to_tydi_example(entry, is_training): if is_training: answer = make_tydi_answer(entry["contexts"], entry["answer"]) start_byte_offset = answer.offset end_byte_offset = answer.offset + byte_len(answer.text) else: answer = None start_byte_offset = None end_byte_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_entry(entry):\n Entry.create(**entry)\n return entry", "def from_dict(cls, dikt) -> \"Todo\":\n return util.deserialize_model(dikt, cls)", "def example_json(example_json_file):\n return json.loads(example_json_file)", "def _json_to_instance(self, json_dict: JsonDict) -> Instance:\n...
[ "0.58346426", "0.5392077", "0.5235372", "0.5232819", "0.52080363", "0.51707566", "0.5161617", "0.5157883", "0.5148814", "0.51232684", "0.51134694", "0.5111602", "0.5105579", "0.51049596", "0.5095554", "0.50900686", "0.5078553", "0.5064115", "0.5054117", "0.50366974", "0.50366...
0.74971884
0
Representacion en cadena de la clase Parroquia.
def __unicode__(self): return self.parroquia
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, nombre, cantidad, precio):\n\n # Atributos privados por convensión\n self._an = 15 # Ancho de columna nombre\n self._ac = 8 # Ancho de columna cantidad\n self._ap = 10 # Ancho de columna precio\n self._ast = 10 # Ancho de columna subtotal\n\n # Se in...
[ "0.62735045", "0.6233848", "0.62092257", "0.6143086", "0.5984596", "0.59630907", "0.59224004", "0.58816874", "0.58564144", "0.5777072", "0.5774827", "0.5763267", "0.57328683", "0.5721564", "0.5687393", "0.5685108", "0.5682803", "0.5677757", "0.56428087", "0.5642351", "0.56404...
0.7457928
0
La Url de vista principal de administracion de Parroquia.
def get_absolute_url(self): return ('listar_parroquia', [self.id, ])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_orion_admin_url(self, obj):\n return obj.orion_admin_url", "def get_admin_url_to_add_run(self, request):\n base_url = reverse(\"admin:courses_courserun_add\")\n return f\"{base_url:s}?direct_course={self.id:d}\"", "def getAdmin():", "def url(self):\n return url_for('/admi...
[ "0.6939429", "0.6376486", "0.62612", "0.6213472", "0.6176542", "0.61681587", "0.6094484", "0.6040345", "0.5983753", "0.5958032", "0.59322804", "0.5912582", "0.584376", "0.58436394", "0.58342546", "0.58238477", "0.58238477", "0.5822934", "0.581415", "0.5813586", "0.58131236", ...
0.66241646
1
Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.
def _isA(self, elementClass, category = ''): if not isinstance(self, elementClass): return False if category and self.getCategory() != category: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subclassof(c, b):\n try:\n return issubclass(c, b)\n except TypeError:\n return False", "def is_subclass(parent_class, child_class_name):\n for child_class in parent_class.__subclasses__():\n if child_class.__name__ == child_class_name:\n return True\n return False...
[ "0.6687288", "0.6670129", "0.66446286", "0.6316864", "0.62128353", "0.610718", "0.6080735", "0.60664964", "0.60402757", "0.5992532", "0.59696436", "0.5941159", "0.58874506", "0.58874506", "0.5886609", "0.58573806", "0.58487344", "0.58478147", "0.57916117", "0.57669014", "0.56...
0.7002873
0
Set the typed value of an input by its name, creating a child element to hold the input if needed.
def _setInputValue(self, name, value, typeString = ''): method = getattr(self.__class__, "_setInputValue" + getTypeString(value)) return method(self, name, value, typeString)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def populate_field(self, name, value):\n locator = self._get_input_field_locator(name)\n self._populate_field(locator, value)", "def insert_by_name(name, val):\n try:\n name = driver.find_element_by_name(name)\n except Exception as e:\n raise(e)\n else:\n name.send_key...
[ "0.6696381", "0.60982335", "0.6062318", "0.58775914", "0.58670473", "0.5854426", "0.5842993", "0.583215", "0.57965046", "0.57965046", "0.5707237", "0.56931925", "0.5665919", "0.56397855", "0.56089824", "0.55845267", "0.5571821", "0.5554291", "0.552724", "0.5509192", "0.549337...
0.64479256
1
(Deprecated) Return a vector of all Parameter elements.
def _getParameters(self): warnings.warn("This function is deprecated; parameters have been replaced with uniform inputs in 1.38.", DeprecationWarning, stacklevel = 2) return list()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parameters_to_vector(self) -> np.ndarray:\n return nn.utils.parameters_to_vector(self.parameters()).detach().cpu().numpy()", "def parameters_list(self):\n return [getattr(self.parameters, p) for p in self.parameters_names()]", "def parameters(self) -> List[Parameter]:\n return self._pa...
[ "0.70164126", "0.69106805", "0.6909647", "0.6856145", "0.68113655", "0.68113655", "0.67872435", "0.6787241", "0.6785588", "0.6761088", "0.67584455", "0.6725566", "0.67151064", "0.66764146", "0.65993285", "0.6595009", "0.6587269", "0.6568346", "0.6563564", "0.65622544", "0.651...
0.697155
1
(Deprecated) Return the value string of a parameter by its name.
def _getParameterValueString(self, name): warnings.warn("This function is deprecated; parameters have been replaced with uniform inputs in 1.38.", DeprecationWarning, stacklevel = 2) return ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getParam(self, params, name):\n return params.get(name)", "def get_param_with_name(self, param_name):\n return self.params[param_name]", "def getParameter(self, name):", "def getSSMParam(name):\n return ssm_client.get_parameter(\n Name=name,\n WithDecryption...
[ "0.70329046", "0.687252", "0.6827756", "0.65972966", "0.65388006", "0.6500877", "0.64673096", "0.6371999", "0.6315599", "0.6314213", "0.62858284", "0.6270459", "0.62613076", "0.6259734", "0.62386006", "0.61926997", "0.6128117", "0.6123776", "0.6123158", "0.6096087", "0.606265...
0.7922667
0
(Deprecated) Add a BindInput to this shader reference.
def _addBindInput(self, name, type = DEFAULT_TYPE_STRING): warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2) return self.addInput(name, type)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _addBindParam(self, name, type = DEFAULT_TYPE_STRING):\n warnings.warn(\"This function is deprecated; shader references have been replaced with shader nodes in 1.38.\", DeprecationWarning, stacklevel = 2)\n return self.addInput(name, type)", "def _getBindInputs(self):\n warnings.warn(\"This function...
[ "0.7632342", "0.65786767", "0.573658", "0.5379098", "0.5296212", "0.5178297", "0.5159998", "0.5151385", "0.5066717", "0.49228904", "0.4916024", "0.48976418", "0.48940352", "0.48545158", "0.47804457", "0.47647017", "0.4753692", "0.47506797", "0.4747506", "0.47449464", "0.47333...
0.84288436
0
(Deprecated) Return a vector of all BindInput elements in this shader reference.
def _getBindInputs(self): warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2) return self.getInputs()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getBindParams(self):\n warnings.warn(\"This function is deprecated; shader references have been replaced with shader nodes in 1.38.\", DeprecationWarning, stacklevel = 2)\n return list()", "def _getBindTokens(self):\n warnings.warn(\"This function is deprecated; shader references have been replaced...
[ "0.7248788", "0.68201584", "0.61971897", "0.6057106", "0.6041571", "0.60374856", "0.60374856", "0.60374856", "0.6018457", "0.59155166", "0.5823089", "0.57687944", "0.5762386", "0.5726699", "0.5726699", "0.5726699", "0.5711171", "0.5709276", "0.5706087", "0.5700484", "0.568270...
0.83538413
0
(Deprecated) Add a BindParam to this shader reference.
def _addBindParam(self, name, type = DEFAULT_TYPE_STRING): warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2) return self.addInput(name, type)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _addBindInput(self, name, type = DEFAULT_TYPE_STRING):\n warnings.warn(\"This function is deprecated; shader references have been replaced with shader nodes in 1.38.\", DeprecationWarning, stacklevel = 2)\n return self.addInput(name, type)", "def _getBindParams(self):\n warnings.warn(\"This function...
[ "0.7179398", "0.6434004", "0.60884535", "0.6070172", "0.59735316", "0.5896598", "0.5733029", "0.5710626", "0.5708676", "0.5646252", "0.5533429", "0.55079865", "0.5417713", "0.53833014", "0.5378985", "0.5373941", "0.5350034", "0.5324678", "0.5298662", "0.52942353", "0.52673304...
0.8272173
0
(Deprecated) Return a vector of all BindParam elements in this shader reference.
def _getBindParams(self): warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2) return list()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getBindInputs(self):\n warnings.warn(\"This function is deprecated; shader references have been replaced with shader nodes in 1.38.\", DeprecationWarning, stacklevel = 2)\n return self.getInputs()", "def _getBindTokens(self):\n warnings.warn(\"This function is deprecated; shader references have bee...
[ "0.73175657", "0.697158", "0.6510387", "0.6437608", "0.6387305", "0.63770574", "0.63090634", "0.62420833", "0.6186843", "0.61844945", "0.61839473", "0.6061543", "0.60109484", "0.59970754", "0.59630865", "0.5951487", "0.59331584", "0.5922793", "0.58891183", "0.5887415", "0.586...
0.8280635
0
(Deprecated) Return a vector of all BindToken elements in this shader reference.
def _getBindTokens(self): warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2) return list()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getBindParams(self):\n warnings.warn(\"This function is deprecated; shader references have been replaced with shader nodes in 1.38.\", DeprecationWarning, stacklevel = 2)\n return list()", "def _getBindInputs(self):\n warnings.warn(\"This function is deprecated; shader references have been replaced...
[ "0.7346781", "0.71642834", "0.6264189", "0.6206269", "0.5697967", "0.5595624", "0.55848074", "0.5566121", "0.5566121", "0.5566121", "0.55017257", "0.54983807", "0.54983807", "0.5487443", "0.5385787", "0.53534365", "0.53367513", "0.5262191", "0.52297187", "0.5215819", "0.52116...
0.8395629
0
(Deprecated) Return a vector of all shader references in this material element.
def _getShaderRefs(self): warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2) return getShaderNodes(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getActiveShaderRefs(self):\n warnings.warn(\"This function is deprecated; shader references have been replaced with shader nodes in 1.38.\", DeprecationWarning, stacklevel = 2)\n return getShaderNodes(self)", "def shaders(self):\n\n shaders = []\n shaders.extend(self._verts)\n sha...
[ "0.7740527", "0.6775367", "0.6466401", "0.6452211", "0.6437122", "0.6314355", "0.62679857", "0.62556607", "0.6210403", "0.6105485", "0.596709", "0.5940758", "0.59146404", "0.5878404", "0.5871508", "0.5811813", "0.5789575", "0.57884926", "0.5763394", "0.57063866", "0.566444", ...
0.7934999
0
(Deprecated) Return a vector of all shader references in this material element, taking material inheritance into account.
def _getActiveShaderRefs(self): warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2) return getShaderNodes(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getShaderRefs(self):\n warnings.warn(\"This function is deprecated; shader references have been replaced with shader nodes in 1.38.\", DeprecationWarning, stacklevel = 2)\n return getShaderNodes(self)", "def shaders(self):\n\n shaders = []\n shaders.extend(self._verts)\n shaders.e...
[ "0.757915", "0.66297746", "0.62730986", "0.61996865", "0.61774623", "0.6176948", "0.60849196", "0.60422945", "0.5975865", "0.5874039", "0.5874017", "0.5842542", "0.58101964", "0.57584727", "0.57190543", "0.56604165", "0.56526685", "0.5576169", "0.5570131", "0.55684435", "0.55...
0.7411408
1
Set the value of a geomprop by its name, creating a child element to hold the geomprop if needed.
def _setGeomPropValue(self, name, value, typeString = ''): method = getattr(self.__class__, "_setGeomPropValue" + getTypeString(value)) return method(self, name, value, typeString)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_simple(parent, name, value):\n element = parent.find('./' + name) \n\n if element is None:\n element = ET.SubElement(parent, name)\n element.text = value\n else:\n element.text = value", "def add_geomean_to_product_data(product, prop_name, geomean_val):\n\tfor prop_data_list in product['da...
[ "0.56408846", "0.53583366", "0.5214419", "0.5200524", "0.5169286", "0.5159845", "0.5102088", "0.50392735", "0.50278354", "0.5018636", "0.49757773", "0.49757773", "0.49658227", "0.49325004", "0.48699766", "0.4865401", "0.48650134", "0.4847803", "0.48443377", "0.48255238", "0.4...
0.5464608
1
(Deprecated) Add a material element to the document.
def _addMaterial(self, name): warnings.warn("This function is deprecated; call Document.addMaterialNode() instead.", DeprecationWarning, stacklevel = 2) return self.addMaterialNode(name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def AddMaterial(self, *args):\n return _XCAFDoc.XCAFDoc_MaterialTool_AddMaterial(self, *args)", "def append_material(self, material):\n # First check if asset attribute exists; if not, define the asset attribute\n if not hasattr(self, \"asset\"):\n self.asset = ET.Element(\"asset\...
[ "0.7026196", "0.6792848", "0.667132", "0.59274834", "0.5922771", "0.5812614", "0.57446635", "0.5629134", "0.5546216", "0.55392534", "0.5464084", "0.5419899", "0.53916496", "0.53648096", "0.53525424", "0.53359", "0.53133327", "0.5275986", "0.51976895", "0.51882774", "0.5178728...
0.8210709
0
(Deprecated) Return a vector of all materials in the document.
def _getMaterials(self): warnings.warn("This function is deprecated; call Document.getMaterialNodes() instead.", DeprecationWarning, stacklevel = 2) return self.getMaterialNodes()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info_materials_polymer_get():\n materials = _material_by_group(974) # 974 == intermediate group\n return materials, 200", "def info_materials_get():\n materials = _material_by_group() # empty means all groups\n return materials, 200", "def info_materials_raw_get():\n materials = _material_by...
[ "0.72720134", "0.7060891", "0.67700535", "0.6652309", "0.6613427", "0.64064366", "0.638908", "0.63752085", "0.63551617", "0.633049", "0.62788475", "0.6175576", "0.6156727", "0.6118103", "0.61163384", "0.601052", "0.59336454", "0.57874507", "0.5771847", "0.57317346", "0.571983...
0.7945748
0
Return the default data search path.
def getDefaultDataSearchPath(): return FileSearchPath(os.path.dirname(__file__))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_default_path(self):\n return os.path.join(cfg.DATA_DIR, 'vehicles_dataset_v{}'.format(self._version))", "def default_data_dir(self):\n return self._default_data_dir", "def _get_default_path(self):\n return os.path.join(cfg.DATA_DIR, 'visual_genome')", "def _get_default_path(self):\n...
[ "0.8129479", "0.8007878", "0.79695016", "0.79296505", "0.7858564", "0.7470226", "0.743667", "0.7417918", "0.74098426", "0.74098426", "0.7362305", "0.7316143", "0.72809714", "0.72342837", "0.72125745", "0.7184736", "0.7136621", "0.70106024", "0.69430655", "0.6912006", "0.68595...
0.8906264
0
Return list of default data library folders
def getDefaultDataLibraryFolders(): return [ 'libraries' ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_default_paths():\n DATA_ROOT = os.environ.get(\"DATA_ROOT\", \"data\")\n defaults = {\n \"TOKENIZE_DATA_DIR\": DATA_ROOT + \"/tokenize\",\n \"MWT_DATA_DIR\": DATA_ROOT + \"/mwt\",\n \"LEMMA_DATA_DIR\": DATA_ROOT + \"/lemma\",\n \"POS_DATA_DIR\": DATA_ROOT + \"/pos\",\n ...
[ "0.717137", "0.70716625", "0.6955009", "0.6915999", "0.68801606", "0.68446493", "0.6835322", "0.6751219", "0.66922414", "0.6663725", "0.66411805", "0.66054195", "0.6547148", "0.65449494", "0.65448755", "0.6523286", "0.649509", "0.64830816", "0.6471197", "0.6460034", "0.644567...
0.89339906
0
Get a list of objects labeled as frame guides in the current 3D scene.
def get_guides(data): return data.groups["Frames"].objects
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getBrailleRegionsForAnimation(self, obj):\n\n self._debugGenerator(\"_getBrailleRegionsForAnimation\", obj)\n\n text = \"\"\n text = self._script.appendString(\n text, self._script.getDisplayedLabel(obj))\n text = self._script.appendString(\n text, self._scrip...
[ "0.56232345", "0.5550209", "0.5408272", "0.5292358", "0.52791625", "0.5228657", "0.5212502", "0.5169032", "0.5049105", "0.50468457", "0.5031301", "0.50303346", "0.49700224", "0.49568957", "0.49561343", "0.49337798", "0.4922755", "0.49168405", "0.48798805", "0.48694423", "0.48...
0.639492
0
Get the reference frame type corresponding to a particular guide.
def get_guide_type(guide): # Maintained by naming convention in the Blender files. Sub-optimal. try: return guide.name[guide.name.rindex(".") + 1:] except: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getComponentType(cls):\n\n return 'Guide'", "def getComponentType(cls):\n\n return 'Guide'", "def get_typ(self, refobj):\n enum = cmds.getAttr(\"%s.type\" % refobj)\n try:\n return JB_ReftrackNode.types[enum]\n except IndexError:\n raise ValueError(\...
[ "0.5693369", "0.5693369", "0.5446423", "0.5337169", "0.53119755", "0.529872", "0.52709115", "0.5264755", "0.5190898", "0.5159653", "0.51567864", "0.5133397", "0.50048554", "0.49838355", "0.49712083", "0.49645618", "0.48794225", "0.48541024", "0.48476246", "0.4845618", "0.4842...
0.7534499
0
Randomize the position of an object `obj` along some linear guide path `guide`.
def randomize_position(obj, guide): p1, p2 = get_guide_endpoints(guide) t = random.random() target_point = p1 + t * (p2 - p1) # update X and Y coordinates. obj.location[0] = target_point[0] obj.location[1] = target_point[1] return t
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def randomize_distance(obj, guide, scale_bounds=(-2, 0)):\n p1, p2 = get_guide_endpoints(guide)\n midpoint = p1 / 2 + p2 / 2\n\n # Get vector perpendicular to the guide.\n diff_rot = Matrix.Rotation(math.pi / 2, 3, 'Z') * (p2 - p1)\n\n scale_factor = scale_bounds[0] + random.random() * (scale_bounds...
[ "0.72296953", "0.55692446", "0.5526078", "0.5247486", "0.52031153", "0.51109755", "0.509799", "0.50979686", "0.5030604", "0.49457812", "0.49372828", "0.49313664", "0.49087912", "0.48839825", "0.48837227", "0.48356238", "0.4801894", "0.47983634", "0.47845507", "0.47785735", "0...
0.82932264
0
Center the position of an object `obj` along a linear guide path `guide`, and randomize its distance on the axis perpendicular to that guide.
def randomize_distance(obj, guide, scale_bounds=(-2, 0)): p1, p2 = get_guide_endpoints(guide) midpoint = p1 / 2 + p2 / 2 # Get vector perpendicular to the guide. diff_rot = Matrix.Rotation(math.pi / 2, 3, 'Z') * (p2 - p1) scale_factor = scale_bounds[0] + random.random() * (scale_bounds[1] - scale_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def randomize_position(obj, guide):\n p1, p2 = get_guide_endpoints(guide)\n t = random.random()\n target_point = p1 + t * (p2 - p1)\n\n # update X and Y coordinates.\n obj.location[0] = target_point[0]\n obj.location[1] = target_point[1]\n\n return t", "def center(self, obj):\n mn0 = ...
[ "0.7362369", "0.5656115", "0.5133738", "0.4947574", "0.49140757", "0.4901315", "0.4811237", "0.46052918", "0.4575708", "0.45413876", "0.4496817", "0.44632584", "0.4445101", "0.44152486", "0.44121188", "0.44050354", "0.43854836", "0.43493664", "0.43398598", "0.43357167", "0.43...
0.75807685
0
Move candidate referents to random positions in the given reference frames. `candidate_setting` is of the form `[(person, guide_path), (person2, guide_path), ...]`
def prepare_scene(data, candidate_setting, randomization_mode): manipulations = defaultdict(dict) for person, guide in candidate_setting.items(): if randomization_mode == "none": # Center the candidate along the guide. p1, p2 = get_guide_endpoints(guide) target = p1 /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def switch_points(mutated_genome,index):\n point_index1 = random.randint(0,max(0,len(mutated_genome[index][2])-1))\n point_index2 = random.randint(0,max(0,len(mutated_genome[index][2])-1))\n temp = mutated_genome[index][2][point_index1]\n mutated_genome[index][2][point_index1] = mutated_genome[index][2][po...
[ "0.6009613", "0.53904885", "0.5373188", "0.5336502", "0.52867323", "0.52322876", "0.51420814", "0.51346767", "0.50901896", "0.5086578", "0.49775714", "0.49687153", "0.4933418", "0.4913252", "0.48939452", "0.48697948", "0.48356456", "0.4826306", "0.4824639", "0.48112273", "0.4...
0.5655333
1
Allows leastsq to take bounds if minimize function is missing.
def myleastsq(errfunc0,x0,args=None,bounds=None,**exkw): from scipy import optimize if hasattr(optimize,'minimize'): def errfunc(x,*iargs): return sum(errfunc0(x,*iargs)**2) if args is not None: exkw['args'] = args res = optimize.minimize(errfunc,x0[:],bounds=bounds,**exkw) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def leastsqbound(func,x0,bounds,args=(),**kw):\n # check for full output\n if \"full_output\" in kw and kw[\"full_output\"]:\n full=True\n else:\n full=False\n\n # convert x0 to internal variables\n i0 = external2internal(x0,bounds)\n\n # perfrom unconstrained optimization using int...
[ "0.7573677", "0.6523712", "0.6448234", "0.6322002", "0.6261192", "0.625652", "0.6225058", "0.62234515", "0.61956996", "0.61218625", "0.6083507", "0.6068286", "0.6016386", "0.60070544", "0.5992043", "0.5962499", "0.5946215", "0.5920246", "0.58964807", "0.58740616", "0.5871715"...
0.71415097
1
Returns spherical radii for provided volumes.
def sphrad(vol): return (3.*vol/(4.*np.pi))**(1./3.)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sphere_volume(r):\n return (4/3) * 3.14159 * r**3", "def sphere_volume(r):\n\treturn 4/3. * math.pi * r ** 3", "def sphere_volume(radius : number) -> number:\n volume = 4/3*(pi*radius*radius*radius)\n return volume", "def sphere_volume(sphere_radius):\n return (4 / 3 * np.pi * sphere_radius**...
[ "0.70751446", "0.69737434", "0.69169736", "0.6792967", "0.6701074", "0.66413015", "0.6604082", "0.6572043", "0.63632387", "0.62836486", "0.62836486", "0.62725145", "0.613928", "0.6092999", "0.6058674", "0.5973587", "0.5946293", "0.59038186", "0.5898153", "0.5847563", "0.58467...
0.71128243
0
Change Karma Make sure that the user can make a karma change using rate limiting and return whether or not the karma value was added or changed
def _change_karma(self, name, change): can_change = self._apply_rate_limit() if not can_change: return False res = self.bot.db.execute('SELECT target, karma FROM karma') for target in res.fetchall(): if target[0].lower() == name.lower(): self.bot.db.execute('U...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _change_karma(self, nick, target, mode):\n if nick == target:\n return \"You can't modify your own karma.\"\n if target in self.karma and (datetime.datetime.now() -\n self.karma[target][2]).seconds < 5:\n return 'Karma spamming is prohibited.'\n if not ...
[ "0.69934213", "0.6468223", "0.61024314", "0.6042686", "0.60205877", "0.59011203", "0.5773027", "0.5760536", "0.572008", "0.56760347", "0.56500137", "0.5561731", "0.53875303", "0.5348932", "0.53422016", "0.52225053", "0.5194737", "0.518642", "0.5163019", "0.51595706", "0.51449...
0.7706274
0
Apply Rate Limit Check how frequently the current user has run karma commands and, if they exceed a certain threshold (30 seconds) return False so they don't make any karma changes
def _apply_rate_limit(self): update_time = time() user_name = self.bot.user.full_name if user_name in self.tokens.keys(): last_change = self.tokens[user_name][0] # Add 1 token for every 30 seconds from the last change added_tokens = int((update_time - last_cha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _safe_limit_check(self):\n if self.rem == 40:\n self.time_start = time.time()\n elif time.time() - self.time_start >= 11:\n self.rem = 40\n self.time_start = time.time()\n elif self.rem <= 0:\n t = 11 - (time.time() - self.time_start)\n\n ...
[ "0.62723166", "0.61897874", "0.6130558", "0.594389", "0.5937632", "0.59163153", "0.5882192", "0.5846787", "0.5845753", "0.57633436", "0.57333547", "0.5716136", "0.57108897", "0.57000345", "0.5694648", "0.5694648", "0.56865287", "0.5670449", "0.56523293", "0.56270933", "0.5619...
0.65764576
0
Compute the total duty percentage for each purchase line. there is an extra duty for some vendors.If the 'extra_duty' field's value is true,then we use a duty perc(0.288 most probably) for each 144 qtys
def compute_total_customs_duty(self): for rec in self: total = 0.0 extra_duty = 0.0 price_total = rec.quantity * rec.unit_price # total = (price_total * duty_percentage)/100 rec.price_total = price_total # for hts in rec.hts_ids: # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_duty_percentage(self):\n container_line_ids = self\n hbl_customs_obj = self.env['hbl.customs.duty']\n for line in container_line_ids:\n p_line = line.purchase_line\n #Get the supplier from product by using po supplier id.\n product_supplier_id = p_line....
[ "0.7884601", "0.5777692", "0.56619155", "0.5644612", "0.5609361", "0.5539036", "0.54949725", "0.54502136", "0.5393716", "0.5389697", "0.53487086", "0.52970153", "0.5285339", "0.5277346", "0.5261509", "0.5249308", "0.5240147", "0.5224184", "0.52226484", "0.5192483", "0.5178316...
0.78766584
1
Get information related to a specific Smart Group. Get information related to a specific Smart Group.
def get_by_id( self, smart_group_id, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.get_by_id.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(isamAppliance, id, check_mode=False, force=False):\n return isamAppliance.invoke_get(\"Retrieving group\", \"/sysaccount/groups/{0}/v1\".format(id))", "def show_group(self, group_id):\n\n return Client._get(self, id=group_id)", "def get_group_details(self, group_id):\n url = self.group...
[ "0.6050466", "0.604989", "0.60478085", "0.60230494", "0.60096216", "0.60058165", "0.5988405", "0.59130573", "0.59111917", "0.58686566", "0.5820906", "0.58130544", "0.5768425", "0.575321", "0.57311463", "0.57198733", "0.57059264", "0.56633234", "0.5633848", "0.5626244", "0.561...
0.6301686
0
Get the history a smart group, which captures any Smart Group state changes (New/Acknowledged/Closed) .
def get_history( self, smart_group_id, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.get_history.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def network_history(request, SPIC_group, SPIC_id):\n SPIC_obj = get_object_or_404(SPIC, group=SPIC_group, local_id=SPIC_id)\n network_list = Network.objects.filter(user_id=request.user.pk, SPIC=SPIC_obj).order_by(\"-local_id\")\n\n return {'SPIC_obj': SPIC_obj, 'network_list': network_list}", "def get_h...
[ "0.59609723", "0.59375453", "0.5827547", "0.5729176", "0.568817", "0.5650969", "0.56454545", "0.563896", "0.5626192", "0.5599211", "0.55906564", "0.5589627", "0.55577046", "0.5528631", "0.55192196", "0.54704773", "0.54695994", "0.5442508", "0.5441003", "0.5439692", "0.5434865...
0.6507963
0
Attenuators out, beamstop in,
def alignment_stop(): smi = SMI_Beamline() yield from smi.modeMeasurement() proposal_id('2023_2', '311564_Pettersson')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def beam_align():\n\n # do nothing if there is a sample mounted to avoid collisions\n if smart_magnet.sample_detect.get() == 0:\n raise Exception(\"Sample mounted on gonio! Avoided collision\")\n\n # wait for attenuators to finish moving\n yield from bps.abs_set(mxatten, 0.002)\n yield from b...
[ "0.59246117", "0.53664815", "0.5361966", "0.52839315", "0.5274596", "0.5259131", "0.52420837", "0.51933676", "0.51914835", "0.51529115", "0.5128894", "0.5128894", "0.5128894", "0.5128894", "0.50962025", "0.50304735", "0.5025527", "0.49930224", "0.49781093", "0.49603343", "0.4...
0.5679036
1
RE(run_loop_measurement(t=1, name='1bl_PEI_10mM', loops=7, pump_t=210, total_t=720, jump_x=10)) Take measurements in the loop Sample has to be aligned before starting the script and theta angle at 0 deg (flat sample).
def run_loop_measurement(t=0.5, name='test', loops=4, pump_t=180, total_t=600, jump_x=10): incident_angles = [0.1, 0.4] waxs_arc = [20, 0] user = "TP" condition = ( ( -1 < waxs.arc.position ) and ( waxs.arc.position < 1 ) and (waxs_arc[0] == 20) ) if condition: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_multiobjective(inputs, parameters = None):\n def thickness(x, t, chord):\n y = af.Naca00XX(chord, t, [x], return_dict = 'y')\n thickness_at_x = y['u'] - y['l']\n return thickness_at_x \n\n if parameters != None:\n eng = parameters[0]\n import_matlab = False\n els...
[ "0.5746817", "0.5685441", "0.5681871", "0.5642942", "0.5569622", "0.55403596", "0.5525413", "0.55203384", "0.5511839", "0.545532", "0.5445678", "0.5411594", "0.54065305", "0.54041046", "0.53374296", "0.53127813", "0.52985483", "0.52948815", "0.5291056", "0.52908057", "0.52744...
0.7498953
0
LZW komprese dict_of_abc je vstupni slovnik dat na kazdem indexu slovniku je list v prubehu komprese se do nej pridavaji polozky list_of_data je posloupnost cisel ke kompresi
def do_LZW_Compression(dict_of_abc, list_of_data): # rozdil mezi None a [] je v pouziti metody extend na listu result = [] P = [] C = [] # C je vzdy jeden prvek ze vstupu PC = [] #how it works video xplanation https://www.youtube.com/watch?v=MQ4ObKv2L_M for i in range(len...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_LZW_DeCompression(dict_of_abc, list_of_data):\n \n #https://www.youtube.com/watch?v=MQM_DsX-LBI\n \n out = []\n predchozi_out = []\n for i in range(len(list_of_data)):\n new = []\n new.extend(predchozi_out)\n if list_of_data[i] in dict_of_abc:\n o = dict_of_...
[ "0.81415105", "0.5463324", "0.5255911", "0.51981646", "0.51777226", "0.5148649", "0.5143358", "0.51358664", "0.5128433", "0.5083292", "0.5054639", "0.5033062", "0.50319797", "0.5004983", "0.49983892", "0.49932218", "0.49870348", "0.498288", "0.49821144", "0.49720147", "0.4967...
0.785483
1
LZW Dekomprese dict_of_abc je vstupni slovnik dat na kazdem indexu slovniku je list v prubehu komprese se do nej pridavaji polozky list_of_data je posloupnost cisel pro dekompresi
def do_LZW_DeCompression(dict_of_abc, list_of_data): #https://www.youtube.com/watch?v=MQM_DsX-LBI out = [] predchozi_out = [] for i in range(len(list_of_data)): new = [] new.extend(predchozi_out) if list_of_data[i] in dict_of_abc: o = dict_of_abc[list_of_dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_LZW_Compression(dict_of_abc, list_of_data):\n \n # rozdil mezi None a [] je v pouziti metody extend na listu\n \n result = []\n P = []\n C = [] # C je vzdy jeden prvek ze vstupu\n PC = []\n \n #how it works video xplanation https://www.youtube.com/watch?v=MQ4ObKv2L_M\n \n fo...
[ "0.7625661", "0.5576687", "0.5428306", "0.5259145", "0.52158284", "0.5127516", "0.51260525", "0.51113755", "0.5106959", "0.50973123", "0.507302", "0.5056697", "0.50454503", "0.50228345", "0.5017704", "0.49628225", "0.49544364", "0.4946142", "0.49108753", "0.49073184", "0.4903...
0.81224066
0
dict_of_abc vypada napriklad takto
def dict_cointains_list(dict_of_abc, item_list): values = list(dict_of_abc.values()) #projdu vsecky listy ve slovniku for i in range(len(values)): #predpokladam ze ve slovniku je finded = True for j in range(len(values[i])): if len(item_list) == len(values[i]):...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_cases_for_dict(self):\n pass", "def init_dict() -> None:\n for elem in letters:\n ascii_dict[elem] = []\n for elem in numbers:\n ascii_dict[elem] = []\n for elem in symbols:\n ascii_dict[elem] = []", "def dictogram_dictlist(self):\n for key, value in sel...
[ "0.59698254", "0.5688297", "0.56781894", "0.56143355", "0.5542839", "0.5520396", "0.5489875", "0.5482796", "0.5428855", "0.54169875", "0.5414742", "0.54147077", "0.5387781", "0.5383238", "0.53804624", "0.5378157", "0.53751314", "0.533766", "0.53338116", "0.5317185", "0.530112...
0.61399186
0
Returns a double, the average number of days between the rating objects specified in the list parameter.
def get_diffs_of_ratings(l): if len(l) <= 1: return str(None) total = 0.0 for v in range(0, len(l)-1): total = total + float((l[v+1]["date"] - l[v]["date"]).days) return str(float(total / (len(l)-1)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def avg(list):\n return sum(list) / len(list)", "def dishlist_avg_cal(n:list)->float:\r\n all_cal = dishlist_cal(n)\r\n return sum(all_cal)/len(all_cal)", "def average_rating(business_list):\n\tratings = []\n\ttry:\n\t\tfor b in business_list:\n\t\t\tratings.append(b['rating'])\n\texcept KeyError:\n\t...
[ "0.68933636", "0.66389376", "0.6581203", "0.65615976", "0.65188193", "0.6491516", "0.64800775", "0.64580154", "0.6454823", "0.6444565", "0.6435506", "0.64231765", "0.64099354", "0.63959163", "0.6393575", "0.63914645", "0.63865495", "0.63710004", "0.6341628", "0.6338856", "0.6...
0.6772968
1
Load truncation parameters from config or container defaults.
def _get_params(self, container): if container in TRUNC_SPEC: self.log.info("Truncating from preset for container {}".format(container)) for key in [ "dataset", "weight_dataset", "fixed_precision", "variance_increase", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _setupConfigAnnotation(self):\n annotations = IAnnotations(self)\n settings = annotations.get(\"PLOMINOFIELDCONFIG\", None)\n if not settings:\n annotations[\"PLOMINOFIELDCONFIG\"] = PersistentDict()", "def _load_hyperopt_config(self, config: Dict[str, Any]) -> Dict[str, Any]:...
[ "0.5405735", "0.5393666", "0.5269585", "0.5220231", "0.5169489", "0.5156765", "0.5130496", "0.5035296", "0.50338167", "0.5030548", "0.49979058", "0.49922258", "0.498201", "0.4959689", "0.4950035", "0.49354002", "0.4933724", "0.49333996", "0.4876323", "0.485839", "0.48395112",...
0.7070541
0
Return a telescope object out of the input (either `ProductManager`, `BeamTransfer` or `TransitTelescope`).
def get_telescope(obj): from drift.core import telescope try: return get_beamtransfer(obj).telescope except RuntimeError: if isinstance(obj, telescope.TransitTelescope): return obj raise RuntimeError("Could not get telescope instance out of %s" % repr(obj))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_beamtransfer(obj):\n from drift.core import manager, beamtransfer\n\n if isinstance(obj, beamtransfer.BeamTransfer):\n return obj\n\n if isinstance(obj, manager.ProductManager):\n return obj.beamtransfer\n\n raise RuntimeError(\"Could not get BeamTransfer instance out of %s\" % re...
[ "0.59094083", "0.55723965", "0.52075577", "0.49067524", "0.4869637", "0.47760263", "0.46497482", "0.46300894", "0.45779586", "0.45738086", "0.4571514", "0.4460605", "0.44365323", "0.4436234", "0.44346416", "0.44056034", "0.43759432", "0.43554714", "0.4353904", "0.43461516", "...
0.7030609
0
Return a BeamTransfer object out of the input (either `ProductManager`, `BeamTransfer`).
def get_beamtransfer(obj): from drift.core import manager, beamtransfer if isinstance(obj, beamtransfer.BeamTransfer): return obj if isinstance(obj, manager.ProductManager): return obj.beamtransfer raise RuntimeError("Could not get BeamTransfer instance out of %s" % repr(obj))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup(self):\n\n import os\n\n from drift.core import beamtransfer\n\n if not os.path.exists(self.product_directory):\n raise RuntimeError(\"BeamTransfers do not exist.\")\n\n bt = beamtransfer.BeamTransfer(self.product_directory)\n\n tel = bt.telescope\n\n ...
[ "0.5573253", "0.50620794", "0.49997687", "0.4947898", "0.48023778", "0.48023617", "0.47191608", "0.47186506", "0.46855393", "0.46065444", "0.4585532", "0.4478559", "0.4471264", "0.445144", "0.44428593", "0.44386634", "0.4436773", "0.44343606", "0.44192073", "0.44131085", "0.4...
0.76120263
0
The main function that finds all solutions for a single clue. Uses parser to find all possible parse trees, then calls the solving function for each parsing tree according to its clue type. Returns an ordered list of all possible solutions with score > MIN_SOLUTION VALUE
def solve(clue, solution_format): # Define parser grammar_str = GrammarDefinitions.define_grammar(clue) grammar = nltk.CFG.fromstring(grammar_str) parser = nltk.ChartParser(grammar) solutions = [] # Get all possible solutions for tree in parser.parse(clue): _handle_abbreviations(tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showSolution(bestTree)->list:\r\n bestSon = bestTree\r\n solved = bestTree.value\r\n minDepth = bestTree.depth\r\n solution = []\r\n while bestSon.sons:\r\n #print(bestSon.state)\r\n solution.append(bestSon.state)\r\n bestSon = getBestSon(bestSon, minDepth)\r\n #print(bes...
[ "0.6172393", "0.6126036", "0.61067355", "0.59318", "0.5886695", "0.5886695", "0.5886695", "0.58592933", "0.5837581", "0.57652533", "0.570048", "0.5684845", "0.56494737", "0.56355613", "0.56352055", "0.5631747", "0.5605624", "0.5603883", "0.55791163", "0.5574826", "0.5563982",...
0.6631623
0
Solver for double synonym clues
def _solve_double_synonym(parse_tree, solution_format=None): def _get_value(solution_list, word): # Gets the value of a word in a solution list for solution in solution_list: if solution[0] == word: return solution[1] return 0 # Get the two synonym parts ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solve(self):", "def test_synonym(self): \n pass", "def test_syndome_LUT(self):\r\n syns = []\r\n errvecs = golay._make_3bit_errors()\r\n for errvec in errvecs:\r\n syn = tuple(numpy.mod(numpy.dot(errvec, golay.DEFAULT_H.T), 2))\r\n syns.append(syn)\r\n ...
[ "0.60946655", "0.60578865", "0.60223013", "0.5942013", "0.58613205", "0.58297867", "0.58198977", "0.5809236", "0.571314", "0.57117873", "0.5688526", "0.56218284", "0.56218284", "0.55990916", "0.5592245", "0.557801", "0.55571336", "0.55550945", "0.55278677", "0.5526694", "0.55...
0.7369051
0
Solver for anagram clues
def _solve_anagram(parse_tree, solution_format=None): anag, syn = _get_parts_ignore_EQU(parse_tree) # Get the anagramed word anag_word = anag[0] if not anag_word.label() == 'ANAG_WORD': anag_word = anag[1] anag_word = _create_sentence(anag_word, space=False) syn_sent = _create_sentence...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solution(s):", "def anagram(s):\n minchanges = 0\n\n if len(s) % 2 == 1:\n return -1\n else:\n word1 = s[0:len(s) // 2]\n word2 = s[len(s) // 2:]\n print(word1, word2)\n c1 = Counter(word1)\n for letter in word2:\n if c1[letter] > 0:\n ...
[ "0.66833496", "0.65617925", "0.6440984", "0.63482744", "0.6340745", "0.62304044", "0.6203706", "0.6193661", "0.6119746", "0.6078559", "0.60522294", "0.60006964", "0.5970734", "0.5944802", "0.59298414", "0.592687", "0.58776724", "0.5774756", "0.57737607", "0.57636297", "0.5762...
0.6842031
0
Solver for hidden word clues
def _solve_hidden_word(parse_tree, solution_format=None): hidden, syn = _get_parts_ignore_EQU(parse_tree) # Get the hiding word hiding_word = hidden[0] if not hiding_word.label() == 'HID_WORD': hiding_word = hidden[1] hiding_word = _create_sentence(hiding_word, space=False) syn_sent =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_clues(self):\r\n print(\"\\n************Searching Clues************\\n\")\r\n for word_id in self.words.keys():\r\n if not self.words[word_id].see and not self.words[word_id].wth:\r\n clue = pop_backslash(self.words[word_id].clue)\r\n temp = word_d...
[ "0.62825", "0.621615", "0.59519327", "0.59129626", "0.59106004", "0.5901776", "0.58596104", "0.5811822", "0.5787408", "0.5749001", "0.5749001", "0.5701069", "0.5651413", "0.56111234", "0.56057537", "0.5567448", "0.5547416", "0.55322987", "0.552673", "0.552673", "0.55166656", ...
0.6624858
0
Given a parse tree with 2 parts, with a possible EQU part in the middle, finds the synonym part and the other part
def _get_parts_ignore_EQU(parse_tree): first_part = parse_tree[0] second_part = parse_tree[1] if second_part.label() == 'EQU': second_part = parse_tree[2] if first_part.label() == 'SYN': syn = first_part other = second_part else: syn = second_part other = fir...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _solve_double_synonym(parse_tree, solution_format=None):\n def _get_value(solution_list, word):\n # Gets the value of a word in a solution list\n for solution in solution_list:\n if solution[0] == word:\n return solution[1]\n\n return 0\n\n # Get the two syn...
[ "0.6501454", "0.59847134", "0.57638747", "0.56675124", "0.56613374", "0.54569155", "0.54319113", "0.5426494", "0.539753", "0.5339401", "0.53225523", "0.5321102", "0.5310823", "0.5307761", "0.52566755", "0.5253671", "0.5250814", "0.5199034", "0.51778674", "0.5174493", "0.51710...
0.6401357
1
Parses the abbreviation file to find all possible abbreviations, then calls helper function to update the tree
def _handle_abbreviations(parse_tree): path = os.path.join(GrammarDefinitions.FOLDER, GrammarDefinitions.ABBREVIATION_FILE) with open(path, "r") as f: lines = f.read().splitlines() abbr_dict = {line.split(GrammarDefinitions.ABBR_SEP)[0]: line.split(GrammarDefinitions.ABBR_SEP)[1] for line in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _replace_abbreviation(parse_tree, abbr_dict):\n if not isinstance(parse_tree, nltk.Tree):\n # Reached a leaf\n return\n\n if parse_tree.label() == 'ABBR':\n # Replace word with its abbreviation\n word = parse_tree[0]\n parse_tree.set_label('WORD')\n parse_tree[0]...
[ "0.6594188", "0.64209026", "0.6191263", "0.6113771", "0.59502375", "0.59138536", "0.58576477", "0.5774968", "0.56978416", "0.5646811", "0.5631029", "0.5490518", "0.54843515", "0.54673076", "0.54151493", "0.5384615", "0.53294075", "0.51091653", "0.5101626", "0.50498986", "0.50...
0.7767338
0
Updates the given tree by replacing the word with its abbreviated form
def _replace_abbreviation(parse_tree, abbr_dict): if not isinstance(parse_tree, nltk.Tree): # Reached a leaf return if parse_tree.label() == 'ABBR': # Replace word with its abbreviation word = parse_tree[0] parse_tree.set_label('WORD') parse_tree[0] = abbr_dict[w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def abbreviate(match_tree, statement):\n\n result = statement\n current_node = match_tree\n for position, letter in enumerate(statement.upper()):\n current_node = current_node.get(letter)\n if not isinstance(current_node, dict):\n if isinstance(current_node, str):\n ...
[ "0.64932525", "0.60075444", "0.6002033", "0.5950056", "0.5884344", "0.5873636", "0.58596784", "0.5755214", "0.5720153", "0.57188857", "0.5702307", "0.57001936", "0.5692823", "0.56882954", "0.5668327", "0.5638983", "0.5637053", "0.5602583", "0.55859566", "0.55837816", "0.55621...
0.75555784
0
Creates a common python list of object, no matter what information are supported by the parsed xml file for test results junit().
def parse(self): def parse_testcase(xml_object): testcase = xml_object tc_dict = { "classname": testcase.attrib.get("classname", "unknown"), "file": testcase.attrib.get("file", "unknown"), "line": int(testcase.attrib.get("line", -1)), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data(self):\n try:\n data = etree.parse(self.resultfilename).getroot()\n except OSError:\n data = []\n\n testresults = []\n for testcase in data:\n category = Category.OK\n status = 'ok'\n module = testcase.get('classname')...
[ "0.6335188", "0.5985103", "0.59026104", "0.5846985", "0.57126236", "0.56514776", "0.5649591", "0.56286633", "0.5615803", "0.5615803", "0.5605953", "0.55911666", "0.5566683", "0.5566683", "0.5559948", "0.55295116", "0.54831856", "0.54688597", "0.54634106", "0.54622257", "0.544...
0.6112433
1
Manual assignment of a (stopped) times object as a subdivision of running timer. Use cases are expected to be very limited (mainly provided as a oneTimes variant of attach_par_subdivision).
def attach_subdivision(times): t = timer() if not isinstance(times, Times): raise TypeError("Expected Times object for param 'times'.") assert times.total > 0., "Attached subdivision has total time 0, appears empty." name = times.name f.r.self_agg += times.self_agg if name not in f.t.sub...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_interval_sub(self, time_step, nsteps):\n world.subtime = TimeAxis(0.0, int(nsteps), float(time_step))\n print(\"Setting subtime\")", "def __set_time_elements(*args):\n args[0].TimeState.delay_elements = args[1]\n args[0].TimeState.set_delay_elements()", "def time_interval_prop(self, time_s...
[ "0.6630454", "0.6081781", "0.5878871", "0.5870936", "0.5784389", "0.57493865", "0.5726583", "0.5696444", "0.56729144", "0.5598866", "0.558305", "0.5582902", "0.55632716", "0.54817516", "0.54677033", "0.5444429", "0.5438984", "0.54319745", "0.5367586", "0.53596765", "0.5350131...
0.6671484
0
Serialize and / or save a Times data object using pickle (cPickle).
def save_pkl(filename=None, times=None): if times is None: if not f.root.stopped: times = collapse.collapse_times() else: times = f.root.times else: if isinstance(times, (list, tuple)): for t in times: if not isinstance(t, Times): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize(self): \n with open(self.path+self.name, \"wb\") as pfile:\n pickle.dump(self.pyObj, pfile)", "def pickle(self,data,filename):\n pickle.dump(data, open(filename, 'wb'))", "def saveData(self): \n self.spIndex.close()\n output = open(PublicTransit.PICK...
[ "0.63484544", "0.60688585", "0.60613865", "0.60561633", "0.5997063", "0.5942309", "0.59148747", "0.590097", "0.58997315", "0.5889424", "0.58798075", "0.58791673", "0.5864843", "0.5844835", "0.5821112", "0.5819759", "0.580201", "0.5794824", "0.57903945", "0.57628703", "0.57584...
0.6815023
0
This method validates the input file. Returns true if the JSON is valid, false otherwise.
def validate_input(update_file): try: json.load(open(update_file)) print "\nValid JSON" return True except ValueError: print "\nInvalid JSON" exit(-1) return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_input(update_file):\n try:\n json.load(open(update_file))\n #print \"Valid JSON\"\n return True\n except ValueError:\n print \"Invalid JSON. Exiting.\"\n exit(-1)\n return False", "def valid_is_json(self):\n return self.file_name.endswith('.json...
[ "0.81748825", "0.7770329", "0.76431674", "0.7455964", "0.7199138", "0.71282756", "0.7009667", "0.6992463", "0.69263047", "0.6873297", "0.68528163", "0.68223625", "0.6743427", "0.6640722", "0.661942", "0.66073275", "0.65818256", "0.6577986", "0.651692", "0.65011466", "0.649889...
0.823358
0
This method prints the current contents of an api_key riak bucket when passed a valid url
def get_current_key(url): r=requests.get(url) #return json.dumps(r.json(), sort_keys=True, indent=4) return json.dumps(r.json(), sort_keys=True, indent=4, separators=(',', ': '))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_all_keys(riak_host,riak_port,bucket):\n url='http://%s:%s/buckets/%s/keys?keys=true' % (riak_host,riak_port,bucket)\n #print url\n r=requests.get(url)\n print json.dumps(r.json(), sort_keys=True, indent=4)", "def get_from_api(url, *, verbose=False):\n vprint = lambda *a, **kwa: print(*a, ...
[ "0.59069735", "0.5775815", "0.56716317", "0.5670298", "0.5502804", "0.54711944", "0.54018843", "0.5394873", "0.5385831", "0.536729", "0.5343384", "0.5342679", "0.5339456", "0.5331075", "0.53242856", "0.53214943", "0.5316168", "0.53113574", "0.527582", "0.5245839", "0.52193", ...
0.6079053
0
This method saves the current contents of the riak bucket/key to be updated into a file called .original
def save_current_contents(url,update_file): r=requests.get(url) save_file=update_file+'.original' json.dump(r.json(), open(save_file,'w')) print "\nSaved contents of: \n\n\t%s \n\nto \n\n\t%s\n" % (url,save_file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _s3_stash(self):\n s3_url = 's3://{}/{}'.format(BUCKET, self.atom_file)\n bucketpath = BUCKET.strip(\"/\")\n bucketbase = BUCKET.split(\"/\")[0]\n parts = urlparse.urlsplit(s3_url)\n mimetype = 'application/xml' \n \n conn = boto.connect_s3()\n\n try:\n ...
[ "0.6037694", "0.59927624", "0.57073236", "0.56520575", "0.56048256", "0.5596014", "0.55929804", "0.55929804", "0.5570519", "0.5558988", "0.5556693", "0.5535628", "0.5512414", "0.5506305", "0.5484331", "0.5482167", "0.54426193", "0.54200596", "0.54176253", "0.54065824", "0.539...
0.6019954
1
Export the accumulate QA info
def export_QA(qa: QA): # TODO: implement log.info("assess_quality.export_QA: not yet implemented")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dump_qa(self):\n #- QA level outputs\n #qa_outfile = {}\n qa_outfig = {}\n for PA in self.palist:\n for QA in self.qalist[PA]:\n #qa_outfile[QA] = self.io_qa(QA)[0]\n qa_outfig[QA] = self.io_qa(QA)[1]\n \n #- mak...
[ "0.62779266", "0.5807726", "0.5701978", "0.5490575", "0.548842", "0.5469755", "0.5413337", "0.54031056", "0.5353437", "0.5329075", "0.52541536", "0.5240437", "0.5219163", "0.52120894", "0.5197329", "0.5191597", "0.5154738", "0.51318127", "0.51313466", "0.51085216", "0.5108008...
0.7101214
0
Computes boundary indices for each of the splits in split_probs.
def _compute_split_boundaries(split_probs, n_items): if len(split_probs) > n_items: raise ValueError( 'Not enough items for the splits. There are {splits} ' 'splits while there are only {items} items'.format( splits=len(split_probs), items=n_items ) ) total_probs = sum(p ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_split_indices(self):\n\n cumsum = np.cumsum(\n np.concatenate((np.array([0], dtype=np.int8), self.split_sizes)))\n \n fold_inds = np.array(\n [(cumsum[n], cumsum[n + 1]) for n in range(self.n_splits)])\n\n return fold_inds", "def indices_of_split(self, s...
[ "0.6504778", "0.6373539", "0.5991977", "0.59512573", "0.58468676", "0.58247024", "0.58247024", "0.5623608", "0.55173296", "0.54587805", "0.5435856", "0.54219145", "0.53155714", "0.53145355", "0.5306709", "0.5304065", "0.5301914", "0.5295978", "0.52721083", "0.52459157", "0.52...
0.7075934
0
Test parsing and streaming of DPTValue1Ucount 50.
def test_value_50(self): self.assertEqual(DPTValue1Ucount().to_knx(50), (0x32,)) self.assertEqual(DPTValue1Ucount().from_knx((0x32,)), 50)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unit(self):\n self.assertEqual(DPTSignedRelativeValue.unit, \"\")\n self.assertEqual(DPTPercentV8.unit, \"%\")\n self.assertEqual(DPTValue1Count.unit, \"counter pulses\")", "def test_with_status_data(self):\r\n\r\n with open(os.path.join(RESOURCE_PATH, 'ND161646.PD0'), 'rb') ...
[ "0.65973496", "0.61154234", "0.60894555", "0.5885825", "0.5680461", "0.5545329", "0.5519853", "0.5479107", "0.54342437", "0.53747666", "0.5368387", "0.53356916", "0.5330443", "0.53220665", "0.532082", "0.52951694", "0.5269306", "0.5266885", "0.52651095", "0.52512425", "0.5247...
0.66703874
0
Test parsing and streaming of DPTValue1Ucount 255.
def test_value_max(self): self.assertEqual(DPTValue1Ucount().to_knx(255), (0xFF,)) self.assertEqual(DPTValue1Ucount().from_knx((0xFF,)), 255)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_value_50(self):\n self.assertEqual(DPTValue1Ucount().to_knx(50), (0x32,))\n self.assertEqual(DPTValue1Ucount().from_knx((0x32,)), 50)", "def test_unit(self):\n self.assertEqual(DPTSignedRelativeValue.unit, \"\")\n self.assertEqual(DPTPercentV8.unit, \"%\")\n self.asser...
[ "0.67056155", "0.631558", "0.6267815", "0.5858477", "0.5822282", "0.5758016", "0.56248516", "0.561795", "0.5597454", "0.55848616", "0.5476851", "0.53409237", "0.530719", "0.5269258", "0.52683234", "0.5258315", "0.52361274", "0.5220925", "0.5200943", "0.5164981", "0.5155284", ...
0.6720798
0
Test parsing and streaming of DPTValue1Ucount 0.
def test_value_min(self): self.assertEqual(DPTValue1Ucount().to_knx(0), (0x00,)) self.assertEqual(DPTValue1Ucount().from_knx((0x00,)), 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unit(self):\n self.assertEqual(DPTSignedRelativeValue.unit, \"\")\n self.assertEqual(DPTPercentV8.unit, \"%\")\n self.assertEqual(DPTValue1Count.unit, \"counter pulses\")", "def test_value_50(self):\n self.assertEqual(DPTValue1Ucount().to_knx(50), (0x32,))\n self.asser...
[ "0.65742433", "0.6063547", "0.6014494", "0.5983357", "0.57647645", "0.5689636", "0.5639485", "0.5594808", "0.5583179", "0.55746424", "0.5439922", "0.5422113", "0.5407889", "0.5406917", "0.53917974", "0.5373599", "0.53290766", "0.53238535", "0.5318", "0.52924883", "0.5290578",...
0.6662104
0
Test parsing of DPTValue1Ucount with wrong value (3 byte array).
def test_from_knx_wrong_parameter(self): with self.assertRaises(ConversionError): DPTValue1Ucount().from_knx((0x01, 0x02, 0x03))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_from_knx_wrong_value(self):\n with self.assertRaises(ConversionError):\n DPTValue1Ucount().from_knx((0x256,))", "def test_from_knx_wrong_parameter2(self):\n with self.assertRaises(ConversionError):\n DPTValue1Ucount().from_knx(\"0x23\")", "def test_value_min(self):\...
[ "0.6574174", "0.64003175", "0.63059187", "0.6276057", "0.6197245", "0.6195625", "0.61819005", "0.6062769", "0.600046", "0.5978124", "0.5972343", "0.5937288", "0.57631", "0.5702879", "0.566235", "0.5638889", "0.56113666", "0.5604449", "0.56010675", "0.55782485", "0.557578", ...
0.6430515
1
Returns the eopatch with the new grouping of the LPIS data. A column "GROUP_1_ID", is also added, with the ID associated to the groups. col_cropN_lpis is the name of the column of the crop type in the lpis dataframe. col_cropN_lpistogroup is the name of the column of the crop type in the csv file specified by self.lpis...
def execute(self, eopatch, col_cropN_lpis, col_cropN_lpistogroup): # Group LPIS classes lpis = eopatch.vector_timeless["LPIS_{}".format(self.year)] mapping = pd.read_csv(self.lpis_to_group_file, sep=";") result = pd.merge(lpis, mapping, how="left", left_on=[col_cropN_lpis], right_on=[col...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def putHaplotypeGroupIntoDB(self, session, input_fname, tg_ecotypeid2row, max_snp_typing_error_rate, snp_id_ls):\n\t\tsys.stderr.write(\"Constructing haplotype groups ...\\n\")\n\t\tpattern_ecotypeid = re.compile(r'(?<=\\))\\d+')\n\t\treader = csv.reader(open(input_fname), delimiter=figureOutDelimiter(input_fname)...
[ "0.54248655", "0.52833027", "0.52409554", "0.51482445", "0.5124294", "0.50936604", "0.5087704", "0.5087017", "0.5085758", "0.50673145", "0.5042352", "0.50204813", "0.5016356", "0.49944848", "0.4958095", "0.49487063", "0.49047828", "0.49024466", "0.48803094", "0.48635092", "0....
0.7963392
0
mask out labels that are not in both train and test data and also mask out samples where features include NaN values
def masking(X_train, X_test, y_train, y_test): # create mask to exclude NaN-values from train data mask_train = np.zeros(X_train.shape[0], dtype=np.bool) for i, subfeat in enumerate(X_train): if True in np.isnan(subfeat): mask_train[i] = True else: mask_train[i] = Fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def omit_nans(self, data, label):\n maskarray=np.full(data.shape[0], True)\n masker=np.unique(np.argwhere(np.isnan(data))[:,0])\n maskarray[masker]=False\n traindata=data[maskarray,:,:,:]\n trainlabel=label[maskarray]\n return traindata, trainlabel", "def filter_nan_samp...
[ "0.7626387", "0.6600071", "0.63293505", "0.62641454", "0.62288636", "0.61516243", "0.608271", "0.6056829", "0.6002692", "0.599427", "0.59860575", "0.59836817", "0.5916399", "0.5898351", "0.5887911", "0.5840369", "0.5840369", "0.581876", "0.58088595", "0.5802163", "0.5787612",...
0.75027907
1
Returns mapping between Geopedia's crop index and crop id for Slovenia.
def get_slovenia_crop_geopedia_idx_to_crop_id_mapping(): gpd_session = GeopediaSession() to_crop_id = list(GeopediaFeatureIterator(layer='2036', gpd_session=gpd_session)) to_crop_id = [{'crop_geopedia_idx': code['id'], **code['properties']} for code in to_crop_id] to_crop_id = pd.DataFrame(to_crop_id) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_austria_crop_geopedia_idx_to_crop_id_mapping():\n gpd_session = GeopediaSession()\n to_crop_id = list(GeopediaFeatureIterator(layer='2032', gpd_session=gpd_session))\n to_crop_id = [{'crop_geopedia_idx': code['id'], **code['properties']} for code in to_crop_id]\n to_crop_id = pd.DataFrame(to_cr...
[ "0.75980484", "0.75025374", "0.5695294", "0.5330386", "0.52470756", "0.5175866", "0.5105939", "0.5084242", "0.5022458", "0.50011927", "0.49794403", "0.49425364", "0.48705566", "0.48659784", "0.48595893", "0.48556918", "0.48154962", "0.48137003", "0.4780601", "0.47703573", "0....
0.8482437
0
Returns mapping between Geopedia's crop index and crop id for Austria.
def get_austria_crop_geopedia_idx_to_crop_id_mapping(): gpd_session = GeopediaSession() to_crop_id = list(GeopediaFeatureIterator(layer='2032', gpd_session=gpd_session)) to_crop_id = [{'crop_geopedia_idx': code['id'], **code['properties']} for code in to_crop_id] to_crop_id = pd.DataFrame(to_crop_id) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_slovenia_crop_geopedia_idx_to_crop_id_mapping():\n gpd_session = GeopediaSession()\n to_crop_id = list(GeopediaFeatureIterator(layer='2036', gpd_session=gpd_session))\n to_crop_id = [{'crop_geopedia_idx': code['id'], **code['properties']} for code in to_crop_id]\n to_crop_id = pd.DataFrame(to_c...
[ "0.77784413", "0.776725", "0.5600029", "0.54075384", "0.5386751", "0.52513653", "0.521203", "0.5181957", "0.5152261", "0.5145004", "0.51417464", "0.5124304", "0.5023551", "0.5006278", "0.49717915", "0.4945458", "0.4932558", "0.49104485", "0.49027997", "0.48968828", "0.4886672...
0.85902876
0
Query oVirt for hosts and place them in env.hosts
def query(oquery='', sure='no', ovirt=None): hosts = oVirtObjectType.all_types['host'].query(ovirt, oquery) env.hosts = [host.address for host in hosts] puts(yellow( "Got %d hosts: \n\t" % len(env.hosts) + '\n\t'.join(env.hosts) )) if sure != 'yes' and not env.parallel: if pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_hosts(self):\n ...", "def list_hosts():\n task_run(\"/bin/hostname -f\",RING_1_dev__allnodes)", "def iter_hosts():\n environmentdef = _get_environmentdef()\n\n for host in environmentdef.hosts():\n # fabric needs the host if we're calling from main()\n with this_hostname(h...
[ "0.71519107", "0.68191886", "0.6781512", "0.6779192", "0.67747766", "0.6615469", "0.6611653", "0.65831035", "0.6563107", "0.6526407", "0.6524256", "0.6518464", "0.6516803", "0.6516803", "0.65129817", "0.6509997", "0.6502699", "0.6498704", "0.6484243", "0.6476118", "0.64731044...
0.70534045
1
List walks, or create a new walks.
def walk_list_api(request): if request.method == 'GET': walks = Walk.objects.filter(user=request.user).order_by("-date") serializer = WalkSerializer(walks, many=True) return Response(serializer.data) elif request.method == 'POST': serializer = WalkSerializer(data=request.data) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def walk(self):\n pass", "def _generate_walks(self):\n return parallel_generate_walks(\n self.d_graph,\n self.walk_length,\n self.num_walks,\n 'Single process!',\n self.sampling_strategy,\n self.NUM_WALKS_KEY,\n self.WALK_...
[ "0.5646791", "0.5542716", "0.55225664", "0.5464238", "0.54215646", "0.528533", "0.52653676", "0.511849", "0.5058529", "0.5012877", "0.4977857", "0.49737927", "0.4950848", "0.4932711", "0.4876913", "0.48244464", "0.48208708", "0.4789596", "0.4759153", "0.47326207", "0.47326207...
0.56819975
0
Python script to read information from a public API returns employess an their completed tasks
def main(): number = sys.argv[1] url_user = "https://jsonplaceholder.typicode.com/users/{}".format(number) url_tasks = ("https://jsonplaceholder.typicode.com/users/{}/todos". format(number)) response = requests.get(url_tasks) tasks = response.json() user_info = requests.get(url_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getTasks(server, appId, maxNumberTasks, completedOnly, oper = 0, fileName = 'data/jsonTasksInfo.dat'):\n if oper == 0:\n if completedOnly == 1:\n JSONdata = urllib2.urlopen(url=server+\"/api/task?app_id=\"+ \\\n str(appId)+\"&state=completed&limit=\"+ \\\n str...
[ "0.6383334", "0.6324897", "0.60697365", "0.60460687", "0.6041132", "0.6039913", "0.6039841", "0.6021158", "0.59782183", "0.594846", "0.5938907", "0.590392", "0.58827335", "0.58718795", "0.5845513", "0.58447444", "0.5832608", "0.5792506", "0.5783988", "0.57403696", "0.5719636"...
0.68217677
0
Pads episodes to all be the same length by repeating the last exp.
def pad(episodes): max_len = max(len(episode) for episode in episodes) mask = torch.zeros((len(episodes), max_len), dtype=torch.bool) padded_episodes = [] for i, episode in enumerate(episodes): padded = episode + [episode[-1]] * (max_len - len(episode)) padded_episodes.append(padded) mask[i, :len(ep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pad(seq, n):\n return", "def _add_target_n_step_q_to_episode(self, episode):\n horizon = len(episode)\n for t in range(horizon):\n end_idx = min(t + self.n, horizon)\n discount = self.gamma ** (end_idx - t)\n mask = episode[end_idx - 1][\"nonterminal\"]\n ...
[ "0.62974507", "0.58488435", "0.58399844", "0.56710404", "0.56123376", "0.555278", "0.55409425", "0.55328083", "0.54572415", "0.5408101", "0.5379053", "0.53634495", "0.5328769", "0.5322512", "0.53201896", "0.5319856", "0.5299281", "0.52867496", "0.52844036", "0.5275552", "0.52...
0.6246594
1
Returns the environment class specified by the type.
def get_env_class(environment_type): if environment_type == "vanilla": return city.CityGridEnv elif environment_type == "distraction": return city.DistractionGridEnv elif environment_type == "map": return city.MapGridEnv elif environment_type == "cooking": return cooking.CookingGridEnv elif en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_environment_class_by_name(environment_type):\n for cls in util.iter_subclasses(Environment):\n if cls.tool_name == environment_type:\n return cls\n raise EnvironmentUnavailable(\n f\"Unknown environment type '{environment_type}'\")", "def get_environment_class(conf, python)...
[ "0.82389814", "0.7236929", "0.67771494", "0.6746536", "0.65948284", "0.6437139", "0.6344269", "0.63292193", "0.6256534", "0.6174284", "0.61565256", "0.60773396", "0.5924187", "0.5919927", "0.58619225", "0.57948107", "0.57791364", "0.5763649", "0.57397777", "0.5733595", "0.573...
0.8176247
1
Two sketches can be merged only if their gamma and min_values are equal.
def mergeable(self, other): return self.gamma == other.gamma and self.min_value == other.min_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def canBeMergedWith(self, other):", "def _merge_sanity_check(self, other):\n if self._fields is not None and (\n set(self.query.values_select) != set(other.query.values_select)\n or set(self.query.extra_select) != set(other.query.extra_select)\n or set(self.query.annotatio...
[ "0.561305", "0.5554772", "0.55113935", "0.5468042", "0.54112643", "0.5404954", "0.5348093", "0.53448844", "0.5326112", "0.53066695", "0.5288724", "0.5269989", "0.51783633", "0.51139086", "0.5101292", "0.5095481", "0.507951", "0.50213623", "0.5012159", "0.4999083", "0.4995614"...
0.7373218
0
Takes a list of revision dicts and extracts globals, includes, and pages Expects revision dict to be sorted already Returns 3tuple
def extract_data(data, rev=0): globs = {'_pages' : {}} includes = [] pages = [] pages_list = [] for datum in data: globs.update(datum.get('globals', {})) includes += datum.get('includes', []) datum_pages = datum.get('pages', []) for page in datum_pages: if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_revision_pages(url_text):\n\trevision_links = []\n\tgrammar_indices = [m.start() for m in re.finditer(\"grammar\", url_text.lower())]\n\t# print(\"Grammar indices:\",grammar_indices)\n\n\tfor i in range(len(grammar_indices)):\n\t\tgrammar_index = grammar_indices[i] \n\t\tprev_index = url_text[:grammar_ind...
[ "0.58713603", "0.5255621", "0.5184779", "0.5133159", "0.5087633", "0.50743926", "0.5060516", "0.50166947", "0.49424127", "0.49343994", "0.49080712", "0.48932", "0.48899907", "0.4886464", "0.48854086", "0.48630324", "0.48628467", "0.48229107", "0.48138183", "0.4796315", "0.478...
0.7212066
0
r"""Distributed version of Stochastic Dual Coordinate Ascent (SDCA) optimizer for linear models with L1 + L2 regularization. As global optimization objective is stronglyconvex, the optimizer optimizes the dual objective at each step. The optimizer applies each update one example at a time. Examples are sampled uniforml...
def _sdca_optimizer(sparse_example_indices, sparse_feature_indices, sparse_feature_values, dense_features, example_weights, example_labels, sparse_indices, sparse_weights, dense_weights, example_state_data, loss_type, l1, l2, num_loss_parti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def optimize_sgd(beta, X, y, num_iterations, step_size):\n \n N = X.shape[0]\n P = X.shape[1]\n costs = []\n #variable step size\n if step_size == 'rm': #Robbins–Monro rule\n t0 = 2\n C = 1\n alpha = 0.5\n for i in range(num_iterations): \n j = random.ran...
[ "0.58430123", "0.57700384", "0.559415", "0.55526096", "0.5507653", "0.5500585", "0.54425055", "0.5425867", "0.5423508", "0.5412528", "0.54118615", "0.5398304", "0.53416395", "0.534044", "0.53132707", "0.52848023", "0.5283411", "0.5282129", "0.5275689", "0.5273703", "0.5230695...
0.68696374
0
r"""Applies L1 regularization shrink step on the parameters.
def _sdca_shrink_l1(weights, l1, l2, name=None): result = _op_def_lib.apply_op("SdcaShrinkL1", weights=weights, l1=l1, l2=l2, name=name) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def l1_regularizer(scale):\n if isinstance(scale, numbers.Integral):\n raise ValueError('scale cannot be an integer: %s' % scale)\n if isinstance(scale, numbers.Real):\n if scale < 0.:\n raise ValueError('Setting a scale less than 0 on a regularizer: %g' %\n ...
[ "0.6826777", "0.61285764", "0.6045434", "0.59946656", "0.59823173", "0.5980362", "0.59782636", "0.5918527", "0.58867913", "0.57994086", "0.57767415", "0.57330287", "0.57198095", "0.56476456", "0.55648047", "0.5526961", "0.5520416", "0.5410303", "0.5392533", "0.5335324", "0.53...
0.61554843
1
This class holds the windows which shows the create experiment widget.
def __init__(self,currentExperiment): super(AmoebaCreateExperimentWindow,self).__init__() self.currentExperiment = currentExperiment #Create the window self.subWindow = QMdiSubWindow() self.widget = AmoebaCreateExperiment(self.subWindow,self.currentExperiment) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createWidgets(self):\n raise NotImplementedError", "def showUI(cls):\r\n win = cls()\r\n win.create()\r\n return win", "def build_window(self):\n\n main_frame = tk.Frame(self.root)\n main_frame.pack(fill='both')\n\n self.open_machine_learner_window_button = ...
[ "0.73238564", "0.70476335", "0.7020338", "0.69660527", "0.6964482", "0.695962", "0.6924835", "0.67237866", "0.6702971", "0.6695231", "0.6694868", "0.6665668", "0.666019", "0.6648684", "0.6624867", "0.6576935", "0.6558816", "0.6556843", "0.6536284", "0.65104073", "0.6472229", ...
0.7192625
1
Testing Tuna is not null
def test_Tuna(self): tuna = Tuna("1", "2", "3", "4") self.assertIsNotNone(tuna)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testIsNullTrueAgain(self):\n val = is_null('') \n self.assertTrue(val)", "def test_non_thesis(non_thesis):\n assert non_thesis is None", "def nulltest():", "def testIsNullTrue(self):\n val = is_null(\"\") \n self.assertTrue(val)", "def is_null(space, w_obj):\n ...
[ "0.66639656", "0.6589096", "0.6544759", "0.6537418", "0.65249217", "0.6464309", "0.6438317", "0.6438317", "0.6416694", "0.6395729", "0.6372581", "0.6337188", "0.63306767", "0.6319348", "0.6262661", "0.62500733", "0.61865604", "0.6135527", "0.6083987", "0.6083987", "0.6083662"...
0.6774843
0
Testing Tuna's setTunasFeatures method works
def test_setTunaFeatures(self): tuna = Tuna() array = ["1", "2", "3", "4"] tuna.setTunaFeatures(array) self.assertEqual(tuna.getTunaFeatures(), array)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_getTunaFeatures(self):\n tuna = Tuna(\"1\", \"2\", \"3\", \"4\")\n array = [\"1\", \"2\", \"3\", \"4\"]\n self.assertEqual(tuna.getTunaFeatures(), array)", "def _initialize_with_tune_context(self, context: \"TuneContext\") -> None:\n raise NotImplementedError", "def prepare...
[ "0.6467389", "0.6120855", "0.5748472", "0.5742488", "0.5711489", "0.56948525", "0.56849676", "0.5643649", "0.5622461", "0.5612863", "0.5570076", "0.5564452", "0.5562412", "0.5538345", "0.5495508", "0.5485487", "0.54830647", "0.5479651", "0.5453535", "0.54154104", "0.5412377",...
0.75750804
0
Testing Tuna's getTunasFeatures method works
def test_getTunaFeatures(self): tuna = Tuna("1", "2", "3", "4") array = ["1", "2", "3", "4"] self.assertEqual(tuna.getTunaFeatures(), array)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_setTunaFeatures(self):\n tuna = Tuna()\n array = [\"1\", \"2\", \"3\", \"4\"]\n tuna.setTunaFeatures(array)\n self.assertEqual(tuna.getTunaFeatures(), array)", "def findFeatures(self):\n\t\tpass", "def test__extract_features(self):\n text_sample = \"I really really l...
[ "0.71556205", "0.6340565", "0.61837447", "0.5806672", "0.5796584", "0.57937485", "0.57770115", "0.57497746", "0.5737169", "0.5710892", "0.5675815", "0.5668341", "0.5659601", "0.55376226", "0.5520661", "0.55035144", "0.5499606", "0.5498502", "0.54887605", "0.5487713", "0.54858...
0.7249121
0
Create "can_approve_estimated_completion_date" permission and add it to the "Admin" group.
def add_permissions(apps, schema_editor): Permission = apps.get_model("auth", "Permission") Group = apps.get_model("auth", "Group") ContentType = apps.get_model("contenttypes", "ContentType") permission, created = Permission.objects.get_or_create( codename="can_approve_estimated_completion_dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_authorize(cls, user, obj):\n if not obj.delivery.deadline.assignment_group.is_examiner(user):\n raise PermissionDenied()", "def write_authorize(cls, user, obj):\n if not models.AssignmentGroup.published_where_is_examiner(user).filter(id=obj.deadline.assignment_group.id):\n ...
[ "0.61045885", "0.5988743", "0.5814144", "0.5738462", "0.5411797", "0.5401533", "0.5399722", "0.5363404", "0.53633904", "0.53270596", "0.52686125", "0.523226", "0.52310044", "0.5126954", "0.51135796", "0.5107107", "0.5074804", "0.5071565", "0.50627375", "0.5031271", "0.5008885...
0.76646936
0
Remove "can_approve_estimated_completion_date" permission and remove it from the "Admin" group.
def remove_permissions(apps, schema_editor): Permission = apps.get_model("auth", "Permission") Group = apps.get_model("auth", "Group") permission = Permission.objects.get( codename="can_approve_estimated_completion_date", ) admin_group = Group.objects.get(name="Administrator") admin_g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delPermission(self,request):\n request.needAuthType(request.ADMIN)\n request.checkArgs(\"admin_username\",\"perm_name\")\n request.getAuthNameObj().canDo(\"CHANGE ADMIN PERMISSIONS\")\n perm_actions.getActionManager().deletePermission(request[\"admin_username\"],request[\"perm_name\...
[ "0.63204193", "0.60559267", "0.5868938", "0.5853292", "0.5768508", "0.5714673", "0.5648865", "0.56440014", "0.5544115", "0.55229086", "0.55072224", "0.54663765", "0.5419387", "0.5413648", "0.53388613", "0.5335905", "0.53285515", "0.5316271", "0.5315049", "0.5301109", "0.52911...
0.81578374
0
export GPU for AD
def export_gpu(entity=None): status = False exportGrp = config.geoGrp res = entity.task_res() libPath = entity.libPath() if res: abcName = entity.libName(config.libName.get('gpu'), res, ext='abc') # name without ext basename = os.path.splitext(abcName)[0] gpuName = '{0}/{1}'.format(libPath, abcNam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetGPU():\n return option['device_id']", "def create_gpu_device_if_present():\n d = dpctl.SyclDevice(\"gpu,cpu\")\n print(\"Selected \" + (\"GPU\" if d.is_gpu else \"CPU\") + \" device\")", "def add_gpu_and_mpi_marks():\n pass", "def create_gpu_device():\n d1 = dpctl.SyclDevice(\"gpu\")\n ...
[ "0.62095964", "0.6097989", "0.59566474", "0.5911981", "0.585888", "0.5828839", "0.57508516", "0.57136184", "0.5679205", "0.56655836", "0.5627468", "0.55777365", "0.55777365", "0.5537934", "0.55370134", "0.55342036", "0.54773647", "0.5465165", "0.54110056", "0.53959876", "0.53...
0.70596236
0
Test to see if profile for leothelion can be viewed anon and logged in
def test_view_profile(self): LOGGER.debug("Test GET /rango/view/leothelion/ for anon user") anon_view_response = self.client.get('/rango/view/leothelion/') self.assertContains(anon_view_response, "leothelion@hotmail.com") LOGGER.debug("Test GET /rango/view/leothelion/ for logged in use...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_user_has_access(self):\n return self.user_has_access(users.get_current_user())", "def test_06_user_public_profile(self):\r\n # As Anonymou user\r\n url = \"/account/%s\" % self.name\r\n res = self.app.get(url, follow_redirects=True)\r\n dom = BeautifulSoup(res.data)\r\n...
[ "0.69051546", "0.6754408", "0.67433447", "0.66899693", "0.6672601", "0.6667041", "0.6631646", "0.66299933", "0.6568902", "0.6545809", "0.6544475", "0.65014887", "0.6479417", "0.64605063", "0.64309174", "0.6402466", "0.63988775", "0.6398008", "0.6369444", "0.6363515", "0.63518...
0.70540863
0
Takes in the direction the camera is pointing and the camera origin and returns a cam2world matrix.
def create_cam2world_matrix(forward_vector, origin, device=None): """""" forward_vector = normalize_vecs(forward_vector) up_vector = torch.tensor([0, 1, 0], dtype=torch.float, device=device) \ .expand_as(forward_vector) left_vector = normalize_vecs( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map_to_matrix(x, y):\n x_pos = round(x * ((MATRIX_SIZE_X - 1)/(FRAME_W - 1)))\n y_pos = round(y * ((MATRIX_SIZE_Y - 1)/(FRAME_H - 1)))\n\n x_pos = (MATRIX_SIZE_X - 1) - x_pos #invert x direction (left and right) to account for camera perspective\n\n return x_pos, y_pos", "def cam_to_world(cam_poi...
[ "0.6586465", "0.6576377", "0.6565738", "0.6500614", "0.64989525", "0.6413747", "0.61989534", "0.6179077", "0.6152811", "0.6126261", "0.59229445", "0.5909412", "0.59015703", "0.5897311", "0.57085705", "0.568021", "0.5642607", "0.5634", "0.56108457", "0.558792", "0.5587084", ...
0.78033996
0
Perturb z_vals and points; Samples a camera position and maps points in camera space to world space.
def transform_sampled_points(points, z_vals, ray_directions, device, h_stddev=1, v_stddev=1, h_mean=math.pi * 0.5, v_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perturb_points(points,\n z_vals,\n ray_directions,\n device):\n distance_between_points = z_vals[:, :, 1:2, :] - z_vals[:, :, 0:1, :] # (n, num_rays, 1, 1)\n offset = (torch.rand(z_vals.shape, device=device) - 0.5) \\\n * distance_between_points...
[ "0.6049411", "0.60473865", "0.6045746", "0.58854824", "0.5848199", "0.58449686", "0.58036494", "0.5799261", "0.5791324", "0.5775069", "0.5753067", "0.5746451", "0.5705016", "0.56961274", "0.56343555", "0.56067497", "0.5599403", "0.5573139", "0.5569328", "0.55522996", "0.55279...
0.65007573
0
Converts an Rmd document as a string into a list of ``Cell`` objects for easier handling with code designed originally for Jupyter notebooks.
def rmd_to_cells(rmd_string): cells, cell_lines, cell_type, in_block, in_begin = [], [], "markdown", False, False for line in rmd_string.split("\n"): if in_block and (line.strip() == "```" or re.match(END_REGEX, line)): in_block = False # collect cell_lines into a new cell ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def markdown_cells(notebook):\n cells = all_cells(notebook)\n return [cell[\"source\"] for cell in cells if cell[\"cell_type\"] == \"markdown\"]", "def convert(cell):\r\n\r\n markdownResult=\"\"\r\n if cell['cell_type'] == 'code':\r\n markdownResult += '```\\n'\r\n\r\n for line in cell['sou...
[ "0.659269", "0.57998616", "0.54991925", "0.5440537", "0.54145265", "0.5360483", "0.5280241", "0.5191896", "0.51772344", "0.51759666", "0.51577157", "0.51485837", "0.5141294", "0.51053214", "0.50847465", "0.50440603", "0.5038209", "0.49959463", "0.4994819", "0.49679536", "0.49...
0.74898815
0
Collapses all runs of cells with empty sources into a single cell with an empty source
def collapse_empty_cells(cells): in_run, run_start = False, 0 replacements = [] for i, cell in enumerate(cells): if in_run and cell["source"].strip(): if (run_start > 0 and cells[run_start-1]["source"].endswith("\n")) or cell["source"].startswith("\n"): replacement = [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collapse(self):\n # TODO: not implemented\n pass", "def collapsed(self) -> None:", "def collapseUp(self):\n retval = False\n for cStartInd in range(self.col):\n lst = [self.get_cell(i) for i in range(cStartInd, self.length, self.col)]\n lst, tmp = self.collapseRow(...
[ "0.5843393", "0.5662654", "0.5656175", "0.5561178", "0.5532706", "0.55238676", "0.5440617", "0.5401576", "0.53815573", "0.5375235", "0.5353397", "0.5295118", "0.5245139", "0.5245116", "0.5235098", "0.5224786", "0.51737785", "0.517261", "0.51705515", "0.5094087", "0.50495225",...
0.7354216
0
Storage service is unavailable.
def test_store_is_unavailable(self, mock_current_session): mock_store = mock.MagicMock() mock_store.is_available.return_value = False mock_current_session.return_value = mock_store with self.assertRaises(ServiceUnavailable): controllers.service_status()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_service_unavailable():\n if WithingsDataManager.service_available is not False:\n _LOGGER.error(\"Looks like the service is not available at the moment\")\n WithingsDataManager.service_available = False\n return True", "def _async_device_unavailable(\n _se...
[ "0.668266", "0.61864495", "0.60823864", "0.6079669", "0.6038685", "0.59237933", "0.59164035", "0.5869149", "0.5832894", "0.572674", "0.5605072", "0.5605072", "0.5580025", "0.55637956", "0.5485156", "0.5483856", "0.5440075", "0.5376526", "0.5344619", "0.5323179", "0.5311567", ...
0.64220196
1
The preview already exists.
def test_already_exists(self, mock_current_session): mock_store = mock.MagicMock() mock_store.deposit.side_effect = store.PreviewAlreadyExists mock_current_session.return_value = mock_store with self.assertRaises(Conflict): # 409 Conflict controllers.deposit_preview(self.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upd_preview(self):\n\n if self.data_type != \"layer\":\n self.dlg.uLabelImgPreview.clear()\n self.dlg.uLabelImgPreview.setText(\"No preview available\")\n return\n\n if self.get_preview(\"300x200\", 0.5):\n return\n if self.get_preview(\"150x100\...
[ "0.6237067", "0.5998938", "0.59585685", "0.5936331", "0.58514047", "0.5833355", "0.58192414", "0.58160555", "0.57726073", "0.5763644", "0.5718817", "0.57129294", "0.5625983", "0.560919", "0.55987835", "0.5598265", "0.5556675", "0.54856384", "0.5413032", "0.53611124", "0.53594...
0.6862947
0
The preview is deposited successfully.
def test_deposit_successful(self, mock_current_session): mock_store = mock.MagicMock() added = datetime.now(UTC) def mock_deposit(obj, overwrite, **kwargs): """Deposit implementation sets metadata on Preview.""" return Preview(source_id=obj.source_id, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mock_deposit(obj, overwrite, **kwargs):\n return Preview(source_id=obj.source_id,\n checksum=obj.checksum,\n metadata=Metadata(added=added,\n checksum='foopdfchex==',\n ...
[ "0.6338141", "0.5979675", "0.59421855", "0.57830966", "0.57375795", "0.56633556", "0.5594401", "0.5583082", "0.55299044", "0.54851264", "0.54364324", "0.5425671", "0.5414658", "0.5412717", "0.5406029", "0.53997284", "0.5370651", "0.5346766", "0.53250915", "0.5285307", "0.5258...
0.68985367
0
Deposit implementation sets metadata on Preview.
def mock_deposit(obj, overwrite, **kwargs): return Preview(source_id=obj.source_id, checksum=obj.checksum, metadata=Metadata(added=added, checksum='foopdfchex==', s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_deposit_successful(self, mock_current_session):\n mock_store = mock.MagicMock()\n added = datetime.now(UTC)\n\n def mock_deposit(obj, overwrite, **kwargs):\n \"\"\"Deposit implementation sets metadata on Preview.\"\"\"\n return Preview(source_id=obj.source_id,\n ...
[ "0.63907486", "0.5510283", "0.54667133", "0.53128654", "0.5308596", "0.51845413", "0.5147838", "0.5139438", "0.51325536", "0.51286876", "0.51013607", "0.5079927", "0.5060331", "0.5060331", "0.5060331", "0.5060331", "0.5060331", "0.5060331", "0.5060331", "0.50552124", "0.48929...
0.7150155
0
Empty the linked list O(n)
def clear(self): trav = self.head while trav is not None: nxt = trav.nxt trav.prev = trav.nxt trav.data = None trav = nxt self.head = None self.tail = None trav = None self.size = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear(self):\n self.head = None", "def clear(self):\n SortedList.clear(self)\n self.head = None", "def clear(self):\n self._head = None\n self._tail = None\n self._size = 0", "def delete_node_at_start(self):\n if not self.head:\n print('List alr...
[ "0.7618228", "0.758952", "0.7434152", "0.716568", "0.71470666", "0.71089613", "0.70733416", "0.7044231", "0.69825834", "0.68761986", "0.6806461", "0.67757773", "0.6737707", "0.66606444", "0.65375364", "0.6524759", "0.65140676", "0.64742666", "0.6388031", "0.63806", "0.6374855...
0.7664343
0
Obtain data from head of linked list O(1)
def peek_first(self): if self.is_empty(): raise RuntimeError("Empty list") return self.head.data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first(self):\r\n if self.head == None: #check if first(head) node is empty\r\n return 'null' #if yes, then return null\r\n else: #if it is not empty\r\n return self.head.data #return the data of head node\r", "def get(self, index):\r\n if index >= self.length():\r\n...
[ "0.7262619", "0.7033946", "0.69992024", "0.69802266", "0.688625", "0.6812085", "0.6749111", "0.6720148", "0.6715752", "0.6712102", "0.6700454", "0.668674", "0.65855867", "0.65336317", "0.65283626", "0.64966935", "0.64835984", "0.6479097", "0.646512", "0.6455154", "0.6453674",...
0.7192319
1
Obtain data from tail of linked list O(1)
def peek_last(self): if self.is_empty(): raise RuntimeError("Empty list") return self.tail.data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_last(self):\n if self.is_empty():\n raise self.NoSuchNodeException()\n\n tail = self.getNode(self.list_size - 1)\n tail_data = tail.data\n\n if self.list_size == 1:\n self.head = None\n else:\n before_tail = self.getNode(self.list_size ...
[ "0.6827692", "0.68033373", "0.6787032", "0.6713353", "0.6656795", "0.66173166", "0.6605389", "0.6585034", "0.656764", "0.65581566", "0.65382594", "0.65274656", "0.65145355", "0.6505743", "0.6500952", "0.64953417", "0.64916885", "0.64655113", "0.6456848", "0.64051723", "0.6399...
0.7195302
0
Convert from ParseResults to normal list.
def result2list(foo): if isinstance(foo, ParseResults): return [result2list(bar) for bar in foo] else: return foo
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _make_result_list(self,res):\n res_list = []\n for r in res:\n res_list.append(r)\n\n return res_list", "def __to_list(__results):\n rows = []\n for row in __results:\n rows.append(row)\n \n __results.c...
[ "0.67065823", "0.6454018", "0.6392541", "0.61657304", "0.6103048", "0.60968775", "0.600516", "0.5954104", "0.58549696", "0.5853532", "0.5851375", "0.5830539", "0.5825065", "0.5800057", "0.5794257", "0.57913077", "0.57792944", "0.5751782", "0.5738138", "0.57195807", "0.5705452...
0.7606971
0