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 |
|---|---|---|---|---|---|---|
Log Errors caused by Updates. | def error(update, context):
logger.warning('Update "%s" caused error "%s"', update, context.error) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def error(update, context):\n\tlogger.warning('Update \"%s\" caused error \"%s\"', update, context.error)",
"def error(update, context):\n\tlogger.warning('Update \"%s\" caused error \"%s\"', update, context.error)",
"def error(self, update, context):\n self.logger.warning('Update \"%s\" caused error \"... | [
"0.7895998",
"0.7895998",
"0.78257465",
"0.77876204",
"0.77857095",
"0.77857095",
"0.7736321",
"0.7720785",
"0.77103233",
"0.7705559",
"0.7657797",
"0.76552874",
"0.76517016",
"0.76468384",
"0.76378685",
"0.76123977",
"0.7566961",
"0.75665903",
"0.7553289",
"0.7541538",
"0.75... | 0.77470577 | 24 |
Test case for companies_company_id_data_bill_payments_bill_payment_id_get | def test_companies_company_id_data_bill_payments_bill_payment_id_get(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_companies_company_id_data_bill_payments_get(self):\n pass",
"def test_fundinginformations_id_get(self):\n pass",
"def test_get_account_periodic_payments_using_get(self):\n pass",
"def test_get_payment_request(self):\n pass",
"def test_portfolio_account_id_ledger_get(sel... | [
"0.89510024",
"0.67293066",
"0.6619396",
"0.64179903",
"0.6405514",
"0.63697785",
"0.6223038",
"0.61138374",
"0.60376",
"0.59713686",
"0.5910931",
"0.5882584",
"0.588174",
"0.5835401",
"0.583473",
"0.5833762",
"0.5809204",
"0.57493806",
"0.57491654",
"0.5741355",
"0.57303685"... | 0.95197064 | 0 |
Take a list of gpx Track objects and convert them to two arrays, one containing the twodimensional distance covered on the globe, the second containing the elevation. | def convert_gpx_tracks_to_arrays(gpx_tracks):
all_points = []
for track in gpx_tracks:
for segment in track.segments:
these_points = []
for point in segment.points:
these_points.append(point)
all_points.append(these_points)
distance = []
ele... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_elevation_list(lats, longs):\n elevations = []\n\n map_client = client(key=GEOCODING_API_KEY)\n\n #Populate elevations\n for i in range(len(lats)):\n lat_long = (lats[i], longs[i]) #Format lattitute and longitude\n elevation_data = map_client.elevation(lat_long) #Get the JSON file... | [
"0.58547074",
"0.58046335",
"0.56457096",
"0.56290966",
"0.5624374",
"0.5607005",
"0.5505824",
"0.5505148",
"0.54917514",
"0.5491537",
"0.5449653",
"0.5412342",
"0.5377138",
"0.53422713",
"0.53001547",
"0.52485096",
"0.5235522",
"0.52246636",
"0.5209468",
"0.5201181",
"0.5191... | 0.7651816 | 0 |
Transform the data so that it has desired mean and standard deviation element wise | def renormalize_torch(data, desired_mean, desired_std, current_mean=None, current_std=None):
# see https://stats.stackexchange.com/questions/46429/transform-data-to-desired-mean-and-standard-deviation
if current_mean is None and current_std is None:
current_std = torch.std(data)
current_mean = t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def standardize(x,mean=[],std=[]):\n x_rand = x[:,1:] # The first column is a dummy feature that we cannot/should not normalize\n if not any(mean) and not any(std):\n mean = x_rand.mean(axis=0)\n std = x_rand.std(axis=0)\n x_rand_norm = (x_rand-mean)/std\n x_cte = np.reshape(x[:,0],(x.sha... | [
"0.7338602",
"0.7308863",
"0.7257655",
"0.7239369",
"0.71761507",
"0.7103488",
"0.7061486",
"0.70613635",
"0.6969751",
"0.6967539",
"0.6964995",
"0.6936441",
"0.69064665",
"0.6903517",
"0.6897775",
"0.6890662",
"0.6890336",
"0.68772715",
"0.68756384",
"0.6866155",
"0.6864502"... | 0.0 | -1 |
Transform the data so that it has desired mean and standard deviation element wise | def renormalize(data, desired_mean, desired_std, current_mean=None, current_std=None):
if isinstance(data, torch.Tensor):
return renormalize_torch(data, desired_mean, desired_std, current_mean=current_mean, current_std=current_std)
elif isinstance(data, np.ndarray):
return renormalize_numpy(data... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def standardize(x,mean=[],std=[]):\n x_rand = x[:,1:] # The first column is a dummy feature that we cannot/should not normalize\n if not any(mean) and not any(std):\n mean = x_rand.mean(axis=0)\n std = x_rand.std(axis=0)\n x_rand_norm = (x_rand-mean)/std\n x_cte = np.reshape(x[:,0],(x.sha... | [
"0.7340168",
"0.7307121",
"0.72577304",
"0.72381693",
"0.7174685",
"0.71027136",
"0.7060585",
"0.7060342",
"0.6971132",
"0.6968859",
"0.6966066",
"0.6937526",
"0.6908038",
"0.69034797",
"0.6896702",
"0.689065",
"0.6889117",
"0.6876658",
"0.6875154",
"0.6864792",
"0.68640053",... | 0.0 | -1 |
Determines whether block is of type type. If block does not exist, this is indicated. If block exists, but type does not exist, this is indicated. | def instance_type_query(self, block, type):
if not self.db.check_block(block):
return 'No such block: %s' % block
elif not self.db.check_type(type):
return 'No such type: %s' % type
else:
if self.db.check_block_type(block, type):
return 'Yes, %... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def IsBlock(self):\r\n\r\n return self.IsType(ID_BLOCK)",
"def set_instance_type(self, block, type):\n if not self.db.check_block(block):\n return 'No such block: %s' % block\n elif not self.db.check_type(type):\n return 'No such type: %s' % type\n else:\n ... | [
"0.7059267",
"0.63892186",
"0.6315961",
"0.6315961",
"0.6260697",
"0.62597287",
"0.6222352",
"0.6010166",
"0.60044545",
"0.60044545",
"0.58836514",
"0.58467036",
"0.57945657",
"0.57593507",
"0.5706733",
"0.5703776",
"0.5690768",
"0.5605407",
"0.55994004",
"0.55389535",
"0.550... | 0.7143345 | 0 |
Tests for correct shape/size of all physio data | def test_run_shape():
for s in subjs:
if s == 'phantom':
# no physio data for phantom
continue
for r in runs:
data = gd.get_run_physio_data(s, 1, r)
triggers = data.T[0].nonzero()[0]
ntriggers = len(triggers)
# check n triggers
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_sizes(self):\n assert self.get_queries().shape == (self.nq, self.d)\n if self.nt > 0:\n xt = self.get_train(maxtrain=123)\n assert xt.shape == (123, self.d), \"shape=%s\" % (xt.shape, )\n assert self.get_database().shape == (self.nb, self.d)\n assert self... | [
"0.7412218",
"0.69538015",
"0.69538015",
"0.68693477",
"0.6839685",
"0.6782179",
"0.67304265",
"0.66932786",
"0.6683325",
"0.6682552",
"0.6650657",
"0.6580486",
"0.64877427",
"0.64779925",
"0.6384488",
"0.6384194",
"0.6381291",
"0.6375498",
"0.6361608",
"0.63551426",
"0.63185... | 0.0 | -1 |
Return the second element of the given list. If the list has no second element, return None. | def select_second(L):
if len(L)<2:
return None
else:
return L[1] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def takeSecond(elem):\n return elem[1]",
"def getFirstTwoElems(x):\r\n if (type(x) == list and len(x) >= 2):\r\n return x[0], x[1]\r\n return",
"def get_second(x):\n return x[1]",
"def return_other(_list, item):\n if item == _list[0]:\n return _list[1]\n else:\n return ... | [
"0.72546357",
"0.71020824",
"0.709148",
"0.6964409",
"0.663627",
"0.6476621",
"0.6455976",
"0.63179314",
"0.6282283",
"0.62585384",
"0.62302023",
"0.62191963",
"0.6196856",
"0.61227584",
"0.6043009",
"0.59930843",
"0.5875032",
"0.5832501",
"0.583247",
"0.57986057",
"0.5762344... | 0.8308376 | 0 |
Initialise with the existing stack and the new stack. | def __init__(self, existing_stack, new_stack, previous_stack,
rollback=False, error_wait_time=None):
self.existing_stack = existing_stack
self.new_stack = new_stack
self.previous_stack = previous_stack
self.rollback = rollback
self.error_wait_time = error_wait_t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n self.stack1 = stack()\n self.stack2 = stack()\n self.front = None",
"def stack_reload(self, new_stack):\n self.stack = new_stack \n self.n_slice, self.ny, self.nx = new_stack.shape\n self.bl_flag = np.zeros(self.n_slice)\n self.c_list.clear()... | [
"0.6664507",
"0.6397264",
"0.6314738",
"0.6314738",
"0.6314073",
"0.62886035",
"0.62420005",
"0.62387484",
"0.6236406",
"0.61443913",
"0.61315995",
"0.6118691",
"0.6118691",
"0.6118691",
"0.6118691",
"0.6118691",
"0.6118691",
"0.6118691",
"0.6118691",
"0.6118691",
"0.6118691"... | 0.70676875 | 0 |
A configurationfilecompatible unique name for this stream. | def slug(self):
return self._source_group_manager.slug | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return '{} {}'.format(self.conf_name, self._name)",
"def unique_id(self) -> str:\n return (\n f\"{self._config_entry_unique_id}-{self._sensor.key}_{self._sensor.key_idx}\"\n )",
"def name(self) -> str:\n return f\"{self._name} via Configuration.yaml\"",
... | [
"0.7190048",
"0.7157833",
"0.711315",
"0.6973189",
"0.6948177",
"0.69132984",
"0.68926024",
"0.6860883",
"0.68360126",
"0.680803",
"0.6769975",
"0.67536813",
"0.673289",
"0.673289",
"0.6685866",
"0.6640951",
"0.6571153",
"0.65386784",
"0.65366304",
"0.6532078",
"0.6501376",
... | 0.0 | -1 |
creates an empty device dataframe | def _create_devices(dev_list, index=None):
if index is not None:
return pd.DataFrame(columns=dev_list, index=index)
else:
return pd.DataFrame(columns=dev_list) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_empty_df():\n df = pd.DataFrame(data=None, dtype=int, columns=OVERLAP_COLUMNS)\n\n return df.set_index(cn.seg_id)",
"def make_data_frame(self):\n names = []\n names.extend(self.SETTABLE_PARAM_NAMES)\n names.extend(self.COLLECTABLE_PARAM_NAMES)\n return pd.DataFrame(data... | [
"0.69109225",
"0.65139806",
"0.6432409",
"0.63319975",
"0.6326182",
"0.6291093",
"0.61900216",
"0.6130173",
"0.609881",
"0.6080611",
"0.6033169",
"0.60222054",
"0.6018478",
"0.601118",
"0.6008498",
"0.6004307",
"0.5979864",
"0.59628844",
"0.5917889",
"0.59013265",
"0.58970106... | 0.73704803 | 0 |
If `file_path` is defined, `data` will be `json.dump`ed to that file. | def dump(self):
if self.file_path is None:
return
with open(self.file_path, "w") as file:
json.dump(self.data, file) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data_writer(file_path, data):\n outfile = open(file_path, \"w+\")\n json.dump(data, outfile)",
"def dump_data(data, data_path):\n with open(data_path, 'w') as data_file:\n json.dump(data, data_file, indent = 4, sort_keys = True)",
"def dump(self, path: str, data: list) -> None:\n\n w... | [
"0.7683539",
"0.76679707",
"0.7627261",
"0.76272166",
"0.76030153",
"0.7551298",
"0.74692684",
"0.7382425",
"0.73648334",
"0.7344148",
"0.72975236",
"0.7266359",
"0.7212887",
"0.7179876",
"0.7141365",
"0.71408564",
"0.71304077",
"0.7119464",
"0.7112843",
"0.70798063",
"0.7054... | 0.6901034 | 32 |
Represents a Data Fusion instance. | def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
description: Optional[pulumi.Input[str]] = None,
enable_stackdriver_logging: Optional[pulumi.Input[bool]] = None,
enable_stackdriver_monitoring: ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DataInstance(self):\n return self._get_attribute('dataInstance')",
"def _build(self):\n coords = list(flatten(((x.start, x.end) for x in self.features)))\n start = min(coords)\n end = max(coords)\n\n attributes = dict(ID=f\"FUS{self.counter:06d}\")\n self.fusion = Gt... | [
"0.5828668",
"0.5815189",
"0.5648182",
"0.55378574",
"0.5536512",
"0.5518277",
"0.5506336",
"0.54975015",
"0.5449501",
"0.5411923",
"0.5382094",
"0.53546894",
"0.534884",
"0.5337046",
"0.5305184",
"0.5304909",
"0.5287401",
"0.52840436",
"0.52826875",
"0.52794445",
"0.5258386"... | 0.0 | -1 |
The time the instance was created in RFC3339 UTC "Zulu" format, accurate to nanoseconds. | def create_time(self) -> pulumi.Output[str]:
return pulumi.get(self, "create_time") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def timestamp_calculator(self): \r\n\r\n current_time = datetime.now(timezone.utc)\r\n\r\n return current_time.isoformat()",
"def create_time(self):\n return self._create_time",
"def create_time(self):\n return self._create_time",
"def create_time(self):\n return self._crea... | [
"0.7403024",
"0.7238055",
"0.7238055",
"0.7238055",
"0.7238055",
"0.71386385",
"0.71386385",
"0.71386385",
"0.7059947",
"0.70536673",
"0.7031496",
"0.69975907",
"0.6995058",
"0.6995058",
"0.6995058",
"0.6995058",
"0.6995058",
"0.6995058",
"0.6995058",
"0.6995058",
"0.6995058"... | 0.6540426 | 86 |
An optional description of the instance. | def description(self) -> pulumi.Output[Optional[str]]:
return pulumi.get(self, "description") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def description(self): # -> str | None:\n ...",
"def description(self):\n return None",
"def description(self):\n pass",
"def description(self) -> str:\n pass",
"def description(self) -> Optional[str]:\n return self._description",
"def description(self) -> Optional[str... | [
"0.78225285",
"0.775623",
"0.768705",
"0.76524323",
"0.7603353",
"0.7556572",
"0.7556572",
"0.7556572",
"0.7556572",
"0.7556572",
"0.7556572",
"0.7556572",
"0.7556572",
"0.7556572",
"0.7556572",
"0.7556572",
"0.7556572",
"0.7556572",
"0.7556572",
"0.7556572",
"0.7556572",
"... | 0.0 | -1 |
Option to enable Stackdriver Logging. | def enable_stackdriver_logging(self) -> pulumi.Output[Optional[bool]]:
return pulumi.get(self, "enable_stackdriver_logging") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enable_stackdriver_logging(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"enable_stackdriver_logging\")",
"def enable_stackdriver_logging(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"enable_stackdriver_logging\")",
"def enable_cloud_log():\n loggin... | [
"0.7740058",
"0.7740058",
"0.7064951",
"0.6942538",
"0.66340405",
"0.6599285",
"0.65863466",
"0.6565765",
"0.6565765",
"0.65419334",
"0.65143526",
"0.6489803",
"0.648186",
"0.64802396",
"0.6468393",
"0.6454187",
"0.64508414",
"0.6397447",
"0.6393087",
"0.632354",
"0.62965167"... | 0.76940453 | 2 |
The resource labels for instance to use to annotate any related underlying resources, such as Compute Engine VMs. | def labels(self) -> pulumi.Output[Optional[Mapping[str, str]]]:
return pulumi.get(self, "labels") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def labels(self) -> Mapping[str, str]:\n return pulumi.get(self, \"labels\")",
"def labels(self) -> Mapping[str, str]:\n return pulumi.get(self, \"labels\")",
"def labels(self) -> Mapping[str, str]:\n return pulumi.get(self, \"labels\")",
"def labels(self) -> Mapping[str, str]:\n ... | [
"0.6887695",
"0.6887695",
"0.6887695",
"0.6887695",
"0.6887695",
"0.6887695",
"0.6887695",
"0.6825382",
"0.67148405",
"0.6690797",
"0.6653999",
"0.66455024",
"0.6630656",
"0.65485054",
"0.65485054",
"0.6516708",
"0.6511654",
"0.6505417",
"0.6505417",
"0.6505417",
"0.64335597"... | 0.61887145 | 82 |
The ID of the instance or a fully qualified identifier for the instance. | def name(self) -> pulumi.Output[str]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def instance_id(self) -> str:\n return pulumi.get(self, \"instance_id\")",
"def instance_id(self) -> str:\n return pulumi.get(self, \"instance_id\")",
"def instance_id(self) -> str:\n return pulumi.get(self, \"instance_id\")",
"def instance_id(self) -> str:\n return pulumi.get(sel... | [
"0.8831739",
"0.8831739",
"0.8831739",
"0.8831739",
"0.8831739",
"0.8831739",
"0.8831739",
"0.87104565",
"0.87104565",
"0.8488644",
"0.8488644",
"0.8417693",
"0.8415027",
"0.82152593",
"0.82152593",
"0.82152593",
"0.817779",
"0.817779",
"0.817779",
"0.799486",
"0.7847565",
... | 0.0 | -1 |
Specifies whether the Data Fusion instance should be private. If set to true, all Data Fusion nodes will have private IP addresses and will not be able to access the public internet. | def private_instance(self) -> pulumi.Output[Optional[bool]]:
return pulumi.get(self, "private_instance") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_private(self):\n\n return self.data[\"isPrivate\"]",
"def endpoint_private_access(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"endpoint_private_access\")",
"def is_private(self):\n return self._is_private",
"def set_config_private(self) -> bool:\n retu... | [
"0.68346846",
"0.6817518",
"0.67943317",
"0.6727265",
"0.6673664",
"0.6673664",
"0.6611393",
"0.65900207",
"0.6540463",
"0.65372896",
"0.63051975",
"0.6244071",
"0.6174808",
"0.6094993",
"0.60635644",
"0.6031844",
"0.5935264",
"0.5931311",
"0.5902257",
"0.5882672",
"0.5835358... | 0.6102394 | 13 |
The ID of the project in which the resource belongs. If it is not provided, the provider project is used. | def project(self) -> pulumi.Output[str]:
return pulumi.get(self, "project") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def project_id(self) -> Optional[str]:\n return pulumi.get(self, \"project_id\")",
"def project_id(self) -> Optional[str]:\n return pulumi.get(self, \"project_id\")",
"def project_id(self) -> str:\n return pulumi.get(self, \"project_id\")",
"def project_id(self) -> str:\n return p... | [
"0.8159896",
"0.8159896",
"0.80476713",
"0.80476713",
"0.80476713",
"0.80476713",
"0.80476713",
"0.80476713",
"0.79406464",
"0.78643245",
"0.78643245",
"0.78643245",
"0.77710366",
"0.7762696",
"0.7762696",
"0.7762696",
"0.77526474",
"0.7682877",
"0.7608289",
"0.7608289",
"0.7... | 0.0 | -1 |
The time the instance was last updated in RFC3339 UTC "Zulu" format, accurate to nanoseconds. | def update_time(self) -> pulumi.Output[str]:
return pulumi.get(self, "update_time") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_update_time(self) -> str:\n return pulumi.get(self, \"last_update_time\")",
"def last_update_time(self):\n return self._last_update_time",
"def last_update_time(self, timeformat='unix'):\n if self.updated_at is None:\n return None\n return formatting.timeformat(s... | [
"0.77464175",
"0.7740039",
"0.7490177",
"0.7480429",
"0.7442182",
"0.7442182",
"0.7442182",
"0.7442182",
"0.7442182",
"0.7317787",
"0.7219565",
"0.71837443",
"0.7172283",
"0.71111566",
"0.7101491",
"0.7083822",
"0.70373803",
"0.7016313",
"0.7016313",
"0.70059407",
"0.69885725... | 0.6950973 | 31 |
View function for About Page. | def about():
return render_template("about.html") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def view_about(request):\n \n return render(request, 'about/about.html')",
"def about(request):\n\treturn render_to_response('aboutus.html')",
"def about():\n logger.info(\"About page accessed\")\n return render_template('about.html')",
"def about_page(request):\r\n return render(request, 'ez_m... | [
"0.8624915",
"0.86247414",
"0.8563009",
"0.841496",
"0.8403201",
"0.8373981",
"0.83042145",
"0.8296447",
"0.82570136",
"0.8216556",
"0.8216556",
"0.8212173",
"0.820837",
"0.8196079",
"0.81939083",
"0.81939083",
"0.81933093",
"0.81882",
"0.8185136",
"0.8185136",
"0.8175051",
... | 0.8073611 | 45 |
Sends a 401 response that enables basic auth | def authenticate():
return Response(
'Forbidden', 401,
{'WWW-Authenticate': 'Basic realm="Login Required"'}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def authenticate():\n return Response(\n 'Admin access required, please login' , 401,\n {'WWW-Authenticate': 'Basic realm=\"Login Required\"'})",
"def authenticate():\n return Response(\n AUTH_MESSAGE, 401, {\n 'WWW-Authenticate': 'Basic realm=\"{}\"'.format(REALM)\n ... | [
"0.8037457",
"0.80016845",
"0.7997504",
"0.78980345",
"0.78761816",
"0.7833727",
"0.78259075",
"0.7812201",
"0.7812201",
"0.7812201",
"0.7812201",
"0.7812201",
"0.7812201",
"0.7812201",
"0.77884096",
"0.77783334",
"0.77580726",
"0.7749071",
"0.7749071",
"0.7749071",
"0.771335... | 0.8199006 | 0 |
Gets the first XForwardedFor address and sets as the IP address. Gets the client_id by simply using a md5 hash of the client IP address and user agent. Determines whether the request was proxied. Determines the client protocol. | def get_client_details():
proxied = False
if request.headers.getlist('X-Forwarded-For'):
client_ip = str(request.headers.getlist('X-Forwarded-For')[0])
logger.info('rebrow access :: client ip set from X-Forwarded-For[0] to %s' % (str(client_ip)))
proxied = True
else:
client_i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __get_client_address(self):\n if 'HTTP_X_FORWARDED_FOR' in self.environ:\n return self.environ['HTTP_X_FORWARDED_FOR'].split(',')[-1].strip()\n\n return self.environ['REMOTE_ADDR']",
"def get_client_ip(request):\n x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')\n if ... | [
"0.7594346",
"0.75440025",
"0.7402496",
"0.7398851",
"0.7398851",
"0.7393473",
"0.72642",
"0.7156212",
"0.7098453",
"0.7056698",
"0.70220554",
"0.6961498",
"0.6904315",
"0.6773866",
"0.66784376",
"0.66330314",
"0.66330314",
"0.65675175",
"0.6501678",
"0.6484593",
"0.6322297",... | 0.6792671 | 13 |
Use the app.secret, client_id and salt to decode the token JWT encoded payload and determine the Redis password. | def decode_token(client_id):
fail_msg = False
trace = False
token = False
# @modified 20210421 - Task #4030: refactoring
# semgrep - python-logger-credential-disclosure
# logger.info('decode_token for client_id - %s' % str(client_id))
logger.info('decode_token for client_id OK')
if not ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def get_token(form_data: OAuth2PasswordRequestForm = Depends()):\n redis_key = f\"{form_data.username},{form_data.password}\"\n user = await re.redis.get(redis_key)\n\n if not user:\n basic_user = BasicUser(**{\n \"username\": form_data.username,\n \"password\": form_dat... | [
"0.64339846",
"0.59039646",
"0.586787",
"0.58591634",
"0.58270526",
"0.5772584",
"0.57497424",
"0.5721885",
"0.57218164",
"0.57161504",
"0.57133025",
"0.5710027",
"0.57051915",
"0.56993884",
"0.56916714",
"0.5683002",
"0.5680865",
"0.5664069",
"0.5626415",
"0.5625765",
"0.561... | 0.59880126 | 1 |
Convert a tile index to tiling coordinates | def indexToCoordinates(self, i):
# Sanity check
assert i >= 0, 'index out of bounds'
assert i < len(self), 'index out of bounds'
# Convert index to the coordinates of the tile
# number of elements that you skip by moving one position in dim 0
x = i // (self.shape[1]*self.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def indexToGrid(mapdata, index):\n \n x = index % mapdata.info.width\n y = index // mapdata.info.width\n return (x, y)",
"def world_coords_to_grid_index(tile_width, tile_height, x: float, y: float):\n # Elsewhere in the code we may use numpy to perform arithmetic. Problem is,\n ... | [
"0.71825325",
"0.71529114",
"0.714742",
"0.70980155",
"0.70268404",
"0.6778332",
"0.6686872",
"0.66252154",
"0.65748584",
"0.6547673",
"0.65397847",
"0.6443249",
"0.639847",
"0.6369536",
"0.63501084",
"0.6287622",
"0.6278953",
"0.62371904",
"0.62371117",
"0.6236063",
"0.62236... | 0.7226416 | 0 |
Convert a tile index to tiling coordinates | def indexToCoordinates(self, i):
# Sanity check
assert i >= 0, 'index out of bounds'
assert i < len(self), 'index out of bounds'
# Convert index to the coordinates of the tile
# number of elements that you skip by moving one position in dim 0
x = i // (self.shape[1]*self.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def indexToGrid(mapdata, index):\n \n x = index % mapdata.info.width\n y = index // mapdata.info.width\n return (x, y)",
"def world_coords_to_grid_index(tile_width, tile_height, x: float, y: float):\n # Elsewhere in the code we may use numpy to perform arithmetic. Problem is,\n ... | [
"0.71826315",
"0.71529806",
"0.71472746",
"0.7098196",
"0.7026966",
"0.67784154",
"0.6687045",
"0.6625526",
"0.65749663",
"0.65476346",
"0.6539868",
"0.6443348",
"0.6398581",
"0.63697577",
"0.63502795",
"0.628768",
"0.62790996",
"0.62373036",
"0.6237001",
"0.6236198",
"0.6223... | 0.7226523 | 1 |
This function creates an instance of UnetTiler3D given a concrete image and optionally a mask tensor. It is assumed that the tiling should extent over the entire input image. Image and Mask arrays are assumed to be of the same size and congruent. If a preexisting tensor is specified as the mask, it is overwritten. If n... | def forEntireCongruentData(cls, image, mask=None, output_shape=(132, 132, 132), input_shape=(220, 220, 220)):
image_canvas = Canvas(image) # Use a canvas for i/o on the image
# Allocate an array to assemble the mask in if not specified
if mask is None:
# Allocate a tensor where the... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def apply_net_tiled_3d(net,img):\n\n # borders = [8,24,24] ## border width within each patch that is thrown away after prediction\n # patchshape_padded = [32,240,240] ## the size of the patch that we feed into the net. must be divisible by 8 or net fails.\n # patchshape = [16,200,200] ## must b... | [
"0.6177036",
"0.60726184",
"0.60690933",
"0.5917124",
"0.58564585",
"0.58087647",
"0.5727461",
"0.5663098",
"0.55021197",
"0.5479169",
"0.5474847",
"0.54664636",
"0.54342926",
"0.5412518",
"0.54077625",
"0.53622305",
"0.5360488",
"0.53075945",
"0.52943414",
"0.5281255",
"0.52... | 0.7430127 | 0 |
Test that get_module_logger returns the existing logger object for a module. | def test_logutil_get_module_logger_exists(self, logging_fh_mock, os_makedirs_mock):
logging_fh_mock.setFormatter = mock.MagicMock(return_value=True)
module_path = os.path.join(self.callpath, "test/modules/mod.d/arpcache.yaml")
module_obj = ec2rlcore.module.get_module(module_path)
logger... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_logutil_get_module_logger(self, logging_fh_mock, os_makedirs_mock):\n logging_fh_mock.setFormatter = mock.MagicMock(return_value=True)\n module_path = os.path.join(self.callpath, \"test/modules/mod.d/arpcache.yaml\")\n module_obj = ec2rlcore.module.get_module(module_path)\n\n l... | [
"0.793995",
"0.749471",
"0.728704",
"0.71306074",
"0.7096622",
"0.70448136",
"0.70192856",
"0.6886613",
"0.6814631",
"0.6732484",
"0.67180073",
"0.6668632",
"0.66446614",
"0.66359025",
"0.6465496",
"0.6432589",
"0.6401083",
"0.6382442",
"0.63650286",
"0.63263613",
"0.6238284"... | 0.75608975 | 1 |
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix inorder arguments and keyword arguments. | def __init__(self, *args, **kwds):
if args or kwds:
super(SensorsData, self).__init__(*args, **kwds)
#message fields cannot be None, assign default values for those that are
if self.op_mode is None:
self.op_mode = ''
if self.speed is None:
self.speed = 0
if self.angle i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, *args, **kwds):\n if args or kwds:\n super(BasicSafetyMessage, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.header is None:\n self.header = std_msgs.msg.Header()\n if self.communication_header is ... | [
"0.8060849",
"0.8059418",
"0.7873155",
"0.7873155",
"0.7873155",
"0.7873155",
"0.76022345",
"0.7600446",
"0.7524561",
"0.7501046",
"0.7501046",
"0.74576837",
"0.7448639",
"0.7443354",
"0.74261546",
"0.7391047",
"0.7354933",
"0.7332085",
"0.7325221",
"0.7316853",
"0.72896564",... | 0.0 | -1 |
serialize message with numpy array types into buffer | def serialize_numpy(self, buff, numpy):
try:
_x = self.op_mode
length = len(_x)
if python3 or type(_x) == unicode:
_x = _x.encode('utf-8')
length = len(_x)
buff.write(struct.pack('<I%ss'%length, length, _x))
_x = self
buff.write(_get_struct_4I4B().pack(_x.speed, _... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def serialize_numpy(self, buff, numpy):\n self.serialize(buff)",
"def serialize_numpy(self, buff, numpy):\n try:\n pass\n except struct.error as se: self._check_types(struct.error(\"%s: '%s' when writing '%s'\" % (type(se), str(se), str(locals().get('_x', self)))))\n except TypeError as te: ... | [
"0.79519945",
"0.7893365",
"0.785495",
"0.77772063",
"0.7765444",
"0.77629846",
"0.7758146",
"0.7753108",
"0.7752819",
"0.7736317",
"0.7675474",
"0.7673923",
"0.7667761",
"0.7663843",
"0.760332",
"0.7587286",
"0.7566181",
"0.75634706",
"0.7555974",
"0.7554196",
"0.7543482",
... | 0.74282783 | 39 |
Returns an array of onehot encoded labels for each pixel in a stack of masks. | def ohe_mask(mask):
n_classes = np.unique(mask).shape[0]
ohe_labels = np.zeros([mask.shape[0]*mask.shape[1]*mask.shape[2], n_classes])
for k in range(n_classes):
ohe_labels[np.equal(mask, k).flatten(), k] = k
return ohe_labels.astype(np.float32) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def onehot_encoding(labels):\n #dataframe = self.cf\n unique = np.unique(labels).tolist()\n one_hot_labels = np.zeros((len(labels), len(unique)))\n for i in range(len(labels)):\n #print(cf.iloc[i,loc])\n pitch = labels[i]\n ind = unique.index(pitch)\n ... | [
"0.7086452",
"0.7034218",
"0.69116014",
"0.6868225",
"0.6803655",
"0.6719784",
"0.6713243",
"0.6710689",
"0.6668941",
"0.66461676",
"0.6615945",
"0.66115016",
"0.6600741",
"0.65553933",
"0.65280956",
"0.65111816",
"0.6504616",
"0.64597017",
"0.6457731",
"0.64381695",
"0.63986... | 0.58457595 | 88 |
String for representing the Model object. | def __str__(self):
return f'{self.first_name} {self.last_name}' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _repr_model_(self):\n return str(self)",
"def get_model_string(self):\n raise NotImplementedError()",
"def __str__(self):\n\n return str(self.model)",
"def __repr__(self):\n s = '' \n s += 'Model Name: ' + self._name + '\\n'\n s += 'Machine Learning Model: ' + st... | [
"0.8188433",
"0.81442237",
"0.8093044",
"0.7905443",
"0.7821154",
"0.7794082",
"0.77520275",
"0.7728334",
"0.77101016",
"0.77041835",
"0.7616919",
"0.75828636",
"0.7530188",
"0.75026286",
"0.74704695",
"0.7447144",
"0.7390358",
"0.7385083",
"0.73765314",
"0.7370234",
"0.72876... | 0.0 | -1 |
Returns the url to access a detail record for this book. | def get_absolute_url(self):
return reverse('student-detail', args=[str(self.id)]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def detail_link(self) -> SafeString:\n return self.get_detail_link()",
"def detail_url(self) -> str:\n return reverse(f'{self.get_meta().app_label}:detail', args=[self.pk])",
"def getDetailUrl(self):\n return self.base.get(\"detailUrl\", [])",
"def get_absolute_url(self):\n return... | [
"0.74187356",
"0.7355333",
"0.7288767",
"0.7257499",
"0.7257499",
"0.7257499",
"0.7257499",
"0.7257499",
"0.72552717",
"0.72293437",
"0.7215756",
"0.7122793",
"0.7037252",
"0.7021864",
"0.7013035",
"0.6963874",
"0.6959519",
"0.6899461",
"0.66315293",
"0.65398407",
"0.6530614"... | 0.650491 | 23 |
String for representing the Model object. | def __str__(self):
return self.name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _repr_model_(self):\n return str(self)",
"def get_model_string(self):\n raise NotImplementedError()",
"def __str__(self):\n\n return str(self.model)",
"def __repr__(self):\n s = '' \n s += 'Model Name: ' + self._name + '\\n'\n s += 'Machine Learning Model: ' + st... | [
"0.81881064",
"0.81440884",
"0.8092518",
"0.79045403",
"0.7821555",
"0.77940255",
"0.7750677",
"0.7726289",
"0.7709741",
"0.77061075",
"0.7617106",
"0.7581494",
"0.752893",
"0.7502676",
"0.7469311",
"0.7445783",
"0.73899454",
"0.73832124",
"0.7374007",
"0.73706955",
"0.728666... | 0.0 | -1 |
Returns the url to access a detail record for this book. | def get_absolute_url(self):
return reverse('project-detail', args=[str(self.id)]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def detail_link(self) -> SafeString:\n return self.get_detail_link()",
"def detail_url(self) -> str:\n return reverse(f'{self.get_meta().app_label}:detail', args=[self.pk])",
"def getDetailUrl(self):\n return self.base.get(\"detailUrl\", [])",
"def get_absolute_url(self):\n return... | [
"0.741553",
"0.735277",
"0.72853076",
"0.7260556",
"0.7260556",
"0.7260556",
"0.7260556",
"0.7260556",
"0.7258401",
"0.72324014",
"0.7218783",
"0.7125919",
"0.7035573",
"0.702461",
"0.701626",
"0.6962146",
"0.6962047",
"0.6898015",
"0.66296065",
"0.65398324",
"0.6527161",
"... | 0.0 | -1 |
String for representing the Model object. | def __str__(self):
return self.name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _repr_model_(self):\n return str(self)",
"def get_model_string(self):\n raise NotImplementedError()",
"def __str__(self):\n\n return str(self.model)",
"def __repr__(self):\n s = '' \n s += 'Model Name: ' + self._name + '\\n'\n s += 'Machine Learning Model: ' + st... | [
"0.8188433",
"0.81442237",
"0.8093044",
"0.7905443",
"0.7821154",
"0.7794082",
"0.77520275",
"0.7728334",
"0.77101016",
"0.77041835",
"0.7616919",
"0.75828636",
"0.7530188",
"0.75026286",
"0.74704695",
"0.7447144",
"0.7390358",
"0.7385083",
"0.73765314",
"0.7370234",
"0.72876... | 0.0 | -1 |
String for representing the Model object. | def __str__(self):
return self.name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _repr_model_(self):\n return str(self)",
"def get_model_string(self):\n raise NotImplementedError()",
"def __str__(self):\n\n return str(self.model)",
"def __repr__(self):\n s = '' \n s += 'Model Name: ' + self._name + '\\n'\n s += 'Machine Learning Model: ' + st... | [
"0.8188433",
"0.81442237",
"0.8093044",
"0.7905443",
"0.7821154",
"0.7794082",
"0.77520275",
"0.7728334",
"0.77101016",
"0.77041835",
"0.7616919",
"0.75828636",
"0.7530188",
"0.75026286",
"0.74704695",
"0.7447144",
"0.7390358",
"0.7385083",
"0.73765314",
"0.7370234",
"0.72876... | 0.0 | -1 |
Stores calling instances and returns this decorator object as function. | def __get__(self, instance, clazz):
# In Python, every function is a property. Before Python invokes function,
# it must access the function using __get__, where it can deliver the calling
# object. After the __get__, function is ready for being invoked by __call__.
self._self = instance... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def store_decorators(decorators):\n def outer(fn):\n fn._decorators = decorators\n return fn\n return outer",
"def cached(decorated: Callable):\n wrapper = _Wrapper(decorated)\n update_wrapper(wrapper=wrapper, wrapped=decorated)\n return wrapper",
"def __call__(self, function):\n\n... | [
"0.67359567",
"0.6022027",
"0.59571344",
"0.5945726",
"0.59403634",
"0.5916852",
"0.5894427",
"0.5888575",
"0.58674634",
"0.5865396",
"0.5847353",
"0.5808033",
"0.57416385",
"0.5736623",
"0.57257795",
"0.57225853",
"0.5720927",
"0.5678383",
"0.56712437",
"0.56709",
"0.5665390... | 0.5286999 | 67 |
Gets the object_type of this WorkflowCliCommand. The concrete type of this complex type. The ObjectType property must be set explicitly by API clients when the type is ambiguous. In all other cases, the ObjectType is optional. The type is ambiguous when a managed object contains an array of nested documents, and the do... | def object_type(self):
return self._object_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type(self):\n return self._object_type",
"def object_type(self, diagnostics=None, context=None):\n raise NotImplementedError(\n 'operation object_type(...) not yet implemented')",
"def object_type(self, diagnostics=None, context=None):\n raise NotImplementedError(\n ... | [
"0.6564303",
"0.61046857",
"0.61046857",
"0.6103534",
"0.60500324",
"0.5877544",
"0.5775089",
"0.56832385",
"0.56598765",
"0.56598765",
"0.56598765",
"0.5642497",
"0.5577006",
"0.5542314",
"0.55134",
"0.55104667",
"0.5503977",
"0.5478309",
"0.5440548",
"0.5405616",
"0.540139"... | 0.69038415 | 8 |
Gets the content_type of this WorkflowCliCommand. Intersight Orchestrator, with the support of response parser specification, can extract the values from API responses and map them to task output parameters. The value extraction is supported for response content types XML and JSON. The type of the content that gets pas... | def content_type(self):
return self._content_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def content_type(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"content_type\")",
"def content_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"content_type\")",
"def content_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"content_type... | [
"0.6986662",
"0.6548301",
"0.6548301",
"0.63956785",
"0.63688916",
"0.63030374",
"0.6291555",
"0.62398094",
"0.62398094",
"0.62398094",
"0.6212172",
"0.6188307",
"0.6175617",
"0.6132409",
"0.6132409",
"0.6132409",
"0.6132409",
"0.6132409",
"0.6132409",
"0.6132409",
"0.6104470... | 0.6290576 | 7 |
Sets the content_type of this WorkflowCliCommand. Intersight Orchestrator, with the support of response parser specification, can extract the values from API responses and map them to task output parameters. The value extraction is supported for response content types XML and JSON. The type of the content that gets pas... | def content_type(self, content_type):
allowed_values = ["json", "xml", "text"]
if content_type not in allowed_values:
raise ValueError(
"Invalid value for `content_type` ({0}), must be one of {1}"
.format(content_type, allowed_values)
)
se... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def content_type(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"content_type\")",
"def content_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"content_type\")",
"def content_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"content_type... | [
"0.61387795",
"0.601153",
"0.601153",
"0.59250945",
"0.5796646",
"0.5763594",
"0.57365996",
"0.5724802",
"0.56946254",
"0.56918323",
"0.56918323",
"0.56918323",
"0.56828016",
"0.5629556",
"0.55807877",
"0.55803853",
"0.5552459",
"0.54570174",
"0.5448451",
"0.543207",
"0.54320... | 0.63850874 | 0 |
Gets the name of this WorkflowCliCommand. A reference name for this API request within the batch API request. This name shall be used to map the API output parameters to subsequent API input parameters within a batch API task. | def name(self):
return self._name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self) -> str:\n if self._data.get(\"name\") is None:\n return self.cmd\n assert isinstance(self._data[\"name\"], str)\n return self._data[\"name\"]",
"def arg_name(self) -> str:\n return pulumi.get(self, \"arg_name\")",
"def name(self):\n return self._comm... | [
"0.70811236",
"0.6918724",
"0.69099444",
"0.6759963",
"0.66833746",
"0.66833746",
"0.66833746",
"0.66833746",
"0.66833746",
"0.66833746",
"0.66833746",
"0.66833746",
"0.66833746",
"0.66833746",
"0.66833746",
"0.66833746",
"0.66833746",
"0.66833746",
"0.66833746",
"0.66833746",
... | 0.0 | -1 |
Sets the name of this WorkflowCliCommand. A reference name for this API request within the batch API request. This name shall be used to map the API output parameters to subsequent API input parameters within a batch API task. | def name(self, name):
self._name = name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_name(self, name):\n self.options['name'] = name",
"def set_name(self, name=''):\n self._name = name",
"def set_name(self, name):\n self.name = name\n return self.name",
"def _set_name(self, name):\n return self.make_request('config', method='PUT', name=name)['name']... | [
"0.6625071",
"0.6543923",
"0.64521724",
"0.6443668",
"0.64350647",
"0.63879746",
"0.63879746",
"0.63879746",
"0.63879746",
"0.63879746",
"0.63257277",
"0.63257277",
"0.63257277",
"0.63257277",
"0.63257277",
"0.63257277",
"0.62938094",
"0.62938094",
"0.62938094",
"0.62938094",
... | 0.61596817 | 96 |
Gets the outcomes of this WorkflowCliCommand. All the possible outcomes of this API are captured here. Outcomes property is a collection property of type workflow.Outcome objects. The outcomes can be mapped to the message to be shown. The outcomes are evaluated in the order they are given. At the end of the outcomes li... | def outcomes(self):
return self._outcomes | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_outcome(self):\n return self.outcome",
"def outcome(self):\n return self._outcome",
"def outcome(self):\n return self._outcome",
"def game_outcomes(self):\n return [GameOutcome(\n home_team=game[0],\n winner=game[1],\n ) for game in zip(\n ... | [
"0.59110963",
"0.5824591",
"0.5824591",
"0.56388307",
"0.53578734",
"0.5295576",
"0.52215075",
"0.50569576",
"0.5030524",
"0.4956799",
"0.4851028",
"0.48366976",
"0.48083296",
"0.4733697",
"0.4679427",
"0.46084848",
"0.46074247",
"0.45940235",
"0.45615205",
"0.45497376",
"0.4... | 0.71597505 | 0 |
Sets the outcomes of this WorkflowCliCommand. All the possible outcomes of this API are captured here. Outcomes property is a collection property of type workflow.Outcome objects. The outcomes can be mapped to the message to be shown. The outcomes are evaluated in the order they are given. At the end of the outcomes li... | def outcomes(self, outcomes):
self._outcomes = outcomes | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def outcomes(self):\n return self._outcomes",
"def add_outcome(self, outcome):\n if outcome.name in self.outcomes:\n raise KeyError(\n \"Option '{}' already contains an outcome '{}'.\".format(\n self.name,\n outcome.name\n )\n )\n\n self.outcomes[outcome.nam... | [
"0.5827716",
"0.4914224",
"0.4887674",
"0.4887674",
"0.48289946",
"0.4779731",
"0.4775197",
"0.4729249",
"0.47155696",
"0.4694893",
"0.46564317",
"0.446417",
"0.44011104",
"0.44006547",
"0.438552",
"0.43835914",
"0.43697655",
"0.43444538",
"0.43096524",
"0.42934647",
"0.42327... | 0.7044916 | 0 |
Gets the response_spec of this WorkflowCliCommand. The optional grammar specification for parsing the response to extract the required values. The specification should have extraction specification specified for all the API output parameters. | def response_spec(self):
return self._response_spec | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def response(self) -> Optional[pulumi.Input['BotResponseSpecificationArgs']]:\n return pulumi.get(self, \"response\")",
"def response(self) -> Optional[pulumi.Input['BotResponseSpecificationArgs']]:\n return pulumi.get(self, \"response\")",
"def capture_response(self) -> Optional[pulumi.Input['Bo... | [
"0.6698291",
"0.6698291",
"0.5871674",
"0.58482414",
"0.57452565",
"0.5531625",
"0.5531625",
"0.5531625",
"0.5531625",
"0.5531625",
"0.5531625",
"0.5531625",
"0.5531625",
"0.5531625",
"0.5531625",
"0.5500476",
"0.5480266",
"0.5386626",
"0.5375355",
"0.52890664",
"0.52586156",... | 0.67568654 | 0 |
Sets the response_spec of this WorkflowCliCommand. The optional grammar specification for parsing the response to extract the required values. The specification should have extraction specification specified for all the API output parameters. | def response_spec(self, response_spec):
self._response_spec = response_spec | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def response_spec(self):\n return self._response_spec",
"def response(self) -> Optional[pulumi.Input['BotResponseSpecificationArgs']]:\n return pulumi.get(self, \"response\")",
"def response(self) -> Optional[pulumi.Input['BotResponseSpecificationArgs']]:\n return pulumi.get(self, \"respon... | [
"0.58668",
"0.5660343",
"0.5660343",
"0.54491186",
"0.5427248",
"0.53926754",
"0.5389661",
"0.53592664",
"0.52549934",
"0.52507615",
"0.52507615",
"0.52507615",
"0.52507615",
"0.5163075",
"0.51255363",
"0.5116933",
"0.5101658",
"0.5101658",
"0.5101658",
"0.50406015",
"0.50275... | 0.7186647 | 0 |
Gets the skip_on_condition of this WorkflowCliCommand. The skip expression, if provided, allows the batch API executor to skip the api execution when the given expression evaluates to true. The expression is given as such a golang template that has to be evaluated to a final content true/false. The expression is an opt... | def skip_on_condition(self):
return self._skip_on_condition | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def skip_on_condition(self, skip_on_condition):\n\n self._skip_on_condition = skip_on_condition",
"def skipIf(self, expr, message):\r\n if expr: self.skip(message)",
"def skip_if(condition, msg=None):\n def deco(test):\n @tools.make_decorator(test)\n def skipper(*args, **kwds):\n... | [
"0.6132984",
"0.5682775",
"0.5622519",
"0.55552536",
"0.5533801",
"0.5521969",
"0.5519086",
"0.5443788",
"0.5087626",
"0.4995944",
"0.49150637",
"0.48806167",
"0.48624656",
"0.48086235",
"0.47555253",
"0.47336423",
"0.47235554",
"0.47054088",
"0.47019777",
"0.47019777",
"0.46... | 0.61656076 | 0 |
Gets the terminal_end of this WorkflowCliCommand. If this flag is set, it marks the end of the terminal session where the previous commands were executed. | def terminal_end(self):
return self._terminal_end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def terminal_end(self, terminal_end):\n\n self._terminal_end = terminal_end",
"def end_prompt(self):\n return self._end_prompt",
"def get_terminal(self):\n terminal = self.layers[-1].get_terminal()\n return terminal",
"def terminal_start(self):\n return self._terminal_start... | [
"0.70066565",
"0.6435464",
"0.6298006",
"0.6129522",
"0.60512525",
"0.603081",
"0.58302504",
"0.5751601",
"0.5732274",
"0.5668516",
"0.56615543",
"0.56006694",
"0.56006694",
"0.56006694",
"0.56006694",
"0.56006694",
"0.5571324",
"0.5546722",
"0.55292547",
"0.5507912",
"0.5505... | 0.79839885 | 0 |
Sets the terminal_end of this WorkflowCliCommand. If this flag is set, it marks the end of the terminal session where the previous commands were executed. | def terminal_end(self, terminal_end):
self._terminal_end = terminal_end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def terminal_end(self):\n return self._terminal_end",
"def end_prompt(self, end_prompt):\n\n self._end_prompt = end_prompt",
"def terminal_start(self, terminal_start):\n\n self._terminal_start = terminal_start",
"def set_endstate(self, endstate):\n self.get_screen().set_endstate(e... | [
"0.6577897",
"0.6404495",
"0.60665566",
"0.5663497",
"0.5601455",
"0.54698",
"0.54698",
"0.54698",
"0.54698",
"0.54698",
"0.5433007",
"0.53809744",
"0.53386885",
"0.53288436",
"0.53076243",
"0.52692515",
"0.5207081",
"0.51995397",
"0.51476735",
"0.51133496",
"0.5056345",
"0... | 0.82329017 | 0 |
Gets the terminal_start of this WorkflowCliCommand. If this flag is set, the execution of this command initiates a terminal session in which the subsequent CLI commands are executed until a command with terminalEnd flag is encountered or the end of the batch. | def terminal_start(self):
return self._terminal_start | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def terminal_start(self, terminal_start):\n\n self._terminal_start = terminal_start",
"def start_cmd(self):\n if self._start_cmd is None:\n raise NotImplementedError()\n\n return self._start_cmd",
"def get_terminal(self):\n terminal = self.layers[-1].get_termi... | [
"0.6360897",
"0.6186781",
"0.6062417",
"0.572582",
"0.5689248",
"0.5618613",
"0.55726624",
"0.54825395",
"0.5380147",
"0.5371906",
"0.5371541",
"0.5323842",
"0.53237146",
"0.5266614",
"0.5256827",
"0.52435803",
"0.5241976",
"0.5231982",
"0.5216516",
"0.52014834",
"0.5097601",... | 0.77724093 | 0 |
Sets the terminal_start of this WorkflowCliCommand. If this flag is set, the execution of this command initiates a terminal session in which the subsequent CLI commands are executed until a command with terminalEnd flag is encountered or the end of the batch. | def terminal_start(self, terminal_start):
self._terminal_start = terminal_start | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def terminal_start(self):\n return self._terminal_start",
"def start_coreterminal(self):\n self.core_process.start('xterm', ['-into',\n str(self.core_terminal.winId()),\n '-hold', '-e',\n ... | [
"0.6485783",
"0.6211937",
"0.56890756",
"0.5636789",
"0.56217897",
"0.5489538",
"0.54607147",
"0.5386771",
"0.5374451",
"0.52925175",
"0.5241797",
"0.51384556",
"0.502264",
"0.49887782",
"0.49793804",
"0.4976259",
"0.49714372",
"0.49334905",
"0.49040836",
"0.4841018",
"0.4819... | 0.7688985 | 0 |
Gets the type of this WorkflowCliCommand. The type of the command can be interactive or noninteractive. | def type(self):
return self._type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def command_type(self) -> Optional[Type[Command]]:\n return self._command_type",
"def cli_type(self):\n\n return str",
"def command_type(self):\n return Parser._command_type[self.command[0]]",
"def get(self):\n\n for name in self.command_types:\n if getattr(self, name) ... | [
"0.75561947",
"0.7415196",
"0.7408793",
"0.6516037",
"0.6465135",
"0.6451417",
"0.6451417",
"0.6451417",
"0.6451417",
"0.6451417",
"0.6451417",
"0.6451417",
"0.6451417",
"0.6451417",
"0.6451417",
"0.6451417",
"0.6451417",
"0.6451417",
"0.6451417",
"0.6451417",
"0.6451417",
... | 0.0 | -1 |
Returns the string representation of the model | def to_str(self):
return pformat(self.to_dict()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _repr_model_(self):\n return str(self)",
"def __str__(self):\n\n return str(self.model)",
"def get_model_string(self):\n raise NotImplementedError()",
"def __str__(self):\n return self.model",
"def serialize_model(self):\n return dill.dumps(self.model)",
"def __str_... | [
"0.8602374",
"0.85093755",
"0.8237104",
"0.8050309",
"0.80128866",
"0.79348034",
"0.78766525",
"0.77898884",
"0.7786461",
"0.7745792",
"0.7627315",
"0.76055235",
"0.757999",
"0.7514394",
"0.75038797",
"0.75035286",
"0.74850684",
"0.7440529",
"0.74325883",
"0.74239755",
"0.740... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n return not self == other",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other):\n return self.__dict__ != other.__dict__",
"def __eq__(self, other):\n return not self.__ne__(other)",
... | [
"0.8410411",
"0.8391477",
"0.8172175",
"0.81410587",
"0.80920255",
"0.8088807",
"0.80676955"
] | 0.0 | -1 |
Equivalent to numpy.nonzero(). The difference torch.nonzero() is that it returns a tuple of 1d tensors, and not a 2d tensor. This is more convenient in a few cases. This should maybe be sent to core pytorch | def nonzero(tensor):
result = tensor.nonzero()
return torch.unbind(result, 1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nonzero(self):\n return array_funcs.nonzero(self)",
"def where(cond):\n return torch.nonzero(cond)",
"def nonzero(self):\n return indexing.nonzero(self)",
"def __nonzero__(self):\n return _yarp.DVector___nonzero__(self)",
"def __nonzero__(self):\n return _almathswig.vectorPos... | [
"0.74413973",
"0.73518986",
"0.69615924",
"0.68349963",
"0.679536",
"0.6758139",
"0.6720182",
"0.6694357",
"0.6643636",
"0.6636133",
"0.6526583",
"0.6394705",
"0.63927436",
"0.6376805",
"0.63046247",
"0.6249144",
"0.6172271",
"0.61607075",
"0.6072842",
"0.6030596",
"0.5961612... | 0.7549238 | 0 |
Efficient version of torch.cat that avoids a copy if there is only a single element in a list | def cat(tensors, dim=0):
assert isinstance(tensors, (list, tuple))
if len(tensors) == 1:
return tensors[0]
return torch.cat(tensors, dim) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def maybe_all_cat(x: th.Tensor) -> th.Tensor:\n if not dist.is_initialized():\n return x\n\n buffer = x.new_empty([dist.get_world_size() * x.shape[0], *x.shape[1:]])\n dist.all_gather_into_tensor(buffer, x)\n return buffer",
"def concat_list(lst, ax):\n if torch.is_tensor(lst[0]):\n ... | [
"0.6768914",
"0.6517925",
"0.6468387",
"0.64377886",
"0.62246776",
"0.61942565",
"0.619313",
"0.6143953",
"0.61241096",
"0.61186576",
"0.60141754",
"0.59179974",
"0.58821505",
"0.5840244",
"0.5840035",
"0.58336955",
"0.58176965",
"0.5813983",
"0.5813983",
"0.5803983",
"0.5782... | 0.6803941 | 0 |
Given a set of BoxList containing the `labels` field, return a set of BoxList for which `labels > 0`. | def keep_only_positive_boxes(boxes):
assert isinstance(boxes, (list, tuple))
assert isinstance(boxes[0], (list, tuple))
assert isinstance(boxes[0][0], BoxList)
assert boxes[0][0].has_field("labels")
positive_boxes = []
num_boxes = 0
for boxes_per_feature_map in boxes:
positive_boxes_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_empty_boxes(boxes, labels):\n del_boxes = []\n for idx, box in enumerate(boxes):\n if box[0] == box[2] or box[1] == box[3]:\n del_boxes.append(idx)\n\n return np.delete(boxes, del_boxes, 0), np.delete(labels, del_boxes)",
"def bboxes_filter_labels(labels, bboxes,\n ... | [
"0.64703315",
"0.61698055",
"0.61591595",
"0.5991897",
"0.5923272",
"0.5905444",
"0.57530326",
"0.5684819",
"0.5612272",
"0.55994505",
"0.5551537",
"0.55234766",
"0.5516591",
"0.5516591",
"0.549626",
"0.5495184",
"0.5480695",
"0.5440822",
"0.5420077",
"0.5416754",
"0.5415791"... | 0.6808206 | 0 |
Get the number of items in the cache. | def num_items(self):
return len(self._items_list) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nbytes(self):\n return sum([entry.nbytes for _, entry in self.cache.values()])",
"def getNumberOfEntries( self ):\n return len( self._FileCache )",
"def size(self):\n return len(self.cache)",
"def count():\n return len(ADBCache._caches)",
"def size(self):\n self._curs... | [
"0.8117195",
"0.80290323",
"0.78515923",
"0.7776496",
"0.7713431",
"0.76341397",
"0.75924677",
"0.7588074",
"0.75073385",
"0.75073385",
"0.7507121",
"0.7507121",
"0.7507121",
"0.7507121",
"0.7507121",
"0.7507121",
"0.7507121",
"0.7507121",
"0.7507121",
"0.7507121",
"0.7507121... | 0.69267136 | 95 |
Get humanreadable subject name derived from the SubjectName or SubjectAltName field. | def display_name(self):
if self.subject_name:
return u", ".join( [ u", ".join(
[ u"{0}={1}".format(k,v) for k, v in dn_tuple ] )
for dn_tuple in self.subject_name ])
for name_type in ("XmppAddr", "DNS", "SRV"):
names = sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subject_name(self) -> str:\n return pulumi.get(self, \"subject_name\")",
"def subject_name(self) -> str:\n return pulumi.get(self, \"subject_name\")",
"def subject_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"subject_name\")",
"def get_subject_name(self):\n re... | [
"0.80769295",
"0.80769295",
"0.7711503",
"0.7684465",
"0.7589533",
"0.7568423",
"0.742775",
"0.72258717",
"0.72258717",
"0.71753144",
"0.7126077",
"0.6891047",
"0.67289484",
"0.65807796",
"0.65550107",
"0.6494894",
"0.648574",
"0.64557433",
"0.64269227",
"0.63651174",
"0.6360... | 0.72443026 | 7 |
Serialize the stanza into a Unicode XML string. | def serialize(self):
return serialize(self.as_xml()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_xml_string(self):\n binary = Etree.tostring(self._xml, encoding='utf8', method='xml')\n return binary.decode('utf-8')",
"def as_xml(self):\r\n result = Stanza.as_xml(self)\r\n if self._show:\r\n child = ElementTree.SubElement(result, self._show_tag)\r\n ch... | [
"0.6861126",
"0.67105246",
"0.6488491",
"0.6454883",
"0.633381",
"0.6288272",
"0.6238313",
"0.62094206",
"0.61780787",
"0.6136681",
"0.61294377",
"0.60978276",
"0.60724616",
"0.6041683",
"0.6020301",
"0.6005353",
"0.59933794",
"0.59809315",
"0.5931383",
"0.58900297",
"0.58837... | 0.6240395 | 6 |
Return the XML error representation. | def as_xml(self):
result = ElementTree.Element(self.error_qname)
result.append(deepcopy(self.condition))
if self.text:
text = ElementTree.SubElement(result, self.text_qname)
if self.language:
text.set(XML_LANG_QNAME, self.language)
text.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def as_xml(self, stanza_namespace = None): # pylint: disable-msg=W0221\r\n if stanza_namespace:\r\n self.error_qname = \"{{{0}}}error\".format(stanza_namespace)\r\n self.text_qname = \"{{{0}}}text\".format(stanza_namespace)\r\n result = ErrorElement.as_xml(self)\r\n resul... | [
"0.72466123",
"0.6543728",
"0.6469045",
"0.6413976",
"0.62614864",
"0.6164561",
"0.6126499",
"0.6111519",
"0.6111519",
"0.6056813",
"0.6052043",
"0.60445005",
"0.6016431",
"0.59000546",
"0.5855487",
"0.584858",
"0.5845893",
"0.5821053",
"0.57861346",
"0.57703644",
"0.5762993"... | 0.7137107 | 1 |
Get the standard English message for the error. | def get_message(self):
cond = self.condition_name
if cond in STREAM_ERRORS:
return STREAM_ERRORS[cond][0]
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def error_message(self) -> str:\n return pulumi.get(self, \"error_message\")",
"def error_message(self) -> str:\n return pulumi.get(self, \"error_message\")",
"def get_error_message(self) -> str:\n return self._error_msg",
"def error_string(self) -> str:\n return self._msg",
"de... | [
"0.7877309",
"0.7877309",
"0.77278847",
"0.75977683",
"0.75348145",
"0.7477345",
"0.7454338",
"0.7407951",
"0.74012816",
"0.71984303",
"0.71671486",
"0.7132833",
"0.71114576",
"0.71065205",
"0.70237446",
"0.6837111",
"0.6828891",
"0.68228406",
"0.6820827",
"0.6792671",
"0.677... | 0.60003144 | 98 |
Get the standard English message for the error. | def get_message(self):
cond = self.condition_name
if cond in STANZA_ERRORS:
return STANZA_ERRORS[cond][0]
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def error_message(self) -> str:\n return pulumi.get(self, \"error_message\")",
"def error_message(self) -> str:\n return pulumi.get(self, \"error_message\")",
"def get_error_message(self) -> str:\n return self._error_msg",
"def error_string(self) -> str:\n return self._msg",
"de... | [
"0.7877309",
"0.7877309",
"0.77278847",
"0.75977683",
"0.75348145",
"0.7477345",
"0.7454338",
"0.7407951",
"0.74012816",
"0.71984303",
"0.7132833",
"0.71114576",
"0.71065205",
"0.70237446",
"0.6837111",
"0.6828891",
"0.68228406",
"0.6820827",
"0.6792671",
"0.6779915",
"0.6772... | 0.71671486 | 10 |
Return the XML error representation. | def as_xml(self, stanza_namespace = None): # pylint: disable-msg=W0221
if stanza_namespace:
self.error_qname = "{{{0}}}error".format(stanza_namespace)
self.text_qname = "{{{0}}}text".format(stanza_namespace)
result = ErrorElement.as_xml(self)
result.set("type", self.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def as_xml(self):\r\n result = ElementTree.Element(self.error_qname)\r\n result.append(deepcopy(self.condition))\r\n if self.text:\r\n text = ElementTree.SubElement(result, self.text_qname)\r\n if self.language:\r\n text.set(XML_LANG_QNAME, self.language)\r... | [
"0.7137107",
"0.6543728",
"0.6469045",
"0.6413976",
"0.62614864",
"0.6164561",
"0.6126499",
"0.6111519",
"0.6111519",
"0.6056813",
"0.6052043",
"0.60445005",
"0.6016431",
"0.59000546",
"0.5855487",
"0.584858",
"0.5845893",
"0.5821053",
"0.57861346",
"0.57703644",
"0.5762993",... | 0.72466123 | 0 |
Create a new `Field` object from an XML element. | def _new_from_xml(cls, xmlnode):
field_type = xmlnode.prop("type")
label = from_utf8(xmlnode.prop("label"))
name = from_utf8(xmlnode.prop("var"))
child = xmlnode.children
values = []
options = []
required = False
desc = None
while child:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _new_from_xml(cls, xmlnode):\r\n child = xmlnode.children\r\n fields = []\r\n while child:\r\n if child.type != \"element\" or child.ns().content != DATAFORM_NS:\r\n pass\r\n elif child.name == \"field\":\r\n fields.append(Field._new_from... | [
"0.72660637",
"0.68494296",
"0.67141545",
"0.61856854",
"0.6045589",
"0.6027848",
"0.60205066",
"0.6009597",
"0.5987878",
"0.5903702",
"0.587912",
"0.58692527",
"0.5842267",
"0.5791186",
"0.57846063",
"0.57409567",
"0.5738716",
"0.57213604",
"0.5720465",
"0.56573087",
"0.5608... | 0.70764583 | 1 |
Initialize a `Form` object. | def __init__(self, xmlnode_or_type = "form", title = None, instructions = None,
fields = None, reported_fields = None, items = None):
if isinstance(xmlnode_or_type, libxml2.xmlNode):
self.__from_xml(xmlnode_or_type)
elif xmlnode_or_type not in self.allowed_types:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def instantiate_form(self, model, *args, **kwargs) -> Form:\n return Form.instantiate(self=model, *args, **kwargs)",
"def __init__(self, form_class):\n self.form_class = form_class\n self.model_class = self.form_class.Meta.model\n self.meta = self.form_class.Meta",
"def form(self):\... | [
"0.70807403",
"0.68745786",
"0.67833847",
"0.6341396",
"0.62951887",
"0.6247006",
"0.61647755",
"0.61623216",
"0.60952497",
"0.60427195",
"0.6029042",
"0.6021532",
"0.6017789",
"0.60025585",
"0.5974065",
"0.59706223",
"0.5970254",
"0.59097314",
"0.5905846",
"0.58823127",
"0.5... | 0.0 | -1 |
Get a deep copy of `self`. | def copy(self):
return copy.deepcopy(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deepcopy(self):\n return self.clone()",
"def deepcopy(self):\n return copy.deepcopy(self)",
"def deepcopy(self):\n return self.__copy__()",
"def deepcopy(self):\n return deepcopy(self)",
"def copy(self):\r\n return deepcopy(self)",
"def copy(self):\r\n return... | [
"0.8975952",
"0.8936158",
"0.8917737",
"0.8857193",
"0.88526165",
"0.88526165",
"0.87977856",
"0.87977856",
"0.8784562",
"0.8784562",
"0.8784562",
"0.8784562",
"0.8784562",
"0.8784562",
"0.8784562",
"0.8784562",
"0.8784562",
"0.8784562",
"0.8784562",
"0.8784562",
"0.8784562",... | 0.88462675 | 6 |
Initialize a `Form` object from an XML element. | def __from_xml(self, xmlnode):
self.fields = []
self.reported_fields = []
self.items = []
self.title = None
self.instructions = None
if (xmlnode.type != "element" or xmlnode.name != "x"
or xmlnode.ns().content != DATAFORM_NS):
raise Val... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _new_from_xml(cls, xmlnode):\r\n label = from_utf8(xmlnode.prop(\"label\"))\r\n child = xmlnode.children\r\n value = None\r\n for child in xml_element_ns_iter(xmlnode.children, DATAFORM_NS):\r\n if child.name == \"value\":\r\n value = from_utf8(child.getCon... | [
"0.68845147",
"0.66916794",
"0.6474108",
"0.63995796",
"0.636357",
"0.5905419",
"0.5899516",
"0.58020353",
"0.5796043",
"0.57325226",
"0.5690412",
"0.5664106",
"0.5658994",
"0.5657048",
"0.55928653",
"0.55911785",
"0.5546918",
"0.5529908",
"0.5528498",
"0.55189717",
"0.547696... | 0.7123815 | 0 |
Get the timestamp as a local time. | def get_datetime_local(self):
r=datetime_utc_to_local(self.timestamp)
return r | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_local_timestamp(record):\r\n\r\n timestamp = datetime.fromtimestamp(\r\n timestamp=record.created,\r\n tz=tzlocal()\r\n )\r\n\r\n return timestamp.isoformat(sep=' ')",
"def get_current_timestamp(self):\n return datetime.datetime.now(local_timezone).isoformat()",
"def time... | [
"0.7668968",
"0.7286546",
"0.723523",
"0.7190292",
"0.7083024",
"0.7057088",
"0.7055616",
"0.70183045",
"0.70031977",
"0.6964257",
"0.69554055",
"0.69424886",
"0.69324976",
"0.6921372",
"0.6864481",
"0.6851352",
"0.6847197",
"0.6827933",
"0.6807481",
"0.68038696",
"0.6800487"... | 0.8113512 | 0 |
Get the timestamp as a UTC. | def get_datetime_utc(self):
return self.timestamp | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getUTCDatetime():\n\n dt = datetime.utcnow().replace(microsecond=0)\n\n return dt.isoformat()",
"def get_utc_time():\n return datetime.now(tz=timezone.utc).strftime(\"%b %d, %Y %H:%M:%S %Z\")",
"def utc_time(self) -> Union[str, None]:\n response = self.command('AT%UTC')\n if response... | [
"0.7616796",
"0.7543996",
"0.75337774",
"0.7500469",
"0.7472961",
"0.73186165",
"0.73056304",
"0.72714216",
"0.72676957",
"0.7260785",
"0.72380465",
"0.7183727",
"0.7139851",
"0.7127293",
"0.71148455",
"0.7045053",
"0.6999321",
"0.6993558",
"0.6989963",
"0.69640136",
"0.69489... | 0.81953377 | 0 |
Remove `self` from the containing `DiscoItems` object. | def remove(self):
if self.disco is None:
return
self.xmlnode.unlinkNode()
oldns=self.xmlnode.ns()
ns=self.xmlnode.newNs(oldns.getContent(),None)
self.xmlnode.replaceNs(oldns,ns)
common_root.addChild(self.xmlnode())
self.disco=None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove(self, item):\n\n del self[self.index(item)]",
"def discard(self, item):\n if item in self:\n self.remove(item)",
"def remove_item(self, item):\n self.items.pop(item.name)",
"def remove(self, item):\n pass",
"def remove_item(self, item):\n self.items.pop(... | [
"0.69977385",
"0.6885115",
"0.6777147",
"0.67301995",
"0.67236835",
"0.6717288",
"0.66431093",
"0.6580455",
"0.65415645",
"0.6503491",
"0.64575726",
"0.64475054",
"0.63964224",
"0.6340161",
"0.6330904",
"0.6326147",
"0.63038254",
"0.6302132",
"0.62553984",
"0.62454486",
"0.62... | 0.0 | -1 |
Get the name of the item. | def get_name(self):
name = self.xmlnode.prop("name")
if name is None:
return None
return name.decode("utf-8") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def item_name(self) -> str:\n return self._item_name",
"def getItemName(self):\n return self._itemName",
"def item_title(self, item):\n return item.name",
"def get_item_name(self, item_id):\n return self.item_dataframe.loc[self.item_dataframe.mainKey == int(item_id)].name.values[0... | [
"0.899619",
"0.8652733",
"0.8170481",
"0.8101467",
"0.7848678",
"0.7673646",
"0.7673646",
"0.7627596",
"0.7627596",
"0.7627596",
"0.7617913",
"0.7610956",
"0.7606998",
"0.76055354",
"0.76055354",
"0.76055354",
"0.76055354",
"0.76055354",
"0.7591232",
"0.75864965",
"0.75864965... | 0.0 | -1 |
Set the name of the item. | def set_name(self, name):
if name is None:
if self.xmlnode.hasProp("name"):
self.xmlnode.unsetProp("name")
return
name = unicode(name)
self.xmlnode.setProp("name", name.encode("utf-8")) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def item_name(self, item_name: str):\n\n self._item_name = item_name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def se... | [
"0.86078304",
"0.79370147",
"0.79370147",
"0.79370147",
"0.79370147",
"0.79370147",
"0.791858",
"0.79169333",
"0.78504527",
"0.78504527",
"0.78504527",
"0.78504527",
"0.78504527",
"0.78504527",
"0.7807374",
"0.77884066",
"0.77815163",
"0.7763934",
"0.774871",
"0.77386886",
"0... | 0.0 | -1 |
Get the action attribute of the item. | def get_action(self):
action=self.xmlnode.prop("action")
if action is None:
return None
return action.decode("utf-8") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_action(self):\n return self.action",
"def action(self):\n return self._action",
"def action(self):\n return self._action",
"def action(self):\n return self._action",
"def getAction(self):\r\n return self.action",
"def action(self):\n\t\treturn self._action",
"... | [
"0.7869614",
"0.75827223",
"0.75827223",
"0.75827223",
"0.75806516",
"0.75043625",
"0.74994975",
"0.74994975",
"0.7499381",
"0.7499381",
"0.7499381",
"0.7499381",
"0.7498285",
"0.7498285",
"0.7498285",
"0.7498285",
"0.7498285",
"0.7498285",
"0.7498285",
"0.7498285",
"0.749828... | 0.755499 | 5 |
Get the name of the item. | def get_name(self):
var = self.xmlnode.prop("name")
if not var:
var = ""
return var.decode("utf-8") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def item_name(self) -> str:\n return self._item_name",
"def getItemName(self):\n return self._itemName",
"def item_title(self, item):\n return item.name",
"def get_item_name(self, item_id):\n return self.item_dataframe.loc[self.item_dataframe.mainKey == int(item_id)].name.values[0... | [
"0.899619",
"0.8652733",
"0.8170481",
"0.8101467",
"0.7848678",
"0.7673646",
"0.7673646",
"0.7627596",
"0.7627596",
"0.7627596",
"0.7617913",
"0.7610956",
"0.7606998",
"0.76055354",
"0.76055354",
"0.76055354",
"0.76055354",
"0.76055354",
"0.7591232",
"0.75864965",
"0.75864965... | 0.0 | -1 |
Set the name of the item. | def set_name(self,name):
if not name:
raise ValueError("name is required in DiscoIdentity")
name = unicode(name)
self.xmlnode.setProp("name", name.encode("utf-8")) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def item_name(self, item_name: str):\n\n self._item_name = item_name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def se... | [
"0.86078304",
"0.79370147",
"0.79370147",
"0.79370147",
"0.79370147",
"0.79370147",
"0.791858",
"0.79169333",
"0.78504527",
"0.78504527",
"0.78504527",
"0.78504527",
"0.78504527",
"0.78504527",
"0.7807374",
"0.77884066",
"0.77815163",
"0.7763934",
"0.774871",
"0.77386886",
"0... | 0.0 | -1 |
Get the type of the item. | def get_type(self):
item_type = self.xmlnode.prop("type")
if not item_type:
item_type = "?"
return item_type.decode("utf-8") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def item_type(self):\n return self._type",
"def getItemType(self):\n return self.itemType",
"def get_item_type(self):\n\n\t\treturn struct.unpack('<L', self.item_raw[0 : 4])[0]",
"def get_item_type(self):\n\n\t\treturn struct.unpack('<L', self.item_raw[0 : 4])[0]",
"def get_type(self):\n ... | [
"0.88629764",
"0.8693319",
"0.8461297",
"0.8461297",
"0.7657755",
"0.76568574",
"0.76568574",
"0.7622051",
"0.7593991",
"0.7558334",
"0.7558334",
"0.75133926",
"0.7488276",
"0.74734306",
"0.7457893",
"0.74186045",
"0.74186045",
"0.7410345",
"0.74009913",
"0.73836666",
"0.7351... | 0.8032414 | 4 |
Check if `self` contains an item. | def has_item(self,jid,node=None):
l=self.xpath_ctxt.xpathEval("d:item")
if l is None:
return False
for it in l:
di=DiscoItem(self,it)
if di.jid==jid and di.node==node:
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_item(self, item):\n return item in self.items",
"def __contains__(self, item):\r\n return item in self.__dict__",
"def contains(self, item):\n\n if self.tree_is_empty() is True:\n return False\n return self.search(item)",
"def __contains__(self, item):\n ... | [
"0.8296083",
"0.8051302",
"0.7971856",
"0.79511917",
"0.78330255",
"0.7792096",
"0.7757471",
"0.7736797",
"0.7723373",
"0.7723373",
"0.76567405",
"0.76318735",
"0.7620686",
"0.745744",
"0.73735154",
"0.7366416",
"0.73661023",
"0.73558015",
"0.7295157",
"0.7197497",
"0.7179385... | 0.6472687 | 75 |
Check if the item described by `self` belongs to the given category and type. | def identity_is(self,item_category,item_type=None):
if not item_category:
raise ValueError("bad category")
if not item_type:
type_expr=u""
elif '"' not in item_type:
type_expr=u' and @type="%s"' % (item_type,)
elif "'" not in type:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_in_category(self, menu_item):\n result = None\n for item in self.__items:\n if item.get_name() == menu_item:\n result = True\n else:\n result = False\n return result",
"def has(self, category):\n return category in self.mapping",
"def __contains__(self, item):\n ... | [
"0.6878782",
"0.6371764",
"0.62361234",
"0.6139338",
"0.6038679",
"0.6017591",
"0.5982735",
"0.5902145",
"0.5815789",
"0.57091707",
"0.5670693",
"0.5663379",
"0.56051373",
"0.5587543",
"0.5587013",
"0.55675256",
"0.55662024",
"0.55662024",
"0.5540449",
"0.5532454",
"0.5507363... | 0.59224325 | 7 |
Initialize a `MucRoomUser` object. | def __init__(self,presence_or_user_or_jid):
if isinstance(presence_or_user_or_jid,MucRoomUser):
self.presence=presence_or_user_or_jid.presence
self.role=presence_or_user_or_jid.role
self.affiliation=presence_or_user_or_jid.affiliation
self.room_jid=presence_o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, xmpp, config, reinit=False, **kwargs):\n if not xmpp.room:\n raise RuntimeError('Multi-user chat support is disabled in config file')\n\n super(Muc, self).__init__(xmpp, config, reinit=reinit, **kwargs)",
"def __init__(self,manager,own_jid,room_jid,handler):\r\n ... | [
"0.65085894",
"0.63544774",
"0.61516184",
"0.6059587",
"0.599315",
"0.56768745",
"0.5676805",
"0.5647038",
"0.56004494",
"0.55911756",
"0.5563822",
"0.55125237",
"0.5450719",
"0.5424447",
"0.54220676",
"0.54138255",
"0.5359668",
"0.5352066",
"0.53473794",
"0.5345572",
"0.5321... | 0.74007154 | 0 |
Initialize a `MucRoomState` object. | def __init__(self,manager,own_jid,room_jid,handler):
self.own_jid=own_jid
self.room_jid=room_jid
self.handler=handler
self.manager=weakref.proxy(manager)
self.joined=False
self.subject=None
self.users={}
self.me=MucRoomUser(room_jid)
self.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, room1 = False, room2= False, state=False):\r\n\t\tself.state = state\r\n\t\tself.room1 = room1\r\n\t\tself.room2 = room2",
"def __init__(self, room, id=uuid4()):\n super().__init__(id=id)\n self._room = room\n self._character = None\n self._status = PlayerStatus.joi... | [
"0.72496176",
"0.66326666",
"0.6414609",
"0.6318126",
"0.6298145",
"0.61733747",
"0.6141297",
"0.6099505",
"0.6088059",
"0.6060369",
"0.59991795",
"0.58739895",
"0.5836085",
"0.5834423",
"0.57148165",
"0.56298983",
"0.5622189",
"0.558765",
"0.55541843",
"0.5523011",
"0.550472... | 0.66999143 | 1 |
Request an "instant room" the default configuration for a MUC room. | def request_instant_room(self):
if self.configured:
raise RuntimeError("Instant room may be requested for unconfigured room only")
form = Form("submit")
return self.configure_room(form) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def room_configured(self):\r\n pass",
"def create_room(room):\n\n if room.custom_server:\n return\n\n def _create_room(xmpp):\n muc = xmpp.plugin['xep_0045']\n muc.joinMUC(room.jid, xmpp.requested_jid.user)\n muc.configureRoom(room.jid, _set_form_values(xmpp, room))\n\n ... | [
"0.6382692",
"0.56701976",
"0.55353206",
"0.54297906",
"0.5423925",
"0.5379001",
"0.5348136",
"0.53389",
"0.52546513",
"0.5233924",
"0.5230633",
"0.5220951",
"0.5211881",
"0.5209376",
"0.5199485",
"0.51671493",
"0.51652396",
"0.51638865",
"0.5143849",
"0.51378876",
"0.5132301... | 0.66497433 | 0 |
Process an unavailable presence from a MUC room. | def __presence_unavailable(self,stanza):
fr=stanza.get_from()
key=fr.bare().as_unicode()
rs=self.rooms.get(key)
if not rs:
return False
rs.process_unavailable_presence(MucPresence(stanza))
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_unavailableBroadcast(self):\n\n self.protocol.unavailable(None)\n presence = self.output[-1]\n self.assertEquals(\"presence\", presence.name)\n self.assertEquals(None, presence.uri)\n self.assertEquals(None, presence.getAttribute('to'))\n self.assertEquals(\"unava... | [
"0.6642906",
"0.6561239",
"0.6497237",
"0.6390973",
"0.6376522",
"0.63067585",
"0.62734866",
"0.627087",
"0.6215486",
"0.6150008",
"0.60968095",
"0.5948993",
"0.581057",
"0.5788893",
"0.56123185",
"0.55222046",
"0.5506747",
"0.550595",
"0.55001837",
"0.54217476",
"0.54014224"... | 0.6625584 | 1 |
Get password from the MUC request. | def get_password(self):
for child in xml_element_iter(self.xmlnode.children):
if get_node_ns_uri(child) == MUC_NS and child.name == "password":
return from_utf8(child.getContent())
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_password(self):\n request = urllib.request.urlopen(\"http://www.dinopass.com/password/simple\").read()\n password = request.decode(\"utf-8\")\n\n return password",
"def _get_password(self):\n return self._password",
"def password(self) -> 'outputs.SecureStringResponse':\n ... | [
"0.72884434",
"0.72722954",
"0.71997243",
"0.7182018",
"0.7121064",
"0.71170187",
"0.7053856",
"0.7053856",
"0.7053856",
"0.7031656",
"0.69465554",
"0.69465554",
"0.69465554",
"0.69465554",
"0.69465554",
"0.69465554",
"0.69465554",
"0.69465554",
"0.69465554",
"0.69465554",
"0... | 0.73666567 | 0 |
Create XML representation of `self`. | def as_xml(self,parent):
n=parent.newChild(None,"item",None)
if self.actor:
n.newTextChild(None,"actor",to_utf8(self.actor))
if self.reason:
n.newTextChild(None,"reason",to_utf8(self.reason))
n.setProp("affiliation",to_utf8(self.affiliation))
if sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xml(self) -> XmlNode:\n return self.generate_xml()",
"def as_xml(self):\r\n raise NotImplementedError",
"def get_xml(self):\n return self.to_xml()",
"def to_xml(self):\n #root skel node ###################################################\n skel = etree.Element('skel')\n... | [
"0.7779858",
"0.771454",
"0.76820123",
"0.7593419",
"0.7522958",
"0.75034916",
"0.7296359",
"0.7280491",
"0.72804433",
"0.72555447",
"0.71017003",
"0.70735466",
"0.7071936",
"0.70169747",
"0.69944423",
"0.69763213",
"0.69095737",
"0.68938595",
"0.68638676",
"0.68419975",
"0.6... | 0.6821498 | 21 |
Create XML representation of `self`. | def as_xml(self,parent):
n=parent.newChild(None,"status",None)
n.setProp("code","%03i" % (self.code,))
return n | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def xml(self) -> XmlNode:\n return self.generate_xml()",
"def as_xml(self):\r\n raise NotImplementedError",
"def get_xml(self):\n return self.to_xml()",
"def to_xml(self):\n #root skel node ###################################################\n skel = etree.Element('skel')\n... | [
"0.7779858",
"0.771454",
"0.76820123",
"0.7593419",
"0.7522958",
"0.75034916",
"0.7296359",
"0.7280491",
"0.72804433",
"0.72555447",
"0.71017003",
"0.70735466",
"0.7071936",
"0.70169747",
"0.69944423",
"0.69763213",
"0.69095737",
"0.68938595",
"0.68638676",
"0.68419975",
"0.6... | 0.6642901 | 77 |
Get the MUC specific payload element. | def get_muc_child(self):
if self.muc_child:
return self.muc_child
if not self.xmlnode.children:
return None
n=self.xmlnode.children
while n:
if n.name not in ("x","query"):
n=n.next
continue
ns=n.ns... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def payload(self) -> PayloadType:\n return self._payload",
"def payload(self) -> str:\n return pulumi.get(self, \"payload\")",
"def payload(self):\n return self._payload",
"def get_payload(self, payload_class, payload_key = None,\r\n ... | [
"0.6205464",
"0.61551434",
"0.61256963",
"0.6040741",
"0.6016075",
"0.60064936",
"0.5721589",
"0.5705247",
"0.55622077",
"0.5525949",
"0.55140907",
"0.5446201",
"0.5428154",
"0.53956807",
"0.5395578",
"0.5383685",
"0.53449595",
"0.53393745",
"0.5325166",
"0.5325166",
"0.53251... | 0.52626973 | 26 |
Return a copy of `self`. | def copy(self):
return MucPresence(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __copy__(self):\n return self.copy()",
"def copy(self):\n return copy(self)",
"def copy(self):\n return self",
"def copy(self):\n return self.__copy__()",
"def copy(self):\n\t\treturn copy.copy(self)",
"def copy(self):\n return super().copy()",
"def copy(self):\n ... | [
"0.89345765",
"0.88519645",
"0.8819118",
"0.87622666",
"0.87002003",
"0.8653348",
"0.8653348",
"0.8653348",
"0.86510503",
"0.86510503",
"0.86510503",
"0.86510503",
"0.8626906",
"0.8626906",
"0.85983497",
"0.85983497",
"0.85689235",
"0.8546507",
"0.85213804",
"0.85213804",
"0.... | 0.0 | -1 |
Initialize an `Iq` object. | def __init__(self,xmlnode=None,from_jid=None,to_jid=None,stanza_type=None,stanza_id=None,
error=None,error_cond=None):
MucStanzaExt.__init__(self)
Iq.__init__(self,xmlnode,from_jid=from_jid,to_jid=to_jid,
stanza_type=stanza_type,stanza_id=stanza_id,
error... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n self._q = []",
"def __init__(self, iq, oq, *args, **kw):\n Process.__init__(self, *args, **kw)\n self.iq, self.oq = iq, oq",
"def __init__(self,q=None):\n if q is None:\n self.__q = np.zeros(4)\n self.__q[0] = 1.0;\n elif type(q) is... | [
"0.63485175",
"0.63072664",
"0.62139976",
"0.6205428",
"0.6124468",
"0.6088462",
"0.5980408",
"0.59666866",
"0.59470135",
"0.5942797",
"0.5893928",
"0.587749",
"0.57990235",
"0.5790753",
"0.5761127",
"0.57297987",
"0.57164574",
"0.5690746",
"0.56885743",
"0.56746507",
"0.5655... | 0.5948335 | 8 |
Return a copy of `self`. | def copy(self):
return MucIq(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __copy__(self):\n return self.copy()",
"def copy(self):\n return copy(self)",
"def copy(self):\n return self",
"def copy(self):\n return self.__copy__()",
"def copy(self):\n\t\treturn copy.copy(self)",
"def copy(self):\n return super().copy()",
"def copy(self):\n ... | [
"0.89345765",
"0.88519645",
"0.8819118",
"0.87622666",
"0.87002003",
"0.8653348",
"0.8653348",
"0.8653348",
"0.86510503",
"0.86510503",
"0.86510503",
"0.86510503",
"0.8626906",
"0.8626906",
"0.85983497",
"0.85983497",
"0.85689235",
"0.8546507",
"0.85213804",
"0.85213804",
"0.... | 0.0 | -1 |
Return Data Form for the `Register` object. Convert legacy fields to a data form if `self.form` is `None`, return `self.form` otherwise. | def get_form(self, form_type = "form"):
if self.form:
if self.form.type != form_type:
raise ValueError("Bad form type in the jabber:iq:register element")
return self.form
form = Form(form_type, instructions = self.instructions)
form.add_field("FO... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def form(self):\n if getattr(self, \"_form\", None) is None:\n data = {}\n if hasattr(self, \"default_form_data\"):\n data.update(self.default_form_data)\n data = session.checker.get(self.form_class.__name__, data)\n self._form = self.form_class(for... | [
"0.68105227",
"0.6809989",
"0.66375566",
"0.6622124",
"0.658413",
"0.65267736",
"0.630449",
"0.6160972",
"0.6110958",
"0.6037817",
"0.603401",
"0.6031194",
"0.598573",
"0.5951804",
"0.5937819",
"0.592273",
"0.5916399",
"0.5900155",
"0.5868151",
"0.58593357",
"0.583117",
"0.... | 0.73505205 | 0 |
Initialize a `VCardField` object. Set its name. | def __init__(self,name):
self.name=name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self,name,value,rfc2425parameters=None):\r\n VCardField.__init__(self,name)\r\n if not rfc2425parameters:\r\n rfc2425parameters={}\r\n if isinstance(value,libxml2.xmlNode):\r\n self.type,self.cred=None,None\r\n n=value.children\r\n vns=g... | [
"0.67980564",
"0.6767403",
"0.6744057",
"0.67157644",
"0.66835654",
"0.66616464",
"0.6627859",
"0.6606118",
"0.6562235",
"0.65063024",
"0.64825374",
"0.6441607",
"0.64400166",
"0.6394262",
"0.6379562",
"0.6194509",
"0.6128039",
"0.60810417",
"0.6077967",
"0.6018019",
"0.59478... | 0.53584224 | 99 |
Initialize a `VCardName` object. | def __init__(self,name,value,rfc2425parameters=None):
_unused = rfc2425parameters
VCardField.__init__(self,name)
if self.name.upper()!="N":
raise RuntimeError("VCardName handles only 'N' type")
if isinstance(value,libxml2.xmlNode):
self.family,self.given,sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self,name,value,rfc2425parameters=None):\r\n _unused = rfc2425parameters\r\n VCardField.__init__(self,name)\r\n if self.name.upper()!=\"ORG\":\r\n raise RuntimeError(\"VCardName handles only 'ORG' type\")\r\n if isinstance(value,libxml2.xmlNode):\r\n s... | [
"0.6551793",
"0.6102033",
"0.6006297",
"0.5966223",
"0.59548527",
"0.59521955",
"0.5941687",
"0.59218377",
"0.58950025",
"0.58825725",
"0.5859599",
"0.585298",
"0.5841986",
"0.58363664",
"0.5820827",
"0.5762787",
"0.575997",
"0.5755156",
"0.5710485",
"0.5710485",
"0.5701081",... | 0.65074813 | 1 |
Initialize a `VCardAdr` object from and XML element. | def __from_xml(self,value):
n=value.children
vns=get_node_ns(value)
while n:
if n.type!='element':
n=n.next
continue
ns=get_node_ns(n)
if (ns and vns and ns.getContent()!=vns.getContent()):
n=n.next
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __from_xml(self,data):\r\n ns=get_node_ns(data)\r\n if ns and ns.getContent()!=VCARD_NS:\r\n raise ValueError(\"Not in the %r namespace\" % (VCARD_NS,))\r\n if data.name!=\"vCard\":\r\n raise ValueError(\"Bad root element name: %r\" % (data.name,))\r\n n=data.c... | [
"0.6546679",
"0.65439653",
"0.63873243",
"0.6332748",
"0.61356634",
"0.6068926",
"0.5822272",
"0.57888347",
"0.5754995",
"0.57434434",
"0.5716824",
"0.5699437",
"0.5627903",
"0.56150347",
"0.5587811",
"0.555288",
"0.5529375",
"0.55246204",
"0.5502899",
"0.5491047",
"0.5423368... | 0.6783448 | 0 |
Initialize a `VCardLabel` object. | def __init__(self,name,value,rfc2425parameters=None):
VCardField.__init__(self,name)
if not rfc2425parameters:
rfc2425parameters={}
if self.name.upper()!="LABEL":
raise RuntimeError("VCardAdr handles only 'LABEL' type")
if isinstance(value,libxml2.xmlNode):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, label):\n py_typecheck.check_type(label, six.string_types)\n self._label = str(label)",
"def __init__(self, label):\n self.label = label",
"def initLabel(self):\n\n cmd = [0x00] * 8\n self.buildCommand(cmd)",
"def __init__(self, label, tag):\n super().__in... | [
"0.67296684",
"0.6692519",
"0.636104",
"0.6350865",
"0.62980455",
"0.6073505",
"0.6051368",
"0.60150766",
"0.5983711",
"0.5901818",
"0.5883134",
"0.5862246",
"0.58517563",
"0.583023",
"0.5806118",
"0.57876325",
"0.57817584",
"0.57707554",
"0.57691544",
"0.5737505",
"0.5715899... | 0.6192874 | 5 |
Initialize a `VCardGeo` object. | def __init__(self,name,value,rfc2425parameters=None):
_unused = rfc2425parameters
VCardField.__init__(self,name)
if self.name.upper()!="GEO":
raise RuntimeError("VCardName handles only 'GEO' type")
if isinstance(value,libxml2.xmlNode):
self.lat,self.lon=[Non... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, name, country, climate, elevation=0):\n self.name = name\n self.country = country\n self.climate = climate\n self.lat = 0\n self.lon = 0\n # TODO: handle elevation with a other method\n self.elevation = elevation\n self.get_coord()",
"def... | [
"0.5904542",
"0.58668566",
"0.58285636",
"0.57602686",
"0.57510495",
"0.5655581",
"0.56380963",
"0.5630178",
"0.5555419",
"0.55502665",
"0.5522805",
"0.55102295",
"0.55101377",
"0.54837507",
"0.5481247",
"0.547784",
"0.5468697",
"0.5465972",
"0.5456116",
"0.54355097",
"0.5372... | 0.7197957 | 0 |
Get the RFC2426 representation of `self`. | def rfc2426(self):
ret="begin:VCARD\r\n"
ret+="version:3.0\r\n"
for _unused, value in self.content.items():
if value is None:
continue
if type(value) is list:
for v in value:
ret+=v.rfc2426()
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rfc2426(self):\r\n return rfc2425encode(self.name,self.value)",
"def rfc2426(self):\r\n return rfc2425encode(self.name,self.value)",
"def rfc2426(self):\r\n return rfc2425encode(\"n\",u';'.join(quote_semicolon(val) for val in\r\n (self.family,self.given,self.middle,self.... | [
"0.83252555",
"0.83252555",
"0.7957391",
"0.7877756",
"0.7850021",
"0.75746506",
"0.7238404",
"0.71918166",
"0.71615696",
"0.7117041",
"0.7099543",
"0.70896465",
"0.70618165",
"0.6989344",
"0.6495119",
"0.6226955",
"0.555124",
"0.54927945",
"0.5456316",
"0.5439679",
"0.540945... | 0.7338627 | 6 |
Returns a decorated class | def decorator(class_):
if "_pyxmpp_feature_uris" not in class_.__dict__:
class_._pyxmpp_feature_uris = set()
class_._pyxmpp_feature_uris.add(uri)
return class_ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ClassDecorator(decorator=lambda x : x):\n def decorate(cls):\n for attr in cls.__dict__: # there's propably a better way to do this\n if callable(getattr(cls, attr)):\n setattr(cls, attr, decorator(getattr(cls, attr)))\n return cls\n return decorate",
"def load_d... | [
"0.6981142",
"0.69752413",
"0.6712332",
"0.6712332",
"0.66499406",
"0.6597853",
"0.65396523",
"0.6510269",
"0.64477324",
"0.6400005",
"0.6386003",
"0.6352994",
"0.6323877",
"0.6322724",
"0.6301431",
"0.6214794",
"0.61027217",
"0.60714644",
"0.60514504",
"0.60393953",
"0.60233... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.