query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
The VPC subnets that Studio uses for communication.
def subnet_ids(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]: return pulumi.get(self, "subnet_ids")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subnets(self) -> Sequence[str]:\n return pulumi.get(self, \"subnets\")", "def subnets(self) -> pulumi.Output[Sequence[str]]:\n return pulumi.get(self, \"subnets\")", "def subnets(self) -> pulumi.Output[Sequence[str]]:\n return pulumi.get(self, \"subnets\")", "def subnets(self) -> pul...
[ "0.8304371", "0.81718767", "0.81718767", "0.81716067", "0.8032661", "0.79584837", "0.7939618", "0.7461049", "0.7456496", "0.7439182", "0.70543736", "0.700263", "0.698368", "0.6957542", "0.6898608", "0.68436927", "0.67423826", "0.65990734", "0.6584025", "0.65813076", "0.655735...
0.65327746
21
The ID of the Amazon Virtual Private Cloud (VPC) that Studio uses for communication.
def vpc_id(self) -> pulumi.Input[str]: return pulumi.get(self, "vpc_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self...
[ "0.83634466", "0.83634466", "0.83634466", "0.83634466", "0.83634466", "0.83634466", "0.8067257", "0.8067257", "0.8067257", "0.8067257", "0.8067257", "0.8067257", "0.8067257", "0.8067257", "0.8067257", "0.79284143", "0.79252106", "0.78330946", "0.76976514", "0.7626964", "0.762...
0.77359873
19
A name for the domain.
def domain_name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "domain_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def domain_name(self) -> str:\n return pulumi.get(self, \"domain_name\")", "def domain_name(self) -> str:\n return pulumi.get(self, \"domain_name\")", "def domain_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"domain_name\")", "def domain_name(self) -> pulumi.Output[str]:\...
[ "0.8627665", "0.8627665", "0.82137305", "0.82137305", "0.82137305", "0.8191541", "0.81842875", "0.8084984", "0.8084984", "0.8084984", "0.75215656", "0.75004846", "0.7499194", "0.7442696", "0.7442696", "0.73769754", "0.7301013", "0.72826844", "0.7276429", "0.72595614", "0.7259...
0.7792371
10
The Amazon Resource Name (ARN) of the created domain.
def domain_arn(self) -> pulumi.Output[str]: return pulumi.get(self, "domain_arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bucket_domain_name(self) -> str:\n ...", "def domain_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"domain_name\")", "def domain_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"domain_name\")", "def domain_name(self) -> pulumi.Output[str]:\n return...
[ "0.66087157", "0.653666", "0.653666", "0.653666", "0.6519193", "0.6519193", "0.65129775", "0.65129775", "0.63391805", "0.63391805", "0.63391805", "0.63391805", "0.63391805", "0.6219553", "0.6219553", "0.6219553", "0.6219553", "0.6219553", "0.6219553", "0.6219553", "0.6219553"...
0.7720833
0
A name for the domain.
def domain_name(self) -> pulumi.Output[str]: return pulumi.get(self, "domain_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def domain_name(self) -> str:\n return pulumi.get(self, \"domain_name\")", "def domain_name(self) -> str:\n return pulumi.get(self, \"domain_name\")", "def get_domain_name(self):\n return self.domain_name.get_text()", "def create_domain_name(self, name):\n return (\"%s.%s.%s\" % (...
[ "0.8628254", "0.8628254", "0.81923366", "0.8182993", "0.808536", "0.808536", "0.808536", "0.77933306", "0.7522186", "0.75020987", "0.7499558", "0.74441755", "0.74441755", "0.7378015", "0.73014915", "0.72835416", "0.72774845", "0.72597253", "0.72597253", "0.7240383", "0.704359...
0.8214402
2
The ID of the Amazon Elastic File System (EFS) managed by this Domain.
def home_efs_file_system_id(self) -> pulumi.Output[str]: return pulumi.get(self, "home_efs_file_system_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_system_id(self) -> str:\n return pulumi.get(self, \"file_system_id\")", "def sfdc_org_id(self) -> str:\n return pulumi.get(self, \"sfdc_org_id\")", "def uuid(self):\n if openmediavault.string.is_fs_uuid(self._id):\n return self._id\n return self.get_udev_property...
[ "0.75458175", "0.64076936", "0.6348888", "0.61123604", "0.6107418", "0.6086329", "0.6086329", "0.60816836", "0.60747164", "0.60697025", "0.6034883", "0.6031416", "0.5996914", "0.5941748", "0.5923695", "0.5923695", "0.5923695", "0.5923695", "0.5923695", "0.5904925", "0.5847907...
0.7285922
1
The ID of the security group that authorizes traffic between the RSessionGateway apps and the RStudioServerPro app.
def security_group_id_for_domain_boundary(self) -> pulumi.Output[str]: return pulumi.get(self, "security_group_id_for_domain_boundary")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def security_group_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"security_group_id\")", "def security_group_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"security_group_id\")", "def security_group_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"securi...
[ "0.76948166", "0.76948166", "0.73573196", "0.73573196", "0.73078245", "0.73078245", "0.71466714", "0.7141363", "0.7141363", "0.7141363", "0.7141363", "0.7141363", "0.7119604", "0.6807679", "0.6804456", "0.6804456", "0.6804456", "0.6804456", "0.6804456", "0.67618924", "0.67607...
0.6655852
25
The VPC subnets that Studio uses for communication.
def subnet_ids(self) -> pulumi.Output[Sequence[str]]: return pulumi.get(self, "subnet_ids")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subnets(self) -> Sequence[str]:\n return pulumi.get(self, \"subnets\")", "def subnets(self) -> pulumi.Output[Sequence[str]]:\n return pulumi.get(self, \"subnets\")", "def subnets(self) -> pulumi.Output[Sequence[str]]:\n return pulumi.get(self, \"subnets\")", "def subnets(self) -> pul...
[ "0.8304371", "0.81718767", "0.81718767", "0.81716067", "0.8032661", "0.79584837", "0.7939618", "0.7461049", "0.7456496", "0.7439182", "0.70543736", "0.700263", "0.698368", "0.6957542", "0.6898608", "0.68436927", "0.67423826", "0.65990734", "0.6584025", "0.65813076", "0.655735...
0.6517597
25
The ID of the Amazon Virtual Private Cloud (VPC) that Studio uses for communication.
def vpc_id(self) -> pulumi.Output[str]: return pulumi.get(self, "vpc_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self...
[ "0.8364145", "0.8364145", "0.8364145", "0.8364145", "0.8364145", "0.8364145", "0.79292554", "0.7925871", "0.7834015", "0.7737266", "0.7737266", "0.7737266", "0.7737266", "0.7737266", "0.7737266", "0.7698707", "0.76281226", "0.76281226", "0.76281226", "0.76281226", "0.76281226...
0.8068161
9
URL /api/v1.0/categories Method GET Returns a list of all available categories.
def categories(): categories = [ 'News', 'Technology', 'Music', 'Sports' ] response = { 'response': categories } return jsonify(response)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_categories(self):\n _url = urljoin(self.base_url, self.API_CATEGORIES)\n return requests.get(_url)", "def get_all_categories():\n return jsonify({\n \"success\": True,\n \"categories\": _read_all_categories()\n })", "def get_categories():\n try:\n ...
[ "0.86645913", "0.8263668", "0.8237474", "0.7978286", "0.79579425", "0.79133695", "0.7823778", "0.7814441", "0.7785671", "0.76614296", "0.76482564", "0.7606076", "0.7596912", "0.7548284", "0.75390446", "0.75243694", "0.7492999", "0.7447652", "0.74417806", "0.7353512", "0.72753...
0.75095063
16
Filtering all tickets in database and return them to views
def do_search(request): tickets = Ticket.objects.filter(issue_type__icontains=request.GET['q']) return render(request, 'tickets.html', {"tickets":tickets})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n filters = []\n if 'category' in request.args:\n category_id = Category.query\\\n .filter(Category.name == request.args['category']).one().id\n filters.append(Ticket.category_id == category_id)\n if 'submitter' in request.args:\n ...
[ "0.67445064", "0.62976104", "0.62751245", "0.62696826", "0.61144745", "0.6094837", "0.6009443", "0.5986099", "0.5924473", "0.5902665", "0.5836112", "0.58171636", "0.57822806", "0.5747292", "0.5726257", "0.5701047", "0.5693373", "0.5681497", "0.5654354", "0.5643167", "0.563919...
0.6172156
4
Calculate the Q operator of the Qrepresentability condition from the one and twobody RDMs `g1` and `g2`, respectively.
def calcQ(g2, g1): idop = g2.copy() idop.data = np.eye(*g2.shape) return g2 - p2N(g1, 2) + idop
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def q_2_q(q_1: Q, q_2: Q) -> Q:\n\n q_1.check_representations(q_2)\n end_q_type = f\"{q_1.q_type}^{q_2.q_type}\"\n\n q2q = exp(product(ln(q_1), q_2))\n q2q.q_type = end_q_type\n q2q.representation = q_1.representation\n q2q.q_type = end_q_type\n\n return q2q", "def calcQ_(g2, N):\n g1 = r...
[ "0.6892517", "0.6889881", "0.63589", "0.6333272", "0.6225902", "0.6191436", "0.5958122", "0.59490293", "0.593716", "0.59290874", "0.589545", "0.5892825", "0.58919996", "0.58509576", "0.5841858", "0.5795289", "0.57928324", "0.57762784", "0.57646835", "0.5763015", "0.5723314", ...
0.7432175
0
Calculate the Q operator of the Qrepresentability condition from the twobody RDM `g2`, with `N` the overall particle number.
def calcQ_(g2, N): g1 = rdm(g2, 1)/(N - 1) return calcQ(g2, g1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calcQ(g2, g1):\n idop = g2.copy()\n idop.data = np.eye(*g2.shape)\n\n return g2 - p2N(g1, 2) + idop", "def qMethod(g_b, g_n, m_b, m_n):\n\tB = g_b @ g_n.T + m_b @ m_n.T\n\tZ = (np.cross(g_b.flatten(), g_n.flatten()) + np.cross(m_b.flatten(), m_n.flatten())).reshape(-1, 1)\n\tK = np.block([[B + B.T -...
[ "0.7517545", "0.6450894", "0.6378916", "0.59851", "0.59831595", "0.5933612", "0.5850486", "0.5746151", "0.5745228", "0.5633107", "0.5575411", "0.5557471", "0.5531216", "0.5524714", "0.5510562", "0.5501106", "0.54945815", "0.5482417", "0.54801255", "0.54795104", "0.54733604", ...
0.8168854
0
Register Vocabulary. DEPRECATED This method should not be used, it has been replaced by register_vocabulary().
def register_vocab(self, start_concept, end_concept, alias_of, regex_str): self.register_vocabulary(start_concept, end_concept, alias_of, regex_str)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setVocabulary(self, vocabulary): # real signature unknown; restored from __doc__\n pass", "def vocab():\n symbols = DEFAULT_SPECIAL_SYMBOLS + [\"mouse\", \"dog\", \"tree\"]\n return Vocabulary(symbols)", "def register_vocabulary(self, entity_value, entity_type,\n ali...
[ "0.679333", "0.61930466", "0.61466193", "0.61137843", "0.5869082", "0.5709179", "0.56945896", "0.56353366", "0.56340474", "0.55958784", "0.5545808", "0.55280566", "0.5495738", "0.5483137", "0.5483137", "0.5482847", "0.54647595", "0.54221207", "0.54163015", "0.5403377", "0.539...
0.69394886
0
>>> t = Textile() >>> t.lists(" one\\n two\\n three") '\\t\\n\\t\\tone\\n\\t\\ttwo\\n\\t\\tthree\\n\\t'
def lists(self, text): #Replace line-initial bullets with asterisks bullet_pattern = re.compile(u'^•', re.U | re.M) pattern = re.compile(r'^((?:[*;:]+|[*;:#]*#(?:_|\d+)?)%s[ .].*)$(?![^#*;:])' % self.lc, re.U | re.M | re.S) return pattern.sub(self.fList, bu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_list(self):\n self.assertValue(\n ['foo', 'bar', 'hello'],\n 'foo\\nbar\\nhello\\n')", "def test_list(self):\n self.assertEquals(\"* item\", trans(\" * item\"))\n self.assertEquals(\"\\t* item\", trans(\" * item\"))\n self.assertEquals(\"\\t\\t* item\",...
[ "0.6317247", "0.60485244", "0.5730285", "0.56785476", "0.56744534", "0.5635327", "0.56317437", "0.56198823", "0.5591716", "0.55897194", "0.5565305", "0.5550064", "0.5518512", "0.5481161", "0.54731613", "0.546874", "0.54473335", "0.5422085", "0.5415559", "0.5406077", "0.538179...
0.55596364
11
Load the pretrained ResNet50 and replace top linear layer
def __init__(self,embedding_size): super(ResNetEncoder,self).__init__() resnet = models.resnet50(pretrained=True) modules = list(resnet.children())[:-1] #Create a sequential models upto top fc layer add a custom fc layer compatible with embedding size of decoder RNN self.resnet =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resnet50(pretrained=False):\n model = ResNet(Bottleneck, [3, 4, 6, 3])\n if pretrained:\n model.load_state_dict(model_zoo.load_url(model_urls['resnet50']))\n return model", "def resnet50(pretrained=False, **kwargs):\n model = ResNet(Bottleneck, [3, 4, 6, 3], **kwargs)\n if pretrained:\n...
[ "0.7086507", "0.70229346", "0.70229346", "0.70229346", "0.70229346", "0.70076656", "0.6889829", "0.68130666", "0.6806834", "0.67665786", "0.6763066", "0.6714202", "0.6696823", "0.6657743", "0.6580299", "0.65655994", "0.65655994", "0.6560681", "0.6560681", "0.6560681", "0.6531...
0.0
-1
Generate random colors. To get visually distinct colors, generate them in HSV space then convert to RGB.
def random_colors(N, bright=True): import random import colorsys brightness = 1.0 if bright else 0.7 hsv = [(i / N, 1, brightness) for i in range(N)] colors = list(map(lambda c: colorsys.hsv_to_rgb(*c), hsv)) random.shuffle(colors) return colors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_color_gen():\n r = randint(0, 255)\n g = randint(0, 255)\n b = randint(0, 255)\n return [r, g, b]", "def _genRandomColor():\n b = random.randint(0, 255)\n g = random.randint(0, 255)\n r = random.randint(0, 255)\n return (b, g, r)", "def random_color():\n colormode(255)\n ...
[ "0.812896", "0.78733075", "0.7786121", "0.7730925", "0.7632204", "0.7620248", "0.7485356", "0.7479354", "0.7455519", "0.7443992", "0.7443486", "0.7427456", "0.7409714", "0.7371655", "0.73648924", "0.7352987", "0.7340252", "0.73222953", "0.73222953", "0.73222953", "0.7310576",...
0.72017545
27
Gets data from file and returns Dataframe
def getTimeseries_from_file(self, path, file_type): self.path = path if not file_type or file_type.lower() not in ['csv', 'pickle']: raise ValueError('Either pickle or csv must be true.') elif file_type=='pickle': temp_dataframe = pd.read_pickle(self.path) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(filename):\r\n return pd.read_csv(filename)", "def run(self) -> pd.DataFrame:\n with open(self.file_path, 'r') as in_file:\n headers = in_file.readline()\n headers = headers.replace(\"\\n\", \"\")\n\n if ',' in headers:\n headers = headers.sp...
[ "0.8084674", "0.78375334", "0.77952564", "0.77952564", "0.77952564", "0.7657531", "0.75506335", "0.7549126", "0.7488558", "0.7333605", "0.7318028", "0.73160434", "0.7280813", "0.7279716", "0.7271018", "0.72660136", "0.7262885", "0.72556317", "0.721922", "0.72089934", "0.71976...
0.0
-1
Is true when color map contains all 12ET pitchclasses.
def is_twelve_tone_complete(self): pcs = range(12) return set(pcs).issubset(set(self._color_dictionary.keys()))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_twenty_four_tone_complete(self):\n pcs = [x / 2.0 for x in range(24)]\n pcs = [int(x) if int(x) == x else x for x in pcs]\n return set(pcs).issubset(set(self._color_dictionary.keys()))", "def has_presets(self):\n return bool(self.positions.__dict__)", "def game_won(self):\n\n...
[ "0.6012609", "0.58728874", "0.57434833", "0.5726375", "0.5688486", "0.5658996", "0.56589687", "0.56312805", "0.5584573", "0.5582692", "0.5529555", "0.5508323", "0.54986054", "0.54841286", "0.54365814", "0.54222614", "0.54154474", "0.5388431", "0.53579587", "0.53516257", "0.53...
0.66580373
0
Is true when color map contains all 24ET pitchclasses.
def is_twenty_four_tone_complete(self): pcs = [x / 2.0 for x in range(24)] pcs = [int(x) if int(x) == x else x for x in pcs] return set(pcs).issubset(set(self._color_dictionary.keys()))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_twelve_tone_complete(self):\n pcs = range(12)\n return set(pcs).issubset(set(self._color_dictionary.keys()))", "def has_presets(self):\n return bool(self.positions.__dict__)", "def has_valid_channel_values(rgb_coll):\n return all([is_0to255(c) and is_int(c) for c in rgb_coll])", ...
[ "0.6362645", "0.57862574", "0.5760941", "0.57446283", "0.57428074", "0.5696903", "0.5641837", "0.56390244", "0.56383634", "0.56338006", "0.55419344", "0.54822344", "0.5426357", "0.5412979", "0.5375172", "0.5368142", "0.53266597", "0.5303085", "0.5281763", "0.52808356", "0.527...
0.6005965
1
Gets a dictionary mapping all the names of the actions in the parse tree to their functions.
def get_all_action_functions_map(): actions = { 'interact': measure_interaction_effects, 'countdata': count_data_points, 'filter': filter_operation, 'explain': explain_operation, 'predict': predict_operation, 'self': self_operation, 'previousfilter': last_turn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def action_map(self) -> Dict[str, CLIActionType]:\n return add_dicts({\n \"dump\": self.dump_action,\n \"dump-macrosizes\": self.dump_macrosizes_action,\n \"dump_macrosizes\": self.dump_macrosizes_action,\n \"synthesis\": self.synthesis_action,\n \"syn\...
[ "0.7013605", "0.65011793", "0.6444236", "0.6371939", "0.6175585", "0.61670697", "0.6091192", "0.60558474", "0.6046994", "0.6029014", "0.6015653", "0.6015653", "0.6015653", "0.6001069", "0.5999505", "0.5998459", "0.59639394", "0.595074", "0.59454554", "0.5927053", "0.5917083",...
0.7455086
0
Represents the SKU name and Azure pricing tier for auto scale vcore resource.
def __init__(__self__, *, name: pulumi.Input[str], capacity: Optional[pulumi.Input[int]] = None, tier: Optional[pulumi.Input[Union[str, 'VCoreSkuTier']]] = None): pulumi.set(__self__, "name", name) if capacity is not None: pulumi.set(__self_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sku(self) -> pulumi.Input['LabVirtualMachineSkuArgs']:\n return pulumi.get(self, \"sku\")", "def sku(self) -> 'outputs.SkuResponse':\n return pulumi.get(self, \"sku\")", "def sku(self) -> 'outputs.SkuResponse':\n return pulumi.get(self, \"sku\")", "def sku(self) -> pulumi.Output[Opti...
[ "0.6397462", "0.6185092", "0.6185092", "0.61596626", "0.61596626", "0.61365914", "0.61365914", "0.61365914", "0.6115369", "0.6080846", "0.60737026", "0.60672235", "0.60627735", "0.6009609", "0.5987054", "0.5974503", "0.5945736", "0.59370977", "0.59269834", "0.5881991", "0.585...
0.6079268
10
The name of the Azure pricing tier to which the SKU applies.
def tier(self) -> Optional[pulumi.Input[Union[str, 'VCoreSkuTier']]]: return pulumi.get(self, "tier")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tier(self) -> str:\n return pulumi.get(self, \"tier\")", "def tier(self) -> str:\n return pulumi.get(self, \"tier\")", "def tier(self) -> str:\n return pulumi.get(self, \"tier\")", "def tier(self) -> Optional[pulumi.Input[Union[str, 'CapacitySkuTier']]]:\n return pulumi.get(se...
[ "0.74537414", "0.74537414", "0.74537414", "0.7325683", "0.71198714", "0.71198714", "0.71198714", "0.71198714", "0.6988218", "0.6962749", "0.6909296", "0.6909296", "0.6909296", "0.67814505", "0.6616215", "0.66117364", "0.6606073", "0.6592861", "0.6582961", "0.6490839", "0.6457...
0.7168205
4
Represents the SKU name and Azure pricing tier for PowerBI Dedicated capacity resource.
def __init__(__self__, *, name: pulumi.Input[str], capacity: Optional[pulumi.Input[int]] = None, tier: Optional[pulumi.Input[Union[str, 'CapacitySkuTier']]] = None): pulumi.set(__self__, "name", name) if capacity is not None: pulumi.set(__se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tier(self) -> Optional[pulumi.Input[Union[str, 'CapacitySkuTier']]]:\n return pulumi.get(self, \"tier\")", "def __init__(__self__, *,\n name: pulumi.Input[Union[str, 'SkuName']],\n capacity: Optional[pulumi.Input[int]] = None):\n pulumi.set(__self__, \"name\", na...
[ "0.64945745", "0.62221", "0.6190194", "0.6179987", "0.6010515", "0.5955662", "0.58902156", "0.5887099", "0.5875179", "0.5875179", "0.58552575", "0.58552575", "0.58552575", "0.5816791", "0.5800199", "0.5800199", "0.5795297", "0.5785588", "0.57793325", "0.5766923", "0.572723", ...
0.62683606
1
The name of the Azure pricing tier to which the SKU applies.
def tier(self) -> Optional[pulumi.Input[Union[str, 'CapacitySkuTier']]]: return pulumi.get(self, "tier")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tier(self) -> str:\n return pulumi.get(self, \"tier\")", "def tier(self) -> str:\n return pulumi.get(self, \"tier\")", "def tier(self) -> str:\n return pulumi.get(self, \"tier\")", "def tier(self) -> Optional[pulumi.Input[Union[str, 'VCoreSkuTier']]]:\n return pulumi.get(self,...
[ "0.74537414", "0.74537414", "0.74537414", "0.7168205", "0.71198714", "0.71198714", "0.71198714", "0.71198714", "0.6988218", "0.6962749", "0.6909296", "0.6909296", "0.6909296", "0.67814505", "0.6616215", "0.66117364", "0.6606073", "0.6592861", "0.6582961", "0.6490839", "0.6457...
0.7325683
3
The type of identity that created the resource
def created_by_type(self) -> Optional[pulumi.Input[Union[str, 'IdentityType']]]: return pulumi.get(self, "created_by_type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type(self) -> pulumi.Input['ResourceIdentityType']:\n return pulumi.get(self, \"type\")", "def type(self) -> Optional[pulumi.Input['ResourceIdentityType']]:\n return pulumi.get(self, \"type\")", "def __init__(__self__, *,\n type: pulumi.Input['ResourceIdentityType']):\n ...
[ "0.8148963", "0.78868645", "0.70635116", "0.69625986", "0.69389886", "0.6919253", "0.68749785", "0.68562704", "0.68426025", "0.68401957", "0.67968535", "0.6709198", "0.6567779", "0.6534717", "0.6499503", "0.6499503", "0.64968115", "0.64939815", "0.64938736", "0.64938736", "0....
0.70667946
2
Prepare image for inputting to the neural network. Returns a Variable
def prep_image(img, inp_dim): orig_im = img dim = orig_im.shape[1], orig_im.shape[0] img = cv2.resize(orig_im, (inp_dim, inp_dim)) img_ = img[:, :, ::-1].transpose((2, 0, 1)).copy() img_ = torch.from_numpy(img_).float().div(255.0).unsqueeze(0) return img_, orig_im, dim
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess(self, img):\n img_ = image.load_img(img, target_size=(299, 299))\n img_ = image.img_to_array(img_)\n img_ = np.expand_dims(img_, axis=0)\n img_ = preprocess_input(img_)\n return img_", "def recreate_image(im_as_var):\n recreated_im = im_as_var.data.numpy()[0]\...
[ "0.6291087", "0.6211924", "0.62102467", "0.61973715", "0.6168404", "0.61643106", "0.6141072", "0.6129269", "0.61194193", "0.611416", "0.611372", "0.6100884", "0.6094138", "0.608152", "0.6079995", "0.60205805", "0.60117126", "0.5996601", "0.59671104", "0.59656924", "0.5960081"...
0.0
-1
Tests that missing any one key from the user data posted fails with 400
def test_new_user_400(self): # Missing First Name user1_body = deepcopy(self.test_user1_data) del(user1_body['first_name']) resp = self.app.post('/users', data=json.dumps(user1_body)) assert resp.status_code == 400 # Missing Last Name user1_body = deepcopy(self.t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_add_user_invalid_payload_keys(self):\n with self.client:\n auth_header = login_test_user(self.client)\n response = self.client.post('/users',\n data = json.dumps(dict(email=\"neilb14@mailinator.com\")),\n ...
[ "0.7554251", "0.72932285", "0.7279795", "0.72723067", "0.71933216", "0.716171", "0.71175796", "0.70061386", "0.6996025", "0.69694066", "0.6968272", "0.69630563", "0.69585073", "0.69489104", "0.69079036", "0.6860136", "0.68529314", "0.6832425", "0.6824387", "0.6823578", "0.682...
0.69779706
9
Tests that a user that doesn't exist returns a 404
def test_get_user_404(self): resp = self.app.get('/users/thisuserdoesntexist') assert resp.status_code == 404
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_returns_404_if_user_doesnt_exist(self):\n # Act\n response = self.client.get(\"/api/v2/projects/queries/non_existent/touched/\")\n self.assertEqual(response.status_code, 404)", "def test_user_does_not_exist(self):\n url = reverse('main_app:user', args=('non-exist',))\n ...
[ "0.82909423", "0.80781746", "0.8067143", "0.80344105", "0.8026084", "0.79801977", "0.7955119", "0.7949028", "0.7929052", "0.79283255", "0.7866859", "0.7822871", "0.781219", "0.7742023", "0.7716419", "0.75792724", "0.74672526", "0.74584144", "0.74392503", "0.7436096", "0.74182...
0.84734124
0
Tests that when trying to modify a nonexistent user we get a 404
def test_modify_userid_404(self): resp = self.app.put('/users/thisuserdoesntexist', data=json.dumps(self.test_user1_data)) assert resp.status_code == 404
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_admin_cannot_update_non_existant_user(self):\n resp = self.admin_create_user()\n reply = self.admin_login()\n token = reply['token']\n user = dict(\n name='Summer Lover',\n username='lover',\n password='Andela8',\n role='attendant'\n ...
[ "0.80791336", "0.7793836", "0.7548771", "0.74550146", "0.735786", "0.7355865", "0.73304707", "0.7281025", "0.7255825", "0.72530854", "0.7241713", "0.71721184", "0.71450764", "0.71310496", "0.7126637", "0.7119815", "0.7110728", "0.7093198", "0.7079226", "0.70180565", "0.701348...
0.82456356
0
Add 2 users and then get a list of the group and validate that the users id's are listed.
def test_list_group_by_id(self): # First add our users resp = self.app.post('/users', data=json.dumps(self.test_user1_data)) assert resp.status_code == 200 resp = self.app.post('/users', data=json.dumps(self.test_user2_data)) assert resp.status_code == 200 # Finally lis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addusers(self, args):\n\n if len(args) < 2:\n print(self.addusers.__doc__)\n return\n\n gname = args[0]\n users = args[1:]\n\n g = sr.group(gname)\n\n if not g.in_db:\n print(\"Group '%s' not found.\" % ( gname ))\n return\n\n ...
[ "0.7135346", "0.70465624", "0.68428904", "0.67087233", "0.66598034", "0.66263545", "0.65692943", "0.6516007", "0.6515337", "0.6515337", "0.6505455", "0.6495061", "0.64665663", "0.6396052", "0.63959", "0.6373419", "0.6368878", "0.6368683", "0.6333648", "0.63327134", "0.6306397...
0.71590555
0
List a group that doesn't exist and verify we get a 404
def test_list_group_404(self): resp = self.app.get('/groups/thisgroupdoesntexist') assert resp.status_code == 404
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_request_groups_group_invalid(self):\n response = requests.get(self.url + '/groups/invalid')\n\n self.assertEqual(response.status_code, 404)", "def test_request_users_user_groups_group_invalid(self):\n response = requests.get(self.url + '/users/John/groups/invalid')\n\n self.a...
[ "0.7774043", "0.75462633", "0.753216", "0.73978347", "0.71797293", "0.714727", "0.69573426", "0.685586", "0.68081933", "0.67371356", "0.6726002", "0.67140925", "0.66166556", "0.66166556", "0.6585218", "0.6509553", "0.64960045", "0.647395", "0.64472705", "0.6426248", "0.642473...
0.88085765
0
Checking the get_report function when the server responds with the HTTP code 404.
def test_get_report_wrong_object_id(self): vt_analyses = VirusTotalAPIAnalyses('test_api_key') vt_analyses.get_report('test_object_id') http_err = vt_analyses.get_last_http_error() self.assertEqual(http_err, vt_analyses.HTTP_NOT_FOUND_ERROR)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handleStatus_404(self):\n log.err('HTTP Error 404')", "def report_404(self):\n self.send_response(404)\n response = 'No such page'\n self.send_header(\"Content-type\", \"text/plain\")\n self.send_header(\"Content-length\", str(len(response)))\n self.end_headers()\n ...
[ "0.7263844", "0.72396004", "0.7156216", "0.6825958", "0.67625475", "0.6751735", "0.6746414", "0.66881996", "0.667067", "0.66271216", "0.66230804", "0.65937316", "0.655799", "0.65512186", "0.6503749", "0.64787656", "0.6468704", "0.64611244", "0.6452675", "0.64436865", "0.64248...
0.63324
30
Changes the page number to +1 of the current. Changes to first page if the current page is the last. Updates the menu once the page number is changed.
async def next_page(self): if self.page_num == len(self.pages): self.page_num = 1 # Loop around to the first item else: self.page_num += 1 return await self.update()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_page(self, direction):\r\n if direction == \"right\":\r\n self.model.increment_page()\r\n else:\r\n self.model.decrement_page()", "def set_page(self, current, previous):\n widget_num = self._option_panel.currentIndex().row()\n self._window.widget_stack...
[ "0.6941455", "0.66133744", "0.65431905", "0.64464843", "0.64318866", "0.64028287", "0.6362106", "0.6333024", "0.6239957", "0.61295563", "0.61176145", "0.6114391", "0.60273105", "0.60270476", "0.5918277", "0.59143305", "0.59026486", "0.5885499", "0.58568245", "0.5818222", "0.5...
0.5641418
28
Changes the page number to 1 of the current. Changes to last page if the current page is the first. Updates the menu once the page number is changed.
async def prev_page(self): if self.page_num == 1: self.page_num = len(self.pages) # Loop around to the last item else: self.page_num -= 1 return await self.update()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_page(self, direction):\r\n if direction == \"right\":\r\n self.model.increment_page()\r\n else:\r\n self.model.decrement_page()", "def set_page(self, current, previous):\n widget_num = self._option_panel.currentIndex().row()\n self._window.widget_stack...
[ "0.66804713", "0.6550282", "0.646217", "0.6435431", "0.64079106", "0.62502944", "0.62228054", "0.6131655", "0.6109933", "0.6088721", "0.5992878", "0.59488875", "0.5948684", "0.59177756", "0.5778423", "0.57779694", "0.5757294", "0.57274425", "0.5677651", "0.5597443", "0.557746...
0.581488
14
Match if a reaction fits the described context. This will ignore reactions added by the bot user, regardless of whether or not ``user`` is supplied.
def same_context( cls, message: Optional[discord.Message] = None, user: Optional[discord.abc.User] = None ) -> "ReactionPredicate": # noinspection PyProtectedMember me_id = message._state.self_id return cls( lambda self, r, u: u.id != me_id ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yes_or_no(\n cls, message: Optional[discord.Message] = None, user: Optional[discord.abc.User] = None\n ) -> \"ReactionPredicate\":\n same_context = cls.same_context(message, user)\n\n def predicate(self: ReactionPredicate, r: discord.Reaction, u: discord.abc.User) -> bool:\n ...
[ "0.6244396", "0.6180074", "0.55531955", "0.552664", "0.550181", "0.5489412", "0.5161011", "0.50214386", "0.50063515", "0.499949", "0.49568933", "0.49260676", "0.49253622", "0.4924516", "0.4912638", "0.49043176", "0.49036583", "0.49024576", "0.48968327", "0.48864415", "0.48842...
0.66514385
0
Set up the StarLine sensors.
async def async_setup_entry( hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback ) -> None: account: StarlineAccount = hass.data[DOMAIN][entry.entry_id] entities = [ sensor for device in account.api.devices.values() for description in BINARY_SENSOR_TYPES ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _setup_sensor ( self ):\n self.spectral = Spectral ( np.array([500, 610, 780, 1580.] ),\n np.array([590, 680, 890, 1750.] ) )", "def _setup_sensor ( self ):\n self.spectral = Spectral ( np.array([450, 520, 630, 770., 1550, 2090.] ),\n ...
[ "0.67339486", "0.67245114", "0.6505229", "0.6418364", "0.63864964", "0.631829", "0.6202428", "0.6157293", "0.6095775", "0.6084087", "0.6081323", "0.6044921", "0.59957916", "0.5995115", "0.5993292", "0.5906404", "0.5903841", "0.5876667", "0.583211", "0.5825604", "0.58131915", ...
0.0
-1
Return the state of the binary sensor.
def is_on(self): return self._device.car_state.get(self._key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state(self):\n return self.device.device_data[self.device_id][self._sensor_type]", "def get_state(self, channel=None):\n return bool(self.getBinaryData(\"SENSOR\", channel))", "def state(self):\n return self.device.value()", "def state(self):\n return self._device.value", "d...
[ "0.7744212", "0.75481385", "0.73658836", "0.72488993", "0.71698236", "0.7155136", "0.7144651", "0.7082685", "0.7070446", "0.7046846", "0.70173615", "0.7011563", "0.7011563", "0.7006789", "0.696577", "0.6948849", "0.69346416", "0.6892984", "0.68836015", "0.6883084", "0.6823216...
0.0
-1
Initializes ConditionalAffineCoupling with the given parameters. This function initializes a ConditionalAffineCoupling block with a given mask, scaling, and shifting network. Note that there are certain
def __init__(self, mask, scale, shift): super(ConditionalAffineCoupling, self).__init__() self.s = scale self.t = shift self.mask = nn.Parameter(mask, requires_grad=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, num_blocks=3, layers_per_block=2, base_num_channels=16,\n upconv=False, fc_layer_sizes=None, upconv_reshape_size=None,\n conditioning_layer_sizes=None, channels_out=3, alpha=0.3,\n conditioning_postprocessing=None,\n final_sigmoid=False, co...
[ "0.62911767", "0.58043766", "0.5732861", "0.56629884", "0.56483656", "0.56291604", "0.55866253", "0.5567616", "0.5553368", "0.5452478", "0.54477096", "0.5446045", "0.54404014", "0.5369349", "0.53468543", "0.5323843", "0.5302394", "0.52924734", "0.5290778", "0.5280227", "0.527...
0.79103297
0
Initialize a LVQ network.
def __init__(self, x, y, n_classes, n_neurons, p_vectors, epsilon=0.9, epsilon_dec_factor=0.001): self.x = x self.y = y self.n_classes = n_classes self.n_neurons = n_neurons self.epsilon = epsilon self.epsilon_dec_factor = epsilon_dec_factor self.p_vectors = p_vec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialise_network(self):\n raise NotImplementedError", "def _init_networks(self, state_dict: OrderedDict):\n self.dqn = Brain(self.backbone_cfg, self.head_cfg).to(self.device)\n self.dqn.load_state_dict(state_dict)\n self.dqn.eval()", "def initialize_network(self):\n sel...
[ "0.6546541", "0.610159", "0.6081403", "0.60727036", "0.6028266", "0.60152817", "0.6004878", "0.5991067", "0.5956415", "0.59310716", "0.5920666", "0.5911234", "0.5882416", "0.5876247", "0.5873226", "0.58470243", "0.5842907", "0.5834719", "0.5829388", "0.5820244", "0.58133394",...
0.0
-1
Find the closest prototype vector for a given vector
def find_closest(self, in_vector): proto_vectors = self.p_vectors closest = None position = () closest_distance = 9999999 for i in range(proto_vectors.shape[0]): for j in range(proto_vectors.shape[1]): distance = np.linalg.norm(in_vector - proto_vector...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_nearest(self, vector, limit):\n raise NotImplementedError", "def find_runnerup(self, in_vector):\n proto_vectors = self.p_vectors\n closest_p_vector = self.find_closest(in_vector)\n runnerup = closest_p_vector\n closest_distance = 99999\n for i in range(proto_vec...
[ "0.6764927", "0.6558223", "0.62386656", "0.6172993", "0.6152886", "0.60871017", "0.60782313", "0.6070341", "0.60566515", "0.6037154", "0.60181046", "0.5977756", "0.5954397", "0.5938408", "0.5929677", "0.59181666", "0.58802617", "0.58418083", "0.58237374", "0.5793803", "0.5790...
0.71599925
0
Pops the number, removing exponents, then numbers after decimal, the decimal and then the numbers before the decimal. This function returns true when the string representation of the number is "".
def popNumber(self): # first remove the exponent part if(self.exponent != None): # if the exponent number is empty then the exponent can be set to none if(self.exponent.popNumber()): self.exponent = None # if there is a decimal part elif(self.decimal): # if there are no numbers after the deci...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_number_repl_isnumeric(s):\n return s.replace('.', '', 1).isnumeric()", "def isnum(self, x):\n\n return x in '1234567890.-'", "def is_number_repl_isdigit(s):\n return s.replace('.', '', 1).isdigit()", "def del_decim_zeros(num):\r\n \r\n if \".\" in num: \r\n \r\n num_z...
[ "0.6353783", "0.61327624", "0.6119294", "0.6107495", "0.60994023", "0.60976213", "0.6026594", "0.5890923", "0.5882494", "0.58501697", "0.58359104", "0.579612", "0.5792416", "0.5791446", "0.5747672", "0.57423365", "0.57376283", "0.5734749", "0.5732852", "0.5730318", "0.5729788...
0.76789564
0
Returns a string that is guaranteed to be parseable by Decimal. Unless the trimZero flag is set to true. trimZero flag trims the leading zero after the decimal (if the zero was not set explicitly). ie 1.0 will be 1. with the flag set to true
def getNumber(self, trimZero = False): # if there is nothing in the number part add a 0 but take care of the # trimZero flag if(self.number == ""): # if trimZero empty string else a 0 if(trimZero): rtn = "" else: rtn = "0" # else add the number string else: rtn = self.number # if t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adapt_decimal(value: t.Any) -> str:\n return str(value)", "def decimal_to_string(value, max_digits=16, decimal_places=0):\n\n # Handle sign separately.\n if value.is_signed():\n sign = u'-'\n value = abs(value)\n else:\n sign = u''\n\n # Let Django quantize and cast to a s...
[ "0.61502624", "0.60526973", "0.60526973", "0.58249366", "0.58072895", "0.570158", "0.56529593", "0.5551596", "0.55464244", "0.55271554", "0.54681396", "0.545652", "0.5413278", "0.54048294", "0.5378782", "0.5321633", "0.52983654", "0.5295608", "0.52770054", "0.5268425", "0.525...
0.6266069
0
Centers an axis system on the page.
def centerAxis(): dislin.center()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def center(self):\n return self.pos + self.axis / 2.0", "def center_mario(self):\n self.rect.midbottom = self.screen_rect.midbottom\n self.x, self.y = float(self.rect.x), float(self.rect.y)", "def center(self):\n cp = self.dat.flowsheet.getCenter()\n self.centerOn(cp[0], cp[1...
[ "0.64558285", "0.64227384", "0.6384967", "0.6289737", "0.61779404", "0.61489534", "0.6041031", "0.6038445", "0.60261756", "0.6020941", "0.6001075", "0.598041", "0.5979693", "0.59539235", "0.5951527", "0.59387547", "0.58902407", "0.5882902", "0.5882783", "0.58723694", "0.58652...
0.8125894
0
Sets number of ticks between labels on axes.
def setTickNumber(n=2, axes='XYZ'): dislin.ticks(n, axes)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_ticks(axis, labelsize):\n axis.get_xaxis().set_tick_params(\n which='both', direction='in', width=1.5, labelrotation=0, labelsize=labelsize)\n axis.get_yaxis().set_tick_params(\n which='both', direction='in', width=1.5, labelcolor='k', labelsize=labelsize)\n # axis.grid(color='r',...
[ "0.7057402", "0.7000445", "0.68007857", "0.67522424", "0.66929007", "0.6654263", "0.6627008", "0.6470452", "0.64382064", "0.6424182", "0.6422453", "0.64185786", "0.63970935", "0.63936806", "0.63610846", "0.6360201", "0.630874", "0.6287962", "0.62434477", "0.6241309", "0.62274...
0.7633505
0
Defines the orientation of axis labels.
def setLabelOrientation(orientation='horizontal',axes='XYZ'): orientdict = {'horizontal':'HORI', 'vertical':'VERT'} dislin.labtyp(orientdict[orientation],axes)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotate_lables_for_xaxis(self, axes, angle=50, alignment='center') : # 'right'\n for label in axes.get_xticklabels() :\n label.set_rotation(angle)\n label.set_horizontalalignment(alignment)", "def AUTO(cls, labels: List[str]):\n # only one: put in the upper center like a title....
[ "0.6883156", "0.651623", "0.6498403", "0.6333933", "0.6186594", "0.6070605", "0.6003084", "0.5972011", "0.5890482", "0.5883455", "0.5868942", "0.58213955", "0.5769059", "0.5768544", "0.5745126", "0.5730258", "0.57283074", "0.5724076", "0.57221514", "0.5691617", "0.5675159", ...
0.816958
0
Defines how axis labels are drawn relative to ticks.
def setLabelPosition(position='ticks', axes='XYZ'): pdict = {'ticks':'TICKS', 'center':'CENTER', 'shift':'SHIFT'} dislin.labpos(pdict[position], axes)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_manual_ticklabels(self):\n fix_text_kerning_factor()\n\n fig = plt.figure()\n ax = fig.add_subplot(projection='ternary')\n\n # Specify tick positions manually.\n ticks = [0.0, 0.2, 0.4, 0.6, 0.8, 1.0]\n labels = [\"0/5\", \"1/5\", \"2/5\", \"3/5\", \"4/5\", \"5/5\...
[ "0.7481456", "0.74091786", "0.7122601", "0.69440246", "0.6895783", "0.678056", "0.6735376", "0.67268115", "0.6654346", "0.66427684", "0.66255754", "0.6601079", "0.6544108", "0.6541293", "0.653788", "0.6534185", "0.65252644", "0.64922184", "0.6479907", "0.64746267", "0.647328"...
0.64992297
17
Sets number of digits after the decimal point for axis labels.
def setLabelDigits(digits=1, axes='XYZ'): dislin.labdig(digits, axes)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_sig_figs(n):\n u.default_format = '.' + str(n) + 'g'\n pd.options.display.float_format = ('{:,.' + str(n) + '}').format", "def xaxis(self,label,units):\n if units != \"\": label = label + \" (\" + units + \")\"\n self.subplot.set_xlabel(label)\n pass", "def setTickNumber(n=2,...
[ "0.62567365", "0.6012108", "0.5952361", "0.5930312", "0.58845496", "0.58520585", "0.58263785", "0.5815189", "0.57554847", "0.57302177", "0.5717137", "0.5695293", "0.562604", "0.56173635", "0.55970675", "0.55856735", "0.55413324", "0.5518758", "0.55081236", "0.550019", "0.5492...
0.7400071
0
Sets the color(index) for axis labels.
def setAxisLabelColor(idx=-1, axes='XYZ'): dislin.axclrs(idx, 'LABELS', axes)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setAxisTickColor(idx=-1, axes='XYZ'):\n dislin.axclrs(idx, 'TICKS', axes)", "def setAxisNameColor(idx=-1, axes='XYZ'):\n dislin.axclrs(idx, 'Name', axes)", "def color_axis(self, name, color):\n\n axis = self._find_axis(name)\n axis.axis_line_color = color\n axis.axis_label_text_c...
[ "0.7852956", "0.7369911", "0.7262369", "0.7098501", "0.6788984", "0.67217046", "0.6541143", "0.64582837", "0.63545763", "0.62810284", "0.62428975", "0.61535394", "0.6079193", "0.6009118", "0.59759986", "0.5922963", "0.5913193", "0.58557695", "0.5851749", "0.57989407", "0.5787...
0.8641924
0
Plots a secondary Y axis. See YAXIS in DISLIN docs.
def secondaryYaxis(low,high,first,step,length,name,direction,x,y,log=0): if log: dislin.yaxlg(low,high,first,step,length,name,direction,x,y) else: dislin.yaxis(low,high,first,step,length,name,direction,x,y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def secondYAxis(requestContext, seriesList):\n for series in seriesList:\n series.options['secondYAxis'] = True\n series.name= 'secondYAxis(%s)' % series.name\n return seriesList", "def __draw_yaxis(self):\n self.ax.set_ylim(self.ylims)\n # set y ticks\n yticks = [*range(0, self.ymax...
[ "0.7232795", "0.7205425", "0.6943629", "0.69286036", "0.6905965", "0.68915266", "0.68915266", "0.6728691", "0.6720614", "0.6630811", "0.6547092", "0.6488742", "0.6426889", "0.6336209", "0.6315274", "0.6306608", "0.6104372", "0.60255235", "0.5970738", "0.59488374", "0.59381574...
0.7966972
0
Sets the justification of text.
def setTextJustification(justify='left'): dislin.txtjus(justdict[justify])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setLabelJustification(justify='auto', axes='XYZ'):\n ldict = {'auto':'AUTO', 'left':'LEFT','right':'RIGHT',\\\n 'outward':'OUTW','inward':'INWA'}\n dislin.labjus(ldict[justify],axes)", "def textalign(text, maxlength, align='left'):\n if align == 'left':\n return text\n elif ...
[ "0.6239393", "0.598961", "0.5877558", "0.5700544", "0.56812006", "0.56617534", "0.56531847", "0.55499697", "0.553489", "0.5508394", "0.5482425", "0.5480239", "0.5418947", "0.5375295", "0.5364213", "0.5343514", "0.531818", "0.531112", "0.53097314", "0.52873176", "0.519898", ...
0.78942156
0
Sets the thickness of DISLIN curves.
def setCurveWidth(w): dislin.thkcrv(w)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setLineWidth(w=1):\n dislin.linwid(w)", "def thickness(self, new_thickness):\n self._thickness = new_thickness", "def set_line_thickness(thickness):\r\n global _current_line_thickness\r\n _current_line_thickness = thickness", "def linewidth(self, size: float):\n for line in self.ax...
[ "0.7238662", "0.7176923", "0.71545905", "0.66181976", "0.6310803", "0.62844306", "0.6253668", "0.6170529", "0.5875727", "0.5801131", "0.5754583", "0.55403847", "0.55327505", "0.5489436", "0.54420143", "0.5388134", "0.5302602", "0.53019524", "0.52769446", "0.519346", "0.513012...
0.6554986
4
Draws a shaded region between two curves.
def drawShadedCurve(x0list,y0list,x1list,y1list): dislin.shdcrv(x0list,y0list,len(x0list),x1list,y1list,len(x1list))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _plot_ribbon_using_bezier(ax, zorder, points1, points2, color1=\"gray\",\n color2=\"gray\", lw=1):\n cc = ColorConverter()\n color1 = np.array(cc.to_rgba(color1))\n color2 = np.array(cc.to_rgba(color2))\n tRange = np.linspace(0, 1, 100)\n xpointsList = []\n ypoint...
[ "0.6258697", "0.61287975", "0.59623253", "0.59399796", "0.5868823", "0.5866544", "0.5813893", "0.57368374", "0.569798", "0.56729186", "0.5603942", "0.55640197", "0.55488276", "0.5516693", "0.54875696", "0.54536015", "0.5414382", "0.54121083", "0.53685546", "0.5356691", "0.534...
0.74347794
0
Draws ellipse at x,y with given radii (a,b).
def drawEllipse(x,y,a,b,ucoords=1): if ucoords: dislin.rlell(x,y,a,b) else: dislin.ellips(x,y,a,b)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ellipse(x,y,a,b):\n return ((x/float(a))**2 + (y/float(b))**2)", "def plot_ellipse(x, y, a, b, angle, color=\"-r\", ax=None, **kwargs):\n\n t = np.arange(0, 2 * math.pi + 0.1, 0.1)\n px = [a * math.cos(it) for it in t]\n py = [b * math.sin(it) for it in t]\n fx = rot_mat_2d(angle) @ (np.array(...
[ "0.8293012", "0.75712687", "0.7360903", "0.7196251", "0.7152272", "0.71346086", "0.70385295", "0.703583", "0.7012867", "0.7004574", "0.69852793", "0.69659996", "0.69352895", "0.69249004", "0.68825567", "0.682254", "0.67835987", "0.6783489", "0.6778383", "0.67413014", "0.66953...
0.7850261
1
Draw pie slice at x,y with given radius and angles.
def drawPie(x,y,radius,alpha,beta,ucoords=1): if ucoords: dislin.rlpie(x,y,radius,alpha,beta) else: dislin.pie(x,y,radius,alpha,beta)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_pie(self, xy, startangle, endangle, **options):\n #TEMPORARY DISABLING TRANSFORM TO AVOID DEFORMED PIE\n options = self._check_options(options)\n x,y = xy\n x,y = self.coord2pixel(x,y)\n fillsize = options[\"fillsize\"]\n bbox = [x-fillsize, y-fillsize, x+fillsize...
[ "0.70082575", "0.67785317", "0.6615501", "0.6615501", "0.62536526", "0.61855865", "0.59680426", "0.59568226", "0.5949198", "0.59007335", "0.5850754", "0.58333856", "0.5820742", "0.5760923", "0.57440895", "0.5716906", "0.56882626", "0.5675637", "0.5670149", "0.56667554", "0.56...
0.66493344
2
Draw elliptical arc centered at x,y.
def drawEllipticArc(x,y,a,b,alpha,beta,theta,ucoords=1): if ucoords: dislin.rlarc(x,y,a,b,alpha,beta,theta) else: dislin.arcell(x,y,a,b,alpha,beta,theta)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DrawEllipticArc(*args, **kwargs):\n return _gdi_.DC_DrawEllipticArc(*args, **kwargs)", "def DrawEllipticArc(*args, **kwargs):\n return _gdi_.PseudoDC_DrawEllipticArc(*args, **kwargs)", "def draw_arc(ax, center, height, width, theta1=0, theta2=numpy.pi, color='k', direction='down',\n ...
[ "0.73173076", "0.7286225", "0.6853219", "0.6711925", "0.6683983", "0.6679631", "0.66764736", "0.65502155", "0.6542193", "0.65346473", "0.6500627", "0.64517057", "0.64164555", "0.6384246", "0.63566864", "0.63390183", "0.6314392", "0.6284831", "0.6280618", "0.6262385", "0.62385...
0.685259
3
Sets thickness and viewing angle for 3D pie graphs.
def setPieOptions3D(thickness=0.2, angle=45.0): dislin.pieopt(thickness, angle)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setViewAngle3D(ang):\n dislin.vang3d(ang)", "def _create_orientation_widget(self, view3d):\n view3d._orientation_widget = vtk.vtkOrientationMarkerWidget()\n \n view3d._axes_actor = vtk.vtkAxesActor()\n view3d._orientation_widget.SetOrientationMarker(view3d._axes_actor)\...
[ "0.63896483", "0.55866605", "0.5569669", "0.5434257", "0.5410274", "0.5324832", "0.523416", "0.5227206", "0.52259475", "0.5216563", "0.5165523", "0.51584786", "0.5147232", "0.5132571", "0.50811416", "0.507107", "0.5061344", "0.5045402", "0.5019843", "0.50186193", "0.5016402",...
0.7749536
0
Add a line to a DISLIN legend.
def addLegendLine(line,n): dislin.leglin(' ',line,n)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _line_for_legend():\n points = [\n [0, 0, 0],\n [0.4, 0, 0],\n [0.4, 0.07, 0],\n [0, 0.07, 0],\n [\n 0.5,\n 0,\n 0,\n ], # last point needed to expand the bounds of the PolyData to be rendered smaller\n ]\n legendface = pyvist...
[ "0.7054781", "0.6546146", "0.6422617", "0.6421417", "0.61775714", "0.61632013", "0.6156001", "0.61404085", "0.60655415", "0.606483", "0.60394263", "0.60367185", "0.60274994", "0.5990008", "0.5984628", "0.5983929", "0.5958868", "0.59069854", "0.5899192", "0.5877321", "0.587319...
0.7667894
0
Sets the lengths of axes in absolute 3D coordinates. See DISLIN manual.
def setAxisLengths3D(x=2.,y=2.,z=2.): dislin.axis3d(x,y,z)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setColorAxisLengths(x,y,z):\n dislin.ax3len(x,y,z)", "def axes(self,a_len,c_len):\n self.a = np.array([a_len,0,0])\n self.b = np.array([0,b_len,0])\n self.c = np.array([0,0,c_len])", "def set_equal_3d_axis(ax, x_lims, y_lims, z_lims):\n x_lims = np.asarray(x_lims)\n y_lims = n...
[ "0.70362484", "0.65221095", "0.6464415", "0.63611263", "0.61208653", "0.6100159", "0.57764566", "0.57535005", "0.5752645", "0.56208295", "0.5587701", "0.5576162", "0.55707467", "0.55322504", "0.55215234", "0.54461443", "0.54030526", "0.5400173", "0.53441256", "0.53363657", "0...
0.78242296
0
Defines whether clipping is done in world or eye coordinate system.
def setClipping3D(system='world', eyevalues=(1,-1)): cdict = {'world':'WORLD','eye':'EYE'} dislin.clip3d(cdict[system]) if system == 'eye': dislin.vclp3d(eyevalues[0],eyevalues[1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clipping(self):\n\n return self._clipping", "def inCamp(self):\n return (((self.myTeam==1) and (self.ballPos.x <= self.width/2))\n | ((self.myTeam==2) and (self.ballPos.x >= self.width/2)))", "def clip(self):\r\n\t\treturn self._clip", "def is_building_eye(self):\r\n pass"...
[ "0.5930985", "0.5756165", "0.5747981", "0.5697391", "0.55847424", "0.5568802", "0.5521892", "0.5466913", "0.54338664", "0.53368056", "0.5331143", "0.5310752", "0.5273903", "0.5264422", "0.5247612", "0.52418727", "0.5220771", "0.5179653", "0.5152023", "0.51403534", "0.5109186"...
0.6020735
0
Sets additional mesh/grid lines for surfaces.
def setSurfaceMeshing(state='off',shading=1): sdict = {'off':'OFF','on':'ON'} val = sdict[state] if not shading: val = 'ONLY' dislin.surmsh(val)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_lines(self, line_cells):\n for cell in line_cells:\n self.surface.set_at(cell.tuple('2D'), YELLOW)", "def setup_lines(self):\n self.center_lines()\n self.space_lines()", "def update_lines(num, ax, fargs):\n \n dataLines, lines = fargs\n for line, data in zip(...
[ "0.6376066", "0.6282291", "0.61807626", "0.6178779", "0.61043733", "0.60533255", "0.6030115", "0.59003764", "0.5877362", "0.58016574", "0.5799771", "0.574227", "0.56685656", "0.5645267", "0.56225187", "0.55958265", "0.5572437", "0.55027455", "0.54961675", "0.5477361", "0.5459...
0.0
-1
Draws 3D surface from a 2D array. Assumes linear grid in X,Yplane.
def drawRegularSurface(matrix, nx, ny, xinterp, yinterp): dislin.surmat(matrix, nx, ny, xinterp, yinterp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_surface(self):\n X, Y = np.meshgrid(self.x, self.y)\n fig = plt.figure()\n ax = fig.add_subplot(111, projection='3d')\n ax.plot_surface(X=X, Y=Y, Z=self.z)\n plt.show()", "def plotSurface(X):\n from mpl_toolkits.mplot3d import Axes3D\n from mpl_toolkits.mplot3d i...
[ "0.68184465", "0.6796497", "0.6357092", "0.63262", "0.6324711", "0.62669253", "0.6257041", "0.62112117", "0.62090564", "0.6149332", "0.60560334", "0.6056032", "0.60307413", "0.60003704", "0.59632593", "0.59547114", "0.59140605", "0.5904409", "0.58869874", "0.5850259", "0.5834...
0.56377304
27
Draws 3D surface from arbitrary x,y,z lists. z can be a matrix.
def drawIrregularSurface(xlist, ylist, zmatrix): dislin.surfce(xlist, len(xlist), ylist, len(ylist), zmatrix)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drawCurve3D(xlist, ylist, zlist):\n dislin.curv3d(xlist,ylist,zlist,len(xlist))", "def drawVector3D(x0,y0,z0,x1,y1,z1, vtype='normal'):\n dislin.vectr3(x0,y0,z0,x1,y1,z1, vectordict[vtype])", "def drawLine3D(x0,y0,z0,x1,y1,z1):\n dislin.strt3d(x0,y0,z0)\n dislin.conn3d(x1,y1,z1)", "def three_...
[ "0.77527666", "0.6590606", "0.65253764", "0.6494141", "0.64780486", "0.6436425", "0.6424919", "0.64208055", "0.63680226", "0.6343612", "0.6311053", "0.6298842", "0.6277188", "0.6254296", "0.62348866", "0.6220534", "0.62138736", "0.6204748", "0.62014693", "0.6187313", "0.61385...
0.65211
3
Setup 2D Plane in 3D space.
def initializePlane3D(ll = (-1,-1,0), lr=(1,-1,0), ur=(1,1,0)): x0,y0,z0 = ll x1,y1,z1 = lr x2,y2,z2 = ur dislin.grfini(x0,y0,z0,x1,y1,z1,x2,y2,z2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def planes_3d(self, quantity, xplane, yplane):\n xplane = int(xplane)\n yplane = int(yplane)\n # Get the scalar values\n # Get the data on the plane with a fixed x value. These means we'll\n # have changing (y, z) points\n xdata = self.get_plane(quantity, 'yz', xplane)\n ...
[ "0.68266565", "0.6796529", "0.65089524", "0.6302284", "0.62422013", "0.62178", "0.61750567", "0.61688626", "0.6167553", "0.6106322", "0.60887325", "0.60859686", "0.6047372", "0.6027371", "0.6021497", "0.6003645", "0.60005385", "0.59458524", "0.589884", "0.58838016", "0.583242...
0.631499
3
Terminate 2D Plane in 3D space.
def terminatePlane3D(): dislin.grffin()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fadePlane(self):\n global circle_group\n circle_group = VGroup()\n\n self.play(FadeOut(number_plane_1))\n\n circle_group.add(circ_main, dot_circ, line_circ, dot_center,\n graph_upper, graph_lower,\n radius_horiz, radius_horiz_end_dot, radius_ang...
[ "0.58465266", "0.5783493", "0.57229847", "0.5693966", "0.56858575", "0.56513643", "0.5619072", "0.5614788", "0.5527087", "0.5468394", "0.542427", "0.5417867", "0.53747195", "0.53730536", "0.5338504", "0.533342", "0.5321568", "0.53099513", "0.5300533", "0.5290572", "0.52896154...
0.74492985
0
Returns True if valid combination of fixes for anchor.
def is_valid(self) -> bool: if self.total <= 1: # Definitely valid (i.e. no conflict) if 0 or 1. In practice, this # function probably won't be called if there are 0 fixes, but 0 is # valid; it simply means "no fixes to apply". return True if self.total ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_anchor_valid(self):\n return self.properties.get('IsAnchorValid', None)", "def check_num_anchors(self):\n return True", "def isAnchor(node):\n # TODO What is considered an anchor needs to be subject to an option\n return bool((isinstance(node, nodes.target)\n ...
[ "0.6337271", "0.6212023", "0.6119893", "0.5860019", "0.5819181", "0.5799705", "0.57556474", "0.5607142", "0.55466485", "0.55404973", "0.5537109", "0.5479701", "0.5465979", "0.54495734", "0.54336065", "0.5415598", "0.5384235", "0.5369184", "0.536886", "0.53444546", "0.5322155"...
0.59751636
3
Samples a random unit vector assuming an isotropic distribution. Returns a list with x, y, z vector composants.
def sample_direction(): gamma = random.random() mu = 2*gamma-1 gamma = random.random() phi = 2*np.pi*gamma direction = [np.sqrt(1-mu**2)*np.cos(phi), np.sqrt(1-mu**2)*np.sin(phi), mu] return direction
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rand_unit_vect_3D():\n xyz = np.random.normal(size=3)\n mag = sum(i**2 for i in xyz) ** .5\n return xyz / mag", "def random_vector_in_unit_ball():\n x = np.random.normal(loc=0.0, scale=1.0, size=(numSamples, self.dim))\n z = np.random.exponential(scale=1.0, size=(numSamples,))\...
[ "0.72459126", "0.70445895", "0.6959826", "0.67074734", "0.6280898", "0.62351114", "0.6162257", "0.61311173", "0.61082554", "0.6028786", "0.600238", "0.59181285", "0.59127164", "0.5907352", "0.590679", "0.58830285", "0.5856221", "0.58490837", "0.5781606", "0.57403296", "0.5706...
0.54196167
47
Determines the interaction type given the macroscopic cross sections. Returns a string identifying the interaction type. mu = total cross section tau = photoelectric absorption cross section sigma_c = compton cross section sigma_r = rayleigh cross section kappa = pair production cross section
def interaction_type(mu=mu, tau=tau, sigma_c=sigma_c, sigma_r=sigma_r, kappa=kappa): gamma = random.random() if gamma <= tau/mu: return "photoelectric absorption" elif (gamma > tau/mu) and (gamma <= tau/mu + sigma_c/mu): return "compton" elif (gamma > tau/mu + sigma_c/mu) and (gamm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fancy_section_type(section):\n return {\n 'LEC': 'Lecture',\n 'LAB': 'Laboratory',\n 'TUT': 'Tutorial',\n 'PRA': 'Practicum',\n 'COR': 'Correspondence',\n 'SEM': 'Seminar',\n 'ONL': 'Online',\n }.get(section, section)", "def _cim_scope_code_type():\n ...
[ "0.49093765", "0.48003057", "0.46996796", "0.46830466", "0.46598744", "0.45934376", "0.454066", "0.45354116", "0.451613", "0.45100072", "0.4461128", "0.44545034", "0.44532928", "0.4437124", "0.44282544", "0.44203833", "0.44116604", "0.4408824", "0.4381297", "0.43694264", "0.4...
0.6893936
0
To make it possible to vary the width, we need to override the constructor of the torchvision resnet.
def __init__(self, block, layers, num_classes=1000, width=64): torch.nn.Module.__init__(self) # Skip the parent constructor. This replaces it. self._norm_layer = torch.nn.BatchNorm2d self.inplanes = width self.dilation = 1 self.groups = 1 self.base_width = 64 #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, embed_size):\n super(EncoderCNN, self).__init__()\n resnet = models.resnet152(pretrained=True)\n modules = list(resnet.children())[:-1] # delete the last fc layer.\n self.resnet = nn.Sequential(*modules)\n self.linear = nn.Linear(resnet.fc.in_features, emb...
[ "0.68885237", "0.68815196", "0.68631077", "0.68590224", "0.67401785", "0.6714699", "0.6710083", "0.6710083", "0.6710083", "0.6494981", "0.6423737", "0.64182776", "0.6379592", "0.6368435", "0.6367111", "0.6366088", "0.6362024", "0.6358001", "0.6344162", "0.6335492", "0.6329023...
0.0
-1
Perform an internal crossmatch by sky coordinates on an astropy table d, whereas the column names for the coordinates have to be provided as well as the cone radius (conrad) in arcsec. Match rows are marked by a "groupID" column of groupsize equal to the possible matches (not involved members).
def internal_coordmatch(d, racol, deccol, conrad, verbose=False): ntot = len(d) coords = coordinates.SkyCoord(ra=d[racol]*u.degree, dec=d[deccol]*u.degree) idxr, idxl, sep, _ = coords.search_around_sky(coords, conrad*u.arcsec) sep = sep.value * 3600 groupids, _, _, _ = _identify_groups(idxl, i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query_and_match(coo, match_radius=1, columns=full_columns):\n from pyia import GaiaDataNew\n query = create_source_query_from(coo, columns=columns)\n gaia = GaiaDataNew.from_query(query)\n gcoo = SkyCoord(gaia.ra, gaia.dec)\n idx, d2d, _ = coo.match_to_catalog_sky(gcoo)\n iimatch = d2d.arcsec...
[ "0.68038523", "0.5753775", "0.5694289", "0.56542", "0.56237996", "0.5614921", "0.5611816", "0.55703163", "0.5495159", "0.5472432", "0.54194224", "0.54156125", "0.53718644", "0.53218013", "0.52443033", "0.52231246", "0.52037096", "0.51334137", "0.5117734", "0.51022184", "0.509...
0.66860235
1
Summary Returns a sigmoid X
def sigmoid(X): g = 1/(1 + np.exp(-X)) return g
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid(x):\n\treturn 1 / (1 + m.exp(-x))", "def sigmoid(x):\n return 1.0/(1.0+exp(-x))", "def sigmoid(x):\n return 1 / (1 + exp(-x))", "def sigmoid(x):\n return 1 / (1 + exp(-x))", "def sigmoid(X):\n return 1 / (1 + np.exp(-X))", "def sigmoid(X):\n return 1 / (1 + np.exp(-X))", "def...
[ "0.82609624", "0.82268596", "0.82182956", "0.82182956", "0.82158417", "0.82158417", "0.8171673", "0.81673867", "0.81355965", "0.81305665", "0.8116539", "0.8115089", "0.81133413", "0.81127304", "0.8111422", "0.81103164", "0.80964637", "0.8093918", "0.8092438", "0.8092438", "0....
0.8174803
6
Function to generate a unique name based on the provided name and names already in the spec. Will append a number to the name to make it unique if the name is already in the spec.
def get_unique_schema_name(components, name, counter=0): if name not in components._schemas: return name if not counter: # first time through recursion warnings.warn( "Multiple schemas resolved to the name {}. The name has been modified. " "Either manually add each of th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_name(name):\n return 'test-%s-%s-%s' % (time.strftime('%Y%m%d%H%M%S'),\n random.randint(0, 999), name)", "def GetUniqueName( name, elems ):\n digits = []\n for c in reversed( name ):\n if c.isdigit():\n digits.append( c )\n else:\n ...
[ "0.7647352", "0.76095986", "0.74818873", "0.74769497", "0.7350527", "0.7143012", "0.706488", "0.7052328", "0.7035109", "0.69729114", "0.6928418", "0.690151", "0.68777573", "0.6846153", "0.6798528", "0.6793855", "0.67870855", "0.6757859", "0.6755977", "0.6753084", "0.67346346"...
0.6034008
74
Create a Zaqar queue with random name.
def _queue_create(self, **kwargs): name = self.generate_random_name() return self.clients("zaqar").queue(name, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_qos_queue(self):\r\n resource = 'qos_queue'\r\n cmd = qos.CreateQoSQueue(\r\n test_cli20.MyApp(sys.stdout), None)\r\n myid = 'myid'\r\n name = 'my_queue'\r\n default = False\r\n args = ['--default', default, name]\r\n position_names = ['na...
[ "0.7066194", "0.68583274", "0.6819033", "0.68110687", "0.65267", "0.6487708", "0.63863385", "0.63517624", "0.6261548", "0.62595046", "0.6251173", "0.6191547", "0.6166396", "0.613844", "0.6010847", "0.60082847", "0.5950921", "0.5944941", "0.59395003", "0.5901849", "0.588249", ...
0.8448215
0
All available API routes.
def index(): return render_template('home.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_routes(api):\n api.add_resource(WatchlistsApi, '/api/watchlists')\n api.add_resource(WatchlistApi, '/api/watchlist/<id>')\n api.add_resource(RegisterUserApi, '/api/auth/register')\n api.add_resource(LoginUserApi, '/api/auth/login')\n api.add_resource(ResetPassword, '/api/auth/reset')\...
[ "0.74727255", "0.74573416", "0.7383036", "0.7368242", "0.7266721", "0.72225714", "0.71447706", "0.7114537", "0.7037122", "0.6973954", "0.69466424", "0.6933393", "0.6898141", "0.68923444", "0.6838017", "0.6745322", "0.6743971", "0.672723", "0.66164595", "0.65930325", "0.659248...
0.0
-1
All available API routes.
def main_nav(): return render_template('home.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_routes(api):\n api.add_resource(WatchlistsApi, '/api/watchlists')\n api.add_resource(WatchlistApi, '/api/watchlist/<id>')\n api.add_resource(RegisterUserApi, '/api/auth/register')\n api.add_resource(LoginUserApi, '/api/auth/login')\n api.add_resource(ResetPassword, '/api/auth/reset')\...
[ "0.74743736", "0.74579436", "0.7382846", "0.7368445", "0.72658366", "0.72230667", "0.7145165", "0.71141386", "0.7038473", "0.69742787", "0.69465667", "0.69334364", "0.6899106", "0.6892158", "0.68389964", "0.674688", "0.67437005", "0.6727781", "0.6616611", "0.65935326", "0.659...
0.0
-1
Sets the learning rate to the initial LR decayed by 10 every 30 epochs
def adjust_learning_rate(self, epoch): lr = self.lr * (0.5 ** (epoch // 2)) for param_group in self.optimizer.param_groups: param_group['lr'] = lr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_learning_rate(init_lr, optimizer, epoch, n=100):\n init_lr = init_lr * (0.1 ** (epoch // n))\n print('learning rate : ', init_lr)\n for param_group in optimizer.param_groups:\n param_group['lr'] = init_lr", "def adjust_learning_rate(start_lr, optimizer, epoch, total_epoch_num):\n #l...
[ "0.7913536", "0.7906521", "0.7849834", "0.777524", "0.77338326", "0.77306354", "0.7722718", "0.77224237", "0.771982", "0.77092624", "0.7693604", "0.76742035", "0.7665748", "0.7665748", "0.7665748", "0.7655329", "0.76419765", "0.7637868", "0.7626077", "0.76247585", "0.7621199"...
0.76399755
17
Given an array, rotate the array to the right by k steps, where k is nonnegative.
def rotate_array(arr, k): arr[:] = (arr[len(arr)-k:])+(arr[:len(arr)-k])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotate_array(arr: list, k: int):\n\n return arr[-k::] + arr[:(len(arr) - k)]", "def rotate(nums, k):\n nums = nums[(len(nums) - k):] + nums[:(len(nums) - k)]", "def rotate(self, nums, k):\n n = len(nums)\n k = k % n\n nums.reverse()\n self.reverse(nums, 0, k-1)\n se...
[ "0.756998", "0.73638463", "0.7226883", "0.72250056", "0.7152494", "0.7126865", "0.7116171", "0.71115035", "0.710078", "0.70571136", "0.7055499", "0.7027234", "0.70231056", "0.69830954", "0.69250417", "0.6918587", "0.6915982", "0.68991685", "0.68820935", "0.685493", "0.6846465...
0.77087784
0
Given an array, find the first duplicate elements index
def duplicate_in_array(s): import collections c = collections.Counter(s) for x in s: if c[x]>1: return s.index(x) return -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def firstDuplicate(array):\n dic = {}\n for num in array:\n if num in dic:\n return num\n else:\n dic[num] = True\n return -1", "def find_uniques_consecutive(array):\n val = array[0]\n indices = []\n for idx, element in enumerate(array):\n if element !...
[ "0.76421154", "0.7110574", "0.70497894", "0.69754463", "0.66972315", "0.6659067", "0.65913093", "0.65413785", "0.6502755", "0.6411607", "0.6409182", "0.64089406", "0.62904465", "0.62689006", "0.6246033", "0.6236716", "0.62001944", "0.61766535", "0.61720073", "0.6150971", "0.6...
0.7872209
0
show 2d matrix this is just pyplot.imshow that displays figure imidiately and with color bar
def mshow(matrix, cmap=None, norm=None, aspect=None, interpolation=None, alpha=1.0, vmin=None, vmax=None, origin=None, extent=None): plt.imshow(matrix,cmap=cmap, norm=norm, aspect=aspect, interpolation=interpolation, alpha=1.0, vmin=vmin, vmax=vmax, origin=origin, extent=extent) plt.colorbar() plt.show...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_matrix(matrix,kind=\"temperature\"):\n if kind==\"temperature\":\n cmap = \"bwr\"\n plt.title(\"Temperature\")\n elif kind==\"habitat\":\n cmap = \"Greens\"\n plt.title(\"Habitat\")\n else:\n cmap = \"Blues\"\n plt.imshow(matrix,\n interpolation...
[ "0.7721486", "0.7349743", "0.7335387", "0.72484833", "0.7244398", "0.7230353", "0.70836747", "0.70160246", "0.6897039", "0.687775", "0.6876795", "0.68762994", "0.6847629", "0.68471634", "0.6816285", "0.6816285", "0.6816285", "0.68039083", "0.6793683", "0.6789697", "0.674424",...
0.77588177
0
Reset turtle to origin.
def reset(self): self.home()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\n self._turtle.clear()\n self._turtle.setposition((0,0)) \n self._turtle.shape('turtle')\n self.color = 'red'\n self.heading = 180\n self.speed = 0", "def reset(self):\n TNavigator.reset(self)\n TPen._reset(self)\n self._clear...
[ "0.7602165", "0.7225796", "0.7050739", "0.69487405", "0.6822176", "0.68037784", "0.6645023", "0.6591394", "0.652549", "0.65115386", "0.65115386", "0.6502074", "0.6502074", "0.6502074", "0.64311725", "0.64229256", "0.63823783", "0.63618904", "0.63240176", "0.6285739", "0.62709...
0.0
-1
Returns the simulation data file name.
def get_sim_file(cls, root_dir, constants): return os.path.join(root_dir, '%s.hdf5' % constants['mos_type'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_filename(self) -> str: # type: ignore[return-value]\n return os.path.abspath(self.name) # type: ignore", "def data_fname(self):\n # NOTE: second argument of rsplit() is 'maxsplit'\n return self.fname.rsplit('.', 1)[0] + '.dat'", "def GetFileName():\r\n d = GetData()\r\n ...
[ "0.7785376", "0.7635999", "0.75209224", "0.70723635", "0.7070788", "0.69904226", "0.69214296", "0.68758464", "0.6875156", "0.68554187", "0.683289", "0.68251497", "0.6819472", "0.68140846", "0.6813863", "0.6813863", "0.6746536", "0.6718145", "0.6703137", "0.66892946", "0.66857...
0.69030166
7
Returns the simulation data file name.
def get_sim_file(cls, root_dir, constants): return os.path.join(root_dir, '%s.hdf5' % constants['mos_type'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_filename(self) -> str: # type: ignore[return-value]\n return os.path.abspath(self.name) # type: ignore", "def data_fname(self):\n # NOTE: second argument of rsplit() is 'maxsplit'\n return self.fname.rsplit('.', 1)[0] + '.dat'", "def GetFileName():\r\n d = GetData()\r\n ...
[ "0.7785376", "0.7635999", "0.75209224", "0.70723635", "0.7070788", "0.69904226", "0.69214296", "0.68758464", "0.6875156", "0.68554187", "0.683289", "0.68251497", "0.6819472", "0.68140846", "0.6813863", "0.6813863", "0.6746536", "0.6718145", "0.6703137", "0.66892946", "0.66857...
0.69030166
8
A class that generates matches for which the players do not know the length of the Match (to their knowledge it is infinite) but that ends with given probability.
def __init__(self, players, prob_end, game, deterministic_cache): super(ProbEndRoundRobinMatches, self).__init__( players, turns=float("inf"), game=game, deterministic_cache=deterministic_cache) self.deterministic_cache.mutable = False self.prob_end = prob_end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_next_match_pick_randomly(population):\n available_players = [player for player in population if player.available]\n\n p1 = random.choice(available_players)\n available_players.remove(p1)\n p2 = random.choice(available_players)\n return p1, p2", "def p(self) -> Probability:\n ...", ...
[ "0.5909953", "0.58689904", "0.5801267", "0.5733405", "0.572833", "0.56514907", "0.5581402", "0.55573815", "0.5555406", "0.55499107", "0.5541794", "0.55310154", "0.5524585", "0.55173683", "0.5498734", "0.5496077", "0.54750395", "0.5463344", "0.54538834", "0.54520464", "0.54414...
0.59914887
0
Sets the current date as the checkout date
def set_checkout(self, date): if type(date) != dt.datetime: raise TypeError('date must be a datetime.datetime object') else: pass self._checkout_date = date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_from_date_as_current_date(self):\n self.set_value_into_input_field(self.set_from_date_locator, self.get_current_date())", "def set_to_date(self):\n self.set_value_into_input_field(self.set_to_date_locator, self.get_current_date())", "def reset_checkout(self):\n self._checkout_date ...
[ "0.74459904", "0.7343462", "0.71254754", "0.68932474", "0.6754143", "0.6682863", "0.6631127", "0.66223925", "0.64379996", "0.6425329", "0.6415427", "0.6359414", "0.6359414", "0.63508105", "0.63124985", "0.6282089", "0.62672997", "0.62507904", "0.6181373", "0.6175951", "0.6169...
0.7939544
0
Parse group data as received from Microsoft Graph API into Demisto's conventions
def parse_outputs(groups_data: dict[str, str]) -> tuple[dict, dict]: # Unnecessary fields, dropping as to not load the incident context. fields_to_drop = ['@odata.context', '@odata.nextLink', '@odata.deltaLink', '@odata.type', '@removed', 'resourceProvisioningOptions', 'securityIdentifier'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_groups(self):\n\n data = []\n ads_by_data = []\n for date_time, group in self.groups:\n for ad in group:\n ads_by_data.append({\"ad\": ad})\n date_key = self.date_to_string(date_time)\n data.append({date_key: ads_by_data})\n ...
[ "0.64572984", "0.6166159", "0.6027871", "0.5987002", "0.5970446", "0.58031744", "0.57469475", "0.5721464", "0.5685282", "0.5684632", "0.56635195", "0.56110907", "0.5609109", "0.5609109", "0.5597781", "0.5580042", "0.55711097", "0.55430204", "0.5537566", "0.55223536", "0.55108...
0.6013681
3
Add a single member to a group by sending a POST request.
def add_member(self, group_id: str, properties: dict[str, str]): # If successful, this method returns 204 No Content response code. # It does not return anything in the response body. # Using resp_type="text" to avoid parsing error in the calling method. self.ms_client.http_request( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_member():\n client = RequestManager()\n client.set_method(\"POST\")\n client.set_endpoint(\"/accounts/{0}/memberships\".format(CONFIG_DATA['account_id']))\n body = {\"person_id\": CONFIG_DATA['member_id']}\n client.set_body(json.dumps(body))\n client.execute_reques...
[ "0.75270987", "0.7379943", "0.7184017", "0.70464", "0.70207095", "0.69544184", "0.6949013", "0.6925853", "0.690745", "0.68999416", "0.6716368", "0.6687833", "0.66823846", "0.6676878", "0.6664061", "0.66190606", "0.6596308", "0.6595417", "0.6536273", "0.6531674", "0.6527996", ...
0.67287385
10
Remove a single member to a group by sending a DELETE request.
def remove_member(self, group_id: str, user_id: str): # If successful, this method returns 204 No Content response code. # It does not return anything in the response body. # Using resp_type="text" to avoid parsing error in the calling method. self.ms_client.http_request( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_member():\n client = RequestManager()\n client.set_method(\"DELETE\")\n member_id = STORED_ID[\"member_id\"]\n client.set_endpoint(\"/accounts/{0}/memberships/{1}\".format(CONFIG_DATA['account_id'], member_id))\n client.execute_request()", "def delete_group_member(se...
[ "0.7974794", "0.77502084", "0.756952", "0.753633", "0.7376965", "0.7323936", "0.72710824", "0.72599673", "0.7174273", "0.7160467", "0.71020585", "0.7069085", "0.70641285", "0.7050504", "0.70447814", "0.70423096", "0.7024639", "0.6983123", "0.6982516", "0.69801414", "0.6977446...
0.7562986
3
Performs a basic GET request to check if the API is reachable and authentication is successful.
def test_function_command(client: MsGraphClient, args: dict) -> tuple[str, dict, dict]: client.test_function() return 'ok', {}, {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_authenticated(self):\n self.verify_get_response(self.client.get(STATUS_PATH))", "def test_GET(self):\n if not self.url:\n return\n response = self.client.get(self.url, {}, format='json')\n self.assertIn(response.status_code, [status.HTTP_405_METHOD_NOT_ALLOWED,...
[ "0.7242978", "0.7135567", "0.6776886", "0.6714548", "0.6624328", "0.6559727", "0.6559727", "0.65561265", "0.6556016", "0.65475523", "0.652865", "0.6474268", "0.6456738", "0.6456738", "0.64413595", "0.6440923", "0.6427488", "0.64193684", "0.6418182", "0.6412824", "0.64126396",...
0.0
-1
Add a member to a group by group id and user id. return outputs in Demisto's format.
def add_member_command(client: MsGraphClient, args: dict) -> tuple[str, dict, dict]: group_id = str(args.get('group_id')) user_id = str(args.get('user_id')) required_properties = { "@odata.id": f'https://graph.microsoft.com/v1.0/users/{user_id}'} client.add_member(group_id, required_properties) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def AddMemberToGroup(group_id,user_id):\r\n Group.AddMemberToGroup(group_id,user_id)", "def test_add_member_by_id_to_group(self):\n pass", "def test_add_member_by_id_to_group1(self):\n pass", "def add_member(group_name, member):\n query=\"INSERT INTO groupmembers(group_id, member)...
[ "0.7774805", "0.7278306", "0.723198", "0.71783495", "0.70184124", "0.679916", "0.6793845", "0.6740416", "0.6675733", "0.6629673", "0.6548232", "0.6491355", "0.6406291", "0.6404293", "0.6372689", "0.6328745", "0.6302069", "0.6301718", "0.629715", "0.628594", "0.6244141", "0....
0.72906643
1
Remove a member from a group by group id and user id. return outputs in Demisto's format.
def remove_member_command(client: MsGraphClient, args: dict) -> tuple[str, dict, dict]: group_id = str(args.get('group_id')) user_id = str(args.get('user_id')) client.remove_member(group_id, user_id) human_readable = f'User {user_id} was removed from the Group "{group_id}" successfully.' return hum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_member(self, group_id: str, user_id: str):\n # If successful, this method returns 204 No Content response code.\n # It does not return anything in the response body.\n # Using resp_type=\"text\" to avoid parsing error in the calling method.\n self.ms_client.http_request(\n...
[ "0.7553396", "0.70715857", "0.7000355", "0.69660556", "0.68491685", "0.683539", "0.67304796", "0.67186046", "0.66618395", "0.66486454", "0.66385674", "0.659689", "0.65155417", "0.6486116", "0.6452204", "0.6446218", "0.644473", "0.6411841", "0.63836026", "0.638358", "0.6373756...
0.7638079
0
Get a Customer by Name
def test_get_customer_by_name(self): test_customer = self._create_customers("Alex") test_customer.create() test_customer = self._create_customers("Sally") test_customer.create() test_customer = self._create_customers("John") test_customer.create() resp = self.app....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_for_customer(self, name):\n customers_list = self.get_customers()\n return next((customer for customer in customers_list if customer.get('name') == name), {'name': None, 'parent':None, 'active': None, 'link': None })", "def get_customers_by_name(name: str = '') -> List[Customer]:\n cu...
[ "0.8169863", "0.7525546", "0.72558576", "0.70762086", "0.70592034", "0.7013837", "0.6990619", "0.6877543", "0.6817464", "0.68126225", "0.6763873", "0.6759032", "0.67145777", "0.6712504", "0.67033786", "0.6669354", "0.66538095", "0.6643005", "0.6633693", "0.6613", "0.660611", ...
0.77297026
1
Add a new experience to memory.
def add(self, state, state_full, action, reward, next_state, next_state_full, done): exp_ = self.experience(state, state_full, action, reward, next_state, next_state_full, done) self.memory.append(exp_)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_new_experience(self, state, action, reward, next_state, done):\n e = self.experience(state, action, reward, next_state, done, self.max_priority)\n self.memory.append(e)", "def add(self, state, action, reward, next_state, done):\n experience = Experience(state, action, reward, next_st...
[ "0.79568833", "0.79042006", "0.78795445", "0.7577913", "0.7570969", "0.74478436", "0.7361023", "0.72697705", "0.721816", "0.71984994", "0.71984994", "0.71984994", "0.71984994", "0.71984994", "0.71984994", "0.71984994", "0.71984994", "0.71984994", "0.71984994", "0.71984994", "...
0.68905056
24
Return the current size of internal memory.
def __len__(self): return len(self.memory)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSize(self) -> int:\n return len(self.mem)", "def getSize(self):\n return self.bf.memory()", "def memsize(self):\n return self.xlist(\"get-memsize\")[1][0] * 1024", "def size(self):\n size = 0\n size += self.data.size * sys.getsizeof(self.data)\n return size / ...
[ "0.8573752", "0.82169205", "0.8200361", "0.8087402", "0.8021614", "0.7890747", "0.78219426", "0.78017354", "0.77905464", "0.7758844", "0.77559924", "0.77559924", "0.775519", "0.77544576", "0.7733221", "0.7732168", "0.7720068", "0.77145016", "0.77092093", "0.77077913", "0.7697...
0.75127405
48
Build a dictionary through a list of words
def buildDict(self, dict): for item in dict: length = len(item) if length not in self.dic: self.dic[length] = [item] else: self.dic[length].append(item)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_dict(word_list):\r\n\r\n # initialize a dictonary\r\n d = dict()\r\n\r\n # iterate through the word_list, mapping sorted letters to word\r\n for i in word_list:\r\n\r\n # key - sorted letters in the word\r\n # how to sort ? --> convert to list, then sort. Finally join the sorted...
[ "0.7771136", "0.7712955", "0.76635027", "0.7587533", "0.7505562", "0.74005705", "0.7371451", "0.7256235", "0.72465676", "0.7218949", "0.7150544", "0.7120735", "0.7089837", "0.7032372", "0.69883305", "0.69395125", "0.69258815", "0.6900314", "0.68616164", "0.681493", "0.6808725...
0.0
-1
Returns if there is any word in the trie that equals to the given word after modifying exactly one character
def search(self, word): length = len(word) if length not in self.dic: return False else: candidateList = self.dic[length] for candidate in candidateList: for i in xrange(length): if candidate[i] != word[i]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_word(trie, string: str) -> bool:\n return any(w == string for w in trie)", "def search(self, word):\n curr = self.trie\n for i, ch in enumerate(word):\n curr = curr.get(ch, {})\n if curr:\n continue\n else:\n break\n \n...
[ "0.7898829", "0.77123356", "0.76817137", "0.7651471", "0.74973875", "0.7494274", "0.7490946", "0.7471417", "0.7440383", "0.7440078", "0.74153924", "0.74125475", "0.73968333", "0.7382937", "0.73649126", "0.7333139", "0.73310703", "0.7293905", "0.729297", "0.72762936", "0.72757...
0.6748994
74
Return a human readable representation of the model instance.
def __str__(self): return "{} - {}".format(self.stars, self.user.username)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self):\n model = self._meta.verbose_name.title()\n return f\"{model:s}: {self.name:s}\"", "def __str__(self):\n model = self._meta.verbose_name.title()\n return f\"{model:s}: {self.name:s}\"",...
[ "0.7985786", "0.7787808", "0.7787808", "0.7578072", "0.7573292", "0.7507807", "0.7386587", "0.7256107", "0.7256107", "0.725131", "0.7250711", "0.72445405", "0.72445405", "0.72391546", "0.72373813", "0.7213002", "0.71956646", "0.7177051", "0.7176494", "0.7173884", "0.7173313",...
0.0
-1
Send a POST to spinnaker to create a new application with class variables.
def create(self): # Retaining abstract account list for backwards compatibility # Refer to #366 self.appinfo['accounts'] = ['default'] self.log.debug('Pipeline Config\n%s', pformat(self.pipeline_config)) self.log.debug('App info:\n%s', pformat(self.appinfo)) jsondata = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_application(self, method=\"POST\", name=\"Sample App\",\r\n short_name=\"sampleapp\", description=\"Description\",\r\n long_description=u'Long Description\\n================'):\r\n if method == \"POST\":\r\n self.create_categories()\r\n ...
[ "0.6948692", "0.65220946", "0.64704156", "0.6162071", "0.6135617", "0.61137813", "0.60664725", "0.5947286", "0.59324384", "0.58997", "0.58205926", "0.57967883", "0.5786118", "0.57479656", "0.5741109", "0.5734602", "0.57231194", "0.57050604", "0.5691916", "0.5690389", "0.56796...
0.63085574
3
Creates an extra dataset object.
def __init__( self, features: np.ndarray, label: np.ndarray, *, extra_features: Optional[np.ndarray] = None, bias: Optional[np.ndarray] = None, gax: Optional[np.ndarray] = None, splitgax: bool = False, ): self.bias = bias if bias is None else t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_dataset(opt):\n\tdata_loader = CustomDatasetDataLoader(opt)\n\tdataset = data_loader.load_data()\n\treturn dataset", "def make_dataset(self, df, **kwargs):\n\t\treturn df", "def _create_dataset(source=''):\n return ExperimentalDataset()", "def create_dataset(opt):\n data_loader = CustomD...
[ "0.7169517", "0.70803374", "0.70407563", "0.6991817", "0.65625143", "0.6537113", "0.64933234", "0.6399026", "0.6393625", "0.6359847", "0.6359847", "0.6356147", "0.63004136", "0.627356", "0.62601423", "0.62071383", "0.6192981", "0.61816967", "0.6153943", "0.6120924", "0.609610...
0.0
-1
Creates a new leaf object.
def __init__(self, info): self.val = info["prediction"] * info["learning_rate"] self.train_size = info["ematrix"].label.shape[0] self.avg_target = np.mean(info["ematrix"].label, axis=0)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_instantiate_leaf_node(self):\n try:\n LeafNode('my_label')\n except Exception:\n message = \"LeafNode instantiation failed\"\n self.fail(message)", "def make_leaves(self):\n\n curr_leaf = self.root\n i = 1\n while i < self.length:\n ...
[ "0.7106855", "0.6948242", "0.6507485", "0.648589", "0.6341395", "0.62960553", "0.62735283", "0.6224523", "0.6177313", "0.6171481", "0.6170195", "0.61345863", "0.6114109", "0.6080579", "0.6065391", "0.6018339", "0.5990318", "0.5978039", "0.59652483", "0.59587157", "0.59407836"...
0.0
-1
Creates an empty tree node.
def __init__(self): self.left = None self.right = None self.depth = 0 self.val = None self.id = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_empty_node():\n from linked_list import Node\n return Node()", "def test_minimal_tree_creation():\n t = Tree(None)\n\n assert t.data is None\n assert t.parent is None\n assert len(t) == 0", "def __init__(self):\n self.root = TreeNode(None)", "def __init__(self):\n s...
[ "0.76739657", "0.74671286", "0.71192217", "0.71054417", "0.71039736", "0.7013856", "0.7013856", "0.70073444", "0.6995621", "0.6995621", "0.6936996", "0.6881671", "0.67254144", "0.67048484", "0.6692601", "0.6684499", "0.6617768", "0.6585749", "0.65682155", "0.65682155", "0.656...
0.5760194
94