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
Convert a datetime.durationfield object into Days, Hours, Minutes, Seconds.
def smooth_timedelta(timedeltaobj): secs = timedeltaobj.total_seconds() timetot = "" if secs > 86400: days = secs // 86400 if days == 1: timetot += f"{int(days)} dzień" else: timetot += f"{int(days)} dni" secs = secs - days * 86400 if secs > 3600:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_duration(duration: int) -> str:\n minutes, seconds = divmod(duration, 60)\n hours, minutes = divmod(minutes, 60)\n days, hours = divmod(hours, 24)\n\n duration = []\n if days > 0:\n duration.append(f\"{days} days\")\n if hours > 0:\n duratio...
[ "0.6570251", "0.6375429", "0.6329478", "0.6308683", "0.63054913", "0.63011974", "0.6293324", "0.62343925", "0.619427", "0.61022854", "0.60944563", "0.6041373", "0.6040879", "0.60048574", "0.5999331", "0.5998975", "0.5987788", "0.59734213", "0.59687835", "0.59426165", "0.59342...
0.5337095
86
Tests if any billing federation is exposed. Federation is exposed when a specific catalog may be identified, selected and used to create a lookup or admin session. Federation is not exposed when a set of catalogs appears as a single catalog.
def supports_visible_federation(self): return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_federation(matrix):\n matrix.charm_config[\"enable-federation\"] = False\n result = matrix.get_federation()\n assert result is False\n matrix.charm_config[\"enable-federation\"] = True\n result = matrix.get_federation()\n assert result is True", "def _can_access_endpoint(self, endp...
[ "0.54837716", "0.5418329", "0.5261027", "0.5146636", "0.5136835", "0.5106803", "0.5105121", "0.50937974", "0.50735223", "0.5071196", "0.50698113", "0.506059", "0.5003939", "0.4982256", "0.49663618", "0.49589586", "0.49400756", "0.49360597", "0.49281862", "0.49163973", "0.4906...
0.66450804
1
Tests if the given ``Catalog`` record type is supported.
def supports_catalog_record_type(self, catalog_record_type=None): if catalog_record_type is None: raise NullArgument() return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_create_catalog_with_record_types(self, *args, **kwargs):\n # Implemented from kitosid template for -\n # osid.resource.BinAdminSession.can_create_bin_with_record_types\n return self._get_provider_session('catalog_admin_session').can_create_catalog_with_record_types(*args, **kwargs)", ...
[ "0.7262981", "0.6980177", "0.67557627", "0.6242428", "0.62419784", "0.6235508", "0.61435956", "0.59597033", "0.5908664", "0.5866235", "0.5827148", "0.5774302", "0.57483727", "0.56505746", "0.56336045", "0.5630315", "0.5597322", "0.55708224", "0.5560782", "0.55267775", "0.5493...
0.8249828
0
Tests if the given catalog search record type is supported.
def supports_catalog_search_record_type(self, catalog_search_record_type=None): if catalog_search_record_type is None: raise NullArgument() return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def supports_catalog_record_type(self, catalog_record_type=None):\n if catalog_record_type is None:\n raise NullArgument()\n return False", "def supports_book_search_record_type(self, book_search_record_type=None):\n if book_search_record_type is None:\n raise NullArgum...
[ "0.79172605", "0.7295258", "0.7058934", "0.665268", "0.6554055", "0.6347802", "0.616384", "0.6052737", "0.58815676", "0.58489805", "0.5801409", "0.57719827", "0.5719734", "0.5710695", "0.5687792", "0.56575793", "0.56539136", "0.5601807", "0.55922437", "0.55835116", "0.5531404...
0.8556666
0
Gets the catalog lookup session.
def get_catalog_lookup_session(self): raise Unimplemented()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_catalog_lookup_session(self, *args, **kwargs):\n # Implemented from kitosid template for -\n # osid.resource.ResourceManager.get_resource_lookup_session_manager_template\n return self._provider_manager.get_catalog_lookup_session(*args, **kwargs)", "def get_catalog_lookup_session(self...
[ "0.8139668", "0.7728458", "0.7427673", "0.7408231", "0.7155619", "0.6684165", "0.66507757", "0.65801775", "0.6569528", "0.6542556", "0.6408536", "0.64069325", "0.63376784", "0.6337346", "0.63228285", "0.6320348", "0.62917995", "0.628173", "0.62473416", "0.62473416", "0.623361...
0.8433303
0
Gets the catalog query session.
def get_catalog_query_session(self): raise Unimplemented()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_catalog_query_session(self, *args, **kwargs):\n # Implemented from kitosid template for -\n # osid.resource.ResourceManager.get_resource_lookup_session_manager_template\n return self._provider_manager.get_catalog_query_session(*args, **kwargs)", "def get_catalog_query_session(self, *...
[ "0.7995521", "0.7697098", "0.7450508", "0.7285649", "0.7092729", "0.7084628", "0.7040289", "0.7028577", "0.6801463", "0.6682395", "0.66677433", "0.66441846", "0.660852", "0.6586674", "0.658392", "0.65484005", "0.65353745", "0.65333116", "0.65333116", "0.65090305", "0.65090305...
0.8333247
0
Gets the cataloging rules manager.
def get_cataloging_rules_manager(self): raise Unimplemented()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cataloging_rules_manager(self, *args, **kwargs):\n raise Unimplemented('Unimplemented in dlkit.services')", "def get_cataloging_rules_proxy_manager(self, *args, **kwargs):\n raise Unimplemented('Unimplemented in dlkit.services')", "def get_cataloging_rules_proxy_manager(self):\n if...
[ "0.8138595", "0.73283154", "0.7199584", "0.6056354", "0.59351975", "0.5583658", "0.55529076", "0.548783", "0.54141456", "0.5409439", "0.5407654", "0.5385322", "0.53709334", "0.5356947", "0.53444284", "0.53297615", "0.53274953", "0.5293504", "0.5253489", "0.5208852", "0.520848...
0.86898196
0
Gets the catalog lookup session.
def get_catalog_lookup_session(self, proxy=None): if proxy is None: raise NullArgument() raise Unimplemented()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_catalog_lookup_session(self):\n raise Unimplemented()", "def get_catalog_lookup_session(self, *args, **kwargs):\n # Implemented from kitosid template for -\n # osid.resource.ResourceManager.get_resource_lookup_session_manager_template\n return self._provider_manager.get_catalo...
[ "0.8433303", "0.8139668", "0.7728458", "0.7408231", "0.7155619", "0.6684165", "0.66507757", "0.65801775", "0.6569528", "0.6542556", "0.6408536", "0.64069325", "0.63376784", "0.6337346", "0.63228285", "0.6320348", "0.62917995", "0.628173", "0.62473416", "0.62473416", "0.623361...
0.7427673
3
Gets the catalog query session.
def get_catalog_query_session(self, proxy=None): if proxy is None: raise NullArgument() raise Unimplemented()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_catalog_query_session(self):\n raise Unimplemented()", "def get_catalog_query_session(self, *args, **kwargs):\n # Implemented from kitosid template for -\n # osid.resource.ResourceManager.get_resource_lookup_session_manager_template\n return self._provider_manager.get_catalog_...
[ "0.8333247", "0.7995521", "0.7697098", "0.7450508", "0.7092729", "0.7084628", "0.7040289", "0.7028577", "0.6801463", "0.6682395", "0.66677433", "0.66441846", "0.660852", "0.6586674", "0.658392", "0.65484005", "0.65353745", "0.65333116", "0.65333116", "0.65090305", "0.65090305...
0.7285649
4
Gets the cataloging rules proxy manager.
def get_cataloging_rules_proxy_manager(self): if proxy is None: raise NullArgument() raise Unimplemented()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cataloging_rules_proxy_manager(self, *args, **kwargs):\n raise Unimplemented('Unimplemented in dlkit.services')", "def get_cataloging_rules_manager(self):\n raise Unimplemented()", "def get_cataloging_rules_manager(self, *args, **kwargs):\n raise Unimplemented('Unimplemented in dlk...
[ "0.82237583", "0.78408587", "0.73989934", "0.62882155", "0.62143385", "0.60708266", "0.5719906", "0.56338716", "0.55841655", "0.5567195", "0.552756", "0.55112135", "0.54388034", "0.5437989", "0.54079753", "0.54041845", "0.538163", "0.53799963", "0.53425825", "0.53425825", "0....
0.86052495
0
Return feed dict for this graph to work for specific tasks. In most cases, it works as an translator for feeds to feed_dict, thus replacing name of feeds to tf.Tensor.
def get_feed_dict(self, feeds=None, task=None): from dxpy.collections.dicts import combine_dicts result = self._externel_feeds() if feeds is None: return result for n in self.nodes: if n in feeds: result[self.tensor(n)] = feeds[n] if se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_feed_dict(self, input_data, input_labels=None, dict_args=None, is_test=False):\n placeholders = [op.name\n for op\n in self.graph.get_operations()\n if (\"auto_placeholders\" in op.name\n and \"input_data\" not in op.name\n and \"input_label\" not in op.name)\n ]\n if in...
[ "0.64917797", "0.6323643", "0.63147664", "0.6301609", "0.61487734", "0.6038681", "0.6032031", "0.59561026", "0.57950485", "0.57876754", "0.57525814", "0.5745243", "0.5742795", "0.5731612", "0.5708012", "0.5665463", "0.5642645", "0.5629736", "0.56057423", "0.5596522", "0.55827...
0.7396861
0
Index in my Web Page.
def Index(request): print(request.method) template = 'User/general/index.html' context = {} return render(request, template, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index():\n pass", "def index():\n\n return render_template(\"index.html\"), 200", "def index():\n return render_template('index.html'), 200", "def index():\r\n return render_template('index.html')", "def index():\n\n\treturn(render_template('index.html'))", "def index():\n ...
[ "0.8176451", "0.80058455", "0.7983078", "0.7966348", "0.7958688", "0.7922231", "0.79002327", "0.7882582", "0.7882582", "0.78620815", "0.78620815", "0.783373", "0.7829811", "0.78058153", "0.78003514", "0.7790953", "0.7790953", "0.7790953", "0.7778783", "0.775646", "0.7741266",...
0.0
-1
All Eventos home Page
def EventosList(request): print(request.method) template = 'User/eventos/all.html' user = request.user.get_username() eventos = Evento.objects.all() print("...............................") print(user) print("...............................") context = {'user':user,'eventos':eventos} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def homepage(request):\n template_var = base_template_vals(request)\n template_var[\"events\"] = Event.objects.filter(is_approved=True\n ).order_by(\"-created\")\n \n return render_to_response(\"event/event_homepage.html\", template_var,\n contex...
[ "0.76447374", "0.72856396", "0.717825", "0.71657157", "0.7147775", "0.71139216", "0.7060904", "0.7057602", "0.70347637", "0.70166653", "0.6997437", "0.6991386", "0.69852704", "0.69663364", "0.6883112", "0.6883112", "0.6883112", "0.6883112", "0.6883112", "0.6883112", "0.688311...
0.0
-1
Get in About me.
def get(self, request): return render(request, self.template, self.context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about_me(self):\n if \"aboutMe\" in self._prop_dict:\n return self._prop_dict[\"aboutMe\"]\n else:\n return None", "async def about(ctx):\n await ctx.send(get_about())", "def about(self) -> dict:\n if self.ABOUT_CACHE:\n return self.ABOUT_CACHE\n ...
[ "0.77418065", "0.7465585", "0.72203964", "0.7193528", "0.7193528", "0.7193528", "0.7193528", "0.7090777", "0.706522", "0.7023098", "0.6949245", "0.6937337", "0.69269776", "0.68645656", "0.6838936", "0.68377805", "0.68326545", "0.68149924", "0.68039465", "0.6790805", "0.678096...
0.0
-1
Compile the program into either the custom HBC format, C code, or Python code. If outfile is None, return the compiled byte string. If functiononly, only create the core function, i.e. no command line parsing function. If overwrite, overwrite outfile if it exists.
def compile(self, outfile=None, language='hbc', functiononly=False, overwrite=False): if isinstance(outfile, str): if not overwrite and os.path.exists(outfile): raise CarError('output file already exists') if not language: ext = outfile.rsp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cross_compiler(compile_func, base_options=None, output_format=\"so\"):\n if base_options is None:\n base_options = []\n def _fcompile(outputs, objects, options=None):\n all_options = base_options\n if options is not None:\n all_options += options\n compile_func(outp...
[ "0.62408274", "0.5666704", "0.5651924", "0.5645974", "0.5631369", "0.56036144", "0.5582799", "0.55643916", "0.54802686", "0.5478638", "0.5431816", "0.5401319", "0.5401046", "0.5386839", "0.538616", "0.53855234", "0.53839976", "0.5367781", "0.5355176", "0.5354651", "0.53521156...
0.7415554
0
Close the client connect connection
async def close(self): if self.closed: return await super().close() if self.socket: await self.socket.close() await self._session.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def closeConnecetion(self):\n client.close()", "def close(self):\n if self.client:\n self.client.connection.close()\n self.client = None", "def disconnect(self) -> None:\n self.client_socket.close()", "def close_connection(self):\n self.nodesocket.close()", "de...
[ "0.8453346", "0.7810343", "0.7728005", "0.765468", "0.76463586", "0.7614969", "0.7558635", "0.75525063", "0.7487831", "0.74669755", "0.7453565", "0.74416816", "0.74349934", "0.74322236", "0.74104923", "0.7400118", "0.7364609", "0.7362799", "0.73469156", "0.7333149", "0.732868...
0.0
-1
Gets the app_sw_rev of this MoteInfo. Software version of the mote's application software
def app_sw_rev(self): return self._app_sw_rev
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def software_version(self) -> str:\n return self.camera_info[\"main_sw_version\"]", "def software_version(self) -> str:\n return self.data.get(Attribute.SOFTWARE_VERSION)", "def sw_version(self) -> str | None:\n return self.status.get(\"VERSION\")", "def hw_version(self) -> str | None:\n...
[ "0.7526223", "0.7502622", "0.72076845", "0.7116721", "0.6990601", "0.6821625", "0.67806876", "0.6773749", "0.67736816", "0.6654348", "0.6643856", "0.66371745", "0.6636289", "0.66328245", "0.6588274", "0.6584876", "0.65532804", "0.6548796", "0.65278494", "0.6439249", "0.643758...
0.84826857
0
Gets the avg_latency of this MoteInfo. Average latency of packets received from the mote, in milliseconds
def avg_latency(self): return self._avg_latency
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rtt_avg_ms(self):\n\n return represent_seconds_in_milliseconds(self.__rtt_avg)", "def average_speed(self):\n return self.total_distance * 3600 / self.total_time", "def average_latency_per_iop(self):\n return self._average_latency_per_iop", "def average_speed(self):\n return se...
[ "0.7302399", "0.69224495", "0.68815714", "0.68051827", "0.6733484", "0.6693967", "0.65792894", "0.64915335", "0.640412", "0.6187503", "0.6101087", "0.60752183", "0.60752183", "0.60752183", "0.6045342", "0.5967161", "0.58939695", "0.5805713", "0.57930434", "0.5704231", "0.5687...
0.82374096
0
Gets the charge of this MoteInfo. Cumulative charge consumed by the mote, in milliCoulombs
def charge(self): return self._charge
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_charge(self):\n\n return self.charge", "def get_charge(self):\n\n return self._charge", "def charge(self):\n return sum(self.charges)", "def send_total_charge(self) -> float:\n charge = self.molecule.molecular_charge\n MDI_Send(charge, 1, MDI_DOUBLE, self.comm)\n ...
[ "0.78122306", "0.7748573", "0.7192705", "0.6914032", "0.68634135", "0.6742989", "0.6724977", "0.6724977", "0.66591215", "0.6603982", "0.6550281", "0.64252025", "0.6401791", "0.62994486", "0.62888664", "0.62835515", "0.61668026", "0.6140012", "0.61310244", "0.61233664", "0.607...
0.7648052
2
Gets the estimated_latency_to_mote of this MoteInfo. Estimated time for a packet to reach the mote, in milliseconds.
def estimated_latency_to_mote(self): return self._estimated_latency_to_mote
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def estimated_latency_to_mote(self, estimated_latency_to_mote):\n self._estimated_latency_to_mote = estimated_latency_to_mote", "def get_latency(self):\n return self.latency", "def estimated_speed(self):\n return self._estimates[3].item(0)", "def get_walk_to_target_duration(self):\n ...
[ "0.6657817", "0.6337562", "0.6059516", "0.5895674", "0.5885249", "0.58293474", "0.5810741", "0.56731063", "0.5642504", "0.5596795", "0.5578066", "0.5551358", "0.5510417", "0.54649323", "0.54280263", "0.54280263", "0.54207796", "0.5413955", "0.53992915", "0.5372599", "0.537222...
0.8276854
0
Gets the id of this MoteInfo. Numeric mote identifier, used as a shortcut on CLI. The id should not be used to uniquely identify a mote as it is not guaranteed to remain constant after a mote reset
def id(self): return self._id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_id_number(self) -> str:\n return self.id_number", "def num_id(self) -> str:\n return pulumi.get(self, \"num_id\")", "def id(self) -> int:\n\t\t# pylint: disable=invalid-name\n\t\treturn self._oid", "def id(self) -> int:\n return pulumi.get(self, \"id\")", "def get_id(self) -> i...
[ "0.7279233", "0.7128634", "0.70177263", "0.6866266", "0.6783373", "0.6783373", "0.6765998", "0.6765998", "0.6765998", "0.6765998", "0.6765998", "0.6765998", "0.6765998", "0.6765998", "0.6765998", "0.6765998", "0.6765998", "0.6765998", "0.6765998", "0.6765998", "0.6765998", ...
0.0
-1
Sets the id of this MoteInfo. Numeric mote identifier, used as a shortcut on CLI. The id should not be used to uniquely identify a mote as it is not guaranteed to remain constant after a mote reset
def id(self, id): self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, id):\n self.__id = id", "def set_id(self, id_=None):\n if id_ is None:\n self.id = id(self)\n else:\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_):...
[ "0.7196563", "0.71223193", "0.7086336", "0.7083084", "0.70471585", "0.6894373", "0.67680734", "0.6767357", "0.6756058", "0.67252517", "0.66743785", "0.66743785", "0.66743785", "0.66743785", "0.66743785", "0.66743785", "0.66743785", "0.66743785", "0.66743785", "0.66743785", "0...
0.6598338
35
Gets the join_sys_time of this MoteInfo. System time at which the mote last joined, in ISO 8601 format
def join_sys_time(self): return self._join_sys_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getJoiningTime(self):\n return self.__joinTime", "def _get_inner_time(self):\n timestamp = self.last_two_timestamps[0]\n if not timestamp:\n return '0000-00-00 00:00:00'\n return str(timestamp)", "def join_sys_time(self, join_sys_time):\n self._join_sys_time = ...
[ "0.6670326", "0.63899076", "0.61067593", "0.60999006", "0.6014486", "0.5942295", "0.59024984", "0.58179945", "0.58179945", "0.57516056", "0.5731954", "0.5654352", "0.5615905", "0.56116253", "0.5609297", "0.56064767", "0.5605071", "0.56032753", "0.56002337", "0.55912", "0.5585...
0.78469896
0
Sets the lost_packet_count of this MoteInfo. Number of lost packets from the mote as calculated by the Manager based on the mote's security counter
def lost_packet_count(self, lost_packet_count): self._lost_packet_count = lost_packet_count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lost_packet_count(self):\n return self._lost_packet_count", "def warning_count(self, warning_count):\n\n self._warning_count = warning_count", "def warning_count(self, warning_count):\n\n self._warning_count = warning_count", "def calculatePacketLoss(packetHistory, lost):\n re...
[ "0.69269884", "0.57692707", "0.57692707", "0.55103815", "0.5151945", "0.5127664", "0.49092168", "0.48681733", "0.47437233", "0.47346026", "0.47043657", "0.46598434", "0.46293947", "0.4620983", "0.46024147", "0.45849094", "0.45819297", "0.45685366", "0.45664665", "0.4550222", ...
0.8063793
0
Gets the max_current of this MoteInfo. Maximum steadystate current allowed by the mote's power supply
def max_current(self): return self._max_current
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state_max(self) -> float:\n raise NotImplementedError", "def max_temp(self):\n return self._max_temp", "def hemt_gate_max_voltage(self):\n return self._hemt_gate_max_voltage", "def locked_temp_max(self) -> int:\r\n # TODO: Force this to return an int.\r\n if self.temper...
[ "0.7260312", "0.70495135", "0.7026395", "0.6911973", "0.6882571", "0.686057", "0.6821794", "0.681874", "0.68151623", "0.6785417", "0.6762671", "0.67457837", "0.67435974", "0.6725798", "0.67040443", "0.6691418", "0.6651901", "0.6648256", "0.6638687", "0.6631283", "0.660668", ...
0.7889407
0
Gets the max_num_links of this MoteInfo. Maximum number of links supported by the mote
def max_num_links(self): return self._max_num_links
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_num_links(self, max_num_links):\n self._max_num_links = max_num_links", "def num_links(self):\n return self._num_links", "def get_current_max_link(self):\n return self.current_max_link", "def num_links(self):\n return len(self._link_reg)", "def max_node_count(self) -> in...
[ "0.78398967", "0.74008155", "0.7031874", "0.66835624", "0.6483618", "0.6469669", "0.64442515", "0.6429202", "0.6413022", "0.64115345", "0.6353532", "0.63361114", "0.6249099", "0.62453425", "0.6238766", "0.62237406", "0.6223439", "0.62070024", "0.6160633", "0.61511993", "0.612...
0.8822376
0
Sets the max_num_links of this MoteInfo. Maximum number of links supported by the mote
def max_num_links(self, max_num_links): self._max_num_links = max_num_links
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_num_links(self):\n return self._max_num_links", "def num_links(self, num_links):\n self._num_links = num_links", "def source_links_in_count_max(self, source_links_in_count_max):\n\n self._source_links_in_count_max = source_links_in_count_max", "def max_num_neighbors(self, max_num...
[ "0.7646011", "0.7308301", "0.71388334", "0.67723143", "0.6654847", "0.64971316", "0.63899976", "0.6379253", "0.63578165", "0.62927413", "0.627924", "0.62658584", "0.61995167", "0.61653036", "0.6144998", "0.61391234", "0.60986197", "0.60350305", "0.60312414", "0.5957197", "0.5...
0.8882974
0
Gets the num_joins of this MoteInfo. Total number of times the mote has joined the manager
def num_joins(self): return self._num_joins
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_joins(self):\n ret_val = self._num_joins()\n return ret_val", "def totalJoinerCount(self) -> int:\n return len(self._joiner_list)", "def num_joins(self, num_joins):\n self._num_joins = num_joins", "def member_count(self) -> int:\n return sum([g.member_count for g in...
[ "0.7515075", "0.71042496", "0.655753", "0.6335969", "0.60084355", "0.5926697", "0.57579213", "0.5744496", "0.55770355", "0.55770355", "0.5568426", "0.5493407", "0.5468854", "0.5410416", "0.53479546", "0.53298765", "0.53271824", "0.53187495", "0.5307417", "0.52984416", "0.5293...
0.7570356
0
Sets the num_joins of this MoteInfo. Total number of times the mote has joined the manager
def num_joins(self, num_joins): self._num_joins = num_joins
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_joins(self):\n return self._num_joins", "def num_joins(self):\n ret_val = self._num_joins()\n return ret_val", "def totalJoinerCount(self) -> int:\n return len(self._joiner_list)", "def set_num_updates(self, num_updates):\n self.num_updates = num_updates", "def se...
[ "0.71759444", "0.7056411", "0.6134475", "0.5622943", "0.5622943", "0.55950475", "0.54748064", "0.54728603", "0.54389614", "0.5327983", "0.52435523", "0.5198548", "0.51782936", "0.51602584", "0.5144307", "0.51405513", "0.50867504", "0.50225776", "0.49896553", "0.497609", "0.49...
0.8113769
0
Sets the num_links of this MoteInfo. Allocated links on the mote
def num_links(self, num_links): self._num_links = num_links
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_num_links(self, max_num_links):\n self._max_num_links = max_num_links", "def num_links(self):\n return self._num_links", "def links(self, links):\n self._links = links", "def links(self, links):\n\n self._links = links", "def links(self, links):\n\n self._links = ...
[ "0.7239475", "0.68061507", "0.6714595", "0.663724", "0.663724", "0.663724", "0.663724", "0.663724", "0.663724", "0.663724", "0.663724", "0.663724", "0.663724", "0.663724", "0.650731", "0.63846624", "0.633741", "0.62901986", "0.62359226", "0.61955035", "0.61250585", "0.60860...
0.8474656
0
Gets the stack_sw_rev of this MoteInfo. Software version of the mote's network stack
def stack_sw_rev(self): return self._stack_sw_rev
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app_sw_rev(self):\n return self._app_sw_rev", "def sw_version(self) -> str | None:\n return self.status.get(\"VERSION\")", "def software_version(self) -> str:\n return self.camera_info[\"main_sw_version\"]", "def software_version(self) -> str:\n return self.data.get(Attribute....
[ "0.71045065", "0.65235287", "0.6337981", "0.6177168", "0.6114412", "0.61143243", "0.6008432", "0.59959435", "0.59318006", "0.5903937", "0.58862597", "0.5774643", "0.57047635", "0.5693847", "0.5678826", "0.5675162", "0.5626215", "0.5602077", "0.56012344", "0.5589912", "0.55727...
0.73570496
0
Sets the stack_sw_rev of this MoteInfo. Software version of the mote's network stack
def stack_sw_rev(self, stack_sw_rev): self._stack_sw_rev = stack_sw_rev
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app_sw_rev(self, app_sw_rev):\n self._app_sw_rev = app_sw_rev", "def stack_sw_rev(self):\n return self._stack_sw_rev", "def app_sw_rev(self):\n return self._app_sw_rev", "def hw_rev(self, hw_rev):\n self._hw_rev = hw_rev", "def software_version(self) -> str:\n return ...
[ "0.63316244", "0.62079245", "0.57788515", "0.54014146", "0.49868244", "0.49547824", "0.49171653", "0.47832817", "0.4776468", "0.4723221", "0.4712181", "0.46490368", "0.46289754", "0.46284208", "0.4617018", "0.45975563", "0.4583487", "0.45821074", "0.45766366", "0.4507446", "0...
0.7797818
0
Gets the state of this MoteInfo. Mote state
def state(self): return self._state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getState(self):\n return self.motorState", "def get_state(self):\n return self.state", "def get_state(self):\n return self.state", "def state(self):\n return self.get_state()", "def getState(self):\n return self.state", "def getState(self):\n return self.stat...
[ "0.71050346", "0.7085388", "0.7085388", "0.7060149", "0.70141566", "0.70141566", "0.70141566", "0.6974582", "0.68895966", "0.68895966", "0.68895966", "0.68895966", "0.68895966", "0.6850195", "0.6846051", "0.6842215", "0.68085796", "0.68085796", "0.68061185", "0.68061185", "0....
0.6756075
49
Gets the state_sys_time of this MoteInfo. Time of last state change, in ISO 8601 format
def state_sys_time(self): return self._state_sys_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_state_time(self) -> str:\n return pulumi.get(self, \"last_state_time\")", "def time_since_last_state_change(self):\n current_time = rospy.get_rostime()\n difference = current_time - self._timestamps['last_state_change']\n return difference.to_sec()", "def current_state_time...
[ "0.76631165", "0.7212587", "0.7184665", "0.6767043", "0.6561226", "0.6501458", "0.6451417", "0.6419728", "0.6399872", "0.63987577", "0.639661", "0.63874054", "0.6384838", "0.6370285", "0.63467836", "0.6338007", "0.6300576", "0.6300576", "0.62860996", "0.6276877", "0.6263084",...
0.8410367
0
Gets the used_current of this MoteInfo. Estimated steadystate current being used
def used_current(self): return self._used_current
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current(self) -> float:\n return self._electric_current", "def get_current_state(self):\n return self.nextYs[-1]", "def current_temp(self):\n return self._current_temp", "def holding_current(self):\n if self.clamp_mode == 'ic':\n return self._meta['holding_current']...
[ "0.66354114", "0.6617031", "0.6557697", "0.6548182", "0.64730537", "0.6468446", "0.6415496", "0.63402086", "0.6324637", "0.63079095", "0.6305494", "0.63054603", "0.62723583", "0.6190966", "0.6175589", "0.6124378", "0.6118722", "0.6070685", "0.6069414", "0.6069389", "0.6037408...
0.7556913
0
Sets the used_current of this MoteInfo. Estimated steadystate current being used
def used_current(self, used_current): self._used_current = used_current
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def used_current(self):\n return self._used_current", "def set_current(self, current):\n self._current = current", "def setCurrent(self, current):\n self.__current = current", "def set_external_current(self, current):\n assert type(current) is AnalogSignal, \\\n \"Curre...
[ "0.62392664", "0.61334276", "0.58923644", "0.57589203", "0.57437307", "0.56925803", "0.5668178", "0.56313926", "0.55130935", "0.5504246", "0.5460091", "0.54534394", "0.5371671", "0.53417975", "0.5329336", "0.53286296", "0.5295329", "0.5286589", "0.52347964", "0.52337044", "0....
0.772313
0
Returns true if both objects are equal
def __eq__(self, other): 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.7961088", "0.7961088", "0.79433626", "0.79303336", "0.7926563", "0.7897525", "0.78826123", "0.78826123", "0.78806067", "0.7872423", "0.7868354", "0.78668815", "0.7825702", "0.7819993", "0.78162885", "0.78078854", "0.78068...
0.79670393
20
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.84564555", "0.8391999", "0.8144653", "0.81410354", "0.81326365", "0.8094085", "0.80921024", "0.80921024", "0.80921024", "0.8085453", "0.8085453", "0.807646", "0.807646", "0.806588" ]
0.0
-1
Convert Item to the pandas DataFrame
def convert_item_to_df(item: Item) -> pd.DataFrame: items = {} for key, value in item.dict().items(): items[key] = [value] return pd.DataFrame(items)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_df(self):\r\n return pd.DataFrame([dict(self)])", "def to_pandas(self, **kwargs) -> pd.Series | pd.DataFrame:\n\n if self.n_items != 1:\n return self.to_dataframe(**kwargs)\n else:\n return self[0].to_pandas(**kwargs)", "def to_df(self):\n return pd.Data...
[ "0.68145746", "0.67881835", "0.6712674", "0.6712674", "0.6712674", "0.6712674", "0.6712674", "0.667181", "0.66498417", "0.6574625", "0.65695935", "0.6519195", "0.64154476", "0.6373365", "0.63534456", "0.63448584", "0.6338784", "0.6336105", "0.6317567", "0.631061", "0.631061",...
0.85101503
0
From rec_t and tcp_t, calculate Hertz of remote clock hertz is slope of linear regression Based on Kohno 2005 paper ver is 4 or 6
def calHertz(self, rcv_t, tcp_t, ver): # Calculating Offsets count = len(rcv_t) Xi_arr = np.zeros(count - 1) Vi_arr = np.zeros(count - 1) adjustment = 0 for i in range(1, count - 1): # xi = rcv_t[i] - rcv_t[0] xi = rcv_t[i] # rcv_t is alreay zer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hexapodZernikeLinearModel():\n Tfile='/home/jghao/research/decamFocus/psf_withseeing/finerGrid_coeff_matrix/zernike_coeff_finerGrid_training.cp'\n b=p.load(open(Tfile))\n nobs = len(b)\n x = b[:,0]\n y = b[:,1]\n z = b[:,2]\n theta = b[:,3]\n phi = b[:,4]\n fwhm = b[:,5]\n e1 = b[...
[ "0.54452085", "0.5440221", "0.54313904", "0.54267985", "0.5399536", "0.5379563", "0.53352743", "0.52713567", "0.5263469", "0.52587265", "0.5213893", "0.51543057", "0.5125633", "0.51023704", "0.50985193", "0.508453", "0.50764006", "0.5072719", "0.5070351", "0.5070229", "0.5069...
0.79712915
0
Sets the name for SMACK, which gets displayed in the "Tool" row in BenchExec table headers.
def name(self): return "SMACK"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setName(self, name):\n self.name = str(name)", "def setName(self, *args):\n return _libsbml.SBase_setName(self, *args)", "def setName(self, name):\n self.name = name", "def setName(self, name):\n self.name = name", "def setName(self, name):\n self.name = name", "def...
[ "0.58007264", "0.5768711", "0.57515246", "0.57515246", "0.57515246", "0.57515246", "0.5743689", "0.56797415", "0.56774", "0.5662364", "0.56598467", "0.56502247", "0.5629208", "0.5629208", "0.55899", "0.55670625", "0.554182", "0.55313325", "0.55208325", "0.55179024", "0.551665...
0.6709596
0
Home endpoint which can be used to test the availability of the application.
def read_home(): return {'message': 'API live!'}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_home(self):\n response = self.app.get(\"/\")\n self.assertTrue(response.status_code, 200)", "def home():\n return response(\"OK\")", "def test_home(self):\n result = self.app.get('/')\n self.assertEqual(result.status_code, 200)", "def test_home_exists(self):\n r...
[ "0.75343317", "0.73834115", "0.73620486", "0.72912455", "0.6789598", "0.674022", "0.67097455", "0.67002136", "0.6689213", "0.6636931", "0.65785706", "0.6559403", "0.65390855", "0.65136707", "0.65136707", "0.6495991", "0.64853466", "0.64853466", "0.6483255", "0.6480013", "0.64...
0.0
-1
String representation of this class, i.e., the ID, the name and the content are converted to a string. Returns str
def __str__(self): pg_str = pformat(self.content) repr_str = "Node ID: {} \nNode Name: {} \n{}".format(self.id, self.name, pg_str) return repr_str
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return str(self.get_data())", "def __str__(self):\n return str(self.serialize())", "def __str__ (self) :\n\n return self.as_string()", "def __str__(self):\n \n result = '<' + self._name + ', ' + str(self._id) + ', ' + self._age + ', ' \n for elem...
[ "0.7679835", "0.767475", "0.764039", "0.76284903", "0.76085037", "0.7586076", "0.7585671", "0.7569462", "0.7568116", "0.75159067", "0.7510985", "0.7500257", "0.7489576", "0.7480575", "0.74689573", "0.74561477", "0.74412036", "0.74403983", "0.7433007", "0.74311155", "0.7428388...
0.7500757
11
Adds an edge to the node if not already given.
def add_edge(self, edge): add_egde = True for edge_this in self.edges: if edge_this == edge: add_egde = False if add_egde: self.edges.append(edge) return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_edge(self, edge):\n assert edge not in self.edges\n self.edges.append(edge)", "def add_edge(self, edge: e.Edge) -> None:\n if edge not in self.edges:\n self.edges.append(edge)\n self.num_edges = self.num_edges + 1", "def add_edge(self, edge):\n if(self....
[ "0.81455845", "0.81034213", "0.78788674", "0.7873439", "0.7865331", "0.7830682", "0.7811535", "0.77546257", "0.77153414", "0.76953614", "0.7635642", "0.7568035", "0.7557874", "0.7546816", "0.75310296", "0.749246", "0.74879485", "0.7477749", "0.7449112", "0.738874", "0.7386084...
0.77203226
8
Checks if two edges are equal, i.e. if the nodes and their order are the same.
def __eq__(self, other): return (self.nodes[0].id == other.nodes[0].id) & \ (self.nodes[1].id == other.nodes[1].id) & \ (self.name == other.name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n if not type(other) == type(self):\n return False\n sedges, oedges = self.edges, other.edges\n return ((len(sedges) == len(oedges)) and\n all(numpy.all(se == oe) for (se, oe) in zip(sedges, oedges)))", "def __eq__(self, other) -> bool:\n ...
[ "0.7570254", "0.7152071", "0.71124387", "0.7019526", "0.6977375", "0.69618773", "0.6881574", "0.68684185", "0.68340844", "0.68208355", "0.681841", "0.6806017", "0.6725294", "0.66637087", "0.66561455", "0.6650941", "0.6645776", "0.6605642", "0.6599983", "0.6598698", "0.6573085...
0.6218246
49
Function will convert an arcgis table into a pandas dataframe with an object ID index, and the selected input fields using an arcpy.da.SearchCursor.
def table_to_data_frame(in_table, input_fields=None, where_clause=None): OIDFieldName = arcpy.Describe(in_table).OIDFieldName if input_fields: final_fields = [OIDFieldName] + input_fields else: final_fields = [field.name for field in arcpy.ListFields(in_table)] data = [row for row in arc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arcgis_table_to_dataframe(in_fc, input_fields=None, query=\"\", skip_nulls=False, null_values=None):\n OIDFieldName = arcpy.Describe(in_fc).OIDFieldName\n if input_fields:\n final_fields = [OIDFieldName] + input_fields\n else:\n final_fields = [field.name for field in arcpy.ListFields(in...
[ "0.7484427", "0.6485084", "0.60221255", "0.5797029", "0.5710786", "0.5704744", "0.5688349", "0.5672435", "0.5620204", "0.5589855", "0.55507004", "0.55374837", "0.5502417", "0.5499836", "0.54932576", "0.5489571", "0.5457213", "0.5451324", "0.54419494", "0.5407192", "0.5398108"...
0.7295562
1
Return the integer represented by the given array of bytes. bytes Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of builtin objects that support the buffer protocol. byteorder The byte order used to rep...
def from_bytes(self, *args, **kwargs): # real signature unknown pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bytesToInt(bytes, byteorder='little', signed=False):\n return int.from_bytes(bytes, byteorder=byteorder, signed=signed)", "def bytes_to_int(byte_array, big_endian=True, signed=False):\n if six.PY3:\n order = 'little'\n if big_endian:\n order = 'big'\n return int.from_byt...
[ "0.7651017", "0.7617132", "0.70860493", "0.7002866", "0.68274885", "0.67317134", "0.66151685", "0.660748", "0.6564039", "0.655962", "0.65332234", "0.6528785", "0.64674294", "0.63933283", "0.63300776", "0.6178349", "0.61577916", "0.61076707", "0.6076243", "0.60364914", "0.5961...
0.0
-1
Return an array of bytes representing an integer. length Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. byteorder The byte order used to represent the integer. If byteorder is 'big', the most significant byte is at the beginning of the byte ...
def to_bytes(self, *args, **kwargs): # real signature unknown pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _int_to_bytes(integer, endian = 'little'):\n size = 1\n while 1<<(8*size) <= integer:\n size += 1\n\n return integer.to_bytes(size, endian)", "def int_to_bytes(val, bit=32, signed=False, big_endian=True):\n val = int(val) #ensure it is an int\n\n if six.PY3:\n order = 'little'\n ...
[ "0.7394093", "0.64829594", "0.6452316", "0.63511336", "0.6289732", "0.62400556", "0.61796063", "0.6171117", "0.6158413", "0.6147844", "0.6110905", "0.5770546", "0.57657367", "0.5683442", "0.5681397", "0.5662447", "0.56502986", "0.55438304", "0.5539375", "0.5531966", "0.553095...
0.0
-1
Takes current population member and add a probability chance
def mutate(pop, mut_prob, kd_min, kd_max, kp_min, kp_max, ki_min, ki_max): pop_curr = pop for i in range(0, len(pop_curr)): for o in range(3) : if random.random() < mut_prob: if random.random() < 0.5: pop_curr[i][o] = round(pop_curr[i][o] * 0.95, 2) #Maint...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gopher_population_modifier(current_population):\n births = int(current_population * (randrange(10, 21) / 100))\n deaths = int(current_population * (randrange(5, 26) / 100))\n new_population = current_population + births - deaths\n print(\"{} gophers were born :) {} gophers died :(\\nTotal gopher po...
[ "0.71191233", "0.66376585", "0.6437675", "0.63819146", "0.6346638", "0.63320357", "0.6271564", "0.6263937", "0.6255298", "0.62419176", "0.6240161", "0.6235752", "0.62227327", "0.6221867", "0.6217007", "0.6206894", "0.62010515", "0.6154123", "0.61391944", "0.61387914", "0.6129...
0.65198016
2
Create a Python instance from the given DOM node. The node tag must correspond to an element declaration in this module.
def CreateFromDOM (node, default_namespace=None): if default_namespace is None: default_namespace = Namespace.fallbackNamespace() return pyxb.binding.basis.element.AnyCreateFromDOM(node, default_namespace)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CreateFromDOM (node, default_namespace=None):\n if default_namespace is None:\n default_namespace = Namespace.fallbackNamespace()\n return pyxb.binding.basis.element.AnyCreateFromDOM(node, _fallback_namespace=default_namespace)", "def CreateFromDOM (node, default_namespace=None):\n if default...
[ "0.69493896", "0.69493896", "0.69493896", "0.69463205", "0.67006904", "0.67006904", "0.67006904", "0.6699389", "0.6666652", "0.6652992", "0.6623793", "0.659611", "0.65873104", "0.6566647", "0.65114874", "0.6491204", "0.64737105", "0.6426442", "0.63259214", "0.63146526", "0.63...
0.70112616
3
Load the weights of the model
def load_weights_model(self, list_path): [path_encoder, path_decoder, path_discriminator, path_scaler] = list_path self.encode_.load_weights(path_encoder) self.decode_.load_weights(path_decoder) self.b.load_weights(path_discriminator) self.scaler = joblib.load(path_scaler)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_model_weights(self):\n raise NotImplementedError", "def load_model_weights(self, filename):\n self.model.load_weights(filename)", "def _load_weights(self):\n self.npz_weights = np.load(self._weight_file)\n self._load_byte_embedding()\n self._load_cnn_weights()\n ...
[ "0.90327716", "0.8304422", "0.82773536", "0.82014227", "0.8105701", "0.7975623", "0.79244506", "0.79115516", "0.7868691", "0.7866498", "0.78297573", "0.7817733", "0.78106564", "0.780487", "0.7778703", "0.7770854", "0.7755037", "0.77353835", "0.7712979", "0.7626056", "0.760809...
0.7442386
31
Decode with activation function sigmoid
def decode(self, z): if self.switch: x = self.bijecter(z, inverse=True) return self.decode_(x) else: return self.decode_(z)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def activation(z):\n # formula for sigmoid\n return 1 / (1 + np.exp(-z))", "def sigmoid_activation(x):\n return 1.0 / (1 + np.exp(-x))", "def _tanh_to_sigmoid(x):\n return x * 0.5 + 0.5", "def sigmoid(data):\n return _make.sigmoid(data)", "def test_activation_sigmoid(self):\r\n senal ...
[ "0.717868", "0.7125176", "0.711064", "0.7073363", "0.7010824", "0.7009891", "0.6959414", "0.6932484", "0.6931598", "0.6919251", "0.69008106", "0.69008106", "0.6856194", "0.6849463", "0.6848282", "0.6843318", "0.68412197", "0.68319184", "0.6831345", "0.6791391", "0.6788123", ...
0.0
-1
Convert expr into a key suitable for the LHS of a definition.
def keyify(expr): # the type of an applied function is an instance of UndefinedFunction. if not isinstance(expr, (sy.Symbol, sy.Derivative)) and \ not isinstance(expr.__class__, UndefinedFunction): raise TypeError("Expected symbol, derivative or applied function; got {} {}".format...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __convert_key(expression):\n if type(expression) is str and len(expression) > 2 and expression[1] == '!':\n expression = eval(expression[2:-1])\n return expression", "def get_id(self, expr):\n return self.table.inv[expr]", "def decl_key(decl):\n prop = decl.split(...
[ "0.68684787", "0.600099", "0.6000887", "0.5807145", "0.56694645", "0.56109315", "0.56108516", "0.5471366", "0.5459606", "0.53762126", "0.53106946", "0.52647823", "0.5191533", "0.51665413", "0.5123395", "0.5120882", "0.5114254", "0.5098275", "0.50690365", "0.50482196", "0.5021...
0.6157233
1
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues): if normalize: cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis] print("Normalized confusion matrix") else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n...
[ "0.81943494", "0.80950284", "0.8029028", "0.8018638", "0.79939085", "0.7990765", "0.79800814", "0.797508", "0.79603964", "0.7956491", "0.7937033", "0.7934199", "0.79338384", "0.7930749", "0.7926003", "0.79238", "0.7923391", "0.7922832", "0.7922392", "0.7921617", "0.79173195",...
0.78139776
94
Returns a dictionary containing a whole state of the module. Both parameters and persistent buffers (e.g. running averages) are included. Keys are corresponding parameter and buffer names.
def get_state_dict(module, destination=None, prefix='', keep_vars=False): # recursively check parallel module in case that the model has a # complicated structure, e.g., nn.Module(nn.Module(DDP)) if is_module_wrapper(module): module = module.module # below is the same as torch.nn.Module.state_d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_state(self) -> Dict:\n state_dict = {}\n for param in self.optim_objs:\n param_name = pyro.get_param_store().param_name(param)\n state_dict[param_name] = _get_state_dict(self.optim_objs[param])\n return state_dict", "def GetState(self):\n self.update()\n d...
[ "0.7024724", "0.67963207", "0.67667896", "0.67192286", "0.6688813", "0.666206", "0.6654222", "0.66146314", "0.6551453", "0.6538365", "0.64351004", "0.6433929", "0.6388329", "0.6349308", "0.6336895", "0.6324478", "0.6310282", "0.62863064", "0.6280051", "0.6257773", "0.62562776...
0.59035623
52
Returns the total error count.
def error_count(): return cpp_style.error_count()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error_count(self):\n return len(self.errors)", "def get_error_count(self):\n return sum(1 for outcome in (r.outcome for r in self.values()) if outcome == Result.ERROR)", "def total_count(self):\n return self.applied_count + self.error_count", "def total_errors(self):\r\n\r\n c...
[ "0.8467452", "0.8278709", "0.784941", "0.78337765", "0.7608282", "0.7383056", "0.72944725", "0.7192949", "0.70496243", "0.7045551", "0.6961836", "0.69463533", "0.68768615", "0.68546253", "0.6846281", "0.6813177", "0.68060696", "0.6794473", "0.6704411", "0.66490924", "0.659211...
0.71611035
8
Make the given url safe for use against the Rally API.
def make_url_safe(self, url): return url.replace(' ', '%20')\ .replace('(', '%28')\ .replace(')', '%29')\ .replace('"', '%22')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_safe_url(self, url):\n\n # Split the URL into scheme, netloc, path, query and fragment\n parts = list(urlsplit(url))\n\n # Clear scheme and netloc and rebuild URL\n parts[0] = '' # Empty scheme\n parts[1] = '' # Empty netloc (hostname:port)\n safe_url = urluns...
[ "0.74128956", "0.72494626", "0.72017986", "0.7135957", "0.7113994", "0.705337", "0.6873259", "0.67868835", "0.67425513", "0.6722146", "0.6675869", "0.6630458", "0.658009", "0.6568927", "0.65426636", "0.6530956", "0.6511181", "0.6491684", "0.64674526", "0.6443847", "0.64355", ...
0.82698137
0
Creates a logger within the weatherhills hierarchy for the module with the given name.
def whLogger(name): return logging.getLogger('wh.'+name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_logger(name):\n logger = logging.getLogger(name)\n level = get_module_log_level(name)\n logger.setLevel(level)\n handler = logging.FileHandler(get_log_file(name))\n handler.setFormatter(logging.Formatter(\n '%(asctime)s %(levelname)s: %(message)s '\n '[in %(pathname)s:%(lineno)...
[ "0.7447689", "0.7289512", "0.7286787", "0.70414567", "0.70012367", "0.6993257", "0.69355166", "0.6934918", "0.6922802", "0.68779176", "0.6833691", "0.677581", "0.67544156", "0.67453974", "0.67436147", "0.6743398", "0.67318684", "0.6729589", "0.67192143", "0.67105496", "0.6700...
0.73826563
1
Test if the provided user has athority to add, change, or delete records.
def has_authority(self, user): UserModel = get_user_model() ADMINISTRATOR = UserModel.ROLE_MAP[UserModel.ADMINISTRATOR] result = True if not (user.is_superuser or user.role == ADMINISTRATOR): try: self.memberships.get(user=user) except Membership....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authorizes(self, user):\n return self.owner == user or self.workers.filter(pk=user.id).exists()", "def is_access_allowed(self, user_id):\n ### DATABASE CODE GOES HERE\n return False", "def user_has_permission(self, id: int, user: User) -> bool:\n return self.get_queryset().filte...
[ "0.6768105", "0.67471164", "0.6598738", "0.6551638", "0.649609", "0.6434696", "0.6347376", "0.6253744", "0.6219477", "0.6166191", "0.6155211", "0.6148262", "0.6141236", "0.61255777", "0.6108959", "0.61036956", "0.6094366", "0.60785043", "0.6069628", "0.604649", "0.6046214", ...
0.59248435
37
Row normalization function Implement a function that normalizes each row of a matrix to have unit length.
def normalizeRows(x): ### YOUR CODE HERE # using l2 norm to normalize x = x / np.sqrt(np.sum(x * x, axis=-1, keepdims=True)) ### END YOUR CODE return x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalizeRows(x):\n\n ### YOUR CODE HERE\n norm2 = np.linalg.norm(x,2,axis = 1).reshape(x.shape[0],-1)\n x = x/norm2\n ### END YOUR CODE\n\n return x", "def normalizeRows(x):\n N = x.shape[0]\n x /= np.sqrt(np.sum(x ** 2, axis=1)).reshape((N, 1)) + 1e-30\n return x", "def normalizeR...
[ "0.8100103", "0.79205406", "0.7916169", "0.784522", "0.75141764", "0.7423923", "0.741233", "0.73160195", "0.71873987", "0.709521", "0.70898914", "0.6911825", "0.68485755", "0.6770021", "0.67602545", "0.6597088", "0.6540042", "0.65026015", "0.6501679", "0.6490548", "0.6477949"...
0.8068179
1
converts a string to float of seconds .5 = 500ms
def parse_interval(val): re_intv = re.compile(r"(?P<count>\d+)(?P<unit>\w+)") match = re_intv.match(val.strip()) if not match: raise ValueError("invalid interval string '%s'" % val) unit = match.group('unit') count = float(match.group('count')) if unit == 's': return count if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_time(value: str) -> float:\n return float(value[:-1]) * TIME[value[-1]]", "def parse_speed(as_str: str) -> float:\n return float(as_str.rstrip(\"x\"))", "def __time_to_float(time_value):\n return time_value.hour/24 + time_value.minute/(24*60) + time_value.second/(24*60*60) + round(time_v...
[ "0.70158046", "0.67012644", "0.66786665", "0.6473429", "0.62491995", "0.6238683", "0.6227477", "0.6209106", "0.61195517", "0.6108488", "0.6107131", "0.6105061", "0.6104791", "0.61017376", "0.6026713", "0.6014234", "0.601071", "0.6003772", "0.60022557", "0.5991827", "0.5989685...
0.0
-1
Creates a PipelineJobSchedule. Creates PipelineJob with template stored in GCS bucket.
def test_call_preview_schedule_service_create( self, mock_schedule_service_create, mock_schedule_service_get, mock_schedule_bucket_exists, job_spec, mock_load_yaml_and_json, ): aiplatform.init( project=_TEST_PROJECT, staging_bucket=_TES...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Create(project_id=None, gcs_location=None, parameters=None,\n job_name=None, service_account_email=None, zone=None,\n max_workers=None):\n params_list = []\n for k, v in parameters.iteritems() if parameters else {}:\n params_list.append(\n Templates.PARAMETERS_VALUE....
[ "0.6470726", "0.64303434", "0.6370536", "0.63047785", "0.62543476", "0.6178535", "0.6068341", "0.6056727", "0.59332466", "0.5923841", "0.5838821", "0.5734617", "0.5701192", "0.5627752", "0.5590617", "0.5561766", "0.5537095", "0.5471969", "0.53069437", "0.52927935", "0.5271449...
0.6228634
5
Creates a PipelineJobSchedule. Creates PipelineJob with template stored in GCS bucket.
def test_call_schedule_service_create( self, mock_schedule_service_create, mock_schedule_service_get, mock_schedule_bucket_exists, job_spec, mock_load_yaml_and_json, ): aiplatform.init( project=_TEST_PROJECT, staging_bucket=_TEST_GCS_BU...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Create(project_id=None, gcs_location=None, parameters=None,\n job_name=None, service_account_email=None, zone=None,\n max_workers=None):\n params_list = []\n for k, v in parameters.iteritems() if parameters else {}:\n params_list.append(\n Templates.PARAMETERS_VALUE....
[ "0.6470726", "0.6370536", "0.63047785", "0.62543476", "0.6228634", "0.6178535", "0.6068341", "0.6056727", "0.59332466", "0.5923841", "0.5838821", "0.5734617", "0.5701192", "0.5627752", "0.5590617", "0.5561766", "0.5537095", "0.5471969", "0.53069437", "0.52927935", "0.5271449"...
0.64303434
1
Creates a PipelineJobSchedule. Creates PipelineJobSchedule with cron expression in different timezone.
def test_call_schedule_service_create_with_different_timezone( self, mock_schedule_service_create, mock_schedule_service_get, mock_schedule_bucket_exists, job_spec, mock_load_yaml_and_json, ): aiplatform.init( project=_TEST_PROJECT, sta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_job_schedule(self):\n job_schedule_create = netapp_utils.zapi\\\n .NaElement.create_node_with_children(\n 'job-schedule-cron-create',\n **{'job-schedule-name': self.name})\n job_schedule_create.add_node_with_children(\n 'job-schedule-cron...
[ "0.75992477", "0.6824529", "0.6575515", "0.6068726", "0.6068388", "0.591828", "0.5823046", "0.5762243", "0.57408535", "0.5712503", "0.57053596", "0.5689617", "0.5685727", "0.5682986", "0.56772643", "0.5671823", "0.56514305", "0.55927366", "0.5551852", "0.5548204", "0.55287486...
0.6690307
2
Creates a PipelineJobSchedule. Sets timeout for PipelineJobSchedule creation.
def test_call_schedule_service_create_with_timeout( self, mock_schedule_service_create, mock_schedule_service_get, mock_schedule_bucket_exists, job_spec, mock_load_yaml_and_json, ): aiplatform.init( project=_TEST_PROJECT, staging_bucket...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_job_schedule(self):\n job_schedule_create = netapp_utils.zapi\\\n .NaElement.create_node_with_children(\n 'job-schedule-cron-create',\n **{'job-schedule-name': self.name})\n job_schedule_create.add_node_with_children(\n 'job-schedule-cron...
[ "0.71430147", "0.6198386", "0.6186102", "0.6105198", "0.60822946", "0.60315704", "0.59837925", "0.5923816", "0.5845684", "0.58085185", "0.5783293", "0.57336515", "0.55871344", "0.55537766", "0.5529175", "0.5462829", "0.54458976", "0.54298764", "0.541807", "0.53686196", "0.532...
0.6605949
1
Updates a PipelineJobSchedule. Raises error because PipelineJobSchedule should be created before update.
def test_call_schedule_service_update_before_create( self, mock_schedule_service_create, mock_schedule_service_update, mock_schedule_service_get, mock_schedule_bucket_exists, job_spec, mock_load_yaml_and_json, ): aiplatform.init( project=_T...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_monitoring_schedule(\n self,\n endpoint_input=None,\n analysis_config=None,\n output_s3_uri=None,\n constraints=None,\n schedule_cron_expression=None,\n enable_cloudwatch_metrics=None,\n role=None,\n instance_count=None,\n instance_ty...
[ "0.6706209", "0.6604515", "0.63944083", "0.63792616", "0.6362011", "0.6250791", "0.61501026", "0.5898081", "0.58241993", "0.57468325", "0.5667688", "0.5654675", "0.56097704", "0.55973196", "0.5580525", "0.55213135", "0.54830104", "0.5476912", "0.5456952", "0.54283816", "0.540...
0.6409538
2
Gets the PipelineJobSchedule max_concurrent_run_count before creating. Raises error because PipelineJobSchedule should be created first.
def test_get_max_concurrent_run_count_before_create( self, mock_schedule_service_create, mock_schedule_service_get, mock_schedule_bucket_exists, job_spec, mock_load_yaml_and_json, ): aiplatform.init( project=_TEST_PROJECT, staging_bucke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_max_run_count_before_create(\n self,\n mock_schedule_service_create,\n mock_schedule_service_get,\n mock_schedule_bucket_exists,\n job_spec,\n mock_load_yaml_and_json,\n ):\n aiplatform.init(\n project=_TEST_PROJECT,\n staging_b...
[ "0.6835824", "0.5872634", "0.58286554", "0.5562567", "0.55301076", "0.53796256", "0.5365757", "0.5317708", "0.5258211", "0.51740164", "0.5169655", "0.51457006", "0.51457006", "0.5136844", "0.51044863", "0.50679994", "0.50486475", "0.504331", "0.504331", "0.504331", "0.504331"...
0.72516686
0
Gets the PipelineJobSchedule allow_queueing before creating. Raises error because PipelineJobSchedule should be created first.
def test_get_allow_queueing_before_create( self, mock_schedule_service_create, mock_schedule_service_get, mock_schedule_bucket_exists, job_spec, mock_load_yaml_and_json, ): aiplatform.init( project=_TEST_PROJECT, staging_bucket=_TEST_GC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schedule(self) -> Optional['outputs.PreventionJobTriggerTriggerSchedule']:\n return pulumi.get(self, \"schedule\")", "def schedule(self) -> pulumi.Input['CanaryScheduleArgs']:\n return pulumi.get(self, \"schedule\")", "def schedule(self) -> pulumi.Input['BackupScheduleArgs']:\n return ...
[ "0.6270615", "0.5816107", "0.5731552", "0.5675227", "0.5618579", "0.5618579", "0.5618579", "0.5618579", "0.5618579", "0.5618579", "0.5618579", "0.5618579", "0.5618579", "0.55312955", "0.55161977", "0.5457498", "0.5457498", "0.5457498", "0.5454101", "0.5413952", "0.5373342", ...
0.6949099
0
Setup the environment for the tests then start the server.
def setup_package(): global TEST_WORKSPACE TEST_WORKSPACE = env.get_workspace('authentication') os.environ['TEST_WORKSPACE'] = TEST_WORKSPACE test_config = {} # Setup environment variables for the test cases. host_port_cfg = {'viewer_host': 'localhost', 'viewer_port': en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pytest_configure() -> None: # pragma: no cover\n print(\"Starting server app\")\n PROC.start()\n time.sleep(1)\n if PROC.exitcode is not None:\n pytest.exit(\"Failed to start the server, exit code {}\\nLogs are in logs/server.log\".format(PROC.exitcode))\n return\n\n create_genera...
[ "0.76377946", "0.7635453", "0.7437365", "0.73669124", "0.73669124", "0.73669124", "0.73438245", "0.72778505", "0.72651803", "0.71840703", "0.7154706", "0.7127607", "0.71087515", "0.703684", "0.6962201", "0.69364583", "0.69063467", "0.69011134", "0.6859559", "0.6858681", "0.68...
0.6690182
42
Shortcut to create an SVG path consisting of one line segment.
def create_line(self, x1, y1, x2, y2, style=None, parent=None): attrs = {'d': 'M %5f %5f L %5f %5f' % (x1, y1, x2, y2)} return self.create_path(attrs, style, parent)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createLineSegment(self):\n return _libsbml.Curve_createLineSegment(self)", "def createLineSegment(self):\n return _libsbml.GeneralGlyph_createLineSegment(self)", "def createLineSegment(self):\n return _libsbml.ReactionGlyph_createLineSegment(self)", "def line(points):\n return Lin...
[ "0.68497336", "0.6762427", "0.6694624", "0.66625476", "0.6613917", "0.6600153", "0.65817976", "0.6479062", "0.6407334", "0.63439256", "0.62751824", "0.62615764", "0.61879927", "0.61792874", "0.61328316", "0.6108042", "0.6094714", "0.60718167", "0.60687006", "0.5863627", "0.58...
0.6973446
0
Computes Shannon entropy for provided DNA sequence. S = sum( p_i log2(p_i) ) where p_i is s the probability of character number i showing up in sequence.
def sequence_entropy(sequence): c = Counter(sequence.upper()) tot = float(sum(c.values())) c = {k: v / tot for k, v in c.items()} return -1 * sum(c * np.log2(c) for b, c in c.items())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ShannonEntropy(self,s):\n e = s[np.nonzero(s)]**2 * np.log(s[np.nonzero(s)]**2)\n return np.sum(e)", "def entropy(s):\n p, lns = Counter(s), float(len(s))\n return -sum( count/lns * math.log(count/lns, 2) for count in p.values())", "def shannon_entropy(counts):\n freq = np.array(coun...
[ "0.7976471", "0.76183635", "0.75856125", "0.72799623", "0.721075", "0.7124218", "0.7123215", "0.70478535", "0.6885457", "0.6882815", "0.6854246", "0.6850696", "0.6804692", "0.6698518", "0.66870403", "0.6676837", "0.66730773", "0.666278", "0.6583616", "0.6574764", "0.656526", ...
0.76540715
1
Reads a kmer count tsv file into a numpy array object.
def tsv_file2kmer_vector(filename, min_length, max_length): kmer_sizes = np.arange(min_length, max_length + 1) try: fh = gzip.open if isgzip(filename) else open with fh(filename, 'rt') as f: for i, rec in enumerate(f): seq, count = rec.strip().split() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_edgl_as_array(fname):\n df = pd.read_csv(fname, sep=\" \", header=None, usecols=[0, 1])\n return df.to_numpy(dtype=np_ncount_t)", "def tcv2array(path):\n a = []\n with open(path) as tsvfile:\n reader = csv.reader(tsvfile, delimiter='\\t')\n for row in reader:\n if ro...
[ "0.64831495", "0.62731797", "0.6222223", "0.61223394", "0.61110294", "0.60582846", "0.597918", "0.596055", "0.58950496", "0.58752686", "0.58544207", "0.5846798", "0.5835179", "0.57764095", "0.57387924", "0.5734096", "0.5727346", "0.572329", "0.5710759", "0.56864655", "0.56695...
0.6789479
0
Slicing a iteratable object based on kmer size, for example a list of kmer embeddings.
def slice_out_kmer(obj, length, min_length, max_length): lengths = np.arange(min_length, max_length + 1) offsets = np.concatenate(([0], 4**lengths)).cumsum() assert min_length <= length <= max_length index = np.where(lengths == length)[0][0] return obj[offsets[index]:offsets[index + 1]]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cut_kmer(sequence, kmer_size):\n for i in range(len(sequence)-kmer_size+1):\n yield sequence[i:i+kmer_size]", "def cut_kmer(sequence, kmer_size):\n for i in range(len(sequence)-kmer_size+1):\n try:\n yield sequence[i:kmer_size+i]\n except StopIteration:\n retu...
[ "0.6988099", "0.68941766", "0.6302285", "0.62536955", "0.6200651", "0.607039", "0.60427773", "0.5996975", "0.5996975", "0.5996975", "0.59849596", "0.5980058", "0.59289813", "0.5922585", "0.59219724", "0.59118545", "0.5886031", "0.58533984", "0.5842371", "0.58411694", "0.57921...
0.64292884
2
Returns the mean rating of a user in the system
def get_mean_user_rating(self, user_id): return self.mean_user_rating[self.mean_user_rating['user_id'] == user_id]['rating'].item()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calcUserMeanRating(userRatingGroup):\n userID = userRatingGroup[0]\n ratingSum = 0.0\n ratingCnt = len(userRatingGroup[1])\n if ratingCnt == 0:\n return (userID, 0.0)\n for item in userRatingGroup[1]:\n ratingSum += item[1]\n return (userID, 1.0 * ratingSum / ratingCnt)", "def...
[ "0.82472277", "0.801734", "0.7873878", "0.77846575", "0.76099813", "0.7456952", "0.7393916", "0.73425126", "0.7335902", "0.7295863", "0.7246373", "0.71819776", "0.71671426", "0.7141816", "0.7128281", "0.7104116", "0.7082695", "0.7080697", "0.70503473", "0.701879", "0.6857769"...
0.84463215
0
Gets the path for the weights in a named voc checkpoint.
def get_voc_named_weights(self, name): return self.voc_checkpoints/f'{name}_weights.pyt'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_weights(\n self, container_checkpoint_dir: Optional[Path]\n ) -> Union[str, Path]:\n if container_checkpoint_dir is None:\n return self.transformer_weights\n else:\n return container_checkpoint_dir", "def get_checkpoint_path(self, checkpoint_id, name, path='...
[ "0.67990035", "0.63052905", "0.6225679", "0.6137034", "0.61063796", "0.60709625", "0.60388905", "0.6010524", "0.5956268", "0.5920713", "0.59078497", "0.58370197", "0.58223593", "0.5798703", "0.5792663", "0.57351375", "0.570738", "0.5701662", "0.5701662", "0.56997675", "0.5677...
0.7351841
0
Checks for a full game board.
def full_board( self ): for x in self.__grid: if isinstance(x, int): return False else: continue return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_if_board_full(self, board):\n for i in range(self.height // 80):\n for j in range(self.width // 80):\n if board[(j, i)] == 0:\n return False\n elif j == self.width // 80:\n break\n else:\n ...
[ "0.8349527", "0.8337419", "0.8303921", "0.82347894", "0.8140055", "0.80695367", "0.79158777", "0.78205186", "0.77502877", "0.77143675", "0.7708602", "0.7701114", "0.7660379", "0.7658071", "0.75324714", "0.75243133", "0.7473973", "0.7425951", "0.7423709", "0.7407206", "0.74035...
0.75897527
14
Return the home directory path of the user in the chroot.
def get_home_directory(self, user: str) -> str: process = self.run( "/", "root", ["sh", "-c", f"realpath ~{user}"], encoding="utf-8", stdout=subprocess.PIPE, ) return process.stdout.strip()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_homedir():\n return os.path.expanduser(\"~\")", "def user_home_path(self):\n return path.join(env.user_home, self._user_home_path)", "def homedir():\n return os.path.expanduser('~')", "def get_home_directory():\n \n try:\n directory=os.path.expanduser(\"~\")\n except...
[ "0.83787596", "0.8305813", "0.8257459", "0.8224074", "0.8160989", "0.80952364", "0.7945365", "0.7945365", "0.78121924", "0.7777236", "0.77564806", "0.77072144", "0.7701126", "0.7584558", "0.7566488", "0.73054457", "0.72201484", "0.7218265", "0.7103926", "0.7080573", "0.704725...
0.80247945
6
Retrieves a Klauder Wavelet with upper frequency f[0] and lower frequency f[1].
def getKlauder(f,t,T=5.0): assert len(f) == 2, 'Klauder wavelet needs 2 frequencies as input' k = np.diff(f)/T f0 = np.sum(f)/2.0 wav = np.real(np.sin(pi*k*t*(T-t))/(pi*k*t)*np.exp(2*pi*1j*f0*t)) return wav
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lam(freq):\n return C / freq", "def waveparameterh(L):\r\n return 8.13 - ((250 - 0.7 * L) / 125) ** 3", "def leff(self):\n with Vega() as v:\n s = self.reinterp(v.wavelength)\n w = s._wavelength\n if s.transmit.max() > 0:\n leff = np.trapz(w * s....
[ "0.60448766", "0.6024216", "0.6006618", "0.5998668", "0.59011817", "0.58808976", "0.58427286", "0.5823462", "0.580129", "0.5755907", "0.5708062", "0.5707106", "0.56499666", "0.5598787", "0.5591535", "0.55868655", "0.5585423", "0.55619085", "0.55590785", "0.5555055", "0.554693...
0.79801583
0
Serialize ExportRequest to a dictionary representing a json object. No validation is done with the exception that only specification of scope is used (course/partner/group).
def to_json(self): json_request = {} if self._course_id: json_request['scope'] = { 'typeName': 'courseContext', 'definition': { 'courseId': self._course_id }} elif self._partner_id: json_request['scope']...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_to_dict(self):\n export_dict = {\n 'scope': self.range.tolist(),\n 'elements': self.elements.tolist(),\n }\n return export_dict", "def to_dict(self):\n result = {\n 'name': self.__class__.__name__,\n ...
[ "0.59692466", "0.59179884", "0.5809289", "0.5793467", "0.5777059", "0.57082593", "0.55184954", "0.54746026", "0.5458097", "0.5458097", "0.5458097", "0.5458097", "0.54515445", "0.5449529", "0.544306", "0.54316616", "0.5415032", "0.54141694", "0.5394432", "0.538698", "0.5373172...
0.70904386
0
Returns the root of a filename (name without extension)
def root_name(filename: str): basename = os.path.basename(filename) basename_split = os.path.splitext(basename) root = None if len(basename_split) == 2: root = basename_split[0] return root
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rootname(filename):\n name = os.path.basename(filename)\n root, ext = os.path.splitext(name)\n while ext:\n root, ext = os.path.splitext(root)\n return root", "def rootname(filename):\n if os.path.sep not in filename:\n return ''\n else:\n file_root, _ = filename.split(...
[ "0.864368", "0.8607693", "0.7442198", "0.7332982", "0.72435725", "0.709666", "0.7036713", "0.69115233", "0.6868265", "0.68452406", "0.6805027", "0.67998445", "0.67915076", "0.67835075", "0.6750787", "0.6749541", "0.6669933", "0.6665176", "0.66563594", "0.6649126", "0.66215676...
0.8771483
0
Return document label by id.
def get_label_by_id(document_id): document = Documents.query.filter_by(id=document_id).first() if document: return document.label return document
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_label(id):\n return if_found(dao.get_label(id))", "def id_for_label(self, id_):\n return id_", "def id_for_label(self, id_):\n return id_", "def find_label_by_id(self, _id):\n search = True\n i = 0\n while search:\n if i == len(self.labels):\n ...
[ "0.80620354", "0.7742091", "0.7690875", "0.7446805", "0.7171032", "0.6833984", "0.67125785", "0.6632173", "0.6545487", "0.6523698", "0.6523698", "0.6499112", "0.6380238", "0.6272138", "0.6260402", "0.62573975", "0.6253745", "0.6188923", "0.61672693", "0.61496276", "0.61429226...
0.8919097
0
Initialize a gated activation unit
def __init__(self): super().__init__() self.tanh = nn.Tanh() self.sigmoid = nn.Sigmoid()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\r\n self.activation = Activation(u'signup')\r\n self.activated = False", "def __init__(self, units, activation=\"relu\"):\n super(Dense, self).__init__(units=units, activation=activation)\n # momentum parameters:\n self.VW = 0\n self.Vb = 0\n #...
[ "0.7051076", "0.67423743", "0.6640329", "0.65053844", "0.6443662", "0.6207373", "0.6195802", "0.6132576", "0.60869306", "0.6062202", "0.605144", "0.6045885", "0.60187495", "0.6018065", "0.59462076", "0.59401363", "0.5912628", "0.59076756", "0.5901118", "0.5899865", "0.5880700...
0.0
-1
Repeat Dense Keras layers, attached to given input.
def repeat_dense(inputs, n_layers, n_units=256, activation='relu', name_prefix=None): if n_units < 1 or n_layers < 1: raise ValueError('`n_layers` and `n_units` must be >= 1, ' 'found {} and {} respectively'.format(n_layers, n_units)) n_units = int(n_units) n_layers = int(n_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dens_block(input_tensor, units, reps=2):\n x = input_tensor\n\n for _ in range(reps):\n x = layers.Dense(units, kernel_regularizer=reg)(x)\n x = l()(x)\n x = layers.Activation('relu')(x)\n\n x = layers.Dense(units, kernel_regularizer=reg)(x)\n x = l()(x)\n shortcut = layers....
[ "0.6266208", "0.60601896", "0.60188603", "0.60042614", "0.589537", "0.5857047", "0.5821393", "0.57139516", "0.569506", "0.56770664", "0.56673694", "0.5641733", "0.5613176", "0.56016934", "0.5596934", "0.55958855", "0.55355763", "0.54956037", "0.544848", "0.5446652", "0.543469...
0.74587476
0
Check whether the given function is a lambda function.
def is_lambda(fun): return isinstance(fun, type(LAMBDA)) and fun.__name__ == LAMBDA.__name__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def islambda(func):\n return getattr(func, 'func_name', False) == '<lambda>'", "def is_lambda_decorator(tree, fname=None):\n return ((type(tree) is Call and len(tree.args) == 1) and\n (fname is None or is_decorator(tree.func, fname)))", "def is_function(obj):\n return isinstance(obj, (types...
[ "0.8688825", "0.739059", "0.73029375", "0.6994089", "0.666503", "0.6457246", "0.6376025", "0.6266291", "0.62612516", "0.6092646", "0.6011841", "0.5974255", "0.5858317", "0.5856653", "0.5814654", "0.57965565", "0.57244384", "0.57128453", "0.5710501", "0.56891865", "0.5685348",...
0.87615645
0
Return the number of lines seen in the text file.
def result(self) -> int: return self._count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_lines(filename):\r\n with open(filename, 'rb') as f:\r\n return sum(1 for line in f)", "def line_count(file):\n with open(file, \"r\") as f:\n return sum(1 for line in f)", "def count_lines(filename):\n with open(filename, 'rb') as f:\n return sum(1 for line in f)", "d...
[ "0.7935287", "0.7923852", "0.78725255", "0.77402514", "0.76699656", "0.7634338", "0.75988483", "0.7554655", "0.7485646", "0.7471403", "0.74574053", "0.7453339", "0.74422", "0.7439493", "0.74357486", "0.74207866", "0.73845905", "0.736639", "0.736639", "0.7334953", "0.7324921",...
0.0
-1
Constructs and returns an instance from its YAML representation.
def from_yaml(cls, loader, node): instance = cls._yamlMakeInstance() yield instance mapping = loader.construct_mapping(node) instance._yamlSetAttributes(mapping)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_yaml(cls, yml: str):\n\n return cls.from_dict(feast_yaml.yaml_loader(yml, load_single=True))", "def from_yaml(cls, b):\n return cls.from_dict(yaml.safe_load(b))", "def from_yaml(cls, y):\n return cls(yaml.load(y, AttrLoader))", "def _from_yaml(cls, loader: yaml.Loader, node: yam...
[ "0.8121205", "0.81057537", "0.7957707", "0.73725003", "0.73648804", "0.730272", "0.7296206", "0.72818094", "0.72745776", "0.7248181", "0.7193339", "0.71713346", "0.7165141", "0.7155449", "0.705275", "0.7044422", "0.69398403", "0.693621", "0.6875843", "0.68058234", "0.67871237...
0.6865312
19
Returns a dictionary containing the data to include in generating the instance's YAML representation. The base implementation uses the contents of the instance's __dict__ filtered through the list of keys returned from _yamlAttributeKeys excluding any that require special handling (subclasses must override this method ...
def _yamlData(self): data = dict([(key, value) for key, value in self.__dict__.iteritems() if ((key in self._yamlAttributeKeys) and (key not in self._yamlSpeciallyHandledAttributes))]) data.update(self._preservedExtraAttributes) return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize(self) -> dict:\n\n attributes = self.include or inspect(self).attrs.keys()\n return {c: getattr(self, c) for c in attributes}", "def dump(self) -> dict:\n result = {}\n for attribute in self.__dump_attributes__:\n value = getattr(self, attribute)\n ...
[ "0.6867913", "0.68068653", "0.6714643", "0.6669472", "0.6593713", "0.6592392", "0.6503254", "0.65011925", "0.64559406", "0.64527816", "0.6440302", "0.641603", "0.6401027", "0.6385806", "0.6360154", "0.6338355", "0.6338355", "0.6338355", "0.6327981", "0.6319528", "0.62545437",...
0.8488478
0
Returns a list of the keys for the attributes to include in the instance's YAML representation. Must be overridden by subclasses.
def _yamlAttributeKeys(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keys(self):\n return [a.name for a in self.__attrs_attrs__]", "def attributes(self):\n return self.__dict.keys()", "def keys(self):\n return list(s.name.lower() for s in self.attributes)", "def key_attributes(self):\n\n return [level.key for level in self.levels]", "def key_...
[ "0.8000632", "0.7444875", "0.74265057", "0.72997576", "0.7251776", "0.72433424", "0.72162145", "0.7060152", "0.6956365", "0.68847114", "0.6863089", "0.68331367", "0.67842066", "0.6779538", "0.67163414", "0.6684896", "0.6642998", "0.6642996", "0.6642996", "0.6642996", "0.66429...
0.75580204
1
Returns a list of attributes that are specially handled by subclasses. These attributes are skipped by _yamlData and _yamlSetAttributes implemented by YAMLObject. Subclasses must override both _yamlData and _yamlSetAttributes to handle these attributes.
def _yamlSpeciallyHandledAttributes(self): return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attributes(self):\n attr = super(BaseDataRecord, self).attributes()\n return [a for a in attr if a not in self.excluded()]", "def attrs(self):\n return [name for name in self.traits() if self.trait_metadata(name, \"attr\")]", "def attrs(self):\n return [name for name in self.tra...
[ "0.7351028", "0.7213582", "0.7213582", "0.7195601", "0.71796477", "0.71068895", "0.70945764", "0.7067637", "0.70405364", "0.6982657", "0.6954899", "0.6935282", "0.688557", "0.6850288", "0.67603517", "0.6740086", "0.6706949", "0.66392326", "0.66371906", "0.65881896", "0.657675...
0.7307711
1
Returns path for userspecific data files
def platform_data_dir(): if POSIX: # nocover dpath_ = os.environ.get('XDG_DATA_HOME', '~/.local/share') elif DARWIN: # nocover dpath_ = '~/Library/Application Support' elif WIN32: # nocover dpath_ = os.environ.get('APPDATA', '~/AppData/Roaming') else: # nocover raise...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_data_path():\n current_directory = os.path.dirname(os.path.realpath(__file__))\n return os.path.join(current_directory, 'emergency_fund_info.json')", "def get_data_path():\n return os.getcwd() + \"/data/\"", "def getDataPath():\n\treturn \"..\" + os.sep + \"data\" + os.sep", "def get_da...
[ "0.7897936", "0.77993596", "0.7736789", "0.7501407", "0.7444343", "0.7397782", "0.7361509", "0.72866106", "0.727496", "0.726646", "0.72662514", "0.7243732", "0.72170913", "0.71930635", "0.7166304", "0.712532", "0.7114455", "0.7094755", "0.70784116", "0.70483005", "0.7035719",...
0.0
-1
this function compute the complex pTintegrated Vn vector in different pT ranges for a single event it returns a 2d matrix vn_arrays[pT_idx, n_order_idx]
def calculate_vn_arrays_for_rn_ratios(data): pT_boundaries = [0.3, 0.5, 0.75, 1.0, 1.5, 2.0, 2.5, 3.0] npT = 50 vn_arrays = [] for ipT in range(len(pT_boundaries)-1): pT_low = pT_boundaries[ipT] pT_high = pT_boundaries[ipT + 1] pT_mid = (pT_low + pT_high)/2. vn_array = ca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calcualte_inte_vn(pT_low, pT_high, data):\n npT = 50\n pT_inte_array = linspace(pT_low, pT_high, npT)\n dpT = pT_inte_array[1] - pT_inte_array[0]\n dN_event = data[:, 2]\n pT_event = data[:, 0]\n dN_interp = exp(interp(pT_inte_array, pT_event, log(dN_event+1e-30)))\n N_event = data[:, -1]\...
[ "0.64492863", "0.6277097", "0.60637414", "0.595706", "0.5917281", "0.5865409", "0.5796517", "0.5730077", "0.57103425", "0.5682613", "0.5650394", "0.561678", "0.56054395", "0.55914265", "0.55682063", "0.5557867", "0.55444175", "0.55256265", "0.546201", "0.5448704", "0.54147524...
0.59030336
5
Compute the dot product of two or more arrays in a single function call
def multi_dot(arrays, out=None): n = len(arrays) if n < 2: checker_throw_value_error("multi_dot", "arrays", n, ">1") result = arrays[0] for id in range(1, n): result = dpnp.dot(result, arrays[id]) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dot_product(a, b):\n if len(a) != len(b):\n raise ValueError('Arrays are of different lengths')\n else:\n return [a[i] * b[i] for i in range(len(a))]", "def dotproduct(x, y):\n return sum(imap(operator.mul, x, y))", "def dotProduct(v1, v2):\n return sum((a * b) for a, b in zip(v1,...
[ "0.81757337", "0.81494147", "0.8068749", "0.8021455", "0.7997094", "0.79926455", "0.7939907", "0.7863811", "0.78179616", "0.77984726", "0.7772214", "0.77302325", "0.7720498", "0.7701872", "0.7689601", "0.76845556", "0.7672314", "0.7665692", "0.7654616", "0.76497173", "0.76279...
0.7363222
29
Computes the average precision at k. This function computes the average precision at k between two lists of items.
def apk(actual, predicted, k=10): if len(predicted) > k: predicted = predicted[:k] score = 0.0 num_hits = 0.0 for i, p in enumerate(predicted): if p in actual and p not in predicted[:i]: num_hits += 1.0 score += num_hits / (i + 1.0) return score / min(len(ac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision_at_k(r, k):\n assert k >= 1\n r = np.asarray(r)[:k] != 0\n if r.size != k:\n raise ValueError('Relevance score length < k')\n return np.mean(r)", "def precision_at_k(r, k):\n assert k >= 1\n r = np.asarray(r)[:k] != 0\n if r.size != k:\n raise ValueError('Relevance sco...
[ "0.73646754", "0.7319478", "0.72992903", "0.71759653", "0.7120172", "0.70458513", "0.7006908", "0.6992203", "0.68572795", "0.68230826", "0.67975354", "0.6755938", "0.6752867", "0.67493105", "0.67382723", "0.6704255", "0.6704255", "0.6685224", "0.6676598", "0.65841764", "0.655...
0.5859851
49
String for representing the Model object.
def __str__(self): return self.name
{ "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.82368803", "0.79901737", "0.7849152", "0.78468513", "0.77520275", "0.7625378", "0.7625378", "0.76225406", "0.76225406", "0.75483394", "0.7522958", "0.7470355", "0.7469358", "0.7447144", "0.7447144", "0.74314755", "0.7427648", "0.7389925", "0.7351721", "0.73424315", "0.7322...
0.0
-1
String for representing the Model object.
def __str__(self): return self.name
{ "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.82368803", "0.79901737", "0.7849152", "0.78468513", "0.77520275", "0.7625378", "0.7625378", "0.76225406", "0.76225406", "0.75483394", "0.7522958", "0.7470355", "0.7469358", "0.7447144", "0.7447144", "0.74314755", "0.7427648", "0.7389925", "0.7351721", "0.73424315", "0.7322...
0.0
-1
String for representing the Model object.
def __str__(self): return self.name
{ "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.82368803", "0.79901737", "0.7849152", "0.78468513", "0.77520275", "0.7625378", "0.7625378", "0.76225406", "0.76225406", "0.75483394", "0.7522958", "0.7470355", "0.7469358", "0.7447144", "0.7447144", "0.74314755", "0.7427648", "0.7389925", "0.7351721", "0.73424315", "0.7322...
0.0
-1
Get an nested attribute.
def get_attr(obj: Any, key: str): if key.strip() == "": return obj for k in key.split("."): obj = getattr(obj, k) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_attr(self, attr, root=None):\n with self._h5file('r') as h5file:\n if root is None:\n obj = h5file\n else:\n obj = h5file[root]\n return get_decoded(obj.attrs, attr)[attr]", "def getattr_recursive(self, name):\n all_attributes ...
[ "0.7030776", "0.6933625", "0.6828036", "0.67945", "0.67658204", "0.6681525", "0.66770464", "0.6652248", "0.6608671", "0.65935177", "0.6582616", "0.65518194", "0.6547425", "0.6535638", "0.6530787", "0.65307176", "0.6516263", "0.65066516", "0.6504183", "0.647846", "0.64751816",...
0.0
-1
This is the path to the executable directory.
def dirpath(self): return self.__edir
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path_to_program_dir(self):\n\tpath = sys.argv[0]\n\n\tif not os.path.isdir(path):\n\t path = os.path.dirname(path)\n\n\tif not path: return '.'\n\n\treturn path", "def program_dir():\n if (Win32() and (hasattr(sys, 'frozen') or imp.is_frozen('__main__'))):\n # running from exe generated by py2ex...
[ "0.83109444", "0.81672883", "0.8083278", "0.79109555", "0.7737846", "0.7692721", "0.76566124", "0.7558099", "0.74880594", "0.7458387", "0.7458387", "0.73453194", "0.73110276", "0.73000944", "0.7286211", "0.7283623", "0.7278029", "0.7240752", "0.72160405", "0.7210152", "0.7200...
0.0
-1
Serves the root index file.
def root(): return send_from_directory('../web/dist', 'index.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_all_files(self, root_dir):\n pass", "def index(self):\n single = os.path.join(\n os.path.dirname(os.path.abspath(__file__)),\n 'index.html')\n return serve_file(single)", "def get_index(self):\n self.client.get('/')", "def write_root_index(self):\n ...
[ "0.72711134", "0.713743", "0.71296984", "0.69983894", "0.6914828", "0.68688494", "0.67612106", "0.67612106", "0.67612106", "0.67481536", "0.67481536", "0.6735952", "0.67345035", "0.6732292", "0.6730316", "0.67095524", "0.6704698", "0.67005026", "0.67005026", "0.6697546", "0.6...
0.6347456
85
Returns dictionary of known tokens with all values
def extract_tokens(l,known_tokens): assert l[0].strip()=="(" and l[-1].strip()==")",ValueError(l) result = {} result.update(known_tokens) i = 0 l_len = len(l) while i<l_len: if l[i] in result: token = l[i] i += 1 # Consume token if i<l_len: if l[i] in result: # non-va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def token_values(self):\n return self._token_values", "def get_read_tokens_dict(mastertoken, config):\n token_list = {}\n tokens = get_read_tokens(mastertoken, config)\n\n for token in tokens:\n if token['name']:\n token_list[token['name']] = token['value']\n if confi...
[ "0.69266176", "0.68743247", "0.6648705", "0.6615865", "0.6611663", "0.65464634", "0.65117127", "0.6508066", "0.6423685", "0.6423685", "0.6423685", "0.64221096", "0.6416195", "0.63738215", "0.6339416", "0.62961584", "0.6284463", "0.6282448", "0.62810796", "0.6213458", "0.62120...
0.6356009
14