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
Get the softmax likelihood associated with the statement. Returns the likelihood as a (softmax model, class label) pair, or as a precomputed discretized likelihood.
def get_likelihood(self, discretized=False, state=None): if not hasattr(self, 'softmax'): self.generate_softmax() if self.softmax is not None: if state is not None: return self.softmax.probability(class_=self.softmax_class_label, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def likelihood(self):\n if self._likelihood is None:\n self._likelihood = exp(self.log_likelihood)\n if self._likelihood == 0:\n self._likelihood = sys.float_info.min\n return self._likelihood", "def log_softmax(input, dim, inplace=False):\n return FunctionLi...
[ "0.60922885", "0.60311407", "0.59170127", "0.58422333", "0.5788663", "0.5774819", "0.5736715", "0.56744146", "0.56641483", "0.56396025", "0.5633783", "0.56208545", "0.56171095", "0.56118083", "0.5607685", "0.5595049", "0.5577833", "0.55751985", "0.55733746", "0.556406", "0.55...
0.76986706
0
Equality if types match and fields match
def __eq__(self, other): return (type(other) == type(self) and self.using_default_schema == other.using_default_schema and self.settings == other.settings and self.schema == other.schema and self.comment == other.comment)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _assert_input_object_types_equal(self, type1, type2):\n self.assertEqual(type1.name, type2.name)\n self.assertEqual(type1.description, type2.description)\n self.assertEqual(\n set(type1.fields.iterkeys()), set(type2.fields.iterkeys()))\n for name, t in type1.fields.iterit...
[ "0.7433653", "0.7135119", "0.6952121", "0.69321793", "0.6918883", "0.68991315", "0.6868184", "0.684146", "0.67625135", "0.66731817", "0.66672426", "0.6635601", "0.6625247", "0.66202956", "0.66159356", "0.65862745", "0.6565891", "0.65412927", "0.6541273", "0.6541269", "0.64709...
0.0
-1
Get the most recent media published by the owner of the access_token.
def self_media(self): url = "https://api.instagram.com/v1/users/self/media/recent/?access_token={0}".format(self.access_token) request = requests.get(url) return request.json()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recent_media(self):\r\n return media.RecentMedia(self)", "def recent_media(self):\r\n return media.RecentMedia(self)", "def recent_media(self):\r\n return media.RecentMedia(self)", "def recent_media(self):\r\n return media.RecentMedia(self)", "def get_media(self, max_id):\r\...
[ "0.6796755", "0.6796755", "0.6796755", "0.6796755", "0.67599696", "0.6730841", "0.6379026", "0.6122097", "0.5999925", "0.59927255", "0.5931581", "0.577009", "0.5754389", "0.5750317", "0.5703142", "0.5688126", "0.55674386", "0.5564788", "0.5486584", "0.54648614", "0.54532725",...
0.6609476
6
Create flow from flow dict.
def from_flow_dict(cls, flow_dict=None, **kwargs): flow = cls(**cls.sanitize_flow_kwargs(flow_dict), add_root_task=False) graph = flow_dict.get('graph', {}) for task in graph.get('tasks', {}).values(): flow.add_task(task=task, add_default_connections=False) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_flow(self, conf, dpid, params):\n\t\tpass", "def load_from_dict(input_dict):\n return WorkflowStepInformation(input_dict)", "def from_dict(cls, dikt) -> 'ProductionFlowItem':\n return util.deserialize_model(dikt, cls)", "def from_flow_spec(cls, flow_spec=None, deep_copy_tasks=True):\...
[ "0.6455452", "0.63703924", "0.6310935", "0.630129", "0.6297996", "0.61647356", "0.6027162", "0.591691", "0.5911723", "0.58802015", "0.5862433", "0.5854949", "0.57904935", "0.5787647", "0.57203573", "0.5711133", "0.563298", "0.5555938", "0.5539709", "0.55395067", "0.5526905", ...
0.77714616
0
Create flow_dict from flow.
def to_flow_dict(self): flow_dict = { **{attr: getattr(self, attr, None) for attr in self.SIMPLE_ATTRS}, 'graph': { 'tasks': {key: task for key, task in self.tasks.items()}, 'edges': [edge for edge in self._edges.values()], }, 'num_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_flow_to_json_dict(flow: flow.Flow) -> dict:\n f = {\n \"id\": flow.id,\n \"intercepted\": flow.intercepted,\n \"client_conn\": flow.client_conn.get_state(),\n \"server_conn\": flow.server_conn.get_state(),\n \"type\": flow.type\n }\n if flow.error:\n f...
[ "0.74811596", "0.6765847", "0.60358953", "0.58801585", "0.58016783", "0.5761484", "0.57410705", "0.5730544", "0.56621265", "0.5659916", "0.5648384", "0.5640027", "0.5624737", "0.55789095", "0.55308735", "0.5521242", "0.54733324", "0.5440959", "0.5367895", "0.53548", "0.535308...
0.72165316
1
Returns parameter quantiles for starmodel
def get_quantiles( name, rootdir=".", columns=["eep", "mass", "radius", "age", "feh", "distance", "AV"], qs=[0.05, 0.16, 0.5, 0.84, 0.95], modelname="mist_starmodel_single", verbose=False, raise_exceptions=False, ): modfile = os.path.join(rootdir, name, "{}.h5".format(modelname)) tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quantile(self, hypercube):\n raise NotImplementedError()", "def quantiles(self):\n return self._quantiles", "def quantiles(self, q: int):\n return self.dist.quantiles(q)", "def get_percentile(self, q):\n return None", "def get_percentile(self, q):\n return None", "d...
[ "0.64169925", "0.637962", "0.63189775", "0.62406796", "0.62406796", "0.6220513", "0.61744785", "0.61182386", "0.60933316", "0.60338765", "0.599344", "0.599344", "0.599344", "0.59428054", "0.5928919", "0.589403", "0.5878463", "0.5878463", "0.58730555", "0.5869733", "0.58490664...
0.5597896
32
Shows the homepage listing students and projects.
def get_homepage(): projects = hackbright.get_projects() students = hackbright.get_students() return render_template("homepage.html", students=students, projects=projects)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_homepage():\n\n list_of_students = hackbright.list_all_students()\n list_of_projects = hackbright.list_all_projects()\n\n return render_template(\"index.html\",\n list_of_students=list_of_students,\n list_of_projects=list_of_projects)", "def ...
[ "0.80605704", "0.6935026", "0.6850943", "0.6835104", "0.68063533", "0.6660563", "0.6626679", "0.6547791", "0.65438527", "0.65353847", "0.6534081", "0.6529442", "0.6524559", "0.6518541", "0.65129155", "0.6511044", "0.65007436", "0.6494312", "0.6461636", "0.6453689", "0.6452600...
0.75135344
1
Compute distance between two objects
def distance(p1,p2): return ((p2.x - p1.x)*2 + (p2.y - p1.y))**0.5
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _object_distance(self, object1, object2):\n return np.linalg.norm(np.array(object1) - np.array(object2))", "def distance(self, other):\n ...", "def distance(self,other):\n return math.sqrt((self.x - other.x)**2 +(self.y - other.y)**2)", "def obj_distance(obj1, obj2):\n distance = ...
[ "0.8555258", "0.77862144", "0.7624347", "0.76083374", "0.76066375", "0.75560284", "0.7544068", "0.754279", "0.75403214", "0.7498405", "0.7467739", "0.7458308", "0.7446304", "0.7433469", "0.7394615", "0.73917365", "0.7390737", "0.7388267", "0.737851", "0.73703736", "0.73674935...
0.6917101
71
Given a path to a .bdgcfg file, figure out the UUID for that file.
def getGUIDByBdcfg(configfile): generalDict, projectDict, solutionDict = Engine.readConfiguration(configfile) return projectDict['uuid']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_uuid(hass, filename=UPDATER_UUID_FILE):\n try:\n with open(hass.config.path(filename)) as fptr:\n jsonf = json.loads(fptr.read())\n return uuid.UUID(jsonf['uuid'], version=4).hex\n except (ValueError, AttributeError):\n return None\n except FileNotFoundError:\...
[ "0.6563805", "0.62032217", "0.6028028", "0.59647095", "0.5964534", "0.57945305", "0.57594717", "0.5742946", "0.5716567", "0.5712278", "0.5690401", "0.56604785", "0.56443954", "0.5641944", "0.5609591", "0.55868953", "0.5585059", "0.55748874", "0.5566039", "0.5555027", "0.55489...
0.76507205
0
Get name of discovery type.
def get_name(self): return "catkin"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type_name(self) -> Optional[str]:\n return pulumi.get(self, \"type_name\")", "def type_name(self):\n return self._type_name", "def name(self) -> str:\n return self.type_data.name", "def type_name(self):\n return self.TYPE_NAMES.get(self.type, \"Unknown\")", "def type_name(self):...
[ "0.71542555", "0.71514803", "0.7143081", "0.71386", "0.7061267", "0.70540243", "0.6987808", "0.6969985", "0.6946779", "0.6748077", "0.6739484", "0.6698395", "0.66971695", "0.665346", "0.66354513", "0.6635443", "0.6603301", "0.652437", "0.652437", "0.652437", "0.652437", "0....
0.0
-1
Validator to check if user has admin role
def be_admin(username): user_data = my_users.get(username) if not user_data or 'admin' not in user_data.get('roles', []): return "User does not have admin role"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isAdmin(user):\n return isUserType(user, Admin)", "def user_is_admin(user):\n return user in admins", "def is_admin(self):\n return Role.query.get(2) in self.roles", "def is_admin():\n # TODO(felipemonteiro): Make this more robust via a context is admin\n # lookup.\n return CONF.pat...
[ "0.7195708", "0.71724236", "0.71231556", "0.70081574", "0.6983258", "0.6954754", "0.6895467", "0.6894189", "0.68935484", "0.68899804", "0.6878295", "0.6839159", "0.68133867", "0.67594767", "0.67324656", "0.67324656", "0.6731227", "0.672199", "0.66843635", "0.667361", "0.66718...
0.71722347
2
If num isn't a power of 2, will return the next higher power of two
def next_p2(num): rval = 1 while rval < num: rval <<= 1 return rval
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_power2(num):\n return 2 ** int(np.ceil(np.log2(num)))", "def _next_power_of_two(self, n):\n if n == 0:\n return 1\n return int(2 ** math.ceil(math.log2(n)))", "def next_p2 (num):\n rval = 1\n while rval<num:\n rval <<= 1\n return rval", "def _next_power_of_2(x):\n re...
[ "0.8734268", "0.81847894", "0.7933371", "0.78695476", "0.78207755", "0.7814647", "0.7762678", "0.743134", "0.739866", "0.7351554", "0.7341135", "0.732585", "0.7287776", "0.7251041", "0.72456557", "0.71558917", "0.71558917", "0.7133101", "0.7126195", "0.7105558", "0.70963067",...
0.7981922
2
Average surface distance metric. Computes the average surface distance (ASD) between the binary objects in two images.
def asd(result, reference, voxelspacing=None, connectivity=1): sds = __surface_distances(result, reference, voxelspacing, connectivity) asd = sds.mean() return asd
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_object_average_surface_distances(labelled_surface_distances_1, labelled_surface_distances_2):\n asd_label_1 = []\n for surface_distance in labelled_surface_distances_1:\n asd_label_1.append(np.mean(surface_distance))\n\n asd_label_2 = []\n for surface_distance in labelled_surface_dis...
[ "0.6882447", "0.67812854", "0.5967613", "0.5770271", "0.5768099", "0.5728789", "0.5724249", "0.57195735", "0.55891013", "0.55025625", "0.5478943", "0.546979", "0.54515624", "0.5422702", "0.5410362", "0.54010916", "0.5391672", "0.536827", "0.5357524", "0.5352367", "0.53379744"...
0.6061412
2
Average symmetric surface distance. Computes the average symmetric surface distance (ASD) between the binary objects in two images.
def assd(result, reference, voxelspacing=None, connectivity=1): assd = np.mean( (asd(result, reference, voxelspacing, connectivity), asd(reference, result, voxelspacing, connectivity)) ) return assd
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_object_average_surface_distances(labelled_surface_distances_1, labelled_surface_distances_2):\n asd_label_1 = []\n for surface_distance in labelled_surface_distances_1:\n asd_label_1.append(np.mean(surface_distance))\n\n asd_label_2 = []\n for surface_distance in labelled_surface_dis...
[ "0.61649543", "0.6120697", "0.6092789", "0.5514295", "0.5485343", "0.54832506", "0.53247577", "0.5288894", "0.5284722", "0.5282436", "0.52777225", "0.52777046", "0.52586055", "0.52527755", "0.5243048", "0.519607", "0.5186011", "0.516091", "0.51481456", "0.5145745", "0.5134756...
0.47976315
69
Decorator to check for discord.py specific paramaters before running a given cog command Returns True if the user is the owner of the guild or the user satisfies all keyword arguments (ex. adminstrator = True) and the command is run in a server (Not a private message) Raises CheckFailure NoPrivateMessage
def owner_or_permissions(**perms): original = commands.has_permissions(**perms).predicate async def extended_check(ctx): if ctx.guild is None: raise errors.NoPrivateMessage return ctx.guild.owner_id == ctx.author.id or await original(ctx) return commands.check(extended_check)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cog_check(self, ctx):\n if ctx.guild is None:\n raise commands.NoPrivateMessage()\n return True", "def is_command_ancillary(args):\n # pylint: disable=bad-continuation\n if (\n # skip the parent check and only\n # determine if the parameter is present\n is_...
[ "0.6856945", "0.66123337", "0.64086205", "0.6222364", "0.6163362", "0.6163362", "0.6090696", "0.6031354", "0.60244286", "0.59669274", "0.595418", "0.59363496", "0.5867672", "0.5850312", "0.57432497", "0.5731238", "0.57059324", "0.57043934", "0.56492984", "0.56438303", "0.5635...
0.5672864
18
Read a file as text.
def read_as_text(filename: str) -> str: with open(filename) as file_handle: txt = file_handle.read() return txt
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_text_from_file(file_path):\n validate_txt_extension(file_path)\n with open(file_path) as file:\n # Read all the lines from the file, and concatenate into a single string.\n return ''.join([line for line in file])", "def read_text_file(str_name_file: str):\n content: str = ''\n ...
[ "0.82834005", "0.81616354", "0.81227875", "0.80503017", "0.8028902", "0.7987044", "0.7964787", "0.78764147", "0.78748137", "0.7856088", "0.7800344", "0.7784426", "0.7780789", "0.7780785", "0.7777496", "0.77749777", "0.7759207", "0.77568686", "0.7745249", "0.77280533", "0.7707...
0.81126684
3
Initilizer for PowerSpectrum class. Builds custom spectrum if variables are passed when creating instance.
def __init__(self, start_w: float = 280.0, stop_w: float = 4000.0, spectra: str = "AM1.5G"): # the first column should be the wavelength in nanometers, the second is the tilt power density/nm in # W/(m**2 nm) = J s^-1 m^-2 nm^-1 = C V m^-2 nm^-1 spectras = {"AM0Etr": 1, "AM1.5G": 2, "AM1.5D": 3}...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, start_w: float = 280.0, stop_w: float = 4000.0, spectra: str = \"AM1.5G\"):\n super(PowerSpectrum).__init__(start_w, stop_w, spectra)\n self.spectrum[:, 1] = self.spectrum[:, 1] * (self.spectrum[:, 0] * 1e-9 / (constants.c * constants.h))\n self.interp = interpolate.interp1d...
[ "0.7103904", "0.68667674", "0.6739533", "0.66500825", "0.6518826", "0.6500992", "0.6341084", "0.6296443", "0.6279604", "0.6190744", "0.61774486", "0.613103", "0.61304563", "0.6079439", "0.60709953", "0.6023808", "0.6001173", "0.59967315", "0.59879214", "0.5983342", "0.5972209...
0.6644479
4
Returns a copy of the spectrum.
def get_spectrum(self): return self.spectrum.copy()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retarder(self):\n self.spectrum = self.spectrum", "def spectrum(self):\r\n spectrum = tsa.cache_to_psd(self.cache, self.ij)\r\n\r\n return spectrum", "def spectrum(self):\r\n f, spectrum = tsa.get_spectra(self.input.data, method=self.method)\r\n return spectrum", "def g...
[ "0.7573213", "0.7512552", "0.7477329", "0.68190265", "0.68140095", "0.67553395", "0.67553395", "0.66107184", "0.6573543", "0.65258205", "0.6394604", "0.6306297", "0.6298666", "0.62905663", "0.6238357", "0.6223427", "0.61873007", "0.6179991", "0.6161867", "0.61329645", "0.6116...
0.85397387
0
Set the root directory of the library. The root directory is the directory that contains the ``Resources`` folder and the toplevel ``package.mo`` file.
def _setLibraryRoot(self): self._libHome = os.path.abspath(rootDir)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_root(self, root):\n self.root_path = root", "def path(self, root_dir):\r\n path = os.path.realpath(root_dir)\r\n if not os.path.exists(path):\r\n raise ValueError('Build root does not exist: %s' % root_dir)\r\n self._root_dir = path", "def set_root(root_):\n global root\n\n r...
[ "0.75139695", "0.74335825", "0.6927549", "0.6892072", "0.67570066", "0.67570066", "0.67544323", "0.67433196", "0.6607599", "0.6450696", "0.6443666", "0.6395353", "0.63014346", "0.62739587", "0.62310123", "0.6185639", "0.61785305", "0.6135115", "0.6084959", "0.60841674", "0.60...
0.77901334
0
return the x that maximizes func_to_maximize(x)
def fmax(func_to_maximize, initial_guess=0.5*V): func_to_minimize = lambda x : -func_to_maximize(x) return fmin(func_to_minimize, initial_guess, disp=False)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fmax(func_to_maximize, initial_guess=0):\n func_to_minimize = lambda x : -func_to_maximize(x)\n return fmin(func_to_minimize, initial_guess, disp=False)[0]", "def maximize(self,x0,method='fmin',**kwargs):\n return self._optimize(x0,'max',method,**kwargs)", "def maximize_scalar(max_func...
[ "0.78582346", "0.762913", "0.70909435", "0.7005915", "0.6918201", "0.6830878", "0.68056947", "0.6792812", "0.6780441", "0.6751625", "0.6751625", "0.67505354", "0.67262614", "0.67262614", "0.67209095", "0.67055553", "0.6699964", "0.668871", "0.668871", "0.668871", "0.668871", ...
0.79619956
0
returns iso formatted timestamp
def unix_to_iso(unix_time): return datetime.datetime.fromtimestamp( int(unix_time)).strftime('%Y-%m-%d %H:%M:%S')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_timestamp():\n return '{}Z'.format(\n datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3]\n )", "def _timestamp():\n moment = time.time()\n moment_us = repr(moment).split(\".\")[1]\n return time.strftime(\"%Y-%m-%d-%H-%M-%S-{}\".format(moment_us), time.gmti...
[ "0.78718376", "0.77396923", "0.7717343", "0.76365614", "0.7627121", "0.7439697", "0.7429275", "0.7429275", "0.74282604", "0.7396412", "0.7369577", "0.7363486", "0.7330156", "0.7329294", "0.7278735", "0.7213117", "0.7198752", "0.7176962", "0.7170994", "0.7160531", "0.7148626",...
0.65717757
82
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(y_true, y_pred, classes, normalize=False, title=None, cmap=plt.cm.Blues): if not title: if normalize: title = 'Normalized confusion matrix' else: title = 'Confusion matrix,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n...
[ "0.81943494", "0.80950284", "0.8029028", "0.8018638", "0.79939085", "0.7990765", "0.79800814", "0.797508", "0.79603964", "0.7956491", "0.7937033", "0.7934199", "0.79338384", "0.7930749", "0.7926003", "0.79238", "0.7923391", "0.7922832", "0.7922392", "0.7921617", "0.79173195",...
0.78198534
87
Check that minimum and maximum core values are respected.
def check_core_allocations(host, cpu_counts): total_platform_cores = 0 total_vswitch_cores = 0 total_shared_cores = 0 total_isolated_cores = 0 for s in range(0, len(host.nodes)): available_cores = len(host.cpu_lists[s]) platform_cores = cpu_counts[s][constants.PLATFORM_FUNCTION] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_gc_min_max(self):\n if not self.allow_open_amount:\n return\n\n if self.gc_min < 0 or self.gc_max < 0:\n self.raise_user_error(\"negative_amount_not_allowed\")\n\n if self.gc_min > self.gc_max:\n self.raise_user_error(\"invalid_amount\")", "def _ver...
[ "0.6770547", "0.6757663", "0.65089494", "0.6500374", "0.64607984", "0.6371458", "0.629739", "0.62963516", "0.6271304", "0.6271218", "0.6192666", "0.61786395", "0.61641514", "0.6142654", "0.6117739", "0.60988885", "0.60755795", "0.60312194", "0.6020419", "0.597178", "0.5952143...
0.5696111
42
Unload a config entry.
async def async_unload_entry(hass, config_entry): unload_ok = await hass.config_entries.async_forward_entry_unload( config_entry, "climate" ) return unload_ok
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:\n hass.data.pop(DOMAIN)\n return True", "async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry):\n unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)\n if unload_ok:\n hass...
[ "0.6888799", "0.67804056", "0.6748717", "0.66898286", "0.6658954", "0.6616611", "0.6603602", "0.65933734", "0.6559995", "0.6542201", "0.6508463", "0.6508463", "0.6508463", "0.6508463", "0.6498429", "0.64940464", "0.648741", "0.648741", "0.648741", "0.648741", "0.64700884", ...
0.6973518
0
Converts LatLng dicts to tuples.
def to_tuple(waypoint): if isinstance(waypoint, dict): return (waypoint["lat"], waypoint["lng"]) else: return waypoint
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _tupleize(d):\n return [(key, value) for key, value in d.items()]", "def dict_to_coordinates(dictionary):\r\n coordinates = []\r\n\r\n for landmark, coordinate in dictionary.items():\r\n coordinates.append((coordinate['x'], coordinate['y']))\r\n\r\n return coordinates", "def convert_dict...
[ "0.66366625", "0.6392047", "0.61594534", "0.61575013", "0.613559", "0.6055408", "0.6005529", "0.59849167", "0.59672385", "0.5961524", "0.59522444", "0.5933124", "0.5812164", "0.5763585", "0.5733763", "0.57309294", "0.56814367", "0.56712127", "0.5636992", "0.5636462", "0.56187...
0.6956577
0
Render website's home page.
def home(): return render_template('home.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_home():\r\n\treturn render_template(\"index.html\")", "def home():\n return render_template('homepage.html')", "def home():\n\n return render_template('home_page.html')", "def homepage():\n return render_template('home/index.html', \n title=\"Bem vindo!\")", "...
[ "0.8725", "0.8579784", "0.8504212", "0.84866977", "0.84621906", "0.84369636", "0.8430821", "0.84204614", "0.83973694", "0.83973694", "0.8375524", "0.83571446", "0.8351527", "0.83413976", "0.83413976", "0.8336913", "0.8330127", "0.83299094", "0.83257043", "0.8317489", "0.82942...
0.833817
25
Render the website's about page.
def about(): return render_template('about.html', name="Nadrine Simms")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about():\n return render_template('about.html', title='About')", "def about():\n\n return render_template('about_page.html', title='About')", "def about():\n\n\treturn render_template(\"about.html\")", "def about():\n return render_template(\n 'about.html',\n title='About',\n ...
[ "0.87910306", "0.8698105", "0.86404276", "0.86124563", "0.8490408", "0.84784615", "0.8467779", "0.84352976", "0.84289914", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242...
0.8185684
41
Add headers to both force latest IE rendering engine or Chrome Frame, and also tell the browser not to cache the rendered page. If we wanted to we could change maxage to 600 seconds which would be 10 minutes.
def add_header(response): response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1' response.headers['Cache-Control'] = 'public, max-age=0' return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, max-age=60'\n return response", "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, m...
[ "0.8143421", "0.8121197", "0.8121197", "0.8121197", "0.8121197", "0.80378723", "0.80360985", "0.8010573", "0.7974773", "0.7764793", "0.7746749", "0.75882703", "0.74570346", "0.7392739", "0.7386158", "0.7386158", "0.7368778", "0.7353415", "0.7353415", "0.7353415", "0.7353415",...
0.79951274
32
Set cuda or cpu as default tensor type.
def set_default_tensor_type(device): if device in [torch.device("cpu"), "cpu"]: torch.set_default_tensor_type(torch.FloatTensor) else: torch.set_default_tensor_type(torch.cuda.FloatTensor)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_default_tensor_type():\n if torch.cuda.is_available():\n torch.set_default_tensor_type('torch.cuda.FloatTensor')\n else:\n print(\"ERROR: cuda is not available. Test will exit.\")", "def set_device_type(device: str = \"cuda\"):\n DefaultDeviceType._default_device_type = device"...
[ "0.8462085", "0.70081735", "0.6351299", "0.6312891", "0.6302002", "0.6301001", "0.62432814", "0.62432814", "0.62432814", "0.62432814", "0.6154245", "0.61309606", "0.61218303", "0.6116661", "0.6022028", "0.59652746", "0.5912389", "0.5874618", "0.5867803", "0.586027", "0.582362...
0.8510498
0
Get the Type of a given entity
def get_type(smiles): mol = Chem.MolFromSmiles(smiles) if mol.HasSubstructMatch(Chem.MolFromSmarts("[*;R]")): return "RING" return "FG"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_entity_type(self):\n return self.entity_type", "def entity_type(self):\n return self._entity_type", "def entity_type(self) -> Optional[str]:\n return pulumi.get(self, \"entity_type\")", "def entity_type(self) -> str:\n return self._entity_type", "def entity_type(self) ->...
[ "0.8026705", "0.77205175", "0.7690819", "0.76394707", "0.7544927", "0.75048757", "0.69538164", "0.68466866", "0.67495024", "0.6543524", "0.6384864", "0.6384864", "0.63847643", "0.6349885", "0.6348386", "0.6265002", "0.6224498", "0.6190957", "0.6190957", "0.61684495", "0.61335...
0.0
-1
Get and break AtomAtom pairs in two different rings.
def get_ring_ring_splits(input_mol, labels=False, do_comb_index=False): # TODO Fix for fused e.g.s RI = input_mol.GetRingInfo() rings = RI.AtomRings() out_mols = [] bonds = [item for sublist in RI.BondRings() for item in sublist] bs = [] for bond in input_mol.GetBonds(): if bond.GetI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iter_atom_pairs(self, bound=True, unique=True, sort=True):\n blacklist = []\n for atom1 in self.iter_atoms(sort=sort):\n for atom2 in self.iter_atoms(sort=sort):\n if not atom1 == atom2:\n if not bound or is_bound(atom1.cart, atom1.element, atom2.cart,...
[ "0.59658116", "0.56597847", "0.5635806", "0.56292987", "0.54953146", "0.54759115", "0.5455739", "0.54142886", "0.54060113", "0.5320033", "0.53129005", "0.52928233", "0.52688074", "0.52503175", "0.5239089", "0.5212334", "0.521067", "0.5196737", "0.5193991", "0.51893455", "0.51...
0.6060232
0
Checks if usernamepassword combination is valid.
def valid_login(username, password): db = get_db() db.ping(True) cur = db.cursor() try: sql = "SELECT password FROM users WHERE user_name = '{}';".format(username) cur.execute(sql) for i in cur: return check_password_hash(i[0], password) return False exce...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def password_validator(username, password):\n digits = re.search(r'\\d+', password)\n capital_letters = re.search(r'[A-Z]+', password)\n lenght = len(password) > PASSWORD_MIN_LENGTH\n special_symbol = re.search(r'[\\-\\/\\@\\?\\!\\,\\.\\#\\&\\*]+', password)\n\n statement = digits and capital_letter...
[ "0.7966039", "0.7848805", "0.7792554", "0.776062", "0.76855046", "0.76335526", "0.75977254", "0.7491143", "0.74420166", "0.7403845", "0.7370911", "0.7354776", "0.7353697", "0.72918993", "0.72707045", "0.72678345", "0.7257464", "0.7235163", "0.72348094", "0.721607", "0.7211450...
0.70460725
30
Add an edge to the underlying graph.
def edge(self, viz_edge: VizEdge) -> None: self._digraph.edge(viz_edge.start, viz_edge.end)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addEdge(self, edge: Edge):\n self.edges.append(edge)", "def add_edge(self, edge):\n assert edge not in self.edges\n self.edges.append(edge)", "def add_edge(self, edge):\n src = edge.get_source()\n dest = edge.get_destination()\n #weightEdge = WeightedEdge(src, dest...
[ "0.8445283", "0.8443771", "0.83711624", "0.8369298", "0.83635324", "0.83153874", "0.8244956", "0.8088963", "0.8080543", "0.8058128", "0.8039632", "0.8031182", "0.8017334", "0.79846", "0.7972718", "0.7916044", "0.78750145", "0.7841579", "0.781696", "0.76966286", "0.7605795", ...
0.0
-1
Parse metadata lines to get metadata object (ordered dict) Allow only numbers, lists of numbers and strings
def parsemeta(metalines): def parseline(line): res = [val.strip() for val in line[5:].split(u':', 1)] key, value = (res[0], res[1]) if len(res) == 2 else (res[0], u'') if re.match(r'^-?\d*[\.|,]?\d+$', value): value = float(value) elif re.match(r'^...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_metadata(self, meta):\r\n output = {}\r\n for name, value in meta.items():\r\n name = name.lower()\r\n if name == \"summary\":\r\n # handle summary metadata as markdown\r\n # summary metadata is special case and join all list values\r\n ...
[ "0.68529207", "0.67159194", "0.66998285", "0.6539436", "0.6451507", "0.63073575", "0.6226078", "0.61940926", "0.6166599", "0.606983", "0.60641", "0.6048356", "0.6042308", "0.60304004", "0.60246766", "0.5993654", "0.5988432", "0.5985137", "0.59825426", "0.5975988", "0.596073",...
0.7264949
0
Returns the y coordinate of the last mouse click that was waited for.
def get_last_click_y(): return _cue.getMouseLocation().getY()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_y_position(self):\n return self.actual_coordinates[1]", "def get_last_click_x():\r\n return _cue.getMouseLocation().getX()", "def _get_y(self):\n return self.position.y", "def get_y(self):\n return self.coords[1]", "def get_y_position(self): \n return self.rect...
[ "0.70762795", "0.70102507", "0.70081323", "0.685298", "0.67405987", "0.6689101", "0.6683078", "0.6655625", "0.6521392", "0.65000963", "0.64991355", "0.649781", "0.6495931", "0.6438594", "0.6438594", "0.64369875", "0.641067", "0.64102703", "0.64101905", "0.63854265", "0.638531...
0.8801762
0
Convert number to nearest numbers with SI prefixes.
def prefix(num): # determine which range it lies in, r1/r2 means reduction 1 or reduction 2 divisors = [1e-24 * pow(10, 3 * x) for x in range(17)] prefixes = list(reversed(['Yotta (Y)', 'Zetta (Z)', 'Exa (E)', 'Peta (P)', 'Tera (T)', 'Giga (G)', 'Mega (M)', 'Kilo (K)', '', 'Mil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert(rates, value, from_string, to_string):\n tuple_list = (\n [x for x in rates if x[0] == from_string and x[1] == to_string])\n if tuple_list:\n return round(tuple_list[0][2] * value, 2)\n else:\n tuple_list2 = (\n [x for x in rates if x[1] == from_string and x[0] ...
[ "0.5877881", "0.58714896", "0.5813303", "0.56365305", "0.5605271", "0.55365324", "0.5487399", "0.5468763", "0.5433826", "0.54247254", "0.5419", "0.5385421", "0.53544366", "0.5351114", "0.5347292", "0.5333756", "0.53021646", "0.5281399", "0.5250965", "0.52498883", "0.52410996"...
0.0
-1
Get an array of colors, typically to use for plotting.
def getColors(num, rgb=False): cmapRGB = get_cmap('nipy_spectral', num) c = [cmapRGB(i)[:-1] for i in range(num)][1:] if rgb: return c # the negative of the first color c2 = [tuple(arr((1, 1, 1)) - arr(color)) for color in c] c = ['#%02x%02x%02x' % tuple(int(255 * color[i]) for i in rang...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getColors():\n return ['#8c99fc', '#cacefd', '#fff1d7', '#feda98', '#fda85a', '#fc6647']", "def getColors():\n colors = ['#d53e4f',\n '#fc8d59',\n '#fee08b',\n '#ffffbf',\n '#e6f598',\n '#99d594',\n '#3288bd',\n ]...
[ "0.8431883", "0.8252241", "0.757633", "0.7556513", "0.749515", "0.742635", "0.742635", "0.7417511", "0.738863", "0.7332588", "0.72232324", "0.7163443", "0.6962239", "0.6939394", "0.6923644", "0.69206274", "0.69086355", "0.68662906", "0.68428737", "0.6819765", "0.6807507", "...
0.6660558
29
Test we enforce valid username/password.
def test_client_id_user_pass() -> None: with pytest.raises(ValueError): indieauth._parse_client_id("http://user@ex.com/") with pytest.raises(ValueError): indieauth._parse_client_id("http://user:pass@ex.com/")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_valid_username_invalid_password(self):\n response = self.client.post(reverse('users:login'), {'username': self.user['username'], 'password': '1sfsdf'})\n self.assertEqual(response.status_code, 200)\n self.assertFormError(response, 'form', None, ERROR_MSG)", "def test_validate_creden...
[ "0.7933663", "0.7823255", "0.77807546", "0.7710019", "0.7672158", "0.7611543", "0.76070577", "0.7532508", "0.7479734", "0.7427894", "0.74191535", "0.7379525", "0.731763", "0.7310791", "0.73100597", "0.7270722", "0.72338974", "0.72298527", "0.72156423", "0.7204777", "0.7204575...
0.0
-1
Test we update empty paths.
def test_parse_url_lowercase_host() -> None: assert indieauth._parse_url("http://ex.com/hello").path == "/hello" assert indieauth._parse_url("http://EX.COM/hello").hostname == "ex.com" parts = indieauth._parse_url("http://EX.COM:123/HELLO") assert parts.netloc == "ex.com:123" assert parts.path == "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_empty(self):\n self.assertFalse(os.path.exists('/'))", "def empty_paths(self):\n self.paths[:]", "def test_set_artifacts_path__deny_change_to_empty():\n path_before = copy.copy(ContractHandler.artifacts_path)\n assert path_before is not None\n assert ContractHandler._contrac...
[ "0.6695401", "0.6604934", "0.6527157", "0.6268614", "0.62626314", "0.6109458", "0.6092667", "0.6079784", "0.60396063", "0.6032325", "0.599547", "0.59649366", "0.5959601", "0.59150314", "0.59150314", "0.59150314", "0.59129804", "0.5910636", "0.5888191", "0.58724904", "0.587104...
0.0
-1
Test we update empty paths.
def test_parse_url_path() -> None: assert indieauth._parse_url("http://ex.com").path == "/"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_empty(self):\n self.assertFalse(os.path.exists('/'))", "def empty_paths(self):\n self.paths[:]", "def test_set_artifacts_path__deny_change_to_empty():\n path_before = copy.copy(ContractHandler.artifacts_path)\n assert path_before is not None\n assert ContractHandler._contrac...
[ "0.6695401", "0.6604934", "0.6527157", "0.6268614", "0.62626314", "0.6109458", "0.6092667", "0.6079784", "0.60396063", "0.6032325", "0.599547", "0.59649366", "0.5959601", "0.59150314", "0.59150314", "0.59150314", "0.59129804", "0.5910636", "0.5888191", "0.58724904", "0.587104...
0.0
-1
Given at least 2 elements in a, generates the Cartesian product of all elements in the list.
def cartesian_graph(a): tile_a = tf.expand_dims(tf.tile(tf.expand_dims(a[0], 1), [1, tf.shape(a[1])[0]]), 2) tile_b = tf.expand_dims(tf.tile(tf.expand_dims(a[1], 0), [tf.shape(a[0])[0], 1]), 2) cart = tf.concat([tile_a, tile_b], axis=2) cart = tf.reshape(cart, [-1, 2]) for c in a[2:]: tile_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cartesian(arrays, out=None):\n\n arrays = [np.asarray(x) for x in arrays]\n dtype = arrays[0].dtype\n\n n = np.prod([x.size for x in arrays])\n if out is None:\n out = np.zeros([n, len(arrays)], dtype=dtype)\n\n m = n / arrays[0].size\n out[:,0] = np.repeat(arrays[0], m)\n if arrays...
[ "0.6750718", "0.6750718", "0.67469853", "0.674225", "0.67377234", "0.6735327", "0.6693337", "0.6677904", "0.66510355", "0.6474917", "0.6449693", "0.6433361", "0.64302397", "0.64208287", "0.637844", "0.6307896", "0.62475723", "0.61624545", "0.61596316", "0.6150428", "0.6140976...
0.6568091
9
Rotation matrix for rotation of `theta` radians around z axis
def z_rotmat(theta): cos_t = np.cos(theta) sin_t = np.sin(theta) return np.array([[cos_t, -sin_t, 0], [sin_t, cos_t, 0], [0, 0, 1]])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rot_z(theta):\n theta_rad = np.radians(theta)\n rotation_matrix = [[np.cos(theta_rad), -np.sin(theta_rad), 0],\n [np.sin(theta_rad), np.cos(theta_rad), 0],\n [0, 0, 1]]\n return np.matrix(rotation_matrix)", "def rotation3Dz(theta):\n rmat = np.zeros((3,...
[ "0.89510113", "0.8513268", "0.8401193", "0.8271346", "0.8271156", "0.7886113", "0.78525066", "0.78206825", "0.7718722", "0.7700243", "0.76467", "0.7621795", "0.75594187", "0.7555873", "0.7543994", "0.7539651", "0.7486037", "0.7455395", "0.74365795", "0.7422053", "0.74098134",...
0.883624
1
Initializes the class by reading the config values and constructing a sensor (if not passed in). In the normal case, the sensor value should be None, thus allowing this class to use the trigger_pin and echo_pin config values to initialize its own Sensor instance. The only time one should need to pass in a Sensor instan...
def __init__(self, config, sensor=None): if sensor is None: from monitor.sensor import SensorDriver self.sensor = SensorDriver(config.getint(CONFIG_SECTION, "trigger_pin"), config.getint(CONFIG_SECTION, "echo_pin")) else: self.se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(self, sensors = None, readings = None, clients = None):\n\n self.sensors = sensors\n self.readings = readings\n self.clients = clients", "def __init__(self) -> None:\n self.sensor = serial.Serial(config.DEVICE)\n super().__init__()", "def __init__(self):\n ...
[ "0.6623096", "0.66055477", "0.655587", "0.64301217", "0.64230275", "0.6369357", "0.6350495", "0.6325234", "0.62492365", "0.6221387", "0.6210502", "0.6198117", "0.61677915", "0.61502326", "0.6140377", "0.61286414", "0.6103818", "0.6072014", "0.6067331", "0.6060488", "0.6049602...
0.80569386
0
Calculate one forward propagation pass with yhat = WX + B followed by ReLU
def forward_propagation(X, W, B): # We are doing a linear transformation with WX + B, # then we are doing a ReLU with the "maximum" Z = np.matmul(W, X) + B yhat = np.maximum(0, Z) return Z, yhat
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def propagate_forward(self, X):\n\n A = X\n L = self.L - 1\n\n for i in range(0, L - 1):\n Z = np.matmul(self.W[i], A) + self.b[i]\n cache = ((A, self.W[i], self.b[i]), Z)\n A = relu(Z)\n self.caches[i] = cache\n Z = np.matmul(self.W[L - 1], A...
[ "0.72324014", "0.7193855", "0.712205", "0.7118211", "0.70029944", "0.69511974", "0.69348174", "0.69012004", "0.6885891", "0.6885685", "0.68315583", "0.6812272", "0.6811642", "0.67951196", "0.6785825", "0.67706", "0.6739923", "0.6735901", "0.6696897", "0.66962826", "0.6692639"...
0.79619485
0
The loss, not to be confused with the cost, is just the difference between yhat (the values we calculated) and Y (the correct result)
def loss(A, Y): return A - Y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loss(self, y: np.ndarray, y_hat: np.ndarray) -> float:\n losses = -(y * np.log(y_hat) + (1 - y) * np.log(1 - y_hat))\n return losses.mean() + self.reg / self.num_parameters * (\n (self.v[:, -1] ** 2).sum() + (self.w ** 2).sum()\n )", "def loss(y, y_hat):\n residual = 0\n ...
[ "0.83081317", "0.8053836", "0.804925", "0.80340034", "0.79513526", "0.79112697", "0.7830561", "0.78220916", "0.77000165", "0.7628609", "0.7599095", "0.7530624", "0.7508241", "0.7504533", "0.74959075", "0.7491703", "0.74726677", "0.74414235", "0.73721355", "0.73415023", "0.733...
0.78762436
6
Uses the Gaussian (normal) distribution to initialize the parameters for all the layers. It randomizes the training examples as layer 0.
def initialize_parameters_for_layers(layer_list, training_examples): W = [None] * len(layer_list) B = [None] * len(layer_list) X = np.random.randn(layer_list[0], training_examples) for j in range(1, len(layer_list)): W[j] = np.random.randn(layer_list[j], layer_list[j-1]) B[j] = np.random...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _random_weight_initialization(self, mean=0, stddev=1):\n self.slp_weights = np.random.normal(mean, stddev, size=(self.n_rbfs, self.n_targets))", "def initialize_parameters(self):\n for i in range(1, self.L):\n self.W[i - 1] = np.random.randn(self.layer_dims[i], self.layer_dims[i - 1]...
[ "0.72450733", "0.70321673", "0.6880616", "0.6697837", "0.6674255", "0.6605887", "0.6539226", "0.6534349", "0.65118116", "0.6511221", "0.65010405", "0.6493671", "0.6427588", "0.642642", "0.6425967", "0.64197356", "0.63975143", "0.6392598", "0.6387074", "0.6363642", "0.63564897...
0.63189447
24
Plot an image array on the screen.
def plot_image(image, limits=None, title=None): # If the image is complex, warn the user and plot only the real part. if np.iscomplexobj(image): warnings.warn('Image is complex; only displaying real part') image = np.real(image) # Plot the scaled image if no limits are provided. if lim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display(array):\n plt.figure()\n plt.imshow(array)\n plt.show()", "def plot_numpy_img(np_img):\n plt.imshow(np_img, interpolation='nearest')\n plt.show()", "def display(array):\n if isinstance(array, np.ndarray):\n plt.imshow(array)\n plt.show()\n ...
[ "0.8083877", "0.7621783", "0.75547636", "0.7445747", "0.71700436", "0.69504726", "0.69481796", "0.6945318", "0.69332254", "0.6886047", "0.68834215", "0.6692736", "0.6679821", "0.667302", "0.6633403", "0.66268796", "0.66121835", "0.66057837", "0.65990543", "0.65990543", "0.659...
0.0
-1
Plot a threedimensional quiver plot on screen.
def plot_quiver(vec_field, width=(1, 1, 1), title=None): # Generate a figure with 3D axes. fig = plt.figure() ax = fig.gca(projection='3d') # Get resolution res = np.shape(vec_field)[0:3] # Make the voxel grid x, y, z = np.meshgrid(np.arange(-width[0] / 2, width[0] / 2, width[0] / res[0])...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_quiver(\n trj: TrajaDataFrame,\n bins: Optional[Union[int, tuple]] = None,\n quiverplot_kws: dict = {},\n **kwargs,\n) -> Axes:\n\n after_plot_args, _ = _get_after_plot_args(**kwargs)\n\n X, Y, U, V = coords_to_flow(trj, bins)\n Z = np.sqrt(U * U + V * V)\n\n fig, ax = plt.subplots...
[ "0.67471987", "0.6668109", "0.6493304", "0.63498944", "0.6283693", "0.61684316", "0.6159947", "0.6137141", "0.6106258", "0.60999334", "0.5900313", "0.5875842", "0.58402973", "0.5814336", "0.5812573", "0.5797149", "0.57767075", "0.57475734", "0.5745139", "0.5733174", "0.573220...
0.5750375
17
Save an image array in an image format. This produces a clean image with no axes or border.
def save_image(image, output_path, limits=None): # Generate a figure with no axes, border, etc. fig = plt.figure() fig.set_size_inches(1, 1) ax = plt.Axes(fig, [0, 0, 1, 1]) ax.set_axis_off() fig.add_axes(ax) # If the image is complex, warn the user and discard the imaginary part. if n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_array_as_image(arr, filename):\n arr = arr.copy().clip(0, 255).astype('uint8')\n im = Image.fromarray(arr)\n im.save(filename)", "def save_npimg(array: np.ndarray, path: str) -> None:\r\n img = Image.fromarray(array.squeeze())\r\n img.save(path)", "def save_image(path, image): \n if le...
[ "0.74521106", "0.7398003", "0.70915765", "0.708634", "0.70116305", "0.69960225", "0.6979536", "0.6927554", "0.6908419", "0.69067883", "0.67870927", "0.6734198", "0.66833395", "0.66709673", "0.665822", "0.6637255", "0.65556484", "0.653073", "0.6511239", "0.6492289", "0.6480823...
0.5913399
52
Rounds time to 4/8/12 AM/PM.
def release_time(date_time): time_hour = int(date_time.strftime('%H')) quotient = int(time_hour / 4) if quotient == 5: date_time = datetime.combine(date_time.date()+timedelta(1), time(0,0)) else: date_time = datetime.combine(date_time.date(), time((quotient+1)*4,0)) r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_time(time: int) -> str:\n minute = time % 100\n hour = int(time / 100)\n\n if hour >= 12:\n if hour > 12:\n hour = hour -12\n response = f'{hour} {minute} pm'\n else:\n response = f'{hour} {minute} am'\n\n return response", "def round_time(self, time):\n ...
[ "0.6743482", "0.6449745", "0.64481854", "0.6378203", "0.624882", "0.60521114", "0.59160554", "0.5871842", "0.58707505", "0.58488184", "0.58358794", "0.57936954", "0.57530534", "0.5738147", "0.57171357", "0.5671024", "0.56705564", "0.5640816", "0.5608962", "0.5574627", "0.5574...
0.5824333
11
Solves a univariate diophantine equations. Explanation =========== A univariate diophantine equation is an equation of the form `a_{0} + a_{1}x + a_{2}x^2 + .. + a_{n}x^n = 0` where `a_{1}, a_{2}, ..a_{n}` are integer constants and `x` is an integer variable. Usage =====
def diop_univariate(eq): var, coeff, diop_type = classify_diop(eq, _dict=False) if diop_type == Univariate.name: return {(int(i),) for i in solveset_real( eq, var[0]).intersect(S.Integers)}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def analyticSol (x):\n\treturn x*(1-x);", "def linear_diophantine(a, b, c):\n # d = pa + qb\n p, q, d = extended_euclidian(a, b)\n if d == 0 or c % d != 0:\n return None\n # ax + by = c <=> a'x + b'y = c'\n a, b, c = a // d, b // d, c // d\n return p * c, q * c, a, b", "def zzX_diophan...
[ "0.60249513", "0.59195673", "0.58596015", "0.57925516", "0.57472533", "0.5679409", "0.5631155", "0.5631155", "0.5616272", "0.5607293", "0.55954486", "0.5595439", "0.5569689", "0.5569689", "0.55627716", "0.54942864", "0.54492813", "0.5401495", "0.5380808", "0.5282501", "0.5277...
0.5003401
49
r""" Returns a special dot product of the vectors `u = (u_{1}, u_{2})` and `v = (v_{1}, v_{2})` which is defined in order to reduce solution of the congruence equation `X^2 aZ^2 \equiv 0 \ (mod \ b)`.
def dot(u, v, w, a, b): u_1, u_2 = u v_1, v_2 = v return (w*u_1 + b*u_2)*(w*v_1 + b*v_2) + abs(a)*u_1*v_1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dot_vectors(u, v):\n return u[0] * v[0] + u[1] * v[1] + u[2] * v[2]", "def dot_product(u, v):\n ret = 0.0\n for i in range(len(u)):\n ret += float(float(u[i]) * float(v[i]))\n return ret", "def vector_dot(v1,v2):\n return (v1.x * v2.x) + (v1.y * v2.y) + (v1.z * v2.z)", "def dotProdu...
[ "0.7950857", "0.75288385", "0.7522804", "0.73738956", "0.7357853", "0.7339615", "0.7303692", "0.72513527", "0.72290015", "0.7170018", "0.7169143", "0.7158276", "0.7121757", "0.7081416", "0.70210546", "0.7018486", "0.70145714", "0.6974848", "0.6963552", "0.69441426", "0.693887...
0.7824539
1
Returns a generator that can be used to generate partitions of an integer `n`. Explanation =========== A partition of `n` is a set of positive integers which add up to `n`. For example, partitions of 3 are 3, 1 + 2, 1 + 1 + 1. A partition is returned as a tuple. If ``k`` equals None, then all possible partitions are re...
def partition(n, k=None, zeros=False): if not zeros or k is None: for i in ordered_partitions(n, k): yield tuple(i) else: for m in range(1, k + 1): for i in ordered_partitions(n, m): i = tuple(i) yield (0,)*(k - len(i)) + i
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def partitions(n, k):\n if k == 1:\n yield (n,)\n return\n for i in range(1, n):\n for p in partitions(n-i, k-1):\n yield (i,) + p", "def parition_generator(n):\n # generator\n k = np.zeros(n, dtype=np.dtype(int))\n Z = np.zeros(n, dtype=np.dtype(int))\n h = [flo...
[ "0.8151417", "0.7783835", "0.74992603", "0.7395536", "0.6835849", "0.66346866", "0.65193653", "0.6518118", "0.6432495", "0.641255", "0.6350289", "0.6323939", "0.62612194", "0.6255318", "0.62544686", "0.6222995", "0.6217608", "0.619579", "0.6087453", "0.5984424", "0.59751225",...
0.8531512
0
r""" Returns a generator for finding ktuples of integers, `(n_{1}, n_{2}, . . . n_{k})`, such that `n = n_{1}^p + n_{2}^p + . . . n_{k}^p`. Usage =====
def power_representation(n, p, k, zeros=False): n, p, k = [as_int(i) for i in (n, p, k)] if n < 0: if p % 2: for t in power_representation(-n, p, k, zeros): yield tuple(-i for i in t) return if p < 1 or k < 1: raise ValueError(filldedent(''' Expectin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def partitions(n, k):\n if k == 1:\n yield (n,)\n return\n for i in range(1, n):\n for p in partitions(n-i, k-1):\n yield (i,) + p", "def partition(n, k=None, zeros=False):\n if not zeros or k is None:\n for i in ordered_partitions(n, k):\n yield tuple(i...
[ "0.7479812", "0.6864269", "0.6725188", "0.6606612", "0.6476373", "0.6454871", "0.6413989", "0.6408966", "0.6377821", "0.6368389", "0.63032275", "0.6301852", "0.630057", "0.63005334", "0.6282942", "0.6269676", "0.6237687", "0.61688274", "0.61648625", "0.6160839", "0.6156447", ...
0.66246575
3
Return True if n can be written as the sum of k squares, False if it cannot, or 1 if ``k == 2`` and ``n`` is prime (in which case it can be written as a sum of two squares). A False is returned only if it cannot be written as ``k``squares, even if 0s are allowed.
def _can_do_sum_of_squares(n, k): if k < 1: return False if n < 0: return False if n == 0: return True if k == 1: return is_square(n) if k == 2: if n in (1, 2): return True if isprime(n): if n % 4 == 1: return 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maybe_prime(n: int, k: int = 3) -> bool:\n if n < 2:\n return False\n for p in small_primes:\n if n < p * p:\n return True\n if n % p == 0:\n return False\n r, s = 0, n - 1\n while s % 2 == 0:\n r += 1\n s //= 2\n for _ in range(k):\n ...
[ "0.6561184", "0.65501326", "0.6427308", "0.64001", "0.6352532", "0.6348876", "0.6299129", "0.6235472", "0.6163073", "0.612142", "0.6099018", "0.6086076", "0.60442114", "0.6026132", "0.60021317", "0.59826374", "0.5964831", "0.5940305", "0.5911724", "0.5869586", "0.58663046", ...
0.8653324
0
Return a list of all legal moves available to the active player. Each player should get a list of all empty spaces on the board on their first move, and otherwise they should get a list of all open spaces in a straight line along any row, column or diagonal from their current position. (Players CANNOT move through obst...
def get_legal_moves(self): moves = [] if self.player_locations[self.whose_turn] is None: return self.get_blank_locations() matrix = [(1,0), (-1,0), (0,1), (0,-1), (1,1), (1,-1), (-1, 1), (-1,-1)] for dx, dy in matrix: x,y = self.player_locations[self.whose_turn] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_moves(self, board, player):\n result = []\n for startx in range(8):\n for starty in range(8):\n for destx in range(8):\n for desty in range(8):\n if self.is_legal_move(board, [startx, starty], [destx, desty], player):\n ...
[ "0.8000684", "0.7773118", "0.7586156", "0.75859827", "0.7583773", "0.7564738", "0.74822897", "0.74147075", "0.7363811", "0.7343176", "0.7341429", "0.7339519", "0.7329256", "0.73158693", "0.7315806", "0.7281532", "0.72739327", "0.7258576", "0.72462726", "0.72447574", "0.723927...
0.803273
0
Heapify the given array
def heapify(self, A: list, i: int): left = 2*i right = (2*i) + 1 heapIndex = i if self.isMax == True: #Max heap if left < self.size and A[left] > A[heapIndex]: heapIndex = left #New largest if right < self.size and A[right] > A[heapInd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_heap(arr):\n for i in range((len(arr)//2), -1, -1):\n heapify(arr,index=i, size=len(arr)-1)", "def build_heap(arr):\n for i in range(len(arr)-1, -1, -1):\n down_heapify(arr, len(arr), i)", "def heapify(x):\n pass", "def heapify(array):\n # Start by sifting down the first p...
[ "0.8211661", "0.8032507", "0.7943686", "0.7833598", "0.76331764", "0.7571177", "0.7472281", "0.7352209", "0.7331762", "0.7325254", "0.7315894", "0.7281005", "0.72591686", "0.7259155", "0.7203545", "0.7190889", "0.702588", "0.7017997", "0.6997299", "0.6957263", "0.6941996", ...
0.6451166
45
Build heap from given list
def build_heap(self, A: list): self.size = len(A) med = (self.size // 2) - 1 #Mid point of array for i in range(0, med + 1): #Reverse iteration self.heapify(A, med - i) #Reverse iteration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def construct_max_heap(self, lst):\n self.heap_list = lst\n #start compare node\n node = (len(self.heap_list)-2)/2\n while node >= 0:\n self.sift_down(node, len(self.heap_list)-1)\n node -= 1", "def build_max_heap(self, list_to_be_heap):\n self.heaplist = ...
[ "0.7733524", "0.7665328", "0.7585385", "0.7496225", "0.74051243", "0.74012357", "0.7397051", "0.7390889", "0.7278791", "0.7245909", "0.7225965", "0.72010607", "0.7190792", "0.7187829", "0.7187829", "0.71755636", "0.70264786", "0.6883777", "0.68744147", "0.6786777", "0.6684687...
0.710583
16
Returns the net heat flow summed over all intervals.
def net_heat_flow(self): return sum(i.heat_flow for i in self.intervals)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_heat_sum(tmin, tmax, tbase=6.0):\n tmax = min(tmax, 30.0)\n tx = (tmin + tmax) / 2.0\n return max(tx - tbase, 0.0)", "def sum(self, flow=False):\n return self._hist.sum(flow)", "def summation(colors):\n return np.sum(colors, -1)", "def compute_heatsum_per_day(maxTemps, minTemps):\...
[ "0.6166869", "0.59363246", "0.5524207", "0.5494214", "0.54568416", "0.5422755", "0.534893", "0.5241173", "0.5239712", "0.52246624", "0.51893425", "0.5185986", "0.5185986", "0.51702714", "0.5137205", "0.5109018", "0.51044893", "0.5080882", "0.50262225", "0.50031", "0.4976768",...
0.8429628
0
Return two randomly chosen PETs
def lotto(): # randomly reorder the PETS list random.shuffle(PETS) # return the first two items in the PETS list return [PETS[0], PETS[1]]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_random_pet():\n resp = HTTP_request.get(' https://api.petfinder.com/v2/animals',\n params={\n \"limit\": 100,\n },\n headers={\"Authorization\": f\"Bearer {pet_finder_token}\"})\n\n pets = resp.json()[\"animals\"]\n\n random_pet = random.choice(pets)\n\n re...
[ "0.64041954", "0.62339264", "0.6210921", "0.6151756", "0.61071044", "0.6058716", "0.5903469", "0.5783984", "0.57775664", "0.57580894", "0.5725573", "0.5706698", "0.5649349", "0.5615236", "0.5610193", "0.5605159", "0.5586027", "0.55515933", "0.55355704", "0.55318683", "0.55276...
0.62105364
3
Returns the score on the given data, if the estimator has been refit. This uses the score defined by ``scoring`` where provided, and the ``best_estimator_.score`` method otherwise.
def score(self, X, y=None): self._check_is_fitted('score') if self.scorer_ is None: raise ValueError("No score function explicitly defined, " "and the estimator doesn't provide one %s" % self.best_estimator_) score = self.scor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def score(self, X, y=None):\n X = _validate_X(X)\n y = _validate_y(y)\n\n if not hasattr(self, 'scorer_') or self.scorer_ is None:\n raise ValueError(\"No score function explicitly defined, \"\n \"and the estimator doesn't provide one %s\"\n ...
[ "0.7313498", "0.7019969", "0.68295705", "0.66166914", "0.65243155", "0.6503311", "0.6480312", "0.642595", "0.6283114", "0.6205799", "0.6185939", "0.61381346", "0.6060636", "0.6026818", "0.59923345", "0.5936567", "0.58994246", "0.58483404", "0.5824809", "0.5810988", "0.5786797...
0.75780076
0
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix inorder arguments and keyword arguments.
def __init__(self, *args, **kwds): if args or kwds: super(observationRPY, self).__init__(*args, **kwds) #message fields cannot be None, assign default values for those that are if self.position is None: self.position = pcl_segment.msg.positionRPY() if self.is_Known is None: s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwds):\n if args or kwds:\n super(KomodoSpeechRecCommand, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.header is None:\n self.header = std_msgs.msg.Header()\n if self.cmd is None:\n ...
[ "0.7794478", "0.77204376", "0.77204376", "0.76865023", "0.7625996", "0.7563802", "0.74399596", "0.74173665", "0.73513013", "0.73086345", "0.72797984", "0.7237519", "0.7227004", "0.7224259", "0.7224259", "0.7218872", "0.72119284", "0.72119284", "0.72119284", "0.72119284", "0.7...
0.0
-1
Set up the test case with a user.
def setUp(self): # noqa super(GeonamesTestCase, self).setUp() self._admin = self.model('user').createUser( 'admin', 'password', 'admin', 'user', 'admin@example.com', admin=True) self._user = self.model('user').createUser( 'minervauser', 'password', 'minerva'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_user(self):\r\n self.email = 'foo@test.com'\r\n self.password = 'bar'\r\n self.username = 'test'\r\n self.create_account(self.username,\r\n self.email, self.password)\r\n self.activate_user(self.email)\r\n self.login(self.email, self.pa...
[ "0.77436024", "0.75182045", "0.750216", "0.7499665", "0.7476557", "0.7475157", "0.7475157", "0.74514866", "0.744934", "0.74491787", "0.7433773", "0.7421106", "0.7392623", "0.7325794", "0.73192704", "0.7282397", "0.7278737", "0.7276982", "0.72619313", "0.72498167", "0.7227374"...
0.0
-1
Calculates a file sha256 or md5 hash.
def _hash_file(fpath, algorithm='sha256', chunk_size=65535): if isinstance(algorithm, str): hasher = _resolve_hasher(algorithm) else: hasher = algorithm with open(fpath, 'rb') as fpath_file: for chunk in iter(lambda: fpath_file.read(chunk_size), b''): hasher.update(chunk) return hasher.hexdi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_file_hash(filepath):\n with open(filepath, 'rb') as f:\n return md5(f.read()).hexdigest()", "def hashfile(file):\n\n hasher = hashlib.sha256()\n\n with open(file, 'rb') as afile:\n buf = afile.read(BLOCKSIZE)\n hasher.update(buf)\n\n return(hasher.hexdigest())", "def _...
[ "0.7786545", "0.7769877", "0.7761857", "0.7740141", "0.77280766", "0.7658293", "0.76109266", "0.7597406", "0.7573602", "0.75731796", "0.75547624", "0.75205857", "0.7517073", "0.74882835", "0.7468499", "0.7444793", "0.7432471", "0.74276716", "0.74213576", "0.74201006", "0.7382...
0.71841
41
Gets batch at position `index`.
def __getitem__(self, index): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, index):\n # get the indexs of each batch\n batch_indexs = self.indexes[index*self.batch_size:(index+1)*self.batch_size]\n # using batch_indexs to get path of current batch\n batch_path = [self.X_path[k] for k in batch_indexs]\n # get batch data\n batc...
[ "0.7656679", "0.7603585", "0.74478835", "0.7352959", "0.73506784", "0.7243818", "0.7213737", "0.7213737", "0.71921736", "0.71921736", "0.7157495", "0.7124583", "0.71189356", "0.70656055", "0.7063249", "0.69080466", "0.69080466", "0.6777095", "0.6733908", "0.6619787", "0.66046...
0.0
-1
Wait for the queue to be empty.
def _wait_queue(self): while True: time.sleep(0.1) if self.queue.unfinished_tasks == 0 or self.stop_signal.is_set(): return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _wait_empty(self):\n while True:\n if self.queue.empty():\n # We still have to wait for the last queue item being processed\n # (queue.empty() returns True before queue.task_done() is\n # called).\n self.queue.join()\n ...
[ "0.8982549", "0.8213569", "0.8069371", "0.7622824", "0.7265177", "0.72617537", "0.7199978", "0.7160778", "0.7152426", "0.71223426", "0.70723593", "0.7032268", "0.6995655", "0.6990395", "0.6975788", "0.6964058", "0.69503295", "0.69113475", "0.6909111", "0.6893445", "0.6877515"...
0.7763727
3
Gets the currentlyrunning duet task. This must be called from within a running async function, or else it will raise a RuntimeError.
def current_task() -> Task: try: return _current_task.get() except LookupError: raise RuntimeError("Can only be called from an async function.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_task(self):\n return self.queue.get()", "def current_task(self):\n try:\n return self.active_item(remove=False)\n except queue.Empty:\n return None", "def _get_current_task():\r\n return current_task", "def _get_current_task():\r\n return current_task"...
[ "0.7482446", "0.73506457", "0.7274522", "0.7274522", "0.7122297", "0.6915014", "0.6913385", "0.6913385", "0.6913385", "0.6913385", "0.6913385", "0.66671145", "0.6424109", "0.6402442", "0.6379625", "0.636109", "0.628069", "0.6240921", "0.6182584", "0.6095428", "0.6076426", "...
0.78834015
0
Hide the widget by adding the dnone html class to the widget. Save the previous class and set viz attribute to False.
def hide(self): if not 'd-none' in str(self.class_): self.old_class = self.class_ self.class_ = 'd-none' self.viz = False return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hide(self):\n self.visible = False", "def hide(self):\n self.set_visible(False)", "def unHide(self):\n self.visible = True", "def ensure_hidden(self):\n self.set_visible(False)", "def toggle_hidden(self):\n if self.hidden:\n self.show()\n else:\n ...
[ "0.748155", "0.7446891", "0.7445759", "0.7321829", "0.69841665", "0.6910661", "0.6910661", "0.6869434", "0.6869434", "0.6856724", "0.68148714", "0.6795722", "0.6777603", "0.67516553", "0.67223257", "0.67000103", "0.6658978", "0.65718645", "0.6516942", "0.65008354", "0.6499523...
0.8425613
0
Hide the widget by removing the dnone html class to the widget Save the previous class and set viz attribute to True.
def show(self): if self.old_class: self.class_ = self.old_class if 'd-none' in str(self.class_): self.class_ = str(self.class_).replace('d-none', '') self.viz = True return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hide(self):\n\n if not 'd-none' in str(self.class_):\n self.old_class = self.class_\n self.class_ = 'd-none'\n\n self.viz = False\n\n return self", "def unHide(self):\n self.visible = True", "def hide(self):\n self.visible = False", "def hide(self)...
[ "0.81186175", "0.7484487", "0.7468306", "0.73704565", "0.7116422", "0.6949298", "0.69383186", "0.689332", "0.6850425", "0.6850425", "0.6809649", "0.6809649", "0.67778593", "0.67379236", "0.67172027", "0.6692686", "0.6573571", "0.65499467", "0.65168744", "0.6506288", "0.646014...
0.6449419
22
Sorts the current routes in order of dynamic parameters ascending. The catchall route is always placed to the end.
def sort_routes(self): current_routes = self.routes.copy() for method in current_routes.keys(): current_routes[method].sort(key=lambda route: -route.pattern.count(b"/")) current_routes[method].sort(key=lambda route: len(route.param_names)) current_routes[method].sort...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _sort_routes(self):\n sorted_routes = OrderedDict()\n for inp_lab, inp in self.inputs.items():\n if inp_lab not in self.routes:\n continue\n sorted_routes[inp_lab] = OrderedDict()\n for out_lab, out in self.outputs.items():\n if out_l...
[ "0.6953572", "0.5846645", "0.57272774", "0.57272774", "0.5657351", "0.5489705", "0.5406363", "0.5375979", "0.53661907", "0.53634363", "0.53601635", "0.53370047", "0.53307194", "0.52761364", "0.5272979", "0.52632207", "0.5247552", "0.5233699", "0.52210313", "0.5210721", "0.517...
0.76602757
0
Returns the value of the maximum scoring sequence in ar.
def max_score(ar, scorer: Optional[topk_scorer]=None): assert len(ar) > 0, "dc.max_score is not defined for empty arrays" if scorer is None: scorer = alpha_length_normalized() def op_max_score(seqs, score): res = np.array([score] + [scorer(s.logprobs, s) for s in seqs]) return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_score(self):\n return max(self._extract_set('score') or [0])", "def getMaxAlignmentScore(self):\n # get max of each row\n # max_scores = [max(i) for i in self.matrix]\n\n # return the max of the max vaules\n return numpy.max(self.matrix)", "def max(self):\n max...
[ "0.7127563", "0.70873386", "0.69916123", "0.6841162", "0.67739606", "0.6766107", "0.6715926", "0.66732097", "0.6657911", "0.65869117", "0.6580604", "0.6541371", "0.65367335", "0.6490844", "0.64814013", "0.6479744", "0.64717054", "0.64717054", "0.64717054", "0.6433435", "0.642...
0.7726154
0
Returns the value of the minimum scoring sequence in ar.
def min_score(ar, scorer: Optional[topk_scorer]=None): assert len(ar) > 0, "dc.min_score is not defined for empty arrays" if scorer is None: scorer = alpha_length_normalized() def op_max_score(seqs, score): return np.array([score] + [scorer(s.logprobs, s) for s in seqs]).min() return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_score(self):\n return min(self._extract_set('score') or [0])", "def argmin(seq, fn):\n best = seq[0]; best_score = fn(best)\n for x in seq:\n x_score = fn(x)\n if x_score < best_score:\n best, best_score = x, x_score\n return best", "def ...
[ "0.7002847", "0.6768277", "0.67613745", "0.67371047", "0.67124754", "0.6652967", "0.6652967", "0.6625174", "0.64696425", "0.6419198", "0.64010924", "0.64010924", "0.6391168", "0.63849664", "0.6362425", "0.629637", "0.62874985", "0.6255259", "0.6255259", "0.62148124", "0.62126...
0.76840615
0
Names the sequences in this pool with the given name. This information is useful for debugging purposes.
def name(self, name=None, nopath=False): if name is None: return self for path, result in self.sequences.items(): if result is None: continue for s in result: if hasattr(s, "pool"): if path is NoDim or nopat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seqFromName(self, name):\n\t\tseqDict = self.sequenceDict()\n\t\treturn seqDict[name]", "def name(self, name):\n return self.name", "def name(self, name):\n\n return self.name", "def get_name(self):\n name = ''.join(self.__name_list)\n\n self.__increment(len(self.__name_list) ...
[ "0.64284045", "0.6339733", "0.6319884", "0.6261095", "0.6208408", "0.6133857", "0.6133857", "0.6133857", "0.6133857", "0.6133857", "0.6133857", "0.60687274", "0.60687274", "0.60654306", "0.6055918", "0.6055791", "0.6051721", "0.6031469", "0.6031469", "0.6031469", "0.6031469",...
0.635276
1
Returns item `i` at the given path in this array.
def item(self, i, path=None): if path is None: assert list(self.sequences.keys())[0] is NoDim, "Cannot access item without path if the array has more than one dimension." path = NoDim return self.sequences[path][i]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def image_path_at(self, i):\n return self.image_path_from_index(self._image_index[i])", "def image_path_at(self, i):\n return self.image_path_from_index(self._image_index[i])", "def __getitem__(self, i):\n return self.get(i, i + 1)", "def __getitem__(self,i):\n return self._items[i]", "...
[ "0.6716055", "0.6716055", "0.6666471", "0.6571183", "0.6557363", "0.65095776", "0.6494377", "0.64751035", "0.64106154", "0.64106154", "0.64106154", "0.64106154", "0.64106154", "0.6235987", "0.6121021", "0.60928845", "0.6087031", "0.60627973", "0.60606676", "0.60439533", "0.60...
0.7906305
0
Returns a new DataArray with the same shape as this one, but with only unique sequences within each pool.
def unique(self): return self.element_wise(lambda seqs: list(set(seqs)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def without_duplicates(self) -> \"SampleDataSet\":\n return SampleDataSet(self._data.drop_duplicates())", "def remove_duplicates(a):\n b = np.ascontiguousarray(a).view(np.dtype((np.void, a.dtype.itemsize * a.shape[1])))\n dedup = np.unique(b).view(a.dtype).reshape(-1, a.shape[1])\n return dedup",...
[ "0.614951", "0.5665234", "0.5645208", "0.5541726", "0.5507382", "0.5385371", "0.53743726", "0.5290405", "0.5273045", "0.5233762", "0.52220154", "0.521804", "0.52133834", "0.5156926", "0.51566297", "0.5150363", "0.5123475", "0.51182115", "0.5093594", "0.50819117", "0.5076379",...
0.5660854
2
Returns all of the nodes in the graph as a collection (set, list, or similar)
def get_vertices(self): output = [] for vertex in self.adjacency_list: output.append(vertex.value) return output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nodes(self):\n\n return list(set(self._graph.keys() + [x for x in itertools.chain.from_iterable(self._graph.values())]))", "def get_nodes(self):\n return [node for node in self._nodes.itervalues()]", "def get_nodes(self):\n return [node for node in self._nodes.itervalues()]", "def no...
[ "0.8091906", "0.767403", "0.767403", "0.76589066", "0.7624159", "0.7607837", "0.7546537", "0.7528698", "0.7526551", "0.7515556", "0.74869543", "0.74475616", "0.7446754", "0.7429433", "0.73889315", "0.7385529", "0.737684", "0.7330525", "0.72751486", "0.724888", "0.72425395", ...
0.0
-1
Parrot > str Return the string representation of the Parrot object based on its last defeated opponent, else a question mark(?) if it has not faced an opponent yet.
def __str__(self): return self._last_opponent
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getOpponentFormat(self):\r\n return self.opponent + \"\\t\"", "def __str__(self):\n res = \"Opponent: \" + str(self.opponent) + \" Angle: \" + str(self.angle)\n return res", "def __str__(self):\n return \"player: \" + str(self.player) + \"\\nposition: \" + str(self.position) + \...
[ "0.67383534", "0.6564957", "0.6473529", "0.62737054", "0.6074091", "0.60388917", "0.5939981", "0.5931592", "0.5871898", "0.58564985", "0.58221257", "0.58185506", "0.5810382", "0.5804153", "0.5765514", "0.5763084", "0.5693789", "0.5614653", "0.56027657", "0.5580586", "0.556923...
0.6515004
2
A dictionary of simulated/true source parameters.
def injection_parameters(self): return self._injection_parameters
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initial_params(self):\r\n prototype_samples = {}\r\n trace = poutine.trace(self.model).get_trace(self.args, self.kwargs)\r\n for name, node in trace.iter_stochastic_nodes():\r\n if (node['type'] == 'sample' and node['is_observed'] == False):\r\n prototype_samples[...
[ "0.65883785", "0.6375989", "0.6341086", "0.62498593", "0.62366295", "0.61617553", "0.6161328", "0.6130521", "0.6109155", "0.6107315", "0.60812485", "0.6081207", "0.6055423", "0.6035477", "0.6033417", "0.60204315", "0.5970646", "0.5961472", "0.5960048", "0.59170073", "0.591390...
0.0
-1
Create 1D plots from posterior grids.
def _1d_plot_grid(self, **kwargs): from pesummary.core.plots.plot import _1d_analytic_plot origkwargs = kwargs.copy() if "fig" not in kwargs: from pesummary.core.plots.figure import figure fig, ax = figure(gca=True) kwargs["fig"] = fig existing...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _nd_plot_grid(self, **kwargs):\n\n from matplotlib.lines import Line2D\n from pesummary.core.plots.publication import pcolormesh\n\n # only add to corner plot if plotting on an existing figure\n if \"fig\" not in kwargs:\n raise TypeError(\n \"Can only add ...
[ "0.67015654", "0.637632", "0.6203047", "0.6182307", "0.6123859", "0.61169755", "0.61040556", "0.6091152", "0.6055943", "0.604422", "0.60359657", "0.6009474", "0.5994107", "0.59797597", "0.59724945", "0.5922779", "0.5917129", "0.59010255", "0.5894244", "0.5850232", "0.5843308"...
0.66519374
1
Calculate the credible intervals for a given parameter.
def credible_interval(self, parameter, interval=[0.05, 0.95]): if parameter not in self.parameters: raise ValueError(f"Parameter '{parameter}' is not available") intervals = {} for key, value in self.results.items(): if isinstance(value, Grid): intervals...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def credible_interval(self, distType='current', interval=(0.025, 0.975)):\n \n # Calculate cdf to use for credible interval\n distCred = self.cumulative_distribution(dist=distType)\n \n # Prior and Current credible intervals\n if (distType=='current' or distType=='p...
[ "0.69340336", "0.65443045", "0.6203978", "0.58193254", "0.5771073", "0.554047", "0.54753447", "0.54728234", "0.5456654", "0.5373382", "0.5351367", "0.5275391", "0.526941", "0.5258351", "0.5222526", "0.5140093", "0.51162237", "0.50856185", "0.50745493", "0.5057593", "0.5038882...
0.74701375
0
Calculate an upper credible interval limit for a given parameter.
def upper_limit(self, parameter, bound=0.95): return self.credible_interval(parameter, interval=[bound])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upper_bound(self) -> float:\n ...", "def max_values(self, lower, upper):\n if not self.upper_bounds is None:\n return self.upper_bounds\n\n minus = np.clip(self.coeffs,-math.inf,0)\n plus = np.clip(self.coeffs,0,math.inf)\n self.upper_bounds = plus.dot(upper) + m...
[ "0.6782903", "0.6254825", "0.624402", "0.615147", "0.61142075", "0.6080531", "0.60715234", "0.60213584", "0.6001461", "0.59814", "0.58664227", "0.58595216", "0.57923555", "0.578106", "0.5772248", "0.57525045", "0.57338864", "0.57316476", "0.5729847", "0.5656949", "0.56540245"...
0.8375727
0
Define the limits of an axis range using the current limits or the default bounds if current limits are outside those bounds.
def _set_axes_limits(ax, parameter, axis="x"): lims = list(ax.get_xlim()) if axis == "x" else list(ax.get_ylim()) if "low" in DEFAULT_BOUNDS[parameter]: low = DEFAULT_BOUNDS[parameter]["low"] if lims[0] < low: lims[0] = DEFAULT_BOUNDS[parameter]["low"] if "high" in DEFAULT_BOUN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setlimits(self, Xlim=[], Ylim=[]):\n self.data['Xmin'] = Xlim[0]\n self.data['Xmax'] = Xlim[1]\n self.data['Ymin'] = Ylim[0]\n self.data['Ymax'] = Ylim[1]", "def set_limits(xlim=None, ylim=None, ax=None):\n if ax is None:\n ax = plt.gca()\n if ylim is not None:\n ...
[ "0.7563677", "0.70228994", "0.6902009", "0.6879037", "0.68770766", "0.684473", "0.67686707", "0.67063695", "0.66331327", "0.66058207", "0.6513873", "0.651009", "0.6494821", "0.64937735", "0.64774936", "0.6468355", "0.6417339", "0.6411401", "0.6410878", "0.6352544", "0.6310361...
0.75755525
0
F(j) = max(F(i)) + 1, 0 <= i < j and nums[i] < nums[j]
def lengthOfLIS(self, nums: List[int]) -> int: n = len(nums) F = [0] * n F[0] = 1 for i in range(1, n): sub_lengths = [0] for j in range(0, i): if nums[j] < nums[i]: sub_lengths.append(F[j]) F[i] = max(sub_l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fn(i, j):\n ans = 1\n for ii, jj in (i-1, j), (i, j-1), (i, j+1), (i+1, j): \n if 0 <= ii < m and 0 <= jj < n and matrix[i][j] < matrix[ii][jj]: \n ans = max(ans, 1 + fn(ii, jj))\n return ans", "def fn(i):\n if i < 0: return 0\n ...
[ "0.71989465", "0.70241994", "0.6753957", "0.674082", "0.6669375", "0.65919256", "0.63025326", "0.62861985", "0.6194349", "0.61904025", "0.617972", "0.6176879", "0.6176447", "0.6172388", "0.6124718", "0.6098153", "0.6098153", "0.60589963", "0.6042938", "0.6024815", "0.6020903"...
0.6163868
14
Extraction rules are in the form string > dict where the dict contains the annotation for the match, e.g.
def __init__(self, rules: Union[Dict[str, dict], Set[str]], separators: str = ''): if isinstance(rules, dict): for pattern, annotation in rules.items(): if 'start' in annotation or 'end' in annotation: raise ValueError("Attributes 'start' and 'end' are reserved d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_annotation(file, pos_dict, ex_dict, tag):\n results = {}\n with open(file, 'r', encoding='utf-8') as f:\n par = 0\n par_results = []\n for line in f:\n if line is \"\\n\":\n if par_results:\n if \"paragraph\" + str(par) in results:\n ...
[ "0.57550836", "0.5731638", "0.5626193", "0.5554156", "0.5467629", "0.53810644", "0.53525615", "0.5292076", "0.52820754", "0.5262517", "0.5208889", "0.51985896", "0.51852655", "0.51687044", "0.516571", "0.5158055", "0.51480985", "0.5145357", "0.51176673", "0.5116655", "0.51079...
0.5541818
4
If the vertex "vertex" is not in self.__graph_dict, a key "vertex" with an empty list as a value is added to the dictionary. Otherwise nothing has to be done.
def add_vertex(self, vertex): if vertex not in self.__graph_dict: self.__graph_dict[vertex] = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_vertex(self, vertex):\n if vertex not in self.graph_dict:\n self.graph_dict[vertex] = []", "def add_vertex(self, vertex):\n if vertex not in self.graph_dict:\n self.graph_dict[vertex] = []\n return vertex", "def add_vertex(self, vertex):\r\n if vert...
[ "0.8621471", "0.8487749", "0.84772027", "0.8406467", "0.77853566", "0.746811", "0.7458696", "0.7252485", "0.7200776", "0.7144652", "0.70762503", "0.70762503", "0.6963895", "0.68889165", "0.688376", "0.6834728", "0.68012196", "0.6797876", "0.6717518", "0.67124915", "0.66779464...
0.858724
2
Get current time as formatted string
def get_timestamp(): return datetime.datetime.now().strftime("%Y-%m-%d %H:%M")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_current_time() -> str:\n return datetime.now().strftime(\"%FT%H:%M:%S\")", "def str_current_time():\n return strftime(\"%Y_%m_%d_%H_%M_%S_%Z\", gmtime())", "def current_time():\n now = datetime.datetime.now()\n time = now.strftime(\"%Y-%m-%d %H:%M:%S:%f\")\n return time", "def get_cur...
[ "0.8467659", "0.8418462", "0.8267366", "0.8218223", "0.82046044", "0.8154258", "0.8117794", "0.8114865", "0.80705476", "0.80462134", "0.8003247", "0.79896045", "0.79678386", "0.7962166", "0.7951885", "0.79158986", "0.7910026", "0.79087", "0.7899042", "0.78971326", "0.7881374"...
0.71401787
73
The homepage for Stock Tracker.
def index(request): return render(request, 'stock_trackers/index.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home():\n stocks = preprocess()\n\n return render_template(\"main.html\",stocks=stocks)", "def homepage():\n return render_template('home/index.html', \n title=\"Bem vindo!\")", "def home():\n\n\treturn render_template('index.html', title='Home Page',\n\t\t\t\t\t\t yea...
[ "0.790749", "0.7402879", "0.73412", "0.7310414", "0.7281917", "0.7259897", "0.7240034", "0.7232201", "0.7216923", "0.7216005", "0.72061193", "0.72061193", "0.72061193", "0.72061193", "0.72061193", "0.72061193", "0.72061193", "0.72061193", "0.72061193", "0.72061193", "0.719491...
0.76760465
1
Same as manual_log_like_normal(x,data), but using scipy implementation. It's pretty slow.
def log_lik_normal(x, data): return np.sum(np.log(scipy.stats.norm(x[0], x[1]).pdf(data)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def manual_log_like_normal(x, data):\n return np.sum(-np.log(x[1] * np.sqrt(2 * np.pi))-((data-x[0])**2) / (2*x[1]**2))", "def lognormal(mu, hw, x): \n return np.exp(-( np.log(x/mu) / (0.01*hw) )**2)", "def log_normal(x, mu, sig):\n dx = x[1]-x[0]\n log_norm = 1 / (x * sig * np.sqrt(2 * np.pi)) ...
[ "0.87133837", "0.7446079", "0.71870023", "0.71722597", "0.69946253", "0.6982088", "0.69053465", "0.69053465", "0.68626857", "0.6756093", "0.6724028", "0.6648678", "0.66445565", "0.6530944", "0.6530044", "0.65269274", "0.65247226", "0.6513712", "0.6513262", "0.65001273", "0.64...
0.7946673
1
Creates the tree string.
def makeTree(size): # Probability that a character will be green. prob_gr = 0.6 # Colour codes. colours = [31, 33, 34, 35, 36, 37] # Characters to use for decorations. Experiment with these. # The chr(169) and chr(174) characters may not work in all terminals # (extended ASCII, c and r in a ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\r\n T = Btree(2)\r\n T.root = Node(self.keys, [Node(child.keys, []) for child in self.children])\r\n return str(T)", "def tree_string(self, indent=0): # pragma: no cover\r\n return \"\"", "def __str__(self):\n\t\tself._synchronize_attributes()\n\t\ts = \"\"\n\t\t...
[ "0.77501494", "0.76212937", "0.75353056", "0.75203866", "0.75203866", "0.7321976", "0.7183862", "0.71086305", "0.709848", "0.70958835", "0.7064057", "0.70419306", "0.69600695", "0.692635", "0.6917843", "0.6889876", "0.6885725", "0.6881385", "0.6879757", "0.68401366", "0.68336...
0.6422408
41
Show image with landmarks
def show_landmarks(image, landmarks, save_fig=False, save_path=None): plt.imshow(image) plt.scatter(landmarks[:, 0], landmarks[:, 1], s=10, marker='.', c='r') if save_fig and save_path is not None: plt.savefig(save_path) plt.pause(0.001) # pause a bit so that plots are updated
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_landmarks(image, landmarks):\n\n if isinstance(image, str):\n # image = io.imread(image)\n image = cv2.cvtColor(cv2.imread(image), cv2.COLOR_BGR2RGB)\n\n plt.imshow(image)\n\n plt.scatter(landmarks[:, 0], landmarks[:, 1], s=10, marker='.', c='r')\n plt.pause(0.001) # pause a bit...
[ "0.808608", "0.7926357", "0.7926357", "0.7926357", "0.78171635", "0.7465765", "0.7464966", "0.6598388", "0.65567565", "0.65280706", "0.6492143", "0.6483718", "0.6477732", "0.644593", "0.64328134", "0.63780797", "0.6371934", "0.6371934", "0.6371934", "0.636128", "0.6348264", ...
0.778297
5
APIMgmtSpec defines the desired state of APIMgmt
def __init__(__self__, *, api_id: pulumi.Input[str], api_service: pulumi.Input[str], location: pulumi.Input[str], properties: pulumi.Input['APIMgmtAPISpecPropertiesArgs'], resource_group: pulumi.Input[str]): pulumi.set(__self__...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _setup_api_properties(self):\n self.implicit_api_logical_id = GeneratedLogicalId.implicit_http_api()\n self.implicit_api_condition = \"ServerlessHttpApiCondition\"\n self.api_event_type = \"HttpApi\"\n self.api_type = SamResourceType.HttpApi.value\n self.api_id_property = \"A...
[ "0.55997956", "0.54633045", "0.54397786", "0.5310828", "0.5273441", "0.52452695", "0.52085876", "0.52010757", "0.51736206", "0.5145516", "0.50976807", "0.5064335", "0.50512815", "0.5033387", "0.5032845", "0.5024864", "0.5005038", "0.50043964", "0.49984825", "0.4998308", "0.49...
0.6245835
0
APIRevision Describes the Revision of the Api. If no value is provided, default revision 1 is created
def api_revision(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "api_revision")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_revision_description(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"api_revision_description\")", "def api_version(self):\n\n\t\treturn self._api_version", "def api_version(self):\n\n return self._api_version", "def api_version(self) -> Optional[str]:\n return ...
[ "0.6755969", "0.6119869", "0.6054017", "0.59239435", "0.59239435", "0.59239435", "0.59239435", "0.59239435", "0.59239435", "0.59239435", "0.59239435", "0.59239435", "0.59239435", "0.59239435", "0.59239435", "0.59239435", "0.59239435", "0.59239435", "0.59239435", "0.59239435", ...
0.75794876
0
Path Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API.
def path(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "path")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_api_path(self):\n return self._get_api_base() + '/' + self._get_resource_suffix()", "def api_url(self, endpoint):\n\n return '{}/{}'.format(self.api_root, endpoint)", "def get_api_path(self):\n return self._get_api_base() + '/object/' + self._get_resource_suffix()", "def api_url(...
[ "0.7867708", "0.7475842", "0.7443843", "0.7401237", "0.73302335", "0.73001975", "0.7122721", "0.71119153", "0.70910627", "0.70845276", "0.7079349", "0.69851875", "0.69132864", "0.6903628", "0.6887463", "0.6840807", "0.68003654", "0.67251736", "0.6705232", "0.6638825", "0.6636...
0.0
-1
Name The display Name of the API Version Set.
def name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return _version._NAME # pylint: disable=protected-access", "def version_name(self) -> str:\n return pulumi.get(self, \"version_name\")", "def api_entity_set_name(self) -> Optional[str]:\n return pulumi.get(self, \"api_entity_set_name\")", "def __repr__(self):\n ...
[ "0.7163041", "0.6847523", "0.6617727", "0.6521526", "0.65016276", "0.6492742", "0.6377641", "0.6377641", "0.6377641", "0.6377641", "0.6377641", "0.6377641", "0.6377641", "0.6377641", "0.6377641", "0.6377641", "0.6377641", "0.6377641", "0.637011", "0.637011", "0.637011", "0....
0.0
-1
AzureSqlServerSpec defines the desired state of AzureSqlServer
def __init__(__self__, *, location: pulumi.Input[str], resourcegroup: pulumi.Input[str], key_vault_to_store_secrets: Optional[pulumi.Input[str]] = None): pulumi.set(__self__, "location", location) pulumi.set(__self__, "resourcegroup", resourcegroup) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__, *,\n location: str,\n resource_group: str,\n server: str,\n db_name: Optional[str] = None,\n edition: Optional[int] = None,\n max_size: Optional['outputs.AzureSqlDatabaseSpecMaxSize'] = None,\n ...
[ "0.55671924", "0.51565075", "0.51251256", "0.4978824", "0.49592975", "0.4909491", "0.48741475", "0.48616317", "0.4773627", "0.4754697", "0.4622016", "0.46083343", "0.4596981", "0.45816892", "0.4510267", "0.4505686", "0.44970566", "0.4466821", "0.44614944", "0.44288692", "0.44...
0.0
-1
CosmosDBKind enumerates the values for kind. Only one of the following kinds may be specified. If none of the following kinds is specified, the default one is GlobalDocumentDBKind.
def kind(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "kind")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kind(self, kind: \"TriggerEventKind\"):\n if isinstance(kind, Enum):\n self._attrs[\"kind\"] = kind.value\n else:\n self._attrs[\"kind\"] = kind # If you supply a string, we presume you know the service will take it.", "def selected_group_kinds(self) -> Optional[pulumi.In...
[ "0.5784343", "0.55062705", "0.54835415", "0.5480056", "0.5466895", "0.5446912", "0.5432135", "0.5431228", "0.53943044", "0.53943044", "0.53852904", "0.53501344", "0.5346622", "0.5335876", "0.5335876", "0.5335876", "0.5335876", "0.5329811", "0.5274644", "0.52716005", "0.527160...
0.47884262
68
DatabaseAccountOfferType The offer type for the Cosmos DB database account.
def database_account_offer_type(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "database_account_offer_type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def offer_type(self):\n return self.proto.offer[0].offerType", "def account_type(self) -> str:\n return pulumi.get(self, \"account_type\")", "def offer_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"offer_type\")", "def __get_account_type(self):\n return ra...
[ "0.62732404", "0.6056946", "0.5796877", "0.5623496", "0.55011934", "0.5317232", "0.514535", "0.5041874", "0.50273305", "0.50273305", "0.50273305", "0.50273305", "0.488415", "0.488415", "0.48418367", "0.48091587", "0.48091587", "0.4735253", "0.4735253", "0.4726379", "0.4716318...
0.8305023
0
EventhubNamespaceSku defines the sku
def sku(self) -> Optional[pulumi.Input['EventhubNamespaceSpecSkuArgs']]: return pulumi.get(self, "sku")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sku(self) -> pulumi.Input['IotHubDpsSkuArgs']:\n return pulumi.get(self, \"sku\")", "def sku(self) -> Optional[pulumi.Input['IotHubDpsSkuArgs']]:\n return pulumi.get(self, \"sku\")", "def sku(self) -> pulumi.Input['ApiManagementServiceSkuPropertiesArgs']:\n return pulumi.get(self, \"sk...
[ "0.70359784", "0.688907", "0.6780028", "0.6747152", "0.66721773", "0.66215503", "0.66215503", "0.65827245", "0.65827245", "0.65827245", "0.65480113", "0.64731556", "0.64731556", "0.6448809", "0.6427096", "0.6427096", "0.6356144", "0.6356144", "0.63418", "0.63300204", "0.63037...
0.8114673
0
IPRules List of IpRules
def ip_rules(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['EventhubNamespaceSpecNetworkRuleIpRulesArgs']]]]: return pulumi.get(self, "ip_rules")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ip_rules(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:\n return pulumi.get(self, \"ip_rules\")", "def ip_rules(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['StorageAccountSpecNetworkRuleIpRulesArgs']]]]:\n return pulumi.get(self, \"ip_rules\")", "def ip_rules(self) -> ...
[ "0.7549045", "0.7458888", "0.7378768", "0.7373913", "0.6809215", "0.6724737", "0.6724737", "0.6562614", "0.6470501", "0.6316684", "0.6278565", "0.6220614", "0.6100953", "0.60866356", "0.608405", "0.60797924", "0.5923773", "0.5872824", "0.58694565", "0.5848989", "0.5830501", ...
0.75341594
1
Subnet Full Resource ID of Virtual Network Subnet
def subnet_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "subnet_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subnet_id(self) -> str:\n return pulumi.get(self, \"subnet_id\")", "def subnet_id(self) -> Optional[str]:\n return pulumi.get(self, \"subnet_id\")", "def subnet_resource_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"subnet_resource_id\")", "def subnet_id(self):...
[ "0.7881096", "0.7577092", "0.747503", "0.7449239", "0.74444234", "0.7443867", "0.7439609", "0.7378375", "0.7378375", "0.7317503", "0.7046465", "0.7022912", "0.679372", "0.6730822", "0.660397", "0.6479247", "0.64577127", "0.6353934", "0.6306767", "0.62809634", "0.6266459", "...
0.7301591
11