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
Delete pods by `name` or `label_selector` in the namespace `ns`. This action has been deprecated in favor of `terminate_pods`.
def delete_pods( name: str = None, ns: str = "default", label_selector: str = None, secrets: Secrets = None, ): _log_deprecated("delete_pods", "terminate_pods") return terminate_pods( name_pattern=name, label_selector=label_selector, ns=ns, secrets=secrets )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_pod_in_a_namespace(self, namespace, name, label_selector=\"\"):\n api_response = None\n try:\n api_response = self.ocp_pods.delete(namespace=namespace, name=name, label_selector=label_selector)\n except ApiException as e:\n logger.error(\"Exception deleting pod...
[ "0.7676201", "0.68533", "0.6325147", "0.6236356", "0.6189598", "0.6068535", "0.5982249", "0.59286475", "0.56464803", "0.56101894", "0.5605845", "0.555608", "0.5537296", "0.55309385", "0.54871714", "0.54690784", "0.54166883", "0.5376403", "0.53360814", "0.5322185", "0.5302754"...
0.86658823
0
Sets the id of this FixedPriceOrder.
def id(self, id): self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, id_):\n\n self.id_ = id_", "def set_id(self, id):\n self.__id = id", "def SetId(self, id):\n self.id = int(id)", "def set_id(self, id):\n self.data['id'] = id", "def set_id(self, id_=None):\n if id_ is None:\n self.id = id(self)\n else:\...
[ "0.73804176", "0.7256614", "0.72190756", "0.6975097", "0.69207233", "0.68378806", "0.6808543", "0.6808543", "0.6808543", "0.6808543", "0.6808543", "0.6808543", "0.6808543", "0.6808543", "0.6808543", "0.6808543", "0.67461413", "0.67461413", "0.67461413", "0.67461413", "0.67461...
0.0
-1
Sets the instrument of this FixedPriceOrder.
def instrument(self, instrument): self._instrument = instrument
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setInstrument(self,instrument):\n self.instrument = instrument\n self.instrument.attach(self)", "def instrument(self, i: int) -> None:\n if i > INSTRUMENT_MAX:\n self._instrument = INSTRUMENT_MAX\n if i < INSTRUMENT_MIN:\n self._instrument = INSTRUMENT_MIN\n e...
[ "0.6874341", "0.63128936", "0.59486437", "0.57818055", "0.57407886", "0.56965375", "0.54864943", "0.5473689", "0.5382283", "0.5280091", "0.5278958", "0.5244575", "0.5239897", "0.52066755", "0.51382935", "0.5131968", "0.509845", "0.5065592", "0.50651616", "0.5054971", "0.50445...
0.7036566
3
Sets the price of this FixedPriceOrder.
def price(self, price): self._price = price
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_price(self, price):\n assert isinstance(price, float), 'Price must be a float'\n self._price = price", "def price(self, price: float):\n\n self._price = price", "def setPrice(self, val):\n self.price = val", "def set_price(self, _price):\n self.price = _price\n ...
[ "0.83058834", "0.80579436", "0.78678685", "0.7814619", "0.7782222", "0.74928355", "0.74506956", "0.7057673", "0.6807021", "0.67636526", "0.6705089", "0.6686887", "0.6676795", "0.64678764", "0.6437129", "0.6360098", "0.629409", "0.6258904", "0.6257738", "0.62071174", "0.617885...
0.79016674
5
Sets the filling_transaction_id of this FixedPriceOrder.
def filling_transaction_id(self, filling_transaction_id): self._filling_transaction_id = filling_transaction_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transaction_id(self, transaction_id):\n\n self._transaction_id = transaction_id", "def transaction_id(self, transaction_id):\n\n self._transaction_id = transaction_id", "def fill_qty(self, fill_qty):\n\n self._fill_qty = fill_qty", "def fill_order_info(self, fill_order_info):\n\n ...
[ "0.6134125", "0.6134125", "0.59988594", "0.57616013", "0.57077223", "0.5651944", "0.5453682", "0.53476137", "0.53476137", "0.5198236", "0.51772434", "0.51349103", "0.5130844", "0.5129531", "0.5129531", "0.5129531", "0.5124169", "0.50538325", "0.5031544", "0.4995864", "0.49449...
0.8231312
0
Sets the filled_time of this FixedPriceOrder.
def filled_time(self, filled_time): self._filled_time = filled_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fill_price(self, fill_price):\n\n self._fill_price = fill_price", "def set_filled_order(self):\n self.set_values(\n start_phrase='Filled Orders',\n end_phrase=None,\n start_with=2,\n end_until=-1,\n prop_keys=self.filled_order_keys,\n ...
[ "0.6595052", "0.65068907", "0.6380333", "0.62155384", "0.60215753", "0.59504706", "0.58616924", "0.58482105", "0.578474", "0.57353157", "0.5731719", "0.57060766", "0.56341016", "0.5625239", "0.5570418", "0.5539514", "0.5525846", "0.5525846", "0.5499253", "0.5452787", "0.54527...
0.8350459
0
Sets the trade_reduced_id of this FixedPriceOrder.
def trade_reduced_id(self, trade_reduced_id): self._trade_reduced_id = trade_reduced_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trade_opened_id(self, trade_opened_id):\n\n self._trade_opened_id = trade_opened_id", "def financial_offer_id(self, financial_offer_id):\n\n self._financial_offer_id = financial_offer_id", "def fixed_amount(self, fixed_amount):\n\n self._fixed_amount = fixed_amount", "def fixed_amoun...
[ "0.5784254", "0.49987936", "0.49319795", "0.49319795", "0.4917987", "0.4917987", "0.4917987", "0.47384098", "0.46353856", "0.46302015", "0.45950204", "0.4570895", "0.45648447", "0.4538149", "0.45300555", "0.45180154", "0.45059323", "0.4503598", "0.4482375", "0.44729948", "0.4...
0.8559559
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, FixedPriceOrder): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Initialize the error with the unpermitted component.
def __init__(self, component_name, component_value, allowed_values): super(UnpermittedComponentError, self).__init__( "{} was required to be one of {!r} but was {!r}".format( component_name, list(sorted(allowed_values)), component_value, ), component_name, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, error = ''):\n IPRO_Error.__init__(self, error)", "def __init__(self, error = ''):\n IPRO_Error.__init__(self, error)", "def __init__(self, error = ''):\n IPRO_Error.__init__(self, error)", "def __init__(self, msg: str) -> None:\n super().__init__(\n ...
[ "0.6656881", "0.6656881", "0.6656881", "0.65116024", "0.6447586", "0.63485545", "0.6318334", "0.6285211", "0.6241168", "0.62122595", "0.6198851", "0.60262394", "0.5998427", "0.5994576", "0.5977634", "0.596302", "0.59432364", "0.5939619", "0.5925935", "0.59133214", "0.58685756...
0.7294459
0
Adds route declarations to the app config.
def configure_routing(config): # Static file access. Separate root for each subdirectory, because Pyramid # treats these as first-class routables rather than a last-ditch fallback config.add_static_view('/css', 'floof:assets/css') config.add_static_view('/files', 'floof:assets/files') # dummy file sto...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_routes(self):\n pass", "def add_routes(self):\n# from server.flask import views as flask_views\n# flask_views_custom_methods = filter(lambda x: x.startswith(\"view_\"), dir(flask_views))\n# for custom_method in flask_views_custom_methods:\n# # Retrieve data needed t...
[ "0.7343304", "0.7111445", "0.6927734", "0.6663373", "0.6618642", "0.6509414", "0.64065814", "0.6380825", "0.63281083", "0.63227695", "0.6289028", "0.6267212", "0.62269104", "0.6143751", "0.60936815", "0.6047055", "0.6040613", "0.60378504", "0.60291815", "0.5995512", "0.595206...
0.6212922
13
The method returns the height of the displayed area of the screen in pixels.
def height(self): return(self.SCREEN_H)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def height(self) -> int:\n return self.screen.getmaxyx()[0]", "def screen_height(self):\n # type: () -> int\n return self._screen_height", "def height(self):\n _, ymin, _, ymax = self.viewport\n return self.parent.window_size[1] * (ymax - ymin)", "def winfo_screenheight(sel...
[ "0.844346", "0.83997166", "0.81180495", "0.79416585", "0.7895171", "0.779391", "0.779391", "0.77222246", "0.7706157", "0.77059484", "0.76483095", "0.76483095", "0.76483095", "0.76483095", "0.76423275", "0.764116", "0.764116", "0.764116", "0.7630333", "0.7531426", "0.7507119",...
0.8675859
0
Returns a bool indicating whether the two nodes are the same
def are_the_same(node_before, node_after) -> bool: if node_before.algorithm != node_after.algorithm: return False elif not _is_output_name_same(node_before, node_after): return False else: for attr in interested_attrs: if _exists_attr(attr, no...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nodes_are_equal(node1, node2):\n\n try:\n return dump_ast(node1).strip() == dump_ast(node2).strip() and \\\n node1.lineno == node2.lineno and \\\n node1.col_offset == node2.col_offset\n except:\n return False", "def __eq__(self, other):\n return type(self)...
[ "0.7926271", "0.77140003", "0.77061266", "0.75974965", "0.75974965", "0.75974965", "0.75974965", "0.75974965", "0.758966", "0.75789934", "0.75232685", "0.7513506", "0.74829745", "0.7423596", "0.7419658", "0.74157387", "0.7373907", "0.7358468", "0.73276097", "0.72754157", "0.7...
0.7236223
22
Gets or sets a JSON string containing a list of dynamic tags that will be evaluated from user claims in the push registration endpoint.
def dynamic_tags_json(self) -> Optional[str]: return pulumi.get(self, "dynamic_tags_json")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def json_taglist():\n tags = Tag.query.all()\n out = {'tags': []}\n for tag in tags:\n out['tags'].append(tag.value)\n\n return jsonify(out)", "def tag_whitelist_json(self) -> Optional[str]:\n return pulumi.get(self, \"tag_whitelist_json\")", "def get_tags():\n\treturn jsonify(tags=[i...
[ "0.63156515", "0.6199246", "0.6112865", "0.5900489", "0.5890987", "0.5740233", "0.5615943", "0.55163264", "0.55163264", "0.5481147", "0.54706466", "0.54363877", "0.54363877", "0.54363877", "0.54363877", "0.5428364", "0.5399729", "0.5393173", "0.53896046", "0.53836834", "0.537...
0.74748486
0
Gets or sets a flag indicating whether the Push endpoint is enabled.
def is_push_enabled(self) -> bool: return pulumi.get(self, "is_push_enabled")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enabled(self):\n return self._packet.get('enabled', True)", "def enabled(self):\n return self._get('enabled')", "def enabled(self, endpoint):\n if self._has_endpoint(endpoint):\n return self._can_access_endpoint(endpoint)\n else:\n return False", "def...
[ "0.6807241", "0.6531802", "0.64264745", "0.6366728", "0.6320976", "0.6320976", "0.6320976", "0.6320976", "0.6320976", "0.6320976", "0.6320976", "0.6320976", "0.62966174", "0.6250802", "0.6200809", "0.6200809", "0.6200809", "0.6200809", "0.6200809", "0.6200809", "0.61435527", ...
0.73074114
0
Gets or sets a JSON string containing a list of tags that are whitelisted for use by the push registration endpoint.
def tag_whitelist_json(self) -> Optional[str]: return pulumi.get(self, "tag_whitelist_json")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags(self):\r\n url = self.base_url + 'tags/'\r\n return json.loads(self.bb.load_url(url))", "def json_taglist():\n tags = Tag.query.all()\n out = {'tags': []}\n for tag in tags:\n out['tags'].append(tag.value)\n\n return jsonify(out)", "def tags(self):\r\n url = '{0...
[ "0.67767817", "0.6750458", "0.6724867", "0.6666554", "0.6487772", "0.64454865", "0.6220114", "0.6220114", "0.6168508", "0.6144219", "0.6141203", "0.6141203", "0.6141203", "0.6141203", "0.6106933", "0.60437053", "0.60178125", "0.59873253", "0.59806365", "0.5933552", "0.5851083...
0.7465907
0
Gets or sets a JSON string containing a list of tags that require user authentication to be used in the push registration endpoint.
def tags_requiring_auth(self) -> Optional[str]: return pulumi.get(self, "tags_requiring_auth")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tag_whitelist_json(self) -> Optional[str]:\n return pulumi.get(self, \"tag_whitelist_json\")", "def tags(self):\r\n url = '{0}/{1}'.format(self.get_url(), 'tags')\r\n\r\n return http.Request('GET', url), parsers.parse_json", "def tags(self):\r\n url = self.base_url + 'tags/'\r\n...
[ "0.66256195", "0.66195095", "0.64664656", "0.6446524", "0.6263832", "0.6232695", "0.61493564", "0.6112513", "0.5951254", "0.5951254", "0.59228855", "0.5895426", "0.5895426", "0.5895426", "0.5895426", "0.5855403", "0.579", "0.579", "0.579", "0.579", "0.579", "0.579", "0.57...
0.58999014
11
Calculate the great circle distance between two points on the earth (specified in decimal degrees)
def haversine_dist(lat1, lng1, lat2, lng2): R = 6371 # mean radius of earth in kms # convert decimal degrees to radians lng1, lat1, lng2, lat2 = map(radians, [lng1, lat1, lng2, lat2]) # haversine formula dlon = lng2 - lng1 dlat = lat2 - lat1 a = (sin(dlat/2))**2 + cos(lat1) * cos(lat2) *...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def great_circle(lat_1, long_1, lat_2, long_2):\n long_1 = m.radians(long_1)\n lat_1 = m.radians(lat_1)\n long_2 = m.radians(long_2)\n lat_2 = m.radians(lat_2)\n\n d = 2 * 6367.45 * m.asin(\n m.sqrt(haversine(lat_2 - lat_1)\n + m.cos(lat_1)*m.cos(lat_2) *\n haversine(long...
[ "0.81450045", "0.7863265", "0.76322985", "0.76064754", "0.75978696", "0.75965863", "0.75944835", "0.75720793", "0.75630087", "0.7555095", "0.7528691", "0.7517629", "0.7492963", "0.7467739", "0.7452678", "0.7434477", "0.73914117", "0.7357736", "0.73484355", "0.73318124", "0.73...
0.0
-1
Return de neighbor nodes of the node. This method is not hierarchical and thus the root node has no effect.
def node_neighbors(graph, nid): if nid is None: return [] if graph.masked: nodes = set(graph.nodes.keys()) adjacency = set(graph.adjacency[nid]) else: nodes = set(graph.origin.nodes.keys()) adjacency = set(graph.origin.adjacency[nid]) return sorted(node...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def neighbours(self):\n return [x.node for x in self.edges]", "def get_neighbours(self):\n return []", "def neighbors(self) -> List['Node']:\r\n self._load_neighbors()\r\n return [edge.source if edge.source != self else edge.target\r\n for edge in self._neighbors....
[ "0.7430351", "0.71326214", "0.70532084", "0.7045622", "0.6977535", "0.6942897", "0.6878872", "0.68705356", "0.6810695", "0.6790978", "0.6770247", "0.6765646", "0.675344", "0.6729268", "0.67236125", "0.66900355", "0.6675893", "0.6669115", "0.6625687", "0.66035706", "0.66016567...
0.0
-1
An edge weight map indexed by node id's. A dictionary indexed by node id1's in which each value is a dictionary of connected node id2's linking to the edge weight. If directed, edges go from id1 to id2, but not the other way. If stochastic, all the weights for the neighbors of a given node sum to 1. A heuristic can be ...
def adjacency(graph, directed=False, reverse=False, stochastic=False, heuristic=None): v = {} for n in graph.nodes: v[n] = {} for e in graph.edges: id1, id2 = e if reverse: id1, id2 = reversed(e) v[id1][id2] = 1.0 - graph.edges[e].get('weight', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map_fid_to_arc_weight(edges, edgeToFID):\n fidToWeight = {}\n for s, targets in edges.items():\n for t, edge in targets.items():\n weight = edge.cost\n fidToWeight[edgeToFID[(s,t)]] = weight\n return fidToWeight", "def _weight_edges(self):\n weights = {}\n for edge i...
[ "0.63344896", "0.6330071", "0.5983686", "0.5929064", "0.5799953", "0.57950926", "0.57940555", "0.57823145", "0.57443416", "0.5702197", "0.5643257", "0.564124", "0.5636478", "0.56044185", "0.5603834", "0.55860645", "0.5552821", "0.5549155", "0.55452603", "0.55107135", "0.55026...
0.5673463
10
Return the OID of this Series_Sample item.
def getOid(self): return self.getDbRecord().getColumnValue(OID_COLUMN)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample_id(self) -> pd.Series:\n return self.meta.get(\"sample_id\")", "def getOid(self):\n if self.__state & self.stClean:\n return self.__oid\n else:\n raise SmiError('%s object not fully initialized' % self.__class__.__name__)", "def GetItemIdentity(self, item):...
[ "0.65542996", "0.65125966", "0.6335911", "0.6334058", "0.6212227", "0.6185819", "0.6120698", "0.61139965", "0.60991305", "0.6045605", "0.603419", "0.60167533", "0.5962272", "0.5941924", "0.594092", "0.5917801", "0.5917291", "0.591624", "0.59053326", "0.5901603", "0.5886144", ...
0.682297
0
Return the Series ID (Foreign Key) of this Series_Sample item.
def getSeriesFK(self): return self.getDbRecord().getColumnValue(SERIES_COLUMN)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample_id(self) -> pd.Series:\n return self.meta.get(\"sample_id\")", "def getSampleFK(self):\n return self.getDbRecord().getColumnValue(SAMPLE_COLUMN)", "def series_id(self) -> str:\n return self.get_main_information()['ParentSeries']", "def getSampleId(self):\n return self.g...
[ "0.76359", "0.74848956", "0.7269557", "0.6918238", "0.6345596", "0.6282396", "0.62360984", "0.6194396", "0.6152078", "0.60451823", "0.6034351", "0.5986492", "0.5963095", "0.5949968", "0.59493345", "0.5925984", "0.5917336", "0.59063274", "0.5901593", "0.58931834", "0.5890906",...
0.7254443
3
Return the Sample ID (Foreign Key) of this Series_Sample item.
def getSampleFK(self): return self.getDbRecord().getColumnValue(SAMPLE_COLUMN)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSampleId(self):\n return self.getDbRecord().getColumnValue(SAMPLE_ID_COLUMN)", "def sample_id(self) -> pd.Series:\n return self.meta.get(\"sample_id\")", "def setSampleFK(self, value):\n return self.getDbRecord().setColumnValue(SAMPLE_COLUMN, value)", "def item_id(self):\n ...
[ "0.80103517", "0.80042773", "0.65711224", "0.64920664", "0.6389007", "0.6228629", "0.61991525", "0.61708945", "0.6132264", "0.6065119", "0.6057483", "0.6048307", "0.6048307", "0.6048307", "0.6048307", "0.6048307", "0.6048307", "0.6043666", "0.6038653", "0.6038653", "0.6027183...
0.8387795
0
Return the Sample Id of this Series_Sample item.
def getSampleId(self): return self.getDbRecord().getColumnValue(SAMPLE_ID_COLUMN)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample_id(self) -> pd.Series:\n return self.meta.get(\"sample_id\")", "def getSampleFK(self):\n return self.getDbRecord().getColumnValue(SAMPLE_COLUMN)", "def item_id(self):\n return self._item_id", "def getId(self):\n return _libsbml.SBase_getId(self)", "def setSampleId(sel...
[ "0.8342742", "0.713528", "0.6823715", "0.67363244", "0.66249245", "0.65780056", "0.64664346", "0.64554805", "0.64230555", "0.6359042", "0.63373935", "0.63373935", "0.63373935", "0.63373935", "0.63373935", "0.63373935", "0.63238734", "0.632156", "0.63208497", "0.6305783", "0.6...
0.8379332
0
Set the OID of this Series_Sample item.
def setOid(self, value): return self.getDbRecord().setColumnValue(OID_COLUMN, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_ident(self, new_ident: int):\n if not isinstance(new_ident, int):\n raise TypeError(\"Spectrum set identifiers may ONLY be positive integers\")\n self._set_ident = new_ident", "def version_oid(self, version_oid):\n\n self._version_oid = version_oid", "def item_metadata_o...
[ "0.5894233", "0.5856492", "0.57207793", "0.56544", "0.56544", "0.55404806", "0.55249864", "0.5490288", "0.5470665", "0.54483867", "0.54479873", "0.5442436", "0.5344514", "0.5307351", "0.52795655", "0.5277514", "0.52747095", "0.52622837", "0.52622217", "0.52622217", "0.5233995...
0.66523397
0
Set the Series ID (Foreign Key) of this Series_Sample item.
def setSeriesFK(self, value): return self.getDbRecord().setColumnValue(SERIES_COLUMN, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setSampleFK(self, value):\n return self.getDbRecord().setColumnValue(SAMPLE_COLUMN, value)", "def setSampleId(self, value):\n return self.getDbRecord().setColumnValue(SAMPLE_ID_COLUMN, value)", "def setId(self, *args):\n return _libsbml.SimpleSpeciesReference_setId(self, *args)", "de...
[ "0.6674764", "0.6318599", "0.61925834", "0.61117274", "0.60480475", "0.60355824", "0.600202", "0.5993006", "0.59875184", "0.5904227", "0.5848485", "0.58415866", "0.5834417", "0.5832713", "0.5819079", "0.5815609", "0.579945", "0.5778987", "0.57736677", "0.5764074", "0.5763798"...
0.69481343
0
Set the Sample Id (Foreign Key) of this Series_Sample item.
def setSampleFK(self, value): return self.getDbRecord().setColumnValue(SAMPLE_COLUMN, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setSampleId(self, value):\n return self.getDbRecord().setColumnValue(SAMPLE_ID_COLUMN, value)", "def sample_id(self) -> pd.Series:\n return self.meta.get(\"sample_id\")", "def getSampleFK(self):\n return self.getDbRecord().getColumnValue(SAMPLE_COLUMN)", "def getSampleId(self):\n ...
[ "0.76243174", "0.62954724", "0.6059425", "0.5901821", "0.5873834", "0.58600944", "0.5842321", "0.583088", "0.5821071", "0.5769658", "0.5762409", "0.5762409", "0.5762409", "0.5760991", "0.5760991", "0.5760991", "0.5760991", "0.5760991", "0.5760991", "0.5760991", "0.5760991", ...
0.774545
0
Set the Sample Id of this Series_Sample item.
def setSampleId(self, value): return self.getDbRecord().setColumnValue(SAMPLE_ID_COLUMN, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setSampleFK(self, value):\n return self.getDbRecord().setColumnValue(SAMPLE_COLUMN, value)", "def sample_id(self) -> pd.Series:\n return self.meta.get(\"sample_id\")", "def setID(self, id):\r\n raise NotImplementedError(\"must be implemented in subclass\")", "def set_id(self, id):\n ...
[ "0.6570046", "0.6398321", "0.6261626", "0.60797423", "0.6006676", "0.5965754", "0.5964697", "0.5959027", "0.5931173", "0.59258485", "0.59258485", "0.59258485", "0.5903037", "0.5900617", "0.5885212", "0.58736914", "0.58736914", "0.58736914", "0.58736914", "0.58736914", "0.5873...
0.8032014
0
Set the Description of this Series_Sample item.
def setDescription(self, value): return self.getDbRecord().setColumnValue(DESCRIPTION_COLUMN, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_desc(self, item_desc):\r\n self.description = item_desc", "def SetDescription(self, description):\n self.description = str(description)", "def set_description(self, description):\r\n self.__description = description", "def set_description(self, description):\n self.description...
[ "0.7871355", "0.77835643", "0.7755221", "0.77129453", "0.77073276", "0.7675003", "0.76573753", "0.75465614", "0.75465614", "0.75465614", "0.75465614", "0.7458813", "0.7458813", "0.7458813", "0.7458813", "0.7458813", "0.7458813", "0.7458813", "0.7458813", "0.7458813", "0.74588...
0.70667267
69
Calculate unit vector for each element in stream.
def unit_vector_stream(stream): return stream.map(lambda x: x / np.linalg.norm(x, axis=-1)[...,None])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uw(self):\n return sm.unitvec(self.w)", "def unit(vector: np.array) -> np.array:\n return np.array([*vector]) / np.sqrt((vector * vector).sum(axis=0))", "def cal_unit_vec(vector):\n return vector / np.linalg.norm(vector)", "def unit(vector):\r\n result = [[0] for row in range(len(vector))]\...
[ "0.7008889", "0.68611336", "0.6859904", "0.6810437", "0.680755", "0.66604006", "0.66469175", "0.66224194", "0.6572716", "0.6522445", "0.6467633", "0.6460247", "0.64244795", "0.6419318", "0.6392956", "0.63723725", "0.63391554", "0.63391554", "0.63391554", "0.63383096", "0.6264...
0.80187875
0
Split itererator of tuples into multiple iterators.
def _split_iterators(iterator, n=None): #if n is None: # item, iterator = cytoolz.peek(iterator) # n = len(item) iterators = itertools.tee(iterator, n) #iterators = ((sample[i] for sample in iterator) for i, iterator in enumerate(iterators)) # Above does not work?! out = list() ou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def batch_iter(iterable: Iterable[T], size: int) -> Iterator[Tuple[T]]:\n # make sure we can deal with iterables like lists too\n sourceiter = iter(iterable)\n # call islice until it returns an empty tuple\n return iter(lambda: tuple(islice(sourceiter, size)), ())", "def split_in_pairs(arg: Iterable)...
[ "0.70962477", "0.68517005", "0.66123486", "0.6484995", "0.6484995", "0.6418032", "0.6409741", "0.63585114", "0.6238258", "0.62358075", "0.6216999", "0.62157154", "0.6195276", "0.6184127", "0.617032", "0.6131312", "0.6117561", "0.6105106", "0.6085174", "0.6072814", "0.6066473"...
0.70533836
1
Return the signal of this subsource as function of SubSource Receiver orientation.
def signal(self, orientation): #return np.array([src.emission(orientation) for src in self.virtualsources]).sum(axis=0) #signal = 0.0 #for src in self.virtualsources: #signal += src.emission(orientation) #return signal #print(orientation) return sum((src.emiss...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_signal(self):\n\n return self._signal", "def signal_rsi(self):\n pass", "def value(self):\n string = signal_base_get_value(self.obj)\n return stringToObject(string)", "def getScatteringSignal(self):\r\n\t\treturn self.scatData", "def get_signal_active(self):\n ret...
[ "0.6157507", "0.57817566", "0.555312", "0.5552063", "0.55218935", "0.5470668", "0.54081994", "0.5403896", "0.5383541", "0.53624886", "0.5278953", "0.52640617", "0.5259815", "0.5242287", "0.5221746", "0.5191637", "0.5181778", "0.51393265", "0.5131482", "0.51149434", "0.5107987...
0.65405846
0
Create an encrypted, signed and compressed JSON Web Token (JWT).
def encrypt(self, data, expires_in_s=None): assert isinstance(data, dict) now = time() dataserial = dumps(data) if expires_in_s is None: expires_in_s = self.expiration_s # Compress token cps = False if self.compress: uncompressed = datas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_jwt(user_obj):\n return jwt.encode(\n user_serializer.GetUserInfoSerializer(user_obj).data,\n settings.SECRET_KEY, algorithm='HS256').decode('utf-8')", "def _create_token(self, payload, key):\n return jwt.encode(payload, key, algorithm='RS256')", "def create_jwt(key, cert, sy...
[ "0.76316756", "0.7579533", "0.75391215", "0.75289017", "0.74664694", "0.7453538", "0.7431578", "0.7377313", "0.7339952", "0.72711843", "0.7263791", "0.71913266", "0.7148498", "0.71472293", "0.71334094", "0.7128197", "0.7121933", "0.70732754", "0.7055387", "0.7054785", "0.7017...
0.63812536
66
Test that it can get a dict of active rooms
def test_get_active_rooms(self): filename = './test_json_data/chat_participant_list.txt' result = jh.getActiveRooms(filename) bad_result = jh.getActiveRooms('invalid file path') self.assertEqual(len(result),2) self.assertEqual(type(result),type({'1':1})) self.as...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_room(rooms):\n free_rooms = []\n booked_rooms = [] \n for element in rooms:\n if element['booked'] == False:\n free_rooms.append(element)\n else:\n booked_rooms.append(element)\n return free_rooms, booked_rooms", "def possible_rooms(self):\r\n r...
[ "0.64899284", "0.6259978", "0.62150085", "0.62083477", "0.6165166", "0.61488074", "0.6099231", "0.6028046", "0.60051787", "0.59717757", "0.59524846", "0.591012", "0.5907857", "0.5889493", "0.58847076", "0.58651894", "0.5847525", "0.5809215", "0.5762803", "0.5745984", "0.57288...
0.7204647
0
Test that it can get a dict of active rooms
def test_update_chat_participants(self): filename = './test_json_data/chat_participant_list2.txt' rooms = {"901":['user2']} jh.update_chat_participants(filename,rooms) rooms = {} if os.path.exists(filename): with open(filename) as f_with_participants: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_active_rooms(self):\n filename = './test_json_data/chat_participant_list.txt'\n\n result = jh.getActiveRooms(filename)\n bad_result = jh.getActiveRooms('invalid file path')\n \n self.assertEqual(len(result),2)\n self.assertEqual(type(result),type({'1':1}))\n ...
[ "0.7204647", "0.64899284", "0.6259978", "0.62150085", "0.62083477", "0.6165166", "0.61488074", "0.6099231", "0.6028046", "0.60051787", "0.59717757", "0.59524846", "0.591012", "0.5907857", "0.5889493", "0.58847076", "0.58651894", "0.5847525", "0.5809215", "0.5762803", "0.57459...
0.52633506
83
Test that it can get a dict of active rooms
def test_del_chat_participants(self): filename = './test_json_data/chat_participant_list3.txt' rooms = {'101':['user101']} with open(filename, 'w') as f_with_participants: json.dump(rooms, f_with_participants) jh.delete_chat_participant(filename,'user101','101') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_active_rooms(self):\n filename = './test_json_data/chat_participant_list.txt'\n\n result = jh.getActiveRooms(filename)\n bad_result = jh.getActiveRooms('invalid file path')\n \n self.assertEqual(len(result),2)\n self.assertEqual(type(result),type({'1':1}))\n ...
[ "0.7204647", "0.64899284", "0.6259978", "0.62150085", "0.62083477", "0.6165166", "0.61488074", "0.6099231", "0.6028046", "0.60051787", "0.59717757", "0.59524846", "0.591012", "0.5907857", "0.5889493", "0.58847076", "0.58651894", "0.5847525", "0.5809215", "0.5762803", "0.57459...
0.0
-1
Retrieves an account by name.
def get_account_by_name(self, name): return next((account for account in self.accounts if account.ynab_account_name.lower() == name.lower()), None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_account(self, name):\n return self._accounts[name]", "def get_account_by_name(self, account_name):\n accounts = self.service_old.management().accounts().list().execute()\n\n account = None\n if accounts.get('items'):\n account = next(acnt for acnt in accounts.get('i...
[ "0.8831098", "0.8327038", "0.7981337", "0.7460405", "0.7292755", "0.72684366", "0.7257258", "0.70805156", "0.7036863", "0.7025724", "0.69705826", "0.69512737", "0.68961453", "0.68383986", "0.6814339", "0.6803135", "0.6694179", "0.6688193", "0.6654581", "0.6645074", "0.6633687...
0.80006295
2
Retrieves the latest transactions from all accounts.
def get_latest_transactions(self): first_run = False if not self._transactions: first_run = True transactions = [] for account in self.accounts: self._logger.debug('Getting transactions for account "%s"', account.ynab_account.name) for transaction in a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_latest_transactions(self):\n transactions = []\n for account in self.accounts:\n self._logger.debug('Getting transactions for account \"%s\"', account.ynab_account.name)\n for transaction in account.get_latest_transactions():\n if not self._filter_tran...
[ "0.7895743", "0.734593", "0.71129805", "0.6921993", "0.6911823", "0.6869161", "0.68425894", "0.683384", "0.6802826", "0.67912877", "0.67362016", "0.67097294", "0.6683309", "0.66813576", "0.66402507", "0.65974385", "0.64527607", "0.642615", "0.64252985", "0.6411244", "0.637871...
0.7669364
1
Retrieves the latest transactions from all accounts.
def get_all_latest_transactions(self): transactions = [] for account in self.accounts: self._logger.debug('Getting transactions for account "%s"', account.ynab_account.name) for transaction in account.get_latest_transactions(): if not self._filter_transaction(tran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_latest_transactions(self):\n first_run = False\n if not self._transactions:\n first_run = True\n transactions = []\n for account in self.accounts:\n self._logger.debug('Getting transactions for account \"%s\"', account.ynab_account.name)\n for tr...
[ "0.7669364", "0.734593", "0.71129805", "0.6921993", "0.6911823", "0.6869161", "0.68425894", "0.683384", "0.6802826", "0.67912877", "0.67362016", "0.67097294", "0.6683309", "0.66813576", "0.66402507", "0.65974385", "0.64527607", "0.642615", "0.64252985", "0.6411244", "0.637871...
0.7895743
0
Write a single PSM to the PSM file. This method is currently not supported (see Notes). Raises NotImplementedError MzidWriter currently does not support write_psm.
def write_psm(self, psm: PSM): raise NotImplementedError("MzidWriter currently does not support write_psm.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_file(self, psm_list: PSMList):\n file = open(self.filename, \"wb\")\n with Progress(disable=not self.show_progressbar) as progress:\n with MzIdentMLWriter(file, close=True) as writer:\n writer.controlled_vocabularies()\n writer.provenance(\n ...
[ "0.6582056", "0.64809006", "0.586037", "0.5521785", "0.5323735", "0.5215599", "0.5100669", "0.5022321", "0.50183034", "0.49951786", "0.4985321", "0.49665624", "0.49407896", "0.49182037", "0.49094188", "0.48834577", "0.48508763", "0.48418483", "0.4815075", "0.48142037", "0.479...
0.8632419
0
This function is for viewing the plot of your cost history. You can run it by uncommenting this plot_cost_history(alpha, cost_history) call in predictions. If you want to run this locally, you should print the return value from this function.
def plot_cost_history(alpha, cost_history): cost_df = pandas.DataFrame({ 'Cost_History': cost_history, 'Iteration': range(len(cost_history)) }) return ggplot(cost_df, aes('Iteration', 'Cost_History')) + \ geom_point() + ggtitle('Cost History for alpha = %.3f' % alpha)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_cost_history(alpha, cost_history):\n \n cost_df = pandas.DataFrame({\n 'Cost_History': cost_history,\n 'Iteration': range(len(cost_history))\n })\n \n return ggplot(cost_df, aes('Iteration', 'Cost_History')) + geom_point() + ggtitle('Cost History for alpha = %.3f' % alpha )", "def ...
[ "0.82092583", "0.7146632", "0.67263234", "0.6687673", "0.6656095", "0.65841687", "0.6539791", "0.6471535", "0.641766", "0.64174503", "0.63881224", "0.63871366", "0.6370425", "0.63621837", "0.6361889", "0.6355649", "0.6335366", "0.63346124", "0.63287526", "0.6301179", "0.62999...
0.81631243
1
Convenience method to format the response to a query. This method should be used when there are no results to display to the user, or there was an error in the provider's request. The result will be easily jsonified to present well to consumers of the API.
def _get_response_message(code=200, reason=None): return {'reason': reason}, code
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _format_query_response(self):\n output = self._initialize_response_output(self.parameters)\n output[\"data\"] = self.query_data\n\n self.query_sum = self._pack_data_object(self.query_sum, **self._mapper.PACK_DEFINITIONS)\n output[\"total\"] = self.query_sum\n\n if self._delta...
[ "0.7696764", "0.71337837", "0.6596114", "0.65798753", "0.6403955", "0.6285973", "0.62694883", "0.6241158", "0.61474717", "0.61452466", "0.614459", "0.61155504", "0.6056754", "0.6019228", "0.6004197", "0.59621936", "0.59357256", "0.5931271", "0.58848655", "0.5847404", "0.58457...
0.0
-1
Return the imported config
def get_config(): return CONFIG
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config():\n return _config", "def config():\n return _config", "def _get_config(self):\n return self.__config", "def _get_config(self):\n return self.__config", "def _get_config(self):\n return self.__config", "def _get_config(self):\n return self.__config", "def _get_config(s...
[ "0.7580502", "0.7532946", "0.7278191", "0.7278191", "0.7278191", "0.7278191", "0.7278191", "0.7278191", "0.7278191", "0.7278191", "0.7278191", "0.7278191", "0.7278191", "0.7278191", "0.7278191", "0.7278191", "0.7278191", "0.7278191", "0.7278191", "0.7278191", "0.7278191", "...
0.7563194
1
Return a combined license expression string with relation, given a list of license expressions strings.
def combine_expressions(expressions, relation='AND', licensing=Licensing()): if not expressions: return if not isinstance(expressions, (list, tuple)): raise TypeError( 'expressions should be a list or tuple and not: {}'.format( type(expressions))) # Remove dupli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_expression(ex_names, stat_types):\n expression = ''\n if not isinstance(ex_names, list):\n ex_names = list(ex_names)\n\n if not isinstance(stat_types, list):\n stat_types = list(stat_types)\n\n expression = expression_maker(ex_names, stat_types.pop(0))\n for stat_type in sta...
[ "0.583086", "0.5724198", "0.56498003", "0.5439089", "0.5347415", "0.5217123", "0.5136189", "0.51250637", "0.5099614", "0.5091305", "0.5080748", "0.50646085", "0.506381", "0.5059159", "0.5048393", "0.5029987", "0.5020536", "0.5003081", "0.50011045", "0.49933028", "0.49893358",...
0.68731374
0
Derive the peak value from the parameters used for simulations.
def _peakFromTruth(theta, size=21): amplitude, center_x, center_y, radius, focus, width_x, width_y = theta x = np.arange(0, size) y = np.arange(0, size) x, y = np.meshgrid(x, y) airy = models.AiryDisk2D(amplitude, center_x, center_y, radius) adata = airy.eval(x, y, amplitude, center_x, center_y,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def peak(self):\n pass", "def peak_PSF(self):\n return self.compute_PSF(np.zeros(self.N_zern))", "def peak(self):\n return self.peak", "def get_peak(self):\r\n \r\n sensor_1_list = []\r\n\r\n for i in self.return_data:\r\n sensor_1_list.append(i[0])\r\n\r\...
[ "0.73705906", "0.7204004", "0.70959073", "0.7057545", "0.6955476", "0.6951814", "0.6908842", "0.6814341", "0.6747759", "0.6517588", "0.64904785", "0.6466835", "0.6358846", "0.63413495", "0.6339315", "0.6331203", "0.6283399", "0.6262438", "0.6177044", "0.6171221", "0.61708885"...
0.0
-1
Keep reads with no variants
def pure_ref(): return lambda mate: len(mate['read_info'].v_list) == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def condolidateReads(options):\n input_filename=options.adapter_trimmed_filename\n output_filename=options.consolidated_filename\n fhw=open(output_filename,\"w\")\n #original_data=readFastqFile(input_filename)\n fhr=open(input_filename,\"r\")\n data={}\n while True:\n line=fhr.readline(...
[ "0.5804314", "0.5610678", "0.5424506", "0.54089755", "0.5396922", "0.5322959", "0.53035295", "0.5247584", "0.5238957", "0.52234495", "0.5204487", "0.51908255", "0.5173583", "0.50885886", "0.5050111", "0.5039139", "0.503018", "0.50232613", "0.50195646", "0.50164014", "0.499818...
0.4746836
49
Loads a .txt file into Pandas's dataframe. Please make sure the .txt is uniform along all rows and columns.
def load_txt(txt_path): try: # Tries to read .txt file into a dataframe txt = pd.read_csv(txt_path, sep=' ', header=None) except FileNotFoundError as e: # If file is not found, handle the exception and exit logger.error(e) raise return txt
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data(txt_path: str = RAW_TXT) -> pd.DataFrame:\n df = pd.read_csv(txt_path)[INDICES]\n return df", "def txt_to_dataframe(folder,name_parcellation):\n column_weight = ['patients','degree', 'density', 'global_efficiency', 'transitivity', 'assortavity', 'clustering_coef',\n 'fi...
[ "0.80884737", "0.74626905", "0.7333251", "0.7233057", "0.72307336", "0.6942694", "0.6915675", "0.68745273", "0.686563", "0.67538553", "0.66462076", "0.645924", "0.64366686", "0.6429676", "0.6415217", "0.64106375", "0.640425", "0.6397842", "0.6327127", "0.632098", "0.6284513",...
0.7408585
2
Loads a .json file into Pandas's dataframe. Please make sure the .json is uniform along all keys and items.
def load_json(json_path): try: # Tries to read .txt file into a dataframe json = pd.read_json(json_path, orient='split') except FileNotFoundError as e: # If file is not found, handle the exception and exit logger.error(e) raise # Expand features nested column f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_file(filename):\n with open(filename, 'rt') as f:\n d = json.load(f)\n return pd.DataFrame.from_records(d['dataset'])", "def load_data(filepath):\n \n return pd.read_json(filepath)", "def load_data(self, filepath: str) -> pd.DataFrame:\n \n with open(filepath) as f:\n ...
[ "0.7727846", "0.7425084", "0.72301656", "0.7055847", "0.69536614", "0.68815184", "0.68465614", "0.679947", "0.6757153", "0.6733104", "0.67285824", "0.6710691", "0.6669755", "0.66600114", "0.6611666", "0.6558607", "0.6531853", "0.6444463", "0.6392828", "0.6365105", "0.6353035"...
0.76684356
1
Adjust all revolutions in Flux object to have specified rotation speed.
def normalise_rpm(flux, rpm): index_list, freq = flux.index_list, flux.sample_freq norm_to_index = 60/rpm * flux.sample_freq norm_flux = [] to_index, index_list = index_list[0], index_list[1:] factor = norm_to_index / to_index for x in flux.list: to_index -= x if to_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def revolve(self, angle_step):\n self.angle += radians(self.speed)\n self.x = self.cx + self.length * sin(self.angle)\n self.y = self.cy + self.length * cos(self.angle)", "def rotate_orbit(self):\n try:\n ang = self.orbit_speed * self.time_scale / self.refresh_rate\n ...
[ "0.6402125", "0.6268562", "0.6068095", "0.602781", "0.6002048", "0.58555764", "0.57390773", "0.5706598", "0.5692153", "0.567325", "0.56443226", "0.56248486", "0.55810165", "0.55516756", "0.55319804", "0.5500289", "0.54468256", "0.539361", "0.5376211", "0.5362839", "0.53432715...
0.0
-1
Initialize a text item
def __init__(self, info: str = None, text=None, extra_info=None, split_threshold_min=20): self.info = info self.extra_info = extra_info self.texts = [] if text is not None: if isinstance(text, str): self.texts = [text] elif isinstance(text, list): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, text):\n\n self.text = text", "def __init__(self, text):\n self.text = text", "def __init__(self, text):\n self.text = text", "def __init__(self,name,value,*args,**kargs):\n self._is_string_ = type(value) == str\n self._plain = kargs.get('plain',False)\n ...
[ "0.7168958", "0.7141958", "0.7141958", "0.69739395", "0.6805816", "0.6775574", "0.67137027", "0.6693358", "0.65936625", "0.65503085", "0.6524511", "0.64976376", "0.649198", "0.64872354", "0.6483659", "0.6423081", "0.64051884", "0.6399705", "0.63604575", "0.63438284", "0.62988...
0.0
-1
Split texts into sentences and deduplicate text entries
def calculate_texts(self) -> None: texts = [] for text in self.texts: paragraphs = list(filter(lambda x: x != "", text.split("\n\n"))) for paragraph in paragraphs: text = paragraph.replace("\n", " ").strip() if len(text) > self.split_threshold_min:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_text(text):\n text = text.strip()\n textList = text.split('\\n')\n newText = ''\n addNewline = True\n for line in textList:\n # Remove duplicate white space\n temp = ' '.join(line.split())\n # Trim any beginning non-alphabet letters\n temp = trim(temp)\n # Remove...
[ "0.6862727", "0.67230487", "0.6517616", "0.6453442", "0.6381562", "0.63738745", "0.6359695", "0.63533616", "0.6288032", "0.62815905", "0.6275038", "0.6195276", "0.61929846", "0.61868834", "0.6133379", "0.61290365", "0.610501", "0.6096357", "0.60952234", "0.60844326", "0.60748...
0.7168906
0
Returns the number of pieces a player of a given color has on the board
def currentScore(self, playerColor): total = 0 for col in range(0, 8): for row in range(0, 8): if self.board[col][row].color == playerColor: total+=1 return total
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_colors(board, color):\n n = 0\n for cell in board:\n if cell == color:\n n += 1\n elif cell == cinv(color):\n n -= 1\n return n", "def count_legal_moves(board, color):\n return len(legal_moves(board, color))", "def count(self,color):\n count = 0\...
[ "0.7588033", "0.7226969", "0.71743196", "0.71097654", "0.7022085", "0.70170206", "0.6936672", "0.6850037", "0.66868883", "0.6659917", "0.6602867", "0.6599407", "0.6571274", "0.656158", "0.6512641", "0.64759034", "0.64349335", "0.6415896", "0.6341236", "0.63127106", "0.6288265...
0.7462682
1
Generate a random string of fixed length
def randomString(stringLength=10): letters = string.ascii_lowercase return ''.join(random.choice(letters) for i in range(stringLength))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_random_string(length: int):\n\tall_chars = string.ascii_letters + string.digits\n\treturn ''.join(random.choices(all_chars, k=length))", "def generate_random_string(length=6):\n n = int(length / 2 + 1)\n x = binascii.hexlify(os.urandom(n))\n s = x[:length]\n return s.decode(\"utf-8\")",...
[ "0.8680464", "0.8573714", "0.85486245", "0.85297275", "0.85209286", "0.84331024", "0.8432044", "0.84157014", "0.84120053", "0.8389201", "0.8345882", "0.8343962", "0.83406156", "0.83348686", "0.83240855", "0.82986933", "0.82911193", "0.8281826", "0.82818025", "0.82811046", "0....
0.7761017
99
Return unique list preserving the order.
def unique_list(duplicates_list): used = set() unique = [x for x in duplicates_list if x not in used and (used.add(x) or True)] return unique
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unique(self) -> 'List':\n return List(sorted(set(self), key=self.index))", "def _unique(li):\n return list(set(li))", "def unique(li):\r\n seen = set()\r\n seen_add = seen.add\r\n return [x for x in li if not (x in seen or seen_add(x))]", "def uniq(ordered_list):\n assert isinstance...
[ "0.8217827", "0.8017372", "0.7935932", "0.7774803", "0.7745046", "0.7738937", "0.77193004", "0.7679603", "0.7666299", "0.7608188", "0.75818276", "0.75319713", "0.74804705", "0.7457509", "0.745552", "0.74389654", "0.74300575", "0.73866165", "0.73742527", "0.73602706", "0.73467...
0.67477244
52
Fixture that deletes the files used by the test methods.
def tearDown(self): try: os.remove(self.targets_filename) os.remove(self.headers_filename) except: raise
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tearDown(self):\n try:\n os.remove(self.fixtureFile)\n except OSError:\n pass", "def teardown():\n for filename in files_to_delete:\n delete_file(filename)", "def tearDown(self):\n try:\n os.remove(self.fixture_file)\n except OS...
[ "0.7972733", "0.79667974", "0.79614806", "0.780152", "0.7784251", "0.7656321", "0.7642764", "0.7576854", "0.75580907", "0.74878705", "0.74443907", "0.7436153", "0.7409162", "0.74073124", "0.7361602", "0.7357896", "0.7357896", "0.7357896", "0.73285383", "0.7311414", "0.7307437...
0.7145457
29
Test that a rule without a protocol cannot be created.
def test_build_rule_book_no_protocol_fails(self): rules_local_path = get_datafile_path(__file__, 'fwd_test_rules_2.yaml') rules_engine = fre.ForwardingRuleRulesEngine(rules_file_path=rules_local_path) with self.assertRaises(InvalidRulesSchemaError): rules_engine.build_rule_b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_rule(self):\n pass", "def test_invalid_link(self):\r\n\r\n # Setup the peer grading module with no linked locations.\r\n peer_grading = self._create_peer_grading_with_linked_problem(self.coe_location, valid_linked_descriptor=False)\r\n\r\n self.assertFalse(peer_grading...
[ "0.6402966", "0.63442403", "0.6216991", "0.6168581", "0.6116525", "0.60159713", "0.5986509", "0.58667994", "0.58486634", "0.58350194", "0.5813467", "0.5811882", "0.5800785", "0.5781192", "0.57572377", "0.5755444", "0.575402", "0.57529277", "0.5750596", "0.5734918", "0.5727157...
0.76426715
0
convert dict to be env friendly uppercase keys and stringify values
def to_env(self, d): return {k.upper(): str(v) for k, v in d.items()}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _convert_profile_to_docker_envs(profile):\n profile = profile._asdict()\n return dict([(key.upper(), value) for key, value in six.iteritems(profile)])", "def environ_to_dict(environ):\n return dict((k, v) for k, v in environ.iteritems()\n if k.isupper())", "def _format_dict(...
[ "0.6461387", "0.6427642", "0.63068426", "0.6264529", "0.61870027", "0.6125286", "0.60866845", "0.5917205", "0.59068584", "0.5900152", "0.58833474", "0.5868494", "0.5863793", "0.57785285", "0.57531714", "0.5691805", "0.5640125", "0.5613474", "0.55953133", "0.5588551", "0.55788...
0.7881677
0
Home page returns correct html
def test_home_page_returns_correct_html(self): request = HttpRequest() response = home_view(request) html = response.content.decode('utf8') self.assertTrue(html.startswith('<!doctype html>')) self.assertIn('<title>home</title>', html) self.assertTrue(html.endswith('</htm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home_page() -> str:\r\n return render_template(\"home.html\")", "def home():\n return render_template('homepage.html')", "def render_home():\r\n\treturn render_template(\"index.html\")", "def Home():\n resp = render_template('index.html')\n return resp", "def home():\n\n\treturn render_temp...
[ "0.8135755", "0.80658823", "0.80061275", "0.7986253", "0.7952734", "0.79241294", "0.79241294", "0.7920812", "0.7916798", "0.7916798", "0.7916798", "0.7916798", "0.7916798", "0.7916798", "0.7916798", "0.7916798", "0.7916798", "0.7916798", "0.7916798", "0.7916798", "0.7916798",...
0.0
-1
Apply a masked softmax on the last dimension of a tensor. The input tensor and mask should be of size (batch, , sequence_length).
def masked_softmax(tensor, mask): tensor_shape = tensor.size() reshaped_tensor = tensor.view(-1, tensor_shape[-1]) # Reshape the mask so it matches the size of the input tensor. while mask.dim() < tensor.dim(): mask = mask.unsqueeze(1) mask = mask.expand_as(tensor).contiguous().float() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_dim_softmax(tensor, mask=None) -> torch.Tensor:\n tensor_shape = tensor.size()\n reshaped_tensor = tensor.view(-1, tensor.size()[-1])\n if mask is not None:\n while mask.dim() < tensor.dim():\n mask = mask.unsqueeze(1)\n mask = mask.expand_as(tensor).contiguous().float()\...
[ "0.80482036", "0.77158296", "0.75313956", "0.7529668", "0.74119353", "0.7222063", "0.7222063", "0.6813553", "0.6779504", "0.6772178", "0.6758053", "0.6697113", "0.6551719", "0.6526691", "0.65045434", "0.64362407", "0.64229125", "0.63955635", "0.6382234", "0.6375659", "0.63707...
0.770708
2
Sort a batch of padded variable length sequences by their length.
def sort_by_seq_lens(batch, sequences_lengths, descending=True): sorted_seq_lens, sorting_index = \ sequences_lengths.sort(0, descending=descending) sorted_batch = batch.index_select(0, sorting_index) idx_range = \ sequences_lengths.new_tensor(torch.arange(0, len(sequences_lengths))) _...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_by_length(self):\n target_lengths = list()\n\n for idx, label_path in enumerate(self.label_paths):\n key = label_path.split('/')[-1].split('.')[0]\n target_lengths.append(len(self.target_dict[key].split()))\n\n bundle = list(zip(target_lengths, self.audio_paths, ...
[ "0.6757189", "0.6677251", "0.66720724", "0.6455222", "0.64158136", "0.6298751", "0.6292799", "0.6239917", "0.61323196", "0.6130738", "0.6043296", "0.6037882", "0.5974773", "0.59539807", "0.5938824", "0.588786", "0.58809465", "0.5863642", "0.58220685", "0.5816878", "0.5807346"...
0.6647022
3
This problem is essentially a "subset sum to K" problem. But here the target is K/2 (where K = sum of elements of nums). If there's a subset of `nums` that sums to sum(nums) / 2, then it means that the other half of `nums` also sums to sum(nums) / 2, unless sum(nums) is odd, in which case we can just return False.
def canPartition(self, nums): cache = {} def helper(nums, i, k): if (i, k) in cache: return False if i >= len(nums): return False if k == 0: return True include_curr = helper(nums, i + 1, k - nums[i]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solution2(nums, K):\n s = 0\n sum_til = []\n for n in nums:\n s += n\n sum_til.append(s)\n\n l = len(nums)\n for i in range(l):\n for j in range(i+1, l):\n sum_ij = sum_til[j] if i == 0 else sum_til[j] - sum_til[i-1]\n if K != 0 and sum_ij % K == 0:\n ...
[ "0.7795549", "0.7751522", "0.7488796", "0.7044727", "0.6980749", "0.66539645", "0.66049", "0.6561346", "0.6483403", "0.6458782", "0.64157957", "0.6396361", "0.6348387", "0.63038343", "0.62906677", "0.6281017", "0.62550944", "0.62225825", "0.6181623", "0.60616606", "0.60247195...
0.74940455
2
This problem is essentially a "subset sum to K" problem. But here the target is K/2 (where K = sum of elements of nums). If there's a subset of `nums` that sums to sum(nums) / 2, then it means that the other half of `nums` also sums to sum(nums) / 2, unless sum(nums) is odd, in which case we can just return False.
def canPartitionIter(self, nums): s = sum(nums) if s % 2 != 0: return False dp = [[None for _ in xrange(len(nums) + 1)] for _ in xrange((s/2) + 1)] for i in xrange(len(nums) + 1): dp[0][i] = True for i in range(1, (s/2) + 1): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solution2(nums, K):\n s = 0\n sum_til = []\n for n in nums:\n s += n\n sum_til.append(s)\n\n l = len(nums)\n for i in range(l):\n for j in range(i+1, l):\n sum_ij = sum_til[j] if i == 0 else sum_til[j] - sum_til[i-1]\n if K != 0 and sum_ij % K == 0:\n ...
[ "0.77956086", "0.7751728", "0.7494562", "0.7488688", "0.7045626", "0.66541165", "0.6604416", "0.65594405", "0.6482972", "0.6458817", "0.641518", "0.6396778", "0.6348307", "0.63033223", "0.6291387", "0.6280972", "0.6255043", "0.6221636", "0.6180663", "0.6061882", "0.60242826",...
0.69814897
5
Create a new Werkzeug application
def create_application(self, environment, *, router=None): if router is None: router = self.create_router(environment) return wrappers.Request.application(router)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app():\n return create_app()", "def app():\n app = create_app()\n return app", "def create_app():\n from server.web import create_app\n # If we do a static javascript app via flask, add it here\n # from server.web import create_app as create_web_app\n return create_app()", "def creat...
[ "0.8228777", "0.809832", "0.8024994", "0.79872996", "0.78103936", "0.77651185", "0.76621825", "0.7637943", "0.76196826", "0.7592336", "0.7565575", "0.75589746", "0.7515365", "0.75118387", "0.75068593", "0.74806076", "0.746273", "0.74575394", "0.7426649", "0.7415916", "0.74100...
0.0
-1
Calculate the mean diference between the true angles and the predicted angles. Each angle is represented as a binary vector.
def angle_error(self, y_true, y_pred): diff = self.angle_difference(K.argmax(y_true), K.argmax(y_pred)) return K.mean(K.cast(K.abs(diff), K.floatx()))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def angle_error_regression(y_true, y_pred):\n return K.mean(angle_difference(y_true * 360, y_pred * 360))", "def maape(actual: np.ndarray, predicted: np.ndarray):\n return np.mean(np.arctan(np.abs((actual - predicted) / (actual + EPSILON))))", "def calc_accuracy(true, predicted):\n return sum([t==p fo...
[ "0.7076504", "0.66557515", "0.6496974", "0.6481175", "0.6388807", "0.62886566", "0.624669", "0.62359565", "0.62252426", "0.62133193", "0.62133193", "0.62053484", "0.6176338", "0.6169975", "0.61569226", "0.6156902", "0.60542506", "0.6037795", "0.6037395", "0.60216033", "0.6018...
0.72584254
0
set end time of NoteInfo
def set_end_time(self, in_data): self._log.debug('') out_data = copy.deepcopy(in_data) note_start = {} ent = None for i, ent in enumerate(out_data): key = (ent.channel, ent.note) if ent.velocity > 0: if key in note_start.keys(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def end_time(self, end_time):\n self._end_time = end_time", "def end_time(self, end_time):\n self._end_time = end_time", "def end_time(self, end_time):\n\n self._end_time = end_time", "def end_time(self, end_time):\n\n self._end_time = end_time", "def end_time(self, end_time):\n...
[ "0.6882689", "0.6882689", "0.6719851", "0.6719851", "0.6719851", "0.6647338", "0.6614098", "0.6445402", "0.6356684", "0.63288105", "0.630808", "0.62738305", "0.6230936", "0.62021714", "0.61318934", "0.60946333", "0.60784894", "0.6068231", "0.60678494", "0.606245", "0.60293216...
0.6922138
0
Initialize the model by setting up the layers.
def __init__(self, vocab_size, output_size, embedding_dim, hidden_dim, n_layers, drop_prob=0.5): super(SentimentRNN, self).__init__() self.output_size = output_size self.n_layers = n_layers self.hidden_dim = hidden_dim # embedding and LSTM layers self.embedding ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_layers(self):\n self._init_predictor()\n if self.use_edge_fusion:\n self._init_edge_module()", "def initialisation(self):\n self.create_variables()\n self.create_placeholders()\n self.build_model()\n self.reset_lr(None, True)\n self.build_loss...
[ "0.7877656", "0.740135", "0.73939556", "0.73799825", "0.72304994", "0.72242755", "0.7183698", "0.7181406", "0.7175707", "0.71491647", "0.70773673", "0.70694804", "0.7036073", "0.70194495", "0.7018242", "0.69936645", "0.6969751", "0.6949472", "0.69274527", "0.6899944", "0.6853...
0.0
-1
This function returns the handle for the camera specified by cameraIndex. When multiple Andor cameras are installed the handle of each camera must be retrieved in order to select a camera using the SetCurrentCamera function. The number of cameras can be obtained using the GetAvailableCameras function.
def camera_handle(self, index): index = ct.c_long(index) handle = ct.c_long() self.lib.GetCameraHandle(index, ct.pointer(handle)) return handle.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_camera(self):\n n = ct.c_long() # current camera handler\n self.lib.GetCurrentCamera(ct.pointer(n))\n return n.value", "def checkCamera(self):\n cameraFound = False\n print(\"[INFO]: Searching for camera...\")\n try:\n for camera in glob.glob(\...
[ "0.6500648", "0.6278193", "0.60549456", "0.5795268", "0.57166904", "0.5661866", "0.56434965", "0.56434965", "0.5561779", "0.5561779", "0.54939383", "0.547935", "0.54685587", "0.5465109", "0.54613286", "0.5433928", "0.5402874", "0.53352165", "0.5331171", "0.5323034", "0.531910...
0.808689
0
This function will return the time to readout data from a sensor. This function should be used after all the acquisitions settings have been set, e.g. SetExposureTime, SetKineticCycleTime and SetReadMode etc. The value returned is the actual times used in subsequent acquisitions.
def readout_time(self): time = ct.c_float() self.lib.GetReadOutTime(ct.pointer(time)) return time.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def acquisition_time(self):\n # Get time channels indices\n #time_channel_idx = [idx\n # for idx, channel in enumerate(self.channels)\n # if channel.lower() == 'time']\n #if len(time_channel_idx) > 1:\n # raise KeyError(\"more than ...
[ "0.6686415", "0.6590419", "0.6485746", "0.6402394", "0.6350816", "0.63448286", "0.6337123", "0.6334844", "0.63056594", "0.62671775", "0.6248572", "0.62475455", "0.61423296", "0.61310995", "0.6123879", "0.61131465", "0.6108938", "0.60705537", "0.6066229", "0.6056668", "0.60559...
0.79229176
0
This function will return the maximum number of exposures that can be configured in the SetRingExposureTimes SDK function.
def n_max_nexposure(self): n = ct.c_int() self.lib.GetMaximumNumberRingExposureTimes(ct.pointer(n)) return n.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def n_exposures_in_ring(self):\n n = ct.c_int()\n self.lib.GetNumberRingExposureTimes(ct.pointer(n))\n return n.value", "def get_max_readings( self ):\n return 2500", "def max_exposure(self):\n exp = ct.c_float()\n self.lib.GetMaximumExposure(ct.pointer(exp))\n ...
[ "0.7902769", "0.61135423", "0.6060099", "0.5974769", "0.5971295", "0.596158", "0.59565973", "0.59284383", "0.58181095", "0.57594264", "0.56521124", "0.5637434", "0.56355864", "0.56113327", "0.554628", "0.5500019", "0.54922545", "0.54710877", "0.54510474", "0.5435613", "0.5424...
0.77088594
1
This function will normally return the number of vertical clock voltage amplitudes that the camera has.
def n_vert_clock_amps(self): n = ct.c_int() self.lib.GetNumberVSAmplitudes(ct.pointer(n)) return n.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def numberOfCamera():\n return numCams", "def get_voltage(self):\n print(\"voici le voltage de la batterie\")", "def voltage(self):\n\t\treturn self._voltage", "def ac_voltage(self):\n return float(self.get_ac_voltage())", "def v(self):\n\n # TODO This translation formula works, but n...
[ "0.64180636", "0.6408465", "0.6215137", "0.62086", "0.61957896", "0.6169884", "0.6159293", "0.6155733", "0.61519086", "0.614214", "0.6072109", "0.6047112", "0.60457784", "0.59713274", "0.595569", "0.5951384", "0.5942707", "0.59188074", "0.5900302", "0.58950037", "0.58596617",...
0.728807
0
This Function is used to get the Vertical Clock Amplitude string that corresponds to the index passed in.
def vert_amp_string(self, index): index = ct.c_int(index) string = (ct.c_char * 6)() self.lib.GetVSAmplitudeString(index, ct.pointer(string)) return str(string.value)[2:-1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vert_amp_index(self, string):\n index = ct.c_int()\n string = ct.c_char_p(str.encode(string))\n self.lib.GetVSAmplitudeFromString(string, ct.pointer(index))\n return index.value", "def set_vert_clock(self, index):\n self.lib.SetVSAmplitude(ct.c_int(index))", "def true_ver...
[ "0.667525", "0.6142152", "0.59183747", "0.56050533", "0.5458286", "0.52486575", "0.51882327", "0.5134089", "0.5115122", "0.51029724", "0.5072049", "0.5044635", "0.50364244", "0.5018709", "0.5009876", "0.4974451", "0.49643877", "0.49538186", "0.4940181", "0.49371266", "0.49313...
0.78057325
0
This Function is used to get the value of the Vertical Clock Amplitude found at the index passed in.
def true_vert_amp(self, index): index = ct.c_int(index) amp = ct.c_int() self.lib.GetVSAmplitudeValue(index, ct.pointer(amp)) return amp.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_vert_clock(self, index):\n self.lib.SetVSAmplitude(ct.c_int(index))", "def vert_amp_string(self, index):\n index = ct.c_int(index)\n string = (ct.c_char * 6)()\n self.lib.GetVSAmplitudeString(index, ct.pointer(string))\n return str(string.value)[2:-1]", "def vert_amp_...
[ "0.6434408", "0.628885", "0.62194365", "0.6130094", "0.5982744", "0.5772933", "0.5718178", "0.56725204", "0.566071", "0.5630627", "0.5617247", "0.5598211", "0.55662227", "0.5540061", "0.55115527", "0.5511238", "0.55040747", "0.5503363", "0.5495526", "0.5483752", "0.5483638", ...
0.64125806
1
Override this to be notified when tracked models have been cleared.
def on_tracked_models_cleared(self, model_class=None): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ClearModels(self):\n self._modelFileNames = []\n self._models = []\n self.Modified(readAgain=True)", "def post_model_save(sender, instance, **kwargs):\n cache.clear()", "def _finalize(self):\n for model in self.models:\n model._finalize()", "def clean(self):\n ...
[ "0.66036975", "0.64446604", "0.6407049", "0.6291935", "0.6290199", "0.62576956", "0.6230756", "0.6224049", "0.6120043", "0.6120043", "0.6120043", "0.6101525", "0.60867", "0.60633624", "0.6057345", "0.60532105", "0.6043381", "0.60006464", "0.596264", "0.5931681", "0.5906582", ...
0.8302861
0
Return tracked models that have not been deleted
def get_live_tracked_models(self, model_class): return self.update_models[model_class] + self.create_models[model_class]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self):\n return self._get_base_queryset().filter(deleted__isnull=True)", "def pending_models(self):\n return self._pending_models", "def untracked(self):\n\n # Getting all scopes.\n day_scope = get_scope_by_name(Scope.DAY.value)()\n week_scope = get_scope_by_...
[ "0.69613403", "0.62662673", "0.61773", "0.61440486", "0.60370874", "0.6003019", "0.5972166", "0.5939213", "0.5927257", "0.58819985", "0.5872996", "0.5820399", "0.57689536", "0.5703486", "0.569044", "0.5660341", "0.56559485", "0.56317765", "0.56216335", "0.5594025", "0.5557161...
0.612333
4
Save the entity dict into a JSON file
async def get_entities(self, file="entities.json"): g = Get(self.token) u = Utilities() api_link_dict = await u.get_api_root_response() entity_dict = {"creation_time": datetime.now(), "data": {}} for index, key in enumerate(api_link_dict): await g.get(key) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self):\n d1 = {}\n with open(self.__file_path, mode=\"w\") as f:\n for k, v in self.__objects.items():\n d1[k] = v.to_dict()\n json.dump(d1, f)", "def save(self, filename):\n content = self.to_dict()\n with open(filename, 'w') as f:\n ...
[ "0.7480966", "0.7442471", "0.73864496", "0.73293823", "0.7266484", "0.72525233", "0.7185934", "0.7142699", "0.6998777", "0.69758695", "0.69407624", "0.69237214", "0.6903089", "0.6903089", "0.6903089", "0.6899742", "0.68898964", "0.6887376", "0.68870616", "0.6864812", "0.68277...
0.0
-1
adds a donation to the donors dict from user input
def create_donation(fullname, amount): donors[fullname].append(amount)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_donation(self):\n name = self.get_donor()\n # Update existing\n if name in self.all_donors:\n input_donation = int(input(\"Please enter a donation: \"))\n donations = int(self.r.hget(name, 'donations'))\n donations += input_donation\n\n self....
[ "0.8370153", "0.79305255", "0.7169134", "0.71627545", "0.70349103", "0.6893343", "0.6892637", "0.674355", "0.67357033", "0.6662839", "0.66144943", "0.6576645", "0.6570795", "0.65602916", "0.6512362", "0.6474099", "0.64517903", "0.6421057", "0.6410186", "0.64092386", "0.638379...
0.74491584
2
adds new donor to donors
def create_donor(fullname): donors[fullname] = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_donor(self, new_donor: Donor):\n self.donor_list.append(new_donor)", "def add_donor_object(self, donor_object):\n self.donors.append(donor_object)", "def add_donation(self):\n name = self.get_donor()\n # Update existing\n if name in self.all_donors:\n input...
[ "0.80855936", "0.7774212", "0.76431465", "0.7547128", "0.754201", "0.73054296", "0.7118392", "0.70664406", "0.70056796", "0.69462854", "0.6927369", "0.6916047", "0.6909889", "0.6872564", "0.675139", "0.66733545", "0.6480681", "0.6468868", "0.64549243", "0.64377767", "0.635742...
0.6907943
13
consistent with R print correct_pvalues_for_multiple_testing([0.0, 0.01, 0.029, 0.03, 0.031, 0.05, 0.069, 0.07, 0.071, 0.09, 0.1])
def correct_pvalues_for_multiple_testing(pvalues, correction_type="Benjamini-Hochberg"): from numpy import array, empty pvalues = array(pvalues) n = float(pvalues.shape[0]) new_pvalues = empty(n) if correction_type == "Bonferroni": new_pvalues = n * pvalues elif correction_type ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_correct_p_values(self):\r\n exp = [0.003, 0.006, 0.003]\r\n obs = self.mc._correct_p_values([0.001, 0.002, 0.001])\r\n assert_almost_equal(obs, exp)", "def test_correct_p_values_no_change(self):\r\n exp = [None, 0.008]\r\n obs = self.mc._correct_p_values([None, 0.008])...
[ "0.7838316", "0.7438661", "0.7208538", "0.7198048", "0.7181474", "0.71743035", "0.6688434", "0.66763717", "0.66294914", "0.65219915", "0.6507874", "0.6375219", "0.63149655", "0.62341577", "0.6168724", "0.6150763", "0.61211157", "0.6110187", "0.6094534", "0.6084296", "0.607924...
0.70660514
6
Picks the first string non null in the list. l list of string string
def pickname(*args): for s in args: s = s.strip() if s: return s raise ValueError( # pragma: no cover f"Unable to find a non empty string in {args}")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first(l):\n return next(iter(l), None)", "def getfirst(s):\n return s[0] if isinstance(s, list) else s", "def first(xs):\n if not xs:\n return None\n return xs[0]", "def first(xs):\n if not xs:\n return None\n return xs[0]", "def return_first(x):\r\n if x == []:\r\n ...
[ "0.6969632", "0.68148303", "0.6691313", "0.6691313", "0.65169305", "0.6423876", "0.64079344", "0.6402005", "0.6245957", "0.6241844", "0.6117296", "0.60944825", "0.6090686", "0.6052452", "0.6048538", "0.6036358", "0.6003192", "0.59832716", "0.5868441", "0.583856", "0.577606", ...
0.55061954
34
Filter the entries based on ``request.user``. This only affects the entries shown in the list view.
def queryset(self, request): if request.user.is_superuser: return Entry.objects.all() return Entry.objects.filter(author=request.user)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self, request):\n qs = super().get_queryset(request)\n return qs.filter(user=request.user)", "def get_queryset(self):\n return super().get_queryset().filter(user=self.request.user)", "def get_queryset(self, *args, **kwargs):\n qs = super().get_queryset(*args, **kwar...
[ "0.78194666", "0.7687475", "0.75375676", "0.7247509", "0.715021", "0.71311677", "0.6998751", "0.6991725", "0.69592154", "0.69558674", "0.69558674", "0.6933253", "0.68695796", "0.6836037", "0.6811135", "0.674889", "0.66968", "0.66668767", "0.66402394", "0.6627597", "0.66261387...
0.7648579
2
Automatically fill in the author field on creation.
def save_model(self, request, obj, form, change): if not change: obj.author = request.user super(EntryAdmin, self).save_model(request, obj, form, change)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def author(self, value):\n self._set_attr('author', value)", "def author(self, author):\n self._author = author", "def set_author (self, author):\n self.author = author", "def set_author(self, author):\n self.author = author\n self.opf.author = author", "def author(self, ...
[ "0.7402873", "0.73863757", "0.73062617", "0.7230365", "0.7179593", "0.7179593", "0.71558046", "0.7145198", "0.7109424", "0.7107238", "0.70926887", "0.70689315", "0.70689315", "0.70689315", "0.7046267", "0.69157773", "0.68818486", "0.68818486", "0.6822474", "0.68144673", "0.67...
0.66508275
24
Return True if the specified crop coordinates are valid, else False.
def check_crop(dim, x1, y1, x2, y2): return ( x1 >= 0 and y1 >= 0 and x2 >= 0 and y2 >= 0 and x1 <= dim[0] and y1 <= dim[1] and x2 <= dim[0] and y2 <= dim[1] and x2 > x1 and y2 > y1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_coordinates(self, x, y):\n return ((x >= 0) and (x < self.width) and\n (y >= 0) and (y < self.height))", "def verify_coords(self, piece_coords):\n if piece_coords[0] >= self.size or piece_coords[0] < 0:\n return False\n if piece_coords[1] >= self.size or p...
[ "0.7457417", "0.70879287", "0.69217837", "0.68509823", "0.67838264", "0.675454", "0.6704354", "0.6703116", "0.66923654", "0.6685273", "0.6522532", "0.6472011", "0.6419103", "0.6399268", "0.63902944", "0.63262385", "0.63255215", "0.6288332", "0.6260077", "0.625354", "0.6229638...
0.6874978
3
Creates a classification model.
def create_model(bert_config, is_training, input_ids, input_mask, segment_ids, labels, num_labels, use_one_hot_embeddings, is_prediction=False): model = modeling.BertModel( config=bert_config, is_training=is_training, input_ids=input_ids, input_mask=input_mask, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_model(self):\n self.classifier = DecisionTreeClassifier(max_depth=1)", "def create_model(self, C : float =1):\n self.classifier = RandomForestClassifier(max_depth=5)", "def create_model():\n\n # Create a sequential model (a simple NN is created) adding a softmax activation at the en...
[ "0.7451048", "0.716728", "0.70753753", "0.69427526", "0.69337225", "0.69306064", "0.6929345", "0.68631464", "0.68004555", "0.6769279", "0.6737084", "0.66838384", "0.66709864", "0.660953", "0.65912193", "0.6564333", "0.6534873", "0.6526978", "0.6525293", "0.6521778", "0.651739...
0.0
-1
| The color of the mesh
def mesh_color(self): return self._mesh_color
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def color(self):\n return 0x2f3136", "def getColor(self):\r\n return self.color", "def color(self):\n return self['color']", "def color(self):\n return self.__color", "def get_color(self):\r\n return self.__color", "def getColor(self):\n return self.color", "de...
[ "0.7043567", "0.70071423", "0.694701", "0.69461226", "0.6916803", "0.68931985", "0.68889546", "0.6885639", "0.68724173", "0.68658173", "0.6851344", "0.6851344", "0.6769434", "0.6761342", "0.6761342", "0.6761342", "0.6715772", "0.6710528", "0.6710528", "0.6708454", "0.6708454"...
0.8775718
0
Draw landmarks and boxes for each face detected
def _draw(self, frame, boxes, probs, landmarks, name): try: print('drawing') for box, prob, ld, id in zip(boxes, probs, landmarks, name): # Draw rectangle on frame cv2.putText(frame, id, (200, 50), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 2, cv2.LINE_AA)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_face_landmarks(data):\n head = extract_head(data);\n landmarks = data['position_data']['face_landmarks'][data['i']];\n face_box = data['position_data']['face_box'][data['i']];\n if face_box is not None:\n for p in landmarks:\n cv2.circle(head,p,3,(255,0,0));\n else:\n ...
[ "0.80245346", "0.7477082", "0.7411941", "0.7286931", "0.7205191", "0.719086", "0.69687265", "0.6922465", "0.68053895", "0.6783767", "0.6767366", "0.6567332", "0.65657604", "0.6555319", "0.65287626", "0.6497128", "0.64835244", "0.64385384", "0.64366263", "0.6425032", "0.641915...
0.674284
11
Read all hashes that have been used since the last call to purge (or reset_hashes).
def read_used(): used_hashes = {"evs": set([]), "cache": set([]), "seeds": set([])} with open(LOG_FILEPATH, 'rb') as logfile: for line in logfile.readlines(): kind, hash = tuple(line.split('...')) used_hashes[kind].add(hash.rstrip()) re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def populate_hash_list(self):\n checkout = 'tmp/repo/tmp/keylime-checkout'\n\n import_ostree_commit(\n os.getcwd(),\n self._metadata.build_dir,\n self._metadata)\n subprocess.check_call([\n 'ostree', 'checkout',\n '--repo=tmp/repo', '-U',\...
[ "0.6130291", "0.61087066", "0.6076313", "0.5903832", "0.58807015", "0.5754902", "0.5699781", "0.5546755", "0.5534785", "0.5488516", "0.5344641", "0.5319649", "0.5309524", "0.53058434", "0.52551395", "0.52533954", "0.5251807", "0.5247394", "0.5244825", "0.5242846", "0.5230798"...
0.6742642
0
Standard sigmoid; since it relies on to do computation, it broadcasts on vectors and matrices
def sigmoid(x): return 1 / (1 - (power(e,-x)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid(X,W,b):\n preActivation = np.dot(X, W) + b\n return (1.0)/(1.0 + np.exp(-preActivation))", "def sigmoid(z):\r\n \r\n return vSigmoid(z);", "def sigmoid(x):\r\n return 1 / (1 + np.exp(-x))", "def sigmoid(x):\r\n\r\n return 1 / (1 + np.exp(-x))", "def _sigmoid(x, b, w):\n ...
[ "0.76855385", "0.7602184", "0.75244224", "0.74355215", "0.7434112", "0.74314064", "0.7430775", "0.7430775", "0.7430775", "0.7430775", "0.7430775", "0.7430775", "0.7421557", "0.74119055", "0.7374227", "0.7368733", "0.7363146", "0.7356516", "0.7353893", "0.7353893", "0.73319376...
0.73360723
20
Delete a photometry request from PS1 DR2 API.
def delete(request, session): session.delete(request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def delete(self, request):\n\n userid = await authenticated_userid(request)\n project = await request.app.context_project(request, userid)\n\n await request.post()\n\n camera_id = request.match_info['camera_file_id']\n\n log = request['slog']\n log.debug('request: ca...
[ "0.59623355", "0.57894564", "0.5768022", "0.5750073", "0.56681186", "0.561366", "0.5587874", "0.55733037", "0.5568012", "0.5568012", "0.5568012", "0.5568012", "0.5568012", "0.5568012", "0.5568012", "0.5568012", "0.5568012", "0.5568012", "0.5568012", "0.5568012", "0.5568012", ...
0.0
-1
Sets the number_of_results of this GetTasksRequest.
def number_of_results(self, number_of_results): if number_of_results is None: raise ValueError("Invalid value for `number_of_results`, must not be `None`") # noqa: E501 self._number_of_results = number_of_results
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def number_of_page_results(self, number_of_page_results):\n if (self.local_vars_configuration.client_side_validation and\n number_of_page_results is not None and number_of_page_results < 0): # noqa: E501\n raise ValueError(\"Invalid value for `number_of_page_results`, must be a va...
[ "0.68612105", "0.66594166", "0.6325807", "0.62158537", "0.6106252", "0.6045949", "0.6045949", "0.604245", "0.59500945", "0.589986", "0.58863825", "0.57753694", "0.5738373", "0.5696044", "0.5665254", "0.5633216", "0.5629213", "0.5542855", "0.5532345", "0.5531737", "0.5528572",...
0.7671211
0
Sets the types of this GetTasksRequest.
def types(self, types): self._types = types
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def types(self, types: List[str]):\n if types is None:\n raise ValueError(\"Invalid value for `types`, must not be `None`\")\n\n self._types = types", "def tasks(self, tasks: List[TaskStatusDefinition]):\n\n self._tasks = tasks", "def task_type(self, task_type):\n\n self....
[ "0.6360011", "0.5970454", "0.5761858", "0.56970704", "0.5532742", "0.5413648", "0.5401507", "0.5397396", "0.5281288", "0.5238552", "0.5210246", "0.51895255", "0.5141056", "0.512426", "0.5087661", "0.5065666", "0.5005809", "0.49552304", "0.49229035", "0.49180356", "0.49080944"...
0.61742914
1
Sets the results of this GetTasksRequest.
def results(self, results): self._results = results
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def results(self, results):\n self._results = results", "def results(self, results):\n self._results = results", "def results_from(self, src):\n if isinstance(src, DTTask):\n self.id = src.id\n self.results = src.results\n self.message = src.message\n ...
[ "0.6591576", "0.6591576", "0.644368", "0.61484593", "0.5947147", "0.587683", "0.5867493", "0.5789863", "0.5788259", "0.57850474", "0.5770067", "0.5749361", "0.5722344", "0.5711871", "0.5677365", "0.5643625", "0.5638384", "0.56150717", "0.55986047", "0.5574283", "0.5524824", ...
0.65791684
5
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, GetTasksRequest): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Goal is to return a dictionary with precipitation data
def precipitation(): #Create a session. session=Session(engine) #Run query to get precipitation data for the past last year of data available year_data = session.query(Measurement.date, Measurement.prcp).filter(Measurement.date>=year_ago).group_by(Measurement.date).order_by(Measurement.date).all() #Clo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precip():\n # Query Measurement data\n session = Session(engine)\n results = session.query(Measurement.date, Measurement.prcp).all()\n\n # Create a dictionary from the row data and append to a list of precipitation data\n precip_data = []\n for date, prcp in results:\n precip_dict = {}...
[ "0.7543681", "0.7528174", "0.750787", "0.74527365", "0.74283564", "0.74063814", "0.73637736", "0.7352269", "0.7328143", "0.7322424", "0.72762746", "0.7272721", "0.7266963", "0.72388226", "0.7184341", "0.71788275", "0.7125281", "0.70950705", "0.70724565", "0.7069405", "0.70342...
0.6385291
33
Return the n point box window (uniform). Returns x as the boxwin windowing array x_windowed The windowed signal is then xx_window
def boxwin(x): print('boxwin is untested') if isinstance(x, (list, tuple, np.ndarray)): n = x.shape[1] f = boxwin(n) if len(x.shape) == 3: f, _, _ = np.meshgrid(f[0, :], np.arange( x.shape[0]), np.arange(x.shape[2])) else: f, _ = np.meshgr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def window(n, /, wintype='boxcar'):\n if wintype == 'welch':\n raise ValueError('Welch window needs 2-tuple of (name, beta).')\n elif wintype == 'kaiser':\n raise ValueError('Kaiser window needs 2-tuple of (name, beta).')\n elif wintype == 'gaussian':\n raise ValueError('Gaussian wind...
[ "0.67929304", "0.63826716", "0.62530965", "0.62104356", "0.6163781", "0.61292005", "0.61183995", "0.6117998", "0.6066852", "0.59949917", "0.5980239", "0.5971152", "0.5926306", "0.5924987", "0.59116906", "0.58216536", "0.58204263", "0.57967544", "0.5784298", "0.57625055", "0.5...
0.73582906
0
Return autospectrum (power spectrum) density of a signal x.
def asd(x, t, windowname="none", ave=bool(True)): f, Pxx = crsd(x, x, t, windowname=windowname, ave=ave) Pxx = Pxx.real return f, Pxx
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def x_density_function(self, x):\n return self.wavefunction(x) * self.wavefunction(x)", "def __density(self, x):\n\n z = np.power(self.rate, x) / m.factorial(x)\n return z * np.exp(-self.rate)", "def power_spectral_density(var):\n\n n = len(var)\n Y = np.fft.fft(var)/n # fft computi...
[ "0.7722702", "0.7631152", "0.6906433", "0.6880516", "0.67593175", "0.6668822", "0.65552306", "0.6529716", "0.63159764", "0.62955135", "0.623053", "0.622363", "0.61980325", "0.59871405", "0.59871405", "0.598704", "0.5977013", "0.5977013", "0.5940076", "0.59347564", "0.5930975"...
0.0
-1
Updates list of objects. Adds that exist in the new_list. Removes objects that only exist in the old_list.
def update_cloud_watch_obj_list(old_list, new_list): # Add new. for new_item in new_list: if new_item not in old_list: new_item.added = True old_list.append(new_item) # Remove deleted. for old_item in old_list: if old_item not in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self):\n for object in reversed(self.addList):\n self.objects.append(object)\n self.addList.remove(object)\n\n for object in reversed(self.removeList):\n self.objects.remove(object)\n ...
[ "0.6606929", "0.65365136", "0.64225185", "0.6238082", "0.62184423", "0.62084067", "0.6177231", "0.6148156", "0.60591096", "0.59892285", "0.5948423", "0.5898615", "0.5896449", "0.5857926", "0.58520526", "0.5822545", "0.5806401", "0.57513887", "0.57020897", "0.5646435", "0.5622...
0.8563437
0
Creates a randomized deck
def create_deck(table): # Make a standard poker deck (14 represents an ace) for value in range(2, 15): if value > 10: if value == 11: name = 'Jack' elif value == 12: name = 'Queen' elif value == 13: name = 'King' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_deck(number = 1):\n deck = []\n for suit, face in itertools.product(suit_names, face_names):\n if face == \"Ace\":\n value = 11\n elif face in ['Jack', 'Queen', 'King']:\n value = 10\n else:\n value = int(face)\n img = Image(img_path+su...
[ "0.7941427", "0.75812906", "0.734631", "0.7343165", "0.73276615", "0.72960913", "0.7191648", "0.70912766", "0.70843655", "0.7065568", "0.6993727", "0.6978954", "0.6978203", "0.69474936", "0.6929045", "0.69254255", "0.6892824", "0.6845372", "0.68394053", "0.6821526", "0.681611...
0.7300573
5
Returns the list of available unary choices.
def available_unary_choices() -> Iterable[str]: for name, _ in inspect.getmembers(sys.modules[__name__], inspect.isclass): if name.startswith('Unary'): yield name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_options(self):\n choices = self.choices()\n\n if not choices:\n return None\n\n return [opt[0] for opt in choices]", "def initDefaultChoices(self):\n return []", "def get_choices(self):\n raise NotImplementedError()", "def get_choices(self):\n ra...
[ "0.6497721", "0.6451401", "0.6121795", "0.6121795", "0.6084259", "0.5980454", "0.59606016", "0.5934286", "0.58762485", "0.5801853", "0.57943", "0.57198817", "0.5713086", "0.5708209", "0.5704113", "0.56997573", "0.56622654", "0.5617699", "0.56143916", "0.5613601", "0.5613432",...
0.80741733
0
Returns a list of tokens. This function expects that the tokens in the text are separated by space
def get_token_list(text): return text.split()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _tokenize(self, text: str) -> List[str]:\n tokens = []\n for token in re.findall(self._pat, text):\n tokens.extend(bpe_token for bpe_token in self._bpe(token).split(\" \"))\n return tokens", "def tokenize(text):\n return tokens_re.findall(text)", "def tokenize(text):\n re...
[ "0.84088236", "0.8402148", "0.8371163", "0.8368173", "0.8351861", "0.8199644", "0.81503844", "0.81367654", "0.8130551", "0.8129492", "0.8119598", "0.8119598", "0.8119598", "0.8020419", "0.7997671", "0.79558134", "0.7935133", "0.79155624", "0.7905959", "0.7903594", "0.7878661"...
0.88442445
0