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
Update a IPFix Filter context (v2.0)
def ipfixfiltercontexts(self, ipfixfiltercontext_id, data, tenant_id=None, api_version="v2.0"): if tenant_id is None and self._parent_class.tenant_id: # Pull tenant_id from parent namespace cache. tenant_id = self._parent_class.tenant_id elif not tenant_id: # No valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_packet_filter(self, packet_filter_id, body=None):\r\n return self.put(self.packet_filter_path % packet_filter_id, body=body)", "def cloudflare_waf_filter_update_request(self, filter_id: str, expression: str, zone_id: str, ref: str = None,\n paused: bo...
[ "0.6284456", "0.62334543", "0.5889026", "0.57389325", "0.56305623", "0.5594993", "0.54391646", "0.5344065", "0.53230435", "0.53095686", "0.5245107", "0.5192891", "0.5131998", "0.51304215", "0.5082194", "0.5077147", "0.50681883", "0.50596887", "0.50445175", "0.50331837", "0.50...
0.659609
0
Concat observation and action to feed the critic.
def concat_obs_and_action(obs, action): return F.concat((obs, action), axis=-1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_action(\n self, action: torch.Tensor, obs: torch.tensor, pre_train: bool = False\n ):\n with torch.no_grad():\n acm_observation = torch.cat([obs, action], axis=1)\n acm_action = self.acm.act(acm_observation)\n acm_action = acm_action.cpu().numpy()[0]\n ...
[ "0.61834", "0.6102943", "0.6004313", "0.591667", "0.5905504", "0.5904155", "0.5892977", "0.57980675", "0.576682", "0.57190067", "0.56239724", "0.56142354", "0.5587729", "0.55859774", "0.55788547", "0.55252117", "0.5515473", "0.55042964", "0.54937345", "0.546257", "0.5433662",...
0.72231126
0
Concat observation and action to feed the critic.
def concat_obs_and_action(obs, action): return F.concat((obs, action), axis=-1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_action(\n self, action: torch.Tensor, obs: torch.tensor, pre_train: bool = False\n ):\n with torch.no_grad():\n acm_observation = torch.cat([obs, action], axis=1)\n acm_action = self.acm.act(acm_observation)\n acm_action = acm_action.cpu().numpy()[0]\n ...
[ "0.61834", "0.6102943", "0.6004313", "0.591667", "0.5905504", "0.5904155", "0.5892977", "0.57980675", "0.576682", "0.57190067", "0.56239724", "0.56142354", "0.5587729", "0.55859774", "0.55788547", "0.55252117", "0.5515473", "0.55042964", "0.54937345", "0.546257", "0.5433662",...
0.72231126
1
test for backslash and quotation mark in article title
def test_get_email_headers_vor_after_poa(self): # set templates to warmed and copy some template files self.copy_email_templates() self.templates.email_templates_warmed = True author = {"first_nm": "Test"} article_data = { "doi": "10.7554/eLife.00666", "ar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_title(self, title):\n\t\t# strip apostrophes\n\t\tif '\\'' in title:\n\t\t\ttitle = re.sub('\\'', '', title)\n\t\tif '.' in title:\n\t\t\ttitle = re.sub('.', '', title)\n\t\treturn title", "def escape_single_quotes(custom_data):\n # https://stackoverflow.com/questions/10569438/how-to-print-unicode...
[ "0.671212", "0.65244305", "0.644828", "0.63826835", "0.6227211", "0.61295265", "0.60501397", "0.6015933", "0.60010123", "0.5964682", "0.5935215", "0.5926926", "0.59107345", "0.5908884", "0.5896515", "0.58860976", "0.58464056", "0.583026", "0.58003277", "0.57997113", "0.579830...
0.0
-1
If s ends with any of the given suffixes, remove that suffix.
def strip_suffix(s, suffixes): for suffix in suffixes: if s.endswith(suffix): return s.rstrip(suffix) return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strip_any_ends(s: str, prefixes: Union[str, Sequence[str]], suffixes: Union[str, Sequence[str]]) -> str:\n\t\tprefixes = [str(z) for z in prefixes] if StringTools.is_true_iterable(prefixes) else [str(prefixes)]\n\t\tsuffixes = [str(z) for z in suffixes] if StringTools.is_true_iterable(suffixes) else [str(suffi...
[ "0.7976806", "0.7474195", "0.73650116", "0.73627186", "0.7312765", "0.7229352", "0.72054744", "0.7200014", "0.71096194", "0.6759472", "0.6674874", "0.6616776", "0.6615292", "0.6504198", "0.64914614", "0.6460829", "0.6280597", "0.61807317", "0.60199267", "0.60010654", "0.59839...
0.8517615
0
a naive tokenizer that splits on punctuation and whitespaces.
def tokenize(s): s = "".join(" " if x in string.punctuation else x for x in s.lower()) return s.split()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simple_tokenizer(text):\n re_tok = re.compile(punctuation_string)\n return re_tok.sub(' ', text).split()", "def tokenizer(text):\n # remove punctuation from text - remove anything that isn't a word char or a space\n replace_punctuation = str.maketrans(string.punctuation, ' ' * len(string.punctuat...
[ "0.80779797", "0.7881415", "0.7805807", "0.7573461", "0.7512989", "0.75009525", "0.75009525", "0.75009525", "0.7458441", "0.72792125", "0.7270322", "0.722437", "0.7182435", "0.715973", "0.713763", "0.71204627", "0.70281935", "0.70220906", "0.6989555", "0.69709575", "0.6969226...
0.73836356
9
Convert to column integer index.
def getColIdx(self, col): try: return int(col) except: return ord(col)-ord('a')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getColIdx(self, col):\n try: \n return int(col)\n except:\n return ord(col)-ord('a')", "def column_indexer(data):\n idCol = {label: index for index, label in enumerate(data.columns)}\n return idCol", "def row_column_to_index(self, row, col):\r\n if row >= se...
[ "0.71879935", "0.6813815", "0.67257106", "0.6707767", "0.6673845", "0.6614878", "0.6553917", "0.6535518", "0.65329057", "0.64649004", "0.6368438", "0.6359051", "0.6354399", "0.6281743", "0.62803566", "0.6267354", "0.61744505", "0.6159785", "0.60960484", "0.6084746", "0.607424...
0.71770704
1
Compute the number of rows in a table. >>> simple_table = T88ble(simple_table_rows, simple_table_labels) >>> simple_table.num_rows() 2 >>> longer_table = T88ble(longer_table_rows, longer_table_labels) >>> longer_table.num_rows() 3
def num_rows(self): return (len(self.rows))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def len(self, table):\n return self.get_table_nb_lines(table)", "def getNumRows(self) -> int:\n ...", "def get_table_nb_lines(self, table):\n sql = \"SELECT COUNT(*) FROM \" + table + \";\"\n cur = self._connection.cursor()\n cur.execute(sql)\n res = cur.fetchall()\n ...
[ "0.7057664", "0.7000111", "0.6924873", "0.6892689", "0.68364155", "0.6750728", "0.6718546", "0.6718546", "0.66236776", "0.64803", "0.6472576", "0.6431292", "0.6406376", "0.64006543", "0.6394253", "0.6394253", "0.63430583", "0.629818", "0.629818", "0.6285307", "0.6279919", "...
0.65308726
9
Compute the number of cols in a table. >>> simple_table = T88ble(simple_table_rows, simple_table_labels) >>> simple_table.num_cols() 2 >>> longer_table = T88ble(longer_table_rows, longer_table_labels) >>> longer_table.num_cols() 5
def num_cols(self): return (len(self.rows[0]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_num_columns(table):\n\n\treturn max((len(row) for row in table))", "def get_table_total_cols(table_name):\n return table_spec[table_name]['number_of_columns']", "def colnum(self):\n \n colnum = 0\n for table in self.columnlabels:\n table = np.asarray(table)\n ...
[ "0.7435793", "0.72695976", "0.7044339", "0.68726677", "0.68480796", "0.6763542", "0.67584926", "0.6724156", "0.667985", "0.6642177", "0.663405", "0.65933347", "0.65551686", "0.6543497", "0.65249014", "0.6457523", "0.6451395", "0.64166677", "0.6411727", "0.6400244", "0.6384871...
0.66561395
9
Do a PUT to the REST API
def base_put(url_path, content): response = requests.put(url=settings.URL_API + url_path, json=content) return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_PUT(self,):\n self.http_method = 'PUT'\n # Nothing to do for now.\n pass", "def put(self, *args, **kwargs):\n self.request(\"put\", *args, **kwargs)", "def _put(self, *args, **kwargs):\n return self._request('put', *args, **kwargs)", "def put(self, *args, **kw):\n ...
[ "0.8481819", "0.8174144", "0.80880237", "0.7906544", "0.7865537", "0.7853935", "0.7853935", "0.7853935", "0.7836279", "0.7733739", "0.7694025", "0.76905614", "0.7686603", "0.7674774", "0.76485056", "0.7642753", "0.75750834", "0.7546372", "0.7518047", "0.7515122", "0.7490388",...
0.7136122
48
Return True if product is importable.
def _check_product(self): self.importable = False abcde = string.ascii_uppercase[:5] product_infos = self.retrieve_product_infos() if product_infos['product_code'] is not None: try: Products.objects.get( code=product_infos['product_code']...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkIfImport():\n instance_ipath, product_ipath = getImportedPathes()\n product_ilist = [i for i in os.listdir(product_ipath) \\\n if osp.isfile(osp.join(product_ipath,i)) and i.endswith('.zexp')]\n if product_ilist:\n return 1\n return 0", "def is_import():\n retur...
[ "0.7130446", "0.70421916", "0.6942563", "0.68672335", "0.67795336", "0.67540073", "0.6393495", "0.63283885", "0.6314604", "0.6280096", "0.6269284", "0.62405753", "0.6190545", "0.6176349", "0.61119163", "0.6110553", "0.6107171", "0.60869443", "0.60152715", "0.60085326", "0.600...
0.70381767
2
Gets the proxy_host of this OrgApacheHttpProxyconfiguratorProperties.
def proxy_host(self) -> ConfigNodePropertyString: return self._proxy_host
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def org_apache_felix_http_host(self) -> ConfigNodePropertyString:\n return self._org_apache_felix_http_host", "def proxy_host(self, proxy_host: ConfigNodePropertyString):\n\n self._proxy_host = proxy_host", "def http_proxy_config(self) -> Optional[pulumi.Input['HttpProxyConfigArgs']]:\n re...
[ "0.722652", "0.70594496", "0.7006233", "0.69573283", "0.6856466", "0.6693293", "0.6693293", "0.6665791", "0.66001433", "0.66001433", "0.6574561", "0.6563599", "0.6481491", "0.64305085", "0.6421678", "0.6343292", "0.6332674", "0.6320876", "0.6285293", "0.62727994", "0.62669", ...
0.84090894
0
Gets the proxy_port of this OrgApacheHttpProxyconfiguratorProperties.
def proxy_port(self) -> ConfigNodePropertyInteger: return self._proxy_port
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def myproxy_port(self):\n return int(self.__get_option('myproxy_port'))", "def proxy_port(self, proxy_port: ConfigNodePropertyInteger):\n\n self._proxy_port = proxy_port", "def org_osgi_service_http_port(self) -> ConfigNodePropertyInteger:\n return self._org_osgi_service_http_port", "def...
[ "0.77271473", "0.7140499", "0.69854283", "0.6951787", "0.66175675", "0.66126806", "0.6559429", "0.6396864", "0.61773384", "0.61648935", "0.61017185", "0.6087262", "0.6020181", "0.6020181", "0.6020181", "0.6020181", "0.6020181", "0.6020181", "0.6012418", "0.59941924", "0.59656...
0.8625204
0
Sets the proxy_port of this OrgApacheHttpProxyconfiguratorProperties.
def proxy_port(self, proxy_port: ConfigNodePropertyInteger): self._proxy_port = proxy_port
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def proxy_port(self) -> ConfigNodePropertyInteger:\n return self._proxy_port", "def myproxy_port(self):\n return int(self.__get_option('myproxy_port'))", "def configure_proxy(self, proxy):\n server_name = self.get_external_domain()\n tls_enabled = self.get_tls()\n ircd_enable...
[ "0.7108557", "0.6764426", "0.66609585", "0.62860316", "0.62850714", "0.6262424", "0.6262424", "0.61988086", "0.6160228", "0.58355385", "0.5831742", "0.58151823", "0.5783903", "0.5776706", "0.57580996", "0.5697625", "0.5631563", "0.56151783", "0.5560392", "0.5540028", "0.54928...
0.8525443
0
Gets the proxy_user of this OrgApacheHttpProxyconfiguratorProperties.
def proxy_user(self) -> ConfigNodePropertyString: return self._proxy_user
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def proxy_user(self, proxy_user: ConfigNodePropertyString):\n\n self._proxy_user = proxy_user", "def proxy_host(self) -> ConfigNodePropertyString:\n return self._proxy_host", "def proxy(self):\n return self.get('proxy', None)", "def proxy_password(self) -> ConfigNodePropertyString:\n ...
[ "0.68361104", "0.6681285", "0.64272577", "0.62115", "0.61349076", "0.61141473", "0.6106977", "0.5957475", "0.5957475", "0.5950456", "0.5936755", "0.59110665", "0.58681285", "0.5855839", "0.5830308", "0.5813465", "0.5813465", "0.5704828", "0.56811047", "0.56747645", "0.5656051...
0.8157716
0
Gets the proxy_password of this OrgApacheHttpProxyconfiguratorProperties.
def proxy_password(self) -> ConfigNodePropertyString: return self._proxy_password
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def proxy_password(self, proxy_password: ConfigNodePropertyString):\n\n self._proxy_password = proxy_password", "def org_apache_felix_https_keystore_password(self) -> ConfigNodePropertyString:\n return self._org_apache_felix_https_keystore_password", "def org_apache_felix_https_truststore_passwor...
[ "0.707795", "0.6565057", "0.63876116", "0.6331296", "0.63257897", "0.6283728", "0.62826884", "0.62522817", "0.6237046", "0.6178273", "0.6178273", "0.6176875", "0.6134971", "0.6092928", "0.6092928", "0.6092928", "0.6092928", "0.6085111", "0.60818136", "0.60432565", "0.60432565...
0.8324397
0
Sets the proxy_password of this OrgApacheHttpProxyconfiguratorProperties.
def proxy_password(self, proxy_password: ConfigNodePropertyString): self._proxy_password = proxy_password
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def proxy_password(self, proxy_password):\n\n self._proxy_password = proxy_password", "def proxy_password(self) -> ConfigNodePropertyString:\n return self._proxy_password", "def set_proxy(self, proxy, user=None):\n proxy_handler = urllib2.ProxyHandler({'http':proxy})\n proxy_auth_ha...
[ "0.80976295", "0.6842099", "0.63505304", "0.62427074", "0.60902023", "0.5898345", "0.58872056", "0.5880058", "0.5872026", "0.5832803", "0.5832803", "0.58307046", "0.5812896", "0.57719296", "0.57462966", "0.57051826", "0.5632621", "0.5632455", "0.56095546", "0.56038886", "0.55...
0.8475717
0
Gets the proxy_exceptions of this OrgApacheHttpProxyconfiguratorProperties.
def proxy_exceptions(self) -> ConfigNodePropertyArray: return self._proxy_exceptions
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def proxy_exceptions(self, proxy_exceptions: ConfigNodePropertyArray):\n\n self._proxy_exceptions = proxy_exceptions", "def proxy_addresses(self):\n if \"proxyAddresses\" in self._prop_dict:\n return self._prop_dict[\"proxyAddresses\"]\n else:\n return None", "def pro...
[ "0.69652", "0.6213066", "0.6195467", "0.58049726", "0.55870247", "0.5452982", "0.53719467", "0.53398305", "0.51390857", "0.51219827", "0.5015078", "0.49335772", "0.49110392", "0.48885685", "0.48733357", "0.4853546", "0.48275474", "0.4815668", "0.47659233", "0.4765037", "0.473...
0.78791857
0
Get key of this MIDI track
def get_key(self) -> pitch.Pitch: note_length: float = 0.0 for note in self.midi_data: if note.type not in [constants.NOTE_ON, constants.NOTE_OFF] or note.is_meta: continue note_length += note.time if note.type == constants.NOTE_ON: se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key(self) -> str:\n return pulumi.get(self, \"key\")", "def key(self) -> str:\n return pulumi.get(self, \"key\")", "def key(self) -> str:\n return pulumi.get(self, \"key\")", "def key(self) -> str:\n return pulumi.get(self, \"key\")", "def key(self) -> str:\n return p...
[ "0.7363542", "0.7363542", "0.7363542", "0.7363542", "0.7363542", "0.7363542", "0.7363542", "0.7363542", "0.7363542", "0.7363542", "0.7363542", "0.7363542", "0.7363542", "0.7363542", "0.7363542", "0.7363542", "0.7363542", "0.7363542", "0.7363542", "0.7363542", "0.7363542", "...
0.0
-1
Return True if the requirement is a positive right or left requirement, but also set this to True on the algorithm, as these will be skipped when determining whether or not fusable.
def is_positive_left_or_right_requirement( self, requirement: Tuple[GriddedPerm, ...] ) -> bool: left, right = self.positive_left_right_requirements if requirement == left: self._positive_left = True return True if requirement == right: self._posit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_right(self):\n return self.r is not None", "def isRight(self):\n\t\tif self.sq(self.a) == self.sq(self.b) + self.sq(self.c):\n\t\t\treturn True\n\t\telif self.sq(self.b) == self.sq(self.a) + self.sq(self.c):\n\t\t\treturn True\n\t\telif self.sq(self.c) == self.sq(self.a) + self.sq(self.b):\n\t\t\t...
[ "0.6261736", "0.6142976", "0.6068524", "0.606693", "0.5974835", "0.59288013", "0.5907143", "0.58914113", "0.5889916", "0.5889916", "0.5889916", "0.58439", "0.58125985", "0.57931226", "0.57520956", "0.57515013", "0.5748452", "0.57483536", "0.5745712", "0.5740906", "0.5728425",...
0.7801707
0
The first cell of the fusion. This cell is in the bottommost row or the leftmost column of the fusion.
def first_cell(self) -> Cell: if self._first_cell is not None: return self._first_cell if not self._pre_check(): raise RuntimeError( "Pre-check failed. No component fusion possible and no first cell" ) assert self._first_cell is not None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_start_cell(self):\n return (self.st_row, self.st_col)", "def cells_x(self):\n return self._cells[0]", "def get_first(self):\n return self.A[1][0] if self.n > 0 else None", "def minimum_f_cell(self):\n return sorted(self.open_cells,key = lambda cell: cell.f)[0]", "def get...
[ "0.7447675", "0.72165114", "0.70797783", "0.69387704", "0.6895671", "0.6793688", "0.6791701", "0.6715668", "0.66716105", "0.66242564", "0.65955967", "0.65906334", "0.6584765", "0.6562356", "0.6560981", "0.65540606", "0.654534", "0.65152", "0.6474466", "0.6462072", "0.64205647...
0.81657314
0
The second cell of the fusion. This cell is in the topmost row or the rightmost column of the fusion.
def second_cell(self) -> Cell: if self._second_cell is not None: return self._second_cell if not self._pre_check(): raise RuntimeError( "Pre-check failed. No component fusion possible and no second cell" ) assert self._second_cell is not None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_top_cell(self):\n return self._top_cell", "def get_atom2(self):\n return self.atom2", "def H2(self) -> int:\n return self.raw_measure()[0]", "def _get_hcell2(self):\n try:\n return self._get_hcell()\n except AttributeError:\n pass\n if s...
[ "0.65394616", "0.65115815", "0.65051323", "0.63606584", "0.63474256", "0.6346645", "0.63238895", "0.63033366", "0.62886304", "0.62799245", "0.625371", "0.6239624", "0.62109137", "0.61575526", "0.6151368", "0.61430347", "0.61199135", "0.61043", "0.6060474", "0.60458606", "0.60...
0.79270566
0
Return True if the tiling contains a crossing length 2 obstruction between `self.first_cell` and `self.second_cell`.
def has_crossing_len2_ob(self) -> bool: fcell = self.first_cell scell = self.second_cell if self._fuse_row: possible_obs = [ GriddedPerm((0, 1), (fcell, scell)), GriddedPerm((1, 0), (scell, fcell)), ] else: possible_obs ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_crossing_len2(self, gp: GriddedPerm) -> bool:\n return (\n len(gp) == 2\n and gp.occupies(self.first_cell)\n and gp.occupies(self.second_cell)\n )", "def check_obstructed(r1,r2): \n \n if r1==r2:\n return False\...
[ "0.78824073", "0.68954784", "0.6758718", "0.6727416", "0.666129", "0.6641281", "0.6579928", "0.6566188", "0.6500242", "0.6472105", "0.6471193", "0.64467746", "0.6424423", "0.631045", "0.63076913", "0.6294491", "0.6294169", "0.62819976", "0.62619436", "0.626085", "0.62178063",...
0.7970894
0
Return True if the gridded permutation `gp` is a length 2 obstruction crossing between the first and second cell.
def is_crossing_len2(self, gp: GriddedPerm) -> bool: return ( len(gp) == 2 and gp.occupies(self.first_cell) and gp.occupies(self.second_cell) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_crossing_len2_ob(self) -> bool:\n fcell = self.first_cell\n scell = self.second_cell\n if self._fuse_row:\n possible_obs = [\n GriddedPerm((0, 1), (fcell, scell)),\n GriddedPerm((1, 0), (scell, fcell)),\n ]\n else:\n ...
[ "0.7605194", "0.65205044", "0.63172007", "0.6194082", "0.6180891", "0.5956996", "0.5954113", "0.5945405", "0.58697414", "0.58615315", "0.5818908", "0.58009255", "0.57704616", "0.57649285", "0.57160443", "0.5714976", "0.5709079", "0.57037276", "0.56842357", "0.56733865", "0.56...
0.87764925
0
Get the upper bound of the observation.
def _get_observation_upper_bound(self): upper_bound = np.zeros(self._get_observation_dimension()) num_motors = self.rex.num_motors upper_bound[0:num_motors] = math.pi # Joint angle. upper_bound[num_motors:2 * num_motors] = motor.MOTOR_SPEED_LIMIT # Joint velocity. upper_bound[2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_upper_bound(self):\n return self._upper_bound", "def upper_bound(self) -> float:\n ...", "def getUpperBound(self) -> int:\n return self.upper_bound", "def upper_limit(self, parameter, bound=0.95):\n\n return self.credible_interval(parameter, interval=[bound])", "def upperLim...
[ "0.82654124", "0.80121654", "0.7784282", "0.73247284", "0.73144007", "0.71001905", "0.70977044", "0.7094112", "0.6991688", "0.68260527", "0.6774511", "0.6772629", "0.6702984", "0.6666552", "0.66234934", "0.66160595", "0.65935975", "0.65418893", "0.6427389", "0.6414601", "0.64...
0.7748964
3
Get the lower bound of the observation.
def _get_observation_lower_bound(self): lower_bound = -self._get_observation_upper_bound() lower_bound[-7] = 0.0 lower_bound[-2:] = [self.min_speed, self.min_side_speed] return lower_bound
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_lower_bound(self):\n return self._lower_bound", "def get_lower_bound(self):\n return self._lower_bound", "def getLowerBound(self) -> int:\n return self.lower_bound", "def lower_bound(self) -> float:\n ...", "def returnLowerBound(self, dimension):\n value = self._distribution....
[ "0.8084833", "0.8084833", "0.78960884", "0.7708704", "0.7328757", "0.72732955", "0.7196263", "0.6926215", "0.6872629", "0.68606067", "0.6858375", "0.68376315", "0.6804683", "0.6735373", "0.673392", "0.67250144", "0.6724453", "0.669467", "0.66673326", "0.6651393", "0.6647003",...
0.80472416
2
Get the length of the observation list.
def _get_observation_dimension(self): return len(self._get_observation_np())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getLength(self):\r\n return len(self.list)", "def length(self):\n return self.list.length", "def length(self):\n return self.list.length", "def length(self):\n return self.list.length()", "def length(self):\n return len(self.list)", "def get_list_length(self):\r\n ...
[ "0.80930895", "0.80637896", "0.80637896", "0.80318654", "0.79584473", "0.786695", "0.7792859", "0.77767175", "0.7762659", "0.77252585", "0.7684728", "0.766819", "0.76175874", "0.76094997", "0.7586631", "0.7583303", "0.7577947", "0.75425744", "0.7509297", "0.74555004", "0.7443...
0.7100927
57
Precomputes transition probabilities for each node.
def _precompute_probabilities(self): d_graph = self.d_graph first_travel_done = set() nodes_generator = self.graph.nodes() if self.quiet \ else tqdm(self.graph.nodes(), desc='Computing transition probabilities') for source in nodes_generator: # Init probabilit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess_transition_probs(self):\n G = self.G\n\n alias_nodes = {}\n for node in G.nodes():\n unnormalized_probs = [G[node][nbr].get('weight', 1.0)\n for nbr in G.neighbors(node)]\n norm_const = sum(unnormalized_probs)\n n...
[ "0.712818", "0.65178996", "0.61523", "0.6139885", "0.6113542", "0.60561776", "0.59526783", "0.5903433", "0.588959", "0.58776224", "0.58366835", "0.57966226", "0.57640105", "0.5752224", "0.5751473", "0.57505405", "0.5744542", "0.5738572", "0.5715336", "0.56442726", "0.5630044"...
0.7142989
0
Set the basicConfig level based on env_var if defined, or default_level The environment variable value, or the value of default_level, can be the names of any of the log level constants defined in the logging module. You may also use an integer value as default_level. At the moment, the environment variable must contai...
def configure_logging_module(env_var, default_level='WARNING'): level = _get_configured_log_level(env_var, default_level) logging.basicConfig(level=level)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_configured_log_level(env_var, default_level='WARNING'):\n level = os.getenv(env_var, default_level)\n if not isinstance(level, int):\n level = _log_level_from_string(level)\n return level", "def set_logging_level(\n manually_set_level=None, environment_variable_key=\"LOGGING_LEVEL\"\n...
[ "0.68221325", "0.64617103", "0.5506202", "0.54990244", "0.54730564", "0.535459", "0.5324308", "0.52451617", "0.51095617", "0.5039056", "0.5022286", "0.50064784", "0.4994939", "0.4991636", "0.4990302", "0.49610692", "0.493908", "0.4931689", "0.4924215", "0.49169022", "0.490851...
0.71818495
0
Implementation detail. Return the integer log level to be used.
def _get_configured_log_level(env_var, default_level='WARNING'): level = os.getenv(env_var, default_level) if not isinstance(level, int): level = _log_level_from_string(level) return level
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_level(self) -> str:\n return pulumi.get(self, \"log_level\")", "def log_level(self) -> str:\n return self._log_level", "def get_logging_level(self):\n return self.logging_level", "def get_log_level(self) -> int:\n logging.debug(self.args)\n return getattr(logging, s...
[ "0.82086635", "0.8169593", "0.80162287", "0.795058", "0.79441875", "0.74983907", "0.7491301", "0.73463506", "0.7334437", "0.73098224", "0.7304052", "0.7304052", "0.72724944", "0.724615", "0.724615", "0.7231551", "0.71871054", "0.7178885", "0.7148527", "0.7148527", "0.7148527"...
0.0
-1
Fetches all enabled workflows.
def get_enabled(*, db_session) -> List[Optional[Workflow]]: return db_session.query(Workflow).filter(Workflow.enabled == true()).all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_workflows(self, with_json=False):\n result = {}\n for key in self.workflows.keys():\n if key.playbook not in result:\n result[key.playbook] = []\n\n if with_json:\n result[key.playbook].append(self.get_workflow(key.playbook, key.workflow...
[ "0.6270288", "0.61222523", "0.6101928", "0.56041294", "0.56041294", "0.559457", "0.5557325", "0.5533011", "0.5519195", "0.54955214", "0.54495984", "0.5432044", "0.53965014", "0.5310892", "0.5277074", "0.52675843", "0.52602226", "0.52553624", "0.52135974", "0.5206534", "0.5179...
0.6306154
0
Initialises inputs and weights
def inputs_weights_init(self): input_user, input_item, input_rating = self.inputs_init() user_embeddings, item_embeddings = self.embeddings_layers_init() return input_user, input_item, input_rating, user_embeddings, item_embeddings
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def InitWeights(self):\n self.w = -1 + 2 * np.random.rand(self.num_of_inputs,)\n self.w0 = -1 + 2 * np.random.rand()", "def init_weights_(self):\n raise NotImplementedError", "def _initialize_weights(self):\n pass", "def _initialize_weights(self, inputs):\n if self.data_ini...
[ "0.80924684", "0.8071966", "0.80684793", "0.8013274", "0.79162055", "0.7788315", "0.7770641", "0.7725195", "0.7713341", "0.7658744", "0.7650996", "0.7641335", "0.76005805", "0.75945807", "0.7527679", "0.75076455", "0.74649364", "0.74520415", "0.7438019", "0.7425605", "0.74238...
0.78995854
5
Torsional helix strain base. Gives a constant helical base generated by a torsion value. Q associates with [torsion, y_constant, z_linear]
def torsion_linear_helix_strain(x, dof): base = np.zeros([6, dof]) base[0, 0] = 1 # torsion base[1, 1] = 1 # y-bending base[2, 2] = x # z-bending - increases linearly return base
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def torsion_helix_strain(x, dof):\n base = np.zeros([6, dof])\n base[0, 0] = 1 # torsion\n base[1, 1] = 1 # y-bending\n base[2, 2] = 1 # z-bending\n return base", "def pure_helix_strain(x, dof):\n base = np.zeros([6, dof])\n base[1, 0] = sin(x/10) # y-bending\n base[2, 1] = cos(x/10) ...
[ "0.7072083", "0.6519385", "0.6303979", "0.58713824", "0.5868275", "0.58465", "0.5783368", "0.5778036", "0.57307476", "0.5645621", "0.5576138", "0.55328107", "0.5498731", "0.54887944", "0.54574955", "0.545356", "0.543697", "0.5426507", "0.5415366", "0.5403819", "0.53893954", ...
0.7081247
0
Check and print the row and column index of value in the array
def linearSearchTwoDArray(array, value): for row in range(len(array)): for col in range(len(array[row])): if value == array[row][col]: print(f"Element: {value} has one occurrence at row={row}, col={col} in this array") return else: print("No such value...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accessElements(array, rowIndex, colIndex):\n if rowIndex >= len(array) or rowIndex < -len(array) or colIndex >= len(array[0]) or colIndex < -len(array[0]):\n print(\"Row or Column indexes should be inbounds and non-negative integers\") \n else:\n print(array[rowIndex, colIndex])", "def in...
[ "0.7445301", "0.648488", "0.63814557", "0.62928915", "0.6151316", "0.6097332", "0.6097332", "0.6046923", "0.6006376", "0.5993538", "0.5974119", "0.5961812", "0.5900841", "0.5868299", "0.58438253", "0.58438253", "0.58438253", "0.58399624", "0.5809277", "0.5809277", "0.5809277"...
0.6265784
4
Calculate bounding box area.
def calculate_area(boxes): box_dimension = len(boxes.size()) if (box_dimension == 1) and (boxes.size()[0] != 0): return (boxes[3] - boxes[1] + 1) * (boxes[2] - boxes[0] + 1) elif box_dimension == 2: return (boxes[:, 3] - boxes[:, 1] + 1) * (boxes[:, 2] - boxes[:, 0] + 1) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boundingBoxArea(box):\n return (box[2] - box[0] + 1) * (box[3] - box[1] + 1)", "def area(self):\n\n bbox = self.bbox\n area = Box.calculate_bbox_area(bbox, bbox_type=self.bbox_type)\n\n return area", "def calculate_bbox_area(bbox: BoxType, rows: int, cols: int) -> float:\n bbox =...
[ "0.82467574", "0.793365", "0.76745176", "0.7565954", "0.74977326", "0.7381083", "0.7376788", "0.7368351", "0.7349708", "0.7304306", "0.7263144", "0.7247266", "0.723708", "0.72289276", "0.71907777", "0.7182651", "0.7166268", "0.7131188", "0.7131188", "0.7131188", "0.7092721", ...
0.0
-1
normed_signal, mean_vector, std_vector = normalizeData(pre_signal) This function normalizes the input signal to have 0 mean and unit variance in time.
def normalizeData(pre_signal): if sp.any(sp.isnan(pre_signal)): print('there are NaNs in the data matrix, making them zero') pre_signal[sp.isnan(pre_signal)] = 0 mean_vector = sp.mean(pre_signal, axis=0, keepdims=True) normed_signal = pre_signal - mean_vector norm_vector = sp.linalg.norm(n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_data(data):\n mean = np.mean(data)\n std = np.std(data)\n return (data - mean) / std", "def normalize_data(x):\n mvec = x.mean(0)\n stdvec = x.std(axis=0)\n \n return (x - mvec)/stdvec", "def normalize_data(x):\n mvec = x.mean(0)\n stdvec = x.std(axis=0)\n \n retu...
[ "0.7299704", "0.70743275", "0.70743275", "0.7074298", "0.70444036", "0.68663794", "0.68628997", "0.68503845", "0.6804495", "0.6799605", "0.6710128", "0.65232193", "0.6518967", "0.647076", "0.6431507", "0.6429846", "0.64105284", "0.6399329", "0.63988125", "0.6396571", "0.63769...
0.87347925
0
Time of expiration for this note, null if note does not expire.
def expiration_time(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "expiration_time")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expiration(self) -> Optional[str]:\n return pulumi.get(self, \"expiration\")", "def expiration_time(self) -> str:\n return pulumi.get(self, \"expiration_time\")", "def expiration(self) -> typing.Optional[aws_cdk.core.Duration]:\n return self._values.get('expiration')", "def expire_ti...
[ "0.78993475", "0.7882641", "0.761953", "0.7589484", "0.7589484", "0.75718683", "0.75205386", "0.74743223", "0.74743223", "0.74743223", "0.7222923", "0.7222923", "0.7216654", "0.71346754", "0.7063434", "0.7056749", "0.7056749", "0.7052704", "0.70352757", "0.7018079", "0.701711...
0.7931551
0
The ID to use for this note.
def note_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "note_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def note_id(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"note_id\")", "def id(self) -> str:\n return self._id", "def id(self) -> str:\n return self._id", "def id(self) -> str:\n return self._id", "def id(self) -> str:\n return self._id", "def id(se...
[ "0.817861", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8158207", "0.8151378", "0.80691016", "0.80691016", "0.80691016", "0.80691016", "0.80691016",...
0.0
-1
The time this note was created. This field can be used as a filter in list requests.
def create_time(self) -> pulumi.Output[str]: return pulumi.get(self, "create_time")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_created(self) -> str:\n return pulumi.get(self, \"time_created\")", "def time_created(self) -> str:\n return pulumi.get(self, \"time_created\")", "def time_created(self) -> str:\n return pulumi.get(self, \"time_created\")", "def created_date_time(self) -> str:\n return pu...
[ "0.8111156", "0.8111156", "0.8111156", "0.7959081", "0.7683159", "0.7653789", "0.7653789", "0.7653789", "0.75779146", "0.75779146", "0.75779146", "0.75779146", "0.75712425", "0.7549877", "0.7506502", "0.7506502", "0.74739736", "0.74739736", "0.7452787", "0.7443181", "0.744318...
0.0
-1
Time of expiration for this note, null if note does not expire.
def expiration_time(self) -> pulumi.Output[str]: return pulumi.get(self, "expiration_time")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expiration_time(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"expiration_time\")", "def expiration(self) -> Optional[str]:\n return pulumi.get(self, \"expiration\")", "def expiration_time(self) -> str:\n return pulumi.get(self, \"expiration_time\")", "def expirati...
[ "0.7931551", "0.78993475", "0.7882641", "0.761953", "0.7589484", "0.7589484", "0.75718683", "0.74743223", "0.74743223", "0.74743223", "0.7222923", "0.7222923", "0.7216654", "0.71346754", "0.7063434", "0.7056749", "0.7056749", "0.7052704", "0.70352757", "0.7018079", "0.7017116...
0.75205386
7
The ID to use for this note.
def note_id(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "note_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def id(self) -> str:\n return self._id", "def id(self) -> str:\n return self._id", "def id(self) -> str:\n return self._id", "def id(self) -> str:\n return self._id", "def id(self) -> str:\n return self._id", "def id(self) -> str:\n return self._id", "def id(se...
[ "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8164871", "0.8158207", "0.8151378", "0.80691016", "0.80691016", "0.80691016", "0.80691016", "0.80691016", "0.80691016...
0.817861
0
converts s to an ascii string.
def unicode_to_ascii(s): ret = "" for ch in s: try: ach = str(ch) ret += ach except UnicodeEncodeError: ret += "?" return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_ascii(s):\n return s.encode('ascii', 'ignore')", "def unicodeToAscii(s):\n return ''.join(\n c for c in unicodedata.normalize('NFD', s)\n if unicodedata.category(c) != 'Mn'\n )", "def toAscii(s):\n return ''.join(\n char for char in unicodedata.normalize('NFD', s)\n ...
[ "0.8091793", "0.695995", "0.6894513", "0.6832518", "0.6789037", "0.67645764", "0.6749313", "0.6736834", "0.6734628", "0.67288494", "0.6715481", "0.671264", "0.6681636", "0.6510723", "0.6499805", "0.64977026", "0.64770466", "0.6474702", "0.6455083", "0.64302224", "0.640141", ...
0.7400869
1
Boolean NumPy array indicating if each value is missing. This should return a 1D array the same length as 'self'.
def isna(self): # type: () -> np.ndarray return extract_isnull_bytemap(self.data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isna(self):\n size = len(self.data)\n isnull_byte_map = np.zeros(size, dtype=bool)\n for i in range(size):\n if self.data[i] is None:\n isnull_byte_map[i] = 1\n\n return isnull_byte_map", "def data_missing():\n return RaggedArray([[], [-1, 0, 1]], dtyp...
[ "0.6850077", "0.67556345", "0.6569893", "0.6546181", "0.6491107", "0.6447204", "0.6447123", "0.64311326", "0.64211506", "0.63759524", "0.6362549", "0.6333199", "0.63118434", "0.6284051", "0.62827754", "0.62480575", "0.6235529", "0.6202338", "0.6197556", "0.6165229", "0.614100...
0.74016553
0
The number of bytes needed to store this object in memory.
def nbytes(self): # type: () -> int size = 0 for chunk in self.data.chunks: for buf in chunk.buffers(): size += buf.size return size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSize(self) -> int:\n return len(self.mem)", "def getSize(self):\n return self.bf.memory()", "def size(self):\n size = 0\n size += self.data.size * sys.getsizeof(self.data)\n return size / 1024.0 / 1024.0 / 1024.0", "def __len__(self):\n return len(self.memory)...
[ "0.820752", "0.8010133", "0.7932737", "0.789989", "0.789989", "0.789989", "0.789989", "0.789989", "0.789989", "0.789989", "0.789989", "0.789989", "0.789989", "0.789989", "0.789989", "0.789989", "0.789989", "0.789989", "0.789989", "0.789989", "0.789989", "0.789989", "0.789...
0.0
-1
Cast to a NumPy array with 'dtype'.
def astype(self, dtype, copy=True): if isinstance(dtype, pa.DataType): raise NotImplementedError("Cast propagation in astype not yet implemented") else: dtype = np.dtype(dtype) return np.asarray(self).astype(dtype)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def asarray(val, dtype=np.float64):\n # val is a list, tuple etc\n if not np.isscalar(val) and np.ndim(val) > 0:\n np_val = np.asarray(val, dtype=dtype)\n else:\n # val is a scalar number\n np_val = np.asarray([val], dtype=dtype)\n\n return np_val", "def _to_numpy_ndarray(cls, da...
[ "0.7329888", "0.70835435", "0.7066227", "0.70650464", "0.6984045", "0.6961744", "0.6949394", "0.6946292", "0.69244313", "0.6881979", "0.68546593", "0.683145", "0.68048763", "0.67890763", "0.67437947", "0.6719441", "0.66922414", "0.6659825", "0.6624919", "0.6611641", "0.658611...
0.6620474
19
Construct a new ExtensionArray from a sequence of scalars.
def _from_sequence(cls, scalars): return cls(pa.array(scalars))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _from_sequence(cls, scalars):\n return cls(xnd.xnd(list(scalars)))", "def _from_sequence(cls, scalars, dtype=None, copy=None):\n if isinstance(scalars, FletcherArray):\n return scalars\n if dtype and isinstance(dtype, FletcherDtype):\n dtype = dtype.arrow_dtype\n ...
[ "0.7438445", "0.7182404", "0.5925194", "0.578319", "0.561165", "0.5573342", "0.55363554", "0.549628", "0.54935765", "0.54918486", "0.5459624", "0.54315454", "0.5349382", "0.5279878", "0.5261748", "0.5165157", "0.51567626", "0.5156627", "0.5146947", "0.5140071", "0.5140071", ...
0.7350238
1
Check does index of resources app return 200 HTTP response.
def test_resources_index_200(self): url = reverse("resources:index") response = self.client.get(url) self.assertEqual(response.status_code, 200)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_index_availability(client):\n response = client.get('/')\n assert response.status_code == 200", "def index_exists(self, index):\n req = requests.head(\n urljoin(self.base_url, '{0}'.format(index)),\n verify=self.verify_certs)\n return req.status_code == 200", ...
[ "0.72738713", "0.6970286", "0.668796", "0.6652207", "0.6646305", "0.6634812", "0.66079015", "0.65830284", "0.6575959", "0.6563295", "0.6541338", "0.65398186", "0.6509976", "0.64713293", "0.64642155", "0.6433188", "0.63695234", "0.6333116", "0.6326806", "0.6320335", "0.6309373...
0.77148545
0
Check does site return code 404 when trying to visit invalid resource list.
def test_invalid_resource_list_404(self): url = reverse("resources:resources", ("invalid",)) response = self.client.get(url) self.assertEqual(response.status_code, 404)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_request_invalid_resource(self):\n response = requests.get(self.url + '/invalid')\n\n self.assertEqual(response.status_code, 404)", "def test_404(self):\n for path in ('/foo', '/abs', '/abs/'):\n response = self.client.get(path)\n self.assertEqual(response.statu...
[ "0.71154463", "0.708275", "0.7051031", "0.6933595", "0.6917241", "0.68890256", "0.6866429", "0.6765221", "0.6718684", "0.67110914", "0.6692023", "0.6660242", "0.6643901", "0.66393906", "0.6638997", "0.6591892", "0.65915734", "0.65869635", "0.6585858", "0.6579115", "0.6558905"...
0.7628783
0
blur image using gaussian convolution
def blur_spatial(im, kernel_size): im = im.astype(np.float64) return conv(im, gaussian_kernel_factory(kernel_size), mode='same')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __gaussian_blur(self, img, kernel_size=3):\n return cv2.GaussianBlur(img, (kernel_size, kernel_size), 0)", "def gaussian_blur(self,img):\n return cv2.GaussianBlur(img, (self.kernel_size, self.kernel_size), 0)", "def blur_image(im, n, ny=None) :\n g = gauss_kern(n, sizey=ny)\n improc = s...
[ "0.79372406", "0.7826343", "0.77874625", "0.77774185", "0.77615887", "0.77392876", "0.7738375", "0.772649", "0.76925623", "0.76925623", "0.76925623", "0.76925623", "0.76925623", "0.76925623", "0.76925623", "0.76925623", "0.76925623", "0.76925623", "0.76925623", "0.76925623", ...
0.73612374
34
Rescale `image` to `target_height` (preserving aspect ratio).
def rescale_by_height(image, target_height, method=cv2.INTER_LANCZOS4): w = int(round(target_height * image.shape[1] / image.shape[0])) return cv2.resize(image, (w, target_height), interpolation=method)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __scale_width_height(img, target_width=None, target_height=None, method=Image.BICUBIC):\n if target_height > 0 and target_width:\n raise ValueError(\n f\"Expected target_width>0 and target_height>0, but got target_width={target_width}, target_height={target_height}\")\n\n ow, oh = img.s...
[ "0.78812975", "0.72038126", "0.70217365", "0.66117895", "0.64457595", "0.63975304", "0.6356515", "0.6355663", "0.6280903", "0.6154969", "0.613986", "0.60753644", "0.6067537", "0.6066633", "0.6060095", "0.5991744", "0.5970474", "0.59211516", "0.58914167", "0.5890337", "0.58815...
0.8288602
0
Get the current active preset.
def get_current_preset(self): if self._legacy_anna: active_rule = self._domain_objects.find("rule[active='true']/directives/when/then") if active_rule is None or "icon" not in active_rule.keys(): return "none" return active_rule.attrib["icon"] log_typ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preset_mode(self) -> str | None:\n state = self._state\n return state.custom_preset or _PRESETS.from_esphome(\n state.preset_compat(self._api_version)\n )", "def info(self):\n return self._presets._cache[self._preset_type][self._name]", "def preset_mode(self):\n ...
[ "0.72490466", "0.7045389", "0.7018352", "0.6948201", "0.6693056", "0.6692988", "0.66542315", "0.6628865", "0.6556297", "0.6556297", "0.63985157", "0.6372818", "0.6372818", "0.6249961", "0.61309326", "0.6109411", "0.6099695", "0.6076975", "0.5980142", "0.595595", "0.58907527",...
0.7438793
0
Return the name of the entity.
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entity_name(self):\n return self.__entity_name", "def entity_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"entity_name\")", "def entity_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"entity_name\")", "def name(self):\n return \"{} {}\".format(self....
[ "0.8988398", "0.83023036", "0.83023036", "0.7979217", "0.7969564", "0.75555485", "0.7543831", "0.7536042", "0.7536042", "0.7536042", "0.75337434", "0.75239676", "0.7496596", "0.74891084", "0.74777347", "0.74761146", "0.7462404", "0.74502766", "0.74502766", "0.74502766", "0.74...
0.0
-1
Return the unit of measurement which this thermostat uses.
def temperature_unit(self): return TEMP_CELSIUS
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unit_of_measurement(self):\n return self.device.unit()", "def unit_of_measurement(self):\n return self._tasmota_entity.unit", "def unit_of_measurement(self):\n return self._sensor.unit", "def unit_of_measurement(self):\n return self._unit", "def unit_of_measurement(self):\n ...
[ "0.8882052", "0.8808171", "0.8807122", "0.87728804", "0.87728804", "0.87728804", "0.87728804", "0.87728804", "0.87728804", "0.87728804", "0.87664086", "0.8742088", "0.8737724", "0.87244856", "0.87022597", "0.87022597", "0.87022597", "0.87022597", "0.87022597", "0.87022597", "...
0.0
-1
Store current user's ID in session.
def store_userid(request_handler, userid): session = sessions.LilCookies(request_handler, SESSION_SECRET) session.set_secure_cookie(name='userid', value=userid)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_current_user(self, user):\n self.session['u'] = user.get().key.urlsafe()", "def do_login(user):\n session[CURRENT_USER_KEY] = user.id", "def set_su_user(self, su_user):\n self.request.session[AUTH_SESSION_KEY] = su_user.id\n self.request.session[AUTH_HASH_SESSION_KEY] = su_user....
[ "0.7535258", "0.7267987", "0.66803646", "0.6646086", "0.66278434", "0.6621015", "0.6528507", "0.6519431", "0.64994454", "0.64678365", "0.64678365", "0.6461256", "0.6461256", "0.6445929", "0.6378854", "0.6341821", "0.6326915", "0.6298172", "0.6290298", "0.6255948", "0.620635",...
0.71583265
2
Get user by id
def get_user_by_id(user_id): return User.query.get(user_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_by_id(self, id):\n\t\treturn self.users.get(id)", "def get_user(id):\n pass", "def get(id):\n return User.query.filter_by(id=id).first()", "def getUser(self, id : int) -> bbUser.bbUser:\n id = self.validateID(id)\n return self.users[id]", "def get_single_user(self, id):...
[ "0.8873811", "0.88707125", "0.87658477", "0.8525675", "0.85058427", "0.84312195", "0.84294516", "0.8414046", "0.84003544", "0.839886", "0.83409226", "0.8265451", "0.826507", "0.82554895", "0.8248595", "0.8222798", "0.8222798", "0.8222798", "0.8222798", "0.8204112", "0.8201288...
0.79460305
48
Get collecton namespace from filename.
def _get_namespace(self, data): ns_name = data['filename'].namespace try: return models.Namespace.objects.get(name=ns_name) except models.Namespace.DoesNotExist: raise exceptions.ValidationError( f'Namespace "{ns_name}" does not exist.' )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _namespace(self) -> str:\n with open(\"/var/run/secrets/kubernetes.io/serviceaccount/namespace\", \"r\") as f:\n return f.read().strip()", "def _get_workload_namespace(self):\n namespace_yaml_file = os.path.join(\n os.path.join(self.workload_subscription_dir, self.workload...
[ "0.65730023", "0.6207105", "0.61400026", "0.6073205", "0.60298467", "0.59602493", "0.59422034", "0.59422034", "0.59422034", "0.5902041", "0.58347476", "0.58164614", "0.58164614", "0.58164614", "0.58164614", "0.58164614", "0.5804809", "0.5788488", "0.5745208", "0.57111806", "0...
0.61116165
3
Validate that collection namespace exists and user owns it.
def _check_namespace_access(self, namespace, user): if not namespace.owners.filter(id=user.id).count(): raise exceptions.PermissionDenied( 'The namespace listed on your filename must match one of ' 'the namespaces you have access to.' )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate(self, namespace):\n pass", "def test_delete_collection_namespaced_role_binding_restriction(self):\n pass", "def test_delete_collection_namespaced_policy(self):\n pass", "def test_delete_collection_net_namespace(self):\n pass", "def collection_exist(database_name, co...
[ "0.5746347", "0.5734805", "0.56959134", "0.55029625", "0.5495402", "0.5449234", "0.5447561", "0.54412967", "0.54309994", "0.53920805", "0.53876394", "0.5371888", "0.53027713", "0.52889574", "0.52657646", "0.5264224", "0.525469", "0.52472353", "0.52441555", "0.52420026", "0.52...
0.6930293
0
Return google playstore apps top 10
def top_apps_data(): # Query for the top 10 apps data results = db.session.query(Appsdata.App_Name, Appsdata.Installs).\ order_by(Appsdata.Installs.desc()).\ limit(20).all() # Create lists from the query results apps_category = [result[0] for result in results] apps_installs = [res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_top_respects_limit(self):\r\n\r\n ranked_3_app = self.create_app_with_contributors(8, 0, name='three')\r\n ranked_2_app = self.create_app_with_contributors(9, 0, name='two')\r\n ranked_1_app = self.create_app_with_contributors(10, 0, name='one')\r\n ranked_4_app = self.crea...
[ "0.7371017", "0.7289569", "0.72751933", "0.6978363", "0.64330024", "0.6308566", "0.62502825", "0.6216118", "0.6058482", "0.60377336", "0.5976765", "0.59495586", "0.59164804", "0.5902653", "0.58923566", "0.5884292", "0.5860498", "0.585445", "0.5851808", "0.5847178", "0.5791033...
0.61506945
8
Return google playstore apps top 10
def Mydata(): stmt = db.session.query(Appsdata).statement df = pd.read_sql_query(stmt, db.session.bind) return jsonify(df.to_dict())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_top_respects_limit(self):\r\n\r\n ranked_3_app = self.create_app_with_contributors(8, 0, name='three')\r\n ranked_2_app = self.create_app_with_contributors(9, 0, name='two')\r\n ranked_1_app = self.create_app_with_contributors(10, 0, name='one')\r\n ranked_4_app = self.crea...
[ "0.7371017", "0.7289569", "0.72751933", "0.6978363", "0.64330024", "0.6308566", "0.62502825", "0.6216118", "0.61506945", "0.6058482", "0.60377336", "0.5976765", "0.59495586", "0.59164804", "0.5902653", "0.58923566", "0.5884292", "0.5860498", "0.585445", "0.5851808", "0.584717...
0.0
-1
Creates a column of bool values indicating whether the specified scalar is an element of each row of a list column.
def contains(self, search_key): return self.d_series.map_partitions( lambda s: s.list.contains(search_key), meta=self.d_series._meta )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def column_values_in_list(col, test_list):\n test = np.array([c_i in test_list for c_i in col])\n return test", "def can_convert_to_column(obj):\n return is_column_like(obj) or cudf.api.types.is_list_like(obj)", "def create(df,column,list_):\n return df[df[column].isin(list_)]", "def getBooleanRo...
[ "0.64463156", "0.6340901", "0.5734575", "0.5637982", "0.56370497", "0.56256264", "0.5600938", "0.5531927", "0.5486252", "0.5472898", "0.5455312", "0.5369859", "0.5362351", "0.5355599", "0.53455114", "0.53367394", "0.53343236", "0.53226924", "0.53077024", "0.52918816", "0.5195...
0.0
-1
Return a string representation of the model.
def __str__(self): if len(self.title) > 50: return self.title[:50] + "..." else: return self.title
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __repr__(self):\n\n mod = f\"{self.__class__.__name__} Model\"\n try:\n mod += f': {self.filename}'\n except AttributeError:\n pass\n s = [mod]\n for name, v in self.metadat...
[ "0.8550562", "0.78680784", "0.7859392", "0.7820475", "0.78200865", "0.78200865", "0.78024864", "0.7667491", "0.7658678", "0.7652298", "0.7619285", "0.75894105", "0.7587887", "0.7541158", "0.75327915", "0.75327915", "0.75173604", "0.7495425", "0.7490489", "0.7479993", "0.74670...
0.0
-1
Constructs a URL for bitbucket API request.
def make_req_url(user, repo, endpoint, limit=50, queries=None): url = "%s%s/%s/%s" % (API_BASE_URL, user, repo, endpoint) # Set limit is given and is above 50, set limit to 50 if limit and limit > 50: limit = 50 url += "?limit=%d" % limit # Add additional query parameters if queries: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_bitbucket_homepage_url(purl):\n purl_data = PackageURL.from_string(purl)\n\n namespace = purl_data.namespace\n name = purl_data.name\n version = purl_data.version\n subpath = purl_data.subpath\n\n if not (name and namespace):\n return\n\n url = \"https://bitbucket.org/{namespa...
[ "0.68552774", "0.6723735", "0.66490626", "0.6549541", "0.6485875", "0.64827955", "0.63807005", "0.63767195", "0.6295841", "0.6295841", "0.62101465", "0.6108978", "0.61024505", "0.60679156", "0.6066768", "0.60302556", "0.6012335", "0.5985781", "0.5979421", "0.59731793", "0.596...
0.6030733
15
Formats a string timestamp to unix seconds. Multiplies by 1000 to use for d3.
def to_unix_time(timestamp): date = datetime.strptime(timestamp, '%Y-%m-%d %H:%M:%S') return int(time.mktime(date.timetuple()))*1000
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timestamp_to_unix(timestamp):\n return timestamp / 1e6", "def timestamp2sec(timestamp):\n return (int(timestamp.seconds) + 60 * int(timestamp.minutes) + 3600 * int(timestamp.hours) + float(int(timestamp.hours) / 1000))", "def unixtimestampformat(value):\n if value is None:\n return 0\n r...
[ "0.72137684", "0.71686846", "0.69934666", "0.695778", "0.6884862", "0.68592936", "0.68185765", "0.6734586", "0.6703311", "0.6698969", "0.66856885", "0.66797775", "0.6652661", "0.66508466", "0.66430736", "0.6636285", "0.6607928", "0.6459986", "0.64391804", "0.6408088", "0.6403...
0.7142641
2
Formats string timestamp into readable timestamp.
def format_timestamp(timestamp): try: date = datetime.strptime(timestamp, '%Y-%m-%d %H:%M:%S+00:00') return datetime.strftime(date, '%m-%d-%Y') except ValueError: return ''
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _format_ts(cls, timestamp):\n return localtime(timestamp).strftime('%Y-%m-%d %H:%M:%S')", "def formatTimestamp(self, timestamp):\n return time.strftime('%Y%m%d-%H%M%S-%Z', time.localtime(timestamp))", "def _convert_timestamp(timestamp):\n extract_time = re.match('(.*?\\+\\d{2}):(.*)', ...
[ "0.8094808", "0.7867094", "0.777266", "0.7534979", "0.7532737", "0.74837834", "0.73228455", "0.7300863", "0.72731143", "0.72643644", "0.72627556", "0.72627556", "0.72627556", "0.72592324", "0.7256392", "0.72433543", "0.72167665", "0.72160774", "0.7205962", "0.7194395", "0.719...
0.80276537
1
Returns True if entire stack is Happyside up, False otherwise.
def _is_happy(cake_stack): if re.search('^\++$', cake_stack) is not None: return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_up(self):\n \n return self.is_level('up')", "def is_stack(self) -> bool:\n return self.layers > 1", "def isUp ( self ) :\n return not self.isDown()", "def canStack(bottom, top):\n bw, bh, bd = bottom\n tw, th, td = top\n return (bw < tw) and (bh < th) and (bd...
[ "0.73744804", "0.6984128", "0.6749618", "0.6676538", "0.66535634", "0.66137004", "0.6577565", "0.6523728", "0.6520193", "0.65013826", "0.65007114", "0.6480169", "0.64759386", "0.64759386", "0.6475886", "0.64710003", "0.64510065", "0.64498603", "0.6445655", "0.64325106", "0.64...
0.0
-1
Returns True if entire stack is sadside up, False otherwise.
def _is_sad(cake_stack): if re.search('^\-+$', cake_stack) is not None: return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_up(self):\n \n return self.is_level('up')", "def _move_up(self) -> bool:\n current_agent_node = self._maze.get_player_node()\n\n if current_agent_node.y == 0:\n # Can't go up. Already on the top row\n return False\n else:\n next_node = se...
[ "0.6879942", "0.66934794", "0.6642897", "0.6641125", "0.6575446", "0.65405107", "0.64417815", "0.6407971", "0.6365742", "0.6356544", "0.6269877", "0.62565356", "0.6238966", "0.6213111", "0.62068194", "0.6205499", "0.61929125", "0.6181834", "0.61652625", "0.6164037", "0.61579"...
0.5720905
91
Computes the center coordinates, height and width of the boxes.
def _get_center_coordinates_and_sizes_vector(box_data): ymin, xmin, ymax, xmax = [np.squeeze(i) for i in np.split(box_data, 4, 0)] width = np.subtract(xmax, xmin) height = np.subtract(ymax, ymin) ycenter = np.add(ymin, np.multiply(height, 0.5)) xcenter = np.add(xmin, np.multiply(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def center_size(boxes):\n concat = P.Concat(1)\n return concat(((boxes[:, 2:] + boxes[:, :2])/2, # cx, cy\n boxes[:, 2:] - boxes[:, :2])) # w, h", "def to_center_form(boxes):\n x_min, y_min = boxes[:, 0], boxes[:, 1]\n x_max, y_max = boxes[:, 2], boxes[:, 3]\n center_x = (x_...
[ "0.8181619", "0.78217334", "0.77983093", "0.7340917", "0.73163414", "0.72916836", "0.7262907", "0.7225552", "0.72027326", "0.7141095", "0.7116679", "0.71099013", "0.7100282", "0.70382655", "0.7007625", "0.7001866", "0.69998944", "0.69948024", "0.6992905", "0.69882375", "0.697...
0.8388918
0
Add a directed, weighted edge to the graph.
def add_edge(self, n1, n2, weight): self.edges[n1.identifier][n2.identifier] = weight
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_edge(self, edge):\n src = edge.get_source()\n dest = edge.get_destination()\n #weightEdge = WeightedEdge(src, dest, edge.get_total_distance(), edge.get_outdoor_distance())\n if not (src in self.edges and dest in self.edges):\n raise ValueError('Node not in graph')\n ...
[ "0.80600375", "0.77537435", "0.7562768", "0.7436069", "0.7381982", "0.7301415", "0.7270415", "0.7238664", "0.7225621", "0.72053915", "0.71684504", "0.7152811", "0.7101876", "0.70712245", "0.7070308", "0.70663655", "0.70411754", "0.699321", "0.6968447", "0.6958962", "0.6933748...
0.74825466
3
Add a directed, weighted edge to the graph.
def add_edge(self, n1, n2, weight): self.edges[n1.identifier][n2.identifier] = weight self.edges[n2.identifier][n1.identifier] = weight
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_edge(self, edge):\n src = edge.get_source()\n dest = edge.get_destination()\n #weightEdge = WeightedEdge(src, dest, edge.get_total_distance(), edge.get_outdoor_distance())\n if not (src in self.edges and dest in self.edges):\n raise ValueError('Node not in graph')\n ...
[ "0.80600375", "0.77537435", "0.7562768", "0.74825466", "0.7436069", "0.7301415", "0.7270415", "0.7238664", "0.7225621", "0.72053915", "0.71684504", "0.7152811", "0.7101876", "0.70712245", "0.7070308", "0.70663655", "0.70411754", "0.699321", "0.6968447", "0.6958962", "0.693374...
0.7381982
5
Get path to the 'bin' folder containing client scripts.
def bin_path(self) -> Path: return self._root_path / "stefan-on-software-api-client" / "bin"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bin_dir():\n return os.path.abspath(os.path.join(get_root_dir(), 'bin/'))", "def scripts_dir(self):\n\n return os.path.join(self.path, 'Scripts' if sys.platform == 'win32'\n else 'bin')", "def dir_bin():\n return abspath('bin')", "def binpath(self):\n return self._q...
[ "0.7861047", "0.77185035", "0.74838704", "0.7435793", "0.73328435", "0.71137536", "0.69853413", "0.6896903", "0.6891927", "0.6757543", "0.6747356", "0.65953153", "0.6557901", "0.65492225", "0.65478766", "0.6545954", "0.6423327", "0.64141256", "0.63964826", "0.6396303", "0.638...
0.8066899
0
Initializes the flask instance and registers a test user. Yields the environment variables to use when running the server.
def sos_init() -> Dict: # Set environment variables for test server instance. env = os.environ.copy() env["FLASK_APP"] = "stefan-on-software/stefan_on_software" env["SECRET_KEY"] = "1234" env["INSTANCE_PATH"] = str(INSTANCE_PATH) env["STATIC_PATH"] = str(STATIC_PATH) os.makedirs(SITE_PATH, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _setup_app_context_for_test():\n ctx = application.app_context()\n ctx.push()\n yield # tests will run here\n ctx.pop()", "def setUp(self):\n self.user = {\n \"Email\": \"user@example.com\",\n \"Password\": \"pass1234\",\n \"Confirm Password\": \"pass1234\...
[ "0.6676394", "0.6628038", "0.66275203", "0.6548167", "0.6533487", "0.64805764", "0.6469744", "0.63168925", "0.6306484", "0.62621593", "0.62621593", "0.6261502", "0.62549764", "0.62396365", "0.6232949", "0.62329406", "0.6222643", "0.6201132", "0.619346", "0.619121", "0.6122347...
0.7203723
0
Gets a collection of `InputExample`s for the train set.
def get_train_examples(self, data_dir): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_train_inputs(self, example):\n return example", "def get_train_examples(self):\n raise NotImplementedError()", "def get_train_examples(self, input_file):\r\n raise NotImplementedError()", "def _create_examples(self, data, set_type):\n examples = []\n for (i, elem) in en...
[ "0.73499966", "0.7173421", "0.7126833", "0.65602446", "0.64204013", "0.64052176", "0.63422555", "0.6290186", "0.6282746", "0.625262", "0.62499267", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0...
0.6205607
33
Gets a collection of `InputExample`s for the dev set.
def get_dev_examples(self, data_dir): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dev_examples(self, input_file):\r\n raise NotImplementedError()", "def get_train_inputs(self, example):\n return example", "def get_examples(self, env):\n return self.fam.c_get_examples(self, env)", "def get_dev_examples(self):\n raise NotImplementedError()", "def _create_ex...
[ "0.68112403", "0.6588688", "0.655683", "0.6552607", "0.64272827", "0.63816285", "0.6255956", "0.61930686", "0.61160946", "0.6094262", "0.6054992", "0.6051947", "0.5994604", "0.5994604", "0.5994604", "0.5994604", "0.5994604", "0.5994604", "0.5994604", "0.5994604", "0.5994604",...
0.59155166
35
Find and return the last line in the file. Very efficient implementation should be blazing fast even for large files.
def last_line(filename): if not os.path.exists(filename): return None try: with open(filename, 'rb') as f: f.seek(-2, os.SEEK_END) while f.read(1) != b"\n": f.seek(-2, os.SEEK_CUR) last = f.readline() return last except OSErro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getLastLine(f, blockSize=3072): \n \n f.seek(0,os.SEEK_END) \n \n totalBytes = f.tell() \n \n if totalBytes > blockSize: \n f.seek(-blockSize,os.SEEK_END) \n else: \n f.seek(0) \n \n lastLines = f.readlines() \n lastLine = lastLines[-1] \n \n if lastLine ==...
[ "0.78585136", "0.72345024", "0.69515103", "0.69332343", "0.6709338", "0.6698495", "0.6528971", "0.648674", "0.6432516", "0.6354311", "0.6255661", "0.6166875", "0.6156475", "0.6149225", "0.61421543", "0.61103934", "0.60424393", "0.6041933", "0.60354185", "0.6025056", "0.601368...
0.7991741
0
Converts dictionaries to tuples
def calcQ(self,thisObs,next_action,reward): thisObs_tup=(thisObs['volume'],thisObs['time']) lastAction_tup=(self.lastAction['vol'],self.lastAction['price']) lastObs_tup=(self.lastObs['volume'],self.lastObs['time']) lastQvalue=0 maxQvalue=0 temp_action=() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _tupleize(d):\n return [(key, value) for key, value in d.items()]", "def dictToTuple(dic):\n tup = []\n for i in range(len(dic)):\n tup.append(dic[i].items())\n return tup", "def dict2tuple(d):\n items = list(d.items())\n items.sort()\n return tuple(items)", "def convert_dict_...
[ "0.80607337", "0.77538645", "0.7666249", "0.76334375", "0.7499756", "0.7271311", "0.7164227", "0.6865281", "0.68153495", "0.68153495", "0.68008494", "0.64133936", "0.6411619", "0.6351038", "0.6289746", "0.62817985", "0.62653655", "0.62633634", "0.6213277", "0.62071395", "0.61...
0.0
-1
Checks if the given object is a lazy string.
def is_lazy_string(obj): return isinstance(obj, LazyString)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_string(obj):\n return isinstance(obj, basestring)", "def is_string(obj):\n return isinstance(obj, str)", "def _is_string(self, obj):\n return isinstance(obj, unicode) or isinstance(obj, str)", "def typeIsString(obj):\n return type(obj) is str or _haveTypeUnicode and type(ob...
[ "0.6758086", "0.6730051", "0.6486579", "0.6435007", "0.6284648", "0.6258783", "0.61483413", "0.60494864", "0.6023831", "0.5980879", "0.5932129", "0.5927949", "0.58245593", "0.575508", "0.573714", "0.5730373", "0.572542", "0.5716102", "0.57060474", "0.570094", "0.5698507", "...
0.91621214
0
Generate a color from the RGB values provided, which should range from 0 to 1.
def __init__(self, r,g,b): self.__r = r; self.__g = g; self.__b = b
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fromInts(r, g, b):\n return IColor(r/255.,g/255.,b/255.)", "def create_color():\n r = random.randint(0,255)\n g = random.randint(0,255)\n b = random.randint(0,255)\n a = random.randint(0,255)\n return introcs.RGB(r,g,b,a)", "def convert_to_RGB_255(colors):\n return (colors[0]*255.0...
[ "0.7371176", "0.72336197", "0.7210157", "0.71852416", "0.7173573", "0.7083075", "0.7021475", "0.7008765", "0.7008765", "0.7008765", "0.6974776", "0.6973327", "0.69105786", "0.68947643", "0.68881625", "0.688794", "0.68777764", "0.68678087", "0.68630016", "0.68032795", "0.67858...
0.0
-1
Return a list containing the RGB triple.
def rgb(self): return [self.__r, self.__g, self.__b]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_rgb_light():\n return list(light.rgb())", "def rgb(self):\n return (self.red, self.green, self.blue)", "def get_color_list(self):\n lst = []\n\n _lib.caca_get_dither_color_list.argtypes = [_Dither]\n _lib.caca_get_dither_color_list.restype = ctypes.POINTER(ctypes.c_c...
[ "0.7424071", "0.72442627", "0.7167121", "0.6984936", "0.6944663", "0.69387996", "0.69311035", "0.69211316", "0.68288153", "0.6698281", "0.66825795", "0.666629", "0.66555774", "0.65699637", "0.64485145", "0.6424471", "0.6418802", "0.64073324", "0.6383848", "0.6335368", "0.6308...
0.7535129
0
Test that messages aren't queued twice.
def test_previously_sent_message_not_sent_twice(self): thread = self.create_thread() message = thread.first_message message.sent = True message.save() send_message(message.pk) self.assertFalse(self.groupnotify_mock.called)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testSendNextMessage(self):\n self.mgr.isGoproBusy = True\n self.mgr.lastRequestSent = monotonic.monotonic()\n self.mgr.queueMsg(3)\n self.mgr.queueMsg(2)\n self.mgr.queueMsg(1)\n self.mgr.processMsgQueue()\n self.v.send_mavlink.assert_called_with(3)\n sel...
[ "0.6772248", "0.66828936", "0.6674258", "0.6540074", "0.653473", "0.6413434", "0.64045256", "0.6376818", "0.6359126", "0.63423115", "0.62599653", "0.62573695", "0.6235738", "0.62240845", "0.6212027", "0.62092435", "0.61870193", "0.61729634", "0.6171722", "0.6166298", "0.61622...
0.748939
0
Sample the spheres radii according to the given probability density function.
def sample_r(self, method='rejection_numpy') -> None: if not self.inverse_transformation: sampler = getattr(SamplerMixin, method) samples = sampler(pdf=self.pdf, size=self.sample_size[0]) else: samples: np.ndarray = getattr(np.random, self.pdf)(size=self.sample_size, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_one_body_sampling(self):\n\n # Initialize the posistions for each new Monte Carlo run\n positions = np.random.rand(self.num_p, self.num_d)\n # Initialize the distance matrix\n self.s.positions_distances(positions)\n # check if the wave function is zero\n while True...
[ "0.6067963", "0.5982569", "0.5821388", "0.5803734", "0.57873887", "0.5784701", "0.5711391", "0.5686841", "0.5677031", "0.566365", "0.56389177", "0.5636704", "0.5635971", "0.5616158", "0.5586947", "0.55801725", "0.557665", "0.5564926", "0.5556865", "0.5556786", "0.55471456", ...
0.50886667
93
Handle GET requests for single order product
def retrieve(self, request, pk=None): try: order_product = Order_Products.objects.get(pk=pk) serializer = Order_Products_Serializer( order_product, context={'request': request} ) return Response(serializer.data) except Exception as ex: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def product_detail(request, id, format=None):\n try:\n product = Product.objects.get(id=id)\n except Product.DoesNotExist:\n return Response(status=status.HTTP_404_NOT_FOUND)\n\n if request.method == 'GET':\n serializer = ProductSerializer(product)\n return Response(serializer.data)\n\n elif reques...
[ "0.70400786", "0.6935842", "0.6913139", "0.672815", "0.66696715", "0.66109437", "0.65805334", "0.6521111", "0.6504174", "0.65033245", "0.6420699", "0.6383076", "0.6381775", "0.6368019", "0.63580143", "0.6303634", "0.6295557", "0.6286161", "0.6281971", "0.627214", "0.6263521",...
0.7688589
0
Handle GET requests to order product resource
def list(self, request): order_products = Order_Products.objects.all() order = self.request.query_params.get('order', None) product = self.request.query_params.get('product', None) payment = self.request.query_params.get('payment', None) if product is not None: orde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retrieve(self, request, pk=None):\n try:\n order_product = Order_Products.objects.get(pk=pk)\n serializer = Order_Products_Serializer(\n order_product, context={'request': request}\n )\n return Response(serializer.data)\n except Exception...
[ "0.76925373", "0.71017045", "0.69099003", "0.68806565", "0.6722549", "0.6722026", "0.67199177", "0.6658514", "0.6618539", "0.66093636", "0.6497469", "0.64909893", "0.64160717", "0.63950706", "0.63431656", "0.6329561", "0.6249482", "0.6240005", "0.6225927", "0.6187374", "0.617...
0.680109
4
Converts a string which SystemLink interprets as a timestamp
def to_datetime(datetime_string): if isinstance(datetime_string, datetime.datetime): return datetime_string if datetime_string.endswith('Z'): datetime_string = datetime_string[:-1] dot_index = datetime_string.find('.') if dot_index != -1: # datetime only stores to 6 decimal place...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode_timestamp(self, string):\n\n if isinstance(string, str):\n return datetime.strptime(string, self.timestamp_format)\n else:\n return string", "def to_timestamp(string):\n date_time_obj = datetime.strptime(string, '%Y-%m-%dT%H:%M:%S.%fZ')\n return date_time_obj....
[ "0.78206915", "0.77657545", "0.76794887", "0.74984324", "0.74168223", "0.73599774", "0.7245426", "0.72251976", "0.7198403", "0.6987626", "0.69810766", "0.6973629", "0.69693846", "0.6951782", "0.6880917", "0.68393743", "0.68103635", "0.6769517", "0.6764644", "0.6757482", "0.67...
0.0
-1
Retrieve the current absolute tilt and rotation angles of the device. Return a tuple (tilt, rot) containing the current state expressed in degrees by default.
def get_position(self, unit='degree'): print("GET POSITION") res = self._send_command( "RP;", fb_required=True, res_pattern="POS:" ) # The received answer is expected to be something like # POS:<float:tilt>,<float:rot> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAngles(self) -> tuple:\n return self.getHeading(), self.getPitch(), self.getRoll()", "def location_rotation(self) -> Tuple[CameraLocationType, CameraRotationType]:\n return self.location, self.rotation", "def tilts(self):\n return self.yaw, self.pitch, self.roll", "def get_angles(...
[ "0.7005419", "0.6638062", "0.6588847", "0.65219104", "0.6217407", "0.61805564", "0.61308897", "0.6066628", "0.6009543", "0.59506464", "0.5920086", "0.5909496", "0.59029615", "0.5872858", "0.5868212", "0.5837592", "0.5777059", "0.5763775", "0.57534814", "0.5752853", "0.5752853...
0.0
-1
Returns an unsigned Long
def rULong(self, address: int): return struct.unpack_from(self.endian + "Q", self.fileC, address)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_unsigned_long(data):\n s_type = \"=%s\" % get_type(\"unsigned_long\")\n return struct.unpack(s_type, data.read(4))[0]", "def read_ulong(self):\n return self._packers[\"L\"].unpack(self.read(4))[0]", "def read_unsigned_long_long(data):\n s_type = \"=%s\" % get_type(\"unsigned_long_long\...
[ "0.7384113", "0.73586845", "0.71783775", "0.6861212", "0.66213787", "0.66213787", "0.66016614", "0.65690666", "0.65455467", "0.63818026", "0.63746303", "0.62839204", "0.6270926", "0.6260171", "0.6259722", "0.6143412", "0.61180145", "0.6101484", "0.6059088", "0.6007855", "0.60...
0.6572872
7
Returns the hero class associated to the provided hero
def get_hero(self, uuid, hero): # I can't wait for case statements in python (3.10) if hero == Heroes.BULK: return Bulk(self.api_key, uuid) elif hero == Heroes.GENERAL_CLUCK: return GeneralCluck(self.api_key, uuid) elif hero == Heroes.CAKE_MONSTER: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_hero(root, _info, episode):\n if episode == 5:\n return luke # Luke is the hero of Episode V\n return artoo # Artoo is the hero otherwise", "def find_hero(self, name):\n for hero in self.heroes:\n if hero.name == name:\n return hero\n return 0", "d...
[ "0.67086357", "0.6616459", "0.6106358", "0.59461135", "0.5916644", "0.55295765", "0.5187479", "0.5165116", "0.51253057", "0.5114335", "0.5089026", "0.50647557", "0.49783254", "0.49614927", "0.49295256", "0.48356608", "0.48340905", "0.4832292", "0.4822834", "0.47946963", "0.47...
0.74373746
0
Translates a mojom_types_mojom.DeclaredConstant to a module.Constant.
def ConstFromMojom(self, mojom_const, parent_kind): const = module.Constant() const.name = mojom_const.decl_data.short_name const.kind = self.KindFromMojom(mojom_const.type) const.value = self.EvalValue(mojom_const.value) const.parent_kind = parent_kind return const
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def infer_constant(self, ctref):\n v = self.pipeline.resources.convert(ctref.node.value)\n return to_abstract(v, ctref.context, ref=ctref, loop=self.loop)", "def on_constant(self, node):\n if node.is_constant(Primitive):\n return self.convert_func(\n get_prim_...
[ "0.57489496", "0.57434434", "0.5608218", "0.54770833", "0.5363335", "0.5346875", "0.53088486", "0.5306045", "0.52995807", "0.5286775", "0.5266806", "0.5237642", "0.5224061", "0.5185338", "0.5149783", "0.5109696", "0.50944084", "0.50896657", "0.50774485", "0.50763476", "0.5073...
0.68629897
0
Add a room to the list of rooms of the game. All rooms must belong to this dictionary!
def add_room(self, room): self.rooms[room.name] = room
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_room(self, room):\n self.rooms.append(room)", "def AddRoom(self, room):\n self._rooms[room.Id] = room", "def add_room(self, data):\n room_id = data['room_id']\n x, y = literal_eval(data['coordinates'])\n room_data = {'id': data['room_id'],\n 'title...
[ "0.8250304", "0.80695575", "0.79341125", "0.74811506", "0.74467003", "0.6817672", "0.67178136", "0.6619181", "0.64646447", "0.6380613", "0.6275128", "0.624765", "0.61933064", "0.6086184", "0.60343015", "0.6001454", "0.6001454", "0.5997486", "0.59927577", "0.5970153", "0.59130...
0.8367019
0
Returns self as an iterator object
def __iter__(self): return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self) -> Iterator[T]:\n return self", "def __iter__(self):\n\n return self", "def iterator(self):\n yield", "def __iter__(self):\n return iter(self.__iter())", "def __iter__(self) -> object:\n return self", "def __iter__(self):\n # type: () -> Iterat...
[ "0.8422927", "0.8321603", "0.8317504", "0.83159345", "0.82508725", "0.8229758", "0.81777346", "0.8128081", "0.81210464", "0.8113643", "0.8113643", "0.8113643", "0.80012876", "0.79649526", "0.79523295", "0.7947341", "0.7933464", "0.79269093", "0.78680116", "0.78664327", "0.786...
0.82846355
10
Initialize an entity to be placed on the screen.
def __init__(self, screen: pygame.Surface, onitama: OnitamaGame, width: int = 100, height: int = 100, offset_x: int = 0, offset_y: int = 0): self.screen = screen self.onitama = onitama self.width = width self.height = height self.rect = (offset_x, offset_y) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self,**kwargs):\n Element.__init__(self,**kwargs)\n self.setVars(['entity'],**kwargs)", "def __init__(self):\n super().__init__()\n self.texture = arcade.load_texture(\":resources:/images/enemies/slimeBlue.png\")\n\n # Reset the viewport, necessary if we have a scr...
[ "0.68347794", "0.66831845", "0.65598726", "0.642514", "0.63359386", "0.63167584", "0.63167584", "0.63117015", "0.6248743", "0.624871", "0.62381625", "0.6195539", "0.6181136", "0.6171159", "0.615781", "0.61536425", "0.61465675", "0.6132519", "0.6132519", "0.61098677", "0.61002...
0.570446
84
test update defined_tags tag on bucket
def test_update_defined_tag_of_bucket(self, test, object_storage): namespace_name, bucket_name = self._get_bucket_details(object_storage) session_factory = test.oci_session_factory() policy = test.load_policy( { "name": "update-defined-tag-to-bucket", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_bucket(self):\n pass", "def test_update_bucket(self, test, object_storage, with_or_without_compartment):\n namespace_name, bucket_name = self._get_bucket_details(object_storage)\n session_factory = test.oci_session_factory()\n policy = test.load_policy(\n {\...
[ "0.74383634", "0.74255884", "0.7199583", "0.7091881", "0.7049948", "0.6985627", "0.6983055", "0.6941539", "0.6813788", "0.6713026", "0.6680753", "0.66093194", "0.6593874", "0.648621", "0.6456412", "0.64186287", "0.6355057", "0.63026285", "0.62090504", "0.6146884", "0.6133824"...
0.83065325
0
[summary] This week we're going to work on flattening iterables. I'd like to you write a function deep_flatten that accepts a list of lists (or lists of tuples and lists) and returns a flattened version of that list of lists.
def deep_flatten(iterable): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flatten(nested_list):\r\n return list(chain.from_iterable(nested_list))", "def flatten(list_to_flatten): \n flattened_list = []\n for item in list_to_flatten:\n if isinstance(item, list) or isinstance(item, tuple):\n flattened_list += flatten(item)\n else:\n flatt...
[ "0.81896967", "0.8110419", "0.79951924", "0.7914606", "0.7902274", "0.786831", "0.7834358", "0.7793925", "0.7766498", "0.77508163", "0.7730388", "0.7722455", "0.7680866", "0.7664666", "0.76602626", "0.765258", "0.763176", "0.7629761", "0.7598867", "0.7590867", "0.75814396", ...
0.8256491
0
The forwarding pass of convolution Module.
def forward(self, x): y = self.Dropout(self.PRelu(self.bn(self.conv(x)))) return y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward_pass_on_convolutions(self, x):\n conv_output = None\n for module_name, module in self.model._modules.items():\n print(module_name)\n if module_name == 'fc':\n return conv_output, x\n x = module(x) # Forward\n # print(module_name,...
[ "0.7667541", "0.73203796", "0.7269957", "0.7184375", "0.70624834", "0.7011728", "0.69778866", "0.6965432", "0.69505167", "0.69444424", "0.68940574", "0.68869805", "0.6878514", "0.68774414", "0.68613315", "0.6847214", "0.6845383", "0.68448216", "0.6833057", "0.68239397", "0.68...
0.0
-1
This is needed to differentiate strings from listlike containers
def is_nonstring_iterable(x): if isinstance(x, primitive_iterable): return False return isinstance(x, collections.Iterable)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def str_or_list(value):\n if isinstance(value, list):\n return value\n return [value]", "def ensure_list(thing):\r\n\r\n if isinstance(thing, str_types):\r\n return [thing]\r\n return thing", "def test_listify(string, cast, expected):\n assert listify(string, cast) == expected", "d...
[ "0.70805126", "0.69545084", "0.69265944", "0.68396753", "0.6809238", "0.6798198", "0.6784358", "0.667864", "0.6644245", "0.66349024", "0.65145624", "0.64828026", "0.6439224", "0.63184685", "0.6316772", "0.6303783", "0.6279796", "0.62774897", "0.6248017", "0.6244451", "0.62388...
0.5808246
49
Return the 'parent' directory For nonsubdir instances, the parent directory is the directory above the run directory, with the platform and year stripped off (if provided). For subdir instances, the parent directory is the basename of the parent run directory.
def parent_dir(self): parent = os.path.dirname(self.dirn) if self.is_subdir: parent = os.path.basename(parent) else: if self.platform is not None and parent.endswith(self.platform): parent = parent[:-len(self.platform)].rstrip(os.sep) if se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parentOrThisDir(path):\n if not os.path.isdir(path):\n path = os.path.dirname(path)\n return path", "def _parent_path(cls,path):\n # os.path.dirname(), but strip directories like files (like unix basename)\n # Treat directories like files...\n if path[-1]=='/':\n ...
[ "0.71339774", "0.71248376", "0.6961372", "0.68611974", "0.67509073", "0.6736749", "0.6677492", "0.6627681", "0.65689147", "0.6522661", "0.6378902", "0.62654114", "0.6240516", "0.61883754", "0.614594", "0.61424494", "0.6001287", "0.5960967", "0.5959129", "0.59375083", "0.58970...
0.8868602
0
Computes mean IntersectionoverUnion (IOU) for two arrays of binary images. Assuming X and Y are of shape (n_images, w, h).
def mean_IOU_gpu(X, Y): #X_fl = K.clip(K.batch_flatten(X), K.epsilon(), 1.) #Y_fl = K.clip(K.batch_flatten(Y), K.epsilon(), 1.) X_fl = K.clip(K.batch_flatten(X), 0., 1.) Y_fl = K.clip(K.batch_flatten(Y), 0., 1.) X_fl = K.cast(K.greater(X_fl, 0.5), 'float32') Y_fl = K.cast(K.greater(Y_fl, 0....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iou(boxes1, boxes2):\n intersections = intersection(boxes1, boxes2)\n area1 = area(boxes1)\n area2 = area(boxes2)\n unions = np.expand_dims(area1, axis=1) + np.expand_dims(\n area2, axis=0) - intersections\n# return intersect / union\n return np.where(intersections == 0.0, np.zeros_like(intersection...
[ "0.69782114", "0.6962116", "0.66721195", "0.6640959", "0.66077787", "0.6523421", "0.65103465", "0.6400429", "0.6394541", "0.638928", "0.63866055", "0.63858116", "0.63626724", "0.63154477", "0.62998873", "0.6267953", "0.6204797", "0.6201612", "0.6190601", "0.6178838", "0.61567...
0.73122233
0
Get every channel linked to a wormhole in this channel
def db_get_channels(self, guildID: int): query = "SELECT rowid, * FROM wormhole_channel WHERE guildID = ?" channels = self.bot.db_query(query, (guildID,), astuple=True) # come as: (rowid, name, channelID, guildID, type, webhookID, # webhookTOKEN) res: List[WormholeChannel] = [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iter_channels(self) -> Iterable[\"MChannel\"]:\n for server in self.servers.values():\n yield from server.channels.values()", "def get_channels():\n r = slack.channels.list().body\n return [ c for c in r['channels'] if c['is_member'] ]", "def getChannels(self) -> List:\n\t\tif self....
[ "0.66028214", "0.6446457", "0.6436417", "0.64005005", "0.63562316", "0.6320136", "0.6311994", "0.6262805", "0.6255586", "0.6153639", "0.61164176", "0.61149114", "0.60689396", "0.6057917", "0.60154015", "0.59996027", "0.59477746", "0.59306663", "0.59245706", "0.59157634", "0.5...
0.7056367
0
Check if the provided user is an admin of the provided wormhole
def check_is_admin(self, wormhole: str, user: int): query = "SELECT 1 FROM wormhole_admin WHERE name = ? AND admin = ?" query_res = self.bot.db_query(query, (wormhole, user)) return len(query_res) > 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_is_admin(user):\n return user in admins", "def is_admin(self, user):\n return user.name in self.admins", "def isAdmin(user):\n return isUserType(user, Admin)", "def isAdmin(self, user):\r\n if user.id in self.admins:\r\n return True\r\n return False", "def use...
[ "0.8167001", "0.79646426", "0.7938655", "0.788781", "0.7829278", "0.78271747", "0.7724729", "0.7711831", "0.76319814", "0.76050913", "0.7532664", "0.7511187", "0.75077087", "0.7477144", "0.7467449", "0.74538374", "0.74421793", "0.74380803", "0.7431995", "0.7403308", "0.738113...
0.8695353
0
Convert a ct_scan to a SimplteITK image.
def _get_itk_from_scan(ct_scan, origin, spacing): img = sitk.GetImageFromArray(ct_scan) img.SetOrigin((origin[1], origin[2], origin[0])) img.SetSpacing((spacing[1], spacing[2], spacing[0])) return img
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rescale_scan(ct_scan, origin, spacing, new_width, new_height, new_depth,\n normalize=True, interpolator=sitk.sitkLinear):\n if not np.all(origin == 0):\n raise ValueError(\"Please feed only resampled images to this function.\")\n if ct_scan.shape[2] != ct_scan.shape...
[ "0.57178766", "0.5692955", "0.55533934", "0.5543001", "0.5540808", "0.5536764", "0.55274993", "0.54926604", "0.54536605", "0.5439487", "0.543525", "0.540509", "0.5389185", "0.537013", "0.53554916", "0.53408873", "0.5332942", "0.5331508", "0.53088015", "0.52979463", "0.5297352...
0.7473181
0
Sets the learning rate to the initial LR decayed by 10 at every specified step
def adjust_learning_rate(optimizer, gamma, step): global lr lr = lr * (gamma ** (step)) for param_group in optimizer.param_groups: param_group['lr'] = lr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_learning_rate(optimizer, lr, step, args):\n # decay = 0.1**(sum(epoch >= np.array(lr_steps)))\n lr = lr * (0.95**(step//args.lr_decay_every))\n print(\"current learning rate: {:.6f}\".format(lr))\n param_group = optimizer.param_groups\n for i in range(len(param_group)):\n param_gro...
[ "0.767812", "0.7677903", "0.7550093", "0.7544309", "0.7532942", "0.7503397", "0.747584", "0.7466765", "0.7463249", "0.74485976", "0.7448121", "0.7448121", "0.74246264", "0.74246264", "0.7421349", "0.7416678", "0.74012214", "0.7391915", "0.7376437", "0.7368993", "0.7358726", ...
0.7387556
18