query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Process one education summary and generate a record
def proc_education_summary( summary: Tag ) -> Dict[str, str]: edu_record = dict() edu_record['school'] = summary.find('h3').text.strip() edu_record['is_abroad_school'] = _is_abroad_school( edu_record['school'] ) for parag in summary.find_all('p'): spans = [span.text.strip() for span in parag.fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_edu_data( api, district_data = {}, categories = {'Education': { }}, \r\n state=48, district=7, leg_body='US-REP', year='2015' ):\r\n category='Education'\r\n\r\n district_key='district'\r\n blockgroup_key='bg'\r\n precinct_key='precinct'\r\n tract_key='tract'\r\n\r\n edu_table = ...
[ "0.6131321", "0.6071274", "0.57574546", "0.57188594", "0.5628388", "0.5616263", "0.5484156", "0.5319141", "0.53092843", "0.52988136", "0.52154684", "0.5209973", "0.52016425", "0.51190305", "0.51043224", "0.50922275", "0.5088542", "0.5073056", "0.5030911", "0.50198203", "0.499...
0.763279
0
Yield successive nsized chunks from l.
def chunks(l, n): for i in range(0, len(l), n): yield l[i:i + n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]", "def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def get_chunks(self, ...
[ "0.8038813", "0.79248375", "0.7923423", "0.7885103", "0.78773195", "0.7815877", "0.77655786", "0.77556044", "0.77441615", "0.7731815", "0.77288336", "0.772473", "0.77028215", "0.76889825", "0.76889825", "0.7664208", "0.76570904", "0.7655856", "0.7655856", "0.76458347", "0.764...
0.7448925
77
Test Postgres direct replication's failure handling by disrupting replication at various stages using Toxiproxy or service restarts
def workflow_default(c: Composition) -> None: # TODO: most of these should likely be converted to cluster tests for scenario in [pg_out_of_disk_space]: with (c.override(Postgres(volumes=["pgdata_512Mb:/var/lib/postgresql/data"]))): print(f"--- Running scenario {scenario.__name__} with limi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def IntrumentFailHook(self):\n #Restart iserver\n #If failed to restart\n #\treturn fail\n pass", "def test_base_replica_repair_with_contention(self):\n self._base_replica_repair_test(fail_mv_lock=True)", "def test_replicate_mariadb_to_pg(self):\n # TODO - Real and mor...
[ "0.63206184", "0.6228888", "0.6210252", "0.62039804", "0.62012404", "0.61866266", "0.61208516", "0.6100933", "0.6046609", "0.6032756", "0.5976263", "0.5965013", "0.59617287", "0.59580386", "0.5951879", "0.5910513", "0.5882536", "0.5845998", "0.58383894", "0.5829405", "0.58280...
0.0
-1
Validate the data at the end.
def end(c: Composition) -> None: c.run("testdrive", "verify-data.td")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validation_end(self, val_data):\n pass", "def validate(cls, data, errors):", "def validate(self, data):\n raise NotImplementedError(\"Inherit this class and override this method.\")", "def validate_data(self, data):\n # TODO use schema\n assert \"file_contents\" in data, data\...
[ "0.745152", "0.7357523", "0.73128825", "0.7111", "0.7077425", "0.68865585", "0.6850227", "0.6831101", "0.6747063", "0.6708461", "0.6707305", "0.66927314", "0.6691213", "0.66337067", "0.6621578", "0.662128", "0.6593216", "0.6551312", "0.6551312", "0.6551312", "0.6551312", "0...
0.0
-1
Confirm that Mz does not reingest the entire snapshot on restart by revoking its SELECT privileges
def verify_no_snapshot_reingestion(c: Composition) -> None: c.run("testdrive", "wait-for-snapshot.td", "postgres-disable-select-permission.td") restart_mz(c) c.run( "testdrive", "delete-rows-t1.td", "delete-rows-t2.td", "alter-table.td", "alter-mz.td", )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_backup_can_use_snapshots(self):\n use_snaps = self.driver.backup_use_temp_snapshot()\n self.assertTrue(use_snaps)", "def test_base_replica_repair_with_contention(self):\n self._base_replica_repair_test(fail_mv_lock=True)", "def test_clone_delete_snap(self):\n\n # pylint: di...
[ "0.5921977", "0.5906115", "0.56129384", "0.55432796", "0.55244553", "0.5494747", "0.543905", "0.54100126", "0.54093075", "0.538874", "0.5343703", "0.5319883", "0.5312346", "0.53067654", "0.5303087", "0.5273802", "0.5273196", "0.5273007", "0.5248124", "0.5243732", "0.52304816"...
0.7708593
0
Return a suite of all tests cases contained in the given module
def loadTestClassFromModule(module, use_load_tests=True): tests = None for name in dir(module): obj = getattr(module, name) if isinstance(obj, type) and issubclass(obj, ParametrizedTestCase) and str(obj) != str( ParametrizedTestCase) and str(obj) != "<class 'uopweixin.util.parame...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def suite():\n\tts = unittest.TestSuite()\n\tfor test_module in __all__:\n\t\tm = importlib.import_module(\"pyroclast.test.\" + test_module)\n\t\tfor n in dir(m):\n\t\t\tc = getattr(m, n)\n\t\t\tif is_test_case(c):\n\t\t\t\ts = unittest.TestLoader().loadTestsFromTestCase(c)\n\t\t\t\tts.addTests(s)\n\treturn ts", ...
[ "0.8063252", "0.7676559", "0.76495856", "0.758284", "0.7530731", "0.7510085", "0.7374049", "0.735785", "0.73530036", "0.7318421", "0.7256384", "0.7214909", "0.7213947", "0.7192925", "0.7191777", "0.7180284", "0.7164808", "0.7152171", "0.71226704", "0.7102935", "0.7084908", ...
0.0
-1
Returns the action to play given a board.
def predict(self, board: np.ndarray) -> Union[int, np.ndarray]:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def choose_action(self, board):\n raise NotImplementedError", "def get_action(obs, player_x, player_y):\n # if player is surrounded\n if obs[\"memory_patterns\"][\"go_around_opponent_surrounded\"]:\n return Action.HighPass\n if Action.Sprint not in obs[\"sticky_actions\"]:\...
[ "0.74648356", "0.6854943", "0.68462664", "0.6679787", "0.65527886", "0.65317684", "0.64895797", "0.6445785", "0.6348787", "0.6347296", "0.6346307", "0.6300806", "0.6267491", "0.6247335", "0.6182883", "0.614225", "0.6126674", "0.610002", "0.60655266", "0.6035297", "0.60203236"...
0.0
-1
calculation of the weighted chi squared to adjust the fitted array a
def _confidence_interval_function(xq, cinfo): a = cinfo.a.copy() a[cinfo.indx] = xq yfit, _ = cinfo.fit_function(a, pderflg=False) if yfit.dtype in ['complex64','complex128']: yfit = np.concatenate([yfit.real,yfit.imag]) wchisqr1 = np.sum(cinfo.ww*(yfit-cinfo.dat)**2)/cinfo.nfree g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_chi_sq(data, errors, fit_range):\n\n def chi_sq(m, c):\n ff = pp_flat(fit_range, m, c)\n return sum((data - ff)**2 / errors**2) / len(fit_range)\n # return sum([(data[t] - pp_flat(t, m, c))**2 / (errors[t])**2\n # for t in fit_range]) / len(fit_range)\n\n...
[ "0.6467894", "0.64215815", "0.6411859", "0.614662", "0.6131364", "0.60107845", "0.59890735", "0.5948792", "0.5901307", "0.58615404", "0.58361286", "0.58329666", "0.58311874", "0.5830273", "0.5828101", "0.580342", "0.5786088", "0.57837075", "0.5777559", "0.57715887", "0.575595...
0.0
-1
metodo para eliminar stop words y puntuaciones
def process_text(text): doc = spacy_model(text.lower()) result = [] for token in doc: if token.text in spacy_model.Defaults.stop_words: continue if token.is_punct: continue if token.lemma_ == '-PRON-': continue result.append(token.lemma_) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_stopwords_fun(self):\n tokens = str(self.doc).split()\n cleaned_tokens = [token for token in tokens\n if token.lower() not in self.stopword_list]\n self.doc = ' '.join(cleaned_tokens)", "def remove_stopwords(text):\n text = \" \"+text\n text = text.u...
[ "0.8029162", "0.7871238", "0.7827937", "0.77273935", "0.7700728", "0.7674348", "0.75979733", "0.7589021", "0.7588377", "0.75513494", "0.75341374", "0.7531595", "0.752028", "0.75105363", "0.74816066", "0.74453825", "0.7396178", "0.73767215", "0.73695505", "0.73666316", "0.7332...
0.0
-1
Extract the text content from lines.
def _extract_content(lines: list[Strip]) -> list[str]: content = ["".join(segment.text for segment in line) for line in lines] return content
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_text_lines(instText):\n\n # Find out which part this is\n part = instText.part\n # Get the necessary parameters: lng, ext, dir\n sLng = part.corpus.get_lng_display()\n sDir = part.dir\n sName = instText.fileName\n sFormat = instText.get_format_display()\n # Now try to get the inform...
[ "0.62102735", "0.61233324", "0.6056201", "0.60443735", "0.5982941", "0.5918472", "0.589934", "0.5866649", "0.5844836", "0.58414966", "0.5823281", "0.5823281", "0.58078074", "0.5782247", "0.57648635", "0.57648635", "0.5750798", "0.57348955", "0.5727085", "0.5703013", "0.569214...
0.7722922
0
Test that empty style returns the content unaltered
def test_no_styles(): content = [ Strip([Segment("foo")]), Strip([Segment("bar")]), Strip([Segment("baz")]), ] styles = Styles() cache = StylesCache() lines = cache.render( styles, Size(3, 3), Color.parse("blue"), Color.parse("green"), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_noop(self):\n html = '<div class=\"pink\">test</div>'\n css = ''\n self.assertEqual(html, inline_css(html, css, pretty_print=False))", "def test_format_empty(self) -> None:\n CSSFormatter._format_str(self._file_read(\"empty.css\"))", "def test_style_hang():\n style = [\n...
[ "0.7511037", "0.7037144", "0.67473537", "0.6714339", "0.65121347", "0.6503912", "0.6401926", "0.63792145", "0.62622905", "0.62292373", "0.6104016", "0.608578", "0.59841275", "0.5979896", "0.5944915", "0.5905404", "0.58714443", "0.5856866", "0.5797256", "0.5770223", "0.5743431...
0.77536297
0
Check that we only render content once or if it has been marked as dirty.
def test_dirty_cache() -> None: content = [ Strip([Segment("foo")]), Strip([Segment("bar")]), Strip([Segment("baz")]), ] rendered_lines: list[int] = [] def get_content_line(y: int) -> Strip: rendered_lines.append(y) return content[y] styles = Styles() s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dirty(self):\n return not self.consistent", "def isDirty(self):\n\t#@DEBUG christophe have to fix denoising optionnal issue prior to set isDirty() to True\n return False", "def dirty(self) -> bool:\n return self.__dirty", "def isdirty(self):\n\n return not not self._olddata", ...
[ "0.6831709", "0.6653389", "0.6605487", "0.65676063", "0.6544088", "0.6544088", "0.6519632", "0.6519632", "0.64638853", "0.63433987", "0.63317883", "0.63255334", "0.63002825", "0.62966454", "0.6286773", "0.62516475", "0.6181001", "0.6179943", "0.61733055", "0.61635214", "0.612...
0.55647093
66
Remaps the value `x` (ranging from `min_x` to `max_x`) to a value ranging from `min_y` to `max_y`.
def remap(x: float, min_x: float, max_x: float, min_y: float, max_y: float) -> float: return min_y + (max_y - min_y) * ((x - min_x) / (max_x - min_x))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map(self, x, y):\n if near(x[0], xmax) and near(x[1], ymax):\n y[0] = x[0] - xmax\n y[1] = x[1] - ymax\n elif near(x[0], xmax):\n y[0] = x[0] - xmax\n y[1] = x[1]\n elif near(x[1], ymax):\n y[0] = x[0]\n y[1] = x[1] - ymax\n else...
[ "0.7707648", "0.7002668", "0.68580097", "0.68068284", "0.67506784", "0.6469885", "0.6415944", "0.6360299", "0.6295195", "0.62137926", "0.6204135", "0.62009853", "0.6177768", "0.6166108", "0.6118882", "0.6101499", "0.60898423", "0.60738873", "0.60470515", "0.6046584", "0.60197...
0.82469887
0
Clamps `x` to `min_x` on the bottom and `max_x` on the top.
def clamp(x: float, min_x: float, max_x: float) -> float: if x < min_x: return min_x elif x > max_x: return max_x return x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clip(x, min, max):\r\n # see decorator for function body\r\n # for grep: clamp, bound\r", "def clip(self, x):\n return self.min_value if x<self.min_value else self.max_value if x > self.max_value else x", "def clamp(min_value: float, max_value: float, value: float):\n\t\tvalue = min(value, max_v...
[ "0.69083524", "0.6883851", "0.66299367", "0.66258687", "0.66229886", "0.6594466", "0.6592013", "0.65834683", "0.6582262", "0.65337896", "0.6510339", "0.65084815", "0.65054435", "0.64963937", "0.6481131", "0.6470808", "0.6464931", "0.6427873", "0.64172363", "0.641455", "0.6394...
0.7616848
0
Returns the sign of `x`.
def signum(x: float) -> float: if x < 0: return -1.0 elif x > 0: return 1.0 return 0.0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sign(x):\n if x >= 0:\n return 1\n else:\n return -1", "def sign(x):\n return(copysign(1, x))", "def sign(x):\n if x >= 0:\n return 1\n return -1", "def sign(x):\n if x < 0.0:\n sign = -1\n elif x == 0.0:\n sign = 0\n elif x > 0.0:\n sign ...
[ "0.8346233", "0.82875556", "0.8269807", "0.7635054", "0.735797", "0.7207477", "0.70154953", "0.6905191", "0.6843425", "0.68372285", "0.68205696", "0.6807225", "0.6597398", "0.65678513", "0.65187556", "0.64728045", "0.64074284", "0.6390278", "0.6282725", "0.62244296", "0.62036...
0.759822
4
The set of arguments for constructing a Application resource.
def __init__(__self__, *, application_name: pulumi.Input[str], description: Optional[pulumi.Input[str]] = None, resource_group_id: Optional[pulumi.Input[str]] = None, tags: Optional[pulumi.Input[Mapping[str, Any]]] = None): pulumi.set(__self__,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def args_from_app(cls, app: 'App') -> 'Mapping[str, Any]':", "def __init__(__self__,\n resource_name: str,\n args: ApplicationArgs,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...", "def __init__(__self__,\n resource_name: str,\n ...
[ "0.6303736", "0.62984806", "0.62984806", "0.62984806", "0.62744284", "0.62020075", "0.6156656", "0.5924589", "0.58367443", "0.5795276", "0.5793395", "0.57801527", "0.5757526", "0.5742587", "0.5737013", "0.57181084", "0.57060695", "0.5625518", "0.5548457", "0.554756", "0.55303...
0.5857718
8
The name of the application.
def application_name(self) -> pulumi.Input[str]: return pulumi.get(self, "application_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name():\n return config.APP_NAME", "def app_name(self) -> str:\n return self._app_name", "def app_name(self):\n return self._app_name", "def app_name(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"app_name\")", "def app_name(self): # pylint:disable=funct...
[ "0.88987994", "0.8826656", "0.87065256", "0.8581351", "0.85392845", "0.8536273", "0.8536273", "0.82712877", "0.8257125", "0.8210752", "0.82000256", "0.8166687", "0.81319946", "0.7960315", "0.7956777", "0.7956144", "0.7917794", "0.7791835", "0.76966834", "0.7654247", "0.761626...
0.8217089
11
Application group description information.
def description(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "description")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_description(self):\n return self['contactgroup_name']", "def get_description(self):\n return self['hostgroup_name']", "def get_description(self):\n return self['servicegroup_name']", "def group_describe(self, group):\n mapped = self.map_vects(datanorm)\n mappednp= n...
[ "0.7121856", "0.70005167", "0.6946467", "0.63040036", "0.6078699", "0.60519594", "0.6045501", "0.6045501", "0.59388095", "0.5931283", "0.5903088", "0.5899129", "0.5891214", "0.588805", "0.58832586", "0.5855849", "0.57701254", "0.57570606", "0.5739233", "0.5737458", "0.5722582...
0.0
-1
The ID of the resource group.
def resource_group_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "resource_group_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_group_id(self) -> str:\n return pulumi.get(self, \"resource_group_id\")", "def resource_group_id(self) -> str:\n return pulumi.get(self, \"resource_group_id\")", "def resource_group_id(self) -> str:\n return pulumi.get(self, \"resource_group_id\")", "def resource_group_id(se...
[ "0.86649776", "0.86649776", "0.86649776", "0.86649776", "0.86649776", "0.8630538", "0.8593075", "0.8593075", "0.85067636", "0.84712285", "0.82789487", "0.82789487", "0.82789487", "0.82233447", "0.82016224", "0.82015216", "0.82015216", "0.82015216", "0.8195097", "0.81241107", ...
0.7949326
29
The tag of the resource.
def tags(self) -> Optional[pulumi.Input[Mapping[str, Any]]]: return pulumi.get(self, "tags")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tag(self) -> str:\n return pulumi.get(self, \"tag\")", "def tag(self):\n return self._tag", "def tag(self) -> str:\n return self._tag", "def tag(self):\n return self.tag_", "def tag(self):\n\n return self._tag", "def tag(self):\n return self._tag", "def get...
[ "0.8139763", "0.801916", "0.79860073", "0.79568666", "0.7909654", "0.787498", "0.7643261", "0.73970675", "0.73422575", "0.7266245", "0.72528666", "0.7234541", "0.7220991", "0.71797085", "0.71773046", "0.69190264", "0.69163066", "0.69163066", "0.69163066", "0.68166023", "0.679...
0.0
-1
Input properties used for looking up and filtering Application resources.
def __init__(__self__, *, application_name: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, resource_group_id: Optional[pulumi.Input[str]] = None, tags: Optional[pulumi.Input[Mapping[str, Any]]] = None): if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_resource_query(self):\n pass", "def get_resource_query(self):\n pass", "def resources(self):", "def properties(self):\r\n return resources.Properties(self)", "def resource_map(self):", "def __init__(__self__,\n resource_name: str,\n opts: Optio...
[ "0.572281", "0.572281", "0.5649089", "0.56316316", "0.56006944", "0.5520727", "0.54839826", "0.53856176", "0.5371801", "0.5370528", "0.5333146", "0.5333146", "0.5333146", "0.5333146", "0.5290779", "0.5284431", "0.5274373", "0.52638376", "0.5256537", "0.5256537", "0.5256537", ...
0.0
-1
The name of the application.
def application_name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "application_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name():\n return config.APP_NAME", "def app_name(self) -> str:\n return self._app_name", "def app_name(self):\n return self._app_name", "def app_name(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"app_name\")", "def app_name(self): # pylint:disable=funct...
[ "0.88987994", "0.8826656", "0.87065256", "0.8581351", "0.85392845", "0.8536273", "0.8536273", "0.82712877", "0.8257125", "0.8217089", "0.8217089", "0.8217089", "0.8217089", "0.8210752", "0.82000256", "0.8166687", "0.81319946", "0.7960315", "0.7956144", "0.7917794", "0.7791835...
0.7956777
18
Application group description information.
def description(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "description")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_description(self):\n return self['contactgroup_name']", "def get_description(self):\n return self['hostgroup_name']", "def get_description(self):\n return self['servicegroup_name']", "def group_describe(self, group):\n mapped = self.map_vects(datanorm)\n mappednp= n...
[ "0.7121031", "0.6999445", "0.69455683", "0.63045233", "0.60766155", "0.6051275", "0.60430706", "0.60430706", "0.593737", "0.59294695", "0.5902866", "0.5898261", "0.58896655", "0.5887561", "0.58826345", "0.58559996", "0.57683855", "0.57562155", "0.57379144", "0.5737829", "0.57...
0.0
-1
The ID of the resource group.
def resource_group_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "resource_group_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_group_id(self) -> str:\n return pulumi.get(self, \"resource_group_id\")", "def resource_group_id(self) -> str:\n return pulumi.get(self, \"resource_group_id\")", "def resource_group_id(self) -> str:\n return pulumi.get(self, \"resource_group_id\")", "def resource_group_id(se...
[ "0.8665304", "0.8665304", "0.8665304", "0.8665304", "0.8665304", "0.86281866", "0.859016", "0.859016", "0.85036665", "0.84688574", "0.8275475", "0.8275475", "0.8275475", "0.8220084", "0.820102", "0.820102", "0.820102", "0.819787", "0.81914556", "0.8124308", "0.80705386", "0...
0.79497033
27
The tag of the resource.
def tags(self) -> Optional[pulumi.Input[Mapping[str, Any]]]: return pulumi.get(self, "tags")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tag(self) -> str:\n return pulumi.get(self, \"tag\")", "def tag(self):\n return self._tag", "def tag(self) -> str:\n return self._tag", "def tag(self):\n return self.tag_", "def tag(self):\n\n return self._tag", "def tag(self):\n return self._tag", "def get...
[ "0.8139763", "0.801916", "0.79860073", "0.79568666", "0.7909654", "0.787498", "0.7643261", "0.73970675", "0.73422575", "0.7266245", "0.72528666", "0.7234541", "0.7220991", "0.71797085", "0.71773046", "0.69190264", "0.69163066", "0.69163066", "0.69163066", "0.68166023", "0.679...
0.0
-1
Provides a OOS Application resource.
def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, application_name: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, resource_group_id: Optional[pulumi.Input[s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_app(self):\n return Application()", "def app():\n app = create_app()\n return app", "def app():\n return aplicattion", "def app(self):\n if self._application is None:\n self._application = Application(client=self)\n return self._application", "def get_app(se...
[ "0.73059857", "0.7058227", "0.7043523", "0.70319784", "0.7018068", "0.6977092", "0.69748026", "0.6823485", "0.6793263", "0.6662604", "0.6583928", "0.6583928", "0.6533822", "0.64895785", "0.6478171", "0.6468239", "0.6433674", "0.6426639", "0.64216334", "0.6416922", "0.6408542"...
0.0
-1
Provides a OOS Application resource.
def __init__(__self__, resource_name: str, args: ApplicationArgs, opts: Optional[pulumi.ResourceOptions] = None): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_app(self):\n return Application()", "def app():\n app = create_app()\n return app", "def app():\n return aplicattion", "def app(self):\n if self._application is None:\n self._application = Application(client=self)\n return self._application", "def get_app(se...
[ "0.73088515", "0.7060569", "0.70460725", "0.7033564", "0.7020643", "0.6979786", "0.6975532", "0.6826027", "0.67952526", "0.666471", "0.6585517", "0.6585517", "0.6536473", "0.6490091", "0.6480043", "0.64701754", "0.643532", "0.6428545", "0.6422514", "0.6417917", "0.6409242", ...
0.60446274
48
Get an existing Application resource's state with the given name, id, and optional extra properties used to qualify the lookup.
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, application_name: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, resource_group_id: Optional[pulumi.Input[str]] = None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n app_name: Optional[pulumi.Input[str]] = None,\n bundle_id: Optional[pulumi.Input[str]] = None,\n encoded_icon: Optional[pulumi.Input[str]] = None,\n ...
[ "0.630705", "0.62093353", "0.5937807", "0.5906766", "0.58660024", "0.5842525", "0.5815528", "0.5810119", "0.57605904", "0.5707702", "0.56638414", "0.5595551", "0.5584274", "0.5507556", "0.54897803", "0.54602087", "0.545936", "0.5440434", "0.5406404", "0.53876024", "0.5386581"...
0.6578928
0
The name of the application.
def application_name(self) -> pulumi.Output[str]: return pulumi.get(self, "application_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name():\n return config.APP_NAME", "def app_name(self) -> str:\n return self._app_name", "def app_name(self):\n return self._app_name", "def app_name(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"app_name\")", "def app_name(self): # pylint:disable=funct...
[ "0.88987994", "0.8826656", "0.87065256", "0.8581351", "0.85392845", "0.82712877", "0.8257125", "0.8217089", "0.8217089", "0.8217089", "0.8217089", "0.8210752", "0.82000256", "0.8166687", "0.81319946", "0.7960315", "0.7956777", "0.7956144", "0.7917794", "0.7791835", "0.7696683...
0.8536273
5
Application group description information.
def description(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "description")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_description(self):\n return self['contactgroup_name']", "def get_description(self):\n return self['hostgroup_name']", "def get_description(self):\n return self['servicegroup_name']", "def group_describe(self, group):\n mapped = self.map_vects(datanorm)\n mappednp= n...
[ "0.7121856", "0.70005167", "0.6946467", "0.63040036", "0.6078699", "0.60519594", "0.6045501", "0.6045501", "0.59388095", "0.5931283", "0.5903088", "0.5899129", "0.5891214", "0.588805", "0.58832586", "0.5855849", "0.57701254", "0.57570606", "0.5739233", "0.5737458", "0.5722582...
0.0
-1
The ID of the resource group.
def resource_group_id(self) -> pulumi.Output[str]: return pulumi.get(self, "resource_group_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_group_id(self) -> str:\n return pulumi.get(self, \"resource_group_id\")", "def resource_group_id(self) -> str:\n return pulumi.get(self, \"resource_group_id\")", "def resource_group_id(self) -> str:\n return pulumi.get(self, \"resource_group_id\")", "def resource_group_id(se...
[ "0.86649776", "0.86649776", "0.86649776", "0.86649776", "0.86649776", "0.8630538", "0.8593075", "0.8593075", "0.85067636", "0.84712285", "0.82789487", "0.82789487", "0.82789487", "0.82233447", "0.82016224", "0.8195097", "0.81241107", "0.8074215", "0.80596274", "0.7949326", "0...
0.82015216
17
The tag of the resource.
def tags(self) -> pulumi.Output[Optional[Mapping[str, Any]]]: return pulumi.get(self, "tags")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tag(self) -> str:\n return pulumi.get(self, \"tag\")", "def tag(self):\n return self._tag", "def tag(self) -> str:\n return self._tag", "def tag(self):\n return self.tag_", "def tag(self):\n\n return self._tag", "def tag(self):\n return self._tag", "def get...
[ "0.8139763", "0.801916", "0.79860073", "0.79568666", "0.7909654", "0.787498", "0.7643261", "0.73970675", "0.73422575", "0.7266245", "0.72528666", "0.7234541", "0.7220991", "0.71797085", "0.71773046", "0.69190264", "0.69163066", "0.69163066", "0.69163066", "0.68166023", "0.679...
0.0
-1
Get the next word
def next(self) -> None: self._skip_space() beg = self.pos while self.pos < len(self.input) and self.input[self.pos] not in SPACES: self.pos += 1 if beg != self.pos: self.current_word = self.input[beg:self.pos] self.start_word = beg else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_word(self, start):\n end_idx = self.idx + len(start)\n if self.match(start):\n return self.line[end_idx] if end_idx < len(self.line) else END", "def __findNextWord(self):\n self.activeWindow().searchCurrentWordForward()", "def get_next_word(self, user_word, computer_wor...
[ "0.7626456", "0.7618756", "0.7401922", "0.72450376", "0.7239354", "0.7138103", "0.707038", "0.7048922", "0.7031582", "0.6879834", "0.6697155", "0.6669527", "0.66365993", "0.6633511", "0.6518907", "0.64728814", "0.64470905", "0.6434723", "0.6363361", "0.63243437", "0.6316042",...
0.7083728
6
Count the approximate number of words in a file.
def count_words(filename): try: with open(filename, encoding = "utf-8") as f_odj: contents = f_odj.read() except FileNotFoundError: msg = "Sorry, the file " + filename + " does not exist." print(msg) else: words = contents.split() num_words = len(words) print("The file " + filename + " has about " + s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_words(filename):", "def count_words_in_file(file_name):\n\n\treturn len(get_words_in_file(file_name))", "def count_words(filename):\n\ttry:\n\t\twith open(filename, encoding='utf-8') as f_obj:\n\t\t\tcontents = f_obj.read()\n\texcept FileNotFoundError:\n\t\tmsg = \"Sorry, the file \" + filename + \" ...
[ "0.89932305", "0.87853706", "0.8404579", "0.82420474", "0.82336766", "0.82162976", "0.814177", "0.80925703", "0.8089069", "0.8040269", "0.7950105", "0.79354155", "0.7916694", "0.7770902", "0.7747514", "0.7704495", "0.763296", "0.7585351", "0.7514763", "0.748077", "0.74705595"...
0.81379974
7
Count the approximate number of words in a file.
def count_words(filename): try: with open(filename, encoding = "utf-8") as f_odj: contents = f_odj.read() except FileNotFoundError: pass #this command tells python to print nothing when a command fails. else: words = contents.split() num_words = len(words) print("The file " + filename + " has about " + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_words(filename):", "def count_words_in_file(file_name):\n\n\treturn len(get_words_in_file(file_name))", "def count_words(filename):\n\ttry:\n\t\twith open(filename, encoding='utf-8') as f_obj:\n\t\t\tcontents = f_obj.read()\n\texcept FileNotFoundError:\n\t\tmsg = \"Sorry, the file \" + filename + \" ...
[ "0.8993027", "0.8785405", "0.84043276", "0.82422566", "0.8233603", "0.82161885", "0.81400055", "0.81380624", "0.80892265", "0.8040543", "0.7949354", "0.79345626", "0.79173636", "0.7771164", "0.7748071", "0.770566", "0.7631951", "0.7584785", "0.75147754", "0.748066", "0.746994...
0.80925614
8
Greet the user by name
def greet_user(): filename = "username.json" try: with open(filename) as f_obj: username = json.load(f_obj) except FileNotFoundError: username = input("What is your name? ") with open(filename, "w") as f_obj: json.dump(username, f_obj) print("We'll remember you when you come back, " + username + "!")...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def greet_player(name):\n\t\n\tprint \"How are are you doing %s?\" % name", "def greet_user(name = 'Menoetius'):\n print(\"Hello, my name is \" + name.title() + \"!\")", "def greet_by_name(name):\r\n greeting = \"Hello, \" + name + \"!\"\r\n return greeting", "def greet_user(username):\n print(\"...
[ "0.8319358", "0.8114963", "0.80059963", "0.79622996", "0.79603666", "0.793943", "0.793943", "0.78609365", "0.7816885", "0.7785995", "0.7774264", "0.7766414", "0.7681205", "0.76318306", "0.762691", "0.7624618", "0.7624618", "0.76201487", "0.76146126", "0.76101714", "0.76046216...
0.6630704
76
Get stored username if available.
def get_stored_username(): filename = "username.json" try: with open(filename) as f_obj: username = json.load(f_obj) except FileNotFoundError: return None else: return username
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_stored_username():\n\tfilename = \"username.json\"\n\ttry:\n\t\twith open(filename) as f_obj:\n\t\t\tusername = json.load(f_obj)\n\texcept FileNotFoundError:\n\t\treturn None \n\telse:\n\t\treturn username", "def get_stored_username():\r\n filename = 'username.json'\r\n try:\r\n with open(fi...
[ "0.80084234", "0.7860824", "0.7860824", "0.77337587", "0.7692235", "0.7661099", "0.7614534", "0.7614534", "0.7606338", "0.76051843", "0.7582414", "0.7569334", "0.7553831", "0.7550343", "0.7530772", "0.75279033", "0.75176704", "0.7506862", "0.74946254", "0.7452427", "0.7451952...
0.8053478
0
greet the user by name.
def greet_user(): username = get_stored_username() if username: print("Welcome back, " + username + "!") else: username = input("What is your name? ") filename = "username.json" with open(filename, "w") as f_obj: json.dump(username, f_obj) print("We'll remember you when you come back, " + username + "!...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def greet_user(username):\n print(\"Hello, \" + username + \"!\")", "def greet_user(username):\r\n print(\"Hello, \" + username + \"!\")", "def greet_user(username):\n print(\"Hello, \" + username.title() + \"!\")", "def greet_user(username):\n print(\"Hello, \" + username.title() + \"!\")", "d...
[ "0.7742676", "0.77161276", "0.759533", "0.759533", "0.750161", "0.7432845", "0.7402234", "0.739661", "0.7388008", "0.73610723", "0.7324235", "0.7311232", "0.7292612", "0.7254287", "0.7243225", "0.7217397", "0.7217397", "0.7217397", "0.7172", "0.7172", "0.7117727", "0.709095...
0.6924233
30
Get stored username if available.
def get_stored_username(): filename = "username.json" try: with open(filename) as f_obj: username = json.load(f_obj) except FileNotFoundError: return None else: return username
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_stored_username():\n\tfilename = \"username.json\"\n\ttry:\n\t\twith open(filename) as f_obj:\n\t\t\tusername = json.load(f_obj)\n\texcept FileNotFoundError:\n\t\treturn None \n\n\telse:\n\t\treturn username", "def get_stored_username():\r\n filename = 'username.json'\r\n try:\r\n with open(...
[ "0.8051945", "0.78594524", "0.78594524", "0.77323157", "0.76917595", "0.7660222", "0.7613819", "0.7613819", "0.760575", "0.7604611", "0.75829405", "0.7569313", "0.75526786", "0.7548911", "0.7530948", "0.7527688", "0.75176305", "0.7505123", "0.74932265", "0.74517757", "0.74511...
0.800696
1
prompt for a new username.
def get_new_username(): username = input("What is your name? ") filename = "username.json" with open(filename, "w") as f_obj: json.dump(username, f_obj) return username
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def input_and_create_user(self):\n print(\"Please input username!\")\n new_username = input()\n new_user = user.User(new_username)\n self.users.append(new_user)", "def __prompt_name(self):\n self.clear_screen()\n self.__print_logo()\n\n name = input(\"[!] Enter ne...
[ "0.7945897", "0.79331565", "0.7831605", "0.758654", "0.7362103", "0.7331439", "0.7292974", "0.7179022", "0.7135102", "0.7087243", "0.70828086", "0.70654726", "0.703393", "0.70313114", "0.6981965", "0.6892832", "0.68580496", "0.68551683", "0.68336195", "0.6819505", "0.6805377"...
0.71003455
9
greet the user by name.
def greet_user(): username = get_stored_username() if username: print("Welcome back, " + username + "!") else: username = get_new_username() print("We'll remember you when you come back, " + username + "!")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def greet_user(username):\n print(\"Hello, \" + username + \"!\")", "def greet_user(username):\r\n print(\"Hello, \" + username + \"!\")", "def greet_user(username):\n print(\"Hello, \" + username.title() + \"!\")", "def greet_user(username):\n print(\"Hello, \" + username.title() + \"!\")", "d...
[ "0.7742676", "0.77161276", "0.759533", "0.759533", "0.750161", "0.7432845", "0.7402234", "0.739661", "0.7388008", "0.73610723", "0.7324235", "0.7311232", "0.7292612", "0.7254287", "0.7243225", "0.7217397", "0.7217397", "0.7217397", "0.7172", "0.7172", "0.7117727", "0.709095...
0.7057291
22
returns a list of paragraphs contained in the text
def get_paragraphs(text): return [LINE_START.sub(' ', p) for p in PARAGRAPH_SEP.split(text)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def paragraph(self, text):\n return [text]", "def split_text_into_paragraphs(text: str) -> List[str]:\n text_aux = text.strip()\n paragraphs = text_aux.split('\\n\\n') # Strip any leading whitespaces\n\n for p in paragraphs:\n p = p.strip()\n\n return [p.strip() for p in paragraphs if l...
[ "0.83955187", "0.8125166", "0.73720586", "0.73144215", "0.72213405", "0.72148705", "0.7213667", "0.71561956", "0.7006088", "0.69887197", "0.6966877", "0.6940387", "0.6864319", "0.67950994", "0.6791216", "0.6780613", "0.67112476", "0.6685332", "0.66705334", "0.6630639", "0.656...
0.84038633
0
Returns the summary description for this Extension, which, by convention, is the first paragraph of the description.
def summary(self): return get_paragraphs(self.description)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def description(self):\n if hasattr(self.ext, 'description'):\n return self.ext.description.strip()\n elif self.ext.__class__.__doc__:\n return self.ext.__class__.__doc__.strip()\n else:\n return ''", "def get_description(self):\n return IntrospectorHe...
[ "0.78256536", "0.7639952", "0.7486263", "0.7451264", "0.7446568", "0.74452317", "0.74394786", "0.7426617", "0.74184203", "0.73955905", "0.7391044", "0.7347202", "0.7347202", "0.7345788", "0.7345788", "0.73437405", "0.73416024", "0.73233247", "0.7322152", "0.73155564", "0.7305...
0.8215133
0
The description for an extension is specified in the ``description`` attribute, or (legacy) as a docstring for the extension's class. If neither method is used in the Extension, an empty string is returned. Description is assumed to be formed as reStructuredText. Leading and trailing whitespace will be stripped away.
def description(self): if hasattr(self.ext, 'description'): return self.ext.description.strip() elif self.ext.__class__.__doc__: return self.ext.__class__.__doc__.strip() else: return ''
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_description(cls) -> str:\n return cls.__doc__ or \"\"", "def get_description(self):\n class_docs = self._clean_docs(get_view_description(self.callback))\n method_docs = self._clean_docs(formatting.dedent(smart_text(self.get_docs())))\n\n if self.yaml_parser.get_param('replace_...
[ "0.77743053", "0.7568844", "0.751977", "0.7513608", "0.7374288", "0.71934885", "0.7123118", "0.7123118", "0.7105097", "0.70527655", "0.70462865", "0.70462865", "0.70462865", "0.70075434", "0.6994637", "0.69777375", "0.6932944", "0.6932944", "0.6932944", "0.6896635", "0.689663...
0.8140012
0
Parse the definition of a lambda function in to a readable string.
def _parse_lambda(text): text = text.split('lambda')[1] param, rest = text.split(':') param = param.strip() # There are three things that could terminate a lambda: an (unparenthesized) # comma, a new line and an (unmatched) close paren. term_chars = [',', '\n', ')'] func_text = '' inside...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_func_dict(self):\n\t\tindex = 0\n\t\twhile index < len(self.tokens):\n\t\t\tif self.tokens[index] == '\\\\': #Lambda\n\t\t\t\t#Every lambda looks like this:\n\t\t\t\t#(\\ (param1:type1, ...) : return_type\n\t\t\t\t# expression)\n\n\t\t\t\t#That expression can then be used as a function\n\t\t\t\t#i.e. ( ...
[ "0.6225172", "0.59550136", "0.5897792", "0.5850685", "0.562561", "0.5619098", "0.5595857", "0.5573676", "0.5565101", "0.5544661", "0.5513691", "0.54889256", "0.5487526", "0.54580456", "0.5446128", "0.54205024", "0.5382486", "0.5373196", "0.5371395", "0.5340549", "0.5324547", ...
0.74260104
0
Create a new Currency dict and add it to the CurrencyHandler.
def add(self, key, name, value, amount): if key in self.attr_dict: raise CurrencyException("Currency '{}' already exists.".format(key)) currency = dict(name=name, value=value, amount=amount) self.attr_dict[key] = currency
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, currency, display_currency):\n self.currency = currency\n self.display_currency = display_currency\n self.values = None", "def map_to_currency(self, raw_currency: HitbtcRawCurrencyModel) -> HitbtcCurrencyModel:\n\n id_ = raw_currency[\"id\"]\n full_name = raw...
[ "0.5917275", "0.570883", "0.5634314", "0.56333137", "0.55009085", "0.5496", "0.5457588", "0.5425929", "0.53408206", "0.5267455", "0.5263783", "0.52430415", "0.5228132", "0.5224954", "0.51914513", "0.51243484", "0.5094641", "0.5089338", "0.50723237", "0.5067563", "0.50572497",...
0.63672763
0
Remove a Currency type from the handler's parent object.
def remove(self, currency): if currency not in self.attr_dict: raise CurrencyException("Currency not found: {}".format(currency)) if currency in self.cache: del self.cache[currency] del self.attr_dict[currency]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear(self):\r\n # Remove all Currency from the handler's parent object.\r\n for currency in self.all:\r\n self.remove(currency)", "def remove_type(self, name):\n del self.types[name]", "def remove_type(self, ):\n if self.AttributeNames.TYPE in self.attrs:\n ...
[ "0.6193116", "0.55905527", "0.549678", "0.5357405", "0.51942194", "0.51325464", "0.51260585", "0.5102608", "0.50955", "0.5081388", "0.5029094", "0.50187397", "0.49982652", "0.49570727", "0.4936209", "0.4920673", "0.49129695", "0.49034035", "0.4890635", "0.48889416", "0.487815...
0.5936809
1
Remove all Currency dicts from the handler's parent object.
def clear(self): # Remove all Currency from the handler's parent object. for currency in self.all: self.remove(currency)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup(self):\n for key in list(self.__dict__.keys()):\n delattr(self, key)", "def cleanup(child):\n children = child.get('children', [])\n for childchild in children:\n cleanup(childchild)\n cleaned = {u'title': child['Title'], u'name': child['id'],\n ...
[ "0.57909", "0.5746782", "0.56116277", "0.55796325", "0.54936713", "0.5380487", "0.5332281", "0.5308741", "0.53043014", "0.52858925", "0.52858526", "0.5236914", "0.522649", "0.51926285", "0.51492065", "0.5148016", "0.5147857", "0.5141735", "0.5112459", "0.5112424", "0.509728",...
0.79079336
0
Return a list of all currency dicts in CurrencyHandler.
def all(self): return self.attr_dict.keys()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_currencies(self):\n cache_key = key_from_list([\n Transaction().database.name,\n Transaction().user,\n 'nereid.website.get_currencies',\n ])\n # The website is automatically appended to the cache prefix\n rv = cache.get(cache_key)\n if rv ...
[ "0.70578814", "0.6960192", "0.69581383", "0.6899935", "0.6881003", "0.6805579", "0.6787807", "0.6785957", "0.6660548", "0.66201127", "0.6607007", "0.6506419", "0.64668596", "0.6377298", "0.6328158", "0.62963367", "0.6219524", "0.62101424", "0.6160421", "0.607411", "0.6035708"...
0.0
-1
Return a formatted list of currency and amounts in this CurrencyHandler.
def contents(self): liststr = "" for key in self.attr_dict.keys(): cur = Currency(self.attr_dict[key]) if cur.amount > 0: liststr += "{}, ".format(cur) if len(liststr.strip()) > 0: return liststr[:-2] else: return l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def returnCurrencies(self):\n pass", "def currencies(self):\r\n return currencies.Currencies(self)", "def getCurrencies():", "def currencies(self) -> localedata.LocaleDataDict:\n return self._data['currency_names']", "def currencies():\n return _CURRENCIES", "def get_currencies(se...
[ "0.705702", "0.67686605", "0.66665345", "0.6634636", "0.6353972", "0.6322486", "0.6319096", "0.627869", "0.62064356", "0.60974497", "0.60969007", "0.6047743", "0.6019805", "0.6012334", "0.60031885", "0.59874904", "0.59807676", "0.59563595", "0.59287757", "0.5878121", "0.58125...
0.6632526
4
Calculates the effective value for each Currency dict contained in the CurrencyHandler based on the amount value attributes in each dict and then returns a formatted list of currency and amounts in CurrencyHandler
def total(self): total = 0 in_currency = None for key in self.attr_dict.keys(): cur = Currency(self.attr_dict[key]) if cur.amount > 0: # Add currency to the total total += cur.amount * cur.value if in_currency is None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _amount_all(self):\n res = {}\n ut_obj = self.env['l10n.ut']\n for iwdl_brw in self.browse(self.ids):\n # Using a clousure to make this call shorter\n f_xc = ut_obj.sxc(\n iwdl_brw.invoice_id.company_id.currency_id.id,\n iwdl_brw.invoice_...
[ "0.6303145", "0.62083", "0.610535", "0.59546936", "0.5936375", "0.5872894", "0.5867872", "0.58499026", "0.5800917", "0.57430327", "0.5654758", "0.5643232", "0.5592844", "0.55193615", "0.55116636", "0.54923713", "0.54861784", "0.5383871", "0.53630614", "0.5346229", "0.5344188"...
0.5877762
5
Support equality comparison Currency or Currency and numeric
def __eq__(self, other): if type(other) == Currency: return self.amount == other.amount elif type(other) in (float, int): return self.amount == other else: return NotImplemented
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_same(from_currency, to_currency):\n return from_currency == to_currency", "def test_no_decimals_01(self):\n self.assertEqual(currency(188.01, False), \"$188.01\")", "def almost_equals(self, other, decimal=...): # -> bool:\n ...", "def test_cast_non_numeric_true():\n assert _curren...
[ "0.6794627", "0.64148045", "0.62916714", "0.6287303", "0.60861164", "0.60342294", "0.6019424", "0.5987673", "0.59783924", "0.59031796", "0.58725405", "0.58359087", "0.58123523", "0.5782787", "0.574468", "0.5706439", "0.56989497", "0.5686803", "0.5669239", "0.5667254", "0.5640...
0.71312416
0
Display name attribute for Currency dict
def name(self): return self._data['name']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getCurrencyName(id=None):", "def getcurrencyfullname(self):\n return self.__currencyFullName", "def currency_name(self, init):\r\n\r\n c2 = CurrencyCodes()\r\n c_name = c2.get_currency_name(init)\r\n return c_name", "def get_currencies_names():\n names = [x for x in cur_dic...
[ "0.7602148", "0.7265514", "0.7119461", "0.69989365", "0.69216484", "0.68386245", "0.6701177", "0.6630605", "0.6585435", "0.6438426", "0.6314373", "0.6314373", "0.6185031", "0.6162813", "0.6149609", "0.6097963", "0.6066696", "0.60457176", "0.6032027", "0.6029877", "0.6021027",...
0.0
-1
Display value attribute for Currency dict
def value(self): return self._data['value']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self) -> str:\n return f'{self.amount}{self.currency}'", "def getValue(currency=None):", "def currency(self):\n return self._dict.get('currency')", "def contents(self):\r\n liststr = \"\"\r\n for key in self.attr_dict.keys():\r\n cur = Currency(self.attr_dic...
[ "0.6828028", "0.6702874", "0.67013633", "0.6666153", "0.6657247", "0.65943104", "0.6487378", "0.64022624", "0.6371257", "0.6335991", "0.625093", "0.622698", "0.6216161", "0.62080675", "0.6172811", "0.61631316", "0.6135629", "0.61307764", "0.6121551", "0.61151177", "0.61043394...
0.0
-1
Display amount attribute for Currency dict
def amount(self): return self._data['amount']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self) -> str:\n return f'{self.amount}{self.currency}'", "def currency(self):\n return self._dict.get('currency')", "def getUserCurrency():", "def contents(self):\r\n liststr = \"\"\r\n for key in self.attr_dict.keys():\r\n cur = Currency(self.attr_dict[key]...
[ "0.7142639", "0.6844769", "0.66623306", "0.6656787", "0.6641012", "0.64849335", "0.64832294", "0.64198047", "0.63667685", "0.63469034", "0.62309015", "0.62241787", "0.62167436", "0.61944413", "0.61734146", "0.6135562", "0.61244303", "0.612251", "0.6120844", "0.6105964", "0.61...
0.640384
8
Use to convert Currency from one defined type, into another based on their defined values in the CurrencyHandler.
def convert(self, obj, amount=None): if isinstance(obj, Currency): if not amount: # Convert the full amount amount_to_convert = obj.amount else: if type(amount) in (int, float): if amount > obj.amount: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _convert(self, from_amount, to_currency, company, date, round=True):\n self, to_currency = self or to_currency, to_currency or self\n assert self, \"convert amount from unknown currency\"\n assert to_currency, \"convert amount to unknown currency\"\n assert company, \"convert amount...
[ "0.6929995", "0.6736516", "0.6692797", "0.65320307", "0.6366181", "0.63392335", "0.6271134", "0.61462563", "0.611356", "0.6068454", "0.60187554", "0.5979764", "0.59433794", "0.59123975", "0.5848342", "0.5832905", "0.57759947", "0.57667243", "0.57433647", "0.5731579", "0.56891...
0.5485178
27
Return a function to evaluate the discrete Morse homotopy associated with an acyclic partial matching
def MorseMatchingHomotopy(M, cellcomplex): # Semantic sugar def bd(chain): return cellcomplex.boundary(chain) def dim(chain_or_cell): return chain_or_cell.dimension() def isAce(cell): return dim(cell) == dim(M(cell)) def isKing(cell): return dim(cell) > dim(M(cell)) def isQueen(cell): return dim(cell) < dim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n long_sequence = input(\"Please give ne a DNA sequence to search: \")\n short_sequence = input(\"What DNA sequence would you like to match? \")\n\n # converts characters to uppercase\n new_long_sequence = long_sequence.upper()\n new_short_sequence = short_sequence.upper()\n\n ans = h...
[ "0.568604", "0.5550278", "0.55182356", "0.5509188", "0.55079424", "0.545774", "0.5452866", "0.5362582", "0.5347199", "0.53404784", "0.5319574", "0.5285013", "0.52706766", "0.5214127", "0.52138937", "0.52030486", "0.5202635", "0.51983035", "0.51891065", "0.5171054", "0.5169706...
0.6065373
0
Implement the discrete Morse homotopy gamma
def homotopy(chain): # We clone the input chain to prevent unexpected alterations work_chain = copy.deepcopy(chain) # We create a dictionary "priority" which gives the rank of queens. # Lower priority numbers will be processed first (i.e. priority ranking, not priority value) Queens = [Q for Q in c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gamma(self):\r\n raise NotImplementedError('not implemented yet, will use spouge approximation')", "def gamma(p, m):\r\n return 1/np.sqrt(1-beta(p, m)**2)", "def gamma(x):\n return 0.0", "def gamma_0(d_matrix, ne, ng, omega, MCut):\r\n prefactor = mu_0**2/(12*np.pi**3*hbar**2*c**2)\r\...
[ "0.75914174", "0.70648074", "0.70197415", "0.68081534", "0.67775464", "0.67721176", "0.6688346", "0.666195", "0.6642769", "0.6627144", "0.66267914", "0.66091704", "0.6601272", "0.6530073", "0.65044415", "0.6472152", "0.63802207", "0.63793516", "0.6353495", "0.6327185", "0.631...
0.0
-1
Iterate over buckets of data in ANI HDF5 file. Yields dicts with atomic numbers (shape [Na,]) coordinated (shape [Nc, Na, 3]) and other available properties specified by `keys` list, w/o NaN values.
def iter_data_buckets(h5filename, keys=['wb97x_dz.energy']): keys = set(keys) keys.discard('atomic_numbers') keys.discard('coordinates') with h5py.File(h5filename, 'r') as f: for grp in f.values(): Nc = grp['coordinates'].shape[0] mask = np.ones(Nc, dtype=np.bool) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iterkeys(self):\n\n for bucket in self.buckets.itervalues():\n for key in bucket.iterkeys():\n yield key", "def htable(nbuckets):", "def __iter__(self):\n for bucket in self._table:\n if bucket is not None:\n for key in bucket:\n ...
[ "0.5657797", "0.5585814", "0.53900796", "0.5333531", "0.5257857", "0.5257857", "0.52129817", "0.51868516", "0.50570804", "0.5018617", "0.50166976", "0.49701107", "0.4946062", "0.49454343", "0.484364", "0.4842193", "0.4812853", "0.47965416", "0.47817302", "0.47817302", "0.4780...
0.79150766
0
Count the number of upper case characters in a given message `message` is the piece of text to be checked Returns the number of uppercase characters in a message
def count_upper_case(message): return sum([1 for c in message if c.isupper()])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getLength(message):\r\n length = 0\r\n for char in message:\r\n if char in alphaUpper or alphaLower:\r\n length += 1\r\n return length", "def case_count(in_string):\n uppercase_count = 0\n lowercase_count = 0\n\n for letter in in_string:\n if letter != \" \":\n ...
[ "0.76881474", "0.66344357", "0.64046204", "0.6375004", "0.6359969", "0.63339776", "0.62310714", "0.62267077", "0.61728984", "0.6039535", "0.6034788", "0.603373", "0.5897213", "0.58886296", "0.5847596", "0.58371395", "0.5793622", "0.5778446", "0.576237", "0.572816", "0.5728015...
0.92106265
0
Check if Stack Exchange API is reachable.
def stack_exchange_is_reachable(context): try: requests.get(context.platform_url, timeout=context.request_timeout) except requests.ConnectionError: raise requests.ConnectionError('Unable to connect to the test URL {} -' ' please ensure that Stack Exchange API is reachable' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_internet_connection():\n logging.debug('Checking internet connection')\n try:\n urlopen(config.api_base_url,\n timeout=config.timeout_internet_connection)\n logging.debug('Connected to the internet')\n return True\n except URLError ...
[ "0.66989774", "0.66208327", "0.6614344", "0.6565945", "0.65571225", "0.65221137", "0.65119606", "0.65000445", "0.645827", "0.6399361", "0.6377966", "0.63600194", "0.632734", "0.6323393", "0.62960714", "0.6262202", "0.62426513", "0.62426513", "0.6221098", "0.6217657", "0.62105...
0.8277769
0
Get activity feed for a specific term. Will save the response to the context.response.
def get_activity_feed(context, term): if not term: raise ValueError('You have to provide a search term!') url = '{}{}'.format(context.test_url, term) response = requests.get(url, timeout=context.request_timeout) context.response = response logging.debug('Request URL: %s', response.request.ur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, term=None):\r\n params = base.get_params(None, locals())\r\n\r\n return http.Request('GET', self.get_url(), params), parsers.parse_json", "def get_timeline_feed(self):\n return self.send_request('feed/timeline/')", "def find(self, term, org_id=None, start=None, limit=None):\r...
[ "0.56197536", "0.5552734", "0.54598755", "0.537812", "0.5318107", "0.5318107", "0.5227282", "0.52052367", "0.5178025", "0.5172108", "0.5171409", "0.5165473", "0.5093184", "0.50673497", "0.50450003", "0.5041239", "0.502026", "0.49861795", "0.49600667", "0.4909415", "0.4890173"...
0.8386549
0
Check whether response contain an array of items of a given name.
def response_contains_array_named(context, array_name): assert context.response response = context.response.json() assert array_name in response assert isinstance(response[array_name], list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def items_should_contain_array_of_tags(context):\n items = context.response.json()['items']\n for item in items:\n assert 'tags' in item\n assert isinstance(item['tags'], list)\n assert len(item['tags']) > 0", "def assertContains(self, response, item):\n self.assertTrue(item in ...
[ "0.6806014", "0.6544438", "0.63810015", "0.6246651", "0.62384456", "0.6114904", "0.6087918", "0.5934501", "0.5888366", "0.5861772", "0.5813326", "0.57487196", "0.5719626", "0.57110256", "0.5709076", "0.57081497", "0.56947345", "0.5662339", "0.56485534", "0.56288683", "0.56015...
0.7968945
0
Check whether response contains all expected meta fields.
def response_contains_meta_data(context): meta_fields = ['has_more', 'quota_max', 'quota_remaining'] assert context.response response = context.response.json() all(field in response for field in meta_fields) logging.debug( 'Response contains all expected meta fields: %s', ', '.join(m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_response_with_requested_fields(self, response):\n self.verify_response_block_dict(response)\n for block_key_string, block_data in response.data['blocks'].items():\n block_key = deserialize_usage_key(block_key_string, self.course_key)\n xblock = self.store.get_item(blo...
[ "0.6693891", "0.6663167", "0.6655489", "0.66543275", "0.66095656", "0.6575519", "0.65531754", "0.65499854", "0.64771754", "0.6439268", "0.6378267", "0.6323601", "0.6306553", "0.630628", "0.630395", "0.6283602", "0.62788475", "0.627194", "0.62715685", "0.626346", "0.6247732", ...
0.8509814
0
Ensure that every item in the response contains an array of tags.
def items_should_contain_array_of_tags(context): items = context.response.json()['items'] for item in items: assert 'tags' in item assert isinstance(item['tags'], list) assert len(item['tags']) > 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_badge_should_have_tags(self):\n\n badge = self.get_sample_badge()\n # It's a string, even though it is used as a URL\n self.assertIsInstance(badge.tags, list)", "def tags(self, val: list):\n self._tags = []\n if val is not None:\n for item in val:\n ...
[ "0.65274763", "0.6096695", "0.60390615", "0.6012579", "0.59465754", "0.5924211", "0.5851703", "0.58414054", "0.58393604", "0.574799", "0.5740444", "0.57277584", "0.57275933", "0.5697522", "0.568074", "0.56763333", "0.5671604", "0.56634396", "0.56573635", "0.5625177", "0.56193...
0.8310971
0
Ensure that every item in the response contains a valid Owner object.
def items_should_contain_owner_object(context): items = context.response.json()['items'] existing_owner_fields = [ 'accept_rate', 'display_name', 'link', 'profile_image', 'reputation', 'user_id', 'user_type' ] non_existing_owner_fields = ['display_name', 'user_type'] for item in ite...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_owner(self):\n self.business_item_class.businesses_list = [{\"owner\": \"chairman\", \"business_name\":\"Maendeleo\", \"category\":\"Backaend\", \"location\":\"myhomecity\"},\n {\"owner\": \"chairmanwe\", \"business_name\":\"NshMaendeleo\", \"category...
[ "0.67120254", "0.628647", "0.626169", "0.6243804", "0.6208822", "0.62073964", "0.61624324", "0.6073476", "0.58263224", "0.5776256", "0.5770972", "0.5699032", "0.56948596", "0.56849164", "0.568436", "0.5622189", "0.5601501", "0.55977744", "0.55893403", "0.5566115", "0.5523703"...
0.746889
0
Ensure that every item in the response has all required fields.
def items_should_contain_required_values(context): items = context.response.json()['items'] item_fields = [ 'answer_count', 'creation_date', 'is_answered', 'last_activity_date', 'last_edit_date', 'link', 'question_id', 'score', 'title', 'view_count' ] for item in items: all(field...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_required_fields(self):\n assert self.title\n assert self.format", "def validate_get_openings_result(self, result):\n\n\n requiredFields = {'company', 'title', 'url', 'locations'}\n #optionalFields = {'department', 'description'}\n\n for r in result:\n if not requiredField...
[ "0.68737304", "0.68655205", "0.66592115", "0.6587089", "0.64782315", "0.64589465", "0.64533013", "0.6435127", "0.64257926", "0.64171165", "0.63953066", "0.6352463", "0.6342748", "0.62600017", "0.6251869", "0.62157905", "0.61955905", "0.6174185", "0.6167766", "0.6143471", "0.6...
0.7643728
0
Ensure that every existing owner has a valid profile link.
def every_existing_owner_should_have_valid_profile_link(context): items = context.response.json()['items'] for item in items: owner = item['owner'] if owner['user_type'] == 'does_not_exist': continue link = owner['link'] assert validators.url(link), ( 'Own...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def every_existing_owner_should_have_valid_profile_image_link(context):\n items = context.response.json()['items']\n for item in items:\n owner = item['owner']\n if owner['user_type'] == 'does_not_exist':\n continue\n link = owner['profile_image']\n assert validators.ur...
[ "0.81346124", "0.7327867", "0.70217496", "0.57078815", "0.56042165", "0.5574404", "0.5555378", "0.5555031", "0.5531482", "0.55212975", "0.54598325", "0.5458646", "0.54356337", "0.5423258", "0.54028314", "0.53994626", "0.5353369", "0.5349723", "0.5343116", "0.5318732", "0.5305...
0.8567939
0
Ensure that every nonexisting owner does not have a profile link.
def every_non_existing_owner_should_not_have_profile_link(context): items = context.response.json()['items'] for item in items: owner = item['owner'] if not owner['user_type'] == 'does_not_exist': continue assert 'link' not in owner logging.debug( 'Not exi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def every_non_existing_owner_should_not_have_profile_image_link(context):\n items = context.response.json()['items']\n for item in items:\n owner = item['owner']\n if not owner['user_type'] == 'does_not_exist':\n continue\n assert 'profile_image' not in owner\n logging....
[ "0.7915558", "0.7725596", "0.732559", "0.5984721", "0.5927636", "0.5710254", "0.56239164", "0.561968", "0.55680996", "0.5519447", "0.5508988", "0.55037135", "0.5468769", "0.54237384", "0.5405099", "0.5354824", "0.5347382", "0.5337534", "0.5323421", "0.5308325", "0.5308029", ...
0.8253403
0
Ensure that every existing owner has a valid profile image link.
def every_existing_owner_should_have_valid_profile_image_link(context): items = context.response.json()['items'] for item in items: owner = item['owner'] if owner['user_type'] == 'does_not_exist': continue link = owner['profile_image'] assert validators.url(link), ( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def every_existing_owner_should_have_valid_profile_link(context):\n items = context.response.json()['items']\n for item in items:\n owner = item['owner']\n if owner['user_type'] == 'does_not_exist':\n continue\n link = owner['link']\n assert validators.url(link), (\n ...
[ "0.79280406", "0.7527706", "0.6885025", "0.60402876", "0.6003037", "0.59512144", "0.5904009", "0.56071186", "0.5574767", "0.5533807", "0.5490869", "0.5467004", "0.54500294", "0.5436294", "0.5308155", "0.530222", "0.5301662", "0.52993053", "0.5294203", "0.5291245", "0.52869546...
0.8664172
0
Ensure that every nonexisting owner does not have a profile image link.
def every_non_existing_owner_should_not_have_profile_image_link(context): items = context.response.json()['items'] for item in items: owner = item['owner'] if not owner['user_type'] == 'does_not_exist': continue assert 'profile_image' not in owner logging.debug( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def every_existing_owner_should_have_valid_profile_image_link(context):\n items = context.response.json()['items']\n for item in items:\n owner = item['owner']\n if owner['user_type'] == 'does_not_exist':\n continue\n link = owner['profile_image']\n assert validators.ur...
[ "0.7888664", "0.7846485", "0.7278047", "0.5966033", "0.577156", "0.56805646", "0.5594332", "0.55319285", "0.55122435", "0.55100256", "0.54839927", "0.54645336", "0.5443735", "0.5442845", "0.5432065", "0.5430972", "0.54200304", "0.5411189", "0.538969", "0.53602254", "0.5352974...
0.8378017
0
Save all the tags from the response to a list and remove the duplicates.
def save_tags(context): items = context.response.json()['items'] tags = set() for item in items: for tag in item['tags']: tags.add(tag) context.tags = list(tags) logging.debug('Saved all tags in context.tags:\n%s', pformat(sorted(context.tags)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags_list_should_have_no_duplicates(context):\n assert context.tags\n # converting a list to a set will remove all the duplicates\n # then we need to:\n # * convert it back to a list\n # * sort both lists\n # and finally compare both lists\n unique_tags = list(set(context.tags))\n asser...
[ "0.6612473", "0.65779996", "0.6445509", "0.6408463", "0.6118125", "0.60956115", "0.6088668", "0.6061069", "0.6054814", "0.60351187", "0.60292125", "0.60233366", "0.5952991", "0.5945566", "0.5942648", "0.59026796", "0.5902645", "0.5877944", "0.583801", "0.5835275", "0.5810574"...
0.69064724
0
Ensure that we have a list of tags without duplicates.
def tags_list_should_have_no_duplicates(context): assert context.tags # converting a list to a set will remove all the duplicates # then we need to: # * convert it back to a list # * sort both lists # and finally compare both lists unique_tags = list(set(context.tags)) assert sorted(cont...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_duplicate(self):\r\n self.elements = list(set(self.elements))\r\n self.elements = [e for e in self.elements if e != '']", "def remove_duplicates_badSolution( li ):\n newli=[]\n seen = set()\n for item in li:\n if item not in seen:\n seen.add( item )\n ...
[ "0.66453546", "0.6560592", "0.6466691", "0.64423674", "0.6351733", "0.6341819", "0.6310374", "0.6308325", "0.6288973", "0.6214205", "0.6203075", "0.6181489", "0.6177429", "0.61650187", "0.61602896", "0.61400074", "0.61346847", "0.61290574", "0.61288965", "0.6081481", "0.60346...
0.8150041
0
Save a copy of the response JSON in context.response_copy
def copy_response(context): context.response_copy = context.response.json() logging.debug('Successfully copied the response')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_response(self, response):\n\n self._tmp_request_args = {}\n self.cache_response(response)", "def process_response(self, request, response):\n return response", "def process_response(self, request, response):\n return response", "def adapt_response(self, response):\n ...
[ "0.61301494", "0.6077249", "0.6077249", "0.6065612", "0.6065612", "0.6027532", "0.6017143", "0.6011364", "0.5959202", "0.5923965", "0.59199226", "0.5805134", "0.58009046", "0.5782035", "0.57615286", "0.5734818", "0.57223654", "0.56809473", "0.5680268", "0.56554216", "0.563393...
0.8781387
0
Remove selected field from all items created by existing owners.
def remove_field_from_every_item_in_response_copy(context, name): items = context.response_copy['items'] for item in items: print(item) if item['owner']['user_type'] == 'does_not_exist': continue if name in item: del(item[name]) logging.debug( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def item_remove_field(self, item, field_name):\n\t\treturn self._modify_object(item=item, field_name=field_name, new_value=None, new_field_name=None)", "def clear_removed_items(self, doctype, items):\n\t\tif items:\n\t\t\tfrappe.db.delete(doctype, dict(parent=self.doc_type, custom=1, name=(\"not in\", items)))\n...
[ "0.62011784", "0.5961859", "0.59229326", "0.58401084", "0.5837176", "0.58022887", "0.57983875", "0.5730194", "0.56140786", "0.5594127", "0.5592921", "0.5575774", "0.5530778", "0.5521096", "0.55118966", "0.55083996", "0.54819924", "0.5477148", "0.5472141", "0.54695934", "0.546...
0.59960264
1
Replace value of selected field in all items with provided value. It will skip items created by nonexisting owners.
def replace_field_value_in_every_item_in_response_copy(context, name, value): items = context.response_copy['items'] for item in items: print(item) if item['owner']['user_type'] == 'does_not_exist': continue if name in item: item[name] = value logging....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_all_item_field_value(**kwargs):\n\n # Filters\n filters = {\n 'disabled': 0,\n 'name': ('like', '%{0}%'.format(kwargs['keyword']))\n }\n\n # Get all Item fields based from the filters\n items = frappe.get_all('Item', filters=filters, fields=['name'])\n\n # Counters\n cur_...
[ "0.6645392", "0.6219248", "0.5475644", "0.54732466", "0.5421802", "0.54202026", "0.53525484", "0.53490883", "0.52693343", "0.5268808", "0.5259692", "0.5259692", "0.52306306", "0.5225818", "0.5224571", "0.52180886", "0.51984584", "0.51984584", "0.51893437", "0.5163014", "0.515...
0.6334869
1
Compare original JSON with its modified copy.
def compare_original_response_with_copy(context): original = context.response.json() copy = context.response_copy def compare_top_level_values(): # get the list of fields that are JSON values not arrays keys = [val for val in original.iterkeys() if not isinstance(original[val], (dict, list,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compare_json(json1, json2):\r\n return JsonType.eq(json1, json2)", "def compare_json_to_json(json1, json2): # , json_object, filters):\n return ordered(json1) == ordered(json2)", "def compare_json(js1, js2):\n return js1.items() <= js2.items()", "def __eq__(self, other) -> bool:\n if jso...
[ "0.76559675", "0.7507114", "0.7321742", "0.680047", "0.6643478", "0.6392799", "0.6192952", "0.61904955", "0.6173847", "0.6120342", "0.6098039", "0.6032834", "0.60087913", "0.59683764", "0.5956568", "0.58886045", "0.5844679", "0.57932216", "0.5773257", "0.57683474", "0.5761158...
0.71568364
3
Method call when we get new values
def process(self, message_box): for msg in message_box: data = msg.payload try: # If a process ask for critical section if data == "section": print("section") self.in_critical = True self.communic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reload_values(self):\r\n raise NotImplementedError", "def pre_update(self, **values):\r\n pass", "def GetValues(self):", "def onUpdated(self):", "def GetValues(self):\n ...", "def GetValues(self):\n ...", "def _UpdateDataSetValues( self ):\n pass", "def update_data...
[ "0.7353331", "0.6988434", "0.687627", "0.68691146", "0.686114", "0.686114", "0.6774022", "0.6674001", "0.665", "0.6640099", "0.66389704", "0.6592992", "0.6592992", "0.6592992", "0.6569918", "0.65685", "0.6528206", "0.65265304", "0.650933", "0.65077114", "0.646326", "0.64620...
0.0
-1
Responsible for initializing the RepositoryInterface
def __init__(self, db_name: str = 'concord.db') -> None: self.controller_database: ControllerDatabase = ControllerDatabase(db_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, repository):\n self.__repo = repository", "def __init__(__self__, *,\n repositories: Optional[pulumi.Input[Sequence[pulumi.Input['ConfigurationServiceGitRepositoryArgs']]]] = None):\n if repositories is not None:\n pulumi.set(__self__, \"repositories\",...
[ "0.777364", "0.7085242", "0.6809118", "0.6743912", "0.66984653", "0.6654255", "0.657456", "0.653264", "0.6512961", "0.65092623", "0.64682984", "0.6369247", "0.6369247", "0.6363029", "0.6342762", "0.6335039", "0.6280612", "0.6273649", "0.6269724", "0.6269724", "0.6269724", "...
0.0
-1
Finds all objects containing the subject_id and returns them
def find_all_by_id(self, subject_id) -> any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_by_id(self, subject_id: str) -> any:\n pass", "def get_by_subject(subject_name):\n return filter_by_prefix(Subscription.all(), subject_name + ':')", "def subject_tag_get_all(context, subject_id, session=None):\n _check_subject_id(subject_id)\n session = session or get_session()\n ...
[ "0.7556286", "0.6888728", "0.6579627", "0.6536872", "0.64493823", "0.6445906", "0.632408", "0.6205879", "0.6202196", "0.6156358", "0.6086483", "0.60020995", "0.59908074", "0.5937208", "0.59239584", "0.5871959", "0.5849564", "0.5790128", "0.57615757", "0.57059926", "0.5698278"...
0.81462866
0
Finds an object containing the subject_id and returns it
def find_by_id(self, subject_id: str) -> any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_subject(subject_id: SubjectID) -> Optional[Subject]:\n subject = DbSubject.query.get(subject_id)\n\n if subject is None:\n return None\n\n return _db_entity_to_subject(subject)", "def get_by_subject(subject):\n return MinimalSubject.all().ancestor(subject).get()", "def _subject_...
[ "0.78996885", "0.7125832", "0.7050861", "0.6940713", "0.6925259", "0.6538362", "0.6424567", "0.6345011", "0.62792736", "0.6265822", "0.61672187", "0.6031679", "0.602013", "0.6006688", "0.59961396", "0.59424037", "0.5910332", "0.59004784", "0.5890035", "0.58306265", "0.5798813...
0.8395928
0
Updates an object containing the subject_id and returns it
def update_by_id(self, subject_id: str, new_subject_data: any) -> any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, subject: Subject) -> None:\n pass", "def update(self, subject: Subject) -> None:\n pass", "def subject_update(context, subject_id, values, purge_props=False,\n from_state=None):\n return _subject_update(context, values, subject_id, purge_props,\n ...
[ "0.73226655", "0.73226655", "0.72892255", "0.675578", "0.659356", "0.64588344", "0.6458803", "0.6387519", "0.6223908", "0.5985143", "0.59724844", "0.59556586", "0.5807392", "0.579997", "0.579997", "0.579997", "0.57938385", "0.57718307", "0.5745582", "0.57401335", "0.5733652",...
0.7856727
0
Deletes an object containing the subject_id and returns whether the operation was successful or not
def delete_by_id(self, subject_id: str) -> any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, subject: str, predicate: str, obj: str):\n self._connector.delete(subject, predicate, obj)", "def deleteSubject(request, run_uuid):\n if request.method == 'POST':\n subject_data = get_object_or_404(SubjectData, pk=run_uuid)\n subject_data.delete()\n logger.info('Su...
[ "0.72939754", "0.70899653", "0.7075572", "0.70754683", "0.67888206", "0.67685735", "0.66285473", "0.6461525", "0.64063144", "0.6379194", "0.6373855", "0.63733524", "0.6321114", "0.6313565", "0.6271722", "0.6264547", "0.6259215", "0.62446636", "0.62331057", "0.62281626", "0.62...
0.7706765
0
Puts an object on the database
def put(self, subject: any) -> any: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put(self,data):\n\n \n try:\n\n db = getDatabase()\n connection = db.connect()\n \n connection.put(self,data)\n except Exception as e:\n raise e\n finally:\n db.dispose()", "def add_to_db(ark_obj):\n session = Sess...
[ "0.7381717", "0.736569", "0.7341733", "0.724491", "0.72058976", "0.7166143", "0.7099735", "0.70342857", "0.7029842", "0.7023118", "0.7019132", "0.7019132", "0.7019132", "0.7019132", "0.6908155", "0.68724597", "0.6847052", "0.68347305", "0.68293303", "0.68293303", "0.68293303"...
0.0
-1
Processes the command used to run Wumpus from the command line.
def readCommand( argv ): from optparse import OptionParser usageStr = """ USAGE: python wumpus.py <options> EXAMPLES: python wumpus.py --agent DummyAgent OR python wumpus.py -a DummyAgent - run wumpus with the dummy agent """ parser = OptionParser(usag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readCommand( argv ):\n from optparse import OptionParser\n usageStr = \"\"\"\n USAGE: python wumpus.py <options>\n EXAMPLES: (1) python wumpus.py\n - starts simple manual Hunt The Wumpus game\n (2) python wumpus.py -k OR python wumpus.py --kb\n ...
[ "0.635491", "0.59744203", "0.593825", "0.5796646", "0.57032573", "0.5658802", "0.5641519", "0.56319475", "0.56145334", "0.55581576", "0.55523694", "0.5529276", "0.5514777", "0.5502347", "0.54955745", "0.54887116", "0.546968", "0.54638857", "0.5458613", "0.5437348", "0.5431120...
0.6152857
1
Cognito values are injected from lambda_util.py from SSM
def __init__(self, region, user_pool_id, app_client_id): self.region = region self.user_pool_id = user_pool_id self.client_id = app_client_id self.client = boto3.client('cognito-idp', region_name=self.region)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aws_credentials():\n os.environ['AWS_ACCESS_KEY_ID'] = 'testing'\n os.environ['AWS_SECRET_ACCESS_KEY'] = 'testing'\n os.environ['AWS_SECURITY_TOKEN'] = 'testing'\n os.environ['REGION'] = 'region'", "def aws_credentials():\n os.environ['AWS_ACCESS_KEY_ID'] = 'testing'\n os.environ['AWS_SECRET_AC...
[ "0.62556726", "0.62092936", "0.6179623", "0.61744046", "0.61744046", "0.61744046", "0.61489314", "0.61489314", "0.6146985", "0.61378336", "0.5724657", "0.5630827", "0.5606129", "0.55538195", "0.5511667", "0.53734136", "0.5367809", "0.53646207", "0.524818", "0.5189068", "0.518...
0.5560235
13
Creates a new user with NEW_PASSWORD_REQUIRED status in the specified user pool. If the user exists already, except is triggered and the user is logged in to get JWT
def create_user(self, user_data): with suppress(self.client.exceptions.UsernameExistsException): attributes = self._get_attributes(user_data) attrib_set = {attr['Name']: attr['Value'] for attr in attributes} user = None try: user = self.client.adm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def create_user(self, **kwargs):\n\n username = kwargs[\"Login\"]\n password = hash_password(kwargs[\"Password\"])\n\n if await self.request.app.manager.count(\n User.select().where(User.username == username)):\n\n return {\"Type\": \"registration\", \"Status\":...
[ "0.6596659", "0.6503658", "0.6449315", "0.6434159", "0.64160377", "0.6367104", "0.6345489", "0.6339796", "0.6322092", "0.63209915", "0.62854207", "0.62553704", "0.6249303", "0.6235448", "0.62351006", "0.6226879", "0.620065", "0.61878043", "0.61827976", "0.61747473", "0.617102...
0.6326071
8
Automates the authorization of a new user with a password challenge/answer and gets their tokens
def _authorize_new_user(self, user_name, password): auth_params = { 'USERNAME': user_name, 'PASSWORD': password + 'temp' } challenges = { 'USERNAME': user_name, 'NEW_PASSWORD': password } # do a first time login to obtain the cha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post(self):\n data = request.get_json()\n is_verified = actions.verify(data['username'], data['password'])\n if not is_verified:\n abort(404, message='A user with matching credentials does not exist.')\n else:\n token = actions.create_token(data['username'], da...
[ "0.6401583", "0.63408506", "0.6334359", "0.6160818", "0.61538154", "0.6136322", "0.61340743", "0.61329556", "0.6080172", "0.6041986", "0.60048705", "0.5982743", "0.5948696", "0.59406096", "0.5929849", "0.5929674", "0.5923784", "0.59219515", "0.58725667", "0.58711153", "0.5861...
0.6261445
3
Signs in existing user with username(email) and password and get new JWTs
def sign_in_user(self, username, password): return self.client.admin_initiate_auth( UserPoolId=self.user_pool_id, ClientId=self.client_id, AuthFlow='ADMIN_NO_SRP_AUTH', AuthParameters={ 'USERNAME': username, 'PASSWORD': password ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login():\n data = request.get_json()\n user = User.authenticate(**data)\n\n if not user:\n return jsonify({ 'message': 'Invalid credentials', 'authenticated': False }), 401\n \n token = jwt.encode(\n {\n 'exp': datetime.now() + timedelta(minutes=90),\n 'iat': datetime...
[ "0.75269914", "0.71932435", "0.7128077", "0.71201265", "0.70540977", "0.70125014", "0.70117205", "0.69632614", "0.6884558", "0.68762094", "0.6826077", "0.67651176", "0.6757102", "0.67303413", "0.6714521", "0.6714521", "0.67135614", "0.670908", "0.6702531", "0.6698466", "0.667...
0.0
-1
Signs out users from all devices, as an administrator.
def sign_out_user(self, username): return self.client.admin_user_global_sign_out( UserPoolId=self.user_pool_id, Username=username )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sign_out():\n ourTestbed.setup_env(\n user_email='', user_id='', user_is_admin='0', overwrite=True)", "def log_out_user(self):\n flask_login.logout_user()", "async def sign_out(self) -> None:\n await self._api.call('system', 'sign_out')", "def logout_all(self, request):\n reque...
[ "0.6705182", "0.65831614", "0.6359137", "0.62794733", "0.62754476", "0.61872244", "0.612055", "0.6115547", "0.60603684", "0.6058338", "0.6047629", "0.6026433", "0.60080856", "0.5995272", "0.59883696", "0.5975011", "0.59552884", "0.589792", "0.58886546", "0.58597285", "0.58386...
0.56075084
48
Deletes a user as an administrator. Works on any user.
def delete_user(self, email): try: return self.client.admin_delete_user( UserPoolId=self.user_pool_id, Username=email ) except self.client.exceptions.UserNotFoundException: raise Exception('An account with the given email does not exis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def del_admin(user_id=None):\r\n try:\r\n if user_id:\r\n user = db.session.query(model.user.User)\\\r\n .get(user_id)\r\n require.user.update(user)\r\n if user:\r\n user.admin = False\r\n db.session.commit()\r\n ...
[ "0.77472854", "0.732289", "0.72048396", "0.7181641", "0.7177986", "0.71209437", "0.7117245", "0.70561045", "0.7038382", "0.6944983", "0.69300973", "0.6926543", "0.69074327", "0.689436", "0.6885258", "0.6881409", "0.6818042", "0.6781359", "0.6775124", "0.67666274", "0.67566514...
0.63084495
69
Gets the specified user by user name in a user pool as an administrator. Works on any user.
def get_user(self, email): try: return self.client.admin_get_user( Username=email, UserPoolId=self.user_pool_id ) except self.client.exceptions.UserNotFoundException: raise Exception('An account with the given email does not exist.')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getuser(gh, user):\n return gh.users(user).get()", "def get_user(self, user_name):\n if self.resource is None:\n self.resource = self.client.get_resource(self.href)\n resource_type = 'user'\n org_filter = None\n if self.client.is_sysadmin():\n resource_typ...
[ "0.69896877", "0.69312584", "0.68463963", "0.6825937", "0.6675744", "0.6672094", "0.65344405", "0.6519063", "0.64946544", "0.6485788", "0.6485416", "0.6457533", "0.637525", "0.63483906", "0.6339118", "0.6331377", "0.6291561", "0.6283403", "0.6259007", "0.62326187", "0.6205599...
0.59123576
60
I don't know why Eli's version of this doesn't work...
def transfer_header(infl, outfl): print "Transfer", infl, "to", outfl fin = pyfits.open(infl) fout = pyfits.open(outfl, 'update') dont_transfer = ["HSTSLAC", "MDRIZSKY", "LACOSMIC", "HISTORY", "COMMENT", ""] print "Transferring: ", for i in range(len(fin)): for key in fin[i].header: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exercise_b2_53():\r\n pass", "def exo2():", "def exercise_b2_113():\r\n pass", "def exercise_b2_106():\r\n pass", "def exercise_b2_107():\r\n pass", "def exercise_b2_27():\r\n pass", "def exercise_b2_69():\r\n pass", "def regular(self):", "def exercise_b2_39():\r\n pass", ...
[ "0.63080245", "0.6279826", "0.6225512", "0.6213161", "0.6152537", "0.6128494", "0.6060436", "0.60037595", "0.5999197", "0.5963986", "0.5950204", "0.5948137", "0.59172416", "0.5898115", "0.5876415", "0.5865529", "0.5860983", "0.58510506", "0.58397245", "0.582677", "0.582677", ...
0.0
-1
Return str of the Question text.
def __str__(self): return self.question_text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return \"question_text: \" + self.question_text \\\n + \"\\npub_date:\" + self.pub_date.__str__()", "def get_text(self):\n text_complet = \"\"\n rez_dict = self.__results\n for i in range(0, len(rez_dict[\"text\"])):\n text = rez_dict[\"...
[ "0.6952599", "0.6809651", "0.6728687", "0.6648696", "0.66370183", "0.6636884", "0.6636884", "0.6626152", "0.6611225", "0.653698", "0.64683396", "0.63943976", "0.63455355", "0.6336619", "0.62959063", "0.629548", "0.62926376", "0.6262842", "0.62339336", "0.62285537", "0.6215401...
0.7432616
0
Check The question was published recently.
def was_published_recently(self): now = timezone.now() return now - datetime.timedelta(days=1) <= self.pub_date <= now
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_was_published_recently_with_old_question(self):\n time = timezone.now() - datetime.timedelta(days=1, seconds=1)\n old_question = Question(pub_date=time)\n self.assertIs(old_question.published_recently(), False)", "def test_was_published_recently_with_old_question(self):\n tim...
[ "0.78417605", "0.7782781", "0.77800715", "0.77731305", "0.77698106", "0.77661824", "0.7765887", "0.775402", "0.7751924", "0.774496", "0.774496", "0.7744173", "0.7742833", "0.7741992", "0.77395815", "0.7734502", "0.77282625", "0.7719259", "0.7718801", "0.7692774", "0.7685845",...
0.776007
7
Check The question is published.
def is_published(self): now = timezone.now() return now >= self.pub_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_published(self) -> bool:\n return self.published and self.published <= timezone.now()", "def test_waspublished_recently_with_future_question(self):\n time = timezone.now() + datetime.timedelta(days=30)\n future_question = Question(pub_date=time)\n self.assertIs(future_question....
[ "0.71493137", "0.7063946", "0.6903579", "0.68560255", "0.684703", "0.683168", "0.683168", "0.67990464", "0.6755138", "0.6693469", "0.661171", "0.6581404", "0.6526466", "0.6474297", "0.646864", "0.6438965", "0.642411", "0.6422557", "0.641191", "0.63997775", "0.6394392", "0.6...
0.74736017
0
Check The question that can vote.
def can_vote(self): now = timezone.now() return self.pub_date <= now <= self.end_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_vote(age):\n return age >= 18", "def has_voted(self, user):\n return user.choice_set.filter(vote=self).exists()", "def has_voted(self, user, ip_address):\r\n if user.is_anonymous():\r\n return len(self.usedip_set.filter(address=ip_address))>0\r\n else:\r\n ...
[ "0.7119358", "0.6522342", "0.6442282", "0.6395101", "0.63761276", "0.6368317", "0.6321182", "0.6282707", "0.6182186", "0.6078608", "0.59862185", "0.5943008", "0.5938228", "0.5928657", "0.59091467", "0.5890169", "0.5838118", "0.58338714", "0.583233", "0.581144", "0.58110076", ...
0.63904667
4
Return str of choice text.
def __str__(self): return self.choice_text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return \"choice_text: \" + self.choice_text", "def __str__(self):\n return gettext('One of %s') % self._get_choices_str()", "def GetStringSelection(self):\n \n return self.choices[self.selected].GetLabel()", "def GetString(self, index):\n \n retu...
[ "0.7722265", "0.732926", "0.7012607", "0.6919962", "0.6744218", "0.6717672", "0.6714625", "0.66818357", "0.6642152", "0.65575504", "0.6554381", "0.6462773", "0.6462773", "0.6441141", "0.64289695", "0.6358801", "0.63565093", "0.6310224", "0.63069963", "0.6293395", "0.62826407"...
0.7704613
1
Triangulate 3D point position from camera projections. The function computes the 3D position of a point landmark from the projection of the point into two camera images separated by a known baseline. All arrays should contain float64 values.
def triangulate(Kl, Kr, Twl, Twr, pl, pr, Sl, Sr): #--- FILL ME IN --- # Compute baseline (right camera translation minus left camera translation) Cr = (Twr)[0:3,-1] #left camera translaton Cl = (Twl)[0:3,-1] #right camera translation b = (Cr - Cl).reshape(3,1) # Unit vec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def project(points, camera_params, theta):\n \"\"\"\n Function takes input of 3d_points, transformations and Convert 3-D points to 2-D by projecting onto images. \n Input:\n points: 3D points in world frame\n camera_params: parameters of camera corrosponding to the point\n theta: Need...
[ "0.65862644", "0.637325", "0.63548315", "0.6317535", "0.63022566", "0.62523985", "0.6216757", "0.6117312", "0.5975491", "0.59543246", "0.59470004", "0.5944769", "0.59325784", "0.5900421", "0.58919555", "0.5883422", "0.5864867", "0.5698507", "0.5697444", "0.5691295", "0.562771...
0.0
-1
log in to drive
def login():
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login(self):\n\t\treturn", "def login(self):", "def login(self):\n self.driver.get(self.login)\n PAUSE = 2\n time.sleep(PAUSE)\n user_input = self.driver.find_element_by_name('username')\n pass_input = self.driver.find_element_by_name('password')\n login_button = s...
[ "0.74581724", "0.7158189", "0.7104258", "0.70794123", "0.7079039", "0.70618725", "0.7040776", "0.6952491", "0.6865552", "0.6833988", "0.68089366", "0.67485416", "0.67315876", "0.6722878", "0.6720476", "0.67203325", "0.6719856", "0.67019886", "0.6689592", "0.66611564", "0.6658...
0.75863075
1