query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Checks that the GsmModem in PDU mode does not send message if error, when the text is within ASCII chars 22 126.
def testSendSmsPduModeError(self): # setup expectation to raise a non-timeout error with prompt when(self.mockDevice).read_lines().thenRaise(Exception("something other than timeout")) self.gsm.send_sms("1234", "Test Message") # must see command with size verify(self.mock...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_sms_valid(text=''):\n try:\n text.decode('ascii')\n except:\n return False\n if len(text) > 160:\n return False\n\n return True", "def testSendSmsPduMode(self):\n \n # setup expectation to raise a timeout error with prompt\n err = errors.GsmReadTimeout...
[ "0.68313634", "0.67669386", "0.61789453", "0.60250825", "0.579996", "0.57878447", "0.5629621", "0.5615489", "0.55831856", "0.5521425", "0.54795057", "0.5427085", "0.54028183", "0.53781205", "0.5342483", "0.53372145", "0.533206", "0.5329173", "0.5322715", "0.53093356", "0.5289...
0.71887165
0
Returns True if the content type is valid.
def is_valid_content_type(cls, content_type: str) -> bool: return content_type in cls.CONTENT_TYPES.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_valid_ct(content_type: str) -> bool:\n content_type = content_type.strip()\n return _is_valid_regex(CT_CONTENT_TYPE_REGEX_PATTERN, content_type)", "def _is_valid_content_type_format(content_type: str) -> bool:\n return (\n _is_valid_ct(content_type)\n or _is_valid_pt(content_type)\...
[ "0.7517771", "0.7417243", "0.70675975", "0.6998834", "0.68573606", "0.6832993", "0.67981493", "0.6714344", "0.6592863", "0.6578096", "0.6575198", "0.6568513", "0.6541694", "0.65321887", "0.65321887", "0.6491889", "0.6491021", "0.6470095", "0.6450657", "0.63938487", "0.6392137...
0.8173388
0
Constructor for facebook sdk
def init_fb(self, **kwargs): try: self.graph = facebook.GraphAPI(access_token=fb_token, version='2.4') except Exception as e: sys.exit(str(e))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, access_token, endpoint='/me',\r\n version='2.5'):\r\n self.access_token = access_token\r\n self.endpoint = endpoint", "def initialize_facebook():\n session = FacebookSession(APP_ID, APP_SECRET, ACCESS_TOKEN)\n return FacebookAdsApi(session)", "def __init__...
[ "0.70955795", "0.70331687", "0.65805393", "0.6543465", "0.6526601", "0.64303684", "0.63264066", "0.625907", "0.6256634", "0.61950535", "0.61830455", "0.618123", "0.61768824", "0.61615527", "0.6148158", "0.6142532", "0.6112654", "0.6108066", "0.6090049", "0.6088559", "0.608694...
0.760726
0
Save event to database
def save_event(self, data): rdb.table(self.rdb_table).insert(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, event):\n self.saved_events.append(event)", "def insert_event_to_db(self):\n try:\n events_coll.insert_one(self.event_info_to_dic())\n except Exception as e:\n print(e)", "def save(self, db):\n pass", "def save_event(id):\n event = Event.que...
[ "0.7487547", "0.7325725", "0.7049459", "0.6976891", "0.69406134", "0.6901806", "0.68859524", "0.6789551", "0.66951", "0.66863483", "0.66196334", "0.65969324", "0.65858656", "0.6583082", "0.6570057", "0.6570057", "0.6570057", "0.6570057", "0.6570057", "0.6570057", "0.6570057",...
0.8077102
0
Iterate through all events pages
def get_events(self): url = '/v2.4/'+self.page_id+'/events' data = self.graph.request(url) while 'next' in data['paging'].keys(): print data['paging']['next'] data = self.graph.request(url, args={ 'limit' : 100, 'after' : ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_event_list(self, response):\n for event in response.css(\".view-content .article-title a::attr(href)\"):\n event_url = event.extract()\n yield scrapy.Request(\n response.urljoin(event_url),\n callback=self.parse_event_page,\n dont_...
[ "0.7203284", "0.6670896", "0.66397905", "0.65484786", "0.65141577", "0.64590824", "0.64310527", "0.6378027", "0.6360895", "0.63342434", "0.6316285", "0.6311675", "0.6298735", "0.6272081", "0.6216796", "0.61802506", "0.61441034", "0.6130424", "0.6043177", "0.60396385", "0.6032...
0.7202085
1
Setup the Binary Sensor platform fo EnOcean.
def setup_platform(hass, config, add_devices, discovery_info=None): dev_id = config.get(CONF_ID, None) devname = config.get(CONF_NAME, "EnOcean binary sensor") add_devices([EnOceanBinarySensor(dev_id, devname)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_platform(\n hass: HomeAssistant,\n config: ConfigType,\n add_entities: AddEntitiesCallback,\n discovery_info: DiscoveryInfoType | None = None,\n) -> None:\n if discovery_info is None:\n return\n binary_sensors = []\n for name in hass.data[DOMAIN]:\n if name in BINARY_SE...
[ "0.6923445", "0.6406349", "0.6367884", "0.630438", "0.6297725", "0.62513864", "0.61724937", "0.61561346", "0.61022043", "0.60586834", "0.60506696", "0.60256183", "0.59961325", "0.59727365", "0.59395474", "0.5925092", "0.5920433", "0.5904643", "0.58785045", "0.5876473", "0.587...
0.7185503
0
Load an ARFF File from a file.
def load(filename): o = open(filename) s = o.read() a = ArffFile.parse(s) o.close() return a
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(self, filename=None):\n importer = aspecd.io.AdfImporter()\n importer.source = filename\n importer.import_into(self)", "def loadFile(self, filename):\n #TODO: do a contents based detection\n if filename[-4:].lower() == '.txt':\n self.loadTIText(open(filename...
[ "0.6952331", "0.6750146", "0.6709102", "0.67043614", "0.6499693", "0.6472072", "0.6260189", "0.6143849", "0.61354226", "0.61135525", "0.60728455", "0.6060615", "0.60431916", "0.60410386", "0.60397345", "0.59697336", "0.5964675", "0.59411573", "0.5907846", "0.5897713", "0.5881...
0.8042971
0
Define a new attribute. atype has to be one of 'numeric', 'string', and 'nominal'. For nominal attributes, pass the possible values as data.
def define_attribute(self, name, atype, data=None): self.attributes.append(name) self.attribute_types[name] = atype self.attribute_data[name] = data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_attribute(self,\n identifier,\n idl_type,\n is_readonly=False,\n extended_attributes=None,\n node=None):\n if isinstance(idl_type, str):\n idl_type = self._crea...
[ "0.6832389", "0.6797418", "0.67368126", "0.6671336", "0.65930986", "0.6554519", "0.65519553", "0.650852", "0.6398499", "0.6318576", "0.6294345", "0.6168906", "0.6158302", "0.6157011", "0.61001563", "0.605466", "0.6050371", "0.6018214", "0.6016995", "0.60158825", "0.60112774",...
0.8044042
0
Update the overall ignorance
def update_overall_ignorance(overall_ignorance, object_ignorance, rate=0.05): return (1-rate)*overall_ignorance + rate*object_ignorance
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self):\n # default implementation is to do nothing.", "def dummy_update( self ):\r\n pass", "def _update(self):\n pass", "def update(self):\n\n pass", "def update(self):\n pass", "def update(self):\n pass", "def update(self):\n pass", "def u...
[ "0.60763353", "0.60567635", "0.60499495", "0.59942096", "0.59925723", "0.59925723", "0.59925723", "0.59925723", "0.59925723", "0.59925723", "0.59925723", "0.59925723", "0.59925723", "0.59925723", "0.59925723", "0.59925723", "0.59925723", "0.59925723", "0.59925723", "0.5989389",...
0.62073374
0
Return focus image at target positon
def check_target_position(environment, target_xy, fovea): temp_fovea = Fovea(target_xy, fovea.size, [0, 0, 0], fovea.unit) temp_image = temp_fovea.get_focus_image(environment) return temp_image
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def click_img(self, target_img):\n pos = imagesearch_loop(target_img, timesample=0.5)\n if pos[0] == -1:\n print(\"No image found\")\n else:\n self.click(pos)", "def extract_target_pixel_location(self):\n #Respective Image location\n pixel_array = self.ima...
[ "0.6471832", "0.60620207", "0.60257924", "0.5962527", "0.5960928", "0.5843375", "0.5577541", "0.556946", "0.5547605", "0.55378973", "0.55275726", "0.54741293", "0.5447037", "0.543567", "0.5431909", "0.54052734", "0.5387265", "0.5387265", "0.5387265", "0.5387265", "0.534272", ...
0.64985406
0
Check if target area is free
def check_free_space(environment, target_xy, fovea): temp_image = check_target_position(environment, target_xy, fovea) if np.array_equal(temp_image, np.zeros(temp_image.shape)): return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_free(self) -> bool:\n return self.places < self.total", "def is_free(self):\n return self._size > 0", "def guard_occupy_transition(self):\n if not self.get_free_positions:\n return True", "def _space_has_degrees_of_freedom(self) -> bool:\n return True", "def fr...
[ "0.69473505", "0.65693545", "0.65516436", "0.65503776", "0.65440136", "0.64887106", "0.63822377", "0.6373474", "0.6314653", "0.6287633", "0.62136126", "0.6197832", "0.6167743", "0.6130558", "0.60996246", "0.6068702", "0.6056441", "0.60131264", "0.6010799", "0.5976388", "0.597...
0.7472877
0
Evaluate loss and gradient for the threelayer convolutional network.
def loss(self, X, y=None): W1, b1 = self.params['W1'], self.params['b1'] W2, b2 = self.params['W2'], self.params['b2'] W3, b3 = self.params['W3'], self.params['b3'] # pass conv_param to the forward pass for the convolutional layer filter_size = W1.shape[2] conv_param = {'stride': 1, 'pad': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loss(self, X, y=None):\n W1, b1 = self.params['W1'], self.params['b1']\n W2, b2 = self.params['W2'], self.params['b2']\n W3, b3 = self.params['W3'], self.params['b3']\n \n # pass conv_param to the forward pass for the convolutional layer\n filter_size = W1.shape[2]\n conv_param = {'stride'...
[ "0.64657706", "0.62264025", "0.61885417", "0.617772", "0.61766106", "0.6117092", "0.609945", "0.6043953", "0.60374737", "0.60298234", "0.6029765", "0.6028192", "0.6012463", "0.6012463", "0.59997284", "0.5982718", "0.590393", "0.58888876", "0.5880226", "0.5858676", "0.5853266"...
0.6235286
1
Inplace applies a one mode gate G into the process matrix T in mode i
def _apply_one_mode_gate(G, T, i): T[i] *= G return T
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _apply_two_mode_gate(G, T, i, j):\n (T[i], T[j]) = (G[0, 0] * T[i] + G[0, 1] * T[j], G[1, 0] * T[i] + G[1, 1] * T[j])\n return T", "def compile(self, seq, registers):\n\n # Check which modes are actually being used\n used_modes = []\n for operations in seq:\n modes = [mo...
[ "0.70139986", "0.5631263", "0.5538027", "0.5311544", "0.5232887", "0.5197726", "0.5164995", "0.5135691", "0.50920993", "0.50480705", "0.5039565", "0.50272524", "0.49950483", "0.49901596", "0.4963029", "0.49488658", "0.4937678", "0.49336824", "0.49291444", "0.49188215", "0.487...
0.79795337
0
Inplace applies a two mode gate G into the process matrix T in modes i and j
def _apply_two_mode_gate(G, T, i, j): (T[i], T[j]) = (G[0, 0] * T[i] + G[0, 1] * T[j], G[1, 0] * T[i] + G[1, 1] * T[j]) return T
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _apply_one_mode_gate(G, T, i):\n\n T[i] *= G\n return T", "def _assembler_baseV00(M2bass, Gi_, G_j, mode):\n Gi_ = Gi_.T\n G_j = G_j.T\n\n hmgeoiti_ = int(np.max(Gi_) + 1)\n hmgeoit_j = int(np.max(G_j) + 1)\n\n szGi_ = np.shape(Gi_)\n szG_j = np.shape(G_j)\n rowGi_ = szGi_[0]\n ...
[ "0.719273", "0.57634723", "0.5522466", "0.509846", "0.50796694", "0.49862283", "0.49686834", "0.49493116", "0.4947738", "0.493212", "0.48544836", "0.48431808", "0.48389664", "0.48374176", "0.4813507", "0.4800392", "0.47900787", "0.47492748", "0.47435454", "0.47330758", "0.472...
0.80511445
0
Returns a list of the columns that are in our features dataframe that should not be used in prediction. These are essentially either metadata columns (team name, for example), or potential target variables that include the outcome. We want to make sure not to use the latter, since we don't want to use information about...
def get_non_feature_columns(): return ['teamid', 'op_teamid', 'matchid', 'competitionid', 'seasonid', 'goals', 'op_goals', 'points', 'timestamp', 'team_name', 'op_team_name']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_columns(self):\n df = self.get_prep_data()\n col = [c for c in df.columns if c not in ['target', 'idd', 'ft_data_dt']]\n return col", "def missing_columns(self):\r\n _missing_columns = set(self.reqd_columns).difference(set(self.all_columns))\r\n return list(_missing...
[ "0.71959037", "0.68640786", "0.683394", "0.6806973", "0.67299575", "0.6661575", "0.6637758", "0.65448886", "0.65201235", "0.64434034", "0.6430318", "0.6406203", "0.63625467", "0.6347281", "0.6317178", "0.6239724", "0.621829", "0.6213187", "0.6197959", "0.6065288", "0.60188276...
0.80354255
0
Returns a list of all columns that should be used in prediction (i.e. all features that are in the dataframe but are not in the features.get_non_feature_column() list).
def get_feature_columns(all_cols): return [col for col in all_cols if col not in get_non_feature_columns()]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_columns(self):\n df = self.get_prep_data()\n col = [c for c in df.columns if c not in ['target', 'idd', 'ft_data_dt']]\n return col", "def get_cols(df):\n meta = get_metafeatures(df)\n categorical_columns = meta.loc[meta['type'] == 'object', 'column'].tolist()\n cols_to_...
[ "0.7311638", "0.71005136", "0.7081749", "0.6978075", "0.6938612", "0.6809944", "0.67643905", "0.6764281", "0.67626035", "0.6757341", "0.67021", "0.6644742", "0.6602799", "0.64940643", "0.64777064", "0.6425499", "0.64037734", "0.6395039", "0.6363723", "0.6360488", "0.6316431",...
0.7818545
0
Setup cache object for wallet
def setup_cache(self): if self.walletname not in cache: cache[self.walletname] = { "raw_transactions": {}, "transactions": [], "tx_count": None, "tx_changed": True, "last_block": None, "raw_tx_block_upda...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_cache(self):\n if self.cacheable:\n self._instance._cache[self.name] = {}", "def __init__(self, *args, **kwargs):\n self._cachedict = {}", "def __init_cache__(self) -> None:\n try:\n self.cache = caches[CACHE_NAME]\n logging.info(\"GeoIP2 - success...
[ "0.70809096", "0.67123383", "0.66832745", "0.6391737", "0.6336041", "0.619476", "0.6180135", "0.6171709", "0.6163314", "0.6139369", "0.60808635", "0.6058581", "0.60361993", "0.60249174", "0.6023925", "0.5965481", "0.59415615", "0.5929574", "0.59244114", "0.59184754", "0.58754...
0.86449647
0
Cache `raw_transactions` (with full data on all the inputs and outputs of each tx)
def cache_raw_txs(self, cli_txs): # Get list of all tx ids txids = list(dict.fromkeys(cli_txs.keys())) tx_count = len(txids) # If there are new transactions (if the transations count changed) if tx_count != self.cache["tx_count"]: for txid in txids: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cache_txs(self, raw_txs):\n # Get the cached `raw_transactions` dict (txid -> tx) as a list of txs\n transactions = list(sorted(raw_txs.values(), key = lambda tx: tx['time'], reverse=True))\n result = []\n\n # If unconfirmed transactions were mined, assign them their block height\n ...
[ "0.7925975", "0.6223888", "0.61566186", "0.60971904", "0.5936462", "0.58497435", "0.58128", "0.57948434", "0.57376546", "0.5634292", "0.5595399", "0.5577145", "0.55244076", "0.54729325", "0.5469587", "0.54539764", "0.5448407", "0.5412813", "0.5397462", "0.53824824", "0.535970...
0.79335445
0
Caches the transactions list. Cache the inputs and outputs which belong to the user's wallet for each `raw_transaction`
def cache_txs(self, raw_txs): # Get the cached `raw_transactions` dict (txid -> tx) as a list of txs transactions = list(sorted(raw_txs.values(), key = lambda tx: tx['time'], reverse=True)) result = [] # If unconfirmed transactions were mined, assign them their block height if l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cache_raw_txs(self, cli_txs): \n # Get list of all tx ids\n txids = list(dict.fromkeys(cli_txs.keys()))\n tx_count = len(txids)\n\n # If there are new transactions (if the transations count changed)\n if tx_count != self.cache[\"tx_count\"]:\n for txid in tx...
[ "0.76756275", "0.6882982", "0.6274878", "0.61497986", "0.58140624", "0.57319975", "0.5679993", "0.5659589", "0.5585741", "0.55252254", "0.55109656", "0.5479615", "0.5473953", "0.546898", "0.5449675", "0.54464066", "0.542897", "0.54221237", "0.5411895", "0.5377797", "0.5366215...
0.7736577
0
This method hides fields that were added in newer API versions. Certain node fields were introduced at certain API versions. These fields are only made available when the request's API version matches or exceeds the versions when these fields were introduced.
def hide_fields_in_newer_versions(obj): if not api_utils.allow_start_end_audit_time(): obj.start_time = wtypes.Unset obj.end_time = wtypes.Unset if not api_utils.allow_force(): obj.force = wtypes.Unset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_api_fields(cls):\n return ['fqdn', 'ttl', 'description', 'views']", "def remove_read_only_fields(self):\n self.fields = XML_List(Elements.FIELDS, [field for field in self.fields if\n not field.read_only or not str_to_bool(field.read_only)])", ...
[ "0.63221574", "0.6136071", "0.60758066", "0.5660327", "0.560701", "0.5569673", "0.55660045", "0.55565786", "0.55165595", "0.54647285", "0.54489416", "0.54486406", "0.54375917", "0.5407587", "0.54063267", "0.5390326", "0.53891975", "0.53873795", "0.5364011", "0.5361968", "0.53...
0.6415202
0
Retrieve information about the given audit.
def get_one(self, audit): if self.from_audits: raise exception.OperationNotPermitted context = pecan.request.context rpc_audit = api_utils.get_resource('Audit', audit) policy.enforce(context, 'audit:get', rpc_audit, action='audit:get') return Audit.convert_with_link...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, audit_uuid):\n audit = AuditResource.get_by_id(audit_uuid=audit_uuid, withContacts=True, withScans=True)\n return audit", "async def getAudit(self, auditid) -> GetAuditResponse:\n\n print(\"get audit 1\" + auditid)\n res = await self.stub.GetAudit(\n GetAuditR...
[ "0.7213119", "0.7043593", "0.66991794", "0.63289493", "0.6216085", "0.62059367", "0.6160432", "0.58675766", "0.5810578", "0.56947064", "0.5672697", "0.5560825", "0.55349076", "0.5424039", "0.541629", "0.53783417", "0.5374017", "0.53407764", "0.533264", "0.53322256", "0.526490...
0.7407178
0
Check request is authenticated. If API_AUTH_SECRET_HEADER_NAME is not in request headers then return 401. If API_AUTH_SECRET_HEADER_NAME is in request headers but incorrect then return 403. Else return none.
def is_authenticated_request(req: Request) -> Optional[Response]: if API_AUTH_SECRET_HEADER_NAME not in req.headers: return make_error_response(HTTP_STATUS_CODE.UNAUTHORIZED) if req.headers[API_AUTH_SECRET_HEADER_NAME] != API_AUTH_SECRET: return make_error_response(HTTP_STATUS_CODE.FORBIDDEN) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_authorization_header_not_present(self, get_key_secret):\r\n request = Request(self.environ)\r\n request.body = self.get_request_body()\r\n response = self.xmodule.grade_handler(request, '')\r\n real_response = self.get_response_values(response)\r\n expected_response = {\...
[ "0.69187254", "0.68816525", "0.66055983", "0.654799", "0.6515225", "0.64065534", "0.63303685", "0.63240373", "0.63201493", "0.6309157", "0.6307791", "0.62788045", "0.6236683", "0.6223184", "0.6208542", "0.6197912", "0.6197359", "0.6196875", "0.61898404", "0.6124128", "0.61186...
0.81665546
0
Add the the number of minutes represented by min to the currentDate input and returns that new date timestamp
def addMinutes(self, currentDate:str, dateFormat:str, mins:int) -> str: inputDateTime = datetime.strptime(currentDate, dateFormat) nextTime = inputDateTime + timedelta(minutes=mins) return nextTime.strftime(dateFormat)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_datetime_before_given_minutes(minutes):\n from datetime import datetime\n import datetime as dt\n date_obj_before_3min = datetime.now()- dt.timedelta(minutes=minutes)\n return date_obj_before_3min", "def get_today_start():\n return datetime.combine(datetime.today(), time.min)", "def next...
[ "0.58505815", "0.5687333", "0.56670386", "0.56670386", "0.5537341", "0.5529319", "0.54898757", "0.54418087", "0.5429182", "0.5377847", "0.53345233", "0.53310037", "0.5325793", "0.5316861", "0.53041273", "0.52726483", "0.5251411", "0.5228076", "0.5211206", "0.5204495", "0.5169...
0.6531147
0
Prints out ">>" to make the prompt look nice.
def prompt(): sys.stdout.write('>> ') sys.stdout.flush()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showPrompt(self):\r\n self.terminal.nextLine()\r\n self.terminal.write(self.ps[self.pn])", "def do_prompt(self, line):\n self.prompt = line + ': '", "def prompt(self, question):\n self.output(' ')\n self.output(question)\n self.output(self.parse_response(str(self.u...
[ "0.7335863", "0.6978222", "0.6823395", "0.67102325", "0.6643498", "0.6569211", "0.649697", "0.64917946", "0.6482021", "0.6433004", "0.63896614", "0.63162845", "0.62998056", "0.6265454", "0.6237534", "0.6233695", "0.6232359", "0.618937", "0.6169687", "0.61388206", "0.6136785",...
0.7840775
0
Takes video file path and a transcode profile, transcode the file, and returns the transcoded file in bytes, along with ffmpeg's stderr output.
def transcode_segment(self, in_path: str, profile: TranscodeProfile ) -> Tuple[bytes, str, str]: out_filepath = f"/tmp/{uuid4()}.ts" transcode_command = [ "ffmpeg", "-i", in_path, "-vf", f"s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transcode(path, outpath):\n\n needs_transcode = determine_transcode(path)\n logger.info(f\"Transcoding {path} to {outpath}...\")\n\n cmd = [\n \"ffmpeg\", \"-y\",\n \"-i\", path,\n \"-an\",\n \"-metadata:s\", \"handler_name=tator\",\n \"-vcodec\", \"libx264\",\n ...
[ "0.6997698", "0.6566929", "0.64950305", "0.6379619", "0.6161119", "0.61035687", "0.5958369", "0.58059055", "0.576237", "0.57498455", "0.57029223", "0.5672103", "0.5670517", "0.5635099", "0.5540602", "0.5490141", "0.541302", "0.5378603", "0.53590256", "0.5312127", "0.52753246"...
0.75541896
0
Get duration from an ffmpeg stderr dump.
def parse_duration_from_stderr(self, stderr: str) -> float: pattern = "Duration: (\\d\\d):(\\d\\d):(\\d\\d\\.\\d\\d)" pattern = re.compile(pattern) result = pattern.search(stderr) if result is None: return None # Parse result hours = float(result.grou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_duration(filename):\n cmd = ('ffprobe -v 0 -of flat=s=_ -select_streams v:0 -show_entries '\n 'stream=duration -of default=nokey=1:noprint_wrappers=1 ' +\n filename).split()\n pid = subprocess.run(cmd, universal_newlines=True,\n stdout=subprocess.PIPE)\n ...
[ "0.7139366", "0.6637791", "0.6516288", "0.6415554", "0.6111052", "0.5992013", "0.59010184", "0.5797666", "0.5752247", "0.57105243", "0.5628981", "0.55969137", "0.555516", "0.5550522", "0.551304", "0.54656565", "0.5385895", "0.5377022", "0.5360331", "0.53306353", "0.5317654", ...
0.77763784
0
Save this entry in the SugarCRM server. If the 'id' field is blank, it creates a new entry and sets the 'id' value.
def save(self): # If 'id' wasn't blank, it's added to the list of dirty fields; this # way the entry will be updated in the SugarCRM connection. if self['id'] != '': self._dirty_fields.append('id') # nvl is the name_value_list, which has the list of attributes. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self):\n if self.id is None:\n self._insert()\n else:\n self._update()", "def save(self):\n if self.id:\n self.update()\n else:\n self.create()", "def save(self)->None:\n item = database.cursor.fetchone()\n if item:\...
[ "0.7648956", "0.7361002", "0.6938848", "0.6878406", "0.66949844", "0.6614205", "0.6569775", "0.6563675", "0.6438659", "0.6280113", "0.62362057", "0.62102276", "0.61960924", "0.6164901", "0.6155119", "0.6127607", "0.61145216", "0.61145216", "0.61145216", "0.61145216", "0.61145...
0.7521411
1
Return the related entries in another module.
def get_related(self, module): connection = self._module._connection result = connection.get_relationships(self._module._name, self['id'], module._name.lower(), '', ['id']) entries = [] for elem in result['entry_list']: entry = Su...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relationships(self):", "def get_related_objects(self):\n result = []\n if self['name'] != None:\n tmp = ObjectDefinition.objects.filter(use__has_field=self['name'], object_type=self['object_type'])\n for i in tmp: result.append(i)\n return result", "def associated...
[ "0.5929166", "0.5709051", "0.54539883", "0.54411966", "0.54079044", "0.54058117", "0.5341041", "0.53391445", "0.5284375", "0.5259152", "0.5229081", "0.52277374", "0.5226618", "0.52161896", "0.5207432", "0.5207311", "0.5198739", "0.5186677", "0.5138827", "0.5136619", "0.512700...
0.7334194
0
Partition list ``l`` in ``K`` partitions. Examples >>> l = [0, 1, 2] >>> list(clusters(l, K=3)) [[[0], [1], [2]], [[], [0, 1], [2]], [[], [1], [0, 2]], [[0], [], [1, 2]], [[], [0], [1, 2]], [[], [], [0, 1, 2]]] >>> list(clusters(l, K=2)) [[[0, 1], [2]], [[1], [0, 2]], [[0], [1, 2]], [[], [0, 1, 2]]] >>> list(clusters(l...
def clusters(l, K): # noqa if l: prev = None for t in clusters(l[1:], K): tup = sorted(t) if tup != prev: prev = tup for i in range(K): yield tup[:i] + [ [l[0]] + tup[i], ] + tup[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_list(l, k):\n\n\tn = len(l)\n\tsublists = []\n\tnsubs = n / k\n\tnrems = n % k\n\n\t# little algo to split lists.\n\n\ti = int(0)\n\twhile i < n:\n\t\tsublists.append(l[i:i+k])\n\t\ti += k\n\n\treturn sublists", "def kmeans_clustering(cluster_list, num_clusters, num_iterations):\n # position initial...
[ "0.6442916", "0.6442183", "0.6315446", "0.6304946", "0.6237085", "0.617769", "0.6146027", "0.6125856", "0.60932726", "0.60206467", "0.5957113", "0.5909527", "0.59080315", "0.585992", "0.58364034", "0.58048147", "0.58022964", "0.57939726", "0.5760786", "0.5759672", "0.57513547...
0.7760409
0
Partition list ``l`` in ``K`` partitions, without empty parts. >>> l = [0, 1, 2] >>> list(neclusters(l, 2)) [[[0, 1], [2]], [[1], [0, 2]], [[0], [1, 2]]] >>> list(neclusters(l, 1)) [[[0, 1, 2]]]
def neclusters(l, K): # noqa for c in clusters(l, K): if all(x for x in c): yield c
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clusters(l, K): # noqa\n if l:\n prev = None\n for t in clusters(l[1:], K):\n tup = sorted(t)\n if tup != prev:\n prev = tup\n for i in range(K):\n yield tup[:i] + [\n [l[0]] + tup[i],\n ...
[ "0.7217303", "0.63322186", "0.625333", "0.6235396", "0.6019988", "0.5918844", "0.5856138", "0.57952917", "0.57450014", "0.5674573", "0.5655689", "0.5525202", "0.5506933", "0.5506646", "0.5503834", "0.5496627", "0.5489272", "0.5465552", "0.5463998", "0.54601", "0.54010504", ...
0.74512917
0
Get all segmentations of a list ``l``.
def all_segmentations(l): for K in range(1, len(l) + 1): gen = neclusters(l, K) yield from gen
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getIntersectorList(self, l):\n return [self.getIntersector(v) for v in l]", "def getSegments(self):\n l = len(self.points)\n return [Segment(self.points[i % l], self.points[(i + 1) % l], \\\n color=self.side_color, width=self.side_width) for i in range(l)]", "def...
[ "0.7343008", "0.5786379", "0.5737136", "0.57333577", "0.56923693", "0.56832623", "0.5526333", "0.55071455", "0.54750925", "0.54672647", "0.5410251", "0.53292185", "0.5260688", "0.52098393", "0.5078696", "0.5060627", "0.50543034", "0.50465745", "0.50461197", "0.50444895", "0.5...
0.7035634
1
Test if ``s1`` and ``s2`` are in the same symbol, given the ``segmentation``.
def q(segmentation, s1, s2): index1 = find_index(segmentation, s1) index2 = find_index(segmentation, s2) return index1 == index2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other: Segment) -> bool:\n return any(\n (\n self.start == other.start and self.end == other.end,\n self.start == other.end and self.end == other.start,\n )\n )", "def segment_segment(s1, s2):\n l1=s1.line()\n l2=s2.line()\n...
[ "0.641324", "0.6303756", "0.62990654", "0.6223713", "0.60034645", "0.59813756", "0.59780806", "0.5975479", "0.58711016", "0.5836675", "0.5813403", "0.5789767", "0.5778101", "0.57675564", "0.5753647", "0.5730708", "0.56924576", "0.5673696", "0.5646707", "0.5588982", "0.5555126...
0.7217469
0
This builds your guide. Use Keyword to update any options at build time.
def build_guide(self, **kwargs): # This builds your guide master and updates your options self.create_guide_master(**kwargs) prefix = self.prefix # Naming prefix. Use this for every new node you create and there should be no name clashes. options = self.options ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_guide(self, **kwargs):\n\n # This builds your guide master and updates your options\n self.create_guide_master(**kwargs)\n\n prefix = self.prefix\n options = self.options\n mirror_value = self.mirror_value\n\n num_joints = options.get('numberJoints')\n...
[ "0.6530746", "0.6263703", "0.61089903", "0.60497785", "0.5882108", "0.5788378", "0.5788378", "0.5754908", "0.56987226", "0.56863075", "0.56494266", "0.5625547", "0.561691", "0.5596764", "0.5596764", "0.55608445", "0.5489056", "0.5478003", "0.5478003", "0.5478003", "0.546438",...
0.63234144
1
Add fu code to list.
def add_fu(self, state): self._fu_set.add(state)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_code(self, code):\n self.code += code", "def add_code(self, id, code):\n self.codes[id] = code", "def set_function_list(self, L):\n\t\tself.function_list = L", "def add_hook(f, h):\n if f in hooks:\n hooks[f] += [h]\n else:\n hooks[f] = [h]", "def add_code(self, co...
[ "0.63861465", "0.5658855", "0.56266004", "0.55539155", "0.5490869", "0.5488156", "0.5473881", "0.54088527", "0.53393835", "0.5329551", "0.5329551", "0.53095835", "0.52636266", "0.5237091", "0.5221719", "0.5194192", "0.51796734", "0.5135299", "0.5118256", "0.5104795", "0.50775...
0.5944328
1
Allow to scroll through the raw data of the csv file selected
def see_raw_data(city): while True: try: see_raw_data_input = input('\nIn addition of the stats above, would you like to scroll through the raw data? (y/n)\n') if see_raw_data_input not in ('y', 'n'): raise Exception ('Invalid answer') if see_raw_data_inp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_loading_file(self):\n column_headers = []\n column_headers_all = []\n\n # Open the file once to get idea of the total rowcount to display progress\n with open(self.csv_file_path[0], newline='') as csv_file:\n self.progress_max.emit(len(csv_file.readlines()) - 2)\n...
[ "0.6083973", "0.6001787", "0.59245104", "0.58940566", "0.5861581", "0.581427", "0.5679473", "0.56790644", "0.5672839", "0.565956", "0.5653351", "0.5615062", "0.560097", "0.5599851", "0.5589927", "0.55863386", "0.5574873", "0.5549084", "0.55258", "0.55049545", "0.54869586", ...
0.62122077
0
Initialization function. Sets the model name and function, path to input data, and the output filename.
def __init__(self, sfs, model, popnames, output): self.sfs = self.load_sfs(sfs) self.modelname = model # Make an extrapolating version of the function self.modelfunc = dadi.Numerics.make_extrap_log_func( self.set_model_func(model)) self.params = self.set_parameters() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self,\n model_fn=cake_fn,\n model_dir: Optional[str] = \"model\",\n saved_path : Optional[str] = None,\n ):\n self.model_fn = model_fn \n self.model_dir = model_dir\n if saved_path == None:\n self.update_p...
[ "0.71706414", "0.69452214", "0.6822937", "0.66740066", "0.6421178", "0.63648045", "0.6306152", "0.62590146", "0.6255789", "0.62344706", "0.62207854", "0.62166464", "0.6183033", "0.61792994", "0.61410034", "0.61369526", "0.61364913", "0.61285555", "0.61272836", "0.6064312", "0...
0.69727397
1
Parse the dadi SFS file and return it as a Spectrum object. Dadi will do basic checking of the spectrum, but we will be more thorough.
def load_sfs(self, sfs): try: fs = dadi.Spectrum.from_file(sfs) except: print 'The spectrum file you provided is not valid!' exit(1) return fs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_file(self):\n file_time = ''\n num_dir = 0\n num_freq = 0\n freq_w_band = 0.0\n freq_0 = 0.0\n start_dir = 0.0\n\n dspec_matrix = []\n\n # Extract the file time from the file name\n input_file_name = self._stream_handle.name\n\n match ...
[ "0.69581074", "0.647524", "0.63855165", "0.63855165", "0.6374014", "0.63154924", "0.6295988", "0.61925375", "0.6125525", "0.6066723", "0.60588676", "0.6026092", "0.5996392", "0.5974746", "0.5853758", "0.5807754", "0.5777854", "0.57754326", "0.5728101", "0.57191104", "0.571364...
0.7699114
0
Given a model name, set the function that has to be called to run that model. This should be safe because we restrict the user input for the models at the argument parsing stage.
def set_model_func(self, model): if model == 'SI': import cavefish_dadi.Models.si return cavefish_dadi.Models.si.si elif model == 'SC': import cavefish_dadi.Models.sc return cavefish_dadi.Models.sc.sc elif model == 'IM': import cavefish...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_model(model: str) -> Any:\n try:\n model_function = eval(model)\n except (NameError, AttributeError) as err:\n sys.exit(f'{err}. Accepted models from {tf}, {sm}, {tfa}, {tfc}')\n return model_function", "def get_function(model_or_function, preprocess_function=None):\n from diann...
[ "0.6543695", "0.6317053", "0.6138432", "0.6007846", "0.5799357", "0.5794181", "0.57566136", "0.56700885", "0.55889934", "0.5577638", "0.5568402", "0.5544729", "0.55088854", "0.55060846", "0.5459015", "0.5454922", "0.54414725", "0.53864926", "0.5364902", "0.5340603", "0.533630...
0.6588683
0
Summarize the replicate runs and convert the parameters estimates into meaningful numbers.
def summarize(self, locuslen): # First, calculate the mean of the parameter estimates from each # of the replicates hot_means = [] for r_t in zip(*self.hot_params): v = [x for x in r_t if not math.isnan(x)] hot_means.append(sum(v)/len(v)) cold_means = [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_mcts(self, runs_per_round):\n for i in range(runs_per_round):\n self.select(self.env, 'r')\n self.env_reset()\n counts = [self.Nsa[('r', a)] for a in range(self.actions)]\n # print(\"counts \", counts)\n # print(\"Q-values\", [self.Qsa[('r', a)] for a in ra...
[ "0.596659", "0.5817768", "0.57848805", "0.5778032", "0.5736855", "0.5722777", "0.5721804", "0.56309265", "0.5599941", "0.5561327", "0.5554734", "0.5542044", "0.55361605", "0.55108637", "0.5486883", "0.5457525", "0.544647", "0.542683", "0.5396689", "0.53914917", "0.5365846", ...
0.58705
1
Drive the UV plane combination. Functionally, this means Performing concatenation Cleaning the concatenated MS in the UV plane Imaging the concatenated MS
def _drive_uv(param_dict, clargs, output_basename, casa_instance): script = [] if glob.glob('{}.concat.ms'.format(output_basename)) and clargs.overwrite: os.system('rm -rf {}.concat.ms'.format(output_basename)) # casa_instance.run_script(script) # todo # write an extension of the drivecas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_uvs(mesh, bsp_verts):\n\n mesh.uv_textures.new(\"UVs\")\n bm = bmesh.new()\n bm.from_mesh(mesh)\n\n if hasattr(bm.faces, \"ensure_lookup_table\"): \n bm.faces.ensure_lookup_table()\n\n uv_layer = bm.loops.layers.uv[0]\n\n for face_idx, current_face in enumerate(bm.faces):\n ...
[ "0.5860706", "0.5756254", "0.558495", "0.55116755", "0.5500914", "0.54856575", "0.5411383", "0.53948486", "0.53849983", "0.5343461", "0.5337835", "0.5308709", "0.53073806", "0.53056586", "0.5296829", "0.5273831", "0.52715695", "0.5257271", "0.52373564", "0.5233863", "0.522525...
0.61613876
0
Drive the feather combination. Functionally, this means Cleaning the individual ms separately. Imaging the individual ms. Feathering the two together.
def _drive_feather(param_dict, clargs, output_basename, casa_instance): # todo later -> the imstat stuff script = [] thresh, seven_meter_clean_args = utils.param_dict_to_clean_input( param_dict, seven_meter=True) _, twelve_meter_clean_args = utils.param_dict_to_clean_input( param_dic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _removeFX(self):\r\n\t\tnodesToClean = [CONST.FOAM_FLUID_SHAPENODE, CONST.WAKE_FLUID_SHAPENODE, 'fluids_hrc']\r\n\t\tfor eachNode in nodesToClean:\r\n\t\t\ttry:\r\n\t\t\t\tcmds.delete(each)\r\n\t\t\texcept:\r\n\t\t\t\tpass\r\n\r\n\t\tfor eachCache in cmds.ls(type = 'cacheFile'):\r\n\t\t\tcmds.delete(eachCache)...
[ "0.53458524", "0.5341943", "0.5341767", "0.51823235", "0.51823235", "0.51713705", "0.51584935", "0.50687635", "0.50499785", "0.5038589", "0.50249314", "0.5024092", "0.5023892", "0.50143516", "0.49986392", "0.49689344", "0.49604985", "0.49398032", "0.49370384", "0.49188516", "...
0.72748023
0
Calculate weightings to use for the feather task
def _calc_feather_weighting(param_dict): weightings = param_dict['weightings'] if not isinstance(weightings, (list, tuple)): return 1.0 return float(weightings[1]) / float(weightings[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_weighted_results():\n pass", "def weight(self):", "def getWeight(self) -> float:\n ...", "def calculateWeights(self):\n return self.distances #En lo que encontramos una funcion que represente", "def get_weights(self):", "def calculate_weights():\n weights = {}\n...
[ "0.7639016", "0.75578135", "0.7499282", "0.73658234", "0.72466195", "0.7217344", "0.7214428", "0.7214428", "0.7117307", "0.7097232", "0.70433426", "0.6888601", "0.6846439", "0.68106675", "0.6809401", "0.6799938", "0.67643374", "0.6751411", "0.6691422", "0.6686457", "0.6686457...
0.7724041
0
Automatically generate a basename or else use the one provided.
def _gen_basename(param_dict, clargs): if param_dict['output_basename'] in ['', 'auto']: return clargs.input_fname.lower().split('.json')[0] else: return param_dict['output_basename']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_fullname(basename, _type=None):\n return '{}.{}'.format(basename, extensions.get(_type, None))", "def _gen_fname(self, basename, cwd=None, suffix=None, change_ext=True, ext=None):\n if not basename:\n msg = \"Unable to generate filename for command %s. \" % self.cmd\n msg...
[ "0.7162985", "0.71130204", "0.71064943", "0.70725805", "0.70725805", "0.6988176", "0.6869497", "0.6849551", "0.672568", "0.6704061", "0.66934615", "0.65571934", "0.6534404", "0.64742374", "0.6473847", "0.646789", "0.6352444", "0.6296653", "0.6274127", "0.62643063", "0.6244662...
0.77820414
0
! Create ssh client. Create ssh client to run commands in host machine from inside container.
def create_client(): hostname = "localhost" username = "she393" password = os.getenv("PASSWORD") client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.connect(hostname=hostname, username=username, password=password) return client
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_sshclient(host, user, port, secret):\n ssh_client = paramiko.SSHClient()\n ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())\n ssh_client.load_system_host_keys()\n if secret and port:\n ssh_client.connect(hostname=host, username=user, password=secret, port=port)\n elif...
[ "0.69851446", "0.6791386", "0.6668736", "0.6655599", "0.6630987", "0.65980434", "0.6580812", "0.65597147", "0.655599", "0.6490338", "0.641064", "0.6405131", "0.6365197", "0.63595355", "0.6352704", "0.6299737", "0.62719107", "0.62428546", "0.6240554", "0.6232706", "0.6225897",...
0.7121306
0
! Wrapper for HTTP responses. message The content of the successful (200) HTTP response. Flask HTTP response object with content of message from the argument and status code 200.
def response(message): res = Response(json.dumps(message)) res.status_code = 200 res.content_type = "application/json" return res
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def response(status, message, code):\n return make_response(jsonify({\n 'status': status,\n 'message': message\n })), code", "def HandleResponse(data,message,success = True,err = 'no err',resp_status = status.HTTP_200_OK):\n return Response({\n 'success':success,\n \"error\":...
[ "0.8077968", "0.7261069", "0.7197937", "0.71356225", "0.7122571", "0.7062746", "0.70605296", "0.70228976", "0.7000634", "0.69415414", "0.6871562", "0.67692024", "0.6674502", "0.6664123", "0.65871406", "0.65599144", "0.6558028", "0.65498847", "0.6513427", "0.6454303", "0.64455...
0.7737896
1
One to one identification of the snapshots.
def snapshot_identification(snapshot): return { 'user_id': snapshot['user_id'], 'timestamp': snapshot['timestamp'], 'snapshot_id': snapshot['snapshot_id']}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unique_id(self):\n return f\"{DOMAIN}_{self._cam_name}_{self._obj_name}_snapshot\"", "def snapshot_id(self) -> Optional[str]:\n return pulumi.get(self, \"snapshot_id\")", "def snapshot_id(self) -> Optional[str]:\n return pulumi.get(self, \"snapshot_id\")", "def snapshot_id(self) -> O...
[ "0.6157024", "0.6145881", "0.6145881", "0.58339775", "0.58339775", "0.58339775", "0.5751372", "0.5697604", "0.5678704", "0.55947214", "0.5580041", "0.5498619", "0.5444909", "0.54207444", "0.53875417", "0.5353588", "0.5305235", "0.52906895", "0.5282701", "0.5255412", "0.525408...
0.6568016
0
The AccountBroker initialze() function before we added the policy stat table. Used by test_policy_table_creation() to make sure that the AccountBroker will correctly add the table for cases where the DB existed before the policy support was added.
def prespi_AccountBroker_initialize(self, conn, put_timestamp, **kwargs): if not self.account: raise ValueError( 'Attempting to create a new database with no account set') self.create_container_table(conn) self.create_account_stat_table(conn, put_timestamp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pre_init(self) -> None:\n self._check_and_set_network()\n self._check_and_apply_migrations()", "def initialize():\n DATABASE.connect()\n DATABASE.create_tables([User, Entry], safe=True)\n DATABASE.close()", "def init():\n database.create_tables([Tracker])\n database.com...
[ "0.66067785", "0.6455682", "0.6373156", "0.63563114", "0.63563114", "0.62698793", "0.6163393", "0.6154188", "0.60957396", "0.60849506", "0.60809666", "0.5964424", "0.5955808", "0.5944223", "0.5935643", "0.5916183", "0.591556", "0.5893408", "0.58916914", "0.5885537", "0.587170...
0.73197085
0
Copied from AccountBroker before the metadata column was added; used for testing with TestAccountBrokerBeforeMetadata. Create account_stat table which is specific to the account DB.
def premetadata_create_account_stat_table(self, conn, put_timestamp): conn.executescript(''' CREATE TABLE account_stat ( account TEXT, created_at TEXT, put_timestamp TEXT DEFAULT '0', delete_timestamp TEXT DEFAULT '0', container_count INTEGER, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pre_track_containers_create_policy_stat(self, conn):\n conn.executescript(\"\"\"\n CREATE TABLE policy_stat (\n storage_policy_index INTEGER PRIMARY KEY,\n object_count INTEGER DEFAULT 0,\n bytes_used INTEGER DEFAULT 0\n );\n INSERT OR IGNORE INTO policy...
[ "0.6411355", "0.5693446", "0.5648235", "0.5506348", "0.5451028", "0.53575075", "0.53320557", "0.52726936", "0.5267531", "0.5266184", "0.5225775", "0.5171474", "0.5141938", "0.51097775", "0.5103295", "0.5092772", "0.50799894", "0.5075006", "0.5058689", "0.5051445", "0.5033744"...
0.76754844
0
Copied from AccountBroker before the sstoage_policy_index column was added; used for testing with TestAccountBrokerBeforeSPI. Create container table which is specific to the account DB.
def prespi_create_container_table(self, conn): conn.executescript(""" CREATE TABLE container ( ROWID INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, put_timestamp TEXT, delete_timestamp TEXT, object_count INTEGER, bytes_used INTEGER, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pre_track_containers_create_container_table(self, conn):\n # revert to old trigger script to support one of the tests\n OLD_POLICY_STAT_TRIGGER_SCRIPT = \"\"\"\n CREATE TRIGGER container_insert_ps AFTER INSERT ON container\n BEGIN\n INSERT OR IGNORE INTO policy_stat\n ...
[ "0.7222646", "0.66707873", "0.5947068", "0.5887795", "0.58477587", "0.5694725", "0.56702393", "0.56475055", "0.56451815", "0.56367904", "0.5633519", "0.55940306", "0.55933654", "0.55901736", "0.5587355", "0.55573237", "0.555128", "0.5534241", "0.55316937", "0.55145425", "0.55...
0.6937344
1
Copied from AccountBroker before the container_count column was added. Create policy_stat table which is specific to the account DB. Not a part of Pluggable Backends, internal to the baseline code.
def pre_track_containers_create_policy_stat(self, conn): conn.executescript(""" CREATE TABLE policy_stat ( storage_policy_index INTEGER PRIMARY KEY, object_count INTEGER DEFAULT 0, bytes_used INTEGER DEFAULT 0 ); INSERT OR IGNORE INTO policy_stat ( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pre_track_containers_create_container_table(self, conn):\n # revert to old trigger script to support one of the tests\n OLD_POLICY_STAT_TRIGGER_SCRIPT = \"\"\"\n CREATE TRIGGER container_insert_ps AFTER INSERT ON container\n BEGIN\n INSERT OR IGNORE INTO policy_stat\n ...
[ "0.6394596", "0.6312397", "0.52926415", "0.5226492", "0.521135", "0.5126524", "0.50752866", "0.50496316", "0.49747297", "0.49588305", "0.4934026", "0.48855892", "0.48768532", "0.4860666", "0.48166457", "0.4806398", "0.4796792", "0.4787185", "0.477994", "0.47572404", "0.475716...
0.8145411
0
Copied from AccountBroker before the container_count column was added (using old stat trigger script) Create container table which is specific to the account DB.
def pre_track_containers_create_container_table(self, conn): # revert to old trigger script to support one of the tests OLD_POLICY_STAT_TRIGGER_SCRIPT = """ CREATE TRIGGER container_insert_ps AFTER INSERT ON container BEGIN INSERT OR IGNORE INTO policy_stat (storage_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prespi_create_container_table(self, conn):\n conn.executescript(\"\"\"\n CREATE TABLE container (\n ROWID INTEGER PRIMARY KEY AUTOINCREMENT,\n name TEXT,\n put_timestamp TEXT,\n delete_timestamp TEXT,\n object_count INTEGER,\n bytes_us...
[ "0.74409187", "0.7198487", "0.61117744", "0.59451663", "0.5910709", "0.58744675", "0.5785568", "0.57599217", "0.5757854", "0.5751283", "0.5730389", "0.5673858", "0.56548923", "0.5640886", "0.5640633", "0.56349385", "0.56337035", "0.56274104", "0.5623988", "0.5606793", "0.5597...
0.75585115
0
Compute the class count of ROIs for each sample.
def count_classes(self, index=None): if index is None: index = np.arange(self.Samples.shape[0]) elif isinstance(index, int): index = [index] count = np.zeros((len(index), len(self._classes)), dtype=np.int) for _ind in range(len(index)): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_num_classes(self):", "def resultCounter(detections):\n counter = 0\n for attribute, value in classIterator(detections):\n if 'crease' in attribute:\n counter += len(value)\n return counter", "def class_counts(rows):\n counts = {} # a dictionary of label -> count.\n for...
[ "0.6769185", "0.6670084", "0.6666405", "0.6666405", "0.6666405", "0.6578789", "0.6500897", "0.64842236", "0.6412822", "0.63247687", "0.6280898", "0.6262814", "0.62501544", "0.6188363", "0.6161805", "0.6135146", "0.6125166", "0.6116448", "0.60772496", "0.6040804", "0.60212356"...
0.73258656
0
Find the maximum number of ROIs per batch sample in the dataset
def get_max_rois(self): maxsize = 0 for index in self.SampleID: rois = self.__getrois__(index); maxsize = max(maxsize, rois.shape[0]) return maxsize
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __len__(self):\n return int(np.ceil(self.max_index / float(self.batch_size)))", "def max_num_batches(self):\n return self._max_num_batches", "def max_individuals(self) -> int:\n return self.group_size.upper * self.groups_allowed", "def __len__(self):\n return int(np.ceil(len(s...
[ "0.6792534", "0.659393", "0.65083873", "0.64983654", "0.6442182", "0.6357087", "0.6351913", "0.63443124", "0.6337801", "0.630785", "0.62681437", "0.6250322", "0.6208346", "0.6205874", "0.616179", "0.61612123", "0.6137554", "0.6132003", "0.612465", "0.6107981", "0.61064506", ...
0.78903097
0
Makes dictionary of the station and their amount of connections.
def make_station_dict(self): self.station_dict = {} # interates over stations and puts the amount of connections in the dict for station in self.stations: length = len(self.stations[station].connections) self.station_dict[station] = length return self.st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stations_dict(self):\n return self.__stations_dict", "def get_online_count():\n return dict(online_user=get_online_users())", "def getConnections():\n\n c = psutil.net_connections()\n connects = {}\n\n count = 0\n for connection in c:\n conn = {}\n status = connection.st...
[ "0.66026574", "0.6212001", "0.61680955", "0.61130697", "0.60983795", "0.60969037", "0.6081789", "0.6016051", "0.59923977", "0.58641666", "0.5816404", "0.58135796", "0.5811761", "0.5791444", "0.5785143", "0.577446", "0.5770902", "0.57675856", "0.5764687", "0.57554936", "0.5753...
0.8745632
0
Sorts the station dict based on the amount of connections (value).
def create_station_list(self): sorted_station_list = sorted(self.station_dict, key=self.station_dict.get) return sorted_station_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort(self):\n\t\tself.servers = sorted(self.servers, key=lambda s: s.load)\n\t\tself.servers = sorted(self.servers, key=lambda s: s.distance_class)\n\t\tself.servers = sorted(self.servers, key=lambda s: s.country == self.locale_info.country, reverse=True)", "def _get_sorted_by_n_connections(m):\n small = ...
[ "0.6438473", "0.6063636", "0.5954494", "0.5753256", "0.572934", "0.5722744", "0.55783653", "0.54763424", "0.5446469", "0.54192704", "0.5373764", "0.531757", "0.5296655", "0.5287621", "0.5285237", "0.5215991", "0.52076167", "0.52006", "0.5183816", "0.51670825", "0.51528376", ...
0.6300883
1
Tries all possible configurations starting at the first station and only adds the configuration with the best score.
def visit_all_possibilities(self, first_station, track, grid): # loops over connections of station for connection in first_station.connections: # keeps adding untill the max length of a track is reached if track.add_station(grid, self.stations[connection].name): #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pick_next_station(self, station):\n self.best_score = 0\n\n stations = self.grid.stations\n # all connections of the last added added station \n lookahead_1 = self.grid.get_station(self.best_connection[1]).connections\n\n for la1 in lookahead_1.values():\n next_sta...
[ "0.7005242", "0.66232514", "0.6464399", "0.62459195", "0.6219636", "0.6025062", "0.5821818", "0.58028185", "0.56950855", "0.5568496", "0.5530859", "0.5526991", "0.55262834", "0.5522291", "0.547059", "0.5425894", "0.54113275", "0.5394614", "0.5392455", "0.5378019", "0.53733134...
0.71698874
0
creates a species identified by taxid and containing empty dictionnary of orthologs
def __init__(self, taxid, species_name = None, lineage=None): self.genes = dict() self.taxid = taxid self.species = species_name self.lineage = lineage
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_taxon():\n if not exists('./data/taxdmp.zip'):\n ftp = FTP('ftp.ncbi.nih.gov')\n ftp.login()\n ftp.cwd('pub/taxonomy')\n ftp.retrbinary('RETR taxdmp.zip', open('./data/taxdmp.zip', 'wb').write)\n ftp.quit\n with ZipFile('./data/taxdmp.zip', 'r') as dumpfile:\n ...
[ "0.62028277", "0.5643144", "0.55928254", "0.5586047", "0.5550129", "0.5545237", "0.55178034", "0.54141647", "0.5405542", "0.5331211", "0.528797", "0.52788687", "0.5253945", "0.52389264", "0.5223071", "0.52124864", "0.516965", "0.51686347", "0.51635945", "0.49660262", "0.49572...
0.6710074
0
add an entry in the dic with key "human gene ID" and value "ortholog gene ID"
def add_gene(self, human_gene, ortholog): if human_gene not in self.genes: self.genes[human_gene] = list() self.genes[human_gene].append(ortholog)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_gene_info(ensembl_info, word, value):\n if \"gene\" in word:\n if \"id\" in word:\n ensembl_info[\"ensembl_gene_id\"] = value\n elif \"start\" in word:\n ensembl_info[\"gene_start\"] = int(value)\n elif \"end\" in word:\n ensembl_info[\"gene_end\"...
[ "0.65119916", "0.5768898", "0.5745668", "0.5678076", "0.56137764", "0.5577298", "0.5574873", "0.5562769", "0.55310345", "0.54852855", "0.5448665", "0.5448038", "0.5416714", "0.54129606", "0.54046834", "0.539394", "0.5387726", "0.53722453", "0.5369394", "0.53620994", "0.535825...
0.7082176
0
Execute default analysis with baySeq
def run_bayseq(self): try: res = robjects.r('library("parallel")') res = robjects.r('library("stats4")') res = robjects.r('library("BiocGenerics")') res = robjects.r('library("S4Vectors")') res = robjects.r('library("IRanges")') res = robje...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(self):\n try:\n self.parse_args()\n self.run()\n return 0\n except AnalysisBackendError as e:\n L.error(e)\n return 1", "def run_analysis(self, argv):\n self._run_argparser(argv)\n self.run()", "def run(self) :\n# print \"evaluating with laban\"\n ...
[ "0.5965446", "0.5941467", "0.5888768", "0.5804564", "0.57392657", "0.5699895", "0.5644962", "0.5548859", "0.5535779", "0.5506015", "0.54572743", "0.54180855", "0.5404095", "0.54018456", "0.53995997", "0.53812164", "0.53697616", "0.5368945", "0.5345558", "0.5340646", "0.533377...
0.6089528
0
Returns the requested income range view in full detail.
def GetIncomeRangeView(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getRange(self):\n return self.range", "def displayActiveRange(selforcls):\n vRange = selforcls.activeRange()\n try:\n vRange = (selforcls.toDisplay(min(vRange)),\n selforcls.toDisplay(max(vRange)))\n except AttributeError:\n pass # toDisp...
[ "0.5824725", "0.5612662", "0.55873716", "0.54605365", "0.54605365", "0.5444421", "0.5324229", "0.5322225", "0.5300629", "0.5277442", "0.5269223", "0.5262803", "0.5230335", "0.52228105", "0.5218109", "0.51848346", "0.5179088", "0.51768607", "0.5176457", "0.51640767", "0.515955...
0.700728
0
Runs a single byte through the packet parsing state amchine. Returns NOT_DONE if the packet is incomplete. Returns SUCCESS is the packet was received successfully. Returns CHECKSUM if a checksum error is detected.
def process_byte(self, byte): if self.index == -1: if byte == 0xff: self.index = 0 self.checksum = 0 elif self.index == 0: if byte != 0xff: self.checksum += byte self.pkt_bytes[0] = byte self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readCommand(self):\n while (True):\n time.sleep(1)\n # At least a package of 4 bytes (minimum)\n # [ Head | Length | Address | Data[0…N] | Check ]\n if (self._serial.inWaiting()>=4):\n # Gets only the first byte of the packet (it should be HEAD)...
[ "0.5792792", "0.56804043", "0.5637224", "0.55658627", "0.5561786", "0.5408823", "0.53773457", "0.5322868", "0.5277083", "0.52678686", "0.52137786", "0.5208731", "0.51964766", "0.5184436", "0.51623356", "0.5156039", "0.51016897", "0.51004124", "0.50996864", "0.508539", "0.5084...
0.6739887
0
Registers a function to run before each request.
def before_request(self, f): self.before_request_funcs.append(f) return f
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def before_request(self, func: typing.Callable):\n return self.add_hook(type_=\"pre\", hook=func)", "def before_request(self, f):\n self.before_request_handlers.append(f)\n return f", "def before_worker_start(func):\n _func_only(func)\n worker_methods_db.register_before_start(func)\n...
[ "0.8118946", "0.7769813", "0.69504994", "0.67644304", "0.6689539", "0.65856653", "0.65145713", "0.64500964", "0.6426918", "0.6376406", "0.6375528", "0.63239646", "0.6193873", "0.6136782", "0.59849536", "0.5943737", "0.58747", "0.5869897", "0.5857567", "0.58538926", "0.5827149...
0.81964976
0
Register a function to be run after each request.
def after_request(self, f): self.after_request_funcs.append(f) return f
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after_request_handle(self, func):\n self.after_request.append(func)\n return func", "def after_request(self, f):\n self.after_request_handlers.append(f)\n return f", "def after_request(self, f):\n self.after_request_handlers.append(f)\n return f", "def after_requ...
[ "0.7849521", "0.7643819", "0.7643819", "0.75291634", "0.62461793", "0.618368", "0.61611503", "0.61363375", "0.6126715", "0.61173093", "0.6038293", "0.5960427", "0.5939071", "0.5817307", "0.57547176", "0.57469493", "0.57465345", "0.573892", "0.56387985", "0.5626159", "0.562473...
0.79526246
0
Registers a template context processor function.
def context_processor(self, f): self.template_context_processors.append(f) return f
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register(self):\n REGISTERED_FUNCTIONS[self.path] = self", "def test_enable_extension_registers_context_processors(self):\n class TestExtension(Extension):\n context_processors = ['my_custom_processor']\n\n # Back up the list, so we can replace it later.\n if hasattr(se...
[ "0.56674093", "0.56304383", "0.5513914", "0.5493239", "0.5407706", "0.5372997", "0.52977866", "0.52085143", "0.5204628", "0.51973486", "0.5171223", "0.51613235", "0.51562536", "0.51132387", "0.5089765", "0.50798845", "0.5026726", "0.499174", "0.4989556", "0.49833864", "0.4970...
0.75228786
0
Enroll a new profile to Azure Speaker ID.
def enroll_profile(region, subscription_key, wav_path): fs, audio_data = _check_and_load_wav_file_length(wav_path) profile_id = _add_profile(region, subscription_key) url = "%s/speaker/identification/v2.0/text-independent/profiles/%s/enrollments" % ( _get_azure_endpoint(region), profile_id) headers = { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put(self, id):\n adm = Administration()\n print(api.payload)\n lp = LearnProfile.from_dict(api.payload)\n if lp is not None:\n lp.set_id(id)\n adm.save_learnprofile(lp)\n return lp, 200\n\n else:\n return '', 500", "def perform_cr...
[ "0.57121813", "0.5669998", "0.55642205", "0.5468942", "0.54388547", "0.5423377", "0.5405765", "0.53824395", "0.5380911", "0.5366512", "0.52692974", "0.52692974", "0.52692974", "0.52692974", "0.52692974", "0.52692974", "0.525241", "0.5236725", "0.5225078", "0.52119666", "0.520...
0.72638845
0
Calculates the number of suicides for a type of agent given game mode, observability, and game seed. If game seed passed is 1, then all game seeds are aggregated.
def suicide_query(game_mode=0, observability=-1, game_seed=-1, agent=-1): event_id = "death" # Keep only those games within given configuration if game_seed != -1: selection = data.loc[(data['game_mode'] == game_mode) & (data['observability'] == observability) & (data[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_agent_number_of_players(players):\n return sum([count_players(player) for player in players\n if player.startswith('agent')])", "def test_winners_per_type_sum(self):\n sim = ss.Simulation()\n sim.run_simulation(14)\n winners = sim.winners_per_type()\n assert sum(...
[ "0.56811786", "0.5137774", "0.5076857", "0.503548", "0.4957199", "0.4900915", "0.48782182", "0.4876376", "0.48688662", "0.48500103", "0.47992226", "0.47777793", "0.475898", "0.4754263", "0.47437844", "0.47234103", "0.47161484", "0.4714737", "0.4711583", "0.47112495", "0.47099...
0.65967184
0
Create a module item.
def create_module_item(self, module_item, **kwargs): unrequired_types = ["ExternalUrl", "Page", "SubHeader"] if isinstance(module_item, dict) and "type" in module_item: # content_id is not required for unrequired_types if module_item["type"] in unrequired_types or "content_id" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_item(request):\r\n usage_key = UsageKey.from_string(request.json['parent_locator'])\r\n category = request.json['category']\r\n\r\n display_name = request.json.get('display_name')\r\n\r\n if not has_course_access(request.user, usage_key.course_key):\r\n raise PermissionDenied()\r\n\r...
[ "0.7228198", "0.65279996", "0.63207406", "0.63207406", "0.6307136", "0.6218153", "0.6193564", "0.61688536", "0.6122195", "0.61181813", "0.60919625", "0.6052571", "0.6050587", "0.6030838", "0.6015427", "0.6014498", "0.6013799", "0.59456086", "0.5937084", "0.5928567", "0.592497...
0.7833921
0
Delete this module item.
def delete(self, **kwargs): response = self._requester.request( "DELETE", "courses/{}/modules/{}/items/{}".format( self.course_id, self.module_id, self.id ), _kwargs=combine_kwargs(**kwargs), ) module_item_json = response.json() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __do_module_delete(item):\n\n file_path = DTF_MODULES_DIR + item.install_name\n\n if utils.delete_file(file_path) != 0:\n log.e(TAG, \"Error removing module file! Continuing.\")\n\n conn = sqlite3.connect(DTF_DB)\n cur = conn.cursor()\n\n # Remove the line first.\n sql = ('DELETE FROM ...
[ "0.76490295", "0.76386184", "0.7293862", "0.7082898", "0.7029256", "0.7006791", "0.6655195", "0.66186965", "0.66186965", "0.66186965", "0.66186965", "0.6595931", "0.657923", "0.65764403", "0.65764403", "0.65596324", "0.65374285", "0.6532332", "0.65124965", "0.6511554", "0.650...
0.7723441
0
One sample/paired sample permutation test based on a tstatistic. This function can perform the test on one variable or simultaneously on multiple variables. When applying the test to multiple variables, the "tmax" method is used for adjusting the pvalues of each variable for multiple comparisons. Like Bonferroni correc...
def permutation_t_test( X, n_permutations=10000, tail=0, n_jobs=None, seed=None, verbose=None ): from .cluster_level import _get_1samp_orders n_samples, n_tests = X.shape X2 = np.mean(X**2, axis=0) # precompute moments mu0 = np.mean(X, axis=0) dof_scaling = sqrt(n_samples / (n_samples - 1.0)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def PermutationTest(self):\n # U = union of B and T\n union_sample = np.concatenate((self.x_benchmark, self.x_trial), axis=0)\n n_samples = self.NB + self.NT\n \n # Initialize array of test statistic values\n self.TS_tilde = np.zeros(self.n_perm, dtype=np.float)\n \...
[ "0.66151273", "0.6504498", "0.60829633", "0.6001584", "0.5969407", "0.5941336", "0.5911625", "0.5903978", "0.5805787", "0.5780182", "0.57714087", "0.56875885", "0.56720537", "0.56512654", "0.5612089", "0.55364573", "0.5505601", "0.55000603", "0.5491501", "0.54649895", "0.5463...
0.70762056
0
Get confidence intervals from nonparametric bootstrap.
def bootstrap_confidence_interval( arr, ci=0.95, n_bootstraps=2000, stat_fun="mean", random_state=None ): if stat_fun == "mean": def stat_fun(x): return x.mean(axis=0) elif stat_fun == "median": def stat_fun(x): return np.median(x, axis=0) elif not callable(st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confidence_intervals(data):\r\n\r\n x_bar = np.nanmean(data) # Mean value\r\n s = np.nanstd(data) # Standard deviation\r\n n = len(data) # Sample size\r\n\r\n lo_conf = x_bar - (1.96 * (s / np.sqrt(n))) # Lower bound of confidence interval\r\n hi_conf = x_bar + (1.96 * ...
[ "0.6679884", "0.6648013", "0.6620062", "0.66174746", "0.6499037", "0.646875", "0.6136825", "0.6136825", "0.61319476", "0.6111559", "0.60788226", "0.6075902", "0.6074073", "0.5812202", "0.5790033", "0.57862234", "0.57668763", "0.57511514", "0.574001", "0.5700028", "0.5675738",...
0.6944301
0
Check if word is provided in slot values. Send word to URLbuilder and return JSON data. Give user definition information.
def my_word_definition_handler(handler_input): # type: (HandlerInput) -> Response slots = handler_input.request_envelope.request.intent.slots if word_slot in slots: curr_word = slots[word_slot].value handler_input.attributes_manager.session_attributes[ word_slot_key] = curr_word...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def my_word_example_handler(handler_input):\n # type: (HandlerInput) -> Response\n slots = handler_input.request_envelope.request.intent.slots\n\n if example_slot in slots:\n curr_word = slots[example_slot].value\n handler_input.attributes_manager.session_attributes[\n example_slo...
[ "0.61216205", "0.58270305", "0.58179843", "0.57400197", "0.5649318", "0.5606277", "0.5591704", "0.5455674", "0.5431328", "0.5341701", "0.5329532", "0.52859133", "0.5281709", "0.52787936", "0.52630574", "0.51918024", "0.51817644", "0.5147042", "0.51228225", "0.5112976", "0.511...
0.6205886
0
This function handles the example sentence intent
def my_word_example_handler(handler_input): # type: (HandlerInput) -> Response slots = handler_input.request_envelope.request.intent.slots if example_slot in slots: curr_word = slots[example_slot].value handler_input.attributes_manager.session_attributes[ example_slot_key] = cur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sentence(self):", "def onCurrentSentence(self, *_args):\n global instance\n log(str(_args))\n #if (instance.isSpeaking and len(_args[1])==0): instance.SpeakDone()\n return", "def hook(self, sentence, words):\n pass", "def handle_gui_example_three_intent(self, messag...
[ "0.67601943", "0.6399362", "0.6366831", "0.63550425", "0.6288494", "0.62700784", "0.6220967", "0.6183083", "0.6126741", "0.6104425", "0.60613656", "0.60591984", "0.6058863", "0.59571433", "0.5951869", "0.59310657", "0.5929599", "0.5913799", "0.5897607", "0.589439", "0.5894384...
0.653233
1
AMAZON.FallbackIntent is only available in enUS locale. This handler will not be triggered except in that locale, so it is safe to deploy on any locale.
def fallback_handler(handler_input): # type: (HandlerInput) -> Response speech = ( "The {} skill can't help you with that. " "I can look up a word in the dictionary for you").format(skill_name) reprompt = ("I can look up a word in the dictionary, " "Just say any word in Engli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fall_back_message():\r\n card_title = \"Fallback Message\"\r\n fallback_string = \"Sorry. I couldn't understood it. Please say again.\"\r\n should_end_session = False\r\n session_attributes = { \r\n \"speech_output\": fallback_string,\r\n \r\n ...
[ "0.5877872", "0.5590493", "0.54645765", "0.54645765", "0.5408452", "0.5357488", "0.5357488", "0.53020567", "0.52696717", "0.5181241", "0.5174385", "0.5174385", "0.5167612", "0.51544356", "0.5071739", "0.5060613", "0.5031619", "0.49786136", "0.4932573", "0.4868343", "0.4852090...
0.5607832
1
Return list of snapshot_ids associated with the given image
def getSnapshotsOf(image): snapshotIds = [] deviceMapping = image.block_device_mapping # dict of devices devices = deviceMapping.keys() for d in devices: snapshotId = deviceMapping[d].snapshot_id if snapshotId is not None: snapshotIds.append(snapshotId.encode()) return s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_snapshots_of(image):\n snapshot_ids = []\n device_mapping = image.block_device_mapping # dict of devices\n devices = device_mapping.keys()\n for device in devices:\n if device_mapping[device].snapshot_id is not None:\n snapshot_ids.append(device_mappin...
[ "0.82660115", "0.6894388", "0.6246945", "0.6215981", "0.61946225", "0.60906774", "0.6078066", "0.607749", "0.5850587", "0.5829291", "0.5715038", "0.57149994", "0.5700483", "0.56884575", "0.5666648", "0.5638562", "0.56358933", "0.56192404", "0.55592096", "0.55305934", "0.55255...
0.8464934
0
Use dictionaries 'cos we'll have to crossreference to get snapshots that go with the AMIs returns list of dictionaries representing images from one region
def getImagesD(region): images = getImages(region) imageDicts = [] for im in images: imageDict = {"name": im.name, "id": im.id, "region": im.region.name, "state": im.state, "created": im.creationDate, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSnapshotsD(region):\n # Can a snapshot belong to more than one AMI? Dunno, keep list just in case (so it never breaks due to it)\n snapshots = getSnapshots(region)\n snapshotsDicts = []\n ims = getImages(region)\n for s in snapshots:\n amis = getAmisOf(s, ims)\n amiIds = []\n ...
[ "0.74375165", "0.669343", "0.6320971", "0.6303299", "0.6287237", "0.6220304", "0.6202331", "0.6175909", "0.60951483", "0.6012867", "0.60106635", "0.59991914", "0.59578496", "0.5940436", "0.5936577", "0.5930096", "0.5909181", "0.5908506", "0.5903435", "0.58975405", "0.5881977"...
0.7583085
0
return a list of dictionaries representing snapshots from one region
def getSnapshotsD(region): # Can a snapshot belong to more than one AMI? Dunno, keep list just in case (so it never breaks due to it) snapshots = getSnapshots(region) snapshotsDicts = [] ims = getImages(region) for s in snapshots: amis = getAmisOf(s, ims) amiIds = [] amiKeeps...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_snapshots(self, region):\n try:\n conn = ec2.connect_to_region(region, **self.credentials)\n region_snapshots = conn.get_all_snapshots(owner='self')\n except boto.exception.EC2ResponseError:\n return []\n return region_snapshots", "def items(self):\n ...
[ "0.71616983", "0.68013346", "0.64756656", "0.6455287", "0.6392508", "0.6385133", "0.63725513", "0.6275416", "0.6235013", "0.62241733", "0.6165991", "0.6158216", "0.6134359", "0.605335", "0.6047018", "0.6043569", "0.6014061", "0.5964335", "0.5959861", "0.59526664", "0.5890748"...
0.78463835
0
return a list of dictionaries representing volumes from one region
def getVolumesD(region): volumes = getVolumes(region) instances = getInstancesD(region) volumesDicts = [] for v in volumesDicts: volumesDict = {"id": v.id, "KEEP-tag": getKeepTag(v), "instance_KEEP-tag": getKeepTag(getInstanceOf(v)), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_volumes(self, region):\n try:\n conn = ec2.connect_to_region(region, **self.credentials)\n region_volumes = conn.get_all_volumes()\n except boto.exception.EC2ResponseError:\n return [] # This better not fail silently or I'll cut a person.\n return regi...
[ "0.70386356", "0.68808", "0.6829185", "0.68042403", "0.6804185", "0.66357", "0.65796185", "0.6541075", "0.64998627", "0.6476049", "0.6467089", "0.6443325", "0.641429", "0.64000684", "0.62908834", "0.62458056", "0.61916316", "0.6191406", "0.611974", "0.6119484", "0.61047727", ...
0.77420294
0
return a list of dictionaries representing instances for one region, will help with volumeinstanceKEEPtag lookup. Maybe.
def getInstancesD(region): instances = getInstances(region) instancesDicts = {"id": i.id, "KEEP-tag": getKeepTag(i), "instance_type": i.instance_type, "state": i.state, "launch_time": i.launch_time, "se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_instances(self, region):\n try:\n conn = ec2.connect_to_region(region, **self.credentials)\n region_instances = []\n reservations = conn.get_all_reservations()\n for reservation in reservations:\n for instance in reservation.instances:\n ...
[ "0.72672004", "0.71622515", "0.68902445", "0.68787754", "0.68357", "0.6603997", "0.6595504", "0.6591907", "0.6584421", "0.6475704", "0.6437322", "0.64160633", "0.63718474", "0.63532615", "0.63506424", "0.63015544", "0.62685406", "0.6161752", "0.6136149", "0.61351824", "0.6126...
0.7885678
0
retrieve list of AMIs that refer to a given snapshot
def getAmisOf(snapshot, images): amis = [] for im in images: snapshotsOfThisIm = getSnapshotsOf(im) for soti in snapshotsOfThisIm: if soti == snapshot.id: amis.append(im) return amis
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_amis_of(snapshot_id):\n mes_amis = []\n # There has GOT to be a better way. Hmm... maybe not\n keys = Ims.spreadsheet.keys()\n for key in keys:\n if snapshot_id in Ims.spreadsheet[key]['associated_snapshots']:\n mes_amis.append(key)\n return mes_...
[ "0.72130966", "0.6595902", "0.6541823", "0.6166669", "0.61240566", "0.60049653", "0.59619623", "0.5923196", "0.5922994", "0.5888076", "0.5858373", "0.5827235", "0.58137566", "0.580514", "0.57657516", "0.57389045", "0.5632397", "0.56060064", "0.5601814", "0.56017476", "0.55515...
0.77030766
0
If tag with key='KEEP' exists, return its value (can be an empty string), else it's 'notag'
def getKeepTag(obj): if 'KEEP' in obj.tags: return obj.tags['KEEP'] else: return "-------no-tag" # try: # tag = obj.tags['KEEP'] # except: # # Note: some with empty KEEP-tags, through web console they look the same as those untagged # return "-----" # return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_keep_tag(obj):\n if 'KEEP' in obj.tags and len(obj.tags['KEEP'].strip()) != 0:\n return obj.tags['KEEP']\n else:\n return \"-------no-tag\"", "def tag_word(self, w): \n if self.unknown(w):\n return self.default_tag\n else:\n return ma...
[ "0.80788904", "0.5658676", "0.550251", "0.54886025", "0.53662133", "0.53030056", "0.52832705", "0.5201634", "0.51524514", "0.5135101", "0.51192683", "0.5106311", "0.5085387", "0.50634223", "0.50538707", "0.5035368", "0.49847323", "0.4977521", "0.49762967", "0.49733838", "0.49...
0.8014554
1
Returns true if the object (instance, volume, snapshot, AMI) has a tag with 'PROD' for key
def isProduction(obj): return 'PROD' in obj.tags # This is deprecated? obj.tags.has_key('PROD')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tag_key_exists(self, key):\n return key in self.map", "def hastag(obj, key):\n key = TAG_PREFIX + key\n if not isinstance(obj, unittest.TestCase):\n return hasattr(obj, key)\n tc_method = getattr(obj, obj._testMethodName)\n return hasattr(tc_method, key) or hasattr(obj, key)", "de...
[ "0.63550603", "0.60692143", "0.59001714", "0.586084", "0.5793219", "0.57157636", "0.56831205", "0.56796306", "0.566162", "0.5619104", "0.5589269", "0.5552662", "0.55072737", "0.5455847", "0.5455847", "0.544153", "0.5431722", "0.54038215", "0.5395981", "0.5394134", "0.5378807"...
0.7877264
0
Write volumes to file
def generateInfoVolumes(regions): print "\nWriting volumes info to output file %s" % volumes_data_output_file with open(volumes_data_output_file, 'w') as f1: f1.write("VOLUMES\n") f1.write( "Name\tvolume_ID\tKEEP-tag_of_volume\tKEEP-tag_of_instance\tproduction?\tvolume_attachment_sta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_inventory_file(inventory_item):\n try:\n with open('inventory', 'w') as file:\n file.write(inventory_item)\n except OSError:\n pass", "def write(self, filename):\n pass", "def write(self, filename):\n pass", "def add_writable_file_vol...
[ "0.62202305", "0.59282184", "0.59282184", "0.5797909", "0.57411486", "0.570655", "0.5696261", "0.5676645", "0.5656309", "0.56229556", "0.5577266", "0.5544393", "0.55409503", "0.5499961", "0.5476858", "0.5472212", "0.54446274", "0.5439978", "0.54305", "0.54144007", "0.53972524...
0.59575117
1
Returns the application directory.
def get_appdir(): return APP_PATH
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app_dir(self):\n return self._app_dir", "def appdata_dir(self) -> str:\n return os.path.join(self._project_dir, 'appdata')", "def thisdir():\n if getattr(sys, 'frozen', False):\n # The application is frozen\n return os.path.dirname(sys.executable)\n else:\n # The applic...
[ "0.8366667", "0.7430168", "0.73666745", "0.7327246", "0.731593", "0.73079205", "0.7295801", "0.7282597", "0.7222026", "0.7218878", "0.72007245", "0.7196958", "0.71940666", "0.7193182", "0.71729344", "0.7168441", "0.7165291", "0.7127867", "0.70903516", "0.70903516", "0.708375"...
0.8947229
0
Return the TSV file corresponding to the current annotation level.
def tsv_name(): if PAR['level'] == 1: return 'col.tsv' else: return 'myc.tsv'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tsv_value(self):\n return self.tsv_file.getvalue()", "def export_tsv(self):\n outputfile = tkinter.filedialog.asksaveasfilename(\n defaultextension=\".tsv\",\n filetypes=((\"tab seperated values\", \"*.tsv\"),\n (\"All Files\", \"*.*\")))\n if ...
[ "0.5939053", "0.5729971", "0.54536223", "0.51073116", "0.5047787", "0.5043582", "0.50271034", "0.5015402", "0.48891845", "0.48566693", "0.48362452", "0.48115683", "0.4806834", "0.4803698", "0.48016763", "0.47835353", "0.47271547", "0.47254357", "0.47245374", "0.47214988", "0....
0.6666001
0
Indicate whether the current level is level 1 (colonization).
def colonization(): return get('level') == 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_single_level(self):\n return self.fragments_tree.height <= 2", "def is_flat(self):\n if self.master:\n return self.master.is_flat\n\n return len(self.levels) == 1", "def is_top_level(self) -> bool:\n return self._indent == ''", "def top_left_dot(self) -> bool:\n ...
[ "0.6308522", "0.60663605", "0.592682", "0.57595533", "0.5757749", "0.56357706", "0.56121695", "0.55404365", "0.5528773", "0.55099", "0.55035543", "0.54934734", "0.5432446", "0.5344056", "0.53366804", "0.53177035", "0.5317035", "0.5309982", "0.52847475", "0.52829605", "0.52761...
0.7897029
0
Indicate whether the current level is level 2 (AM fungal structures).
def intra_struct(): return get('level') == 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_subgroup(self, right):\n if right.level() == 1:\n return True\n if is_Gamma0(right):\n return self.level() % right.level() == 0\n if is_Gamma1(right):\n if right.level() >= 3:\n return False\n elif right.level() == 2:\n ...
[ "0.6321547", "0.62854135", "0.62632716", "0.6087753", "0.59138495", "0.5752362", "0.5700526", "0.56212634", "0.55640566", "0.55273724", "0.5408885", "0.5408016", "0.53746355", "0.53725296", "0.5317222", "0.5312037", "0.5294672", "0.52933645", "0.52883124", "0.5273141", "0.525...
0.66111106
0
Builds AMFinder commandline parser.
def build_arg_parser(): main = ArgumentParser(description='AMFinder command-line arguments.', allow_abbrev=False, formatter_class=RawTextHelpFormatter) subparsers = main.add_subparsers(dest='run_mode', required=True, help...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_parser(self, parser: ArgumentParser) -> None:", "def create_parser() -> configargparse.ArgParser:\n parser = configargparse.ArgParser(default_config_files=[\n \"/etc/lookout/analyzer.conf\", \"~/.config/lookout/analyzer.conf\"],\n formatter_class=ArgumentDefaultsHelpFormatterNoNone,\n ...
[ "0.69869363", "0.6829675", "0.6746405", "0.6673381", "0.66188794", "0.658462", "0.6580858", "0.6543717", "0.65387374", "0.6531024", "0.6523515", "0.6503992", "0.6499173", "0.64667153", "0.6449182", "0.6419928", "0.6393331", "0.6363311", "0.6360073", "0.6353206", "0.63527614",...
0.7635935
0
Returns absolute paths to input files.
def abspath(files): files = sum([glob.glob(x) for x in files], []) return [os.path.abspath(x) for x in files]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inputpathabs(self):\n return os.path.abspath(self.inputpath)", "def get_file_list(input_dir):\n\tfile_paths = [input_dir +'/' + f for f in listdir(input_dir) if isfile(join(input_dir, f)) ]\n\treturn file_paths", "def sources_absolute_paths(self):\r\n abs_target_base = os.path.join(get_buildroot(...
[ "0.6970691", "0.6879517", "0.6868738", "0.6868052", "0.67055565", "0.6700424", "0.65872943", "0.657331", "0.6540866", "0.651123", "0.65038157", "0.65028954", "0.6485323", "0.6448438", "0.63885504", "0.6380545", "0.63705975", "0.63195634", "0.6316908", "0.63139904", "0.6297403...
0.71486807
0
Creating a custom time entry, minimum must is hour duration and project param
def createTimeEntry(self, hourduration, description=None, projectid=None, projectname=None, taskid=None, clientname=None, year=None, month=None, day=None, hour=None, billable=False, hourdiff=-2): data = { "time_entry": {} } if not proj...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def running_custom_hour(arg):\n pass", "def __init__(self, hour, minute=0, second=0, microsecond=0, tzinfo=None):", "def timeField(*args, annotation: Union[AnyStr, bool]=\"\", backgroundColor: Union[List[float,\n float, float], bool]=None, changeCommand: Script=None, defineTemplate: AnyStr=\"\"...
[ "0.63917255", "0.63114077", "0.5988722", "0.5984777", "0.59670573", "0.59660786", "0.59379464", "0.5916419", "0.58417237", "0.58348185", "0.5833585", "0.5783263", "0.5764132", "0.5757329", "0.5752414", "0.57444865", "0.57442397", "0.5735035", "0.57336044", "0.5732334", "0.572...
0.68871313
0
Fast query given the Client's name and Project's name
def getClientProject(self, clientName, projectName): for client in self.getClients(): if client['name'] == clientName: cid = client['id'] if not cid: print('Could not find such client name') return None for projct in self.getClientProjects(ci...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def searchClientProject(self, name):\n for client in self.getClients():\n try:\n for project in self.getClientProjects(client['id']):\n if project['name'] == name:\n return project\n except Exception:\n continue\n\...
[ "0.68639714", "0.61412024", "0.5989478", "0.5867039", "0.5781275", "0.5674645", "0.566956", "0.56622523", "0.5642613", "0.5634638", "0.55459017", "0.5535563", "0.5528021", "0.5521917", "0.5521528", "0.54804444", "0.5467839", "0.5415431", "0.5400909", "0.53992367", "0.53678286...
0.6326702
1
Update data for an existing client. If the name or notes parameter is not supplied, the existing data on the Toggl server will not be changed.
def updateClient(self, id, name=None, notes=None): data = {} data['client'] = {} data['client']['name'] = name data['client']['notes'] = notes response = self.postRequest(Endpoints.CLIENTS + '/{0}'.format(id), parameters=data, method='PUT') return self.decodeJSON(respon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_client(client_name, updated_client_name): # Operacion modificar\n global clients\n\n if client_name in clients:\n index = clients.index(client_name)\n clients[index] = updated_client_name\n else:\n print(\"Client isn\\'t in the client list\")", "def test_update_client(se...
[ "0.67937523", "0.65493184", "0.6435495", "0.62011623", "0.6047726", "0.5984437", "0.5956502", "0.5945212", "0.5844981", "0.57898957", "0.5773103", "0.57370985", "0.5677678", "0.55478555", "0.5545997", "0.55407304", "0.55150896", "0.55113846", "0.5479551", "0.5476245", "0.5462...
0.7835998
0
This method will run all the episodes with epsilon greedy strategy
def run_epsilon(env, num_of_bandits, iterations, episodes): # Initialize total mean rewards array per episode by zero epsilon_rewards = np.zeros(iterations) for i in range(episodes): print(f"Running Epsilon episode:{i}") n = 1 action_count_per_bandit = np.ones(num_of_bandits) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self) -> None:\n for episode in range(1, self.episodes + 1):\n print('Episode:', episode)\n steps, state_action_history = self.run_one_episode()\n self.steps_per_episode.append(steps)\n if episode % parameters.CACHING_INTERVAL == 0 or steps < 1000:\n ...
[ "0.7450819", "0.7309439", "0.71770984", "0.7124558", "0.7124558", "0.7051895", "0.703537", "0.69566625", "0.684824", "0.68205166", "0.6802857", "0.68013686", "0.67991036", "0.6790752", "0.675303", "0.67489773", "0.67405975", "0.6739792", "0.67348915", "0.6732355", "0.6706088"...
0.74749076
0
Train agent over given number of iterations. Each iteration consists of self play over n_episodes and then a learn step where agent updates network based on random sample from replay buffer
def train(self, iters, n_episodes): for i in range(iters): self.self_play(n_episodes) self.learn()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def learn(self, num_episodes=10000):\n for i in range(num_episodes):\n self.actor()\n self.learner()", "def trainAgent(self):\r\n\t\tfor episode in range(self.TOT_EPISODES):\r\n\t\t\t#reset environment, stacked frames every episode.\r\n\t\t\tstate = self.env.reset()\r\n\t\t\trewards ...
[ "0.7785768", "0.76625186", "0.76138806", "0.7555034", "0.7430718", "0.7399803", "0.73953015", "0.73881173", "0.7361592", "0.72675776", "0.72441524", "0.7235535", "0.72085416", "0.71934515", "0.71493644", "0.71422166", "0.7102493", "0.7057307", "0.70422393", "0.70264834", "0.7...
0.81745845
0
generate pair message between node Hv and Hw. since the cat operation, msgs from hv > hw and hw > hv are different
def __init__(self, dim_hv, dim_hw, msg_dim): super(PairMessageGenerator, self).__init__() self.dim_hv, self.dim_hw, self.msg_dim = dim_hv, dim_hw, msg_dim self.in_dim = dim_hv + dim_hw # row * feature_dim, 2048 self.mlp = nn.Sequential( nn.LayerNorm(self.in_dim), # this lay...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_HHH(self, msg):\n self.prev_head = self.head\n self.head = msg.headx, msg.heady, msg.headz\n # self.torso = msg.torsox, msg.torsoy, msg.torsoz\n # self.Rhand = msg.Rhandx, msg.Rhandy, msg.Rhandz\n # self.Lhand = msg.Lhandx, msg.Lhandy, msg.Lhandz\n\n # if the dista...
[ "0.54044586", "0.5386834", "0.5290445", "0.51632214", "0.51632214", "0.51127476", "0.51023054", "0.50814384", "0.50715846", "0.50035816", "0.499038", "0.4964276", "0.4964276", "0.4964276", "0.49613354", "0.49603233", "0.49329245", "0.48807725", "0.48755825", "0.48755825", "0....
0.58693963
0
Import all model data using the loader.
def import_data(self): self.models = [] for o in self.loader.load(): klass = self.type_for(o) if hasattr(klass, "from_api"): self.models.append(klass.from_api(o)) else: self.models.append(klass(o)) return self.models
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def import_all():\n\n # count the number of files loaded\n count = 0\n\n # get model name\n model_name_list = [model for data_models in settings.OBJECT_DATA_MODELS\n for model in data_models]\n\n model_name_list += [model for model in settings.OTHER_DATA_MODELS]\n\n # import...
[ "0.7716706", "0.6954782", "0.6742698", "0.67201203", "0.6513403", "0.64677274", "0.64014745", "0.6369573", "0.6368797", "0.63448185", "0.633244", "0.6321181", "0.62659895", "0.6258032", "0.6243625", "0.6167777", "0.6158548", "0.6115253", "0.608663", "0.608182", "0.6074489", ...
0.7674908
1
Test GenBank parsing invalid product line raises ValueError
def test_invalid_product_line_raises_value_error(self): def parse_invalid_product_line(): rec = SeqIO.read(path.join('GenBank', 'invalid_product.gb'), 'genbank') self.assertRaises(ValueError, parse_invalid_product_line)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testBadLine(self):\n\n self.assertRaises(\n ValueError,\n tools._trackInfo,\n 'not a real line'\n )", "def test_readbadformat(self):\n\n self.assertRaises(ParseError, self.hw, self.badfile)", "def test_invalid_regref(self, parse_input_mocked_metadata):\...
[ "0.6412361", "0.63490635", "0.6333902", "0.6294638", "0.62427443", "0.6210081", "0.6208923", "0.6203845", "0.6167732", "0.61114794", "0.6096026", "0.60889727", "0.6073056", "0.60688126", "0.6063661", "0.60588723", "0.6050436", "0.6005442", "0.5976354", "0.5972584", "0.5971466...
0.8058622
0
\b Lists all your published apps. $ 21 publish list Results from the list command are paginated. Use 'n' to move to the next page and 'p' to move to the previous page. You can view detailed admin information about an app by specifying it's id at the prompt.
def list(ctx): # pylint: disable=redefined-builtin _list_apps(ctx.obj['config'], ctx.obj['client'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _list_apps(config, client):\n logger.info(\"Listing all the published apps by {}: \".format(config.username), fg=\"green\")\n current_page = 0\n total_pages = get_search_results(config, client, current_page)\n if total_pages < 1:\n return\n\n while 0 <= current_page < total_pages:\n ...
[ "0.71768415", "0.6380013", "0.6237213", "0.61973405", "0.6124043", "0.60990864", "0.60854894", "0.5944503", "0.5898133", "0.58913547", "0.5877315", "0.5836518", "0.5767014", "0.5754838", "0.5688991", "0.56420964", "0.56412876", "0.55870926", "0.5555698", "0.5543384", "0.55005...
0.64636713
1
\b Removes a published app from the Marketplace. $ 21 publish remove [yes] {app_id} \b Removes all published apps from the Marketplace. $ 21 publish remove [yes] all \b
def remove(ctx, app_id, all, assume_yes): if all and not app_id: for _app_id in _get_all_app_ids(ctx.obj['config'], ctx.obj['client']): _delete_app(ctx.obj['config'], ctx.obj['client'], _app_id, assume_yes) elif app_id and not all: _delete_app(ctx.obj['config'], ctx.obj['client'], ap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove():\n run('pew rm {0}'.format(package_name()))", "def app_delete(self, name):\n self.core.api.os.shell.cmd('{0} delete app /app.name:\"{1}\"'.format(self.APP_CMD, name))", "def remove_app(self):\n \n pass", "def delete_app(AppId=None):\n pass", "def delete_app(short_na...
[ "0.6542366", "0.63983655", "0.635603", "0.62508076", "0.6105173", "0.60880226", "0.5995787", "0.59228504", "0.5885536", "0.58168525", "0.57712317", "0.5742939", "0.56851757", "0.56586546", "0.5657139", "0.5622254", "0.5595414", "0.5593344", "0.55384624", "0.55296105", "0.5524...
0.67598
0
\b Publishes an app to 21 Marketplace. $ 21 publish submit path_to_manifest/manifest.yaml The contents of the manifest file should follow the guidelines specified at
def submit(ctx, manifest_path, marketplace, skip, parameters): if parameters is not None: try: parameters = _parse_parameters(parameters) except: logger.error( "Manifest parameter overrides should be in the form 'key1=\"value1\" " "key2=\"value...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _publish(client, manifest_path, marketplace, skip, overrides):\n try:\n manifest_json = check_app_manifest(manifest_path, overrides, marketplace)\n app_url = \"{}://{}\".format(manifest_json[\"schemes\"][0], manifest_json[\"host\"])\n app_ip = urlparse(app_url).hostname\n\n if no...
[ "0.7300059", "0.67660546", "0.6331592", "0.6170584", "0.60555214", "0.6053848", "0.5974832", "0.58902156", "0.5870017", "0.58022076", "0.56858075", "0.56083417", "0.5599532", "0.5585206", "0.5573604", "0.5570114", "0.5532284", "0.5491696", "0.5456021", "0.5449518", "0.5443404...
0.69711465
1
Parses parameters string and returns a dict of overrides. This function assumes that parameters string is in the form of '"key1="value1" key2="value2"'. Use of single quotes is optional but is helpful for strings that contain spaces.
def _parse_parameters(parameters): if not re.match(r'^(\w+)="([^=]+)"(\s{1}(\w+)="([^=]+)")*$', parameters): raise ValueError # first we add tokens that separate key/value pairs. # in case of key='ss sss ss', we skip tokenizing when we se the first single quote # and resume when we see the s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_params( self ):\n paramDic={}\n # Parameters are on the 3rd arg passed to the script\n paramStr=sys.argv[2]\n print paramStr\n if len(paramStr)>1:\n paramStr = paramStr.replace('?','')\n \n # Ignore last char if it is a '/'\n ...
[ "0.65870714", "0.65518653", "0.65437955", "0.65169543", "0.63385206", "0.6322526", "0.63106567", "0.6298732", "0.6283422", "0.6264256", "0.62140757", "0.6202048", "0.6163683", "0.60954064", "0.6093808", "0.6043404", "0.60339767", "0.6015657", "0.5971249", "0.5954985", "0.5940...
0.74429375
0