query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Update numeric display next to the steps slider
def update_steps_display(self): self.steps_display["text"] = str(self.steps.get())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render(self):\n step = 1\n while step < self.number_steps and self.update():\n step += 1", "def _update_moved(self):\n self._RAS_textbox.setPlainText('{:.2f}, {:.2f}, {:.2f}'.format(\n *self._ras))\n self._VOX_textbox.setPlainText('{:3d}, {:3d}, {:3d}'.format...
[ "0.66743606", "0.6626409", "0.66102076", "0.6515737", "0.6476403", "0.64489394", "0.64451456", "0.63932395", "0.6381926", "0.6372158", "0.63198364", "0.62249696", "0.62058264", "0.61915565", "0.6180695", "0.6122212", "0.6116389", "0.61021405", "0.60663074", "0.60516673", "0.6...
0.7663334
0
Recompute output text from given input, steps, reverse flag
def recompute_output_text(self): s = self.input_string.get() senc = rotcode.rotate(s,steps=self.steps.get()) if self.reverse_flag.get(): # Reverse the encoded text senc = senc[::-1] self.output_string.set(senc)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_lf(input: str, output_1: str, output_2: str = None):\n\n commands = {'predicates': ['jump', 'run', 'look', 'turn', 'walk'],\n 'directions': ['right', 'left'],\n 'manners': ['around', 'opposite'],\n 'connectives': ['and', 'after'],\n 'rep...
[ "0.55496913", "0.545185", "0.53822345", "0.5354698", "0.5353447", "0.53152114", "0.5261441", "0.5248678", "0.52150947", "0.5196478", "0.5194642", "0.517498", "0.51497334", "0.5141352", "0.51077133", "0.5106624", "0.50867814", "0.5078254", "0.50731355", "0.50665945", "0.504808...
0.7016214
0
test automol.pot.scale test automol.pot.truncate
def test__transform_potential(): # Test scaling ref_pot_scaled = {(0.0,): 0.0, (0.52359878,): 0.9625, (1.04719755,): 2.0250, (1.57079633,): 1.1250, (2.0943951,): 0.0125, (2.61799388,): 0.7625, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_scale(app):\n\n assert False", "def test_fltruncate(doctest):", "def test_truncates_to_correct_size(self):\n truncated = truncateFeedback(self.simpleTestString)\n self.assertTrue(len(truncated) < 16000)\n truncated = truncateFeedback(self.complicatedString)\n self.assert...
[ "0.628716", "0.61302304", "0.61120254", "0.60404897", "0.6016312", "0.5859699", "0.58324665", "0.5822803", "0.57707256", "0.56191003", "0.5570279", "0.54269767", "0.5422839", "0.54122514", "0.5407196", "0.5385296", "0.538417", "0.5360554", "0.5357873", "0.5356955", "0.5347388...
0.69110906
0
test automol.pot.is_nonempty test automol.pot.remove_empty_terms
def test__empty_terms_in_potential(): assert automol.pot.is_nonempty(POT1) assert not automol.pot.is_nonempty(POT4) ref_filt_pot = { (0.00000000,): 0.00, (1.04719755,): 3.58, (2.09439510,): 0.01, (2.61799388,): 1.75, (3.14159265,): 3.59, (3.66519143,): 1.69, (4.18879020,): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_drop_empty_tokens():\n assert TextCleaner().transform([[[\",;\", \"hi\"]]])[\"corpus\"][0] == [\"hi\"]", "def filter_empty(word_list):\n new_list = []\n for x in word_list:\n if(x):\n new_list.append(x)\n return new_list", "def _test_empty(t):\n return t.is_empty()", ...
[ "0.63404757", "0.5988395", "0.58825773", "0.58777523", "0.58777523", "0.5839472", "0.57559234", "0.57364994", "0.5718661", "0.566934", "0.56597316", "0.5659018", "0.5597607", "0.5574163", "0.5573768", "0.55535173", "0.55426997", "0.55241096", "0.55177104", "0.5457747", "0.544...
0.7711217
0
test pot.low_repulsion_struct test pot.intramol_interaction_potential_sum
def test__intmol(): assert automol.pot.low_repulsion_struct( PROP_GEO1, PROP_GEO2, thresh=40.0, potential='exp6') assert automol.pot.low_repulsion_struct( PROP_GEO1, PROP_GEO2, thresh=40.0, potential='lj_12_6')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_positive_electrode_potential_profile(self):\n\n # TODO: add these when have averages", "def test_get_damage(self):\n self.veh.health = 2.2\n for op in self.veh.operators:\n op.health = 0.5\n self.veh.get_damage(0.5)\n self.assertEqual(self.veh.health, 1.9)\n...
[ "0.59519386", "0.5829538", "0.5827172", "0.5813004", "0.5792655", "0.57918406", "0.5693443", "0.56725687", "0.56448", "0.56394345", "0.55754596", "0.55304575", "0.55190116", "0.5504824", "0.54837334", "0.5465801", "0.5416366", "0.54028714", "0.53973913", "0.5393444", "0.53878...
0.716907
0
List all registered webhooks
def list_webhooks(self): response = requests.get( '%spreferences/notifications' % self._url, **self._auth ) if response.status_code == 401: raise MoipAuthorizationException(response.json()) else: pretty_print(response.json()) r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def webhooks(self) -> json:\r\n try:\r\n return self.api(method=\"GET\", endpoint=f\"all/webhooks.json\").json()\r\n except Exception as e:\r\n raise e", "def get_webhooks():\n response = requests.get(f'{KAZOO_SERVER}:8000/v2/webhooks', headers=HEADERS)\n\n return respon...
[ "0.77598524", "0.7740946", "0.74069196", "0.7401097", "0.7245128", "0.69214565", "0.658913", "0.6355134", "0.60457546", "0.60093135", "0.59982985", "0.58501834", "0.58471", "0.5829704", "0.58189565", "0.57290506", "0.57161087", "0.5711402", "0.5692388", "0.5687633", "0.568699...
0.7822811
0
Is the specified flag value set in the named field
def scapy_packet_Packet_hasflag(self, field_name, value): field, val = self.getfield_and_val(field_name) if isinstance(field, EnumField): if val not in field.i2s: return False return field.i2s[val] == value else: return (1 << field.names.index([value])) & self.__getattr__(field_name) != 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isSet(self) -> bool:\n ...", "def isset(flag, bit):\n return (flag & (1 << bit)) != 0", "def __contains__(self, fieldname):\r\n return fieldname in self._by_name", "def flag_set(self, flag):\n if self.flags & flag != 0:\n return True\n else:\n retu...
[ "0.66490847", "0.66310626", "0.65593815", "0.65549105", "0.64554703", "0.64065385", "0.6394484", "0.62965024", "0.6294043", "0.62912136", "0.62753475", "0.62619025", "0.6226627", "0.6203985", "0.6180789", "0.6164268", "0.6163804", "0.6150065", "0.61461496", "0.61461496", "0.6...
0.7172924
0
Ignore any unparsed conditionally present fields If all fields have been parsed, the payload length should have decreased RadioTap_len bytes If it has not, there are unparsed fields which should be treated as padding
def scapy_layers_dot11_RadioTap_extract_padding(self, s): padding = len(s) - (self.pre_dissect_len - self.RadioTap_len) if padding: return s[padding:], s[:padding] else: return s, None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_payload(self):\n while len(self.buffer) >= 10:\n \"\"\" check magic word \"\"\"\n if self.buffer[0:2] != self.mw:\n #LogDebug(\"drop all buffer due to incorrect magic word\")\n self.buffer = b\"\" # drop entire buffer\n\n \"\"\" extrac...
[ "0.5758904", "0.5714169", "0.5561634", "0.5545129", "0.5527998", "0.545058", "0.54219514", "0.5382851", "0.5330748", "0.5286648", "0.52165085", "0.5182126", "0.51425725", "0.5123392", "0.50582284", "0.5032795", "0.5027796", "0.49997252", "0.4987452", "0.4986482", "0.49796093"...
0.61330944
0
An iterator of Dot11Elt
def scapy_layers_dot11_Dot11_elts(self): dot11elt = self.getlayer(Dot11Elt) while dot11elt and dot11elt.haslayer(Dot11Elt): yield dot11elt dot11elt = dot11elt.payload
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n #it = super(DotList, self).__iter__()\n #it_next = getattr(it, 'next')\n #setattr(it, 'next', lambda: it_next(it))\n #return it\n for val in super(DotList, self).__iter__():\n val, converted = self._convert(val)\n yield val", "def __i...
[ "0.7072858", "0.68785644", "0.6803899", "0.66386545", "0.6604238", "0.6588813", "0.6588813", "0.6588813", "0.6588813", "0.6520716", "0.64845335", "0.64845335", "0.64555174", "0.6374868", "0.63678914", "0.6353142", "0.6329093", "0.6308754", "0.6294408", "0.6292211", "0.6280752...
0.71375513
0
Return the payload of the SSID Dot11Elt if it exists
def scapy_layers_dot11_Dot11_essid(self): elt = self.find_elt_by_id(0) return elt.info if elt else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scapy_layers_dot11_Dot11_channel(self):\n\telt = self.find_elt_by_id(3)\n\tif elt:\n\t\ttry:\n\t\t\treturn int(ord(elt.info))\n\t\texcept Exception, e:\n\t\t\tPrinter.error('Bad Dot11Elt channel got[{0:s}]'.format(elt.info))\n\t\t\tPrinter.exception(e)\n\treturn None", "def scapy_layers_dot11_Dot11_rsn(self)...
[ "0.59182674", "0.57995284", "0.5514172", "0.54966897", "0.5430576", "0.537802", "0.5233905", "0.5164239", "0.51609045", "0.51131594", "0.50782114", "0.5061551", "0.5024059", "0.48869783", "0.4856761", "0.48329434", "0.4824721", "0.48163962", "0.47966594", "0.47715434", "0.470...
0.7235877
0
Return the payload of the rates Dot11Elt if it exists
def scapy_layers_dot11_Dot11_rates(self, id=1): elt = self.find_elt_by_id(id) if elt: try: return Dot11EltRates(str(elt)).rates except Exception, e: Printer.error('Bad Dot11EltRates got[{0:s}]'.format(elt.info)) Printer.exception(e) return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scapy_layers_dot11_Dot11_extended_rates(self):\n\treturn scapy.layers.dot11.Dot11.rates(self, 50)", "def scapy_layers_dot11_Dot11_rsn(self):\n\telt = self.find_elt_by_id(48)\n\tif elt:\n\t\ttry:\n\t\t\treturn Dot11EltRSN(str(elt))\n\t\texcept Exception, e:\n\t\t\tPrinter.error('Bad Dot11EltRSN got[{0:s}]'.fo...
[ "0.6049632", "0.56936306", "0.55454546", "0.54558164", "0.5343874", "0.5139327", "0.5034578", "0.5033297", "0.50103927", "0.49922195", "0.49817798", "0.49752674", "0.49476495", "0.4910628", "0.49040276", "0.48814178", "0.48367184", "0.479828", "0.47883132", "0.47692147", "0.4...
0.61063814
0
Return the payload of the extended rates Dot11Elt if it exists
def scapy_layers_dot11_Dot11_extended_rates(self): return scapy.layers.dot11.Dot11.rates(self, 50)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scapy_layers_dot11_Dot11_rsn(self):\n\telt = self.find_elt_by_id(48)\n\tif elt:\n\t\ttry:\n\t\t\treturn Dot11EltRSN(str(elt))\n\t\texcept Exception, e:\n\t\t\tPrinter.error('Bad Dot11EltRSN got[{0:s}]'.format(elt.info))\n\t\t\tPrinter.exception(e)\n\treturn None", "def scapy_layers_dot11_Dot11_rates(self, id...
[ "0.59015256", "0.5886497", "0.5597564", "0.5459946", "0.5415052", "0.52650505", "0.52193874", "0.521355", "0.48723102", "0.4851953", "0.48475108", "0.4799606", "0.4751168", "0.47170013", "0.47159463", "0.4710192", "0.4705433", "0.46916574", "0.46782368", "0.46744698", "0.4654...
0.65866774
0
Return the bssid for a station associated with the packet
def scapy_layers_dot11_Dot11_sta_bssid(self): if self.haslayer(Dot11ProbeReq) or self.hasflag('FCfield', 'to-DS'): return self.addr2 else: return self.addr1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scapy_layers_dot11_Dot11_ap_bssid(self):\n\tif self.haslayer(Dot11ProbeReq) or self.hasflag('FCfield', 'to-DS'):\n\t\treturn self.addr1\n\telse:\n\t\treturn self.addr2", "def get_mac(self) -> str:\n self.sendline(\"iw {} info\".format(self.iface_dut))\n # We are looking for MAC definition of ST...
[ "0.6688804", "0.61454266", "0.55835766", "0.55603284", "0.54360455", "0.539569", "0.53219247", "0.5315912", "0.52887183", "0.5276628", "0.52339447", "0.5182452", "0.5108018", "0.5100057", "0.5097165", "0.50842947", "0.50817996", "0.5074957", "0.50737345", "0.5055487", "0.5042...
0.6826852
0
Return the bssid for a access point associated with the packet
def scapy_layers_dot11_Dot11_ap_bssid(self): if self.haslayer(Dot11ProbeReq) or self.hasflag('FCfield', 'to-DS'): return self.addr1 else: return self.addr2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scapy_layers_dot11_Dot11_sta_bssid(self):\n\tif self.haslayer(Dot11ProbeReq) or self.hasflag('FCfield', 'to-DS'):\n\t\treturn self.addr2\n\telse:\n\t\treturn self.addr1", "def _ParseScanAccessPoint(self, bssid, active, output):\n logging.debug('BSSID %s data: %s', bssid, output)\n ap = AccessPoint()\n ...
[ "0.66561997", "0.5751736", "0.55849266", "0.5567842", "0.53363216", "0.5283974", "0.52727413", "0.5197677", "0.50932574", "0.5053118", "0.5039937", "0.49793264", "0.4975569", "0.49664629", "0.4964176", "0.49487025", "0.49456146", "0.49188927", "0.48956266", "0.4873034", "0.48...
0.7097048
0
Return the payload of the channel Dot11Elt if it exists
def scapy_layers_dot11_Dot11_channel(self): elt = self.find_elt_by_id(3) if elt: try: return int(ord(elt.info)) except Exception, e: Printer.error('Bad Dot11Elt channel got[{0:s}]'.format(elt.info)) Printer.exception(e) return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_payload(self, method, **params):\n try:\n payload = params['data']['payload']\n if self.prettyprint:\n payload = \"\\n\" + json.dumps(json.loads(payload),\n indent=self.indent)\n except KeyError:\n pay...
[ "0.56063277", "0.55746084", "0.5516486", "0.5355748", "0.53529704", "0.5318996", "0.5305361", "0.5296454", "0.52660185", "0.525842", "0.5254692", "0.5223337", "0.5222636", "0.521037", "0.51997375", "0.5199443", "0.5199309", "0.5196995", "0.51823986", "0.5137331", "0.50672734"...
0.60443616
0
Return the payload of the RSN Dot11Elt as a Dot11EltRSN
def scapy_layers_dot11_Dot11_rsn(self): elt = self.find_elt_by_id(48) if elt: try: return Dot11EltRSN(str(elt)) except Exception, e: Printer.error('Bad Dot11EltRSN got[{0:s}]'.format(elt.info)) Printer.exception(e) return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scapy_layers_dot11_Dot11_essid(self):\n\telt = self.find_elt_by_id(0)\n\treturn elt.info if elt else None", "def radrad(rxn_class):\n return rxn_class[2]", "def scapy_layers_dot11_Dot11_channel(self):\n\telt = self.find_elt_by_id(3)\n\tif elt:\n\t\ttry:\n\t\t\treturn int(ord(elt.info))\n\t\texcept Excep...
[ "0.53411746", "0.53235483", "0.5224338", "0.5132557", "0.50328666", "0.5013562", "0.5005922", "0.49886772", "0.48984975", "0.48978934", "0.48872203", "0.48789933", "0.48356414", "0.47863543", "0.4749115", "0.46559978", "0.46264306", "0.46089596", "0.45820284", "0.45652077", "...
0.76497084
0
The script and recent_reviews div should not be in pages other than /
def test_scripts_inside_content_block(self): c = Client() resp = c.get('/books/') self.assertNotIn(b'<div id="recent_reviews"></div>', resp.content) self.assertNotIn(b'<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>', resp....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_reviews(rest_link):\n\tfilename = rest_link.split('/')[-1]\n\n\tcontents = None\n\n\tif contents is None:\n\t\tstart = time()\n\t\tdriver = init_chromedriver()\n\t\tdriver.get(rest_link + '/reviews')\n\n\t\t# print('There are {} reviews'.format(self.review_count))\n\n\t\t# click on the button 'All reviews'...
[ "0.5464051", "0.5293618", "0.5263059", "0.52595705", "0.51436615", "0.5098476", "0.5049983", "0.50164896", "0.4982949", "0.4955135", "0.49080214", "0.48954827", "0.48952228", "0.48645595", "0.4863734", "0.4846348", "0.48214057", "0.47539172", "0.47491297", "0.4722077", "0.469...
0.63994175
0
Generate multiples and submultiples for SI mass units ``kg_unit`` must be defined, with name ``kilogram`` and symbol ``kg``
def si_mass_units(kg_unit): if ( kg_unit.scale.name != 'kilogram' and kg_unit.scale.symbol != 'kg' ): raise RuntimeError( "conventional name required, got {0.name} and{0.symbol}".format( kg_unit.scale ) ) register =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ug(micrograms):\n return Unit(micrograms,\"microgram\")", "def convert_mass(self, event):\n try:\n #Compare other unit to one unit(kilograms)\n current_value, current_unit = float(\"0\" + str(self.v.get())), self.dropdown.get()\n unit_comp = {\"Earth masses\": 5.972...
[ "0.6103328", "0.55920964", "0.5580761", "0.55796033", "0.54702944", "0.54552805", "0.53426504", "0.5303828", "0.5280096", "0.527506", "0.51260483", "0.5101993", "0.5077254", "0.49855217", "0.4979591", "0.49414262", "0.49162444", "0.48854282", "0.48811856", "0.48731062", "0.48...
0.7980442
0
Return a table with n points for L <= x <= R.
def table(self, L, R, n=10): s = "" for x in np.linspace(L, R, n): y = self(x) s += f"({x:.2f}, {y:.2f})\n" return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def table(self, L, R, n):\n s =''\n import numpy as np\n for x in np.linspace(L, R, n):\n y = self(x)\n s += '%12g %12g\\n' % (x, y)\n return s", "def table(self, L, R, n):\n s = \"\"\n import numpy as np\n for x in np.linspace(L, R, n):\n ...
[ "0.67438424", "0.66597396", "0.6583996", "0.58916706", "0.5767555", "0.5591495", "0.55757004", "0.5530176", "0.55254424", "0.550175", "0.5420978", "0.54207957", "0.5419914", "0.5413035", "0.5402804", "0.5400571", "0.539307", "0.538115", "0.53599143", "0.5330984", "0.53086424"...
0.6785874
0
Gets family and nodename for a loopback address.
def _localhost(): s = socket infos = s.getaddrinfo( None, 0, s.AF_UNSPEC, s.SOCK_STREAM, 0, s.AI_ADDRCONFIG ) (family, _, _, _, address) = infos[0] nodename = address[0] return (family, nodename)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def address_family(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"address_family\")", "def get_fqdn_ip():\n hn = 'localhost'\n try:\n hn = socket.getfqdn()\n except Exception:\n pass\n\n return hn, socket.gethostbyname(hn)", "def lan_address(self):\n _, port = ...
[ "0.65299064", "0.642337", "0.62909234", "0.62878233", "0.62209463", "0.61997175", "0.6181633", "0.6117473", "0.60401535", "0.5997337", "0.59566", "0.58147323", "0.5790853", "0.57890886", "0.5737602", "0.5692669", "0.56794184", "0.56704295", "0.5654292", "0.5650246", "0.564333...
0.6480385
1
Creates a `WSGIServer` subclass that works on IPv6only machines.
def _make_ipv6_compatible_wsgi_server(): address_family = _localhost()[0] attrs = {"address_family": address_family} bases = (simple_server.WSGIServer, object) # `object` needed for py2 return type("_Ipv6CompatibleWsgiServer", bases, attrs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def server(port, wsgi_app):\n try:\n httpd = wsgiref.simple_server.make_server(self._host, port, wsgi_app)\n except socket.error:\n # Try IPv6\n httpd = wsgiref.simple_server.make_server(\n self._host, port, wsgi_app, server_class=WsgiServerIpv6)\n start...
[ "0.64724845", "0.63392466", "0.6143431", "0.58700484", "0.5513902", "0.53968626", "0.5241401", "0.5182265", "0.50068", "0.49932447", "0.4983454", "0.49615303", "0.49504307", "0.49427244", "0.49270323", "0.4926663", "0.4906438", "0.49058476", "0.49000055", "0.48926827", "0.488...
0.87002546
0
tabulate neff for the set of nsigma maglim, integrating n(m)completeness(m)
def tabulate_neff(nofm, maglims, min_int_mag=None, max_int_mag=None, ninterp=_DEFAULT_NINTERP, nint=_DEFAULT_NINT): from .completeness import Completeness maglims=numpy.array(maglims, ndmin=1, dtype='f8') if min_int_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(n = 150000, quiet = False):\n t0 = time() #timing possibility\n\n if quiet:\n output_stream = StringIO()\n else:\n output_stream = sys.stdout\n\n\n print(t0,file=output_stream)\n \n\n sfr = .01\n # star mass function\n kroupa = np.vectorize(functions.kroupa)\n...
[ "0.56557244", "0.5613199", "0.55118966", "0.54916126", "0.54809016", "0.54578453", "0.5439868", "0.54248464", "0.54236376", "0.5419726", "0.5400328", "0.53806776", "0.5375143", "0.53693914", "0.53661466", "0.53588134", "0.5332693", "0.5332548", "0.5316006", "0.53090787", "0.5...
0.658275
0
Tests extract features function
def test__extract_features(self): text_sample = "I really really love this movie" feature_sample = ['really','love','good'] feature_score_type = "presence" model_sample = Model(feature_sample,feature_score_type) result_features = model_sample.extract_features(text_sample) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_features(self):\n self.extract_features_static()\n self.extract_features_dynamic()", "def extractFeatures(self, datum):\n abstract", "def parse_features(self, skip=...):\n ...", "def parse_features(self, skip=...):\n ...", "def run_feature_extraction_tests():\...
[ "0.75710934", "0.7458195", "0.7271205", "0.7271205", "0.7229665", "0.7179762", "0.71079266", "0.7095855", "0.70533335", "0.7007457", "0.6979936", "0.6979936", "0.6877849", "0.6830908", "0.68102217", "0.68021005", "0.67849606", "0.6719933", "0.66889083", "0.6650494", "0.662407...
0.7814448
0
Tests the function build feature base
def test_build_feature_base(self): data = pd.DataFrame(pd.read_csv("tests/in_data/pro1_sub.csv")) X = data.ix[:,1] Y = data.ix[:,0] model_sample = Model([],"presence") feature_base = model_sample.build_feature_base(X,Y) feature_evaluation = assert_equal(len(feat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_quick_build(self):\n pass", "def test_quick_build1(self):\n pass", "def testing_featurizer_build():\n f = ImageFeaturizer()\n compare_featurizer_class(f, (0, 0), np.zeros((1)), 0, '', False, '', {}, 1)", "def feature():\n pass", "def buildFeature(self, action):\n retu...
[ "0.70990074", "0.6807914", "0.6754384", "0.6503756", "0.64401925", "0.64291525", "0.6279466", "0.6276012", "0.61892056", "0.6169643", "0.61558723", "0.61558723", "0.61558723", "0.61558723", "0.61558723", "0.61267376", "0.6122545", "0.603081", "0.6001345", "0.6001345", "0.5985...
0.72161376
0
Merges QC Data at resolutions other than HH (DD, WW, MM, YY)
def merge_qcdata_res(qcdata, output, res): ts_label = TIMESTAMP_DTYPE_BY_RESOLUTION[res][-1][0] if not numpy.all(qcdata[ts_label] == output[ts_label]): raise ONEFluxError("Timestamps differ for QAData merging ({r})".format(r=res)) var_add = [i for i in list(qcdata.dtype.descr) if (('TIMESTAMP' not...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aggregate_qcdata(qcdata):\n\n # DD\n log.debug('Aggregating daily DD QC Data')\n curr_ts, last_ts = datetime.strptime(qcdata['TIMESTAMP_START'][0], '%Y%m%d%H%M'), datetime.strptime(qcdata['TIMESTAMP_START'][-1], '%Y%m%d%H%M')\n curr_y, first_y, last_y = curr_ts.year, curr_ts.year, last_ts.year\n ...
[ "0.6156126", "0.58203137", "0.57482314", "0.55775374", "0.55311126", "0.5448704", "0.52939075", "0.52104324", "0.51980734", "0.51493365", "0.51245236", "0.5095829", "0.50803155", "0.5067214", "0.506001", "0.505244", "0.5029764", "0.5026783", "0.49972567", "0.4959744", "0.4958...
0.5936494
1
Create DD, WW, MM, and YY aggregations for QC Data from HH
def aggregate_qcdata(qcdata): # DD log.debug('Aggregating daily DD QC Data') curr_ts, last_ts = datetime.strptime(qcdata['TIMESTAMP_START'][0], '%Y%m%d%H%M'), datetime.strptime(qcdata['TIMESTAMP_START'][-1], '%Y%m%d%H%M') curr_y, first_y, last_y = curr_ts.year, curr_ts.year, last_ts.year entries_dd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_aggregate(self):\n\n #10 Minute sampleing\n result = export.processExport(houseId=1,\n aggregate=\"10Min\")\n\n self.assertEqual(result.shape, (1440, 2))\n #And the second sample should be 10 minutes in\n self.assertEqual(result.index...
[ "0.57438546", "0.5509426", "0.53329486", "0.5328154", "0.5287484", "0.52342576", "0.52246255", "0.5203673", "0.5202492", "0.51359963", "0.5117627", "0.5115736", "0.5109917", "0.5095647", "0.5057524", "0.5043697", "0.50283754", "0.5024874", "0.5005127", "0.49985284", "0.499759...
0.67333305
0
Generate stats and zip file for file list
def gen_stats_zip(filename_list, zipfilename, tier='tier2', csv_processor='ICOS-ETC', zip_processor='LBL_AMP', ts_format="%Y-%m-%d %H:%M:%S"): log.info("Generating ZIP and stats for: {z}".format(z=zipfilename)) if not filename_list: return [], [] today = datetime.now().strftime(ts_format) outp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_zip_file(self):\n # need the following:\n # 1. readme\n # 2. cleaned features file\n # 3. gene map\n # 4. clean response file\n # 5. run.yml\n # 6. combined viz scores files\n # 7. all top_genes_per_phenotype* files\n # 8. network metadata\...
[ "0.64026874", "0.6400921", "0.63619936", "0.63527894", "0.6333742", "0.61578065", "0.6113968", "0.6105778", "0.5977443", "0.59759825", "0.5966402", "0.5930453", "0.5922933", "0.5911249", "0.5904917", "0.5897221", "0.58823717", "0.5827255", "0.5818379", "0.5807002", "0.5805618...
0.74140304
0
Creates a consecutive date list starting at start_day for period days.
def create_date_list( periods: int, start_date: str = "2020-09-01", freq: str = "d" ) -> list: return [str(d)[:10] for d in pd.date_range(start_date, periods=periods, freq=freq)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_date_list(start_date = start_date, end_date = end_date):", "def date_range(start_date, end_date):\n list_dates = []\n for n in range((end_date + timedelta(1) - start_date).days):\n temp_date = start_date + timedelta(n)\n list_dates.append(temp_date.strftime('%Y%m%d'))\n return list_dates", ...
[ "0.7265906", "0.69491833", "0.69491833", "0.693092", "0.68951315", "0.6861502", "0.68613756", "0.68303305", "0.6753256", "0.6680145", "0.66681755", "0.6592631", "0.65356743", "0.65356743", "0.64768016", "0.6471104", "0.6426717", "0.64178765", "0.6412465", "0.64123446", "0.640...
0.75543296
0
Creates a spline basis functions.
def create_spline_basis( x, knot_list=None, num_knots=None, degree: int = 3, add_intercept=True ): assert ((knot_list is None) and (num_knots is not None)) or ( (knot_list is not None) and (num_knots is None) ), "Define knot_list OR num_knot" if knot_list is None: knot_list = np.quantile...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_splines(self, export=False):\n self.log_debug(\"Initialise Splines\")\n \n # store the old splines to calculate the guess later\n if not export:\n # self.old_splines = auxiliary.copy_splines(self.splines)\n self.old_splines = copy.deepcopy(self.splines)\n\...
[ "0.6145274", "0.60877424", "0.6052145", "0.60375947", "0.6001898", "0.59999204", "0.5954496", "0.5932355", "0.59286356", "0.5879033", "0.58691406", "0.58664", "0.5846284", "0.58285266", "0.58219206", "0.5805841", "0.5795633", "0.5771377", "0.5762374", "0.5760151", "0.5756835"...
0.6666942
0
Creates a SKAST expression from a given bound method of a fitted SKLearn model. A shorthand notation for SKompiledModel(method, inputs)
def skompile(*args, inputs=None): if len(args) > 3: raise ValueError("Too many arguments") elif not args: raise ValueError("Invalid arguments") elif len(args) == 3: if inputs is not None: raise ValueError("Too many arguments") model, method, inputs = args eli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def symbolic(inputs):\n def decorator(method):\n name = \"__\" + method.__name__\n \n def wrapper(self, *args):\n if isinstance(args[0], T.Variable):\n return method(self, *args)\n elif hasattr(self, name):\n return getattr(self, name)(*ar...
[ "0.5219497", "0.5079229", "0.4959971", "0.49062678", "0.4859112", "0.48553485", "0.47938234", "0.479378", "0.47654662", "0.47600314", "0.47471395", "0.47446042", "0.47090238", "0.47008646", "0.46279964", "0.46064377", "0.45961896", "0.4594283", "0.45740858", "0.45689133", "0....
0.5971231
0
Get all wildcards that occur in a grammar
def get_wildcards_forest(trees): wildcards = set() for tree in trees: extracted = tree.scan_values(lambda x: isinstance(x, WildCard)) for item in extracted: wildcards.add(item) return wildcards
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wildcard(pattern):\n wildcards = pattern.count('?')\n alphabet = ['0', '1']\n\n def xcombinations(items, length):\n if length == 0:\n yield []\n else:\n for i in xrange(len(items)):\n for sc in xcombinations(items, length - 1):\n yi...
[ "0.66501", "0.59201765", "0.57804966", "0.57796156", "0.576238", "0.57578564", "0.57382244", "0.5705745", "0.5631493", "0.56185585", "0.56112564", "0.55474377", "0.5537474", "0.5532528", "0.5528494", "0.5503258", "0.5481816", "0.546438", "0.54334146", "0.5430353", "0.54172885...
0.6646591
1
given a resnet model from torchvision.models, it changes its norm according to norm_type
def change_norm(model, norm_type="BN", norm_power=0.2): # select norm to be used normlayer = select_norm(norm_type, norm_power=norm_power) # find total number of childern model_len = 0 for n, child in enumerate(model.children()): model_len = n # for layer 0 which is outside conv_sh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resnet_imagenet(model_name, norm_type, tracking=True, norm_power=0.2, num_classes=1000, pretrained=False):\n if model_name == \"resnet18\":\n model = models.resnet18(pretrained=pretrained)\n elif model_name == \"resnet34\":\n model = models.resnet34(pretrained=pretrained)\n elif model_na...
[ "0.7371408", "0.64291745", "0.6322172", "0.60419244", "0.5997436", "0.59194046", "0.5907011", "0.5901997", "0.58824545", "0.586733", "0.58539593", "0.5836785", "0.5836774", "0.5810099", "0.5782081", "0.5776598", "0.57732487", "0.5750572", "0.5748389", "0.57176185", "0.5704199...
0.76990515
0
Mueller matrix operator for an optical attenuator.
def op_attenuator(t): att = np.array([[t, 0, 0, 0], [0, t, 0, 0], [0, 0, t, 0], [0, 0, 0, t]]) return att
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mat(self): # pylint: disable=C0103\n if self._mat is None:\n object.__setattr__(\n self, \"_mat\", np.diag(self._disp_over_m) + self.potential\n )\n return self._mat", "def Omat(self):\n if self.standard:\n return np.matrix(((0, -1, 0), (0...
[ "0.608024", "0.58110744", "0.58069587", "0.5739771", "0.57117015", "0.56846637", "0.56842667", "0.5656006", "0.5633964", "0.5619499", "0.5590821", "0.54993665", "0.54972875", "0.54821813", "0.54650754", "0.5445499", "0.54452884", "0.54288983", "0.5426877", "0.5414312", "0.540...
0.5938638
1
Mueller matrix operator for a perfect mirror.
def op_mirror(): mir = np.array([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, -1, 0], [0, 0, 0, -1]]) return mir
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reverse_matrix(self):\n return SWAP.matrix @ self.matrix @ SWAP.matrix", "def commute_matrix(A):\n R = resistance_matrix(A)\n E = A.sum() / 2 # number of edges in graph\n C = 2 * E * R\n return C", "def mrotate(self):\n result_matrix = [[0 for col in range(len(self.matrix[0]))] f...
[ "0.6354242", "0.6077073", "0.5978175", "0.58676255", "0.58503145", "0.57724315", "0.5750676", "0.5740711", "0.5718066", "0.571125", "0.57004726", "0.56977755", "0.5695764", "0.5625887", "0.562493", "0.5602626", "0.5601049", "0.56000036", "0.559377", "0.55932105", "0.5584477",...
0.7168453
0
Mueller matrix operator for an quarterwave plate.
def op_quarter_wave_plate(theta): C2 = np.cos(2 * theta) S2 = np.sin(2 * theta) qwp = np.array([[1, 0, 0, 0], [0, C2**2, C2 * S2, -S2], [0, C2 * S2, S2 * S2, C2], [0, S2, -C2, 0]]) return qwp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_qmat(self):\n if self.model == 'ER':\n self.qmat = np.array([\n [-self.alpha, self.alpha],\n [self.alpha, -self.alpha],\n ])\n \n elif self.model == 'ARD':\n self.qmat = np.array([\n [-self.alpha, self.a...
[ "0.60673034", "0.6040835", "0.59534115", "0.5936303", "0.59071225", "0.5872927", "0.5841236", "0.58081967", "0.5794956", "0.5728738", "0.57063866", "0.5670171", "0.5620856", "0.5606768", "0.5600662", "0.5588184", "0.55748636", "0.55673945", "0.55352193", "0.5526969", "0.55140...
0.6152456
0
Mueller matrix operator for Fresnel reflection at angle theta. These are based on Collett, MuellerStokes Matrix Formulation of Fresnel equation, Am. J Phys., 39, 1971. The changes in direction and detector orientation are included in the Mueller matrix. See Clark, Stellar Polarimetry, Appendix A. Still needs sign testi...
def op_fresnel_reflection(m, theta): rho_p = pypolar.fresnel.r_par_amplitude(m, theta) rho_s = pypolar.fresnel.r_per_amplitude(m, theta) a = abs(rho_s)**2 + abs(rho_p)**2 b = abs(rho_s)**2 - abs(rho_p)**2 c = 2 * rho_s * rho_p mat = np.array([[a, b, 0, 0], [b, a, 0, 0], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def op_fresnel_transmission(m, theta):\n tau_p = pypolar.fresnel.T_par(m, theta)\n tau_s = pypolar.fresnel.T_per(m, theta)\n a = tau_s + tau_p\n b = tau_s - tau_p\n c = 2 * np.sqrt(tau_s * tau_p)\n mat = np.array([[a, b, 0, 0],\n [b, a, 0, 0],\n [0, 0, c, 0],...
[ "0.622056", "0.58702517", "0.57508045", "0.57361025", "0.5569424", "0.5563289", "0.5490292", "0.54849046", "0.54608405", "0.54515225", "0.54515225", "0.5438567", "0.5430586", "0.5418725", "0.54170763", "0.5402968", "0.5402867", "0.5396172", "0.53819424", "0.5380137", "0.53571...
0.6610029
0
Mueller matrix operator for Fresnel transmission at angle theta. These are based on Collett, MuellerStokes Matrix Formulation of Fresnel equation, Am. J Phys., 39, 1971. Still needs sign testing for angles above Brewster's angle.
def op_fresnel_transmission(m, theta): tau_p = pypolar.fresnel.T_par(m, theta) tau_s = pypolar.fresnel.T_per(m, theta) a = tau_s + tau_p b = tau_s - tau_p c = 2 * np.sqrt(tau_s * tau_p) mat = np.array([[a, b, 0, 0], [b, a, 0, 0], [0, 0, c, 0], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward_kinematics(self):\n temp_T = Matrix.eye(3)\n for i in range(len(self.lengths)):\n angle_mat = self.T_a.subs(self.q,self.angles[i]).evalf()\n len_mat = self.T_x.subs(self.l,self.lengths[i]).evalf()\n temp_T = temp_T * angle_mat * len_mat\n \n ...
[ "0.58222497", "0.5807233", "0.5698358", "0.5615085", "0.5584165", "0.55772936", "0.5574442", "0.5547859", "0.5538702", "0.54976326", "0.54926777", "0.5482593", "0.54791564", "0.5468963", "0.54620767", "0.54620767", "0.54540205", "0.5448489", "0.54424965", "0.54398084", "0.538...
0.69669837
0
Stokes vector for right circular polarized light.
def stokes_right_circular(): return np.array([1, 0, 0, 1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Stokes_from_circular(self):\n (El,Er) = self.circular\n self.logger.debug(\"Stokes_from_circular: (El, Er) = %s\", (El,Er))\n (Elc,Erc) = self.circular.conj()\n self.logger.debug(\"Stokes_from_circular: (El*,Er*) = %s\", (Elc,Erc))\n (Sll,Srr) = abs(self.circular*self.circular.conj())\n self...
[ "0.6375804", "0.63201016", "0.62976336", "0.6121063", "0.6112942", "0.61114967", "0.60595465", "0.59962296", "0.5943087", "0.5923745", "0.5880259", "0.582169", "0.57043517", "0.5687367", "0.56583893", "0.5655317", "0.56551397", "0.5644171", "0.5632502", "0.56057614", "0.55933...
0.6873656
0
Stokes vector for left circular polarized light.
def stokes_left_circular(): return np.array([1, 0, 0, -1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stokes_right_circular():\n return np.array([1, 0, 0, 1])", "def Stokes_from_circular(self):\n (El,Er) = self.circular\n self.logger.debug(\"Stokes_from_circular: (El, Er) = %s\", (El,Er))\n (Elc,Erc) = self.circular.conj()\n self.logger.debug(\"Stokes_from_circular: (El*,Er*) = %s\", (Elc,Erc...
[ "0.6702422", "0.6211005", "0.61032695", "0.6089576", "0.5984944", "0.5715034", "0.5711016", "0.5634177", "0.56062025", "0.55863446", "0.55207545", "0.5490274", "0.54805064", "0.5478465", "0.54540604", "0.5451712", "0.5427926", "0.54220295", "0.5368582", "0.5365445", "0.535949...
0.6847403
0
Stokes vector for horizontal polarized light.
def stokes_horizontal(): return np.array([1, 1, 0, 0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stokes_unpolarized():\n return np.array([1, 0, 0, 0])", "def shear(self):\n \n ux,_ = np.gradient(self._obj['u'],self._obj['x'],self._obj['y'],axis=(0,1))\n _,vy = np.gradient(self._obj['v'],self._obj['x'],self._obj['y'],axis=(0,1))\n # self._obj['w'] = xr.DataArray(vy - ux, di...
[ "0.5918117", "0.58723986", "0.5818484", "0.5731975", "0.5699452", "0.56661665", "0.5574211", "0.5566611", "0.55083126", "0.54805046", "0.54722756", "0.54115766", "0.54074466", "0.53298634", "0.53224814", "0.5320513", "0.53155434", "0.5285353", "0.52818227", "0.52457833", "0.5...
0.647436
0
Stokes vector for vertical polarized light.
def stokes_vertical(): return np.array([1, -1, 0, 0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vector_polar(v):\n return vector_mag(v), vector_angle(v)", "def calcul_v_sphere(r):\n volume = 4/3 * math.pi * (r ** 3)\n return volume", "def rayleigh(v0):\r\n # Need to sample the angle theta from the phase function\r\n loop_condition = True\r\n while loop_condition:\r\n eps = ra...
[ "0.589377", "0.5741251", "0.5730084", "0.5728626", "0.5676611", "0.56667644", "0.5650076", "0.5563742", "0.55254483", "0.54606766", "0.5449218", "0.54369754", "0.54300106", "0.5413834", "0.5402253", "0.53944075", "0.5390309", "0.53888935", "0.53772324", "0.53700924", "0.53613...
0.6714072
0
Stokes vector using ellipsometer parameters. This creates a Stokes vector for the specific set of ellipsometry parameters tanpsi and Delta. See Fujiwara table 3.1 for example.
def stokes_ellipsometry(tanpsi, Delta): psi = np.arctan(tanpsi) cp = np.cos(2*psi) sp = np.sin(2*psi) cd = np.cos(2*Delta) sd = np.sin(2*Delta) if np.isscalar(tanpsi) and np.isscalar(Delta): return np.array([1, -cp, sp*cd, -sp*sd]) return np.array([np.ones_like(tanpsi), -cp, sp*cd, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Stokes_from_linear(self):\n (Ex,Ey) = self.linear\n self.logger.debug(\"Stokes_from_linear: (Ex, Ey) = %s\", (Ex,Ey))\n (Exc,Eyc) = self.linear.conj()\n self.logger.debug(\"Stokes_from_linear: (Ex*,Ey*) = %s\", (Exc,Eyc))\n (Sxx,Syy) = abs(self.linear*self.linear.conj())\n self.logger.debug(...
[ "0.60508937", "0.5953389", "0.5497419", "0.54203093", "0.5364661", "0.53449655", "0.5343437", "0.5288109", "0.516597", "0.51629436", "0.51338726", "0.5108275", "0.5054561", "0.50430876", "0.5008257", "0.5005713", "0.49933615", "0.49854788", "0.49025834", "0.48844898", "0.4881...
0.6754775
0
Return the ellipticity of the polarization ellipse. This parameter is often represented by Chi.
def ellipse_ellipticity(S): return 1/2 * np.arcsin(S[..., 3]/S[..., 0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_eccentricity(self, ellipse):\r\n a = ellipse.get_width()\r\n b = ellipse.get_height()\r\n if b > a:\r\n a, b = b, a\r\n c = np.sqrt(a**2 - b**2)\r\n return fdiv(c, a)", "def is_elliptic(self):\n if self.is_irreducible():\n return self._info[...
[ "0.715565", "0.7126095", "0.7016102", "0.68837917", "0.6737195", "0.66294", "0.65405613", "0.6381411", "0.63158727", "0.60865784", "0.5994429", "0.5964785", "0.5847698", "0.57892936", "0.5760368", "0.5736172", "0.57336146", "0.57251966", "0.5711549", "0.57085276", "0.5672819"...
0.721865
0
Return the semimajor and semiminor axes of the polarization ellipse.
def ellipse_axes(S): absL = np.sqrt(S[..., 1]**2 + S[..., 2]**2) A = np.sqrt((S[..., 0] + absL)/2) B = np.sqrt((S[..., 0] - absL)/2) return A, B
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ellipse_volume(semi_major_axis: number, semi_minor_axis : number) -> number:\n area = pi*semi_major_axis*semi_minor_axis\n return area", "def ellipse_orientation(S):\n return 1/2 * np.arctan2(S[..., 2], S[..., 1])", "def ellipse_area(semi_major_axis: number, semi_minor_axis : number) -> number:\n ...
[ "0.6327822", "0.6299756", "0.62783325", "0.61692506", "0.61252266", "0.6107363", "0.59618175", "0.5873875", "0.584203", "0.58325744", "0.57928264", "0.57928264", "0.57914275", "0.5780864", "0.56624025", "0.56526333", "0.56080467", "0.55608785", "0.5538955", "0.553485", "0.552...
0.66926306
0
Convert a Stokes vector to a Jones vector. The Jones vector can only represent the part of the Stokes vector that is polarized. This fraction is calculated and represented as a Jones vector with its horizontal component represented as a real number. The sign convention for the Jones vector can be set by calling `pypola...
def _stokes_to_jones(S): if S[0] == 0: return np.array([0, 0]) # Fraction of intensity that is polarized Ip = np.sqrt(S[1]**2 + S[2]**2 + S[3]**2) # Normalize the remaining Stokes parameters to this fraction Q = S[1] / Ip U = S[2] / Ip V = S[3] / Ip # Amplitude of the polarize...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kelvin_to_jansky(self):\n this_unit = self.stokes.unit\n if self.component_type == \"point\":\n if this_unit.is_equivalent(\"Jy\"):\n return\n\n else:\n if this_unit.is_equivalent(\"Jy/sr\"):\n return\n\n if self.spectral_type == \...
[ "0.60473555", "0.5517495", "0.5416298", "0.5373445", "0.5368293", "0.53238535", "0.5320668", "0.5303249", "0.52756107", "0.5274153", "0.5189188", "0.50686723", "0.5053943", "0.50444096", "0.5042495", "0.5015951", "0.49547493", "0.4945272", "0.4922178", "0.48534885", "0.484294...
0.7741497
0
Convert a (list of) Stokes vector(s) to a (list of) Jones vector(s). The sign convention for the Jones vector can be set by calling `pypolar.jones.use_alternate_convention(True)`. The default is to assume that the field is represented by exp(jomegatkz).
def stokes_to_jones(S): if S.ndim == 1: return _stokes_to_jones(S) n, m = S.shape if m != 4: print("Wrong shape ... should be %dx4 not %dx%d" % (m, n, m)) return None J = np.empty(shape=(n, 2), dtype=np.ndarray) for i, SS in enumerate(S): J[i] = _stokes_to_jones(SS)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _stokes_to_jones(S):\n if S[0] == 0:\n return np.array([0, 0])\n\n # Fraction of intensity that is polarized\n Ip = np.sqrt(S[1]**2 + S[2]**2 + S[3]**2)\n\n # Normalize the remaining Stokes parameters to this fraction\n Q = S[1] / Ip\n U = S[2] / Ip\n V = S[3] / Ip\n\n # Amplitud...
[ "0.7159555", "0.53809863", "0.537464", "0.5312977", "0.52801853", "0.5190829", "0.51224995", "0.51198554", "0.50839615", "0.49398622", "0.49230736", "0.48852983", "0.48749423", "0.4834024", "0.48198506", "0.47887433", "0.47838855", "0.47801447", "0.47250998", "0.47172138", "0...
0.60636616
1
Convert a Mueller matrix to a Jones matrix. Theocaris, Matrix Theory of Photoelasticity, eqns 4.704.76, 1979
def mueller_to_jones(M): A = np.empty((2, 2)) A[0, 0] = np.sqrt((M[0, 0]+M[0, 1]+M[1, 0]+M[1, 1])/2) A[0, 1] = np.sqrt((M[0, 0]+M[0, 1]-M[1, 0]-M[1, 1])/2) A[1, 0] = np.sqrt((M[0, 0]-M[0, 1]+M[1, 0]-M[1, 1])/2) A[1, 1] = np.sqrt((M[0, 0]-M[0, 1]-M[1, 0]+M[1, 1])/2) theta = np.empty((2, 2)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Mxform(x1,y1,x2,y2):\n return Jones.toMueller([[np.dot(x2,x1), np.dot(x2, y1)], [np.dot(y2,x1), np.dot(y2,y1)]])", "def mv_to_typej(mv):\n\n tab1 = [\n 0.0000000E+00,\n 1.9528268E+01,\n -1.2286185E+00,\n -1.0752178E+00,\n -5.9086933E-01,\n -1.7256713E-01,\n -2.8131513...
[ "0.58988345", "0.5716909", "0.5713044", "0.5655451", "0.56502", "0.56357044", "0.5602359", "0.5583494", "0.55154", "0.5499076", "0.5477744", "0.54714924", "0.54547334", "0.5414216", "0.5409368", "0.54040843", "0.5365349", "0.5365349", "0.5362546", "0.5341024", "0.5336913", ...
0.7471535
0
Interpret a Stokes vector.
def interpret(S): try: S0, S1, S2, S3 = S except: print("Stokes vector must have four real elements") return 0 # eps = 1e-12 print("I = %.3f" % S0) print("Q = %.3f" % S1) print("U = %.3f" % S2) print("V = %.3f" % S3) s = "not implemented yet" return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readVector(text):\n items = text.split()\n if int(items[0])+1 != len(items):\n raise ValueError(\"Invalid number of items\")\n return [float(v) for v in items[1:]]", "def decode(self, spikes: np.ndarray) -> np.ndarray:\n pass", "def Stokes_from_linear(self):\n (Ex,Ey) = self.linea...
[ "0.60886234", "0.59607303", "0.58653384", "0.5766407", "0.5677671", "0.5631319", "0.5600276", "0.5399393", "0.5385505", "0.53619516", "0.53451824", "0.5342632", "0.5315072", "0.5314751", "0.53052455", "0.52875173", "0.52736217", "0.5263819", "0.5230776", "0.5215104", "0.52144...
0.68386406
0
Smooth observations producing position, speed, acceleration
def smooth(self, observations): pos = [] vel = [] acc = [] for i in range(observations.shape[1]): y, covariances = self.kf.smooth(observations[:, i]) pos.append(y[:, 0].reshape(-1, 1)) vel.append(y[:, 1].reshape(-1, 1)) acc.append(y[:, 2]....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _smooth(self):\n self.te = self._spline(self.rho_in, self.te_in, self.rho)\n self.ne = self._spline(self.rho_in, self.ne_in, self.rho)\n self.ti = self._spline(self.rho_in, self.ti_in, self.rho)\n self.vt = self._spline(self.rho_in, self.vt_in, self.rho)\n for i in range(self...
[ "0.62876487", "0.6055829", "0.60419613", "0.5992351", "0.59783936", "0.57513666", "0.567181", "0.555362", "0.5534943", "0.5531237", "0.5526341", "0.55006784", "0.5468531", "0.5467028", "0.5455522", "0.54256433", "0.5368036", "0.53605014", "0.5350593", "0.53427297", "0.5341266...
0.70262474
0
Datasets class for TUD datasets
def __init__(self, name_dataset, reduce=False): dataset = TUDataset(root='data/TUDataset', name=name_dataset) if reduce: new_dataset = [] for i in tqdm(range(len(dataset))): aux_graph = copy.deepcopy(dataset[i]) aux_graph.edge_index = TUDData.reduc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def datasets(self):\n pass", "def dataset(options):\n pass", "def __init__(self, dataset: Dataset):\n self.dataset = dataset", "def get_dataset(self):\n\n trainset = datasets.STL10('datasets/STL10/train/', split='train', transform=self.train_transforms,\n ...
[ "0.7214187", "0.69516677", "0.68727934", "0.6754461", "0.6677324", "0.6676307", "0.66406834", "0.6459943", "0.6451365", "0.645113", "0.64483017", "0.64184797", "0.6414838", "0.64115745", "0.6398356", "0.63801205", "0.637789", "0.63703185", "0.6368668", "0.6358485", "0.6352805...
0.73709434
0
Morphologically removes small (less than size) connected regions of 0s or 1s.
def remove_small_regions(img, size): img = morphology.remove_small_objects(img, size) img = morphology.remove_small_holes(img, size) return img
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean(img):\n\n label_img = label(img, connectivity=2)\n props = sorted(regionprops(label_img), key=lambda x: x.area)\n clean = morphology.binary_closing(img)\n\n clean = morphology.remove_small_holes(clean)\n return morphology.remove_small_objects(clean,\n ...
[ "0.69040537", "0.66481537", "0.6540535", "0.6446184", "0.640733", "0.6189493", "0.6148512", "0.61474717", "0.60423034", "0.5965002", "0.59620076", "0.5838528", "0.58286774", "0.56522554", "0.5626833", "0.561877", "0.55968136", "0.555457", "0.5544738", "0.5538274", "0.55295503...
0.7111345
0
Annotate a corpus for numerical values
def annotate(self,corpus): assert corpus.parsed == True, "Corpus must already be parsed before entity recognition" for doc in corpus.documents: entityCount = len(doc.entities) for sentence in doc.sentences: words = [ t.word for t in sentence.tokens ] for i,t in enumerate(sentence.tokens): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform(self, corpus: Corpus):\n assert 'stem_tokens' in next(corpus.iter_utterances()).meta\n counter = 1\n for utt in corpus.iter_utterances():\n if utt.meta['valid']:\n utt.meta['analysis'] = lexicon.analyze(utt.text,categories=self.categories)\n ...
[ "0.56012124", "0.54685616", "0.5414934", "0.539664", "0.52834344", "0.52618635", "0.5205094", "0.5182441", "0.5171937", "0.516879", "0.5146784", "0.5139397", "0.5107445", "0.5091306", "0.5090975", "0.5087072", "0.5081519", "0.5074216", "0.5056092", "0.50356823", "0.50180066",...
0.6498321
0
Set the tile at position row, col to have the given value.
def set_tile(self, row, col, value): self.grid[row][col] = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_tile(self, row, col, value):\n self._grid[row][col] = value", "def set_tile(self, row, col, value):\r\n self.grid[row][col] = value", "def set_tile(self, row, col, value):\r\n self._grid[row][col]=value", "def set_tile(self, row, col, value):\n if row >= 0 and row < self.g...
[ "0.9080037", "0.90793175", "0.90655726", "0.9029603", "0.90050316", "0.89972246", "0.8996403", "0.89953005", "0.8973403", "0.8968872", "0.8968872", "0.8962704", "0.8913228", "0.8894016", "0.8863161", "0.8840529", "0.88058203", "0.8442761", "0.8156478", "0.7806925", "0.7654879...
0.9102308
1
Erases the cache of instrument parameters.
def _erase_device_parameters_cache(self): self._device_parameters = {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decache(self):", "def cache_clear(self):\n\t\tself.__cache = {}", "def _clear_cache(self):\n keys = [\"nodes\", \"availability\", \"capacity\", \"cost\"]\n for key in keys:\n if key in self.__dict__:\n del self.__dict__[key]", "def clear_cache(self):\n pass"...
[ "0.68131924", "0.6409071", "0.6292454", "0.6275479", "0.6272713", "0.62357974", "0.61196434", "0.61167276", "0.61162287", "0.6106311", "0.61049825", "0.60567194", "0.603639", "0.60339475", "0.6000556", "0.5955249", "0.5950833", "0.59467536", "0.5926714", "0.5917723", "0.58942...
0.7008138
0
Configures the instrument with the settings of the runcard. A connection to the instrument needs to be established beforehand.
def setup(self): settings: ClusterQRM_RF_Settings = self.settings if self.is_connected: # Load settings port_settings: ClusterRF_OutputPort_Settings = settings.ports["o1"] self.ports["o1"].channel = port_settings.channel self._port_channel_map["o1"] = self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure(self):\n\n pass", "def config(self):\n self._resource_manager = self._api._ixnetwork.ResourceManager\n self._ixn_vport = self._api._vport\n self._delete_vports()\n self._create_vports()\n self._create_capture()\n self._set_location()\n self._s...
[ "0.6158928", "0.6095324", "0.60756123", "0.60756123", "0.60638505", "0.6053563", "0.600437", "0.5960908", "0.5943156", "0.5927517", "0.5884492", "0.5838539", "0.58357614", "0.5825384", "0.5825384", "0.5825384", "0.5825384", "0.58032554", "0.57259214", "0.5696976", "0.56886494...
0.63779825
0
Retrieves and configures the next avaliable sequencer. The parameters of the new sequencer are copied from those of the default sequencer, except for the intermediate frequency and classification parameters.
def _get_next_sequencer(self, port: str, frequency: int, qubits: dict, qubit: None): # select a new sequencer and configure it as required next_sequencer_number = self._free_sequencers_numbers.pop(0) if next_sequencer_number != self.DEFAULT_SEQUENCERS[port]: for parameter in self.de...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _setup_next_sequence(cls):\n return 0", "def play_sequence(self):\n\n # Start used sequencers\n for sequencer_number in self._used_sequencers_numbers:\n self.device.start_sequencer(sequencer_number)", "def get_next_config(self):\n\n self.reset_trial()\n self._c...
[ "0.5624271", "0.5404458", "0.5380647", "0.5322468", "0.526005", "0.5203631", "0.5172526", "0.51346254", "0.5033744", "0.49373752", "0.49323764", "0.47812727", "0.47804984", "0.46966892", "0.4684466", "0.46774712", "0.46585009", "0.46499082", "0.4640295", "0.46368748", "0.4596...
0.67878765
0
Returns the intermediate frequency needed to synthesise a pulse based on the port lo frequency.
def get_if(self, pulse: Pulse): _rf = pulse.frequency _lo = self.ports[self._channel_port_map[pulse.channel]].lo_frequency _if = _rf - _lo if abs(_if) > self.FREQUENCY_LIMIT: raise Exception( f""" Pulse frequency {_rf:_} cannot be synthesised with...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tone_to_freq(tone):\n return math.pow(2, (tone - 69.0) / 12.0) * 440.0", "def mtof(p):\n return 440.0 * 2 ** ((p - 69) / 12.0)", "def accPulse (t,Dp,t1,Tp):\r\n\tdiscretePulse=-(Dp*math.pi**2)/(float(2)*Tp**2)*np.sin(math.pi*(t-t1-Tp/float(2))/float(Tp))\r\n\treturn discretePulse/float(981)", "def _f...
[ "0.61215377", "0.60024834", "0.59792614", "0.5836403", "0.55756986", "0.55727637", "0.55603135", "0.55224115", "0.55160546", "0.5490879", "0.54866594", "0.54661137", "0.5411104", "0.5390114", "0.53830355", "0.53789145", "0.53789145", "0.5369351", "0.536179", "0.5361057", "0.5...
0.68523395
0
Processes a sequence of pulses and sweepers, generating the waveforms and program required by the instrument to synthesise them. The output of the process is a list of sequencers used for each port, configured with the information required to play the sequence.
def process_pulse_sequence( self, qubits: dict, instrument_pulses: PulseSequence, navgs: int, nshots: int, repetition_duration: int, sweepers=None, ): if sweepers is None: sweepers = [] sequencer: Sequencer sweeper: Sweeper ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preparePulseSequence(self):\n # get carrier frequency\n if self._MWSource is not None:\n carrierFrequency = self.carrierFrequency()\n else:\n carrierFrequency = 0\n\n # Decide to apply or not corrections\n applyCorrectionsArray = [\n pulse.app...
[ "0.62234795", "0.5661765", "0.5486216", "0.5444976", "0.5425541", "0.530444", "0.5303273", "0.52961653", "0.5199436", "0.51819366", "0.51601386", "0.51319253", "0.512279", "0.51042527", "0.50697345", "0.5013417", "0.49780914", "0.49754444", "0.49714395", "0.49533033", "0.4946...
0.69938815
0
Uploads waveforms and programs of all sequencers and arms them in preparation for execution. This method should be called after `process_pulse_sequence()`. It configures certain parameters of the instrument based on the needs of resources determined while processing the pulse sequence.
def upload(self): # Setup for sequencer_number in self._used_sequencers_numbers: target = self.device.sequencers[sequencer_number] self._set_device_parameter(target, "sync_en", value=True) self._set_device_parameter(target, "marker_ovr_en", value=True) # Default afte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sequencePreparation(self):\n #Calculation of the number of frames in function of the duration + LED list for the acquisition\n if self.seqMode == \"rgbMode\":\n self._rgbSequenceInit()\n elif self.seqMode == 'rbMode':\n self._rbSequenceInit()\n else:\n ...
[ "0.6190852", "0.61017346", "0.5820398", "0.57978183", "0.56364334", "0.55292535", "0.5384502", "0.53416306", "0.53379995", "0.53071916", "0.5247322", "0.5245387", "0.52057785", "0.5191742", "0.5182606", "0.51793665", "0.5171601", "0.5146318", "0.5137092", "0.5132799", "0.5131...
0.7205206
0
Plays the sequence of pulses. Starts the sequencers needed to play the sequence of pulses.
def play_sequence(self): # Start used sequencers for sequencer_number in self._used_sequencers_numbers: self.device.start_sequencer(sequencer_number)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def play_seq(self):\n \n self.deactivate_buts()\n \n # Add one random button number to sequence\n self.sequence.append(randint(0, 3))\n\n # Speed up playback by set amounts at set points in the game\n if len(self.sequence) == 6:\n self.duration = 0.36\n ...
[ "0.6578914", "0.6389446", "0.5949848", "0.58943784", "0.58396095", "0.57476765", "0.5710082", "0.5592152", "0.5572224", "0.5429729", "0.5426148", "0.53808916", "0.5363273", "0.53594166", "0.5352194", "0.5331404", "0.52823335", "0.5272723", "0.5272432", "0.52669454", "0.526532...
0.7409019
0
Processes the results of the acquisition. If hardware demodulation is disabled, it demodulates and integrates the acquired pulse. If enabled, if processes the results as required by qblox (calculating the average by dividing the integrated results by the number of smaples acquired).
def _process_acquisition_results(self, acquisition_results, readout_pulse: Pulse, demodulate=True): if demodulate: acquisition_frequency = self.get_if(readout_pulse) # DOWN Conversion n0 = 0 n1 = self.ports["i1"].acquisition_duration input_vec_I = np....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n result = self.measure_pulse_width()\n self.result_queue.put(result)", "def obtain_data(self):\n ##MODIFY THIS\n #ipdb.set_trace()\n print('obtain_data')\n print(self.enabler)\n print(self.index)\n helper = '>'+str(1+int(self.chann_span.get(...
[ "0.5812212", "0.56929606", "0.5583953", "0.5452837", "0.54194784", "0.53873444", "0.53826183", "0.53570884", "0.52543724", "0.5248744", "0.52284294", "0.522656", "0.52185214", "0.5213807", "0.5177829", "0.5177829", "0.5162387", "0.5148008", "0.5128929", "0.51210445", "0.51202...
0.7334148
0
Parse one page of a restaurant and get all his parameters
def parse_one_restaurant(): # Used for determining on which page error occurs global on_tags, on_details try: on_details = True on_tags = False # Get all of useful params of this page name = wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, 'h1.section-hero-header-title-title'))).text type =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def crawl_page(latitude,longitude, page_num, verbose=True):\r\n try:\r\n if(page_num==0):\r\n page_url = get_city_restaurants_page_0(latitude, longitude)\r\n else:\r\n page_url= get_city_restaurants_pages(latitude,longitude,page_num)\r\n soup = BeautifulSoup(urllib2.ur...
[ "0.66931427", "0.6273185", "0.61628985", "0.60633975", "0.6046904", "0.60008866", "0.59816045", "0.5950862", "0.5926086", "0.5911279", "0.5889028", "0.58050334", "0.5803539", "0.57965684", "0.57854086", "0.5781833", "0.5733511", "0.570712", "0.57054114", "0.5696001", "0.56763...
0.68237394
0
Return True if and only if this matrix is symmetric.
def is_symmetric(self): return self.all_equal(self.transpose())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_symmetric(self):\n return self.args[0].is_symmetric()", "def symmetric(matrix):\n return sp.allclose(matrix, matrix.T)", "def is_symmetric(mat):\n return np.allclose(mat.T, mat)", "def is_symmetric_transform(self) -> bool:\n\n # If the kernel is made stochastic, it looses the symme...
[ "0.82978755", "0.79237944", "0.78656095", "0.7824919", "0.77664655", "0.767461", "0.7674271", "0.7494814", "0.735827", "0.73149246", "0.7055103", "0.7051139", "0.69387823", "0.68682027", "0.6647748", "0.66305554", "0.66025525", "0.65713704", "0.65697753", "0.65394515", "0.641...
0.81464267
1
Return True if and only if this matrix is skewsymmetric.
def is_skew_symmetric(self): return self.all_equal(-self.transpose())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_skew_symmetric(self):\n return self._info['skew_symmetric']", "def is_symmetric_transform(self) -> bool:\n\n # If the kernel is made stochastic, it looses the symmetry, if symmetric_kernel\n # is set to True, then apply the the symmetry transformation\n return self.is_stochasti...
[ "0.8862124", "0.7443813", "0.72241163", "0.7113059", "0.70095956", "0.6706654", "0.66669273", "0.6633314", "0.65637493", "0.649977", "0.6452688", "0.64183134", "0.6310784", "0.6289229", "0.6278429", "0.61373484", "0.6124613", "0.611005", "0.60631007", "0.6038263", "0.5956895"...
0.8811966
1
Apply the Toeplitz decomposition to this matrix. Decompose this matrix into the sum of a symmetric and skewsymmetric matrix, returning the result as a tuple.
def toeplitz_decomposition(self): if self.m != self.n: raise exc.DecompositionError("non-square matrices do not have a " + "a Toeplitz decomposition") # TODO: test for decomposition directly using the parity of elements try: diviso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lup_decomposition(self):\n p = [i for i in range(self.rows_count())]\n for i in range(self.rows_count() - 1):\n pivot = i\n for j in range(i + 1, self.rows_count()):\n if abs(self[p[j], i]) > abs(self[p[pivot], i]):\n pivot = j\n ...
[ "0.5213323", "0.50996494", "0.49849567", "0.49510524", "0.49172488", "0.49110764", "0.4883246", "0.48457295", "0.48438048", "0.4828325", "0.48001832", "0.47712076", "0.4749993", "0.47361603", "0.47205043", "0.46793815", "0.4654566", "0.46158004", "0.46089533", "0.46067482", "...
0.7463325
0
Apply the QR decomposition to this matrix. Decompose this matrix into the product of an orthogonal and upper triangular matrix, returning the result as a tuple.
def qr_decomposition(self): if self.m != self.n: raise NotImplementedError('QR decomposition not yet available ' + 'for non-square matrices') orig_basis = [vec.Vector.fromMatrixColumn(self, j) for j in range(self.m)] orthog_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def QR(self):\n m, n = self.shape\n assert m >= n, \"Requires m>=n\"\n R = self.copy()\n Q = eye(m)\n\n for j in range(n):\n reflect_me = R[j:, j].copy()\n v, beta = reflect_me._house()\n H = eye(m)\n # A[j:, j:] = (I - beta*v*v.T)*A[j:...
[ "0.6598388", "0.59672034", "0.5609881", "0.55924284", "0.55765384", "0.5519256", "0.5508025", "0.5469608", "0.53900325", "0.529357", "0.529137", "0.5268985", "0.5247279", "0.52351326", "0.5216549", "0.520348", "0.5151719", "0.51425827", "0.5136921", "0.51350784", "0.5107533",...
0.7268903
0
Create random matrix. Make a random matrix of dimension m by n with elements chosen independently and uniformly from the interval (min, max).
def makeRandom(cls, m, n, min=0, max=1): Matrix.validate_dimensions(m, n) data = [[randrange(min, max) for j in range(n)] for i in range(m)] return RealMatrix(m, n, data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def irandmatrix(n, range = 10):\n A = mp.matrix(n, n)\n for i in xrange(n):\n for j in xrange(n):\n A[i,j]=int( (2 * mp.rand() - 1) * range)\n return A", "def matrix_generate(n):\n a = np.eye(n)\n max = 0\n for i in range(n):\n for j in range(n):\n a[i][j] = ...
[ "0.78433233", "0.7638872", "0.7627804", "0.7468793", "0.7439924", "0.7393176", "0.72388965", "0.69421613", "0.6859874", "0.68500143", "0.68343204", "0.6825909", "0.68149805", "0.68130934", "0.6673447", "0.66420335", "0.6639308", "0.6585535", "0.64954025", "0.6492207", "0.6433...
0.841046
0
Make matrix from list. Make a matrix from a list of elements, filling along data, when given at least one dimension of the matrix.
def fromList(cls, elems, **kwargs): if not ('m' in kwargs or 'n' in kwargs): raise ValueError("at least one of m and n must be specified") m = kwargs.get('m') n = kwargs.get('n') num_elems = len(elems) if m is None: m = num_elems // n elif n is Non...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matrixlist(inputlist, converter=proper, fake=False):\n if converter is None:\n converter = type(inputlist[0][0])\n xlen = len(inputlist[0])\n for x in xrange(1,len(inputlist)):\n if len(inputlist[x]) != xlen:\n raise IndexError(\"Unequal matrix row lengths for matrixlist of \"...
[ "0.7094579", "0.66672474", "0.63974005", "0.62002563", "0.61311346", "0.6109359", "0.605273", "0.6044873", "0.59845465", "0.59546614", "0.59326655", "0.59093165", "0.59049064", "0.59013504", "0.5888967", "0.5872197", "0.586887", "0.58510363", "0.58313245", "0.57852983", "0.57...
0.71792424
0
Make matrix from a list of vectors.
def fromVectors(cls, vectors): data = [[v[i] for i in range(v.m)] for v in vectors] return Matrix.fromCols(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getVector(lstOfValues):\n return MatrixExtended([[v] for v in lstOfValues])", "def vector_as_matrix(v):\r\n return [[v_i] for v_i in v]", "def matFromVec(vec):\n return matCopy([vec])", "def get_list_as_mvector(input_list):\n out_vec = oMa.MVector(input_list[0], input_list[1], input_list[2])\...
[ "0.74852514", "0.7236794", "0.6905837", "0.6645156", "0.6583316", "0.64538586", "0.6444173", "0.63659257", "0.62837905", "0.6265147", "0.6186161", "0.6146926", "0.6107079", "0.6092697", "0.6067659", "0.6058737", "0.6023423", "0.60118854", "0.60114", "0.6001914", "0.59696084",...
0.8131241
0
Set/reset the decimal precision used for the __str__() magic.
def set_str_precision(cls, dp=3): cls.str_decimal_places = dp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_precision(prec = None):\n context = decimal.getcontext()\n oldprec = context.prec\n if prec is not None:\n context.prec = prec\n return oldprec", "def _set_precision(self, precision) :\n self.__precision = self.parent().monoid().filter(precision)", "def _se...
[ "0.7331764", "0.72784746", "0.7261722", "0.7223948", "0.719054", "0.7175613", "0.6952761", "0.6919375", "0.68670195", "0.6699688", "0.6622625", "0.6622625", "0.65981686", "0.6512836", "0.6496002", "0.64959157", "0.6437724", "0.6406243", "0.6323721", "0.63200074", "0.6317553",...
0.79880565
0
Check if a given object is of a numeric type. Note that since bool inherits from int, that this will accept Boolean values
def is_numeric(obj): return isinstance(obj, (int, float, complex))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isNumeric(obj):\n return isinstance(obj, (int, float, bool))", "def isNumeric(obj):\n # type: (Any) -> bool\n return isinstance(obj, numbers.Number)", "def has_numeric_type(obj: _std_typing.Any) -> bool:\n return (not has_vector_type(obj)) and (not has_string_type(obj))", "def is_numeric(numb...
[ "0.8772221", "0.826441", "0.81246066", "0.8043363", "0.80361676", "0.7986987", "0.7566155", "0.7546925", "0.7494043", "0.7489575", "0.74447656", "0.7419485", "0.7357148", "0.7324903", "0.731739", "0.72969717", "0.72762114", "0.72283113", "0.7226205", "0.7183321", "0.7163518",...
0.83028454
1
Compute Boolean AND of this matrix and another valid object.
def __and__(self, obj): return self._boolean_operation(obj, operator.__and__)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __and__(self, other):\n return np.logical_and(self.array, other.array)", "def __and__(self, other):\n return self._operation_and(other)", "def __and__(self, other):\n return self.and_(other)", "def __and__(self, other):\n return self.fam.c_binop('and', self, other)", "def __...
[ "0.78984976", "0.75045496", "0.7492574", "0.7389445", "0.70946676", "0.70001763", "0.69510233", "0.69422674", "0.6920357", "0.6887442", "0.6886706", "0.6882738", "0.68388146", "0.67555815", "0.6739484", "0.67231524", "0.6708773", "0.66455406", "0.66329443", "0.66319954", "0.6...
0.7529107
1
Compute Boolean OR of this matrix and another valid object.
def __or__(self, obj): return self._boolean_operation(obj, operator.__or__)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __or__(self, other):\n return self.or_(other)", "def __or__(self, other):\n return self.fam.c_binop('or', self, other)", "def __or__(self, other):\n return self._operation_or(other)", "def __or__(self, y):\n return self.__and__(y) ^ self ^ y", "def __or__(self, other: Any) -...
[ "0.7211771", "0.7197068", "0.71211773", "0.6955508", "0.69108903", "0.6870653", "0.68568015", "0.6832886", "0.6832886", "0.67516315", "0.6701058", "0.66413164", "0.6543983", "0.65375394", "0.65342784", "0.6506125", "0.6473617", "0.6450746", "0.6440729", "0.64316595", "0.63916...
0.75740445
0
Compute Boolean XOR of this matrix and another valid object.
def __xor__(self, obj): return self._boolean_operation(obj, operator.__xor__)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __xor__(self, other):\r\n if self.field.characteristic == 2:\r\n return runtime.xor(self, other)\r\n\r\n return super().__xor__(other)", "def __xor__(self, other):\r\n return self + other - 2 * self * other", "def __xor__(self, other):\n a, b = Trits.match_length(self...
[ "0.75794953", "0.74803716", "0.7438497", "0.7419556", "0.7356534", "0.72640234", "0.7255716", "0.72463936", "0.72371286", "0.7204695", "0.71223634", "0.7035147", "0.6980655", "0.6955515", "0.68930554", "0.68813163", "0.6829587", "0.68166876", "0.6752015", "0.6738258", "0.6732...
0.8031445
0
Add a valid object to this matrix using Boolean XOR.
def __add__(self, obj): return self ^ obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __xor__(self, obj):\n return self._boolean_operation(obj, operator.__xor__)", "def __add__(self, matrix: 'MatrixBoolean') -> 'MatrixBoolean':\n\t\tif not isinstance(matrix, MatrixBoolean):\n\t\t\traise ValueError(\"argument must be an instance of class 'MatrixBoolean\")\n\t\tif matrix.dimM != self.dim...
[ "0.6797146", "0.62222004", "0.60349834", "0.6022956", "0.5844179", "0.57682467", "0.57170165", "0.568021", "0.5676684", "0.5675201", "0.560465", "0.5573083", "0.55210245", "0.5481003", "0.5479233", "0.5475661", "0.5468765", "0.54282075", "0.5425144", "0.5415078", "0.53872645"...
0.68709326
0
Subtract a valid object from this matrix using Boolean XOR.
def __sub__(self, obj): return self ^ obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __xor__(self, obj):\n return self._boolean_operation(obj, operator.__xor__)", "def inverse(self):\n return ~self", "def __xor__(self, other):\r\n return self + other - 2 * self * other", "def __xor__(self, other) -> 'MultiVector':\n\n other, mv = self._checkOther(other, coerce...
[ "0.74840236", "0.67975473", "0.6766909", "0.674297", "0.67211384", "0.6373538", "0.63416576", "0.6299656", "0.628002", "0.62564844", "0.6243239", "0.6241097", "0.6230208", "0.6198502", "0.61821944", "0.6181961", "0.6175661", "0.6163909", "0.6141009", "0.6134941", "0.6115627",...
0.7122932
1
Add a valid object to this matrix and return the result. Doesn't modify the current matrix. Valid objects include other matrices and numeric scalars
def __add__(self, obj): if isinstance(obj, Matrix): if self.m != obj.m or self.n != obj.n: raise exc.ComformabilityError( "matrices must have the same dimensions") if type(self) is not type(obj): raise TypeError("matrices must be th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __add__(self, obj):\n if not (type(self) == type(obj)):\n return NotImplemented\n if not (self.size == obj.size):\n raise ValueError(\"Matrices must be the same size for '+'\")\n returnvalue = Matrix()\n for i in range(self._height):\n currentRow = l...
[ "0.75506026", "0.66640896", "0.65407854", "0.62173265", "0.61547166", "0.6107255", "0.6053494", "0.6048974", "0.6034012", "0.6017702", "0.59789455", "0.5961353", "0.59272856", "0.5919188", "0.5896844", "0.5891839", "0.5846766", "0.5837135", "0.58124554", "0.5793911", "0.57792...
0.80393094
0
Subtract a valid object from this matrix and return the result. Doesn't modify the current matrix. Valid objects include other matrices and numeric scalars
def __sub__(self, obj): if isinstance(obj, Matrix): if self.m != obj.m or self.n != obj.n: raise exc.ComformabilityError( "matrices must have the same dimensions") if type(self) is not type(obj): raise TypeError( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __sub__(self, obj):\n if not (type(self) == type(obj)):\n return NotImplemented\n if not (self.size == obj.size):\n raise ValueError(\"Matrices must be the same size for '+'\")\n returnvalue = Matrix()\n for i in range(self._height):\n currentRow = l...
[ "0.7706783", "0.7068469", "0.7036815", "0.70187473", "0.7001399", "0.6607137", "0.6511861", "0.6472658", "0.64521635", "0.6448783", "0.63913584", "0.6282879", "0.623709", "0.6208969", "0.62017924", "0.6193165", "0.61590624", "0.6113605", "0.60930926", "0.6062546", "0.6024069"...
0.8286494
0
Multiply this matrix by a valid object and return the result. Doesn't modify the current matrix. Valid objects include other matrices vectors, and numeric scalars. In the case where the other object is a matrix, multiplication occurs with the current matrix on the lefthand side.
def __mul__(self, obj): if isinstance(obj, Matrix): if self.n != obj.m: raise exc.ComformabilityError( "inner matrix dimensions must match") if type(self) is not type(obj): raise TypeError( "matrices must be ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __mul__(self, oth):\n\t\tif isinstance(oth, Matrix) or isiterable(oth):\n\t\t\t# matrix\n\t\t\toth_m = oth\n\t\t\tif not isinstance(oth_m, Matrix):\n\t\t\t\toth_m = Matrix(oth_m)\t\t\t\n\t\t\tres_m = self._mat_mul(oth_m)\n\t\t\tif isinstance(oth, Matrix):\n\t\t\t\treturn res_m\n\t\t\telse:\n\t\t\t\treturn type...
[ "0.7228593", "0.715777", "0.71572244", "0.71418726", "0.71213937", "0.7118932", "0.7074844", "0.7031363", "0.6972003", "0.69600475", "0.69098276", "0.6884298", "0.68534285", "0.6848822", "0.68257827", "0.6811321", "0.6770755", "0.6674994", "0.6671941", "0.66105765", "0.659815...
0.8243538
0
Calculate the Hadamard product of two matrices.
def hadamard(A, B): if not all(isinstance(M, IntegerMatrix) for M in (A, B)): raise TypeError("can only Hadamard two matrices") if type(A) is not type(B): raise TypeError( "matrices must be the same type") if A.m != B.m or A.n != B.n: raise...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ham_product(q1, q2):\n prod = np.empty(4)\n prod[0] = q1[0]*q2[0] - q1[1]*q2[1] - q1[2]*q2[2] - q1[3]*q2[3]\n prod[1] = q1[0]*q2[1] + q1[1]*q2[0] + q1[2]*q2[3] - q1[3]*q2[2]\n prod[2] = q1[0]*q2[2] - q1[1]*q2[3] + q1[2]*q2[0] + q1[3]*q2[1]\n prod[3] = q1[0]*q2[3] + q1[1]*q2[2] - q1[2]*q2[1] + q1...
[ "0.706124", "0.6859125", "0.66127837", "0.6482767", "0.64076084", "0.61796117", "0.6152221", "0.61312777", "0.60399675", "0.6030917", "0.60226506", "0.59868777", "0.5985798", "0.5985798", "0.5969577", "0.59601176", "0.5952439", "0.5923932", "0.5921231", "0.5918118", "0.591811...
0.77502495
0
Make a zero matrix of dimension m by n.
def makeZero(m, n): Matrix.validate_dimensions(m, n) data = [[0 for j in range(n)] for i in range(m)] return IntegerMatrix(m, n, data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeZero(m, n):\n Matrix.validate_dimensions(m, n)\n data = [[0. for j in range(n)] for i in range(m)]\n return RealMatrix(m, n, data)", "def zeros(m, n):\n data = dict.fromkeys(itertools.product(range(m), range(n)), mpfr(0))\n return MPMatrix((m, n), data)", "def makeZero(m, n):...
[ "0.8702598", "0.84187156", "0.8344323", "0.7984786", "0.7688622", "0.76761514", "0.7661081", "0.75629056", "0.75604486", "0.7559634", "0.7559634", "0.75470996", "0.75038904", "0.7459018", "0.74510133", "0.74015135", "0.73990643", "0.7032862", "0.70207566", "0.6995373", "0.691...
0.87931824
0
Make an identity matrix of dimension m by m.
def makeIdentity(m): Matrix.validate_dimensions(m, m) data = [[1 if i == j else 0 for j in range(m)] for i in range(m)] return IntegerMatrix(m, m, data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_matrix():\r\n return numpy.identity(4)", "def identity_matrix():\n return numpy.identity(4)", "def makeIdentity(m):\n Matrix.validate_dimensions(m, m)\n data = [[1. if i == j else 0. for j in range(m)] for i in range(m)]\n return RealMatrix(m, m, data)", "def identity_...
[ "0.81645733", "0.8163707", "0.81377834", "0.80602086", "0.80602086", "0.80602086", "0.8004408", "0.7941929", "0.79349154", "0.79169667", "0.7820539", "0.7820539", "0.7443002", "0.7420335", "0.73268086", "0.7207678", "0.7067191", "0.69964963", "0.6992883", "0.69667166", "0.682...
0.84012944
0
Make a zero matrix of dimension m by n.
def makeZero(m, n): Matrix.validate_dimensions(m, n) data = [[0. for j in range(n)] for i in range(m)] return RealMatrix(m, n, data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeZero(m, n):\n Matrix.validate_dimensions(m, n)\n data = [[0 for j in range(n)] for i in range(m)]\n return IntegerMatrix(m, n, data)", "def zeros(m, n):\n data = dict.fromkeys(itertools.product(range(m), range(n)), mpfr(0))\n return MPMatrix((m, n), data)", "def makeZero(m, n...
[ "0.8792867", "0.841994", "0.8343372", "0.7982616", "0.76915884", "0.7676163", "0.76599306", "0.7562079", "0.7558743", "0.7558743", "0.7557831", "0.75453925", "0.7501125", "0.74591345", "0.74484515", "0.74032515", "0.73965424", "0.7029756", "0.70214945", "0.69921505", "0.69145...
0.8702078
1
Create and return a new `Tweet` instance, given the validated data.
def create(self, validated_data): return Tweet.objects.create(**validated_data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, tweet_data):\n _hashtags = tweet_data['entities']['hashtags']\n _str_date = tweet_data['created_at']\n self.account = Account(tweet_data['user'])\n self.date = self.format_date(_str_date)\n self.hashtags = [\"#%s\" % (tag['text']) for tag in _hashtags]\n ...
[ "0.5881127", "0.5873994", "0.5803559", "0.5790256", "0.5789718", "0.5761981", "0.57276875", "0.5721631", "0.57007635", "0.56960815", "0.5623666", "0.56081635", "0.5532758", "0.5492157", "0.5488445", "0.5477836", "0.5439708", "0.5428132", "0.5425358", "0.54081345", "0.53985476...
0.8140694
0
Sort the stack, with the smallest item at the top, using only one other stack as a temporary buffer. Each element is popped from the stack, and placed on the temporary stack in reverse order (with largest at the top). We can put it in the correct order by using the original stack as a further temporary buffer.
def sort_stack(self, stack): temp_stack = [] while stack: elem = stack.pop() while temp_stack and temp_stack[-1] > elem: # Move items off of temp stack to allow us to place # elem in the correct location (in reverse order) stack.ap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_stack(stack: Stack):\n # additional stack\n tmp = Stack()\n # find length\n n = 0\n while stack:\n tmp.push(stack.pop())\n n += 1\n while tmp:\n stack.push(tmp.pop())\n # balance the content between the 2 stacks, sorting one at the time\n mini = float('inf')\n ...
[ "0.80508965", "0.8048911", "0.7593493", "0.75742716", "0.7521887", "0.7087995", "0.69575614", "0.6245629", "0.62282133", "0.6180442", "0.61109734", "0.61109734", "0.6014799", "0.59822226", "0.59634143", "0.58511704", "0.583471", "0.57483006", "0.57244563", "0.5684383", "0.568...
0.8126014
0
Create a RegionsSelector model from JSON files.
def from_json(cls, regions_mask, wcs_info, wcs_regions=None, dist_info=None, spec_info=None): transforms = [] # read in primary WCS and update wcs_relative with it.? # read in dist_info and create scomp # assign it to rid labels = cls.labels_from_mask(regions_mask) sky_w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(file):\n\n import json\n import importlib\n\n f = open(file, 'r')\n input = json.loads(f.read())\n\n # import the appropriate transformation class\n regMethod = str(input['regMethod'])\n className = str(input['transClass'])\n transClass = getattr(imp...
[ "0.5971097", "0.5836287", "0.5817237", "0.58021134", "0.57905114", "0.5740482", "0.57245135", "0.56857735", "0.5683675", "0.56316054", "0.5617406", "0.5614904", "0.56127757", "0.55939007", "0.55778724", "0.55558705", "0.5516661", "0.5485536", "0.5472339", "0.54615104", "0.542...
0.6534754
0
returns a hypersphere of the same dimension as the collection of input tuples (radius, (center)) Methods available for fitting are "algebraic" fitting methods Hyper AlSharadqah and Chernov's Hyperfit algorithm Pratt Vaughn Pratt's algorithm Taubin G. Taubin's algorithm The following methods, though very similar, are no...
def fit_hypersphere(data, method="Hyper"): num_points = len(data) # print >>stderr, "DEBUG: num_points=", num_points if num_points==0: return (0,None) if num_points==1: return (0,data[0]) dimen = len(data[0]) # dimensionality of hypersphere # print >>stderr, "DEBUG: dim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Icosphere(radius=1.0, center=(0.0, 0.0, 0.0), nsub=3):\n mesh = Icosahedron()\n mesh.clear_data()\n mesh = mesh.subdivide(nsub=nsub)\n\n # scale to desired radius and translate origin\n dist = np.linalg.norm(mesh.points, axis=1, keepdims=True) # distance from origin\n mesh.points = mesh.poin...
[ "0.7010963", "0.6909186", "0.6886178", "0.6744337", "0.6612435", "0.65304524", "0.65160096", "0.64552844", "0.6426737", "0.64250475", "0.6424217", "0.63945514", "0.63725907", "0.63302106", "0.62695825", "0.6258461", "0.6257253", "0.61706847", "0.61703926", "0.612936", "0.6115...
0.7670112
0
Test case for adding_criteria_to_segments Adding criteria to segments
def test_adding_criteria_to_segments(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_updating_segment_criteria(self):\n pass", "def test_getting_segments(self):\n pass", "def test_creating_a_new_segment(self):\n pass", "def getTimeSegments(segments,bounds,radius,starttime,endtime,magrange,catalog,contributor):\n stime = starttime\n etime = endtime\n \n ...
[ "0.7855492", "0.62065667", "0.59646577", "0.5781041", "0.56449413", "0.55860585", "0.55084765", "0.5420136", "0.5403109", "0.53202343", "0.53079236", "0.52779084", "0.5229569", "0.51612747", "0.51400477", "0.51351476", "0.5022801", "0.49976885", "0.49529022", "0.49529022", "0...
0.9097539
0
Test case for creating_a_new_segment Creating a new segment
def test_creating_a_new_segment(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_segment(**kwargs):\n sessiontoken = kwargs['sessiontoken']\n proxy = kwargs['proxy']\n if kwargs['objectname'] is None or kwargs['gateway'] is None:\n print(\"Please specify a name for the segment, and the gateway/network.\")\n sys.exit(1)\n if kwargs['segment_type'] == \"flexible...
[ "0.7178131", "0.7067078", "0.69926876", "0.690543", "0.66917306", "0.65425503", "0.6071454", "0.6064674", "0.5964906", "0.5882583", "0.5821999", "0.5819856", "0.57798696", "0.57370746", "0.57185143", "0.5717881", "0.567745", "0.5626217", "0.56260043", "0.5579192", "0.55605865...
0.9367639
0
Test case for deleting_a_segment Deleting A Segment
def test_deleting_a_segment(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_creating_a_new_segment(self):\n pass", "def test_updating_a_segment(self):\n pass", "def remove_segment(**kwargs):\n sessiontoken = kwargs['sessiontoken']\n proxy = kwargs['proxy']\n segment_name = kwargs[\"objectname\"]\n segment=search_nsx_json(proxy, sessiontoken, \"Segmen...
[ "0.69824106", "0.697671", "0.68467265", "0.6729917", "0.6716292", "0.6714796", "0.6667467", "0.66342497", "0.6507445", "0.64676803", "0.6434738", "0.64153236", "0.6397277", "0.6387413", "0.6376963", "0.6361274", "0.6356013", "0.63503873", "0.63406765", "0.6300734", "0.6271998...
0.927292
0
Test case for getting_segment_details Getting segment details
def test_getting_segment_details(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_getting_segments(self):\n pass", "def fetch(self, segment):\n pass", "def test_creating_a_new_segment(self):\n pass", "def getseg(*args):\n return _ida_segment.getseg(*args)", "def test_aws_service_api_vm_details_get(self):\n pass", "def getSegment(self):\n re...
[ "0.7531621", "0.6604978", "0.6311625", "0.6171972", "0.6125701", "0.60362875", "0.59910595", "0.5931202", "0.5931202", "0.5813913", "0.5782741", "0.56055504", "0.5565164", "0.55490947", "0.55036545", "0.5482009", "0.54724914", "0.54593164", "0.54412705", "0.5418447", "0.54107...
0.90232855
0
Test case for getting_segment_subscribers Getting segment subscribers
def test_getting_segment_subscribers(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_subscriptions(self):\n pass", "def test_json_get_subscribers(self) -> None:\n stream_name = gather_subscriptions(self.user_profile)[0][0][\"name\"]\n stream_id = get_stream(stream_name, self.user_profile.realm).id\n expected_subscribers = gather_subscriptions(self.user_pr...
[ "0.65450656", "0.6537608", "0.65199435", "0.6419554", "0.6334731", "0.6083889", "0.6069727", "0.6043294", "0.58917093", "0.58529264", "0.5828398", "0.58085084", "0.5775409", "0.57023025", "0.5636875", "0.5597932", "0.5558285", "0.5511905", "0.549096", "0.5464656", "0.54469824...
0.89748365
0
Test case for getting_segments Getting segments
def test_getting_segments(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_getting_segment_details(self):\n pass", "def getTimeSegments(segments,bounds,radius,starttime,endtime,magrange,catalog,contributor):\n stime = starttime\n etime = endtime\n \n dt = etime - stime\n dtseconds = dt.days*86400 + dt.seconds\n #segment 1\n newstime = stime\n new...
[ "0.76614946", "0.71628374", "0.71479404", "0.68277216", "0.6537677", "0.6519523", "0.65000474", "0.64666384", "0.6398494", "0.6357241", "0.632585", "0.63154536", "0.6299325", "0.6283982", "0.61848646", "0.61442107", "0.6109503", "0.6102212", "0.6090234", "0.6087303", "0.60583...
0.8816814
0
Test case for updating_a_segment Updating a segment
def test_updating_a_segment(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_updating_segment_criteria(self):\n pass", "def update(self,\n segment_id,\n segment,\n ):\n return self._invoke('update',\n {\n 'segment_id': segment_id,\n 'segment': ...
[ "0.75014263", "0.688015", "0.67864245", "0.67125845", "0.663435", "0.63650805", "0.6103719", "0.591197", "0.5902195", "0.58821124", "0.5709648", "0.56523585", "0.5637537", "0.5599842", "0.55715674", "0.55529267", "0.5525722", "0.5518666", "0.5506248", "0.5490082", "0.5484211"...
0.91595715
0
Test case for updating_segment_criteria Updating segment criteria
def test_updating_segment_criteria(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_updating_a_segment(self):\n pass", "def test_adding_criteria_to_segments(self):\n pass", "def __test_all_segments_with_updates(self, arr, fnc, upd):\n segment_tree = SegmentTree(arr, fnc)\n for index, value in upd.items():\n arr[index] = value\n segmen...
[ "0.77034825", "0.69949424", "0.6227643", "0.61745214", "0.6073167", "0.58669007", "0.5859704", "0.5857487", "0.5842801", "0.57678235", "0.576526", "0.575428", "0.5653545", "0.5578291", "0.5492454", "0.5490422", "0.54864603", "0.5427842", "0.53579086", "0.5290485", "0.52587", ...
0.9068177
0
Return a RandomState instance. This function exists solely to assist (un)pickling. Note that the state of the RandomState returned here is irrelevant, as this function's entire purpose is to return a newly allocated RandomState whose state pickle can set. Consequently the RandomState returned by this function is a fres...
def __RandomState_ctor(): return RandomState(seed=0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_random_state(self):\n self._validate_random_state()\n return deepcopy(self.random_state)", "def randomstate_constructor(value, name=None, strict=False,\r\n allow_downcast=None, borrow=False):\r\n if not isinstance(value, numpy.random.RandomState):\r\n r...
[ "0.7778816", "0.683517", "0.6510209", "0.64647645", "0.64314055", "0.64308727", "0.6382851", "0.6360861", "0.62564206", "0.6177404", "0.6176083", "0.6148165", "0.6143091", "0.6129019", "0.6129019", "0.61283976", "0.61039007", "0.6046189", "0.59496826", "0.5940564", "0.5885214...
0.78790283
0
Returns packages version and system architecture from names of directories from rpm directory.
def get_package_version_and_system_architecture(): rpm_directory = path.join(PMDK_PATH, 'rpm') global PMDK_VERSION global SYSTEM_ARCHITECTURE for elem in listdir(rpm_directory): if '.src.rpm' in elem: # looks for the version number of rpm package in rpm package name PMDK_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_libraries_names():\n rpm_packages_path = path.join(PMDK_PATH, 'rpm', SYSTEM_ARCHITECTURE)\n libraries_names = [elem.split('-')[0] for elem in listdir(rpm_packages_path)\n if PMDK_VERSION in elem]\n return set(libraries_names)", "def python_lib_rpm_dirs(self):\n libs ...
[ "0.6161193", "0.6122785", "0.5981177", "0.59130055", "0.58940387", "0.58286214", "0.5709137", "0.5639597", "0.5598138", "0.5580684", "0.5580032", "0.5578116", "0.5537562", "0.5529098", "0.55147636", "0.5497184", "0.5420838", "0.54055643", "0.5402964", "0.53701097", "0.535321"...
0.737647
0
Returns names of elements, for which are installed packages from PMDK library.
def get_libraries_names(): rpm_packages_path = path.join(PMDK_PATH, 'rpm', SYSTEM_ARCHITECTURE) libraries_names = [elem.split('-')[0] for elem in listdir(rpm_packages_path) if PMDK_VERSION in elem] return set(libraries_names)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_packages(self):\n for tag, pkg in PACKAGES.iteritems():\n print \"{tag} - {label}\".format(tag=tag, label=pkg['label'])", "def get_installed_jdk_packages():\n # Convert to a set and back to a list again to uniqueify.\n return sorted(list(set(rpm_query_whatprovides('java-devel', '...
[ "0.67465824", "0.6395732", "0.6301598", "0.629761", "0.6287263", "0.62821704", "0.62647754", "0.62220615", "0.6209631", "0.6172314", "0.6155008", "0.61340463", "0.61195815", "0.6102195", "0.6086", "0.6085253", "0.6062425", "0.6052318", "0.5966378", "0.5955613", "0.59143865", ...
0.6524266
1
Returns names of rpm packages from PMDK library, which are not installed.
def get_not_installed_rpm_packages(): def is_installed(elem): return elem in PMDK_TOOLS and elem in listdir('/usr/bin/') or\ elem == "pmdk" or elem + '.so' in listdir('/usr/lib64/') elements = get_libraries_names() not_installed_packages = [] for elem in elements: if not is_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_libraries_names():\n rpm_packages_path = path.join(PMDK_PATH, 'rpm', SYSTEM_ARCHITECTURE)\n libraries_names = [elem.split('-')[0] for elem in listdir(rpm_packages_path)\n if PMDK_VERSION in elem]\n return set(libraries_names)", "def get_incompatible_packages():\n pkgconf...
[ "0.7235543", "0.6945456", "0.6342976", "0.6160323", "0.6086829", "0.6032428", "0.60037297", "0.5944693", "0.5900178", "0.58960384", "0.58750695", "0.58675647", "0.5866338", "0.5856483", "0.58513457", "0.5849526", "0.5832865", "0.583231", "0.58298975", "0.58112466", "0.5799085...
0.8578429
0
Returns names of rpm packages from PMDK library, which are not compatible with the current version of PMDK library.
def get_incompatible_packages(): pkgconfig_directory = '/usr/lib64/pkgconfig/' incompatibe_packages = [] libraries = get_libraries_names() - set(NO_PKG_CONFIGS) for library in libraries: with open(pkgconfig_directory + library + '.pc') as f: out = f.readlines() for line in ou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_not_installed_rpm_packages():\n def is_installed(elem):\n return elem in PMDK_TOOLS and elem in listdir('/usr/bin/') or\\\n elem == \"pmdk\" or elem + '.so' in listdir('/usr/lib64/')\n\n elements = get_libraries_names()\n not_installed_packages = []\n for elem in elements:\n ...
[ "0.7846389", "0.72225404", "0.6426748", "0.6413008", "0.63156086", "0.62599754", "0.6034742", "0.6006004", "0.59778386", "0.59747636", "0.5855276", "0.5831163", "0.5814997", "0.5813693", "0.57949054", "0.5794221", "0.5775875", "0.5775215", "0.57673746", "0.5766722", "0.575691...
0.74688727
1