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
Returns string equivalent metric tensor for arbitrary signature (n+1,1).
def arbitrary_metric_conformal(n): str1 = ','.join(n*[n*'# '+'0 0']) return ','.join([str1, n*'0 '+'1 0', n*'0 '+'0 -1'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generatetensorstring(n, *args):\n out = ''\n label = 0\n arg = array(args) - 1\n\n for i in range(0, n):\n if i in arg:\n label += 1\n out += str(label)\n else:\n out += '0'\n return out", "def arbitrary_metric(n):\n return ','.join(n*[(n*'# ')...
[ "0.7335266", "0.6614944", "0.5870445", "0.57487804", "0.5631736", "0.5613404", "0.5613404", "0.5605873", "0.55608094", "0.5559182", "0.55332357", "0.5525293", "0.549704", "0.549111", "0.5484398", "0.5404831", "0.5387937", "0.5379831", "0.5376238", "0.5356729", "0.53442824", ...
0.675217
1
Initialization of multivector X. Inputs are as follows mvtype base result default default Zero multivector 'basisvector' int i ith basis vector 'basisbivector' int i ith basis bivector 'scalar' x scalar of value x 's' 'grade' [A] X.grade(i) = A 's,i' 'vector' [A] X.grade(1) = [A] 's' 'grade2' or 'bivector' [A] X.grade(...
def __init__(self, base=None, mvtype=None, fct=False, blade_rep=False): def make_scalar(self, base): # make a scalar (grade 0) if isinstance(base, str): if self.fct: self.obj = Function(base)(*MV.coords) * MV.ONE else: self.ob...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_multivector(self, mv_string: str) -> 'MultiVector':\n # Get the names of the canonical blades\n blade_name_index_map = {name: index for index, name in enumerate(self.names)}\n\n # Clean up the input string a bit\n cleaned_string = re.sub('[()]', '', mv_string)\n\n # Cre...
[ "0.5864791", "0.56299835", "0.5587006", "0.5300526", "0.5234044", "0.51684433", "0.5098225", "0.5004577", "0.49840516", "0.48754478", "0.48539126", "0.48526686", "0.48297414", "0.48215443", "0.47922993", "0.47744957", "0.47716647", "0.47507182", "0.47472134", "0.47345725", "0...
0.5945704
0
blst is a list of integers [i_{1},...,i_{r}] representing the geometric product of r basis vectors a_{{i_1}}...a_{{i_r}}. reduce_basis_loop searches along the list [i_{1},...,i_{r}] untill it finds i_{j} == i_{j+1} and in this case contracts the list, or if i_{j} > i_{j+1} it revises the list (~i_{j} means remove i_{j}...
def reduce_basis_loop(blst): nblst = len(blst) # number of basis vectors if nblst <= 1: return True # a scalar or vector is already reduced jstep = 1 while jstep < nblst: istep = jstep - 1 if blst[istep] == blst[jstep]: # basis vectorindex is repeat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reduce_basis(blst):\n if blst == []: # blst represents scalar\n blst_coef = [S.One]\n blst_expand = [[]]\n return blst_coef, blst_expand\n blst_expand = [blst]\n blst_coef = [S.One]\n blst_flg = [False]\n # reduce untill all blst revise flgs ...
[ "0.74192554", "0.5640521", "0.5459008", "0.54296786", "0.54119235", "0.540116", "0.5336555", "0.5312872", "0.53054225", "0.52321666", "0.522779", "0.51996654", "0.51987606", "0.516643", "0.5161502", "0.5107346", "0.509456", "0.5087616", "0.50548446", "0.5050206", "0.50449675"...
0.7519971
0
Repetitively applies reduce_basis_loop to blst product representation until normal form is realized.
def reduce_basis(blst): if blst == []: # blst represents scalar blst_coef = [S.One] blst_expand = [[]] return blst_coef, blst_expand blst_expand = [blst] blst_coef = [S.One] blst_flg = [False] # reduce untill all blst revise flgs are True ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reduce_basis_loop(blst):\n nblst = len(blst) # number of basis vectors\n if nblst <= 1:\n return True # a scalar or vector is already reduced\n jstep = 1\n while jstep < nblst:\n istep = jstep - 1\n if blst[istep] == blst[jstep]: # basis vectorind...
[ "0.66939", "0.624517", "0.61524415", "0.5377774", "0.53481805", "0.52738833", "0.5265409", "0.5262873", "0.5256915", "0.5229674", "0.5219297", "0.5219084", "0.5213323", "0.5190296", "0.51787317", "0.5177017", "0.5174022", "0.5158163", "0.51551455", "0.5134983", "0.5131637", ...
0.65859497
1
basic_geometric_product assumes that mv1 and mv2 are both mulitvectors, not scalars and both are in the base and not the blade representation. No multivector flags are checked. This function is used to construct the blades from the bases.
def basic_geometric_product(obj1, obj2): def mul_table(b1, b2): return MV.base_mul_table[(b1, b2)] obj12 = bilinear_product(obj1 * obj2, mul_table) return obj12
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geometric_product(b1, b2):\n if MV.is_orthogonal:\n return MV.product_orthogonal_blades(b1, b2)\n else:\n result = MV.base_mul_table[(b1, b2)]\n return result", "def product(m1, m2, *, algebra):\r\n if algebra.generic:\r\n return product_generic(m1, m2...
[ "0.7294823", "0.610592", "0.59556174", "0.5919792", "0.59137595", "0.57840294", "0.576036", "0.57155263", "0.5543547", "0.55077744", "0.54841685", "0.5473713", "0.54708713", "0.54593825", "0.542873", "0.53812945", "0.53635", "0.53552055", "0.5343255", "0.53025746", "0.5300780...
0.6998385
1
geometric_product(b1, b2) calculates the geometric product of the multivectors b1 and b2 (b1b2).
def geometric_product(b1, b2): if MV.is_orthogonal: return MV.product_orthogonal_blades(b1, b2) else: result = MV.base_mul_table[(b1, b2)] return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def basic_geometric_product(obj1, obj2):\n def mul_table(b1, b2):\n return MV.base_mul_table[(b1, b2)]\n\n obj12 = bilinear_product(obj1 * obj2, mul_table)\n\n return obj12", "def product_on_basis(self, g1, g2):\n return self.monomial(g1 * g2)", "def product(m1, m...
[ "0.75844187", "0.7164965", "0.6578136", "0.64436394", "0.63663024", "0.63341844", "0.61727136", "0.61528414", "0.6012372", "0.600324", "0.596329", "0.5945704", "0.59392905", "0.5894978", "0.58771664", "0.5858963", "0.5858153", "0.58371806", "0.5816208", "0.57996815", "0.57971...
0.8940799
0
basic_add assummes that mv1 and mv2 are multivectors both in the base or blade representation. It sets no flags for the output and forms mv1.obj+mv2.obj. It is used to form the base expansion of the blades.
def basic_add(mv1, mv2): obj = expand(mv1.obj + mv2.obj) return MV(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __add__(self, other) -> 'MultiVector':\n\n other, mv = self._checkOther(other)\n if not mv:\n if isinstance(other, np.ndarray):\n obj = self.__array__()\n return obj + other\n newValue = self.value + other.value\n\n return self._newMV(newValu...
[ "0.65701765", "0.6202356", "0.6075151", "0.6073223", "0.60088956", "0.5998455", "0.5991042", "0.596939", "0.59141076", "0.590348", "0.59015656", "0.5889864", "0.588341", "0.58491516", "0.5832951", "0.582946", "0.58226776", "0.5811619", "0.57894444", "0.57894444", "0.578164", ...
0.77825725
0
basic_sub assummes that mv1 and mv2 are multivectors both in the base or blade representation. It sets no flags for the output and forms mv1.objmv2.obj. It is used to form the base expansion of the blades.
def basic_sub(mv1, mv2): obj = expand(mv1.obj - mv2.obj) return MV(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __rsub__(self, other) -> 'MultiVector':\n\n other, mv = self._checkOther(other)\n if not mv:\n if isinstance(other, np.ndarray):\n obj = self.__array__()\n return other - obj\n newValue = other.value - self.value\n\n return self._newMV(newVal...
[ "0.557827", "0.53695613", "0.53142464", "0.5300189", "0.5257704", "0.523283", "0.51847106", "0.51273334", "0.51244754", "0.50942093", "0.5087423", "0.5071045", "0.504296", "0.49870265", "0.49753162", "0.49314412", "0.4930154", "0.4919905", "0.4870767", "0.4870767", "0.4864468...
0.7241678
0
MV.setup() creates all the arrays and dictionaries required to construct, multiply, add, and differentiate multivectors in linear and curvilinear coordinate systems. The inputs to MV.setup() are as follows
def setup(basis, metric=None, coords=None, rframe=False, debug=False, curv=(None, None)): MV.print_blades = False MV.connection = False MV.ONE = ONE_NC MV.basis_vectors = Vector.setup(basis, metric=metric, coords=coords, curv=curv, debug=debug) MV.curv_norm = curv[1] MV...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, m, vectors = None, dimensions = None, shape = None):\n\n if len(m) == 0:\n\n if dimensions is None or shape is None:\n raise ValueError(\"Empty input: could not determine number of dimensions and/or shape of tight-binding blocks\")\n\n if not isinstanc...
[ "0.6173127", "0.6024267", "0.5991427", "0.5930524", "0.5871141", "0.5857915", "0.58415943", "0.57747877", "0.57653034", "0.5739402", "0.5713214", "0.5695451", "0.5690959", "0.5658733", "0.5652546", "0.56463075", "0.56383073", "0.56313884", "0.5623318", "0.56146264", "0.560566...
0.627566
0
Turn on the galgebraaware string printer. This function is intended for interactive use only. Use
def ga_print_on(): GA_Printer._on() return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def graphic_auto():\r\n print(\"\\nCe mode n'est pas supporté. Passez en affichage textuel pour le mode automatique\")", "def _sympystr(self, printer: StrPrinter, *args: Any) -> str:\n return self.__str__()", "def setPrint():\n (e,d,sr,sw) = codecs.lookup('utf-8')\n unicode_to_utf8 = sw(sys.std...
[ "0.5538108", "0.5525539", "0.5430061", "0.5383011", "0.5338082", "0.5306781", "0.52800083", "0.5246761", "0.52052337", "0.51956373", "0.5180933", "0.51808774", "0.51637495", "0.515028", "0.5118401", "0.5114532", "0.50874585", "0.5075697", "0.50739366", "0.5056623", "0.5042328...
0.57592547
0
Turn off the galgebraaware string printer. This function is intended for interactive use only. See ga_print_on for the noninteractive technique.
def ga_print_off(): GA_Printer._off() return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def off(self):\n self.log.debug(\"Turning Off GI String\")\n self.send('GI:' + self.number + ',00')", "def clear_print(): #py:clear_print\n RUR._clear_print_()", "def setVerboseDebugOff(self):\n self.edLogging.setVerboseDebugOff()", "def disable(self):\n self.write(\":OUTPUT O...
[ "0.5968523", "0.5947648", "0.56971455", "0.5696629", "0.5670645", "0.56590736", "0.5643402", "0.560675", "0.55705297", "0.546668", "0.5341625", "0.53399086", "0.5332385", "0.5318964", "0.5292575", "0.5262038", "0.52124405", "0.52119297", "0.52096134", "0.5162625", "0.5157773"...
0.7837262
0
Walk through subscribers and call each
def notify(self) -> None: for s in self.subscribers: s()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def call_subscribers(self, *args, **kwargs) -> None:\n for subscriber in self.get_subscribers():\n subscriber(*args, **kwargs)", "def subscribers(self) -> Iterator[Any]:\n yield from self.get_subscribers()", "def iter_subscribers(self) -> Iterable[Subscriber]:\n s = self._subscr...
[ "0.84120554", "0.7723482", "0.73185205", "0.69558495", "0.6913707", "0.68804014", "0.6766491", "0.6569695", "0.65439785", "0.65062094", "0.6404035", "0.63797355", "0.63797355", "0.63797355", "0.6377038", "0.6369277", "0.6364671", "0.6341559", "0.6341559", "0.63152725", "0.629...
0.79313534
1
Test for user registration if the email field is left blank.
def test_registeration_no_email(self): response = self.signup_a_user(self.user_lacks_email) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual(response.data["errors"]["email"], ["This field may not be blank."] ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_empty_email_field(self):\r\n result=self.user.get_user_register(\"Stephen\",\" Ochieng\",\"stephenochieng955@mail.com\",\"stephenochieng\",\"eat\")\r\n self.assertEqual(2,result,\"Fill in the email field please\")", "def validate_email(form, field):\n if User.query.filter_by...
[ "0.79143554", "0.7476595", "0.7412217", "0.7264835", "0.71948195", "0.71632093", "0.7139864", "0.71038264", "0.7100845", "0.70943457", "0.70943457", "0.7073835", "0.7070486", "0.70429677", "0.7027812", "0.70208925", "0.7011211", "0.7000811", "0.69996154", "0.69884473", "0.696...
0.77772486
1
Test for user registration if the password field is left blank.
def test_registeration_no_password(self): response = self.signup_a_user(self.user_lacks_password) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual(response.data["errors"]["password"], ["This field may not be blank."] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_empty_password_field(self):\r\n result=self.user.get_user_register(\"Stephen\",\" Ochieng\",\"stephenochieng955@mail.com\",\"stephenochieng\",\"eat\"\")\r\n self.assertEqual(2,result,\"Fill in the password field please\")", "def test_blank_password(self):\n rv = self.signup(...
[ "0.8107422", "0.74967027", "0.7491438", "0.7306149", "0.7261646", "0.7236501", "0.7218995", "0.71771955", "0.7168061", "0.71054524", "0.7092673", "0.7056072", "0.696011", "0.6956286", "0.6930456", "0.6829606", "0.68144846", "0.68116146", "0.6808691", "0.6790647", "0.6754452",...
0.77265465
1
Test for user registration if the username given email is invalid.
def test_registeration_invalid_email(self): response = self.signup_a_user(self.user_invalid_email) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual(response.data["errors"]["email"], ["Enter a valid email address."] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_register_email():\n email = request.args.get('email')\n if not email:\n return jsonify({'valid': False, 'error': 'Please provide an email address'})\n user = User.query.filter_by(email=email).first()\n if user:\n # The email already exists\n return jsonify({'valid': Fa...
[ "0.7547907", "0.74165046", "0.73967505", "0.732267", "0.72933745", "0.72748053", "0.7253366", "0.72475505", "0.7102373", "0.70894736", "0.70877165", "0.7083112", "0.707519", "0.707519", "0.70706815", "0.70548916", "0.70492876", "0.70419025", "0.70329314", "0.70305437", "0.700...
0.78273094
0
Test for user registration if a short password is given.
def test_registeration_short_password(self): response = self.signup_a_user(self.user_short_password) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertNotIn("token", response.data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_short_pwd(self):\n msg = self.user.registration(\"MrShort\",\n \"MrShort@yahoo.com\",\n \"short\",\n \"short\")\n self.assertEqual(\n msg, \"Password is too short\")", "de...
[ "0.83976233", "0.75759006", "0.7555989", "0.7475443", "0.7467976", "0.74650115", "0.740763", "0.7354399", "0.73383784", "0.7309584", "0.72784615", "0.7261508", "0.7253697", "0.72383696", "0.7179356", "0.7126384", "0.70701456", "0.7009712", "0.697496", "0.69285434", "0.6920359...
0.79427946
1
Test for user registration if the username entered already exists.
def test_registeration_duplicate_username(self): self.signup_a_user(self.user_data) response_duplicate = self.signup_a_user( self.user_data_duplicate_username) self.assertEqual(response_duplicate.status_code, status.HTTP_400_BAD_REQUEST) self.assertEq...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def username_exist_check(form, field):\n username = field.data\n user = UserModel.query(UserModel.username==username).get()\n if user:\n raise validators.ValidationError('username exists, choose a different one!')", "def test_incorrect_user_registeration_duplicate_username(self):\n with se...
[ "0.7591259", "0.7430318", "0.7417273", "0.74149245", "0.7358232", "0.7342233", "0.7337628", "0.72507143", "0.72231424", "0.72068596", "0.7179421", "0.7179032", "0.7161134", "0.71544224", "0.71408266", "0.7131557", "0.710796", "0.7104845", "0.7086091", "0.70827687", "0.70806",...
0.7743392
0
Test if user email can be successfull verified
def test_successful_email_verification(self): self.signup_a_user(self.user_data) time = datetime.now() + timedelta(hours=24) token = jwt.encode({ "email": self.user_data['user']['email'], "username": self.user_data['user']['username'], "exp": int(time.strftime...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_email(uid, token):\n return True", "def test_verifyEmailToken(self, testUser):\n test_token = testUser._get_email_verification_token()\n resulting_user, error = User.verify_email_verification_token(test_token)\n assert resulting_user == testUser\n assert error is None", ...
[ "0.75945127", "0.7247236", "0.71062005", "0.7102009", "0.6965794", "0.696194", "0.6948527", "0.6945835", "0.69084865", "0.69049275", "0.6887958", "0.6887018", "0.688298", "0.68772143", "0.68579274", "0.68569136", "0.68304384", "0.68299425", "0.68171763", "0.6811524", "0.67895...
0.76062006
0
Test if superuser lacks password during registration
def test_registeration_for_a_super_user_no_password(self): with self.assertRaisesMessage(TypeError, 'Superusers must have a password.'): User.objects.create_superuser( 'jey', 'jey@gmail.com', None )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_registeration_no_password(self):\n response = self.signup_a_user(self.user_lacks_password)\n self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)\n self.assertEqual(response.data[\"errors\"][\"password\"],\n [\"This field may not be blank.\"]\n ...
[ "0.7730721", "0.75323004", "0.7112893", "0.71118355", "0.7111212", "0.70669585", "0.69311017", "0.68940204", "0.6874378", "0.6853667", "0.68071675", "0.6781884", "0.6778523", "0.6761359", "0.6758197", "0.67377335", "0.6715638", "0.67041874", "0.6686129", "0.6680794", "0.66652...
0.7916377
0
Returns the NFL.com XML schedule URL. `year` should be an integer, `stype` should be one of the strings `PRE`, `REG` or `POST`, and `gsis_week` should be a value in the range `[0, 17]`.
def schedule_url(year, stype, week): xmlurl = 'http://www.nfl.com/ajax/scorestrip?' if stype == 'POST': week += 17 if week == 21: # NFL.com you so silly week += 1 return '%sseason=%s&seasonType=%s&week=%s' % (xmlurl, year, stype, week)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nflweek(self, irc, msg, args, optlist, optweek):\n \n url = self._b64decode('aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbmZsZ2MvYWxsU2NoZWR1bGUuanM=')\n \n usePre, useNext, outputWeek = False, False, False\n for (option, arg) in optlist:\n if option == 'pre':\n ...
[ "0.5616885", "0.5599027", "0.5584702", "0.54965335", "0.5473918", "0.54580694", "0.54052055", "0.5347304", "0.5339127", "0.52896404", "0.52048624", "0.51906604", "0.51684946", "0.5129978", "0.5076557", "0.49814737", "0.49760836", "0.49678627", "0.4946219", "0.49451348", "0.49...
0.8175423
0
Returns a list of dictionaries with information about each game in the week specified. The games are ordered by gsis_id. `year` should be an integer, `stype` should be one of the strings `PRE`, `REG` or `POST`, and `gsis_week` should be a value in the range `[1, 17]`.
def week_schedule(year, stype, week): url = schedule_url(year, stype, week) try: dom = xml.parse(urllib.request.urlopen(url)) except urllib.error.HTTPError: print >> sys.stderr, 'Could not load %s' % url return [] games = [] for g in dom.getElementsByTagName("g"): gs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_player_stats_from_game(team, year, week):", "def get_game_urls(year, week):\n base_url = \"https://www.pro-football-reference.com\"\n\n # URL for the summary of all games for a given week\n # This page has the each match up for the week and\n # a link to the detailed game stats \n url = \"...
[ "0.6665809", "0.61017793", "0.61004215", "0.6001612", "0.5903821", "0.5827948", "0.5819547", "0.5689172", "0.5586587", "0.55241364", "0.551874", "0.5498469", "0.54769766", "0.54609835", "0.54267156", "0.5334554", "0.5332943", "0.531095", "0.5307973", "0.5299174", "0.52895266"...
0.67672735
0
Updates the schedule for the given week in place. `year` should be an integer year, `stype` should be one of the strings `PRE`, `REG` or `POST`, and `week` should be an integer in the range `[1, 17]`.
def update_week(sched, year, stype, week): games = week_schedule(year, stype, week) if not games: return False for game in games: sched[game['eid']] = game return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schedule_url(year, stype, week):\n xmlurl = 'http://www.nfl.com/ajax/scorestrip?'\n if stype == 'POST':\n week += 17\n if week == 21: # NFL.com you so silly\n week += 1\n return '%sseason=%s&seasonType=%s&week=%s' % (xmlurl, year, stype, week)", "def new_schedule():\n sc...
[ "0.6161994", "0.61415374", "0.6012722", "0.57134855", "0.5687228", "0.5635037", "0.5324557", "0.5197044", "0.51190466", "0.50082874", "0.4961533", "0.4941671", "0.4897804", "0.48618266", "0.48251626", "0.48216134", "0.48010698", "0.48004752", "0.47763065", "0.47727725", "0.47...
0.7813704
0
IFieldWidget factory for MonthYearWidget.
def MonthYearFieldWidget(field, request): return z3c.form.widget.FieldWidget(field, MonthYearWidget(request))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_month_year_form(answer, answer_store, metadata, error_messages, group_instance=0):\n class MonthYearDateForm(Form):\n year = StringField()\n\n @property\n def data(self):\n data = super().data\n if not data['year'] and not data['month']:\n return...
[ "0.62484366", "0.5616301", "0.55594164", "0.5469463", "0.5385409", "0.53257436", "0.5307012", "0.52457553", "0.5240472", "0.5217904", "0.52053624", "0.5177285", "0.5167722", "0.51511526", "0.5149131", "0.51403147", "0.5138843", "0.5109565", "0.51012707", "0.50680935", "0.5066...
0.83495045
0
Parse the concept recursively by building the dependencies in a DFS.
def ParseConcept(self, parsed_args): def _ParseConcept(node): """Recursive parsing.""" if not node.is_group: fallthroughs = [] if node.arg_name: fallthroughs.append(deps_lib.ArgFallthrough(node.arg_name)) fallthroughs += node.fallthroughs return node.concept.Pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_dependencies(root):\n \n symbol_table = create_symbol_table(root)\n\n names = []\n #Set the depth of the root node\n set_depth(root, 0)\n #Stack of nodes to visit\n stack = Stack(root)\n \n #List of (src, dest) of dependencies\n dependency_table = DTable(symbol_table=symbol_t...
[ "0.5932189", "0.5616958", "0.5583157", "0.5574061", "0.551635", "0.5494592", "0.5444698", "0.54332215", "0.54161686", "0.54020333", "0.5381399", "0.5378261", "0.5371334", "0.537087", "0.53227365", "0.5284282", "0.5281907", "0.5279752", "0.52777743", "0.52580094", "0.52174854"...
0.6277191
0
Returns the marshalled dependencies or None if not marshalled.
def marshalled_dependencies(self): return self._marshalled_dependencies
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dependencies(self) -> typing.Optional[typing.List[aws_cdk.core.IDependable]]:\n return self._values.get('dependencies')", "def _get_serialized_dependencies() -> list[dict]:\n ge_execution_environment = GXExecutionEnvironment()\n dependencies: list[PackageInfo] = ge_execution_environment....
[ "0.66336", "0.6317252", "0.6160566", "0.6154664", "0.60835606", "0.6075372", "0.60691637", "0.5990367", "0.59015894", "0.5880229", "0.57658875", "0.5753441", "0.56921554", "0.56841236", "0.5587627", "0.5564383", "0.5541083", "0.5525729", "0.54924315", "0.54788554", "0.5469728...
0.80643296
0
Builds the dependency tree from the attribute.
def FromAttribute(cls, attribute): kwargs = { 'concept': attribute.concept, } marshal = attribute.concept.Marshal() if marshal: attributes = [concept.Attribute() for concept in marshal] elif not isinstance(attribute, base.Attribute): attributes = attribute.attributes else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, attribute):\n self.attribute = attribute\n self.children = {}", "def __init__(self, value=None, attribute_name=\"root\", attribute_index=None, branches=None):\r\n \r\n self.branches = [] if branches is None else branches\r\n self.attribute_name = attribute_na...
[ "0.6205591", "0.54303133", "0.5409594", "0.5385007", "0.5278372", "0.5250632", "0.52187914", "0.518745", "0.5175224", "0.51547897", "0.51407504", "0.505456", "0.5051703", "0.50377077", "0.5018684", "0.49033028", "0.48913673", "0.48817107", "0.4878731", "0.48579183", "0.485396...
0.6981778
0
Produce a graph from a graph specification string
def make_graph_from_spec(graphtype, args): parsed = parse_graph_argument(graphtype, args) assert parsed['graphtype'] == graphtype return obtain_graph(parsed)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_string(data, format):\n # Using ConjunctiveGraph instead of Graph for nquads support.\n graph = rdflib.ConjunctiveGraph()\n graph.parse(data=data, format=format)\n return graph", "def decode(self, s: str) -> Graph:\n tree = self.parse(s)\n return layout.interpret(tree, self.mod...
[ "0.72229034", "0.65314263", "0.630098", "0.6145521", "0.5966661", "0.58902687", "0.58687323", "0.5811371", "0.5789124", "0.5778046", "0.5770304", "0.57410806", "0.57179654", "0.57134116", "0.5706407", "0.567618", "0.56655943", "0.56653327", "0.56520647", "0.56509197", "0.5625...
0.73010737
0
Create an Argparse action for the appropriate graph type
def _make_graph_action(graphtype): class X(ObtainGraphAction): def __init__(self, option_strings, dest, nargs=None, **kwargs): if nargs is not None: raise ValueError("nargs not allowed") super(ObtainSimpleGraph, self).__init__(option_strings, dest, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cmd_type(args):", "def build_parser(self, parser: ArgumentParser) -> None:", "def parse_arg():\n parser = argparse.ArgumentParser()\n parser.add_argument('--model', type=str, default='stylegan', choices=['vanilla', 'stylegan'])\n parser.add_argument('--mode', type=str, default='sample', choices=['...
[ "0.59044886", "0.5609354", "0.55502117", "0.55225414", "0.5513847", "0.54993194", "0.54445225", "0.543972", "0.54150474", "0.540011", "0.53757983", "0.53718716", "0.5364547", "0.5339465", "0.5327935", "0.5322697", "0.53149366", "0.5303954", "0.5284009", "0.52825195", "0.52754...
0.718014
0
. sdssArchie populates a directory with links to raw images from the SDSS mission. These images are all in FITS format and suitable for reprojection, moaicking, etc.
def sdssDownload(band, location, size, path): debug = 0 # Build the URL to get image metadata url = "http://montage.ipac.caltech.edu/cgi-bin/ArchiveList/nph-archivelist?survey=SDSSDR7+" \ + urllib.parse.quote_plus(band) \ + "&location=" \ + urllib.parse.quote_plus(locatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_dataset_ssdd(xml_path, source_img_path, save_img_path):\r\n if not os.path.exists(xml_path):\r\n raise FileExistsError('path not found! : %s' % xml_path)\r\n if not os.path.exists(source_img_path):\r\n raise FileExistsError('path not found! : %s' % source_img_path)\r\n os.makedirs(sa...
[ "0.55155456", "0.5476172", "0.54450047", "0.5224515", "0.52012366", "0.51884437", "0.51854724", "0.5174322", "0.5080309", "0.5073184", "0.50654817", "0.50591475", "0.5052409", "0.50509655", "0.5030141", "0.50101596", "0.50072604", "0.50005573", "0.49802643", "0.4974658", "0.4...
0.6716102
0
find living area(businesscluster)/user_group(user_cluster) from user[review]business pattern use pyspark.mlib.fpm.FPGrowth ?
def livingAreaFromPattern(business_list): print("livingAreaFromUser") dataset_path = "../dataset/yelp_dataset_challenge_academic_dataset/" review_path = dataset_path + "yelp_academic_dataset_review.json" # make empty user list for each business business_user_list = {} # mine user set from business...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_membership_occupancy(data):\n \n \n \n n_clusters = len(set(data['clusters'])-{-1}) # since -1 element denotes noice\n\n if n_clusters == 0:\n membership=[Cluster_Membership_Features()]\n membership = pd.DataFrame([o.__dict__ for o in membership])\n areas=[Cluster_Ar...
[ "0.52797246", "0.52199507", "0.5210768", "0.5193586", "0.5083459", "0.505313", "0.49605098", "0.49023223", "0.48352116", "0.48323983", "0.48208183", "0.48178968", "0.48000693", "0.47976232", "0.47464606", "0.47443205", "0.4720602", "0.46867013", "0.46766102", "0.4675779", "0....
0.66381836
0
dpy test open.core.betterself.tests.views.test_supplement_log_views.TestSupplementLogViews.test_display_name_on_log_serializer_some_hours_ago keepdb
def test_display_name_on_log_serializer_some_hours_ago(self): supplement = SupplementFactory(user=self.user_1) utc_now = get_utc_now() # if you adjust it this way, it should result in about 4.5 hours ago time = get_time_relative_units_ago(utc_now, hours=5.0) time = get_time_rela...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_view(self):\n symbol = 'NFLX'\n table = 'option'\n path = os.path.join(CLEAN_DIR, '__%s__.h5' % symbol.lower())\n db = pd.HDFStore(path)\n df_valid = db.select('%s/valid/normal' % table)\n df_clean = db.select('%s/clean/normal' % table)\n db.close()\n\n ...
[ "0.65981513", "0.6052977", "0.5761027", "0.5758195", "0.56305027", "0.5629243", "0.56134623", "0.5595543", "0.55493367", "0.554384", "0.55271995", "0.55213636", "0.5514271", "0.5513057", "0.5480352", "0.54751736", "0.5472414", "0.5469077", "0.5467044", "0.54616696", "0.542556...
0.6509554
1
dpy test open.core.betterself.tests.views.test_supplement_log_views.TestSupplementLogViews.test_create_supplement_log_with_supplement_stack keepdb
def test_create_supplement_log_with_supplement_stack(self): # a hidden feature, not really restful, but allow a user to send a supplement_stack_uuid # to create a set of supplements taken at the same time supplements = SupplementFactory.create_batch(3, user=self.user_1) stack = Suppleme...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_log_create(self):\n log_count_init = LoggerHistory.objects.count()\n project = ProjectFactory.create(**{'creator': self.user})\n\n log_count = LoggerHistory.objects.count()\n self.assertEqual(log_count, log_count_init + 2)\n\n logs = LoggerHistory.objects.all().order_by(...
[ "0.55140984", "0.5488463", "0.5472687", "0.5416085", "0.5384", "0.53035986", "0.5266111", "0.52222145", "0.5215893", "0.5204896", "0.51745385", "0.5106385", "0.51032764", "0.5082029", "0.5060074", "0.5040978", "0.5037969", "0.50287753", "0.5026711", "0.50227827", "0.5015357",...
0.66104376
0
This method is for starting all worker threads. We are using three workers right now . 1. One for fetching latest instances info and adds to Queue 2. One for fetching from Queue and updating Redis 3. For updating the aggregator app , about this applications info. All are deamon threads.
def init_workers(): party_queue = Queue() p = Producer(party_queue) p.daemon = True c = Consumer(party_queue) c.deamon= True m = MasterUpdater(db,application_name) m.deamon = True p.start() c.start() m.start()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_worker_threads(self):\n \n for thread_number in range(0, self.max_workers):\n worker = DeviceWorker(self, thread_number)\n self.worker_threads.append(worker)\n worker.start()", "def run(self):\n self.loop = asyncio.new_event_loop()\n asyncio.set_...
[ "0.69211185", "0.6883585", "0.68569523", "0.6700609", "0.66060066", "0.65566313", "0.65401286", "0.6494234", "0.6476157", "0.6364482", "0.6347284", "0.63381314", "0.6334397", "0.63333243", "0.6332522", "0.6323897", "0.63228923", "0.63194346", "0.6301538", "0.6267396", "0.6245...
0.7628425
0
This endpoint is for adding threads to the application. Loadbalancer decids to go for which instances and based on that thread is added to it.
def addthread(): instance_id = os.getenv("CF_INSTANCE_INDEX") print 'Instance Id ****************%s'%instance_id thread_count = int(db.hget(application_name,instance_id)) thread_count+=1 print 'Threadcount ****************%s'%thread_count result = db.hset(application_name,str(instance_id),str(th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_thread(self, name):\n\n thread = Thread( name=name, thread_id=self._thread_id)\n self._threads.append( thread )\n self._thread_index[ name ] = self._thread_id \n\n self._thread_id += 1", "def add(self, thread: Thread) -> 'ThreadCollection':\n self.threads.append(thread)...
[ "0.61186695", "0.6037261", "0.59276444", "0.5759148", "0.57148796", "0.5704339", "0.5652928", "0.5635489", "0.56050885", "0.55989206", "0.557358", "0.54911715", "0.54561585", "0.54296136", "0.530312", "0.52900285", "0.52391607", "0.52054316", "0.5184673", "0.51762354", "0.517...
0.6699622
0
This endpoint is for deleting threads to the application. Loadbalancer decids to go for which instances and based on that thread is deleted from it.
def deletethread(): instance_id = os.getenv("CF_INSTANCE_INDEX") print 'Instance Id **************%s'%instance_id thread_count = int(db.hget(application_name,instance_id)) thread_count-=1 db.hset(application_name,instance_id,thread_count) return json.dumps({'message':'success'})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, request, *args, **kwargs):\n thread = self.get_thread()\n if not thread:\n raise NotFound(code=status.HTTP_404_NOT_FOUND)\n\n thread.userthread_set.filter(user=request.user).update(deleted=True)\n return Response(status=status.HTTP_200_OK)", "def delete_thr...
[ "0.6738103", "0.6622684", "0.6566545", "0.6066882", "0.5980656", "0.59621376", "0.5912667", "0.59076726", "0.5729367", "0.56661147", "0.56276625", "0.55877733", "0.5483106", "0.5478149", "0.54611045", "0.5445592", "0.5394832", "0.5373644", "0.5369041", "0.53478205", "0.534321...
0.7300401
0
Creates a proper filename for the given location If the given location points to directories, the returned location will contain only the filename
def create_file_location(loc: str) -> str: slash = "/" reverse_data = loc[-4:] # "/" will not be in the type of the file already in reverse_data reverse_data_ind = -4 while slash not in reverse_data: reverse_data_ind -= 1 reverse_data = loc[reverse_data_ind:] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_filename (self):\n\t\tassert self.__patient_name and self.__location_name, \"New filename could not be determined, one or more needed arguments is empty!\"\n\t\t_patient_name = self.__patient_name.split(' ')\n\t\t_patient_name.reverse()\n\t\t\n\t\treturn os.path.join(os.path.dirname(self.file._path), \"...
[ "0.6805693", "0.6518008", "0.6388743", "0.63538235", "0.63387", "0.62725794", "0.6262627", "0.62427413", "0.62051255", "0.61933726", "0.6160632", "0.613817", "0.61105317", "0.6016717", "0.5970482", "0.59570444", "0.5934276", "0.59204453", "0.5914126", "0.5911994", "0.58834434...
0.6680386
1
Split the remote URI and filename
def get_remote_uri_and_filename(uri_to_filename: str) -> tuple: wrld_wide_web = "www" slashstr = "/" begin_uri_ind = uri_to_filename.find(wrld_wide_web) end_uri_ind = uri_to_filename[begin_uri_ind:].find(slashstr) + begin_uri_ind if begin_uri_ind == -1: end_uri_ind ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def urlunsplit(urlparts):\n res = urlparse.urlunsplit(urlparts)\n if os.name == 'nt' and urlparts[0] == 'file' and '|' not in urlparts[2]:\n # UNC paths must have 4 slashes: 'file:////server/path'\n # Depending on the path in urlparts[2], urlparse.urlunsplit()\n # left only two or three ...
[ "0.62937796", "0.6218686", "0.6200895", "0.6087369", "0.60476273", "0.600817", "0.6003365", "0.59986997", "0.59732485", "0.5964299", "0.59405315", "0.5875241", "0.58545583", "0.5850874", "0.58473027", "0.583716", "0.5829513", "0.5802676", "0.57771903", "0.5771919", "0.5765623...
0.6659016
0
Receive header from the server Since bytes get received in chunks from the server, a part of the body can be fetched while retrieving the header if the HTTP command is a GET. Returns tuple Returns the data gotten from the server in bytes in a tuple with the header and the beginning part of the body, respectively
def recv_header(self) -> tuple: print("[RECV] receiving header data...") raw_data = b'' double_new_line = "\r\n\r\n" raw_double_new_line = double_new_line.encode(HttpClient.FORMAT) end_header_ind = raw_data.find(raw_double_new_line) while end_header_ind == -1: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_response_header(self):\r\n length = None\r\n encoding = \"identity\"\r\n chunked = False\r\n\r\n hdr = []\r\n while True:\r\n line = self._read_line()\r\n if not line:\r\n break\r\n hdr.append(line)\r\n\r\n for line...
[ "0.6726309", "0.6658526", "0.65284485", "0.63513744", "0.6345517", "0.6232262", "0.6210868", "0.61820525", "0.6092584", "0.5983558", "0.5924737", "0.585223", "0.5794497", "0.5770316", "0.5761275", "0.5740198", "0.57067704", "0.5695626", "0.5685245", "0.5679793", "0.56790406",...
0.7980558
0
Search the given data for image references to get from the server and update file locations in the data This function searches image references, creates image HTTP commands and sends and receives them as well as write the gotten images to .png files and update their locations in the given data string.
def update_images(self, data: str) -> str: soup = BeautifulSoup(data, 'html.parser') images = soup.find_all('img') imgs_fetched = 0 added_slash = False for img in images: img_src = [img['src']] try: img_lowsrc = img['lowsrc'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_images(deployment_key, image_data):\n\n for image_data_dict in image_data:\n\n print \"------------------>>> \" + image_data_dict['longitude']+\" \"+image_data_dict['latitude']\n\n #save the image\n image = Image(deployment_id=deployment_key,\n image_name=imag...
[ "0.56523925", "0.55404896", "0.5243077", "0.52363485", "0.5202743", "0.5199795", "0.51812476", "0.51698273", "0.516844", "0.5163222", "0.5150527", "0.5147897", "0.5147299", "0.5144263", "0.5133299", "0.51263857", "0.51242083", "0.50927204", "0.50801075", "0.5058242", "0.50564...
0.7407984
0
Write the given data in bytes to the file specified by the given location
def write_to_binary_file(self, loc: str, data: bytes): try: os.mkdir("../" + self.uri) except FileExistsError: pass f = open("../" + self.uri + loc, "wb") f.write(data) print("[WRITE] written to binary file loc") f.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def saveFile(self, data, filelocation):\n with open(filelocation, 'w+') as f:\n f.write(data)", "def _write(self, location, data):\n self._connector.write(location=location, data=data)", "def WriteFile(fname, data):\n #self._out.Info(\"Write file '%s' size %d (%#0x)\" %\n ...
[ "0.7691357", "0.7292099", "0.70110595", "0.6999185", "0.6913213", "0.6899446", "0.6837154", "0.6831176", "0.67579323", "0.67032653", "0.6694929", "0.66886604", "0.6682146", "0.6645691", "0.66213727", "0.6594393", "0.65671325", "0.6493949", "0.6468906", "0.6445375", "0.6416940...
0.7901474
0
just return the data field without validation or cleaning
def clean_data(self): return self.instance.data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _clean(self):\n return self._cleaned_data", "def clean(self):\n cleaned_data = super().clean()\n cleaned_data = {key: field for key, field in cleaned_data.items()\n if field is not None}\n return cleaned_data", "def clean(self):\n return self.cleane...
[ "0.6897902", "0.6809394", "0.6758481", "0.6635496", "0.65225774", "0.6479827", "0.6264334", "0.61400473", "0.61306554", "0.61287683", "0.6101665", "0.6072879", "0.6037578", "0.5995208", "0.598719", "0.59713817", "0.5957951", "0.5946828", "0.592844", "0.59206504", "0.5918018",...
0.70667255
0
Upload a batch of bulk SMS messages for the given batch. Delete the temp file after we're done. Assumes the file is valid (run is_file_valid on it first!)
def upload_bulk_sms_file(batch_id, file_path): batch = Batch.objects.get(id=batch_id) batch.add_messages(read_messages_from_file(file_path)) batch.status = Batch.PENDING batch.save()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_batch_upload(\n large_upload_collection: UploadCollection,\n fake_session: HexpySession,\n caplog: CaptureFixture,\n) -> None:\n responses.add(\n responses.POST, HexpySession.ROOT + \"content/upload\", json={}, status=200\n )\n\n client = ContentUploadAPI(fake_session)\n\n with...
[ "0.60872424", "0.6074862", "0.6071004", "0.5761583", "0.5742203", "0.56967413", "0.5694419", "0.5675369", "0.5652757", "0.56240517", "0.5594879", "0.5551266", "0.5516878", "0.5437645", "0.54255754", "0.54190534", "0.53817254", "0.5378776", "0.5368394", "0.53422683", "0.528414...
0.76303023
0
Generator that yields (phone_number, message_text, from_shortcode) tuples for the phone numbers that we need to send this reminder to.
def get_phone_numbers_to_send_to(self): # Get the phone numbers we want to send to, excluding those that have # already done the thing we want to remind them of phone_numbers = self.PhoneModel.objects.exclude(phone_number__in=self.to_exclude())\ .va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def import_(cls, contact):\n assert not isinstance(message, PhoneMessage)\n ret = PhoneMessage(peer=message.peer,text=message.text,timestamp=message.timestamp,direction=message.direction,status=message.status)\n yield ret", "def import_(cls, contact):\n assert not isinstance(message, ...
[ "0.5719036", "0.5719036", "0.56990075", "0.5694666", "0.56109744", "0.5564422", "0.5556031", "0.5551733", "0.54962224", "0.5310059", "0.52897495", "0.5231164", "0.5210091", "0.5202274", "0.51038384", "0.5088225", "0.5055888", "0.50017893", "0.49557918", "0.49384242", "0.49111...
0.75832903
0
Return list of phone numbers to exclude
def to_exclude(self): midnight = now().replace(hour=0, minute=0, microsecond=0) return CenterOpen.objects.filter( creation_date__gte=midnight, ).values_list('phone_number', flat=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_exclude(self):\n reporting_period = self.message_number - 3\n one_day_ago = now() - datetime.timedelta(hours=24)\n\n return PollingReport.objects.filter(\n period_number=reporting_period,\n creation_date__gte=one_day_ago,\n ).values_list('phone_number', flat...
[ "0.68836176", "0.6817019", "0.6605563", "0.6385881", "0.6231758", "0.6127829", "0.5994405", "0.5945233", "0.5879907", "0.58594704", "0.5847167", "0.5825994", "0.57723284", "0.57659954", "0.56730187", "0.56591904", "0.56587076", "0.5578085", "0.55595624", "0.54801834", "0.5466...
0.7004097
0
Return list of phone numbers to exclude
def to_exclude(self): reporting_period = self.message_number - 3 one_day_ago = now() - datetime.timedelta(hours=24) return PollingReport.objects.filter( period_number=reporting_period, creation_date__gte=one_day_ago, ).values_list('phone_number', flat=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_exclude(self):\n midnight = now().replace(hour=0, minute=0, microsecond=0)\n return CenterOpen.objects.filter(\n creation_date__gte=midnight,\n ).values_list('phone_number', flat=True)", "def get_phone_numbers(r):\n phone_match = re.findall(r'\\d\\d\\d-\\d\\d\\d-\\d\\d\\...
[ "0.7004097", "0.6817019", "0.6605563", "0.6385881", "0.6231758", "0.6127829", "0.5994405", "0.5945233", "0.5879907", "0.58594704", "0.5847167", "0.5825994", "0.57723284", "0.57659954", "0.56730187", "0.56591904", "0.56587076", "0.5578085", "0.55595624", "0.54801834", "0.54669...
0.68836176
1
checks for the existence of index.json in our container this should contain a list of the known environments
def load_footprints(self): # container = self.cf.get_container(self.container_name) try: index = self.container.get_object("index.json") except pyrax.exceptions.NoSuchObject, e: logging.warning(e.message) index = None return False ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_environment_json():\n for l in list(environments.data):\n e = environments[l]\n assert len(json.dumps(e.json())) > 0", "def index_exists(self, index):\n req = requests.head(\n urljoin(self.base_url, '{0}'.format(index)),\n verify=self.verify_certs)\n ...
[ "0.59280825", "0.5806982", "0.56054586", "0.56054586", "0.55998284", "0.55643755", "0.55463576", "0.5510609", "0.5477762", "0.54507244", "0.54284483", "0.53760177", "0.5251548", "0.5230927", "0.5225034", "0.5213105", "0.52022856", "0.5189031", "0.51847184", "0.51796925", "0.5...
0.5837648
1
Stops a footprint. Doesn't save beforehand...
def stop_footprint(self, fpname): logging.debug("%s entered" % __name__) fp = self.get_footprint(fpname, start=False) if fp.footprint_status == 'locked': notify("Footprint is locked. use 'vcauto unlock %s' to unlock" % fpname) return False fp.stop()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop():", "def stop():", "def stop():", "def stop():", "def stop() -> None:", "def ShutDown(self):\n self.stop = True", "def _stop(self):\n self.display_end_message()", "def stop(self) -> None:", "def stop(self) -> None:", "def stop(self):\n self.halt = True", "def stop(sel...
[ "0.7043337", "0.7043337", "0.7043337", "0.7043337", "0.6996987", "0.6845476", "0.6798433", "0.67666304", "0.67666304", "0.6745605", "0.6719792", "0.6719792", "0.6713029", "0.6694422", "0.6664728", "0.6641678", "0.6641678", "0.6641678", "0.6641678", "0.6641678", "0.6641678", ...
0.7369448
0
Cleans up old images for a footprint
def cleanup_footprint(self, fpname): logging.debug("Environment: %s entered" % __name__) fp = self.get_footprint(fpname, start=False) fp.cleanup_old_images() fp.save()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup_old_images(self):\n \n logging.debug(\"%s cleanup_old_images entered\" % self.footprint_name)\n active_imgs = self.images.values()\n old_images = self.old_images[:]\n for img_id in old_images:\n logging.info(\"Deleting image %s from footprint %s\" % (img_id...
[ "0.7728984", "0.68751556", "0.6851496", "0.6813197", "0.68120325", "0.6710279", "0.66899776", "0.66793317", "0.6670238", "0.66463476", "0.6640301", "0.6638297", "0.66006744", "0.6594191", "0.6556678", "0.6501267", "0.64649165", "0.64532274", "0.64403", "0.6423079", "0.6415412...
0.7514244
1
If the machine is up and running, returns true. Otherwise, false
def isup(self): if self.cloudserver: # print self.cloudserver.status if self.cloudserver.status in ("ACTIVE",): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_running(self):\n status = self.get_status_response()\n return ((status[1] & 2) == 2)\n #end is_running()", "def is_host_on(self):\n status = False\n cmd = \"/usr/local/bin/wedge_power.sh status\"\n data = run_shell_cmd(cmd)\n Logger.info(\"[FSCD Testing] Ex...
[ "0.7330963", "0.72654027", "0.71712124", "0.7063742", "0.70420057", "0.69943506", "0.69807935", "0.69802505", "0.69777983", "0.69452125", "0.69422954", "0.69337684", "0.6929303", "0.69289416", "0.69059473", "0.6869076", "0.6848751", "0.68291354", "0.67952394", "0.67810994", "...
0.7490606
0
Loads a machine configuration from UUID
def load(self, uuid): try: self.cloudserver = cs.servers.find(id=uuid) except novaclient.exceptions.NotFound, e: logging.warn("MACHINE LOAD: %s" % (e.message)) self.cloudserver = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_uuid(hass, filename=UPDATER_UUID_FILE):\n try:\n with open(hass.config.path(filename)) as fptr:\n jsonf = json.loads(fptr.read())\n return uuid.UUID(jsonf['uuid'], version=4).hex\n except (ValueError, AttributeError):\n return None\n except FileNotFoundError:\...
[ "0.6147094", "0.57746917", "0.5625065", "0.5610705", "0.55276257", "0.54724026", "0.54303753", "0.5414847", "0.5411107", "0.5402537", "0.5385142", "0.53720784", "0.536935", "0.5362943", "0.53380674", "0.53305805", "0.5315731", "0.5303435", "0.5303292", "0.5229692", "0.5215051...
0.6848256
0
returns the image id for this server's image if no images are available, returns false
def get_image(self): logging.debug("%s get_image entered" % str(self.machine_name)) snapshots = cs.list_snapshots() # find the one for this server if self.cloudserver: server_id = self.cloudserver.id else: return self.image_id for snapshot in snap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_image_id(image):\n if not is_valid_image(image):\n return False\n\n return AVAILABLE_IMAGES[image]['imageid']", "def __get_image_id(self):\n return self.__get_multi_images_ids(1)", "def image(image_id):\n\n found = False\n img = None\n \n try:\n for img in api.get_all_images(...
[ "0.7939803", "0.6910872", "0.6902494", "0.68787456", "0.68787456", "0.68402404", "0.68402404", "0.67526597", "0.67297727", "0.6713687", "0.66430134", "0.6589573", "0.6473954", "0.64638543", "0.6452316", "0.6434772", "0.64255714", "0.63007826", "0.6255115", "0.6236525", "0.623...
0.7042216
1
creates a network object based on a UUID
def load(self, uuid, start=False): try: self.cloudnet = cn.find(id=uuid) except pyrax.exceptions.NotFound: logging.debug("Net '%s' not found" % uuid) notify("Net %s not found" % uuid) if start: logging.info("Creating saved network %s" % str...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def network_create(request, **kwargs):\n LOG.debug(\"network_create(): kwargs = %s\", kwargs)\n if 'tenant_id' not in kwargs:\n kwargs['tenant_id'] = request.user.project_id\n body = {'network': kwargs}\n network = neutronclient(request).create_network(body=body).get('network')\n return Netwo...
[ "0.6062799", "0.603502", "0.582513", "0.5787245", "0.5766916", "0.5711439", "0.56836003", "0.5682199", "0.5682199", "0.5662838", "0.56615597", "0.5657272", "0.5600276", "0.55921495", "0.55897397", "0.55331975", "0.55121243", "0.5499216", "0.5496342", "0.5491063", "0.5463536",...
0.64101815
0
Loads machines in this footprint from a saved configuration
def load_machines(self, start=False): logging.debug("%s load_machines entered" % self) all_containers = cf.list_containers() if self.container_name in all_containers: logging.info("Found existing container, checking for machine configuration") mycontainer = cf.get_contain...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loadData(self):\n machineToNode = {}\n self.listOfMachines = []\n nextID = 0\n self.processingSteps = []\n with open(self.filename) as f:\n lines = f.read().splitlines()\n for line in lines:\n formatted = line.split(\"\\t\")\n ...
[ "0.6219401", "0.60637736", "0.6025016", "0.5973482", "0.58529407", "0.5671862", "0.5639537", "0.5555861", "0.5542145", "0.5535792", "0.55310524", "0.5508809", "0.5501766", "0.5488466", "0.5480206", "0.547936", "0.54793215", "0.5475674", "0.54564184", "0.54383266", "0.542272",...
0.68753
0
creates a network using the config file
def create_networks(self, force=False): # FIXME: debugging here logging.debug("create_networks called") # check for an existing configuration file... # logging.debug("networks: %s" % self.infra.get("networks")) networks = self.infra.get("networks") for net in networks.ke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _build_network(self):\n pass", "def build_network(config):\n network_cfg = config['network']\n\n network_name = network_cfg['name']\n\n network_params = list(inspect.signature(eval(network_name).__init__).parameters)[1:]\n\n args = [f'{param}={network_cfg[param]}' for param in network_para...
[ "0.6915689", "0.68071264", "0.6689674", "0.6628101", "0.6618998", "0.6616645", "0.6526357", "0.65202266", "0.648277", "0.6478787", "0.6444736", "0.6421923", "0.6384232", "0.63694835", "0.63689196", "0.63608533", "0.63573414", "0.63250643", "0.6324466", "0.63123256", "0.628292...
0.68759245
1
creates ALL the machines! At the end of this function, all machines should be in either ACTIVE, BUILD, SPAWNING
def create_machines(self): logging.debug("create_machines called") machines = self.infra.get("servers") for machine in machines.keys(): mconf = machines[machine] # see if the machine is already up and running # print mconf uuid = mconf.get...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createMachines():\n machines = []\n for i in range(0, num_of_machines):\n cur_machine = Machine(i)\n machines.append(cur_machine)\n return machines", "def create(self):\n\n # container for rollback mechanism\n rollback = []\n try:\n # creates a resource ...
[ "0.76316166", "0.6569155", "0.62322426", "0.6159688", "0.61554545", "0.61323273", "0.6065621", "0.6046792", "0.5981266", "0.5957129", "0.5953931", "0.5938385", "0.5913482", "0.58697325", "0.5782107", "0.57716244", "0.5718792", "0.57028174", "0.5688252", "0.5650603", "0.563867...
0.7944196
0
removes all the machines in this footprint. use with caution, obviously
def delete_machines(self): logging.debug("delete_machines called") for machine in self.machines: logging.warn("Deleting %s" % machine) print "Deleting %s" % machine cs.servers.delete(self.machines[machine])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def removeAllJobs():\n for machine in machines_list:\n cur_jobs = dict(machine.assigned_jobs)\n for key, job in cur_jobs.items():\n if key != job.number:\n print(\"SOMETHING WENT WRONG\")\n num = job.number\n machine.removeJob(num)\n # pri...
[ "0.6773899", "0.6649755", "0.66016436", "0.6241426", "0.61251307", "0.6103505", "0.60677546", "0.60047007", "0.60010695", "0.5999311", "0.5996833", "0.5980042", "0.5965853", "0.5929966", "0.59157157", "0.59010637", "0.5890948", "0.58694685", "0.5855757", "0.58315146", "0.5824...
0.66934747
1
creates a machine using the dictionary 'mconf'
def create_machine(self, mconf): logging.debug("create_machine called") mconf = self.infra['servers'][machine] logging.debug( mconf) mnets = [] for net in mconf['networks']: net = self.footprint_name + net n = nets.get(net) mnets.extend(n.get_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_machines(self):\n logging.debug(\"create_machines called\")\n machines = self.infra.get(\"servers\")\n \n for machine in machines.keys():\n mconf = machines[machine]\n # see if the machine is already up and running\n # print mconf\n ...
[ "0.6860685", "0.6659295", "0.6655527", "0.64740914", "0.6308551", "0.6280909", "0.6268223", "0.610979", "0.60430926", "0.587755", "0.58630854", "0.5851866", "0.5847064", "0.57532233", "0.5665835", "0.5662811", "0.5652065", "0.5631715", "0.5607754", "0.5598763", "0.55778795", ...
0.76968414
0
Stops my running machines and Networks
def stop(self): logging.debug("footprint/stop entered") logging.info("Stopping cloud instances") print "Stopping machines" for machine in self.machines: logging.debug("stopping %s" % machine) server = self.machines[machine] server.stop() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop():\n server = current_server()\n server.stop()", "def stop_network(self):\n self.net.stop()\n cleanup()", "def stop_machines(args):\n session = Session()\n finder = MachineFinder(args.finder)\n machines = finder.find_machines(session)\n print \"Machines Found: %d\" % (l...
[ "0.74034405", "0.7331", "0.72250396", "0.7217169", "0.7147028", "0.71102506", "0.71032614", "0.7041442", "0.7028625", "0.7012726", "0.70068556", "0.6982688", "0.6973177", "0.69675374", "0.68966967", "0.68966967", "0.68966967", "0.68966967", "0.6891113", "0.6874908", "0.686650...
0.81897783
0
gets rid of the images that are in self.old_images
def cleanup_old_images(self): logging.debug("%s cleanup_old_images entered" % self.footprint_name) active_imgs = self.images.values() old_images = self.old_images[:] for img_id in old_images: logging.info("Deleting image %s from footprint %s" % (img_id, self.footprin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup_images(self, remove_old=False, raise_on_error=False):\n used_images = set(self.inspect_container(container['Id'])['Image']\n for container in self.containers(all=True))\n image_dependencies = ((image['Id'], image['ParentId']) for image in self.images(all=True))\n ...
[ "0.71753365", "0.71657157", "0.7112273", "0.6806083", "0.6705047", "0.67038685", "0.6515299", "0.65073246", "0.6493095", "0.6474456", "0.6471966", "0.64409673", "0.64349556", "0.6318989", "0.63066757", "0.62962", "0.6290896", "0.62616545", "0.62310565", "0.62105197", "0.61754...
0.78869724
0
Decorator used to mark test as unstable, on failure test will be skipped
def unstable_test(reason): def decor(f): @functools.wraps(f) def inner(self, *args, **kwargs): try: return f(self, *args, **kwargs) except Exception as e: msg = ("%s was marked as unstable because of %s, " "failure was: %...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_tolerate_decorated_function_raise_if_disabled():\n def test_function():\n raise AttributeError()\n fn = tolerate()(test_function)\n # disable\n tolerate.disabled = True\n fn()", "def nottest(func):\n func.__test__ = False\n return func", "def test_skip_with_decorator_and_re...
[ "0.6815152", "0.6798022", "0.6399966", "0.63713986", "0.6351152", "0.6224526", "0.62141585", "0.61629665", "0.61518234", "0.61411357", "0.61333674", "0.61102664", "0.60946846", "0.60712504", "0.6062093", "0.6051325", "0.60307455", "0.59463334", "0.5942542", "0.59260625", "0.5...
0.8009059
0
Moves the bat so that it's horizontal center matches the `mouse`'s x coordinate
def follow_mouse(self, mouse): half_width = self.width() / 2 self.left = mouse.get_x() - half_width self.right = mouse.get_x() + half_width
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def center_on_mouse(w):\n root=w.get_toplevel().get_root_window()\n (screen, x, y, mod) = root.get_display().get_pointer()\n r = screen.get_monitor_geometry(screen.get_monitor_at_point(x, y))\n\n # Let's try to center the window on the mouse as much as possible.\n width, height = w.get_size()\n\n ...
[ "0.6708827", "0.663107", "0.6538599", "0.6505084", "0.64959896", "0.6494877", "0.6483131", "0.6474495", "0.6442556", "0.6411922", "0.636627", "0.6366057", "0.6353346", "0.6341614", "0.6323766", "0.6273625", "0.62531394", "0.6246571", "0.62312543", "0.6217553", "0.62078714", ...
0.6882362
0
Test SDPS is closed by default.
def test_open_close(): spds = SDPS(VirtualDevice(), 'MX28') assert not spds.is_opened spds.open() assert spds.is_opened spds.open() #TODO: analyze caplog, there should be no new records assert spds.is_opened
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tearDown(self):\n\n self.ssx.close()\n\tself.ether_linux.close()", "def close_epd():\n if not epd:\n return\n epd.sleep()\n epd.Dev_exit()\n # epd2in13_V2.epdconfig.module_exit()", "def test_close():\n while True:\n yield", "def close():", "def close(self):\n ...
[ "0.6117834", "0.59781855", "0.5928616", "0.5864863", "0.57755136", "0.5764428", "0.57200724", "0.57200724", "0.57200724", "0.57200724", "0.56916636", "0.56903917", "0.56810856", "0.566714", "0.56270903", "0.56155586", "0.5615163", "0.559969", "0.55993295", "0.5591073", "0.558...
0.79550093
0
Lists the datasets of given type.
def list_datasets(self): if self.list_type == "base": ds = Dataset(f"{self.pool}/iocage/releases").get_dependents() elif self.list_type == "template": ds = Dataset( f"{self.pool}/iocage/templates").get_dependents() else: ds = Dataset(f"{self.po...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_dataset(filename, type = 'roi'):\n import os\n import numpy as np\n\n root,camera_name,dataset_name,chunk,extension = split_raw_filename(filename)\n lst_dir = os.listdir(root)\n lst_dataset = []\n lst_order = []\n for item in lst_dir:\n if item.find(camera_name+'_'+dataset_name...
[ "0.70378935", "0.6865316", "0.6826336", "0.66687363", "0.6661014", "0.6492224", "0.6468444", "0.6413947", "0.63845885", "0.6371946", "0.634277", "0.63223267", "0.62534624", "0.62460375", "0.6238044", "0.6224218", "0.622276", "0.61857224", "0.6069631", "0.6054941", "0.6037386"...
0.718499
0
Filter out known triples.
def filter_triples(self, *triples: Optional[AnyTriples]) -> pandas.DataFrame: df = self.df for mapped_triples in triples: if mapped_triples is None: continue df = df[ self._contains( df=df, mapped_triples=get_mapped_triples(mapp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_triples(triples):\n mapped = {\"support\": \"sup\", \"attack\": \"att\"}\n for src, trg, rel in triples:\n yield src, trg, mapped[rel]", "def _FilterProtonsAndElectrons(self):\n self.reactants = filter(lambda c: c.compound.kegg_id not in \n ['C00080',...
[ "0.6813777", "0.6081424", "0.59989166", "0.5998013", "0.5976139", "0.5955847", "0.5940772", "0.56804806", "0.564802", "0.5636245", "0.5615253", "0.559533", "0.5566563", "0.5500882", "0.54745847", "0.5450013", "0.53927666", "0.5369526", "0.5325805", "0.5321928", "0.53131807", ...
0.61448926
1
Add columns indicating whether the triples are known.
def add_membership_columns(self, **filter_triples: Optional[AnyTriples]) -> pandas.DataFrame: df = self.df.copy() for key, mapped_triples in filter_triples.items(): if mapped_triples is None: continue df[f"in_{key}"] = self._contains( df=df, mapped...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_necessary_columns(args, custom_columns):\n # we need to add the variant's chrom, start and gene if \n # not already there.\n if custom_columns.find(\"gene\") < 0:\n custom_columns += \", gene\"\n if custom_columns.find(\"start\") < 0:\n custom_columns += \", start\"\n \n ...
[ "0.562762", "0.5550908", "0.5445135", "0.52890366", "0.5256663", "0.52413803", "0.51965714", "0.51795316", "0.51790893", "0.5166947", "0.51399446", "0.5127369", "0.5103183", "0.5096646", "0.5071032", "0.5071032", "0.5071032", "0.5071032", "0.5071032", "0.5071032", "0.5071032"...
0.5838496
0
Finalize the result to build a score pack.
def finalize(self) -> ScorePack: return _build_pack(result=self.result, scores=self.scores, flatten=self.flatten)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def finalize(self):\n\t\tif self._sum_factor != 0.0:\n\t\t\tself._last_score = self._current_score / self._sum_factor\n\t\telse:\n\t\t\tself._last_score = 0.0\n\n\t\tself._scores.append(self._last_score)\n\t\tself._scores = self._scores[-self._range[1]:]\n\t\n\t\tself._sum_factor = 0.0\n\t\tself._current_score = 0...
[ "0.64929175", "0.622959", "0.61430496", "0.59670115", "0.586202", "0.586202", "0.5779755", "0.5779755", "0.5779755", "0.5779755", "0.5779755", "0.5779755", "0.5755986", "0.574902", "0.57053846", "0.5704968", "0.56878275", "0.5685002", "0.56383765", "0.5637584", "0.5634387", ...
0.8922027
0
Predict scores for triples in batches.
def _predict_triples_batched( model: Model, mapped_triples: MappedTriples, batch_size: int, *, mode: Optional[InductiveMode], ) -> torch.FloatTensor: return torch.cat( [ model.predict_hrt(hrt_batch=hrt_batch, mode=mode) for hrt_batch in mapped_triples.split(split_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def batched_predict(model, batcher, batch_size, int_mapped_X, doc_labels):\n # Intialize batcher but dont shuffle.\n train_batcher = batcher(full_X=int_mapped_X, full_y=doc_labels,\n batch_size=batch_size, shuffle=False)\n preds = []\n for batch_X, _ in train_batcher.next_bat...
[ "0.67831933", "0.6649977", "0.6635593", "0.6554775", "0.6491951", "0.6449032", "0.6446405", "0.642895", "0.6420933", "0.6414145", "0.63964075", "0.63964075", "0.63964075", "0.63935876", "0.6353541", "0.63404864", "0.62785363", "0.62594736", "0.62131524", "0.6203044", "0.62018...
0.68329436
0
read the information of the proc_card
def read_proc_card(self,proc_card,cond=''): # Define Process ff=open(proc_card,'r') #read step by step # 1) find the begin of the definition of process # 2) read all process # 3) find multiparticle # 1) find the begin of the definition of process ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_card(name_card):\n\n card=Cards.Card(name_card)\n return card.info", "def info(rom):\n rom = ROM(rom, detect=True)", "def read_pc_cards(line_split, bc_class, temp_data):\n try:\n card = line_split[1]\n oc = bc_class.output_control\n if card == 'ADP':\n oc.pr...
[ "0.6855214", "0.6366758", "0.6203701", "0.61332", "0.60705686", "0.6004618", "0.5982571", "0.5831143", "0.58183104", "0.5806762", "0.58002955", "0.57653475", "0.5755379", "0.5754448", "0.5754256", "0.5750857", "0.5729067", "0.5687092", "0.5683945", "0.56729585", "0.5549377", ...
0.6682566
1
find the pid(s) of the fist tag in text. return the text without this tag and the pid. pid is a dictonary
def first_part_pid(self,text,pid): len_max=4 key_list=pid.keys() while 1: num=min(len_max,len(text)) if len_max==0: sys.exit('error pid dico not complete or invalid input :'+str([text[:min(3,len(text))]])+'\ \n Complete proc_info...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put_pid(html):\n pid = 1\n while \"<p>\" in html:\n pttn = \"<p id=\\\"p\"+str(pid)+\"\\\">\"\n html = html.replace(\"<p>\", pttn, 1)\n pid += 1\n return html", "def search_id(root, pid):\n for page in root.iter('page'):\n if pid == int(...
[ "0.58003074", "0.57914335", "0.5653984", "0.5537846", "0.5431429", "0.5412854", "0.53122246", "0.5279903", "0.5271768", "0.5230322", "0.52031726", "0.5202017", "0.51832134", "0.51767814", "0.51464283", "0.5146019", "0.5136489", "0.5106759", "0.50907266", "0.50770473", "0.5070...
0.71128947
0
Randomly sample wavelengths For the elements in the input parameters the linelist is generated by uniformly sampling n lines (from the input params) between the wavelength bounds, uniformly sampling the EP, exponentially sampling the EW. Then uses a general curveofgrowth (COG) to evaluate the loggf values for these lin...
def generate_random_linelist (teff,wv_bounds=(4500,5500),species_params=None,filepath=None): abund_offset_range = (-1,1) species_offset_range = (-1,1) ew_dist_width = 30 ep_range = (0,12) loggf_range = (-6.0,0.5) theta = 5040.0/teff # # TODO: remove this calculation??? # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample(self, n_samples):\n warn_str = 'Sampling routine does not guarantee positive values for '\\\n 'parameters. This can lead to undefined behavior in the '\\\n 'reconstruction routine.'\n warnings.warn(warn_str)\n parameters = self.parameters\n ...
[ "0.5653445", "0.55955446", "0.5486668", "0.54451805", "0.53694373", "0.5320008", "0.5296738", "0.52280873", "0.51915306", "0.5186858", "0.51570797", "0.5149137", "0.51367515", "0.5135647", "0.51089597", "0.50617474", "0.504159", "0.4974354", "0.49736986", "0.49644294", "0.496...
0.70306146
0
Compute up to and including the numberth Fibonacci number using a tuple.
def fibonacci_tuple(number: int) -> Tuple[int]: # TODO: Add all of the required source code for this tuple-based function # create an empty tuple that will ultimately contain the results result = () return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fibi(n):\n a, b = 0, 1\n for i in range(n):\n # fibonacci series is next no. is sum of previous two number.\n temp = a\n a = b\n # now nth fibonacci no. is sum of previous two number.\n b = temp+b\n # returning a because a changing each places\n return a", "def...
[ "0.75894666", "0.7538217", "0.75195146", "0.7448897", "0.7431259", "0.7419754", "0.73824215", "0.7370119", "0.7356644", "0.73555946", "0.7337323", "0.7304508", "0.7281281", "0.7250468", "0.7238936", "0.7233767", "0.7220419", "0.7194974", "0.7188385", "0.7179203", "0.71757513"...
0.7685388
0
Get equivalent numpy data type.
def to_numpy(self) -> np.dtype: return self._numpy_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_numpy_type(cls, dtype):\n\n import numpy as np\n\n m = {\n 'int64': cls.DATATYPE_INTEGER64,\n 'float64': cls.DATATYPE_FLOAT,\n 'object': cls.DATATYPE_TEXT # Hack. Pandas makes strings into object.\n\n }\n\n t = m.get(dtype.name, None)\n\n ...
[ "0.769732", "0.75943226", "0.73756564", "0.7314441", "0.72991663", "0.7278911", "0.7250658", "0.72166574", "0.7211531", "0.7104003", "0.7079365", "0.70540684", "0.7013266", "0.7007132", "0.70026565", "0.6982001", "0.6982001", "0.6938975", "0.6897863", "0.68970895", "0.6880126...
0.7986924
0
Get equivalent pandas data type.
def to_pandas(self) -> np.dtype: return self._pandas_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dtype(self):\n return self.dataset.dtype", "def get_data_type(self, idx):\n return(self.data[idx].dtype)", "def data_type(self):\r\n return self._data_type", "def pandas_typecast(self) -> dict:\n res = {}\n for feat in self.data_features:\n res[feat.key] = Ap...
[ "0.71331644", "0.7072568", "0.6999959", "0.69842416", "0.69832945", "0.69410366", "0.69400424", "0.6939205", "0.6939205", "0.6939205", "0.69211984", "0.68852323", "0.6871631", "0.685922", "0.6851461", "0.6834503", "0.68337905", "0.6816899", "0.6816899", "0.68114424", "0.68056...
0.775533
0
Get equivalent python data type.
def to_python(self): return self._python_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value_type(self) -> global___Type:", "def data_type():\n return DataTypeUtil.getDTypeForName(DataTypeUtil.getDtypeFromContext())", "def data_type(self):\r\n return self._data_type", "def data_type(self):\n return self._data_type", "def data_type(self):\n return self._data_type",...
[ "0.7410425", "0.7387216", "0.7316804", "0.727203", "0.727203", "0.727203", "0.7131656", "0.70684606", "0.70642436", "0.7061131", "0.70596075", "0.7056807", "0.69821095", "0.69792867", "0.6967002", "0.69436836", "0.69416994", "0.69367987", "0.6896436", "0.6880892", "0.6849164"...
0.75319296
0
Deserialize from a json loaded dictionary. The dictionary is expected to contain `dtype` and `shape` keys.
def from_json_dict(cls, **kwargs): if not {"dtype", "shape"} <= set(kwargs.keys()): raise MlflowException( "Missing keys in TensorSpec JSON. Expected to find keys `dtype` and `shape`" ) tensor_type = np.dtype(kwargs["dtype"]) tensor_shape = tuple(kwargs["s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def json_numpy_obj_hook(dct):\n if isinstance(dct, dict) and '__ndarray__' in dct:\n data = base64.b64decode(dct['__ndarray__'])\n return np.frombuffer(data, dct['dtype']).reshape(dct['shape'])\n return dct", "def json_numpy_obj_hook(dct):\n if isinstance(dct, dict) and '__ndarray__' in dc...
[ "0.6346653", "0.6346653", "0.6346653", "0.6262504", "0.6226852", "0.6124331", "0.6119451", "0.60499054", "0.6042176", "0.6040868", "0.5904905", "0.5904379", "0.5898837", "0.5881666", "0.5858799", "0.5832042", "0.5828539", "0.5815559", "0.58065915", "0.579569", "0.579569", "...
0.71330523
0
Deserialize from a json loaded dictionary. The dictionary is expected to contain `type` and `tensorspec` keys.
def from_json_dict(cls, **kwargs): if not {"tensor-spec", "type"} <= set(kwargs.keys()): raise MlflowException( "Missing keys in TensorSpec JSON. Expected to find keys `tensor-spec` and `type`" ) if kwargs["type"] != "tensor": raise MlflowException("Ty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_json_dict(cls, **kwargs):\n if not {\"dtype\", \"shape\"} <= set(kwargs.keys()):\n raise MlflowException(\n \"Missing keys in TensorSpec JSON. Expected to find keys `dtype` and `shape`\"\n )\n tensor_type = np.dtype(kwargs[\"dtype\"])\n tensor_shap...
[ "0.6717568", "0.6475844", "0.5921668", "0.57201827", "0.5712029", "0.565757", "0.556388", "0.55401796", "0.5503761", "0.55017537", "0.54763174", "0.5475381", "0.547456", "0.5465548", "0.5463203", "0.54470825", "0.5446951", "0.5446507", "0.5443184", "0.5415699", "0.5411698", ...
0.6818149
0
Return true iff this schema is specified using TensorSpec
def is_tensor_spec(self) -> bool: return self.inputs and isinstance(self.inputs[0], TensorSpec)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CanHandle(arrow_schema: pa.Schema,\n tensor_representation: schema_pb2.TensorRepresentation) -> bool:", "def HasTensor(tensor):\n return _C.HasTensor(_stringify_tensor(tensor))", "def isValidForSchema(schema):\n\n return True", "def _is_tensor(x: Any) -> bool:\n if has_ten...
[ "0.65127563", "0.61843073", "0.6171532", "0.6088138", "0.60639656", "0.605836", "0.5957792", "0.59569246", "0.5917196", "0.5877377", "0.5843759", "0.57662356", "0.57657427", "0.5760585", "0.57354224", "0.5623972", "0.56167257", "0.5597002", "0.5547964", "0.5536937", "0.552051...
0.7972583
0
Get list of required data names or range of indices if schema has no names.
def required_input_names(self) -> List[Union[str, int]]: return [x.name or i for i, x in enumerate(self.inputs) if not x.optional]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _columns(cls, schema: dsl.Source.Schema) -> typing.Sequence[str]:\n return tuple(f.name for f in schema)", "def required_names(self):\n return self.names", "def range_(headers, data):\n\tcolumn_matrix=data.get_data(headers).getT() # get columns as rows, as this makes analysis much easier ...
[ "0.5546902", "0.5545147", "0.54750943", "0.5310567", "0.5299616", "0.5286704", "0.52143526", "0.520144", "0.51530856", "0.5140516", "0.5064487", "0.5046594", "0.50444853", "0.50188786", "0.5005533", "0.49726644", "0.4968502", "0.494713", "0.4940273", "0.4896035", "0.4895277",...
0.5911899
0
Get list of optional data names or range of indices if schema has no names.
def optional_input_names(self) -> List[Union[str, int]]: return [x.name or i for i, x in enumerate(self.inputs) if x.optional]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetColumnsOption(self, data) :\n indices = [ int(x.replace(self.label, '')) for x in data.columns if self.label in x and x.replace(self.label, '')!='' ]\n return indices", "def _validate_optional_columns(data, optional_columns: Iterable[str]) -> List[str]:\n return [col for col in optional_c...
[ "0.5420054", "0.5409389", "0.5329937", "0.5207868", "0.5200079", "0.5180961", "0.5161508", "0.51286906", "0.51203305", "0.5104722", "0.5085727", "0.50109327", "0.49985334", "0.49859744", "0.49706316", "0.49647433", "0.49270085", "0.49135083", "0.48775432", "0.48590228", "0.48...
0.56992084
0
Return true iff this schema declares names, false otherwise.
def has_input_names(self) -> bool: return self.inputs and self.inputs[0].name is not None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_named(self):\n return self._name != \"\"", "def has_name(self):\n return self.name is not None", "def has_name(self):\n return self.unpack_word(0x2) != 0", "def hasname(self):\n\t\treturn self.name is not None", "def is_named(self):\n return isinstance(self.uri, rdflib.UR...
[ "0.67626655", "0.65662235", "0.65542966", "0.65278155", "0.6318693", "0.62735355", "0.62677515", "0.62423134", "0.6233214", "0.6197741", "0.6192188", "0.6183855", "0.6135794", "0.6091593", "0.6084331", "0.6082097", "0.60806525", "0.6075674", "0.6074233", "0.6058121", "0.60302...
0.6635011
1
Convenience shortcut to get the datatypes as numpy types.
def numpy_types(self) -> List[np.dtype]: if self.is_tensor_spec(): return [x.type for x in self.inputs] return [x.type.to_numpy() for x in self.inputs]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dtype(a):\n return a.dtype", "def convert_numpy_type(cls, dtype):\n\n import numpy as np\n\n m = {\n 'int64': cls.DATATYPE_INTEGER64,\n 'float64': cls.DATATYPE_FLOAT,\n 'object': cls.DATATYPE_TEXT # Hack. Pandas makes strings into object.\n\n }\n\n ...
[ "0.7268677", "0.7105176", "0.6986784", "0.69750243", "0.68694115", "0.6840682", "0.68287677", "0.6782016", "0.6771388", "0.6683813", "0.66641784", "0.6649819", "0.66467124", "0.66123533", "0.65286714", "0.6524209", "0.65238565", "0.65094167", "0.64978486", "0.6475613", "0.646...
0.7314908
0
Convenience shortcut to get the datatypes as pandas types. Unsupported by TensorSpec.
def pandas_types(self) -> List[np.dtype]: if self.is_tensor_spec(): raise MlflowException("TensorSpec only supports numpy types, use numpy_types() instead") return [x.type.to_pandas() for x in self.inputs]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_all_types(df):\n \n printmd (\"**Type of every column in the data**\")\n print(\"\")\n print(df.dtypes)", "def test_datatype(self):\n with Pandas() as pd:\n if pd is None:\n return\n with Numpy() as np: # noqa\n if numpy is None:\n ...
[ "0.7003106", "0.6985756", "0.69507617", "0.69301367", "0.68799984", "0.68386495", "0.6816557", "0.6776637", "0.6776178", "0.67734635", "0.6700742", "0.66937995", "0.6674489", "0.66693664", "0.6617623", "0.6579563", "0.6561717", "0.6560362", "0.6541399", "0.6519523", "0.64774"...
0.7869348
0
Convert to Spark schema. If this schema is a single unnamed column, it is converted directly the corresponding spark data type, otherwise it's returned as a struct (missing column names are filled with an integer sequence). Unsupported by TensorSpec.
def as_spark_schema(self): if self.is_tensor_spec(): raise MlflowException("TensorSpec cannot be converted to spark dataframe") if len(self.inputs) == 1 and self.inputs[0].name is None: return self.inputs[0].type.to_spark() from pyspark.sql.types import StructField, Struc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spark_struct(self) -> StructType:\n return StructType(\n [field._spark_struct_field for field in self.fields.values()] # pylint: disable=protected-access\n )", "def to_pyspark(self):\n\n from pyspark.sql import types\n\n converted = [column.to_pyspark() for column in\n...
[ "0.6904619", "0.66464955", "0.6551367", "0.6448138", "0.6429422", "0.6236184", "0.6129085", "0.61142105", "0.60690856", "0.60551524", "0.6054802", "0.58241206", "0.58079237", "0.57803047", "0.57453275", "0.5671589", "0.5661568", "0.5661568", "0.5661568", "0.5661568", "0.56615...
0.85288256
0
The parameter shape. If shape is None, the parameter is a scalar.
def shape(self) -> Optional[tuple]: return self._shape
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shape(tensor):\n raise NotImplementedError", "def shape(self):\n return () if self.data is None else self.data.shape", "def get_shape(self):\n if self.__data is None:\n return None\n return self.__data.shape", "def shape(self):\n return None", "def shape(se...
[ "0.6924879", "0.6893731", "0.6866802", "0.6865781", "0.68652874", "0.68652874", "0.6821286", "0.6821286", "0.68035334", "0.6766341", "0.673566", "0.67304426", "0.67222726", "0.67222726", "0.67222726", "0.67082804", "0.67057914", "0.66809076", "0.6637465", "0.66297925", "0.659...
0.7097256
0
Deserialize from a json loaded dictionary. The dictionary is expected to contain `name`, `dtype` and `default` keys.
def from_json_dict(cls, **kwargs): if not {"name", "dtype", "default"} <= set(kwargs.keys()): raise MlflowException.invalid_parameter_value( "Missing keys in ParamSpec JSON. Expected to find " "keys `name`, `dtype` and `default`", ) return cls( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(dtype, data):\n try:\n field_map = {field.name: field.type for field in fields(dtype)}\n return dtype(**{key: from_dict(field_map[key], val) for key, val in data.items()})\n except:\n return data", "def from_dict(cls, dikt) -> 'Data':\n return util.deserialize_mode...
[ "0.65025043", "0.6450461", "0.64315695", "0.6395811", "0.6343944", "0.61597955", "0.61597955", "0.6130065", "0.60474235", "0.6044787", "0.6044787", "0.6044787", "0.6044787", "0.6044787", "0.6044787", "0.6035153", "0.60263526", "0.60216767", "0.5999314", "0.5984175", "0.596573...
0.66446763
0
Representation of ParamSchema as a list of ParamSpec.
def params(self) -> List[ParamSpec]: return self._params
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def params(self):\n params = []\n\n for item in self._definition.get('params', []):\n params.append(Parameter(**item))\n\n return params", "def parameters_list(self):\n return [getattr(self.parameters, p) for p in self.parameters_names()]", "def params(self):\n par...
[ "0.691991", "0.6484944", "0.6462228", "0.63977724", "0.6325918", "0.62585086", "0.62333375", "0.620639", "0.6140663", "0.6089474", "0.6089474", "0.6044677", "0.6035956", "0.601716", "0.59799117", "0.5978789", "0.5953582", "0.5935289", "0.59084135", "0.58894736", "0.5884259", ...
0.74145514
0
Serialize and sign a payload
def serialize_and_sign_payload(payload): secret = workspace_config.secret serializer = URLSafeTimedSerializer(secret) return serializer.dumps(payload)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sign(self, payload):\n raise NotImplementedError", "def serialize(self, data):\n content_type, content_encoding, body = encode(\n data, serializer=self._serializer)\n # What we sign is the serialized body, not the body itself.\n # this way the receiver doesn't have to d...
[ "0.82866585", "0.70969784", "0.7074487", "0.7011158", "0.6987856", "0.69799507", "0.6851743", "0.683143", "0.67447525", "0.6580634", "0.65661055", "0.6511153", "0.65076566", "0.6490571", "0.6463449", "0.64224446", "0.633673", "0.6336214", "0.633587", "0.63212436", "0.63013643...
0.76294374
1
Get a list of source columns needed for a list of Tranforms
def _get_cols_source(transforms: List[api.Transform]) -> List[str]: all_names = [transform.name for transform in transforms] all_cols = [] for transform in transforms: for col in transform.cols_input: all_cols.append(col) # Dedup all_cols = sorted(list(set(all_cols))) cols_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_columns(source):\n return _get_tuple(source)", "def get_all_columns(self):\n df = self.get_prep_data()\n col = [c for c in df.columns if c not in ['target', 'idd', 'ft_data_dt']]\n return col", "def _columns(cls, schema: dsl.Source.Schema) -> typing.Sequence[str]:\n ...
[ "0.6551627", "0.6047745", "0.5922719", "0.5867634", "0.57899415", "0.572468", "0.5704853", "0.56765085", "0.566541", "0.5662665", "0.5637412", "0.56182426", "0.55748445", "0.5557002", "0.553021", "0.55158603", "0.5513728", "0.55070573", "0.5474222", "0.54346395", "0.54317945"...
0.70048964
0
ap = voc_ap(rec, prec, [use_07_metric]) Compute VOC AP given precision and recall. If use_07_metric is true, uses the
def voc_ap(rec, prec, use_07_metric=False): if use_07_metric: # 11 point metric ap = 0. for t in np.arange(0., 1.1, 0.1): if np.sum(rec >= t) == 0: p = 0 else: p = np.max(prec[rec >= t]) ap = ap + p / 11. else: # correct AP calculation # first append...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def voc_ap(rec, prec, use_07_metric=False):\n # print('voc_ap() - use_07_metric:=' + str(use_07_metric))\n if use_07_metric:\n # 11 point metric\n ap = 0.\n for t in np.arange(0., 1.1, 0.1):\n if np.sum(rec >= t) == 0:\n p = 0\n else:\n ...
[ "0.8997465", "0.8870425", "0.88661957", "0.8855855", "0.8560796", "0.84174436", "0.79434955", "0.7525645", "0.7171058", "0.7015265", "0.7012963", "0.7001396", "0.6998313", "0.6998313", "0.68332696", "0.6457625", "0.63979095", "0.63241434", "0.5971566", "0.5846918", "0.5786816...
0.89020455
1
Returns True if x is a factor of y, False otherwise. >>> is_factor(3, 6) True >>> is_factor(4, 10) False >>> is_factor(0, 5) False >>> is_factor(0, 0) False
def is_factor(x, y): "*** YOUR CODE HERE ***" return x != 0 and y % x == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_factor(f, n):\r\n return n%f == 0", "def is_deficient_number(x):\n return sum(proper_divisors(x)) < x", "def result_factorization(N,factors):\n if len(factors) !=2:\n print(\"len(factors) != 2\")\n sys.exit()\n\n if N != factors[0] * factors[1]:\n print(\"factors[0]×fact...
[ "0.6357728", "0.55084133", "0.53305715", "0.5291762", "0.5208339", "0.5195607", "0.51481825", "0.5126917", "0.5065983", "0.5002196", "0.49979103", "0.4989943", "0.49696514", "0.4965507", "0.4760264", "0.47427294", "0.47160405", "0.46659768", "0.46605894", "0.46361917", "0.460...
0.75121635
0
Initialize a MultiGetBuilder class instance.
def __init__(self, get_builder: List[GetBuilder], connection: Connection): get_names = [] super().__init__(connection) if not isinstance(get_builder, List): raise TypeError(f"get_builder must be of type List but was {type(get_builder)}") for get in get_builder: if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, gets: Iterable[Get[_Product]]) -> None:\n self.gets = tuple(gets)", "def __init__(self):\n self.uris = AsyncSet('uris')\n self.sockets = AsyncSet('sockets')", "def __init__(self, get_request):\n self.get_request = get_request", "def initialize(self, **kwargs):",...
[ "0.55963", "0.54980415", "0.5483173", "0.54138225", "0.541091", "0.5309026", "0.52982867", "0.5288797", "0.5260517", "0.5250384", "0.52447206", "0.52146167", "0.5213104", "0.5211589", "0.520927", "0.5190979", "0.5182279", "0.5181204", "0.51765466", "0.51728845", "0.5171653", ...
0.6898711
0
function to setup open3d Visualizer for the lidar data
def setup_visualizer(self, name = 'Lidar', width=960, height=540): self.frame_count = 0 self.visualizer = o3d.visualization.Visualizer() self.visualizer.create_window( window_name=name, width=width, height=height, left=int(width/2), t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enable3D(self):\r\n if(self.dataController.fileLoaded==True):\r\n self.dataController.toggleInteractiveMode()\r\n\r\n self.midsagittalView = False\r\n self.frontView = False\r\n self.topView = False\r\n self.bottomView = False\r\n self.threeDView = True", ...
[ "0.63638705", "0.6328074", "0.6270137", "0.6251713", "0.62446195", "0.6227215", "0.6163339", "0.59849817", "0.59704614", "0.59704614", "0.5967697", "0.5963475", "0.5957633", "0.5953474", "0.592644", "0.59061944", "0.5905854", "0.5850071", "0.5831858", "0.5799028", "0.5777155"...
0.7348105
0
get the best trial for the specified pilot
def get_best_trial(self, pilote_indir): directoryFiles = glob.glob(pilote_indir + '\\*\\') current_directory = os.path.dirname(os.path.realpath(__file__)) os.chdir('{}'.format(pilote_indir)) TimeToTake = 2000 for directoryFile in directoryFiles: fileList = glob.glob(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_nearest_slot(self):\n available_slots = [pslot for pslot in self.slots.values() if pslot.available]\n if not available_slots:\n return None\n\n return sorted(available_slots, key=lambda x: x.slot_no)[0]", "def get_best_candidate(self):\n if not self.scores:\n ...
[ "0.5883931", "0.5697249", "0.56650543", "0.56638396", "0.55298257", "0.55134535", "0.55003", "0.54870796", "0.5427402", "0.54083616", "0.5396226", "0.5389446", "0.53866136", "0.5372684", "0.5368138", "0.53622884", "0.5358141", "0.53475463", "0.5329183", "0.53275746", "0.53197...
0.644881
0
Creates a notification widget for the given Apple notification.
def create_notification_widget( notification: Notification, max_width: int, max_height: int, *, color_count: int = 2**16 ) -> PlainNotification: # pylint: disable=unused-argument return PlainNotification( notification.title, notification.message, max_width, max_height )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_notification(self, notifying_href, notifying_action, notified_href, owner):\n if self.id == owner.id:\n return\n new_notification = Notification()\n new_notification.eid = make_uuid()\n new_notification.notifier = self\n new_notification.notifying_href = notifying_href\n new_not...
[ "0.6032959", "0.58641875", "0.5599529", "0.5576505", "0.5470885", "0.5424067", "0.5413306", "0.53179187", "0.5241253", "0.51939934", "0.51340526", "0.5105446", "0.5090865", "0.50744104", "0.50218236", "0.500356", "0.49955222", "0.49904597", "0.49753603", "0.49531054", "0.4935...
0.70267284
0
Ensure locking works with packages providing egg formats.
def test_lock_handle_eggs(PipenvInstance): with PipenvInstance() as p: with open(p.pipfile_path, 'w') as f: f.write(""" [packages] RandomWords = "*" """) c = p.pipenv('lock --verbose') assert c.return_code == 0 assert 'randomwords' in p.lockfile['default'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def try_aquire_lock():\n minor_print(\"Försöker skaffa låset ...\")\n\n lock_path = GITTED_FOLDER / \"lock\"\n\n try:\n lock_path.touch()\n except FileExistsError:\n return False\n\n shell_command([\"git\", \"add\", lock_path.as_posix()])\n shell_command([\"git\", \"commit\", \"-m\"...
[ "0.6385096", "0.63102984", "0.6257099", "0.6104113", "0.6070152", "0.5974093", "0.5886178", "0.5820387", "0.5814204", "0.57700354", "0.5732807", "0.570666", "0.56299394", "0.5628609", "0.5625447", "0.55729425", "0.5565471", "0.5550874", "0.55506325", "0.55385846", "0.55385846...
0.70772547
0
Test locking pathlib2 on python2.7 which needs `scandir`, but fails to resolve when using a fresh dependency cache.
def test_lock_missing_cache_entries_gets_all_hashes(PipenvInstance, tmpdir): with temp_environ(): os.environ["PIPENV_CACHE_DIR"] = str(tmpdir.strpath) with PipenvInstance(chdir=True) as p: p._pipfile.add("pathlib2", "*") assert "pathlib2" in p.pipfile["packages"] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_multiple_file_locks(tmp_path, monkeypatch):\n monkeypatch.setenv(\"RAY_TMPDIR\", str(tmp_path))\n with TempFileLock(path=\"abc.txt\"):\n with TempFileLock(path=\"subdir/abc.txt\"):\n assert RAY_LOCKFILE_DIR in os.listdir(tmp_path)\n # We should have 2 locks, one for abc....
[ "0.6222418", "0.6130201", "0.59925234", "0.5901809", "0.5773521", "0.5565444", "0.55019283", "0.5500261", "0.5484437", "0.5481608", "0.54605097", "0.5448761", "0.54419774", "0.54357016", "0.5403511", "0.5388962", "0.53638595", "0.5358114", "0.5355904", "0.5307997", "0.5273019...
0.65530354
0
Test that locking VCS dependencies respects top level packages pinned in Pipfiles
def test_vcs_lock_respects_top_level_pins(PipenvInstance): with PipenvInstance(chdir=True) as p: requests_uri = p._pipfile.get_fixture_path("git/requests").as_uri() p._pipfile.add("requests", { "editable": True, "git": "{0}".format(requests_uri), "ref": "v2.18.4" }) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_lock_nested_direct_url(PipenvInstance):\n with PipenvInstance(chdir=True) as p:\n c = p.pipenv(\"install test_package\")\n assert c.return_code == 0\n assert \"vistir\" in p.lockfile[\"default\"]\n assert \"colorama\" in p.lockfile[\"default\"]\n assert \"six\" in p.l...
[ "0.7329363", "0.702094", "0.6835602", "0.6223605", "0.6167663", "0.6166821", "0.61292666", "0.6089021", "0.60641634", "0.605229", "0.6038405", "0.6011453", "0.5998504", "0.5972812", "0.588836", "0.5851986", "0.5831583", "0.5810718", "0.58075935", "0.5803977", "0.5745415", "...
0.80453974
0
Returns the ProposalDuplicatesStatus entity belonging to the given program or creates a new one.
def getOrCreateStatusForProgram(program_entity): q = GSoCProposalDuplicatesStatus.all().filter('program', program_entity) pds_entity = q.get() if not pds_entity: pds_entity = GSoCProposalDuplicatesStatus(program=program_entity) pds_entity.put() return pds_entity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_duplicated_gaitid(self):\n idaa_index = 6\n\n upload_program = program.ProgramUpload(idaa_program=self.idaa_json['value'][idaa_index]['fields'],\n msr_country_codes_list=msr_country_codes_list, msr_gaitid_list=msr_gaitid_list, duplicated_gaitids=self.duplicated_gaitids\n )\...
[ "0.5067345", "0.50525963", "0.48686835", "0.48571825", "0.48259327", "0.47985896", "0.469886", "0.45529917", "0.4551319", "0.45431018", "0.45216838", "0.45062414", "0.4499026", "0.44892734", "0.44764814", "0.44734502", "0.44511035", "0.43895268", "0.43871993", "0.4328409", "0...
0.8143192
0
Deletes all ProposalDuplicates for a given program.
def deleteAllForProgram(program_entity, non_dupes_only=False): q = GSoCProposalDuplicate.all() q.filter('program', program_entity) if non_dupes_only: q.filter('is_duplicate', False) # can not delete more then 500 entities in one call proposal_duplicates = q.fetch(500) while proposal_duplicates: d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __delete_duplicates(self):\n log = logging.getLogger()\n log.debug(\"\\n---> Duplicate check <---\")\n\n chromosomes = list(set(self.chromosomes))\n diff = self.size - len(chromosomes)\n\n if diff > 0:\n log.debug(\"---> Duplicate(s) found! <---\")\n for...
[ "0.6054534", "0.5698924", "0.5686124", "0.5661891", "0.5609604", "0.553568", "0.5426321", "0.5374607", "0.5284277", "0.524176", "0.5195046", "0.51412344", "0.5139206", "0.51266795", "0.5096939", "0.5093703", "0.5048117", "0.5042014", "0.5031504", "0.50095457", "0.4990579", ...
0.7256893
0
Experimental general propagation command Propagate is an experimental propagation command which selects the best propagation routine automatically. The idea is to use something like the Fesnel number to select the Forvard, GForvard or the Fresnel command. Please provide us with tips to improve this command by starting ...
def Propagate(Fin,z,UseFresnel=False,UseForvard=False): xs,ys=D4sigma(Fin) M=10 NF=M*(((xs**4)/Fin.lam)**0.333)/z # Check with formula given by jjmelko in issue 59 #NF=xs*xs/Fin.lam/z #Check with Fresnel number print(NF) if Fin._IsGauss: #obvious choice ... print('using GForvard, pure Ga...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def propagate(self):\n self._check_status(STATUS_IDLE)\n\n # Notify listeners\n self._notify_listeners_start_operation(listener.OPERATION_PROPAGATE)\n\n # Propagate model\n self._set_status(STATUS_PROPAGATING)\n psol = self.agent.propagate()\n self._set_status(STATU...
[ "0.59361964", "0.575066", "0.55280215", "0.53319633", "0.526097", "0.5111091", "0.50951254", "0.50775415", "0.50766164", "0.5039297", "0.5003076", "0.49845314", "0.4984517", "0.49446452", "0.4943839", "0.4937982", "0.49218255", "0.49218255", "0.49218255", "0.49171242", "0.491...
0.59724057
0