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
EventhubNamespaceSku defines the sku
def __init__(__self__, *, capacity: Optional[pulumi.Input[int]] = None, name: Optional[pulumi.Input[str]] = None, tier: Optional[pulumi.Input[str]] = None): if capacity is not None: pulumi.set(__self__, "capacity", capacity) if name is not N...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sku(self) -> Optional[pulumi.Input['EventhubNamespaceSpecSkuArgs']]:\n return pulumi.get(self, \"sku\")", "def sku(self) -> pulumi.Input['IotHubDpsSkuArgs']:\n return pulumi.get(self, \"sku\")", "def sku(self) -> Optional[pulumi.Input['IotHubDpsSkuArgs']]:\n return pulumi.get(self, \"s...
[ "0.81155515", "0.70365", "0.6889655", "0.6780357", "0.67479026", "0.66723436", "0.6621684", "0.6621684", "0.65824133", "0.65824133", "0.65824133", "0.65482324", "0.64734006", "0.64734006", "0.6449073", "0.64273584", "0.64273584", "0.6356497", "0.6356497", "0.63426834", "0.632...
0.0
-1
EventhubSpec defines the desired state of Eventhub
def __init__(__self__, *, location: pulumi.Input[str], resource_group: pulumi.Input[str], authorization_rule: Optional[pulumi.Input['EventhubSpecAuthorizationRuleArgs']] = None, key_vault_to_store_secrets: Optional[pulumi.Input[str]] = None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_describe_event(self):\n pass", "def test_future_event(self):\n pass", "async def test_event(bus: lightbus.BusNode, dummy_api, stream_use):\n bus.bus_client.transport_registry.get_event_transport('default').stream_use = stream_use\n manually_set_plugins({})\n received_kwargs = []...
[ "0.57470316", "0.55471534", "0.53595334", "0.5293586", "0.5258583", "0.5215196", "0.5189524", "0.51341164", "0.51017606", "0.5065276", "0.5036942", "0.49862343", "0.4979512", "0.49704596", "0.49670807", "0.4964356", "0.49602917", "0.49551234", "0.48925504", "0.48886102", "0.4...
0.5355655
3
MessageRetentionInDays Number of days to retain the events for this Event Hub, value should be 1 to 7 days
def message_retention_in_days(self) -> Optional[pulumi.Input[int]]: return pulumi.get(self, "message_retention_in_days")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_retention_days(self) -> int:\n return pulumi.get(self, \"max_retention_days\")", "def retention_days(self) -> Optional[int]:\n return pulumi.get(self, \"retention_days\")", "def remaining_retention_days(self) -> int:\n return pulumi.get(self, \"remaining_retention_days\")", "def ...
[ "0.69079363", "0.68759406", "0.684173", "0.67357457", "0.6631539", "0.6548917", "0.63111925", "0.62610126", "0.6173079", "0.57759434", "0.5710031", "0.5526394", "0.5431963", "0.5377957", "0.52475584", "0.516884", "0.51634234", "0.5107976", "0.506718", "0.506307", "0.506307", ...
0.7918465
0
AccountName Name of the storage account
def account_name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "account_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def storage_account_name(self) -> str:\n return pulumi.get(self, \"storage_account_name\")", "def get_azure_storage_account_name(self):\n try:\n account = self.instance_metadata.get_tags()['bkp_storage_account']\n logging.debug(\"Using storage account name from instance metada...
[ "0.885021", "0.79995525", "0.7892335", "0.7835469", "0.7835469", "0.71318054", "0.7103977", "0.7103977", "0.7103977", "0.70397264", "0.703388", "0.6771647", "0.67408985", "0.6714965", "0.67045265", "0.67045265", "0.66372246", "0.65092146", "0.64859873", "0.64859873", "0.64312...
0.69242465
12
ResourceGroup Name of the storage account resource group
def resource_group(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "resource_group")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_group_name(self) -> str:\n return pulumi.get(self, \"resource_group_name\")", "def resource_group(self) -> str:\n return pulumi.get(self, \"resource_group\")", "def resource_group_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"resource_group_name\")", "def res...
[ "0.7900516", "0.7723234", "0.7661297", "0.7661297", "0.7661297", "0.7661297", "0.7661297", "0.7661297", "0.7661297", "0.7661297", "0.7661297", "0.7661297", "0.7661297", "0.7661297", "0.764902", "0.74493235", "0.74493235", "0.74493235", "0.74493235", "0.74493235", "0.74493235"...
0.69013786
78
KeyVaultSku the SKU of the Key Vault
def sku(self) -> Optional[pulumi.Input['KeyVaultSpecSkuArgs']]: return pulumi.get(self, "sku")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sku(self) -> pulumi.Input['LabVirtualMachineSkuArgs']:\n return pulumi.get(self, \"sku\")", "def sku(self) -> Optional[pulumi.Input['StorageAccountSpecSkuArgs']]:\n return pulumi.get(self, \"sku\")", "def sku(self) -> 'outputs.SkuResponse':\n return pulumi.get(self, \"sku\")", "def s...
[ "0.7646807", "0.76211065", "0.75372154", "0.75372154", "0.7470512", "0.74445903", "0.74197114", "0.7401715", "0.7374842", "0.7309626", "0.729828", "0.729828", "0.72923553", "0.7192968", "0.7144767", "0.7144767", "0.71375906", "0.7067842", "0.7067842", "0.68284833", "0.6676762...
0.8176889
0
IPRules The list of IP address rules.
def ip_rules(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: return pulumi.get(self, "ip_rules")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ip_rules(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['EventhubNamespaceSpecNetworkRuleIpRulesArgs']]]]:\n return pulumi.get(self, \"ip_rules\")", "def ip_rules(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['StorageAccountSpecNetworkRuleIpRulesArgs']]]]:\n return pulumi.get(self,...
[ "0.76496", "0.7548644", "0.74054444", "0.7380639", "0.69958955", "0.68092954", "0.68092954", "0.63832223", "0.6261158", "0.6135325", "0.60355914", "0.5967046", "0.59655607", "0.59314233", "0.5805967", "0.5789669", "0.57281464", "0.56940675", "0.5657434", "0.5657434", "0.56044...
0.7583248
1
VirtualNetworkRules The list of virtual network rules.
def virtual_network_rules(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: return pulumi.get(self, "virtual_network_rules")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def virtual_network_rules(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['EventhubNamespaceSpecNetworkRuleVirtualNetworkRulesArgs']]]]:\n return pulumi.get(self, \"virtual_network_rules\")", "def virtual_network_rules(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['StorageAccountSpecNetworkRul...
[ "0.7907061", "0.78448915", "0.75953215", "0.75953215", "0.6169978", "0.5870965", "0.5775226", "0.5599528", "0.5582663", "0.5499094", "0.54738176", "0.5429269", "0.53426695", "0.5253109", "0.515451", "0.50497365", "0.5023078", "0.5018901", "0.49850854", "0.49832827", "0.496324...
0.74176955
4
KeyVaultSku the SKU of the Key Vault
def __init__(__self__, *, name: Optional[pulumi.Input[str]] = None): if name is not None: pulumi.set(__self__, "name", name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sku(self) -> Optional[pulumi.Input['KeyVaultSpecSkuArgs']]:\n return pulumi.get(self, \"sku\")", "def sku(self) -> pulumi.Input['LabVirtualMachineSkuArgs']:\n return pulumi.get(self, \"sku\")", "def sku(self) -> Optional[pulumi.Input['StorageAccountSpecSkuArgs']]:\n return pulumi.get(s...
[ "0.817566", "0.76455826", "0.76190823", "0.7536969", "0.7536969", "0.746991", "0.744263", "0.74177456", "0.7399863", "0.73731464", "0.7308772", "0.72975844", "0.72975844", "0.7291478", "0.71913093", "0.7144333", "0.7144333", "0.713816", "0.7067006", "0.7067006", "0.68288094",...
0.0
-1
MySQLFirewallRuleSpec defines the desired state of MySQLFirewallRule
def __init__(__self__, *, end_ip_address: pulumi.Input[str], resource_group: pulumi.Input[str], server: pulumi.Input[str], start_ip_address: pulumi.Input[str]): pulumi.set(__self__, "end_ip_address", end_ip_address) pulumi.set(__self__,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_firewall_rule_protocol(self):\r\n resource = 'firewall_rule'\r\n cmd = firewallrule.UpdateFirewallRule(test_cli20.MyApp(sys.stdout),\r\n None)\r\n self._test_update_resource(resource, cmd, 'myid',\r\n ...
[ "0.58980244", "0.5564809", "0.5302986", "0.53005546", "0.51207197", "0.4977411", "0.49605805", "0.49408087", "0.49079952", "0.48587972", "0.48423457", "0.48284513", "0.48178557", "0.47900584", "0.47553283", "0.4728022", "0.4724269", "0.47188938", "0.4717813", "0.46965986", "0...
0.0
-1
RedisCacheFirewallRuleSpec defines the desired state of RedisCacheFirewallRule
def __init__(__self__, *, properties: pulumi.Input['RedisCacheFirewallRuleSpecPropertiesArgs'], redis_cache: pulumi.Input[str], resource_group: pulumi.Input[str]): pulumi.set(__self__, "properties", properties) pulumi.set(__self__, "redis_cache", redis_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def properties(self) -> pulumi.Input['RedisCacheFirewallRuleSpecPropertiesArgs']:\n return pulumi.get(self, \"properties\")", "def cloudflare_waf_firewall_rule_list_request(self, args: dict, page: int = None, page_size: int = None) -> Dict[str, Any]:\n\n params = remove_empty_elements({\n ...
[ "0.64670515", "0.49387297", "0.48921567", "0.4852446", "0.47198328", "0.4697007", "0.46688896", "0.4635285", "0.4571405", "0.4550623", "0.45408437", "0.45253858", "0.45047858", "0.4497345", "0.4491649", "0.44886386", "0.44803116", "0.4475603", "0.4461498", "0.4446517", "0.442...
0.6373335
1
ResourceGroupSpec defines the desired state of ResourceGroup
def __init__(__self__, *, location: pulumi.Input[str]): pulumi.set(__self__, "location", location)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_resource_group(self):\n pass", "def test_patch_resource_group(self):\n pass", "def test_get_resource_group_list(self):\n pass", "def test_update_resource_group(self):\n pass", "def resource_group(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(se...
[ "0.6505509", "0.6301065", "0.61530906", "0.6148361", "0.6142357", "0.60421413", "0.58286417", "0.58286417", "0.576577", "0.576577", "0.576577", "0.576577", "0.576577", "0.576577", "0.576577", "0.576577", "0.576577", "0.576577", "0.576577", "0.576577", "0.576577", "0.576577"...
0.0
-1
StorageAccountKind enumerates the values for kind. Only one of the following kinds may be specified. If none of the following kinds is specified, the default one is StorageV2.
def kind(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "kind")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getStorageDriverFromEnum(self, eStorageCtrl, fHardDisk):\n if eStorageCtrl == vboxcon.StorageControllerType_IntelAhci:\n if fHardDisk:\n return ('ahci', False);\n return ('ahci', True);\n if eStorageCtrl == vboxcon.StorageControllerType_PIIX4:\n ret...
[ "0.47533482", "0.46575654", "0.46544495", "0.46497372", "0.46063492", "0.45768434", "0.45735317", "0.44810522", "0.44777015", "0.4470783", "0.44599375", "0.43815556", "0.43552122", "0.43443552", "0.43182033", "0.42779818", "0.42725334", "0.42725334", "0.42725334", "0.42725334",...
0.0
-1
StorageAccountSku the SKU of the storage account.
def sku(self) -> Optional[pulumi.Input['StorageAccountSpecSkuArgs']]: return pulumi.get(self, "sku")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sku(self) -> pulumi.Input['ApiManagementServiceSkuPropertiesArgs']:\n return pulumi.get(self, \"sku\")", "def sku(self) -> pulumi.Input['IotHubDpsSkuArgs']:\n return pulumi.get(self, \"sku\")", "def sku(self) -> Optional[pulumi.Input['EventhubNamespaceSpecSkuArgs']]:\n return pulumi.ge...
[ "0.69467324", "0.69334656", "0.6922027", "0.68865705", "0.68865705", "0.6876564", "0.687044", "0.6859113", "0.6849375", "0.68090314", "0.6784327", "0.6546753", "0.6546753", "0.6534348", "0.65298563", "0.65298563", "0.6486263", "0.63881135", "0.63881135", "0.62186664", "0.6213...
0.7923365
0
StorageAccountSku the SKU of the storage account.
def __init__(__self__, *, name: Optional[pulumi.Input[str]] = None): if name is not None: pulumi.set(__self__, "name", name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sku(self) -> Optional[pulumi.Input['StorageAccountSpecSkuArgs']]:\n return pulumi.get(self, \"sku\")", "def sku(self) -> pulumi.Input['ApiManagementServiceSkuPropertiesArgs']:\n return pulumi.get(self, \"sku\")", "def sku(self) -> pulumi.Input['IotHubDpsSkuArgs']:\n return pulumi.get(s...
[ "0.7923365", "0.69467324", "0.69334656", "0.6922027", "0.68865705", "0.68865705", "0.6876564", "0.687044", "0.6859113", "0.6849375", "0.68090314", "0.6784327", "0.6546753", "0.6546753", "0.6534348", "0.65298563", "0.65298563", "0.6486263", "0.63881135", "0.63881135", "0.62186...
0.0
-1
VNetSubnets defines subnets for this vnet
def __init__(__self__, *, subnet_address_prefix: pulumi.Input[str], subnet_name: pulumi.Input[str], service_endpoints: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None): pulumi.set(__self__, "subnet_address_prefix", subnet_address_prefix) pulu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subnets(self) -> Sequence[str]:\n return pulumi.get(self, \"subnets\")", "def subnets(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:\n return pulumi.get(self, \"subnets\")", "def subnets(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ResourceIdArgs']]]]:\n return pulumi.get...
[ "0.73542285", "0.73308", "0.7224014", "0.707693", "0.70190054", "0.70097846", "0.70097846", "0.69170034", "0.69083375", "0.6660492", "0.6571413", "0.65679055", "0.6528275", "0.6326189", "0.6300819", "0.62799764", "0.6203635", "0.6164927", "0.6125909", "0.6075279", "0.6075279"...
0.0
-1
Return the field to which I refer
def field(self): return self.reference.field
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def field_ref(self) -> str:\n return pulumi.get(self, \"field_ref\")", "def field(self):\n return self.__field", "def field_ref(self) -> Optional[str]:\n return pulumi.get(self, \"field_ref\")", "def field(self):\n return self.__field", "def get_ref(self, field):\n if field i...
[ "0.78582025", "0.7691693", "0.7650813", "0.76154995", "0.76145256", "0.7483544", "0.7483544", "0.7483544", "0.7483544", "0.72307676", "0.7154997", "0.7084573", "0.6939344", "0.69102126", "0.6900437", "0.68984705", "0.68928736", "0.6873761", "0.68402", "0.683615", "0.68066275"...
0.84023654
0
Get the proper min/max range for the variable
def vmnmx ( self , var , vmin , vmax ) : if var.xminmax() : vmn , vmx = var.xminmax () if is_good_number ( vmin ) : vmin = max ( vmin , vmn ) else : vmin = vmn if is_good_number ( vmax ) : vmax = min ( vmax , vmx ) else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _full_value_range(self):\n min_value, max_value = self._raw_data.data_range\n return max_value - min_value", "def _get_min_max_value(min, max, value=None, step=None):\n # Either min and max need to be given, or value needs to be given\n if value is None:\n if min is None or max is None:\n ...
[ "0.75316525", "0.7485886", "0.7384613", "0.7356289", "0.72231376", "0.7164665", "0.70964175", "0.7076812", "0.7063247", "0.705729", "0.7055413", "0.7037412", "0.7023311", "0.699551", "0.69851154", "0.694994", "0.69257486", "0.69132155", "0.6906655", "0.6900297", "0.6845268", ...
0.6713911
37
Min/max values for xvariable
def xminmax ( self ) : return self.xvar.minmax()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_min_max_x(self, min_x = 1e9, max_x = -1e9, exclude = []): \n \n if self.verbose > 1:\n print(\"MultiLinearSpectra.get_min_max_x()\") \n \n for m in range(len(self.mess)):\n if m not in exclude and self.mess[m][\"class\"] not in exclude:\n ...
[ "0.720667", "0.710442", "0.70935297", "0.6985304", "0.6864827", "0.6849282", "0.6815381", "0.678636", "0.67706716", "0.6729637", "0.66622525", "0.6648847", "0.6641357", "0.6628382", "0.6610478", "0.6606432", "0.65855145", "0.6585273", "0.657884", "0.6574708", "0.65424234", ...
0.8137068
0
Get the proper xmin/xmax range
def xmnmx ( self , xmin , xmax ) : return self.vmnmx ( self.xvar , xmin , xmax )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bounds(self):\n return self.xmin, self.xmax, self.ymin, self.ymax", "def _bound(x, min_value, max_value):\n return np.maximum(min_value, np.minimum(x, max_value))", "def get_range(self) -> tuple[int, int]:\n return self.range_from, self.range_to", "def range(self):\n lows,...
[ "0.7715976", "0.7351248", "0.7245717", "0.7244277", "0.7217625", "0.7149899", "0.7148794", "0.7143487", "0.7076961", "0.70282245", "0.7013115", "0.7012048", "0.70070577", "0.69957423", "0.6985054", "0.6973543", "0.696343", "0.6949011", "0.6940179", "0.69164306", "0.69139504",...
0.0
-1
Min/max values for yvariable
def yminmax ( self ) : return self.yvar.minmax()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_y_arg(self):\n return max((self(0).y,0), (self(1).y,1))[1]", "def y_max(self) -> ir.FloatingValue:\n return ops.GeoYMax(self).to_expr()", "def y_max(self):\n return self.get_max_value(self.Y_INDEX)", "def min_y_arg(self):\n return min((self(0).y,0), (self(1).y,1))[1]", "...
[ "0.6969927", "0.69609314", "0.6916123", "0.68843013", "0.6877174", "0.6854547", "0.68303454", "0.6701568", "0.6643342", "0.6635836", "0.66347027", "0.663", "0.6557379", "0.6557379", "0.65480304", "0.653643", "0.6531591", "0.65247154", "0.64870334", "0.64422137", "0.64368397",...
0.83712214
0
Get the proper ymin/ymax range
def ymnmx ( self , ymin , ymax ) : return self.vmnmx ( self.yvar , ymin , ymax )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bounds(self):\n return self.xmin, self.xmax, self.ymin, self.ymax", "def ymin(self):\n return self.bbox[0][1]", "def get_ymin(self):\n return self.__ymin", "def _range_tightbbox(self, x):\n # TODO: Better testing for axes visibility\n bbox = self._tightbbox\n if ...
[ "0.7536308", "0.7256791", "0.69486654", "0.6858025", "0.68088293", "0.6783814", "0.673076", "0.6615128", "0.65841734", "0.65812343", "0.6535311", "0.64967", "0.64850336", "0.6468613", "0.64352614", "0.64218354", "0.6407238", "0.64023876", "0.6389204", "0.63664293", "0.6316297...
0.0
-1
Min/max values for yvariable
def zminmax ( self ) : return self.zvar.minmax()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yminmax ( self ) :\n return self.yvar.minmax()", "def max_y_arg(self):\n return max((self(0).y,0), (self(1).y,1))[1]", "def y_max(self) -> ir.FloatingValue:\n return ops.GeoYMax(self).to_expr()", "def y_max(self):\n return self.get_max_value(self.Y_INDEX)", "def min_y_arg(se...
[ "0.83712214", "0.6969927", "0.69609314", "0.6916123", "0.68843013", "0.6877174", "0.6854547", "0.68303454", "0.6701568", "0.6643342", "0.6635836", "0.66347027", "0.663", "0.6557379", "0.6557379", "0.65480304", "0.653643", "0.6531591", "0.65247154", "0.64870334", "0.64422137",...
0.59933335
77
Sentences that are shorter than the max sentence length will be padded
def Batch_Padding(batch, batch_first, pad_token): padded_batch = torch.nn.utils.rnn.pad_sequence([torch.tensor(x) for x in batch], batch_first=True, padding_value=pad_token) return padded_batch
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pad_sentences(sentences, padding_word=\"<PAD/>\"):\n # !!! 一定要注意这里会影响数据的形状,要与代码内的 sequence length 保持一致 !!!\n sequence_length = 30\n # sequence_length = max(len(x) for x in sentences)\n padded_sentences = []\n for i in range(len(sentences)):\n sentence = sentences[i][:sequence_length]\n ...
[ "0.761549", "0.759053", "0.74325603", "0.7414228", "0.7383278", "0.7364693", "0.7356377", "0.73005116", "0.7231061", "0.7146647", "0.7117847", "0.7095228", "0.7011655", "0.6829436", "0.67847717", "0.6759713", "0.66450495", "0.6596753", "0.6590864", "0.658838", "0.64831376", ...
0.0
-1
Batch is the raw words (not indice) Batch should be at the first dim Batch should be sorted in the descending order to use the "packed padded sequence function"
def Batch_Preprocessing(batch, word2idx, batch_size, batch_first=True, pad_token="<pad>"): pad_token = word2idx[pad_token] batch_idx = Batch2Idx(batch, word2idx) batch_idx.sort(key = lambda s: len(s), reverse=True) # sort the batch in the descending order batch_len = Batch_Length_Calculator(batch_idx)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def batchify(batch):\n\n PAD_ID = batch[0]['<PAD>']\n inputs_list = [ex['input'] for ex in batch]\n max_length_list = []\n for docs in inputs_list:\n max_length = max([len(doc[1]) for doc in docs])\n max_length_list.append(max_length)\n inputs = []\n for index,docs in enumerate(inpu...
[ "0.7186635", "0.7027946", "0.6945027", "0.67812145", "0.6743976", "0.6734085", "0.67259175", "0.6716711", "0.67107445", "0.6706902", "0.66253495", "0.66055214", "0.6585167", "0.65343946", "0.6502442", "0.64708024", "0.64295256", "0.6395916", "0.63934433", "0.63934433", "0.638...
0.705422
1
This method returns object of loads that are failing error_state != None, failing error_state = None, success
def stitch_check_loads(response): task_logger.info('Got loads response, checking for errors') failed_loads = {} try: loads = json.loads(response) if ('data' not in loads) or len(loads) == 0: raise StitchApiException('Invalid response from loads api') failed_loads = { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_result(self):\n\n try:\n entry = self._get_nearest_entry_with_artifact()\n\n if entry is None:\n return None\n\n if entry.tier == 'local':\n file_path = path_from_url(entry.artifact_url)\n\n elif entry.tier == 'cloud':\n ...
[ "0.54306763", "0.53637487", "0.5333311", "0.5301838", "0.5283001", "0.5273002", "0.5264489", "0.5246199", "0.5217972", "0.5217148", "0.5194477", "0.5188971", "0.51522297", "0.51494706", "0.51444006", "0.5142842", "0.51173574", "0.51087344", "0.5082586", "0.50719994", "0.50706...
0.5907646
0
This method returns True if target_time + delta_hours >= current time. False otherwise.
def time_filter(target_time, format, delta_hours): return datetime.strptime(target_time, format) + timedelta(hours=delta_hours) >= datetime.utcnow()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_time():\n times = get_times()\n time_difference = abs((times['local'] - times['target']).total_seconds())\n return time_difference < post_time_tol_seconds", "def is_after(self, dt: datetime) -> bool:\n return self.target_time >= make_tz_aware(dt)", "def check_attack(self):\n no...
[ "0.70599633", "0.64565754", "0.6361258", "0.633628", "0.63154334", "0.62607044", "0.6176231", "0.61137956", "0.5971461", "0.59303844", "0.59226227", "0.591145", "0.5903801", "0.58901465", "0.5878395", "0.58584213", "0.58575547", "0.58501834", "0.5820352", "0.57955676", "0.578...
0.73495626
0
Compares this user entity with another one.
def __eq__(self, obj): if not obj: return False return str(self.key()) == str(obj.key())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n if not isinstance(other, User):\n return False\n\n return self.__dict__ == other.__dict__", "def __eq__(self, other):\n if not isinstance(other, User):\n return False\n\n return self.__dict__ == other.__dict__", "def __eq__(self, othe...
[ "0.71119803", "0.71119803", "0.71119803", "0.69198245", "0.6897546", "0.6850669", "0.68227696", "0.68066347", "0.67957556", "0.6604202", "0.65775335", "0.6567185", "0.6539681", "0.65378934", "0.65139675", "0.64989287", "0.64036286", "0.6400513", "0.63941395", "0.6365585", "0....
0.0
-1
Compares this user entity with another one.
def __ne__(self, obj): return not self.__eq__(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n if not isinstance(other, User):\n return False\n\n return self.__dict__ == other.__dict__", "def __eq__(self, other):\n if not isinstance(other, User):\n return False\n\n return self.__dict__ == other.__dict__", "def __eq__(self, othe...
[ "0.71119803", "0.71119803", "0.71119803", "0.69198245", "0.6897546", "0.6850669", "0.68227696", "0.68066347", "0.67957556", "0.6604202", "0.65775335", "0.6567185", "0.6539681", "0.65378934", "0.65139675", "0.64989287", "0.64036286", "0.6400513", "0.63941395", "0.6365585", "0....
0.0
-1
Return the number of prime numbers up to and including n. >>> count_primes(6) 3 2, 3, 5 >>> count_primes(13) 6 2, 3, 5, 7, 11, 13
def count_primes(n): i, total = 1, 0 while i <= n: if is_prime(i): total += 1 i += 1 return total
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def countPrimesOptimized(self, n: int) -> int:\n if n < 2:\n return 0\n\n size = (n - 3) // 2 + 1 # -3 for 0,1,2 and // 2 to ignore evens\n primes = [2]\n is_prime = [True for i in range(size)] # represents if (2i+3) is prime\n\n for i in range(size):\n if...
[ "0.8320163", "0.74782383", "0.7402222", "0.72196627", "0.71892047", "0.701902", "0.6861923", "0.6677156", "0.6675551", "0.6666648", "0.6635933", "0.6500234", "0.6486344", "0.64378786", "0.6426352", "0.6356678", "0.635557", "0.6339933", "0.6317071", "0.6292331", "0.62911236", ...
0.85665524
0
Returns a function that is itself a higherorder function.
def cycle(f1, f2, f3): "*** YOUR CODE HERE ***" def f_n(n): def f_x(x): i = 0 while i < n: if i%3 == 0: x = f1(x) elif i%3 == 1: x = f2(x) else: x = f3(x) i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lift(func: Callable) -> Callable:\n return lambda f: compose2(func, f)", "def curry2(f):\n return lambda x: lambda y: f(x, y)", "def two():\n return lambda f: lambda x: f(f(x))", "def one():\n return lambda f: lambda x: f(x)", "def curry(f: Callable) -> Callable:\n @functools.wraps(f)\n ...
[ "0.6576693", "0.63378894", "0.6233256", "0.6153265", "0.6129069", "0.6070844", "0.6052302", "0.6001915", "0.5964916", "0.594681", "0.58936214", "0.58842826", "0.57823807", "0.57667005", "0.56814593", "0.56791604", "0.5664517", "0.5645075", "0.55790377", "0.5564775", "0.548919...
0.0
-1
Fetch questions from stack exchange API.
def fetch_questions( start: int, end: int, tags: str, site: str = "stackoverflow", votes_threshold: int = 1, **kwargs ) -> Dict[str, Any]: params = { "fromdate": start, "todate": end, "order": "desc", "sort": "votes", "min": votes_threshold, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_questions(now):\n url = 'https://api.stackexchange.com/2.2/questions'\n payload = {\n 'site': 'stackoverflow',\n 'order': 'desc',\n 'sort': 'activity',\n 'filter': '!4)zhYBvQ2q6LTHHe8'\n }\n # https://api.stac...
[ "0.70330614", "0.6882399", "0.6545069", "0.6543828", "0.6393058", "0.6292426", "0.6230435", "0.6219314", "0.6076395", "0.5953763", "0.59307975", "0.5902566", "0.5899188", "0.5769806", "0.5736594", "0.57222015", "0.5721201", "0.571375", "0.5697367", "0.56572676", "0.56317586",...
0.53076744
50
Get a json file and turns it into a dictionary file.
def json2register(self): try: with open('registered.json', 'r') as file: self.final_dicc = json.load(file) except (FileNotFoundError, ValueError, json.decoder.JSONDecodeError): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def json_dict(path):\n json_file=open(path)\n json_str = json_file.read()\n json_data = loads(json_str)\n return json_data", "def json_dict(path):\n json_file=open(path)\n json_str = json_file.read()\n json_data = json.loads(json_str)\n return json_data", "def dictionary_from_json_file(...
[ "0.75848216", "0.75512147", "0.7401128", "0.7297878", "0.72836757", "0.7237917", "0.7216209", "0.71961683", "0.7195884", "0.71792805", "0.7173089", "0.7153463", "0.71461594", "0.7144102", "0.7121728", "0.71081513", "0.7107323", "0.7098076", "0.7095392", "0.702254", "0.7015352...
0.0
-1
Finds all variables over which the given model is defined.
def variables(model: Model) -> AbstractSet[str]: assert is_model(model) return model.keys()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def variables(model: Model) -> AbstractSet[str]:\r\n assert is_model(model)\r\n return model.keys()", "def get_model_variables():\n g = tf.get_default_graph()\n return set(g.get_collection(tf.GraphKeys.MODEL_VARIABLES))", "def findall_var(formula, variable):\n res = []\n s = Solver()\n s.a...
[ "0.7272694", "0.71490556", "0.667702", "0.66481906", "0.65305126", "0.6503552", "0.6485774", "0.6348526", "0.6266385", "0.61185426", "0.61151373", "0.60915273", "0.60735244", "0.60460764", "0.6007835", "0.60012186", "0.59873295", "0.5895373", "0.58784264", "0.5875211", "0.586...
0.73332566
0
Returns the default timezone.
def default(self): if self.no_dbus: return return self.TimeZoneProperties.Get('(ss)', BUS_NAME, 'Timezone')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timezone():\n\n return time.timezone", "def get_timezone():\n return dates.get_timezone(_get_tz())", "def time_zone():\n return timezone('Etc/GMT-10')", "def _get_tz():\n return 'UTC'", "def default_offline(self):\n\t\t\n\t\twith open(\"/etc/timezone\") as f:\n\t\t\ttzone = f.readline()...
[ "0.79179716", "0.78254384", "0.7603934", "0.7593029", "0.72600347", "0.725074", "0.72326636", "0.71985435", "0.70479274", "0.70047355", "0.6908444", "0.68653435", "0.68653435", "0.68653435", "0.685976", "0.68284416", "0.67740804", "0.6761612", "0.6725657", "0.66827357", "0.66...
0.80930585
0
Returns the default timezone. This is an 'offline' method, so the target will be respected and DBus will not be used.
def default_offline(self): with open("/etc/timezone") as f: tzone = f.readline().replace("\n","") return tzone
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default(self):\n\t\t\n\t\tif self.no_dbus: return\n\t\t\n\t\treturn self.TimeZoneProperties.Get('(ss)', BUS_NAME, 'Timezone')", "def get_timezone():\n return dates.get_timezone(_get_tz())", "def _get_tz():\n return 'UTC'", "def timezone():\n\n return time.timezone", "def get_timezone(self) -> ...
[ "0.8489979", "0.7383099", "0.7375322", "0.7365673", "0.711081", "0.70930594", "0.6884481", "0.68395865", "0.68390113", "0.68292636", "0.67981756", "0.67640585", "0.67013127", "0.66991365", "0.6638373", "0.6638373", "0.6638373", "0.66305315", "0.6607288", "0.65521634", "0.6543...
0.78908
1
Test if notification email is sent to Boardlist upon creation.
def test_notification_creation_email(self): mailhost = api.portal.get_tool('MailHost') self.assertEqual(len(mailhost.messages), 1) msg = message_from_string(mailhost.messages[0]) self.assertEqual(msg['To'], BOARD_LIST_ADDRESS) self.assertEqual( msg['From'], 'EESTEC I...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_email(self):\n # No email should be send\n self.assertEqual(len(mail.outbox), 0)\n\n # enable plugin and set mail setting to true\n plugin = registry.plugins.get('inventreecorenotificationsplugin')\n plugin.set_setting('ENABLE_NOTIFICATION_EMAILS', True)\n Notific...
[ "0.6556735", "0.65537953", "0.63737667", "0.6364501", "0.63192624", "0.628415", "0.6258998", "0.6213086", "0.61988914", "0.61858743", "0.6121915", "0.61117977", "0.60874194", "0.6074701", "0.60646015", "0.6010965", "0.5982959", "0.5968985", "0.595813", "0.5944277", "0.5924927...
0.7275896
0
Convert the content of a file, from a given path, to a list
def convert_file_to_list(file_path, separator="\n"): # gets the content of the file contents = read_file(file_path) # splits the content by a separator return contents.split(separator)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_to_list(path):\n fd = open(path)\n t = list()\n for line in fd:\n t += process_line(line)\n\n return t", "def file_to_list(path: str):\n files = []\n with open(path, \"r\") as file_handler:\n for line in file_handler.readlines():\n split = line.split(\",\")\n ...
[ "0.8602792", "0.7987933", "0.7973737", "0.76790863", "0.744752", "0.74313194", "0.7397077", "0.7336752", "0.72939026", "0.7292768", "0.7288939", "0.7255037", "0.7181154", "0.71618915", "0.71224266", "0.71160537", "0.71110123", "0.7045281", "0.70317", "0.70078385", "0.6999386"...
0.78354794
3
Gets the ratio of the step of the foot given the time of the path
def leftRightFootStepRatio(self, t: float, post_pre_settings: PostPreSetting = PostPreSetting.POST_AND_PRE) -> (int, float, float): full_step_time = self.full_step_time() half_step_time = self.half_step_time() post_step_time = self.post_footstep_ratio * full_step_time pre_step_time = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def half_step_time(self):\n\n return self.full_step_time() * self.half_to_full_step_time_ratio", "def taper_ratio(self) -> float:\n return self.xsecs[-1].chord / self.xsecs[0].chord", "def time_step(self):\n\n rho_rel = np.abs(self.rho_dt / self.rho)\n rho_rel_max = np.max(rho_rel)\...
[ "0.6458688", "0.62631404", "0.6132712", "0.60785115", "0.60140437", "0.5937692", "0.5915294", "0.58683693", "0.5854346", "0.58422595", "0.5784637", "0.5775838", "0.5767585", "0.57486767", "0.57436156", "0.5738492", "0.5723011", "0.569719", "0.56890446", "0.56781787", "0.55622...
0.6042406
4
Position of the right foot on the ground at a certain foot step
def rightFootGroundPositionAtTorsoStep(self, n: int) -> Transformation: torsostep = self.getTorsoStepPose(n) bodypos = torsostep.position transformToLeftFoot = Transformation([0, -self.foot_separation, -bodypos[2] + self.foot_center_to_floor]) return torsostep @ transformToLeftFoot
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def MoveRightStep(self):\n if self.facing == 0:\n self.facing = 1\n self.x += self.stepLeft\n elif self.facing == 1:\n self.facing = 2\n self.y += self.stepUp\n elif self.facing == 2:\n self.facing = 3\n self.x -= self.stepRight...
[ "0.6220426", "0.6205104", "0.6142532", "0.6115129", "0.6073426", "0.60303456", "0.6002727", "0.6001177", "0.5971134", "0.59408754", "0.59240866", "0.59177285", "0.5837172", "0.58324254", "0.58282083", "0.58151126", "0.5779304", "0.57497555", "0.57187366", "0.5692062", "0.5692...
0.6751273
0
Position of the left foot on the ground at a certain foot step
def leftFootGroundPositionAtTorsoStep(self, n: int) -> Transformation: torsostep = self.getTorsoStepPose(n) bodypos = torsostep.position transformToRightFoot = Transformation([0, self.foot_separation, -bodypos[2] + self.foot_center_to_floor]) return torsostep @ transformToRightFoot
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_on_land_position(self) -> Point2:\n return self.position.offset(Point2((-2.5, 0.5)))", "def left_edge(f: SwimmingFish) -> float:\n if f.dx > 0:\n return f.posn.x\n else:\n return f.posn.x - f.fish.size", "def left(self):\r\n if self.d in direction_tuple:\r\n ...
[ "0.64178807", "0.63937944", "0.6290517", "0.62835646", "0.622797", "0.6162648", "0.6106532", "0.6082986", "0.6082986", "0.60187197", "0.5964649", "0.59643507", "0.59528923", "0.59426326", "0.5919873", "0.5894431", "0.5892018", "0.5889113", "0.5880736", "0.5879636", "0.5856236...
0.68765485
0
Closes the cursor into the database.
def close(self): self._check_closed() self._statement_cache.shutdown() self._close_result_set() self.closed = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\n self.cursor.close()", "def close_cursor(self, cursor=None):\n if cursor != None:\n cursor.close()\n else:\n self.cur.close()\n\n self.dbcon.commit()", "def close(self):\n# self.cursor.close()\n\tself.db.close()", "def close(self):\r\...
[ "0.82439345", "0.81032735", "0.80062336", "0.78465134", "0.7745423", "0.7720044", "0.7719967", "0.7702749", "0.7656007", "0.761185", "0.75760216", "0.7487821", "0.7459423", "0.74485385", "0.7448299", "0.7438617", "0.74236435", "0.74235684", "0.73971534", "0.73632944", "0.7353...
0.6740459
64
Close current ResultSet on client and server side
def _close_result_set(self): if self._result_set: self._result_set.close(self.session) self._result_set = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\n self._check_closed()\n self._statement_cache.shutdown()\n self._close_result_set()\n self.closed = True", "def close(self):\r\n debug.write(\"[SourceRPG] handling SQL close\", 1)\r\n self.cursor.close()\r\n self.connection.close()\r\n deb...
[ "0.7303431", "0.66221654", "0.6416366", "0.63946855", "0.6357354", "0.6265299", "0.62494904", "0.6228407", "0.6211641", "0.6193648", "0.6160745", "0.6160745", "0.6160745", "0.60941464", "0.6081423", "0.6074532", "0.6067966", "0.60328", "0.60275894", "0.6024028", "0.6007732", ...
0.7495625
0
Parse a list of JSON objects into a result set of model instances.
def parse_list(cls, data): results = ResultSet() data = data or [] for obj in data: if obj: results.append(cls.parse(obj)) return results
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_json_list(cls: Type[T], value: ResponseOrResults) -> List['BaseModel']:\n return [cls.from_json(item) for item in ensure_list(value)]", "def from_json_list(cls, value: JsonResponse, **kwargs) -> 'BaseModelCollection': # type: ignore\n return cls.from_json(value) # type: ignore", "def j...
[ "0.70385766", "0.6717563", "0.6142425", "0.5847431", "0.5741159", "0.570719", "0.5693447", "0.5690963", "0.56718355", "0.562394", "0.5595281", "0.5455497", "0.5440124", "0.5433064", "0.540744", "0.54056185", "0.5394713", "0.53931516", "0.53719157", "0.5365601", "0.53539413", ...
0.7313941
0
Returns a properly formed service name based on the service and process names passed in. Will look up services in the service mapping dictionary to see if there's a preferred name.
def get_full_service_name(service, s): service_alias = SERVICE_MAPPING[service] if service in SERVICE_MAPPING else service # Don't suffix service type if it's a web worker or the same as the service (e.g. gateway, haproxy) if s == 'web' or service_alias == s: return service_alias return '{}-{}'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_service_name(service, rem):\n flavor = rem.os.package_type\n try:\n return _SERVICE_MAP[service][flavor]\n except KeyError:\n return None", "def SERVICE_NAME(default=None):\n return ParamStore.get('SERVICE_NAME', default=default, store=ParamStore.Stores.OS).value", "def se...
[ "0.66432166", "0.6257668", "0.6223302", "0.6223302", "0.6223302", "0.6210517", "0.6210517", "0.6210517", "0.6126875", "0.6126875", "0.6123789", "0.6123789", "0.6123789", "0.6099026", "0.5897384", "0.5817679", "0.58041877", "0.57994455", "0.57889974", "0.5719965", "0.57155925"...
0.6857236
0
Returns starting state of the board.
def initial_state(): return [[EMPTY, EMPTY, EMPTY], [EMPTY, EMPTY, EMPTY], [EMPTY, EMPTY, EMPTY]]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_state(self):\r\n return np.zeros(self.board_size, dtype=np.int8)", "def start_state():\n return chess.Board()", "def startingState(self):\n # Returns starting position and 4 false because no corners are visited yet\n return (self.startingPosition, (False, False, False, False))...
[ "0.8081514", "0.7890486", "0.7534929", "0.72789717", "0.72789717", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", "0.72262055", ...
0.0
-1
Returns player who has the next turn on a board.
def player(board): if board == initial_state(): return X # if board has lesser or eual X(s) than O(s) if sum([row.count(X) for row in board]) <= sum([row.count(O) for row in board]): return X else: return O
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_player(board, prev_player):\n opp = Othello.opponent(prev_player)\n if Othello.any_legal_move(opp, board):\n return opp\n elif Othello.any_legal_move(prev_player, board):\n return prev_player\n return None", "def next_player(self,board, prev_player):\r\n...
[ "0.7910981", "0.7522231", "0.74202156", "0.73700017", "0.7195211", "0.6975818", "0.6961524", "0.6925103", "0.6919324", "0.6899665", "0.6847661", "0.68389785", "0.6838656", "0.6825226", "0.6774813", "0.6774813", "0.6769727", "0.671182", "0.67078507", "0.6656021", "0.66138667",...
0.5978976
91
Returns the optimal action for the current player on the board.
def minimax(board): if terminal(board): return None # If AI is X, ie, maximizing player if player(board) is X: _, bestAction = maximum(board, -math.inf, math.inf) return bestAction elif player(board) is O: _, bestAction = minimum(board, -math.inf, math.inf) r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_best_action(self):\n if self.bestAction is None:\n self.calculate_best_action()\n return self.bestAction", "def getAction(self, gameState: GameState):\n _max = float(\"-inf\")\n action = None\n for move in gameState.getLegalActions(0):\n util = min...
[ "0.7767876", "0.76326656", "0.7583707", "0.7527576", "0.7518166", "0.7459586", "0.74264187", "0.74171406", "0.7394994", "0.7373495", "0.73339117", "0.73138356", "0.7306222", "0.72836244", "0.72657037", "0.72657037", "0.7249796", "0.72338015", "0.7202847", "0.7173266", "0.7171...
0.74657345
5
Determine if rectangles overlap.
def overlap_rect(rec1, rec2): # true if rec2 is left of rec1 a = rec2[2] <= rec1[0] # true if rec2 is right of rec1 b = rec1[2] <= rec2[0] # true if rec2 is below rec1 c = rec2[3] <= rec1[1] # true if rec2 is above rec1 d = rec1[3] <= rec2[1] return not (a or b or c or d)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_overlap(self):\r\n rect1 = Rectangle(10, 20, 30, 40)\r\n rect2 = Rectangle(50, 60, 70, 80)\r\n\r\n # overlap should be commutative\r\n assert not rect1.overlap_with(rect2)\r\n assert not rect2.overlap_with(rect1)\r\n assert not Rectangle.overlap(rect1, rect2)\r\n ...
[ "0.78785366", "0.78189707", "0.74654937", "0.7433727", "0.73448104", "0.73079705", "0.72908956", "0.72661495", "0.72529876", "0.72025895", "0.71837574", "0.71644276", "0.7121134", "0.70713717", "0.7053453", "0.70287764", "0.70260084", "0.70231086", "0.7020437", "0.70099384", ...
0.7547085
2
Unload a config entry.
async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool: if unload_ok := await hass.config_entries.async_unload_platforms( config_entry, PLATFORMS ): hass.data[DOMAIN].pop(config_entry.entry_id) return unload_ok
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_unload_entry(hass, config_entry):\n unload_ok = await hass.config_entries.async_forward_entry_unload(\n config_entry, \"climate\"\n )\n return unload_ok", "async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:\n hass.data.pop(DOMAIN)\n return True", ...
[ "0.697284", "0.6888074", "0.6779855", "0.6747459", "0.6689002", "0.6657831", "0.66162205", "0.6603433", "0.65925974", "0.65411645", "0.6507643", "0.6507643", "0.6507643", "0.6507643", "0.64977276", "0.64931643", "0.6486601", "0.6486601", "0.6486601", "0.6486601", "0.6469397",...
0.65595686
9
Yield successive nsized chunks from l.
def chunks(l, n): for i in range(0, len(l), n): yield l[i:i + n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]", "def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def get_chunks(self, ...
[ "0.803914", "0.7924723", "0.79231334", "0.7884526", "0.78771573", "0.7815713", "0.7765599", "0.7755608", "0.7743973", "0.77318287", "0.7728876", "0.77249795", "0.77027917", "0.76890886", "0.76890886", "0.7664144", "0.76570666", "0.7655797", "0.7655797", "0.7645813", "0.764581...
0.7448972
78
A Hand object will always be constructed with an empty _cards list and replacement set to False
def __init__(self): super().__init__() self._value = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_hand(self):\n for _ in range(self._handsize):\n if self._deck.size() == 0:\n self._discard.shuffle_collection()\n self._deck.replace(self._discard)\n self._discard.clear_collection()\n card = self._deck.pop()\n self._hand...
[ "0.7613032", "0.74924225", "0.74772555", "0.74301654", "0.7287259", "0.7262421", "0.7251907", "0.71440315", "0.7057955", "0.69956195", "0.69634026", "0.6960053", "0.6800016", "0.6773459", "0.67476636", "0.67013836", "0.66852134", "0.6676611", "0.6665342", "0.6657667", "0.6640...
0.0
-1
Get system comments for the given report hash.
def __get_system_comments(self, report_hash): return [c for c in self._cc_client.getComments(report_hash) if c.kind == CommentKind.SYSTEM]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_comment_path(self, sha):\n if not hasattr(self, 'id'):\n raise BadReference('No matching issue on disk')\n return os.path.join(self.paths['comments'], sha)", "def _get_comments(self):\n if not hasattr(self, 'id'):\n raise BadReference('No matching issue on disk'...
[ "0.5537172", "0.545937", "0.5455009", "0.5206663", "0.51767915", "0.51745874", "0.5155963", "0.50855726", "0.50787807", "0.50529563", "0.4995812", "0.49920028", "0.49753758", "0.49339846", "0.49136597", "0.48309815", "0.4760609", "0.47601953", "0.47593158", "0.47565213", "0.4...
0.8368234
0
Print self as an inline XML file. This should work on all input that did not generate a warning while parsing. The output file is identical to the input file modulo processing instructions, comments, and the order of attributes in an opening tag and the kind of quotes used. Also, tags that were printed as will be print...
def print_xml(self, filename): # TODO: check what happens when input is not an xml file # TODO: add xmldec, processing instructions and comments xml_string = u'' # TODO: use a string buffer offset = 0 stack = [] for char in self.text: # any tags on the st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_to(self, fp):\n fp.write('<')\n fp.write(self.tag)\n for k, v in self.attrs.iteritems():\n fp.write(' ')\n fp.write(k),\n fp.write('=\"')\n fp.write(xml_escape(v))\n fp.write('\"')\n if len(self.contents) == 0:\n ...
[ "0.62197226", "0.6048956", "0.6016494", "0.5944045", "0.58689517", "0.58488643", "0.5817568", "0.5681433", "0.5657486", "0.56079835", "0.5561612", "0.5530839", "0.5529737", "0.54898024", "0.546645", "0.5466347", "0.5453806", "0.5446715", "0.54263365", "0.5418585", "0.53572667...
0.7199937
0
Handles Page Not Found
def page_not_found(e): return flask.render_template("index.html")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def page_not_found(e):\n return 'Sorry, Nothing at this URL.', 404", "def page_not_found(e):\n return 'Sorry, Nothing at this URL.', 404", "def page_not_found(e):\n return 'Sorry, Nothing at this URL.', 404", "def page_not_found(e):\n return 'Sorry, Nothing at this URL.', 404", "def page_not_fo...
[ "0.8687298", "0.8687298", "0.8687298", "0.8687298", "0.8687298", "0.8687298", "0.8687298", "0.8687298", "0.8666211", "0.8666211", "0.8666211", "0.8666211", "0.8666211", "0.8666211", "0.8666211", "0.86377716", "0.86123717", "0.8597504", "0.85742", "0.85742", "0.85337675", "0...
0.8068309
38
Checks if tokens[x] is a compound expression.
def iscompound(tokens, x): # Compound expression is defined as: <column> <operator(s)> <column> return Token.isoperator(tokens[x]) and (Token.iscolumn(Token.get(tokens, x - 1)) or Token.iscolumn(Token.get(tokens, x + 1)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_brackets(tokens: List[str]) -> True:\r\n brackets = []\r\n for token in tokens:\r\n if token in \"([\":\r\n brackets.append(token)\r\n elif token in \")]\":\r\n if not brackets:\r\n raise ExtraBracket(token)\r\n ...
[ "0.5669534", "0.564794", "0.5642666", "0.5626602", "0.5616339", "0.5565577", "0.5458162", "0.54266393", "0.5378607", "0.5342598", "0.5301539", "0.5266454", "0.52369833", "0.52193666", "0.5175678", "0.51712704", "0.51619214", "0.5151816", "0.5147043", "0.51430595", "0.50591195...
0.8339693
0
Checks if tokens[x] is a function.
def isfunction(tokens, x): # True if a column token is followed by an open paren return Token.iscolumn(tokens[x]) and Token.get(tokens, x + 1) == "("
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_function(self, words):\n if words[0] == 'function':\n if len(words) != 3:\n raise SyntaxError(\"File line {}: Invalid number of arguments for C_FUNCTION command.\".format(self._file_line))\n return True\n else:\n return False", "def is_functio...
[ "0.710208", "0.7015454", "0.6900961", "0.6894929", "0.67121917", "0.6656099", "0.6635856", "0.6470379", "0.6424486", "0.63378024", "0.6241931", "0.61632514", "0.61535656", "0.6138275", "0.60397315", "0.60176575", "0.59207094", "0.58425725", "0.5819073", "0.578338", "0.5781441...
0.81264156
0
Applies whitespace wrapping rules to token.
def wrapspace(text, token): # Wildcards have no whitespace. Need special case since * is also multiply which does have whitespace. if token in ["*"] and (not text or text.endswith((" ", "("))): return token # Operator whitespace if Token.isoperator(token) or Token.islogicse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wrap_onspace(text, width):\n\n if type(text) is str:\n return reduce(lambda line, word, width=width: '%s%s%s' %\n (line,\n ' \\n'[(len(line[line.rfind('\\n')+1:])\n + len(word.split('\\n',1)[0]\n ) >= width)],\n ...
[ "0.5774597", "0.5737177", "0.5731227", "0.5696316", "0.5644078", "0.55580634", "0.54953635", "0.5490879", "0.5487803", "0.53908145", "0.5341635", "0.53410155", "0.53251344", "0.5309135", "0.5299806", "0.52769685", "0.52598155", "0.5224677", "0.52198225", "0.5203209", "0.51878...
0.6869686
0
Compares the object with the other specified object. The comparison logic is based purely on the boolean part of this object. Only that value is compared with the other object passed as the argument. Extra part is omitted and not involved at any point of the process. In other words, when two different RichBool objects ...
def __cmp__(self, other): if not isinstance(other, RichBool): return cmp(self.value, other) else: return self.value.__cmp__(other.value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eq(self, other):\n\n return self._get(\"eq\", other, Bool)", "def eq(self, other):\n\n return self._get(\"eq\", other, Bool)", "def __eq__(self, other: t.Any) -> bool:\n return self._op_bool('__eq__', other)", "def cmp ( self, object1, object2 ):\n return cmp( self.get_raw_val...
[ "0.6444708", "0.6444708", "0.61909145", "0.61883175", "0.61757416", "0.60792214", "0.60736483", "0.6002145", "0.5997982", "0.59928966", "0.59888387", "0.5987536", "0.59808135", "0.5980495", "0.5978448", "0.5975038", "0.5930091", "0.5916661", "0.5912936", "0.5902536", "0.58995...
0.77908385
0
Tests whether the object is non zero. The test is based entirely on the boolean part of this object. Therefore, the object evaluates to the same value as the boolean part.
def __nonzero__(self): return self.value.__nonzero__()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_zero(self) -> bool:\n return self.field.zero == self", "def __nonzero__(self):\r\n return bool(assert_(self.obj, 'not %r' % self.obj))", "def __nonzero__(self):\n return self.__bool__()", "def __nonzero__(self):\n return self.__bool__()", "def __nonzero__(self):\n ...
[ "0.7965036", "0.7960964", "0.7806893", "0.7806893", "0.77440876", "0.769175", "0.7613569", "0.7597485", "0.7534254", "0.7503735", "0.75008625", "0.74094796", "0.74091715", "0.74091715", "0.7406179", "0.7334928", "0.72950006", "0.72581667", "0.71952343", "0.71816427", "0.71474...
0.74766535
11
Set the identifier on the given refobj
def set_id(self, refobj, identifier): cmds.setAttr("%s.identifier" %refobj, identifier)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setObjectID(self, id):\n\n self.objectID = id[0]", "def _set_id(self, value):\n pass", "def _set_id(self):\n raise NotImplementedError()", "def get_id(self, refobj):\n return cmds.getAttr(\"%s.identifier\" % refobj)", "def setID(self, idf):\n self.id = idf", "def se...
[ "0.68797815", "0.6822181", "0.6799036", "0.67888385", "0.6752616", "0.6707806", "0.6524266", "0.6485014", "0.64802206", "0.6404837", "0.6401697", "0.6401697", "0.6355947", "0.6287689", "0.6264787", "0.6247668", "0.62428343", "0.62315834", "0.62315834", "0.62315834", "0.623158...
0.88734657
0
Return the taskfile that is loaded and represented by the refobj
def get_taskfile(self, refobj): tfid = cmds.getAttr("%s.taskfile_id" % refobj) try: return djadapter.taskfiles.get(pk=tfid) except djadapter.models.TaskFile.DoesNotExist: raise djadapter.models.TaskFile.DoesNotExist("Could not find the taskfile that was set on the node %s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def task_file(self) -> str:\n return self._task_file", "def file(self):\r\n return self._get_instantiation()[0]", "def get_current_element(self, ):\n n = jbscene.get_current_scene_node()\n if not n:\n return None\n tfid = cmds.getAttr(\"%s.taskfile_id\" % n)\n ...
[ "0.66803247", "0.6412058", "0.60803765", "0.5927928", "0.5887138", "0.5884475", "0.5860933", "0.5825342", "0.5825342", "0.5825342", "0.5822415", "0.57887113", "0.5777895", "0.5774442", "0.574729", "0.5727233", "0.57185227", "0.57159585", "0.5694699", "0.5650569", "0.564753", ...
0.7678395
0
different test with positive and negative
def test_many_positive(self): # pairs (input, result) pairs = [ ([3, 4, 6, 8, 0], 192), ([1, -1, 1, -1, 1], 1), ([0, 0, 0, 0, -1], 0), ([6, 5, 4, 3, 2], 120), ([6, 5, 4, 3, -2], 120), ([6, 5, 4, -3, -2], 120), ([-6, -5,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_negative(self, a):\n return a < 0", "def pos_neg(a,b,negative):\r\n if negative:\r\n return (a<0 and b<0)\r\n else:\r\n return (a<0 and b<0) or (a>0 and b<0)", "def isnegative(x):\n if x < 0 :\n return True\n return False", "def pos_neg(a, b, negative):\n is_...
[ "0.74023217", "0.7301608", "0.7271193", "0.71770155", "0.71551657", "0.7132869", "0.7059717", "0.70369434", "0.6985859", "0.69822025", "0.69079757", "0.6871111", "0.6859043", "0.68541604", "0.6837909", "0.68238705", "0.67702967", "0.67277586", "0.67213297", "0.6687449", "0.66...
0.0
-1
Helper to create a DeviceArray from an arbitrary array like. This is similar in purpose and usage to np.asarray, except that it takes a device as the first argument. This may not be the best mechanism for getting a DeviceArray, depending on your use case, but it is reliable and simple. This function may make a defensiv...
def asdevicearray( device: HalDevice, a, dtype=None, *, implicit_host_transfer: bool = False, memory_type=MemoryType.DEVICE_LOCAL, allowed_usage=(BufferUsage.DEFAULT | BufferUsage.MAPPING), element_type: Optional[HalElementType] = None, ) -> DeviceArray: if isinstance(a, DeviceArray)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def asanyarray(a, dtype=None, order='C'):\n\n if not use_origin_backend(a):\n # if it is already dpnp.ndarray then same object should be returned\n if isinstance(a, dpnp.ndarray):\n return a\n\n if order != 'C':\n checker_throw_value_error(\"asanyarray\", \"order\", or...
[ "0.57667375", "0.5602861", "0.5421812", "0.53608096", "0.53427565", "0.5321783", "0.5320466", "0.52971774", "0.5230859", "0.5208777", "0.5206086", "0.51700985", "0.5100557", "0.50603163", "0.503586", "0.49814802", "0.49739218", "0.4933068", "0.4913977", "0.4875228", "0.487265...
0.7531969
0
r""" Creates a `Translation` from a permutation array and a displacement vector
def __init__(self, permutation: Array, displacement: Array): super().__init__(permutation) self._vector = np.asarray(displacement)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fromTranslation(cls, rows, cols, vector):\n data = np.eye(rows, cols)\n data[0:rows - 1, cols - 1] = vector[0:rows - 1]\n return cls.create(rows, cols, data)", "def translate(self, displacement):\n self._position = self._position + np.array(displacement)", "def fromTranslation(cls, ...
[ "0.6541649", "0.61649334", "0.59390616", "0.59386325", "0.583163", "0.58079153", "0.5788804", "0.57135034", "0.5708511", "0.57003343", "0.5693465", "0.5666232", "0.55613786", "0.5332658", "0.5307349", "0.5289208", "0.5282833", "0.5278213", "0.5267077", "0.5228667", "0.5218569...
0.6529388
1
Checks whether the given user has access to the given object/attribute or not.
def __has_access_to(self, user, object_dn, object_type, attr): aclresolver = PluginRegistry.getInstance("ACLResolver") if user: topic = "%s.objects.%s.attributes.%s" % (self.env.domain, object_type, attr) return aclresolver.check(user, topic, "r", base=object_dn) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_access(self, user):\n if user.is_superuser:\n return True\n return self.user_objects(user).filter(id=self.id).exists()", "def has_object_permission(self, request, view, user):\n return user == request.user or request.user.is_superuser", "def has_object_permission(self, r...
[ "0.7836353", "0.7807786", "0.77371716", "0.771122", "0.7672409", "0.76431626", "0.76171756", "0.7579402", "0.7507307", "0.7499338", "0.74848723", "0.74727285", "0.74495775", "0.7447678", "0.743351", "0.7425586", "0.74174947", "0.73950535", "0.73934233", "0.73842424", "0.73775...
0.7988736
0
r"""AWSstyle quote a URL part. >>> aws_urlquote("/bucket/a key") '/bucket/a%20key'
def aws_urlquote(value): if isinstance(value, unicode): value = value.encode("utf-8") return quote(value, "/")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def urlQuote(string):\r\n return quote(string.encode(\"utf-8\"))", "def urlquote(text):\n if op.sep == \"\\\\\":\n return urllib.quote(text.replace(\"\\\\\", \"/\"))\n else:\n return urllib.quote(text)", "def url_quote_part(s, safechars='/', encoding=None):\n if isinstance(s, unic...
[ "0.71850055", "0.6820925", "0.66878295", "0.66752934", "0.6336278", "0.6248485", "0.6247598", "0.62447345", "0.62392414", "0.62388104", "0.6185441", "0.6113482", "0.60382205", "0.59683627", "0.5966279", "0.5877668", "0.5850622", "0.5835752", "0.5828804", "0.58018637", "0.5801...
0.7945368
0
Splits the text into sentences
def split(text): doc = nlp(text) sentences = [x.text_with_ws for x in doc.sents] return sentences
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sentence_split(self, text):\n return split_into_sentences(text)", "def split_sentences(text):\n # sentence_delimiters = re.compile(r'(?<!\\w\\.\\w.)(?<![A-Z][a-z]\\.)(?<=\\.|\\?)\\s')\n # sentences = sentence_delimiters.split(text)\n sentences = nltk.sent_tokenize(text)\n return sentences"...
[ "0.8618131", "0.84692633", "0.8448708", "0.8376191", "0.8080729", "0.8014871", "0.7834365", "0.7820921", "0.77364206", "0.77341825", "0.7620127", "0.7620127", "0.75762755", "0.7565037", "0.7495662", "0.7385169", "0.7379681", "0.730377", "0.7302221", "0.7296511", "0.7295937", ...
0.84483415
3
Create an iterator of pairs off terms from selected terms against each other.
def make_selected_terms_links(self, selected_terms): return itertools.permutations(selected_terms, 2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pairs(terms):\n return itertools.combinations(terms, 2)", "def find_pairs(corpus, a, b):\n pairs = []\n it1 = CorpusIterator(corpus, a)\n it2 = CorpusIterator(corpus, b)\n\n def _is_pair(x, y):\n return x.document_id == y.document_id and x.index == y.index - 1\n\n def _cmp(x, y):...
[ "0.738843", "0.6366551", "0.6194225", "0.61930287", "0.61878234", "0.61712223", "0.6112163", "0.6028782", "0.6018045", "0.5965866", "0.5958879", "0.58453256", "0.58418584", "0.57792634", "0.5774925", "0.57153827", "0.5618452", "0.5570853", "0.5570221", "0.55380106", "0.552626...
0.5911248
11
Create an iterator of pairs of terms from selected terms against all other annotation terms.
def make_selected_terms_links_with_all(self, selected_terms, annotations_dict): for term in selected_terms: for other_term in annotations_dict.iterkeys(): if term != other_term: yield term, other_term yield other_term, term
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pairs(terms):\n return itertools.combinations(terms, 2)", "def terms(self) -> Tuple[Term, ...]:\n ...", "def __iter__(self):\n for term in self._terms:\n yield term", "def subterms(self) -> Iterator[Tuple[Position, TermLike]]:\n yield ((), self)\n for index, ...
[ "0.66849136", "0.62071425", "0.61837894", "0.5878103", "0.583477", "0.5712218", "0.56987214", "0.5652333", "0.56468534", "0.5578357", "0.5553841", "0.5486469", "0.548385", "0.5480822", "0.5471624", "0.54165804", "0.5351309", "0.53331155", "0.5282495", "0.5254025", "0.52370644...
0.7164845
0
Creates an instance of this model from a dictionary
def from_dictionary(cls, dictionary): if dictionary is None: return None # Extract variables from the dictionary consumer_id = dictionary.get('consumerId') consumer_ssn = dictionary.get('consumerSsn') event_name = dictionary.get('event...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n # Extract variables from the dictionary\n id = dictionary.get('id')\n name = dictionary.get('name')\n mtype = dictionary.get('type')\n usage_bytes = diction...
[ "0.83181584", "0.8168118", "0.8168118", "0.8118749", "0.8089047", "0.79787344", "0.7949278", "0.79231393", "0.7898951", "0.78923255", "0.788838", "0.7882321", "0.7882212", "0.7876749", "0.78585315", "0.7836853", "0.7801407", "0.7801407", "0.7801407", "0.7801407", "0.7801407",...
0.7602739
75
Get stderr of function or script, same for both. By default, output file is kept unless delete_file is True or self.auto_delete is True.
def get_stderr(self, save=True, delete_file=None, update=True): _logme.log(('Getting stderr, save={}, auto_delete={}, ' 'delete_file={}').format( save, self.auto_delete, delete_file ), 'debug') if delete_file is None: delete_fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_stderr(self):\n return self._get_log('stderr')", "def stderr(self):\n return self.__stderr", "def get_stderr(self) :\n\t\tif self.__stderr is not None :\n\t\t\tself.__stderr.flush()\n\t\t\treturn self.__stderr.getvalue()", "def get_stderr(self):\n _ = self.get() # force finished wait...
[ "0.7353532", "0.7304997", "0.72000223", "0.7167783", "0.7108938", "0.70323706", "0.68595123", "0.6780241", "0.6545824", "0.6528379", "0.6460243", "0.63623786", "0.63265234", "0.6292708", "0.6249163", "0.6218217", "0.62067664", "0.6155185", "0.61359644", "0.61210513", "0.61100...
0.7703393
0
Add linearly stacked data points to the problem.
def _add_entries(self, py_2d, py_3d, py_t_indices, py_conf, pids_to_smooth, explained_frame_ids, pids_2_scenes, t_init, r_init, mx_conf): assert not self._finalized, "Can't add more after finalization" # 2d positions assert len(py_2d) == len(py_3d), \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_data_to_model(self, qinfos):\n if len(qinfos) == 0:\n return\n new_points = np.empty((0, self.domain_dim))\n new_vals = np.empty(0)\n for i in range(len(qinfos)):\n new_points = np.concatenate((new_points,\n qinfos[i].point.reshape(-1, self.domain_dim...
[ "0.62380075", "0.58683753", "0.5861876", "0.5837011", "0.5615771", "0.55258864", "0.54981256", "0.54957575", "0.54849035", "0.54496783", "0.5443693", "0.54045206", "0.53876233", "0.5359485", "0.5335805", "0.5305189", "0.5273833", "0.5273377", "0.5256303", "0.524404", "0.52325...
0.0
-1
Adds a 3D pose that's not optimized for and it's confidences for the occlusion loss.
def add_pose_static(self, pose, frame_id_query, skeleton_2d, pose_source, id_scene, dtype_np): assert not self._finalized self._static_pids_started = True pid = self.get_next_pid() if self._pid_static_first is None: self._pid_static_first = pid ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keypoint_3d_loss(self, pred_keypoints_3d, gt_keypoints_3d, has_pose_3d):\n pred_keypoints_3d = pred_keypoints_3d[:, 25:, :]\n conf = gt_keypoints_3d[:, :, -1].unsqueeze(-1).clone()\n gt_keypoints_3d = gt_keypoints_3d[:, :, :-1].clone()\n gt_keypoints_3d = gt_keypoints_3d[has_pose_3d...
[ "0.57470226", "0.539369", "0.5227385", "0.5151389", "0.50144655", "0.5013465", "0.4973527", "0.4945913", "0.49308166", "0.49280363", "0.4908333", "0.48629856", "0.4848461", "0.483506", "0.48333174", "0.48047763", "0.4788253", "0.47723636", "0.47217646", "0.4716818", "0.470899...
0.47925353
16
Get player with given user_id
def get_player(self, user_id): players = [p for p in self.players if p.id() == user_id] return players[0] if players else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPlayer(self, userid):\r\n return self.__getitem__(userid)", "def get_member(self, user):\n for player in self.members:\n if player.uuid == user.id:\n return player\n return None", "def get_object_with_user(self, user):\n try:\n uid = int(u...
[ "0.77376837", "0.76827997", "0.76463723", "0.74241555", "0.71831334", "0.7124138", "0.709597", "0.6968963", "0.69332516", "0.69145083", "0.69037503", "0.6833335", "0.6831861", "0.6772205", "0.6711818", "0.6686504", "0.66775745", "0.6673603", "0.66542155", "0.66327447", "0.661...
0.88436645
0
Get list of players that are able to move. List is sorted by turn order. (Player on the dealer's left is first)
def get_able_players(self): highest_bid = self.get_highest_bid() def is_able(player): return player.is_active() and (player.pot_money < highest_bid or player.can_decide) first_n = (self.dealer_index + 1) % len(self.in_game_players) in_game_sorted = self.in_game_players[firs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_possible_moves(self) -> list:\n if self.p1_turn:\n name = '2'\n else:\n name = '1'\n\n count = 0\n for i in self.claim:\n if i == name:\n count += 1\n over = count >= 0.5 * len(self.claim)\n\n moves = []\n if n...
[ "0.70194936", "0.67961556", "0.67679745", "0.6585016", "0.65574604", "0.65489334", "0.6514725", "0.64710397", "0.6454037", "0.6408303", "0.6385914", "0.6369085", "0.630229", "0.62995875", "0.6278645", "0.62700856", "0.62328225", "0.61893004", "0.61708194", "0.61578995", "0.61...
0.70623815
0
Input n>=6, Returns a list of primes, 2 <= p < n
def primes2(n): n, correction = n-n%6+6, 2-(n%6>1) sieve = [True] * (n//3) for i in range(1,int(n**0.5)//3+1): if sieve[i]: k=3*i+1|1 sieve[ k*k//3 ::2*k] = [False] * ((n//6-k*k//6-1)//k+1) sieve[k*(k-2*(i&1)+4)//3::2*k] = [False] * ((n//6-k*(k-2*(i&1)+4)//6-1)//k+1) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_primes(n):\n\n return list(primes_sieve(n))", "def make_primes(n):\n out_list = []\n for i in range(2, n):\n if is_prime(i):\n out_list.append(i)\n return out_list", "def list_primes(n):\n primeList = []\n for i in range(n):\n if is_prime(i):\n primeList.append(i...
[ "0.8541514", "0.84436715", "0.8406148", "0.83585244", "0.82618254", "0.8233985", "0.8214188", "0.8212246", "0.82071525", "0.81704533", "0.8101073", "0.8004435", "0.7959523", "0.79544747", "0.7944765", "0.79406875", "0.7890036", "0.78695965", "0.78695965", "0.7863534", "0.7858...
0.7689422
31
Defaults params for `LmInput`.
def Params(cls): p = super(LmInput, cls).Params() p.Define('fixed_input_shape', False, 'Fixed input shape or not.') p.tokenizer = tokenizers.AsciiTokenizer.Params() return p
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _default_params(self) -> Dict[str, Any]:\n normal_params = {\n \"temperature\": self.temperature,\n \"max_tokens\": self.max_tokens,\n \"top_p\": self.top_p,\n \"frequency_penalty\": self.frequency_penalty,\n \"presence_penalty\": self.presence_pena...
[ "0.68726116", "0.67605543", "0.6482413", "0.63521385", "0.6324739", "0.6194862", "0.61828744", "0.617979", "0.61631554", "0.61158967", "0.61079776", "0.6100417", "0.6078041", "0.6072544", "0.6024833", "0.6020714", "0.601865", "0.60152096", "0.59877026", "0.5982867", "0.597707...
0.7556699
0
$\int_{0}^{t} 1/(t + c)^{p}$
def _omori_integrate(t, c, p): if p == 1: return log((t + c)/c) else: return ((t + c)**(1 - p) - c**(1 - p))/(1 - p)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def algorithm_1_1(p, c, t, x):\n\n q = np.array(c, dtype=np.float64)\n\n for k in range(1, p + 1):\n for j in range(0, p - k + 1):\n q[j] = (t[j + k] - x) / (t[j + k] - t[j]) * q[j] + (x - t[j]) / (\n t[j + k] - t[j]) * q[j + 1]\n return q[0]", "def algorithm_2_20(p, t, ...
[ "0.7614857", "0.6934931", "0.6923188", "0.6862701", "0.6708306", "0.66852283", "0.6614421", "0.66054064", "0.6521449", "0.6511847", "0.6485992", "0.6462008", "0.64511585", "0.63874006", "0.6331202", "0.63274807", "0.63235456", "0.63163173", "0.62996906", "0.62286", "0.6189329...
0.6864281
3
Compose the error object json to be added in 'errors' in given operation's summary
def __set_errors_json(self, error_count_by_operation, errors_by_operation): message = "{0} error/s reported.".format(error_count_by_operation) log_file_path = self.logger.file_logger.log_file_path message += " The latest {0} error/s are shared in detail. To view all errors, review this log file ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_errors(errors):\n\n try:\n return errors['detail']\n\n except KeyError:\n error_string = ''\n\n for key in errors:\n error_string += '{0}\\n'.format(errors[key][0])\n\n return error_string", "def construct_err(err_name='DEFAULT', err_language='english'):\n ...
[ "0.6166942", "0.6034691", "0.5928332", "0.5909501", "0.5879692", "0.5865361", "0.5827591", "0.5798399", "0.5795216", "0.57915705", "0.5767179", "0.5752834", "0.57390165", "0.57163966", "0.570569", "0.5677877", "0.56438595", "0.56375134", "0.56273156", "0.55945367", "0.5572995...
0.7067888
0
Returns if the word is in the trie.
def search(self, word): node = self.search_prefix(word) return node is not None and '#' in node and node['#'] == 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_trie(self, trie, word):\n current_dict = trie\n for letter in word:\n if letter in current_dict:\n current_dict = current_dict[letter]\n else:\n return False\n else:\n if '_end_' in current_dict:\n return curr...
[ "0.838591", "0.8151737", "0.8122628", "0.7856223", "0.7829874", "0.77924806", "0.7791972", "0.77632296", "0.77523863", "0.7746683", "0.7710448", "0.76799077", "0.7676034", "0.7663706", "0.76495034", "0.7633486", "0.76275533", "0.76097536", "0.7576672", "0.756812", "0.75609034...
0.7299974
46
Test a range of inacceptable project names.
def test_bad_names(self): self.do_test_bad_name('', 'tmp/frog') self.do_test_bad_name('.b', 'tmp/frog') self.do_test_bad_name('a b', 'tmp/frog') # FAILS self.do_test_bad_name('a-b', 'tmp/frog') # FAILS
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_check_for_oversubscribed_projects(\n student_names, project_names, supervisor_names, capacities, seed, clean\n):\n\n *_, game = make_game(\n student_names, project_names, supervisor_names, capacities, seed, clean\n )\n game.solve()\n\n project = game.projects[0]\n project.matching...
[ "0.6534595", "0.63760275", "0.6239839", "0.622794", "0.61762774", "0.6062405", "0.5859189", "0.57978994", "0.569069", "0.5654902", "0.5636386", "0.55873895", "0.5567264", "0.55578", "0.5521492", "0.55059874", "0.54254067", "0.5405777", "0.53826344", "0.5364801", "0.53454417",...
0.0
-1
Loads in the yaml file and splits the contents.
def load(self, file): self.__log(f'Starting to load settings from {file}', 'warning') contents = load_yaml(file) for item in contents: if item == 'options': self.__log(f'Found options in {file}, loading them', 'warning') for i in contents[item]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_yaml_file(self, path):\n with path.open('r') as handle:\n data = load_yaml(handle)\n\n self.set_all(**self.SCHEMA.load(data).data)", "def _separate(self):\n s = self.as_yamlstr()\n self._config = yaml.load(s, Loader=yaml.Loader)\n self._comments = self._extr...
[ "0.66595876", "0.6529717", "0.6519499", "0.6496563", "0.64642537", "0.6453446", "0.6436033", "0.6417023", "0.6402035", "0.6380477", "0.6365179", "0.63462204", "0.633313", "0.63190305", "0.63182473", "0.6290642", "0.6251451", "0.62264425", "0.617627", "0.6171026", "0.6117576",...
0.5743891
56
Image to Tensor converter. This method takes an image and returns as deep learning compatible image tensor with proper transformation.
def get_image(self, image): # transform image with proper padding row, column, _ = image.shape image = cv2.copyMakeBorder(image, (column-row)//2, (column-row)//2, 0, 0, cv2.BORDER_CONSTANT) # reshape image in proper si...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_image_to_tensor(image):\n # image = image.astype(np.float32)\n return transform(image)\n # return transform(image)", "def image_to_tensor(image):\n image_tensor = image.transpose(2, 0, 1)\n image_tensor = image_tensor.astype(np.float32)\n image_tensor = torch.from_numpy(image_tensor...
[ "0.8300986", "0.7623943", "0.744452", "0.74440616", "0.73748606", "0.7256048", "0.6981082", "0.6943973", "0.6943973", "0.6943973", "0.6829764", "0.6825344", "0.67887414", "0.67125404", "0.66860247", "0.666928", "0.6638647", "0.6632439", "0.6613119", "0.6607929", "0.659306", ...
0.0
-1
Return the smallest value in the whole subtree.
def smallest (self): return self.pointers[0].smallest()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_smallest(node):\n smallest = node.value\n\n while node.left is not None:\n node = node.left\n smallest = node.value\n\n return smallest", "def find_smallest(self):\n return self._find_smallest(self.root)", "def peek_min(self):\n if self.root:\n ...
[ "0.83880603", "0.83494014", "0.8261917", "0.8084516", "0.79809886", "0.79490703", "0.7915808", "0.7887662", "0.7875714", "0.78674084", "0.78292763", "0.7816443", "0.7798868", "0.77252614", "0.771773", "0.770909", "0.769711", "0.7564198", "0.7546694", "0.75263035", "0.7479972"...
0.7448259
22
Generate a random string of fixed length
def random_string(string_len=10000): letters = string.ascii_lowercase return ''.join(random.choice(letters) for _ in range(string_len))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_random_string(length: int):\n\tall_chars = string.ascii_letters + string.digits\n\treturn ''.join(random.choices(all_chars, k=length))", "def generate_random_string(length=6):\n n = int(length / 2 + 1)\n x = binascii.hexlify(os.urandom(n))\n s = x[:length]\n return s.decode(\"utf-8\")",...
[ "0.8680464", "0.8573714", "0.85486245", "0.85297275", "0.85209286", "0.84331024", "0.8432044", "0.84157014", "0.84120053", "0.8389201", "0.8345882", "0.8343962", "0.83406156", "0.83348686", "0.83240855", "0.82986933", "0.82911193", "0.8281826", "0.82818025", "0.82811046", "0....
0.7796139
78
Try to do a Http GET to the create blog post page when you are logged in as a normal user. In real life the 'ADD' button is not on the screen but we can still send the GET request to create the user to the server. This should fail with a Http 403 Forbidden
def test_get_create_post_as_user_logged_in(self): login = self.client.login(username='testuser_normal', password='password12345') if login: url = reverse('blogs:create') response = self.client.get(url) self.assertEqual(response.status_code, 403) self.cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_create_post_as_anonymous_user(self):\n\n url = reverse('blogs:create')\n response = self.client.get(url)\n\n self.assertEqual(response.status_code, 403)", "def test_post_creation_unauthorized(self):\n url = reverse('post-list')\n user_url = reverse('user-detail', k...
[ "0.7427427", "0.7161118", "0.71479446", "0.70174766", "0.6805963", "0.67969424", "0.67112637", "0.6706168", "0.65912634", "0.65485734", "0.65409946", "0.6535743", "0.65283424", "0.6514738", "0.6476121", "0.6444468", "0.64413774", "0.6374397", "0.6357739", "0.6337469", "0.6337...
0.69489855
4
Try to do a Http POST to the create blog post page when you are logged in as a user with no privileges. You should get a Http 403 Forbidden.
def test_post_create_post_as_user_logged_in(self): login = self.client.login(username='testuser_normal', password='password12345') if login: new_title = "this is a new title for create" new_content = "this is new content for create by nicholas herriot" new_publishe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_create_post_as_anonymous_user(self):\n\n url = reverse('blogs:create')\n response = self.client.get(url)\n\n self.assertEqual(response.status_code, 403)", "def test_post_creation_unauthorized(self):\n url = reverse('post-list')\n user_url = reverse('user-detail', k...
[ "0.7521191", "0.7360052", "0.71726155", "0.7158328", "0.71339715", "0.71001667", "0.70535505", "0.7036674", "0.70145726", "0.70005834", "0.6948143", "0.6898936", "0.6688082", "0.66641307", "0.66127324", "0.6608382", "0.6592327", "0.657401", "0.65483195", "0.6470003", "0.64691...
0.6504746
19
Try to do a Http GET to delete a blog post page when you are an anonymous user. You should get a Http 403 Forbidden as only an admin or staff user can delete posts.
def test_post_delete_post_as_anonymous_user(self): last_post = Post.objects.get(title="test3") url = reverse('blogs:delete', kwargs={'slug': last_post.slug}) response = self.client.get(url) # There should still be a blog post with this title. Hence we should still be able to find the bl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_delete_unauthorized(self):\n url = reverse('post-detail', kwargs={'pk': self.post.id})\n response = self.client.delete(url)\n self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)", "def test_post_delete_logged_in(self):\n url = reverse('post-detail', kwargs=...
[ "0.760562", "0.73647255", "0.71092904", "0.69990057", "0.69843364", "0.6967568", "0.68355864", "0.6793638", "0.67839885", "0.6779465", "0.6773584", "0.67699283", "0.66953725", "0.6641608", "0.6606169", "0.6604065", "0.657507", "0.6556101", "0.6551979", "0.6536588", "0.6427880...
0.7389012
1
Try to do a Http GET to delete a blog post page when you are a normal user. You should get a Http 403 Forbidden as only an admin or staff user can delete posts.
def test_post_delete_post_as_logged_in_user(self): login = self.client.login(username='testuser_normal', password='password12345') if login: last_post = Post.objects.get(title="test3") url = reverse('blogs:delete', kwargs={'slug': last_post.slug}) response = self.cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_delete_unauthorized(self):\n url = reverse('post-detail', kwargs={'pk': self.post.id})\n response = self.client.delete(url)\n self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)", "def test_post_delete_logged_in(self):\n url = reverse('post-detail', kwargs=...
[ "0.77090204", "0.74142224", "0.7378812", "0.7183023", "0.7164214", "0.7092898", "0.7021265", "0.70211625", "0.69831973", "0.6925314", "0.6921452", "0.6913361", "0.68595135", "0.6820148", "0.68057424", "0.6794492", "0.6771192", "0.6744863", "0.6743678", "0.6719264", "0.6574930...
0.68058336
14
Try to do a Http GET to delete a blog post page when you are a staff user. You should get a Http 302 You should be redirected to the blogs URL.
def test_post_delete_post_as_staff_user(self): login = self.client.login(username='testuser_staff', password='password12345') if login: last_post = Post.objects.get(title="test3") url = reverse('blogs:delete', kwargs={'slug': last_post.slug}) response = self.client....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_delete_post_as_admin_user(self):\n login = self.client.login(username='testuser_admin', password='password12345')\n\n if login:\n\n last_post = Post.objects.get(title=\"test3\")\n url = reverse('blogs:delete', kwargs={'slug': last_post.slug})\n response ...
[ "0.73730916", "0.714529", "0.7044264", "0.6994577", "0.6966852", "0.69542104", "0.6918779", "0.6860914", "0.68360007", "0.67813367", "0.67721766", "0.66289335", "0.65948343", "0.65824604", "0.6578005", "0.65455973", "0.64570737", "0.6450366", "0.6446787", "0.6425828", "0.6420...
0.7608611
0
Preregister BigQuery tables and Parquet directories as temporary views.
def register_views(spark, bigquery_tables, hcfs_dirs): temp_dfs = {} for table in bigquery_tables: name = table.split('.')[-1] logging.info('Loading %s', table) temp_dfs[name] = spark.read.format('bigquery').option('table', table).load() for hcfs_dir in hcfs_dirs: name = hcfs_dir.split('/')[-1] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drop_old_iceqube_tables():\n queue.storage.recreate_tables()", "def tear_down():\n db.flush()\n for table in metadata.tables.values():\n db.execute(table.delete())", "def setup_target_bigquery(self):\n self.delete_dataset_target_bigquery('ppw_e2e_tap_postgres')\n s...
[ "0.60332733", "0.5850599", "0.5643817", "0.55915076", "0.5587126", "0.55850476", "0.55768234", "0.55475914", "0.55230784", "0.55136365", "0.55093753", "0.5480773", "0.54701746", "0.5443543", "0.5441625", "0.54017884", "0.5401201", "0.5377228", "0.53369397", "0.5330783", "0.53...
0.62818336
0
returns boolean if the the lead intersects with the path of a particle
def check_intersection(self, particle, trajectory): intersection = self.line.intersection(trajectory) check = isinstance(intersection, shapely.geometry.Point) if check: intersection = [intersection.x, intersection.y] return [check, intersection]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_intersecting(self, ray):\n\n intersecting_point = self._sympy_plane.intersection(ray.sympy_line)[0]\n\n if 'x' in self._name:\n\n if self._within_y_bounds(intersecting_point.y) and self._within_z_bounds(intersecting_point.z):\n return True, np.array(map(float, [inters...
[ "0.6820177", "0.6580403", "0.6549938", "0.65458953", "0.65439326", "0.6519521", "0.6505728", "0.6444002", "0.63986945", "0.6379889", "0.6362897", "0.6327882", "0.6302101", "0.6282149", "0.62798524", "0.62612164", "0.62437475", "0.6236044", "0.6200129", "0.6192624", "0.6181581...
0.6569451
2
Get an existing FirewallRule resource's state with the given name, id, and optional extra properties used to qualify the lookup.
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None) -> 'FirewallRule': opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = dict() __props__["end_ip"] = None __props__["name"] = None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n direction: Optional[pulumi.Input[str]] = None,\n dry_run: Optional[pulumi.Input[bool]] = None,\n listener_id: Optional[pulumi.Input[str]] = None,\n ...
[ "0.6766867", "0.64151376", "0.63440967", "0.6062281", "0.6002148", "0.59975606", "0.5937825", "0.5635326", "0.56186944", "0.54493845", "0.5413885", "0.5286892", "0.5221827", "0.51381284", "0.51351386", "0.51325524", "0.51140153", "0.5107555", "0.5069736", "0.50370955", "0.503...
0.7343628
0
Returns valid relative path without preceding / .
def rpath(path): if path.startswith('/'): path = path[1:] return path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _sanitize_relative_path(self, path):\n last = None\n path = os.path.normpath(path)\n while path != last:\n last = path\n # Note: os.path.join treats '/' as os.sep on Windows\n path = path.lstrip(os.sep).lstrip('/')\n path = path.lstrip(os.pardir)...
[ "0.78773415", "0.76372135", "0.75466543", "0.738993", "0.73724186", "0.7305083", "0.7259217", "0.71868014", "0.71376234", "0.71371746", "0.71276987", "0.7098929", "0.7073184", "0.70718753", "0.7065884", "0.7062364", "0.7055339", "0.7047333", "0.7042753", "0.7039734", "0.70141...
0.7014132
21
Checks that cdhit can be run, and returns version.
def check_cdhit_version(cdhit_exec='cd-hit'): p = str( subprocess.run(cdhit_exec + ' -h', stdout=subprocess.PIPE, shell=True)) version = False find_ver = re.search(r'CD-HIT version \d+\.\d+', p) if find_ver: version = float(find_ver[0].split()[-1]) if not version: sys.stderr....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_cdhit_supported_version(self):\r\n self.assertTrue(which('cd-hit'),\r\n \"cd-hit not found. This may or may not be a problem depending on \" +\r\n \"which components of QIIME you plan to use.\")\r\n # cd-hit does not have a version print in their...
[ "0.67566645", "0.6268092", "0.6197752", "0.6142676", "0.6072033", "0.59949404", "0.59768623", "0.5966653", "0.5908998", "0.5900754", "0.58872926", "0.5846061", "0.58251655", "0.5825078", "0.5794901", "0.57900554", "0.5752349", "0.5751359", "0.5736305", "0.5729775", "0.5720715...
0.7393205
0
Test that exception is raised if no email is given
def test_create_no_email(self): self.portal.portal_properties.site_properties.use_email_as_login = True self.assertRaises( ValueError, api.user.create, username='chuck', password='secret' )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invalid_email_when_logging_in(self):\n pass", "def test_empty_email():\n expect_error(register, InputError, \"a\", \"abdkjjd\", \"a\", \"A\", \"\")", "def test_unknown_email():\r\n auth_register_v1(email='harrypotter@gmail.com',\r\n password='qw3rtyAppl3s@99',\r\n ...
[ "0.7807532", "0.7694323", "0.7610884", "0.754362", "0.74519366", "0.744689", "0.7444232", "0.73221993", "0.7275625", "0.72517663", "0.72512853", "0.7218671", "0.719487", "0.7194725", "0.7164603", "0.70984656", "0.7092247", "0.7064556", "0.70287913", "0.7021593", "0.70109934",...
0.7321363
8
Test that email is parsed from the properties
def test_create_email_in_properties(self): user = api.user.create( username='chuck', password='secret', properties={'email': 'chuck@norris.org'} ) self.assertEquals(user.getProperty('email'), 'chuck@norris.org')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_email(self):\r\n \r\n self.assertEqual('maryc123@yahoo.com', self.user.email)", "def test_clean_email(self):\n\n raw_email = 'from=<user@domain.com>'\n result = clean_email(raw_email)\n self.assertEqual(result, 'user@domain.com')", "def test_email_address(self):\n ...
[ "0.70654356", "0.69766766", "0.692082", "0.68756866", "0.686623", "0.68461347", "0.68295705", "0.68069005", "0.67966443", "0.6643023", "0.6576639", "0.6568408", "0.652954", "0.65173155", "0.64472926", "0.6422967", "0.64181256", "0.6360059", "0.6350519", "0.63356835", "0.63014...
0.6790841
9
Get the interval at which this function is executing. This translates an AWS Rate Schedule Expression ('rate(2 hours)') into a second interval
def _evaluate_interval(self): rate_match = AWS_RATE_RE.match(self._schedule) if not rate_match: raise AppConfigError('Invalid \'rate\' interval value: ' '{}'.format(self._schedule)) value = rate_match.group(2) or rate_match.group(4) unit = r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interval(self) -> int:\n return pulumi.get(self, \"interval\")", "def get_interval(self):\n return self.interval * 1000", "def interval(self):\n return self.__interval", "def interval(self):\n return self._interval", "def interval(self):\n return self._interval", "d...
[ "0.7161424", "0.71133465", "0.6716398", "0.6701243", "0.6701243", "0.6591058", "0.6582625", "0.6578035", "0.6556201", "0.6556201", "0.6523063", "0.6415974", "0.6391763", "0.6356646", "0.62375575", "0.6222892", "0.6222892", "0.6221555", "0.61875314", "0.61829716", "0.617091", ...
0.7932928
0
Get the last timestamp
def last_timestamp(self): LOGGER.debug('Getting last_timestamp as: %s', self._last_timestamp) return self._last_timestamp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_timestamp(self):\n return self._last_timestamp", "def get_last_time(self):\n \n return self._last", "def get_last_timestamp(self):\n return self._frame_timestamp", "def lasttime(self):\n if hasattr(self, \"_lasttime\"):\n return self._lasttime\n e...
[ "0.8668161", "0.84046865", "0.83760184", "0.8173479", "0.79495394", "0.7847311", "0.77691823", "0.7763253", "0.767657", "0.7675941", "0.7630592", "0.7576935", "0.75218123", "0.7483857", "0.7483232", "0.74118686", "0.7401233", "0.7401233", "0.7379154", "0.73734283", "0.7368113...
0.86650693
1