query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Plot confusion matrix using provided sklearn metrics.confusion_matrix values
def format_confusion_matrix(matrix, classes, figsize=(8, 4.5), title='', **kwargs): tn, fp, fn, tp = matrix.ravel() labels = np.array([ [ 'TP = {}'.format(tp), 'FP = {}'.format(fp), 'Precision = {:.2f}%'.format(tp / (tp + fp) * 100) ], [ 'F...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(self):\r\n interp = ClassificationInterpretation.from_learner(self.learn)\r\n interp.plot_confusion_matrix()", "def confusion_matrix(y_true, y_pred):\n skplt.plot_confusion_matrix(y_true, y_pred, normalize=True)\n plt.show()", "def plot_confusion_matrix(cm,...
[ "0.85292625", "0.8358722", "0.83164454", "0.83113015", "0.8297132", "0.8239064", "0.8210537", "0.8208425", "0.81997687", "0.8187058", "0.8185418", "0.8180164", "0.8152549", "0.8149543", "0.8149024", "0.81246525", "0.81169707", "0.8116899", "0.81074977", "0.8107005", "0.810671...
0.0
-1
Calculate threshold that should be used a given FPR or TPR value, based on given true values and predictions. Can be seen as a horizontal or vertical cut of a ROC curve
def get_threshold(true_values, predictions, target_fpr=None, target_tpr=None): if target_fpr is None and target_tpr is None: raise AttributeError('Specify one of TPR and FPR') if target_fpr and target_tpr: raise AttributeError('Specify only one of TPR and FPR') prev_threshold = None fprs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_TPR_threshold(y, scores, desired_TPR):\n for threshold in np.arange(1,0,-0.01):\n y_hat = (scores>=threshold).astype(int)\n confusion = confusion_matrix(y, y_hat)\n TN, FP, FN, TP = confusion.flat\n TPR = TP / (TP + FN)\n FPR = FP / (FP + TN)\n if TPR >= desire...
[ "0.73898816", "0.6876145", "0.6862842", "0.67141974", "0.66397965", "0.66231006", "0.659168", "0.65874106", "0.6506481", "0.64685255", "0.64640546", "0.6461244", "0.64604175", "0.6406104", "0.6381822", "0.6363779", "0.6341084", "0.63255036", "0.63210684", "0.63208485", "0.631...
0.8032899
0
Get the Reactome Stable ID for a given Uniprot ID.
def rx_id_from_up_id(up_id): react_search_url = 'http://www.reactome.org/ContentService/search/query' params = {'query': up_id, 'cluster': 'true', 'species':'Homo sapiens'} headers = {'Accept': 'application/json'} res = requests.get(react_search_url, headers=headers, params=params) if not res.status...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def up_id_from_rx_id(reactome_id):\n react_url = 'http://www.reactome.org/ContentService/data/query/' \\\n + reactome_id + '/referenceEntity'\n res = requests.get(react_url)\n if not res.status_code == 200:\n return None\n _, entry, entry_type = res.text.split('\\t')\n if entry...
[ "0.6640001", "0.6503159", "0.6433108", "0.6433108", "0.6433108", "0.6433108", "0.6433108", "0.6433108", "0.6433108", "0.6433108", "0.6433108", "0.6433108", "0.6433108", "0.6433108", "0.6433108", "0.6433108", "0.6433108", "0.6433108", "0.6433108", "0.6433108", "0.6433108", "...
0.0
-1
Argument 'vectors' is a dataframe with index vector ids.
def bulk_store_vector_old(self, vectors_df): if len(vec_ids) != len(vectors): raise ValueError with self.table.batch_write() as batch: for ind in vectors_df.index: vec_id = str(ind) vec = vectors_df.loc[ind].values item = self._crea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def faiss_index(vectors, ids=None):\n index = faiss.IndexFlatL2(vectors.shape[1])\n if ids:\n index = faiss.IndexIDMap(index)\n index.add_with_ids(vectors, np.array([i for i in ids]))\n else:\n index.add(vectors)\n\n return index", "def dataframe_from_vectors(**kwargs):\n retu...
[ "0.7106333", "0.6811036", "0.63466954", "0.62717336", "0.6179383", "0.6179383", "0.61661184", "0.6162891", "0.6125444", "0.6107017", "0.610671", "0.60495985", "0.60319054", "0.5955523", "0.5946969", "0.5921195", "0.59076285", "0.5887823", "0.58809096", "0.58267844", "0.579533...
0.68852794
1
Extract the JWT value from the request Header
def get_jwt_value(self, request): auth = get_authorization_header(request).split() auth_header_prefix = settings.JWT_AUTH_HEADER_PREFIX.lower() if not auth: if settings.JWT_AUTH_COOKIE: return request.COOKIES.get(settings.JWT_AUTH_COOKIE) return None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_jwt(self, request):\n auth_header_prefix = self.auth_header_prefix\n try:\n authorization = request.authorization\n except ValueError:\n return None\n if authorization is None:\n return None\n authtype, token = authorization\n if au...
[ "0.7858044", "0.7511597", "0.7240969", "0.7211593", "0.718861", "0.70605755", "0.7032483", "0.7002912", "0.6862061", "0.6852892", "0.6741529", "0.67372906", "0.6670443", "0.665745", "0.6649749", "0.66399497", "0.6543017", "0.6535601", "0.65324974", "0.65063125", "0.65012133",...
0.8138629
0
Create a heap, optionally by copying elements from iterable.
def __init__(self, iterable=None): self.heap = [] if iterable is not None: for item in iterable: self.push(item)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def heapsort(iterable):\n queue = []\n\n [heapq.heappush(queue, item) for item in iterable]\n\n return [heapq.heappop(queue) for i in range(len(queue))]", "def heapify(x):\n pass", "def build_heap(self, arr):\n i = len(arr) // 2\n self.size = len(arr)\n self.heap_list = [-1] + ...
[ "0.72410303", "0.7051308", "0.693648", "0.6918692", "0.6899991", "0.68681264", "0.6720534", "0.67195183", "0.6672693", "0.6666965", "0.6666965", "0.64771056", "0.6437493", "0.63755804", "0.6367573", "0.6309075", "0.6295559", "0.6223148", "0.6217653", "0.6199215", "0.6198203",...
0.77081156
0
Creates a thread to run the current action on with _action_then_signal() and starts the thread.
def action(self): self.action_thread = Thread(target=self._action_then_signal, daemon=True) self.action_thread.start()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self, actions_to_run=None):\n\n self.__thread = Thread(target = self.__run, args=[actions_to_run])\n self.__thread.start()\n self.__set_state(WorkerState.Idle)", "def start_background_thread(self):\n self.runner = Runner(queue=queue, app_id=self.app_id)\n self.runner....
[ "0.6547175", "0.6039589", "0.59670496", "0.5966031", "0.58738077", "0.5838541", "0.57921827", "0.57874674", "0.5773225", "0.5753852", "0.5731102", "0.57148725", "0.571158", "0.56937253", "0.5665757", "0.5648856", "0.5641471", "0.562415", "0.5566491", "0.55386996", "0.5538058"...
0.82488555
0
Initializes app,test variables and test client
def setUp(self): self.app = create_app(config_name="testing") self.client = self.app.test_client self.activity = {'name': 'Shop in Dubai'} # test bucket self.bucketlist = {'name': 'Go to Egypt for trip'} # test user self.user_details = { 'email': 'test...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n self.app = create_app()\n self.client = self.app.test_client", "def setUp(self):\r\n self.app = app.test_client()\r\n self.app.testing = True", "def setUp(self):\n self.app = app\n self.client = self.app.test_client", "def setUp(self):\n #ap...
[ "0.82711816", "0.81828535", "0.81783855", "0.8171928", "0.8162108", "0.8156813", "0.81428725", "0.81428725", "0.80526626", "0.80025965", "0.7977814", "0.7953018", "0.7952892", "0.7940171", "0.7812929", "0.7812929", "0.77971184", "0.77971184", "0.77971184", "0.77425003", "0.77...
0.748095
36
Attach a `Mapper` instance to an object.
def set_mapper(obj, mapper): setattr(obj, MAPPER, mapper) return mapper
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addObjectMap(self,fromMod,toMod,objectMap):\n if self.objectMaps == None: self.loadObjectMaps()\n self.objectMaps[(fromMod,toMod)] = objectMap", "def attach(self, obj):\n self.Object = obj.Object", "def extend(self, mappings):\n if isinstance(mappings, self.__class__):\n ...
[ "0.5826254", "0.55663204", "0.54730034", "0.5471485", "0.5421349", "0.53690064", "0.53602016", "0.5251881", "0.5229329", "0.5206481", "0.51788855", "0.51725054", "0.5143136", "0.51405644", "0.50553316", "0.50550145", "0.50498307", "0.50015295", "0.499092", "0.49558455", "0.49...
0.65594316
0
Removes a firewall rule from the active rules set.
def remove_rule(self, rule_number): if self._mode == Mode.PassThrough: raise ValueError("Can't edit rules while in passthrough mode") if self._mode == Mode.BlackList: if len(self._blacklist_rules) - 1 < rule_number: raise ValueError('Rule not found in rules list') rule = self._blacklist_rules.pop(rul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_firewall_rule(self, firewall_rule):\r\n return self.delete(self.firewall_rule_path % (firewall_rule))", "def delete_firewall_rule(self, server_uuid, firewall_rule_position):\n url = f'/server/{server_uuid}/firewall_rule/{firewall_rule_position}'\n return self.api.delete_request(ur...
[ "0.7757533", "0.6943715", "0.6852705", "0.67832965", "0.67708015", "0.6635733", "0.65605795", "0.6348685", "0.6308939", "0.6307866", "0.62326866", "0.62037337", "0.6202202", "0.61941576", "0.614105", "0.61352926", "0.61348003", "0.6127797", "0.606116", "0.6017737", "0.5989145...
0.6898738
2
String for representing the Model object
def __str__(self): return self.lastName + ", " + self.firstName
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self):\n return \"DataModel(name={},attributes={},description={})\".format(\n self.name, {a.name: str(a) for a in self.attributes}, self.description\n )", "def __str__(self):\n \n res =...
[ "0.8219232", "0.8020793", "0.77580154", "0.7699273", "0.7683828", "0.7678613", "0.7568337", "0.7568337", "0.75642484", "0.75642484", "0.75589746", "0.75219977", "0.75219977", "0.7509915", "0.75078505", "0.7363909", "0.73598325", "0.7340365", "0.73359716", "0.73188025", "0.731...
0.0
-1
String for representing the Model object
def __str__(self): return self.lastName + ", " + self.firstName
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self):\n return \"DataModel(name={},attributes={},description={})\".format(\n self.name, {a.name: str(a) for a in self.attributes}, self.description\n )", "def __str__(self):\n \n res =...
[ "0.8219232", "0.8020793", "0.77580154", "0.7699273", "0.7683828", "0.7678613", "0.7568337", "0.7568337", "0.75642484", "0.75642484", "0.75589746", "0.75219977", "0.75219977", "0.7509915", "0.75078505", "0.7363909", "0.73598325", "0.7340365", "0.73359716", "0.73188025", "0.731...
0.0
-1
String for representing the Model object
def __str__(self): return self.date.strftime('%y/%m/%d') + " " + self.time.strftime("%I:%M %p") + " " + self.activity + " " + self.description[:40]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self):\n return \"DataModel(name={},attributes={},description={})\".format(\n self.name, {a.name: str(a) for a in self.attributes}, self.description\n )", "def __str__(self):\n \n res =...
[ "0.8219232", "0.8020793", "0.77580154", "0.7699273", "0.7683828", "0.7678613", "0.7568337", "0.7568337", "0.75642484", "0.75642484", "0.75589746", "0.75219977", "0.75219977", "0.7509915", "0.75078505", "0.7363909", "0.73598325", "0.7340365", "0.73359716", "0.73188025", "0.731...
0.0
-1
Returns a new DQN agent for training.
def get_dqn_policy(locals_: dict = {}, globals_: dict = {}): from attackgraph.rl.dqn.dqn import DQN best_responder = DQN( is_attacker=locals_["training_attacker"], input_size=locals_["observation_space"], hidden_sizes=gin.REQUIRED, output_size=locals_["n_actions"], parame...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initiate_agent(self, env):\n from keras import Sequential\n from keras.optimizers import Adam\n from keras.layers import Dense, Dropout\n from rl.memory import SequentialMemory\n from rl.agents import DQNAgent\n\n self.env = env\n\n nb_actions = self.env.action_...
[ "0.7206351", "0.65786463", "0.6507172", "0.6447812", "0.63560385", "0.6079678", "0.6061534", "0.60434127", "0.59667206", "0.59236157", "0.5913338", "0.58702904", "0.58642316", "0.5832737", "0.58281505", "0.58207935", "0.5808759", "0.5806642", "0.5761789", "0.57550985", "0.575...
0.5207674
83
Returns a new DQNEncDec agent for training.
def get_dqn_enc_dec_policy(locals_: dict = {}, globals_: dict = {}): from attackgraph.rl.dqn.dqn_encdec import DQNEncDec best_responder = DQNEncDec( is_attacker=locals_["training_attacker"], state_dim=locals_["observation_space"], hidden_sizes=gin.REQUIRED, action_dim=locals_["n_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initiate_agent(self, env):\n from keras import Sequential\n from keras.optimizers import Adam\n from keras.layers import Dense, Dropout\n from rl.memory import SequentialMemory\n from rl.agents import DQNAgent\n\n self.env = env\n\n nb_actions = self.env.action_...
[ "0.68932515", "0.63375115", "0.6181415", "0.6145594", "0.5808726", "0.5784682", "0.5780569", "0.57206464", "0.5680821", "0.5623891", "0.5603343", "0.5583325", "0.55061114", "0.5503261", "0.5478956", "0.546185", "0.54576355", "0.5454365", "0.5427669", "0.54274136", "0.5398888"...
0.5774409
7
check if the stack is empty or not
def is_empty(self): if len(self.items) == 0: return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return len(self.the_stack) == 0", "def is_empty(self):\n return len(self.stack) == 0", "def empty(self):\r\n return len(self.stack) == 0", "def empty(self):\r\n return self.stack == []", "def empty(self) -> bool:\n if len(self.stack)==0:\n ...
[ "0.8820189", "0.8789367", "0.87762195", "0.8738477", "0.8710901", "0.86677873", "0.86677873", "0.8604702", "0.8599921", "0.85739094", "0.8472459", "0.8416655", "0.83404785", "0.83376265", "0.83323705", "0.83043426", "0.826573", "0.826077", "0.826077", "0.82483155", "0.8248315...
0.0
-1
Assign AOV to object. Applies to all materials.
def assign_aov(self, aov: AOV): if aov not in self.assigned_aovs: for material in self.materials: shader_node_tree = material.node_tree assert shader_node_tree is not None, "Material must have a node tree" aov.add_to_shader(shader_node_tree) self.assigned_aovs.append(aov)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assign_aovs(self, aovs: List[AOV]):\n\t\tfor aov in aovs:\n\t\t\tself.assign_aov(aov)", "def exportAovs(self):\n\t\taovs = mc.ls( typ = 'aiAOV' )\n\t\taovData = {}\n\t\tfor a in aovs:\n\t\t\taovData[a] = {}\n\t\t\taovData[a]['enabled'] = mc.getAttr( a + '.enabled' )\n\t\t\taovData[a]['name'] ...
[ "0.56896895", "0.5355168", "0.51943994", "0.51154995", "0.5089141", "0.50518215", "0.50138897", "0.49981174", "0.49703842", "0.4933291", "0.49104992", "0.48974028", "0.48704788", "0.4866555", "0.48458073", "0.48303026", "0.4798564", "0.47830492", "0.46833578", "0.46684775", "...
0.724779
0
Override to set origin manually. Should only be used by internal functions.
def _set_origin_manual(self, origin: Vector, all_meshes=True): if all_meshes: for mesh in self._meshes: mesh.location = origin else: self._meshes[0].location = origin
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_origin_value(self, origin):\n self.origin_value = origin", "def set_origin(self, origin):\n self.origin = origin\n self.__symbol_set.update(origin)", "def set_origin(self, origin_x, origin_y):\r\n self.x = origin_x - (self.rect.width / 2)\r\n self.y = origin_y + self...
[ "0.7926876", "0.76980597", "0.7681081", "0.75539285", "0.7288345", "0.72832423", "0.7259262", "0.70419425", "0.70419425", "0.70419425", "0.7029014", "0.6987368", "0.6827552", "0.67920196", "0.6771851", "0.67673916", "0.65686303", "0.65686303", "0.65686303", "0.65686303", "0.6...
0.7113664
7
Move object origin to centroid.
def origin_to_centroid(self, method: str = 'bounds'): _valid_methods = ['bounds', 'median', 'com_volume', 'com_area'] _type_lookup = dict(bounds='ORIGIN_GEOMETRY', median='ORIGIN_GEOMETRY', com_volume='ORIGIN_CENTER_OF_VOLUME', com_area='ORIGIN_CENTER_OF_MASS') center = 'BOUNDS' if method == 'bou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def centroid(self, centroid):\n\n self._centroid = centroid", "def setCentroid(self, center):\n p = center - self.centroid\n for i in range(len(self.points)):\n self.points[i] += p", "def center(self, destination):\n self.move(destination=destination, origin=self.center)"...
[ "0.6864928", "0.6516138", "0.6403322", "0.63724273", "0.63602036", "0.6357464", "0.63393885", "0.63297814", "0.6308069", "0.62789786", "0.62113476", "0.6191734", "0.61526984", "0.61366516", "0.605789", "0.6038639", "0.60129255", "0.5979582", "0.5941254", "0.5928024", "0.59148...
0.594073
19
Render website's home page.
def home(): return render_template('index.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_home():\r\n\treturn render_template(\"index.html\")", "def home():\n return render_template('homepage.html')", "def home():\n\n return render_template('home_page.html')", "def homepage():\n return render_template('home/index.html', \n title=\"Bem vindo!\")", "...
[ "0.8724249", "0.85791856", "0.850329", "0.84860355", "0.84612614", "0.84362435", "0.8429879", "0.8419578", "0.8396612", "0.8396612", "0.8374868", "0.8356488", "0.8350785", "0.8340763", "0.8340763", "0.83374727", "0.83374727", "0.83374727", "0.83374727", "0.83374727", "0.83374...
0.82190555
53
Render the home page.
def index(): return render_template('index.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_home():\r\n\treturn render_template(\"index.html\")", "def home():\n\n return render_template('home_page.html')", "def home():\n\n return render_template(\"home.html\")", "def home():\n return render_template(\"home.html\")", "def home():\n return render_template(\"home.html\")", "...
[ "0.887302", "0.8745959", "0.8593729", "0.85518956", "0.85518956", "0.85492104", "0.85492104", "0.85492104", "0.85492104", "0.85492104", "0.85492104", "0.85492104", "0.85492104", "0.85492104", "0.85492104", "0.85492104", "0.85492104", "0.85492104", "0.85492104", "0.85492104", ...
0.0
-1
Render the about site page.
def about(): return render_template('about.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about():\n return render_template('about.html', title='About')", "def about():\n\n return render_template('about_page.html', title='About')", "def about():\n\n\treturn render_template(\"about.html\")", "def about():\n return render_template(\n 'about.html',\n title='About',\n ...
[ "0.8623695", "0.8546367", "0.8505849", "0.83812547", "0.83113366", "0.8297885", "0.82673436", "0.825615", "0.8242478", "0.8230787", "0.8229448", "0.82178956", "0.82066315", "0.82066315", "0.82066315", "0.82066315", "0.82066315", "0.82066315", "0.82066315", "0.82066315", "0.82...
0.8145113
35
Render the website's contact page.
def favicon(): return send_file('static/img/favicon.ico')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contact():\n return render_template('contact.html')", "def contact():\n\n\treturn render_template('contact.html', title='Contact',\n\t\t\t\t\t\t year=datetime.now().year,\n\t\t\t\t\t\t message='Your contact page.')", "def contact():\n return render_template(\n 'contact.html',\n titl...
[ "0.8571523", "0.853422", "0.8482251", "0.84443015", "0.84443015", "0.8443343", "0.8438249", "0.84182364", "0.84182364", "0.84182364", "0.84182364", "0.84182364", "0.84182364", "0.84182364", "0.84182364", "0.8395762", "0.837459", "0.8162383", "0.81143713", "0.8085514", "0.8036...
0.0
-1
calculates grid deltas between two positions relative to first position
def manhattenPath(position1, position2): dx = position2[0] - position1[0] dy = position2[1] - position1[1] return dx,dy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def PDiffGrids(A, B):\n if (A.xllcorner,A.yllcorner) == (B.xllcorner,B.yllcorner) and (A.ncols,A.nrows)==(B.ncols,B.nrows):\n Bx = numpy.where(B.data != B.nodata, B.data, 1.0)\n Bx = numpy.where(B.data != 0., B.data, 1.0)\n C = 100. * (A.data-Bx)/Bx\n New = grid(C, A.xllcorner, A.yll...
[ "0.62960494", "0.61300075", "0.60621697", "0.6059241", "0.60561305", "0.6032316", "0.6003388", "0.59514964", "0.5944506", "0.58836967", "0.58693504", "0.58687866", "0.5848963", "0.58146465", "0.57909715", "0.57909477", "0.57792354", "0.57341146", "0.5691901", "0.5690794", "0....
0.53063124
75
Returns the transport used by the client instance.
def transport(self) -> ContactCenterInsightsTransport: return self._transport
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transport(self):\n return self._transport", "def transport(self) -> TraceServiceTransport:\n return self._client.transport", "def transport(self) -> ServiceControllerTransport:\n return self._client.transport", "def transport(self) -> MetadataServiceTransport:\n return self._c...
[ "0.82946277", "0.7887542", "0.773594", "0.773068", "0.76806635", "0.7674273", "0.76357967", "0.7558095", "0.7551682", "0.75303864", "0.74958986", "0.7488142", "0.7436853", "0.7423566", "0.7368433", "0.73340607", "0.721926", "0.7109823", "0.7102308", "0.68808985", "0.6671675",...
0.68144
20
Returns a fullyqualified billing_account string.
def common_billing_account_path(billing_account: str,) -> str: return "billingAccounts/{billing_account}".format( billing_account=billing_account, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def billing_account(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"billing_account\")", "def billing_account(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"billing_account\")", "def billing_account(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"billing_account...
[ "0.79002553", "0.79002553", "0.79002553", "0.7712969", "0.7712969", "0.74875593", "0.74875593", "0.73243135", "0.68009645", "0.6783066", "0.66662496", "0.66662496", "0.66435224", "0.66435224", "0.65389526", "0.6513056", "0.6302785", "0.6262761", "0.6173323", "0.6169606", "0.6...
0.750967
5
r"""Updates an issue model.
def update_issue_model( self, request: contact_center_insights.UpdateIssueModelRequest = None, *, issue_model: resources.IssueModel = None, update_mask: field_mask_pb2.FieldMask = None, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateModel(self):\n pass", "def update(self):\n\n params = {\n \"title\": self.title,\n \"body\": self.body,\n \"state\": self.state,\n \"labels\": self.labels,\n \"assignees\": self.assignees,\n }\n\n if self.milestone:\n ...
[ "0.71829796", "0.7070325", "0.6968259", "0.6723839", "0.6370942", "0.6251977", "0.6076467", "0.60365206", "0.60352504", "0.5975417", "0.59308255", "0.5929828", "0.5870872", "0.57429624", "0.57183534", "0.5710667", "0.5701886", "0.569185", "0.56910235", "0.56847495", "0.565393...
0.6811689
3
Returns the min value in a binary tree.
def min_value(root_elem): min_val = root_elem.value stack = [root_elem] while stack: # Capture the current element and add it to the result current = stack.pop() if current.value < min_val: min_val = current.value # if the current element has a left/right child, add it to the stack for checking ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def peek_min(self):\n if self.root:\n return self.root.min().value\n raise ValueError(\"cannot perform peek_min on an empty tree\")", "def get_min(self):\n\t\tif self.left:\n\t\t\treturn self.left.get_min()\n\t\treturn self.value", "def get_min(self):\n if not self:\n ...
[ "0.8520712", "0.845208", "0.83252406", "0.822124", "0.80629766", "0.80616343", "0.79981214", "0.79378015", "0.79205626", "0.790611", "0.78811866", "0.7863986", "0.7837147", "0.7833623", "0.7791693", "0.7706092", "0.7685366", "0.75970435", "0.7590981", "0.75882053", "0.7573986...
0.7800315
14
Return the maximum path sum of a binary tree.
def max_path_sum(root_elem): if root_elem is None: return 0 if root_elem.left is None and root_elem.right is None: return root_elem.value max_child = max(max_path_sum(root_elem.left),max_path_sum(root_elem.left)) return root_elem.value + max_child
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maxPathSum(self, root):\n def maxPotential(node):\n \"\"\"Return max potention from each node in tree.\"\"\"\n nonlocal maxsum\n # Allocate null values to 0\n if not node:\n return 0\n\n # Get the max sum from the left and right subtr...
[ "0.8390415", "0.8178529", "0.7540854", "0.74962276", "0.74432206", "0.7416371", "0.6850052", "0.6802187", "0.66597754", "0.66577923", "0.65914303", "0.657993", "0.657216", "0.6428174", "0.63990885", "0.63990885", "0.6391039", "0.6366077", "0.6362675", "0.6358799", "0.63518876...
0.84747034
0
Get the most recent ProductVersion for a product
def latest_product_version(product): return product.productversions.order_by("-created_on").first()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_latest_vsn(self):\n # The last version in the list should be the newest one.\n if len(self.versions) > 0:\n v = sorted(self.versions, key=lambda v: int(v['id']))[len(self.versions)-1]\n return self.get_version(v['id'])\n else: return None", "def latest(cls):\n ...
[ "0.70546645", "0.697221", "0.68986726", "0.6848886", "0.68030393", "0.6796238", "0.679168", "0.6778039", "0.6743275", "0.6739602", "0.67340857", "0.6706589", "0.6674874", "0.66369516", "0.66028637", "0.6543131", "0.6518379", "0.6431812", "0.63932705", "0.63916445", "0.6387638...
0.8983362
0
Verifies that the course run selections for the given basket are valid, and returns the course run IDs of the selected course runs.
def _validate_basket_run_selections(basket, product_object): course_run_selections = basket.courserunselection_set.all() if len(course_run_selections) == 0: raise ValidationError({"runs": "You must select a date for each course."}) if isinstance(product_object, Program): valid_course_ids = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_basket_for_checkout(user):\n basket = Basket.objects.prefetch_related(\n \"basketitems__product__content_object\",\n \"couponselection_set__coupon\",\n \"courserunselection_set__run\",\n ).get(user=user)\n\n basket_item, product, product_version = _validate_basket_content...
[ "0.56617093", "0.49104264", "0.49085626", "0.4806148", "0.4783811", "0.4709899", "0.46398574", "0.45839947", "0.45368364", "0.45231676", "0.45187724", "0.44772285", "0.44472843", "0.4437117", "0.44013822", "0.438784", "0.436937", "0.43656102", "0.43396983", "0.4338599", "0.43...
0.7933139
0
Test if an instance or class is serializable. >>>
def is_serializable(instance_or_class: Any) -> bool: return hasattr(instance_or_class, SERDE_SCOPE)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_picklable(obj):\n try:\n pickle.dumps(obj)\n\n except pickle.PicklingError:\n return False\n return True", "def is_sedes(obj):\n return hasattr(obj, 'serialize') and hasattr(obj, 'deserialize')", "def test_serialization():\n\n # Class is serializable.\n ray.put(DummyPredictor...
[ "0.631063", "0.61888593", "0.61764514", "0.606287", "0.578346", "0.5709154", "0.5606728", "0.5577882", "0.5562468", "0.55464387", "0.553389", "0.5487497", "0.5483271", "0.54758954", "0.54571164", "0.5341938", "0.5293715", "0.52733064", "0.52531147", "0.5225431", "0.5212891", ...
0.8185239
0
Render rvalue for primitives.
def primitive(self, arg: SeField[Any]) -> str: typ = typename(arg.type) var = arg.varname if self.suppress_coerce: return var else: return f"coerce({typ}, {var})"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n r = f\"<{self.type}={self.value}>\" if self.value else f\"<{self.type}>\"\n return r", "def __repr__(self):\r\n return self.value", "def __repr__(self):\n return \"{}\".format(self.val)", "def __repr__(self):\n return \"{}\".format(self.val)", "def _...
[ "0.6320464", "0.59662974", "0.5883248", "0.5883248", "0.587805", "0.587805", "0.58287644", "0.58287644", "0.576031", "0.5690682", "0.56842905", "0.56658614", "0.56658614", "0.56658614", "0.56658614", "0.564693", "0.56184596", "0.5614047", "0.5597958", "0.55143726", "0.5512603...
0.0
-1
Get the default engines from all models Returns Dict[str, str] Default engines for all containers. If unspecified, it is not included in the return dictionary.
def get_container_default_engines() -> Dict[str, str]: default_engines = {} for id, all_engines in ALL_ALLOWED_ENGINES.items(): default_engines[id] = all_engines[0] return default_engines
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_engines_details(self):\n if not \"engines\" in self.data:\n raise ValueError(\"This recipe doesn't have engines\")\n return self.data[\"engines\"]", "def envs(self) -> Optional[Sequence['outputs.CSIPowerMaxSpecDriverCommonEnvs']]:\n return pulumi.get(self, \"envs\")", "d...
[ "0.59966433", "0.56747043", "0.56631047", "0.5660428", "0.56266505", "0.56266505", "0.5584942", "0.55665815", "0.5556945", "0.55494493", "0.55435604", "0.5537465", "0.55236477", "0.55003726", "0.54973334", "0.5489643", "0.54861104", "0.54800034", "0.54428667", "0.5370886", "0...
0.795721
0
Model ID Returns str The model id that is used to reference this model
def id(self) -> str: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getId(self):\n return _libsbml.Model_getId(self)", "def model_id(self):\n return self.comm.comm_id", "def model_id(self):\n date_str = dt.now().strftime(\"%Y-%m-%d_%H:%M\")\n return \"%s_%s_%s_%s\" % (date_str, self.embedding_type, self.class_label, self.drop_irrelevant)", "de...
[ "0.8249524", "0.8019611", "0.79375136", "0.78011423", "0.7406605", "0.73186636", "0.72834927", "0.72834927", "0.72834927", "0.72834927", "0.72834927", "0.72834927", "0.72834927", "0.72834927", "0.72834927", "0.72834927", "0.72834927", "0.72834927", "0.72834927", "0.7278067", ...
0.7186416
24
Model Name Returns str The detailed name of the model used for display purposes
def name(self) -> str: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return '%s%s' % (self.name, ' - %s' % self.model if self.model else '')", "def get_model_name(self) -> str:\n return self._get_string(openvr.Prop_RenderModelName_String)", "def __str__(self):\n model = self._meta.verbose_name.title()\n return f\"{model:s}: {self...
[ "0.8532552", "0.83654517", "0.83200336", "0.83200336", "0.8155751", "0.81235456", "0.8109568", "0.81031543", "0.8035665", "0.7843652", "0.7814869", "0.7744835", "0.77404827", "0.77257526", "0.7678394", "0.76538646", "0.76369643", "0.7629161", "0.7591583", "0.75697595", "0.756...
0.0
-1
Export a zip file containing all of the database's response templates.
def export_notebooks_as_zip(modeladmin, request, queryset): del request, modeladmin # unused buffer = io.BytesIO() zip_file = zipfile.ZipFile(buffer, "w") for notebook in queryset: filename = notebook.path zip_file.writestr(filename, notebook.content) zip_file.close() respons...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def database(request):\n with tempfile.TemporaryDirectory() as tmpdir:\n with zipfile.ZipFile(os.path.join(tmpdir, 'data.zip'), 'x') as datazip:\n datazip.write(settings.DATABASES['default']['NAME'], arcname='db.sqlite3')\n response = FileResponse(open(os.path.join(tmpdir, 'data.zip'), ...
[ "0.6605638", "0.62541217", "0.6186269", "0.60622203", "0.59472805", "0.59091693", "0.5873034", "0.587133", "0.587133", "0.5852864", "0.58439785", "0.58303237", "0.58122176", "0.5793028", "0.5791535", "0.5782591", "0.5782591", "0.5782591", "0.5782591", "0.5782591", "0.5782591"...
0.632173
1
Returns mocked response with url. Returns None if not matched any data.
def find_response(self, url, method="GET"): parsed = urlparse.urlparse(url) if parsed.netloc not in self._cnfs_by_host: return None method = method.upper() for item in self._cnfs_by_host[parsed.netloc]: if item["path"] == parsed.path and item["method"] == method:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mockreturn(url, *args, **kwargs):\n filename = data_path(DATA_FILES['m101'])\n f = open(filename, 'r')\n text = f.read()\n retval = MockResponse(text)\n f.close()\n return retval", "def get_response(request_url):\n return requests.get(request_url)", "def mock_github_get(url):\n ...
[ "0.7185421", "0.67830473", "0.6581207", "0.6554457", "0.6503297", "0.6491006", "0.6486203", "0.6438076", "0.6438076", "0.6429996", "0.6391392", "0.63800424", "0.63695586", "0.63675416", "0.63119805", "0.63081384", "0.6301569", "0.62391376", "0.6229476", "0.6188182", "0.615624...
0.6072532
23
Returns true if board_size is valid.
def is_valid_board_size(board_size): if not isinstance(board_size, int): return False if board_size < 3 or board_size > Board.LARGEST_BOARD_SIZE: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_board_valid(bd):\n return is_rows_valid(bd) and is_cols_valid(bd) and is_sqrs_valid(bd)", "def __check_board_is_valid(self, board, players):\n total_tiles = board.get_rows() * board.get_cols()\n # check the board is big enough\n if total_tiles < (6 - len(players)) * len(players):\n...
[ "0.7422723", "0.7249498", "0.69887567", "0.69840866", "0.6846299", "0.68242246", "0.6704236", "0.66333365", "0.662797", "0.66123533", "0.66006494", "0.65978116", "0.65944284", "0.6556372", "0.65444493", "0.65066385", "0.65052843", "0.6429753", "0.64249456", "0.6424821", "0.63...
0.85331017
0
Runs the main loop for the program.
def start_gameloop(self): print("Game Loop starting...") while True: current_turn = self.who_goes_first() print('The ' + current_turn + ' will go first.') while self.is_active: if current_turn == "player": self.board.draw() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run():\n main()", "def main():\n run_program()", "def main() -> None:\n runner()\n asyncio.get_event_loop().run_forever()", "def main() -> None:\n runner()\n asyncio.get_event_loop().run_forever()", "async def _main(self):\n while True:\n time.sleep(1)", "def main(...
[ "0.77293634", "0.76222867", "0.75609976", "0.75609976", "0.73191077", "0.73138976", "0.72779584", "0.72532403", "0.7218559", "0.71964186", "0.71941996", "0.7175238", "0.7160935", "0.71349376", "0.71322256", "0.7110474", "0.7102987", "0.70947635", "0.70587116", "0.7038902", "0...
0.0
-1
Split dataframe into training and validation sets based on given %
def splitTrainValidate(df, perc_training = 0.8): train = df.sample(frac=perc_training)#, random_state=200) validate = df.drop(train.index) return (train, validate)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_train_test(df, percentage_train=50):\n return (\n df.loc[(df.index.values % 100) < percentage_train].reset_index().copy(),\n df.loc[~((df.index.values % 100) < percentage_train)].reset_index().copy(),\n )", "def split_train_dev_set(df, percent=0.2):\n train = []\n...
[ "0.80060047", "0.74237996", "0.7367158", "0.7349186", "0.731596", "0.72757053", "0.7271053", "0.72709185", "0.71755165", "0.7162196", "0.71269006", "0.71239233", "0.71239233", "0.70942765", "0.7059493", "0.70532954", "0.7044986", "0.70298046", "0.69762635", "0.6971696", "0.69...
0.7616091
1
Format graph into networkx Graph object.
def format_networkx(graph, meta=None, cmap="nipy_spectral_r", norm=None, **kwargs): # Extract node, link data (require, for now) node_data = dict(graph['nodes']) link_dict = dict(graph['links']) # check meta data if meta is None: meta = sorted(set(__ for _ in node_data.values() for __ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convertGraph(G):\n G_new = nx.Graph()\n for nd, attrs in G.nodes(data=True):\n G_new.add_node(str(nd), chem=attrs['atom_symbol'])\n# G_new.add_node(str(nd), x=str(attrs['attributes'][0]),\n# y=str(attrs['attributes'][1]))\n ...
[ "0.7325583", "0.72616845", "0.7033721", "0.68054384", "0.66022146", "0.6486966", "0.63581645", "0.63276106", "0.6243864", "0.62359005", "0.6202594", "0.6198098", "0.61733884", "0.61504203", "0.6101194", "0.6086393", "0.60592103", "0.6049269", "0.603517", "0.6030319", "0.60198...
0.56149256
87
Add cover to scatter plot of projection/lens.
def draw_cover(ax=None, cover_cubes=None, draw_all=True, max_draw=2, **kwargs): if ax is None: ax = plt.gca() # save for later xlim = np.ravel(ax.get_xlim()) ylim = np.ravel(ax.get_ylim()) if cover_cubes is None: cover_cubes = get_cover_cubes(**kwargs) # extract bins (TODO:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coverPlots(self, plotX, plotY, iCiv):\n\t\t\n\t\tfor x in range(plotX-1, plotX+2):\n\t\t\tfor y in range(plotY-1, plotY+2):\n\t\t\t\tgc.getMap().plot(x, y).setRevealed(iCiv, False, True, -1);", "def plot_imshow(data, col_name):\n city_x,city_y = get_city_base()\n fig = plt.figure(figsize = FIGURE_SIZE)...
[ "0.5685548", "0.56419706", "0.5500533", "0.54964197", "0.5418214", "0.5405593", "0.5395795", "0.5394089", "0.5381184", "0.5341818", "0.53070235", "0.52644366", "0.5259561", "0.5244077", "0.5230234", "0.5229156", "0.5211171", "0.52091885", "0.52051985", "0.51938695", "0.519207...
0.0
-1
Extracts value from record and removes leading prefix/URI
def get_record_value(record_entry, key): value = record_entry[key]["value"] return value[value.rfind("#") + 1:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_prefix(val: str, prefix: str) -> str:\n return val[len(prefix):] if val.startswith(prefix) else val", "def extract(dictionary, oid, value):\n pid = int(oid.rsplit('.', 1)[-1])\n dictionary[pid] = value.strip()", "def recordval(record, key):\n return re.sub(r'\\s+', ' ', raw_recordv...
[ "0.60919607", "0.5938295", "0.5916172", "0.58858234", "0.58747935", "0.5501179", "0.54746306", "0.5455352", "0.5402884", "0.53885865", "0.53713566", "0.5363935", "0.5352411", "0.53093725", "0.5285315", "0.52457774", "0.52300525", "0.52289844", "0.51924855", "0.5152468", "0.51...
0.6734634
0
Creates a new SmtpMailer profile
def Create( profile_name, host, username=None, password=None, port=26, from_name=None, from_email=None, ssl=False, output_stream=sys.stdout, ): if not from_name and not from_email: raise Co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_user_profile(sender, instance, created, **kwargs):\n if created:\n profile = UserProfile()\n profile.user = instance\n profile.email=instance.email\n profile.save()", "def create(self, data):\n # Make User\n username = data['email'].split(\"@\")[0]\n ...
[ "0.69871515", "0.6736804", "0.67064905", "0.6634885", "0.6540685", "0.65364593", "0.653232", "0.65289867", "0.6498891", "0.6498891", "0.6498891", "0.64774895", "0.6446011", "0.6395769", "0.6395544", "0.63789546", "0.6365305", "0.626774", "0.6246853", "0.6245375", "0.624051", ...
0.79361427
0
Adds word with a frequency of 1. If word already exists, increment that key's value by 1 to indicate it was seen again.
def add_word(self, word): word = word.lower() if word in self.word_list: self.word_list[word] += 1 else: self.word_list[word] = 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_word(self, word):\n if not word in self._word2idx.keys():\n self._word2idx[word] = self.vocab_size\n self.freqs[word] = 0\n self._idx2word[self.vocab_size] = word\n self.vocab_size += 1\n self.freqs[word] += 1", "def update(self, word, freq):\n ...
[ "0.7508585", "0.74045515", "0.723629", "0.7222524", "0.71989167", "0.71388763", "0.7124417", "0.7124417", "0.707256", "0.69336337", "0.685697", "0.6778958", "0.6690065", "0.6665038", "0.6661889", "0.66369", "0.649379", "0.6490922", "0.64678854", "0.6453679", "0.6403599", "0...
0.7521451
0
This finds all matching subgraphs within the graph. The subgraphs are returned as a derived graph based on the node list, so all edges are present even ones not present in match. The subgraph is matched by edge key only. All of the edges must be present in the subgraph, however nodes that are distinct in the match are ...
def find_all_subgraphs(graph, match): if not match: return [] return _find(graph, match, {}, match)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matched_sub_graph_instances(self, graph: Graph):\n if self.replacement_desc.match_kind == 'points': # instance is specified with lists of start/end nodes\n match = self._match_sub_graph_for_points(graph)\n if match is not None:\n yield match\n elif self.repla...
[ "0.7030763", "0.6678678", "0.6512331", "0.6489582", "0.6326925", "0.6235689", "0.60963726", "0.5959586", "0.59095633", "0.57163835", "0.56518906", "0.5639643", "0.5571853", "0.54761225", "0.5454015", "0.5342025", "0.5341317", "0.5312715", "0.5310282", "0.5289495", "0.52827466...
0.79836005
0
Check if the search should be cutoff early.
def cutoff_test(self, state, depth): return self.depth_limit > 0 and depth > self.depth_limit
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def should_stop(self, frac_for_search=0.85):\n\n cur_time = time.time()\n return (cur_time - self._start_time) >= frac_for_search * self._time_budget", "def _check_classical_stop_conditions(self, changed):\n searching = changed and (self._iteration < self._max_iterations) \n if not ch...
[ "0.6385524", "0.634059", "0.63234013", "0.6291988", "0.61720973", "0.61563563", "0.61507714", "0.61128885", "0.6068058", "0.60376775", "0.59424233", "0.59367615", "0.5913712", "0.5910038", "0.5872615", "0.5867036", "0.5865767", "0.58355504", "0.58325434", "0.5819071", "0.5811...
0.62697405
4
Default environment configuration. Can be overloaded in environment implementations, or by calling configure().
def default_config(cls) -> dict: return { "observation": { "type": "Kinematics" }, "action": { "type": "DiscreteMetaAction" }, "simulation_frequency": 15, # [Hz] "policy_frequency": 1, # [Hz] "o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_env_config(self):\n self.env_config = {\n # ===== STANDARD ARGUMENTS ======\n \"n_agents\": 4, # Number of non-planner agents\n \"world_size\": [15, 15], # [Height, Width] of the env world\n \"episode_length\": 1000, # Number of time-steps per episode\n...
[ "0.6802826", "0.66435456", "0.6623785", "0.6506481", "0.6459857", "0.6433671", "0.63724357", "0.63403493", "0.6243218", "0.62029225", "0.6172123", "0.61640805", "0.61543757", "0.61498463", "0.61260986", "0.60633385", "0.60337114", "0.6030936", "0.60288036", "0.6027045", "0.60...
0.568443
55
Return the reward associated with performing a given action and ending up in the current state.
def _reward(self, action: Action) -> float: raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def step(self, action):\n res = self.reward_table.get(self.curr_state, action)\n\n self.curr_state = res['result']\n\n return res", "def _get_reward(self, action):\n HIRE_COST = 1 # TODO 7/29/20 - Determine significance of this value\n\n # Lookup the state representation using the cur_sta...
[ "0.81838316", "0.810044", "0.8042165", "0.8030217", "0.80297923", "0.8012718", "0.79599637", "0.7952822", "0.76932406", "0.7685848", "0.76539856", "0.75493425", "0.7532442", "0.7450053", "0.7443335", "0.73995954", "0.73988664", "0.73345715", "0.7295285", "0.7288301", "0.72852...
0.7453679
13
Returns a multiobjective vector of rewards. If implemented, this reward vector should be aggregated into a scalar in _reward(). This vector value should only be returned inside the info dict.
def _rewards(self, action: Action) -> Dict[Text, float]: raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_rewards(self):\n return np.array(self.rewards)", "def get_rewards(self):\n for i in self.REWARDS:\n self.get_reward(i)", "def get_reward_list(self):\n return self._gameRewards", "def get_reward_list(self):\n return self._gameRewards", "def get_reward(self):\n ...
[ "0.7354578", "0.6758989", "0.671144", "0.671144", "0.6539161", "0.63932836", "0.6383539", "0.638338", "0.6265215", "0.62527347", "0.62435377", "0.6173115", "0.6156117", "0.6148786", "0.60945773", "0.60682255", "0.6025972", "0.5994977", "0.59854215", "0.59682214", "0.59472084"...
0.5493291
57
Close the environment. Will close the environment viewer if it exists.
def close(self) -> None: self.done = True if self.viewer is not None: self.viewer.close() self.viewer = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\n self._close_viewer_window()\n self.env.close()", "def close_env(self):\n self.env.close()", "def close(self): \n\t\tself.env.close()", "def _close_viewer_window(self):\n # We need to do some strange things here to fix-up flaws in gym\n # pylint: disable=p...
[ "0.8069727", "0.78172356", "0.7408848", "0.68834907", "0.6678882", "0.6580309", "0.65654665", "0.6563769", "0.6159269", "0.61543995", "0.6137054", "0.6083034", "0.6081373", "0.6057436", "0.60300815", "0.60117877", "0.59660363", "0.5931668", "0.5931668", "0.5930597", "0.588814...
0.58679926
21
Decide if two paths the same.
def areSamePaths(path1, path2): path1 = os.path.abspath(os.path.normpath(path1)) path2 = os.path.abspath(os.path.normpath(path2)) if os.path.exists(path1) and os.path.exists(path2): path1 = getExternalUsePath(path1) path2 = getExternalUsePath(path2) path1 = os.path.normcase(path1) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def samepath(p1, p2):\n # type: (str, str) -> bool\n return pathnormalize(p1) == pathnormalize(p2)", "def on_same_mount(cls, path1: os.PathLike, path2: os.PathLike) -> bool:\n return cls.get_mount(path1)[0] == cls.get_mount(path2)[0]", "def __eq__(self, other):\n return type(self) == type(o...
[ "0.80794454", "0.7335985", "0.728109", "0.71233845", "0.7090421", "0.7060327", "0.682967", "0.67997307", "0.6791317", "0.669375", "0.6561799", "0.6548824", "0.653403", "0.64468986", "0.63320774", "0.6330571", "0.610795", "0.60870606", "0.60596025", "0.60438037", "0.60414", ...
0.75999165
1
Make it a relative path, if possible.
def relpath(path, start="."): if start == ".": start = os.curdir try: return os.path.relpath(path, start) except ValueError: # On Windows, paths on different devices prevent it to work. Use that # full path then. if isWin32OrPosixWindows(): return os.path...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relativize(path: str):\n return join('.', path)", "def relative_path(__file__, path):\n return os.path.abspath(os.path.join(os.path.dirname(__file__), path))", "def force_absolute(base, path):\n if os.path.abspath(path) and os.path.exists(path):\n return path\n else:\n return path...
[ "0.7060268", "0.70526326", "0.7029295", "0.6987652", "0.698544", "0.68057936", "0.67967445", "0.66952765", "0.666566", "0.6663056", "0.66472405", "0.66117835", "0.6608718", "0.6588504", "0.6561882", "0.6549738", "0.6541213", "0.65336865", "0.65184957", "0.65082276", "0.649987...
0.6156716
68
Is the given path executable.
def isPathExecutable(path): return os.path.isfile(path) and os.access(path, os.X_OK)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_executable(path):\n return (os.path.exists(path) and\n not os.path.isdir(path) and\n os.access(path, os.F_OK | os.X_OK))", "def is_executable(file_path):\n\n return os.path.isfile(file_path) and os.access(file_path, os.X_OK)", "def is_in_path(self):\n exe =...
[ "0.87049234", "0.82668436", "0.8151447", "0.8045147", "0.8028939", "0.7975011", "0.7975011", "0.7967362", "0.7948243", "0.79336417", "0.79315096", "0.79158705", "0.79051197", "0.77032655", "0.76975554", "0.76865935", "0.7447012", "0.717335", "0.7148607", "0.711846", "0.710060...
0.8775785
0
Has a filename one of the given extensions.
def hasFilenameExtension(path, extensions): extension = getFilenameExtension(path) if isinstance(extensions, basestring): return extension == extensions else: return extension in extensions
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_file_allowed_extension(filename, extensions):\n return filename.lower().endswith(extensions)", "def has_file_allowed_extension(filename, extensions):\n return filename.lower().endswith(extensions)", "def has_extension(self, filename):\n if filename is None:\n return False\n ...
[ "0.84971595", "0.84971595", "0.83129245", "0.8290528", "0.8273597", "0.82258934", "0.82258934", "0.81216115", "0.8003813", "0.79840004", "0.79104877", "0.7897788", "0.782885", "0.7801445", "0.77727574", "0.7756917", "0.76878774", "0.76196367", "0.76131713", "0.7600364", "0.75...
0.78652465
12
Gets the externally usable absolute path for a given relative path.
def getExternalUsePath(filename, only_dirname=False): filename = os.path.abspath(filename) if os.name == "nt": if filename not in _external_use_path_cache: asked_filename = filename if only_dirname: dirname = getWindowsShortPathName(os.path.dirname(filename)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_abs_path(path):\r\n abs_path = lib_path.abspath(path)\r\n return abs_path", "def get_abs_path(relative_path):\n if os.path.isabs(relative_path):\n return relative_path\n path_parts = relative_path.split(os.sep)\n abs_path = os.path.abspath('.')\n for path_part in path_parts:\n ...
[ "0.8282519", "0.823421", "0.823001", "0.8111444", "0.8076817", "0.80646294", "0.7980848", "0.77372855", "0.7735954", "0.77253485", "0.77186006", "0.76823103", "0.7660861", "0.7658924", "0.76536", "0.76509243", "0.76169777", "0.7614475", "0.7556018", "0.75538075", "0.7546099",...
0.0
-1
Convert filename into a path suitable for reporting, avoiding home directory paths.
def getReportPath(filename, prefixes=()): key = filename, tuple(prefixes) if key not in _report_path_cache: _report_path_cache[key] = _getReportPath(filename, prefixes) return _report_path_cache[key]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalizeFilename(filename):\n return os.path.abspath(os.path.expanduser(filename))", "def get_filename(filepath):\n return filepath.replace(\"{}\\\\\".format(RES_DIR), \"\")", "def pathToFileName(self, path):\n\t\t# Find the path, and strip the leading slash.\n\t\tpath =urlparse.urlparse(self.path)[...
[ "0.7325488", "0.7263966", "0.72180045", "0.7198163", "0.70467937", "0.70044374", "0.69391733", "0.6887128", "0.68808347", "0.6830386", "0.6780329", "0.6767687", "0.67444694", "0.67303175", "0.6725817", "0.6702119", "0.6698484", "0.66942364", "0.65428585", "0.65319484", "0.652...
0.0
-1
Test if a path contains any unwanted elements.
def containsPathElements(path, elements): elements = tuple(os.path.normcase(element) for element in elements) path = os.path.normpath(path) parts = os.path.normpath(path).split(os.path.sep) return any(element in parts for element in elements)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _path_exclude(self,path):\n\t\t#exclusions = [\t'10A103_Milky_Way_DA_NY/flame_settings_BU',\n\t\t#\t\t\t'/2010_archive/conformFS/p6/0'\n\t\t#\t\t\t]\n\t\t#for exc in exclusions:\n\t\t#\tif exc in path:\n\t\t#\t\treturn True\n\t\treturn False", "def _is_ignored(self, full_path):\n for ignor in self._ig...
[ "0.70819604", "0.68359214", "0.6834951", "0.65814173", "0.6517847", "0.6453988", "0.62765026", "0.62502044", "0.6247838", "0.61707073", "0.6158768", "0.61509436", "0.6147983", "0.6066478", "0.60239595", "0.6004838", "0.5966133", "0.5926251", "0.58772814", "0.58577347", "0.584...
0.58618635
19
Creates and returns instance of cim_quality class.
def _cim_quality(): return { 'type' : 'class', 'name' : 'cim_quality', 'base' : None, 'is_abstract' : False, 'is_entity' : True, 'doc' : 'The starting point for a quality record. It can contain any number of issues and reports. An issue is an open-ended description ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_quality(self):\n p = self.suitability + 1.15 * self.fono\n self.quality = np.exp(p) / (1 + np.exp(p))", "def quality(self) -> int:\n return self._quality", "def quality(self, value: int):\n # TODO - Ensure that this is valid\n self._quality = value", "def test_creat...
[ "0.55847603", "0.544121", "0.5395065", "0.53075176", "0.5211302", "0.5208251", "0.52065456", "0.5173867", "0.5161894", "0.51486427", "0.5118597", "0.5094241", "0.50869876", "0.5075998", "0.505893", "0.505843", "0.50402147", "0.5028008", "0.50113624", "0.49139944", "0.4907511"...
0.7541364
0
Partition an image into multiple patches of approximately equal size. The patch size is based on the desired number of rows and columns. Returns a list of image patches, in rowmajor order.
def create_image_patches(img, size=512): patch_list = [] width, height = img.shape[1], img.shape[0] w, h = size, size for y in range(0, height, h): y_end = min(y + h, width) for x in range(0, width, w): x_end = min(x + w, height) patch = img[y:y_end, x:x_end] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def divide_image_to_patches(img, patch_size):\n\n assert len(img.shape) == 3 and img.shape[-1] == 3\n\n height, width, n_channels = img.shape\n coordinates = _get_top_left_coordinates(height, width, patch_size)\n\n patches = []\n\n for top, left in coordinates:\n patches.append(img[top:top + ...
[ "0.7768448", "0.74705344", "0.7354165", "0.73307747", "0.7192567", "0.702412", "0.69212884", "0.68442935", "0.6794618", "0.67900044", "0.67849517", "0.6781368", "0.66674095", "0.66178596", "0.6552253", "0.6532069", "0.6493392", "0.64794147", "0.6466042", "0.6463869", "0.64577...
0.74337757
2
The plain dict defining the instance.
def _as_dict(self): return dict(self.items())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dict(self) -> Dict:\r\n return super().dict()", "def dict(self) -> Dict:\r\n return super().dict()", "def dict(self):\n return self.__dict__", "def dict(self):\n return self.__dict__", "def dict(self):\n return self.__dict__", "def dict(self):\n return self._...
[ "0.8240194", "0.8240194", "0.8110981", "0.8110981", "0.8110981", "0.8110981", "0.8110981", "0.8110981", "0.8110981", "0.8024938", "0.7829087", "0.77814144", "0.7761681", "0.7717576", "0.77096266", "0.768326", "0.76700306", "0.7650281", "0.7648925", "0.75965476", "0.7551962", ...
0.7384265
35
Creates the operators necessary for the simulation.
def make_operators(self): self.relationship_operator = Operators.RelationshipOperator(self) self.infection_operator = Operators.InfectionOperator(self) self.time_operator = Operators.TimeOperator(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _basic_operators_init():\n global BASIC_OPERATORS\n\n BASIC_OPERATORS = {\n \"angle_between\": {\n \"node\": \"angleBetween\",\n \"inputs\": [\n [\"vector1X\", \"vector1Y\", \"vector1Z\"],\n [\"vector2X\", \"vector2Y\", \"vector2Z\"],\n ...
[ "0.69540614", "0.6671332", "0.6624016", "0.63947886", "0.6279157", "0.62216306", "0.6161427", "0.6091667", "0.6049673", "0.60490084", "0.60336334", "0.60207355", "0.6005739", "0.6004894", "0.59818363", "0.5960457", "0.5926143", "0.58911276", "0.5849135", "0.5826824", "0.58212...
0.78349316
0
Add agent to the list of agents, the network, and assign to a grid queue. This is seperate from the make_population method so that other objects can add agents without make_population.
def add_to_simulation(self,agent): self.agents[agent.name] = agent self.network.add_node(agent) #agent given a grid queue at initialization grid_queue = [gq for gq in self.grid_queues.values() if gq.accepts(agent)][agent.sex] agent.grid_queue = grid_queue.index s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_grid_queue(self, agent):\n self.pipes[agent.grid_queue].send(\"add\")\n self.pipes[agent.grid_queue].send(agent)", "def append(self, agent):\n self.agents.append(agent)", "def add_transport(self, agent):\n with self.simulation_mutex:\n self.get(\"transport_agen...
[ "0.7903126", "0.69386274", "0.6692364", "0.65296", "0.6506088", "0.65008456", "0.64870113", "0.6464909", "0.6399469", "0.6321615", "0.62191206", "0.5769175", "0.5749872", "0.57246745", "0.56684023", "0.5616239", "0.55954784", "0.55757207", "0.5544044", "0.54693997", "0.541747...
0.8597643
0
Finds the age of agent
def age(self, agent): return (self.time - agent.born)/52.0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_age(self):\n\t\treturn self.age", "def age(self, year=None):\n y, m = self.master['birthYear'], self.master['birthMonth']\n return (year if year else self.currentyear) - y - (m > 6)", "def get_age(self):\n if validate_date_format(self.birt):\n birth_year, birth_month, bi...
[ "0.76486295", "0.7600306", "0.752329", "0.75098073", "0.75055975", "0.74689084", "0.74398935", "0.7416887", "0.740167", "0.74006224", "0.73706967", "0.73706967", "0.73706967", "0.7359488", "0.7359488", "0.7352661", "0.7352553", "0.73469836", "0.73408884", "0.7289448", "0.7281...
0.8530317
0
The Mode of the gateway slb.
def gateway_slb_mode(self) -> Optional[str]: return pulumi.get(self, "gateway_slb_mode")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gateway_slb_mode(self) -> str:\n return pulumi.get(self, \"gateway_slb_mode\")", "def get_mode(self):\r\n return self.mode", "def getmode(self):\n return self.mode", "def getMode(self):\n return self._mode", "def networkMode(self):\n\n response = self.at.sendCommand(\...
[ "0.83784354", "0.7091251", "0.7043202", "0.7018953", "0.6969579", "0.696678", "0.69319195", "0.692981", "0.6925483", "0.6925483", "0.6925483", "0.69151485", "0.69151485", "0.69151485", "0.6911895", "0.6883668", "0.6883668", "0.6864306", "0.68403286", "0.6803735", "0.67907137"...
0.7977576
1
The Status of the gateway slb.
def gateway_slb_status(self) -> Optional[str]: return pulumi.get(self, "gateway_slb_status")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gateway_slb_status(self) -> str:\n return pulumi.get(self, \"gateway_slb_status\")", "def status(self):\n return self.microblaze.state", "def status(self):\n return self.status", "def status(self):\n\t\treturn self._status", "def get_status(self):\n return self.status", "d...
[ "0.8582471", "0.72279525", "0.7110276", "0.7072184", "0.70538783", "0.70538783", "0.70538783", "0.7053305", "0.70464987", "0.703579", "0.703579", "0.7032769", "0.7032769", "0.70277184", "0.7027479", "0.70165145", "0.7011966", "0.7010962", "0.7007864", "0.7002743", "0.7002743"...
0.8072908
1
The ID of the gateway slb.
def slb_id(self) -> Optional[str]: return pulumi.get(self, "slb_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slb_id(self) -> str:\n return pulumi.get(self, \"slb_id\")", "def load_balancer_id(self) -> str:\n return pulumi.get(self, \"load_balancer_id\")", "def load_balancer_id(self) -> str:\n return pulumi.get(self, \"load_balancer_id\")", "def load_balancer_id(self) -> str:\n return...
[ "0.8201966", "0.7164886", "0.7164886", "0.7164886", "0.70258796", "0.6930156", "0.68294036", "0.6806015", "0.6771984", "0.6767023", "0.66462326", "0.662997", "0.661855", "0.661855", "0.66020685", "0.6594977", "0.6590117", "0.65078634", "0.6491616", "0.6479168", "0.64759105", ...
0.7741368
1
The id of acl.
def acl_id(self) -> str: return pulumi.get(self, "acl_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def acl_id(self) -> Optional[str]:\n return pulumi.get(self, \"acl_id\")", "def acl_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"acl_id\")", "def acl_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"acl_id\")", "def acl_id(self) -> Optional[pulumi.Input[str]]:\n ...
[ "0.86818516", "0.8637558", "0.8555794", "0.83676344", "0.69789577", "0.66910535", "0.6628064", "0.66190517", "0.65989006", "0.6589253", "0.6535327", "0.6535327", "0.6535327", "0.6535327", "0.6535327", "0.6535327", "0.6535327", "0.6535327", "0.6535327", "0.6535327", "0.6535327...
0.91479766
2
ID of the MSE Cluster.
def cluster_id(self) -> str: return pulumi.get(self, "cluster_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_id(self):\n return self._cluster_id", "def cluster_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"cluster_id\")", "def cluster_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"cluster_id\")", "def cluster_id(self) -> pulumi.Output[str]:\n return...
[ "0.79827464", "0.7791658", "0.7791658", "0.7791658", "0.7791658", "0.76063097", "0.74616414", "0.74616414", "0.73167914", "0.73140806", "0.73140806", "0.73140806", "0.7183493", "0.69770646", "0.69641954", "0.6779036", "0.6685338", "0.660061", "0.660061", "0.6465981", "0.64428...
0.8189766
1
ID of the MSE Cluster.
def id(self) -> str: return pulumi.get(self, "id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")", "def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")", "def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")", "def cluster_id(self) -> str:\n return pulumi.get(self, \"cl...
[ "0.8189766", "0.8189766", "0.8189766", "0.8189766", "0.8189766", "0.79827464", "0.7791658", "0.7791658", "0.7791658", "0.7791658", "0.76063097", "0.74616414", "0.74616414", "0.73167914", "0.73140806", "0.73140806", "0.73140806", "0.7183493", "0.69770646", "0.69641954", "0.677...
0.0
-1
ID of the MSE Cluster.
def instance_id(self) -> str: return pulumi.get(self, "instance_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")", "def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")", "def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")", "def cluster_id(self) -> str:\n return pulumi.get(self, \"cl...
[ "0.8189766", "0.8189766", "0.8189766", "0.8189766", "0.8189766", "0.79827464", "0.7791658", "0.7791658", "0.7791658", "0.7791658", "0.76063097", "0.74616414", "0.74616414", "0.73167914", "0.73140806", "0.73140806", "0.73140806", "0.7183493", "0.69770646", "0.69641954", "0.677...
0.5806641
79
The address of private network.
def intranet_address(self) -> str: return pulumi.get(self, "intranet_address")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private_network(self) -> str:\n return pulumi.get(self, \"private_network\")", "def network_address(self):\n\n return self._network_address", "def private_ip_address(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"private_ip_address\")", "def private_ip_address(self) -> pulu...
[ "0.7933097", "0.77741337", "0.7497677", "0.7497677", "0.7494737", "0.7405235", "0.73491955", "0.72590643", "0.7210017", "0.71845526", "0.7113998", "0.7113998", "0.7113998", "0.7113998", "0.7113998", "0.7074387", "0.70176274", "0.70118", "0.69016606", "0.6761564", "0.6761564",...
0.0
-1
The type of payment.
def pay_info(self) -> str: return pulumi.get(self, "pay_info")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def payment_type(self) -> str:\n return pulumi.get(self, \"payment_type\")", "def pay_type(self) -> str:\n return pulumi.get(self, \"pay_type\")", "def pay_type(self) -> str:\n return pulumi.get(self, \"pay_type\")", "def get_payment_type(self):\n payment_types = dict(settings.SUB...
[ "0.90905195", "0.8491085", "0.8491085", "0.82080966", "0.8157786", "0.80303454", "0.7920886", "0.7410416", "0.7219208", "0.7024609", "0.7024609", "0.6824851", "0.68031955", "0.6691925", "0.66769683", "0.66769683", "0.66769683", "0.66769683", "0.66769683", "0.66769683", "0.667...
0.0
-1
The id of Namespace.
def namespace_id(self) -> str: return pulumi.get(self, "namespace_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def namespace_id(self) -> Optional[str]:\n return pulumi.get(self, \"namespace_id\")", "def ns_id(self) -> str:\n return self._ns_id", "def getNamespacePath(self, id: long) -> unicode:\n ...", "def app_id_namespace(self):\n return self.__key.app_id_namespace()", "def computed_id(o):...
[ "0.8175702", "0.8166244", "0.71459746", "0.71278036", "0.69183016", "0.6917026", "0.686557", "0.67646843", "0.67315775", "0.6656598", "0.66097224", "0.65102136", "0.65102136", "0.65102136", "0.6491382", "0.6487603", "0.6451285", "0.6425991", "0.6422249", "0.6418733", "0.63989...
0.8748231
0
The backup vswitch id.
def backup_vswitch_id(self) -> str: return pulumi.get(self, "backup_vswitch_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vswitch_id(self) -> str:\n return pulumi.get(self, \"vswitch_id\")", "def vswitch_id(self) -> str:\n return pulumi.get(self, \"vswitch_id\")", "def vswitch_id(self) -> str:\n return pulumi.get(self, \"vswitch_id\")", "def vswitch_id(self) -> str:\n return pulumi.get(self, \"vs...
[ "0.81662524", "0.81662524", "0.81662524", "0.81662524", "0.7894044", "0.7894044", "0.7894044", "0.76167953", "0.76167953", "0.76167953", "0.72934574", "0.72934574", "0.72934574", "0.6895379", "0.6872636", "0.6860954", "0.684382", "0.6644172", "0.6635474", "0.6632908", "0.6632...
0.9345862
0
The name of the Gateway.
def gateway_name(self) -> str: return pulumi.get(self, "gateway_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gateway_name(self):\n return self.msg.gateway_name", "def name(self) -> str:\n return f\"{self._inst} NAT {self._data['name']}\"", "def name(self):\n return f'{self._vehicle.name} {self.wan_name} Signal'", "def gateway(self):\n return ''", "def name(self):\n return \"...
[ "0.8758647", "0.7125576", "0.691796", "0.682868", "0.67558604", "0.6721219", "0.67202896", "0.6688761", "0.6652942", "0.6629581", "0.6621541", "0.6619424", "0.66166276", "0.66166276", "0.66166276", "0.66123873", "0.6610318", "0.6610318", "0.6610318", "0.6610318", "0.66018283"...
0.8843099
0
The ID of the Gateway.
def id(self) -> str: return pulumi.get(self, "id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transit_gateway_id(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"transit_gateway_id\")", "def vpn_gateway_id(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"vpn_gateway_id\")", "def customer_gateway_id(self) -> pulumi.Output[str]:\n return pulumi...
[ "0.760282", "0.7552202", "0.74892884", "0.7416938", "0.7416938", "0.74003875", "0.74003875", "0.7357843", "0.72985363", "0.7172895", "0.7170665", "0.7020698", "0.69360036", "0.69011545", "0.6879337", "0.6865615", "0.68156004", "0.67905176", "0.6782389", "0.67685145", "0.67360...
0.0
-1
The payment type of the resource.
def payment_type(self) -> str: return pulumi.get(self, "payment_type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pay_type(self) -> str:\n return pulumi.get(self, \"pay_type\")", "def pay_type(self) -> str:\n return pulumi.get(self, \"pay_type\")", "def get_payment_type(self):\n payment_types = dict(settings.SUBSCRIPTION_PAYMENT_METHODS)\n return payment_types.get(self.payment_type, \"N/A\"...
[ "0.8333561", "0.8333561", "0.8156635", "0.7922579", "0.77071005", "0.76321757", "0.73601484", "0.73601484", "0.7269524", "0.7269524", "0.7269524", "0.7269524", "0.7269524", "0.7269524", "0.7269524", "0.7269524", "0.7269524", "0.7269524", "0.7269524", "0.7269524", "0.7269524",...
0.8836735
0
The status of the gateway.
def status(self) -> str: return pulumi.get(self, "status")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status(self):\n return self.status", "def get_status(self):\n return self.status", "def get_status(self):\n return self.status", "def get_status(self):\n return self.status", "def status(self):\n\t\treturn self._status", "def status(self):\r\n return self._status", ...
[ "0.79179776", "0.78476715", "0.78476715", "0.78476715", "0.7847561", "0.78201336", "0.78201336", "0.78135014", "0.7803643", "0.7803643", "0.778872", "0.7782259", "0.7782259", "0.7782259", "0.7782259", "0.7782259", "0.7782259", "0.7782259", "0.7782259", "0.7782259", "0.7782259...
0.7566843
61
The ID of the vpc.
def vpc_id(self) -> str: return pulumi.get(self, "vpc_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vpc_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> pulumi.Output[str]:\n ...
[ "0.9047301", "0.9047301", "0.9047301", "0.9047301", "0.9047301", "0.9047301", "0.9047301", "0.9047301", "0.9047301", "0.89741546", "0.8941356", "0.89109", "0.8826025", "0.8826025", "0.8826025", "0.8826025", "0.8826025", "0.8826025", "0.87463313", "0.87463313", "0.87463313", ...
0.93597037
4
The ID of the vswitch.
def vswitch_id(self) -> str: return pulumi.get(self, "vswitch_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vswitch_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"vswitch_id\")", "def vswitch_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"vswitch_id\")", "def vswitch_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"vswitch_id\")", "def vswitch_id(self) ...
[ "0.87616795", "0.87616795", "0.87616795", "0.85737336", "0.85737336", "0.85737336", "0.82949", "0.82949", "0.82949", "0.79455656", "0.7392806", "0.73809665", "0.73350304", "0.7329398", "0.725224", "0.725224", "0.72321284", "0.7118147", "0.7117566", "0.7006065", "0.69523454", ...
0.90596646
2
The Mode of the gateway slb.
def gateway_slb_mode(self) -> str: return pulumi.get(self, "gateway_slb_mode")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gateway_slb_mode(self) -> Optional[str]:\n return pulumi.get(self, \"gateway_slb_mode\")", "def get_mode(self):\r\n return self.mode", "def getmode(self):\n return self.mode", "def getMode(self):\n return self._mode", "def networkMode(self):\n\n response = self.at.sen...
[ "0.7977576", "0.7091251", "0.7043202", "0.7018953", "0.6969579", "0.696678", "0.69319195", "0.692981", "0.6925483", "0.6925483", "0.6925483", "0.69151485", "0.69151485", "0.69151485", "0.6911895", "0.6883668", "0.6883668", "0.6864306", "0.68403286", "0.6803735", "0.67907137",...
0.83784354
0
The Status of the gateway slb.
def gateway_slb_status(self) -> str: return pulumi.get(self, "gateway_slb_status")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gateway_slb_status(self) -> Optional[str]:\n return pulumi.get(self, \"gateway_slb_status\")", "def status(self):\n return self.microblaze.state", "def status(self):\n return self.status", "def status(self):\n\t\treturn self._status", "def get_status(self):\n return self.sta...
[ "0.8072908", "0.72279525", "0.7110276", "0.7072184", "0.70538783", "0.70538783", "0.70538783", "0.7053305", "0.70464987", "0.703579", "0.703579", "0.7032769", "0.7032769", "0.70277184", "0.7027479", "0.70165145", "0.7011966", "0.7010962", "0.7007864", "0.7002743", "0.7002743"...
0.8582471
0
The ID of the gateway slb.
def slb_id(self) -> str: return pulumi.get(self, "slb_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slb_id(self) -> Optional[str]:\n return pulumi.get(self, \"slb_id\")", "def load_balancer_id(self) -> str:\n return pulumi.get(self, \"load_balancer_id\")", "def load_balancer_id(self) -> str:\n return pulumi.get(self, \"load_balancer_id\")", "def load_balancer_id(self) -> str:\n ...
[ "0.7741368", "0.7164886", "0.7164886", "0.7164886", "0.70258796", "0.6930156", "0.68294036", "0.6806015", "0.6771984", "0.6767023", "0.66462326", "0.662997", "0.661855", "0.661855", "0.66020685", "0.6594977", "0.6590117", "0.65078634", "0.6491616", "0.6479168", "0.64759105", ...
0.8201966
0
The ID of the Cluster.
def cluster_id(self) -> str: return pulumi.get(self, "cluster_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_id(self):\n return self._cluster_id", "def cluster_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"cluster_id\")", "def cluster_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"cluster_id\")", "def cluster_id(self) -> pulumi.Output[str]:\n return...
[ "0.89389086", "0.86626196", "0.86626196", "0.86626196", "0.86626196", "0.8340103", "0.8340103", "0.811908", "0.811908", "0.811908", "0.8054237", "0.78245205", "0.76897746", "0.7672705", "0.7471035", "0.74283445", "0.7086439", "0.7086439", "0.70488244", "0.7007689", "0.6988441...
0.90772015
0
__init__ The constructor for a Node object.
def __init__(self, host, port, initialized=None, uuid=None, debug=False, no_mine=False, benchmark=False, neighbors=[]): m = sha1() m.update(host.encode()) m.update(str(port).encode()) self.metadata = {} self.metadata['done'] = initialized self.metadata['host'] = host ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.root = self.Node(None)", "def __init__(self):\n self.root = Node(None)", "def __init__(self):\n self.__root = Node()", "def __init__(self):\n self.root = Node('')", "def __init__(self):\n self.root = self.Node()", "def __init__(self):\n ...
[ "0.8253996", "0.8201114", "0.8167369", "0.8153046", "0.812439", "0.80758876", "0.80758876", "0.8030052", "0.8030052", "0.8030052", "0.79498625", "0.7937665", "0.79246503", "0.78018874", "0.77907264", "0.77897644", "0.77652395", "0.77497905", "0.7716643", "0.7685881", "0.76789...
0.0
-1
Returns the dictionary in a list of dictionaries that has the value of 'key' as 'value'.
def get(list_of_dict, key, value): return filter(lambda dictionary: dictionary[key] == value, list_of_dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_items(self, value, key=None):\n if key is None:\n return self.dicts(value)\n else:\n items = self.dicts(value)\n return [item[key] for item in items]", "def fusion_api_get_dict_from_list(self, listofDict, key, value):\n for d in listofDict:\n ...
[ "0.7204482", "0.7005516", "0.68736064", "0.661824", "0.6468425", "0.6367532", "0.6362521", "0.6360842", "0.6291553", "0.62285995", "0.62285995", "0.6169165", "0.6146054", "0.612497", "0.60989004", "0.6065829", "0.5944303", "0.59299034", "0.5926492", "0.5887199", "0.5844322", ...
0.69926775
2
Return list of all the projects in OpenStack.
def get_project_list(): return parse_list_output(Popen( 'openstack project list'.split(), stdout=STDOUT, stderr=STDERR ).communicate()[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def project_list(self):\n try:\n ids = self.request[api.DATA][api.DATA][\"ids\"]\n return self._get_keystone_projects(ids)\n except Exception as e:\n LOG.exception(\"Error occurred: %s\" % e)", "def list_keystone_v3_projects(self):\n LOG_OBJ.debug(\"List the ...
[ "0.8495921", "0.82235503", "0.8123712", "0.81170243", "0.80510795", "0.80300194", "0.80000013", "0.7996671", "0.7820062", "0.7760749", "0.7758176", "0.77562165", "0.77063435", "0.76904523", "0.7660116", "0.7604", "0.76015157", "0.75770324", "0.75115687", "0.74678594", "0.7449...
0.8108943
4
Gets dictionary of sample_id => index mappings that is used to lookup information in the genotype and haplotype tables
def get_samples_index(options): sys.stderr.write("reading list of individuals from %s\n" % options.samples) f = open(options.samples) ind_dict = {} idx = 0 for line in f: words = line.rstrip().split() # name = words[0].replace("NA", "") name ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_idx_maps(self, types, initial_mapping=None):\n initial_mapping = constants.INITIAL_MAPPING if initial_mapping is None else initial_mapping\n # generate type to index mappings\n self.type_to_idx['word'] = Preprocessor.type_to_idx(types['word'], initial_mapping['word'])\n self.ty...
[ "0.6734681", "0.6362328", "0.6331943", "0.6179442", "0.6103658", "0.6103658", "0.6075308", "0.6054439", "0.6011484", "0.6009861", "0.60036623", "0.59335893", "0.58924013", "0.5886331", "0.5804621", "0.57770246", "0.5739632", "0.57164943", "0.5711326", "0.57105523", "0.5654858...
0.666491
1
Computes epsilonDP topk counts using the Laplace mechanism.
def laplace_mechanism(item_counts, k, c, epsilon, neighbor_type): if neighbor_type is NeighborType.SWAP: sensitivity = min(2 * k, 2 * c) else: sensitivity = min(k, c) noisy_counts = item_counts + np.random.laplace( scale=sensitivity / epsilon, size=item_counts.shape) noisy_sorted_items = sorted_to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cdp_peeling_mechanism(item_counts, k, epsilon, delta):\n local_epsilon = em_epsilon_cdp(epsilon, delta, k)\n noisy_counts = item_counts + np.random.gumbel(\n scale=1 / local_epsilon, size=item_counts.shape)\n noisy_sorted_items = sorted_top_k(noisy_counts, k)\n return noisy_sorted_items", "def knn(p...
[ "0.6299064", "0.6220429", "0.6008511", "0.59606147", "0.595082", "0.5838881", "0.57103693", "0.56822735", "0.56595933", "0.56535417", "0.5634167", "0.5607399", "0.55868787", "0.55651116", "0.5560048", "0.5548766", "0.55285704", "0.5524867", "0.5504731", "0.5490478", "0.548544...
0.6184371
2
Get the sum of all lengths of the answer sets from any of the groups
def part_one(answer_data): group_counts = [] for answer_group in parse_groups(answer_data): group_counts.append(count_answer_set_union(answer_group)) return sum(group_counts)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_answer_set_union(group):\n answer_set = set(itertools.chain.from_iterable(group))\n return len(answer_set)", "def _lengths_groupings(mol):\n return [len(list(group)) for _, group in itertools.groupby(mol)]", "def count_answer_set_intersection(group):\n answer_set = set.intersection(*(set(...
[ "0.65839064", "0.6550863", "0.6525309", "0.6517386", "0.64997894", "0.6459564", "0.63812834", "0.62014186", "0.6115709", "0.5857287", "0.58487755", "0.57985544", "0.5781799", "0.5760002", "0.5707117", "0.5684685", "0.56666017", "0.56604224", "0.5643512", "0.55858415", "0.5530...
0.7051139
0
Property that defines scoring metric (e.g. ROCAUC or accuracy or fscore), given as a sklearncompatible string or a compatible sklearn scorer.
def scoring(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_scorer(scoring):\n if isinstance(scoring, str):\n try:\n scorer = SCORERS[scoring]\n except KeyError:\n raise ValueError(\n \"%r is not a valid scoring value. \"\n \"Use sorted(sklearn.metrics.SCORERS.keys()) \"\n \"to get ...
[ "0.71016246", "0.68566847", "0.6771998", "0.67681074", "0.6585731", "0.6511511", "0.6139908", "0.61190397", "0.61076844", "0.6000113", "0.5980278", "0.588598", "0.58689713", "0.58319646", "0.5831674", "0.58099157", "0.5791813", "0.57615745", "0.571513", "0.56960905", "0.56896...
0.58209944
15
Return the value of the state (computed in __init__).
def getValue(self, state): return self.values[state]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value(self, state):\n raise NotImplementedError", "def value(self, state):\n raise NotImplementedError", "def value(self, state):\n\t\traise NotImplementedError", "def getValue(self, state):\n util.raiseNotDefined()", "def getValue(self, state):\n util.raiseNotDefined()", ...
[ "0.83014333", "0.83014333", "0.826012", "0.8086146", "0.8086146", "0.79581815", "0.79296756", "0.78013283", "0.77367806", "0.77336967", "0.76010257", "0.76010257", "0.76010257", "0.76010257", "0.76010257", "0.76010257", "0.76010257", "0.76010257", "0.76010257", "0.76010257", ...
0.77333474
21
The policy is the best action in the given state according to the values currently stored in self.values. You may break ties any way you see fit. Note that if there are no legal actions, which is the case at the terminal state, you should return None.
def getPolicy(self, state): "*** YOUR CODE HERE ***" possibleActions = self.mdp.getPossibleActions(state) if len(possibleActions) == 0: return None results = [] for action in possibleActions: total = 0 for (nextState, prob) in self.mdp.getTransitionStatesA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPolicy(self, state):\n \"*** YOUR CODE HERE ***\"\n # OUR CODE HERE\n possibleActions = self.mdp.getPossibleActions(state)\n #checking for terminal state (no possible actions)\n if len(possibleActions) is 0: \n return None\n \n #attempt at using the Counter\n eValsActions = ut...
[ "0.77925164", "0.7712582", "0.76146024", "0.7607256", "0.74923486", "0.7467473", "0.7373709", "0.73420584", "0.7340943", "0.7338618", "0.73357975", "0.73147744", "0.7310598", "0.73102057", "0.727411", "0.724419", "0.724419", "0.71566546", "0.70890623", "0.70821065", "0.706314...
0.72943586
14
Generates a random string of input length
def get_random_string(length=5): return ''.join(random.SystemRandom().choice(string.ascii_lowercase + string.digits) for _ in range(length))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_random_string(length: int):\n\tall_chars = string.ascii_letters + string.digits\n\treturn ''.join(random.choices(all_chars, k=length))", "def generate_random_string(length):\r\n return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(length))", "def get_random_str(l...
[ "0.8702128", "0.85277575", "0.83981323", "0.83885884", "0.83881694", "0.8386189", "0.83839774", "0.8355186", "0.83521414", "0.83404326", "0.83040214", "0.82958287", "0.8289667", "0.8258438", "0.8243102", "0.82406664", "0.82318115", "0.822977", "0.8210092", "0.8178366", "0.817...
0.818328
19
Converts a rotation matrix to quaterion
def rot2quat(R): dEpsilon = 1e-6; quat = 4*[0.,] quat[0] = 0.5*np.sqrt(R[0,0]+R[1,1]+R[2,2]+1.0) if ( np.fabs(R[0,0]-R[1,1]-R[2,2]+1.0) < dEpsilon ): quat[1] = 0.0 else: quat[1] = 0.5*np.sign(R[2,1]-R[1,2])*np.sqrt(R[0,0]-R[1,1]-R[2,2]+1.0) if ( np.fabs(R[1,1]-R[2,2]-R[0,0]+1.0)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotation_mat_to_quat(R, q):\n q[0] = np.sqrt(R[0] + R[4] + R[8]) / 2\n q[1] = (R[7] - R[5]) / (4. * q[0])\n q[2] = (R[2] - R[6]) / (4. * q[0])\n q[3] = (R[3] - R[1]) / (4. * q[0])", "def rotation_matrix_to_quaternion(rotation_matrix):\n trace = np.trace(rotation_matrix)\n\n if trace > 0:\n ...
[ "0.7971645", "0.78728527", "0.7606546", "0.73802453", "0.7247294", "0.72241783", "0.7176656", "0.7131773", "0.7116152", "0.709005", "0.70214915", "0.7020572", "0.694918", "0.6943903", "0.6937841", "0.69297695", "0.69214255", "0.69173455", "0.69159365", "0.6870446", "0.6825436...
0.664386
31
get the minimum value of the data
def min(self): return min(self.sample)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Min(data):\n return data.min()", "def get_min(cls, data: tuple or list) -> float:\n cls._data_validation(data)\n return min(data)", "def min(self):\n least = self.data[0]\n \n for i in range(len(self.data)):\n if self.data[i] < least:\n least ...
[ "0.8953239", "0.8494876", "0.82617766", "0.81728566", "0.8151191", "0.8047047", "0.8025826", "0.8025826", "0.8022368", "0.80136144", "0.7988374", "0.7962404", "0.7959122", "0.7887428", "0.78769225", "0.78260833", "0.78007185", "0.7764526", "0.7764526", "0.7711247", "0.767816"...
0.7411154
48
get the maximum value of the data
def max(self): return max(self.sample)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Max(data):\n return data.max()", "def get_max(cls, data: tuple or list) -> float:\n cls._data_validation(data)\n return max(data)", "def get_max_value(self):\n max_value = max(self.values)\n return max_value", "def max(self):\n return numpy.ma.max(self.data)", "def...
[ "0.89424443", "0.8334495", "0.8301815", "0.8243822", "0.8200489", "0.81081915", "0.80724716", "0.79809207", "0.79766816", "0.79656523", "0.79636735", "0.79469854", "0.7931078", "0.790472", "0.78812575", "0.7835154", "0.7821081", "0.77920437", "0.7769243", "0.7702423", "0.7701...
0.73751247
45
Converts a post to an object.
def post_to_object(self, post, remove_id_prefix=False): id = post.get('id') if not id: return {} post_type = post.get('type') status_type = post.get('status_type') url = self.post_url(post) picture = post.get('picture') display_name = None message = (post.get('message') or post.ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_to_activity(self, post):\n id = None\n if post.get('id'):\n # strip USERID_ prefix if it's there\n post['id'] = post['id'].split('_', 1)[-1]\n id = post['id']\n\n obj = self.post_to_object(post)\n activity = {\n 'verb': VERBS.get(post.get('type', obj.get('objectType')), 'po...
[ "0.6743017", "0.6634363", "0.64666134", "0.64328283", "0.64288676", "0.63924253", "0.62250465", "0.6100585", "0.5983494", "0.57928866", "0.5783546", "0.57720053", "0.5728001", "0.57224494", "0.5671519", "0.5561353", "0.5561353", "0.5547429", "0.55430514", "0.5517116", "0.5506...
0.7561014
0