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 |
|---|---|---|---|---|---|---|
Returns a corresponding form field to your document field with some argument value. If mongo_field is not a supported field type, None will be returned. | def mongofield_to_formfield(mongo_field, widget=None, **kwargs):
if mongo_field.choices:
return forms.ChoiceField(
choices = mongo_field.choices,
widget = widget,
label = mongo_field.verbose_name,
required = mongo_field.required,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def api_field_from_mongo_field(cls, f, default=tastypie_fields.CharField):\r\n\r\n result = default\r\n\r\n if isinstance(f, (mongoengine.ComplexDateTimeField, mongoengine.DateTimeField)):\r\n result = tastypie_fields.DateTimeField\r\n elif isinstance(f, mongoengine.BooleanField):\r... | [
"0.7513637",
"0.6739226",
"0.6523016",
"0.649139",
"0.64877313",
"0.64723545",
"0.63325566",
"0.6317045",
"0.6311768",
"0.6296844",
"0.6267898",
"0.6201326",
"0.613974",
"0.61055815",
"0.60916525",
"0.60869265",
"0.60836",
"0.6055458",
"0.603872",
"0.60258335",
"0.60256004",
... | 0.70353186 | 1 |
Check if the paths have been set. Should be true after `set_paths` has been called. | def paths_set(self):
return self._paths_set | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_paths(self) -> None:\n bad_keys = []\n for key, path in self.paths.items():\n # we only check specified paths, and drop them otherwise\n if path is not None:\n if isinstance(path, str):\n path = Path(path)\n if not path... | [
"0.69389457",
"0.66912466",
"0.6672468",
"0.6614077",
"0.647543",
"0.6472543",
"0.6241962",
"0.62369555",
"0.6229761",
"0.6217773",
"0.6211751",
"0.62054604",
"0.617153",
"0.61413795",
"0.61014664",
"0.61014664",
"0.6090713",
"0.60759485",
"0.60712343",
"0.60548925",
"0.60194... | 0.5800538 | 30 |
Constructor for the LabelSmoothing module. | def __init__(self, smoothing=0.1):
super(LabelSmoothingCrossEntropy, self).__init__()
assert smoothing < 1.0
self.smoothing = smoothing
self.confidence = 1. - smoothing | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, smoothing=0.0):\n super(LabelSmoothing, self).__init__()\n self.confidence = 1.0 - smoothing\n self.smoothing = smoothing",
"def __init__(self, smoothing=0.0):\n super(LabelSmoothing, self).__init__()\n self.confidence = 1.0 - smoothing\n self.smoothin... | [
"0.8505097",
"0.8505097",
"0.85014725",
"0.7740796",
"0.6831716",
"0.6535184",
"0.64484084",
"0.6373303",
"0.6344245",
"0.6325938",
"0.6322719",
"0.6288337",
"0.61676824",
"0.616322",
"0.6125794",
"0.60863334",
"0.60729283",
"0.60607344",
"0.59531105",
"0.59465086",
"0.591395... | 0.76720005 | 4 |
This function helps to read the input file as a pandas dataframe and returns them. | def read_input_file(inp_file, sep = ","):
df = pd.read_csv(inp_file, sep = sep)
# read the input file as a pandas dataframe
return df | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run(self) -> pd.DataFrame:\n with open(self.file_path, 'r') as in_file:\n headers = in_file.readline()\n headers = headers.replace(\"\\n\", \"\")\n\n if ',' in headers:\n headers = headers.split(',')\n else:\n headers = headers.sp... | [
"0.76586795",
"0.75894886",
"0.73977333",
"0.73572356",
"0.73287624",
"0.73287624",
"0.73287624",
"0.728862",
"0.7268643",
"0.7187225",
"0.7187225",
"0.7132298",
"0.71238756",
"0.7098056",
"0.7072574",
"0.70412254",
"0.70390135",
"0.7000305",
"0.69866455",
"0.6978137",
"0.693... | 0.71544135 | 11 |
Masking some random tokens for Language Model task with probabilities as in the original BERT paper. | def random_word(tokens, tokenizer, word_mask_rate=0.15):
output_label = []
for i, token in enumerate(tokens):
prob = random.random()
if prob < word_mask_rate:
prob /= word_mask_rate
# 80% randomly change token to mask token
if prob < 0.8:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_mask_tokens(inputs, alphabet, mlm_probability=0.15):\n labels = inputs.clone()\n device = inputs.device\n # We sample a few tokens in each sequence for MLM training\n # (with probability `self.mlm_probability`)\n probability_matrix = torch.full(labels.shape, mlm_probability,\n ... | [
"0.72398764",
"0.6995237",
"0.68272895",
"0.6789064",
"0.66487736",
"0.66257054",
"0.6620122",
"0.65425634",
"0.65218735",
"0.65218115",
"0.64321506",
"0.6338301",
"0.6281222",
"0.62538826",
"0.6238888",
"0.606579",
"0.5929544",
"0.590163",
"0.5832555",
"0.5821377",
"0.575693... | 0.6822052 | 3 |
Masking some random tokens for Language Model task with probabilities as in the original BERT paper. | def random_word_wwm(tokens, ref_ids, tokenizer):
output_label = []
for i, (token, ref_id) in enumerate(zip(tokens, ref_ids)):
prob = random.random()
if ref_id == 1:
# 80% randomly change token to mask token
if prob < 0.8:
tokens[i] = "[MASK]"
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_mask_tokens(inputs, alphabet, mlm_probability=0.15):\n labels = inputs.clone()\n device = inputs.device\n # We sample a few tokens in each sequence for MLM training\n # (with probability `self.mlm_probability`)\n probability_matrix = torch.full(labels.shape, mlm_probability,\n ... | [
"0.72398764",
"0.6995237",
"0.68272895",
"0.6822052",
"0.6789064",
"0.66487736",
"0.66257054",
"0.6620122",
"0.65425634",
"0.65218735",
"0.65218115",
"0.64321506",
"0.6338301",
"0.6281222",
"0.6238888",
"0.606579",
"0.5929544",
"0.590163",
"0.5832555",
"0.5821377",
"0.5756936... | 0.62538826 | 14 |
Tokenizes text for pretraining fast | def tokenize_fast(self, text):
ref_ids = prepare_ref([text], self.tokenizer_ltp, self.tokenizer_cn)
tokens = self.tokenizer_cn.tokenize(text)
ref_ids = cn_whole_word_mask(tokens, ref_ids[0])
tokens, labels = random_word_wwm(tokens, ref_ids, self.tokenizer_cn)
input_ids = self... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pre_process(text):\n # replace (,.'\") with ''\n text = text.replace(',', '')\n text = text.replace('.', '')\n text = text.replace(\"'\", '')\n text = text.replace(\"\\\"\", '')\n\n # tokenize into words\n tokens = [word for sent in sent_tokenize(text) for word in word_tokenize(sent)]\n\n ... | [
"0.761084",
"0.7487242",
"0.7473724",
"0.7417983",
"0.7393427",
"0.7381722",
"0.7375605",
"0.73472124",
"0.7334791",
"0.73288685",
"0.7294211",
"0.71877694",
"0.7152752",
"0.7149783",
"0.71439195",
"0.71402186",
"0.7126123",
"0.7123565",
"0.7099908",
"0.70952654",
"0.70804876... | 0.7116974 | 18 |
Make the model object behave like a dict. | def update(self, values):
for k, v in values.items():
setattr(self, k, v) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_basedict(self):\n tester = BaseModel()\n self.assertTrue(dict, type(tester.to_dict()))",
"def to_dict_model(self) -> dict:\n return dict((key, getattr(self, key)) for key in self.__mapper__.c.keys())",
"def dict(self) -> Dict:\r\n return super().dict()",
"def dict(self) -> Di... | [
"0.7156991",
"0.70300174",
"0.6915193",
"0.6915193",
"0.68749535",
"0.68191147",
"0.6766341",
"0.6752122",
"0.66892827",
"0.6662648",
"0.66206944",
"0.65513957",
"0.6487081",
"0.6468018",
"0.6455899",
"0.6440813",
"0.6429715",
"0.6374103",
"0.63627994",
"0.635863",
"0.6354428... | 0.0 | -1 |
Make the model object behave like a dict. Includes attributes from joins. | def _as_dict(self):
local = dict((key, value) for key, value in self)
joined = dict([(k, v) for k, v in self.__dict__.items() if not k[0] == '_'])
local.update(joined)
return local | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_dict_model(self) -> dict:\n return dict((key, getattr(self, key)) for key in self.__mapper__.c.keys())",
"def to_dict(self):\n\n # Check if is the right instance.\n if isinstance(self, db.Model):\n # construct a dictionary from column names and values.\n dict_represe... | [
"0.70385915",
"0.666341",
"0.6465881",
"0.6449412",
"0.6448221",
"0.624454",
"0.624454",
"0.624454",
"0.624454",
"0.6240828",
"0.6209597",
"0.62063193",
"0.61831933",
"0.6181241",
"0.61705804",
"0.6137681",
"0.61370254",
"0.6117289",
"0.61125255",
"0.61003816",
"0.60861963",
... | 0.61745274 | 14 |
Make the model object behave like a dict. | def items(self):
return self._as_dict().items() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_basedict(self):\n tester = BaseModel()\n self.assertTrue(dict, type(tester.to_dict()))",
"def to_dict_model(self) -> dict:\n return dict((key, getattr(self, key)) for key in self.__mapper__.c.keys())",
"def dict(self) -> Dict:\r\n return super().dict()",
"def dict(self) -> Di... | [
"0.7156991",
"0.70300174",
"0.6915193",
"0.6915193",
"0.68749535",
"0.68191147",
"0.6766341",
"0.6752122",
"0.66892827",
"0.6662648",
"0.66206944",
"0.65513957",
"0.6487081",
"0.6468018",
"0.6455899",
"0.6440813",
"0.6429715",
"0.6374103",
"0.63627994",
"0.635863",
"0.6354428... | 0.0 | -1 |
Make the model object behave like a dict. | def keys(self):
return [key for key, value in self.items()] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_basedict(self):\n tester = BaseModel()\n self.assertTrue(dict, type(tester.to_dict()))",
"def to_dict_model(self) -> dict:\n return dict((key, getattr(self, key)) for key in self.__mapper__.c.keys())",
"def dict(self) -> Dict:\r\n return super().dict()",
"def dict(self) -> Di... | [
"0.7156991",
"0.70300174",
"0.6915193",
"0.6915193",
"0.68749535",
"0.68191147",
"0.6766341",
"0.6752122",
"0.66892827",
"0.6662648",
"0.66206944",
"0.65513957",
"0.6487081",
"0.6468018",
"0.6455899",
"0.6440813",
"0.6429715",
"0.6374103",
"0.63627994",
"0.635863",
"0.6354428... | 0.0 | -1 |
Create a date stamp in `YYYY.MM.DD` format | def date_stamp():
return datetime.fromtimestamp(time()).strftime('%Y.%m.%d') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def createTimeStamp_Date():\r\n\r\n return str(datetime.now().strftime(\"%Y%m%d\"))",
"def _create_time_stamp() -> str:\n\n return datetime.datetime.now().strftime(\"%Y%m%d\")",
"def timestamp(): \n timestamp = datetime.today().strftime('%Y-%m-%d')\n \n return timestamp",
"def _generate_ti... | [
"0.72115386",
"0.70491153",
"0.67339337",
"0.6568617",
"0.65210354",
"0.648998",
"0.6414228",
"0.6369776",
"0.6287706",
"0.628564",
"0.62490517",
"0.6230516",
"0.62298757",
"0.62216735",
"0.62049425",
"0.62000537",
"0.61752015",
"0.6162914",
"0.61561304",
"0.61438173",
"0.614... | 0.7991279 | 0 |
Remove spaces from string | def strip_space(string):
return string.replace(' ', '') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _clean(self, string):\n return re.sub('\\s+', ' ', string).strip()",
"def _clean(s):\n return re.sub(r'\\s+', ' ', s.strip())",
"def normalize_space (text):\n return RE_WS.sub (' ', text.strip ())",
"def strip_string(input):\n return input.lower().replace(\" \", \"\")",
"def remove_spac... | [
"0.8310581",
"0.8238624",
"0.81268764",
"0.8120203",
"0.8060197",
"0.8060197",
"0.80022186",
"0.7995755",
"0.7936008",
"0.7922126",
"0.78820735",
"0.78219277",
"0.7796138",
"0.77705383",
"0.7741941",
"0.7707952",
"0.7705342",
"0.77037746",
"0.7632682",
"0.7605174",
"0.7555755... | 0.868651 | 0 |
Convert string to float/int if possible (designed to extract number from a price sting, e.g. 250 EUR > 250) | def string_to_digit(string, output):
string = strip_space(string)
if not string[0].isdigit() and not string[1].isdigit():
return None
string_items = []
for index, item in enumerate(string):
if item.isdigit():
string_items.append(item)
else:
if item == ','... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def string_to_number(s):\n\n if type(s).__name__==\"str\":\n s = s.strip()\n if s ==\"-\":\n s = 0\n else:\n s = s.replace(\",\",\"\").replace(\"$\",\"\")\n if s.find(\"(\")>=0 and s.find(\")\")>=0:\n s = s.replace(\"(\",\"-\").replace(\")\",\... | [
"0.78137314",
"0.76550496",
"0.7595723",
"0.7486487",
"0.7467063",
"0.73929125",
"0.7373212",
"0.7359088",
"0.7338691",
"0.73267406",
"0.7325711",
"0.7325567",
"0.7318711",
"0.7202625",
"0.7193438",
"0.7188898",
"0.71598786",
"0.71511465",
"0.7136185",
"0.71309143",
"0.709854... | 0.6528663 | 62 |
Get float decimal precision | def float_precision(float_number):
decimal = str(float_number).split('.')[-1]
return len(decimal) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_precision(self):\n ...",
"def precision(self):\n tpos, fpos = len(self.__true_positives), len(self.__false_positives)\n return float(tpos) / (tpos + fpos)",
"def get_precision(TP, FP):\n precision = TP / (TP + FP)\n return precision",
"def _prec(self):\n prec = int(self.... | [
"0.7749543",
"0.7588651",
"0.75266516",
"0.7511785",
"0.7494172",
"0.74072754",
"0.72116446",
"0.71588767",
"0.7125477",
"0.7118032",
"0.7118032",
"0.6918683",
"0.6910011",
"0.6908712",
"0.6811989",
"0.67898273",
"0.67779183",
"0.67704475",
"0.67704475",
"0.67557555",
"0.6710... | 0.7039923 | 11 |
Load an AXJSON string from file. | def load(file, **kwargs):
extension = os.path.splitext(file)
if extension not in {'.json', '.axjson'}:
raise RuntimeError('Given extension ({}) not supported'.format(extension))
with open(file) as f:
data = json.load(f)
if extension == '.json':
return data
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_file(filename):\n # in order to complete this lab we are going to use the python lib json in which we have the function json.loads\n # which will automatically load a json from a string\n f = open(filename, 'r')\n string = f.read()\n return json.loads(string)",
"def lo... | [
"0.74248743",
"0.7421141",
"0.72266936",
"0.7194867",
"0.71056324",
"0.7095098",
"0.70735717",
"0.7071148",
"0.7062761",
"0.7057769",
"0.7013723",
"0.69914967",
"0.6988031",
"0.69874483",
"0.69535404",
"0.69339085",
"0.69319695",
"0.69204426",
"0.688412",
"0.68759584",
"0.686... | 0.6974349 | 14 |
Load an AXJSON string. | def loads(string, **kwargs):
string = substitutes(string, **kwargs)
return json.loads(string) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_json(json_str):\n return _api_internal._load_json(json_str)",
"def json_loads(self, string: str) -> object:\n return json.loads(string)",
"def test_loader_loads_from_str():\n base_json = '{\"foo\": \"bar\"}'\n json_test = {\"foo\": \"bar\"}\n assert whenzat.loader(base_json, from_fi... | [
"0.7149268",
"0.7059853",
"0.6998435",
"0.6987914",
"0.6956995",
"0.6956431",
"0.6939345",
"0.6821695",
"0.6797675",
"0.66472405",
"0.661415",
"0.65726197",
"0.65375847",
"0.65037864",
"0.6493634",
"0.6493634",
"0.6493634",
"0.6466554",
"0.6463728",
"0.64627653",
"0.6455392",... | 0.6400999 | 24 |
Test 'syslog_bsd' with no data | def test_syslog_bsd_nodata(self):
self.assertEqual(jc.parsers.syslog_bsd.parse('', quiet=True), []) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_syslog_bsd_sample(self):\n self.assertEqual(jc.parsers.syslog_bsd.parse(self.syslog, quiet=True), self.syslog_json)",
"def test_syslog_shortcut_simple(self):\n with cleanup_handlers():\n expected_message = random_string(50)\n coloredlogs.install(syslog=True)\n ... | [
"0.8114864",
"0.73499095",
"0.714779",
"0.6932098",
"0.60125524",
"0.5995677",
"0.5884359",
"0.58819526",
"0.5869912",
"0.5748948",
"0.57362247",
"0.56586576",
"0.5595454",
"0.5549938",
"0.551957",
"0.5502301",
"0.54979366",
"0.54829013",
"0.5482012",
"0.54362947",
"0.5433371... | 0.83931804 | 0 |
Gets a collection of `InputExample`s for the train set. | def get_train_examples(self, data_dir):
raise NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_train_inputs(self, example):\n return example",
"def get_train_examples(self):\n raise NotImplementedError()",
"def get_train_examples(self, input_file):\r\n raise NotImplementedError()",
"def _create_examples(self, data, set_type):\n examples = []\n for (i, elem) in en... | [
"0.73499966",
"0.7173421",
"0.7126833",
"0.65602446",
"0.64204013",
"0.64052176",
"0.63422555",
"0.6290186",
"0.6282746",
"0.625262",
"0.62499267",
"0.6233708",
"0.62225735",
"0.62225735",
"0.6205607",
"0.6205607",
"0.6205607",
"0.6205607",
"0.6205607",
"0.6205607",
"0.620560... | 0.62466323 | 16 |
Gets a collection of `InputExample`s for the dev set. | def get_dev_examples(self, data_dir):
raise NotImplementedError() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_dev_examples(self, input_file):\r\n raise NotImplementedError()",
"def get_train_inputs(self, example):\n return example",
"def get_examples(self, env):\n return self.fam.c_get_examples(self, env)",
"def get_dev_examples(self):\n raise NotImplementedError()",
"def _create_ex... | [
"0.68112403",
"0.6588688",
"0.655683",
"0.6552607",
"0.64272827",
"0.63816285",
"0.6255956",
"0.61930686",
"0.61160946",
"0.6094262",
"0.6054992",
"0.6051947",
"0.5989807",
"0.5927489",
"0.5922901",
"0.5920675",
"0.59200704",
"0.59155166",
"0.59155166",
"0.59155166",
"0.59155... | 0.5994604 | 19 |
Create / Configure flask socket application instance. | def create_app(node_id, debug=False, database_url=None):
app = Flask(__name__)
app.debug = debug
app.config["SECRET_KEY"] = "justasecretkeythatishouldputhere"
# Enable persistent mode
# Overwrite syft.object_storage methods to work in a persistent way
# Persist models / tensors
if database... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_app(self):\r\n self.app = Flask(__name__, instance_relative_config=True)\r\n\r\n # Init the secret key of the app -it is a must for flask to run\r\n self.app.config.from_mapping(\r\n SECRET_KEY='!ZNeverSayNever116Z!',\r\n MONGODB_SETTINGS= {'host': 'mongodb://l... | [
"0.7278274",
"0.71779203",
"0.71189386",
"0.7069282",
"0.7014822",
"0.699415",
"0.69914824",
"0.6956802",
"0.6903401",
"0.68889064",
"0.68463856",
"0.67374223",
"0.67195284",
"0.6699444",
"0.6695996",
"0.6691832",
"0.668738",
"0.664961",
"0.66402286",
"0.6636195",
"0.66334933... | 0.6430299 | 44 |
Creates and saves a User with the given username, email and password. | def _create_user(self, username, email, password,
is_staff, is_superuser, **extra_fields):
now = timezone.now()
if not username:
raise ValueError('The given username must be set')
email = self.normalize_email(email)
user = self.model(username=username, em... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_user(self, email, password,username, **extra_fields):\r\n if not email:\r\n raise ValueError('The given email must be set')\r\n if not username:\r\n raise ValueError('The given username must be set')\r\n email = self.normalize_email(email)\r\n user = se... | [
"0.86018157",
"0.84706366",
"0.8462776",
"0.8417308",
"0.8413365",
"0.839183",
"0.8346418",
"0.83453476",
"0.8314481",
"0.8306914",
"0.8288764",
"0.827679",
"0.8270353",
"0.82577944",
"0.8213095",
"0.81978804",
"0.8175898",
"0.81719273",
"0.8164025",
"0.8162915",
"0.8138058",... | 0.7812763 | 98 |
Returns the first_name plus the last_name, with a space in between. | def get_full_name(self):
full_name = '%s %s' % (self.first_name, self.last_name)
return full_name.strip() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def full_name(first_name, last_name):\n return first_name + \" \" + last_name",
"def full_name(first_name, last_name):\n\t\n\treturn first_name + \" \" + last_name",
"def get_formated_name(first_name,last_name):\n\tfull_name = first_name + '' + last_name\n\treturn full_name.title()",
"def get_full_name(se... | [
"0.8313066",
"0.82006806",
"0.8049215",
"0.80409706",
"0.8017754",
"0.7999701",
"0.79541886",
"0.7942144",
"0.7942144",
"0.7942144",
"0.7937664",
"0.79287225",
"0.7921711",
"0.790314",
"0.7892264",
"0.7890117",
"0.7878668",
"0.786143",
"0.78528684",
"0.7823523",
"0.7813124",
... | 0.77466476 | 48 |
Partitions list into chunks of a given size. | def chunked(list_: List, chunksize: int=20) -> List[List]:
chunks: List[List] = []
for i in range(0, len(list_), chunksize):
chunks.append(list_[i:i + chunksize])
return chunks | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def split_chunk(list, chunk_size):\n for i in range(0, len(list), chunk_size):\n yield list[i:i + chunk_size]",
"def split_to_chunks(of_list, chunk_size):\n assert of_list is not None\n\n for i in range(0, len(of_list), chunk_size):\n yield of_list[i:i + chunk_size]",
"def chunks... | [
"0.8334214",
"0.81209314",
"0.8087246",
"0.79734325",
"0.7957527",
"0.79523337",
"0.791073",
"0.78604645",
"0.7748277",
"0.771706",
"0.7702818",
"0.75589657",
"0.7540729",
"0.7523789",
"0.7517376",
"0.75007874",
"0.74898887",
"0.7488238",
"0.7438908",
"0.74358684",
"0.743486"... | 0.7597529 | 11 |
Return a string representation of the ZFSObject. | def __str__(self):
return unicode(self).encode('utf-8') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dumps(self, obj):\n # Most of the work is done in _serialize, but we have to tack on\n # the stop instruction after it all.\n return self.serialize(obj) + '.'",
"def toString(self, obj):\n return Box(shareID=obj.shareID.encode('utf-8'),\n localpart=obj.localpart.... | [
"0.6940503",
"0.67266965",
"0.6649267",
"0.64493996",
"0.6443176",
"0.6390305",
"0.63856226",
"0.6377745",
"0.6369319",
"0.633863",
"0.6328441",
"0.6313356",
"0.6293756",
"0.62915975",
"0.6285299",
"0.6259597",
"0.62520397",
"0.620446",
"0.6184525",
"0.61715204",
"0.61715204"... | 0.0 | -1 |
Checks whether two line segments, each defined by two end points, will intersect. | def intersects(a0, a1, b0, b1):
# First line is vertical
if a0[0] == a1[0]:
# Both lines are vertical
if b0[0] == b1[0]:
return (a0[0] == b0[0]) and (in_range(b0[1], a0[1], a1[1]) or in_range(b1[1], a0[1], a1[1]))
eqn = get_eqn(b0, b1)
y = apply_eqn(eqn, a0[0])
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def intersects(self):\n match = False\n for i in range(len(self.__points) - 1):\n p1 = self.__points[i]\n p2 = self.__points[i + 1]\n bounds = self.__line_segment(p1, p2)\n if not bounds is None:\n xmin = bounds[0]\n ymin = bounds[1]\n xmax = bounds[0]\n ymax =... | [
"0.79861605",
"0.796072",
"0.78962195",
"0.7878628",
"0.7784153",
"0.77600104",
"0.7726184",
"0.76562107",
"0.74979556",
"0.7466333",
"0.7346095",
"0.7319165",
"0.73001945",
"0.7266084",
"0.7260472",
"0.72478867",
"0.7220036",
"0.72112364",
"0.71863985",
"0.7180507",
"0.71608... | 0.8077527 | 0 |
Get the absolute expiration time for a response, applying URL patterns if available | def get_expiration_date(self, response: ClientResponse) -> Optional[datetime]:
try:
expire_after = self._get_expiration_for_url(response)
except Exception:
expire_after = self.expire_after
return None if expire_after is None else datetime.utcnow() + expire_after | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_expiration_for_url(self, response: ClientResponse) -> Optional[timedelta]:\n for pattern, expire_after in self.expire_after_urls.items():\n if glob_match(_base_url(response.url), pattern):\n logger.debug(f'URL {response.url} matched pattern \"{pattern}\": {expire_after}')\... | [
"0.77470225",
"0.6808722",
"0.6315388",
"0.6272531",
"0.6226552",
"0.61878306",
"0.6130656",
"0.6126645",
"0.61227036",
"0.60825044",
"0.6062179",
"0.6051897",
"0.6046145",
"0.6025793",
"0.5982068",
"0.5974371",
"0.59007597",
"0.588384",
"0.58533776",
"0.58466953",
"0.5822685... | 0.6721955 | 2 |
Get the relative expiration time matching the specified URL, if any. If there is no match, raise a ``ValueError`` to differentiate beween this case and a matching pattern with ``expire_after=None`` | def _get_expiration_for_url(self, response: ClientResponse) -> Optional[timedelta]:
for pattern, expire_after in self.expire_after_urls.items():
if glob_match(_base_url(response.url), pattern):
logger.debug(f'URL {response.url} matched pattern "{pattern}": {expire_after}')
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_expiration_date(self, response: ClientResponse) -> Optional[datetime]:\n try:\n expire_after = self._get_expiration_for_url(response)\n except Exception:\n expire_after = self.expire_after\n return None if expire_after is None else datetime.utcnow() + expire_after... | [
"0.6163386",
"0.6090519",
"0.5992412",
"0.59868395",
"0.5901658",
"0.5859716",
"0.5850323",
"0.57985574",
"0.5746856",
"0.5733486",
"0.56452775",
"0.5578208",
"0.55672175",
"0.5538701",
"0.5531233",
"0.5507477",
"0.54516244",
"0.54516244",
"0.54184306",
"0.53662246",
"0.52619... | 0.7894576 | 0 |
Returns the type of the detector type used in the tally. | def getDetectorType(self,short=False):
if not short:
return self.detectorTypeList[self.detectorType]
elif short and self.radiograph:
return self.detectorTypeList[self.detectorType + 3]
elif short and self.mesh:
return self.detectorTypeList[self.detectorType - 3] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_perfcount_type(self):\n return self._perfcount_type",
"def _type(self):\n return self._id[1]",
"def get_spec_type(self):\r\n return self._spec_type",
"def type(self):\n return self._device.type_name",
"def get_type(self):\n return self.type",
"def get_type(self)... | [
"0.68209916",
"0.6759823",
"0.6650719",
"0.6578477",
"0.65732616",
"0.65732616",
"0.65444016",
"0.65444016",
"0.6538729",
"0.6537474",
"0.6524749",
"0.65238047",
"0.65238047",
"0.65238047",
"0.65238047",
"0.65238047",
"0.65238047",
"0.65238047",
"0.65238047",
"0.65238047",
"0... | 0.6447093 | 63 |
Returns the number of bins relative to the desired axis. The correspondence is, as usual, (f,d,u,s,m,c,e,t) for standard 8D data, plus (i,j,k) for mesh tallies. | def getNbins(self,axis,includeTotalBin = True):
if axis == "f":
nCells = 1 if self.nCells == 0 else self.nCells
return nCells
if axis == "i":
return self.meshInfo[1]
if axis == "j":
return self.meshInfo[2]
if axis == "k":
return self.meshInfo[3]
if axis == "d":
nDir = 1 if self.nDir == ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getBinSize(axes, bin_numbers):\n\n size = 1\n for axis, bin_number in zip(axes, bin_numbers):\n if bin_number in (\"underflow\", \"overflow\"):\n continue\n x0, x1 = axis.getBinRange(bin_number)\n size *= x1 - x0\n return size",
"def bin_width(self):\n return s... | [
"0.7353562",
"0.7205327",
"0.6915319",
"0.652132",
"0.652132",
"0.6507314",
"0.64550245",
"0.6427048",
"0.6385898",
"0.6331704",
"0.6310464",
"0.629466",
"0.6285278",
"0.6281168",
"0.6261638",
"0.62614894",
"0.6254845",
"0.62311447",
"0.62261003",
"0.6221479",
"0.62144303",
... | 0.71826434 | 2 |
Return required map data for use in Google maps. | def mapdata(self):
return {
'lat': str(self.location.latitude),
'lng': str(self.location.longitude),
'options': {
'icon': self.species.marker.url
},
'data': {
'href': str(self.get_absolute_url())
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_data(self) -> Tuple[PoliciesMap, ZonesMap, LinksMap]:\n return self.policies_map, self.zones_map, self.links_map",
"def get_map(self):\n return self.map",
"def mapdata():\n return getmapdata(db, MyTable)",
"def get_map(self):\n return self.get_raw_ys()",
"def get_mapdata():\... | [
"0.6948525",
"0.67924017",
"0.66954994",
"0.6690142",
"0.6622162",
"0.6499347",
"0.6456643",
"0.6435143",
"0.64274293",
"0.6408059",
"0.6395554",
"0.6391359",
"0.6195452",
"0.6082148",
"0.60652393",
"0.60634816",
"0.60386384",
"0.59405565",
"0.593953",
"0.5867089",
"0.5839402... | 0.68733096 | 1 |
Read in a text file and split on texts, producing list of lists. | def split_data(lines_in):
rows = []
for line in lines_in:
field = []
for i in line.split("\t"):
field.append(i)
rows.append(field)
rows = rows[1:] # strip header
return rows | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getlistfromtext(self,filename):\n l=[]\n\n if self.encoding:\n f = codecs.open(filename,\"r\",encoding=self.encoding)\n for line in f:\n l.append(line.rstrip())\n f.close()\n\n else:\n f = open(filename,\"r\")\n for line... | [
"0.76778513",
"0.7582347",
"0.7507679",
"0.7430819",
"0.73867154",
"0.7344569",
"0.73204017",
"0.72556806",
"0.71832883",
"0.7028821",
"0.70010245",
"0.6979072",
"0.6977877",
"0.69595337",
"0.6949279",
"0.69492173",
"0.69153875",
"0.688636",
"0.6871501",
"0.6838152",
"0.68362... | 0.0 | -1 |
Return whether cell has been played or not. | def is_empty(self):
return self.content is None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def playable(self, cell):\n \n return self.cells[cell] is None",
"def is_game_won(self):\n return True",
"def check_for_tie(self):\n\n\t\tif len(self.player_model.available_cells) > 0:\n\t\t\treturn False\n\t\telse:\n\t\t\treturn True",
"def has_won(board, player):\r\n return False",
... | [
"0.8226661",
"0.71537334",
"0.71423227",
"0.7098788",
"0.7068022",
"0.7055993",
"0.7027787",
"0.7026404",
"0.70060176",
"0.69290984",
"0.6904199",
"0.68803936",
"0.686787",
"0.68661124",
"0.6864804",
"0.6864804",
"0.68363947",
"0.6802465",
"0.6784152",
"0.6767223",
"0.6744712... | 0.0 | -1 |
Create the name of the dagfile. Here dagfilename and dagid are equal. | def get_filepath(self, **kwargs) -> str:
return f'dag_{self.dag_id}.py' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def file_name(id, title, kind=\"src\"):\n fn_template = conf.template_source_file_name\n if kind == \"tst\":\n fn_template = conf.template_test_file_name\n\n return fn_template.format(id=id, title=title.replace(\"-\", \"_\"))",
"def _filename(task_id):\n return \"{}.json\".format(task_id)"... | [
"0.6607938",
"0.6455492",
"0.6442134",
"0.63638234",
"0.6360817",
"0.6323717",
"0.6268085",
"0.6216823",
"0.61841655",
"0.6096074",
"0.6076574",
"0.6055444",
"0.6037976",
"0.5969476",
"0.5944159",
"0.5936554",
"0.59322774",
"0.5909013",
"0.58737123",
"0.58667916",
"0.58667105... | 0.7125821 | 0 |
initializes an instance of AutoPKColumn. | def __init__(self, *args, **kwargs):
args = list(args)
name, type_ = self._extract_name_and_type(args, kwargs)
if type_ is None:
type_ = self.DEFAULT_TYPE
is_variant = isinstance(type_, Variant)
if not misc_utils.is_subclass_or_instance(type_, Integer) and \
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n\t\tsuper().__init__(self.TABLE_NAME, self.PRIMARY_KEY)",
"def __init__(self,\r\n primary_key=False,\r\n index=False,\r\n db_field=None,\r\n default=None,\r\n required=False,\r\n save_strategy=Non... | [
"0.66918254",
"0.6521233",
"0.6413484",
"0.5774195",
"0.57210267",
"0.55706245",
"0.5553725",
"0.55529994",
"0.5549547",
"0.5536598",
"0.54911035",
"0.5481343",
"0.54543424",
"0.5433994",
"0.54313385",
"0.5420253",
"0.540601",
"0.53140867",
"0.529627",
"0.52736",
"0.5230047",... | 0.6920747 | 0 |
initializes an instance of FKColumn. | def __init__(self, *args, **kwargs):
self._fk = kwargs.pop('fk', None)
self._fk_on_update = kwargs.pop('fk_on_update', None)
self._fk_on_delete = kwargs.pop('fk_on_delete', None)
kwargs.setdefault('index', True)
kwargs.setdefault('nullable', False)
super().__init__(*ar... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, name=None, related_entity_id_column=None):\n \n self.name = name\n self.related_entity_id_column = related_entity_id_column",
"def __init__(self,\r\n primary_key=False,\r\n index=False,\r\n db_field=None,\r\n ... | [
"0.62952536",
"0.6237951",
"0.62212753",
"0.6192258",
"0.61161536",
"0.59109443",
"0.5850205",
"0.5795181",
"0.5670945",
"0.56551814",
"0.5588184",
"0.5529657",
"0.54587996",
"0.5438781",
"0.5415387",
"0.5400687",
"0.5399623",
"0.5381393",
"0.53749794",
"0.5352867",
"0.532967... | 0.627221 | 1 |
initializes an instance of HiddenColumn. | def __init__(self, *args, **kwargs):
kwargs.update(allow_read=False)
kwargs.update(allow_write=False)
super().__init__(*args, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init_hidden(self):\n pass",
"def init_hidden(self):\n pass",
"def init_hidden(self):\n h0 = torch.zeros(self.num_layers, self.batch_size, self.hidden_size)\n\n return h0 # a parameter tensor of shape (self.num_layers, self.batch_size, self.hidden_size)",
"def __init__(self, h... | [
"0.6550948",
"0.6550948",
"0.6219032",
"0.6208034",
"0.6151538",
"0.58533937",
"0.58254105",
"0.5736058",
"0.5699293",
"0.5690701",
"0.56834036",
"0.5642732",
"0.5640911",
"0.561327",
"0.56078595",
"0.55999464",
"0.5572959",
"0.5572959",
"0.55693567",
"0.55693567",
"0.5569356... | 0.0 | -1 |
Test finding symmetries of operator without symmetries. Should return empty symmetry | def test_find_z2_symmetries_op_without_sym(self):
qubit_op = SparsePauliOp.from_list(
[
("I", -1.0424710218959303),
("Z", -0.7879673588770277),
("X", -0.18128880821149604),
]
)
z2_symmetries = Z2Symmetries.find_z2_symmetries... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_find_z2_symmetries_empty_op(self):\n qubit_op = SparsePauliOp.from_list([(\"II\", 0.0)])\n z2_symmetries = Z2Symmetries.find_z2_symmetries(qubit_op)\n self.assertTrue(z2_symmetries.is_empty())",
"def find_Z2_symmetries(cls, operator: PauliSumOp) -> \"Z2Symmetries\":\n pauli_s... | [
"0.70889777",
"0.645457",
"0.6423835",
"0.63496923",
"0.63187045",
"0.62797415",
"0.6279505",
"0.62645376",
"0.61872584",
"0.6086566",
"0.6040597",
"0.6031987",
"0.59890413",
"0.5936181",
"0.59239954",
"0.5916298",
"0.59038275",
"0.58930904",
"0.5847929",
"0.5814645",
"0.5786... | 0.7489047 | 0 |
The region instance group manager this instance config is part of. | def region_instance_group_manager(self) -> pulumi.Input[str]:
return pulumi.get(self, "region_instance_group_manager") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def region_instance_group_manager(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"region_instance_group_manager\")",
"def region_instance_group_manager(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"region_instance_group_manager\")",
"def instance_group(self):\n ... | [
"0.84875405",
"0.83289313",
"0.711908",
"0.6636743",
"0.6619557",
"0.6549893",
"0.6521835",
"0.640504",
"0.6383301",
"0.6380577",
"0.62642086",
"0.6234054",
"0.62199885",
"0.6201708",
"0.6201708",
"0.6201708",
"0.61523896",
"0.6139028",
"0.6120763",
"0.6113928",
"0.6061341",
... | 0.8419484 | 1 |
The name for this perinstance config and its corresponding instance. | def name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self.config[\"name\"]",
"def name(self):\n return self._config_name",
"def getname(self):\n if self.instance is not None:\n return '%s_%s' % (self.name,self.instance)\n else:\n return self.name",
"def name(self):\n return f'{se... | [
"0.7921268",
"0.77886087",
"0.76010334",
"0.75972843",
"0.74883515",
"0.745722",
"0.745722",
"0.7432947",
"0.742261",
"0.73406494",
"0.723465",
"0.71910524",
"0.70794725",
"0.70407206",
"0.70396584",
"0.70396584",
"0.70396584",
"0.70396584",
"0.70396584",
"0.70396584",
"0.703... | 0.0 | -1 |
The preserved state for this instance. Structure is documented below. | def preserved_state(self) -> Optional[pulumi.Input['RegionPerInstanceConfigPreservedStateArgs']]:
return pulumi.get(self, "preserved_state") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def state(self):\n return self._state.copy()",
"def __getstate__(self) -> Dict[str, Any]:\n s = self.__dict__.copy()\n # Kill the parent ref. It won't pickle well.\n s[\"_parent\"] = None\n return s",
"def get_state(self):\n return copy.deepcopy(self._state)",
"def _... | [
"0.752546",
"0.73399615",
"0.7336629",
"0.7320218",
"0.7305965",
"0.72662914",
"0.7224578",
"0.720459",
"0.7195773",
"0.7165739",
"0.7153303",
"0.71179336",
"0.7106083",
"0.70733476",
"0.7043706",
"0.7011242",
"0.7011242",
"0.69893044",
"0.69844514",
"0.6969824",
"0.694819",
... | 0.0 | -1 |
The name for this perinstance config and its corresponding instance. | def name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self.config[\"name\"]",
"def name(self):\n return self._config_name",
"def getname(self):\n if self.instance is not None:\n return '%s_%s' % (self.name,self.instance)\n else:\n return self.name",
"def name(self):\n return f'{se... | [
"0.7921268",
"0.77886087",
"0.76010334",
"0.75972843",
"0.74883515",
"0.745722",
"0.745722",
"0.7432947",
"0.742261",
"0.73406494",
"0.723465",
"0.71910524",
"0.70794725",
"0.70407206",
"0.70396584",
"0.70396584",
"0.70396584",
"0.70396584",
"0.70396584",
"0.70396584",
"0.703... | 0.0 | -1 |
The preserved state for this instance. Structure is documented below. | def preserved_state(self) -> Optional[pulumi.Input['RegionPerInstanceConfigPreservedStateArgs']]:
return pulumi.get(self, "preserved_state") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def state(self):\n return self._state.copy()",
"def __getstate__(self) -> Dict[str, Any]:\n s = self.__dict__.copy()\n # Kill the parent ref. It won't pickle well.\n s[\"_parent\"] = None\n return s",
"def get_state(self):\n return copy.deepcopy(self._state)",
"def _... | [
"0.752546",
"0.73399615",
"0.7336629",
"0.7320218",
"0.7305965",
"0.72662914",
"0.7224578",
"0.720459",
"0.7195773",
"0.7165739",
"0.7153303",
"0.71179336",
"0.7106083",
"0.70733476",
"0.7043706",
"0.7011242",
"0.7011242",
"0.69893044",
"0.69844514",
"0.6969824",
"0.694819",
... | 0.0 | -1 |
The region instance group manager this instance config is part of. | def region_instance_group_manager(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "region_instance_group_manager") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def region_instance_group_manager(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"region_instance_group_manager\")",
"def region_instance_group_manager(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"region_instance_group_manager\")",
"def instance_group(self):\n return se... | [
"0.84875405",
"0.8419484",
"0.711908",
"0.6636743",
"0.6619557",
"0.6549893",
"0.6521835",
"0.640504",
"0.6383301",
"0.6380577",
"0.62642086",
"0.6234054",
"0.62199885",
"0.6201708",
"0.6201708",
"0.6201708",
"0.61523896",
"0.6139028",
"0.6120763",
"0.6113928",
"0.6061341",
... | 0.83289313 | 2 |
Get an existing RegionPerInstanceConfig resource's state with the given name, id, and optional extra properties used to qualify the lookup. | def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
minimal_action: Optional[pulumi.Input[str]] = None,
most_disruptive_allowed_action: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n auto_healing_policies: Optional[pulumi.Input[pulumi.InputType['RegionInstanceGroupManagerAutoHealingPoliciesArgs']]] = None,\n base_instance_name: Optional[pulumi.Inpu... | [
"0.58944273",
"0.5708766",
"0.55635357",
"0.552322",
"0.551305",
"0.54242986",
"0.5369279",
"0.536327",
"0.53003675",
"0.52842146",
"0.52307206",
"0.51734614",
"0.5171641",
"0.5153289",
"0.51435804",
"0.51220214",
"0.5104368",
"0.51011133",
"0.5097255",
"0.5086163",
"0.507807... | 0.7881635 | 0 |
The name for this perinstance config and its corresponding instance. | def name(self) -> pulumi.Output[str]:
return pulumi.get(self, "name") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self.config[\"name\"]",
"def name(self):\n return self._config_name",
"def getname(self):\n if self.instance is not None:\n return '%s_%s' % (self.name,self.instance)\n else:\n return self.name",
"def name(self):\n return f'{se... | [
"0.7921268",
"0.77886087",
"0.76010334",
"0.75972843",
"0.74883515",
"0.745722",
"0.745722",
"0.7432947",
"0.742261",
"0.73406494",
"0.723465",
"0.71910524",
"0.70794725",
"0.70407206",
"0.70396584",
"0.70396584",
"0.70396584",
"0.70396584",
"0.70396584",
"0.70396584",
"0.703... | 0.0 | -1 |
The preserved state for this instance. Structure is documented below. | def preserved_state(self) -> pulumi.Output[Optional['outputs.RegionPerInstanceConfigPreservedState']]:
return pulumi.get(self, "preserved_state") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def state(self):\n return self._state.copy()",
"def __getstate__(self) -> Dict[str, Any]:\n s = self.__dict__.copy()\n # Kill the parent ref. It won't pickle well.\n s[\"_parent\"] = None\n return s",
"def get_state(self):\n return copy.deepcopy(self._state)",
"def _... | [
"0.752546",
"0.73399615",
"0.7336629",
"0.7320218",
"0.7305965",
"0.72662914",
"0.7224578",
"0.720459",
"0.7195773",
"0.7165739",
"0.7153303",
"0.71179336",
"0.7106083",
"0.70733476",
"0.7043706",
"0.7011242",
"0.7011242",
"0.69893044",
"0.69844514",
"0.6969824",
"0.694819",
... | 0.0 | -1 |
The region instance group manager this instance config is part of. | def region_instance_group_manager(self) -> pulumi.Output[str]:
return pulumi.get(self, "region_instance_group_manager") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def region_instance_group_manager(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"region_instance_group_manager\")",
"def region_instance_group_manager(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"region_instance_group_manager\")",
"def instance_group(self):\n ... | [
"0.8419484",
"0.83289313",
"0.711908",
"0.6636743",
"0.6619557",
"0.6549893",
"0.6521835",
"0.640504",
"0.6383301",
"0.6380577",
"0.62642086",
"0.6234054",
"0.62199885",
"0.6201708",
"0.6201708",
"0.6201708",
"0.61523896",
"0.6139028",
"0.6120763",
"0.6113928",
"0.6061341",
... | 0.84875405 | 0 |
Zips supplied iterables and returns a generator. Aggregates `iterables` using `zip` or `itertools.zip_longest`, depending on the value of the `type_longest` parameter. | def _create_zip(*iterables, fillvalue=None, type_longest=False):
if type_longest:
from itertools import zip_longest
zipped = zip_longest(*iterables, fillvalue=fillvalue)
else:
zipped = zip(*iterables)
return zipped | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generic_generator(*args):\n for zips in zip(*args):\n yield zips",
"def roundrobin_generators(*iterables):\n sentinel = object()\n return (item\n for item in itertools.chain.from_iterable(\n zip_longest(*iterables, fillvalue=sentinel))\n if item is not sen... | [
"0.74638236",
"0.70779556",
"0.6920767",
"0.6790071",
"0.6747506",
"0.6538901",
"0.6386911",
"0.62737614",
"0.62320125",
"0.61896706",
"0.61559653",
"0.6154345",
"0.61169636",
"0.6112788",
"0.60699487",
"0.6050951",
"0.599997",
"0.59985965",
"0.59918356",
"0.59469235",
"0.594... | 0.72551274 | 1 |
Attempt to verify `named_tuple` object. | def _verify_named_tuple(named_tuple):
if not bool(
isclass(named_tuple)
and issubclass(named_tuple, tuple)
and callable(named_tuple)
and hasattr(named_tuple, "_fields")
):
raise TypeError(
"named_tuple parameter should be a tuple subclass created "
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_namedtuple(self) -> PossibleResult[T]:\n if isinstance(self.constructor, NamedTupleType):\n if not isinstance(self.obj, Mapping):\n raise DeserializeError(\n Mapping, self.obj, self.new_depth, self.key\n )\n parameters = inspe... | [
"0.68199235",
"0.67301375",
"0.6673667",
"0.6623314",
"0.63967687",
"0.62151116",
"0.6078862",
"0.6021922",
"0.5991719",
"0.5851979",
"0.5774451",
"0.5740202",
"0.57347226",
"0.5712458",
"0.56869173",
"0.56830233",
"0.5672216",
"0.5608439",
"0.55648327",
"0.555728",
"0.555261... | 0.8434493 | 0 |
Computes area of boxes. | def area(boxes):
return (boxes[:, 2] - boxes[:, 0]) * (boxes[:, 3] - boxes[:, 1]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def box_area(boxes):\n return (boxes[:, 2] - boxes[:, 0]) * (boxes[:, 3] - boxes[:, 1])",
"def box_area(boxes):\n return (boxes[:, 2] - boxes[:, 0]) * (boxes[:, 3] - boxes[:, 1])",
"def area(boxes):\n y_min, x_min, y_max, x_max = np.split(boxes, 4, axis=-1)\n return np.squeeze((y_max - y_min) * (x_max ... | [
"0.84715885",
"0.84715885",
"0.84084266",
"0.8369817",
"0.8334332",
"0.81802857",
"0.80124605",
"0.79808813",
"0.7970544",
"0.7858747",
"0.78092647",
"0.7688126",
"0.7576553",
"0.7440499",
"0.73104835",
"0.72514987",
"0.72302496",
"0.7130858",
"0.71270365",
"0.7125084",
"0.71... | 0.830171 | 5 |
Computes pairwise intersectionoverarea between box collections. Intersectionoverarea (ioa) between two boxes box1 and box2 is defined as their intersection area over box2's area. Note that ioa is not symmetric, that is, IOA(box1, box2) != IOA(box2, box1). | def ioa(boxes1, boxes2):
intersect = intersection(boxes1, boxes2)
areas = np.expand_dims(area(boxes2), axis=0)
return intersect / areas | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ioa(boxes1: np.array, boxes2: np.array) -> np.array:\n\n inter = intersection(boxes1, boxes2)\n area2 = area(boxes2)\n\n return inter / area2",
"def compute_iou(box, boxes, box_area, boxes_area):\n # Calculate intersection areas\n y1 = np.maximum(box[0], boxes[:, 0])\n y2 = np.minimum(box[2... | [
"0.7800874",
"0.7426347",
"0.7426347",
"0.7426347",
"0.7415929",
"0.74117863",
"0.7400198",
"0.73683995",
"0.73683995",
"0.73171073",
"0.7250476",
"0.7231404",
"0.71596044",
"0.71454203",
"0.7111889",
"0.7065369",
"0.702324",
"0.70060414",
"0.6958022",
"0.684861",
"0.6821698"... | 0.7882489 | 0 |
Determines if the date is a holiday or not. | def holiday(self):
holidays = [] # array of holidays for the organization.
if self.time_stamp in holidays:
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_holiday(self) -> bool:\n return set(self._get_date_text_ascii()) == set([int(x) for x in self.params['holiday']['holiday_text']])",
"def is_holiday(date):\n \n return date.day in __get_holidays(date.year)[date.month]",
"def get_holiday(self, date):\n if date.weekday() > 4 or [date.year, ... | [
"0.8743553",
"0.8521114",
"0.7686474",
"0.7664391",
"0.76460797",
"0.7595722",
"0.75122744",
"0.7336759",
"0.722877",
"0.7190423",
"0.7148056",
"0.69224405",
"0.68953985",
"0.67829835",
"0.66642845",
"0.6526839",
"0.634072",
"0.62876004",
"0.6246252",
"0.6238995",
"0.62128305... | 0.8041178 | 2 |
Determines if the date is a business day or not. | def business_day(self):
if self.time_stamp.weekday() not in (5, 6) and not holiday(self.time_stamp):
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_workfree(date):\n \n return date.weekday() == 6 or is_holiday(date)",
"def is_no_bell_day():\n today = time.localtime()[:3]\n for r in no_bell:\n if today >= r[0] and today <= r[1]:\n return True\n return False",
"def is_weekend(date):\n \n return date.weekday() == 5 or da... | [
"0.6530061",
"0.6357234",
"0.6301635",
"0.6286301",
"0.62136126",
"0.61975855",
"0.619755",
"0.61922276",
"0.61534816",
"0.6147341",
"0.60991293",
"0.60991293",
"0.60926026",
"0.6084631",
"0.6068878",
"0.59800583",
"0.59332544",
"0.59213245",
"0.59089226",
"0.5897852",
"0.586... | 0.8129507 | 0 |
Optically center a character in a square frame | def apply_center(unctr_img_dir):
uncentered_image_names = glob(unctr_img_dir)
DIR = Path(".")
for img_name in uncentered_image_names:
# normalize images
img = ~cv2.imread(img_name, cv2.COLOR_BGR2GRAY)
IMG = os.path.basename(img_name)
h, w = img.shape
# h = w = max(w,h)
h = int(h//2 )
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def centerTextFor( player, text=\"\", fillchar= \" \" ):\n return centerTextAt( text, fillchar, getUserScreenWidth( player ) )",
"def center(self, width, fillchar, _difference):\n remainder = _difference % 2\n _difference //= 2\n spacing = self._filler(fillchar, _difference)\n resu... | [
"0.71393794",
"0.6723144",
"0.6715921",
"0.6544259",
"0.6461048",
"0.636856",
"0.61947143",
"0.6176261",
"0.6137369",
"0.6126848",
"0.6069957",
"0.60687196",
"0.6045401",
"0.6039767",
"0.6024151",
"0.5966101",
"0.59454423",
"0.5921089",
"0.5875806",
"0.5860107",
"0.58241117",... | 0.0 | -1 |
Sets the amended_by of this BaseF3Filing. | def amended_by(self, amended_by):
self._amended_by = amended_by | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def amendment(self, amendment):\n\n self._amendment = amendment",
"def mitigated_by(self, mitigated_by):\n\n self._mitigated_by = mitigated_by",
"def last_reviewed_by(self, last_reviewed_by):\n\n self._last_reviewed_by = last_reviewed_by",
"def fixed_by(self, fixed_by):\n\n self._... | [
"0.5665775",
"0.53501815",
"0.51164865",
"0.49919376",
"0.4920553",
"0.49079865",
"0.49079865",
"0.48661909",
"0.48661909",
"0.48399076",
"0.4793392",
"0.47048062",
"0.47017315",
"0.46601146",
"0.46601146",
"0.46601146",
"0.46500546",
"0.46500546",
"0.46500546",
"0.46500546",
... | 0.7454775 | 0 |
Sets the beginning_image_number of this BaseF3Filing. | def beginning_image_number(self, beginning_image_number):
self._beginning_image_number = beginning_image_number | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def image_number(self, image_number):\n\n self._image_number = image_number",
"def front_image(self, front_image):\n\n self._front_image = front_image",
"def set_fragment_start(self, line_no):\n fragment = self.__fragments[-1]\n fragment.set_attribute(\"source_file\", self.__filenam... | [
"0.61838394",
"0.58558977",
"0.5634341",
"0.55463344",
"0.53918976",
"0.5363303",
"0.5301866",
"0.523363",
"0.5210288",
"0.5176344",
"0.51330674",
"0.51211154",
"0.51211154",
"0.511837",
"0.5100409",
"0.5085155",
"0.50693226",
"0.50674987",
"0.5061904",
"0.50410235",
"0.50126... | 0.8954919 | 1 |
Sets the candidate_first_name of this BaseF3Filing. | def candidate_first_name(self, candidate_first_name):
self._candidate_first_name = candidate_first_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_first_name(self, first_name):\n self.first_name = first_name",
"def first_name(self, name):\n self._first_name = name",
"def first_name(self, first_name):\n\n self._first_name = first_name",
"def first_name(self, first_name):\n\n self._first_name = first_name",
"def firs... | [
"0.75565785",
"0.7541784",
"0.74420786",
"0.74420786",
"0.74420786",
"0.74420786",
"0.74420786",
"0.74420786",
"0.74420786",
"0.74420786",
"0.74420786",
"0.7192716",
"0.7192716",
"0.7124884",
"0.6980686",
"0.6946179",
"0.68951225",
"0.68951225",
"0.6690133",
"0.6690133",
"0.6... | 0.8716898 | 0 |
Sets the candidate_last_name of this BaseF3Filing. | def candidate_last_name(self, candidate_last_name):
self._candidate_last_name = candidate_last_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_last_name(self, last_name):\n self.last_name = last_name",
"def last_name(self, last_name):\n\n self._last_name = last_name",
"def last_name(self, last_name):\n\n self._last_name = last_name",
"def last_name(self, last_name):\n\n self._last_name = last_name",
"def last_n... | [
"0.7434689",
"0.7351388",
"0.7351388",
"0.7351388",
"0.7351388",
"0.7351388",
"0.7351388",
"0.7351388",
"0.7351388",
"0.7351388",
"0.7351388",
"0.7230407",
"0.7143216",
"0.6909766",
"0.68279165",
"0.67197424",
"0.67079335",
"0.66664094",
"0.66664094",
"0.6624922",
"0.6624922"... | 0.87842244 | 0 |
Sets the candidate_middle_name of this BaseF3Filing. | def candidate_middle_name(self, candidate_middle_name):
self._candidate_middle_name = candidate_middle_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def middle_name(self, middle_name):\n\n self._middle_name = middle_name",
"def middle_name(self, middle_name):\n\n self._middle_name = middle_name",
"def treasurer_middle_name(self, treasurer_middle_name):\n\n self._treasurer_middle_name = treasurer_middle_name",
"def payee_middle_name(s... | [
"0.76846766",
"0.76846766",
"0.737077",
"0.7061493",
"0.6310693",
"0.6310693",
"0.62975794",
"0.62508327",
"0.618115",
"0.618115",
"0.5930765",
"0.5930765",
"0.5585011",
"0.5504625",
"0.54391205",
"0.5412856",
"0.5229392",
"0.5127531",
"0.50281394",
"0.50221044",
"0.5007021",... | 0.8764704 | 0 |
Sets the candidate_name of this BaseF3Filing. | def candidate_name(self, candidate_name):
self._candidate_name = candidate_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def candidate_first_name(self, candidate_first_name):\n\n self._candidate_first_name = candidate_first_name",
"def candidate_first_name(self, candidate_first_name):\n\n self._candidate_first_name = candidate_first_name",
"def candidate_last_name(self, candidate_last_name):\n\n self._candid... | [
"0.6811646",
"0.6811646",
"0.66703665",
"0.66703665",
"0.6519901",
"0.60873073",
"0.60873073",
"0.5991898",
"0.5867712",
"0.5806437",
"0.5806437",
"0.5776905",
"0.56812656",
"0.56469727",
"0.5645448",
"0.56269187",
"0.56141025",
"0.55815935",
"0.5561688",
"0.5507559",
"0.5484... | 0.81033343 | 0 |
Sets the committee_id of this BaseF3Filing. | def committee_id(self, committee_id):
self._committee_id = committee_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def conduit_committee_id(self, conduit_committee_id):\n\n self._conduit_committee_id = conduit_committee_id",
"def committee(self, committee):\n\n self._committee = committee",
"def committee_name(self, committee_name):\n\n self._committee_name = committee_name",
"def filer_committee_nam... | [
"0.7677789",
"0.6790667",
"0.6473755",
"0.636248",
"0.61241126",
"0.5976553",
"0.56743205",
"0.56107426",
"0.56107426",
"0.5562098",
"0.55359906",
"0.55359906",
"0.55359906",
"0.55359906",
"0.5533516",
"0.54058135",
"0.53709763",
"0.52754676",
"0.52754676",
"0.52667016",
"0.5... | 0.8350239 | 1 |
Sets the coverage_end_date of this BaseF3Filing. | def coverage_end_date(self, coverage_end_date):
self._coverage_end_date = coverage_end_date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_date(self, end_date):\n\n self._end_date = end_date",
"def end_date(self, end_date):\n\n self._end_date = end_date",
"def end_date(self, end_date):\n\n self._end_date = end_date",
"def end_date(self, end_date):\n\n self._end_date = end_date",
"def end_date(self, end_date... | [
"0.78305703",
"0.78305703",
"0.78305703",
"0.78305703",
"0.78305703",
"0.78305703",
"0.78305703",
"0.78305703",
"0.7804615",
"0.7638242",
"0.75442624",
"0.72792745",
"0.726586",
"0.722878",
"0.71858793",
"0.7095502",
"0.6988613",
"0.6972287",
"0.6957091",
"0.6846241",
"0.6456... | 0.9009096 | 1 |
Sets the coverage_start_date of this BaseF3Filing. | def coverage_start_date(self, coverage_start_date):
self._coverage_start_date = coverage_start_date | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_date(self, start_date):\n \n self._start_date = start_date",
"def start_date(self, start_date):\n\n self._start_date = start_date",
"def start_date(self, start_date):\n\n self._start_date = start_date",
"def start_date(self, start_date):\n\n self._start_date = sta... | [
"0.7856594",
"0.77932626",
"0.77932626",
"0.77932626",
"0.77932626",
"0.77932626",
"0.77932626",
"0.77932626",
"0.77932626",
"0.77932626",
"0.7767839",
"0.76443624",
"0.75705636",
"0.74806225",
"0.70943916",
"0.6971344",
"0.683614",
"0.679464",
"0.6700373",
"0.6532",
"0.62762... | 0.8792716 | 1 |
Sets the document_description of this BaseF3Filing. | def document_description(self, document_description):
self._document_description = document_description | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_description(self, description):\n self._description = description",
"def set_description(self, description):\n self.description = description",
"def set_description(self, description):\n self.__description = description",
"def set_description(self, description):\r\n self._... | [
"0.6668957",
"0.66099644",
"0.660201",
"0.66010475",
"0.65385723",
"0.65385723",
"0.65385723",
"0.65385723",
"0.65385723",
"0.65385723",
"0.65385723",
"0.65385723",
"0.65385723",
"0.65385723",
"0.65385723",
"0.65385723",
"0.65385723",
"0.65385723",
"0.65385723",
"0.65385723",
... | 0.81963736 | 1 |
Sets the fec_url of this BaseF3Filing. | def fec_url(self, fec_url):
self._fec_url = fec_url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_url(self, url):\n self.url = url",
"def fec_file_id(self, fec_file_id):\n\n self._fec_file_id = fec_file_id",
"def fec_file_id(self, fec_file_id):\n\n self._fec_file_id = fec_file_id",
"def _set_url(self): \n self.url = self.geturl()",
"def set_url(self, url):\n ... | [
"0.5991539",
"0.59400356",
"0.59400356",
"0.5937342",
"0.59370846",
"0.5890876",
"0.56530446",
"0.5645736",
"0.5645736",
"0.5645736",
"0.5645736",
"0.5645736",
"0.5645736",
"0.5645736",
"0.56421167",
"0.55670965",
"0.55670965",
"0.55670965",
"0.555287",
"0.55327386",
"0.55206... | 0.8578951 | 1 |
Sets the pdf_url of this BaseF3Filing. | def pdf_url(self, pdf_url):
self._pdf_url = pdf_url | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pdf(self, pdf):\n\n self._pdf = pdf",
"def set_url(self, url):\n if url is not None:\n self.url = url",
"def attachment_url(self, attachment_url):\n\n self._attachment_url = attachment_url",
"def set_url(self, url):\n self.url = url",
"def set_url(self, url):\n ... | [
"0.6746016",
"0.62305415",
"0.61984634",
"0.6165166",
"0.6154034",
"0.59663403",
"0.5895516",
"0.5895516",
"0.5895516",
"0.5895516",
"0.5895516",
"0.5895516",
"0.5895516",
"0.5887959",
"0.5884538",
"0.5834432",
"0.5810279",
"0.580431",
"0.580431",
"0.580431",
"0.5722871",
"... | 0.838444 | 1 |
Sets the report_type of this BaseF3Filing. | def report_type(self, report_type):
self._report_type = report_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def report_type(self, report_type):\n if self.local_vars_configuration.client_side_validation and report_type is None: # noqa: E501\n raise ValueError(\"Invalid value for `report_type`, must not be `None`\") # noqa: E501\n\n self._report_type = report_type",
"def setDataSetType(self, t... | [
"0.71602374",
"0.593164",
"0.58898205",
"0.58739966",
"0.5822777",
"0.5822777",
"0.5740988",
"0.5720869",
"0.5615132",
"0.5610363",
"0.55534947",
"0.55241334",
"0.55223376",
"0.5508913",
"0.5508913",
"0.55046743",
"0.5501768",
"0.54940563",
"0.5476767",
"0.544539",
"0.5427518... | 0.79401815 | 1 |
Sets the rpt_pgi of this BaseF3Filing. | def rpt_pgi(self, rpt_pgi):
self._rpt_pgi = rpt_pgi | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pt_pctg(self, pt_pctg):\n\n self._pt_pctg = pt_pctg",
"def set_iqpt(self, iqpt, fine=False):\n self._iqpt = iqpt\n\n if fine:\n self.set_iqpt_fine(iqpt)\n else:\n self.set_iqpt_coarse(iqpt)",
"def ppm(self, ppm):\n self._ppm = ppm\n self._f = ... | [
"0.52198476",
"0.49984655",
"0.47654533",
"0.47578156",
"0.4755088",
"0.47145313",
"0.47109002",
"0.46927333",
"0.46533793",
"0.46263468",
"0.46127975",
"0.45861143",
"0.45800924",
"0.45629212",
"0.4546918",
"0.4546918",
"0.4546918",
"0.45050818",
"0.44976506",
"0.44950718",
... | 0.85941297 | 0 |
Sets the runoff_election of this BaseF3Filing. | def runoff_election(self, runoff_election):
self._runoff_election = runoff_election | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def election_state(self, election_state):\n\n self._election_state = election_state",
"def set_eval(self):\n self._phase = 'predict'\n self.add_flags_recursive(training=False)\n return self",
"def setEvaluationMode(self, newMode):\n \n pass",
"def setup_fader(self):\n ... | [
"0.48773542",
"0.48154408",
"0.47620934",
"0.45956492",
"0.45821953",
"0.45782518",
"0.45756358",
"0.45375776",
"0.44949687",
"0.44890016",
"0.44056222",
"0.4397033",
"0.43784285",
"0.43684888",
"0.42980695",
"0.42891005",
"0.42878655",
"0.42800224",
"0.4278577",
"0.4270856",
... | 0.7858126 | 0 |
Sets the suffix of this BaseF3Filing. | def suffix(self, suffix):
self._suffix = suffix | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setSuffix(self, value):\n return self._set(suffix=value)",
"def suffix(self):\n return self._suffix",
"def suffix(self):\n return self._suffix",
"def suffix(self):\n return self._suffix",
"def suffix(self):\n return self[\"suffix\"]",
"def suffix(self):\n ret... | [
"0.73608553",
"0.6667001",
"0.6667001",
"0.6667001",
"0.66542226",
"0.66542226",
"0.65998626",
"0.65998626",
"0.6410323",
"0.6388769",
"0.63597876",
"0.63550955",
"0.60827017",
"0.6013623",
"0.60129744",
"0.6001725",
"0.5984929",
"0.5968745",
"0.5962656",
"0.59561205",
"0.579... | 0.7771558 | 2 |
Sets the treasurer_first_name of this BaseF3Filing. | def treasurer_first_name(self, treasurer_first_name):
self._treasurer_first_name = treasurer_first_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_first_name(self, first_name):\n self.first_name = first_name",
"def first_name(self, name):\n self._first_name = name",
"def first_name(self, first_name):\n\n self._first_name = first_name",
"def first_name(self, first_name):\n\n self._first_name = first_name",
"def firs... | [
"0.71659356",
"0.7014854",
"0.7004702",
"0.7004702",
"0.7004702",
"0.7004702",
"0.7004702",
"0.7004702",
"0.7004702",
"0.7004702",
"0.7004702",
"0.6847499",
"0.6847499",
"0.67131716",
"0.6700151",
"0.6637977",
"0.6568514",
"0.6547322",
"0.61957216",
"0.6179754",
"0.61224896",... | 0.8997543 | 0 |
Sets the treasurer_last_name of this BaseF3Filing. | def treasurer_last_name(self, treasurer_last_name):
self._treasurer_last_name = treasurer_last_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def treasurer_name(self, treasurer_name):\n\n self._treasurer_name = treasurer_name",
"def set_last_name(self, last_name):\n self.last_name = last_name",
"def last_name(self, last_name):\n\n self._last_name = last_name",
"def last_name(self, last_name):\n\n self._last_name = last_... | [
"0.69770914",
"0.6921543",
"0.6765562",
"0.6765562",
"0.6765562",
"0.6765562",
"0.6765562",
"0.6765562",
"0.6765562",
"0.6765562",
"0.6765562",
"0.6765562",
"0.66386265",
"0.6612227",
"0.66104656",
"0.6594594",
"0.65204203",
"0.6503506",
"0.6326731",
"0.6256542",
"0.6256542",... | 0.8871139 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
if not isinstance(other, BaseF3Filing):
return False
return self.to_dict() == other.to_dict() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
"0.79670393",
... | 0.0 | -1 |
Returns true if both objects are not equal | def __ne__(self, other):
if not isinstance(other, BaseF3Filing):
return True
return self.to_dict() != other.to_dict() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
"0.8042487",
... | 0.0 | -1 |
Gets the total amount that was withdrawn | def get_withdrawals(self):
withdrawals = 0
for transaction in self.ledger:
amount = transaction["amount"]
if amount < 0:
withdrawals += abs(amount)
return withdrawals | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def withdraw(self, amount):\n if self.overdrawn:\n print('You have overdrawn, please add more money!')\n return self.balance\n self.balance = self.balance - amount\n return self.balance",
"def withdraw(self, amount):\n self.transactions += [('withdraw', amount)]\... | [
"0.7299716",
"0.72493106",
"0.7133386",
"0.7127129",
"0.71264035",
"0.7071744",
"0.701187",
"0.69846034",
"0.6981216",
"0.6972358",
"0.69251007",
"0.6913102",
"0.688742",
"0.68576777",
"0.68397534",
"0.68382627",
"0.68323696",
"0.682077",
"0.6816122",
"0.67782736",
"0.6727541... | 0.65763944 | 27 |
Returns the balance of the category | def get_balance(self):
balance = 0
for transaction in self.ledger:
balance += transaction["amount"]
return balance | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_balance(self):\r\n return self.balance",
"def get_balance(self):\n final_amount = 0\n for i in range(len(self.ledger)):\n final_amount += self.ledger[i]['amount']\n return final_amount",
"def get_balance(self) -> float:\n return self._balance",
"def get_b... | [
"0.7166005",
"0.71610105",
"0.712255",
"0.7098108",
"0.7098108",
"0.70248795",
"0.7007224",
"0.69782346",
"0.6967873",
"0.69420856",
"0.69405955",
"0.69067883",
"0.69025874",
"0.6892503",
"0.6811431",
"0.6810839",
"0.6796444",
"0.67873144",
"0.67870355",
"0.6749259",
"0.67434... | 0.710522 | 3 |
The primary value associated with this entity entry. For example, if the entity type is vegetable, the value could be scallions. | def value(self) -> str:
return pulumi.get(self, "value") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def native_value(self) -> str | datetime | int | float | None:\n if (key := self.entity_description.value_key) is None:\n return None\n return self.coordinator.data[key]",
"def value (self):\r\n return self.entry.get()",
"def value(self):\n return self.get_data(\"value\")... | [
"0.687899",
"0.6704025",
"0.6560908",
"0.65193826",
"0.6512383",
"0.64228725",
"0.6388812",
"0.6366085",
"0.6366085",
"0.6366085",
"0.6366085",
"0.6366085",
"0.6366085",
"0.6366085",
"0.6366085",
"0.6366085",
"0.6366085",
"0.6366085",
"0.6366085",
"0.6366085",
"0.6366085",
... | 0.63415694 | 48 |
Return whether two signatures are equal. | def __eq__(self, other):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n if not isinstance(other, HandwrittenSignature):\n return False\n\n return self.__dict__ == other.__dict__",
"def compare_signatures(self):\n my_decoded_sig = self._generate_signature().decode('utf-8')\n github_decoded_sig = self.github_signature.d... | [
"0.7376817",
"0.7366683",
"0.6833633",
"0.6822376",
"0.6760297",
"0.6717255",
"0.66255033",
"0.6621525",
"0.66104496",
"0.65823257",
"0.6542633",
"0.6539048",
"0.6535858",
"0.6517003",
"0.65066475",
"0.64650303",
"0.6443265",
"0.64417446",
"0.64297014",
"0.64221925",
"0.64064... | 0.0 | -1 |
Return whether two signatures are not equal. | def __ne__(self, other):
return not (self == other) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other):\n if not isinstance(other, AwsS3PresignedUrlForUpload):\n return True\n\n return self.to_dict() != other.to_dict()",
"def compare_signatures(self):\n my_decoded_sig = self._generate_signature().decode('utf-8')\n github_decoded_sig = self.github_sign... | [
"0.6810536",
"0.66832244",
"0.6669398",
"0.6649389",
"0.65423083",
"0.6531548",
"0.6408324",
"0.6405201",
"0.63616735",
"0.6360111",
"0.6349488",
"0.6294186",
"0.6274727",
"0.62588614",
"0.6258481",
"0.6256906",
"0.62511283",
"0.62347645",
"0.62277216",
"0.6209967",
"0.620117... | 0.0 | -1 |
Return a string representation of the signature. | def __repr__(self):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def signature(self) -> str:\n return self[\"Sns\"][\"Signature\"]",
"def get_signature(self):\n return \" \".join(self.segments[-1].unixtext.replace(\n u\"\\n\", \" \").strip().split())",
"def signature(self):\n return self._signature",
"def signature(self):\n return se... | [
"0.7541231",
"0.728667",
"0.7190602",
"0.7190602",
"0.7190602",
"0.7182051",
"0.71359193",
"0.70791394",
"0.7027011",
"0.70154303",
"0.6995797",
"0.6944751",
"0.6935849",
"0.68435204",
"0.6832239",
"0.6832239",
"0.6758563",
"0.66998273",
"0.6689304",
"0.66820216",
"0.6674166"... | 0.0 | -1 |
Return a string representation of the signature. | def __repr__(self):
return ('<ProjectSignature(apps=%r)>'
% list(six.iterkeys(self._app_sigs))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def signature(self) -> str:\n return self[\"Sns\"][\"Signature\"]",
"def get_signature(self):\n return \" \".join(self.segments[-1].unixtext.replace(\n u\"\\n\", \" \").strip().split())",
"def signature(self):\n return self._signature",
"def signature(self):\n return se... | [
"0.7541231",
"0.728667",
"0.7190602",
"0.7190602",
"0.7190602",
"0.7182051",
"0.71359193",
"0.70791394",
"0.7027011",
"0.70154303",
"0.6995797",
"0.6944751",
"0.6935849",
"0.68435204",
"0.6832239",
"0.6832239",
"0.6758563",
"0.66998273",
"0.6689304",
"0.66820216",
"0.6674166"... | 0.6146218 | 56 |
Return whether two application signatures are equal. | def __eq__(self, other):
return (other is not None and
self.app_id == other.app_id and
self.legacy_app_label == other.legacy_app_label and
self.upgrade_method == other.upgrade_method and
self.applied_migrations == other.applied_migrations and
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return dict.__eq__(self._app_sigs, other._app_sigs)",
"def compare_signatures(self):\n my_decoded_sig = self._generate_signature().decode('utf-8')\n github_decoded_sig = self.github_signature.decode('utf-8')\n self.logger.info(f'*** INFO: My Signature: {my_d... | [
"0.7336663",
"0.72561383",
"0.7213521",
"0.668619",
"0.66038907",
"0.6564686",
"0.6436949",
"0.63801855",
"0.63764834",
"0.6350779",
"0.63317466",
"0.62575054",
"0.6240622",
"0.6201929",
"0.61982626",
"0.61881167",
"0.61878103",
"0.6177919",
"0.6177863",
"0.6169445",
"0.61631... | 0.6116594 | 22 |
Return a string representation of the signature. | def __repr__(self):
return ('<AppSignature(app_id=%r, legacy_app_label=%r,'
' upgrade_method=%r, models=%r)>'
% (self.app_id, self.legacy_app_label, self.upgrade_method,
list(six.iterkeys(self._model_sigs)))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def signature(self) -> str:\n return self[\"Sns\"][\"Signature\"]",
"def get_signature(self):\n return \" \".join(self.segments[-1].unixtext.replace(\n u\"\\n\", \" \").strip().split())",
"def signature(self):\n return self._signature",
"def signature(self):\n return se... | [
"0.7541231",
"0.728667",
"0.7190602",
"0.7190602",
"0.7190602",
"0.7182051",
"0.71359193",
"0.70791394",
"0.7027011",
"0.70154303",
"0.6995797",
"0.6944751",
"0.6935849",
"0.68435204",
"0.6832239",
"0.6832239",
"0.6758563",
"0.66998273",
"0.6689304",
"0.66820216",
"0.6674166"... | 0.0 | -1 |
A list of fields that are unique together. | def unique_together(self):
return self._unique_together | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def uniqField(self, fieldname):\n\t\tretval = list(set(self.getField(fieldname)))\n\t\tretval.sort()\n\t\treturn retval",
"def make_fields_unique(self, fields):\n ...",
"def get_bulk_update_fields(cls: Type[models.Model], unique_fields: List[str]) -> List[str]:\n\n def _should_be_updated(field):\n ... | [
"0.75018066",
"0.7456106",
"0.682475",
"0.68157005",
"0.68019295",
"0.6529714",
"0.6514058",
"0.63804555",
"0.6373435",
"0.63520736",
"0.63472104",
"0.6105653",
"0.6089852",
"0.6089612",
"0.60645854",
"0.6004397",
"0.5993746",
"0.5972406",
"0.5948468",
"0.59414506",
"0.593425... | 0.5969403 | 18 |
A list of fields that are unique together. When setting this property, the value will be normalized for storage and comparison. | def unique_together(self, new_value):
self._unique_together = self._normalize_together(new_value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_fields_unique(self, fields):\n ...",
"def enforce_unique_values(self):\n return self.properties.get('enforceUniqueValues', None)",
"def uniqField(self, fieldname):\n\t\tretval = list(set(self.getField(fieldname)))\n\t\tretval.sort()\n\t\treturn retval",
"def unique_together(self):\n ... | [
"0.71412766",
"0.690614",
"0.67555785",
"0.6575446",
"0.64381",
"0.64336294",
"0.6328384",
"0.62690926",
"0.62523794",
"0.62094533",
"0.6114811",
"0.60603833",
"0.60546935",
"0.6011236",
"0.59579444",
"0.58583796",
"0.58020973",
"0.57015425",
"0.56918037",
"0.5688462",
"0.566... | 0.55682695 | 26 |
Return a string representation of the signature. | def __repr__(self):
return '<ModelSignature(model_name=%r)>' % self.model_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def signature(self) -> str:\n return self[\"Sns\"][\"Signature\"]",
"def get_signature(self):\n return \" \".join(self.segments[-1].unixtext.replace(\n u\"\\n\", \" \").strip().split())",
"def signature(self):\n return self._signature",
"def signature(self):\n return se... | [
"0.7541231",
"0.728667",
"0.7190602",
"0.7190602",
"0.7190602",
"0.7182051",
"0.71359193",
"0.70791394",
"0.7027011",
"0.70154303",
"0.6995797",
"0.6944751",
"0.6935849",
"0.68435204",
"0.6832239",
"0.6832239",
"0.6758563",
"0.66998273",
"0.6689304",
"0.66820216",
"0.6674166"... | 0.5852881 | 98 |
Return whether two constraint signatures are equal. | def __eq__(self, other):
return (other is not None and
self.name == other.name and
self.type is other.type and
dict.__eq__(self.attrs, other.attrs)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isequal(f1, f2):\n import numpy\n if f1.shape != f2.shape:\n return False\n return numpy.all(f1 == f2)",
"def is_compatible_to(self, other: 'Signature') -> bool:\n if self is other or self == other:\n return True\n # self.return_type must be compatible to other.return... | [
"0.68434644",
"0.6572002",
"0.6518584",
"0.6471955",
"0.643408",
"0.63790154",
"0.6351441",
"0.62833714",
"0.627556",
"0.62725395",
"0.625815",
"0.6221274",
"0.62191933",
"0.6179424",
"0.6144881",
"0.61195487",
"0.6106448",
"0.6104243",
"0.6094595",
"0.6092234",
"0.60877544",... | 0.0 | -1 |
Return a string representation of the signature. | def __repr__(self):
return ('<ConstraintSignature(name=%r, type=%r, attrs=%r)>'
% (self.name, self.type, self.attrs)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def signature(self) -> str:\n return self[\"Sns\"][\"Signature\"]",
"def get_signature(self):\n return \" \".join(self.segments[-1].unixtext.replace(\n u\"\\n\", \" \").strip().split())",
"def signature(self):\n return self._signature",
"def signature(self):\n return se... | [
"0.7541231",
"0.728667",
"0.7190602",
"0.7190602",
"0.7190602",
"0.7182051",
"0.71359193",
"0.70791394",
"0.7027011",
"0.70154303",
"0.6995797",
"0.6944751",
"0.6935849",
"0.68435204",
"0.6832239",
"0.6832239",
"0.6758563",
"0.66998273",
"0.6689304",
"0.66820216",
"0.6674166"... | 0.63918275 | 37 |
Return a string representation of the signature. | def __repr__(self):
return (
'<IndexSignature(name=%r, fields=%r, expressions=%r, attrs=%r)>'
% (self.name, self.fields, self.expressions, self.attrs)
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def signature(self) -> str:\n return self[\"Sns\"][\"Signature\"]",
"def get_signature(self):\n return \" \".join(self.segments[-1].unixtext.replace(\n u\"\\n\", \" \").strip().split())",
"def signature(self):\n return self._signature",
"def signature(self):\n return se... | [
"0.7541231",
"0.728667",
"0.7190602",
"0.7190602",
"0.7190602",
"0.7182051",
"0.71359193",
"0.70791394",
"0.7027011",
"0.70154303",
"0.6995797",
"0.6944751",
"0.6935849",
"0.68435204",
"0.6832239",
"0.6832239",
"0.6758563",
"0.66998273",
"0.6689304",
"0.66820216",
"0.6674166"... | 0.0 | -1 |
Return attribute names and defaults for a field type. The attributes returned are those that impact the schema for a field's column. | def _get_defaults_for_field_type(cls, field_type):
defaults = cls._ATTRIBUTE_DEFAULTS['*'].copy()
defaults.update(cls._ATTRIBUTE_DEFAULTS.get(field_type, {}))
return defaults | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _iter_attrs_for_field_type(cls, field_type):\n return six.iterkeys(cls._get_defaults_for_field_type(field_type))",
"def _iter_attrs_for_field_type(cls, field_type):\n return six.iterkeys(cls._get_defaults_for_field_type(field_type))",
"def attributes(self):\n attrs_ = [\"name\", \"type... | [
"0.70024806",
"0.70024806",
"0.6483557",
"0.6446088",
"0.6301498",
"0.61059994",
"0.6103305",
"0.60458183",
"0.59709275",
"0.59659547",
"0.59314203",
"0.5881389",
"0.5878465",
"0.5851464",
"0.5847215",
"0.576201",
"0.5748283",
"0.5739588",
"0.5689493",
"0.5676328",
"0.5675821... | 0.67333186 | 2 |
Return whether an attribute is set to its default value. | def is_attr_value_default(self, attr_name):
try:
attr_value = self.field_attrs[attr_name]
except KeyError:
return True
return attr_value == self.get_attr_default(attr_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_default_value(self, name):\n return self.get_attribute_schema(name).has_default_value",
"def has_default_value(self):\n return self.default is not None",
"def isDefault (self):\n val = self.__getattribute__('StoredValue')\n dft = self.__class__.StoredValue\n return va... | [
"0.8286388",
"0.80434895",
"0.7622466",
"0.75843847",
"0.75212675",
"0.74690676",
"0.74160683",
"0.7394499",
"0.7368233",
"0.7368233",
"0.7368233",
"0.73641014",
"0.7321007",
"0.72814614",
"0.7269877",
"0.7269877",
"0.7269877",
"0.7269877",
"0.7269877",
"0.72656024",
"0.72349... | 0.8460985 | 0 |
Return a string representation of the signature. | def __repr__(self):
return ('<FieldSignature(field_name=%r, field_type=%r,'
' field_attrs=%r, related_model=%r)>'
% (self.field_name, self.field_type, self.field_attrs,
self.related_model)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def signature(self) -> str:\n return self[\"Sns\"][\"Signature\"]",
"def get_signature(self):\n return \" \".join(self.segments[-1].unixtext.replace(\n u\"\\n\", \" \").strip().split())",
"def signature(self):\n return self._signature",
"def signature(self):\n return se... | [
"0.7541231",
"0.728667",
"0.7190602",
"0.7190602",
"0.7190602",
"0.7182051",
"0.71359193",
"0.70791394",
"0.7027011",
"0.70154303",
"0.6995797",
"0.6944751",
"0.6935849",
"0.68435204",
"0.6832239",
"0.6832239",
"0.6758563",
"0.66998273",
"0.6689304",
"0.66820216",
"0.6674166"... | 0.6410023 | 35 |
Validate that a signature version is supported. | def validate_sig_version(sig_version):
assert isinstance(sig_version, int)
if not (0 < sig_version <= LATEST_SIGNATURE_VERSION):
raise InvalidSignatureVersion(sig_version) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_valid_version(self):\n pass",
"def validate_sig(v):\n return _validate(v, prefixes=[b'edsig', b'spsig', b'p2sig', b'sig'])",
"def verify_request_signature(req_info: StatusResponse) -> None:\n if not req_info.signature_check(req_info.xmlstr):\n raise ValueError(_(\"Message signature v... | [
"0.7049565",
"0.7026056",
"0.6871145",
"0.6599704",
"0.6588321",
"0.65606564",
"0.650507",
"0.6485739",
"0.64500076",
"0.64500076",
"0.6447045",
"0.63562006",
"0.62808734",
"0.6263591",
"0.6263414",
"0.62573683",
"0.62222445",
"0.61833036",
"0.6162751",
"0.61342484",
"0.61037... | 0.8372564 | 0 |
Returns a dictionary of potential 'Instance' or 'List(Instance)' handlers. | def _get_instance_handlers ( class_dict, bases ):
# Create the results dictionary:
instance_traits = {}
# Merge all of the base class information into the result:
for base in bases:
for name, base_arg_lists in base.__dict__.get( InstanceTraits ).items():
arg_lists = instance_traits.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_instance_handlers ( self, name ):\n return [ ( getattr( self, method_name ), item_name )\n for method_name, item_name in\n self.__class__.__instance_traits__[ name ] ]",
"def _handlers(self):\n if not self.__handlers:\n handlers = {}\n ... | [
"0.7389283",
"0.65861636",
"0.6319803",
"0.6283904",
"0.6173508",
"0.6095202",
"0.6093097",
"0.6004274",
"0.599405",
"0.5966543",
"0.5965682",
"0.5918643",
"0.591231",
"0.5829983",
"0.5795273",
"0.5794718",
"0.5753532",
"0.57528436",
"0.5666043",
"0.56089044",
"0.5585255",
... | 0.68570805 | 1 |
Returns a list of the immediate (or all) subclasses of this class. | def trait_subclasses ( cls, all = False ):
if not all:
return getattr( cls, SubclassTraits )[:]
return cls._trait_subclasses( [] ) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subclasses(cls) -> Iterator:\n for subclass in cls.__subclasses__():\n if subclass._type_definition.description: # type: ignore\n yield subclass\n yield from subclass.subclasses()",
"def all_named_subclasses(cls):\n\n subclasses = set()\n\n # Search ... | [
"0.7965914",
"0.7860459",
"0.7841226",
"0.7732966",
"0.7698565",
"0.76687044",
"0.76437676",
"0.7637427",
"0.7567316",
"0.7493863",
"0.7493863",
"0.7464732",
"0.742482",
"0.7397033",
"0.73967296",
"0.7335012",
"0.73037994",
"0.7296995",
"0.72925603",
"0.72815853",
"0.72693145... | 0.685713 | 39 |
Gets or sets a ViewElement associated with an object's class. | def trait_view ( self, name = None, view_element = None ):
return self.__class__._trait_view( name, view_element,
self.default_traits_view, self.trait_view_elements,
self.editable_traits ) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_view ( self, object ):\n return self.view",
"def view(self):\n return self._view_class(self)",
"def assign_view(self):\n return self._assign_view if self._assign_view else self.assign_view_class.as_view()",
"def _trait_view ( cls, name, view_element, default_name, view_elements,\... | [
"0.6597641",
"0.61757994",
"0.6034168",
"0.6019519",
"0.57290363",
"0.5692431",
"0.55523133",
"0.5528999",
"0.5437708",
"0.54075265",
"0.5333245",
"0.53059626",
"0.5299367",
"0.52665097",
"0.5218051",
"0.5218051",
"0.52072746",
"0.51878",
"0.51696706",
"0.51521075",
"0.514986... | 0.5232022 | 14 |
Gets or sets a ViewElement associated with an object's class. | def _trait_view ( cls, name, view_element, default_name, view_elements,
editable_traits ):
# If a view element was passed instead of a name or None, return it:
if isinstance( name, ViewElement ):
return name
# Get the ViewElements object associated with th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_view ( self, object ):\n return self.view",
"def view(self):\n return self._view_class(self)",
"def assign_view(self):\n return self._assign_view if self._assign_view else self.assign_view_class.as_view()",
"def get_view(self):\n return self.view",
"def find_element_view... | [
"0.6597641",
"0.61757994",
"0.6034168",
"0.57290363",
"0.5692431",
"0.55523133",
"0.5528999",
"0.5437708",
"0.54075265",
"0.5333245",
"0.53059626",
"0.5299367",
"0.52665097",
"0.5232022",
"0.5218051",
"0.5218051",
"0.52072746",
"0.51878",
"0.51696706",
"0.51521075",
"0.514986... | 0.6019519 | 3 |
Returns the name of the default traits view for the object's class. | def default_traits_view ( self ):
return self.__class__.class_default_traits_view() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def class_default_traits_view ( cls ):\n return DefaultTraitsView",
"def default_name(self):\n return '[' + self.__class__.__name__ + ']'",
"def trait_view ( self, name = None, view_element = None ):\n return self.__class__._trait_view( name, view_element,\n self... | [
"0.7735993",
"0.6291089",
"0.60965973",
"0.5929089",
"0.570706",
"0.5701696",
"0.5699419",
"0.56655765",
"0.55864435",
"0.55864435",
"0.558457",
"0.5576945",
"0.5576945",
"0.5576945",
"0.5576945",
"0.5576945",
"0.5569423",
"0.5568265",
"0.55635583",
"0.55579734",
"0.55380857"... | 0.7999477 | 0 |
Returns the name of the default traits view for the class. | def class_default_traits_view ( cls ):
return DefaultTraitsView | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_traits_view ( self ):\n return self.__class__.class_default_traits_view()",
"def default_name(self):\n return '[' + self.__class__.__name__ + ']'",
"def trait_view ( self, name = None, view_element = None ):\n return self.__class__._trait_view( name, view_element,\n ... | [
"0.80914354",
"0.6308808",
"0.62565976",
"0.58990747",
"0.576018",
"0.57067627",
"0.56375057",
"0.56268305",
"0.56242377",
"0.5555459",
"0.5538645",
"0.5515421",
"0.548918",
"0.54879785",
"0.5473735",
"0.5434816",
"0.5410361",
"0.540936",
"0.540936",
"0.5409269",
"0.54002327"... | 0.7942204 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.