query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Token mappings for NER model
def load_mappings(filepath): return pickle.load(open(filepath, "rb"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokens():\n pass", "def map_Token_to_dict(t):\n token_info = {}\n token_info[\"word\"] = t.word\n token_info[\"lemma\"] = t.lemma\n token_info[\"msd\"] = t.msd\n token_info[\"pos\"] = t.pos\n token_info[\"saldo\"] = t.saldo\n token_info[\"ref\"] = t.ref\n token_info[\"deprel\"] = t...
[ "0.63447225", "0.6226196", "0.61659867", "0.5927074", "0.589132", "0.58562636", "0.58474576", "0.5840225", "0.58150643", "0.5798591", "0.5797799", "0.57669115", "0.5751382", "0.5750236", "0.57295144", "0.57158226", "0.5683966", "0.5664627", "0.5656512", "0.564592", "0.5643204...
0.0
-1
For use in custom count vectorizer
def get_tokens(input_cell): return ast.literal_eval(input_cell)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_vectorizer(self, df:pd.DataFrame, column_name:str, y:list=None):\n self._vectorizer = CountVectorizer()\n # print(vectorizer.get_feature_names())\n ans = self._vectorizer.fit_transform(raw_documents=df[column_name], y=y)\n return ans", "def count_vector(df:pd.DataFrame, colu...
[ "0.6809927", "0.67695844", "0.65299875", "0.6391221", "0.6323332", "0.62907547", "0.62714547", "0.61953974", "0.6180927", "0.6131787", "0.6047954", "0.60330844", "0.603307", "0.5988649", "0.59795606", "0.5941198", "0.59382194", "0.5921308", "0.58819425", "0.58742064", "0.5858...
0.0
-1
Assuming the model is y = a x + b
def linearRegression(self, xtr, ytr, xte, yte): LEARNING_RATE = 0.5 with self.graph.as_default() as graph: with tf.name_scope('training'): with tf.name_scope('loss'): train_loss = tf.reduce_mean( tf.square(self.y_train - self.y_plac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model(theta, x):\n\tw, b = theta\n\treturn w * x + b", "def linear_model(inp, w1, b1):\n y = inp @ w1 + b1\n centered_y = y - y.mean()\n return centered_y.sum()", "def train(self, X, y):", "def predict(self, X, a, b):\n pass", "def _model(x, p):\n y_hat = 0\n for...
[ "0.7249487", "0.71250397", "0.6496419", "0.6465882", "0.63790184", "0.63515145", "0.62340564", "0.62106526", "0.6194019", "0.617126", "0.616771", "0.6105718", "0.6064502", "0.6057555", "0.6056323", "0.6056323", "0.6056323", "0.60315615", "0.6020455", "0.60099643", "0.60048103...
0.0
-1
Need to simplfy this function
def create_squad(self, direction): if direction == 0: for n in range(5): ship = Plane(self.allSprites, self.enemy_bullets, direction) ship_width = ship.rect.width ship.x = ship_width ship.rect.x = ship.x ship.rect.y = sh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def regular(self):", "def apply(self) -> None:", "def apply(self) -> None:", "def exo2():", "def apply(self):", "def substantiate():", "def support(self):", "def degibber(self):", "def common(self):", "def preprocess(self):", "def transform(self):", "def result(self):", "def result(self):",...
[ "0.6376737", "0.6244976", "0.6244976", "0.6197035", "0.61636925", "0.6142249", "0.6093243", "0.59947705", "0.5912478", "0.58679175", "0.5863944", "0.5855838", "0.5855838", "0.58418566", "0.58280736", "0.58211434", "0.57913846", "0.5772694", "0.5734324", "0.5734324", "0.573432...
0.0
-1
Performs a search over container using __eq__ comparison and not hash
def tunnel_in_container(container, tunnel): for element in container: if tunnel == element: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __contains__(self, item):", "def search(self, *args, **kwargs):\n # comparison = f\"__{kwargs.get('comparison')}__\" if kwargs.get('comparison') else '__eq__'\n comparison = '__{comparison}__'.format(comparison=kwargs.get('comparison')) if kwargs.get('comparison') else '__eq__'\n try:\n ...
[ "0.6521921", "0.6412573", "0.6221914", "0.61815023", "0.61169034", "0.60485363", "0.5968565", "0.5967089", "0.5930296", "0.5905189", "0.58816653", "0.58630764", "0.58409524", "0.5830806", "0.5827367", "0.58256793", "0.5808385", "0.5803326", "0.580157", "0.5775276", "0.5761809...
0.0
-1
Smart heuristics to join node into caves. In this implementation, if one endpoint of a tunnel lies within the radius of another, join them together.
def simplify(self): added_clumps = [] staying_tunnels = [] removed_clumps = set() for tunnel in self.tunnels: tunnel_end_distance = self.get_distance(tunnel.start, tunnel.end) if tunnel_end_distance - tunnel.start.distance_from_wall < 0 or \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compute_connection(current_waypoint, next_waypoint, threshold=35):\n n = next_waypoint.transform.rotation.yaw\n n = n % 360.0\n\n c = current_waypoint.transform.rotation.yaw\n c = c % 360.0\n\n diff_angle = (n - c) % 180.0\n if diff_angle < threshold or diff_angle > (180 - threshold):\n ...
[ "0.56855464", "0.5546275", "0.54715693", "0.5383454", "0.5380818", "0.5340776", "0.53051436", "0.5162047", "0.51586264", "0.5147107", "0.51121587", "0.5093378", "0.5077364", "0.50570464", "0.5055928", "0.5012461", "0.500983", "0.49842656", "0.497719", "0.49690145", "0.4961483...
0.54145515
3
Converts clumps and tunnels to graph nodes and edges to be presented on the final map.
def extract_diagram(self): nodes = [] edges = [] for clump in self.clumps: new_nodes, new_edges = clump.get_diagram_representation() nodes.extend(new_nodes) edges.extend(new_edges) #nodes.append(backend.JunctionNode(clump)) # TODO:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_connections(self, connections):\n model = self.model\n for conn in getattr(model, u'connection', []):\n comp1 = model.get_component_by_name(conn.map_components.component_1)\n comp2 = model.get_component_by_name(conn.map_components.component_2)\n for mappin...
[ "0.6328475", "0.6253309", "0.6002456", "0.59599626", "0.583428", "0.5823277", "0.57307833", "0.5722579", "0.57005084", "0.56930006", "0.56913257", "0.56404", "0.5634069", "0.5631323", "0.55093277", "0.54946303", "0.5490735", "0.54480684", "0.5414293", "0.5393222", "0.53843117...
0.60783696
2
Finds connected points that are not part of tunnels and assigns a single node for all of them.
def mark_clump(self, point): # TODO: flood fill it properly if point.node: return neighbors = len(self.get_neighbors(point)) if neighbors == 1: node = DeadEnd([point]) elif neighbors == 2: raise Exception("WTF, 2 neighbors") else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_connection_between_nodes(self):\n\n for i, node in enumerate(self.list_empty_nodes):\n line = node.labyrinth_position[0]\n column = node.labyrinth_position[1]\n\n for j in range(i+1, len(self.list_empty_nodes)):\n line_j = self.list_empty_nodes[j].laby...
[ "0.65846676", "0.6225609", "0.6146511", "0.605316", "0.6015919", "0.5997633", "0.5969244", "0.59334683", "0.59093934", "0.5858953", "0.5842103", "0.58010113", "0.57768786", "0.5756226", "0.5723973", "0.5719049", "0.57177925", "0.57150555", "0.56853795", "0.5685296", "0.566074...
0.0
-1
Depthfirst graph traversal, extracts clumps (nodes) and tunnels (edges). Graph must have at least one point that is a junction.
def find_structure(self): cave_graphs = [] starting_point = None # firse initalize points for point in self.points.values(): neighbors = self.get_neighbors(point) if len(neighbors) != 2 and point.node is None: starting_point = point ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def construct_junction_graph(self) -> Graph[Cell]:\n if self.maze is None:\n raise ValueError('No current maze to construct a junction graph from!')\n\n junction_graph = Graph()\n visited = defaultdict(bool)\n\n def cell_visitor(cell: Cell) -> None:\n visited[cell]...
[ "0.62955743", "0.6218852", "0.60339916", "0.5890118", "0.5873582", "0.5675615", "0.5669391", "0.5656545", "0.56498134", "0.5575273", "0.55740166", "0.55538756", "0.5547625", "0.5546689", "0.55386174", "0.5508685", "0.5503386", "0.5432993", "0.5432737", "0.54099274", "0.539502...
0.63038146
0
A reference source of entropy.
def entropy(n_bits): return n_bits and random.getrandbits(n_bits)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entropy(self):\n raise NotImplementedError", "def entropy(self):\n return self._entropy_func", "def _entropy(self):\n return self.rv.entropy(*self._pymc_dists_to_value(self.args), **self.kwds)", "def entropy(self):\n return self._normal.entropy()", "def S(self):\n ...
[ "0.7335538", "0.7321996", "0.6929512", "0.6915944", "0.6511103", "0.6434832", "0.6370721", "0.6351", "0.6345588", "0.6240882", "0.6234527", "0.6183247", "0.6183247", "0.6111796", "0.61077815", "0.6087875", "0.60816205", "0.6070592", "0.6016523", "0.5976137", "0.5970436", "0...
0.57390875
37
From 0 to n 1.
def roll(entropy, n): # Minimum bit depth to cover the full range. # Note that more bits would be more fair. bit_depth = math.ceil(math.log2(n)) x = entropy(bit_depth) # Scale from total range to desired range. # Numbers with higher odds will be evenly distributed. return math.floor(x * n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def I (self, n):", "def fakultet (n = 1):\n sum = 1\n for i in range(n, 1, -1):\n sum *= i\n return sum", "def ones(n, offset=0):\n\n if (n == float('inf')):\n return -1\n\n return ((1 << n) - 1) << offset", "def Arn(r, n):\n ret = 1\n for t in range(n, n-r+1-1, -1):\n ...
[ "0.69229555", "0.66966933", "0.6686047", "0.6685972", "0.66640633", "0.6661085", "0.66186", "0.65888745", "0.6527394", "0.6467458", "0.64236766", "0.6413104", "0.64037323", "0.6394609", "0.63714546", "0.637133", "0.6354937", "0.6330853", "0.63275546", "0.6323024", "0.63122994...
0.0
-1
From first to last.
def in_range(entropy, first, last): return first + roll(entropy, last - first + 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exchange_first_last(seq):\n return seq[-1:]+seq[1:-1]+seq[0:1]", "def exchange_first_last(seq):\n first = seq[0:1]\n middle = seq[1:-1]\n last = seq[-1:]\n seq_copy = last + middle + first\n return seq_copy", "def first_and_last(values):\n first = values[0]\n last = values[-1]\n ...
[ "0.684175", "0.669462", "0.667846", "0.6484993", "0.6262593", "0.6100792", "0.60273415", "0.59952015", "0.5988307", "0.5964163", "0.5768536", "0.5752433", "0.5742823", "0.5672278", "0.5632229", "0.5624323", "0.5592517", "0.55782247", "0.55598646", "0.5542554", "0.551485", "...
0.0
-1
One of a set of options.
def one_of(entropy, options): # Coerce to list; could be an iterator or set. options = list(options) return options[roll(entropy, len(options))]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def options(self, a: str) -> typing.Any:", "def option(self, spec):\n return spec.options[self.rng.integers(len(spec.options))]", "def visit_option(self, state, opt_name, opt_value):\n pass", "def options_by_name(self):\n pass", "def _additional_option(self):\n pass", "def _is...
[ "0.7128821", "0.6769607", "0.6563619", "0.65318555", "0.64025533", "0.6402144", "0.63814133", "0.6359936", "0.6351186", "0.632631", "0.6319813", "0.6228393", "0.62080795", "0.62018996", "0.6144289", "0.6132868", "0.61311126", "0.6106209", "0.6093769", "0.6092339", "0.6045443"...
0.0
-1
From 0 to positive infinity.
def scale(entropy): # FIXME: Improve generation performance # for testing viability. # `scale_` has the desired properties of # periodically producing very large documents. x = 0 while entropy(1): x += 1 return x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inf(self):\n return self._inf", "def isinf(x):\n return False", "def fill_with_neg_inf(t):\r\n return t.float().fill_(float(\"-inf\")).type_as(t)", "def isInfinity(self):\n return _libsbml.ASTNode_isInfinity(self)", "def isInfinite(value):\n if value == float('inf') or value ...
[ "0.74205124", "0.7011005", "0.68522996", "0.68498147", "0.658942", "0.65669304", "0.65312845", "0.65211093", "0.6454594", "0.64146763", "0.6392522", "0.6364933", "0.6337372", "0.6335443", "0.6289076", "0.62520576", "0.6175854", "0.61369663", "0.611988", "0.6090568", "0.607692...
0.0
-1
From 0 to positive infinity.
def scale_(entropy): # Double scale with each successive 1. bit_depth = 0 while entropy(1): bit_depth += 1 # Return a random number within the scale. return 2 ** bit_depth + entropy(bit_depth) - 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inf(self):\n return self._inf", "def isinf(x):\n return False", "def fill_with_neg_inf(t):\r\n return t.float().fill_(float(\"-inf\")).type_as(t)", "def isInfinity(self):\n return _libsbml.ASTNode_isInfinity(self)", "def isInfinite(value):\n if value == float('inf') or value ...
[ "0.7419534", "0.70103866", "0.6852276", "0.68489885", "0.65879995", "0.6568186", "0.65308875", "0.65205", "0.64529145", "0.64138526", "0.63921684", "0.63641196", "0.63368535", "0.6335251", "0.6289104", "0.6252908", "0.61746687", "0.6135361", "0.61183196", "0.60907626", "0.607...
0.0
-1
not authorized access not allowed
def test_not_authenticated_uri(self): request = self.factory.get(self.uri) response = self.view(request) response.render() self.assertEqual(response.status_code, 401, 'Expected Response Code 401, received {0} instead.' .format(response.status_code))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_authenticated_denied(self):", "def authorized(self):\n pass", "def forbidden():\n return HttpError(403)", "def test_user_not_authorized(self):\n response = self.client.post(self.url)\n self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)", "def __require_privila...
[ "0.75042206", "0.7406361", "0.7399189", "0.739384", "0.73844796", "0.72006446", "0.7158826", "0.71275866", "0.7116086", "0.7061837", "0.7053329", "0.70110494", "0.7009463", "0.6971239", "0.696135", "0.69366765", "0.69185925", "0.68959856", "0.68959856", "0.68959856", "0.68959...
0.0
-1
ensure that uri is authorized access only
def test_authenticated_uri(self): request = self.factory.get(self.uri) force_authenticate(request, self.user) response = self.view(request) response.render() self.assertEqual(response.status_code, 200, 'Expected Response Code 200, received {0} instead.' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unauthenticated_resource_allowed(self):\n raise NotImplementedError # FIXME", "def test_not_authenticated_uri(self):\n request = self.factory.get(self.uri)\n response = self.view(request)\n response.render()\n self.assertEqual(response.status_code, 401,\n '...
[ "0.65171504", "0.6402486", "0.63771325", "0.6375413", "0.63071775", "0.63009334", "0.6289721", "0.62644935", "0.6228444", "0.62223566", "0.61878365", "0.61414355", "0.6134728", "0.6133376", "0.6118283", "0.61019117", "0.6080933", "0.6025073", "0.59571517", "0.5946507", "0.593...
0.6181522
11
testing upload a triple store file
def test_post(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_upload_file(self):\n pass", "def test_upload(self):\n with self.client:\n file = dict(\n file=(BytesIO(b'my file contents'), \"foto.jpg\"),\n )\n response = self.client.post('/upload',\n content_type='mu...
[ "0.75622064", "0.74450475", "0.7414942", "0.72579104", "0.714064", "0.71367294", "0.7100109", "0.709622", "0.6873781", "0.6828715", "0.6760692", "0.6704941", "0.6680957", "0.66789514", "0.66406935", "0.65745944", "0.6552711", "0.65437436", "0.6475079", "0.64600915", "0.645860...
0.0
-1
This test changes the netbios name of the server and then verifies that this results in the server's domain SID changing. The new SID is stored in a global variable so that we can perform additional tests to verify that SIDs are rewritten properly in group_mapping.tdb. old_netbiosname is stored so that we can reset con...
def test_056_netbios_name_change_check_sid(request): depends(request, ["service_cifs_running"], scope="session") global new_sid global old_netbiosname results = GET("/smb/") assert results.status_code == 200, results.text old_netbiosname = results.json()["netbiosname"] old_sid = results.jso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_058_change_netbios_name_and_check_groupmap(request):\n depends(request, [\"SID_CHANGED\", \"ssh_password\"], scope=\"session\")\n payload = {\n \"netbiosname\": old_netbiosname,\n }\n results = PUT(\"/smb/\", payload)\n assert results.status_code == 200, results.text\n sleep(5)\n\...
[ "0.7362551", "0.61641616", "0.6045183", "0.60308814", "0.5808337", "0.58069056", "0.5755924", "0.5711386", "0.56862813", "0.5601481", "0.55547637", "0.55288833", "0.5508139", "0.5473006", "0.5441461", "0.5417473", "0.54068434", "0.5388924", "0.5378174", "0.5349858", "0.532144...
0.7686053
0
Create testgroup and verify that groupmap entry generated with new SID.
def test_057_create_new_smb_group_for_sid_test(request): depends(request, ["SID_CHANGED", "ssh_password"], scope="session") global group_id payload = { "name": "testsidgroup", "smb": True, } results = POST("/group/", payload) assert results.status_code == 200, results.text gr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_group(self):\n pass", "def test_create_group(self):\n pass", "def test_verify_that_you_can_create_a_new_group():", "def test_create_group(self):\n groupid = 'villains'\n\n # create the group\n resp = self.app.post('/groups', data=json.dumps({'name':groupid})...
[ "0.7478963", "0.7478963", "0.7324722", "0.7320051", "0.698248", "0.6931495", "0.68939006", "0.6839453", "0.68214154", "0.6734239", "0.6696365", "0.6614686", "0.65505034", "0.6506986", "0.6498141", "0.6479654", "0.64630705", "0.6456968", "0.6449117", "0.6447869", "0.6438386", ...
0.81538206
0
Verify that changes to netbios name result in groupmap sid changes.
def test_058_change_netbios_name_and_check_groupmap(request): depends(request, ["SID_CHANGED", "ssh_password"], scope="session") payload = { "netbiosname": old_netbiosname, } results = PUT("/smb/", payload) assert results.status_code == 200, results.text sleep(5) cmd = "midclt call ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_056_netbios_name_change_check_sid(request):\n depends(request, [\"service_cifs_running\"], scope=\"session\")\n global new_sid\n global old_netbiosname\n\n results = GET(\"/smb/\")\n assert results.status_code == 200, results.text\n old_netbiosname = results.json()[\"netbiosname\"]\n ...
[ "0.73724425", "0.63812697", "0.60749346", "0.5786616", "0.5737494", "0.5689937", "0.558545", "0.556925", "0.5448637", "0.5431592", "0.5371331", "0.5291523", "0.52891064", "0.5282398", "0.52451235", "0.523351", "0.52235484", "0.52166736", "0.5215772", "0.5207367", "0.52060276"...
0.8209844
0
Check if object exists in Swift.
def check_object(container, object): swift_conn = keystone.get_swiftclient() try: swift_conn.head_object(container, object) return True except ClientException: LOG.error( 'The object %s in container %s was not found', object, container ) return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def objExists(*args, **kwargs)->bool:\n pass", "def exists(self, obj):\n return False", "def _isobject(self, name, exist):\r\n if exist in [2, 5]:\r\n return False\r\n cmd = \"isobject(%s)\" % name\r\n if not self._engine:\r\n msg = \"Session is not open\"\r...
[ "0.7633462", "0.7457026", "0.68618387", "0.6738865", "0.66530925", "0.6610566", "0.6606193", "0.6532107", "0.6531226", "0.65227437", "0.6456245", "0.6397228", "0.6397228", "0.63877124", "0.6349197", "0.6294372", "0.62620234", "0.62258947", "0.6223668", "0.62103516", "0.617190...
0.6523617
9
This method will copy from other only the leaves & descendant that are requested in self
def copyRequestedFrom (self, other): if self.isLocalTimeStringRequested(): self.localTimeString=other.localTimeString self._myHasLocalTimeString=other._myHasLocalTimeString self._myLocalTimeStringRequested=other._myLocalTimeStringRequested if self.isUtcTimeS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_from(self, other):\n assert not self.is_final\n if self.parent is not None:\n assert other.parent is not None\n self.parent.copy_from(other.parent)\n self.isolated_names = copy.copy(other.isolated_names)\n self.modified = copy.copy(other.modified)\n self.read = copy.copy(other.rea...
[ "0.7139034", "0.68035215", "0.65542984", "0.6402804", "0.6338159", "0.6317084", "0.63066095", "0.62067425", "0.6183237", "0.6153278", "0.60946536", "0.6041807", "0.603661", "0.5989809", "0.5975044", "0.5970866", "0.5968901", "0.5928488", "0.59153694", "0.58945", "0.5891103", ...
0.0
-1
This method will copy to self only the leaves & descendant that are set in other
def copySetFrom (self, other): if other.hasLocalTimeString(): self.localTimeString=other.localTimeString self._myHasLocalTimeString=other._myHasLocalTimeString self._myLocalTimeStringRequested=other._myLocalTimeStringRequested if other.hasUtcTimeString(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_from(self, other):\n assert not self.is_final\n if self.parent is not None:\n assert other.parent is not None\n self.parent.copy_from(other.parent)\n self.isolated_names = copy.copy(other.isolated_names)\n self.modified = copy.copy(other.modified)\n self.read = copy.copy(other.rea...
[ "0.65994555", "0.6590117", "0.63456917", "0.63343483", "0.6332817", "0.6266025", "0.62527746", "0.6083085", "0.60715175", "0.6068964", "0.60687524", "0.60618335", "0.6056082", "0.59922147", "0.59904253", "0.59889364", "0.5935985", "0.5921964", "0.5910749", "0.5903574", "0.589...
0.0
-1
This method will copy to self only the leaves & descendant that and their "has" values from other. It will leave "requested" fields unchanged
def copyDataFrom (self, other): self.localTimeString=other.localTimeString self._myHasLocalTimeString=other._myHasLocalTimeString self.utcTimeString=other.utcTimeString self._myHasUtcTimeString=other._myHasUtcTimeString self.daylightSavingTime=other.daylightSav...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_from(self, other):\n assert not self.is_final\n if self.parent is not None:\n assert other.parent is not None\n self.parent.copy_from(other.parent)\n self.isolated_names = copy.copy(other.isolated_names)\n self.modified = copy.copy(other.modified)\n self.read = copy.copy(other.rea...
[ "0.65413207", "0.5917658", "0.58983076", "0.58842134", "0.5883233", "0.5857297", "0.5756933", "0.5754315", "0.567328", "0.56559527", "0.5655356", "0.56519586", "0.56430566", "0.5628962", "0.5605453", "0.55990183", "0.557354", "0.556295", "0.5561114", "0.55332273", "0.55176497...
0.0
-1
Only numeric members with has flag set to on will be subtracted
def subtractAllNumericHas (self, other): if self.hasEpoch(): if other.hasEpoch(): self.epoch -= other.epoch if self.hasUtcOffsetMinutes(): if other.hasUtcOffsetMinutes(): self.utcOffsetMinutes -= other.utcOffsetMinutes ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __neg__(self):\n return 0 - self", "def __neg__(self):\n return self.neg()", "def subtractAllNumericHas (self, other):\n \n if self.hasOutErrorPackets():\n if other.hasOutErrorPackets():\n self.outErrorPackets -= other.outErrorPackets\n \n ...
[ "0.62634593", "0.61539656", "0.60460675", "0.60210055", "0.5773645", "0.5751537", "0.5718697", "0.5712941", "0.571179", "0.56675845", "0.56455714", "0.56396145", "0.5638622", "0.5621065", "0.55998564", "0.5568793", "0.5568793", "0.5568793", "0.5551674", "0.5467386", "0.545240...
0.60316527
3
Only numeric members with has flag set to on will be subtracted
def addAllNumericHas (self, other): if self.hasEpoch(): if other.hasEpoch(): self.epoch += other.epoch if self.hasUtcOffsetMinutes(): if other.hasUtcOffsetMinutes(): self.utcOffsetMinutes += other.utcOffsetMinutes ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __neg__(self):\n return 0 - self", "def __neg__(self):\n return self.neg()", "def subtractAllNumericHas (self, other):\n \n if self.hasOutErrorPackets():\n if other.hasOutErrorPackets():\n self.outErrorPackets -= other.outErrorPackets\n \n ...
[ "0.6264014", "0.615425", "0.6046589", "0.6032788", "0.6021112", "0.5774686", "0.575271", "0.5718622", "0.57138014", "0.57122934", "0.5668872", "0.56468856", "0.5641599", "0.56415534", "0.5621353", "0.5600475", "0.55667835", "0.55667835", "0.55667835", "0.5551966", "0.54674935...
0.0
-1
Print a line to the output file, discarding duplicate blank lines.
def write(s): global prev_line if not (prev_line == "\n" and s == "\n"): fo.write(s) prev_line = s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_stripped_line(fout, line):\n fout.write(line)\n fout.write('\\n')", "def dealCommonline(line):\n\n print \"\\t\\t%s\" % (line.strip('\\n'))", "def write_line(self, line):\n\n if line[0] != \"(\": # indent all non-label lines.\n line = \" \" * 4 + line\n self.fd.writ...
[ "0.6561397", "0.6144277", "0.6068922", "0.6002885", "0.59682703", "0.5850297", "0.5837288", "0.5804523", "0.5775405", "0.5681184", "0.56594974", "0.56477165", "0.56048447", "0.5593835", "0.5592475", "0.5574469", "0.55244064", "0.5516073", "0.55054593", "0.54997486", "0.547703...
0.5347325
47
Parse a C constant value in decimal or hex. Return None if the input isn't a constant.
def convert_value(value): # print "Attempting to match value: %s" % value m = re.match('^(0(x|X)[0-9a-fA-F]+|[0-9]+)$', value) if m is None: return None value = m.group(1) if value.startswith("0x") or value.startswith("0X"): return int(value[2:], 16) else: return int(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_constant(name, libgmt):\n c_get_enum = libgmt.GMT_Get_Enum\n c_get_enum.argtypes = [ctypes.c_char_p]\n c_get_enum.restype = ctypes.c_int\n\n value = c_get_enum(name.encode())\n\n if value is None or value == -99999:\n raise GMTCLibError(\n \"Constant '{}' doesn't exits in l...
[ "0.5632588", "0.5586047", "0.5533818", "0.55302715", "0.5484222", "0.5482968", "0.54275924", "0.5395987", "0.53449136", "0.5325055", "0.52999747", "0.5280379", "0.5259344", "0.52487993", "0.52158546", "0.519826", "0.5152143", "0.51404864", "0.51237184", "0.51235414", "0.51213...
0.56358886
0
Convert a C identifier to be a valid occam identifer.
def occamify_name(name): name = name.replace("_", ".") if name[0] == ".": name = "X" + name if name[-1] == ".": name += "X" return name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_identifier(val: Any):\n val = str(val).strip()\n # Replaces spaces, dashes, and slashes to underscores\n val = re.sub(r\"[\\s\\-/\\\\]\", \"_\", val)\n # Remove remaining invalid characters\n val = re.sub(r\"[^0-9a-zA-Z_]\", \"\", val)\n # Identifier can't start with digits\n val = re.s...
[ "0.6382469", "0.63354176", "0.5939232", "0.5869739", "0.5867305", "0.5863034", "0.5823705", "0.5754403", "0.5711596", "0.56707406", "0.566262", "0.5643252", "0.56212616", "0.55866235", "0.5584955", "0.5584267", "0.55398595", "0.55394506", "0.55231905", "0.55100995", "0.548896...
0.0
-1
This method is called when the handler should emit the record. By default, SocketHandler will silently drop a message if it cannot send it. Because this is not desired in our case, we will use a queue that will act as a buffer if the message is not sent
def emit(self, record): self.buffer.append(record) while len(self.buffer) != 0: nextRecord = self.buffer.popleft() super().emit(nextRecord) if self.sock is None: # If we failed to send the record self.buffer.appendleft(nextRecord) br...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def emit(self, record):\n try:\n # Format: [ [queueMsgID, PID], record ]\n self.queue.put([[config.DUMMYMP_LOG_ID, os.getpid(), self.int_pid], record])\n except:\n # Something went wrong...\n self.handleError(record)", "def handle_write(self):\n #s...
[ "0.6777097", "0.67079544", "0.6660982", "0.66555536", "0.66555536", "0.66555536", "0.6519431", "0.6481583", "0.6451602", "0.64207643", "0.64196646", "0.64065015", "0.6357897", "0.6326828", "0.62853485", "0.6271823", "0.62639964", "0.6251536", "0.6215217", "0.61984706", "0.619...
0.7365688
0
The following code is copied from the SocketHandler implementation. One line is changed to prevent all messages from being converted to strings.
def makePickle(self, record): ei = record.exc_info if ei: # just to get traceback text into record.exc_text ... dummy = self.format(record) # See issue #14436: If msg or args are objects, they may not be # available on the receiving end. So we convert the msg % ar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handleMessage(msg):", "def handle_message(self, message):", "def to_string(msg):\n if type(msg) is bytes:\n msg = str(msg)\n msg = msg[2:]\n return msg[:-1]\n else:\n return msg", "def handle(self, message):", "def __processMsg(self, sock, msgData):\n\n pass", ...
[ "0.6507231", "0.6033136", "0.5843889", "0.5815367", "0.5716884", "0.5715668", "0.56667054", "0.5658734", "0.5644602", "0.56359076", "0.56347317", "0.5606671", "0.55791515", "0.5511831", "0.5506883", "0.5450436", "0.54457396", "0.54431564", "0.5422972", "0.53962946", "0.538632...
0.0
-1
| Requests the content of a directory on the machine running Nanome
def _request_directory(self, path, callback=None, pattern="*"): options = DirectoryRequestOptions() options._directory_name = path options._pattern = pattern id = self._network._send(_Messages.directory_request, options, callback != None) self._save_callback(id, callback)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_dir():\n request()\n sleep_ms( 100 ) # give sometime for the buffer to get data\n try:\n read_response()\n except Exception as err:\n print( 'Error decoding response' )\n print( '[ERROR]', err )\n sleep_ms( 1000 )", "def test_dir_query():\n response = echo_client(\...
[ "0.7279646", "0.6351751", "0.6332403", "0.60547894", "0.58797693", "0.586253", "0.58039623", "0.5776779", "0.5737375", "0.57306904", "0.5706204", "0.57026035", "0.56860507", "0.56487966", "0.5639918", "0.55764306", "0.554403", "0.55420625", "0.5540011", "0.548273", "0.5476476...
0.5246486
63
| Reads files on the machine running Nanome, and returns them
def _request_files(self, file_list, callback=None): id = self._network._send(_Messages.file_request, file_list, callback != None) self._save_callback(id, callback)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_all_files():\n paths = get_all_recording_paths()\n\n return read_by_paths(paths)", "def get_nasadem_file_list():\n\n global nasadem_file_list\n if nasadem_file_list is None:\n nasadem_file = download_url(nasadem_file_index_url)\n with open(nasadem_file) as f:\n nasad...
[ "0.63308704", "0.63162225", "0.6124706", "0.61032605", "0.60520303", "0.6001759", "0.5981098", "0.5973027", "0.59662366", "0.59262437", "0.5905288", "0.5895844", "0.5888806", "0.58481973", "0.5807229", "0.58071476", "0.5765757", "0.57574964", "0.5742501", "0.57266575", "0.570...
0.0
-1
Helper function for argument parsing.
def int_or_str(text): try: return int(text) except ValueError: return text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_arguments(args):", "def Args(parser):", "def _pre_argument_parsing(self):\n pass", "def _parse_args(self, prepared_args):\n pass", "def parseArguments(self):\n iterator = iter(sys.argv[1:]) # Skip file name\n for argument in iterator:\n if len(argument) < 2...
[ "0.79303455", "0.7602255", "0.73190254", "0.7167153", "0.68745065", "0.687013", "0.6869624", "0.68274933", "0.68205035", "0.67932284", "0.6792503", "0.67673117", "0.6763976", "0.66961086", "0.6694033", "0.66836804", "0.6668083", "0.6649227", "0.6605114", "0.658573", "0.657141...
0.0
-1
The spectrum sits in a buffer with width spec_buffer_pad + spec_buffer_w . The first spec_buffer_pad of it is a copy of the last spec_buffer_pad of it.
def stream_inference_of_microphone_audio(args): with sd.InputStream(device=args.device, channels=1, callback=update_spectrogram, blocksize=samples_buffer_block_size, samplerate=samplerate): with tf.Session() as sess: tf.saved_model.loader.load(sess...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def observed_spectrum(spec, wave, resolution, mag=None, mag_band='g', mag_system='AB', \n redshift=None, emline_db=None):\n if redshift is not None:\n spec.redshift(redshift)\n if mag is not None:\n broadband = efficiency.FilterResponse(band=mag_band)\n # Check that ...
[ "0.58118004", "0.5794949", "0.5607931", "0.55611324", "0.5536402", "0.54763293", "0.5458407", "0.54346955", "0.5432787", "0.5346925", "0.5333904", "0.5282993", "0.5275823", "0.52669376", "0.526041", "0.522841", "0.5217324", "0.51879936", "0.51861805", "0.51780736", "0.5172873...
0.0
-1
create database and tables in mysql
def init_database(self): try: DatabaseCreation.create_database() except BaseExceptionHandler as base_exception_handler: self.logger.error(message=base_exception_handler.error_message)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_db():\n db.create_all()\n print('Database structure created successfully')", "def make_db():\n\n db.create_all()", "def create_tables():\n db.create_all()", "def create_tables():\n db.create_all()", "def create_database():\n with connection:\n connection.execute(...
[ "0.80518013", "0.8014398", "0.79978704", "0.79978704", "0.79829156", "0.7973766", "0.7953593", "0.7953593", "0.7953593", "0.7953593", "0.7953593", "0.7953593", "0.7953593", "0.7953593", "0.7953593", "0.7953593", "0.7953593", "0.79528016", "0.7904342", "0.7874087", "0.78698146...
0.0
-1
Parse Text2Text model training arguments
def parse_arguments(args): parser = argparse.ArgumentParser( description="Text2Text: Read input text training files, output item files and train a model" ) parser.add_argument( "-i", "--input-text-path", type=str, required=True, metavar="INPUT_TEXT_PATH", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_train_args():\n parser = argparse.ArgumentParser('Train a Text Summarization Model')\n\n # parser.add_argument('--hiddenDim', nargs='?', type=int, default=50, help='The size of the hidden dimension to be used for all layers')\n parser.add_argument('--hiddenDim', type=int, default=50, help='The siz...
[ "0.686333", "0.67426586", "0.6403633", "0.63728684", "0.63588935", "0.63261265", "0.63138217", "0.6302748", "0.62799126", "0.6250235", "0.6242753", "0.62252027", "0.6123396", "0.6101539", "0.607476", "0.6056414", "0.6046505", "0.60454464", "0.60431504", "0.60165226", "0.59678...
0.6688534
2
Note that this method supports the `seed` argument (for consistency with other generators), but its value is ignored because resetting a Constant generator has no effect.
def reset(self, seed=None): super().reset(seed) return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def temp_seed(cntxt_seed):\n state = np.random.get_state()\n np.random.seed(cntxt_seed)\n try:\n yield\n finally:\n np.random.set_state(state)", "def seed(self, seed=None):\r\n if seed is None:\r\n seed = self.default_seed\r\n #backport\r\n #seed = self.d...
[ "0.66678673", "0.66486984", "0.66190064", "0.66113573", "0.6481708", "0.6450779", "0.6450779", "0.6387273", "0.638019", "0.6367012", "0.63657165", "0.6360408", "0.6359411", "0.6357816", "0.6341527", "0.6340486", "0.63117254", "0.624635", "0.624635", "0.62377846", "0.62114537"...
0.6098022
28
Test case for rest_v20_dd_systems_systemid_stats_capacity_get
def test_rest_v20_dd_systems_systemid_stats_capacity_get(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_capacity(self, meta, raven_vars, dispatch, t, raw=False):\n return self.get_interaction().get_capacity(meta, raven_vars, dispatch, t, raw=raw)", "def get_capacity():\n fs.get_capacity()", "def test_get_cluster_capacity_monthly_resolution(self):\n url = \"?filter[time_scope_units]=month&fil...
[ "0.6880177", "0.6838495", "0.67628455", "0.6728308", "0.66688097", "0.6290439", "0.62468123", "0.61392134", "0.60665524", "0.6012225", "0.59929657", "0.5983629", "0.5947236", "0.5928955", "0.5917592", "0.59040964", "0.5896049", "0.5859963", "0.58585066", "0.5814054", "0.57612...
0.96901834
0
make node without archiving, create temp table, take full backup, check that temp table not present in backup catalogue
def test_exclude_temp_tables(self): fname = self.id().split('.')[3] backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup') node = self.make_simple_node(base_dir="{0}/{1}/node".format(module_name, fname), set_replication=True, initdb_params=['--data-checksu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_backup_compact(self):\n gen = BlobGenerator(\"ent-backup\", \"ent-backup-\", self.value_size, end=self.num_items)\n self._load_all_buckets(self.master, gen, \"create\", 0)\n self.backup_create()\n self.backup_cluster_validate()\n self.backup_compact_validate()", "def t...
[ "0.59866905", "0.58030164", "0.566614", "0.55969876", "0.5524487", "0.55036587", "0.5501728", "0.54733956", "0.5441421", "0.53914344", "0.53887075", "0.5378152", "0.53320277", "0.5308021", "0.5263021", "0.5219191", "0.5218431", "0.52177876", "0.5212545", "0.5208883", "0.52000...
0.6901967
0
make node without archiving, create temp table, take full backup, check that temp table not present in backup catalogue
def test_exclude_unlogged_tables(self): fname = self.id().split('.')[3] backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup') node = self.make_simple_node(base_dir="{0}/{1}/node".format(module_name, fname), set_replication=True, initdb_params=['--data-che...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_exclude_temp_tables(self):\n fname = self.id().split('.')[3]\n backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')\n node = self.make_simple_node(base_dir=\"{0}/{1}/node\".format(module_name, fname),\n set_replication=True,\n initdb_params=['--...
[ "0.6903086", "0.5988097", "0.58038205", "0.559825", "0.5524568", "0.550428", "0.5502258", "0.54732674", "0.5442118", "0.53923094", "0.5389752", "0.5378277", "0.5331801", "0.53092754", "0.5263534", "0.52197963", "0.5218867", "0.5218319", "0.52124774", "0.52093047", "0.5201064"...
0.566736
3
Spec function for a token embedding module.
def bert_module_fn(is_training): input_ids = tf.compat.v1.placeholder(shape=[None, None], dtype=tf.int32, name="input_ids") input_mask = tf.compat.v1.placeholder(shape=[None, None], dtype=tf.int32, name="input_mask") token_type = tf.compat.v1.placeholder(shape=[None, None], dtype=tf.int32, name...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_tokens():\n pass", "def test_decode_token():\n pass", "def test_char_embedder(self, resource_loader):\n config = {\n \"model_type\": \"tagger\",\n \"example_type\": ENTITY_EXAMPLE_TYPE,\n \"label_type\": ENTITIES_LABEL_TYPE,\n \"model_settin...
[ "0.5766105", "0.57528055", "0.56794906", "0.55031544", "0.54930705", "0.5325876", "0.5264288", "0.52472454", "0.52392995", "0.51481664", "0.51122683", "0.50571203", "0.50538754", "0.50153184", "0.50013244", "0.49968055", "0.49864978", "0.4977168", "0.49732983", "0.4953704", "...
0.50553316
12
add token to database
def blacklist_token(token, user): user = User.query.filter_by(username=user).first() user.login_status = False token = Token.query.filter_by(token=token).first() token.blacklist = True db.session.commit() return {'Message': 'You have successfully logged out', "Statu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def saveToken(self, token):\n query = \"INSERT OR REPLACE INTO token (token, id) VALUES (?, 1)\"\n self.db.execute(query, (token,))", "def save_token(self):\n db.session.add(self)\n db.session.commit()", "def add_token_to_database(encoded_token, identity_claim):\r\n decoded_token...
[ "0.8094326", "0.8070803", "0.74415904", "0.70355546", "0.7000242", "0.6967281", "0.69559306", "0.6940046", "0.6920779", "0.6872094", "0.6775218", "0.67006576", "0.66358006", "0.6613867", "0.6519567", "0.6519567", "0.63963455", "0.62032", "0.610051", "0.6077065", "0.6077065", ...
0.0
-1
Start at the start and the end, count inwards
def palindrome_itertive(a): # TODO make this less crappy start = 0 end = len(a) - 1 while start != end: # print(end) # print('start: ', start, ' a: ', a[start]) # print('end: ', end, ' a: ', a[end]) if not a[start] == a[end]: return False else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_up(start, stop):\n while start <=stop:\n print(start)\n start +=1", "def count(self):\n\n count = 0\n x = self.begin\n\n if self.begin == self.end == None:\n return 0\n\n elif self.begin == self.end:\n return 1\n\n else:\n ...
[ "0.7230575", "0.6875732", "0.66416466", "0.6609699", "0.6562417", "0.6481846", "0.62998545", "0.628956", "0.62748414", "0.62748414", "0.6273725", "0.6236967", "0.6213429", "0.61929876", "0.6182156", "0.61766803", "0.61409944", "0.61409944", "0.61409944", "0.61409944", "0.6138...
0.0
-1
OH GOD HERE WE GO AGAIN AND AGAIN AND AGAIN AND AGAIN
def palindrome_recursive(a): # Base case if len(a) <= 1: return True else: if a[0] == a[len(a)-1]: return palindrome_recursive(a[1:-1]) else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exercise_b2_53():\r\n pass", "def substantiate():", "def exercise_b2_27():\r\n pass", "def exercise_b2_69():\r\n pass", "def exercise_b2_106():\r\n pass", "def exercise_b2_113():\r\n pass", "def exercise_b2_107():\r\n pass", "def smarter():\r\n pass", "def exo2():", "def ...
[ "0.6076375", "0.5914736", "0.5894991", "0.5881642", "0.5800912", "0.57918847", "0.57858425", "0.57839304", "0.57633895", "0.5762886", "0.57562476", "0.5729908", "0.5719242", "0.5715583", "0.56889856", "0.5682348", "0.5657531", "0.56277037", "0.5583101", "0.55743325", "0.55732...
0.0
-1
Returns the longest contiguous palindrome in a given string. Iteratively go through the string and pass all substrings through function to check if they're palindromes. Store the longest. Then increase starting character and do it again. THIS IS BAD. If the whole string is a palindrome, I take _as long as possible_ to ...
def longest_palindrome(a): # This is some spaghetti if I've ever seen some. In the case where the whole work is # a palindrome, we can go ahead and skip. BUT ONLY IN THAT INSTANCE BECAUSE IT'S BAD if palindrome_golf(a): return a # Enter the bad max_so_far = '' for length in range(1,len(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def longest_palindrome(string):\n if is_palindrome(string):\n return string\n\n max_len = len(string) - 1\n\n while max_len > 0:\n i = 0\n while (i + max_len) <= len(string):\n sub = string[i:(i + max_len)]\n if is_palindrome(sub):\n return sub\n ...
[ "0.83150655", "0.79243183", "0.7793008", "0.75675213", "0.74943185", "0.73650616", "0.7276467", "0.72561765", "0.72025687", "0.69321364", "0.6855386", "0.68493617", "0.6692047", "0.6672678", "0.66698956", "0.6611336", "0.65887463", "0.65847784", "0.65815246", "0.65474427", "0...
0.7861719
2
Gather all the images collecting available urls from input file
def collect_images_from_urls(url_filepath, target_folder, image_class_name): def get_img_from_url(index, url): """Closure function invoked by each running downloading Thread""" try: with urllib.request.urlopen(url) as response: if response.headers.get_content_maintype() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_image_urls(self):\n if not os.path.isfile(self._image_urls_file_name):\n raise IOError, \"'%s' is not found\" % self._image_urls_file_name\n if os.path.getsize(self._image_urls_file_name) == 0:\n raise IOError, \"'%s' is empty\" % self._image_urls_file_name\n fo...
[ "0.7226425", "0.70590836", "0.69470996", "0.69348496", "0.6923049", "0.6900815", "0.68564993", "0.6853746", "0.6749816", "0.6686294", "0.6652796", "0.6562838", "0.6533928", "0.6515956", "0.6465455", "0.64469564", "0.6442082", "0.6438901", "0.6426852", "0.6349089", "0.634611",...
0.67413855
9
Closure function invoked by each running downloading Thread
def get_img_from_url(index, url): try: with urllib.request.urlopen(url) as response: if response.headers.get_content_maintype() == 'image': image_filename = image_filename_prefix.format(name=image_class_name, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n urls_to_download = self._get_links()\n results = ThreadPool(8).imap_unordered(self._download_url, urls_to_download)\n for path in results:\n print(path)", "def main():\n for i, url in enumerate(opts.thread, start=1):\n opts.archived_md5 = reload_archive(...
[ "0.7098351", "0.7055904", "0.68225944", "0.66464436", "0.65913904", "0.6507428", "0.64913315", "0.64657086", "0.64212185", "0.6403113", "0.63153106", "0.6311804", "0.6286661", "0.6259997", "0.62520695", "0.6230645", "0.6185179", "0.61826974", "0.6145493", "0.61442566", "0.613...
0.0
-1
If file was exist already, rename it and return a new name
def gen_file_name(filename, path=UPLOAD_FOLDER): i = 1 while os.path.exists(os.path.join(path, filename)): name, extension = os.path.splitext(filename) filename = '%s_%s%s' % (name, str(i), extension) i += 1 return filename
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fileRenameandReplace(filename,newfilename):\n try:\n os.rename(filename,newfilename)\n logging.info(\"Json file renamed in PD path\")\n except Exception as er:\n print (\"Not able to rename the json file \")\n return False", "def auto_rename(file_path, new_name):\n \n # Re...
[ "0.7435091", "0.7346437", "0.72911143", "0.724895", "0.72124314", "0.7185561", "0.713919", "0.69512355", "0.6867768", "0.6814744", "0.6778549", "0.6761721", "0.67595124", "0.67341584", "0.6674652", "0.6667342", "0.6659564", "0.6628739", "0.6602175", "0.65358675", "0.64996296"...
0.0
-1
Checks if this intersatellite link could transmit data (stateindependent).
def couldTransmit(self, data, receiver, txLocation, rxLocation, context): return super(InterSatelliteLink, self).couldTransmit(data, receiver) \ and txLocation.isOrbit() \ and rxLocation.isOrbit() \ and (abs(txLocation.sector - rxLocation.sector) <= 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def couldReceive(self, data, transmitter, txLocation, rxLocation, context):\n return super(InterSatelliteLink, self).couldReceive(data, transmitter) \\\n and txLocation.isOrbit() \\\n and rxLocation.isOrbit() \\\n and (abs(txLocation.sector - rxLocation.sector) <...
[ "0.6808816", "0.66868186", "0.64477277", "0.64418393", "0.62366825", "0.61757886", "0.6150189", "0.6097931", "0.60884607", "0.60488987", "0.6041025", "0.60021377", "0.5998871", "0.5975922", "0.5969649", "0.5958305", "0.59526134", "0.59449387", "0.5935071", "0.592336", "0.5916...
0.76803
0
Checks if this intersatellite link could receive data (stateindependent).
def couldReceive(self, data, transmitter, txLocation, rxLocation, context): return super(InterSatelliteLink, self).couldReceive(data, transmitter) \ and txLocation.isOrbit() \ and rxLocation.isOrbit() \ and (abs(txLocation.sector - rxLocation.sector) <= 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DataAvailable(self) -> bool:", "def data_available(self):\n return (self.status & 0x08) != 0", "def couldTransmit(self, data, receiver, txLocation, rxLocation, context):\n return super(InterSatelliteLink, self).couldTransmit(data, receiver) \\\n and txLocation.isOrbit() \\\n ...
[ "0.6806446", "0.666152", "0.6657909", "0.6534576", "0.65277207", "0.65100396", "0.6355405", "0.63156337", "0.63156337", "0.6288527", "0.6234863", "0.62215567", "0.61767733", "0.61651605", "0.61578643", "0.6138238", "0.60690147", "0.6063522", "0.60616744", "0.60542154", "0.603...
0.71264654
0
Checks if this is an intersatellite link.
def isISL(self): return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_cross_onap_link(self, logical_link):\n for relationship in logical_link[\"relationship-list\"][\"relationship\"]:\n if relationship[\"related-to\"] == \"ext-aai-network\":\n return True\n return False", "def isAlternateLink(self, rel, type = None): #$NON-NLS-1$\r\n ...
[ "0.6288431", "0.6154505", "0.6127506", "0.59536004", "0.5880275", "0.585257", "0.58179533", "0.5740787", "0.5721288", "0.571853", "0.56867456", "0.5679271", "0.567471", "0.5648151", "0.56475735", "0.559833", "0.5596475", "0.5586078", "0.5565179", "0.5555051", "0.55481195", ...
0.61121464
3
The basic idea here is to represent the file contents as a long string and iterate through it characterbycharacter (the 'ind' variable points to the current character). Whenever we get to a new tree, we call the function again (recursively) to read it in.
def readTree(text, ind, verbose=False): if verbose: print("Reading new subtree", text[ind:][:10]) # consume any spaces before the tree while text[ind].isspace(): ind += 1 if text[ind] == "(": if verbose: print("Found open paren") tree = [] ind += 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def traverse_tree(file, tree):\n\n\tfor node in tree.get_children():\n\t\tpass", "def fileparse(filename, node):\n\n fd = open(filename)\n line = fd.readline().strip('\\r\\n')\n\n while line != '':\n node.Add(line, node)\n line = fd.readline().strip('\\r\\n')", "def read_file_into_tree(f...
[ "0.57345337", "0.5500208", "0.54999906", "0.54994", "0.54745203", "0.53851414", "0.5351733", "0.5224818", "0.5221484", "0.5204018", "0.5189784", "0.51858944", "0.51852345", "0.5182749", "0.51462406", "0.51426816", "0.5098841", "0.50946444", "0.50844306", "0.50804096", "0.5069...
0.6211928
0
queries the given url and places in the params and headers into the request if present.
def query(url, params=None, headers_param=None): if params is None: params = {} logging.info("url={0}\tparams={1}".format(url, params)) headers = { 'Referer': url, "Content-Type": "text/xml; charset=UTF-8", # implement after checking if this doesn't kill the other scripts 'U...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query(url):", "def request(url, headers, params, method=\"GET\"):\n url = UrlManipulation.replace_query_params(url, **params)\n logger.debug(f\"request(): {method} {url}\")\n req = urllib.request.Request(url, headers=headers, method=method)\n try:\n with urllib.request....
[ "0.71451706", "0.64857244", "0.6369296", "0.6307592", "0.63027126", "0.61929387", "0.6177525", "0.6103905", "0.60760415", "0.6020824", "0.60137224", "0.597998", "0.59702086", "0.5964929", "0.59598595", "0.5957351", "0.5942728", "0.59328884", "0.59190345", "0.59136254", "0.586...
0.6601044
1
Return the configuration object based on the name.
def get_named_config(config_name: str = 'production'): if config_name in ['production', 'staging', 'default']: config = ProdConfig() elif config_name == 'testing': config = TestConfig() elif config_name == 'development': config = DevConfig() else: raise KeyError(f'Unknown...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config(self, name):\n return self.configs[name][0]", "def get_config_by_name(name):\r\n attrs = get_config_attributes(name)\r\n if attrs['online']:\r\n config = CONFIGS[name]()\r\n else:\r\n config = CONFIGS[name]\r\n \r\n # setting the Tune Run name attribute\r\n ...
[ "0.8064526", "0.77655816", "0.77019644", "0.74938506", "0.73495984", "0.72860664", "0.72388405", "0.72321206", "0.7196328", "0.7142278", "0.71287477", "0.7099421", "0.69440746", "0.69259566", "0.66691816", "0.65930384", "0.6522588", "0.6522556", "0.65188694", "0.65184826", "0...
0.748673
4
Getter for the _target trait.
def _get__target(self): if self._saved_target is None: self._saved_target = self._metadata.get_callable()() return self._saved_target
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_target(self):\n return self._target", "def _target(self):\n return self.__target", "def target(self):\n return self._target", "def target(self):\n return self._target", "def target(self):\n return self._target", "def target(self):\n return self._target", ...
[ "0.84827393", "0.82744116", "0.81823874", "0.81823874", "0.81823874", "0.81823874", "0.8173378", "0.8173378", "0.81621283", "0.8154736", "0.8072631", "0.8058809", "0.7985514", "0.7985514", "0.7984027", "0.7978245", "0.7950289", "0.77790356", "0.7757075", "0.764704", "0.760310...
0.6959168
47
Make the functions for adding filters and add them to the namespace automatically.
def _make_functions(namespace): for fil in registry.filters: func_name = camel2enthought(fil.id) class_name = fil.id if func_name.endswith('_filter'): func_name = func_name[:-7] class_name = class_name[:-6] class_name = class_name + 'Factory' # Don't ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_custom_filters(environment):\n\n # TODO deprecate ipaddr_index and netmask for the better ipnet ones\n filter_list = {\n 'dpkg_arch': filter_dpkg_arch,\n 'storage_size_num': filter_storage_size_num,\n 'ipnet_hostaddr': filter_ipnet_hostaddr,\n 'ipnet_hostmin': filter_ipne...
[ "0.6854986", "0.65905815", "0.6556149", "0.6516991", "0.6503513", "0.6503041", "0.649308", "0.64256465", "0.6318187", "0.6257711", "0.62176806", "0.6180177", "0.61334944", "0.6132359", "0.6121357", "0.61159486", "0.6114769", "0.609798", "0.6030215", "0.6022262", "0.6016461", ...
0.7930712
0
Runs the RPKI Validator
def __enter__(self): utils.kill_port(self.port) # Must remove these to ensure a clean run utils.clean_paths(self.rpki_db_paths) cmds = [f"cd {self.rpki_package_path}", f"chown -R root:root {self.rpki_package_path}"] utils.run_cmds(cmds) # Writes validator...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _start_validator(self):\n\n logging.info(\"Starting RPKI Validator\")\n utils.run_cmds((f\"cd {self.rpki_package_path} && \"\n f\"./{self.rpki_run_name}\"))", "def run():\n\n parser = argparse.ArgumentParser(description='Run the GOComp PSSE based validation tool on a p...
[ "0.73801863", "0.64284384", "0.6258135", "0.5849748", "0.58456504", "0.58381337", "0.5827633", "0.58155566", "0.5787312", "0.57792974", "0.57668513", "0.57668513", "0.5709736", "0.5706987", "0.56957924", "0.56811833", "0.56714517", "0.56623787", "0.56613994", "0.56548417", "0...
0.0
-1
Sends start cmd to RPKI Validator
def _start_validator(self): logging.info("Starting RPKI Validator") utils.run_cmds((f"cd {self.rpki_package_path} && " f"./{self.rpki_run_name}"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_execution(self):\n self.send_message(\"control.start\",None)", "async def start_validators(self):\n if self.is_client():\n return\n\n await sleep(random.random() * 3)\n\n cmd = \"/home/martijn/stellar-core/stellar-core run\"\n out_file = open(\"stellar.out\...
[ "0.6607596", "0.6571173", "0.6326597", "0.6210207", "0.6210207", "0.6210207", "0.6210207", "0.6158169", "0.613642", "0.6122255", "0.60959846", "0.6072968", "0.60660356", "0.60612607", "0.60051334", "0.5982089", "0.5948722", "0.592256", "0.589133", "0.58726084", "0.5835454", ...
0.74625295
0
Loads all trust anchors
def load_trust_anchors(self): utils.write_to_stdout(f"{datetime.now()}: Loading RPKI Validator\n", logging.root.level) time.sleep(60) while self._get_validation_status() is False: time.sleep(10) utils.write_to_stdout(".", logging.root.level)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def FullTrustAssemblies(self) -> _n_1_t_2:", "def UserApplicationTrusts(self) -> ApplicationTrustCollection:", "def FullTrustAssemblies(self) -> _n_2_t_0[StrongName]:", "def ApplicationTrustManager(self) -> IApplicationTrustManager:", "def load_verify_locations(self, cafile: Optional[Any] = ..., dummy: Opt...
[ "0.6452937", "0.6358674", "0.6343231", "0.60823315", "0.60078466", "0.5811615", "0.5778859", "0.5626693", "0.5504848", "0.54254216", "0.54251266", "0.54206556", "0.53962106", "0.53946304", "0.53521353", "0.53237087", "0.5316759", "0.53055185", "0.5273949", "0.5269059", "0.516...
0.72097015
0
Makes query to api of rpki validator
def make_query(self, api_endpoint: str, data=True) -> dict: result = utils.get_json(os.path.join(self.api_url, api_endpoint), RPKI_Validator_Wrapper.get_headers()) return result["data"] if data else result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request(query):", "def query(self):", "def query(self, query):", "def test_query_endpoint(self):\n\n test_query = {'user': {'email': 'joshua@emmaa.com',\n 'name': 'joshua',\n 'slack_id': '123456abcdef'},\n 'models': [...
[ "0.6170514", "0.59080476", "0.5833607", "0.5753477", "0.5671307", "0.5548914", "0.5526771", "0.5455396", "0.54270256", "0.5394377", "0.53173655", "0.53173655", "0.529548", "0.52700967", "0.5267953", "0.5258905", "0.52568907", "0.52481514", "0.52410793", "0.52322966", "0.52301...
0.55104727
7
Gets the data from ripe and formats it for csv insertions
def get_validity_data(self) -> dict: logging.info("Getting data from ripe") assert self.total_prefix_origin_pairs < 10000000, "page size too small" # Then we get the data from the ripe RPKI validator # Todo for later, change 10mil to be total count return self.make_query("bgp/?p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_CSV(self):\n self.drop_columns()\n self.rename_columns()\n self.spilt_columns()\n self.add_vehicle_id_column()\n self.add_source_column()\n self.add_timestamp_columns()\n self.get_colour_columns()\n self.clean_column_formats()\n\n # print(s...
[ "0.67308193", "0.60329825", "0.6019134", "0.5944693", "0.586528", "0.5816258", "0.57726353", "0.5743871", "0.5715828", "0.5697282", "0.55727077", "0.55635524", "0.5538254", "0.55140436", "0.5508639", "0.55046505", "0.5496556", "0.54953486", "0.54451126", "0.5443631", "0.54399...
0.0
-1
logs a message and waits
def _wait(self, time_to_sleep: int, msg: str): logging.debug(msg) if logging.root.level == logging.INFO: # Number of times per second to update tqdm divisor = 100 for _ in trange(time_to_sleep * divisor, desc=msg): time.sle...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def step_log(self, context: CallbackContext) -> None:\n try:\n msg = self.telegram_queue.get_nowait()\n await context.bot.send_message(chat_id=self.logging_chat_id, text=msg)\n except queue.Empty:\n pass", "def _execute(self):\n LOG.info(\"Waiting for a...
[ "0.703519", "0.7005076", "0.6724646", "0.65853786", "0.6513948", "0.6503922", "0.64900374", "0.63779444", "0.6374579", "0.6338678", "0.63351077", "0.62966096", "0.62556356", "0.62336075", "0.6178579", "0.61621654", "0.6156895", "0.61005133", "0.60830873", "0.6065437", "0.6064...
0.6188955
14
Returns row count of json object for waiting
def _get_validation_status(self) -> bool: try: for x in self.make_query("trust-anchors/statuses"): if x["completedValidation"] is False: # If anything has not been validated return false return False # All are validated. Return tru...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count(self):\n self._fetch_if_needed()\n return len(self._result_cache.get('rows', []))", "def count_rows(self):\n with self.conn:\n return len(self.select_all_rows())", "def row_count(data):\n return int(arcpy.GetCount_management(data).getOutput(0))", "def rowcount(sel...
[ "0.6802281", "0.66612387", "0.66511995", "0.65624493", "0.6489967", "0.6470001", "0.64694464", "0.6371715", "0.6351355", "0.6314331", "0.6314331", "0.62972707", "0.6276142", "0.6232271", "0.6232227", "0.6218811", "0.6213197", "0.6193299", "0.61728585", "0.6153976", "0.6128956...
0.0
-1
Returns the validity dict for the RPKI Validator to decode results I could have this as a class attribute but too messy I think.
def get_validity_dict() -> dict: return {"VALID": ROA_Validity.VALID.value, "UNKNOWN": ROA_Validity.UNKNOWN.value, "INVALID_LENGTH": ROA_Validity.INVALID_BY_LENGTH.value, "INVALID_ASN": ROA_Validity.INVALID_BY_ORIGIN.value}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_validate(self) -> dict:\n response = self.rc.execute(\"GET\",\n self._get_uri(GET_VALIDATE_URI),\n headers=self.header,\n verify=self.verify)\n return response.json()", "def getKrustyValidi...
[ "0.68762314", "0.65788156", "0.6511472", "0.63827586", "0.6343963", "0.62334585", "0.6198675", "0.6181131", "0.6175592", "0.61523205", "0.6139875", "0.61204463", "0.6046817", "0.6017709", "0.5970631", "0.59177464", "0.58760285", "0.5810927", "0.57986134", "0.5791891", "0.5789...
0.7998628
0
Gets the headers for all url queries to the validator
def get_headers() -> dict: return {"Connection": "keep-alive", "Cache-Control": "max-age=0", "Upgrade-Insecure-Requests": 1, "User-Agent": ("Mozilla/5.0 (X11; Linux x86_64)" " AppleWebKit/537.36 (KHTML, like Gecko) " ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_url_http_headers(self) -> Dict[str, str]:\n h = requests.head(self.url, allow_redirects=True)\n return h.headers", "def getheaders(self):\n return self.urllib3_response.getheaders()", "def getheaders(self):\n return self.urllib3_response.getheaders()", "def getheaders(sel...
[ "0.7520884", "0.6975295", "0.6975295", "0.6975295", "0.6920222", "0.6895884", "0.6797614", "0.67949516", "0.6744045", "0.6728178", "0.6647769", "0.6647769", "0.6616169", "0.65774935", "0.6571051", "0.6564471", "0.6533954", "0.6524701", "0.6517692", "0.6494233", "0.6491621", ...
0.644033
21
Installs RPKI validator with our configs. This might break in the future, but we need to do it this way for now to be able to do what we want with our own prefix origin table.
def install(**kwargs): config_logging(kwargs.get("stream_level", logging.DEBUG), kwargs.get("section")) utils.delete_paths([RPKI_Validator_Wrapper.rpki_package_path, RPKI_Validator_Wrapper.temp_install_path]) RPKI_Validator_Wrapper._download_v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _start_validator(self):\n\n logging.info(\"Starting RPKI Validator\")\n utils.run_cmds((f\"cd {self.rpki_package_path} && \"\n f\"./{self.rpki_run_name}\"))", "def _download_validator():\n\n rpki_url = (\"https://ftp.ripe.net/tools/rpki/validator3/beta/generic/\"\n...
[ "0.63697255", "0.5358504", "0.5253388", "0.5171715", "0.5128011", "0.50729746", "0.5013778", "0.4977327", "0.49645743", "0.48654142", "0.48506802", "0.484606", "0.47760716", "0.46838087", "0.4675308", "0.4669454", "0.46684492", "0.46496302", "0.4635433", "0.46273148", "0.4615...
0.6363485
1
Downloads validator into proper location
def _download_validator(): rpki_url = ("https://ftp.ripe.net/tools/rpki/validator3/beta/generic/" "rpki-validator-3-latest-dist.tar.gz") arin_tal = ("https://www.arin.net/resources/manage/rpki/" "arin-ripevalidator.tal") # This is the java version they us...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _download(self):\n self._system.download(\"http://geant4.web.cern.ch/geant4/support/source/\" + self._tar_name)", "def main():\n sandbox = create_sandbox()\n directory = download_package_to_sandbox(\n sandbox,\n 'https://pypi.python.org/packages/source/c/checkmyreqs/checkmyreqs-0.1...
[ "0.5852008", "0.5642754", "0.5526515", "0.5338583", "0.53289795", "0.5327149", "0.5300025", "0.5300025", "0.52865535", "0.52240986", "0.522238", "0.51255095", "0.51255095", "0.51233405", "0.5114986", "0.5091691", "0.5079647", "0.5037147", "0.5001166", "0.49831185", "0.4979095...
0.7724067
0
Changes location of input ann for bgp preview file
def _change_file_hosted_location(): # Changes where the file is hosted path = (f"{RPKI_Validator_Wrapper.rpki_package_path}conf" "/application-defaults.properties") prepend = "rpki.validator.bgp.ris.dump.urls=" replace = ("https://www.ris.ripe.net/dumps/riswhoisdump.IPv4...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def OnCustomPathChanged(self, event):\n self._annotations_path = self._file_dialog.value", "def _get_ann_file(self):\n prefix = 'instances' if 'test' not in self.image_set else 'image_info'\n return os.path.join(self.data_path, 'annotations',\n prefix + '_' + self....
[ "0.5407435", "0.52599055", "0.519646", "0.51875174", "0.5149553", "0.5149553", "0.5145319", "0.5119233", "0.507476", "0.50581217", "0.5036149", "0.49735096", "0.4945222", "0.49176285", "0.49105573", "0.4907959", "0.48954073", "0.4869619", "0.48695368", "0.48660442", "0.485979...
0.50529623
10
Prob because of a proxy, but on our server this is necessary
def _change_server_address(): # Changes the server address path = (f"{RPKI_Validator_Wrapper.rpki_package_path}conf" "/application.properties") prepend = "server.address=" replace = "localhost" replace_with = "0.0.0.0" utils.replace_line(path, prepend, re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_bad_proxy(pip, url):\n try:\n res = requests.get(\n url,\n proxies={'http':pip},\n headers={'User-agent':'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0'},\n timeout=10\n )\n except Exception as e:\n return ...
[ "0.6536286", "0.6455781", "0.6426632", "0.632419", "0.62789583", "0.61999655", "0.6165126", "0.60038203", "0.59746265", "0.592634", "0.58581245", "0.58513933", "0.58508027", "0.5772282", "0.5758716", "0.5737422", "0.57222337", "0.57179177", "0.57071245", "0.5704665", "0.56840...
0.0
-1
Configure rpki validator to run off absolute paths This is necessary due to script being called from elsewhere In other words not from inside the RPKI dir.
def _config_absolute_paths(path): # Since I am calling the script from elsewhere these must be # absolute paths prepend = "rpki.validator.data.path=" replace = "." # Must remove trailing backslash at the end replace_with = RPKI_Validator_Wrapper.rpki_package_path[:-1] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_paths(self):\n # When we're started with a *.qemuboot.conf arg assume that image\n # artefacts are relative to that file, rather than in whatever\n # directory DEPLOY_DIR_IMAGE in the conf file points to.\n if self.qbconfload:\n imgdir = os.path.realpath(os.path....
[ "0.56588614", "0.54540795", "0.5439257", "0.5435881", "0.5407553", "0.53129953", "0.5268416", "0.52518916", "0.5166516", "0.5107923", "0.5076477", "0.5066876", "0.5058214", "0.50226915", "0.49473757", "0.49465066", "0.49405462", "0.49361816", "0.4921926", "0.48854834", "0.486...
0.71353936
0
Plots an xy graph at a certain specified wavelength onto the current axes. Keyword arguments are passed on to matplotlib.
def plot_wavelength_slice(self, offset, axes=None, style='imshow', **kwargs): if axes is None: axes = wcsaxes_compat.gca_wcs(self.axes_wcs, slices=("x", "y", offset)) data = self._choose_wavelength_slice(offset) if data is None: data = self._choose_wavelength_slice(0) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def liveplot(x, y, xlim, ylim, title):\n plt.plot(x,y,'b.')\n plt.xlim(xlim)\n plt.ylim(ylim)\n plt.xlabel('North-South Axis')\n plt.ylabel('East-West Axis')\n plt.title(title)\n plt.show()", "def plot_xyz():\n plt.subplot(3,1,1) # for x axis\n plt.title('x value v.s. time')\n plt....
[ "0.68592244", "0.6670617", "0.6542144", "0.65134996", "0.6377094", "0.62712955", "0.62569517", "0.6249064", "0.6229926", "0.61167306", "0.60711694", "0.60472214", "0.60371035", "0.60346633", "0.60338837", "0.5984468", "0.59759843", "0.5972779", "0.59544533", "0.5941109", "0.5...
0.0
-1
Plots an xy graph at a certain specified wavelength onto the current axes. Keyword arguments are passed on to matplotlib.
def plot_x_slice(self, offset, axes=None, style='imshow', **kwargs): if axes is None: axes = wcsaxes_compat.gca_wcs(self.axes_wcs, slices=("x", offset, "y")) data = self._choose_x_slice(offset) if data is None: data = self._choose_x_slice(0) if style == 'imshow'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def liveplot(x, y, xlim, ylim, title):\n plt.plot(x,y,'b.')\n plt.xlim(xlim)\n plt.ylim(ylim)\n plt.xlabel('North-South Axis')\n plt.ylabel('East-West Axis')\n plt.title(title)\n plt.show()", "def plot_xyz():\n plt.subplot(3,1,1) # for x axis\n plt.title('x value v.s. time')\n plt....
[ "0.68588203", "0.6669191", "0.6541369", "0.6513319", "0.63761437", "0.6271679", "0.62557006", "0.62491953", "0.62296474", "0.6115451", "0.6069608", "0.6046171", "0.6036858", "0.6034111", "0.60327625", "0.5983629", "0.59748536", "0.59711856", "0.59539765", "0.5939472", "0.5929...
0.0
-1
Plots an interactive visualization of this cube with a slider controlling the wavelength axis. Parameters other than data and wcs are passed to ImageAnimatorWCS, which in turn passes them to imshow.
def animate(self, *args, **kwargs): i = ImageAnimatorWCS(self.data, wcs=self.axes_wcs, *args, **kwargs) return i
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Wave2DShow(ufield, ds, vel=None, vmin=None, vmax=None):\n #max index time and max index space\n maxt = np.shape(snapshots)[0]\n maxk = np.shape(snapshots)[1]\n maxi = np.shape(snapshots)[2] \n\n print \"vmin : \", vmin, \"vmax : \", vmax\n # space axis starting at 0 in x and z (using y coz...
[ "0.6150268", "0.6055747", "0.5920359", "0.5777385", "0.575942", "0.57372284", "0.57306933", "0.57087874", "0.5624707", "0.5564459", "0.5552165", "0.5533102", "0.55292475", "0.5504385", "0.5469229", "0.5465655", "0.546129", "0.54549205", "0.54419166", "0.5441791", "0.54239833"...
0.5334662
27
Retrieves an xy slice at a wavelength specified by the cube's primary wavelength plus the given offset.
def _choose_wavelength_slice(self, offset): if 'WAVE' not in self.axes_wcs.wcs.ctype: raise cu.CubeError(2, "Spectral dimension not present") if self.data.ndim == 4: raise cu.CubeError(4, "Can only work with 3D cubes") axis = -2 if self.axes_wcs.wcs.ctype[0] in ['TIME', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _choose_x_slice(self, offset):\n arr = None\n axis = 0\n length = self.data.shape[axis]\n if isinstance(offset, int) and offset >= 0 and offset < length:\n arr = self.data.take(offset, axis=axis)\n\n if isinstance(offset, u.Quantity):\n unit = self.axes_...
[ "0.6906233", "0.60154533", "0.57687914", "0.56916517", "0.5654022", "0.55755776", "0.55728334", "0.55718255", "0.5528963", "0.5498326", "0.54335445", "0.5349252", "0.53329015", "0.5331418", "0.53038037", "0.52538073", "0.52528626", "0.52475715", "0.5232891", "0.52242994", "0....
0.67115897
1
Retrieves a lambday slice at an x coordinate specified by the cube's primary wavelength plus the given offset.
def _choose_x_slice(self, offset): arr = None axis = 0 length = self.data.shape[axis] if isinstance(offset, int) and offset >= 0 and offset < length: arr = self.data.take(offset, axis=axis) if isinstance(offset, u.Quantity): unit = self.axes_wcs.wcs.cunit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _choose_wavelength_slice(self, offset):\n if 'WAVE' not in self.axes_wcs.wcs.ctype:\n raise cu.CubeError(2, \"Spectral dimension not present\")\n if self.data.ndim == 4:\n raise cu.CubeError(4, \"Can only work with 3D cubes\")\n\n axis = -2 if self.axes_wcs.wcs.ctype[...
[ "0.63117456", "0.5793032", "0.5629141", "0.5089525", "0.5078301", "0.506176", "0.50505126", "0.5043352", "0.49999565", "0.49748117", "0.4926123", "0.49144813", "0.49112678", "0.4907331", "0.48990658", "0.48967353", "0.4890172", "0.4886623", "0.48143712", "0.4807352", "0.47636...
0.61754596
1
Instantiate a new instance of this class using given data.
def _new_instance(cls, data, wcs, errors=None, **kwargs): return cls(data, wcs, errors=errors, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_data(cls, data):\n return object.__new__(cls)", "def from_data(cls,data):\n\n new_object = cls() # Only this line needs to be updated\n new_object.data = data\n\n return new_object", "def create(self, cls, data=None):\n return cls(self, initial_data=data)", "def fr...
[ "0.8485502", "0.82323295", "0.8037924", "0.8033954", "0.78525287", "0.7681436", "0.76791143", "0.75968486", "0.7346645", "0.7328685", "0.73233855", "0.7298864", "0.7253603", "0.7244204", "0.7244204", "0.7244204", "0.7244204", "0.72342247", "0.71200186", "0.7111342", "0.704766...
0.71335787
18
Converts a given frequency chunk to a SunPy Map. Extra parameters are passed on to Map.
def slice_to_map(self, chunk, snd_dim=None, *args, **kwargs): if self.axes_wcs.wcs.ctype[1] == 'WAVE' and self.data.ndim == 3: error = "Cannot construct a map with only one spatial dimension" raise cu.CubeError(3, error) if isinstance(chunk, tuple): item = slice(cu.pi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _createMap(self):\n width = self.map_size[0] * self.chunk_size\n height = self.map_size[1] * self.chunk_size\n map_array = np.zeros((height, width), dtype=float)\n chunks = {}\n clist = []\n for i in range(0, self.map_size[0]*self.map_size[1]):\n chunks[i+1]...
[ "0.57270765", "0.5564925", "0.5475267", "0.54156667", "0.54104096", "0.5340992", "0.52815837", "0.51907945", "0.51874447", "0.51529014", "0.5140967", "0.51343143", "0.50851405", "0.5076608", "0.5042034", "0.5038399", "0.5007617", "0.5004075", "0.4992073", "0.49909553", "0.498...
0.6020252
0
For a timelambday cube, returns a lightcurve with curves at the specified wavelength and given ycoordinate. If no y is given, all of them will be used (meaning the lightcurve object could contain more than one timecurve.)
def slice_to_lightcurve(self, wavelength, y_coord=None, x_coord=None): if self.axes_wcs.wcs.ctype[0] not in ['TIME', 'UTC']: raise cu.CubeError(1, 'Cannot create a lightcurve with no time axis') if self.axes_wcs.wcs.ctype[1] != 'WAVE': raise cu.Cube...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lightCurve(self, time, filters):\n\n lcMags = np.zeros(time.size, dtype=float)\n\n rise = np.where(time <= self.peakTime)\n lcMags[rise] += self.riseSlope*time[rise]-self.riseSlope*self.peakTime\n decline = np.where(time > self.peakTime)\n lcMags[decline] += self.declineSlope...
[ "0.5951895", "0.5928167", "0.5583655", "0.55513257", "0.54969233", "0.5486457", "0.5382974", "0.5276939", "0.5214253", "0.5212705", "0.51789206", "0.5082815", "0.50349635", "0.49946722", "0.4969627", "0.49492365", "0.4941575", "0.49127588", "0.4905105", "0.490314", "0.4884597...
0.61594796
0
For a cube containing a spectral dimension, returns a sunpy spectrum. The given coordinates represent which values to take. If they are None, then the corresponding axis is summed.
def slice_to_spectrum(self, *coords, **kwargs): if 'WAVE' not in self.axes_wcs.wcs.ctype: raise cu.CubeError(2, 'Spectral axis needed to create a spectrum') axis = -1 if self.axes_wcs.wcs.ctype[0] == 'WAVE' else -2 pixels = [cu.pixelize(coord, self.axes_wcs, axis) for coord in coords...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_spectral_cube(self):\n if self.data.ndim == 4:\n raise cu.CubeError(4, \"Too many dimensions: Can only convert a \" +\n \"3D cube. Slice the cube before converting\")\n if 'WAVE' not in self.axes_wcs.wcs.ctype:\n raise cu.CubeError(2,...
[ "0.6098314", "0.57695895", "0.56967276", "0.5517648", "0.5394993", "0.5346096", "0.5340599", "0.52352476", "0.5234346", "0.52302986", "0.52094436", "0.52033246", "0.5161801", "0.5134656", "0.50857544", "0.5084157", "0.50615275", "0.5031639", "0.49863473", "0.49710125", "0.496...
0.62595874
0
For a timelambday cube, given a ycoordinate, returns a sunpy spectrogram. Keyword arguments are passed on to Spectrogram's __init__.
def slice_to_spectrogram(self, y_coord, x_coord=None, **kwargs): if self.axes_wcs.wcs.ctype[0] not in ['TIME', 'UTC']: raise cu.CubeError(1, 'Cannot create a spectrogram with no time axis') if self.axes_wcs.wcs.ctype[1] != 'WAVE': raise cu.CubeError...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mel_spectrogram(self, y):\n # assert(torch.min(y.data) >= -1)\n # assert(torch.max(y.data) <= 1)\n\n magnitudes, phases = self.stft_fn.transform(y)\n # magnitudes = magnitudes.data\n mel_output = torch.matmul(self.mel_basis, magnitudes)\n mel_output = self.spectral_nor...
[ "0.62373495", "0.61111325", "0.5878095", "0.5321949", "0.52246", "0.52145845", "0.51144654", "0.50932705", "0.5055656", "0.50293887", "0.50188696", "0.50037694", "0.49115393", "0.4873337", "0.4850232", "0.48383042", "0.48147768", "0.4789717", "0.4733066", "0.4707515", "0.4701...
0.6674686
0
For a hypercube, return a 3D cube that has been cut along the given axis and with data corresponding to the given chunk.
def slice_to_cube(self, axis, chunk, **kwargs): if self.data.ndim == 3: raise cu.CubeError(4, 'Can only slice a hypercube into a cube') item = [slice(None, None, None) for _ in range(4)] if isinstance(chunk, tuple): if cu.iter_isinstance(chunk, (u.Quantity, u.Quantity)):...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def explode_along_axis(self, axis):\n # If axis is -ve then calculate the axis from the length of the dimensions of one cube\n if axis < 0:\n axis = len(self.dimensions) + axis\n # To store the resultant cube\n result_cubes = []\n # All slices are initially initialised...
[ "0.63870597", "0.61239403", "0.60539335", "0.5832195", "0.57542986", "0.56327647", "0.559867", "0.5501042", "0.5500518", "0.5481983", "0.5481307", "0.54722977", "0.5436329", "0.53984386", "0.53860784", "0.53848904", "0.53785336", "0.5359201", "0.5354345", "0.5327404", "0.5268...
0.83219737
0
Converts this cube into a SpectralCube. It will only work if the cube has exactly three dimensions and one of those is a spectral axis.
def convert_to_spectral_cube(self): if self.data.ndim == 4: raise cu.CubeError(4, "Too many dimensions: Can only convert a " + "3D cube. Slice the cube before converting") if 'WAVE' not in self.axes_wcs.wcs.ctype: raise cu.CubeError(2, 'Spectral axi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spectral_model(self):\n d = self.data\n spec_type = d['SpectrumType'].strip()\n pars, errs = {}, {}\n pars['amplitude'] = d['Flux_Density']\n errs['amplitude'] = d['Unc_Flux_Density']\n pars['reference'] = d['Pivot_Energy']\n\n if spec_type == 'PowerLaw':\n ...
[ "0.6274869", "0.6003347", "0.5845092", "0.5763128", "0.56499904", "0.55344087", "0.55215806", "0.5233117", "0.5228521", "0.5198386", "0.5195983", "0.51448613", "0.51295257", "0.5123832", "0.5117463", "0.51086575", "0.50924385", "0.50752395", "0.50532764", "0.50532764", "0.505...
0.8686489
0
Returns a numpy array containing the time values for the cube's time dimension, as well as the unit used.
def time_axis(self): if self.axes_wcs.wcs.ctype[0] not in ['TIME', 'UTC']: raise cu.CubeError(1, 'No time axis present') delta = self.axes_wcs.wcs.cdelt[0] crpix = self.axes_wcs.wcs.crpix[0] crval = self.axes_wcs.wcs.crval[0] start = crval - crpix * delta stop...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time(self):\n return self.time_array", "def time_axis_array(self):\n return self._time_axis.get_array()", "def arr_time(self):\n return self._arr_time", "def times(self):\n if self._times is None:\n self._times = np.zeros((self.ntimestep), dtype=np.float64)\n ...
[ "0.7211374", "0.6856966", "0.68256146", "0.67285633", "0.65972865", "0.6441097", "0.63960433", "0.6338288", "0.6300424", "0.6298656", "0.6298656", "0.62866175", "0.62780577", "0.62295645", "0.6061472", "0.6057796", "0.6039089", "0.60030895", "0.5996386", "0.59960365", "0.5991...
0.6944582
1
Returns a numpy array containing the frequency values for the cube's spectral dimension, as well as the axis's unit.
def wavelength_axis(self): if 'WAVE' not in self.axes_wcs.wcs.ctype: raise cu.CubeError(2, 'No energy (wavelength, frequency) axis found') axis = 0 if self.axes_wcs.wcs.ctype[0] == 'WAVE' else 1 delta = self.axes_wcs.wcs.cdelt[axis] crpix = self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def frequencies(self):\r\n\r\n self.method['Fs'] = self.method.get('Fs', self.input.sampling_rate)\r\n NFFT = self.method.get('NFFT', 64)\r\n Fs = self.method.get('Fs')\r\n freqs = tsu.get_freqs(Fs, NFFT)\r\n lb_idx, ub_idx = tsu.get_bounds(freqs, self.lb, self.ub)\r\n\r\n ...
[ "0.6470279", "0.6461034", "0.64269227", "0.6334639", "0.6251372", "0.61910397", "0.59662837", "0.5920204", "0.5918302", "0.59053004", "0.5890902", "0.5809529", "0.57999116", "0.57967234", "0.5774496", "0.57175756", "0.57160854", "0.5687078", "0.5675256", "0.5670857", "0.56388...
0.55794877
25
Returns whether the wcs system and the array are wellaligned.
def _array_is_aligned(self): rot_matrix = self.axes_wcs.wcs.pc return np.allclose(rot_matrix, np.eye(self.axes_wcs.wcs.naxis))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isaligned(a: np.ndarray, alignment: int) -> bool:\n return (a.ctypes.data % alignment) == 0", "def is_aligned(self):\n\n return self._bits == 0", "def has_wcs(self):\n if self.header is None:\n return False\n\n required = 'CRPIX,CRVAL,CTYPE'.split(',')\n keywords =...
[ "0.6622194", "0.66116005", "0.64189285", "0.629337", "0.6231566", "0.62093145", "0.61557496", "0.61207116", "0.5808725", "0.57705253", "0.5653776", "0.5611747", "0.5607932", "0.5607731", "0.55909234", "0.5550369", "0.5533875", "0.55202824", "0.54235834", "0.5402072", "0.53951...
0.74039537
0
Instantiate a new instance of this class using given data.
def _new_instance(cls, data_list, meta=None, common_axis=None): return cls(data_list, meta=meta, common_axis=common_axis)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_data(cls, data):\n return object.__new__(cls)", "def from_data(cls,data):\n\n new_object = cls() # Only this line needs to be updated\n new_object.data = data\n\n return new_object", "def create(self, cls, data=None):\n return cls(self, initial_data=data)", "def fr...
[ "0.8487179", "0.8234369", "0.8037686", "0.80359334", "0.78548235", "0.7683154", "0.7678993", "0.7598695", "0.7346941", "0.73307866", "0.7325395", "0.7300296", "0.725587", "0.72462845", "0.72462845", "0.72462845", "0.72462845", "0.72362065", "0.7133408", "0.71174616", "0.71122...
0.6748535
30
Method to slice the cubesequence instance as a single cube Example >>> Say we have three Cubes each cube has common_axis=0 is time and shape=(3,3,3) >>> data_list = [cubeA, cubeB, cubeC] >>> cs = CubeSequence(data_list, meta=None, common_axis=0) >>> return zeroth time slice of cubeB in via normal CubeSequence indexing.
def index_as_cube(self): return _IndexAsCubeSlicer(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cube_like_tuple_item_to_sequence_items(item, common_axis, common_axis_lengths, n_cube_dims):\n if not hasattr(item, \"__len__\"):\n raise TypeError(\"item must be an iterable of slices and/or ints.\")\n if len(item) <= common_axis:\n raise ValueError(\"item must be include an entry for the ...
[ "0.6331354", "0.62150717", "0.60088134", "0.5788159", "0.5405186", "0.52887505", "0.52854425", "0.526346", "0.52061605", "0.512507", "0.51214343", "0.5059634", "0.50593454", "0.5031299", "0.50106156", "0.5003349", "0.49384144", "0.493823", "0.49368778", "0.49356455", "0.49280...
0.5719029
4
Plots an xy graph at a certain specified wavelength onto the current axes. Keyword arguments are passed on to matplotlib.
def plot_x_slice(self, offset, **kwargs): cumul_cube_lengths = np.cumsum(np.array([c.shape[self.common_axis] for c in self.data])) sequence_index, cube_index = cu._convert_cube_like_index_to_sequence_indices( offset, cumul_cube_lengths) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def liveplot(x, y, xlim, ylim, title):\n plt.plot(x,y,'b.')\n plt.xlim(xlim)\n plt.ylim(ylim)\n plt.xlabel('North-South Axis')\n plt.ylabel('East-West Axis')\n plt.title(title)\n plt.show()", "def plot_xyz():\n plt.subplot(3,1,1) # for x axis\n plt.title('x value v.s. time')\n plt....
[ "0.68588203", "0.6669191", "0.6541369", "0.6513319", "0.63761437", "0.6271679", "0.62557006", "0.62491953", "0.62296474", "0.6115451", "0.6069608", "0.6046171", "0.6036858", "0.6034111", "0.60327625", "0.5983629", "0.59748536", "0.59711856", "0.59539765", "0.5939472", "0.5929...
0.0
-1
Plots an xy graph at a certain specified wavelength onto the current axes. Keyword arguments are passed on to matplotlib.
def plot_wavelength_slice(self, offset, **kwargs): cumul_cube_lengths = np.cumsum(np.array([c.shape[self.common_axis] for c in self.data])) sequence_index, cube_index = cu._convert_cube_like_index_to_sequence_indices( offset, cumul_cube_length...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def liveplot(x, y, xlim, ylim, title):\n plt.plot(x,y,'b.')\n plt.xlim(xlim)\n plt.ylim(ylim)\n plt.xlabel('North-South Axis')\n plt.ylabel('East-West Axis')\n plt.title(title)\n plt.show()", "def plot_xyz():\n plt.subplot(3,1,1) # for x axis\n plt.title('x value v.s. time')\n plt....
[ "0.68592244", "0.6670617", "0.6542144", "0.65134996", "0.6377094", "0.62712955", "0.62569517", "0.6249064", "0.6229926", "0.61167306", "0.60711694", "0.60472214", "0.60371035", "0.60346633", "0.60338837", "0.5984468", "0.59759843", "0.5972779", "0.59544533", "0.5941109", "0.5...
0.0
-1
parse case excel file.
def manual_case_parser(self): data = self.excel_parser() result = self.process_module_field(data) self.add_class_name_field(result) self.process_multi_step_field(result) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_parse_sample_sheet(self):\n pass", "def parse_ra():\r\n fname = 'parse/File1.xlsx'\r\n sheet_name = 'Sheet1'\r\n\r\n ra_sheet = get_sheet(fname, sheet_name)\r\n return parse_sheet(ra_sheet)", "def parse_xlsx(filename):\n from openpyxl import load_workbook\n\n workbook = load_w...
[ "0.66888124", "0.6109369", "0.61021197", "0.60966265", "0.5916426", "0.589535", "0.58326924", "0.5774381", "0.56844836", "0.5633092", "0.5630392", "0.56159174", "0.56018525", "0.55881256", "0.55868655", "0.55625945", "0.55516446", "0.55497164", "0.5522616", "0.55121005", "0.5...
0.67918974
0
Process the "Module" filed.
def process_module_field(self, data): result = list() case_info = data['values'] # add Module filed for i, v in enumerate(case_info): if not v['Module']: v['Module'] = case_info[i - 1]['Module'] else: module = tuple(self.parser.sp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_module_list(self, modules):", "def visit_Module(self, node):\n for item in node.body:\n self.visit(item)", "def visit_Module(self, node):\n for item in node.body:\n self.visit(item)", "def exec_module(self, module):\n pass", "def on_module_event(self, ...
[ "0.73333037", "0.6903211", "0.6903211", "0.6841748", "0.6787638", "0.6626777", "0.6554846", "0.64963454", "0.6429045", "0.6391386", "0.63664407", "0.63107514", "0.6293941", "0.6276409", "0.6265793", "0.6207045", "0.61946833", "0.61454856", "0.61390555", "0.6034528", "0.603106...
0.6489552
8
Add the "ClassName" filed.
def add_class_name_field(data): for case in data: case_id = case['No.'] filed_list = case_id.split('_') filed_list = list(map(lambda x: x.title(), filed_list)) case['ClassName'] = ''.join(filed_list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setClassName(self,whichDir):\n self.className = whichDir\n self.setClassMap({whichDir : 1})", "def addClassRef(clazz):\n\n global h_classes\n header = \"class %s;\" % clazz\n if not header in h_classes:\n h_classes.append(header)", "def add_class(self, name):\n if name ...
[ "0.6673873", "0.65873694", "0.65540683", "0.65310895", "0.62807566", "0.61844677", "0.61496955", "0.61109734", "0.60883236", "0.5851665", "0.5794981", "0.57527643", "0.57015514", "0.56917053", "0.5677711", "0.5670707", "0.566091", "0.56086993", "0.55906165", "0.55896807", "0....
0.69511896
0
Process the multi_step filed.
def multi_step_field(self, info): result = list() for i, v in enumerate(self.parser.split(info)): if re.search(r'^\d+', v): result.append(v) else: result[-1] += ' %s' % v return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_step(self) -> None:", "def process_step(self, request, step, form):\n pass", "def _step(self):\n pass", "def process_steps(self, df, **kwargs):\n pass", "def step(self, **kwargs):\n pass", "def _step(self) -> None:", "def perform_step(self) -> None:\n pass", ...
[ "0.6953273", "0.6896622", "0.6519482", "0.6498906", "0.6467285", "0.64277387", "0.63524014", "0.62364155", "0.61352557", "0.61075705", "0.6049684", "0.5984105", "0.5969542", "0.59558064", "0.5954331", "0.5935271", "0.5926765", "0.58631474", "0.58631474", "0.5861994", "0.58472...
0.0
-1
Sample from the provided binary quadratic model.
def sample(self, bqm, chain_strength=1.0, **parameters): # solve the problem on the child system child = self.child # apply the embedding to the given problem to map it to the child sampler __, target_edgelist, target_adjacency = child.structure # add self-loops to edgelist to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample(self,noise,s):\n rhs=self.prior.sqrtM*noise\n self.prior.Msolver.solve(s,rhs)", "def sample(self, bqm, fixed_variables=None, **parameters):\n return super().sample(bqm, fixed_variables=fixed_variables, **parameters)", "def sample(self, bqm, **parameters):\n return self.ch...
[ "0.5944321", "0.58827317", "0.57604975", "0.56414646", "0.5592896", "0.5581259", "0.55090886", "0.54022413", "0.5325893", "0.5319684", "0.53083277", "0.53047055", "0.5290728", "0.52858907", "0.5271392", "0.5254466", "0.52531403", "0.52415967", "0.52349377", "0.5205364", "0.52...
0.4778152
97
Sample from the provided binary quadratic model.
def sample(self, bqm, chain_strength=1.0, **parameters): # solve the problem on the child system child = self.child # apply the embedding to the given problem to map it to the child sampler __, __, target_adjacency = child.structure # get the embedding embedding = self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample(self,noise,s):\n rhs=self.prior.sqrtM*noise\n self.prior.Msolver.solve(s,rhs)", "def sample(self, bqm, fixed_variables=None, **parameters):\n return super().sample(bqm, fixed_variables=fixed_variables, **parameters)", "def sample(self, bqm, **parameters):\n return self.ch...
[ "0.5944321", "0.58827317", "0.57604975", "0.56414646", "0.5592896", "0.5581259", "0.55090886", "0.54022413", "0.5325893", "0.5319684", "0.53083277", "0.53047055", "0.5290728", "0.52858907", "0.5271392", "0.5254466", "0.52531403", "0.52415967", "0.52349377", "0.5205364", "0.52...
0.0
-1
determine from an adjacency the list of edges if (u, v) in edges, then (v, u) should not be
def _adjacency_to_edges(adjacency): edges = set() for u in adjacency: for v in adjacency[u]: try: edge = (u, v) if u <= v else (v, u) except TypeError: # Py3 does not allow sorting of unlike types if (v, u) in edges: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isUndirected(G):\n for v in G:\n if v in G[v]:\n return False\n for w in G[v]:\n if v not in G[w]:\n return False\n return True", "def de2ue(edges):\n return set(de for de in edges if tuple(reversed(de)) in edges)", "def test_adjacent_none(graph_w...
[ "0.70223045", "0.67823124", "0.6704551", "0.663785", "0.65423083", "0.65288144", "0.6453709", "0.6431163", "0.64235234", "0.63841563", "0.6299269", "0.6283511", "0.6264669", "0.6231787", "0.6221642", "0.6220229", "0.6163761", "0.6078412", "0.60337824", "0.60281676", "0.602758...
0.61262304
17
Validation of the implementaiton of periodic angle axis in Magnetic (MagFEMM) and Force (ForceMT) modules
def test_FEMM_periodicity_time_no_periodicity_a(): SPMSM_015 = load(join(DATA_DIR, "Machine", "SPMSM_015.json")) assert SPMSM_015.comp_periodicity() == (9, False, 9, True) simu = Simu1(name="test_FEMM_periodicity_time_no_periodicity_a", machine=SPMSM_015) # Definition of the enforced output of the e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_FEMM_periodicity_angle():\n\n SPMSM_015 = load(join(DATA_DIR, \"Machine\", \"SPMSM_015.json\"))\n\n assert SPMSM_015.comp_periodicity() == (9, False, 9, True)\n\n simu = Simu1(name=\"test_FEMM_periodicity_angle\", machine=SPMSM_015)\n\n # Definition of the enforced output of the electrical mod...
[ "0.6782517", "0.60290766", "0.6012614", "0.58263516", "0.5755218", "0.56247103", "0.5583029", "0.5559526", "0.55149376", "0.54994637", "0.5498538", "0.54675615", "0.5454319", "0.5441296", "0.54299664", "0.5414825", "0.54081666", "0.53792536", "0.53736025", "0.53621024", "0.53...
0.56348616
5
Validation of the implementaiton of periodic angle axis in Magnetic (MagFEMM) and Force (ForceMT) modules
def test_FEMM_periodicity_time(): SPMSM_015 = load(join(DATA_DIR, "Machine", "SPMSM_015.json")) assert SPMSM_015.comp_periodicity() == (9, False, 9, True) simu = Simu1(name="test_FEMM_periodicity_time", machine=SPMSM_015) # Definition of the enforced output of the electrical module I0_rms = 250 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_FEMM_periodicity_angle():\n\n SPMSM_015 = load(join(DATA_DIR, \"Machine\", \"SPMSM_015.json\"))\n\n assert SPMSM_015.comp_periodicity() == (9, False, 9, True)\n\n simu = Simu1(name=\"test_FEMM_periodicity_angle\", machine=SPMSM_015)\n\n # Definition of the enforced output of the electrical mod...
[ "0.67807055", "0.6025987", "0.6009556", "0.582327", "0.57532835", "0.5632618", "0.5626842", "0.5582642", "0.55583394", "0.55183727", "0.5498292", "0.5465175", "0.54535043", "0.54445416", "0.54298043", "0.54143214", "0.5408169", "0.53782576", "0.53738904", "0.53651005", "0.535...
0.54969805
11