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
Set up OIDC issuer profile for the ManagedCluster object.
def set_up_oidc_issuer_profile(self, mc: ManagedCluster) -> ManagedCluster: self._ensure_mc(mc) oidc_issuer_profile = self.context.get_oidc_issuer_profile() if oidc_issuer_profile is not None: mc.oidc_issuer_profile = oidc_issuer_profile return mc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_oidc_issuer_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n oidc_issuer_profile = self.context.get_oidc_issuer_profile()\n if oidc_issuer_profile is not None:\n mc.oidc_issuer_profile = oidc_issuer_profile\n\n return mc", "def set_up_...
[ "0.68949056", "0.6509729", "0.59140515", "0.58743733", "0.58665264", "0.5851112", "0.5786927", "0.573488", "0.56927", "0.5686523", "0.56630516", "0.5605314", "0.5597112", "0.5546473", "0.5518196", "0.5349327", "0.53285", "0.52434665", "0.5205877", "0.5151916", "0.5124305", ...
0.77052444
0
Set up workload autoscaler profile for the ManagedCluster object.
def set_up_workload_auto_scaler_profile(self, mc: ManagedCluster) -> ManagedCluster: self._ensure_mc(mc) if self.context.get_enable_keda(): if mc.workload_auto_scaler_profile is None: mc.workload_auto_scaler_profile = self.models.ManagedClusterWorkloadAutoScalerProfile() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_up_auto_scaler_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n cluster_autoscaler_profile = self.context.get_cluster_autoscaler_profile()\n mc.auto_scaler_profile = cluster_autoscaler_profile\n return mc", "def update_workload_auto_scaler_profile...
[ "0.8076214", "0.7491031", "0.7352861", "0.6414039", "0.63400394", "0.63381267", "0.61320627", "0.6118087", "0.5994238", "0.59813344", "0.5911872", "0.58884025", "0.5853951", "0.58003074", "0.57358766", "0.57021785", "0.56957954", "0.56529593", "0.5541374", "0.55400974", "0.55...
0.8073404
1
Set up autoscaler profile for the ManagedCluster object.
def set_up_auto_scaler_profile(self, mc: ManagedCluster) -> ManagedCluster: self._ensure_mc(mc) cluster_autoscaler_profile = self.context.get_cluster_autoscaler_profile() mc.auto_scaler_profile = cluster_autoscaler_profile return mc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_up_workload_auto_scaler_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n if self.context.get_enable_keda():\n if mc.workload_auto_scaler_profile is None:\n mc.workload_auto_scaler_profile = self.models.ManagedClusterWorkloadAutoScalerPro...
[ "0.78787524", "0.7584544", "0.72677207", "0.65111727", "0.6414405", "0.6131129", "0.61158025", "0.6072033", "0.6016049", "0.5991844", "0.59358615", "0.59160423", "0.586377", "0.58514345", "0.5827458", "0.57397324", "0.5728022", "0.5689652", "0.5640538", "0.5614725", "0.555527...
0.8339926
0
Set up azure monitor profile for the ManagedCluster object.
def set_up_azure_monitor_profile(self, mc: ManagedCluster) -> ManagedCluster: self._ensure_mc(mc) # read the original value passed by the command ksm_metric_labels_allow_list = self.context.raw_param.get("ksm_metric_labels_allow_list") ksm_metric_annotations_allow_list = self.context.raw...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_azure_monitor_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n # read the original value passed by the command\n ksm_metric_labels_allow_list = self.context.raw_param.get(\"ksm_metric_labels_allow_list\")\n ksm_metric_annotations_allow_list = sel...
[ "0.72846806", "0.71346223", "0.64711446", "0.6104006", "0.60403425", "0.59842443", "0.5969809", "0.59013", "0.5852365", "0.5829357", "0.5784714", "0.5775937", "0.5744401", "0.570182", "0.57013726", "0.5676068", "0.56605566", "0.5610358", "0.5585451", "0.5560262", "0.55012053"...
0.7944016
0
Helper function to check if postprocessing is required after sending a PUT request to create the cluster.
def check_is_postprocessing_required(self, mc: ManagedCluster) -> bool: # some addons require post cluster creation role assigment monitoring_addon_enabled = self.context.get_intermediate("monitoring_addon_enabled", default_value=False) ingress_appgw_addon_enabled = self.context.get_intermediate...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_is_postprocessing_required(self, mc: ManagedCluster) -> bool:\n # some addons require post cluster creation role assigment\n monitoring_addon_enabled = self.context.get_intermediate(\"monitoring_addon_enabled\", default_value=False)\n ingress_appgw_addon_enabled = self.context.get_in...
[ "0.65956247", "0.6160552", "0.5965819", "0.5765838", "0.54389656", "0.52548474", "0.5172896", "0.51714987", "0.5161744", "0.5144229", "0.50794834", "0.50763243", "0.50758445", "0.5068631", "0.506405", "0.50525963", "0.5025663", "0.50229084", "0.50158024", "0.49857804", "0.498...
0.6787382
0
Initialize an AKSAgentPoolAddDecorator object to assemble the AgentPool profile.
def init_agentpool_decorator_context(self) -> None: self.agentpool_decorator = AKSAgentPoolUpdateDecorator( self.cmd, self.client, self.__raw_parameters, self.resource_type, self.agentpool_decorator_mode ) self.agentpool_context = self.agentpool_decorator.context self.context...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_agentpool_decorator_context(self) -> None:\n self.agentpool_decorator = AKSAgentPoolAddDecorator(\n self.cmd, self.client, self.__raw_parameters, self.resource_type, self.agentpool_decorator_mode\n )\n self.agentpool_context = self.agentpool_decorator.context\n self....
[ "0.82316643", "0.61094487", "0.58690387", "0.58118975", "0.5642255", "0.5622449", "0.5469193", "0.5461134", "0.5350976", "0.5324465", "0.5300219", "0.52914625", "0.5236859", "0.5222781", "0.51754194", "0.51687443", "0.51389706", "0.51012224", "0.5097092", "0.50748473", "0.505...
0.7490148
1
Get the ManagedCluster object currently in use and attach it to internal context. Internally send request using ContainerServiceClient and parameters name (cluster) and resource group name.
def fetch_mc(self) -> ManagedCluster: mc = self.client.get(self.context.get_resource_group_name(), self.context.get_name()) # attach mc to AKSContext self.context.attach_mc(mc) return mc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_mc(self) -> ManagedCluster:\n # Initialize a ManagedCluster object with mandatory parameter location.\n mc = self.models.ManagedCluster(\n location=self.context.get_location(),\n )\n\n # attach mc to AKSContext\n self.context.attach_mc(mc)\n return mc",...
[ "0.63290817", "0.5981959", "0.5886816", "0.58823264", "0.5875958", "0.5780633", "0.5742241", "0.5623842", "0.56223327", "0.5598198", "0.5598198", "0.55960774", "0.5590564", "0.5503874", "0.54916924", "0.54552215", "0.5428519", "0.5419511", "0.5408951", "0.53970474", "0.539554...
0.6626831
0
Update agentpool profile for the ManagedCluster object.
def update_agentpool_profile(self, mc: ManagedCluster) -> ManagedCluster: self._ensure_mc(mc) if not mc.agent_pool_profiles: raise UnknownError( "Encounter an unexpected error while getting agent pool profiles from the cluster in the process of " "updating ag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_up_agentpool_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n agentpool_profile = self.agentpool_decorator.construct_agentpool_profile_default()\n mc.agent_pool_profiles = [agentpool_profile]\n return mc", "def update_mc_profile_default(self) -> M...
[ "0.69000655", "0.64854956", "0.63575286", "0.58744913", "0.5846469", "0.58256614", "0.58208615", "0.571694", "0.56969243", "0.5597279", "0.55756265", "0.5568938", "0.55441463", "0.55437326", "0.54608375", "0.5429033", "0.5364649", "0.5275306", "0.5205076", "0.5190666", "0.517...
0.8161614
0
Update autoscaler profile for the ManagedCluster object.
def update_auto_scaler_profile(self, mc): self._ensure_mc(mc) cluster_autoscaler_profile = self.context.get_cluster_autoscaler_profile() if cluster_autoscaler_profile is not None: # update profile (may clear profile with empty dictionary) mc.auto_scaler_profile = cluster...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_up_auto_scaler_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n cluster_autoscaler_profile = self.context.get_cluster_autoscaler_profile()\n mc.auto_scaler_profile = cluster_autoscaler_profile\n return mc", "def update_workload_auto_scaler_profile...
[ "0.77689654", "0.77025795", "0.70554644", "0.6538188", "0.62741613", "0.62367916", "0.61821556", "0.60954934", "0.6095449", "0.5962787", "0.5960805", "0.58981574", "0.58537835", "0.582746", "0.5796772", "0.57472837", "0.5672821", "0.5601652", "0.5588318", "0.5538377", "0.5453...
0.8491165
0
Update tags for the ManagedCluster object.
def update_tags(self, mc: ManagedCluster) -> ManagedCluster: self._ensure_mc(mc) tags = self.context.get_tags() if tags is not None: mc.tags = tags return mc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def AddClusterTags(self, tags, dry_run=False, reason=None):\n query = [(\"tag\", t) for t in tags]\n _AppendDryRunIf(query, dry_run)\n _AppendReason(query, reason)\n\n return self._SendRequest(HTTP_PUT, \"/%s/tags\" % GANETI_RAPI_VERSION,\n query, None)", "def update_clust...
[ "0.5990642", "0.59193057", "0.5559754", "0.55428", "0.54464996", "0.5432885", "0.5410724", "0.54037637", "0.54037637", "0.54037637", "0.5357456", "0.5332834", "0.53129476", "0.52917403", "0.5266721", "0.5208107", "0.5159976", "0.513104", "0.51148003", "0.5085101", "0.50813633...
0.74483514
0
Update sku (uptime sla) for the ManagedCluster object.
def update_sku(self, mc: ManagedCluster) -> ManagedCluster: self._ensure_mc(mc) # Premium without LTS is ok (not vice versa) if self.context.get_tier() == CONST_MANAGED_CLUSTER_SKU_TIER_PREMIUM: mc.sku = self.models.ManagedClusterSKU( name="Base", tie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_up_sku(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n if self.context.get_uptime_sla() or self.context.get_tier() == CONST_MANAGED_CLUSTER_SKU_TIER_STANDARD:\n mc.sku = self.models.ManagedClusterSKU(\n name=\"Base\",\n tier=\"St...
[ "0.71179074", "0.5984935", "0.53230107", "0.5303793", "0.5204448", "0.5096391", "0.5087994", "0.5086891", "0.502062", "0.49859262", "0.4938367", "0.49240932", "0.48839968", "0.48643538", "0.48471776", "0.48239538", "0.47839066", "0.47805685", "0.47805685", "0.4759781", "0.475...
0.7960321
0
Update load balancer profile for the ManagedCluster object.
def update_load_balancer_profile(self, mc: ManagedCluster) -> ManagedCluster: self._ensure_mc(mc) if not mc.network_profile: raise UnknownError( "Encounter an unexpected error while getting network profile from the cluster in the process of " "updating its lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_agentpool_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n if not mc.agent_pool_profiles:\n raise UnknownError(\n \"Encounter an unexpected error while getting agent pool profiles from the cluster in the process of \"\n ...
[ "0.65942985", "0.63839215", "0.6343197", "0.62864435", "0.61292905", "0.61204284", "0.6031443", "0.57443124", "0.5726644", "0.5723703", "0.5628799", "0.5628109", "0.5623104", "0.56101996", "0.56002855", "0.5590744", "0.5588446", "0.55560887", "0.55289423", "0.55235827", "0.55...
0.75255644
0
Update nat gateway profile for the ManagedCluster object.
def update_nat_gateway_profile(self, mc: ManagedCluster) -> ManagedCluster: self._ensure_mc(mc) if not mc.network_profile: raise UnknownError( "Unexpectedly get an empty network profile in the process of updating nat gateway profile." ) outbound_type = se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_mc_profile_default(self) -> ManagedCluster:\n # check raw parameters\n # promt y/n if no options are specified to ask user whether to perform a reconcile operation\n self.check_raw_parameters()\n # fetch the ManagedCluster object\n mc = self.fetch_mc()\n # updat...
[ "0.6426489", "0.63450545", "0.62319547", "0.60947186", "0.60823864", "0.59361637", "0.5891273", "0.5854507", "0.5761657", "0.57524437", "0.5678059", "0.56612414", "0.5579701", "0.53702694", "0.5347543", "0.53397816", "0.5326909", "0.52681994", "0.5237096", "0.5205934", "0.518...
0.7545268
0
Update api server access profile and fqdn subdomain for the ManagedCluster object.
def update_api_server_access_profile(self, mc: ManagedCluster) -> ManagedCluster: self._ensure_mc(mc) if mc.api_server_access_profile is None: profile_holder = self.models.ManagedClusterAPIServerAccessProfile() else: profile_holder = mc.api_server_access_profile ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_up_api_server_access_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n api_server_access_profile = None\n api_server_authorized_ip_ranges = self.context.get_api_server_authorized_ip_ranges()\n enable_private_cluster = self.context.get_enable_private_...
[ "0.6785518", "0.62549794", "0.56788695", "0.5587446", "0.55768114", "0.5548693", "0.5440958", "0.523388", "0.5209735", "0.5204637", "0.5203941", "0.5169459", "0.5154716", "0.51498365", "0.5145779", "0.50799966", "0.50749654", "0.50468695", "0.5043714", "0.50179535", "0.500715...
0.72265285
0
Update windows profile for the ManagedCluster object.
def update_windows_profile(self, mc: ManagedCluster) -> ManagedCluster: self._ensure_mc(mc) enable_ahub = self.context.get_enable_ahub() disable_ahub = self.context.get_disable_ahub() windows_admin_password = self.context.get_windows_admin_password() enable_windows_gmsa = self.c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_up_windows_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n (\n windows_admin_username,\n windows_admin_password,\n ) = self.context.get_windows_admin_username_and_password()\n if windows_admin_username or windows_admin_passwor...
[ "0.6615214", "0.6559488", "0.6554667", "0.6302969", "0.62154424", "0.6039585", "0.60123307", "0.5999623", "0.5888613", "0.58799297", "0.5857495", "0.57862186", "0.575272", "0.55814606", "0.5574849", "0.5490474", "0.54602957", "0.5456462", "0.54487735", "0.5445578", "0.5434550...
0.79302394
0
Update OIDC issuer profile for the ManagedCluster object.
def update_oidc_issuer_profile(self, mc: ManagedCluster) -> ManagedCluster: self._ensure_mc(mc) oidc_issuer_profile = self.context.get_oidc_issuer_profile() if oidc_issuer_profile is not None: mc.oidc_issuer_profile = oidc_issuer_profile return mc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_up_oidc_issuer_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n oidc_issuer_profile = self.context.get_oidc_issuer_profile()\n if oidc_issuer_profile is not None:\n mc.oidc_issuer_profile = oidc_issuer_profile\n\n return mc", "def update_...
[ "0.7138633", "0.6434838", "0.6359209", "0.6091803", "0.5943593", "0.5936524", "0.5852094", "0.5840535", "0.58331877", "0.56902266", "0.56145376", "0.55521697", "0.5457869", "0.53420657", "0.5270344", "0.52316934", "0.51749843", "0.5146125", "0.5134343", "0.5117193", "0.509305...
0.79235494
0
Update network plugin settings of network profile for the ManagedCluster object.
def update_network_plugin_settings(self, mc: ManagedCluster) -> ManagedCluster: self._ensure_mc(mc) network_plugin_mode = self.context.get_network_plugin_mode() if network_plugin_mode: mc.network_profile.network_plugin_mode = network_plugin_mode ( pod_cidr, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_mc_profile_default(self) -> ManagedCluster:\n # check raw parameters\n # promt y/n if no options are specified to ask user whether to perform a reconcile operation\n self.check_raw_parameters()\n # fetch the ManagedCluster object\n mc = self.fetch_mc()\n # updat...
[ "0.6287261", "0.62562764", "0.6206155", "0.5919854", "0.5832747", "0.5745208", "0.5725939", "0.5664839", "0.5643876", "0.56297773", "0.5584582", "0.54472065", "0.5360767", "0.53581583", "0.534671", "0.53357637", "0.53113896", "0.52554923", "0.5243599", "0.51855236", "0.518398...
0.8056863
0
Update storage profile for the ManagedCluster object.
def update_storage_profile(self, mc: ManagedCluster) -> ManagedCluster: self._ensure_mc(mc) mc.storage_profile = self.context.get_storage_profile() return mc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_up_storage_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n if hasattr(self.models, \"ManagedClusterStorageProfile\"):\n mc.storage_profile = self.context.get_storage_profile()\n\n return mc", "def update_mc_profile_default(self) -> ManagedClu...
[ "0.7120557", "0.6314157", "0.6202867", "0.58940035", "0.5887002", "0.5872036", "0.5859722", "0.5836123", "0.57843363", "0.5757808", "0.5714045", "0.5625429", "0.55987877", "0.54697853", "0.54638046", "0.5455607", "0.54530305", "0.53886455", "0.53717756", "0.5316751", "0.52893...
0.81250465
0
Update security profile imageCleaner for the ManagedCluster object.
def update_image_cleaner(self, mc: ManagedCluster) -> ManagedCluster: self._ensure_mc(mc) enable_image_cleaner = self.context.get_enable_image_cleaner() disable_image_cleaner = self.context.get_disable_image_cleaner() interval_hours = self.context.get_image_cleaner_interval_hours() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_up_image_cleaner(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n interval_hours = self.context.get_image_cleaner_interval_hours()\n\n if self.context.get_enable_image_cleaner():\n\n if mc.security_profile is None:\n mc.security_profile =...
[ "0.6851309", "0.67022616", "0.5652698", "0.555268", "0.54567385", "0.5302302", "0.52607596", "0.50487584", "0.50180537", "0.5011092", "0.5008191", "0.5006725", "0.49423403", "0.48312888", "0.47744167", "0.47587383", "0.47480166", "0.47262153", "0.47243848", "0.47189918", "0.4...
0.73032594
0
Update workload autoscaler profile for the ManagedCluster object.
def update_workload_auto_scaler_profile(self, mc: ManagedCluster) -> ManagedCluster: self._ensure_mc(mc) if self.context.get_enable_keda(): if mc.workload_auto_scaler_profile is None: mc.workload_auto_scaler_profile = self.models.ManagedClusterWorkloadAutoScalerProfile() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_auto_scaler_profile(self, mc):\n self._ensure_mc(mc)\n\n cluster_autoscaler_profile = self.context.get_cluster_autoscaler_profile()\n if cluster_autoscaler_profile is not None:\n # update profile (may clear profile with empty dictionary)\n mc.auto_scaler_profil...
[ "0.82561743", "0.75433207", "0.7293663", "0.6517002", "0.6411876", "0.6182385", "0.61311543", "0.59943694", "0.5993539", "0.59688723", "0.59505665", "0.59278333", "0.5866863", "0.5812482", "0.56214845", "0.5597126", "0.5546318", "0.5526554", "0.5516587", "0.550821", "0.548046...
0.7946528
1
Update azure monitor profile for the ManagedCluster object.
def update_azure_monitor_profile(self, mc: ManagedCluster) -> ManagedCluster: self._ensure_mc(mc) # read the original value passed by the command ksm_metric_labels_allow_list = self.context.raw_param.get("ksm_metric_labels_allow_list") ksm_metric_annotations_allow_list = self.context.ra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_up_azure_monitor_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n # read the original value passed by the command\n ksm_metric_labels_allow_list = self.context.raw_param.get(\"ksm_metric_labels_allow_list\")\n ksm_metric_annotations_allow_list = self....
[ "0.7277104", "0.63934505", "0.61648846", "0.614551", "0.61402935", "0.6066223", "0.5994208", "0.5984191", "0.5957272", "0.5943673", "0.5894648", "0.5878133", "0.5850033", "0.57665926", "0.57402784", "0.5631679", "0.5623526", "0.5593438", "0.55433184", "0.54727024", "0.5458814...
0.7853511
0
Helper function to check if postprocessing is required after sending a PUT request to create the cluster.
def check_is_postprocessing_required(self, mc: ManagedCluster) -> bool: # some addons require post cluster creation role assigment monitoring_addon_enabled = self.context.get_intermediate("monitoring_addon_enabled", default_value=False) ingress_appgw_addon_enabled = self.context.get_intermediate...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_is_postprocessing_required(self, mc: ManagedCluster) -> bool:\n # some addons require post cluster creation role assigment\n monitoring_addon_enabled = self.context.get_intermediate(\"monitoring_addon_enabled\", default_value=False)\n ingress_appgw_addon_enabled = self.context.get_in...
[ "0.6787382", "0.6160552", "0.5965819", "0.5765838", "0.54389656", "0.52548474", "0.5172896", "0.51714987", "0.5161744", "0.5144229", "0.50794834", "0.50763243", "0.50758445", "0.5068631", "0.506405", "0.50525963", "0.5025663", "0.50229084", "0.50158024", "0.49857804", "0.4980...
0.65956247
1
Send request to update the existing managed cluster.
def update_mc(self, mc: ManagedCluster) -> ManagedCluster: self._ensure_mc(mc) return self.put_mc(mc)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_cluster(self, cluster, params, *args, **kwargs):\n raise NotImplementedError", "def update(id, body: Body):\n\n cluster = clusters.get_by_id(id)\n\n if cluster is None:\n raise HTTPException(status_code=404, detail=\"Cluster not found for ID: {0}\".format(id))\n\n cluster.update...
[ "0.7191971", "0.7066755", "0.7005855", "0.67756027", "0.6429547", "0.6165414", "0.6147759", "0.61359227", "0.60395795", "0.6039569", "0.59164023", "0.58718383", "0.58608097", "0.58484197", "0.58156073", "0.5783585", "0.5762689", "0.575575", "0.5751597", "0.57309073", "0.57024...
0.52261937
56
Replaces u'celsius' with 'fahrenheit' in the provided string.
def replace_celcius(string): return string.replace(u'celsius', u'fahrenheit')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_celsius_to_fahrenheit(celsius):\n return celsius * 9.0 / 5 + 32", "def _celsius_to_fahrenheit(self) -> None:\n if self.units == \"celsius\":\n self.value = (((self.value / 5) * 9) + 32).__round__(2)\n self.units = \"fahrenheit\"\n else:\n msg = (\n ...
[ "0.66244715", "0.6384214", "0.6268346", "0.6167058", "0.61540127", "0.61191595", "0.6103219", "0.60855544", "0.6050967", "0.60101855", "0.5962116", "0.59152514", "0.5893281", "0.58617944", "0.5766658", "0.5766658", "0.5739406", "0.5734028", "0.57056034", "0.5679949", "0.56359...
0.8532337
0
convnet inference block by block. The block coordinates should be aligned with cloud storage.
def create_inference_tasks(task_queue, image_layer_path, convnet_path, mask_layer_path, output_layer_path, output_block_start, output_block_size, grid_size, patch_size, patch_overlap, cropping_margin_size, output_key='output', num_output_channels=3, image_mip=1, output_mip=1, mask_mip...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def block_inception_c(blk, net):\n # By default use stride=1 and SAME padding\n s = net.add(Split('%s/Split' % blk, 4))\n br0 = conv2d(net, '%s/Branch_0/Conv2d_0a_1x1' % blk, 256, 1, src=s)\n\n br1 = conv2d(net, '%s/Branch_1/Conv2d_0a_1x1' % blk, 384, 1, src=s)\n br1 = net.add(Split('%s/Branch_1/Spl...
[ "0.66582626", "0.6451007", "0.64135444", "0.63718015", "0.63372326", "0.62998694", "0.62323284", "0.6195406", "0.6167625", "0.6156127", "0.61436325", "0.61318815", "0.6110937", "0.6108192", "0.61076534", "0.6093889", "0.60925573", "0.6086378", "0.60754573", "0.60693055", "0.6...
0.0
-1
Convert degrees to quaternions
def to_quaternion(roll = 0.0, pitch = 0.0, yaw = 0.0): t0 = math.cos(math.radians(yaw * 0.5)) t1 = math.sin(math.radians(yaw * 0.5)) t2 = math.cos(math.radians(roll * 0.5)) t3 = math.sin(math.radians(roll * 0.5)) t4 = math.cos(math.radians(pitch * 0.5)) t5 = math.sin(math.radians(pitch * 0.5)) w = t0 * t2 * t4 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _rotate_quaternion(self, q):\n self._normalise()\n return self * q * self.conjugate", "def angle_to_quaternion(angle):\n\treturn Quaternion(*tf.transformations.quaternion_from_euler(0, 0, angle))", "def angle_to_quaternion(angle):\n return Quaternion(*tf.transformations.quaternion_from_eul...
[ "0.7151884", "0.70794785", "0.69795513", "0.6890196", "0.6885355", "0.68387544", "0.6825451", "0.6785443", "0.6781011", "0.6753861", "0.6744243", "0.67363155", "0.67292994", "0.6655036", "0.66510034", "0.66371715", "0.66367793", "0.66176534", "0.66134346", "0.6551278", "0.655...
0.6149848
51
Add Comment to post.
def add_comment(cls, uid, person, email, body): try: qs = cls.query.add_comment(uid=uid, person=person, email=email, body=body) record = cls.engine.query(qs, fetch_opts='single') except (DBAPIError, SnaqlException) as error: raise Exception(error.args[0]) r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_comment(cls, post_id, user_id, content):\n c = cls(parent=comment_key(),\n post_id=post_id,\n user_id=user_id,\n content=content)\n c.put()", "def post(self, post_id):\n comment_content = self.request.get(\"comment_content\")\n Post.add_co...
[ "0.82225007", "0.7583707", "0.75809085", "0.7247829", "0.7170257", "0.70538193", "0.69097257", "0.6878592", "0.68745327", "0.67804384", "0.6741349", "0.67374927", "0.67098224", "0.66295004", "0.6624333", "0.65848434", "0.65231735", "0.65173745", "0.65173745", "0.6499979", "0....
0.0
-1
Generate a random character string of length n
def gen_random_char_string(n, base_s=""): if n == 0: return base_s c = random.choice(string.ascii_letters) return gen_random_char_string(n-1, base_s + c)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_rand_str(n):\n return \"\".join(random.choice(string.ascii_letters) for _ in range(n))", "def gen_random_chars(n: int = 10) -> Text:\n if n < 1:\n raise Exception('Number of random chars to generate has to be > 0')\n\n return ''.join(choice(ascii_lowercase + '-_')\n ...
[ "0.86658543", "0.85566527", "0.8546031", "0.84206235", "0.8215926", "0.80584174", "0.8052071", "0.795686", "0.79503375", "0.79443985", "0.79272246", "0.7922356", "0.79156876", "0.78830683", "0.7817866", "0.78086793", "0.7803741", "0.7789038", "0.7785089", "0.77838916", "0.778...
0.8413165
4
Returns the coordinates of the origin bounding box that are intersected by the intersect bounding box. >>> bounding_box = 10, 100, 30, 110 >>> other_bbox = 20, 100, 40, 105 >>> bounding_box_intersection(bounding_box, other_bbox) (10, 0, 20, 5) >>> bounding_box_intersection(other_bbox, bounding_box) (0, 0, 10, 5) >>> co...
def bounding_box_intersection(origin: Tuple[int, int, int, int], intersect: Tuple[int, int, int, int]) \ -> Optional[Tuple[int, int, int, int]]: o_t, o_l, o_b, o_r = origin t, l, b, r = intersect out_top = max(t, o_t) out_left = max(l, o_l) out_bottom = min(b, o_b) out_right = min(r, o_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intersection(box0, box1):\n if isinstance(box0, bounding_box_pb2.BoundingBox):\n box0 = BoundingBox(box0.start, box0.size)\n if isinstance(box1, bounding_box_pb2.BoundingBox):\n box1 = BoundingBox(box1.start, box1.size)\n if not isinstance(box0, BoundingBox):\n raise ValueError('box0 must be a Boun...
[ "0.73368526", "0.68448746", "0.6794572", "0.6752013", "0.6524481", "0.6365032", "0.6349253", "0.6339419", "0.63276106", "0.6230844", "0.6219065", "0.6181393", "0.6178924", "0.6171056", "0.6161214", "0.615606", "0.61267775", "0.61151683", "0.60859907", "0.607529", "0.60643137"...
0.7157741
1
Computes the recall, precision and fscore for the prediction Node given the truth Node.
def pixel_metrics(truth: Node, prediction: Node) -> Tuple[float, float, float]: recall, precision, fscore = 0, 0, 0 intersection_truth = bounding_box_intersection(truth.bounding_box, prediction.bounding_box) if intersection_truth is None: logging.d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_recall_precision_fscore(truth: List[Node], prediction: List[Node]) \\\n -> Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]:\n recall = numpy.zeros((len(truth), len(prediction)))\n precision = numpy.zeros((len(truth), len(prediction)))\n fscore = numpy.zeros((len(truth), len(predictio...
[ "0.7300171", "0.7163483", "0.71341056", "0.69883686", "0.6961389", "0.6687912", "0.66681075", "0.6655577", "0.6635931", "0.6634769", "0.6633833", "0.6585825", "0.6574979", "0.6558169", "0.6523462", "0.65003914", "0.6488661", "0.64875406", "0.64809954", "0.6479049", "0.647664"...
0.0
-1
draws an ellipse around the center of the points
def draw_perimeter(centroid, image, color, scale_factor): center_x = scale(centroid.coords.item(0), scale_factor) center_y = scale(centroid.coords.item(1), scale_factor) max_x = 0 max_y = 0 for point in centroid.points: scaled_x = scale(point.item(0), scale_factor) scaled_y = scale...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drawEllipse(img, center, axes, angle, startAngle=0, endAngle=360, color = (0,0,255), fill = -1):\n\tcv2.ellipse(img, center, axes, angle, startAngle, endAngle, color, fill)", "def ellipse(self):\n f = self.img\n x = self.x\n y = self.y\n x2 = self.x2\n y2 = self.y2\n xy = ...
[ "0.7842527", "0.7806552", "0.7571398", "0.73608714", "0.7261851", "0.7241438", "0.72338784", "0.7170632", "0.7167897", "0.71314347", "0.70732373", "0.7072711", "0.70466924", "0.7026025", "0.70214534", "0.7007903", "0.699258", "0.69773793", "0.6938472", "0.6928123", "0.6868979...
0.0
-1
Display an image. Wrap `matplotlib.pyplot.imshow` to display a possibly intensity manipulated version of the image `X`.
def imshow(X, ax=None, intensity_func=None, intensity_args=(), show_axis='frame', **kwargs): @_decorate_validation def validate_input(): _numeric('X', ('boolean', 'integer', 'floating'), shape=(-1, -1)) _generic('ax', mpl.axes.Axes, ignore_none=True) _generic('intensity_func'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_image(X):\n\n\tim = X.reshape(28, 28)\n\ttemp = plt.imshow(im)\n\tplt.show()", "def plot_img(X: np.ndarray, **kwargs):\n kwargs.setdefault('origin', 'lower') # Sane default\n plt.imshow(X, **kwargs)", "def show_image(image):\r\n plt.imshow(image, cmap='gray')\r\n plt.show()", "def di...
[ "0.8321958", "0.7961306", "0.75955147", "0.753911", "0.7533973", "0.7476919", "0.745646", "0.740446", "0.73409796", "0.7315752", "0.7315752", "0.7315752", "0.7277346", "0.72211635", "0.71984375", "0.71843135", "0.71229005", "0.71088415", "0.70842797", "0.7079816", "0.70698", ...
0.7462702
6
Set the term in the form.
def get_form_kwargs(self, **kwargs): kwargs = super(CandidateEditView, self).get_form_kwargs(**kwargs) kwargs['candidate_term'] = self.candidate.term return kwargs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_term_text(self, term, fulltext):\n term_entry = self.sql_session.query(Term).get(term)\n if term_entry:\n term_entry.fulltext = fulltext", "def preg_term(self, preg_term):\n\n self.logger.debug(\"In 'preg_term' setter.\")\n\n self._preg_term = preg_term", "def ter...
[ "0.71175146", "0.68550855", "0.63705415", "0.6144158", "0.5816871", "0.5789726", "0.57820034", "0.5767371", "0.5661654", "0.56422377", "0.56371766", "0.56113946", "0.56011474", "0.5574104", "0.55038446", "0.55038285", "0.547851", "0.5468794", "0.5446931", "0.54445195", "0.544...
0.0
-1
Set the term of the requirement to the current term.
def form_valid(self, form): form.instance.term = Term.objects.get_current_term() messages.success(self.request, '{req_type} requirement created!'.format( req_type=self.display_req_type)) return super( ManualCandidateRequirementCreateView, self).form_valid(form)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_term_text(self, term, fulltext):\n term_entry = self.sql_session.query(Term).get(term)\n if term_entry:\n term_entry.fulltext = fulltext", "def preg_term(self, preg_term):\n\n self.logger.debug(\"In 'preg_term' setter.\")\n\n self._preg_term = preg_term", "def ter...
[ "0.64847124", "0.6334201", "0.5986424", "0.5544135", "0.5509674", "0.54983705", "0.5456465", "0.5348691", "0.5333413", "0.52703387", "0.52224094", "0.52158356", "0.52030915", "0.5188148", "0.5169398", "0.51674813", "0.515454", "0.51141346", "0.51084954", "0.5074955", "0.50479...
0.5203271
12
Sets the id of this Game.
def id(self, id): self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, id):\n self.__id = id", "def set_id(self, id_):\n\n self.id_ = id_", "def SetId(self, id):\n self.id = int(id)", "def set_id(self, player_id):\n pass", "def set_id(self, id):\n self.data['id'] = id", "def set_id(self, id):\n self.id = id\n ...
[ "0.79247755", "0.78860915", "0.78824073", "0.7723867", "0.7681004", "0.759572", "0.75824404", "0.7418058", "0.7418058", "0.7418058", "0.7418058", "0.7418058", "0.7418058", "0.7418058", "0.7418058", "0.7418058", "0.7418058", "0.7406203", "0.73548305", "0.73548305", "0.73548305...
0.0
-1
Sets the player_b_name of this Game.
def player_b_name(self, player_b_name): self._player_b_name = player_b_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def player_a_name(self, player_a_name):\n\n self._player_a_name = player_a_name", "def player_b_games(self, player_b_games):\n\n self._player_b_games = player_b_games", "def player_b_id(self, player_b_id):\n\n self._player_b_id = player_b_id", "def bcp_player_variable(self, name, value, ...
[ "0.7046953", "0.68283844", "0.6823286", "0.60431397", "0.602946", "0.5915856", "0.5797274", "0.57551175", "0.564356", "0.5617421", "0.5611178", "0.5594154", "0.5562194", "0.55580914", "0.55133885", "0.54521626", "0.543514", "0.5420806", "0.5417903", "0.5417903", "0.5415289", ...
0.9181073
0
Sets the player_a_id of this Game.
def player_a_id(self, player_a_id): self._player_a_id = player_a_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_player_id(self, player_id):\n self.player_id = player_id", "def player_a_games(self, player_a_games):\n\n self._player_a_games = player_a_games", "def set_id(self, player_id):\n pass", "def player_id(self, player_id):\n\n self._player_id = player_id", "def player_id(self...
[ "0.69736564", "0.69562083", "0.6944866", "0.685115", "0.685115", "0.67752093", "0.6499893", "0.6387207", "0.61095905", "0.5931413", "0.5756862", "0.5719053", "0.5642285", "0.5627128", "0.5627128", "0.5627128", "0.55055493", "0.5500313", "0.5443958", "0.544141", "0.5326835", ...
0.8947233
0
Sets the player_b_id of this Game.
def player_b_id(self, player_b_id): self._player_b_id = player_b_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def player_b_games(self, player_b_games):\n\n self._player_b_games = player_b_games", "def player_b_name(self, player_b_name):\n\n self._player_b_name = player_b_name", "def player_a_id(self, player_a_id):\n\n self._player_a_id = player_a_id", "def set_player_id(self, player_id):\n ...
[ "0.701637", "0.68415976", "0.6529189", "0.6521133", "0.6509748", "0.63791966", "0.63791966", "0.63403463", "0.61362946", "0.609142", "0.57009405", "0.56523895", "0.5555329", "0.55444074", "0.54241943", "0.54158646", "0.54158646", "0.54158646", "0.5270569", "0.5130478", "0.512...
0.8964314
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, Game): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8089139", "0.8089139", "0.8054507", "0.79827213", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
The conv block is the block that has conv layer at shortcut. Arguments
def conv_block(filters, stage, block, strides=(2, 2)): def layer(input_tensor): # extracting params and names for layers conv_params = get_conv_params() bn_params = get_bn_params() conv_name, bn_name, relu_name, sc_name = handle_block_names(stage, block) x = BatchNormaliza...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conv_block(self, output_channel, filter_, activate):\n return self.add_layer(conv_block, output_channel, filter_, activate)", "def conv_block(input_tensor, kernel_size, filters, stage, block_id, strides=(2, 2), data_format='channels_last', train_bn=True):\n\n filter1, filter2, filter3 = filters\n ...
[ "0.754371", "0.7060612", "0.7043081", "0.69984245", "0.6913935", "0.68654615", "0.6839871", "0.6827021", "0.6823767", "0.67977256", "0.6794483", "0.6773842", "0.6742968", "0.67385846", "0.6723267", "0.67199", "0.6713653", "0.67034614", "0.66949296", "0.6679553", "0.6656035", ...
0.6701542
18
The identity block is the block that has no conv layer at shortcut. Arguments
def identity_block(filters, stage, block): def layer(input_tensor): conv_params = get_conv_params() bn_params = get_bn_params() conv_name, bn_name, relu_name, sc_name = handle_block_names(stage, block) x = BatchNormalization(name=bn_name + '0', **bn_params)(input_tensor) x ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_block(self, input_tensor, filters, activation, stage, block, start_with_batch_norm = True):\n\n # Set the naming convention\n conv_name_base = 'res' + str(stage) + block + '_branch'\n batch_norm_name_base = 'batch_norm' + str(stage) + block + '_branch'\n\n x_shortcut = inpu...
[ "0.71272004", "0.7022438", "0.6910338", "0.68836653", "0.68505627", "0.68221945", "0.6821999", "0.680346", "0.6799615", "0.67849326", "0.67714536", "0.67158884", "0.67146987", "0.67137283", "0.6664201", "0.6624224", "0.662218", "0.662218", "0.66078824", "0.65984523", "0.65485...
0.6847176
5
The identity block is the block that has no conv layer at shortcut. Arguments
def basic_identity_block(filters, stage, block): def layer(input_tensor): conv_params = get_conv_params() bn_params = get_bn_params() conv_name, bn_name, relu_name, sc_name = handle_block_names(stage, block) x = BatchNormalization(name=bn_name + '1', **bn_params)(input_tensor) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_block(self, input_tensor, filters, activation, stage, block, start_with_batch_norm = True):\n\n # Set the naming convention\n conv_name_base = 'res' + str(stage) + block + '_branch'\n batch_norm_name_base = 'batch_norm' + str(stage) + block + '_branch'\n\n x_shortcut = inpu...
[ "0.7127304", "0.70226824", "0.69105184", "0.68836373", "0.6850498", "0.68464863", "0.6822095", "0.6821457", "0.6803604", "0.67993164", "0.6784702", "0.6715633", "0.6714348", "0.6713607", "0.6663853", "0.66239524", "0.6621875", "0.6621875", "0.6607414", "0.6598225", "0.6548092...
0.6770701
11
The identity block is the block that has no conv layer at shortcut. Arguments
def basic_conv_block(filters, stage, block, strides=(2, 2)): def layer(input_tensor): conv_params = get_conv_params() bn_params = get_bn_params() conv_name, bn_name, relu_name, sc_name = handle_block_names(stage, block) x = BatchNormalization(name=bn_name + '1', **bn_params)(input_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_block(self, input_tensor, filters, activation, stage, block, start_with_batch_norm = True):\n\n # Set the naming convention\n conv_name_base = 'res' + str(stage) + block + '_branch'\n batch_norm_name_base = 'batch_norm' + str(stage) + block + '_branch'\n\n x_shortcut = inpu...
[ "0.71272004", "0.7022438", "0.6910338", "0.68836653", "0.68505627", "0.6847176", "0.68221945", "0.6821999", "0.680346", "0.6799615", "0.67849326", "0.67714536", "0.67158884", "0.67146987", "0.67137283", "0.6664201", "0.6624224", "0.662218", "0.662218", "0.66078824", "0.659845...
0.0
-1
The identity block is the block that has no conv layer at shortcut. Arguments
def basic_conv_block2(filters, stage, block, strides=(2, 2)): def layer(input_tensor): conv_params = get_conv_params() bn_params = get_bn_params() conv_name, bn_name, relu_name, sc_name = handle_block_names(stage, block) # x = BatchNormalization(name=bn_name + '1', **bn_params)(inp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_block(self, input_tensor, filters, activation, stage, block, start_with_batch_norm = True):\n\n # Set the naming convention\n conv_name_base = 'res' + str(stage) + block + '_branch'\n batch_norm_name_base = 'batch_norm' + str(stage) + block + '_branch'\n\n x_shortcut = inpu...
[ "0.71272004", "0.7022438", "0.6910338", "0.68836653", "0.68505627", "0.6847176", "0.68221945", "0.6821999", "0.680346", "0.6799615", "0.67849326", "0.67714536", "0.67158884", "0.67146987", "0.67137283", "0.6664201", "0.6624224", "0.662218", "0.662218", "0.66078824", "0.659845...
0.0
-1
The identity block is the block that has no conv layer at shortcut. Arguments
def identity_scse_block(filters, stage, block, re=8): def layer(input_tensor): conv_params = get_conv_params() bn_params = get_bn_params() conv_name, bn_name, relu_name, sc_name = handle_block_names(stage, block) x = BatchNormalization(name=bn_name + '0', **bn_params)(input_tensor)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_block(self, input_tensor, filters, activation, stage, block, start_with_batch_norm = True):\n\n # Set the naming convention\n conv_name_base = 'res' + str(stage) + block + '_branch'\n batch_norm_name_base = 'batch_norm' + str(stage) + block + '_branch'\n\n x_shortcut = inpu...
[ "0.71272004", "0.7022438", "0.6910338", "0.68836653", "0.68505627", "0.6847176", "0.68221945", "0.6821999", "0.680346", "0.6799615", "0.67849326", "0.67714536", "0.67158884", "0.67146987", "0.67137283", "0.6664201", "0.6624224", "0.662218", "0.662218", "0.66078824", "0.659845...
0.59655523
40
The identity block is the block that has no conv layer at shortcut. Arguments
def conv_scse_block(filters, stage, block, re=8): def layer(input_tensor): conv_params = get_conv_params() bn_params = get_bn_params() conv_name, bn_name, relu_name, sc_name = handle_block_names(stage, block) x = BatchNormalization(name=bn_name + '0', **bn_params)(input_tensor) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_block(self, input_tensor, filters, activation, stage, block, start_with_batch_norm = True):\n\n # Set the naming convention\n conv_name_base = 'res' + str(stage) + block + '_branch'\n batch_norm_name_base = 'batch_norm' + str(stage) + block + '_branch'\n\n x_shortcut = inpu...
[ "0.7127304", "0.70226824", "0.69105184", "0.68836373", "0.6850498", "0.68464863", "0.6822095", "0.6821457", "0.6803604", "0.67993164", "0.6784702", "0.6770701", "0.6715633", "0.6714348", "0.6713607", "0.6663853", "0.66239524", "0.6621875", "0.6621875", "0.6607414", "0.6598225...
0.0
-1
The identity block is the block that has no conv layer at shortcut. Arguments
def basic_identity_scse_block(filters, stage, block, re=8): def layer(input_tensor): conv_params = get_conv_params() bn_params = get_bn_params() conv_name, bn_name, relu_name, sc_name = handle_block_names(stage, block) x = BatchNormalization(name=bn_name + '1', **bn_params)(input_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_block(self, input_tensor, filters, activation, stage, block, start_with_batch_norm = True):\n\n # Set the naming convention\n conv_name_base = 'res' + str(stage) + block + '_branch'\n batch_norm_name_base = 'batch_norm' + str(stage) + block + '_branch'\n\n x_shortcut = inpu...
[ "0.71272004", "0.7022438", "0.6910338", "0.68836653", "0.68505627", "0.6847176", "0.68221945", "0.6821999", "0.680346", "0.6799615", "0.67849326", "0.67714536", "0.67158884", "0.67146987", "0.67137283", "0.6664201", "0.6624224", "0.662218", "0.662218", "0.66078824", "0.659845...
0.60076267
37
The identity block is the block that has no conv layer at shortcut. Arguments
def basic_conv_scse_block(filters, stage, block, strides=(2, 2), re=8): def layer(input_tensor): conv_params = get_conv_params() bn_params = get_bn_params() conv_name, bn_name, relu_name, sc_name = handle_block_names(stage, block) x = BatchNormalization(name=bn_name + '1', **bn_par...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_block(self, input_tensor, filters, activation, stage, block, start_with_batch_norm = True):\n\n # Set the naming convention\n conv_name_base = 'res' + str(stage) + block + '_branch'\n batch_norm_name_base = 'batch_norm' + str(stage) + block + '_branch'\n\n x_shortcut = inpu...
[ "0.71272004", "0.7022438", "0.6910338", "0.68836653", "0.68505627", "0.6847176", "0.68221945", "0.6821999", "0.680346", "0.6799615", "0.67849326", "0.67714536", "0.67158884", "0.67146987", "0.67137283", "0.6664201", "0.6624224", "0.662218", "0.662218", "0.66078824", "0.659845...
0.0
-1
Returns the default collector settings
def get_default_config(self): config = super(UserScriptsCollector, self).get_default_config() config.update( { 'path': '.', 'scripts_path': '/etc/diamond/user_scripts/', 'method': 'Threaded', } ) return config
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_default_config(self):\r\n config = super(CMDCollector, self).get_default_config()\r\n config.update({\r\n 'enabled': 'True',\r\n 'fs': ',',\r\n 'timeout': 300,\r\n })\r\n return config", "def getDefaultSettings():\n return {}", "def ge...
[ "0.7051504", "0.70081085", "0.6949213", "0.67133325", "0.65743", "0.6530999", "0.6521596", "0.65153503", "0.64666075", "0.64476866", "0.6413572", "0.6397821", "0.6380573", "0.6368372", "0.6357416", "0.6351892", "0.6331843", "0.63120425", "0.62354094", "0.6231949", "0.62074935...
0.587527
49
Voice Play the next song in the queue. Accepts no arguments.
def on_skip(self, event): self.pre_check(event) if (event.author.id not in self.cool_down["general"] or time() - self.cool_down["general"][event.author.id] >= 2): self.get_player(event.guild.id).skip() self.cool_down["general"][event.author.id] = time() el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def play(self, ctx, *, song: str):\n state = self.get_voice_state(ctx.message.server)\n opts = {\n 'default_search': 'ytsearch',\n 'quiet': True,\n }\n\n if state.voice is None:\n success = await ctx.invoke(self.summon)\n if not success:...
[ "0.71854866", "0.7116944", "0.69287676", "0.6867975", "0.677823", "0.6712081", "0.66847193", "0.6683627", "0.66687655", "0.6661358", "0.66608906", "0.66580075", "0.66245365", "0.66217434", "0.6613146", "0.6613146", "0.6595063", "0.65922534", "0.6574445", "0.6485049", "0.64724...
0.0
-1
Voice Get information about next queued song. Accepts no arguments.
def on_next_command(self, event): self.pre_check(event) if not self.get_player(event.guild.id).queue: return event.channel.send_message("There aren't any songs queued.") ytdata = self.get_ytdl_values( self.get_player(event.guild.id).queue[0].metadata, ) ev...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_next_song():\n try:\n next_song = queue.getSong()\n queue_change()\n currently_playing_change(next_song)\n return json.dumps(next_song.to_dict())\n except IndexError as e:\n return json.dumps({'error': 'No songs in the queue'})", "def get_next_song(self):\r\n ...
[ "0.7528458", "0.6910447", "0.68040365", "0.63107395", "0.63067645", "0.627678", "0.6212034", "0.6185695", "0.6137425", "0.61039096", "0.6087242", "0.60314745", "0.6030844", "0.60241926", "0.600748", "0.5967641", "0.59300333", "0.58726114", "0.5847199", "0.58364683", "0.581738...
0.65402305
3
Returns total amount received on your account
def get_transaction_totals(self, params=None): return self.get(f"{self.gateway_path}/totals", params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def balance(self):\n total_money = 0\n for item in self.ledger:\n total_money += item['amount']\n return total_money", "def get_total_paid(self):\n return sum(self.paid)", "def total_spent(self):\n total_sum = Order.objects.filter(\n email=self.email).ag...
[ "0.7104757", "0.7069385", "0.6880987", "0.68749225", "0.68589234", "0.6857937", "0.6842639", "0.68081063", "0.67907584", "0.67608845", "0.6741547", "0.6711796", "0.6690905", "0.6689272", "0.6676667", "0.661183", "0.6594401", "0.6575686", "0.65718985", "0.6565763", "0.6565763"...
0.0
-1
return the index corresponding at the first occurence of value in list
def index(liste, value): for ii in range(len(liste)): if liste[ii] == value: return ii return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index(self, value):\n self.__validate_value(value)\n for index, v in enumerate(self.__list):\n if v == value:\n return index", "def closest_value_index(val, lst):\n index = 0\n for item in lst:\n if item > val:\n return index\n index += 1...
[ "0.7666883", "0.75553674", "0.75322366", "0.73974407", "0.7306116", "0.72406524", "0.71949124", "0.71868026", "0.7173489", "0.71538794", "0.71089154", "0.7069118", "0.7064808", "0.70324296", "0.7016907", "0.70150346", "0.69772476", "0.69540596", "0.69502425", "0.69284594", "0...
0.81286085
0
method to set the name of the output_database
def set_output_database (self, file_name): try: self.object_database=file_name self.filepath_output_database = os.path.join(self.filepath, self.output_database) print("set output_database filename to", file_name) except: print("setting object database fail...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def database_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"database_name\")", "def getDatabaseName(self):\n raise NotImplementedError", "def get_db_name(self):\n\t\treturn conf.db_name", "def get_name(self) -> str:\n return self.dbname", "def db_name(self, db_name):\n\n...
[ "0.71581715", "0.7139252", "0.70207834", "0.6973042", "0.6896915", "0.6870785", "0.6853191", "0.6820632", "0.668634", "0.6684695", "0.6680187", "0.66756105", "0.66751665", "0.66531605", "0.6643873", "0.66307545", "0.6598226", "0.65926546", "0.6548423", "0.65220237", "0.640572...
0.8193771
0
Creates a GetGroupMessage from a protobuf As a requirement of all objects which inherit from Serializable, this method transforms a protobuf object into an instance of this class.
def _proto2object( proto: GetGroupMessage_PB, ) -> "GetGroupMessage": return GetGroupMessage( msg_id=_deserialize(blob=proto.msg_id), address=_deserialize(blob=proto.address), content=json.loads(proto.content), reply_to=_deserialize(blob=proto.reply_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _proto2object(\n proto: CreateGroupMessage_PB,\n ) -> \"CreateGroupMessage\":\n\n return CreateGroupMessage(\n msg_id=_deserialize(blob=proto.msg_id),\n address=_deserialize(blob=proto.address),\n content=json.loads(proto.content),\n reply_to=_deseri...
[ "0.8065173", "0.8059963", "0.80385315", "0.7838053", "0.78343934", "0.7728165", "0.772733", "0.76612204", "0.75730646", "0.75216293", "0.7501986", "0.7421604", "0.7359245", "0.7337106", "0.72288305", "0.71763164", "0.70391303", "0.70110816", "0.68666184", "0.68378156", "0.645...
0.8384033
0
Sets the prev link for the node.
def getPrev(self): return self.prev
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setPrev(self, prev):\n\t\t\tself.prev = prev", "def prev(self, prev):\n\n self._prev = prev", "def set_prev(self, p) -> None:\n self.prev = p", "def setPrev(self, prev_half_edge):\n self.prev = prev_half_edge", "def prev_page_url(self, prev_page_url):\n\n self._prev_page_url...
[ "0.7875985", "0.7465448", "0.7228299", "0.7093982", "0.7074755", "0.6893062", "0.68524987", "0.67959595", "0.668916", "0.6375687", "0.6178108", "0.61040765", "0.60961574", "0.6089415", "0.6055914", "0.5996824", "0.5947542", "0.59411544", "0.5934224", "0.59309167", "0.5916836"...
0.5934818
18
Sets the prev link for the node.
def setPrev(self, prev): self.prev = prev
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prev(self, prev):\n\n self._prev = prev", "def set_prev(self, p) -> None:\n self.prev = p", "def setPrev(self, prev_half_edge):\n self.prev = prev_half_edge", "def prev_page_url(self, prev_page_url):\n\n self._prev_page_url = prev_page_url", "def goToPrevHistory(self: Self, ...
[ "0.7465448", "0.7228299", "0.7093982", "0.7074755", "0.6893062", "0.68524987", "0.67959595", "0.668916", "0.6375687", "0.6178108", "0.61040765", "0.60961574", "0.6089415", "0.6055914", "0.5996824", "0.5947542", "0.59411544", "0.5934818", "0.5934224", "0.59309167", "0.5916836"...
0.7875985
0
Replace the graph of the given GraphModule with one that contains the same nodes as the original, but in topologically sorted order. This is used by the merge_matmul transformation below, which disturbs the topologically sorted order of its input GraphModule, so that this order is restored before further transformation...
def legalize_graph(gm: pippy.fx.GraphModule) -> pippy.fx.GraphModule: indeg = {node: 0 for node in gm.graph.nodes} new_graph = pippy.fx.Graph() # Track how many unfulfilled dependencies each node has for node in gm.graph.nodes: for user in node.users: indeg[user] += 1 queue: coll...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reset_topological_order(self):\n self._topological_order = self._input_nodes[:]\n self.sorted = False", "def transform(g):\n min_nidx = min(g.nodes)\n max_nidx = max(g.nodes)\n\n if min_nidx == 0 and max_nidx == g.number_of_nodes() - 1: # Everything already labeled as wanted\n ...
[ "0.6281253", "0.6020051", "0.5968213", "0.5939152", "0.5891148", "0.587402", "0.57739174", "0.57242393", "0.5655821", "0.56404704", "0.56368893", "0.56269574", "0.56102455", "0.5603213", "0.55983084", "0.5588909", "0.5579634", "0.5571751", "0.55631703", "0.5544777", "0.554143...
0.62657577
1
Determine which FA environment (Dev/Uat/Prod) the script is running in. Returns the specified path contained in the FExtensionValue which differs for each environment. Also retrieves the list of trade filters separated by ';' in the FExtensionValue config file.
def retrieve_environment(env_config, filter_config): global path, filter_list_from_config arena_data_server = acm.FDhDatabase["ADM"].ADSNameAndPort().upper() configuration = acm.GetDefaultValueFromName( acm.GetDefaultContext(), acm.FObject, env_config) filter_list_from_config = acm.GetDefaultV...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_environment():\n # Search for the environment variable set by the hutch python setup\n env = os.getenv('CONDA_ENVNAME')\n # Otherwise look for built-in Conda environment variables\n if not env:\n env = os.getenv('CONDA_DEFAULT_ENV')\n # Check the top level PYTHONPATH to see if...
[ "0.5488771", "0.52747124", "0.52578723", "0.5231717", "0.51516294", "0.50663215", "0.506381", "0.5058923", "0.505804", "0.49744675", "0.49618024", "0.4936943", "0.48768833", "0.48471853", "0.48470667", "0.4840807", "0.48290032", "0.47938055", "0.4790978", "0.47902945", "0.478...
0.6358428
0
initialize the dictionary structure.
def initialize_globals(): for filter_name in filter_list_from_config: try: trade_filter = acm.FTradeSelection[filter_name] live_trade_filters.append(trade_filter) add_trades(trade_filter) except Exception: exc_type, _exc_obj, exc_tb = sys.exc_info() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.dict = {}", "def __init__(self):\n self.dict = {}", "def __init__(self, dict):\n self.dict = dict", "def __init__(self, dict):\n self.dict = dict", "def __init__(self):\n self.dictionary = None", "def __init__(self):\r\n self.dic={}", ...
[ "0.76089376", "0.76089376", "0.7508111", "0.7508111", "0.745744", "0.7422544", "0.7417321", "0.7417321", "0.7382122", "0.7361919", "0.7361919", "0.7361919", "0.7361919", "0.73564655", "0.7314578", "0.73127544", "0.72841823", "0.7283625", "0.7282861", "0.7256283", "0.72472054"...
0.0
-1
This renders the home page.
def home(request): context_dict = {} employee = models.Teacher.objects.filter( user=request.user ).first() # context_dict = { # context_helper.get_emp_info(employee) # } # print (context_dict) context_dict.update(context_helper.get_emp_info(employee)) return render(request, "home.html", context_dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home():\n\n return render_template('home_page.html')", "def home():\n\n return render_template(\"home.html\")", "def render_home():\r\n\treturn render_template(\"index.html\")", "def home():\n return render_template('home.html')", "def home():\n return render_template('home.html')", "def ...
[ "0.8908748", "0.8750969", "0.87306887", "0.86931294", "0.86931294", "0.86931294", "0.86931294", "0.86931294", "0.86931294", "0.86931294", "0.86931294", "0.86931294", "0.86931294", "0.86931294", "0.86931294", "0.86931294", "0.86931294", "0.86931294", "0.86931294", "0.8677446", ...
0.0
-1
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=None, normalize=False, title=None, cmap=plt.cm.Blues): if not title: if normalize: title = 'Normalized confusion matrix' else: title = 'Confusion ma...
{ "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.8194862", "0.80949175", "0.8029915", "0.8019153", "0.79941195", "0.7991258", "0.7980955", "0.7976606", "0.79610753", "0.79590565", "0.79378676", "0.7934962", "0.7934504", "0.79313844", "0.7926313", "0.7924577", "0.79241234", "0.7923211", "0.7923023", "0.7921931", "0.791787...
0.0
-1
Return the name of the Hikvision sensor.
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sensor_name(self):\n return self.data[1]", "def name(self):\n return self._sensor.name", "def name(self):\n return self.device.device_data[self.device_id]['name'] + \\\n f' {self._sensor_type}'", "def name(self):\n return f\"{self._name} {SENSOR_TYPES[self.senso...
[ "0.8268713", "0.8237671", "0.78250563", "0.76772547", "0.75464255", "0.7545106", "0.74908656", "0.7388705", "0.7388686", "0.73761815", "0.72924775", "0.71507454", "0.704222", "0.7000588", "0.6804253", "0.67127144", "0.67098206", "0.6688464", "0.6660511", "0.6660511", "0.66605...
0.0
-1
Return true if sensor is on.
def is_on(self): return self._sensor_state()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_on(self):\n return getattr(self.coordinator.data[0], self._sensor) is True", "def is_on(self):\n data = self.sensor_data\n if data and data[\"model\"] == \"SML\" and data[\"changed\"]:\n return data[\"state\"] == STATE_ON\n return False", "def is_on(self) -> bool:\...
[ "0.8668819", "0.83718693", "0.8321358", "0.82086754", "0.82086754", "0.82086754", "0.8072303", "0.79461884", "0.78692335", "0.78692335", "0.78290933", "0.77697575", "0.7760602", "0.76900584", "0.7629474", "0.7626312", "0.7625873", "0.757377", "0.7554073", "0.75531846", "0.752...
0.88761306
0
Return the class of this sensor, from DEVICE_CLASSES.
def device_class(self): try: return DEVICE_CLASS_MAP[self._sensor] except KeyError: # Sensor must be unknown to us, add as generic return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_class(self):\n return self.sensor_type[\"class\"]", "def device_class(self):\n return DEVICE_CLASSES.get(self.sensor_data[\"model\"])", "def device_class(self):\n return SENSOR_TYPES[self.sensor][3].get(\"device_class\")", "def device_class(self):\n if self.sensor_class...
[ "0.9062012", "0.8947314", "0.8809003", "0.87462795", "0.87445956", "0.87445956", "0.873263", "0.87101674", "0.85638815", "0.85638815", "0.85526353", "0.84336495", "0.84305036", "0.83888704", "0.8281369", "0.82692766", "0.8168396", "0.8107814", "0.80006665", "0.7911548", "0.78...
0.83166206
14
Return the state attributes.
def extra_state_attributes(self): attr = {ATTR_LAST_TRIP_TIME: self._sensor_last_update()} if self._delay != 0: attr[ATTR_DELAY] = self._delay return attr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state_attributes(self):\n return self._attributes", "def state_attributes(self):\n return self._attributes", "def device_state_attributes(self):\r\n return self.attributes", "def device_state_attributes(self):\n return self._state_attrs", "def device_state_attributes(self):\...
[ "0.8953056", "0.8953056", "0.8524094", "0.83673775", "0.83673775", "0.83637255", "0.8335954", "0.83349335", "0.8310754", "0.8291855", "0.828953", "0.828953", "0.82875603", "0.82875603", "0.82875603", "0.82875603", "0.82875603", "0.82875603", "0.82875603", "0.82875603", "0.828...
0.0
-1
Creating flask app and setting all modeuls and config.
def create_app(): config = config_by_name[os.getenv('APP_SETTINGS', 'dev')] flask_app = Flask(__name__, static_folder=None, instance_relative_config=True) flask_app.config.from_object(config) with flask_app.app_context(): app_manager = Manager(flask_app) from app.models import db, ma ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_app(self):\r\n self.app = Flask(__name__, instance_relative_config=True)\r\n\r\n # Init the secret key of the app -it is a must for flask to run\r\n self.app.config.from_mapping(\r\n SECRET_KEY='!ZNeverSayNever116Z!',\r\n MONGODB_SETTINGS= {'host': 'mongodb://l...
[ "0.862719", "0.8351689", "0.8347321", "0.8346519", "0.83345604", "0.8300351", "0.8289072", "0.82784265", "0.8225128", "0.8211296", "0.8185404", "0.8164446", "0.8142924", "0.8129862", "0.80871683", "0.8087077", "0.8070512", "0.8064273", "0.80463356", "0.8019652", "0.80069155",...
0.81871897
10
Traverse through the entire BTree to calculate the number of nodes it has.
def numNodes(T): n = 1 if T.isLeaf: return n for i in range(len(T.child)): n += numNodes(T.child[i]) return n
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_nodes(self):\n if self.children is None:\n return 0\n\n total_count = 0\n for child in self.children:\n if child is None:\n return 0\n child_count = child.count_nodes()\n total_count = total_count + child_count\n\n ret...
[ "0.8126878", "0.78849125", "0.7833212", "0.78316116", "0.7772799", "0.77459306", "0.77308065", "0.7716238", "0.7689622", "0.7682001", "0.767653", "0.76338", "0.74925274", "0.7490429", "0.7453843", "0.73934203", "0.7377626", "0.7375549", "0.73751295", "0.73481226", "0.7330711"...
0.8063285
1
Test case for create_response_descriptor_subscriptions_subscription_subscription_resource
def test_create_response_descriptor_subscriptions_subscription_subscription_resource(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_modify_response_descriptor_subscriptions_subscription_subscription_resource(self):\n pass", "def test_create_response_descriptor_subscriptions_subscription_subscription_resource_spaces(self):\n pass", "def test_load_response_descriptor_subscriptions_subscription_subscription_resource(sel...
[ "0.87412554", "0.8588088", "0.83379585", "0.82308966", "0.7775794", "0.7608592", "0.7605677", "0.75500727", "0.7347543", "0.7300998", "0.7060672", "0.70161843", "0.69488347", "0.69302607", "0.6744745", "0.6676874", "0.66014934", "0.65724623", "0.64912724", "0.6457783", "0.640...
0.94596004
0
Test case for create_response_descriptor_subscriptions_subscription_subscription_resource_spaces
def test_create_response_descriptor_subscriptions_subscription_subscription_resource_spaces(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_modify_response_descriptor_subscriptions_subscription_subscription_resource_spaces(self):\n pass", "def test_index_response_descriptor_subscriptions_subscription_subscription_resource_spaces(self):\n pass", "def test_load_response_descriptor_subscriptions_subscription_subscription_resour...
[ "0.87898076", "0.84957993", "0.84469354", "0.8135916", "0.8024415", "0.75330555", "0.74872947", "0.72072065", "0.7170737", "0.7123899", "0.7024082", "0.6879563", "0.68744624", "0.66875726", "0.6547886", "0.6496468", "0.6405576", "0.62375563", "0.62205213", "0.62015754", "0.61...
0.94430006
0
Test case for list_all_response_descriptor_subscriptions_subscription_subscription_resource
def test_list_all_response_descriptor_subscriptions_subscription_subscription_resource(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_list_all_response_descriptor_subscriptions_subscription_subscription_resource_spaces(self):\n pass", "def test_load_response_descriptor_subscriptions_subscription_subscription_resource(self):\n pass", "def test_create_response_descriptor_subscriptions_subscription_subscription_resource(s...
[ "0.8672392", "0.80634016", "0.7963346", "0.79525554", "0.7950173", "0.762874", "0.75751597", "0.75354266", "0.75185573", "0.7085981", "0.7015135", "0.6927433", "0.6609123", "0.6608625", "0.65717506", "0.64721626", "0.6449704", "0.6410992", "0.6408065", "0.63710225", "0.632791...
0.94718015
0
Test case for modify_response_descriptor_subscriptions_subscription_subscription_resource
def test_modify_response_descriptor_subscriptions_subscription_subscription_resource(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_response_descriptor_subscriptions_subscription_subscription_resource(self):\n pass", "def test_modify_response_descriptor_subscriptions_subscription_subscription_resource_spaces(self):\n pass", "def test_load_response_descriptor_subscriptions_subscription_subscription_resource(sel...
[ "0.8563571", "0.84658855", "0.8058546", "0.80224764", "0.7713785", "0.75516945", "0.7453322", "0.7192042", "0.71334755", "0.71012443", "0.70175844", "0.7000383", "0.6748506", "0.6710934", "0.6697179", "0.66575694", "0.66456854", "0.6641054", "0.6612385", "0.6570631", "0.65649...
0.9448674
0
Add a member to a group, by an existing group member.
def add_new_member(self, event): body = event['body'] body = json.loads(body) required_fields = ['group_id', 'new_user_id'] for f in required_fields: if f not in body: return get_bad_request('POST body missing field {}'.format(f)) group_id = body['gr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_member_to_group(self, group_id, member_id):\n route_values = {}\n if group_id is not None:\n route_values['groupId'] = self._serialize.url('group_id', group_id, 'str')\n if member_id is not None:\n route_values['memberId'] = self._serialize.url('member_id', member...
[ "0.80759203", "0.7781975", "0.770071", "0.7675795", "0.759767", "0.7432633", "0.7386738", "0.73069775", "0.7115192", "0.7030641", "0.6992207", "0.6979588", "0.69104636", "0.68972623", "0.6890155", "0.6796194", "0.66509473", "0.6607152", "0.66037047", "0.6538465", "0.6519908",...
0.6159286
37
Converting pixels from BGR (Red, Green, Blue) to YCrCb (luma, bluedifference, reddifference)
def bgr_to_ycrcb(matrix3d: np.ndarray) -> np.ndarray: return np.apply_along_axis(bgr_pixel_to_ycrcb, 2, matrix3d)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yuv_to_rgb(img_yuv):\n\n y = img_yuv[..., 0]\n u = img_yuv[..., 1]\n v = img_yuv[..., 2]\n\n r = y + 1.14 * v\n g = y - 0.396 * u - 0.581 * v\n b = y + 2.029 * u\n\n img_rgb = np.stack((r, g, b), axis=2)\n img_rgb = np.clip(img_rgb, 0, 1)\n return img_rgb", "def yuv2rgb(im):\n #...
[ "0.73401994", "0.72443944", "0.7191258", "0.6968075", "0.69310284", "0.68717015", "0.6746351", "0.6573021", "0.6481176", "0.64723957", "0.6445774", "0.6442767", "0.6418211", "0.6372011", "0.6353601", "0.6352888", "0.6323306", "0.62929225", "0.6268779", "0.6262479", "0.6217953...
0.0
-1
Return if the plugin is available for loading. If a plugin is missing dependencies or for some other reason should not be available to the current system it should override this property and return False to exclude itself from the plugin list.
def available(self): return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_loaded(self, plugin):\n return self._get_name(plugin) in self.loaded_plugins", "def has_plugin(self, name: str) -> bool:\n return name in self._plugins", "def has_plugin(self, plugin_name):\n return plugin_name in self.plugins.values_list('name', flat=True)", "def plugin_enabled_b...
[ "0.7220657", "0.7182119", "0.7025559", "0.6910154", "0.689142", "0.6865923", "0.6846862", "0.68416315", "0.6709156", "0.6687168", "0.65706414", "0.65523076", "0.6530908", "0.65000683", "0.64809287", "0.64012355", "0.63563097", "0.63315696", "0.6328762", "0.63147926", "0.62802...
0.6098247
38
Uses a given batch dictionary and domain kwargs to obtain a SqlAlchemy column object.
def get_compute_domain( self, domain_kwargs: Dict, domain_type: Union[str, MetricDomainTypes], accessor_keys: Optional[Iterable[str]] = None, ) -> Tuple[Select, dict, dict]: # Extracting value from enum if it is given for future computation domain_type = MetricDomainT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def column(self, domain=None):\n if domain is None:\n return self.col.copy()\n else:\n return self.col.convert_to(domain)", "def sqlobj_from_dict(obj, values):\n for c in obj.__table__.columns:\n if c.name in values:\n setattr(obj, c.name, values[c.name])\...
[ "0.5431496", "0.5401011", "0.5268713", "0.5224346", "0.5138979", "0.5074222", "0.5069668", "0.4973821", "0.49038166", "0.48214892", "0.48129463", "0.48129117", "0.4805565", "0.47794953", "0.47447672", "0.47046596", "0.46708152", "0.46705273", "0.46506712", "0.46404663", "0.46...
0.5133917
5
"0x58, 0x59, 0x01, 0x00, 0x00" => [0x58, 0x59, 0x01, 0x00, 0x00]
def hex_str_to_bytes_arr(bytes_str: str) -> List[int]: return eval(f"[{bytes_str}]")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hex_list(self):\r\n return [''.join(['{:02X}'.format(b) for b in data]) for data in self.buffers()]", "def buf_to_list(buf):\r\n buf_stripped = buf.raw.decode().rstrip('\\x00')\r\n# for ch in buf_stripped:\r\n# if (ch == '0') or (ch == '\\t') or (ch == '\\n'):\r\n# name = name....
[ "0.65582275", "0.63307226", "0.6290027", "0.6262765", "0.61640704", "0.6160979", "0.6156085", "0.61130404", "0.610784", "0.60554963", "0.6033458", "0.5946255", "0.5939836", "0.58945185", "0.5894092", "0.5832303", "0.5822892", "0.58158875", "0.58045244", "0.580421", "0.5776219...
0.6725189
0
Test being able to unload an entry.
async def test_unload_entry(opp, mock_account): entry = await setup_integration(opp, mock_account, VACUUM_DOMAIN) vacuum = opp.states.get(VACUUM_ENTITY_ID) assert vacuum assert vacuum.state == STATE_DOCKED await opp.services.async_call( VACUUM_DOMAIN, SERVICE_START, {ATTR_E...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_unload_entry(opp, nzbget_api):\n entry = await init_integration(opp)\n\n assert len(opp.config_entries.async_entries(DOMAIN)) == 1\n assert entry.state is ConfigEntryState.LOADED\n\n assert await opp.config_entries.async_unload(entry.entry_id)\n await opp.async_block_till_done()\n\n ...
[ "0.77138734", "0.76933795", "0.74769473", "0.7384423", "0.7349679", "0.73169553", "0.7288968", "0.72645843", "0.72513765", "0.7182948", "0.713809", "0.6820462", "0.6797362", "0.6791803", "0.6683401", "0.6641027", "0.66159004", "0.6594395", "0.6540514", "0.64573026", "0.645170...
0.720308
9
dictionary of all default parameters (key=param name). Note that defaults are generally only stored for parameters where the default is different from the configured value
def get_default_parameters(self, default_type): return self._default_parameters.get(default_type, {})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parameters_default(cls):\n return cls._Parameters.__new__.__defaults__", "def get_parameters(self):\n params = {}\n for p in self.DEFAULT_VALUES.keys():\n params[p] = getattr(self, p)\n return params", "def defaults() -> dict:\n pass", "def get_defaults(self)...
[ "0.79437476", "0.7881707", "0.77220637", "0.76504976", "0.76182073", "0.756907", "0.7555116", "0.7548557", "0.7531213", "0.7496584", "0.7451419", "0.7296076", "0.72916055", "0.72622734", "0.72622734", "0.72486615", "0.7164347", "0.71471405", "0.7126808", "0.7124386", "0.71238...
0.76477087
4
get a specific dataset.
def get_dataset(self, name, multi_instance=0): return [elem for elem in self._data_list if elem.name == name and elem.multi_id == multi_instance][0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dataset(self):\n return datasets.get_dataset(self.dataset_id)", "def get_dataset(self, dataset_id):\n return self.session.query(self.Dataset).get(dataset_id)", "def get(id: str) -> DataSet:\n pass", "def get(self, name):\n assert name, \"Must input a valid dataset name.\"\...
[ "0.7955141", "0.7826601", "0.7670849", "0.760219", "0.7440116", "0.7433901", "0.73345757", "0.7322343", "0.72858053", "0.7252087", "0.7180746", "0.7176037", "0.71597934", "0.71402335", "0.71210235", "0.7117107", "0.711563", "0.7065056", "0.7016815", "0.7013039", "0.7009789", ...
0.6579869
35
Assert that a valid CO type amendment statement returns a 200 status.
def test_amendment_court_order_success(session, client, jwt): # setup current_app.config.update(PAYMENT_SVC_URL=MOCK_PAY_URL) rv1 = create_financing_test(session, client, jwt) assert rv1.status_code == HTTPStatus.CREATED assert rv1.json['baseRegistrationNumber'] base_reg_num = rv1.json['baseRegi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_status_code_200(self):\n\t\tformatted_status = status_code(self)\n\t\tself.assertEqual(formatted_status, '200')", "def test_status_code(self):\n formatted_status_code = get_status_code('python')\n self.assertEqual(formatted_status_code, 200) #compares the test result with the result expect...
[ "0.6761491", "0.6702015", "0.6561934", "0.65322626", "0.64473075", "0.631492", "0.6283017", "0.6236529", "0.6227647", "0.6190859", "0.61854064", "0.6174831", "0.61590624", "0.61475474", "0.61203253", "0.6095389", "0.6056882", "0.60532194", "0.60359067", "0.5995723", "0.599545...
0.5729343
48
Assert that a valid AM type amendment statement returns a 200 status.
def test_amendment_success(session, client, jwt): # setup current_app.config.update(PAYMENT_SVC_URL=MOCK_PAY_URL) rv1 = create_financing_test(session, client, jwt) assert rv1.status_code == HTTPStatus.CREATED assert rv1.json['baseRegistrationNumber'] base_reg_num = rv1.json['baseRegistrationNumb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_status_code_200(self):\n\t\tformatted_status = status_code(self)\n\t\tself.assertEqual(formatted_status, '200')", "def test_status_code(self):\n formatted_status_code = get_status_code('python')\n self.assertEqual(formatted_status_code, 200) #compares the test result with the result expect...
[ "0.6372946", "0.63325983", "0.63275206", "0.62338895", "0.62029874", "0.61930406", "0.6110963", "0.60898936", "0.6039467", "0.59729207", "0.5962532", "0.59578514", "0.5945757", "0.59246397", "0.5898609", "0.5855304", "0.5838366", "0.58124256", "0.58041656", "0.57992774", "0.5...
0.5846508
16
Test showing the page of all offers.
def test_offers_show_every(self): result = self.client.get('/offers_show_every') self.assertEqual(result.status, '200 OK') self.assertIn(b'Offers', result.data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_offers(self):\n pass", "def test_show_offer(self, mock_find):\n mock_find.return_value = sample_offer\n\n result = self.client.get(f'/offers/{sample_offer_id}')\n self.assertEqual(result.status, '200 OK')\n self.assertIn(b'Description', result.data)", "def test_b...
[ "0.72028357", "0.63975585", "0.6307497", "0.6142342", "0.6118828", "0.6108139", "0.6106805", "0.61000824", "0.60947084", "0.6088211", "0.6061273", "0.6035597", "0.6009674", "0.5989309", "0.59431523", "0.59197736", "0.5881938", "0.5876856", "0.5876462", "0.58678347", "0.582831...
0.78508234
0
This method converts the dictionary to the list
def convertToList(dict): listOfList= [[k, v] for k, v in dict.items()] for i in listOfList: if i[1][2]=='x': listOfList.remove(i) return listOfList
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __dic2list(self,dic):\n return [(x,dic[x]) for x in dic]", "def __dic2list(self,dic):\n\treturn map(lambda x:[x,dic[x]],dic)", "def __dict_to_list(dict):\n\n max_val = 1\n for k,v in dict.items():\n if type(v) is list:\n if len(v) > 1 and (max_val > 1 and len(...
[ "0.80659676", "0.8013816", "0.75778276", "0.75696623", "0.7395945", "0.72877353", "0.727885", "0.7155753", "0.70990515", "0.6958522", "0.68984103", "0.6868956", "0.68315274", "0.68111265", "0.6782167", "0.6775089", "0.67651856", "0.6748294", "0.67303777", "0.6666534", "0.6666...
0.6355936
36
A person template page without attached person should show an error banner explaining to the user that he/she is misusing the template.
def test_template_person_detail_without_person(self): page = PageFactory( template="courses/cms/person_detail.html", title__language="en", should_publish=True, ) with self.assertTemplateUsed( "courses/cms/fragment_error_detail_template_banner.html...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def errorview(request):\n \n #return a page indicating an error has occured\n return render(request, 'SmellGuessTemplate/error.html')", "def page_not_found(error):\r\n return render_template('error_template.html' , title = \"404 bud\", \r\n \t\t\t\t\t\t\t\t\t\t\t\tmessage = \"Time to make the chim...
[ "0.6937663", "0.6863008", "0.68516415", "0.6752877", "0.6686156", "0.66346717", "0.6599722", "0.65577775", "0.6542976", "0.650337", "0.6459382", "0.6441446", "0.64403677", "0.64176124", "0.63976896", "0.63921285", "0.63720983", "0.63401914", "0.63311446", "0.626568", "0.62625...
0.7322566
0
barcode_filename should accept sequences 0107 Sequences 0107 are all represented by singledigit integers, and should be properly zeropadded in the filename. The range allowed here is deliberately shorter than elsewhere in the program because barcode_filename is designed to work only with a corresponding date, and ISO w...
def test_price_code_0(self): start_date = datetime(2016, 11, 13) # Note this is a Sunday, and must have timedelta added for x in range(1, 7): with self.subTest(x=x): date = start_date + timedelta(x) result = star_barcode.barcode_filename(date, x) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_year_boundary(self):\n date = datetime(2017, 1, 1)\n seq = 27\n name = star_barcode.barcode_filename(date, seq)\n self.assertEqual(\n name,\n 'Barcode_2016-W52-7_27.pdf'\n )", "def test_wrong_sequence(self):\n date = datetime(2016, 11, ...
[ "0.6251834", "0.6211295", "0.6178404", "0.61356765", "0.6012833", "0.5837435", "0.5756376", "0.5724416", "0.56670076", "0.56564724", "0.5565162", "0.55428994", "0.5510424", "0.5450344", "0.52778983", "0.5277632", "0.51578164", "0.51521355", "0.5145388", "0.5137915", "0.511371...
0.54502195
14
Test the __init__ method when parameter 'ip' is None. Since the field is optional, it should pass.
def test_init_no_ip(self): # mocks of files rsa_ca_priv_file, rsa_priv_file, rsa_cert_file = range(3) ap = APInfo(port_id=1, ip=None, mac="bb:bb:bb:bb:bb:bb", radio_mac="bb:bb:bb:bb:bb:00", udp_port=12345, wlc_ip='1.1.1.1', gateway_ip='1.1.1.2', ap_mode=APMode.LOCAL, rsa_ca_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_init_no_ip(self):\n client = ClientInfo(\"cc:cc:cc:cc:cc:cc\", ip=None, ap_info=self.ap)\n self.assertEqual(client.ip, None)\n self.assertEqual(client.ip_bytes, None)", "def __init__(__self__, *,\n ip: Optional[pulumi.Input['IPAccessControlArgs']] = None):\n i...
[ "0.7619989", "0.7324193", "0.7324193", "0.7323932", "0.70612985", "0.6996996", "0.6709637", "0.6705524", "0.6618657", "0.65942365", "0.6415844", "0.6387556", "0.6366282", "0.6358961", "0.6319033", "0.6228522", "0.6208983", "0.6139439", "0.6108403", "0.6083423", "0.6066069", ...
0.7339444
1
Test the __init__ method when mandatory parameter 'mac' is None.
def test_init_no_mac(self): with self.assertRaises(ValueError): client = ClientInfo(None, ip="3.3.3.3", ap_info=self.ap)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_init_no_mac(self):\n # mocks of files\n rsa_ca_priv_file, rsa_priv_file, rsa_cert_file = range(3)\n\n with self.assertRaises(ValueError):\n ap = APInfo(port_id=1, ip=\"2.2.2.2\", mac=None, radio_mac=\"bb:bb:bb:bb:bb:00\", udp_port=12345, wlc_ip='1.1.1.1',\n ...
[ "0.7700126", "0.718434", "0.7076505", "0.69038445", "0.68528235", "0.64499795", "0.6309808", "0.6301054", "0.6203087", "0.616466", "0.6155142", "0.61442065", "0.61114347", "0.609657", "0.607744", "0.6011186", "0.6001735", "0.59643024", "0.5931269", "0.5910585", "0.5905488", ...
0.79045194
0
Test the __init__ method when parameter 'ip' is None. Since the field is optional, it should pass.
def test_init_no_ip(self): client = ClientInfo("cc:cc:cc:cc:cc:cc", ip=None, ap_info=self.ap) self.assertEqual(client.ip, None) self.assertEqual(client.ip_bytes, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_init_no_ip(self):\n # mocks of files\n rsa_ca_priv_file, rsa_priv_file, rsa_cert_file = range(3)\n\n ap = APInfo(port_id=1, ip=None, mac=\"bb:bb:bb:bb:bb:bb\", radio_mac=\"bb:bb:bb:bb:bb:00\", udp_port=12345, wlc_ip='1.1.1.1',\n gateway_ip='1.1.1.2', ap_mode=APMode....
[ "0.7339444", "0.7324193", "0.7324193", "0.7323932", "0.70612985", "0.6996996", "0.6709637", "0.6705524", "0.6618657", "0.65942365", "0.6415844", "0.6387556", "0.6366282", "0.6358961", "0.6319033", "0.6228522", "0.6208983", "0.6139439", "0.6108403", "0.6083423", "0.6066069", ...
0.7619989
0
User not logged in returns 200
def test_not_logged_in(self): response = self.c.get(reverse(map_page), {'lat': 34.0, 'lng': 45.3}) self.assertEqual(response.status_code, 200)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_logged_in():\n if not session.get('user_id'):\n return \"nope\", 401\n else:\n return \"yep\", 200", "def test_returns_401_if_user_not_logged_in(self):\n # Act\n response = self.client.get(self.url)\n self.assertEqual(response.status_code, 401)", "def test_retu...
[ "0.803735", "0.7406583", "0.7406583", "0.7406583", "0.7374086", "0.7358094", "0.73388165", "0.72660834", "0.72058254", "0.7197486", "0.7057259", "0.69839096", "0.6981634", "0.6981634", "0.6972179", "0.6965677", "0.6945636", "0.69440126", "0.68950224", "0.68555284", "0.6853421...
0.6876522
19
The expression pt1 == pt2 returns True when pt1 is close to pt2
def test_almost_equal(self): x = Point( lat=23.4, lng=23.1, author=self.u ) self.assertTrue(self.a == x) self.assertFalse(self.a != x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _same(p1,p2,prec=0.0001):\n #return num.all(num.equal(p1,p2))\n t1 = num.fabs(p1[0]-p2[0]) < prec\n t2 = num.fabs(p1[1]-p2[1]) < prec\n if t1 and t2:\n #print \"same\", p1,p2\n return True", "def test_eq_2():\n a = FixedPoint(1, 'Q2.8')\n b = FixedPoin...
[ "0.78786254", "0.73442125", "0.73271257", "0.73021305", "0.72471225", "0.72312576", "0.7224132", "0.72203106", "0.7208399", "0.7186101", "0.7171681", "0.71665627", "0.71387106", "0.71274626", "0.71209747", "0.7108511", "0.7045949", "0.7042352", "0.7017369", "0.7011124", "0.69...
0.6642547
39
The expression pt1 == pt2 returns False when pt1 is not close to pt2
def test_not_equal(self): x = Point( lat=24.4, lng=23.1, author=self.u ) self.assertFalse(self.a == x) self.assertTrue(self.a != x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _same(p1,p2,prec=0.0001):\n #return num.all(num.equal(p1,p2))\n t1 = num.fabs(p1[0]-p2[0]) < prec\n t2 = num.fabs(p1[1]-p2[1]) < prec\n if t1 and t2:\n #print \"same\", p1,p2\n return True", "def almost_equals(self, other):\n import math\n ox, ...
[ "0.7833791", "0.7375096", "0.73340034", "0.7259631", "0.7250514", "0.72273964", "0.7221379", "0.7205826", "0.7195672", "0.7176461", "0.716174", "0.7157015", "0.7149755", "0.7145545", "0.7136548", "0.7128811", "0.7119354", "0.71039134", "0.7080448", "0.7078054", "0.706964", ...
0.0
-1
Cast schema names which containing special characters to valid names. Here special characters means any characters in
def cast_name(key): special_symbols = set('{}{}'.format(punctuation, ' ')) special_symbols.remove('_') new_key = ['_' if x in special_symbols else x for x in key] casted_key = ''.join(new_key) return casted_key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encodeSchemaName(self, schema):\r\n return '\"{}\"'.format(schema)", "def _scrub(self, string):\n if not string.isalnum():\n raise ValueError(\"Table name cannot include non-alphanumerics.\")\n return string", "def normalize_name(word):\n return word.strip(\"0123456789!@#...
[ "0.61856335", "0.6037464", "0.6004261", "0.58687896", "0.58262765", "0.5808754", "0.5807647", "0.57684666", "0.5738535", "0.5723603", "0.57223094", "0.57125217", "0.56966615", "0.56726086", "0.5666764", "0.5645181", "0.56419724", "0.5639399", "0.5602806", "0.55878466", "0.558...
0.53094554
57
Get learning rate scheduler.
def get_lr_scheduler(self): try: scheduler_name = self.configs.OPTIM.LR_SCHEDULER.SCHEDULER_NAME except AttributeError: scheduler_name = None if scheduler_name is None: lr_scheduler = None elif scheduler_name == 'plateau': factor = self.c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_scheduler(optimizer, opt):\n \n epochs_no_decay = opt.epochs - opt.lr_linear\n lr_policy = opt.lr_policy\n \n if lr_policy == 'linear':\n def lr_lambda(epoch):\n return 1. - max(0, epoch - epochs_no_decay) / float(opt.lr_linear + 1)\n scheduler = lr_scheduler.LambdaL...
[ "0.7635437", "0.75883573", "0.75060844", "0.7453083", "0.73677176", "0.7187605", "0.7152048", "0.71470124", "0.7139361", "0.70922357", "0.7084877", "0.7058236", "0.70532143", "0.70265824", "0.70135325", "0.70125854", "0.69860375", "0.6956636", "0.6950861", "0.6934655", "0.692...
0.7616563
1
Return list of unique values while preserving order. Values must be hashable.
def uniq(seq: Iterable): seen, result = {}, [] for item in seq: if item in seen: continue seen[item] = None result.append(item) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_unique_value_list(value):\n my_set = set(value)\n new_list = list(my_set)\n new_list.sort()\n return new_list", "def unique(x):\n\n return list(set(x))", "def find_remove_duplicates(list_of_values):\r\n output = []\r\n seen = set()\r\n for value in list_of_values:\r\n ...
[ "0.77642304", "0.73466635", "0.72686464", "0.70993155", "0.7049732", "0.7036178", "0.6986363", "0.69395584", "0.69315803", "0.6901696", "0.6871331", "0.6860619", "0.68340397", "0.68287754", "0.68124825", "0.67243654", "0.6652985", "0.66490304", "0.66442025", "0.6638174", "0.6...
0.6244349
50
Initialize table from listlike container.
def _init_list(self, data: List[Any]): # Assume data is homogenous in regard to row type obj = data[0] column_names = self._column_name_getter(obj) column_values = self._column_value_getter(obj) # Map of source to destination column column_map = {} # Do not upda...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_table(self, table: \"Table\"):\n if not self.columns:\n self.columns = table.columns\n self._data = table.data", "def __init__(self):\n self.table = {}\n self.ls = []", "def init_blank(self, T):\n self.headings = []\n self.table = {}\n self....
[ "0.6741247", "0.65784097", "0.6445998", "0.6421057", "0.6410227", "0.62771124", "0.62656546", "0.6222653", "0.62108904", "0.6183416", "0.6157158", "0.61253923", "0.6124469", "0.6088853", "0.60814494", "0.598742", "0.59580296", "0.5902306", "0.5902306", "0.5886963", "0.5882113...
0.6464922
2
Initialize table from dictlike container.
def _init_dict(self, data: Dict[Column, Row]): if not self._columns: self._columns = list(data.keys()) # Filter values by defined columns columns = ( to_list(values) for column, values in data.items() if column in self._columns ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_table(self, table: \"Table\"):\n if not self.columns:\n self.columns = table.columns\n self._data = table.data", "def test_create_from_dicts(self):\n cols = list(zip(*self.dtypes))[0]\n dicts = [dict([(cols[i], d[i]) for i in xrange(len(d))])\n for...
[ "0.7078723", "0.69768757", "0.6741791", "0.6514259", "0.6489797", "0.6371205", "0.63667476", "0.6355663", "0.63450754", "0.6337645", "0.63217604", "0.63029504", "0.6181961", "0.61749095", "0.61712486", "0.61712486", "0.61712486", "0.61712486", "0.61712486", "0.61712486", "0.6...
0.6601733
3
Validate that given column names can be used.
def _validate_columns(self, names): if not is_list_like(names): raise ValueError("Columns should be list-like") if len(set(names)) != len(names): raise ValueError("Duplicate column names") if self._data and len(names) != len(self._data[0]): raise ValueError(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_columns(df: pd.DataFrame, names: typing.Sequence[str]) -> None:\n for expected in names:\n if expected not in df.columns:\n raise ValueError(f\"'{expected}' column not found in input\")\n return", "def _validate_columns(data, ip_column, lat_column, long_column, other_columns):\...
[ "0.8195807", "0.7515005", "0.74477583", "0.73584527", "0.72443414", "0.72358197", "0.7166061", "0.7122262", "0.7121349", "0.711966", "0.7089864", "0.708901", "0.69831634", "0.6980481", "0.6958175", "0.6949049", "0.692618", "0.6905489", "0.6900764", "0.6798847", "0.6783542", ...
0.8290189
0
Find location for column value.
def column_location(self, value): # Try to use as-is try: return self._columns.index(value) except ValueError: pass # Try as integer index try: value = int(value) if value in self._columns: location = self._column...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _col_match(sheet, row, value):\r\n for cell in sheet[row]:\r\n if cell.value == value:\r\n return cell.column", "def _value_column(self, field):\n for field_dict in self.schema['idx_fields']:\n if field_dict['field_name'] == field:\n return field_dict['co...
[ "0.6948674", "0.6942318", "0.68900645", "0.6643696", "0.6632486", "0.6617296", "0.66054964", "0.6541255", "0.65210915", "0.65178216", "0.64717984", "0.64717984", "0.64595383", "0.63534844", "0.63455355", "0.6333555", "0.6323215", "0.63208455", "0.63208455", "0.63208455", "0.6...
0.81713206
0