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
Function to build a partial ```calc_distance_coords_pbc``` function suitable for use with trackpy
def build_distance_function(min_h1, max_h1, min_h2, max_h2, PBC_flag): import functools return functools.partial( pbc_utils.calc_distance_coords_pbc, min_h1=min_h1, max_h1=max_h1, min_h2=min_h2, max_h2=max_h2, PBC_flag=PBC_flag, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pbc_distance(s, p1, p2):\n if not np:\n raise PysimmError('pysimm.calc.pbc_distance function requires numpy')\n frac_x1 = p1.x / s.dim.dx\n frac_y1 = p1.y / s.dim.dy\n frac_z1 = p1.z / s.dim.dz\n\n frac_x2 = p2.x / s.dim.dx\n frac_y2 = p2.y / s.dim.dy\n frac_z2 = p2.z / s.dim.dz\n\n...
[ "0.6503802", "0.5724239", "0.572131", "0.54476553", "0.5408478", "0.52951556", "0.5289381", "0.5267281", "0.5232054", "0.52185535", "0.5212503", "0.52112436", "0.5186095", "0.5143587", "0.5139267", "0.508171", "0.50686514", "0.5060421", "0.50538033", "0.5043596", "0.5043567",...
0.6937138
0
Gets the infer_from_volume of this V1InstancetypeMatcher. InferFromVolume lists the name of a volume that should be used to infer or discover the instancetype to be used through known annotations on the underlying resource. Once applied to the InstancetypeMatcher this field is removed.
def infer_from_volume(self): return self._infer_from_volume
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def infer_from_volume(self, infer_from_volume):\n\n self._infer_from_volume = infer_from_volume", "def volume_type(self) -> Optional['ImageRecipeEbsInstanceBlockDeviceSpecificationVolumeType']:\n return pulumi.get(self, \"volume_type\")", "def volume_type(self) -> pulumi.Input[str]:\n retu...
[ "0.67935944", "0.5259939", "0.52572536", "0.52572536", "0.52572536", "0.5202766", "0.5198747", "0.5057213", "0.48220143", "0.45793012", "0.45634255", "0.45050117", "0.4460283", "0.44045213", "0.4394361", "0.43930328", "0.43930328", "0.43533045", "0.43070012", "0.42998278", "0...
0.6860095
0
Sets the infer_from_volume of this V1InstancetypeMatcher. InferFromVolume lists the name of a volume that should be used to infer or discover the instancetype to be used through known annotations on the underlying resource. Once applied to the InstancetypeMatcher this field is removed.
def infer_from_volume(self, infer_from_volume): self._infer_from_volume = infer_from_volume
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def infer_from_volume(self):\n return self._infer_from_volume", "def vm_volume(self, vm_volume):\n\n self._vm_volume = vm_volume", "def vm_volume_num_in(self, vm_volume_num_in):\n\n self._vm_volume_num_in = vm_volume_num_in", "def volume(self, volume: float | None, from_unit: str) -> flo...
[ "0.6179284", "0.4821179", "0.47393295", "0.46639273", "0.44716388", "0.42963034", "0.42963034", "0.42963034", "0.42936236", "0.42641383", "0.42475522", "0.4207976", "0.41756517", "0.41611257", "0.41115034", "0.41115034", "0.41115034", "0.40940353", "0.4079341", "0.40478197", ...
0.78964543
0
Gets the kind of this V1InstancetypeMatcher.
def kind(self): return self._kind
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kind(self):\r\n return TypeKind.from_id(self._kind_id)", "def kind(self):\n return self._kind()", "def get_kind(self):\n\n return self._kind", "def kind(self) -> Optional[pulumi.Input[Union[str, 'Kind']]]:\n return pulumi.get(self, \"kind\")", "def instance_type(self) -> Opt...
[ "0.68519145", "0.6798443", "0.6776659", "0.6745071", "0.6632163", "0.6616803", "0.6570146", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0.65678346", "0...
0.68037
1
Sets the kind of this V1InstancetypeMatcher.
def kind(self, kind): self._kind = kind
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type(self, kind):\n self.type = kind", "def SetKind(self, new_kind):\r\n\r\n self.kind = new_kind", "def setKind(self, *args):\n return _libsbml.Group_setKind(self, *args)", "def set_animal_type(self, type):\n self.__animal_type = type", "def kind(self):\r\n return Ty...
[ "0.6455525", "0.6433481", "0.54713297", "0.5424579", "0.5371051", "0.5353109", "0.5353109", "0.52752435", "0.52738905", "0.52656156", "0.5262199", "0.5230913", "0.51952267", "0.5185055", "0.5125558", "0.5102749", "0.50909984", "0.50909984", "0.5090743", "0.50399154", "0.50182...
0.6711593
0
Gets the revision_name of this V1InstancetypeMatcher. RevisionName specifies a ControllerRevision containing a specific copy of the VirtualMachineInstancetype or VirtualMachineClusterInstancetype to be used. This is initially captured the first time the instancetype is applied to the VirtualMachineInstance.
def revision_name(self): return self._revision_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_revision(self) -> str:\n raise NotImplementedError", "def revision_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"revision_id\")", "def revision_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"revision_id\")", "def revision_name(self, revision_na...
[ "0.5930421", "0.5832373", "0.56634843", "0.5642108", "0.56332916", "0.5617286", "0.5599239", "0.5599239", "0.55049074", "0.5437495", "0.53946596", "0.53627014", "0.52907014", "0.5288136", "0.5269732", "0.5256777", "0.5225539", "0.5221635", "0.5187551", "0.51847583", "0.517289...
0.7437482
0
Sets the revision_name of this V1InstancetypeMatcher. RevisionName specifies a ControllerRevision containing a specific copy of the VirtualMachineInstancetype or VirtualMachineClusterInstancetype to be used. This is initially captured the first time the instancetype is applied to the VirtualMachineInstance.
def revision_name(self, revision_name): self._revision_name = revision_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def revision_name(self):\n return self._revision_name", "def revision(self, revision):\n\n self._revision = revision", "def revision(self, revision):\n\n self._revision = revision", "def version_name(self, version_name):\n\n self._version_name = version_name", "def revision_date...
[ "0.6077396", "0.5887768", "0.5887768", "0.5557397", "0.5485677", "0.53572", "0.5241066", "0.5112764", "0.50767004", "0.5017641", "0.4926791", "0.4926791", "0.4926791", "0.4926791", "0.49181154", "0.48859185", "0.48621053", "0.48197612", "0.48039836", "0.47604755", "0.47476882...
0.765607
0
Provide a textual but machineparsable summary of the validity.
def summary(self): if self.intact and self.valid: return 'INTACT:' + ','.join(self.summary_fields()) else: return 'INVALID'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def text_summary_message(self):\n failed = [e for e in self.evaluations if not e.passes]\n if failed == []:\n return \"SUCCESS - all constraints evaluations pass\"\n else:\n return \"FAILURE: %d constraints evaluations failed\" % len(failed)", "def summary_str(self):\n ...
[ "0.67813087", "0.6697839", "0.66660243", "0.65193915", "0.64792556", "0.62082374", "0.61479163", "0.6066884", "0.5975568", "0.5933147", "0.5919707", "0.5911134", "0.5895692", "0.58560157", "0.58024544", "0.5795383", "0.5792874", "0.57629436", "0.5743133", "0.57407546", "0.574...
0.7213531
0
Convenience method to quickly construct a CMS attribute object with one value.
def simple_cms_attribute(attr_type, value): return cms.CMSAttribute({ 'type': cms.CMSAttributeType(attr_type), 'values': (value,) })
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Attribute(name, value=None):\r\n if value:\r\n return '{}=\"{}\"'.format(name, value)\r\n else:\r\n return ''", "def attr(*args, **kwargs):\n return Attr(*args, **kwargs)", "def attr(self, name, value=None):\n name = force_str(name)\n if value is None:\n...
[ "0.61815035", "0.6143442", "0.59669095", "0.59208685", "0.591601", "0.5877489", "0.58367324", "0.57793784", "0.5776018", "0.57140464", "0.56913745", "0.56646174", "0.56335896", "0.5609841", "0.55496794", "0.55427676", "0.5484943", "0.5442016", "0.54280305", "0.5385116", "0.53...
0.71282095
0
Find and return CMS attribute values of a given type.
def find_cms_attribute(attrs, name): for attr in attrs: if attr['type'].native == name: return attr['values'] raise KeyError(f'Unable to locate attribute {name}.')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_by_attribute(self, attr: str) -> OrderedSet[TypeInfo]:\n return self._attribute_map[attr]", "def _get_attributes(instance, typeobj):\r\n for key in dir(instance):\r\n if key.startswith(\"__\"):\r\n continue\r\n value = getattr(instance, key)\r\n if type(value) =...
[ "0.6257374", "0.596916", "0.5891672", "0.5872649", "0.5872649", "0.5868156", "0.5813058", "0.5589635", "0.55736107", "0.5559369", "0.5542781", "0.5526976", "0.5514115", "0.5503646", "0.54920286", "0.54625946", "0.54558057", "0.54090667", "0.5406369", "0.53883684", "0.5378219"...
0.71951133
0
Add a certificate to the collection.
def register(self, cert: x509.Certificate): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_certificate(self, certificate):\r\n return self.ssl.createObject(certificate)", "def certificate(self, certificate):\n\n self._certificate = certificate", "def test_add_certificate(self):\n response = self.client.post(\n '/api/v1/certificates', data=json.dumps(new_certif...
[ "0.732119", "0.64080614", "0.63713294", "0.62904525", "0.6147562", "0.5799322", "0.57153565", "0.56899965", "0.5622387", "0.56122565", "0.5603453", "0.5470921", "0.5413858", "0.5312806", "0.53112924", "0.5309554", "0.5308113", "0.52884185", "0.52824706", "0.5264608", "0.52414...
0.6417264
1
This function calculates and returns the acceleration of the projectile in the x direction. It takes in its position as the only arguments This function is called by rungeKuttaOrbits function
def accelerationCalcX(x,y): global G # the gravitational constant is initialised like this so that it can be used in this function global massEarth #the same goes for the mass of the Earth return (-G*massEarth*x)/((x**2+y**2)**(3/2)) # here from Newton's law of gravitation we return the acceleration on a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accelerationCalcY(x,y):\r\n global G #glabel variables are initialised\r\n global massEarth\r\n return (-G*massEarth*y)/((x**2+y**2)**(3/2))# here from Newton's law of gravitation we return the acceleration on a projectile in the y direction\r", "def moonCalcX(x,y,Mx,My, angle, velocityX, velocityY,...
[ "0.69122255", "0.6663677", "0.6505237", "0.63240826", "0.6182281", "0.6094737", "0.6086825", "0.6025632", "0.59547836", "0.5837698", "0.5836382", "0.5828699", "0.580022", "0.5737932", "0.57096344", "0.56973237", "0.5675177", "0.56677544", "0.5624874", "0.5619431", "0.5617412"...
0.78164375
0
This function calculates and returns the acceleration of the projectile in the y direction. It takes in its position as the only arguments This function is called by rungeKuttaOrbits function
def accelerationCalcY(x,y): global G #glabel variables are initialised global massEarth return (-G*massEarth*y)/((x**2+y**2)**(3/2))# here from Newton's law of gravitation we return the acceleration on a projectile in the y direction
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accelerationCalcX(x,y):\r\n global G # the gravitational constant is initialised like this so that it can be used in this function\r\n global massEarth #the same goes for the mass of the Earth\r\n return (-G*massEarth*x)/((x**2+y**2)**(3/2)) # here from Newton's law of gravitation we return the accele...
[ "0.72341603", "0.6672844", "0.644247", "0.6421138", "0.6134269", "0.6126715", "0.6093111", "0.60223216", "0.59848374", "0.5891617", "0.5880014", "0.5879183", "0.577726", "0.57613313", "0.5665182", "0.5594082", "0.5587789", "0.5585746", "0.5568441", "0.55637026", "0.554956", ...
0.7982147
0
This function calculates the orbital path using runge kutta method. It is called for part a of the assesed task A while loop is used to perform the iterations, an orbit count or a duration is used as the end conditions.
def rungeKuttaOrbits(deltaTime, duration, startingX, startingY, startingVelocityX, startingVelocityY, orbitNumber = -1): global G global massEarth h = deltaTime # this is the size of the time steps which is defined by the user and brought into the function. time = [] # creating an empty ar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def IteratePaths(self):\n self.w = self.setwage(self.K, self.N)\n self.r = self.setrate(self.K, self.N)\n self.b = self.benefit(self.N)\n\n a1, aT = [-1,], []\n\n for q in range(self.Nq):\n if q == 0:\n self.apath[-1] = 0.2\n elif q == 1:\n ...
[ "0.64319205", "0.63072336", "0.6304262", "0.6276249", "0.608337", "0.5961301", "0.5916297", "0.5907067", "0.59038746", "0.58973813", "0.5896513", "0.5894789", "0.58790845", "0.5859513", "0.5826464", "0.5715191", "0.57151264", "0.5696681", "0.5689896", "0.56834763", "0.5664081...
0.80209935
0
This function calculates the position of the moon. It is called by moonPass in each iteration. For this section of the simulation we are not assuming the moon is stationary We use the RungeKutta method to calculate its position after each time step
def dynamicMoon(moonPosX, moonPosY, velocityXMoon, velocityYMoon, h): kPosMoon = [[0 for x in range(4)] for y in range(2)] # initialising the 2x2 k matricies kVMoon = [[0 for x in range(4)] for y in range(2)] kPosMoon[0][0] = velocityXMoon # this value is k1 for the x position. It is just the veloc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def moon_phase(\n datetime_index,\n epsilon=1e-6,\n epoch=2444237.905,\n ecliptic_longitude_epoch=278.833540,\n ecliptic_longitude_perigee=282.596403,\n eccentricity=0.016718,\n moon_mean_longitude_epoch=64.975464,\n moon_mean_perigee_epoch=349.383063,\n):\n # set time to Noon if not oth...
[ "0.63613015", "0.6289077", "0.61580545", "0.5977542", "0.59485847", "0.58612055", "0.58468276", "0.5809444", "0.5792219", "0.5705045", "0.56847054", "0.5665109", "0.56647074", "0.5653153", "0.5642665", "0.56286395", "0.5616683", "0.55258423", "0.54849905", "0.5454718", "0.543...
0.67872584
0
This function calculates and returns the acceleration of the projectile in the x direction for part b. It takes in the position of the projectile and the position of the moon as arguments. It also takes in the velocity of the projectile and its mass and the force that the rocket engines produce. In this simulation the ...
def moonCalcX(x,y,Mx,My, angle, velocityX, velocityY, massRocket, rocketForce): global G # initialising global variables global massEarth global massMoon global rocketStage xMoon = x-Mx # here we calculate the position of the projectile relative to the moon. Ie with the centre of the moon at (0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accelerationCalcX(x,y):\r\n global G # the gravitational constant is initialised like this so that it can be used in this function\r\n global massEarth #the same goes for the mass of the Earth\r\n return (-G*massEarth*x)/((x**2+y**2)**(3/2)) # here from Newton's law of gravitation we return the accele...
[ "0.6795126", "0.6737617", "0.62249166", "0.60076183", "0.5869379", "0.58310217", "0.57234585", "0.5666382", "0.5630505", "0.56107914", "0.55997115", "0.5570482", "0.54657173", "0.5462664", "0.5437919", "0.54338056", "0.5384155", "0.53010774", "0.5265965", "0.5254062", "0.5241...
0.73881394
0
In this function the velocity and position of the rocket is calculated it is called for part b of the assesed practical The aim of this function is to, using the runge kutta method, calcualte the position of the rocket/projectile as it makes one orbit around Earth and then transfers to a different path, by use of rocke...
def moonPass(deltaTime, duration, startingX, startingY, startingVelocityX, startingVelocityY, massRocket, rocketForce, rocketTransferDuration, moonStartAngle, manual = False): global rocketStage # initialising the global variables global massMoon moonPosX = earthMoonDistance*math.sin(math.pi*moonSt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def engine_boost(self):\r\n gamma = 6.67e-11\r\n esc_velocity = np.sqrt((2*gamma*self.home_m*2.0e30)/(self.home_r*10**3))\r\n print esc_velocity\r\n esc_mom, per_force = self.escaped_momentum()\r\n pos, vel,part_esc, impact, part_coll, mom = self.box_collision_info()\r\n\r\n ...
[ "0.65248644", "0.6148687", "0.6120176", "0.60389876", "0.60374606", "0.60031456", "0.59537953", "0.59110385", "0.59035736", "0.5863402", "0.58236134", "0.580871", "0.5796121", "0.5757865", "0.575598", "0.5750195", "0.57371026", "0.57208824", "0.5716999", "0.5677754", "0.56426...
0.6298484
1
This function is excecuted when calculate is clicked, firstly it performs an input validation to make sure the user hasn't entered anything in incorrectly. Then it runs the simulations and displays the results.
def calculate(self): self.MyInput = self.buttonValue.get() self.inputErrorText.set("") if self.MyInput == 1: # if the part b radio button was selected, run part a errorOn = False # error on determines whether there is an error in the users input, here we are initialising it to fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n welcome_message()\n continue_program = True\n num_calculations = 0\n # all the calculation options in the program\n calculation_options = [\"addition\", \"subtraction\", \"division\",\n \"multiplication\", \"exponents\", \"circle area\",\n ...
[ "0.7127794", "0.6825341", "0.67326593", "0.6658684", "0.66468376", "0.64997995", "0.64390886", "0.6391869", "0.63617754", "0.6282505", "0.6271106", "0.621879", "0.61775064", "0.6141118", "0.6078396", "0.60584056", "0.6021438", "0.60192466", "0.59882176", "0.59788686", "0.5972...
0.6900274
1
Print the header of the program.
def print_header(): print('------------------------------------') print(' Lesson04') print(' Kata Fourteen Assignment') print('------------------------------------\n')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_header():\n print(\"STEM Center Temperature Project\")\n print(\"Shaotong Wen\")", "def print_header_information():\n\t\tprint \"Elijah Molloy\"\n\t\tprint \"70-510 - Spring 1 - 2018\"\n\t\tprint \"PROGRAMMING ASSIGNMENT #4\\n\"", "def print_the_header():\n print('-------------------')\n ...
[ "0.8161156", "0.813946", "0.80921113", "0.8032606", "0.79831046", "0.7942053", "0.7838612", "0.76502264", "0.7578044", "0.7559331", "0.7503499", "0.7464448", "0.7373962", "0.73484933", "0.73313195", "0.71610045", "0.7153667", "0.7149086", "0.7115781", "0.71111786", "0.7086044...
0.82916284
0
agent action state mapping maps agent to set of actions, each action mapped to a set of states reward is the base reward given for public actions penalty_multiplier determines the default penalty for public actions, which will be overridden on relevant public actions
def project_team_problem_by_mapping(team_problem_path, rewarded_agent_action_state_mapping, reward, penalized_agent_action_state_mapping=None, penalty_multiplier=1.1, delete_unused_public=False, add_gap_filler_actions=False, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def agent_step(self, reward, state):\n self.sum_rewards += reward\n self.episode_steps += 1\n\n # Make state an array of shape (1, state_dim) to add a batch dimension and\n # to later match the get_action_values() and get_TD_update() functions\n state = np.array(state)\n\n ...
[ "0.6344949", "0.61674756", "0.61470383", "0.60861135", "0.60658044", "0.60479194", "0.6033494", "0.59976757", "0.5996801", "0.5961972", "0.595548", "0.59472746", "0.593346", "0.59168094", "0.58657336", "0.58576876", "0.5841162", "0.5832507", "0.58247805", "0.5821705", "0.5805...
0.6314591
1
Generate tfidf feature vector for a test document
def generate_feature_vector(self, test_document, n): m = len(self.bag_of_features) feature_vector = np.zeros(m) for feature, col in self.bag_of_features.items(): if feature in test_document.tfs['all'].keys(): tf = test_document.tfs['all'][feature] df =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tfidf_vectors(self):\n\n train_text = self.get_training_data()\n test_text = self.get_testing_data()\n\n print 'Initilizing tf vectorizer ...'\n vectorizer = TfidfVectorizer(sublinear_tf=True)\n vectorizer.fit( train_text + test_text )\n\n print 'Transforming data ...
[ "0.785586", "0.7570564", "0.7538584", "0.74642384", "0.7366454", "0.7244039", "0.71907777", "0.715004", "0.7090177", "0.70719916", "0.6965234", "0.6958449", "0.6920894", "0.68468946", "0.6837763", "0.68373895", "0.68313736", "0.68215734", "0.6795726", "0.67324233", "0.672509"...
0.80550724
0
Output debug information to the logger for a function call.
def debug_log(function): argument_names = list(function.__code__.co_varnames) @functools.wraps(function) def write_log(*args, **kwargs): argument_values = ( "{} = {}".format(arg, value) for arg, value in list(zip(argument_names, args)) + list(kwargs.items()) ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def debug_log(self, msg, *args, **kwargs):\n if self.debug:\n self.log.debug(msg, *args, **kwargs)", "def debug(func):\n @functools.wraps(func)\n def wrapper_debug(*args, **kwargs):\n caller = sys._getframe().f_back.f_code.co_name\n args_repr = [repr(a) for a in args]\n ...
[ "0.71970177", "0.7136869", "0.7104334", "0.7059706", "0.7056888", "0.7052082", "0.7016987", "0.69610274", "0.693679", "0.6874928", "0.68171775", "0.67644125", "0.67597145", "0.6758524", "0.6753844", "0.67478865", "0.67472714", "0.674561", "0.6711056", "0.67006165", "0.6691391...
0.72317445
0
Create a user to project relationship on the database and add the access to the the object store associated with it Returns a json object
def add_user_to_projects(username): projects = request.get_json().get("projects", []) return jsonify( admin.add_user_to_projects( current_app.scoped_session(), username, projects=projects ) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(self, request, *args, **kwargs):\n project = Project.objects.get(id=kwargs[\"projects_pk\"])\n self.check_object_permissions(request, project)\n\n serializer = self.get_serializer(data=request.data)\n if serializer.is_valid():\n serializer.save(permission=\"contrib...
[ "0.6604595", "0.62971663", "0.6157545", "0.60772395", "0.6073453", "0.60304475", "0.5985062", "0.5970649", "0.59600526", "0.5952909", "0.59231085", "0.5905837", "0.5883463", "0.58822805", "0.5867942", "0.58676624", "0.5852228", "0.58465254", "0.58429295", "0.58218867", "0.582...
0.63159335
1
Get the information related to a project from the userdatamodel database Returns a json object
def get_project(projectname): return jsonify(admin.get_project_info(current_app.scoped_session(), projectname))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def project_info_json(project_id):\n is_full = bool(request.args.get('full')) or False\n project = Project.query.filter_by(id=project_id).first_or_404()\n team = []\n for user in project.get_team():\n team.append({\n 'id': user.id,\n 'name': user.username,\n 'lin...
[ "0.7214082", "0.71943396", "0.6952048", "0.6899152", "0.6709157", "0.67011726", "0.6655677", "0.6609695", "0.6577548", "0.6532058", "0.6509522", "0.6477301", "0.6442753", "0.64270794", "0.64234126", "0.6392102", "0.63863045", "0.6374332", "0.6365453", "0.6332158", "0.6286693"...
0.7607622
0
Create a new project on the specified storage Returns a json object
def create_project(projectname): auth_id = request.get_json().get("auth_id") storage_accesses = request.get_json().get("storage_accesses", []) response = jsonify( admin.create_project( current_app.scoped_session(), projectname, auth_id, storage_accesses ) ) return respons...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_project():\n client = RequestManager()\n project_name = \"\".join(choices(string.ascii_letters + string.digits, k=10))\n client.set_method(\"POST\")\n client.set_endpoint(\"/projects\")\n body = {\"name\": project_name}\n client.set_body(json.dumps(body))\n ...
[ "0.7471655", "0.7242691", "0.6983104", "0.68495417", "0.6776968", "0.67216253", "0.6676151", "0.6647804", "0.6635833", "0.6581537", "0.6511293", "0.6476797", "0.6467023", "0.6428822", "0.64281964", "0.6365997", "0.63108987", "0.6304829", "0.626724", "0.62626046", "0.62626046"...
0.79443556
0
Remove project. No Buckets should be associated with it. Returns a json object.
def delete_project(projectname): response = jsonify(admin.delete_project(current_app.scoped_session(), projectname)) return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_project(project_id):\n response_object = {'status': 'success'}\n with database.engine.begin() as connection:\n\n stmt = select([models.projects.c.path]).where(\n models.projects.c.project_id == project_id)\n project = connection.execute(stmt).first()\n\n if project:...
[ "0.7604604", "0.7378177", "0.7146411", "0.71200186", "0.7094052", "0.70536935", "0.69614834", "0.69150805", "0.6914222", "0.68811715", "0.68664753", "0.685494", "0.68310815", "0.67918074", "0.6735482", "0.6709882", "0.6707316", "0.66896605", "0.66676927", "0.6655505", "0.6647...
0.77943534
0
Create a bucket in the selected project. Returns a json object.
def create_bucket_in_project(projectname, bucketname): providername = request.get_json().get("provider") response = jsonify( admin.create_bucket_on_project( current_app.scoped_session(), projectname, bucketname, providername ) ) return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_bucket(request: Dict) -> Dict:\n global config\n\n body = {\n \"user_name\": request.get(\"user_name\"),\n \"prefix\": request.get(\"bucket_name\")[0:5],\n \"bucket_name\": request.get(\"bucket_name\"),\n \"region\": request.get(\"region\")\n }\n\n response = requ...
[ "0.770828", "0.7366614", "0.7327456", "0.72858685", "0.72755516", "0.72426456", "0.7183779", "0.7142208", "0.7115629", "0.7103667", "0.7072197", "0.69649357", "0.6954873", "0.6949976", "0.68545145", "0.6825542", "0.67639256", "0.67597574", "0.6615808", "0.66080517", "0.660368...
0.85846573
0
Delete a bucket from the selected project, both in the userdatamodel database and in the storage client associated with that bucket. Returns a json object.
def delete_bucket_from_project(projectname, bucketname): return jsonify( admin.delete_bucket_on_project( current_app.scoped_session(), projectname, bucketname ) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_bucket(Bucket=None):\n pass", "def delete(c, bucket=None):\n if bucket == None:\n bucket = \"dvc-\" + project_dir_name().replace(\"_\",\"-\")\n bucket_resource = boto3.resource('s3').Bucket(bucket)\n bucket_resource.objects.all().delete()\n s3 = boto3.client(\"s3\")\n s3.delet...
[ "0.7371198", "0.72444403", "0.7116821", "0.70088047", "0.67758113", "0.67603856", "0.6666685", "0.66456497", "0.66209084", "0.65455085", "0.651497", "0.6514675", "0.6471017", "0.643583", "0.63600045", "0.63537544", "0.6328313", "0.629418", "0.62890303", "0.62840277", "0.62413...
0.83541125
0
Retrieve the information regarding the buckets created within a project. Returns a json object.
def list_buckets_from_project(projectname): response = jsonify( admin.list_buckets_on_project_by_name(current_app.scoped_session(), projectname) ) return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_bucket(self, bucket_id=None):\n url = self.prism_endpoint + \"/wBuckets\"\n\n if bucket_id is not None:\n url = url + \"/\" + bucket_id\n\n headers = {\"Authorization\": \"Bearer \" + self.bearer_token}\n\n r = requests.get(url, headers=headers)\n\n if r.statu...
[ "0.68911624", "0.68694276", "0.64497566", "0.62909305", "0.62754864", "0.6273063", "0.6197743", "0.6167279", "0.6167279", "0.6166078", "0.6156144", "0.6135357", "0.6109459", "0.6097497", "0.6097397", "0.6071835", "0.60186607", "0.6008603", "0.60063124", "0.59913695", "0.59358...
0.76838374
0
Retriev the information related to a cloud provider Returns a json object.
def get_cloud_provider(providername): return jsonify(admin.get_provider(current_app.scoped_session(), providername))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def got_info(self, cloud_obj):", "def cloud_information(self):\n url = \"%s/state/teams/%s/cloud\" % (self.url, self.identifier, )\n return perform_request(url)", "def getting_info(self, cloud_path):\n\t\telog(\"getting info on {}\".format(cloud_path))", "def create_cloud_provider(providername)...
[ "0.6571166", "0.63667", "0.61403143", "0.6059541", "0.58900946", "0.5878304", "0.5854456", "0.5830992", "0.5746011", "0.5727587", "0.5727587", "0.5725593", "0.5715221", "0.5701914", "0.56956863", "0.5689701", "0.5678993", "0.5678993", "0.56572187", "0.56572187", "0.56572187",...
0.77457684
0
Create a cloud provider. Returns a json object
def create_cloud_provider(providername): backend_name = request.get_json().get("backend") service_name = request.get_json().get("service") response = jsonify( admin.create_provider( current_app.scoped_session(), providername, backend=backend_name, serv...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post(self):\n data = request.json\n return save_new_provider(data=data)", "def create_provider(\n provider_id:UUID = Form(...),\n name:str = Form(...),\n qualification:str = Form(...),\n speciality:str = Form(...),\n phone:str = Form(...),\n department:Optional[str] = Form(\"N...
[ "0.68563443", "0.67368394", "0.6477088", "0.6397299", "0.6252256", "0.62151587", "0.602584", "0.59691894", "0.5928429", "0.58741647", "0.58655447", "0.5850614", "0.57752794", "0.5756378", "0.5713417", "0.56977063", "0.56696475", "0.5635304", "0.56122875", "0.561085", "0.56076...
0.8406289
0
Deletes a cloud provider from the userdatamodel All projects associated with it should be deassociated or removed. Returns a json object.
def delete_cloud_provider(providername): response = jsonify( admin.delete_provider(current_app.scoped_session(), providername) ) return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_provider(cls, args, config):\n # print \"MOLNSProvider.delete_provider(args={0}, config={1})\".format(args, config)\n if len(args) == 0:\n print \"USAGE: molns provider delete name\"\n return\n config.delete_object(name=args[0], kind='Provider')", "def delete...
[ "0.6050923", "0.60456926", "0.6033595", "0.5842455", "0.58123046", "0.5792337", "0.5689819", "0.56781906", "0.5669796", "0.56312925", "0.5622049", "0.5621408", "0.5614882", "0.558948", "0.55592316", "0.55066687", "0.547221", "0.5437688", "0.54265517", "0.5403434", "0.5396147"...
0.74918044
0
List registration info for every user for which there exists registration info. Endpoint accessible to admins only. Response json structure is provisional.
def get_registered_users(): registered_users = ( current_app.scoped_session() .query(User) .filter(User.additional_info["registration_info"] != "{}") .all() ) registration_info_list = { u.username: u.additional_info["registration_info"] for u in registered_users }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def regist_list(request):\n if request.method == 'GET':\n obj = Registration.objects.all()\n serializer = RegistrationSerializer(obj, many=True)\n return Response(serializer.data)\n\n elif request.method == 'POST':\n serializer = RegistrationSerializer(data=request.data)\n ...
[ "0.7029425", "0.6845629", "0.68214566", "0.678186", "0.67794687", "0.67025185", "0.6694884", "0.66759723", "0.66730595", "0.6640294", "0.6625212", "0.6608798", "0.65859395", "0.65832144", "0.6538527", "0.6520434", "0.6509548", "0.6508005", "0.65027857", "0.6488409", "0.648224...
0.71273
0
Explore all functions graphs to find CALL nodes and set its reference node to the function that is being called.
def _update_call(self): for entry in self._entry_nodes: self._update_call_visit(entry.get_func_first_node(), {})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_call_visit(self, n, visited):\n visited[n] = True\n\n if n.get_type() == CFGNodeType.PSEUDO:\n self._update_call_visit(n.get_refnode(), visited)\n\n elif n.get_type() == CFGNodeType.CALL:\n # update reference node to the right entry node\n for entry...
[ "0.65636283", "0.6276025", "0.6210403", "0.62048095", "0.61102766", "0.6087253", "0.5940777", "0.58598393", "0.57830435", "0.57504827", "0.5683792", "0.5667964", "0.5667079", "0.5658224", "0.56541586", "0.5650132", "0.5637696", "0.5632561", "0.5617415", "0.5613178", "0.557867...
0.68614286
0
Explore graph to find CALL nodes to set its reference node.
def _update_call_visit(self, n, visited): visited[n] = True if n.get_type() == CFGNodeType.PSEUDO: self._update_call_visit(n.get_refnode(), visited) elif n.get_type() == CFGNodeType.CALL: # update reference node to the right entry node for entry in self._ent...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_call(self):\n for entry in self._entry_nodes:\n self._update_call_visit(entry.get_func_first_node(), {})", "def visit_Call(self, node):\n assert hasattr(node, 'args')\n if node.args:\n assert isinstance(node.args[0], gast.Starred)\n # modify args\...
[ "0.66796786", "0.6476864", "0.5834841", "0.5663037", "0.56612915", "0.5649983", "0.56191975", "0.56105536", "0.5572147", "0.5554469", "0.55138224", "0.5512501", "0.54916", "0.5477388", "0.5476042", "0.5465886", "0.5424795", "0.53768784", "0.5370139", "0.53345925", "0.53321743...
0.68683636
0
Remove only END_IF nodes from the graph
def _clean_graph_visit(self, node, visited): visited[node] = True while True: rp_node = None rp_id = -1 for n_id, n in enumerate(node.get_children()): if n.get_type() == CFGNodeType.END_IF: rp_node = n rp_id = n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_edges(self):", "def exclude_nodes(self, nodes):", "def _clean_graph(self):\n for entry_node in self._entry_nodes:\n self._clean_graph_visit(entry_node.get_func_first_node(), {})", "def __filterEdges(self):", "def test_graph_deletes_nodes(graph_with_edges):\n graph_with_edges....
[ "0.58917356", "0.58329576", "0.5668507", "0.5631711", "0.5548695", "0.5546482", "0.5497204", "0.5482357", "0.5463975", "0.54236144", "0.53977835", "0.53893036", "0.5389056", "0.53693956", "0.5340207", "0.53300816", "0.53244513", "0.52348584", "0.52129465", "0.5197603", "0.519...
0.60764
0
Add last node to the function graph.
def _add_last_node(self): for entry in self._entry_nodes: last_node = CFGNode(CFGNodeType.END) last_node.set_func_owner(entry.get_func_name()) self._add_last_node_visit(entry.get_func_first_node(), last_node, {})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_last(self, node_to_add):\n if self.head == None:\n self.head = node_to_add\n return\n node = self.head\n # while node.next is not None:*\n while node.next is not None:\n node = node.next\n node.next = node_to_add", "def _add_last(cls, no...
[ "0.7408528", "0.7114501", "0.7109686", "0.7069022", "0.7064014", "0.69920665", "0.69053197", "0.6893356", "0.666776", "0.6589375", "0.6487233", "0.6406148", "0.63763314", "0.6357778", "0.6322931", "0.6313516", "0.629065", "0.6240862", "0.6162617", "0.61421853", "0.6136249", ...
0.787556
0
Tells each layer what its input space should be.
def _update_layer_input_spaces(self): layers = self.layers layers[0].set_input_space(self.input_space) for i in xrange(1,len(layers)-1): layers[i].set_input_space(layers[i-1].get_output_space()) maxout2_outputspace = layers[-2].get_output_space() for layer in layers[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_layer_input_spaces(self):\n layers = self.layers\n\n context, state = self.input_space.components\n\n layers[0].set_input_space(context)\n for i in range(1, len(layers)):\n layers[i].set_input_space(layers[i-1].get_output_space())\n\n if not layers[-1].get_...
[ "0.6925567", "0.63703185", "0.62553126", "0.58150554", "0.57749593", "0.5744001", "0.56387454", "0.5533307", "0.54923004", "0.54889655", "0.54830664", "0.54790485", "0.5473214", "0.5473214", "0.5473214", "0.54449487", "0.5417073", "0.5398265", "0.539603", "0.53763556", "0.534...
0.748153
0
Add new layers on top of the existing hidden layers
def add_layers(self, layers): existing_layers = self.layers assert len(existing_layers) > 0 for layer in layers: assert layer.get_mlp() is None layer.set_mlp(self) layer.set_input_space(existing_layers[-1].get_output_space()) existing_layers.appen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append_layer(self, *args, **kwargs) :\n \n self.insert_layer(len(self._layers), *args, **kwargs)", "def layers(self): # -> LayerView:\n ...", "def UpdateLayers(self):\n pass", "def append_or_update_layer(self, layer: 'Layer'):\n if layer.has_pos():\n self.layer...
[ "0.7095661", "0.66834885", "0.66251296", "0.6611837", "0.64945513", "0.6470093", "0.6432915", "0.63612753", "0.6332223", "0.632618", "0.6313714", "0.6310573", "0.6291049", "0.6288144", "0.6264428", "0.62475944", "0.6246594", "0.62342656", "0.6127018", "0.6120007", "0.6090351"...
0.6849667
1
Return the (space, source) data_specs for self.get_monitoring_channels. In this case, we want the inputs and targets.
def get_monitoring_data_specs(self): space = [self.get_input_space()] space += self.get_output_space() space = CompositeSpace(space) source = (self.get_input_source(), self.get_target_source(), 'second_targets') return (space, source)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, channels): \n data = []\n for chan, d in zip(self.channels, self.data):\n if chan not in channels:\n continue\n data.append(d)\n data = np.stack(data)\n return data", "def get_monitoring_channels(self, data):\n X, Y, Y_ ...
[ "0.5871383", "0.57009673", "0.5678127", "0.5660185", "0.5625841", "0.56236094", "0.562306", "0.56222403", "0.5535455", "0.5499879", "0.5476862", "0.54665375", "0.54600203", "0.5433384", "0.54321045", "0.540674", "0.54066885", "0.53989625", "0.5361413", "0.53332245", "0.532617...
0.7835641
0
Get the total number of inputs to the layers whose names are listed in `layers`. Used for computing the total number of dropout masks.
def get_total_input_dimension(self, layers): self._validate_layer_names(layers) total = 0 for layer in self.layers: if layer.layer_name in layers: total += layer.get_input_space().get_total_dimension() return total
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_layer_params(layer):\n num_params = 0\n name, param_names, dims, _, _ = layer.get_layer_info()\n nparams = len(dims)\n for j in range(nparams):\n num_params += np.prod(dims[j])\n return num_params", "def _num_layers(model):\n\n if hasattr(model, \"n_layers\"): # eg. xlm\n ...
[ "0.72782046", "0.6937146", "0.69188535", "0.68936896", "0.6862165", "0.68418735", "0.6738074", "0.66205007", "0.6601187", "0.6585802", "0.64619875", "0.64123404", "0.6409986", "0.6313719", "0.63014966", "0.63014966", "0.6250643", "0.62283087", "0.6208902", "0.61174226", "0.61...
0.81204873
0
Computes self.cost, but takes data=(X, Y) rather than Y_hat as an argument. This is just a wrapper around self.cost that computes Y_hat by calling Y_hat = self.fprop(X)
def cost_from_X(self, data): self.cost_from_X_data_specs()[0].validate(data) X, Y = data Y_hats= self.fprop(X) return self.cost(Y, Y_hats)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cost(self, data_X, data_Y):\n c = self.cost_function(data_Y, self.predict(data_X))\n\n if self.regularizer is not None:\n c += self.regularizer.cost(self.particle_input, self.layers)\n\n return c", "def _cost_method(self, *args, **kwargs):\n\n cost_val = 0.5 * np.linalg...
[ "0.75146097", "0.7288574", "0.70718175", "0.70287496", "0.68496263", "0.67605805", "0.67605805", "0.67270523", "0.6531732", "0.64908296", "0.6445102", "0.6405418", "0.6400755", "0.63193655", "0.6301988", "0.62059665", "0.61993927", "0.6180116", "0.6142807", "0.6129098", "0.61...
0.76611173
0
Returns the data specs needed by cost_from_X. This is useful if cost_from_X is used in a MethodCost.
def cost_from_X_data_specs(self): space = [self.get_input_space()] space.append(selg.get_output_space()) space = CompositeSpace(sapce) source = (self.get_input_source(), self.get_target_source(), 'second_targets') return (space , source)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cost_from_X(self, data):\n self.cost_from_X_data_specs()[0].validate(data)\n X, Y = data\n Y_hats= self.fprop(X)\n return self.cost(Y, Y_hats)", "def getOptData(Nopt,Ntot,x0,res,method):\n if method == 'trust-constr':\n # 'Nopt' 'Ntot' 'x0', 'x', 'fun', 'status', 'succes...
[ "0.61315626", "0.56846666", "0.55875313", "0.5583118", "0.53431153", "0.5321473", "0.5307849", "0.5269418", "0.5223313", "0.51874125", "0.5176748", "0.51195794", "0.5119364", "0.50997776", "0.50902474", "0.50720304", "0.5066388", "0.5047318", "0.50405896", "0.49812394", "0.49...
0.636601
0
Returns a batch (vector) of mean across units of KL divergence for each example KL(P || Q) where P is defined by Y and Q is defined by Y_hat Currently Y must be purely binary. If it's not, you'll still get the right gradient, but the value in the monitoring channel will be wrong. Y_hat must be generated by fprop, i.e.,...
def kl(self, Y, Y_hat): # Pull out the argument to the sigmoid assert hasattr(Y_hat, 'owner') owner = Y_hat.owner assert owner is not None op = owner.op if not hasattr(op, 'scalar_op'): raise ValueError("Expected Y_hat to be generated by an Elemwise op, got "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kl_divergence(self) -> Tensor:\n return self.variational_strategy.kl_divergence().sum(dim=1).mean()", "def kl(Y, Y_hat):\n # Pull out the argument to the sigmoid\n assert hasattr(Y_hat, 'owner')\n owner = Y_hat.owner\n assert owner is not None\n op = owner.op\n\n if not hasattr(op, '...
[ "0.6280097", "0.62127364", "0.6130113", "0.6080619", "0.60047257", "0.5996181", "0.5964916", "0.59330046", "0.5850586", "0.5840875", "0.58325166", "0.5808322", "0.58059067", "0.5779216", "0.57758087", "0.57617956", "0.5695129", "0.56764656", "0.56725264", "0.56547177", "0.565...
0.621306
1
Return node corresponding to given file descriptor.
def fdToNode( cls, fd ): node = Node.outToNode.get( fd ) return node or Node.inToNode.get( fd )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_inode(self, pid, fd):\n key = \"{0}:{1}\".format(pid, fd)\n\n if str(fd) in self.std.keys():\n return self.std[fd]\n elif pid in self.imap and fd in self.imap[pid]:\n return self.imap[pid][fd]\n else:\n log.debug(\"Failed to get inode for pid {0}...
[ "0.61093277", "0.59235", "0.5872065", "0.58599794", "0.58459187", "0.57981616", "0.5748449", "0.572794", "0.57188034", "0.569378", "0.568198", "0.56807923", "0.5680378", "0.5680378", "0.56488997", "0.55963635", "0.55938274", "0.55888534", "0.5558678", "0.55565476", "0.5546049...
0.7031694
0
Create link to another node, making two new interfaces.
def linkTo( self, node2, port1=None, port2=None ): node1 = self if port1 is None: port1 = node1.newPort() if port2 is None: port2 = node2.newPort() intf1 = node1.intfName( port1 ) intf2 = node2.intfName( port2 ) makeIntfPair( intf1, intf2 ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_link(self, node1, port1, node2, port2=None):\n if not port2:\n ports_in_use = set((node['adapter_number'], node['port_number']) for link in self.links() for node in link['nodes'] if node['node_id'] == node2['node_id'])\n available_ports = (port for port in node2['ports'] if ...
[ "0.726686", "0.69971514", "0.69927746", "0.6811726", "0.6792625", "0.66843724", "0.6557354", "0.6553899", "0.650231", "0.6470072", "0.6431105", "0.6390623", "0.63864315", "0.63657534", "0.6323423", "0.62832546", "0.62310404", "0.6230063", "0.6182247", "0.6174451", "0.6172912"...
0.77085114
0
Set the MAC address for an interface.
def setMAC( self, intf, mac ): result = self.cmd( 'ifconfig', intf, 'down' ) result += self.cmd( 'ifconfig', intf, 'hw', 'ether', mac ) result += self.cmd( 'ifconfig', intf, 'up' ) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_mac(interface, mac):\r\n print(\"Changing MAC-address for \" + interface + \" to \" + mac)\r\n subprocess.call([\"sudo\", \"ifconfig\", interface, \"down\"])\r\n subprocess.call([\"sudo\", \"ifconfig\", interface, \"hw\", \"ether\", mac])\r\n subprocess.call([\"sudo\", \"ifconfig\", interfac...
[ "0.72594166", "0.7175451", "0.7175451", "0.6787153", "0.6587821", "0.65287876", "0.6495245", "0.6403959", "0.6188951", "0.61675185", "0.60591865", "0.60192376", "0.5850488", "0.58242285", "0.5806144", "0.57886744", "0.5751436", "0.5701006", "0.569445", "0.5660209", "0.5656149...
0.75229865
0
Set the IP address for an interface.
def setIP( self, intf, ip, prefixLen=8 ): ipSub = '%s/%d' % ( ip, prefixLen ) result = self.cmd( 'ifconfig', intf, ipSub, 'up' ) self.ips[ intf ] = ip return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setIpaddr(self):\n\t\tself.ipaddr = self.settings.getKeyValue('ipaddr')\n\t\tself.socket.send('setenv ipaddr ' + self.ipaddr+'\\r', 1)\t\t\n\t\treturn None", "def setIP(self, idx, ip):\n self.ip[int(idx)-1] = ip", "def setAddress(self, ip_address):\n # type: (str)->None\n\n self._valid...
[ "0.73299426", "0.73147446", "0.715779", "0.7145206", "0.7062749", "0.70484364", "0.7044561", "0.7044561", "0.6879253", "0.68670195", "0.68506825", "0.6807834", "0.6750093", "0.6747669", "0.673858", "0.6730996", "0.6730996", "0.6730996", "0.66354245", "0.6541427", "0.65340984"...
0.7629163
0
Add route to host.
def setHostRoute( self, ip, intf ): return self.cmd( 'route add -host ' + ip + ' dev ' + intf )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_route(self, item):\n self._routes[item.route] = item\n self.httpd.route(item.route, method=\"GET\", callback=item.get)\n self.httpd.route(item.route, method=\"POST\", callback=item.post)\n self.httpd.route(item.route, method=\"PUT\", callback=item.put)\n self.httpd.route(...
[ "0.69187474", "0.6842462", "0.6789609", "0.6763615", "0.66881067", "0.6635929", "0.65970284", "0.65843874", "0.6540146", "0.65312475", "0.6504228", "0.6468539", "0.6445218", "0.63322836", "0.6203056", "0.6200036", "0.6175157", "0.61362606", "0.6101332", "0.60902107", "0.60807...
0.69271463
0
Set the default route to go through intf.
def setDefaultRoute( self, intf ): self.cmd( 'ip route flush root 0/0' ) return self.cmd( 'route add default ' + intf )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_default_route_to_namespace(node, namespace, default_route):\n cmd = f\"ip netns exec {namespace} ip route add default \" \\\n f\"via {default_route}\"\n exec_cmd_no_error(node, cmd, sudo=True)", "def setHostRoute( self, ip, intf ):\n return self.cmd( 'route add -host ' +...
[ "0.6774669", "0.6770076", "0.664887", "0.6062997", "0.599619", "0.595429", "0.58975947", "0.58752805", "0.58463943", "0.58402807", "0.5836372", "0.5791792", "0.5736922", "0.5697862", "0.56632996", "0.5632258", "0.5548598", "0.54976135", "0.5422293", "0.54028916", "0.5342135",...
0.86951214
0
Helper method to format the data contained in the dictionary data by adding the domain corresponding to its values, the groupbys in the context and by properly formatting the date/datetime values.
def _read_group_format_result_custom(self, data, annotated_groupbys, groupby, domain): sections = [] for gb in annotated_groupbys: ftype = gb['type'] value = data[gb['groupby']] # full domain for this groupby spec d = None if value: if ftype == 'many2one': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _format_data(self) -> None:\n for row in self._db_data:\n if row['age_start'] is None:\n continue\n # entry = {'x': 'Celkem', 'y': int(row['count'])}\n elif row['age_start'] == 95:\n entry = {'x': f\"{int(row['age_start'])}+\", 'y': int(r...
[ "0.6392354", "0.6272505", "0.5988696", "0.5928549", "0.5836685", "0.5798975", "0.5777946", "0.5728696", "0.5643554", "0.56160223", "0.54914033", "0.5487025", "0.5465167", "0.5442022", "0.5434007", "0.53996074", "0.5373946", "0.53372926", "0.53325415", "0.5331802", "0.5279002"...
0.6871423
0
Tests geting the distinct attribute.
def test_get_distinct_attribute(empty_index): response = empty_index().get_distinct_attribute() assert response == DEFAULT_DISTINCT_ATTRIBUTE
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_distinct(self):\n self.Person(name=\"Mr Orange\", age=20).save()\n self.Person(name=\"Mr White\", age=20).save()\n self.Person(name=\"Mr Orange\", age=30).save()\n self.Person(name=\"Mr Pink\", age=30).save()\n assert set(self.Person.objects.distinct(\"name\")) == {\n ...
[ "0.7171296", "0.6381211", "0.6305313", "0.6287358", "0.62533", "0.61289865", "0.6106848", "0.6078984", "0.60779727", "0.59708464", "0.594668", "0.5885581", "0.5836582", "0.5778179", "0.5739546", "0.5716182", "0.5711451", "0.57031935", "0.57015455", "0.5691546", "0.5676289", ...
0.7374313
0
Tests updating a custom distinct attribute.
def test_update_distinct_attribute(empty_index): index = empty_index() response = index.update_distinct_attribute(NEW_DISTINCT_ATTRIBUTE) index.wait_for_task(response.task_uid) response = index.get_distinct_attribute() assert response == NEW_DISTINCT_ATTRIBUTE
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_reset_distinct_attribute(empty_index):\n index = empty_index()\n # Update the settings first\n response = index.update_distinct_attribute(NEW_DISTINCT_ATTRIBUTE)\n update = index.wait_for_task(response.task_uid)\n assert update.status == \"succeeded\"\n # Check the settings have been cor...
[ "0.69757235", "0.6877334", "0.64377487", "0.6401684", "0.62925076", "0.6141173", "0.6129551", "0.5928887", "0.5882361", "0.58768326", "0.5776375", "0.57444024", "0.57308495", "0.5680889", "0.5659367", "0.5655449", "0.5609948", "0.5599394", "0.5593579", "0.55859065", "0.558134...
0.7738963
0
Tests updating distinct attribute at null.
def test_update_distinct_at_to_none(empty_index): index = empty_index() # Update the settings first response = index.update_distinct_attribute(NEW_DISTINCT_ATTRIBUTE) update = index.wait_for_task(response.task_uid) assert update.status == "succeeded" # Check the settings have been correctly upda...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_distinct_attribute(empty_index):\n index = empty_index()\n response = index.update_distinct_attribute(NEW_DISTINCT_ATTRIBUTE)\n index.wait_for_task(response.task_uid)\n response = index.get_distinct_attribute()\n assert response == NEW_DISTINCT_ATTRIBUTE", "def test_reset_distinct_...
[ "0.69314086", "0.6787653", "0.635861", "0.6348732", "0.6094404", "0.6029529", "0.5991318", "0.5986552", "0.5949775", "0.59351224", "0.59338945", "0.59041405", "0.5736023", "0.5693171", "0.56724703", "0.56440735", "0.56093395", "0.558425", "0.55558413", "0.5489437", "0.5478113...
0.77116615
0
Tests resetting the distinct attribute setting to its default value.
def test_reset_distinct_attribute(empty_index): index = empty_index() # Update the settings first response = index.update_distinct_attribute(NEW_DISTINCT_ATTRIBUTE) update = index.wait_for_task(response.task_uid) assert update.status == "succeeded" # Check the settings have been correctly update...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_distinct_at_to_none(empty_index):\n index = empty_index()\n # Update the settings first\n response = index.update_distinct_attribute(NEW_DISTINCT_ATTRIBUTE)\n update = index.wait_for_task(response.task_uid)\n assert update.status == \"succeeded\"\n # Check the settings have been c...
[ "0.6772628", "0.6436121", "0.6057547", "0.6033246", "0.5754811", "0.5673129", "0.5640679", "0.56396735", "0.5496543", "0.54774064", "0.54538465", "0.54514074", "0.5443915", "0.543396", "0.5418498", "0.5403552", "0.5392372", "0.5346754", "0.5346754", "0.534544", "0.53452265", ...
0.75935936
0
To check if the database is empty and if number of records in the curves table match the number of colums in data table
def check_integrity(self): curves = list() data = list() schema = list() try: with sqlite3.connect(self.db_file) as conn: cur = conn.cursor() cur.execute("""SELECT name FROM sqlite_master ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_empty_table(spark, df):\n return df.count()", "def check_pivot(self):\n cur = self.conn.cursor(cursor_factory=psycopg2.extras.DictCursor)\n cur.execute(\"SELECT count(*) as count FROM comuni\")\n if cur.fetchone()['count'] == 0:\n return False\n\n return True",...
[ "0.7119765", "0.67205954", "0.66683275", "0.6614719", "0.65096724", "0.64495516", "0.6423471", "0.6408584", "0.63829684", "0.63311976", "0.6327359", "0.6316111", "0.6288299", "0.62037814", "0.6198717", "0.61604923", "0.61486655", "0.6144986", "0.6110447", "0.60529774", "0.601...
0.6756671
1
retrieve a log from a well object based on name
def get_log(self, name): try: if not self.check_integrity(): raise Exception("Database check failed.") if name not in self.existing_logs: raise Exception("no log named {}!".format(name)) depth = None data = None info = N...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getattr__(self, name):\n return getattr(self.logger, name)", "def get(name):\r\n log = logging.getLogger(\"%s.%s\" % (ROOT_NAME, name))\r\n return log", "def __init__(self, name=None):\r\n self.log = {}\r\n self.name = name", "def get_log(self, logs, ref=None):\n log_l...
[ "0.6410488", "0.61597985", "0.6137236", "0.60459477", "0.5966296", "0.5935314", "0.5915831", "0.58834445", "0.58472806", "0.580055", "0.5747475", "0.5723606", "0.569686", "0.569686", "0.56823814", "0.5631312", "0.55898577", "0.5562629", "0.5538704", "0.55312175", "0.5525273",...
0.6700138
0
remove log from the database
def drop_log(self, name): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_log():\n log_path = Path.cwd() / \"premise.log\"\n if log_path.exists():\n log_path.unlink()", "def delete_log(self):\n os.system('rm -rf *.log')\n os.system('rm -rf *.log~')\n os.system('rm -rf *.last')\n os.system('rm -rf *.last~')", "async def logremove(se...
[ "0.73590934", "0.70616347", "0.69847333", "0.6977385", "0.69092923", "0.68795884", "0.68770546", "0.68559015", "0.6831385", "0.6782533", "0.67610216", "0.67543477", "0.67404985", "0.6728246", "0.6680153", "0.6674054", "0.66031235", "0.6536886", "0.652178", "0.6432546", "0.643...
0.74065155
0
This method acts similar to TF 1.x contrib's slim `resnet_arg_scope()`. It overrides
def _set_resnet_arg_scope(self): vs_initializer = tf.keras.initializers.VarianceScaling(2.0) l2_regularizer = tf.keras.regularizers.l2(self.config.GENERATOR_WEIGHT_DECAY) for layer in self.resnet50V2.layers: if isinstance(layer, layers.Conv2D): # original implementati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resnet_arg_scope(weight_decay=0.0001,\n batch_norm_decay=0.997,\n batch_norm_epsilon=1e-5,\n batch_norm_scale=True):\n batch_norm_params = {\n 'decay': batch_norm_decay,\n 'epsilon': batch_norm_epsilon,\n 'scale': batch_norm_sc...
[ "0.7317407", "0.69415987", "0.68931425", "0.66727936", "0.6627226", "0.6583197", "0.657031", "0.65344423", "0.652833", "0.6508914", "0.63038117", "0.60640794", "0.6034785", "0.6023101", "0.60036284", "0.5946136", "0.59422016", "0.5882463", "0.5860376", "0.584589", "0.57714474...
0.75091875
0
Loops through the sequence, pulling out lists and numbers and appends to one list.
def unPackSequence(self,seq): for val in seq.values: # If this is a Sequence, we need to loop # through all of the values. if (isinstance(val,Sequence)): for y in val.values: # Need to check for a nested Sequence.. if (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_numbers(sequence):\r\n\r\n new_list = []\r\n for element in sequence:\r\n if isinstance(element, numbers.Number) == True:\r\n new_list.append(element)\r\n\r\n return new_list", "def mk_lst_atnum(self):\n\t\telem_rnge=[]\n\t\tfor i in self.atom_num_lst:\n\t\t\tel_strt=i[0]\n\t\t...
[ "0.6608918", "0.62080395", "0.5952531", "0.58509207", "0.57317436", "0.569225", "0.5652438", "0.56388247", "0.56002635", "0.5560526", "0.55465287", "0.55451286", "0.55406106", "0.5538535", "0.5516778", "0.55025935", "0.5459181", "0.5458194", "0.5449622", "0.5444445", "0.54184...
0.6227478
1
Merge frequency channels into bands. This applies the channels_per_band mapping to the frequency data. Each band centre frequency is the mean of the corresponding channel group's frequencies, while the band bandwidth is the sum of the corresponding channel group's bandwidths. Any band containing an selected channel is ...
def merge(self, channels_per_band): # Each band centre frequency is the mean of the corresponding channel centre frequencies self.freqs = np.array([self.freqs[chans].mean() for chans in channels_per_band], dtype='double') # Each band bandwidth is the sum of the corresponding channel bandwidths ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def power_in_bands(self, bands=None, avgaxis=None):\n if bands is None:\n bands = _third_octave_bands\n\n # center frequencies\n fcs = np.asarray([b[0] for b in bands])\n Npow2 = 2 ** (self.nt - 1).bit_length()\n f = np.fft.fftfreq(Npow2, d=1 / self.fs)\n\n shap...
[ "0.5844027", "0.5711204", "0.5668193", "0.5579299", "0.54720396", "0.529781", "0.52940506", "0.52754074", "0.5260165", "0.52417344", "0.5239664", "0.52370924", "0.522461", "0.51322466", "0.5131431", "0.51101893", "0.5090947", "0.50556654", "0.5049532", "0.50319654", "0.502597...
0.77019286
0
Verbose humanfriendly string representation of compound scan object.
def __str__(self): if len(self.label) > 0: descr = ["'%s', target='%s' [%s]" % (self.label, self.target.name, self.target.body_type)] else: descr = ["target='%s' [%s]" % (self.target.name, self.target.body_type)] if self.baseline: descr[0] += ', initial baseli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n return \"<scape.CompoundScan '%s' target='%s' scans=%d at 0x%x>\" % \\\n (self.label, self.target.name, len(self.scans), id(self))", "def summary_string(self) -> str:", "def __str__(self):\n result=\"curv %f d0 %f z0 %f ctheta %f phi %f barcode %d\"%(self.curv,...
[ "0.7058272", "0.6654389", "0.6609311", "0.6565386", "0.64818525", "0.6451558", "0.64161944", "0.63941485", "0.63828623", "0.6356845", "0.62884885", "0.6260844", "0.62590647", "0.62419504", "0.6229655", "0.62264264", "0.62011516", "0.61939335", "0.6191299", "0.6185869", "0.618...
0.70026654
1
Short humanfriendly string representation of compound scan object.
def __repr__(self): return "<scape.CompoundScan '%s' target='%s' scans=%d at 0x%x>" % \ (self.label, self.target.name, len(self.scans), id(self))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n if len(self.label) > 0:\n descr = [\"'%s', target='%s' [%s]\" % (self.label, self.target.name, self.target.body_type)]\n else:\n descr = [\"target='%s' [%s]\" % (self.target.name, self.target.body_type)]\n if self.baseline:\n descr[0] += ',...
[ "0.688725", "0.67664367", "0.6724836", "0.6670949", "0.6578623", "0.64914143", "0.6479086", "0.64786154", "0.64267373", "0.6376614", "0.6373513", "0.6347645", "0.63218963", "0.63008374", "0.6251328", "0.6250434", "0.6240722", "0.62382686", "0.62278575", "0.6213998", "0.621322...
0.7146545
0
Simultaneously fit beam and baselines to all scans in a compound scan. This fits a beam pattern and baselines to the selected power data in all the scans comprising the compound scan. The beam pattern is a Gaussian function of the twodimensional target coordinates for the entire compound scan. The initial baseline is a...
def fit_beam_and_baselines(self, pol='absI', circular_beam='auto', bl_degrees=(1, 3), refine_beam=True, spike_width=0, band=0): scan_coords = [scan.target_coords for scan in self.scans] scan_data = [remove_spikes(scan.pol(pol)[:, band], spike_width=spike_width) for scan in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fit_map(self,data,maps):\n fname = data.filename.split('/')[-1]\n\n mjd0 = data['level1/spectrometer/MJD'][0]\n\n\n # If the source is Jupiter we will use the beam model\n self.model.set_fixed(**{'x0':True,'y0':True,'phi':True,'sigx':True,'sigy_scale':True})\n def limfunc(P):...
[ "0.5598162", "0.5527672", "0.53220797", "0.52896893", "0.5284418", "0.51551104", "0.5112994", "0.511094", "0.50964415", "0.5070264", "0.5061855", "0.5042336", "0.50071", "0.49789724", "0.4932618", "0.4909247", "0.49040374", "0.48918086", "0.487291", "0.48722082", "0.48522362"...
0.7559899
0
Estimate height of fitted baseline (at fitted beam center). This estimates the height of the fitted baseline (if any) at the beam center (or the target position, if no beam is fitted). It takes into account scanbased baselines in the case of a refined beam. Returns
def baseline_height(self): if self.beam and self.beam.is_valid: # Refined beam has at least 2 per-scan baselines - obtain weighted average closest to beam center if self.beam.refined: dist_to_center = np.tile(np.inf, len(self.scans)) closest_time = np.zero...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def baseline(self):\n if getattr(self, \"_baseline\", None) is None:\n self._baseline = (self.container.height - 1) / 2\n return self._baseline", "def calculate_height(self):\n return self.endY - self.startY", "def height(self) -> float:\n top = 0\n height_ = 0\n ...
[ "0.6542492", "0.6280973", "0.59154475", "0.5837213", "0.5821059", "0.57658815", "0.5764019", "0.5725438", "0.5682824", "0.56201655", "0.55726725", "0.5555807", "0.54607314", "0.5446551", "0.5441504", "0.5437026", "0.5437026", "0.5437026", "0.5437026", "0.5437026", "0.5437026"...
0.83846015
0
Creates a file with the failures
def generateFailures(self): if self.failures in ([], None): return False failedTests = open(FAILURES, 'w') # TODO: append timestamp failedTests.write("# Failed tests file:\n") failedTests.write("# The following tests failed:\n") results = [] for (fail...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reportErrorMsg(self, ErrorMessage, outputFile):\n f=self.openFile(outputFile, \"a\") #open otuputFile for appending\n self._insertErrorMsg(ErrorMessage, f)\n f.close()", "def test_malformed(self):\n fdesc, fname = tempfile.mkstemp()\n tfile = os.fdopen(fdesc, 'w')\n ...
[ "0.64918286", "0.63601446", "0.6313763", "0.6276625", "0.61415344", "0.61130357", "0.60906464", "0.60813326", "0.60699445", "0.6066768", "0.6014459", "0.60016465", "0.5988164", "0.5936202", "0.59356916", "0.5922553", "0.5885075", "0.5859121", "0.5850302", "0.5808094", "0.5802...
0.7097818
0
main. Parses options and launches tester accordingly
def main(): log.configureLogger(log=log.testlog, fileLog=log.TESTLOGFILE, format=log.TESTFORMAT, truncate=True) log.configureLogger(log=log.log, fileLog=log.LOGFILE) try: opts, args = getopt.getopt(sys.argv[1:], "h", ["help", "file=", "verbosity=", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n opt = parse_opts()\n run(opt)", "def main():\n opt = parse_opts()\n run(opt)", "def main():\n tester = Tester()\n # parse args, load configuration and create all required objects.\n tester.setup_experiment()\n # GO!\n tester.run_experiment()", "def main( argv = None )...
[ "0.74648494", "0.74648494", "0.734513", "0.7306256", "0.7227674", "0.7082558", "0.70686907", "0.7002963", "0.69707316", "0.6967899", "0.6943825", "0.6943825", "0.6930058", "0.69207317", "0.6908182", "0.6896923", "0.68950987", "0.685636", "0.68523526", "0.6840879", "0.6772132"...
0.771722
0
Arguments `rs_rel`, `cs_rel` Numpy arrays of same shape, with elements ranging from 0 to 1 that give the row and column indices of the query locations respectively. `k` Integer. Number of nearest neighbors to interpolate between `dist_eps` Distances less than `dist_eps` will be rounded up to `dist_eps`. This avoids div...
def query(self, rs_rel, cs_rel, k = 20, dist_eps = 1e-2): qlocs = np.stack([rs_rel, cs_rel], axis = -1) dists, ixs = self.tree.query(qlocs, k) dists[abs(dists) < dist_eps] = dist_eps weights = (1/dists) weights /= weights.sum(axis = -1, keepdims = True) if (isinstance(se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evalWaveSol(new_interps, patch_dict, intp_deg=1, interp_key='times'):\n try:\n len(new_interps)\n except TypeError:\n new_interps = [new_interps]\n K = patch_dict['K']\n vv = patch_dict['v']\n # Interpolate eigen coefficients\n new_ecs = np.empty((len(new_interps),K),dtype=floa...
[ "0.5075194", "0.5031626", "0.490455", "0.48908958", "0.4879923", "0.48777267", "0.4770437", "0.47269413", "0.46350664", "0.4627406", "0.46109045", "0.46049383", "0.459993", "0.4597956", "0.4581222", "0.45588097", "0.45553517", "0.4553372", "0.45361796", "0.45346838", "0.45002...
0.7458557
0
Create an instance of RequestBrand from a JSON string
def from_json(cls, json_str: str) -> RequestBrand: return cls.from_dict(json.loads(json_str))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, obj: dict) -> RequestBrand:\n if obj is None:\n return None\n\n if not isinstance(obj, dict):\n return RequestBrand.parse_obj(obj)\n\n _obj = RequestBrand.parse_obj({\n \"enabled\": obj.get(\"enabled\") if obj.get(\"enabled\") is not None els...
[ "0.7363198", "0.6268038", "0.614419", "0.595012", "0.5901369", "0.5890789", "0.5777404", "0.56571347", "0.56529176", "0.5650855", "0.5643532", "0.5617905", "0.5617905", "0.56174004", "0.5600303", "0.5475841", "0.54382366", "0.54360545", "0.5423777", "0.54090446", "0.5391293",...
0.90503436
0
Create an instance of RequestBrand from a dict
def from_dict(cls, obj: dict) -> RequestBrand: if obj is None: return None if not isinstance(obj, dict): return RequestBrand.parse_obj(obj) _obj = RequestBrand.parse_obj({ "enabled": obj.get("enabled") if obj.get("enabled") is not None else False, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_json(cls, json_str: str) -> RequestBrand:\n return cls.from_dict(json.loads(json_str))", "def from_dict(cls, dikt) -> 'InstallmentRequest':\n return util.deserialize_model(dikt, cls)", "def from_dict(cls, dikt) -> 'AllOfCreateClaimResponseClaim':\n return util.deserialize_model(di...
[ "0.7679478", "0.5972524", "0.5969632", "0.5839963", "0.579212", "0.57508856", "0.5745636", "0.5735802", "0.570862", "0.568766", "0.56873107", "0.56569636", "0.5647507", "0.56461084", "0.56461084", "0.56461084", "0.56461084", "0.56461084", "0.56461084", "0.56461084", "0.564610...
0.8146828
0
This method aims to get the average reward of Q when algorithm is convergence, and return the average reward number (QLearn) > float
def get_reward(self): ##get total reward value from Q total_reward = 0.0 for value in self.Q.itervalues(): total_reward = total_reward + value ##return the average reward return total_reward
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compute_reward(self):\n last_score = self.episode_qualities[-2]\n new_score = self.episode_qualities[-1]\n reward = new_score - last_score\n return reward", "def average_reward(self):\n T = len(self)\n return np.sum(self.rewards / T)", "def _get_reward(self):\n ...
[ "0.7103472", "0.7073003", "0.6997558", "0.6786214", "0.6777132", "0.66912806", "0.6688988", "0.6633598", "0.6628798", "0.6565059", "0.65352833", "0.65352833", "0.65352833", "0.6506695", "0.6501479", "0.64849424", "0.6481587", "0.64435846", "0.64326936", "0.64276785", "0.63895...
0.78576
0
This method would be used in Q5 to make the Q value initial to the given number (QLearn, int) > None
def initial_Q(self, negative): ##get each values in the Q, and change their content to given number, plan to use in Q5 for key in self.Q.iterkeys(): self.Q[key] = float(negative)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialise_target(self, c, key):\n if key == 'p':\n return 1e5\n elif key == 'h':\n if self.Q.val < 0 and self.Q.is_set:\n return 5e5\n elif self.Q.val > 0 and self.Q.is_set:\n return 1e5\n else:\n return 3e5...
[ "0.6239269", "0.6144159", "0.60767823", "0.5894886", "0.5801988", "0.5796355", "0.5770441", "0.5764256", "0.57420045", "0.5707565", "0.5667575", "0.5652657", "0.56428313", "0.5583631", "0.5548008", "0.5546005", "0.55409145", "0.5530589", "0.552907", "0.5526886", "0.55216646",...
0.7193756
0
This method aims to get the average reward of Q when algorithm is convergence, and return the average reward number (QLearn) > float
def get_reward(self): ##get total reward value from Q total_reward = 0.0 for value in self.Q.itervalues(): total_reward = total_reward + value ##return the average reward return total_reward
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compute_reward(self):\n last_score = self.episode_qualities[-2]\n new_score = self.episode_qualities[-1]\n reward = new_score - last_score\n return reward", "def average_reward(self):\n T = len(self)\n return np.sum(self.rewards / T)", "def _get_reward(self):\n ...
[ "0.71038145", "0.70732397", "0.6997361", "0.6785547", "0.6777385", "0.6690966", "0.6689361", "0.6633346", "0.6629559", "0.65654373", "0.6535817", "0.6535817", "0.6535817", "0.65063584", "0.65024406", "0.6485663", "0.64820874", "0.6443513", "0.6432792", "0.642921", "0.6390154"...
0.7857142
0
Can be called by a subclass to turn on debug printing, which is off by default. This is the sort of thing that we'll do temporarily to debug a particular module.
def _enableDebugPrint(self): self._dbPrint = Printer(debugPrint=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toggle_debug(self):\n self.__debug = not self.__debug", "def _set_debug(debug):\n global _DEBUG\n _DEBUG = debug\n if debug:\n logging.disable(logging.NOTSET)\n else:\n logging.disable(logging.DEBUG)", "def setdebug(self):\n self.debug = True\n irclib.DEBUG = ...
[ "0.7449715", "0.73577935", "0.7184942", "0.71557313", "0.7130531", "0.70672524", "0.6979527", "0.69692737", "0.6967443", "0.6953417", "0.69455767", "0.69269854", "0.69086194", "0.6852432", "0.683156", "0.6830406", "0.6823304", "0.6816698", "0.67899185", "0.6775433", "0.675419...
0.79366827
0
Given an offset, finds the smallest data offset that is still larger than the given one. Useful for predicting data sizes.
def next_smallest_offset(offset): result = 999999 # larger than any 2 bytes can hold so it's okay for i in range(animTableSize): file.seek(baseOffset + animTableOffset + i * 2) value = animTableOffset + read_int16(file) if offset < value: result = min([result, value]) for i in range(frameT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_offset(self):\n return self.offset", "def pick_hkl(offset,monotype):\r\n if monotype == \"115\": return monotype\r\n offset_table = {\"004\":40.31,\"113\":15.08,\"115\":24.52,\"117\":28.89,\r\n \"224\":5.05,\"228\":20.84,\"331\":36.42,\"333\":14.42,\r\n ...
[ "0.60255474", "0.5917065", "0.55483514", "0.5496242", "0.5479068", "0.5474642", "0.54324865", "0.5425579", "0.53831327", "0.53377974", "0.5227506", "0.5223104", "0.5196041", "0.51932144", "0.51929575", "0.51640016", "0.51567763", "0.5137963", "0.5134362", "0.5123117", "0.5116...
0.70638347
0
Return a URL to a random photo of a doggo!
def get_random_doggo() -> str: try: url = 'https://dog.ceo/api/breeds/image/random' response = requests.get(url) response.raise_for_status() return (response.json())['message'] except requests.exceptions.RequestException as e: raise SystemExit(e) from None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_rand_img():\n import urllib\n import os\n import glob\n\n pics = glob.glob('/home/cody_techngs/PycharmProjects/ProjTest/ActiveAMT/ActiveAMT_FLASK/static/images/HITs/rand*')\n nums = []\n\n for pic in pics:\n nums.append(int(pic.split('rand_img')[1].split('.')[0]))\n\n unique_num...
[ "0.7453313", "0.724781", "0.70130974", "0.6922463", "0.6880638", "0.6880318", "0.68614966", "0.67962927", "0.6781785", "0.67620844", "0.67239094", "0.6632829", "0.6624345", "0.66026783", "0.65969336", "0.65794235", "0.6541514", "0.6538393", "0.6531164", "0.6465773", "0.644739...
0.74325985
1
function used for marking paid overtime request.
def action_payslip_done(self): for recd in self.overtime_ids: recd.payslip_paid = True return super(PayslipOverTime, self).action_payslip_done()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def give_raise(self):\r\n self.hourly_pay = 12.00", "def _update_time_delivered(self, time_delivered):\n # Update db record's time_delivered field\n update = {'time_delivered': time_delivered}\n datebase.update_transaction_record(filter=self.filter, update=update)\n \n ...
[ "0.5734456", "0.54917884", "0.5488641", "0.5425759", "0.5379847", "0.5361704", "0.5336929", "0.5302527", "0.52825636", "0.5259016", "0.5251456", "0.52396864", "0.5166845", "0.51525915", "0.5093702", "0.50864965", "0.50557196", "0.5053615", "0.503513", "0.5030416", "0.5005438"...
0.62886924
0
Get earth radius in different units
def earth_radius(units="m"): if "m" == units: return 6371000 elif "km" == units: return 6371 elif "mi" == units: return 3959
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_earth_radius(latitude):\n a = R_EARTH_MAX\n b = R_EARTH_MIN\n num = ((a ** 2 * np.cos(latitude)) ** 2 +\n (b ** 2 * np.sin(latitude)) ** 2)\n den = ((a * np.cos(latitude)) ** 2 +\n (b * np.sin(latitude)) ** 2)\n\n earth_radius = np.sqrt(num / den)\n\n return earth_radi...
[ "0.79103917", "0.76303893", "0.7034871", "0.67765987", "0.6703641", "0.6703641", "0.66735804", "0.6649192", "0.661459", "0.6605676", "0.65906054", "0.65811086", "0.65754837", "0.65078837", "0.6493166", "0.6481205", "0.64750284", "0.6433246", "0.6433246", "0.6433246", "0.64332...
0.8567125
0
Compute rhumb bearing The rhumb bearing is a constant bearing that takes from start to finish
def rhumb_bearing(start,finish): s = math.pi * np.squeeze(np.array(start)) / 180 f = math.pi * np.squeeze(np.array(finish)) / 180 delta_lat = math.log(math.tan(math.pi/4 + f[0]/2)/ math.tan(math.pi/4 + s[0]/2)) delta_lon = f[1]-s[1] if abs(delta_lon) > math.pi: if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bearing(start,finish):\n\n s = math.pi * np.squeeze(np.array(start)) / 180\n f = math.pi * np.squeeze(np.array(finish)) / 180\n\n y = math.sin(f[1] - s[1]) * math.cos(f[0])\n x = math.cos(s[0])*math.sin(f[0]) - math.sin(s[0])*math.cos(f[0])*math.cos(f[1] - s[1])\n\n return math.atan2(y,x)/math.p...
[ "0.64192533", "0.6089861", "0.60896766", "0.60305", "0.60060227", "0.59659827", "0.59157413", "0.5848272", "0.58012354", "0.58004105", "0.5798403", "0.5783343", "0.5741823", "0.5735007", "0.5712815", "0.5605114", "0.5593813", "0.5574494", "0.5536812", "0.5531894", "0.5509087"...
0.8037823
0
Compute geodesic distance between two coordinates
def geodesic_distance(coord1, coord2): # convert coordinates to radians s = math.pi * np.squeeze(np.array(coord1)) / 180 f = math.pi * np.squeeze(np.array(coord2)) / 180 delta = (f - s)/2 t = math.cos(f[0]) * math.cos(s[0]) * math.sin(delta[1])**2 + math.sin(delta[0])**2 return earth_radius() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geodesicDistance(A, B = geolocate(\"Colosseo\")):\n # colosseo = (41.890183, 12.492369)\n return geopy.distance.vincenty(A, B).meters", "def calculateDistanceBetweenPoints(lat1,lon1,lat2,lon2):\n\treturn Geodesic.WGS84.Inverse(lat1,lon1, lat2, lon2)['s12']", "def gpx_distance(lat1, lon1, lat2, lon2):...
[ "0.8040781", "0.76826054", "0.7614041", "0.7522615", "0.7473504", "0.74703974", "0.74609226", "0.74029285", "0.73929065", "0.7370778", "0.736628", "0.73550165", "0.73463356", "0.7341979", "0.7339803", "0.73323673", "0.7329245", "0.73039186", "0.7303546", "0.72905797", "0.7283...
0.8206886
0
Compute rhumb distance The rhumb line is a line with a constant bearing connecting start and finish
def rhumb_distance(coord1,coord2): s = math.pi * np.squeeze(np.array(coord1)) / 180 f = math.pi * np.squeeze(np.array(coord2)) / 180 delta_psi = math.log(math.tan(math.pi/4 + f[0]/2)/math.tan(math.pi/4 + s[0]/2)) delta_phi = f[0] - s[0] if math.isclose(delta_psi,0): q = math.cos(coord1[0]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rhumb_bearing(start,finish):\n s = math.pi * np.squeeze(np.array(start)) / 180\n f = math.pi * np.squeeze(np.array(finish)) / 180\n\n delta_lat = math.log(math.tan(math.pi/4 + f[0]/2)/\n math.tan(math.pi/4 + s[0]/2))\n delta_lon = f[1]-s[1]\n\n if abs(delta_lon) > math.pi...
[ "0.6622201", "0.6087436", "0.58070743", "0.56087154", "0.55743235", "0.553928", "0.546571", "0.5325996", "0.52972853", "0.529526", "0.5284628", "0.5196924", "0.5190767", "0.5163438", "0.5128233", "0.5107282", "0.50858974", "0.508183", "0.5076084", "0.507107", "0.502082", "0...
0.66375715
0
A paste pipeline replica that keys off of auth_strategy. Code nabbed from cinder.
def auth_pipeline_factory(loader, global_conf, **local_conf): pipeline = local_conf[cfg.CONF['service:api'].auth_strategy] pipeline = pipeline.split() LOG.info('Getting auth pipeline: %s', pipeline[:-1]) filters = [loader.get_filter(n) for n in pipeline[:-1]] app = loader.get_app(pipeline[-1]) f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Retrieve(self, key):\n\n pyperclip.copy(self.paris[key])\n pyperclip.paste()\n stdout.write(\"Password copied to clipboard\\n\\n\")", "def __init__(__self__, *,\n roles: pulumi.Input[Sequence[pulumi.Input[str]]],\n source: pulumi.Input['AuthorizationPolicy...
[ "0.5118556", "0.51185375", "0.4965619", "0.48775768", "0.48199967", "0.48162", "0.4799817", "0.4751136", "0.4746879", "0.47116855", "0.4697333", "0.4630406", "0.46250236", "0.46093643", "0.4596763", "0.45823455", "0.45453352", "0.45183134", "0.4500309", "0.44993395", "0.44696...
0.52556103
0
Created 20180315 by Magnus Wenzer Updated 20180315 by Magnus Wenzer Checks a list containing dictionaries. For each dict in list, if active, value is put in return list.
def _get_active_values_in_list_with_dicts(self, dict_list): return_list = [] for item in dict_list: if item['active']: return_list.append(item['value']) return return_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_by_status(x, _filter_status_list=None):\n if _filter_status_list:\n for filter_status in _filter_status_list:\n if x.get(filter_status, False):\n return True\n return False\n return True", "def active_provide...
[ "0.5671397", "0.550913", "0.550407", "0.54994005", "0.5442271", "0.5409051", "0.5357739", "0.5319727", "0.5317687", "0.5249954", "0.524707", "0.52308744", "0.5226059", "0.52194464", "0.51830673", "0.5159976", "0.5140193", "0.5088059", "0.50812167", "0.50732946", "0.50649667",...
0.82694095
0
Created 20180219 by Magnus Wenzer Updated 20180220 by Magnus Wenzer Deletes the given subset in the given workspace.
def delete_subset(self, user_id=None, workspace_alias=None, subset_alias=None, subset_unique_id=None, permanently=False): if not self._change_ok(workspace_alias): return False if not self._change_ok(subset_alias): return False uuid_mapping = self._get_uuid_mapp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_subset_delete(self, request):\n workspace_uuid = request['workspace_uuid']\n subset_uuid = request['subset_uuid']\n# print('###', user_id)\n# print('###', alias)\n# print('###', source_uuid)\n uuid_mapping = self._get_uuid_mapping_object(workspace_uuid)\n ...
[ "0.6940467", "0.6327891", "0.6094673", "0.60219777", "0.5787553", "0.5776524", "0.5695416", "0.5645003", "0.5572171", "0.549758", "0.53848606", "0.5375593", "0.5357942", "0.5336151", "0.53086", "0.52408975", "0.5216784", "0.51458037", "0.5117532", "0.5078234", "0.50725836", ...
0.6962482
0
Created 20180315 by Magnus Wenzer Updated 20180315 by Magnus Wenzer Internally its only possible to filter water bodies. "selectable" needs to be checked against water district and type.
def dict_water_district(self, workspace_unique_id=None, subset_unique_id=None, water_district=None, request=None): workspace_object = self._get_workspace_object(unique_id=workspace_unique_id) subset_object = workspace_object.get_subset_object(subset_unique_id) water_body_mapping = self.mapping...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def water_selection(self):\n sel_cache = self.pdb_hierarchy.atom_selection_cache()\n sel_str = \"({}) and element O and altloc ' '\".format(\n \" or \".join([ \"resname \" + i for i in WATER_RES_NAMES ]))\n return sel_cache.selection(sel_str).iselection()", "def selectable(cls):\n return...
[ "0.5496856", "0.541872", "0.53677183", "0.5266952", "0.5236672", "0.5216479", "0.5079429", "0.5077097", "0.5003362", "0.4986593", "0.49618343", "0.49564248", "0.49207762", "0.48768166", "0.4875303", "0.48698652", "0.48493057", "0.48145944", "0.4809578", "0.48075867", "0.47838...
0.5763971
0
Created 20180220 by Magnus Wenzer Updated 20180220 by Magnus Wenzer Loads default data to the workspace with alias workspace_alias.
def import_default_data(self, user_id, workspace_alias=None, force=False): uuid_mapping = self._get_uuid_mapping_object(user_id) unique_id = uuid_mapping.get_uuid(workspace_alias, user_id) self._logger.debug('Trying to load default data in workspace "{}" with alias "{}"'.format(unique_id, works...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _populate_default_report(self):\n # Read the default value of the report from a file.\n with open('data/default_report.json', encoding='utf-8') as f:\n data = json.load(f)\n return data", "def DefaultData():\n return copy.deepcopy(DEFAULT_DATA)", "def load_workspace(self, u...
[ "0.5870257", "0.5760178", "0.56529677", "0.5623296", "0.55893505", "0.55027646", "0.5497914", "0.54843235", "0.5402786", "0.52960736", "0.52848715", "0.52841055", "0.5282006", "0.5274736", "0.5241284", "0.5206808", "0.5187985", "0.51797193", "0.5175489", "0.51556045", "0.5130...
0.704804
0
Created 20180222 by Magnus Wenzer Updated 20180317 by Magnus Wenzer request is a list of subsets
def list_subsets(self, workspace_unique_id=None, user_id=None, request=None): # print('list_subsets_request', request) subset_list = [] # subset_uuid_list = [] # sub_request_list = [] request_for_subset_uuid = self._get_mapping_for_name_in_dict('uuid', request) # sub...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_subset_list(self, request):\n user_id = request['user_id']\n workspace_uuid = request['workspace_uuid'] \n \n # Initiate structure \n response = {'workspace': {}, \n 'subsets': []}\n \n # Add workspace info\n response['workspace'...
[ "0.77484703", "0.7521009", "0.7020162", "0.698494", "0.6955711", "0.6873681", "0.68087065", "0.6790433", "0.6709277", "0.66507804", "0.65798736", "0.65652454", "0.65651333", "0.63246727", "0.62794", "0.62321556", "0.6219645", "0.6185485", "0.6175655", "0.6136254", "0.6104752"...
0.759992
1
Created 20180219 by Magnus Wenzer Updated 20180219 by Magnus Wenzer Loads all workspaces for the given user. Including default workspace.
def load_all_workspaces_for_user(self, user_id, with_status=None): self._logger.debug('Trying to load all workspaces for user "{}"'.format(user_id)) status = self.include_status[:] if with_status: if type(with_status) != list: with_status = [with_status] s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_workspaces(self, user_id=None, include_default=True):\n workspace_list = []\n uuid_mapping = self._get_uuid_mapping_object(user_id)\n for unique_id in uuid_mapping.get_uuid_list_for_user(user_id, status=self.all_status):\n workspace_list.append(self.dict_workspace(unique_id...
[ "0.7145674", "0.6562303", "0.6544468", "0.64289045", "0.6418593", "0.620989", "0.6157345", "0.604248", "0.56916255", "0.56894064", "0.5645786", "0.5548759", "0.54820323", "0.54720014", "0.5402761", "0.5397861", "0.53499335", "0.53392744", "0.5335907", "0.5318997", "0.526516",...
0.8043361
0
method to find the campus entry time, leave time and time on campus First time in a day a phone sees a campus router is entry time of the participant/phone and last time is leave time. Difference of these two gives time spent on campus.
def get_campus_entry_leave_times(file): #Read the data in to data frame df = pd.read_csv(file) #consider only university wifi router address records and split the record_time in to date and time df_with_UofS_Wifi = df.loc[df.ssid.isin(['uofs-secure','uofs-public','uofs-guest'])] df_with_UofS_Wifi[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time(self):\n start=''\n end=''\n time=''\n times=self.times\n print(times[self.istep])\n if self.istep > 0:\n start=ncEarth.beginstr % times[self.istep].isoformat()\n\n\n if self.istep < len(times)-2:\n end = ncEarth.endstr % times[sel...
[ "0.61323994", "0.59420913", "0.57315105", "0.56641966", "0.56329477", "0.5629163", "0.56087255", "0.55361205", "0.5505485", "0.54692566", "0.54194015", "0.5413245", "0.54055864", "0.5391738", "0.5372277", "0.53710574", "0.5364219", "0.5362187", "0.5357668", "0.53460544", "0.5...
0.65192443
0
Load all image paths and labels from JSON annotation files into buffer.
def _load_jsons(self): items = [] labels = [] with open(self._ann_file, 'r') as fid: database = json.load(fid) # iterate through the annotations bbox_scale_list = [] det_bbox_set = {} if self._det_bbox_file is not None: bbox_list = json.lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_annotations(self, index):\n anns_file = open(os.path.join(self.folder_path, self.image_ids[index] + '.json'))\n labels = json.load(anns_file)\n labels = labels[\"shapes\"]\n anns_file.close()\n return labels.copy()", "def load_annotations(self):\n # get keys\n ...
[ "0.6773557", "0.6764564", "0.6703604", "0.6423532", "0.6378831", "0.63352156", "0.6333135", "0.63009274", "0.62890697", "0.6284986", "0.6210532", "0.6171009", "0.616882", "0.616882", "0.6130748", "0.6109519", "0.606346", "0.6059006", "0.60517806", "0.6042462", "0.60410523", ...
0.69886076
0
Joint pairs which defines the pairs of joint to be swapped when the image is flipped horizontally.
def joint_pairs(self): return ((1, 4), (2, 5), (3, 6), (14, 11), (15, 12), (16, 13))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def joint_pairs(self):\n return [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10], [11, 12], [13, 14], [15, 16], #17 body keypoints\n [20-3, 23-3], [21-3, 24-3], [22-3, 25-3], [26-3, 42-3], [27-3, 41-3], [28-3, 40-3], [29-3, 39-3], [30-3, 38-3], \n [31-3, 37-3], [32-3, 36-3], [33-3, 35-3], [43-3, 52-3]...
[ "0.66545373", "0.65470254", "0.6051815", "0.57137436", "0.56843126", "0.5623211", "0.5614786", "0.55623996", "0.55575967", "0.54953533", "0.54756796", "0.54527175", "0.54323506", "0.5426223", "0.54169637", "0.53801167", "0.5361496", "0.53608465", "0.53471905", "0.53354126", "...
0.68822443
0
Bone pairs which defines the pairs of bone to be swapped when the image is flipped horizontally.
def bone_pairs(self): return ((0, 3), (1, 4), (2, 5), (10, 13), (11, 14), (12, 15))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_flip_paris(self):\n # the same names in union and actual\n flip_pair_names = [['rank', 'lank'], ['rkne', 'lkne'], ['rhip', 'lhip'],\n ['rwri', 'lwri'], ['relb', 'lelb'], ['rsho', 'lsho']]\n union_keys = list(self.union_joints.keys())\n union_values = list(self.union_j...
[ "0.662993", "0.6171406", "0.5842243", "0.58399457", "0.5735997", "0.570899", "0.56805974", "0.56785613", "0.567307", "0.56585765", "0.563003", "0.55790025", "0.55271894", "0.55107224", "0.5498656", "0.5486589", "0.5465652", "0.54218626", "0.5388845", "0.5351196", "0.5349765",...
0.7152036
0
Retrieve all possible types of transitions of length specified by the global seq variable. It's a recursive function. The first variable is a list at each call of the function is contains all types of transitions of length trans_len. If this is not the desired length the function will create new, longer transitions bas...
def get_trans(trans, trans_len): if trans_len is seq_len: return trans longer_trans = [] for i in range(0, len(trans)): for j in range(0, len(roles)): extended_trans = trans[i] + roles[j] longer_trans.append(extended_trans) return get_trans(longer_trans, trans_le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fast_forward_to_length(sequences, length):\n return itertools.dropwhile(lambda seq: len(seq) != length, sequences)", "def _process_action_seq(sequence, length=15, new_model=True):\n sequence = sequence[-length:].copy()\n if new_model:\n sequence = sequence[::-1]\n if len(sequence) < length...
[ "0.50799465", "0.50494367", "0.5038166", "0.5005558", "0.49217415", "0.48370227", "0.4781379", "0.47625095", "0.47396758", "0.4715089", "0.46634635", "0.4663074", "0.4646214", "0.46372935", "0.46253017", "0.46243155", "0.4622535", "0.4612152", "0.45818692", "0.45770788", "0.4...
0.5663372
0
Get a dictionary which maps types of all possible transitions to their id.
def get_transition_seqs_mapping(): trans = get_trans(roles, 1) return dict(zip(trans, range(0, len(trans))))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transitions(self) -> List[Dict]:\n return []", "def make_state_dict(self):\r\n state_dict = {c.TRANSITION_IN: self.transition_in,\r\n c.TRANSITION_OUT: self.transition_out,\r\n c.NORMAL: self.normal_update}\r\n\r\n return state_dict", "def make...
[ "0.6439613", "0.5733046", "0.57136375", "0.5650811", "0.557072", "0.54940706", "0.5487677", "0.5471991", "0.54332393", "0.5409491", "0.54032075", "0.5389907", "0.5374988", "0.53382164", "0.5318377", "0.53044444", "0.5293877", "0.52808124", "0.5280403", "0.527011", "0.527011",...
0.69371897
0
Pipeline involves parsing a text in order to obtain POS for all words and dependency relations, creating an entitygrid from all the nouns, proper nouns and pronouns, turning that grid into a distribution over sequences of entities and finally turning that distribution into a number of features
def pipeline(file): # special processing is performed to avoid sentence boundaries after abbrevs doc = nlp(text_processing.preprocess_text_ents(file)) grid = get_grid(doc) distrib = get_distrib(grid, doc) return get_feats(distrib)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _preprocess(self):\n self.data['sentences'] = self.data['text'].apply(self._tokenize_sent)\n self.data['nouns'] = self.data['sentences'].apply(self._get_nouns)\n # self._get_frequent_features()\n # self._compactness_pruning()\n # self._redundancy_pruning()\n # self._ge...
[ "0.67250866", "0.6273848", "0.62365246", "0.6191878", "0.6069492", "0.6068553", "0.6060052", "0.6042596", "0.59811956", "0.59724104", "0.59723806", "0.5947424", "0.5933629", "0.5927411", "0.5899485", "0.588648", "0.58602023", "0.5841929", "0.58375186", "0.5805755", "0.5803638...
0.63119763
1
From the entity grid retrieve the distribution of specific sequences of entity transitions the sequence length is chosen to be 2.
def get_distrib(grid, doc): global trans_seqs total_count = 0 distrib = [0] * len(trans_seqs) for ent in grid: ent_info = grid[ent] # start checking from 1st sent, at each sent look back for i, s in enumerate(doc.sents): if i is 0: continue ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_transition_probs(self):\n n = len(self.speakers) # TODO why this line ???\n transitions = np.random.randint(5, size=(n, n)) + 1\n transitions += transitions.transpose()\n for i in range(0, math.floor(n / 2)):\n s1 = np.random.randint(n)\n s2 = np.random.r...
[ "0.5346634", "0.5228086", "0.5218266", "0.51843196", "0.5098318", "0.5068576", "0.50205743", "0.50091136", "0.50077754", "0.49654615", "0.49433005", "0.49026233", "0.48638028", "0.48624063", "0.48541245", "0.48035395", "0.47897255", "0.47870055", "0.4772353", "0.47721606", "0...
0.58241117
0
Message to children is the expectation of the natural statistic vector. Also, messages to all children are the same.
def updateMsgToChild(self): # Equation (A.13) self.msgToChild = np.array([ self.shape / self.rate, sp.psi(self.shape) - np.log(self.rate) ])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_message(j, i, grand_children_of_i):\n messages[(j,i)] = {xi: 0 for xi in node_potentials[i]}\n \n incoming_messages = {xj: 1 for xj in node_potentials[j]} # Default to be 1 for leaf nodes (no effect)\n if len(grand_children_of_i) != 0: # Only deal with this case because at le...
[ "0.59310055", "0.5701559", "0.5489514", "0.5345456", "0.52907044", "0.5243858", "0.5208686", "0.51975256", "0.5184647", "0.51787", "0.5134574", "0.50988024", "0.5091925", "0.502986", "0.5020265", "0.5015908", "0.5009527", "0.50084186", "0.49896958", "0.4959518", "0.4954847", ...
0.6316827
0
Add a timezoneaware datetime to a point. If no cached timezone is available then we look it up based on lat/long data
def add_timezone(point, tz_cache): def __lookup_tz(point): if 'lat' in point and 'lon' in point: tz_cache['tf'] = TimezoneFinderL() lat = point['lat'] lon = point['lon'] tz_cache['zonename'] = tz_cache['tf'].timezone_at(lat=lat, lng=lon) log.info(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_timezone(dt: datetime, tz_info: tzinfo = UTC) -> datetime:\n if dt.tzinfo is not None:\n raise ValueError(f\"{dt} is already tz-aware\")\n return dt.replace(tzinfo=tz_info)", "def add_local_timezone(dt):\n assert dt.tzinfo is None\n localtz = tzlocal.get_localzone()\n logging.warnin...
[ "0.64761394", "0.58638394", "0.57350594", "0.56670034", "0.56631047", "0.56339055", "0.5580282", "0.555809", "0.5544983", "0.5537903", "0.5529828", "0.5525055", "0.5470559", "0.54561234", "0.54303354", "0.5413975", "0.53542125", "0.52766013", "0.52674073", "0.5260034", "0.525...
0.7735498
0
Build a GPS point from a line of GSDformatted data
def build_point_from_gsd(gsd_line:list, convert_coords:bool=True) -> dict: if gsd_line is None: return None log.debug('build_point_from_gsd: line=%s', gsd_line) # GSD line should be a list of 6 strs if len(gsd_line) != 6: log.warn('gsd_line does not look like valid GSD data: %s', gsd_l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gpgga_convert(line):\r\n gps = line.strip().split(',')\r\n #check data\r\n if gps[6] == '0' :\r\n return\r\n fix = ''\r\n if gps[6] == '1':\r\n fix = 'GPS fix'\r\n elif gps[6] == '2':\r\n fix = 'DGPS fix'\r\n elif gps[6] == '4':\r\n fix = 'RTK Fix coordinate (ce...
[ "0.7007553", "0.6363894", "0.6284185", "0.62214625", "0.6157454", "0.6089781", "0.60783947", "0.59322464", "0.5829045", "0.571882", "0.56910944", "0.5686706", "0.5662082", "0.5659796", "0.5654232", "0.5645341", "0.56356305", "0.56298614", "0.55953664", "0.55884266", "0.557480...
0.69892526
1
Returns a string that describes the flop outputs given possible input constraints vector==state
def getOutLogic(self, state): flops = self.__flops logic = [] for flop in flops: #logic.append(self.__logic[flop]) #logic.append(self.__stateProp.logic[flop]) #thisLogic = "" #for gen in self.__logic[flop]: # thisLogic += gen ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_state(X):\n out = ''\n for coord in range(18):\n out += \"{0}\".format(STATE_VARS[coord])\n val = float(X[coord])\n out += \" {0: 2.4e}\\n\".format(val)\n\n print out", "def solution_to_string(self):\n solution_vector_index_format = [index+1 if elem == 1 else -index...
[ "0.5725954", "0.5650629", "0.56426287", "0.56417847", "0.5459054", "0.5389325", "0.53883845", "0.5376916", "0.53286886", "0.532717", "0.5298706", "0.5298644", "0.5297902", "0.529479", "0.5294783", "0.5267648", "0.5226227", "0.52242136", "0.51998556", "0.51962954", "0.51801956...
0.5701107
1