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
Given a string object, regardless of type, returns a representation of that string in the native string type, encoding and decoding where necessary. This assumes ASCII unless told otherwise.
def _to_native_string(string, encoding='ascii'): if isinstance(string, str): out = string else: out = string.decode(encoding) return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_native_str(s):\n if not isinstance(s, str):\n return s.decode('ascii', 'strict')\n return s", "def pystr(s):\n if six.PY2 and isinstance(s, six.text_type):\n return s.encode('ascii', 'ignore')\n elif six.PY3 and isinstance(s, six.binary_type):\n return s.decode('utf-8')\n ...
[ "0.76825947", "0.74697006", "0.74070233", "0.73792666", "0.73578906", "0.73205477", "0.71665096", "0.7136369", "0.6976668", "0.69382024", "0.69344807", "0.6859275", "0.6773821", "0.67531794", "0.6750167", "0.6700445", "0.66834134", "0.667559", "0.66700625", "0.66051435", "0.6...
0.78919077
0
When using the list() command (GET singular or batch), this is called to add any additional logic to the queryset or verify the user has access to the items being pulled.
def list_class_search(self, request, current_queryset): return current_queryset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self):\n queryset = super().get_queryset()\n return queryset.available_for_user(self.request.user)", "def get_queryset(self, *args, **kwargs):\n qs = super().get_queryset(*args, **kwargs)\n user = self.request.user\n if not user.is_authenticated:\n r...
[ "0.73047286", "0.7255619", "0.7098018", "0.708734", "0.7078743", "0.70605165", "0.70168155", "0.6955862", "0.6901173", "0.6875157", "0.6835958", "0.6746452", "0.6704133", "0.6704133", "0.66757494", "0.6645755", "0.6560318", "0.6521229", "0.6507598", "0.6484462", "0.6472457", ...
0.0
-1
Returns a sequence of tracks
def _get_similar_tracks(track): l = [] for track in _lastfm.get_track(track["artist"], track["title"]).get_similar(): track = track.item l.append({"artist": track.get_artist().get_name(), "title": track.get_title()}) return l
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tracks(num=1):\n pass", "def get_8tracks_songs(self):\n logging.info('getting tracks from 8tracks')\n API_KEY = '7fe2e057bb81abf2248a06ecab027b8dc09e01d3' \n self.info_var.set('\\n\\n Now playing 8Tracks Songs: \\n')\n\n api = Api(api_key=API_KEY)\n mixes ...
[ "0.78148675", "0.694223", "0.68728083", "0.67171866", "0.65844595", "0.6505452", "0.6460934", "0.64313346", "0.6381539", "0.633947", "0.63382536", "0.6258346", "0.6213796", "0.62071747", "0.6192527", "0.61125255", "0.60862386", "0.60745597", "0.60670143", "0.60561", "0.604781...
0.5894415
27
Returns a sequence of tracks
def _get_top_tracks(artist, limit): l = [] for track in _lastfm.get_artist(artist).get_top_tracks(limit=limit): track = track.item l.append({"artist": track.get_artist().get_name(), "title": track.get_title()}) return l
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tracks(num=1):\n pass", "def get_8tracks_songs(self):\n logging.info('getting tracks from 8tracks')\n API_KEY = '7fe2e057bb81abf2248a06ecab027b8dc09e01d3' \n self.info_var.set('\\n\\n Now playing 8Tracks Songs: \\n')\n\n api = Api(api_key=API_KEY)\n mixes ...
[ "0.78169715", "0.6944414", "0.6875316", "0.67187476", "0.65869004", "0.65069485", "0.64633286", "0.643163", "0.6383554", "0.63416183", "0.6341186", "0.62597686", "0.621545", "0.6209237", "0.61935276", "0.61146224", "0.60914814", "0.6078586", "0.60693836", "0.60581064", "0.604...
0.529543
93
Test expects failure due to blacklisted flavor In rules_murano_system.txt file are defined congress rules preventing deploy environment where instances have flavor property set to 'really.bad.flavor'.
def test_deploy_policy_fail_flavor(self): self._check_deploy_failure( self._create_test_app(flavor='really.bad.flavor', key='test-key'), 'bad flavor')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testFailure():\n run(\"chariot-me\") #Start management-engine without initial deplflag\n egress()", "def test_not_a_valid_fuzzer(self):\n self.assertFalse(cifuzz.check_fuzzer_build(TEST_FILES_PATH))", "def test_build_error_no_match_with_charmcraft_yaml(\n mock_host_base, basic_project, monkeypatch,...
[ "0.60948056", "0.5961156", "0.5944623", "0.5851669", "0.5819456", "0.57601464", "0.5736138", "0.5707545", "0.5691066", "0.5633678", "0.56242937", "0.5618079", "0.5610208", "0.5607173", "0.55768085", "0.55684745", "0.5559717", "0.5548684", "0.5533213", "0.5532696", "0.55213386...
0.6831176
0
Create dictionary for query annotations.
def annotations(self): annotations = {"date": self.date_trunc("usage_start")} # { query_param: database_field_name } fields = self._mapper.provider_map.get("annotations") for q_param, db_field in fields.items(): annotations[q_param] = F(db_field) if ( "pro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queries_to_dict(queries: List) -> List:\n return [\n {\n \"unannotated_text\": query.query.text,\n \"annotated_text\": dump_query(query),\n \"domain\": query.domain,\n \"intent\": query.intent,\n }\n for query i...
[ "0.6465399", "0.61611813", "0.60600257", "0.5904343", "0.5902068", "0.590205", "0.590205", "0.5836968", "0.5800371", "0.5723801", "0.57154983", "0.56440455", "0.56043994", "0.5598025", "0.55468184", "0.55292803", "0.5524905", "0.55039936", "0.5492002", "0.5472746", "0.5471667...
0.7450913
0
Add delta to the resultset using current month comparisons.
def add_current_month_deltas(self, query_data, query_sum): delta_field_one, delta_field_two = self._delta.split("__") for row in query_data: delta_value = Decimal(row.get(delta_field_one, 0)) - Decimal(row.get(delta_field_two, 0)) # noqa: W504 row["delta_value"] = delta_value ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_add_current_month_deltas_no_previous_data_w_query_data(self):\n url = \"?filter[time_scope_value]=-1&filter[resolution]=monthly&filter[limit]=1\"\n query_params = self.mocked_query_params(url, OCPCpuView)\n handler = OCPReportQueryHandler(query_params)\n handler._delta = \"usag...
[ "0.6911801", "0.67617816", "0.6748516", "0.6522632", "0.5534764", "0.5299118", "0.5297844", "0.5280118", "0.52487004", "0.5185394", "0.51793647", "0.5177164", "0.5138675", "0.51066107", "0.510281", "0.5084717", "0.5060132", "0.5059068", "0.4990458", "0.49528804", "0.49410024"...
0.6476176
4
create bit array of value 1 and then shift it to the left i times.
def create_and_shift_ones(bit_string, i): str_length = len(bit_string) if i > (str_length - 2): # deducting 2 for the '0b' of every binary string raise Exception('Shifting more than the length of the string') one = BitArray('0b' + '0' * (str_length - 1) + bin(1)[2:]) # create a bitarray of ones o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bits_trippling_1(self):\n bits = np.array((self.image_bits))\n trippled_binary_image_bits = np.repeat(bits, 3)\n return trippled_binary_image_bits", "def xs(x, i):\n\n def parallel_shift(x, s):\n lo, hi = x % W, x // W\n lo = (lo << s) % W\n hi = (...
[ "0.6527023", "0.63221556", "0.6297559", "0.6295933", "0.62751395", "0.6275082", "0.62474877", "0.62075615", "0.6151358", "0.61129326", "0.61057794", "0.60825115", "0.6041385", "0.59783757", "0.59783757", "0.5967097", "0.59642833", "0.5960934", "0.5939053", "0.59254754", "0.58...
0.68935513
0
Return the test binary path for the current host machine.
def get_test_binary(): return "./Source/astcenc"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_exec_path(self):\n bin_name = 'test_hint_time'\n # Look for in place build\n script_dir = os.path.dirname(os.path.realpath(__file__))\n bin_path = os.path.join(script_dir, '.libs', bin_name)\n if not os.path.exists(bin_path):\n # Look for out of place build fro...
[ "0.66496825", "0.664309", "0.651933", "0.6432318", "0.6427663", "0.6417282", "0.64005595", "0.6364901", "0.6341914", "0.6320428", "0.63140327", "0.6301264", "0.6294853", "0.6257356", "0.61920226", "0.6184713", "0.617299", "0.6161132", "0.61554354", "0.61389816", "0.61164176",...
0.7133221
0
Return the reference binary path for the current host machine.
def get_reference_binary(): return "./Binary/linux-x64/astcenc"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def binpath(self):\n return self._query_config()['binpath']", "def binpath(self):\n return self.__bin", "def get_target_binary():\n file_location = prompt_base(\"where is the file located?\")\n file_location = os.path.abspath(file_location)\n return file_location", "def _blink_base(sel...
[ "0.69345254", "0.6899813", "0.6662372", "0.65941286", "0.6521972", "0.6514827", "0.6481966", "0.6477558", "0.64516836", "0.6426856", "0.6320538", "0.6292434", "0.62915134", "0.6254497", "0.62468845", "0.6244267", "0.62086916", "0.620309", "0.6201857", "0.61929256", "0.6183511...
0.76430035
0
Receives datetime instance and returns int total seconds
def total_seconds_datetime(time): if isinstance(time, datetime): return time.second + time.minute * 60 + time.hour * 3600 else: raise Exception("{} is not a datetime instance".format(today))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seconds(self):\n end = self.end or timezone.now()\n result = end - self.start\n return result.seconds", "def get_elapsed_seconds():\n\tutcnow = datetime.utcnow()\n\tmidnight_utc = datetime.combine(utcnow.date(), time(0))\n\tdelta = utcnow - midnight_utc\n\treturn delta.total_seconds()", ...
[ "0.7671854", "0.7280136", "0.7271972", "0.72426414", "0.7234691", "0.72201884", "0.7209075", "0.720482", "0.71819377", "0.71104556", "0.7097988", "0.7084554", "0.6996194", "0.6975854", "0.69742554", "0.6966981", "0.69166523", "0.69087535", "0.6890244", "0.68871206", "0.688696...
0.716144
9
Check if today is startmonth day
def is_startmonth(today): if isinstance(today, datetime): if today.day == 1: return True return False else: raise Exception("{} is not a datetime instance".format(today))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_starttrimester(today):\n if isinstance(today, datetime):\n if today.day == 1 and today.month == 1:\n return True\n elif today.day == 1 and today.month == 4:\n return True\n elif today.day == 1 and today.month == 7:\n return True\n elif today.da...
[ "0.77674085", "0.7534008", "0.7300303", "0.6990338", "0.6985148", "0.6846361", "0.6837897", "0.6822636", "0.66718066", "0.66498154", "0.6513399", "0.64925903", "0.64514804", "0.642389", "0.63659245", "0.6348478", "0.6334379", "0.62953764", "0.62823486", "0.6198536", "0.619804...
0.85193604
0
Check if today is starttrimester day
def is_starttrimester(today): if isinstance(today, datetime): if today.day == 1 and today.month == 1: return True elif today.day == 1 and today.month == 4: return True elif today.day == 1 and today.month == 7: return True elif today.day == 1 and to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def runs_today(self,s_id,day):\n if self.schedule_keys[s_id][day]==1:\n return True\n else:\n return False", "def is_dayofnewtrimester(day, today):\n if isinstance(today, datetime):\n if today.day == int(day) and today.month == 1:\n return True\n el...
[ "0.7721896", "0.7540536", "0.7523071", "0.7160882", "0.70620686", "0.70235986", "0.6840922", "0.6716203", "0.6654683", "0.6642705", "0.6590663", "0.6561168", "0.6543597", "0.6485861", "0.6485861", "0.64852846", "0.64319086", "0.64193434", "0.6374264", "0.63574517", "0.6349544...
0.82390046
0
Check if today is specific day of month
def is_dayofmonth(day, today): if isinstance(today, datetime): int_day = int(day) if today.day == int_day: return True return False else: raise Exception("{} is not a datetime instance".format(today))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_dayofnewtrimester(day, today):\n if isinstance(today, datetime):\n if today.day == int(day) and today.month == 1:\n return True\n elif today.day == int(day) and today.month == 4:\n return True\n elif today.day == int(day) and today.month == 7:\n retur...
[ "0.7484211", "0.7387048", "0.73675853", "0.7089258", "0.68247694", "0.67759037", "0.67383504", "0.66899437", "0.66522187", "0.66285676", "0.66056705", "0.6562509", "0.6521648", "0.6490237", "0.64706", "0.6446822", "0.64426076", "0.6435847", "0.63919866", "0.6370431", "0.63604...
0.819592
0
Check if the last send was in the same day, if yes return False
def is_once(today, last_send): if isinstance(today, datetime): if last_send is not None: if today.date() != last_send.date(): return True return False return True else: raise Exception("{} is not a datetime instance".format(today))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_outdated(self):\n today = datetime.datetime.today()\n day = datetime.datetime.combine(self.date, self.start_time)\n return day <= today", "def is_oncebetween(start, end, last_send, now):\n\n if last_send is not None:\n now_today = now\n start_hour = start.split(\":\")...
[ "0.6761714", "0.6653484", "0.6468747", "0.6467761", "0.63432646", "0.6286878", "0.6253676", "0.62026536", "0.61785954", "0.6162367", "0.61585045", "0.6139138", "0.612036", "0.6094996", "0.6085233", "0.60778266", "0.6066203", "0.603894", "0.6008927", "0.59947425", "0.59779423"...
0.7925761
0
Path to the run directory.
def run_dir(self, value=None): if value is not None: self._run_dir = value return self._run_dir
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def runner_path():\n git_base = os.popen('git rev-parse --show-toplevel').read().strip()\n return os.path.join(git_base, RUNNER_SCRIPT_BASENAME)", "def path_to_program_dir(self):\n\tpath = sys.argv[0]\n\n\tif not os.path.isdir(path):\n\t path = os.path.dirname(path)\n\n\tif not path: return '.'\n\n\tret...
[ "0.7461507", "0.7391438", "0.73115975", "0.73115975", "0.7282091", "0.7241663", "0.7229003", "0.71999544", "0.7186624", "0.7178305", "0.7115261", "0.71051484", "0.7066216", "0.7032835", "0.7020495", "0.6990319", "0.69800454", "0.6973799", "0.6943994", "0.691811", "0.6914628",...
0.7162815
10
Split DataFrame or matrices into random train and test subsets
def train_test_split(df, stratify=None, test_size=0.2, shuffle=False, random_state=None): t = df.sample(frac=1, random_state=random_state).index if shuffle else df.index if stratify is None: t = [t[0:round(len(t)*(1-test_size))].tolist(), t[round(len(t)*(1-test_size)):].tolist()] else: t = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_data(df: pd.DataFrame):\n size = int(df.shape[0] * 0.8)\n indexes = np.random.choice(df.index, size, replace=False)\n train_set = df.loc[indexes]\n test_set = df.loc[~df.index.isin(indexes)]\n return train_set, test_set", "def split_dataset(df, test_size, seed):\r\n ncols = np.size(df...
[ "0.83450115", "0.7835442", "0.77892274", "0.7671971", "0.7632677", "0.75787514", "0.7569498", "0.7555203", "0.7534092", "0.75305897", "0.7396956", "0.7286583", "0.7267887", "0.7259169", "0.72253996", "0.7211722", "0.7205512", "0.7177795", "0.7177336", "0.7170283", "0.712934",...
0.68466926
53
Extends an existing dynaform. If any of dynainclude, dynaexclude or dynaproperties are not present, they are retrieved from dynaform (if present in it's Meta class). While it is rather useless to extend from a dynaform that does not have a Meta class, it is allowed, the resulting DynaForm is the same as if newDynaForm ...
def extendDynaForm(dynaform, dynainclude=None, dynaexclude=None, dynaproperties=None, append=False): # Retrieve the Meta class from the existing dynaform meta = getattr(dynaform, 'Meta') dynamodel = getattr(meta, 'model', None) originclude = getattr(meta, 'include', []) origexclude = ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def newDynaForm(dynamodel=None, dynabase=None, dynainclude=None, \n dynaexclude=None, dynaproperties=None):\n\n class DynaForm(dynabase):\n \"\"\"The dynamically created Form class\n \"\"\"\n\n __metaclass__ = DynaFormMetaclass\n\n class Meta:\n \"\"\"Inner Meta class that defines ...
[ "0.6011206", "0.5576735", "0.48622766", "0.48534808", "0.46219403", "0.46149936", "0.45616913", "0.4548721", "0.45049348", "0.4479585", "0.4394802", "0.4387221", "0.4369661", "0.43617228", "0.43460262", "0.4330904", "0.4291084", "0.4277482", "0.42550665", "0.42485812", "0.423...
0.8671747
0
the 404 error case is tested
def test_mineral_detail_view_404(self): resp = self.client.get(reverse( 'minerals:detail', kwargs={'name': 'nothing'})) self.assertEqual(resp.status_code, 404)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_errors(self):\n rc = self.app.get('/this_should_not_exist', follow_redirects=True)\n assert b'404 error :(' in rc.data", "def test_not_found(self):\n self._error_test(fitbit_exceptions.HTTPNotFound)", "def not_found():\n return HttpError(404)", "def test_get_404(self):\n ...
[ "0.8255935", "0.8093764", "0.8065739", "0.8023106", "0.7973832", "0.7945598", "0.790912", "0.77482927", "0.77035487", "0.7651636", "0.7622957", "0.7609208", "0.7586827", "0.7565953", "0.75508404", "0.7545785", "0.7510848", "0.75077456", "0.75041103", "0.7503768", "0.74961543"...
0.0
-1
Add a list of additional tokens to the encoder. The additional tokens are indexed starting from the last index of the current vocabulary in the order of the `special_tokens` list.
def set_special_tokens(self, special_tokens): if not special_tokens: self.special_tokens = {} self.special_tokens_decoder = {} return self.special_tokens = dict((tok, len(self.encoder) + i) for i, tok in enumerate(special_tokens)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_special_tokens_(model, tokenizer):\n orig_num_tokens = len(tokenizer.encoder)\n num_added_tokens = tokenizer.add_special_tokens(ATTR_TO_SPECIAL_TOKEN) # doesn't add if they are already there\n if num_added_tokens > 0:\n model.resize_token_embeddings(new_num_tokens=orig_num_tokens + num_adde...
[ "0.7473028", "0.7036401", "0.6812366", "0.6457823", "0.6438591", "0.6424395", "0.6407748", "0.6330814", "0.5939789", "0.59315705", "0.5907322", "0.57830495", "0.57660943", "0.5765722", "0.57558626", "0.57191026", "0.5691086", "0.5513721", "0.5488577", "0.5485021", "0.5467534"...
0.6972036
2
Converts a sequence of tokens into ids using the vocab.
def convert_tokens_to_ids(self, tokens): ids = [] if isinstance(tokens, str): if tokens in self.special_tokens: return self.special_tokens[tokens] else: return self.encoder.get(tokens, self.unk_id) for token in tokens: if token ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sequence_to_list_ids(sequence, vocab):\n pass", "def sentence_to_token_ids(sentence, vocabulary):\n return [vocabulary.get(w, UNK_ID) for w in sentence.strip().split()]", "def convert_to_ids(self, vocab):\n for data_set in [self.train_set, self.dev_set, self.test_set]:\n if data_set...
[ "0.7760125", "0.74963677", "0.7465171", "0.74226004", "0.73314273", "0.73061234", "0.7287909", "0.72748107", "0.7257345", "0.7237548", "0.7222457", "0.7209118", "0.7168923", "0.70928735", "0.68646646", "0.6838162", "0.6824125", "0.6781408", "0.67564845", "0.6729754", "0.67187...
0.70247203
14
Test that a complete subclass of CryptographicObject can be instantiated.
def test_init(self): DummyCryptographicObject()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_constructor(self):\n pass", "def test_init(self):\n res = computer.Computer(1)\n exp = computer.Computer\n self.assertIsInstance(res, exp)", "def _check_init(self):\n # instantiate the guest class we want to test\n system_name = 'dummy_system'\n host_na...
[ "0.65006685", "0.6441401", "0.6394996", "0.6383331", "0.6383331", "0.6308297", "0.6172312", "0.6152583", "0.6124878", "0.611675", "0.6095418", "0.6082839", "0.60751", "0.6071222", "0.5994109", "0.59853834", "0.5985357", "0.59707654", "0.5942825", "0.5932657", "0.59250283", ...
0.75651866
0
Test that equality can be applied to a CryptographicObject.
def test_eq(self): dummy = DummyCryptographicObject() self.assertTrue(dummy == dummy)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_equal_on_equal(self):\n a = objects.OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n b = objects.OpaqueObject(self.bytes_a, enums.OpaqueDataType.NONE)\n self.assertTrue(a == b)\n self.assertTrue(b == a)", "def testEquality(self):\n pass", "def test_equal_on_eq...
[ "0.70277303", "0.7000732", "0.6937103", "0.69115734", "0.6715484", "0.6583001", "0.65158", "0.64747053", "0.6401378", "0.63911974", "0.63908947", "0.63757825", "0.6372717", "0.6349561", "0.63456315", "0.6318303", "0.63091224", "0.6306089", "0.63023496", "0.63023496", "0.63023...
0.81553316
0
Test that inequality can be applied to a CryptographicObject.
def test_ne(self): dummy = DummyCryptographicObject() self.assertFalse(dummy != dummy)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_equality_check_against_other_object_doesnt_raise_exception(self):\n test_object = Vec3(1, 2, 3)\n self.assertFalse(test_object == Quat(1, 2, 3, 4))\n self.assertFalse(Quat(1, 2, 3, 4) == test_object)\n self.assertTrue(test_object != Quat(1, 2, 3, 4))\n self.assertTrue(Qu...
[ "0.742624", "0.6941938", "0.69069123", "0.6877963", "0.682012", "0.6778467", "0.6776792", "0.67317206", "0.67226475", "0.6694408", "0.6687443", "0.6663873", "0.6629442", "0.6616907", "0.6570672", "0.6500002", "0.64829564", "0.64600354", "0.6404219", "0.638736", "0.6380576", ...
0.7311332
1
Sets the document_name of this ChosenDocumentType.
def document_name(self, document_name): self._document_name = document_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_document_name_for_search(self, document_name):\n self.set_value_into_input_field(self.document_name_locator, document_name)", "def set_doc_name(self, doc, name):\n if not self.doc_name_set:\n doc.name = name\n self.doc_name_set = True\n return True\n ...
[ "0.7608966", "0.7119806", "0.6907448", "0.6275231", "0.61224365", "0.60764116", "0.60740906", "0.6050477", "0.6050477", "0.6031782", "0.60283804", "0.60193926", "0.60193926", "0.6008418", "0.6008418", "0.6008418", "0.6008418", "0.6008418", "0.6008284", "0.6008284", "0.6003224...
0.78492844
2
Sets the id of this ChosenDocumentType.
def id(self, id): self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, id_):\n\n self.id_ = id_", "def set_id(self, id):\n self.__id = id", "def SetId(self, id):\n self.id = int(id)", "def id(self, id):\n \n self._id = id", "def id(self, id):\n \n self._id = id", "def id(self, id):\n \n self._id...
[ "0.7058556", "0.6967648", "0.68639857", "0.6828551", "0.6828551", "0.6828551", "0.6828551", "0.6828551", "0.682071", "0.67935646" ]
0.0
-1
Sets the rfid_presence of this ChosenDocumentType.
def rfid_presence(self, rfid_presence): self._rfid_presence = rfid_presence
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def presence(self, presence):\n\n self._presence = presence", "def update_presence(self):\n\t\tif self.config.presence_model == 'permanent':\n\t\t\tself.thin.presence = 'true'", "def set_presence(self,presence):\n if self.presence == presence:\n return True\n self.get(\"SetPrese...
[ "0.5314175", "0.5028032", "0.49593645", "0.4727353", "0.47209975", "0.4646469", "0.45388153", "0.45100293", "0.42970642", "0.42603353", "0.4236324", "0.42108715", "0.4207196", "0.4190377", "0.41543576", "0.41386065", "0.41164532", "0.41000557", "0.41000557", "0.40790913", "0....
0.75943595
0
Sets the fdsid_list of this ChosenDocumentType.
def fdsid_list(self, fdsid_list): self._fdsid_list = fdsid_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setDetectLists(self, value):\n return self._set(detectLists=value)", "def setListDoc(self, list):\n if list is None: list__o = None\n else: list__o = list._o\n libxml2mod.xmlSetListDoc(list__o, self._o)", "def selected_field_list(self, selected_field_list):\n\n self._sele...
[ "0.56980526", "0.5551058", "0.54733735", "0.53912944", "0.5286996", "0.52688754", "0.5115367", "0.5089448", "0.50852895", "0.5081734", "0.49569732", "0.49525592", "0.49525592", "0.49468395", "0.4934902", "0.4926602", "0.4910837", "0.48342586", "0.47735143", "0.47699958", "0.4...
0.79506814
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, ChosenDocumentType): 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, ChosenDocumentType): 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
Converts 1d array to column vector
def column_convertor(x): x.shape = (1, x.shape[0]) return x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_col_vector(array):\n return array.reshape(-1, 1)", "def _colvec(x):\n x = np.atleast_1d(x)\n return x[:, None]", "def to_col_vec(x):\n assert x.ndim == 1\n return jnp.expand_dims(x, 1)", "def as_column_vector(array):\n if array.ndim != 1:\n raise ValueError(\"Array must be 1...
[ "0.84671545", "0.80300206", "0.802524", "0.78122807", "0.709527", "0.6899797", "0.68092006", "0.6793547", "0.6788081", "0.6731769", "0.6491291", "0.64874524", "0.6401601", "0.6398951", "0.6381212", "0.63568366", "0.63144624", "0.6229336", "0.61914265", "0.61914265", "0.619142...
0.66716987
10
Generate a random string of fixed length
def randomString(stringLength=10): letters = string.ascii_lowercase return ''.join(random.choice(letters) for i in range(stringLength))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_random_string(length: int):\n\tall_chars = string.ascii_letters + string.digits\n\treturn ''.join(random.choices(all_chars, k=length))", "def generate_random_string(length=6):\n n = int(length / 2 + 1)\n x = binascii.hexlify(os.urandom(n))\n s = x[:length]\n return s.decode(\"utf-8\")",...
[ "0.8680464", "0.8573714", "0.85486245", "0.85297275", "0.85209286", "0.84331024", "0.8432044", "0.84157014", "0.84120053", "0.8389201", "0.8345882", "0.8343962", "0.83406156", "0.83348686", "0.83240855", "0.82986933", "0.82911193", "0.8281826", "0.82818025", "0.82811046", "0....
0.7761017
100
Converts vector of counts at each index to vector of indices.
def expand_counts(counts): result = [] for i, c in enumerate(counts): result.append(zeros(c, int) + i) return concatenate(result)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scatter_counts_to_indices(input: torch.LongTensor) -> torch.LongTensor:\n return torch.repeat_interleave(torch.arange(input.size(0), device=input.device), input).long()", "def compute_index_counts(indexing): \n counts = np.zeros(indexing.shape)\n for index in indexing:\n counts[index] += 1...
[ "0.70062447", "0.6942687", "0.6853809", "0.6773348", "0.66999876", "0.6447943", "0.63133955", "0.62436694", "0.61927336", "0.60750073", "0.60216826", "0.5999534", "0.59808105", "0.5980244", "0.59706396", "0.5962303", "0.596185", "0.5930667", "0.59017885", "0.5896326", "0.5878...
0.5845072
22
Converts vector of indices to counts of each index.
def counts(indices, result=None): if result is None: max_val = indices.max() result = zeros(max_val+1) for i in indices: result[i] += 1 return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_index_counts(indexing): \n counts = np.zeros(indexing.shape)\n for index in indexing:\n counts[index] += 1\n return counts", "def discrete_to_counts(states, bins=16):\n counts = np.zeros((bins, bins))\n indices, freqs = np.unique(states, return_counts=True, axis=0)\n indic...
[ "0.7217822", "0.6457897", "0.62358946", "0.6053968", "0.6019362", "0.59868187", "0.59312683", "0.5871194", "0.58578587", "0.5823663", "0.58084357", "0.5793666", "0.57912624", "0.5722364", "0.5703025", "0.5688481", "0.5682981", "0.5623394", "0.5623394", "0.5621437", "0.5618436...
0.70142394
1
Fraction of the sample that belongs to the most abundant species. Berger & Parker 1970, by way of SDRIV online help.
def berger_parker_d(counts): return counts.max()/float(counts.sum())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_diversity(population):\n\t# average variance of each component\n\treturn np.average(np.var(population, axis = 0))\n\treturn np.average(np.std(population, axis = 0))\n\treturn np.average(np.std(population, axis = 0) / ((self.benchmarks.bound[1] - self.benchmarks.bound[0]) / 2))", "def getMaxAbundanceOfSam...
[ "0.60289633", "0.5989476", "0.5975571", "0.5967715", "0.59288865", "0.5899165", "0.587771", "0.5860618", "0.58529943", "0.5844538", "0.5821821", "0.58162725", "0.5781736", "0.57713294", "0.5771269", "0.57666487", "0.57447904", "0.57414854", "0.5739806", "0.571243", "0.5705989...
0.64891404
0
Returns a JSON representing an error response.
def _Error(message): return json.dumps({ 'success': False, 'error': message, })
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def json_error(message):\n return json_response(isError=True, message=message)", "def response_error(error, status=400):\n\n response = {\n 'status': 'failed',\n 'error': error\n }\n\n return response_json(response, status=400)", "def json_err(msg: str) -> Response:\n return jsonif...
[ "0.81485987", "0.80329454", "0.7923255", "0.7875635", "0.77363646", "0.77231735", "0.7710547", "0.7688032", "0.7618342", "0.7608276", "0.7570327", "0.75567764", "0.7543568", "0.7543568", "0.75201184", "0.7507895", "0.7481006", "0.74513465", "0.7448628", "0.7448276", "0.743086...
0.75457
12
Returns the path to run_isolated.py.
def _run_isolated_path(self): return self.m.swarming_client.path.join('run_isolated.py')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execution_path(self, filename):\n return os.path.join(os.path.dirname(inspect.getfile(sys._getframe(0))), filename)", "def get_path() -> str:\n return os.path.dirname(os.path.realpath(__file__))", "def get_exec_path():\n if hasattr(sys, \"frozen\"): # compiled by py2exe\n return os.pat...
[ "0.6935143", "0.6634698", "0.6447546", "0.637952", "0.63567185", "0.6326805", "0.6305902", "0.62329495", "0.6213217", "0.62101316", "0.6174481", "0.6167914", "0.6167573", "0.61457425", "0.60513157", "0.60503757", "0.60503757", "0.60492474", "0.6014892", "0.5995597", "0.597467...
0.90655893
0
return the utc string date in iso format without ms and TZ info
def get_last_update_string(self): if self.last_update: return self.last_update.replace( microsecond=0, tzinfo=None ).isoformat(' ') else: return "Never updated"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def date_to_utc_string(filedate):\n return filedate.isoformat()", "def iso_date(self, t=None):\n if t is None:\n t = time.time()\n time_str = time.strftime(\"%Y-%m-%d %H:%M:%S\", time.localtime(t))\n\n return time_str", "def GetCompactDateString():\r\n utc_time = pytz.UTC.lo...
[ "0.77768815", "0.734065", "0.7176053", "0.71295995", "0.7072434", "0.7065012", "0.697127", "0.6892826", "0.68764484", "0.68615615", "0.68114245", "0.67730445", "0.67437345", "0.67238325", "0.669914", "0.6639058", "0.6627206", "0.66264224", "0.66180646", "0.6614407", "0.661400...
0.0
-1
return the utc string date in iso format without ms and TZ info
def get_cached_until_string(self): if self.cached_until: return self.cached_until.replace( microsecond=0, tzinfo=None ).isoformat(' ') else: return "Unknown"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def date_to_utc_string(filedate):\n return filedate.isoformat()", "def iso_date(self, t=None):\n if t is None:\n t = time.time()\n time_str = time.strftime(\"%Y-%m-%d %H:%M:%S\", time.localtime(t))\n\n return time_str", "def GetCompactDateString():\r\n utc_time = pytz.UTC.lo...
[ "0.77775896", "0.73394394", "0.7175259", "0.71285397", "0.7073385", "0.70638937", "0.6970549", "0.68919635", "0.6874189", "0.68614024", "0.6812121", "0.6773667", "0.6742701", "0.67238003", "0.6698596", "0.6638403", "0.66287684", "0.6626727", "0.6616427", "0.66128683", "0.6611...
0.0
-1
Read json file relative to script path.
def _read_json(self, filename): path = os.path.join(self.script_path, filename) try: with open(path) as file: return json.load(file) except Exception as exception: print('Error parsing {}: {}'.format(path, str(exception))) raise
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_file(path):\n with open(path) as json_file:\n data = json.load(json_file)\n return data", "def read_json(path):\n with open(path, 'r') as f:\n return json.load(f)", "def read(self, filepath, dirpath=None):\n try:\n #filepath = os.path.normpath(filepath)\n ...
[ "0.7193864", "0.71574455", "0.7150226", "0.7128024", "0.7105681", "0.7038684", "0.7029771", "0.6983457", "0.69627136", "0.69555044", "0.6941781", "0.69336987", "0.6904255", "0.6896164", "0.687199", "0.6868762", "0.68459815", "0.6845667", "0.683009", "0.6828687", "0.68019944",...
0.75991535
0
Parse GL enum groups from XML.
def _parse_groups(self): for root in self.roots: for group in root.iter('group'): group_name = group.attrib.get('name', '') for enum in group.iter('enum'): enum_name = enum.attrib.get('name', '') self.group_to_enum_list[group_na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_enums(self):\n for root in self.roots:\n for enums in root.iter('enums'):\n enums_group = enums.attrib.get('group', '')\n group_type = enums.attrib.get('type', '')\n\n for enum in enums.iter('enum'):\n value_str = enum.at...
[ "0.7044662", "0.5964326", "0.57122314", "0.5444964", "0.5001799", "0.49394402", "0.4927513", "0.4870068", "0.48300183", "0.48243234", "0.47604328", "0.47599226", "0.47426096", "0.47366259", "0.471619", "0.46546304", "0.46531627", "0.4631822", "0.46300843", "0.45849836", "0.45...
0.7929369
0
Add extra enums from EXTRA_ENUM_GROUPS.
def _add_extra_enums(self): for group_name, group in EXTRA_ENUM_GROUPS.items(): self.used_enum_groups.add(group_name) for enum in group: self.enum_list.append(enum) self.group_to_enum_list[group_name].append(enum)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_enums(self, new_enums):\n # hack to handle single elements\n new_enums = utils.listify(new_enums)\n\n # add enums to list one by one\n for enum in new_enums:\n # check existance\n assert enum.name not in self.enum_names, \\\n \"Enum with name...
[ "0.60970837", "0.586385", "0.5818526", "0.5816311", "0.5656249", "0.5406399", "0.5288602", "0.5239192", "0.5084099", "0.5069505", "0.5035586", "0.49236628", "0.49122676", "0.48666975", "0.48183146", "0.48031887", "0.4772997", "0.47669992", "0.4762568", "0.47582892", "0.475153...
0.8954793
0
Initializes variables for power dispatch for a given component and a given attribute.
def define_operational_variables(n, sns, c, attr): if n.df(c).empty: return active = get_activity_mask(n, c, sns) if n._multi_invest else None coords = [sns, n.df(c).index.rename(c)] n.model.add_variables(coords=coords, name=f"{c}-{attr}", mask=active)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, **kwargs):\n Interaction.__init__(self, **kwargs)\n self._stores = None # the resource stored by this interaction\n self._rate = None # the rate at which this component can store up or discharge\n self._initial_stored = None # how much resource does this component start with st...
[ "0.6074827", "0.6015167", "0.59197325", "0.57863986", "0.5695947", "0.56740654", "0.55710286", "0.55388874", "0.55057156", "0.5490808", "0.5426918", "0.5426918", "0.5419718", "0.54162085", "0.53841", "0.53569806", "0.5339485", "0.53356683", "0.53163534", "0.53155214", "0.5315...
0.0
-1
Initializes variables for transmission losses.
def define_loss_variables(n, sns, c): if n.df(c).empty or c not in n.passive_branch_components: return active = get_activity_mask(n, c, sns) if n._multi_invest else None coords = [sns, n.df(c).index.rename(c)] n.model.add_variables(0, coords=coords, name=f"{c}-loss", mask=active)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _initLoss(self):\n\n pass", "def __attrs_post_init__(self):\n self.state_changes_send_channel, self.state_changes_receive_channel = trio.open_memory_channel(\n math.inf\n )\n self._nursery = self._nursery_manager = None", "def __init__(self):\n self.__bus_dict ...
[ "0.6990381", "0.65155005", "0.6514332", "0.6489483", "0.64660823", "0.6431584", "0.6427531", "0.6426392", "0.64237666", "0.6390504", "0.6359539", "0.630417", "0.63037413", "0.62936133", "0.62639964", "0.6252833", "0.62203383", "0.618838", "0.6177667", "0.61327124", "0.6112981...
0.0
-1
Using different Callbacks (definite in Callbacks.py) the learning rate schedule is set
def GetLearnRate(DILr,Epochs): if(DILr.mode == 'poly'): ScheduelLr = PolynomialDecay(maxEpochs=DILr.StepSize,initAlpha=DILr.Lr,power=DILr.factor) ScheduelLr.plot(range(1,int(Epochs)+1)) lrate = LearningRateScheduler(ScheduelLr) elif(DILr.mode == 'cycle'): lrate = CyclicLR(step_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def learning_rate_callback(batch_size, replicas):\n\n lr_start = 0.00005\n lr_max = 0.0000125 * replicas * batch_size\n lr_min = 0.00001\n lr_ramp_ep = 5\n lr_sus_ep = 5\n lr_decay = 0.8\n\n def lrfn(epoch):\n # warmup - linear increase\n if epoch < lr_ramp_ep:\n lr = ...
[ "0.71758395", "0.70044523", "0.69092435", "0.6824272", "0.6791794", "0.6772398", "0.6727645", "0.6712389", "0.6682246", "0.6662408", "0.6649355", "0.6633659", "0.65613574", "0.65611106", "0.65438145", "0.6481285", "0.647498", "0.6471419", "0.6469883", "0.64695793", "0.6454348...
0.0
-1
our model has two convolution layers. Each convolution layer has a maxpooling layer. The second convolution layer has dropout applied to it. This method adds these two layers.
def add_convolution_layers(self): with tf.variable_scope("conv_layer_1"): # our input to this layer is from word embeddings. which would be of # shape (batch_size, number of words in the sentence, dimension of # embedding). For us dimension of embedding is the number of input # channels, sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addConv2dLayer(mainGraph,\n inputOperation=None,\n nFilters=1,\n filterHeigth=2,\n filterWidth=2,\n padding=\"SAME\",\n convStride=1,\n activation=ReLUActivation,\n ba...
[ "0.75036395", "0.716524", "0.70740813", "0.700538", "0.69718426", "0.6829985", "0.6760686", "0.67580193", "0.66849434", "0.666091", "0.6629891", "0.6619081", "0.6610454", "0.6590837", "0.6577832", "0.65343153", "0.652373", "0.6512504", "0.6510821", "0.6478652", "0.6471495", ...
0.75744385
0
Convert string to float, but also handles None and 'null'.
def to_float(val): if val is None: return None if str(val) == "null": return None return float(val)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_float(s):\n try:\n return float(s)\n except TypeError:\n return None", "def _string_to_float(s):\n try:\n f = float(s)\n return f\n except ValueError:\n return None", "def safe_float(str):\n if not str:\n return None\n try:\...
[ "0.85086167", "0.82970667", "0.8255398", "0.8055475", "0.8009049", "0.79424113", "0.7822859", "0.77312434", "0.7701687", "0.76599395", "0.7586672", "0.75611866", "0.7515104", "0.7503652", "0.7430676", "0.7361605", "0.73383075", "0.73019737", "0.7297088", "0.72904354", "0.7270...
0.7970725
5
Returns nodes as list
def get_nodes(self, exclude_limited=False, dev=False, testnet=False, testnetdev=False, wss=True, https=True, not_working=False, normal=True, appbase=True): node_list = [] node_type_list = [] if normal: node_type_list.append("normal") if appbase: node_type_list.app...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_node_list(self):\n return []", "def get_node_list(self):\n return [[node] for node in self.graph.nodes]", "def as_list(self):\n nodes = []\n node = self.first_node\n while node:\n nodes.append(node)\n node = node.next\n return nodes", "d...
[ "0.8621583", "0.8409404", "0.83789057", "0.82941365", "0.82659495", "0.8037672", "0.80138576", "0.8001828", "0.8001828", "0.7922903", "0.78064555", "0.77212715", "0.7720067", "0.7720067", "0.771063", "0.7703488", "0.76930636", "0.7689961", "0.767528", "0.76691437", "0.7654724...
0.0
-1
setUp and tearDown are run for teach test
def setUp(self): self.input_csv = os.path.join(os.path.dirname(__file__), '___valid_input.csv') with open(self.input_csv, 'wb') as opf1: opf1.write( """ GSE59813,GSM1446812; GSE61491,GSM1506106; GSM1506107; """) parser = rp_prep.get_parser() self.temp_outdir = tempfile.mkdtem...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\r\n # nothing to do, all tests use different things\r\n pass", "def setUp(self) :\n pass", "def setUp(self):\r\n pass", "def setUp(self):\n pass", "def setUp(self):\n pass", "def setUp(self):\n pass", "def setUp(self):\n pass", ...
[ "0.8489375", "0.84717464", "0.84206253", "0.8416925", "0.8416925", "0.8416925", "0.8416925", "0.8416925", "0.8416925", "0.8416925", "0.8416925", "0.8416925", "0.8416925", "0.8416925", "0.8416925", "0.8416925", "0.8416925", "0.8416925", "0.8416925", "0.8416925", "0.8416925", ...
0.0
-1
The year with the highest gross per movie
def highest_per_movie(): copy = movies.copy() copy['Gross Per Movie'] = copy['Total Gross'] / copy['Number of Movies'] #calculate gross per movie year = copy.sort_values(['Gross Per Movie'], ascending = False).reset_index(drop = True).Year.loc[0] return ('highest_per_movie', year)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yr_fewest_movies():\n copy = movies.copy()\n year = copy.sort_values(['Number of Movies', 'Year']).reset_index(drop = True).Year.loc[0]\n return ('yr_fewest_movies', year)", "def highest_ratings_year(data: pd.DataFrame):\n # Convert time integer into datatime type and then to year onl...
[ "0.73288196", "0.6960721", "0.6787786", "0.65035117", "0.6462938", "0.64448607", "0.6261294", "0.62173045", "0.6203082", "0.6161109", "0.6153471", "0.61173403", "0.60902816", "0.59842336", "0.59685653", "0.59647983", "0.5944049", "0.58445615", "0.5809048", "0.5784561", "0.575...
0.8599459
0
shoot the opponents fleet. It must be called alternatively for each of the player until anyone of Players fleet is completely destroyed.
def play_a_shot(self, req): game = models.BattleShip.getByUrlKey(req.url_key) return game.shoot(str(req.player), (str(req.y) + str(req.x - 1)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attack(self, opponents):\n \n living_heroes = list()\n dead_heroes = list()\n living_opponents = list()\n dead_opponents = list()\n \n for hero in self.heroes:\n if hero.is_alive():\n living_heroes.append(hero)\n else:\n ...
[ "0.6563822", "0.6430784", "0.63496816", "0.6174137", "0.61626023", "0.591999", "0.58899945", "0.58292824", "0.5810707", "0.58024395", "0.57633525", "0.57399064", "0.5736279", "0.57277113", "0.57236326", "0.569527", "0.5688177", "0.5667987", "0.5648462", "0.5639927", "0.561889...
0.5480669
47
Unload a config entry.
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS) if unload_ok: hass.data[DOMAIN].pop(entry.entry_id) if not hass.data[DOMAIN]: hass.data.pop(DOMAIN) return unload_ok
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_unload_entry(hass, config_entry):\n unload_ok = await hass.config_entries.async_forward_entry_unload(\n config_entry, \"climate\"\n )\n return unload_ok", "async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:\n hass.data.pop(DOMAIN)\n return True", ...
[ "0.69729054", "0.688811", "0.6779906", "0.67475253", "0.6689114", "0.6657885", "0.66162664", "0.6603484", "0.65926456", "0.65596145", "0.6541213", "0.65076923", "0.65076923", "0.65076923", "0.65076923", "0.6497813", "0.6493226", "0.6486651", "0.6486651", "0.6486651", "0.64866...
0.6459737
30
add a new transition to the buffer
def add(self, obs_t, action, reward, obs_tp1, done): data = (obs_t, action, reward, obs_tp1, done) if self._next_idx >= len(self._storage): self._storage.append(data) old_data = None else: old_data = self._storage[self._next_idx] self._storage[sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def storeTransition(self, transition):\n self.buffer.append(transition)", "def add(self, state, action, reward, next_state, done):\n e = self.transition(state, action, reward, next_state, done)\n self.buffer.append(e)", "def add(self, transition: Tuple[np.ndarray, ...]) -> Tuple[Any, ...]:...
[ "0.77596265", "0.7419274", "0.7304988", "0.7234456", "0.70836526", "0.70348704", "0.6973781", "0.68939126", "0.6768309", "0.6743578", "0.67420524", "0.6680733", "0.6604713", "0.65684104", "0.65420747", "0.6486401", "0.64780766", "0.6453972", "0.6449315", "0.6435826", "0.64216...
0.0
-1
add a new transition to the buffer
def add(self, obs_t, action, reward, obs_tp1, done): data = (obs_t, action, reward, obs_tp1, done) priority = random.uniform(0, 1) if len(self._storage) < self._maxsize: heapq.heappush(self._storage, (priority, data)) elif priority > self._storage[0][0]: heapq.hea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def storeTransition(self, transition):\n self.buffer.append(transition)", "def add(self, state, action, reward, next_state, done):\n e = self.transition(state, action, reward, next_state, done)\n self.buffer.append(e)", "def add(self, transition: Tuple[np.ndarray, ...]) -> Tuple[Any, ...]:...
[ "0.77596265", "0.7419274", "0.7304988", "0.7234456", "0.70836526", "0.70348704", "0.6973781", "0.68939126", "0.6768309", "0.6743578", "0.67420524", "0.6680733", "0.6604713", "0.65684104", "0.65420747", "0.6486401", "0.64780766", "0.6453972", "0.6449315", "0.6435826", "0.64216...
0.0
-1
add a new transition to the both the fifo buffer and the reservoir buffer
def add(self, obs_t, action, reward, obs_tp1, done): if random.uniform(0,1) < self.fifo_frac: self.fifo_buffer.add(obs_t, action, reward, obs_tp1, done) else: self.reservoir_buffer.add(obs_t, action, reward, obs_tp1, done)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push(self,transition):\n \n input_to_buffer = transpose_list(transition)\n \n for item in input_to_buffer:\n self.deque.append(item)", "def push(self, state, action, reward, next_state):\n\n to_add = [state, action, reward, next_state]\n if len(self.buffer) < ...
[ "0.67815495", "0.63464403", "0.6254327", "0.6234603", "0.6219062", "0.6214096", "0.6165611", "0.6128896", "0.6062362", "0.6031492", "0.5985832", "0.5909655", "0.5871509", "0.58675724", "0.5848985", "0.5817101", "0.57786167", "0.5777641", "0.57725704", "0.5690952", "0.5657907"...
0.7009381
0
add a new transition to the buffer
def add(self, obs_t, action, reward, obs_tp1, done): self.count += 1 data = (obs_t, action, reward, obs_tp1, done) popped_data = self.buffers[0].add(*data) for i in range(1, self.num_buffers): #print("buffer ", i) #print("popped: ", popped_data) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def storeTransition(self, transition):\n self.buffer.append(transition)", "def add(self, state, action, reward, next_state, done):\n e = self.transition(state, action, reward, next_state, done)\n self.buffer.append(e)", "def add(self, transition: Tuple[np.ndarray, ...]) -> Tuple[Any, ...]:...
[ "0.77588046", "0.7417499", "0.7302822", "0.7235182", "0.70817834", "0.7034866", "0.6974339", "0.68909377", "0.6765151", "0.6743873", "0.67414343", "0.66774404", "0.6604543", "0.6566156", "0.65441024", "0.64920175", "0.64779884", "0.6450471", "0.64482915", "0.64394164", "0.642...
0.0
-1
Create an empty trie.
def empty_trie(): trie = Trie() return trie
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def empty_trie():\n from trie import Trie\n trie = Trie()\n return trie", "def test_create_empty_trie(empty_trie):\n assert empty_trie.root.children == {}\n assert empty_trie._size == 0", "def full_trie():\n trie = Trie()\n trie.insert(\"hey\")\n return trie", "def __init__(self):\n ...
[ "0.8230706", "0.77392805", "0.7571804", "0.7424975", "0.73735195", "0.73735195", "0.73731816", "0.7307245", "0.72377187", "0.72262377", "0.71787477", "0.71580553", "0.7147745", "0.7142353", "0.71349156", "0.7131655", "0.7104453", "0.70892656", "0.70892656", "0.7070404", "0.70...
0.8391781
0
Create a full trie.
def full_trie(): trie = Trie() trie.insert("hey") return trie
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def empty_trie():\n trie = Trie()\n return trie", "def tricky_trie():\n from trie import Trie\n trie = Trie()\n trie.insert('bbbbbbb')\n trie.insert('bbb')\n trie.insert('lololololol')\n trie.insert('blololololol')\n return trie", "def empty_trie():\n from trie import Trie\n tr...
[ "0.7345377", "0.7323961", "0.72654074", "0.7221503", "0.6984365", "0.69774294", "0.69678795", "0.69590634", "0.6928978", "0.69205683", "0.69065535", "0.6885359", "0.6880337", "0.68720824", "0.68720824", "0.6832441", "0.6823224", "0.678609", "0.678609", "0.6743208", "0.6743208...
0.8118928
0
Test that you can create an empty trie.
def test_create_empty_trie(empty_trie): assert empty_trie.root.children == {} assert empty_trie._size == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def empty_trie():\n trie = Trie()\n return trie", "def empty_trie():\n from trie import Trie\n trie = Trie()\n return trie", "def test_create_trienode():\n node = TrieNode(\"h\")\n assert node.value == \"h\"\n assert node.children == {}", "def test_trie_node_init_no_values_one():\n ...
[ "0.8196012", "0.81215835", "0.7809496", "0.7806996", "0.7718164", "0.7661335", "0.76395416", "0.75668114", "0.7549761", "0.7478465", "0.74649847", "0.74351084", "0.7414301", "0.7110109", "0.70072746", "0.696736", "0.69252527", "0.6917356", "0.69077295", "0.690067", "0.6895206...
0.8903007
0
Test that when you insert multiple words, the trie still works.
def test_insert_many_words_still_works(multi_trie): assert multi_trie.root.value is None assert "o" in multi_trie.root.children["h"].children.keys() assert "e" in multi_trie.root.children["h"].children.keys() assert "y" and "a" and "l" in multi_trie.root.children["h"].children["e"].children.keys()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_insert_a_word_twice_does_not_change_size(empty_trie):\n empty_trie.insert(\"hey\")\n assert empty_trie.size() == 1\n empty_trie.insert(\"hey\")\n assert empty_trie.size() == 1", "def test_remove_word_that_branches_from_root_by_itself(empty_trie):\n empty_trie.insert(\"tool\")\n empty_t...
[ "0.78128386", "0.7326783", "0.7305232", "0.7227274", "0.72166604", "0.716746", "0.7124758", "0.70827895", "0.70675117", "0.7049298", "0.7036254", "0.70179945", "0.70084196", "0.69779724", "0.6969451", "0.69656616", "0.6959996", "0.6925087", "0.6915204", "0.69134575", "0.69095...
0.8502558
0
Test that insertion increases size with each node inserted.
def test_insert_string_increases_size(empty_trie): empty_trie.insert("hey") assert empty_trie.size() == 1 empty_trie.insert("howdy") assert empty_trie.size() == 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testInsertLength(self):\n\n num = randint(60,180)\n for i in xrange(num):\n self.s.insert(i, None)\n self.assertEqual(len(self.s), num)\n\n #try to insert duplicates\n for i in xrange(num):\n self.s.insert(i, None)\n self.assertEqual(len(self.s), num)", "def test_insert_will_not_d...
[ "0.74245894", "0.71504813", "0.7029587", "0.70265055", "0.6992194", "0.6916814", "0.689764", "0.6787405", "0.6659674", "0.66059434", "0.6590055", "0.65652645", "0.6536741", "0.65361303", "0.6497826", "0.6451675", "0.6374883", "0.6321842", "0.6312503", "0.6301499", "0.6282635"...
0.7106342
2
Test that you can remove a word and that word won't be in the trie.
def test_remove_longer_word_removes_word(multi_trie): multi_trie.remove("hello") assert multi_trie.contains("hello") is False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_remove_word_that_branches_from_root_by_itself(empty_trie):\n empty_trie.insert(\"tool\")\n empty_trie.remove(\"tool\")\n assert empty_trie.contains(\"tool\") is False", "def test_remove_word_with_one_bifurcation(multi_trie):\n multi_trie.remove(\"howdy\")\n assert multi_trie.contains(\"ho...
[ "0.8512736", "0.8271751", "0.8259157", "0.8206236", "0.78804654", "0.76772517", "0.74268067", "0.72782165", "0.71668535", "0.7012277", "0.68166244", "0.6758799", "0.6728426", "0.6699965", "0.6677232", "0.6676111", "0.6620871", "0.6579341", "0.65625083", "0.65607697", "0.64602...
0.82719713
1
Test that removing word with one bifurcation retains all other words.
def test_remove_one_bifurcation_word_retains_all_other_words(multi_trie): multi_trie.remove("howdy") assert multi_trie.contains("hey") is True assert multi_trie.contains("hell") is True assert multi_trie.contains("head") is True assert multi_trie.contains("hello") is True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_remove_word_with_one_bifurcation(multi_trie):\n multi_trie.remove(\"howdy\")\n assert multi_trie.contains(\"howdy\") is False", "def test_remove_longer_word_removes_word(multi_trie):\n multi_trie.remove(\"hello\")\n assert multi_trie.contains(\"hello\") is False", "def test_remove_shorter_...
[ "0.78765565", "0.72120506", "0.71086216", "0.685957", "0.66471756", "0.6390764", "0.6375158", "0.6331255", "0.63140166", "0.62521094", "0.6237919", "0.6228175", "0.6215612", "0.62028766", "0.61736137", "0.6172887", "0.6151073", "0.6109139", "0.6108014", "0.60991704", "0.60633...
0.79645926
0
Test that removing word that is part of a bigger word keeps big word.
def test_remove_shorter_word_retains_longer_form_of_that_word(multi_trie): multi_trie.remove("hell") assert multi_trie.contains("hello") is True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_remove_longer_word_removes_word(multi_trie):\n multi_trie.remove(\"hello\")\n assert multi_trie.contains(\"hello\") is False", "def test_remove_longer_word_retains_all_shorter_words(multi_trie):\n multi_trie.remove(\"hello\")\n assert multi_trie.contains(\"hey\") is True\n assert multi_tr...
[ "0.7699288", "0.74591786", "0.7172749", "0.70858705", "0.6341019", "0.63058686", "0.62904996", "0.62871593", "0.6181052", "0.6054642", "0.60476005", "0.60089946", "0.59900707", "0.5944911", "0.5939216", "0.59132385", "0.5873297", "0.58701956", "0.5841264", "0.5839522", "0.580...
0.7688585
1
Test that traversal returns the whole trie when input is none or ' '.
def test_traversal_with_no_input_string_returns_trie(full_trie): assert list(full_trie.traversal()) == ['h', 'e', 'y'] assert list(full_trie.traversal('')) == ['h', 'e', 'y']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_input_and_traversal_with_no_input_string_returns_trie(full_trie):\n full_trie.insert('hi')\n assert list(full_trie.traversal()) == ['h', 'e', 'y', 'i']\n assert list(full_trie.traversal('')) == ['h', 'e', 'y', 'i']", "def test_traverse_string_on_empty_trie(empty_trie):\n assert list(empty_tr...
[ "0.7997135", "0.7956378", "0.7870996", "0.7620597", "0.75617135", "0.7302723", "0.71616876", "0.7155028", "0.7000671", "0.6965663", "0.6832685", "0.6703443", "0.6486497", "0.63177407", "0.6237987", "0.6213727", "0.61209595", "0.6057515", "0.605426", "0.60443014", "0.59543633"...
0.8201932
0
Test that traversal returns the whole trie when input is none or ' '.
def test_input_and_traversal_with_no_input_string_returns_trie(full_trie): full_trie.insert('hi') assert list(full_trie.traversal()) == ['h', 'e', 'y', 'i'] assert list(full_trie.traversal('')) == ['h', 'e', 'y', 'i']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_traversal_with_no_input_string_returns_trie(full_trie):\n assert list(full_trie.traversal()) == ['h', 'e', 'y']\n assert list(full_trie.traversal('')) == ['h', 'e', 'y']", "def test_traverse_string_on_empty_trie(empty_trie):\n assert list(empty_trie.traversal('hello')) == []", "def test_trave...
[ "0.8202242", "0.7956839", "0.78706455", "0.76216495", "0.7562557", "0.7303095", "0.71636105", "0.7154459", "0.7002342", "0.69665736", "0.6833847", "0.67055494", "0.6487328", "0.63187987", "0.62359667", "0.62122196", "0.6120545", "0.60560375", "0.60528696", "0.6042741", "0.595...
0.7995527
1
Test that traversal returns nothing when input not in trie.
def test_traversal_with_string_not_in_trie(full_trie): assert list(full_trie.traversal("goodbye")) == []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_traverse_on_empty_trie(empty_trie):\n assert list(empty_trie.traversal()) == []", "def test_traversal_with_no_input_string_returns_trie(full_trie):\n assert list(full_trie.traversal()) == ['h', 'e', 'y']\n assert list(full_trie.traversal('')) == ['h', 'e', 'y']", "def test_traverse_string_on_...
[ "0.82014567", "0.8136907", "0.8132053", "0.7901772", "0.7807976", "0.7613533", "0.70074373", "0.6970098", "0.69277984", "0.68465346", "0.67914116", "0.6720323", "0.6664457", "0.6645412", "0.64837307", "0.6469199", "0.6448756", "0.6416063", "0.63846356", "0.6330381", "0.632434...
0.83601534
0
Test that traversal returns nothing when input == trie.
def test_traversal_on_word_with_no_following_letters(full_trie): assert list(full_trie.traversal("hey")) == []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_traversal_with_string_not_in_trie(full_trie):\n assert list(full_trie.traversal(\"goodbye\")) == []", "def test_traversal_with_no_input_string_returns_trie(full_trie):\n assert list(full_trie.traversal()) == ['h', 'e', 'y']\n assert list(full_trie.traversal('')) == ['h', 'e', 'y']", "def test...
[ "0.8135248", "0.81053925", "0.80623966", "0.8009447", "0.7888802", "0.773793", "0.69882035", "0.693434", "0.68291754", "0.6728551", "0.6675065", "0.6645052", "0.6616828", "0.66139615", "0.64770585", "0.6409748", "0.63685673", "0.63551277", "0.6338793", "0.6289575", "0.6187775...
0.7471661
6
Test that traversal returns nothing when inserted input == trie.
def test_traversal_on_input_word_with_no_following_letters(full_trie): full_trie.insert("yo") assert list(full_trie.traversal("yo")) == []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_input_and_traversal_with_no_input_string_returns_trie(full_trie):\n full_trie.insert('hi')\n assert list(full_trie.traversal()) == ['h', 'e', 'y', 'i']\n assert list(full_trie.traversal('')) == ['h', 'e', 'y', 'i']", "def test_traversal_with_string_not_in_trie(full_trie):\n assert list(full_...
[ "0.8233737", "0.79376614", "0.7906238", "0.780261", "0.777091", "0.7287093", "0.7258237", "0.7051923", "0.70194066", "0.69169176", "0.68171924", "0.6779414", "0.6718962", "0.6641939", "0.66342", "0.6467831", "0.64510965", "0.6434683", "0.6410059", "0.63895553", "0.63777006", ...
0.7898561
3
Color the node given its name.
def colorNodeByName(node): # Try to find the session color manager. manager = _findSessionColorManager() # If one exists, use it to try to color the node. if manager is not None: manager.colorNodeByName(node)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def colorNode(node):\n # Try to find the session color manager.\n manager = _findSessionColorManager()\n\n # If one exists, use it to try to color the node.\n if manager is not None:\n manager.colorNode(node)", "def get_color(self, node: Node) -> str:\n\n idx = hash(node.get_kind_name()...
[ "0.7009091", "0.6522462", "0.6135791", "0.6123377", "0.6052353", "0.60097086", "0.5960722", "0.5885916", "0.58801985", "0.5791643", "0.57668203", "0.5743497", "0.5723728", "0.56933814", "0.5658884", "0.56463313", "0.5640387", "0.56351495", "0.56206757", "0.56176895", "0.56033...
0.7916316
0
Returns the total input size for this stage. This is only valid if the stage read data from a shuffle.
def input_mb(self): total_input_bytes = sum([t.remote_mb_read + t.local_mb_read for t in self.tasks if t.has_fetch]) total_input_bytes += sum([t.input_mb for t in self.tasks]) return total_input_bytes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def input_size(self):\n return self.env.input_size", "def _input_size(self):\n return self.embedding_size + self.hidden_size", "def input_load(self):\n return self.nmos_size + self.pmos_size", "def size(self) -> Optional[pulumi.Input[float]]:\n return pulumi.get(self, \"size\")", ...
[ "0.7427888", "0.7346966", "0.7344351", "0.7286139", "0.6996515", "0.6978404", "0.6962194", "0.69052255", "0.6842657", "0.6775047", "0.67652845", "0.67310387", "0.67310387", "0.67310387", "0.67274904", "0.67274904", "0.67157096", "0.671562", "0.6676925", "0.6651551", "0.665155...
0.0
-1
Returns the total output size for this stage. This is only valid if the output data was written for a shuffle.
def output_mb(self): total_output_size = sum([t.shuffle_mb_written for t in self.tasks]) return total_output_size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_size(self):\n return self._output_size", "def output_size(self):\n return self._output_size", "def output_size(self) -> int:\n return self.out_sz", "def size(self) -> pulumi.Output[float]:\n return pulumi.get(self, \"size\")", "def output_size(self) -> int:\n r...
[ "0.7927941", "0.7927941", "0.771634", "0.7508722", "0.73909295", "0.72043544", "0.71275866", "0.6960922", "0.68636453", "0.6811561", "0.6773658", "0.6736633", "0.6709694", "0.66865265", "0.66707903", "0.6636977", "0.6636902", "0.6633736", "0.66218823", "0.6611975", "0.6557108...
0.8025761
0
Excludes any questions that aren't published yet.
def get_queryset(self): return Question.objects.filter(pub_date__lte=timezone.now())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self):\n # the filter says that it only returns those w/ the pub_date\n # less or equal to timezone.now() (earlier or now)\n questions = Question.objects.filter(\n pub_date__lte=timezone.now()\n ).order_by('-pub_date')\n\n excludes = []\n for qu...
[ "0.6604021", "0.64446515", "0.6220697", "0.61680806", "0.61680806", "0.6099354", "0.6098479", "0.6081178", "0.6053914", "0.6050758", "0.59694785", "0.58919686", "0.58919686", "0.5888636", "0.5880843", "0.586779", "0.586779", "0.586779", "0.586779", "0.58673334", "0.5855172", ...
0.6209108
17
Recall metric. Only computes a batchwise average of recall. Computes the recall, a metric for multilabel classification of how many relevant items are selected.
def recall(y_true, y_pred): true_positives = K.sum(K.round(K.clip(y_true * y_pred, 0, 1))) possible_positives = K.sum(K.round(K.clip(y_true, 0, 1))) recall = true_positives / (possible_positives + K.epsilon()) return recall
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recall(y_true, y_pred, average, labels):\n\n y_true, y_pred = check_metric_args(y_true, y_pred, average, labels)\n\n result = None\n\n m = len(y_true)\n n = len(labels)\n\n confusion_matrix = get_confusion_matrix(y_true, y_pred, labels).T\n\n if average == \"micro\":\n numerator = np.t...
[ "0.7603752", "0.74474216", "0.7404044", "0.7280462", "0.7208341", "0.7164908", "0.7156751", "0.7130874", "0.71000224", "0.70961666", "0.70961666", "0.70961666", "0.70961666", "0.70961666", "0.70961666", "0.70961666", "0.70961666", "0.70961666", "0.70961666", "0.70961666", "0....
0.71443284
11
Precision metric. Only computes a batchwise average of precision. Computes the precision, a metric for multilabel classification of how many selected items are relevant.
def precision(y_true, y_pred): true_positives = K.sum(K.round(K.clip(y_true * y_pred, 0, 1))) predicted_positives = K.sum(K.round(K.clip(y_pred, 0, 1))) precision = true_positives / (predicted_positives + K.epsilon()) return precision
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision(self):\n self.overall_precision = precision_score(\n self.y_true, self.y_pred, average = self.average_type).round(self.digits_count_fp)\n self.classes_precision = precision_score(\n self.y_true, self.y_pred, average = None).round(self.digits_count_fp)", "def comp...
[ "0.74913025", "0.728889", "0.71595335", "0.7153832", "0.70662045", "0.6985961", "0.69664735", "0.69553095", "0.69133496", "0.68336445", "0.6818772", "0.6810098", "0.6786243", "0.6758142", "0.6758142", "0.6758142", "0.6758142", "0.6758142", "0.6758142", "0.6758142", "0.6758142...
0.68056715
14
Sets the learning rate to the initial LR decayed by 10 every 30 epochs
def adjust_learning_rate(optimizer, epoch): lr = args.lr * (0.1 ** (epoch // 30)) for param_group in optimizer.param_groups: param_group['lr'] = lr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_learning_rate(init_lr, optimizer, epoch, n=100):\n init_lr = init_lr * (0.1 ** (epoch // n))\n print('learning rate : ', init_lr)\n for param_group in optimizer.param_groups:\n param_group['lr'] = init_lr", "def adjust_learning_rate(start_lr, optimizer, epoch, total_epoch_num):\n #l...
[ "0.79133433", "0.7907211", "0.7850508", "0.77755034", "0.7734465", "0.773158", "0.77232176", "0.7722336", "0.7719667", "0.7709295", "0.7693627", "0.76746327", "0.7665828", "0.7665828", "0.7665828", "0.7655531", "0.76423776", "0.76399475", "0.76379395", "0.76263064", "0.762507...
0.7580111
32
Remove stopwords and short words in texts in dataframe.
def remove_words(df: pd.DataFrame, text_field: str, stopwords: Set[str], short_words_size: int = 3, output_field: Optional[str] = None) -> pd.DataFrame: out_field = output_field if output_field is not None else text_field df[out_field] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop_words_remover(df):\n stop_words = stop_words_dict['stopwords']\n\n df['Without Stop Words'] = [' '.join([w for w in x.lower().split()\n if w not in stop_words])\n for x in df['Tweets'].tolist()\n ]\n resu...
[ "0.79382974", "0.779954", "0.7680476", "0.76698786", "0.75832784", "0.7465699", "0.74531347", "0.72681636", "0.7264841", "0.723588", "0.7232364", "0.7166481", "0.71566296", "0.71369493", "0.7102331", "0.70946115", "0.7076461", "0.70419604", "0.70407236", "0.7025877", "0.70067...
0.79211307
1
Tokenize texts in dataframe.
def tokenize(df: pd.DataFrame, text_field: str, output_field: str) -> pd.DataFrame: df[output_field] = df[text_field].apply( lambda column: ' '.join(regexp_tokenize(column, pattern=r'[\s,.?!-:]+', gaps=True, discard_empty=True)) ) return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenize(self, df: DataFrame, text_col=\"text\") -> DataFrame:\n\n texts = df[text_col]\n if self.to_lower:\n texts = texts.apply(lambda text: text.lower())\n\n if self.use_remove_punctuation:\n texts = texts.apply(lambda text: self.remove_punctuation(text))\n\n ...
[ "0.8168444", "0.79196864", "0.7657709", "0.73905814", "0.7212765", "0.7106539", "0.69510406", "0.693064", "0.68750554", "0.6835091", "0.6777537", "0.6768172", "0.67266744", "0.6695436", "0.667505", "0.6672369", "0.6656933", "0.6645189", "0.6590776", "0.6545479", "0.6533771", ...
0.75830597
3
helper attribute holding the standard test's data directory
def datadir(cls): # pylint: disable=E0213 mod = sys.modules[cls.__module__] return osp.join(osp.dirname(osp.abspath(mod.__file__)), 'data')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_data_dir(self):\n return os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')", "def data_dir():\n return os.path.join(os.path.dirname(__file__), 'test', 'data')", "def data_dir():\n return os.path.join(os.path.dirname(_here), 'test', 'data')", "def __dir_test_data():\n ...
[ "0.8822668", "0.8480116", "0.8457253", "0.833946", "0.8126946", "0.8036975", "0.76918036", "0.7639481", "0.759455", "0.7580266", "0.75658065", "0.755238", "0.75303316", "0.7491178", "0.74830043", "0.7448365", "0.7444769", "0.7439788", "0.74315155", "0.74315155", "0.73500437",...
0.66180074
62
Allow a user to create a post
def add_post(request): context = RequestContext(request) if request.method == 'POST': form = PostForm(request.POST, request.FILES) if form.is_valid(): form.save(commit=True) return redirect(blog) else: form.errors form = PostForm() return render_to_response('blog/add_post.html', {'form': form}, conte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_create(request):\n\tform = PostForm(request.POST or None, request.FILES or None)\n\tif request.POST:\n\t\tif form.is_valid():\n\t\t\tinstance = form.save(commit=False)\n\t\t\tinstance.user = request.user\n\t\t\tinstance.save()\n\t\t\tmessages.success(request, \"Post created!\")\n\t\t\treturn HttpResponseR...
[ "0.77995807", "0.7707933", "0.76975834", "0.7584286", "0.748422", "0.74766344", "0.73922265", "0.7341689", "0.7336625", "0.7246598", "0.7205509", "0.7186319", "0.71615034", "0.71256626", "0.71069914", "0.7081613", "0.708097", "0.707806", "0.7077477", "0.7068825", "0.7066965",...
0.0
-1
Sets the xbrl_member of this CompanySharesOutstanding.
def xbrl_member(self, xbrl_member): self._xbrl_member = xbrl_member
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def member_of(self, member_of: object):\n\n self._member_of = member_of", "def __init__(self, xbrl_axis=None, xbrl_member=None, title_of_security=None, trading_symbol=None, security_exchange_name=None, shares_outstanding=None): # noqa: E501 # noqa: E501\n\n self._xbrl_axis = None\n self._x...
[ "0.5315446", "0.51163673", "0.50208473", "0.50178456", "0.496713", "0.48989674", "0.48514822", "0.48340034", "0.47946647", "0.47856298", "0.47497913", "0.47355002", "0.46961203", "0.46472278", "0.4643359", "0.4636568", "0.4612313", "0.46051726", "0.4583095", "0.45823118", "0....
0.7606827
0
Sets the title_of_security of this CompanySharesOutstanding.
def title_of_security(self, title_of_security): self._title_of_security = title_of_security
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authority_title(self, authority_title):\n\n self._authority_title = authority_title", "def set_title(self, title):\n\t\tpass", "def setTitle(self, title):\n self.__title__ = title", "def setTitle(self, title):\n self._title = title", "def settitle(self, title):\n self.__titl...
[ "0.5582221", "0.553276", "0.5464426", "0.5426828", "0.5364334", "0.5364334", "0.53603905", "0.53464526", "0.53207034", "0.5317882", "0.53055894", "0.53044", "0.52914065", "0.52898365", "0.52885693", "0.52819943", "0.525425", "0.52389425", "0.52101356", "0.5170192", "0.5170192...
0.7989265
0
Sets the security_exchange_name of this CompanySharesOutstanding.
def security_exchange_name(self, security_exchange_name): self._security_exchange_name = security_exchange_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(self, sNewShareName):\n\t\tcall_sdk_function('PrlShare_SetName', self.handle, sNewShareName)", "def setExchange(self, exchange):\r\n\t\tself.exchange = exchange", "def payee_name(self, payee_name):\n\n self._payee_name = payee_name", "def setExchange(self, exchange):\r\n\t\tself.pair.exch...
[ "0.59554976", "0.5699564", "0.5614428", "0.5570126", "0.54785377", "0.54163843", "0.53968006", "0.5334684", "0.5306025", "0.52800035", "0.52709365", "0.52241266", "0.51730824", "0.5159486", "0.51339614", "0.5122424", "0.51099145", "0.51099145", "0.51099145", "0.51099145", "0....
0.8049971
0
Sets the shares_outstanding of this CompanySharesOutstanding.
def shares_outstanding(self, shares_outstanding): self._shares_outstanding = shares_outstanding
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_company_founded(self, value):\n self.company_founded = value", "def update_shares(self):\n self.nb_shares = self.shares.count()\n self.save()", "def fee_xtra_shares(self, fee_xtra_shares):\n\n self._fee_xtra_shares = fee_xtra_shares", "def manage_stock(self, manage_stock):...
[ "0.5172161", "0.5170245", "0.5081828", "0.49156207", "0.48746184", "0.48356825", "0.47940323", "0.4700569", "0.4609945", "0.45945835", "0.45829228", "0.45697272", "0.45413285", "0.45300502", "0.4512692", "0.45067695", "0.44998428", "0.44998428", "0.44998428", "0.44998428", "0...
0.845648
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, CompanySharesOutstanding): 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.84560555", "0.83913696", "0.8143685", "0.81403786", "0.8131871", "0.8093231", "0.80915105", "0.80915105", "0.80915105", "0.8084564", "0.8084564", "0.8075547", "0.8075547", "0.8065006" ]
0.0
-1
part 1 of the common header for all webout html files
def common_header_part1(outfile: TextIO, title: str, indexpath: str = "") -> None: outfile.write("<!DOCTYPE HTML>\n") outfile.write("<html lang=\"en\">\n") outfile.write(" <head>\n") outfile.write(" <!-- Google tag (gtag.js) -->\n") outfile.write(" <script async src=\"https://www.googletagmanager...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def common_html_header(outfile: TextIO, title: str, indexpath: str = \"\") -> None:\n common_header_part1(outfile, title, indexpath=indexpath)\n common_header_part2(outfile, indexpath=indexpath)", "def common_header_part2(outfile: TextIO, indexpath: str = \"\", include_map: bool = False) -> None:\n outf...
[ "0.7310548", "0.72130895", "0.669063", "0.65561694", "0.6554252", "0.6477935", "0.629995", "0.624201", "0.62418926", "0.6185418", "0.61781824", "0.61258537", "0.6102721", "0.6068492", "0.6064652", "0.6023097", "0.588838", "0.58609045", "0.5840573", "0.5813871", "0.5789944", ...
0.72125494
2
part 2 of the common header for all webout html files
def common_header_part2(outfile: TextIO, indexpath: str = "", include_map: bool = False) -> None: outfile.write(" </head>\n") outfile.write("\n") if include_map: outfile.write(" <body onload=\"initialize()\">\n") else: outfile.write(" <body>\n") outfile.write(" <div id=\"skip-l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def common_html_header(outfile: TextIO, title: str, indexpath: str = \"\") -> None:\n common_header_part1(outfile, title, indexpath=indexpath)\n common_header_part2(outfile, indexpath=indexpath)", "def common_header_part1(outfile: TextIO, title: str, indexpath: str = \"\") -> None:\n outfile.write(\"<!D...
[ "0.7142896", "0.71233875", "0.65526456", "0.65062773", "0.6347267", "0.62525314", "0.6225593", "0.6224267", "0.6071082", "0.60600173", "0.6051541", "0.5979848", "0.59549737", "0.59207064", "0.5842377", "0.5831878", "0.5824586", "0.5821843", "0.58054024", "0.5798344", "0.57776...
0.7155209
0
create a blank index.html file for webout directories to prevent browsers from listing containing files
def create_blank_index(fname: str) -> None: with open(fname, "w") as outfile: outfile.write("<!DOCTYPE HTML>\n") outfile.write("<html lang=\"en\">\n") outfile.write(" <head>\n") outfile.write(" <meta charset=\"utf-8\" />\n") outfile.write(" <title>n/a</title>\n") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_path_and_index(subdir: str) -> None:\n if not os.path.exists(WEBOUT_PATH + subdir):\n os.makedirs(WEBOUT_PATH + subdir)\n create_blank_index(WEBOUT_PATH + subdir + \"index.html\")", "def nullx(self):\n return open(os.path.join(self.staticdir, \"index.html\"))", "def root():\n ...
[ "0.743672", "0.69597656", "0.6934943", "0.68823487", "0.6802986", "0.6786042", "0.6658209", "0.6650924", "0.66362566", "0.6534041", "0.65273935", "0.65232056", "0.6492514", "0.6484433", "0.6479414", "0.6467111", "0.6467111", "0.64238346", "0.64203584", "0.6406822", "0.6402359...
0.66454756
8
function to clean up names so that variation such as punctuation does not prevent a match
def clean_name(x: str) -> str: x = x.replace(", var.", " var.") if "{" in x: x = x[:x.find("{")-1] return x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_name(s):\n return re.sub('[\\W_]+', '', s).lower()", "def _sanitizeName(name):\n\n name = name.lower() # lower.\n name = name.replace('.','') # remove periods.\n name = name.replace('-','') # remove dashes.\n name = name.replace(\"'\",'') # remove apostrophies.\n # return it.\n ...
[ "0.7899415", "0.77751094", "0.77683455", "0.7733023", "0.7707101", "0.7527052", "0.7518962", "0.74160117", "0.7342701", "0.7309317", "0.728663", "0.7268865", "0.720183", "0.71331203", "0.7132378", "0.7074982", "0.7074801", "0.7074801", "0.7074801", "0.7031685", "0.7011743", ...
0.0
-1
Constructor. Initializes the internal key value to None.
def __init__(self, value, column_name=None, table_name=None): if not column_name and \ isinstance(value, types.StringTypes) and \ value[0] in KEY_TYPES and \ value.find(COL_SEPARATOR) > 0: # this is constructed key table_name, column_name, val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self._key = ''", "def __init__(self, key=None):\n self.key = key", "def __init__(__self__, *,\n key: Optional[pulumi.Input[str]] = None,\n value: Optional[pulumi.Input[str]] = None):\n if key is not None:\n pulumi.set(__self_...
[ "0.79701024", "0.7719548", "0.74980706", "0.7438545", "0.73498017", "0.733619", "0.7226178", "0.7217992", "0.7135386", "0.7135386", "0.7135386", "0.7135386", "0.7135386", "0.7135386", "0.7135386", "0.7135386", "0.7135386", "0.7135386", "0.7135386", "0.7135386", "0.7135386", ...
0.0
-1
String representation of the key. Each Key is represented by [type U][full_column]|[value].
def __str__(self): key_type = self.__guess_key_type() return "%s%s%s%s" % ( key_type, self.getFullyQualifiedName(), COL_SEPARATOR, self.__key )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key(self)->str:\n return \"{}:{}.{}.{}\".format(self.source, self.db, self.ed, self.rec)", "def _key_to_str(self, key: Any) -> Any:\n if isinstance(key, str):\n return key\n if isinstance(key, int):\n return list(self._data_vars.keys())[key]\n if isinstance(k...
[ "0.7185751", "0.70761335", "0.7045239", "0.7011694", "0.7011694", "0.7009207", "0.69607264", "0.69163334", "0.68640375", "0.67905277", "0.6774116", "0.67433316", "0.673338", "0.669495", "0.669495", "0.6680772", "0.6667989", "0.660078", "0.65877926", "0.6544538", "0.65388435",...
0.80834216
0
The supercategories where this category is a member of any set of children. Note that all possible parents are returned, not "canonical" parents.
def parents(self) -> set["HierarchicalCategory"]: return self.categorization.parents(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ancestors(self) -> set[\"HierarchicalCategory\"]:\n return self.categorization.ancestors(self)", "def children(self) -> list[set[\"HierarchicalCategory\"]]:\n return self.categorization.children(self)", "def leaf_children(self) -> list[set[\"HierarchicalCategory\"]]:\n ret = []\n ...
[ "0.7293767", "0.72403806", "0.7221767", "0.7165426", "0.71166617", "0.6867782", "0.68392456", "0.6794149", "0.6618477", "0.6576405", "0.63923216", "0.633744", "0.6326134", "0.6319682", "0.62995994", "0.62809247", "0.6263329", "0.6213591", "0.6159876", "0.6127407", "0.610811",...
0.75217533
0
The sets of subcategories which are descendants of this category and do not have children themselves. Sets of children are chased separately, so each set of leaf children is selfsufficient to reconstruct this category (if the categorization allows reconstructing categories from their children, i.e. if total_sum is set)...
def leaf_children(self) -> list[set["HierarchicalCategory"]]: ret = [] for children in self.children: n = [] for child in children: if child.is_leaf: n.append([{child}]) else: n.append(child.leaf_children) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def descendants(self) -> set[\"HierarchicalCategory\"]:\n return self.categorization.descendants(self)", "def children(self) -> list[set[\"HierarchicalCategory\"]]:\n return self.categorization.children(self)", "def children(\n self, cat: typing.Union[str, HierarchicalCategory]\n ) -> l...
[ "0.755007", "0.7032662", "0.69125843", "0.68902165", "0.6748703", "0.6741472", "0.66047186", "0.65718263", "0.6462812", "0.6384042", "0.63346934", "0.62835926", "0.6266729", "0.62290126", "0.6151169", "0.6140242", "0.6133421", "0.61323303", "0.6128564", "0.6061589", "0.605872...
0.74580395
1
The list of sets of direct children of the given category.
def children( self, cat: typing.Union[str, HierarchicalCategory] ) -> list[set[HierarchicalCategory]]: if not isinstance(cat, HierarchicalCategory): return self.children(self._all_codes_map[cat]) children_dict = {} for _, child, setno in self._graph.edges(cat, "set"): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def children(self) -> list[set[\"HierarchicalCategory\"]]:\n return self.categorization.children(self)", "def leaf_children(\n self, cat: typing.Union[str, HierarchicalCategory]\n ) -> list[set[HierarchicalCategory]]:\n if not isinstance(cat, HierarchicalCategory):\n return sel...
[ "0.75516796", "0.7268226", "0.6969757", "0.69614905", "0.695906", "0.67972845", "0.67608833", "0.654496", "0.63985157", "0.6372887", "0.63548315", "0.6350083", "0.6341693", "0.63257265", "0.6309417", "0.6273869", "0.62576276", "0.62097853", "0.61735904", "0.61674654", "0.6155...
0.8111073
0
Create Categorization or HierarchicalCategorization from a dict specification.
def from_spec(spec: dict[str, typing.Any]) -> CategorizationT: if spec["hierarchical"]: return HierarchicalCategorization.from_spec(spec) else: return Categorization.from_spec(spec)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_spec(\n cls: type[CategorizationT], spec: dict[str, typing.Any]\n ) -> CategorizationT:\n if spec[\"hierarchical\"] != cls.hierarchical:\n raise ValueError(\n \"Specification is for a non-hierarchical categorization, use\"\n \"Categorization.from_s...
[ "0.6915147", "0.6858981", "0.59756553", "0.5657054", "0.56551516", "0.55090696", "0.5499468", "0.5492386", "0.54117054", "0.53619766", "0.5347223", "0.53456694", "0.5313046", "0.53052735", "0.5289592", "0.5287172", "0.5284914", "0.52793205", "0.5270843", "0.5218367", "0.52167...
0.80054176
0
drawing the bullet and rotating it according to it's launcher
def calculate_heading(self): self.radius = Bullet.side # for collision detection self.angle += self.boss.turretAngle self.mass = Bullet.mass self.vel = Bullet.vel # Designing a Bullet image = pygame.Surface((Bullet.side * 2, Bullet.side)) image.fill((128...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_bullet(self):\n self.screen.blit(self.image, self.rect)", "def draw_bullet(self):\n self.screen.blit(self.image, self.rect)", "def draw_bullet(self):\n\t\tpygame.draw.rect(self.screen, self.colour, self.rect)", "def draw_bullet(self):\r\n pygame.draw.rect(self.screen, self.color...
[ "0.7293251", "0.7293251", "0.7245552", "0.71505433", "0.70313513", "0.69465584", "0.6935661", "0.69219995", "0.69159174", "0.69101745", "0.68442506", "0.67508835", "0.66921884", "0.66921884", "0.6603616", "0.6542815", "0.6507938", "0.6466501", "0.64383036", "0.6425846", "0.63...
0.5990294
57
Get all channel items for this channel.
def get_items(self, keyword='', linked=True, unlinked=True): page = 1 show_on_page = 50 request_items = self.request_channel_items( page, show_linked=linked, show_unlinked=unlinked, show_on_page=show_on_page, keyword=keyword) items = request_items while le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_items(self):\n return self.api.state['items']", "def get_all(self):\n return self.__items", "def get_all(self):\n\n return self._items[:]", "def all(self):\n return self.client.request_with_method(Methods.LIST % self.name)['items']", "def iter_channels(self) -> Itera...
[ "0.68368477", "0.68236643", "0.6649051", "0.6626947", "0.6585407", "0.6561852", "0.6453671", "0.64034814", "0.63789743", "0.63749206", "0.63717353", "0.6338891", "0.6327982", "0.6313627", "0.6307755", "0.6301804", "0.6286068", "0.6266928", "0.6260479", "0.62567854", "0.624577...
0.5790154
56
returns True if at least one service of this Role is still running
def __some_alive(self): for service in self.__services.values(): if service.is_alive(): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_services_running():\n return all(['RUNNING' in line or 'EXITED' in line\n for line in supervisor_status()])", "def healthy_service(self):\n return not self.service_currently_down and not self.service_recently_down", "def should_keep_running(self):\n return len(self.party.act...
[ "0.7420898", "0.7197685", "0.71518683", "0.7028626", "0.69956684", "0.69136214", "0.6843473", "0.6761129", "0.6666567", "0.6664707", "0.6662684", "0.66441935", "0.6605911", "0.6594392", "0.6587816", "0.65838486", "0.65452635", "0.6543974", "0.6527387", "0.6509514", "0.6477596...
0.7972044
0
Fetches secrets from Datastore and returns them as a list.
def get_secrets(): client = datastore.Client() query = client.query(kind='env_vars') entity = query.fetch() secrets = list(entity)[0] return secrets
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def list_secrets(self):\n pass", "def get_db_secrets():\n secret_response = secrets_client.get_secret_value(SecretId=db_secret_name)\n secrets = json.loads(secret_response['SecretString'])\n return secrets", "def secrets(self): # pylint: disable=no-self-use\n return []", "def se...
[ "0.8086684", "0.7478185", "0.72897476", "0.7256536", "0.71578765", "0.70649576", "0.6729046", "0.6623931", "0.6564589", "0.655233", "0.6418088", "0.64006025", "0.63814545", "0.63044786", "0.6236014", "0.6230588", "0.6158977", "0.61266756", "0.6121772", "0.60114855", "0.600639...
0.73549074
2