query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Return the state attributes of the device.
def extra_state_attributes(self): return {attr: getattr(self, '_' + prop) for attr, prop in ATTRIBUTES_IRHVAC.items()}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_state_attributes(self):\r\n return self.attributes", "def device_state_attributes(self):\r\n return self._attributes", "def device_state_attributes(self):\n return self._state_attrs", "def device_state_attributes(self):\n return self._state_attrs", "def device_state_a...
[ "0.92738223", "0.92053986", "0.91516256", "0.91516256", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148746", "0.9148746", "0.9137698", "0.9110632",...
0.0
-1
Return the polling state.
def should_poll(self): return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_state(self):\r\n alarm = self._alarm()\r\n return alarm.state", "def _get_state(self):\n # gst's get_state function returns a 3-tuple; we just want the\n # status flag in position 1.\n return self.pipeline.get_state(Gst.CLOCK_TIME_NONE)[1]", "def state(self):\n ...
[ "0.70800793", "0.69442177", "0.6918493", "0.6845751", "0.68327427", "0.67729336", "0.67729336", "0.6728276", "0.6668334", "0.6641413", "0.6641413", "0.6641413", "0.6641413", "0.6641413", "0.66395515", "0.66395515", "0.66395515", "0.66395515", "0.66395515", "0.66395515", "0.66...
0.0
-1
Return the name of the thermostat.
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return f\"{self._tc_object.name} {SENSOR_TYPES[self.type][0]}\"", "def thermostat(self) -> dict[str, Any]:\n return self.data.ecobee.get_thermostat(self.thermostat_index)", "def name(self) -> str:\n return f\"{get_friendly_name(self._name)} temperature\"", "def name(sel...
[ "0.68962795", "0.6839454", "0.67705506", "0.6765792", "0.6695404", "0.667108", "0.6555283", "0.6515466", "0.6505295", "0.6478986", "0.64298517", "0.64298517", "0.64298517", "0.64109445", "0.6402691", "0.63823766", "0.6380735", "0.6307367", "0.6297553", "0.62935513", "0.627699...
0.0
-1
Return the precision of the system.
def precision(self): if self._temp_precision is not None: return self._temp_precision return super().precision
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision(self) :\n return self.__precision", "def precision(self) :\n return self.__precision", "def get_precision(self):\n ...", "def precision(self):\n tpos, fpos = len(self.__true_positives), len(self.__false_positives)\n return float(tpos) / (tpos + fpos)", "def ...
[ "0.8444097", "0.8444097", "0.82612175", "0.8181004", "0.8089527", "0.79801905", "0.7966513", "0.7718673", "0.7630337", "0.7629425", "0.7629425", "0.7524124", "0.73394215", "0.7315662", "0.72706413", "0.7264505", "0.72592515", "0.72338885", "0.7231734", "0.71754324", "0.712173...
0.7463178
12
Set new target fan mode.
async def async_set_fan_mode(self, fan_mode): if fan_mode not in self._fan_list: #tweak for some ELECTRA_AC devices if HVAC_FAN_MAX_HIGH in self._fan_list and HVAC_FAN_AUTO_MAX in self._fan_list: if fan_mode != FAN_HIGH and fan_mode != HVAC_FAN_MAX: _L...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_fan_mode(self, fan):\n if fan == STATE_AUTO:\n self._device.set_fan(self._device.FAN_AUTO)\n elif fan == STATE_ON:\n self._device.set_fan(self._device.FAN_ON)", "def set_fan_mode(self, value):\n return self.parent.controller.set_fan_auto_mode(value)", "def set...
[ "0.78884286", "0.77543575", "0.77154255", "0.7704043", "0.7611645", "0.75783825", "0.7501574", "0.74044466", "0.7102789", "0.7077084", "0.6946794", "0.6912525", "0.67700696", "0.67671233", "0.6766175", "0.67127615", "0.6685691", "0.66704637", "0.666543", "0.65710115", "0.6450...
0.70231044
10
Update thermostat with latest state from humidity sensor.
def _async_update_humidity(self, state): try: if state.state != STATE_UNKNOWN and state.state != STATE_UNAVAILABLE: self._cur_humidity = float(state.state) except ValueError as ex: _LOGGER.error("Unable to update from humidity sensor: %s", ex)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self):\n dht = self.sensor(self.pin)\n try:\n temperature = dht.temperature\n humidity = dht.humidity\n except RuntimeError:\n _LOGGER.debug(\"Unexpected value from DHT sensor: %s\", self.name)\n except Exception: # pylint: disable=broad-exce...
[ "0.73199445", "0.7230179", "0.7114188", "0.6872575", "0.6853841", "0.6826067", "0.67649347", "0.67321724", "0.6671747", "0.6651021", "0.660839", "0.6598017", "0.6594007", "0.6588228", "0.65824324", "0.6542562", "0.65395427", "0.65314305", "0.65276444", "0.65202945", "0.650354...
0.6809371
6
Set new preset mode. This method must be run in the event loop and returns a coroutine.
async def async_set_preset_mode(self, preset_mode): if preset_mode == PRESET_AWAY and not self._is_away: self._is_away = True self._saved_target_temp = self._target_temp self._target_temp = self._away_temp elif preset_mode == PRESET_NONE and self._is_away: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_set_preset_mode(self, preset_mode: str) -> None:\n if self._on != \"1\":\n if preset_mode == PRESET_NONE:\n return\n await self.async_turn_on()\n\n _LOGGER.debug(\"Setting preset mode of %s to %s\", self._unique_id, preset_mode)\n\n if prese...
[ "0.7762982", "0.7632403", "0.7520384", "0.7422413", "0.7046435", "0.6933416", "0.68563724", "0.6694669", "0.65027344", "0.6400875", "0.6358334", "0.6338518", "0.62694293", "0.62260246", "0.6112911", "0.6063648", "0.6018906", "0.5970804", "0.5935271", "0.5933047", "0.5930905",...
0.7560988
2
return a list of subreddits an account is subscribed to. client requires running accounts.user_login() first to start a user session
def my_subreddits(client, status, limit): url = r'http://www.reddit.com/subreddits/mine/{st}.json'.format(st=status) data = {'limit': limit} response = client.get(url, data=data) return response.json()['data']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_subreddits(cls, user, limit = sr_limit):\r\n if user and user.has_subscribed:\r\n sr_ids = Subreddit.reverse_subscriber_ids(user)\r\n if limit and len(sr_ids) > limit:\r\n return random.sample(sr_ids, limit)\r\n else:\r\n return sr_ids\...
[ "0.6922533", "0.6777294", "0.67184013", "0.6520809", "0.65074635", "0.63565433", "0.62280905", "0.6175533", "0.61702925", "0.6138922", "0.6084708", "0.6076012", "0.5955911", "0.5952306", "0.58888316", "0.58864987", "0.588385", "0.58796906", "0.5871477", "0.5850943", "0.584672...
0.6320614
6
retrieves a lexer by name, different than lexers.get_lexer_by_name() because it automatically enables certain options. this way all lexers for welbornprod will have the same options and can be set in one place.
def get_lexer_byname(sname): return lexers.get_lexer_by_name(sname, stripall=True,)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_lexer():\n from ply import lex\n from . import _lex_rules\n return lex.lex(module=_lex_rules)", "def get_lex(verbose=False):\n my_lex = lex.lex(reflags=re.MULTILINE)\n\n if verbose: # creates a wrapper around the lexer that prints tokens\n verbose_lexer = VerboseLexer(my_lex)\n ...
[ "0.7317053", "0.6653418", "0.6545838", "0.63526165", "0.61852825", "0.6138827", "0.6067293", "0.5774032", "0.55634767", "0.5419138", "0.53597975", "0.5289627", "0.52396786", "0.51768416", "0.5146471", "0.5128064", "0.50367415", "0.49918264", "0.49358594", "0.48820254", "0.477...
0.72155935
1
determine lexer from shebang line if any is present.
def get_lexer_name_fromcontent(content): if isinstance(content, (list, tuple)): # readlines() was passed. firstline = content[0] else: if '\n' in content: # not calling split() here. firstline = content[:content.index('\n')] else: # Can't ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_shebang(self, handle, interpreter):\n if detect_python_script(handle):\n lines = handle.readlines()\n lines[0] = b'#!' + interpreter.encode('ascii') + b'\\n'\n handle = BytesIO(b''.join(lines))\n handle.seek(0)\n return handle", "def test_sheba...
[ "0.59522444", "0.59133625", "0.561238", "0.5584809", "0.555884", "0.5437252", "0.5312546", "0.52890486", "0.52624834", "0.51891804", "0.5173168", "0.5093346", "0.50898236", "0.50880116", "0.5066577", "0.50448346", "0.5003711", "0.49791637", "0.49072304", "0.48991567", "0.4866...
0.6977566
0
Retrieve code to be highlighted from match groups.
def get_code(mgroups): if mgroups: code = mgroups[1].strip() return code return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def highlight(self):\n \n try:\n code = pygments.highlight(self.code, self.lexer, self.formatter)\n highlighted = '\\n'.join(['<div class=\\'highlighted\\'>\\n',\n code,\n '\\n</div>',\n ...
[ "0.60760725", "0.58881295", "0.5608171", "0.55925745", "0.5565984", "0.5559514", "0.55092806", "0.5474122", "0.5466953", "0.5427415", "0.54039824", "0.53841394", "0.53733027", "0.53732294", "0.5367726", "0.5343992", "0.533734", "0.5298997", "0.52988076", "0.52813673", "0.5280...
0.6220374
0
Try highlighting a line of text. Return the highlighted code on success, return unhighlighted code on failure.
def try_highlight(code, langname): try: lexer = lexers.get_lexer_by_name(langname) if not lexer: _log.debug('highlight_codes: No lexer found for ' '{}'.format(langname)) return code highlighted = pygments...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def syntax_highlight(code, highlight_lines=[], start_line=1, style='unavailable'):\n\n\t\tif start_line > 1:\n\t\t\tcode = ('# CodeCache - next line is %d; note lines: %r\\n' % (start_line, highlight_lines)) + code\n\n\t\tcode = ('# CodeCache - unhighlighted\\n') + code\n\n\t\thtml = \"\"\"<html>\n\t\t<body>\n\t\t...
[ "0.73155403", "0.7226551", "0.7055936", "0.69353896", "0.69348735", "0.6810765", "0.674353", "0.67103857", "0.66998684", "0.6610711", "0.651196", "0.6490616", "0.6414343", "0.6402131", "0.6334728", "0.6326711", "0.6309824", "0.62229544", "0.6109985", "0.60548365", "0.60351515...
0.6750641
6
Create a string for the Genre. This is required to display genre in Admin.
def display_genre(self, *args): return ', '.join(genre.name for genre in args[0].genre.all()[:3])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_genre(self):\n \n # Get first 3 genres and join to a string.\n return ', '.join([ genre.name for genre in self.genre.all()[:3] ])", "def display_genre(self):\n\n\t\treturn ', '.join(genre.name for genre in self.genre.all()[:3])", "def add_genre(request):\n\tif request.method =...
[ "0.71018815", "0.6895552", "0.68684465", "0.68314636", "0.67901397", "0.6762828", "0.6724158", "0.67127514", "0.6552365", "0.65325725", "0.64681476", "0.64652336", "0.6459481", "0.64475477", "0.6144701", "0.6136432", "0.60898936", "0.60420936", "0.6022638", "0.6002483", "0.59...
0.6578647
8
Discard an element from a value set. For a `collection` that maps `key` to {`value1`, `value2`, ...}, discard a specific `value` from the value set and drop the entire entry if the set becomes empty.
def discard_value(collection, key, value): try: values = collection[key] except KeyError: pass else: values.discard(value) if not values: del collection[key]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def discard(self, value):\n assert (isinstance(value, tuple))\n if len(value) == 1:\n value = [(value[0], i) for i in range(self._label_size)]\n return self.difference_update(value)\n if value not in self._innercontainer:\n warnings.warn(\"Element %s to discard...
[ "0.6470461", "0.63632697", "0.6287609", "0.6223567", "0.61295867", "0.6127197", "0.60605234", "0.6029306", "0.5955194", "0.5773044", "0.57489055", "0.5702388", "0.5674573", "0.56718934", "0.56458104", "0.5583555", "0.5569626", "0.55388045", "0.55287117", "0.55187935", "0.5510...
0.8306151
0
Get whether the user has the permission required to call this view, with this method.
def has_permission(self, request, view): if request.method == "POST": return not (request.user and is_authenticated(request.user)) return request.user and is_authenticated(request.user)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_permission(self, request, view):\n return True", "def has_permission(self, request, view):\n return False", "def has_permission(self, request, view):\n if request.user.is_authenticated():\n return True\n return False", "def is_visible(cls, request):\n if ...
[ "0.81622297", "0.81161976", "0.8102889", "0.8053223", "0.7979759", "0.79351586", "0.7819013", "0.7819013", "0.7819013", "0.7786912", "0.77575403", "0.77447987", "0.7742115", "0.7693631", "0.76784754", "0.7663089", "0.76601905", "0.7659848", "0.76145715", "0.7545961", "0.75451...
0.7721397
13
Get whether the user has the permission required to call this view, with this method.
def has_object_permission(self, request, view, obj): return request.user.id == obj.user_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_permission(self, request, view):\n return True", "def has_permission(self, request, view):\n return False", "def has_permission(self, request, view):\n if request.user.is_authenticated():\n return True\n return False", "def is_visible(cls, request):\n if ...
[ "0.81658405", "0.81198525", "0.81068224", "0.8055815", "0.79822916", "0.7937462", "0.78214616", "0.78214616", "0.78214616", "0.77877444", "0.7760506", "0.7747271", "0.7744871", "0.77250004", "0.76962006", "0.7681924", "0.766296", "0.7662592", "0.76623625", "0.76163137", "0.75...
0.70891845
48
Get whether the user has the permission required to call this view, with this method.
def has_object_permission(self, request, view, obj): if request.method == "PUT" or request.method == "PATCH": return request.user.id == obj.organiser_id return obj.participant_set.filter(user_id=request.user.id, meeting_id=obj.id).count() == 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_permission(self, request, view):\n return True", "def has_permission(self, request, view):\n return False", "def has_permission(self, request, view):\n if request.user.is_authenticated():\n return True\n return False", "def is_visible(cls, request):\n if ...
[ "0.81658405", "0.81198525", "0.81068224", "0.8055815", "0.79822916", "0.7937462", "0.78214616", "0.78214616", "0.78214616", "0.77877444", "0.7760506", "0.7747271", "0.7744871", "0.77250004", "0.76962006", "0.7681924", "0.766296", "0.7662592", "0.76623625", "0.76163137", "0.75...
0.0
-1
Returns a generator wrapping the tokens returned by `tokenizer` as `Token` instances
def wrap(self, stream_generator): for lineno, token, value in stream_generator: if token in ignored_tokens: continue elif token == tokens.OPERATOR: token = operators[value] elif token == tokens.INTEGER: value = int(value) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_tokenizer(self):\n def tokenizer(doc):\n token_pattern = re.compile(self.token_pattern)\n return token_pattern.findall(doc)\n \n return tokenizer", "def __next__(self):\n if self.gen is None:\n self.gen = self.token_generator()\n\n ...
[ "0.72149414", "0.71084607", "0.67937285", "0.6749666", "0.64964247", "0.6493081", "0.6493081", "0.6493081", "0.62948275", "0.6229362", "0.6215976", "0.6155995", "0.61297137", "0.6107623", "0.61070234", "0.6002618", "0.5990469", "0.5982948", "0.5980122", "0.5980118", "0.597814...
0.55374974
72
Generates list of ngrams used to generate ngram distribution. Preprocessing step used in initalization.
def get_ngrams(self, n = None): if not n: n = self.N temp = [] for sent in self.get_sentences(): temp.extend(list(sent)) return nltk.ngrams(temp, n)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_ngrams(word_list, n):\n yield zip(*[word_list[i:] for i in range(n)])", "def ngrams(self):\n return self.__ngrams(())", "def __makeNgrams(self, n):\n # start_time = time.time()\n ngrams = dict()\n itergrams = dict()\n\n for k in range(2,n+1):\n it...
[ "0.78915685", "0.7751312", "0.76265734", "0.76226556", "0.75976634", "0.745277", "0.7429453", "0.74146384", "0.73578143", "0.7254168", "0.7251246", "0.72490007", "0.721078", "0.71797687", "0.71135336", "0.70774204", "0.7065587", "0.70627224", "0.7056435", "0.7044134", "0.7013...
0.7430485
6
Subtraction of two numbers
def sub(n1, n2): return n1 - n2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subtract(num1, num2):\n return num1 - num2", "def subtract(num1, num2):\n return num1 - num2", "def subtract(num1, num2):\n return num1 - num2", "def subtract(first, second):\n return first - second", "def subtraction(num_1, num_2):\n return num_1 - num_2", "def subtraction(number1, numb...
[ "0.85040355", "0.84988505", "0.84988505", "0.84092903", "0.84019125", "0.83986926", "0.8276438", "0.8256487", "0.8251286", "0.8251286", "0.82013524", "0.8186849", "0.8161457", "0.8111111", "0.8065054", "0.80207515", "0.8020375", "0.79677093", "0.79677093", "0.79677093", "0.79...
0.72928977
48
Creates a new SparkSession for the Spark Connect interface.
def __init__( self, connection: Union[str, ChannelBuilder], user_id: Optional[str] = None, channel_options: Optional[List[Tuple[str, Any]]] = None, retry_policy: Optional[Dict[str, Any]] = None, use_reattachable_execute: bool = True, ): self.thread_local = thr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_sparksession():\n return SparkSession.builder.\\\n appName(\"Transforming the historical parking occupancy and blockface datasets\").\\\n getOrCreate()", "def create_spark_session():\n return SparkSession.builder \\\n .appName(\"Dataframe Reader\") \\...
[ "0.77936214", "0.77365065", "0.7736232", "0.7736232", "0.7736232", "0.7736232", "0.7736232", "0.7736232", "0.7736232", "0.7736232", "0.7736232", "0.773497", "0.773497", "0.773497", "0.773497", "0.77333647", "0.7668354", "0.76464325", "0.7640239", "0.760827", "0.7589869", "0...
0.0
-1
Return given plan as a pandas DataFrame.
def to_pandas(self, plan: pb2.Plan) -> "pd.DataFrame": logger.info(f"Executing plan {self._proto_to_string(plan)}") req = self._execute_plan_request_with_metadata() req.plan.CopyFrom(plan) (self_destruct_conf,) = self.get_config_with_defaults( ("spark.sql.execution.arrow.pysp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pars_df(plan_type, stop=False):\n df = pd.concat([get_plan_pars(patient, plan_type, stop)\n for patient in patients])\n return df", "def get_iter_df(plan_type, stop=False):\n df = pd.DataFrame({\n 'patient': patients,\n 'plan_type': len(patients)*[plan_type],\n ...
[ "0.6772377", "0.6622497", "0.6530004", "0.6514379", "0.65083545", "0.64813524", "0.64523077", "0.64442676", "0.6439152", "0.64234054", "0.6411915", "0.6368132", "0.62961847", "0.62940353", "0.6291303", "0.62888074", "0.61626965", "0.61383885", "0.6103358", "0.60820967", "0.60...
0.76100737
0
Calculate the gradient of the gravitational potential produced by each galaxy at the given positions, from, e.g., dVi/dx = + G Mi { (xxp)^2 + (yyp)^2 + (zzp)^2 }^(3/2) (xxp) dVi/dy = + G Mi { (xxp)^2 + (yyp)^2 + (zzp)^2 }^(3/2) (yyp) dVi/dz = + G Mi { (xxp)^2 + (yyp)^2 + (zzp)^2 }^(3/2) (zzp) ^ | this is the posi_diff_...
def grad_gravi_potential_feel(self, core_mass, core_position, evaluating_position): GM = self._G_feel * core_mass positional_difference = evaluating_position - core_position posi_diff_powered = np.sum(positional_difference**2, axis=0)**(-1.5) grad_potential = GM * posi_diff_powered * ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calcDerivatives(self,Omega,U,xpos,ypos,psi):\r\n theta_w,mu_w,sigma_w = self.theta_w,self.mu_w,self.sigma_w\r\n theta_u,mu_u,sigma_u = self.theta_u,self.mu_u,self.sigma_u\r\n \r\n sigma_o = self.sigma_o\r\n dt = self.dt\r\n \r\n # Compute coupling force fc\r\n ...
[ "0.65398383", "0.6245482", "0.61119276", "0.6025402", "0.5981382", "0.5903195", "0.5890541", "0.58235013", "0.58148694", "0.5789188", "0.5789048", "0.5782355", "0.57028866", "0.5689286", "0.5677595", "0.56268215", "0.56132555", "0.55846834", "0.5583189", "0.55662566", "0.5559...
0.6701832
0
Calculate the distance between two coordinates using a standard distance equation ( (x1x2)^2 + (y1y2)^2 )^0.5 >>> distance( (0, 0), (3, 4) ) == 5 True >>> round(distance( (1.6, 2.4), (3.45, 5) )) == 9 True
def distance(a, b): if len(a) != 2 or len(b) != 2: raise ValueError dx = float(a[0]) - float(b[0]) dy = float(a[1]) - float(b[1]) return ( dx**2 + dy**2 )**0.5
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(x1, y1, x2, y2):\n return ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5", "def distance(x1, y1, x2, y2):\n dist = ((x1-x2)**2 + (y1-y2)**2)**0.5\n return dist", "def get_distance(x1, y1, x2, y2):\n return math.sqrt((x1 - x2) ** 2 + (y1 * 2.38 - y2 * 2.38) ** 2)", "def distance(x1, y1, x2,...
[ "0.7953953", "0.7775668", "0.76804537", "0.76638067", "0.7630552", "0.76297164", "0.759901", "0.753257", "0.7508396", "0.7496325", "0.749033", "0.7428608", "0.73996025", "0.7384063", "0.73479193", "0.7340648", "0.7334529", "0.73230594", "0.7322186", "0.7318626", "0.72983813",...
0.6917301
82
Updates weight given gradient and index.
def __call__(self, index, grad, weight): allow_np = self.optimizer.allow_np_array if hasattr(self.optimizer, "allow_np_array") else is_np_array() if not isinstance(index, (list, tuple)): indices = [index] grads = [_as_classic(grad, allow_np)] weights = [_as_classic(we...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_weights(self, gradient, n):\n lr_decay = self.learning_rate*(1/2)*(n/100)\n self.delta_weights = lr_decay * gradient + self.momentum*self.delta_weights\n self.weights += self.delta_weights", "def update_weights(self, X, Y, learning_rate):\n grads = self.calculate_gradients(...
[ "0.6990673", "0.69255406", "0.68448234", "0.6827901", "0.67836154", "0.67406386", "0.6709919", "0.6686432", "0.66507006", "0.66456854", "0.66295326", "0.66004544", "0.6581278", "0.65600014", "0.6503776", "0.64697427", "0.6448159", "0.6448134", "0.6445575", "0.6440841", "0.642...
0.66786075
8
GET lists all responses (models.Reponse serialized) POST creates one
def api_reponses(request): if request.method == 'GET': reponses = Reponse.objects.all() serializer = ReponseSerializer(reponses, many=True) return Response(serializer.data) elif request.method == 'POST': serializer = ReponseSerializer(data=request.data) if serializer.is_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list(self, request):\n queryset = self.get_queryset()\n serializer = self.serializer_class(queryset, many=True)\n return Response(serializer.data)", "def list(self):\n response = self.client.get_json(URL_MAPPING)\n response.success = response.status_code == 200\n ret...
[ "0.717326", "0.6889712", "0.6768476", "0.67531705", "0.66146094", "0.65151197", "0.65151197", "0.65151197", "0.65151197", "0.65151197", "0.6472683", "0.6472227", "0.64679587", "0.6447035", "0.64332736", "0.64305395", "0.64158446", "0.64029753", "0.64029753", "0.639092", "0.63...
0.7202587
0
pad edge of array such that its dimension becomes nx, ny. only works for odd number length arrays
def pad_edge_to_shape(arr, nx, ny): nxa, nya = arr.shape for n in [nx, ny, nxa, nya]: if not isodd(n): raise Exception("[pad_edge_to_shape] only accept odd-number-length arrays") if nx > nxa: dx = (nx - nxa)/2 arr = np.pad(arr, ((int(dx), int(dx)), (0, 0)), 'constant', constant_values=0) elif nx < nxa: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pad_edges(self, pad):\n weights=[]\n for dim, xy in zip([0, 1], [self.x, self.y]):\n xy0 = np.mean(xy)\n W = xy[-1]-xy[0]\n dist = np.abs(xy-xy0)\n wt=np.ones_like(dist)\n wt[ dist >= W/2 - pad] = 0\n weights += [wt]\n self....
[ "0.6963497", "0.66677666", "0.654713", "0.6464003", "0.6388372", "0.627468", "0.62488174", "0.6203423", "0.610493", "0.6100823", "0.6070607", "0.60217315", "0.601552", "0.5957344", "0.5926763", "0.590912", "0.58811855", "0.5879983", "0.58438426", "0.5810194", "0.5802986", "...
0.81783867
0
whether psf1 is smaller than psf2 Params
def has_smaller_psf_fits(fp1, fp2, mode='quick', fracdiff_threshold=0.1): psf1 = fits.getdata(fp1) psf2 = fits.getdata(fp2) return has_smaller_psf(psf1, psf2, mode=mode, fracdiff_threshold=fracdiff_threshold)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_smaller_psf(psf1, psf2, mode='quick', fracdiff_threshold=0.1):\n\tif mode == 'quick': \n\t\tsize1 = calc_psf_size_inpix_quick(psf1)\n\t\tsize2 = calc_psf_size_inpix_quick(psf2)\n\telif mode in ['moffat', 'gaussian']:\n\t\tsize1 = calc_psf_fwhm(psf1, mode=mode)\n\t\tsize2 = calc_psf_fwhm(psf2, mode=mode)\n\...
[ "0.6822715", "0.6721614", "0.63837737", "0.63390714", "0.6248951", "0.6244719", "0.62394893", "0.62274647", "0.6161932", "0.6099823", "0.60172856", "0.6007618", "0.60050344", "0.60002226", "0.5994519", "0.59620064", "0.5950422", "0.5940178", "0.5936509", "0.5932419", "0.59285...
0.617004
8
Split data into train, dev, and test sets.
def train_dev_test_split(data, train_pct=0.7): train_len, dev_len, test_len = create_split_bounds(len(data), train_pct) # Train (70%) train = data[0:train_len] # Dev (15%) dev_ub = (train_len + dev_len) dev = data[train_len:dev_ub] # Test (15%) test = data[dev_ub:] assert "One of...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __split_dataset(self):\n self.train, self.valid, _, _ = train_test_split(self.data, self.data, test_size=0.2)\n self.valid, self.test, _, _ = train_test_split(self.valid, self.valid, test_size=0.5)", "def split_data_into_train_and_test(raw_training_data):\n train_set, test_set = train_test_s...
[ "0.8286795", "0.818965", "0.8167478", "0.7967408", "0.78986156", "0.78663903", "0.7852902", "0.77674115", "0.76804864", "0.76417494", "0.7630867", "0.76257163", "0.7612045", "0.75398916", "0.7487783", "0.7452819", "0.7442101", "0.73654723", "0.73436904", "0.73370534", "0.7297...
0.78206915
7
Creates an instance of this model from a dictionary
def from_dictionary(cls, dictionary): if dictionary is None: return None # Extract variables from the dictionary found = dictionary.get('found') displaying = dictionary.get('displaying') more_available = dictionary.get('moreAvailable')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n # Extract variables from the dictionary\n id = dictionary.get('id')\n name = dictionary.get('name')\n mtype = dictionary.get('type')\n usage_bytes = diction...
[ "0.83181584", "0.8168118", "0.8168118", "0.8118749", "0.8089047", "0.79787344", "0.7949278", "0.79231393", "0.7898951", "0.78923255", "0.788838", "0.7882321", "0.7882212", "0.7876749", "0.78585315", "0.7836853", "0.7801407", "0.7801407", "0.7801407", "0.7801407", "0.7801407",...
0.74963725
84
Calculation dictionary word frequency in text
def word_count(self, document): start_time = time.time() dictionary = dict() counter = defaultdict(int) for line in document.splitlines(): for word in line.split(): if word not in PUNCTUATION_MARK: counter[word] += 1 for word, cnt i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def word_frequency( tokenized, dic ):\n print( 'computing word frequencies' )\n start = time.time()\n for i, text in enumerate( tokenized ):\n for token in text:\n if token not in dic:\n dic[ token ] = 1\n else:\n dic[ token ] += 1\n if i % 10000 == 0:\n sys.stdout.write( '\\r...
[ "0.7970062", "0.7938689", "0.78460866", "0.7764175", "0.7749926", "0.7704706", "0.7679698", "0.76686376", "0.76342607", "0.7634133", "0.7590735", "0.7589869", "0.75863254", "0.7572945", "0.7531965", "0.75213355", "0.7520234", "0.7498843", "0.7480733", "0.7465496", "0.74498284...
0.73680985
29
Sets the calendar_type of this CreateCalendarRequest.
def calendar_type(self, calendar_type): if self.local_vars_configuration.client_side_validation and calendar_type is None: # noqa: E501 raise ValueError("Invalid value for `calendar_type`, must not be `None`") # noqa: E501 if (self.local_vars_configuration.client_side_validation and ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schedule_type(self, schedule_type):\n\n self._schedule_type = schedule_type", "def schedule_type(self, schedule_type):\n\n self._schedule_type = schedule_type", "def __init__(self, calendar_id=None, calendar_type=None, weekend_mask=None, source_provider=None, properties=None, local_vars_confi...
[ "0.591827", "0.591827", "0.55911773", "0.5516545", "0.5375648", "0.5334696", "0.53199035", "0.5166499", "0.51608753", "0.5129588", "0.5129588", "0.5067251", "0.50470537", "0.50470537", "0.49333262", "0.49106622", "0.48932183", "0.48899758", "0.48899758", "0.48861697", "0.4886...
0.77070737
0
Sets the source_provider of this CreateCalendarRequest.
def source_provider(self, source_provider): if self.local_vars_configuration.client_side_validation and source_provider is None: # noqa: E501 raise ValueError("Invalid value for `source_provider`, must not be `None`") # noqa: E501 if (self.local_vars_configuration.client_side_validation an...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform_from_provider(self, source_provider):\n self.source_provider = source_provider\n return self.__transform()", "def set_source(self, source):\n self.data['source'] = source", "def source_type(self, source_type):\n\n self._source_type = source_type", "def source(self, s...
[ "0.6060129", "0.58456886", "0.58121955", "0.57038367", "0.56585306", "0.5564187", "0.5564187", "0.5564187", "0.5564187", "0.5564187", "0.5564187", "0.5564187", "0.55370766", "0.55113256", "0.5462026", "0.5448064", "0.54292", "0.54292", "0.54050654", "0.5384465", "0.5361171", ...
0.6681624
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, CreateCalendarRequest): return False return self.to_dict() == other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, CreateCalendarRequest): return True return self.to_dict() != other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", ...
0.0
-1
gets MSDSM's explicit load balancing policy for a given hardware type if no such policy exists, CLEAR_POLICY is returns, and NOT the globalwise policy
def get_hardware_specific_load_balancing_policy(cls, vendor_id, product_id): output = cls.execute(["-s", "-t"]) hardware_id = cls._get_hardware_id(vendor_id, product_id) return cls._extract_hardware_specific_load_balacing_policy(output, hardware_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_default_load_balancing_policy(cls):\n output = cls.execute([\"-s\", \"-m\"])\n return cls._extract_load_balancing_from_output(output)", "def set_hardware_specific_load_balancing_policy(cls, vendor_id, product_id, policy):\n cls.execute([\"-l\", \"-t\", cls._get_hardware_id(vendor_id,...
[ "0.6569381", "0.59992105", "0.5800603", "0.5786084", "0.57062864", "0.5675465", "0.5505157", "0.5442991", "0.5410181", "0.53849256", "0.53849256", "0.5381537", "0.5381537", "0.5381537", "0.5381537", "0.5381537", "0.5306607", "0.5276885", "0.5274634", "0.5274634", "0.5273049",...
0.64869505
1
Normalize data by mean and std
def normalize(self, mean=None, std=None): if mean is None: mean = self.mean if std is None: std = self.std new = self.copy() new.data = (new.data - mean) / std return new
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_data(data):\n mean = np.mean(data)\n std = np.std(data)\n return (data - mean) / std", "def normalize_data(self, data):\n self.find_mean_std(data)\n return (data - self._data_mean) / self._data_std", "def normalize(dataset):\n return normalize_standard_deviation(normalize_mean(d...
[ "0.8434648", "0.83735466", "0.83514005", "0.8309937", "0.813911", "0.8095093", "0.8094868", "0.80746734", "0.80746734", "0.7958982", "0.7909498", "0.79080135", "0.7903171", "0.7877104", "0.7725069", "0.771763", "0.76299673", "0.76246417", "0.7607675", "0.76022696", "0.7578414...
0.8003659
9
Row number of the cell.
def row(self): return self.address.row
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cellcount(self):\n self.cellcount += 1\n return self.cellcount - 1", "def get_row_number(self):\n return int(len(self.data_items)/12)", "def get_rows(self) -> int:\r\n return 1 + self.display.get_rows() + 1", "def row_counter(self) -> int:\n return self.writer.row_c...
[ "0.81436354", "0.79492503", "0.7681822", "0.76800704", "0.7493973", "0.7240358", "0.7240358", "0.72008276", "0.7172407", "0.7172407", "0.7172407", "0.7168775", "0.7168775", "0.7168775", "0.7168775", "0.7168775", "0.7168775", "0.7168775", "0.7168775", "0.7168775", "0.7168775",...
0.0
-1
Column number of the cell.
def col(self): return self.address.col
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cellcount(self):\n self.cellcount += 1\n return self.cellcount - 1", "def colnum(self):\n \n colnum = 0\n for table in self.columnlabels:\n table = np.asarray(table)\n if np.ndim(table) <= 1:\n table = np.reshape(table, (1, -1))\n ...
[ "0.7826401", "0.7552068", "0.726262", "0.726262", "0.726262", "0.726262", "0.72143805", "0.71628606", "0.71628606", "0.71628606", "0.7143345", "0.7139971", "0.713605", "0.71090776", "0.71090776", "0.71090776", "0.71090776", "0.6993653", "0.6971205", "0.69401604", "0.69244295"...
0.6185351
100
Horizontal alignment of the value in this cell.
def horizontal_alignment(self): self.update() return self._horizontal_alignment
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_horizontal_alignment(self, value):\n if self._simplecell:\n self.fetch()\n self.horizontal_alignment = value\n return self", "def align(self):\n return self[\"align\"]", "def align(self):\n return self[\"align\"]", "def align(self):\n return self[\...
[ "0.7409452", "0.72323525", "0.72323525", "0.72323525", "0.69622326", "0.69622326", "0.6784023", "0.66739255", "0.6484266", "0.6484266", "0.6300595", "0.62934643", "0.62763953", "0.6209386", "0.60543156", "0.6031389", "0.59866005", "0.59031236", "0.59017766", "0.5858133", "0.5...
0.74992216
0
Vertical alignment of the value in this cell.
def vertical_alignment(self): self.update() return self._vertical_alignment
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_vertical_alignment(self, value):\n if self._simplecell:\n self.fetch()\n self.vertical_alignment = value\n return self", "def get_vertical_alignment ( self, object ):\n return self.vertical_alignment", "def get_vertical_alignment ( self, object ):\n return ...
[ "0.7441967", "0.72014475", "0.72014475", "0.6974618", "0.6974618", "0.6974618", "0.6515785", "0.6444984", "0.6444984", "0.64078635", "0.63322556", "0.6172946", "0.6086818", "0.60649306", "0.6061121", "0.6029892", "0.5861079", "0.58519423", "0.5820007", "0.58154285", "0.580833...
0.7499262
0
Set value of the cell
def set_value(self, value): self.value = value return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setCell(self, row = None, column = None, value = None, *, cell = None):\n\n\t\t\t\tif (cell is None):\n\t\t\t\t\tcell = self.getCell(row = row, column = column)\n\n\t\t\t\tif (value is None):\n\t\t\t\t\tvalue = \"\"\n\n\t\t\t\t#Write Value\n\t\t\t\tfor _cell in self.ensure_container(cell):\n\t\t\t\t\t_cell.val...
[ "0.8426325", "0.81121373", "0.81121373", "0.7956469", "0.7692151", "0.7691583", "0.765155", "0.75266325", "0.7526605", "0.75253135", "0.7448543", "0.7394003", "0.73488754", "0.73422", "0.73391616", "0.72664326", "0.71940696", "0.7151409", "0.7083226", "0.7062165", "0.70527756...
0.0
-1
Generates a random string.
def GenerateRandomName(): buf = cStringIO.StringIO() buf.write(random.choice(_BEGIN_ALPHABET)) for _ in xrange(_LENGTH - 1): buf.write(random.choice(_ALPHABET)) return buf.getvalue()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generateRandomString():\n return ''.join(b64encode(urandom(32)).decode('utf-8'))", "def generate_random_string():\n return \"\".join(random.choice(string.ascii_lowercase + string.digits) for _ in range(16)) # nosec", "def __generate_random_string():\n return uuid4().hex[:6].upper()", "def g...
[ "0.84560287", "0.82843846", "0.80716765", "0.79450464", "0.79261374", "0.78291446", "0.7765885", "0.77650875", "0.7708884", "0.76824504", "0.76790863", "0.76734227", "0.76081663", "0.75977355", "0.7574635", "0.7539058", "0.7533451", "0.75309235", "0.75033206", "0.7502378", "0...
0.7443927
29
info_equipment_silos_get Gets array of all &x60;silo&x60; type equipment.
def info_equipment_silos_get(): equipment = _equipment_by_group(404) # 404 == Silo return equipment, 200
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info_equipment_get():\n equipment = _equipment_by_group()\n return equipment, 200", "def SI(As):\n return [A for A in As if A.is_SI()]", "def get_equipment_from_inventory(self):\n return [x for x in self.inventory if x.is_equip()]", "def get_silo(self, kwargs):\n silo = kwargs[\"si...
[ "0.590595", "0.5802894", "0.55763084", "0.54569453", "0.51872075", "0.51785463", "0.5134462", "0.51182604", "0.5077114", "0.5072936", "0.49910268", "0.4964943", "0.4960338", "0.49557588", "0.4902286", "0.4892064", "0.48766363", "0.4870165", "0.48684546", "0.48554105", "0.4842...
0.8025731
0
... Gets information about a specific silo or reactor of type &x60;type_id&x60;.
def info_equipment_type_id_get(type_id): session = info_map.Session() q = session.query(info_map.Equipment).filter(info_map.Equipment.type == type_id) q_equipment = q.one_or_none() if q_equipment is not None: equipment = EquipmentInfo( type=q_equipment.type, name=q_equi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info_towers_type_id_get(type_id):\n session = info_map.Session()\n\n q = session.query(info_map.Tower).filter(info_map.Tower.type==type_id)\n q_tower = q.one_or_none()\n\n if q_tower is None:\n error = Error('Type {} Not Found'.format(type_id))\n return error, 404\n else:\n ...
[ "0.64273417", "0.6409365", "0.63464624", "0.5812449", "0.5743849", "0.5735178", "0.56570697", "0.55146897", "0.5493715", "0.54579854", "0.53485316", "0.5339599", "0.53377044", "0.52807367", "0.52807367", "0.52807367", "0.52807367", "0.52807367", "0.52807367", "0.52807367", "0...
0.5347943
11
info_materials_polymer_get Gets array of information for materials belonging to the &x60;hybrid_polymer&x60; group.
def info_materials_polymer_get(): materials = _material_by_group(974) # 974 == intermediate group return materials, 200
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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_group(427) # 427 == intermediate group\n return materials, 200", "def info_materials_booster_get():\n materials = _material_by...
[ "0.6330627", "0.6324947", "0.61798847", "0.6098886", "0.5845665", "0.58380127", "0.5712282", "0.5572853", "0.5501908", "0.5256906", "0.5152851", "0.5108197", "0.5093082", "0.5053898", "0.50301653", "0.50117445", "0.5007073", "0.50035447", "0.49697763", "0.4946183", "0.4927814...
0.7704396
0
info_towers_type_id_get Gets type details for a specific tower with &x60;type_id&x60;.
def info_towers_type_id_get(type_id): session = info_map.Session() q = session.query(info_map.Tower).filter(info_map.Tower.type==type_id) q_tower = q.one_or_none() if q_tower is None: error = Error('Type {} Not Found'.format(type_id)) return error, 404 else: tower = TowerIn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def work_type_info(self,type_id):\n url = self.BASE_URL + 'types/' + type_id\n return self._make_get_request(url,models.pass_through)", "def getTypeID(self) -> int:\n ...", "def info_equipment_type_id_get(type_id):\n session = info_map.Session()\n\n q = session.query(info_map.Equipme...
[ "0.67885387", "0.6278862", "0.62483215", "0.61653554", "0.58298653", "0.5806513", "0.58008885", "0.57251716", "0.5705453", "0.56670266", "0.56458306", "0.5572307", "0.55531913", "0.5501472", "0.55010223", "0.5468028", "0.54644954", "0.5443738", "0.5409154", "0.53696805", "0.5...
0.8583815
0
Small helper to check pseudoequality of parsed arguments on `ArgumentParser` instances.
def argparsersEqual(self, a: argparse.ArgumentParser, b: argparse.ArgumentParser): self.assertEqual(len(a._actions), len(b._actions)) for x, y in zip(a._actions, b._actions): xx = {k: v for k, v in vars(x).items() if k != "container"} yy = {k: v for k, v in vars(y).items() if k !...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_args(self, parser: argparse):\n pass", "def check_argv():\n parser = argparse.ArgumentParser(\n description=__doc__.strip().split(\"\\n\")[0], add_help=False\n )\n parser.add_argument(\"npz_fn\", type=str, help=\"NumPy archive\")\n parser.add_argument(\n \"--metr...
[ "0.6908521", "0.6847377", "0.6765022", "0.67383665", "0.6728656", "0.65886974", "0.6520069", "0.649709", "0.6496028", "0.6481191", "0.6469778", "0.646593", "0.64435285", "0.63988554", "0.63676465", "0.6364478", "0.63558024", "0.6285132", "0.62711996", "0.6238257", "0.62330747...
0.6018255
40
initialize the convolutional weights from external sources
def initialize_(self, kernel, bias=None): dtype = self.body[0].weight.dtype device = self.body[0].weight.device kernel = torch.tensor(kernel, dtype=dtype, device=device, requires_grad=True) assert kernel.shape == self.body[0].weight.shape, 'Wrong kernel shape!' if bias is not Non...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_weight(self):\n init_layer(self.conv1)\n init_layer(self.conv2)\n init_bn(self.norm1)\n init_bn(self.norm2)", "def initialize_weights(self):\n for layer in self._cnn_layers:\n weights_initializer.WeightsInitializer.initialize_layer_or_model(layer)", "def init_weight...
[ "0.7707283", "0.76163775", "0.7367971", "0.7081997", "0.70735353", "0.70552", "0.70261794", "0.7004111", "0.6981914", "0.6979833", "0.6979833", "0.6979833", "0.6944894", "0.69382465", "0.6907979", "0.6891786", "0.6886772", "0.6883024", "0.68814385", "0.68665624", "0.6863251",...
0.0
-1
Get the value of the workflow state.
def get_workflow_state(self): state = self._gdb_interface.get_workflow_state() return state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def workflow_state(self):\n return self.getattr('workflow_state')", "def getValue(self, state):\n return self.values[state]", "def getValue(self, state):\n return self.values[state]", "def getValue(self, state):\n return self.values[state]", "def getValue(self, state):\n ...
[ "0.81738126", "0.774143", "0.774143", "0.774143", "0.774143", "0.774143", "0.774143", "0.774143", "0.774143", "0.774143", "0.774143", "0.774143", "0.774143", "0.7738205", "0.7738205", "0.7721314", "0.74927855", "0.74710155", "0.73475033", "0.73255765", "0.72705215", "0.7201...
0.73909634
18
Return workflow's current state.
def set_workflow_state(self, state): self._gdb_interface.set_workflow_state(state)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def workflow_state(self):\n return self.getattr('workflow_state')", "def get_workflow_state(self):\n state = self._gdb_interface.get_workflow_state()\n return state", "def get_workflow_state(self):\n return self._read_transaction(tx.get_workflow_state)", "def get_current_state(sel...
[ "0.86774427", "0.8436255", "0.8270832", "0.7877234", "0.76872474", "0.76734453", "0.7638846", "0.7612706", "0.7600637", "0.75564146", "0.7539786", "0.7530069", "0.7432403", "0.74069685", "0.7341035", "0.7341035", "0.7324472", "0.7297541", "0.7290465", "0.72597057", "0.7259705...
0.0
-1
Get the state of the task in a BEE workflow.
def get_task_state(self, task): return self._gdb_interface.get_task_state(task)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def workflow_state(self):\n return self.getattr('workflow_state')", "def get_task_state(self, task):\n return self._read_transaction(tx.get_task_state, task=task)", "def get_workflow_state(self):\n return self._read_transaction(tx.get_workflow_state)", "def TaskState(self):\n retu...
[ "0.75908023", "0.75550437", "0.75397456", "0.7523817", "0.7410685", "0.66350543", "0.6602705", "0.6509645", "0.65001637", "0.64986885", "0.64573014", "0.64559954", "0.6439921", "0.643707", "0.6387548", "0.63739985", "0.63389", "0.6287655", "0.62331474", "0.62331474", "0.62120...
0.7300946
5
Get a task input object.
def get_task_input(self, task, input_id): return self._gdb_interface.get_task_input(task, input_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_task_input(self, task, input_id):\n input_record = self._read_transaction(tx.get_task_input, task=task, input_id=input_id)\n return _reconstruct_task_input(input_record[\"i\"])", "def get_input(activity_task):\n try:\n input = json.loads(activity_task[\"input\"])\n except KeyEr...
[ "0.7996444", "0.7785932", "0.728005", "0.70826304", "0.70027125", "0.6958544", "0.6958544", "0.6958544", "0.6958544", "0.6958544", "0.6958544", "0.6958544", "0.67204386", "0.6641288", "0.66134584", "0.648235", "0.6450063", "0.6400933", "0.63355494", "0.63355494", "0.633423", ...
0.7808478
1
Return true if a workflow has been initialized, else false. Currently functionally the same as workflow_loaded() but may change when multiple workflows per database instance are supported.
def workflow_initialized(self): return self._gdb_interface.initialized()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def workflow_loaded(self):\n return bool(not self._gdb_interface.empty())", "def initialized(self) -> bool:\n return self._env.repo_is_initialized", "def isLoaded(self):\n\t\tif (self.Loaded):\n\t\t\treturn True\n\t\telse:\n\t\t\treturn False", "def initialized(self):\n # verbose = CMAKE...
[ "0.8085261", "0.67335707", "0.66535574", "0.658602", "0.65654093", "0.65590787", "0.65527964", "0.64919037", "0.64697134", "0.64194506", "0.6371147", "0.63431203", "0.6322748", "0.6295717", "0.62222815", "0.61863106", "0.6185213", "0.61795527", "0.6163161", "0.6143348", "0.61...
0.79402953
1
Make sure we on Home Page.
def is_on_home_page(self): current_url_path = urlparse(self.driver.current_url).path if current_url_path == "/opencart.com/": return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def go_home(self):\r\n if self.home_url is not None:\r\n self.set_url(self.home_url)", "def ishome(self) -> bool:\n pass", "def isHomePage(self):\n home = self.getHome(self.url)\n if home == self.url:\n return True\n if home == self.url + '/':\n ...
[ "0.7916476", "0.79071206", "0.78627676", "0.7619237", "0.7471857", "0.7471857", "0.74282503", "0.739136", "0.73656636", "0.73577523", "0.7301384", "0.7267416", "0.72648543", "0.7230129", "0.7221264", "0.7216947", "0.7211741", "0.716063", "0.7159932", "0.71449023", "0.7098572"...
0.7615845
4
Gets the word for a numeric index. It's the inverted index of tokenizer.word_index
def inverted_word_index(idx): words, idxs = zip(*tokenizer.word_index.items()) inverted_word_index = dict(zip(idxs, words)) return inverted_word_index.get(idx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_word_with_index(index):\n return reverse_word_index[index-3]", "def word_at(self, index, signed = False):\n return 0", "def index2word(index_word, index_dict):\n if index_word == -1 or index_word not in index_dict.keys():\n return '_eps_'\n else:\n return index_dict[index_word...
[ "0.71185416", "0.70030665", "0.69690275", "0.689556", "0.67301446", "0.6554378", "0.6424138", "0.6371555", "0.63237935", "0.63192016", "0.60297984", "0.6012512", "0.60036725", "0.59953034", "0.59649503", "0.5908518", "0.5867147", "0.5851885", "0.578998", "0.5783581", "0.57372...
0.65506154
6
Create an ExpressionTuple from the argument list.
def etuple(*args, **kwargs): return ExpressionTuple(args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tuple_from_sequence(*args):\n return tuple(args)", "def add_make_tuple(self, input_names, name=None):\n return self._build_op('make_tuple', input_names, name=name)", "def _convert_args(self, expr, args, kwargs):\n assert expr is not None\n\n if not kwargs:\n return args\n...
[ "0.706731", "0.6615204", "0.6342391", "0.6166674", "0.6147584", "0.6138586", "0.60783774", "0.6051736", "0.6042792", "0.6013283", "0.59804356", "0.59657633", "0.5926374", "0.5908236", "0.5895943", "0.5875364", "0.5874082", "0.582572", "0.5814472", "0.5811136", "0.57383716", ...
0.7851466
0
Return an expressiontuple for an object (i.e. a tuple of rand and rators). When evaluated, the rand and rators should [re]construct the object. When the object cannot be given such a form, it is simply converted to an `ExpressionTuple` and returned.
def etuplize(x, shallow=False, return_bad_args=False): if isinstance(x, ExpressionTuple): return x elif x is not None and isinstance(x, (ConsNull, ConsPair)): return etuple(*x) try: # This can throw an `IndexError` if `x` is an empty # `list`/`tuple`. op = operator(x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def etuple(*args, **kwargs):\n return ExpressionTuple(args, **kwargs)", "def eval_obj(self):\n if self._eval_obj is not self.null:\n return self._eval_obj\n else:\n evaled_args = [getattr(i, \"eval_obj\", i) for i in self._tuple[1:]]\n arg_grps = toolz.groupby(la...
[ "0.5762293", "0.57256657", "0.5714239", "0.5693082", "0.5489034", "0.54035276", "0.5286356", "0.5156198", "0.5116044", "0.4976834", "0.49533644", "0.49224707", "0.4860231", "0.4839558", "0.48391026", "0.48206934", "0.4807789", "0.48030072", "0.47959676", "0.47603655", "0.4720...
0.42550898
92
Checks that new password is different from the old one.
def clean(self): cleaned_data = super(ChangePasswordForm, self).clean() if 'new_password1' not in cleaned_data or ( 'old_password' not in cleaned_data): return cleaned_data new_password1 = cleaned_data['new_password1'] old_password = cleaned_data['old_password...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def old_password_check(form, field):\n old_password = field.data\n password = current_user.password\n r = pwd_context.verify(old_password, current_user.password)\n if not r:\n raise validators.ValidationError('old password is wrong')", "def clean_old_password(self):\n old_password = sel...
[ "0.8218274", "0.75920165", "0.75815976", "0.7525574", "0.7516791", "0.75152874", "0.7420153", "0.7417503", "0.73723835", "0.73492736", "0.73198617", "0.7301317", "0.72529405", "0.7252495", "0.7247974", "0.7225164", "0.7215783", "0.71830356", "0.7118095", "0.7114967", "0.71136...
0.7257933
12
Returns the first (agent) config if it exists
def default(self): return self._configs[0] if len(self._configs) else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config() -> Optional[Config]:\n return CurrentConfig.get()", "def get_config(self, name):\n return self.configs[name][0]", "def get_next_config(self):\n\n self.reset_trial()\n self._cur_config = self.get_default()\n return self._cur_config if len(self._results) == 0 else ...
[ "0.68275225", "0.6681222", "0.6441166", "0.63606095", "0.6337707", "0.6310026", "0.62764406", "0.62681717", "0.62672555", "0.62220144", "0.62137663", "0.6158311", "0.6139016", "0.6116565", "0.6099824", "0.6076288", "0.60514563", "0.6049106", "0.6018028", "0.60078484", "0.6006...
0.6616274
2
Simple method for returning the direct config object (pierce the abstracton).
def get_config(self, filename): if filename in self._path_index: return self._configs[self._path_index[filename]] elif filename in self._name_index: return self._configs[self._name_index[filename]] elif filename in self._configs: return self._configs[filename]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config():\n return Config()", "def config():\n return Config()", "def _get_config(self):\n return self.__config", "def _get_config(self):\n return self.__config", "def _get_config(self):\n return self.__config", "def _get_config(self):\n return self.__config", "def _get_config(sel...
[ "0.78938085", "0.78938085", "0.78739125", "0.78739125", "0.78739125", "0.78739125", "0.78739125", "0.78739125", "0.78739125", "0.78739125", "0.78739125", "0.78739125", "0.78739125", "0.78739125", "0.78739125", "0.78739125", "0.78739125", "0.78739125", "0.78739125", "0.78739125"...
0.0
-1
Filter by genres only, default order by rating
def chatbot_genre_query(self, genres: list): #-> cursor object if not self.client: self.connect() return self.db.find({"$query": { "genre": { "$in": genres }}, "$orderby": { "avg_vote" : -1 }}).limit(25)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_genre(self):\n return self.sort('genre')", "def ratings_genre(Y, genres, genre_id):\n # Filter Y for only ratings of movies in the genre.\n genre_Y = filter(\n lambda user_movie_rating: genres[user_movie_rating[1]][genre_id], Y\n )\n bar_count_ratings(genre_Y, 'Rating distribut...
[ "0.70228237", "0.6662912", "0.6549775", "0.6419749", "0.61386824", "0.6075597", "0.602869", "0.600298", "0.59209967", "0.58671343", "0.57941294", "0.5786716", "0.57831573", "0.56835747", "0.56504637", "0.56333935", "0.5586098", "0.5585946", "0.5571421", "0.5569255", "0.552294...
0.60557246
6
Forward the turn_on command to the switch in this light switch.
async def async_turn_on(self, **kwargs: Any) -> None: await self.hass.services.async_call( SWITCH_DOMAIN, SERVICE_TURN_ON, {ATTR_ENTITY_ID: self._switch_entity_id}, blocking=True, context=self._context, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_on(self, **kwargs):\n self._send_command(\"turn_on\")", "def turn_on(self):\n GPIO.output(self.gpio, True) # turn on light", "def lightning_turnon(self):\n self.turnOn()", "def turn_on(self) -> None:\n self._state = self._player.turn_on()", "def turn_on(self, **kwargs)...
[ "0.7764154", "0.7566925", "0.7501928", "0.7315117", "0.72621936", "0.7127489", "0.7030782", "0.69779074", "0.6971074", "0.6942896", "0.6905027", "0.68822736", "0.68619883", "0.68618166", "0.6859013", "0.6852448", "0.6831925", "0.68313575", "0.6786743", "0.6742766", "0.673696"...
0.6523862
32
Forward the turn_off command to the switch in this light switch.
async def async_turn_off(self, **kwargs: Any) -> None: await self.hass.services.async_call( SWITCH_DOMAIN, SERVICE_TURN_OFF, {ATTR_ENTITY_ID: self._switch_entity_id}, blocking=True, context=self._context, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_off(self):\n print(\"Turning the lights off\")\n self.led.all_off()\n self.client.publish(STATE_TOPIC, OFF) #publish", "def turn_off(self, **kwargs):\n self._send_command(\"turn_off\")", "def turn_off(self):\n self.handleCommand(1)\n self._state = STATE_OFF", ...
[ "0.78730065", "0.7855249", "0.7832026", "0.77367496", "0.77086437", "0.76635927", "0.76395625", "0.76272076", "0.7624852", "0.7579611", "0.7576153", "0.757077", "0.7547561", "0.7399789", "0.73824257", "0.73693633", "0.7299171", "0.72709745", "0.7256585", "0.72240967", "0.7223...
0.7090578
31
Tests data_arrays associated with the spill_container's initializers get initialized to nonzero values. Uses sample_sc_no_uncertainty fixture defined in conftest.py It initializes a SpillContainer object with two Spill objects. For first Spill object, set element_type=floating() and for the second Spill object, set ele...
def test_element_types(elem_type, arr_types, sample_sc_no_uncertainty): sc = sample_sc_no_uncertainty release_t = None for idx, spill in enumerate(sc.spills): spill.release.num_elements = 20 spill.element_type = elem_type[idx] if release_t is None: release_t = spill.rel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_scalar_null(setup_teardown_file):\n f = setup_teardown_file[3]\n\n dset = f.create_dataset('x', shape=(), dtype='i1')\n out = dset[()]\n\n assert out.dtype == \"int8\"", "def test_empty_input(self):\n discs = calc_disc(np.column_stack((np.ones(0), np.ones(0), np.ones(0))))\n np...
[ "0.56414616", "0.5639996", "0.5595986", "0.5565307", "0.5561602", "0.5515527", "0.54247344", "0.5379217", "0.53539866", "0.53539866", "0.5297714", "0.5291884", "0.5287311", "0.52353257", "0.5230813", "0.52275115", "0.5198817", "0.51814646", "0.5180948", "0.5169366", "0.515403...
0.60738707
0
Returns primary email address for user.
def email(self): # Look for a primary address useremail = UserEmail.query.filter_by(user_id=self.id, primary=True).first() if useremail: return useremail # No primary? Maybe there's one that's not set as primary? useremail = UserEmail.query.filter_by(user_id=self.id)....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_email(self):\n member = self.get_user()\n if member:\n return member.getProperty('email')", "def GetEmailAddress(user_id):\n user_id = user_id.strip()\n if '@' in user_id:\n email = user_id\n else:\n email = user_id + '@' + os.environ['AUTH_DOMAIN']\n\n if IsEmailV...
[ "0.78028786", "0.77713746", "0.7764561", "0.7728864", "0.76348764", "0.75360286", "0.7458946", "0.7336919", "0.7315691", "0.72993445", "0.7263331", "0.7262461", "0.7251671", "0.72314334", "0.7212976", "0.71790814", "0.7163576", "0.71492904", "0.7122921", "0.71066886", "0.7089...
0.8366688
0
Return the organizations this user is an owner of.
def organizations_owned(self): return sorted(set([team.org for team in self.teams if team.org.owners == team]), key=lambda o: o.title)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def organizations(self):\n return self.get('{}/orgs'.format(ApiVersion.A1.value))", "def users_organizations(user):\n if not user or not user.is_authenticated():\n return None\n else:\n return get_users_organizations(user)", "def organizations(self) -> pulumi.Output[Optional[Sequence[str...
[ "0.75234264", "0.7355202", "0.7338327", "0.732963", "0.7157286", "0.7157286", "0.6971191", "0.69580215", "0.6817423", "0.67844224", "0.6716645", "0.67040765", "0.66907626", "0.66826135", "0.6634238", "0.6566632", "0.6552039", "0.6487494", "0.6436868", "0.6402666", "0.63780403...
0.75082576
1
Return the database ids of the organizations this user is an owner of. This is used for database queries.
def organizations_owned_ids(self): return list(set([team.org.id for team in self.teams if team.org.owners == team]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_owned_databases(cursor: Cursor, owner: Owner) -> List[str]:\n try:\n role = pgsql.get_role(cursor, owner_name(owner))\n except KeyError:\n return []\n else:\n return pgsql.get_role_databases(cursor, role)", "def owners(self):\n return self.find_users_by_rel('owner')",...
[ "0.6630027", "0.6190039", "0.61056006", "0.6053241", "0.59775424", "0.59524024", "0.5898232", "0.5860923", "0.5847888", "0.5791888", "0.57729286", "0.57369775", "0.5725238", "0.57117176", "0.56789976", "0.56789976", "0.5667667", "0.56619185", "0.56433517", "0.55884355", "0.55...
0.7049594
0
Return True if profile is complete (fullname, username and email are present), False otherwise.
def is_profile_complete(self): return bool(self.fullname and self.username and self.email)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_profile_complete(self):\n return self.height is not None and self.target_weight is not None and self.sex is not None", "def test_profile_is_complete(empty_field):\n profile = ProfileFactory.create()\n if empty_field:\n setattr(profile, empty_field, \"\")\n assert profile.is_comp...
[ "0.7660327", "0.6515523", "0.6258003", "0.62203634", "0.60552484", "0.60441434", "0.60126865", "0.600802", "0.60051453", "0.60035336", "0.59825146", "0.5960877", "0.5956045", "0.5915388", "0.5888117", "0.58855486", "0.578887", "0.5775631", "0.5775514", "0.57733446", "0.573166...
0.91561294
0
Asserts the specified scope tree equals to the expected.
def assertScopeTree(self, actual_scope, expected_scope): self.assertIsInstance(actual_scope, dict) self.assertIsInstance(expected_scope, dict) self.assertIs(actual_scope['type'], expected_scope['type']) self.assertEqual(actual_scope['variables'], expected_scope['variables']) ac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assertScopeIs(self, scope, used, modified):\n self.assertSymbolSetsAre(used, scope.read, 'read')\n self.assertSymbolSetsAre(modified, scope.modified, 'modified')", "def test_scope(self):\n self.assertEqual(gde.util.scope_finalize(\"foo/bar\"), \"foo/bar/\")\n self.assertEqual(gde.util.scope_dirna...
[ "0.6755343", "0.57084304", "0.56344545", "0.55606353", "0.55191064", "0.54519325", "0.54107094", "0.5380722", "0.5373398", "0.53439", "0.53340614", "0.5286944", "0.5251546", "0.5241494", "0.52386934", "0.52292556", "0.5222548", "0.5217494", "0.52065426", "0.52061564", "0.5201...
0.75867707
0
Returns the indices of missing values in given column and DataFrame.
def get_nan_idx(column, df): return df[df[column].isna()].index.values
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_missing(self):\n missing_values = self.df[self.col_name].isnull().sum()\n return missing_values", "def get_undef_cols_idx(x, undef_val):\n undef_col_idx = []\n for col_idx in range(x.shape[1]):\n column = x[:, col_idx]\n if((column == undef_val).all()):\n undef_col_id...
[ "0.6708618", "0.6640726", "0.61746544", "0.5945225", "0.5769853", "0.5581568", "0.5565339", "0.5565339", "0.55574757", "0.555494", "0.5534359", "0.551519", "0.5497504", "0.549431", "0.5476203", "0.54515845", "0.5448321", "0.5447253", "0.54446787", "0.54337037", "0.54337037", ...
0.7734628
0
Returns an index that can pass by certain conditions Assume, list structure is same This means that the element's length of maximum depth is same This property can be ensured whether list is convertible to numpy or not
def get_index_from_nested_list(data, conditions): assert type(np.array(data)) == np.ndarray, "Please match list's element structure" def check_function(element): return sum(apply_function_vector(conditions, element)) == len(conditions) condition_results = np.array(list(map(lambda element: True...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solveProblem(list):\n return len(findSubArray(list))", "def get_max_index_of_list(a_list):\n if isinstance(a_list, np.ndarray):\n idx = np.argmax(a_list)\n elif isinstance(a_list, list):\n idx=a_list.index(max(a_list))\n return idx", "def _get_list_value(index, array):\r\n if l...
[ "0.62655646", "0.5775952", "0.5745775", "0.5729268", "0.57074714", "0.5699579", "0.5644121", "0.55637735", "0.5535851", "0.5535571", "0.5526095", "0.5513824", "0.5511535", "0.5461871", "0.545002", "0.54438853", "0.5436087", "0.54269624", "0.5412735", "0.53786576", "0.53701025...
0.6035402
1
Remove redundant rows in a 2D array.
def remove_duplicate_pairs(pairs): uniq_pairs = np.unique(np.sort(pairs, axis=1), axis=0) return uniq_pairs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_dupl_2d(arr):\n arr_len = len(arr)\n idx = 0\n unique = set()\n while idx < arr_len:\n if tuple(arr[idx]) in unique:\n del arr[idx]\n arr_len -= 1\n continue\n unique.add(tuple(arr[idx]))\n idx += 1\n return arr", "def unique_rows(ar...
[ "0.7427939", "0.6523278", "0.6502353", "0.6420778", "0.6366982", "0.6311192", "0.6306388", "0.62814486", "0.6265097", "0.62396204", "0.6229771", "0.60985744", "0.60885894", "0.59301287", "0.5876699", "0.58752686", "0.5822574", "0.5772816", "0.57662255", "0.5728899", "0.571172...
0.5856237
16
Displays an image with thigh layout and without axes.
def showim(image, figsize=(9,9), ax=None, **kwargs): if ax is None: return_ax = True fig, ax = plt.subplots(figsize=figsize) else: return_ax = False ax.imshow(image, **kwargs) ax.axis('off') ax.figure.tight_layout() if return_ax: return fig, ax
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plt_show_image(image):\r\n plt.imshow(image)\r\n plt.axis('off')\r\n plt.axis('image')\r\n plt.tight_layout(pad=0)", "def show_image(img, bw=False, alpha=1, no_ticks=True, title=''):\n if not bw:\n plt.imshow(img, alpha=alpha)\n else:\n plt.imshow(img, alpha=alpha, cmap=plt.ge...
[ "0.74564666", "0.71203893", "0.69177717", "0.69142455", "0.6881091", "0.68015707", "0.6702259", "0.6702259", "0.6702259", "0.66623855", "0.6640822", "0.6603975", "0.65924495", "0.65654963", "0.6523868", "0.6511689", "0.6494621", "0.6486562", "0.64772516", "0.6473564", "0.6472...
0.64326304
24
Convert an array of coordinates of nodes into a dataframe.
def coords_to_df(coords, columns=None): nb_dim = coords.shape[1] if columns is None: if nb_dim == 2: columns = ['x', 'y'] elif nb_dim == 3: columns = ['x', 'y', 'z'] else: columns = ['x'+str(i) for i in range(nb_dim)] nodes = pd.DataFrame(data...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_nparray_to_df(nparray: np.ndarray) -> pd.DataFrame:\n return pd.DataFrame(data=nparray[1:, 1:],\n index=nparray[1:, 0],\n columns=nparray[0, 1:])", "def pairs_to_df(pairs, columns=['source', 'target']):\n\n edges = pd.DataFrame(data=pairs, columns=colu...
[ "0.6632619", "0.6244005", "0.6242919", "0.62031627", "0.607918", "0.60278714", "0.59574014", "0.595516", "0.5941459", "0.5928194", "0.5882817", "0.5775229", "0.5745484", "0.5655849", "0.5629929", "0.5624326", "0.56232446", "0.56177723", "0.5602782", "0.55818737", "0.55790675"...
0.78486717
0
Sort twice an array, first on axis 1, then preserves whole rows and sort by one column on axis 0. Usefull to compare pairs of nodes obtained with different methods.
def double_sort(data, last_var=0): # doing simply np.sort(np.sort(pairs, axis=1), axis=0) # would uncouple first and second elements of pairs # during the second sorting (axis=0) data = np.sort(data, axis=1) x_sort = np.argsort(data[:, 0]) data = data[x_sort] return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_by_rows(arr):\n return arr[np.lexsort(arr.T[::-1])]", "def _sort_on_first_sequence(x: Tensor, y: Tensor) ->Tuple[Tensor, Tensor]:\n y = torch.clone(y)\n x, y = x.T, y.T\n x, perm = x.sort()\n for i in range(x.shape[0]):\n y[i] = y[i][perm[i]]\n return x.T, y.T", "def merge_sor...
[ "0.65879536", "0.6219641", "0.61398816", "0.6091375", "0.60643595", "0.6051954", "0.60437024", "0.5970286", "0.5961236", "0.5953032", "0.5940348", "0.5927935", "0.5879487", "0.5859", "0.5835104", "0.58219874", "0.5815098", "0.58118254", "0.5810778", "0.5804389", "0.5793223", ...
0.69055223
0
Symmetrically normalize adjacency matrix.
def normalize_adj(adj): adj = sp.coo_matrix(adj) rowsum = np.array(adj.sum(1)) d_inv_sqrt = np.power(rowsum, -0.5).flatten() d_inv_sqrt[np.isinf(d_inv_sqrt)] = 0. d_mat_inv_sqrt = sp.diags(d_inv_sqrt) return adj.dot(d_mat_inv_sqrt).transpose().dot(d_mat_inv_sqrt).tocoo()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_adj(adj):\n\n rowsum = np.array(adj.sum(1))\n d_inv_sqrt = np.power(rowsum, -0.5).flatten()\n d_inv_sqrt[np.isinf(d_inv_sqrt)] = 0.\n d_mat_inv_sqrt = np.diag(d_inv_sqrt)\n return adj.dot(d_mat_inv_sqrt).transpose().dot(d_mat_inv_sqrt)", "def normalize_adj(adj):\n adj = sp.coo_mat...
[ "0.788518", "0.7698141", "0.7698141", "0.7698141", "0.7698141", "0.7698141", "0.7698141", "0.7698141", "0.7698141", "0.7698141", "0.759434", "0.7566608", "0.7335597", "0.730491", "0.72684425", "0.688461", "0.68616927", "0.686005", "0.6832041", "0.682895", "0.6750887", "0.67...
0.7691616
10
Convert a scipy sparse matrix to a torch sparse tensor.
def sparse_mx_to_torch_sparse_tensor(sparse_mx): sparse_mx = sparse_mx.tocoo().astype(np.float32) indices = torch.from_numpy( np.vstack((sparse_mx.row, sparse_mx.col)).astype(np.int64)) values = torch.from_numpy(sparse_mx.data) shape = torch.Size(sparse_mx.shape) return torch.sparse.Fl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def csr2tensor(self, matrix: sp.csr_matrix):\n matrix = matrix.tocoo()\n x = torch.sparse.FloatTensor(\n torch.LongTensor(np.array([matrix.row, matrix.col])),\n torch.FloatTensor(matrix.data.astype(np.float32)),\n matrix.shape,\n ).to(self.device)\n retu...
[ "0.8299787", "0.8148542", "0.8045949", "0.80325705", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80134654", "0.79973555", "0.79973555", ...
0.7985302
21
A dedicated method to generate a word dictionary that maps all input words (plus their normalized form) into the actual objects that are present inside the db. If not they will be merged. Returns a dictionary that maps all words to be used for fragment generation.
def _gen_word_dict(words): # grab all of them with a single in statement. results = lookup_words_by_words( (set([self.normalize(w) for w in words] + words)), session, Word) def merge(word): if word in results: retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buildDict(self, words):\n for word in words:\n length = len(word)\n key = \"{}/{}\".format(length, word[0])\n ls = self.origin.get(key, [])\n ls.append(word)\n self.origin[key] = ls", "def constitute_word_dict(self):\r\n\r\n #IS THIS NECESS...
[ "0.67200947", "0.6625876", "0.6563597", "0.6516098", "0.6492723", "0.6482178", "0.64553916", "0.64371216", "0.63821185", "0.6304204", "0.6237513", "0.62254953", "0.6115732", "0.61110294", "0.607431", "0.60695404", "0.60642964", "0.6052985", "0.6050083", "0.59877324", "0.59838...
0.7829429
0
Yield successive nsized chunks from l.
def chunks(seq, size): for i in range(0, len(seq), size): yield seq[i:i + size]
{ "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.0
-1
Checks whether `chars` is a control character.
def _is_control(char): # These are technically control characters but we count them as whitespace # characters. if char == "\t" or char == "\n" or char == "\r": return False cat = unicodedata.category(char) if cat.startswith("C"): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_control(char):\n # These are technically control characters but we count them as whitespace\n # characters.\n if char == \"\\t\" or char == \"\\n\" or char == \"\\r\":\n return False\n cat = unicodedata.category(char)\n if cat.startswith(\"C\"):\n re...
[ "0.8177336", "0.8169858", "0.80915713", "0.6468453", "0.58763784", "0.582512", "0.5796899", "0.5719301", "0.57148904", "0.57065594", "0.56959367", "0.5653251", "0.5603813", "0.5585948", "0.55843735", "0.55716395", "0.55498976", "0.55498976", "0.55404437", "0.5529611", "0.5528...
0.81981814
0
Get euclidean distance of two ndarray.
def __dist(u, v): return spatial.distance.euclidean(u, v)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def euclidean_distance(x: np.ndarray, y: np.ndarray) -> float:\n\n distance = np.linalg.norm(x - y)\n\n return distance", "def euclidean_distance(x1: np.ndarray, x2: np.ndarray) -> float:\n return np.sqrt(np.square(x1 - x2).sum())", "def euclidean_distance(arr1,arr2):\n distance = np.sqrt(np.sum((a...
[ "0.84578055", "0.843366", "0.837038", "0.81413156", "0.80824345", "0.7987596", "0.7979049", "0.78321725", "0.77563345", "0.7672047", "0.76141065", "0.7596758", "0.7591913", "0.7575157", "0.7558568", "0.7546465", "0.7510201", "0.75062114", "0.7467394", "0.7464438", "0.7432162"...
0.0
-1
Add headers to both force latest IE rendering engine or Chrome Frame, and also to cache the rendered page for 10 minutes.
def add_header(response): response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1' response.headers['Cache-Control'] = 'public, max-age=0' return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, max-age=60'\n return response", "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, m...
[ "0.8221727", "0.8220911", "0.8220911", "0.8220911", "0.8220911", "0.81940746", "0.81111443", "0.80852413", "0.79712725", "0.78637785", "0.7659569", "0.72363365", "0.71586627", "0.71513546", "0.71513546", "0.71502376", "0.71502376", "0.7140211", "0.7135492", "0.7126684", "0.71...
0.8161616
20
This program return the addition of a and b
def addition(a, b): result = a + b return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def suma(a, b):\n\n\ttotal = a + b\n\treturn total", "def addition(a, b):\n return a + b", "def add(self, a, b):\n return a + b", "def add(a,b):\r\n result=a+b\r\n return result", "def addition(a,b):\n return a+b", "def add_numbers(a,b):\r\n return a+ b", "def add( a, b ):\n re...
[ "0.86424017", "0.8625883", "0.8575068", "0.85576713", "0.85202205", "0.8473523", "0.8429532", "0.84253705", "0.8383523", "0.8371983", "0.8361959", "0.8361959", "0.8361959", "0.8361959", "0.8361959", "0.8361959", "0.8361088", "0.8361088", "0.83610564", "0.83432174", "0.8342991...
0.8906723
0
Return the class of this device.
def device_class(self): return BINARY_SENSORS[self.info_type]["device_class"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_class(self):\n return devices.get_class(self.type)", "def device_class(self):\n return self.type", "def device_class(self):\n return self.type", "def device_class(self):\n return self.type", "def device_class(self):\n return self.sensor_type[\"class\"]", "def de...
[ "0.9229803", "0.9017451", "0.9017451", "0.9017451", "0.8966804", "0.89290935", "0.89290935", "0.89290935", "0.89290935", "0.89290935", "0.89265805", "0.89143944", "0.88131243", "0.8740996", "0.86684036", "0.8621287", "0.86166286", "0.8544227", "0.8544227", "0.8488545", "0.839...
0.86034
17
Get pixel coordinates of the face bounding box.
def get_face_bbox_for_output(data_cfg, pose, crop_smaller=0): if len(pose.shape) == 3: pose = L.unsqueeze(pose, [0]) elif len(pose.shape) == 5: pose = pose[-1, -1:] _, _, h, w = pose.shape use_openpose = False # 'pose_maps-densepose' not in data_cfg.input_labels if use_openp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_face_coords(self, frame):\n\n\t\ttry:\n\t\t\tresults = self.face_detector.detect_faces(frame) # Detects faces in the image\n\n\t\t\tx1, y1, width, height = results[0]['box'] # Bounding box of first face\n\t\t\tx1, y1 = abs(x1), abs(y1) # bug fix...\n\t\t\tx2, y2 = x1 + width, y1 + height\n\t\texcept:\n\...
[ "0.75683945", "0.73199755", "0.7138412", "0.7094686", "0.6944965", "0.6944965", "0.6929223", "0.6876521", "0.67271036", "0.6708694", "0.67064774", "0.6689314", "0.6632134", "0.6627218", "0.6585066", "0.65747625", "0.6526595", "0.652475", "0.6519756", "0.64742786", "0.64388686...
0.0
-1
minimized `objective` using `optimizer` w.r.t. variables in `var_list` while ensure the norm of the gradients for each variable is clipped to `clip_val`
def minimize_and_clip(optimizer, objective, var_list, clip_val=10): gradients = optimizer.compute_gradients(objective, var_list=var_list) for i, (grad, var) in enumerate(gradients): if grad is not None: gradients[i] = (tf.clip_by_norm(grad, clip_val), var) return optimizer.apply_gradient...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clip_gradient(optimizer, grad_clip):\r\n for group in optimizer.param_groups:\r\n for param in group['params']:\r\n if param.grad is not None:\r\n param.grad.data.clamp_(-grad_clip, grad_clip)", "def wasserstein_d_update(loss, optimizer, clipping_value, var_list=None, name...
[ "0.6920718", "0.6902635", "0.68931025", "0.68931025", "0.68931025", "0.68931025", "0.68931025", "0.6582693", "0.64683825", "0.63839215", "0.6305887", "0.61805135", "0.6106104", "0.60038155", "0.5956716", "0.5930686", "0.5924098", "0.5912812", "0.5906947", "0.5906716", "0.5879...
0.86587673
0
Detect the distribution we run on. Returns C{None} if the distribution is unknown.
def detect(): id = None if lsb_release: id = lsb_release.get_distro_information()['ID'] else: try: lsb_cmd = subprocess.Popen(['lsb_release', '--id', '-s'], stdout=subprocess.PIPE, stderr=subprocess.DE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dist(\n package: str, distributions: List[metadata.Distribution]\n) -> Optional[metadata.Distribution]:\n for dist in distributions:\n if canonicalize_name(dist.metadata[\"name\"]) == canonicalize_name(package):\n return dist\n return None", "def get_distribution(self, name: st...
[ "0.65360194", "0.64382267", "0.63081384", "0.62859154", "0.603015", "0.58941746", "0.5511781", "0.5473931", "0.5456583", "0.54372996", "0.5426276", "0.5422632", "0.5384776", "0.5344702", "0.5326665", "0.5313272", "0.530478", "0.53039247", "0.52750427", "0.5226195", "0.5216842...
0.60777664
4
Gets the conan_channel of this PackagesValidateuploadConan. Conan channel.
def conan_channel(self): return self._conan_channel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getChannel(self):\r\n return self.channel", "def channel(self):\n return self._channel", "def channel(self):\n return self._channel", "def channel(self) -> Channel:\n return self._channel", "def channel(self) -> 'Channel': # stub\n return self._channel", "def get_c...
[ "0.6667482", "0.6643652", "0.6643652", "0.64813036", "0.6396637", "0.63468975", "0.6231727", "0.6223075", "0.6223075", "0.617829", "0.61510575", "0.6136269", "0.6122096", "0.6035795", "0.6009541", "0.6008983", "0.59376764", "0.59007156", "0.58908975", "0.588123", "0.5836054",...
0.7833787
0
Sets the name of this PackagesValidateuploadConan. The name of this package.
def name(self, name): self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_pkg_file_name(self, doc, name):\n self.assert_package_exists()\n if not self.package_file_name_set:\n self.package_file_name_set = True\n doc.package.file_name = name\n return True\n else:\n raise CardinalityError('Package::FileName')", "de...
[ "0.6875987", "0.6775543", "0.6775543", "0.6775543", "0.6775543", "0.6775543", "0.6773961", "0.6766468", "0.67637914", "0.67637914", "0.6747513", "0.67370623", "0.67354846", "0.67350054", "0.67350054", "0.67219174", "0.672011", "0.6711983", "0.6676644", "0.6668963", "0.6668963...
0.0
-1
Gets the package_file of this PackagesValidateuploadConan. The primary file for the package.
def package_file(self): return self._package_file
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file(self):\n return self.theFile", "def file(self):\n return self.__file", "def file(self):\n return self._file", "def file(self):\n return self._file", "def file(self):\n return self._file", "def bkg_file(self):\n return self._return_if('_bkg_file')", ...
[ "0.6725227", "0.6619508", "0.6614374", "0.6614374", "0.6614374", "0.6548022", "0.65089774", "0.6474492", "0.6398804", "0.63876027", "0.63728946", "0.6355717", "0.63378674", "0.6225192", "0.62219995", "0.60542774", "0.60474354", "0.60238844", "0.59482676", "0.5938543", "0.5938...
0.78036183
0
Gets the republish of this PackagesValidateuploadConan. If true, the uploaded package will overwrite any others with the same attributes (e.g. same version); otherwise, it will be flagged as a duplicate.
def republish(self): return self._republish
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_duplicate(self):\n return bool(self.duplicated)", "def package_duplicates(config, key):\n for dup in duplicates:\n if ((config.value[key[0]].value['use_name'].value ==\n \"'\"+dup['use_name']+\"'\") and\n (config.value[key[0]].value['dom_name'].value...
[ "0.5693314", "0.54048264", "0.52064383", "0.51720625", "0.5130952", "0.509345", "0.49396333", "0.48743057", "0.4860968", "0.48338404", "0.48171023", "0.48118237", "0.47642094", "0.47493032", "0.47469112", "0.47431198", "0.47429913", "0.47365427", "0.47348762", "0.47340596", "...
0.6168775
0
Sets the republish of this PackagesValidateuploadConan. If true, the uploaded package will overwrite any others with the same attributes (e.g. same version); otherwise, it will be flagged as a duplicate.
def republish(self, republish): self._republish = republish
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def package_duplicates(config, key):\n for dup in duplicates:\n if ((config.value[key[0]].value['use_name'].value ==\n \"'\"+dup['use_name']+\"'\") and\n (config.value[key[0]].value['dom_name'].value ==\n \"'\"+dup['dom_name']+\"'\") and\...
[ "0.55953145", "0.55178195", "0.50429386", "0.49798515", "0.49246606", "0.49100035", "0.49016917", "0.4864604", "0.48499233", "0.48066214", "0.47536334", "0.47515762", "0.47480172", "0.4713158", "0.47099832", "0.4693102", "0.46879792", "0.46759307", "0.4658969", "0.4617457", "...
0.60106707
0
Gets the tags of this PackagesValidateuploadConan. A commaseparated values list of tags to add to the package.
def tags(self): return self._tags
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['PackagingConfigurationTagArgs']]]]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Sequence[str]:\n return pulumi.get(self, \"tags\")", "def tags(self):\n return self.get(\"tags\")", "def tags(self) -> Optional[Sequ...
[ "0.67272997", "0.6619701", "0.66015184", "0.6509138", "0.6402477", "0.6401254", "0.63776714", "0.6364328", "0.6364328", "0.6364328", "0.6355829", "0.634032", "0.63387674", "0.6315701", "0.6303924", "0.6303924", "0.6303924", "0.6303924", "0.6303924", "0.6303924", "0.6303924", ...
0.6184233
43
Gets the version of this PackagesValidateuploadConan. The raw version for this package.
def version(self): return self._version
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_version(self):\n return self.version", "def get_version(self):\n return self.http_call(\"get\", url=f\"{self.base_url}/version\").json()", "def get_version(self):\n return self.__make_api_call('get/version')", "def get_version(self):\n return self.bot_data_file[\"version\"...
[ "0.7274935", "0.71790636", "0.7162353", "0.71619034", "0.71594507", "0.71594507", "0.71513873", "0.7146826", "0.7124466", "0.7088627", "0.70140904", "0.7006317", "0.7006317", "0.69977725", "0.6979267", "0.6964114", "0.6958839", "0.6921082", "0.6910214", "0.6896678", "0.689265...
0.6871671
27
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, PackagesValidateuploadConan): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Returns whether x is a sequence (tuple, list).
def is_sequence(x): return (not hasattr(x, 'strip') and hasattr(x, '__getitem__') or hasattr(x, '__iter__'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_sequence_of_tuple(items):\n return all(isinstance(item, tuple) for item in items)", "def is_tuple_of(seq, expected_type):\n return is_seq_of(seq, expected_type, seq_type=tuple)", "def is_generator_or_sequence(x):\n builtin_iterators = (str, list, tuple, dict, set, frozenset)\n if isinstance(x, (...
[ "0.7804483", "0.7515303", "0.7421977", "0.7280833", "0.7250874", "0.7184394", "0.7142841", "0.7050563", "0.704016", "0.6963568", "0.69200027", "0.6896757", "0.68329227", "0.68293595", "0.68220294", "0.67720157", "0.6763112", "0.67452466", "0.6724103", "0.6565156", "0.6518151"...
0.7623573
1
The path the PKI secret backend is mounted at, with no leading or trailing `/`s.
def backend(self) -> pulumi.Input[str]: return pulumi.get(self, "backend")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key_path(self):\n keypath = self._get_field('System', 'keypath')\n localpath = \"/\".join(__file__.split('/')[:-1])\n return join(localpath, keypath)", "def mount_path(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"mount_path\")", "def _get_mount_path(self, connection_i...
[ "0.69400895", "0.67528343", "0.6601275", "0.6568888", "0.6568888", "0.64987063", "0.640874", "0.63564384", "0.6339407", "0.6339407", "0.63300693", "0.63208747", "0.6236033", "0.6230053", "0.6207578", "0.6205769", "0.61841357", "0.6135614", "0.61206084", "0.6094694", "0.609047...
0.0
-1
Flag to allow wildcard certificates.
def allow_wildcard_certificates(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "allow_wildcard_certificates")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allow_wildcard_certificates(self) -> pulumi.Output[Optional[bool]]:\n return pulumi.get(self, \"allow_wildcard_certificates\")", "def allow_glob_domains(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"allow_glob_domains\")", "def allow_glob_domains(self) -> Optional[pulumi....
[ "0.8314172", "0.59357345", "0.59357345", "0.5834005", "0.5522522", "0.5439092", "0.5439092", "0.5315702", "0.5234011", "0.5060899", "0.50091714", "0.49912784", "0.4956629", "0.495546", "0.49339125", "0.49270755", "0.4916405", "0.49120408", "0.4887357", "0.48812097", "0.487273...
0.8427902
0