query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Check if the current view is an OCaml source code. | def is_ocaml(view):
ocaml = 'source.ocaml'
mlfi = 'source.mlfi'
location = view.sel()[0].begin()
return view.match_selector(location, ocaml) or view.match_selector(location, mlfi) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_non_js_source(self):\n self.view.set_syntax_file(\"Packages/Python/Python.tmLanguage\")\n\n actual = is_js_source(self.view)\n\n self.assertFalse(actual)",
"def test_js_source(self):\n actual = is_js_source(self.view)\n\n self.assertTrue(actual)",
"def is_authoring_s... | [
"0.67141247",
"0.61287296",
"0.59936684",
"0.59469485",
"0.59078604",
"0.5851658",
"0.5787282",
"0.5709476",
"0.5676872",
"0.5662873",
"0.56603956",
"0.55736876",
"0.5511895",
"0.5484196",
"0.5424797",
"0.54031396",
"0.53450185",
"0.53424245",
"0.52996314",
"0.5279858",
"0.52... | 0.69519085 | 0 |
Execute the given function if we are in an OCaml source code only. | def only_ocaml(func):
@functools.wraps(func)
def wrapper(self, view, *args, **kwargs):
if is_ocaml(view):
return func(self, view, *args, **kwargs)
return wrapper | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def main_code():\n pass",
"def in_function_code(self):\n return self.lscope is not None and self.sscope is None",
"def runsource(self, source, filename=\"<input>\", symbol=\"single\"):\n try:\n code = self.compile(source, filename, symbol)\n except (OverflowError, SyntaxError... | [
"0.61175025",
"0.59589654",
"0.5907236",
"0.57341886",
"0.57255304",
"0.5646994",
"0.5632915",
"0.55879843",
"0.55784357",
"0.5551663",
"0.55419976",
"0.5538157",
"0.5525979",
"0.54997593",
"0.54997593",
"0.54997593",
"0.54997593",
"0.54997593",
"0.54997593",
"0.54997593",
"0... | 0.6008382 | 1 |
Convert a position returned by Merlin to a Sublime text point. Sublime uses character positions and starts each file at line 0. | def merlin_pos(view, pos):
return view.text_point(pos['line'] - 1, pos['col']) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_position(tu, file, line, column):\r\n return conf.lib.clang_getLocation(tu, file, line, column)",
"def point2pos(self, point):\n row = self._vim.eval('byte2line({})'.format(point))\n col = self._vim.eval('{} - line2byte({})'.format(point, row))\n return (int(row), int(col))",... | [
"0.59632206",
"0.5889241",
"0.56616706",
"0.56562984",
"0.54250014",
"0.5352155",
"0.524134",
"0.52322143",
"0.5227591",
"0.52061164",
"0.5179411",
"0.5161949",
"0.51547635",
"0.507839",
"0.5063059",
"0.5035226",
"0.5024355",
"0.50153136",
"0.5005417",
"0.50020736",
"0.499957... | 0.6376156 | 0 |
.get_recommendation_display() will return the correct value of the recommendation choice | def test_recommendation_value(self):
john_starks = Athlete(first_name="John", last_name="Starks", sport="NBA", recommendation="a")
self.assertEqual(john_starks.get_recommendation_display(), "Hire Joe IMMEDIATELY!") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n if self.recommend:\n review = 'recommended by {}: {}'.format(self.reviewer, self.comments)\n else:\n review = 'not recommended by {}: {}'.format(self.reviewer, self.comments)\n\n return review",
"def handle_recommendation(request):\n ticker = req... | [
"0.64533204",
"0.62321275",
"0.6155811",
"0.6037975",
"0.59529597",
"0.58630055",
"0.57988244",
"0.5778563",
"0.5745785",
"0.5703222",
"0.56989217",
"0.56337386",
"0.56248695",
"0.557974",
"0.55621016",
"0.5547041",
"0.55275047",
"0.55242544",
"0.5524008",
"0.55168205",
"0.55... | 0.6441277 | 1 |
Invoked by pika when RabbitMQ has finished the Exchange.Declare RPC command. | def on_exchange_declareok(self, _unused_frame):
self._channel_ctrl.queue_declare(
'',
exclusive=True,
auto_delete=True,
callback=self.on_queue_declareok
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_exchange_declareok(self, unused_frame):\n self.logger.info('exchange declared')\n self.setup_queue()",
"def on_exchange_declareok(self, unused_frame):\n LOGGER.debug('Exchange declared')\n\n for queue in self._handlers.keys():\n self._channel.queue_declare(self.on_qu... | [
"0.715761",
"0.6964966",
"0.64156866",
"0.61320156",
"0.6064579",
"0.6064579",
"0.6064579",
"0.6040164",
"0.60303724",
"0.6024567",
"0.6008154",
"0.59611946",
"0.5960115",
"0.5942857",
"0.59143645",
"0.5890094",
"0.58587295",
"0.58443904",
"0.5769042",
"0.57334083",
"0.569658... | 0.7317034 | 0 |
Get next report ID or False if not available | def next_id(self):
try:
return Report.objects.filter(id__gt=self.id).order_by("id").first().id
except Exception:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nextId(self):\r\n \r\n nextId = -1\r\n if self._wizard.currentId() == SOURCE_PAGE_ID:\r\n nextId = TARGET_PAGE_ID\r\n elif self._wizard.currentId() == TARGET_PAGE_ID:\r\n nextId = DATASTORE_PAGE_ID\r\n elif self._wizard.currentId() == DATASTORE_PAGE_ID:\... | [
"0.62095916",
"0.6153769",
"0.5885677",
"0.5764439",
"0.573282",
"0.56805384",
"0.5647685",
"0.5569167",
"0.5534752",
"0.55111814",
"0.5475925",
"0.5458879",
"0.5441728",
"0.5426077",
"0.5425727",
"0.5425234",
"0.5410581",
"0.5389253",
"0.5372817",
"0.5361491",
"0.5344166",
... | 0.8004583 | 0 |
Get previous report ID or False if not available | def previous_id(self):
try:
return Report.objects.filter(id__lt=self.id).order_by("-id").first().id
except Exception:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next_id(self):\n try:\n return Report.objects.filter(id__gt=self.id).order_by(\"id\").first().id\n except Exception:\n return False",
"def get_report_id(self, reports):\n matching_reports = [\n report for report in reports if report.get('title') in [\n ... | [
"0.69261867",
"0.6367051",
"0.6234315",
"0.61751926",
"0.600833",
"0.5732639",
"0.5732639",
"0.5496686",
"0.54920655",
"0.5474516",
"0.5460659",
"0.5322554",
"0.5255835",
"0.52374005",
"0.519327",
"0.5184205",
"0.516578",
"0.5152253",
"0.51465",
"0.51069415",
"0.5098686",
"... | 0.76356864 | 0 |
Constructs HttpRequest from string containing an entire HTTP request | def deserialize(cls, data: bytes) -> HttpRequest:
try:
raw = data.decode("utf-8")
raw_headers, raw_body = raw.split("\r\n\r\n")
header_lines = raw_headers.split("\r\n")
method, path, protocol = header_lines[0].split()
headers = HttpRequest._parse_heade... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def request_from_text(text):\n lines = text.splitlines()\n match = re.search('^([a-z]+) (.*) (http/[0-9]\\.[0-9])$', lines[0], re.I)\n method, path, version = match.groups()\n headers = {}\n for idx, line in enumerate(lines[1:], start=1):\n if not line:\n break\n hdr, val = ... | [
"0.66163635",
"0.64092165",
"0.6310418",
"0.6307847",
"0.62922215",
"0.6205955",
"0.6139031",
"0.61217684",
"0.60365695",
"0.60207903",
"0.5994213",
"0.5978753",
"0.5958118",
"0.5937699",
"0.5780297",
"0.5706186",
"0.5587631",
"0.5573185",
"0.55512106",
"0.5533943",
"0.553247... | 0.64779276 | 1 |
Parses headers to a dictionary from a list of strings | def _parse_headers(raw_headers: List[str]) -> Dict[str, str]:
headers: Dict[str, str] = {}
for header in raw_headers:
name = header[: header.find(":")].strip()
value = header[header.find(":") + 1 :].strip()
headers[name.lower()] = value
return headers | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _parse_headers(headers):\n try:\n return dict(header.split(\":\") for header in headers)\n except:\n raise ValueError(\"Invalid headers %s\" % headers)",
"def generate_header_dic(self, header_strings):\n headers = dict()\n\n for header_values in header_string... | [
"0.78225195",
"0.74253625",
"0.73871934",
"0.7215364",
"0.7209012",
"0.71768695",
"0.7095645",
"0.70905596",
"0.70813763",
"0.70813763",
"0.70154387",
"0.6994542",
"0.6965097",
"0.69445574",
"0.6913696",
"0.6835682",
"0.6808548",
"0.6762677",
"0.6754819",
"0.6710498",
"0.6692... | 0.806986 | 0 |
Reemplaza la(s) ocurrencia(s) de tag en el archivo por nstr | def rep(self,tag,nstr):
tmp = []
for line in self.content:
if tag in line:
tmp.append(line.replace(tag,nstr))
else:
tmp.append(line)
self.content = tmp | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ler_arquivo_xml(self, diretorio):\r\n with open(diretorio, 'r') as fxml:\r\n\t strfx = fxml.readlines()\r\n\t string = \"\".join(strfx).replace(\"&\",\" e \")\r\n return string",
"def archivoXl(archivo):\r\n return ow(archivo)",
"def SV_tag_length(tag_file, outPrefix):\r\n outdir... | [
"0.56019914",
"0.55601597",
"0.5558506",
"0.55486673",
"0.5365312",
"0.5310506",
"0.52868605",
"0.5284282",
"0.5265695",
"0.5260303",
"0.52433544",
"0.523879",
"0.52328277",
"0.52186084",
"0.52185684",
"0.5216578",
"0.51640344",
"0.5162988",
"0.51482356",
"0.5122066",
"0.5119... | 0.56634676 | 0 |
Salva los cambios al archivo especificado en newfile, o hace una copia del archivo original (filename+'~') y salva el contenido en "filename" | def saveFile(self,newfile=None):
if newfile == None:
shutil.move(self.filename,self.filename+'~')
self.handler = open(self.filename,'w')
else:
self.handler = open(newfile,'w')
self.handler.writelines(self.content)
self.handler.close() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def newfile(filename):\n # Open the new file for writing\n with open(filename, \"w\") as file:\n pass",
"def renewFile(filename):\n\n\tfileRepo = repertoire + filename + extension # Position du fichier\n\n\t# Ouvre en ecriture et l'ecrase\n\t# La methode with ferme le fichier automatiquement\n\twith... | [
"0.68023175",
"0.6601903",
"0.6470307",
"0.6256966",
"0.60828876",
"0.60267633",
"0.59504694",
"0.5871682",
"0.5786605",
"0.5738598",
"0.57240206",
"0.5673847",
"0.5622948",
"0.5617441",
"0.5615462",
"0.55986905",
"0.55614066",
"0.55208856",
"0.551383",
"0.55105835",
"0.55076... | 0.68237215 | 0 |
``summary'' is a systemgenerated summary. ``references'' is a list of humanmade reference summaries | def score_summary(self, summary, references, summary_id='A'):
try:
self._write_config(references, Doc(summary_id, summary))
output = self._run_rouge()
output = output.decode("utf-8")
return self._parse_output(output)
except CalledProcessError as e:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def summary(self, summary):\n\n self._summary = summary",
"def summary(self, summary):\n\n self._summary = summary",
"def summary(self, summary):\n\n self._summary = summary",
"def summary(self, summary: str):\n return self.swag({\n 'summary': summary\n })",
"d... | [
"0.58870405",
"0.58870405",
"0.58870405",
"0.5803425",
"0.5781204",
"0.5522118",
"0.5503257",
"0.54215056",
"0.53986794",
"0.53744864",
"0.53230405",
"0.5302629",
"0.52970827",
"0.5282875",
"0.5266578",
"0.52372295",
"0.5206945",
"0.5153626",
"0.5151684",
"0.5148715",
"0.5141... | 0.6722548 | 0 |
Display unpublished Draft Entries | def drafts():
query = Entry.drafts().order_by(Entry.last_mod_date.desc())
return object_list('index.html', query) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def drafts_view(self, request, object_id, extra_context=None):\n opts = self.model._meta\n action_list = [{\"revision\": version.revision,\n \"url\": reverse(\"admin:%s_%s_draft\" % (opts.app_label, opts.module_name), args=(version.object_id, version.revision.id))}\n ... | [
"0.7508209",
"0.6815543",
"0.6162445",
"0.6106849",
"0.60844666",
"0.6059696",
"0.60429025",
"0.60228574",
"0.6012785",
"0.59416395",
"0.5828027",
"0.5751404",
"0.5730366",
"0.57115114",
"0.5708828",
"0.5697832",
"0.5697832",
"0.5679159",
"0.5660224",
"0.5650022",
"0.56475645... | 0.73618597 | 1 |
Create new blog Entry | def create():
if request.method == 'POST':
if request.form.get('title') and request.form.get('content'):
entry = Entry.create(
title = request.form.get('title'),
content = request.form.get('content'),
published = request.form.get('published') or Fa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def createNewBlogEntry(self): #$NON-NLS-1$\r\n atomdoc = self._createNewEntryDocument()\r\n self._initNewEntryDocument(atomdoc)\r\n return ZAtomNewBlogEntry(atomdoc)",
"def blog_create(request):\n entry = BlogRecord()\n form = BlogCreateForm(request.POST)\n if request.method == 'POS... | [
"0.8232406",
"0.7668556",
"0.7641279",
"0.7607913",
"0.73694056",
"0.7322824",
"0.73227113",
"0.7250803",
"0.7247709",
"0.72167945",
"0.7215931",
"0.6994082",
"0.69597936",
"0.69173276",
"0.68832356",
"0.6816936",
"0.68142015",
"0.67737234",
"0.6718318",
"0.670351",
"0.669757... | 0.77166563 | 1 |
a function converting csv output files from operational_sep_quantities to json files for observations | def obs_csv2json(input_file,output_file,example_path,instrument):
obs_path = Path(cfg.obs_path)
with open(example_path,'r') as e:
example = js.load(e)
#deleting unused categories
del(example['sep_forecast_submission']['forecasts'])
del(example['sep_forecast_submission']['... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_dataset(input_file_path, output_file_path):\n col_index_map = {'user_id': 0, 'session_id': 1, 'timestamp': 2, 'step': 3, 'action_type': 4, 'reference': 5,\n 'platform': 6, 'city': 7, 'device': 8,\n 'current_filters': 9, 'impressions': 10, 'prices': 11}\n fla... | [
"0.60670656",
"0.5917598",
"0.5867013",
"0.577265",
"0.5737042",
"0.5713435",
"0.56811106",
"0.56413877",
"0.56257904",
"0.5622406",
"0.5606425",
"0.5585183",
"0.55736536",
"0.55720776",
"0.5546977",
"0.554406",
"0.55393744",
"0.5519248",
"0.5511894",
"0.5495278",
"0.5494552"... | 0.7022942 | 0 |
choose the correct instrument to use for observations for a given date range. inputs must be date objects from the datetime module. used if there is no information about which instrument was primary. | def choose_inst(given_start_date,given_end_date): #INPUTS MUST BE DATE OBJECTS
inst_start_dates=[]
inst_end_dates=[]
good_instruments = []
good_end_dates = []
bad_inst = []
#extracting dates where instruments are active from csv file
inst_dates = pd.read_csv(ref_path / 'instrument... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def choose_prime_inst(given_start_date,given_end_date):\r\n\r\n #extracting primary dates where instruments are active from csv file\r\n inst_prime_dates = pd.read_csv(ref_path / 'GOES_primary_assignments.csv', header=3)\r\n\r\n #figuring out which instrument is primary for given start date\r\n for d i... | [
"0.6696412",
"0.5244132",
"0.5244106",
"0.5234904",
"0.523354",
"0.5202343",
"0.50902385",
"0.49597186",
"0.4926985",
"0.49259138",
"0.4911848",
"0.48814812",
"0.4860115",
"0.48596224",
"0.48520213",
"0.48501316",
"0.4843819",
"0.4843819",
"0.48264506",
"0.48252285",
"0.48125... | 0.707812 | 0 |
choose the correct instrument to use for observations for a given date range based on the primary instrument for that time period. inputs must be date objects from the datetime module. | def choose_prime_inst(given_start_date,given_end_date):
#extracting primary dates where instruments are active from csv file
inst_prime_dates = pd.read_csv(ref_path / 'GOES_primary_assignments.csv', header=3)
#figuring out which instrument is primary for given start date
for d in range(len(inst_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def choose_inst(given_start_date,given_end_date): #INPUTS MUST BE DATE OBJECTS\r\n\r\n inst_start_dates=[]\r\n inst_end_dates=[]\r\n good_instruments = []\r\n good_end_dates = []\r\n bad_inst = []\r\n\r\n #extracting dates where instruments are active from csv file\r\n inst_dates = pd.read_csv... | [
"0.7161972",
"0.5350023",
"0.5343824",
"0.52754986",
"0.52716273",
"0.5243731",
"0.5240982",
"0.5149819",
"0.5139513",
"0.50795436",
"0.50315154",
"0.5018969",
"0.5007179",
"0.50046945",
"0.49793446",
"0.4966744",
"0.49542493",
"0.4934821",
"0.4922149",
"0.49216446",
"0.48913... | 0.68636316 | 1 |
will create JSON output files if there are two events (for each threshold) in one time window. Ie, if there are two >10MeV >10pfu events as well as two >100MeV >1pfu events, will create files for all four events, but if there are three >100MeV >1pfu events, will only generate JSON files for the first two. Second events... | def two_in_one(obs_file,et,subevent):
#in this function, the "original time window" talked about in the comments
#refers to the start and end times that were input to create the file obs_file,
#which will likely have been created using the database_extraction function
#opening first outp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def multi_event(st,et,instrument_chosen,subevent):\r\n print('checking for multiple events within given time window')\r\n \r\n #creating file for time window with first events for all thresholds\r\n out_name = Path(cfg.obs_path) / database_extraction(st,et,instrument_chosen,subevent)\r\n\r\n #creati... | [
"0.67087024",
"0.5573654",
"0.5543615",
"0.5325832",
"0.5257581",
"0.523323",
"0.5181749",
"0.5180666",
"0.51276666",
"0.5114678",
"0.51098496",
"0.5098101",
"0.5082852",
"0.5076031",
"0.50719666",
"0.5061145",
"0.50575876",
"0.5052095",
"0.5037945",
"0.5035007",
"0.5021967",... | 0.62420124 | 1 |
all events in one time window (not just two) used if there is more than one event occurring within a short time period. will generate an output file for every event that occurs within a given time window not to be confused with many_events, which generates output given multiple time windows. Can create files for up to ... | def multi_event(st,et,instrument_chosen,subevent):
print('checking for multiple events within given time window')
#creating file for time window with first events for all thresholds
out_name = Path(cfg.obs_path) / database_extraction(st,et,instrument_chosen,subevent)
#creating files for all ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def INPUT_Periods_file(input):\n \n global events\n \n tb = 3600\n ta = 3600\n \n Period = input['min_date'].split('T')[0] + '_' + \\\n input['max_date'].split('T')[0] + '_' + \\\n str(input['min_mag']) + '_' + str(input['max_mag'])\n eventpath = os.path.join(i... | [
"0.6087541",
"0.59404063",
"0.58714825",
"0.5870363",
"0.58608985",
"0.57862127",
"0.57703376",
"0.5700037",
"0.5650298",
"0.56280893",
"0.5617199",
"0.56035525",
"0.5598488",
"0.5553481",
"0.55442035",
"0.5541307",
"0.5524684",
"0.55119693",
"0.5496372",
"0.5496372",
"0.5493... | 0.6893672 | 0 |
given lists of peak fluxes for protons >10 MeV and >100 MeV, creates a boolean for whether or not each event is a subevent (doesn't cross a threshold) | def gen_subevent_bools(p_10,p_100):
#list of subevent booleans
subevent_bools = []
#extracting 10 MeV peak flux if it exists
for j in range(len(p_10)):
try:
p10 = float(p_10[j])
except ValueError:
p10 = 'nan'
#extracting 100 MeV pe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def spec_to_peaks(data, value, fp = iterate_structure(generate_binary_structure(rank = 2, connectivity=2), 10)):\n\n max_arr = maximum_filter(data, footprint = fp)\n return (data == max_arr) & (data > value)",
"def check_overlaps(self, verbose = False):\n if hasattr(self.phot, \"data\") and hasattr(... | [
"0.6195646",
"0.607271",
"0.5963362",
"0.5910339",
"0.5904927",
"0.5832219",
"0.57945627",
"0.5773653",
"0.563543",
"0.5589451",
"0.5549814",
"0.553361",
"0.55285126",
"0.5508843",
"0.5495379",
"0.54413253",
"0.54157656",
"0.5363649",
"0.532954",
"0.5318515",
"0.53176546",
... | 0.82217896 | 0 |
takes in lists of start times and end times to create a list of time windows, and a list of whether or not an event is a subevent, and uses those lists to run functions that extract data from the GOES database. Each list must have the same length, and indices of lists must correspond (ie start_time[j] has an end time o... | def many_events(start_time,end_time,subevent_bools):
#running through for each event
for j in range(len(start_time)):
#start, end, and subevent bool for this event
st = start_time[j]
et = end_time[j]
subevent = bool(subevent_bools[j])
#che... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def multi_event(st,et,instrument_chosen,subevent):\r\n print('checking for multiple events within given time window')\r\n \r\n #creating file for time window with first events for all thresholds\r\n out_name = Path(cfg.obs_path) / database_extraction(st,et,instrument_chosen,subevent)\r\n\r\n #creati... | [
"0.65961754",
"0.6502333",
"0.6414507",
"0.6089023",
"0.5852518",
"0.5768563",
"0.57619506",
"0.57517695",
"0.5713987",
"0.56655604",
"0.56637067",
"0.56566614",
"0.56286615",
"0.55703324",
"0.5542513",
"0.5491681",
"0.5479628",
"0.54761803",
"0.5450979",
"0.54409343",
"0.543... | 0.8048312 | 0 |
Returning the sync mode | def get_sync_mode():
return sync_mode | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def synchronize_system_mode(self):\n\n return self._synchronize_system_mode",
"def sync(self):\n return self._sync",
"def isSync(self):\n return False",
"def getMode(self):\n with self.lock:\n mode = self.mode\n return mode",
"def syncheck(self) :\n\t\ttry :\n\... | [
"0.72940135",
"0.7088847",
"0.7082289",
"0.7017716",
"0.6868106",
"0.68618685",
"0.68516916",
"0.6798914",
"0.6798914",
"0.6657855",
"0.64055157",
"0.6349925",
"0.63405436",
"0.6327484",
"0.63198066",
"0.63171744",
"0.631424",
"0.63071305",
"0.63044363",
"0.62617934",
"0.6251... | 0.91350996 | 0 |
Checking the sync_mode based on the given configuration | def check_sync_mode():
global sync_mode
_description = ''
_modes = {
SyncMode.RECEIVER: '(REMOTE ➔ LOCAL)',
SyncMode.SENDER: '(LOCAL ➔ REMOTE)',
SyncMode.PROXY: '(REMOTE ➔ LOCAL ➔ REMOTE)',
SyncMode.DUMP_LOCAL: '(LOCAL, ONLY EXPORT)',
SyncMode.DUMP_REMOTE: '(REMOTE, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_sync_mode():\n return sync_mode",
"def __check_mode(self):\n self.mode[\"auto_mode\"] = self.communications.get_mode()",
"def check_config_mode(self):\n return False",
"def __check_mode_change(self):\n if self.mode[\"auto_mode\"] != self.mode[\"last_mode\"]:\n self.... | [
"0.72925556",
"0.692381",
"0.6704957",
"0.63555396",
"0.63372236",
"0.61973035",
"0.61619157",
"0.6108568",
"0.6087788",
"0.6085571",
"0.6059644",
"0.60411906",
"0.60293037",
"0.60175145",
"0.594344",
"0.59315693",
"0.588756",
"0.58717567",
"0.58026725",
"0.580076",
"0.580005... | 0.78860736 | 0 |
Check if given client is remote client | def is_remote(client):
if client == Client.ORIGIN:
return is_origin_remote()
elif client == Client.TARGET:
return is_target_remote()
elif client == Client.LOCAL:
return False
else:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_remote(self): # -> Any | bool:\n ...",
"def is_remote(self):\n if socket.gethostbyname(socket.gethostname()).startswith('10.7'):\n return False\n else:\n return True",
"def is_local_client(self):\n return self.msg.is_local_client",
"def is_remote(self... | [
"0.7279024",
"0.7175781",
"0.70540047",
"0.6942053",
"0.6814598",
"0.6683476",
"0.66315174",
"0.66083586",
"0.6517704",
"0.6482558",
"0.6460855",
"0.6398728",
"0.63722503",
"0.6251613",
"0.62041306",
"0.62041306",
"0.61882174",
"0.615462",
"0.61380357",
"0.6073914",
"0.602614... | 0.83206755 | 0 |
Check if target is remote client | def is_target_remote():
return sync_mode in (SyncMode.SENDER, SyncMode.PROXY, SyncMode.DUMP_REMOTE,
SyncMode.IMPORT_REMOTE, SyncMode.SYNC_REMOTE) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_remote(client):\n if client == Client.ORIGIN:\n return is_origin_remote()\n elif client == Client.TARGET:\n return is_target_remote()\n elif client == Client.LOCAL:\n return False\n else:\n return False",
"def is_remote(self): # -> Any | bool:\n ...",
"def... | [
"0.7902426",
"0.7443142",
"0.7258655",
"0.7257651",
"0.7235301",
"0.6850371",
"0.6576049",
"0.645614",
"0.6447849",
"0.640186",
"0.6281278",
"0.61393785",
"0.60623175",
"0.60600775",
"0.600218",
"0.59922236",
"0.59744495",
"0.59468746",
"0.593498",
"0.5931949",
"0.59191805",
... | 0.7590158 | 1 |
Check if origin is remote client | def is_origin_remote():
return sync_mode in (SyncMode.RECEIVER, SyncMode.PROXY, SyncMode.DUMP_REMOTE,
SyncMode.IMPORT_REMOTE, SyncMode.SYNC_REMOTE) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_remote(client):\n if client == Client.ORIGIN:\n return is_origin_remote()\n elif client == Client.TARGET:\n return is_target_remote()\n elif client == Client.LOCAL:\n return False\n else:\n return False",
"def is_remote(self):\n return False",
"def is_remot... | [
"0.79242504",
"0.7800007",
"0.7686724",
"0.75528294",
"0.747566",
"0.7285064",
"0.70139563",
"0.6977031",
"0.6942172",
"0.6772315",
"0.6772315",
"0.6772315",
"0.6772315",
"0.67488825",
"0.6476083",
"0.6462293",
"0.64356977",
"0.63294023",
"0.6260433",
"0.6211482",
"0.62091947... | 0.8189138 | 0 |
Check if sync mode is import | def is_import():
return sync_mode in (SyncMode.IMPORT_LOCAL, SyncMode.IMPORT_REMOTE) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_sync_mode():\n global sync_mode\n _description = ''\n\n _modes = {\n SyncMode.RECEIVER: '(REMOTE ➔ LOCAL)',\n SyncMode.SENDER: '(LOCAL ➔ REMOTE)',\n SyncMode.PROXY: '(REMOTE ➔ LOCAL ➔ REMOTE)',\n SyncMode.DUMP_LOCAL: '(LOCAL, ONLY EXPORT)',\n SyncMode.DUMP_REMO... | [
"0.75585586",
"0.69149435",
"0.665945",
"0.64593935",
"0.6442651",
"0.63151574",
"0.63039666",
"0.6274873",
"0.6236776",
"0.6194281",
"0.6192882",
"0.6032196",
"0.59927666",
"0.59285295",
"0.59285295",
"0.59168273",
"0.5914921",
"0.58185005",
"0.57003963",
"0.5684882",
"0.567... | 0.9084145 | 0 |
Assert valid court order. | def test_court_orders(session, test_status, expected_code, expected_msg):
business = factory_business('BC1234567')
filing = copy.deepcopy(COURT_ORDER_FILING_TEMPLATE)
del filing['filing']['courtOrder']['fileKey']
if test_status == 'FAIL':
del filing['filing']['courtOrder']['orderDetails']
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_case_customer_complete_courseevent_order(self):",
"def test_order_constraint(self):\n orders_placed = [25, 25, 25]\n with self.assertRaises(Exception):\n analyse_uncertain_demand.UncertainDemand(\n orders=orders_placed,\n sku='Rx493-90',\n ... | [
"0.6418377",
"0.6131915",
"0.5973272",
"0.59159654",
"0.5835521",
"0.5678925",
"0.56525654",
"0.5622847",
"0.55975693",
"0.55640495",
"0.55434185",
"0.5528798",
"0.55012167",
"0.54883766",
"0.54165864",
"0.539526",
"0.53826475",
"0.5382484",
"0.5381499",
"0.5373344",
"0.53692... | 0.67318577 | 0 |
Find a text label for an axis describing a provided CSV column. | def get_label(column):
for key, label in column_to_label.items():
if key in column:
return label | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _label(self, column):\n # XXX\n return column",
"def _get_label ( self ):\n if self._label is not None:\n return self._label\n return 'Column %d' % (self.index + 1)",
"def GetColLabelValue(self, col):\n label = self.column_label(self.colsel[col])\n \n ... | [
"0.70492536",
"0.65161985",
"0.6515418",
"0.63260293",
"0.60894614",
"0.6023913",
"0.59223855",
"0.5880934",
"0.5865998",
"0.57208353",
"0.5644971",
"0.56144625",
"0.55985284",
"0.55886084",
"0.5540931",
"0.5496037",
"0.5494928",
"0.5494829",
"0.5493561",
"0.5486655",
"0.5454... | 0.7068317 | 0 |
Find all possible values of a column in the pandas.DataFram list | def dfs_all_values(dfs, column):
values = []
# loop over all (pandas.DataFrame, str) pairs
for df in dfs:
values.extend(df[column].tolist())
# set() removes duplicates
# sorted() converts Set to List and sort the elements
return sorted(set(values)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getValuesForColumn(self, columnname):\n return list(self.abundance_df[columnname].unique())",
"def get_values(df):\n return df.columns.values.tolist()",
"def get_binary_values(data_frame):\n all_columns = pandas.DataFrame( index = data_frame.index)\n for col in data_frame.columns:\n dat... | [
"0.6171805",
"0.6113757",
"0.5891988",
"0.5879397",
"0.58606875",
"0.5812586",
"0.57938266",
"0.5787178",
"0.57815653",
"0.5762439",
"0.5762439",
"0.56766194",
"0.56144273",
"0.5601676",
"0.5587507",
"0.5523211",
"0.55008084",
"0.5450795",
"0.5401311",
"0.5399768",
"0.5390941... | 0.6156369 | 1 |
Draw multiple lines y(x) using data from the dfs list on the ax subplot. | def draw_plot(ax, dfs, legend, x, y, xscale, yaxis_max):
xticks = dfs_all_values(dfs, x)
# loop over all pandas.DataFrame objects
for df in dfs:
# setting the x-column as an index is required to draw the y-column
# as a function of x argument
df = df.set_index(x)
# plot line ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot(x, y, *dfs):\n ax = None\n for df in dfs:\n ax = df[[x, y]].set_index(x).plot(kind='line', ylim=(0, None), xlim=(0, None), ax=ax)",
"def update_plot(self,ax):\n for i,line in enumerate(self.lines):\n line.set_ydata(self.data[i].f)\n for line in self.lines: \n ... | [
"0.75955755",
"0.6639895",
"0.63147664",
"0.6244438",
"0.6018296",
"0.5990527",
"0.59632486",
"0.5877029",
"0.58101994",
"0.58101994",
"0.5800447",
"0.5794655",
"0.5775401",
"0.57584023",
"0.5737174",
"0.5724625",
"0.5724219",
"0.57178116",
"0.56640327",
"0.56584495",
"0.5646... | 0.7199761 | 1 |
Draw a table of all data used to chart y(x) | def draw_table(ax, dfs, legend, x, y):
col_labels = dfs_all_values(dfs, x)
column_legend = []
cell_text = []
# loop over all pandas.DataFrame objects
for df in dfs:
# to allow query y(x) easily
df = df.set_index(x)
df_row = df[y]
# build a row with filled blanks '-'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def table(self):\n\n param=self.x_param\n\n device=self.device\n\n base_params=device.get_params()\n\n data_tot=DataFrame()\n\n for i in range(len(param)):\n\n print_index=1\n\n for name in param.names:\n\n device._set_params(param(i))\n\n ... | [
"0.64481795",
"0.6369142",
"0.61868083",
"0.615285",
"0.60729265",
"0.60604787",
"0.59911245",
"0.5980409",
"0.59740573",
"0.5895259",
"0.5869834",
"0.5847987",
"0.5836506",
"0.5818547",
"0.58129287",
"0.5809058",
"0.57461077",
"0.57257223",
"0.5720079",
"0.5665956",
"0.56587... | 0.67767966 | 0 |
Going to a nonchunkadmin URL should be ok, and should also put the `_data_changed` parameter onto the URL. | def test_to_other_url(self):
user = User(username='test', is_staff=True, is_superuser=True,
is_active=True)
user.set_password('test')
user.full_clean()
user.save()
request = RequestFactory().get('/')
response_302 = HttpResponseRedirect(redirect_to='/ad... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_returned_data_changed(self):\n request = RequestFactory().get('/')\n admin_instance = get_modeladmin(Iframe)\n response_302 = HttpResponseRedirect(redirect_to='/admin_mountpoint/')\n new_response = admin_instance.maybe_fix_redirection(\n request=request, response=res... | [
"0.6304963",
"0.60231835",
"0.5975458",
"0.59199995",
"0.57574075",
"0.5661228",
"0.56567496",
"0.5646688",
"0.56410176",
"0.5619408",
"0.5619408",
"0.5565735",
"0.5562113",
"0.5547753",
"0.5510401",
"0.55066466",
"0.54986465",
"0.54867476",
"0.54704493",
"0.54627734",
"0.544... | 0.6291411 | 1 |
If `_autoclose` is in the URL, that + `_data_changed` should propagate to the next redirect URL for the purposes of our adminlinks JS. | def test_autoclose_chunkadmin(self):
user = User(username='test', is_staff=True, is_superuser=True,
is_active=True)
user.set_password('test')
user.full_clean()
user.save()
admin_instance = get_modeladmin(Iframe)
self.assertIsInstance(admin_instance, Re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def response_post_save_change(self, request, obj):\n opts = self.model._meta\n\n if \"next\" in request.GET:\n return HttpResponseRedirect(request.GET['next'])\n\n if self.has_change_permission(request, None):\n post_url = reverse('admin:%s_%s_changelist' %\n ... | [
"0.5717953",
"0.56154025",
"0.5552884",
"0.5355236",
"0.5205197",
"0.5178103",
"0.49210623",
"0.48757377",
"0.48716828",
"0.48654342",
"0.48438132",
"0.48274982",
"0.48240012",
"0.48213187",
"0.47654843",
"0.47389874",
"0.46854186",
"0.46743634",
"0.46646327",
"0.463678",
"0.... | 0.5659059 | 1 |
if continue editing is hit, it should go back to the parent URL, I think? | def test_continue_editing_parent_object(self):
user = User(username='test', is_staff=True, is_superuser=True,
is_active=True)
user.set_password('test')
user.full_clean()
user.save()
admin_instance = get_modeladmin(Iframe)
self.assertIsInstance(admin_in... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def submit_and_back(self):\n self.submit(skip_confirm=True)\n self.parent().do_detail()",
"def submit_and_back(self):\n self.submit(skip_confirm=True)\n self.parent().do_detail()",
"def response_change(self, request, obj):\r\n \r\n # in these cases, the redirect is goo... | [
"0.6385778",
"0.6385778",
"0.6379418",
"0.62234807",
"0.6166165",
"0.61428994",
"0.6119325",
"0.6115395",
"0.61025864",
"0.60791975",
"0.6070473",
"0.6042546",
"0.60110354",
"0.60064095",
"0.600623",
"0.5988462",
"0.59622556",
"0.59316474",
"0.590217",
"0.58978534",
"0.589691... | 0.65077806 | 0 |
Generate immediate (different by one mismatch) neighbours of the given genome pattern | def _generate_immediate_neighbours(pattern: str) -> list:
generated = []
for i in range(len(pattern)):
if pattern[i] == 'A':
generated.extend([pattern[:i] + c + pattern[i + 1:] for c in LIST_A])
elif pattern[i] == 'C':
generated.extend([pattern[:i] + c + pattern[i + 1:] f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate_neighbours(pattern: str, mismatches: int) -> set:\n neighbourhood = set()\n neighbourhood.add(pattern)\n\n curr_patterns = [pattern]\n next_patterns = []\n\n for curr_mismatches in range(mismatches):\n for curr_pattern in curr_patterns:\n for neighbour in _generate_imm... | [
"0.6630292",
"0.6147133",
"0.61121386",
"0.6109716",
"0.6099266",
"0.60585225",
"0.60353184",
"0.5980777",
"0.59600437",
"0.5955379",
"0.58933324",
"0.5820584",
"0.5806383",
"0.5797996",
"0.5792484",
"0.5790195",
"0.57679236",
"0.5754327",
"0.5728205",
"0.5717146",
"0.5706085... | 0.7541577 | 0 |
Whether the given card matches this card | def is_match(self, card):
return self.suit == card.suit or self.value == card.value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _validate_card_match(self, chosen_card, active_card, active_suit):\n\t\treturn chosen_card.is_match(active_card) or chosen_card.suit == active_suit",
"def __eq__(self, other_card):\n if self.rank == other_card.rank or self.suit == other_card.suit:\n return True\n else:\n r... | [
"0.78050846",
"0.7451856",
"0.727455",
"0.7232319",
"0.718153",
"0.7173871",
"0.713753",
"0.7100822",
"0.67850065",
"0.6778596",
"0.6773867",
"0.674615",
"0.6730441",
"0.66842115",
"0.6663965",
"0.6543529",
"0.6535424",
"0.6506496",
"0.648398",
"0.64583373",
"0.6433088",
"0... | 0.8583878 | 0 |
Ensures that chosen_card is an acceptable match, given the active_card and active_suit | def _validate_card_match(self, chosen_card, active_card, active_suit):
return chosen_card.is_match(active_card) or chosen_card.suit == active_suit | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_chosen_card(self, allowed_cards, chosen_card):\n if self.action is not None:\n if self.action in allowed_cards:\n logger.info(f\"Successfully chose the card: {self.action}\")\n chosen_card = self.action\n else:\n logger.error(f\"{sel... | [
"0.70289963",
"0.70051605",
"0.6518905",
"0.6450109",
"0.63630843",
"0.630566",
"0.62759304",
"0.62171423",
"0.61978257",
"0.61198056",
"0.60976046",
"0.60950667",
"0.6085195",
"0.6076674",
"0.60443",
"0.60375905",
"0.60289156",
"0.59881556",
"0.59762114",
"0.59721756",
"0.59... | 0.82993805 | 0 |
If test_mode is True, an image of `screen` is saved | def save_screen(screen):
if not video_mode: # Don't record video
return False
# Make global variables writeable
global current_frame
global path_checked
frames_directory = os.path.dirname(
os.path.dirname(
os.path.realpath(__file__))) + "\\frames\\"
if not path_check... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def saveScreenPNG(self, filename):\n return nes_lib.saveScreenPNG(self.obj, filename)",
"def screen_shot(self):\n screen_size = '{}x{}@{}x{}/0'.format(self.screen[0], self.screen[1], self.screen[0], self.screen[1])\n subprocess.check_call([\n ADB_EXECUTOR, '-s', self.device_id, 's... | [
"0.65687513",
"0.64645797",
"0.62103873",
"0.6199405",
"0.6150051",
"0.6116136",
"0.6103849",
"0.6095868",
"0.60331243",
"0.6008139",
"0.5992217",
"0.5990289",
"0.59354466",
"0.5926195",
"0.58971107",
"0.5877742",
"0.58629024",
"0.5829966",
"0.58243024",
"0.57998353",
"0.5798... | 0.7221238 | 0 |
>>> find_good_recipes(9, 10) '5158916779' >>> find_good_recipes(5, 10) '0124515891' >>> find_good_recipes(18, 10) '9251071085' >>> find_good_recipes(2018, 10) '5941429882' | def find_good_recipes(improvement_num, count):
recipes = [3, 7]
elf1 = 0
elf2 = 1
while len(recipes) <= improvement_num + count:
elf1_value = recipes[elf1]
elf2_value = recipes[elf2]
recipe_sum = elf1_value + elf2_value
if recipe_sum > 9:
recipe_string = f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_get_similar_recipes(self):\n pass",
"def test_get_random_recipes(self):\n pass",
"def measure_the_work(pattern_to_find):\n recipes = [3, 7]\n keys = [int(key) for key in pattern_to_find]\n elf1 = 0\n elf2 = 1\n not_found = True\n\n while not_found:\n elf1_value =... | [
"0.62732804",
"0.61937374",
"0.6106467",
"0.59431934",
"0.59081733",
"0.5582103",
"0.5502457",
"0.5500289",
"0.5376491",
"0.53712493",
"0.53555405",
"0.53383607",
"0.52812743",
"0.52651393",
"0.5197361",
"0.5169107",
"0.516706",
"0.51159555",
"0.5107954",
"0.51040334",
"0.509... | 0.7260232 | 0 |
Set next handler of the chain | def set_next(self, handler):
self.next = handler
return handler | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_handler(self, handler):\n self.next_handler = handler",
"def _handler_changed(self, handler):\n if self.next is not None:\n self.next.handler = handler",
"def setNext(self, next):\n\t\t\tself.next = next",
"def next(self, next):\n\n self._next = next",
"def next(self... | [
"0.7661297",
"0.6707803",
"0.6030326",
"0.59693336",
"0.59693336",
"0.5968152",
"0.5833051",
"0.5818501",
"0.57607543",
"0.57461786",
"0.5692767",
"0.566452",
"0.5590942",
"0.5582867",
"0.557292",
"0.55651385",
"0.55508965",
"0.5547468",
"0.55370283",
"0.55218494",
"0.5515645... | 0.80296415 | 0 |
Look for and return any unexplored point including the given seed. Calling map.find_above(MSS) after map.block_down(MSS) will thus find strict supersets of the MSS, as the MSS itself has been blocked. | def find_above(self, seed):
superset_exists = self.solver.solve((i + 1) for i in seed)
if superset_exists:
return self.get_seed()
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_seed(self, seed):\n out = self.complement(seed)\n return self.solver.solve([(i + 1) for i in seed] + [-(i + 1) for i in out])",
"def choose_pos(self):\n s = self\n\n availablepos = []\n for dblock in s.pjs.dblocks:\n is_available = True\n\n for p... | [
"0.59967655",
"0.55694646",
"0.5480614",
"0.5397099",
"0.5393073",
"0.5385499",
"0.5333922",
"0.52977884",
"0.52768016",
"0.5189014",
"0.51889",
"0.518867",
"0.5116351",
"0.5088275",
"0.5082775",
"0.5077057",
"0.50351775",
"0.50136656",
"0.5006063",
"0.49916822",
"0.49692985"... | 0.7450136 | 0 |
Maximize a given seed within the current set of constraints. The Boolean direction parameter specifies up (True) or down (False) | def maximize_seed(self, seed, direction):
while True:
comp = self.complement(seed)
x = self.solver.new_var() + 1
if direction:
# search for a solution w/ all of the current seed plus at
# least one from the current complement.
s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def maximize(self):\n raise NotImplementedError",
"def solve(num_wizards, num_constraints, wizards, constraints):\n\n # print(num_wizards)\n # print(num_constraints)\n # print(wizards)\n # print(constraints)\n # node_set = set(wizards)\n \n\n\n def cost(sol,num_constraints,constraints... | [
"0.5255628",
"0.51518804",
"0.50815153",
"0.5040505",
"0.50042754",
"0.49726215",
"0.48932496",
"0.4887833",
"0.486175",
"0.48460725",
"0.4834822",
"0.4807731",
"0.48042133",
"0.47982746",
"0.47937402",
"0.4761865",
"0.4752347",
"0.4741787",
"0.47137696",
"0.46898678",
"0.466... | 0.7806484 | 0 |
Return the complement of a given set w.r.t. the set of mapped constraints. | def complement(self, aset):
return self.all_n.difference(aset) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def complement(self) -> 'RangeSet':\n return RangeSet(Range()) - self",
"def get_complement(seta):\n\n complement_set = set()\n\n for elem in seta:\n new_elem_tuple = (elem[0], float(D('1.0') - D(str(elem[1]))))\n complement_set.add(new_elem_tuple)\n\n return complement_set",
"def... | [
"0.6654452",
"0.6576406",
"0.63831866",
"0.62827057",
"0.58516365",
"0.5725783",
"0.56848663",
"0.5537928",
"0.5518822",
"0.54672354",
"0.5461112",
"0.5455276",
"0.5429003",
"0.5420453",
"0.5417606",
"0.54041857",
"0.5387203",
"0.5379959",
"0.53690493",
"0.5363554",
"0.535995... | 0.76911646 | 0 |
Add a given clause to the Map solver. | def add_clause(self, clause):
self.solver.add_clause(clause)
if self.dump is not None:
self.dump.write(" ".join(map(str, clause)) + " 0\n") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_clause(self, clause):\n self.abstract_clauses.append(clause)",
"def tell (self, clause):\n self.clauses.add(clause)",
"def add_clause(self, clause, soft=False):\n\n # first, map external literals to internal literals\n # introduce new variables if necessary\n cl = lis... | [
"0.7232271",
"0.68253154",
"0.64435804",
"0.64024657",
"0.6194685",
"0.589618",
"0.55395997",
"0.549732",
"0.5440252",
"0.5343942",
"0.5326947",
"0.5320732",
"0.52594405",
"0.5190137",
"0.5155156",
"0.50672406",
"0.49388227",
"0.48930344",
"0.48519868",
"0.48471695",
"0.48246... | 0.75571716 | 0 |
Sends a POST request containing `data` to url. `auth` should be a tuple containing (username, password). | def post(url, data, auth=None, retries=10):
if not url.startswith('http://'):
url = 'http://' + url
request = urllib2.Request(url)
if auth:
request.add_header('Authorization', 'Basic %s' % b64encode('%s:%s' % auth))
params = urllib.urlencode(data)
response = urllib2.urlopen(request... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_post_request(self, url, data):\n auth = (self.AUTH_ID, self.AUTH_TOKEN)\n headers = {'content-type': 'application/json'}\n return requests.post(url, data=data, auth=auth, headers=headers)",
"def _post(self, url, data=None):\n if data is not None:\n data = urllib.ur... | [
"0.6842728",
"0.6454791",
"0.63290054",
"0.6314501",
"0.62772477",
"0.6190568",
"0.61195064",
"0.6063945",
"0.60278213",
"0.5984815",
"0.5982844",
"0.5974754",
"0.59532285",
"0.5944688",
"0.5935827",
"0.59314847",
"0.5888572",
"0.58549273",
"0.5854561",
"0.58424336",
"0.57753... | 0.7495922 | 0 |
Collect characters while within a source record | def characters(self, content):
if self.in_source: self.chars += content | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def characters(self, data):\n pass",
"def cleanup_raw_data(buf):\n raw = str(buf, encoding='iso-8859-1').strip()\n records = raw.splitlines()\n return records",
"def extractCharacters(self):\n \n length, high=self.getSize() ##geting size of LineFrame object - high and length\n ... | [
"0.63615435",
"0.5877636",
"0.564212",
"0.5450437",
"0.53484285",
"0.5325434",
"0.5275199",
"0.52268296",
"0.51683784",
"0.51639074",
"0.5162519",
"0.5138824",
"0.5114489",
"0.51047087",
"0.50685495",
"0.50610465",
"0.5054689",
"0.5049034",
"0.50311816",
"0.50303805",
"0.5023... | 0.63518363 | 1 |
Create connection line constraint between item's handle and the port. | def constraint(self, item, handle, glue_item):
start = MatrixProjection(self.start, glue_item.matrix_i2c)
end = MatrixProjection(self.end, glue_item.matrix_i2c)
point = MatrixProjection(handle.pos, item.matrix_i2c)
cx = EqualsConstraint(point.x, start.x)
cy = BetweenConstraint(p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_fixed_distance_to_line_constraint():\n return FixedDistanceToLineConstraint()",
"def test_connect(self):\n line, head = self._get_line()\n self.tool.connect(line, head, (120, 50))\n cinfo = self.canvas.get_connection(head)\n self.assertTrue(cinfo is not None)\n ... | [
"0.5818294",
"0.5687332",
"0.5500008",
"0.52568966",
"0.5220818",
"0.5207515",
"0.52057487",
"0.505119",
"0.5035412",
"0.5020907",
"0.49766943",
"0.4966835",
"0.49285123",
"0.492827",
"0.492827",
"0.49215764",
"0.49072984",
"0.49011382",
"0.4897819",
"0.48977235",
"0.4889161"... | 0.6178213 | 0 |
Draw lifeline. We always draw the lifeline's head. We only draw the lifeline's lifetime when the lifetime is visible. | def draw_lifeline(self, box, context, bounding_box):
cr = context.cairo
cr.rectangle(0, 0, self.width, self.height)
stroke(context)
if (
context.hovered
or context.focused
or context.dropzone
or self._lifetime.visible
):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw_line():\n\n # Small Size Line\n glLineWidth(0.1)\n glColor3f(0.5, 1.0, 0.9)\n wid = 0\n while wid <= width:\n length = 0\n while length <= height:\n glBegin(GL_LINES)\n glVertex3f(0.0, length, 0.0)\n glVertex3f(wid, length, 0)\n glEn... | [
"0.6687818",
"0.6577214",
"0.65438086",
"0.64897895",
"0.63934726",
"0.63052434",
"0.6266094",
"0.6217813",
"0.61868715",
"0.61665386",
"0.6159552",
"0.6142421",
"0.6132305",
"0.60893184",
"0.60786086",
"0.60565233",
"0.60377926",
"0.60295296",
"0.6012153",
"0.59879833",
"0.5... | 0.6821605 | 0 |
Load data from CSV files and return them as numpy arrays The use_labels parameter indicates whether one should read the first column (containing class labels). If false, return all 0s. | def load_data(filename, use_labels=True):
# load column 1 to 8 (ignore last one)
data = np.loadtxt(open( filename), delimiter=',',
usecols=range(1, 9), skiprows=1)
if use_labels:
labels = np.loadtxt(open( filename), delimiter=',',
usecols=[0], skipro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load(self, path=\"../data_set/final-train-dataset.csv\", shuffle=False,\n onlyLabelToUse=None, useOnlyBestIndicators=False, binary=False):\n data = []\n labels = []\n\n with open(path) as csvfile:\n reader = csv.reader(csvfile, delimiter=',')\n skip = True... | [
"0.706477",
"0.68677425",
"0.6859685",
"0.6782772",
"0.67529887",
"0.6746655",
"0.67292655",
"0.66810787",
"0.66234106",
"0.65906125",
"0.6552061",
"0.65014195",
"0.64909846",
"0.646308",
"0.6431648",
"0.6414293",
"0.6412473",
"0.6407337",
"0.63972247",
"0.6389596",
"0.635698... | 0.7765821 | 0 |
Given a vector of predictions, save results in CSV format. | def save_results(predictions, filename):
with open(filename, 'w') as f:
f.write("id,ACTION\n")
for i, pred in enumerate(predictions):
f.write("%d,%f\n" % (i + 1, pred)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_results(file_path, predictions):\n with open(file_path, \"w\") as csv_file:\n writer = csv.writer(csv_file, delimiter=\",\")\n writer.writerow([\"Id\", \"Bound\"])\n for id, bound in enumerate(predictions):\n writer.writerow([id, bound])",
"def write_predictions(y_pre... | [
"0.7925112",
"0.75827205",
"0.75710183",
"0.75710183",
"0.7489846",
"0.74501824",
"0.73730016",
"0.7322112",
"0.70706344",
"0.6982982",
"0.69460446",
"0.6911982",
"0.6833308",
"0.6815102",
"0.67553407",
"0.6745336",
"0.6745336",
"0.6745336",
"0.6745336",
"0.6745336",
"0.67453... | 0.78001994 | 1 |
The following function is used to format the numbers. In the beginning "th, st, nd, rd" are removed | def clean_numbers(self, x):
# remove "th" after a number
matches = re.findall(r'\b\d+\s*th\b', x)
if len(matches) != 0:
x = re.sub(r'\s*th\b', " ", x)
# remove "rd" after a number
matches = re.findall(r'\b\d+\s*rd\b', x)
if len(matches) != 0:
x =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _format_numbers(smth: any) -> any:\n if isinstance(smth, int):\n return float(smth)\n elif smth == 'N.V.':\n return 0.0 # meaning, wine is of type 'non-vintage' and is made of grapes from more than one harvest\n else:\n return smth",
"def ordinal_filter(... | [
"0.67999727",
"0.62027526",
"0.61682063",
"0.6136683",
"0.6127746",
"0.6096326",
"0.60839456",
"0.6068743",
"0.6052151",
"0.5988611",
"0.5986997",
"0.59576005",
"0.59576005",
"0.59576005",
"0.5921066",
"0.59175247",
"0.59080505",
"0.59045625",
"0.59045625",
"0.58787817",
"0.5... | 0.7203597 | 0 |
This function is used to replace "yr,yrs" by year and "hr,hrs" by hour. | def year_and_hour(self, text):
# Find matches for "yr", "yrs", "hr", "hrs"
matches_year = re.findall(r'\b\d+\s*yr\b', text)
matches_years = re.findall(r'\b\d+\s*yrs\b', text)
matches_hour = re.findall(r'\b\d+\s*hr\b', text)
matches_hours = re.findall(r'\b\d+\s*hrs\b', text)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def replace_time(text, ori):\n r = ori\n if '**' in text:\n r = 'xxhour'\n else:\n try:\n # handle exceptions with custom rules\n f, s = text.split()\n s = 'am' if s[0] == 'a' else 'pm'\n l, r = f.split(':')\n if l == '' or l == '00':\n ... | [
"0.61535865",
"0.54928744",
"0.54547983",
"0.5405917",
"0.5310719",
"0.5267757",
"0.52620614",
"0.5259947",
"0.51755303",
"0.5144724",
"0.51272285",
"0.5085674",
"0.50707275",
"0.50623596",
"0.5054484",
"0.505168",
"0.5038544",
"0.50103486",
"0.500148",
"0.498647",
"0.4965652... | 0.7474295 | 0 |
Performs an HTTP request set in 'method'. Returns requests object The method will try to catch some of the typical errors and gather error messages from Newrelic API Each known error has a corresponding exception. All exceptions are inherited from generic NewRelicException If HTTP return code is not known a generic New... | def _request(self, method, *args, **kwargs):
try:
r = getattr(requests, method)(*args, **kwargs)
except AttributeError:
raise NewRelicException(
'Method {} is unsupported by requests module'
.format(method)
)
except requests.exc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_request(method, url, data=None, headers=None):\n try:\n if method == 'GET':\n resp = requests.get(url, headers=headers)\n return resp\n elif method == 'POST':\n resp = requests.post(url, json=data, headers=headers)\n return resp\n elif meth... | [
"0.62948996",
"0.62826276",
"0.62717605",
"0.6218818",
"0.61214685",
"0.6097778",
"0.6028783",
"0.59454954",
"0.5928931",
"0.5927472",
"0.5919466",
"0.5915387",
"0.584488",
"0.58434975",
"0.58159757",
"0.5748989",
"0.57105803",
"0.57093656",
"0.5705746",
"0.5681902",
"0.56764... | 0.7337592 | 0 |
Wrapper for requests GET method | def _get(self, *args, **kwargs):
return self._request('get', *args, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(self, *args, **kwargs):\n self.request(\"get\", *args, **kwargs)",
"def http_method_get():\n return 'GET'",
"def get(self, *path, **data):\n\t\treturn self.request('GET', *path, **data)",
"def _get(self, url):\n return self._request(url)",
"def get(self, *args, **kwargs):\n ... | [
"0.7811461",
"0.7689053",
"0.7667969",
"0.75441927",
"0.753764",
"0.75005716",
"0.7481838",
"0.746681",
"0.7408591",
"0.7339474",
"0.7280342",
"0.7256964",
"0.7247393",
"0.72263336",
"0.7189114",
"0.718059",
"0.7164386",
"0.7148469",
"0.71383345",
"0.71329045",
"0.7128152",
... | 0.79950804 | 0 |
Wrapper for requests POST method | def _post(self, *args, **kwargs):
return self._request('post', *args, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post(self, *args, **kwargs):\n return self._requests_call(util.requests_post, *args, **kwargs)",
"def http_method_post():\n return 'POST'",
"def http_post(self, **kwargs):\n return self.rabjcallable.post(**kwargs)",
"def post(self, *args, **kwargs):\n self.request(\"post\", *args,... | [
"0.7969932",
"0.746994",
"0.73935425",
"0.73165405",
"0.72691715",
"0.7221908",
"0.7146746",
"0.713131",
"0.71067417",
"0.707506",
"0.7030268",
"0.7027897",
"0.7024082",
"0.7005868",
"0.69719",
"0.6945976",
"0.69432557",
"0.6938295",
"0.6930771",
"0.68950063",
"0.6866864",
... | 0.7983252 | 0 |
Wrapper for requests PUT method | def _put(self, *args, **kwargs):
return self._request('put', *args, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def http_method_put():\n return 'PUT'",
"def put(self, *args, **kwargs):\n self.request(\"put\", *args, **kwargs)",
"def put(self, request, pk=None):\n\n return Response({'method': 'put'})",
"def do_PUT(self,):\n self.http_method = 'PUT'\n # Nothing to do for now.\n pass... | [
"0.7939011",
"0.792131",
"0.78856367",
"0.7825104",
"0.7805697",
"0.77722734",
"0.76859236",
"0.76859236",
"0.76859236",
"0.7676738",
"0.7652082",
"0.7603654",
"0.7537342",
"0.7523113",
"0.74227804",
"0.7417111",
"0.74126923",
"0.7345135",
"0.7330537",
"0.73288274",
"0.729239... | 0.82278174 | 0 |
Wrapper for requests DELETE method | def _delete(self, *args, **kwargs):
return self._request('delete', *args, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def http_delete(self, **kwargs):\n return self.rabjcallable.delete(**kwargs)",
"def _delete(self, url):\n return self._request(url, method=\"DELETE\")",
"def _delete(self, url, **kwargs):\n return self._call('DELETE', url, kwargs)",
"def delete(self, method, uri, query_param, request_par... | [
"0.80676454",
"0.805195",
"0.7881113",
"0.78649473",
"0.7842438",
"0.78090477",
"0.78055274",
"0.7791732",
"0.77519745",
"0.76926935",
"0.7613614",
"0.7541842",
"0.7470509",
"0.7459804",
"0.74210435",
"0.7401509",
"0.73857987",
"0.73857987",
"0.7379348",
"0.7372078",
"0.73668... | 0.8166634 | 0 |
Load JSON as a protobuf (pb2) object. Any calls to load protobuf objects from JSON in this repository should be through this function. Returns `None` if the loading failed. | def open_pbobject(path, pb_class):
assert path.endswith(".json"), 'File extension for {} needs to be json.'.format(path)
if path.startswith('s3://'):
return open_remote_pb_object(path, pb_class)
assert os.path.exists(path), f'Path not found: {path}'
with open(path, 'r', encoding='UTF-8') as json... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load(self):\n with io.open(self.filename, encoding='utf-8') as f:\n self.load_from_dict(json.loads(f.read()))",
"def load_json(json_str):\n return _api_internal._load_json(json_str)",
"def _localloadjson(path: str) -> JSONType:\n with open(path, encoding=\"utf-8\") as fh:\n r... | [
"0.57719094",
"0.57548875",
"0.5741168",
"0.568899",
"0.5675841",
"0.55961937",
"0.5520938",
"0.55098826",
"0.55086243",
"0.5459598",
"0.54020417",
"0.5388325",
"0.5387577",
"0.5386068",
"0.5349237",
"0.533662",
"0.53339887",
"0.53334725",
"0.5324513",
"0.5323394",
"0.5311550... | 0.5887734 | 0 |
Like open_pboject but source can be a path or a bytestring | def parse_pbobject(source, pb_class):
if isinstance(source, str):
return open_pbobject(source, pb_class)
elif isinstance(source, bytes):
pb_object = pb_class()
pb_object.ParseFromString(source)
return pb_object
else:
logging.error(f'cannot parse type {type(source)}') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def source(self) -> str | Path:\n ...",
"def open_pds(source):\n\t# if isinstance(source, file):\n\t# \treturn source\n\tif hasattr(source, \"read\"):\n\t\t# sys.stderr.write(\"Identified a file-like object by read() method existence\\n\")\n\t\treturn source\n\n\ttry:\n\t\t# For universal newlines -- i.e.... | [
"0.6619778",
"0.6433512",
"0.62496525",
"0.61425763",
"0.59727526",
"0.58300316",
"0.57773453",
"0.57492805",
"0.5733119",
"0.5724798",
"0.5724798",
"0.5724405",
"0.57121646",
"0.5667463",
"0.5616308",
"0.55945593",
"0.55895805",
"0.55895805",
"0.55895805",
"0.55640024",
"0.5... | 0.6567848 | 1 |
Save protobuf (pb2) object to JSON file with our standard indent, key ordering, and other settings. Any calls to save protobuf objects to JSON in this repository should be through this function. | def save_pbobject_as_json(pb_object, save_path):
if os.path.isdir(save_path):
save_path = os.path.join(save_path, generate_uid_from_pbobject(pb_object) + ".json")
assert save_path.endswith(".json"), 'File extension for {} needs to be json.'.format(save_path)
with open(save_path, "w", encoding='UTF-... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _save(self):\n with open(self.file_path, 'w') as fid:\n json.dump(self.data, fid, indent=4, sort_keys=True)",
"def save(self):\n with open(self.file_path, 'w', encoding=Config.ENCODING) as file:\n json.dump(self.data, file, indent=2, ensure_ascii=False)",
"def save(self)... | [
"0.64825857",
"0.63305324",
"0.62367463",
"0.61235774",
"0.61045235",
"0.6103396",
"0.60486585",
"0.59887636",
"0.5981807",
"0.5977813",
"0.59710145",
"0.5964725",
"0.5957643",
"0.5951203",
"0.5950735",
"0.59460485",
"0.59422106",
"0.5939334",
"0.592283",
"0.59114516",
"0.591... | 0.72667795 | 0 |
Open ontology objects, first attempt to open V2 before trying V1. | def open_ontology_pbobject(ontology_file):
try:
ontology = parse_pbobject(ontology_file, OntologyV2Pb2)
if ontology is not None:
logging.info('Successfully loaded Ontology V2 spec.')
return ontology
except Exception:
logging.error('Failed to load ontology file wit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def open(self):\n\n self._key_generator = KeyGenerator()\n\n # A map from LOD to LODHistory instance for all LODs that have\n # been referenced so far:\n self._lod_histories = {}\n\n # This corresponds to the 'nodes' table in a Subversion fs. (We\n # don't need a 'representations' or 'strings' t... | [
"0.56189865",
"0.5365172",
"0.52742535",
"0.5039581",
"0.50218326",
"0.50218326",
"0.50218326",
"0.49638537",
"0.48817602",
"0.48285356",
"0.47886187",
"0.47444418",
"0.47354096",
"0.47354096",
"0.47251382",
"0.47234756",
"0.4720916",
"0.4704863",
"0.46936986",
"0.4692322",
"... | 0.6786061 | 0 |
Open feature ontology objects. | def open_feature_ontology_pbobject(ontology_file):
try:
ontology = open_pbobject(ontology_file, FeatureOntologyPb2)
if ontology is not None:
logging.info('Successfully loaded FeatureOntology spec.')
return ontology
except Exception:
logging.error('Failed to load o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_ontology_db_xrefs(self, feature):\n ontology = collections.defaultdict(dict) # type: dict\n db_xrefs = []\n # these are keys are formatted strangely and require special parsing\n for key in (\"go_process\", \"go_function\", \"go_component\"):\n ontology_event_index ... | [
"0.5661019",
"0.55700505",
"0.5532482",
"0.5513073",
"0.5394623",
"0.53802025",
"0.53731954",
"0.53539014",
"0.5332702",
"0.53029007",
"0.53000814",
"0.52954465",
"0.52883095",
"0.5224929",
"0.522275",
"0.5220456",
"0.5214841",
"0.5178848",
"0.5178848",
"0.5178848",
"0.517366... | 0.7093566 | 0 |
From a list of 'scene.json' and/or 'scene_.json' paths in s3, return a Scene object for the one with the latest timestamp. | def get_latest_scene(s3_scene_jsons):
# Fetch all 'scene*.json' files and load Scenes
scenes = [open_remote_pb_object(scene_json, Scene) for scene_json in s3_scene_jsons]
# Find Scene with latest creation timestamp
creation_ts = [_s.creation_date.ToMicroseconds() for _s in scenes]
index = creation_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_latest_year_month_day_prefix(s3_path):\n latest = date.min\n keys = get_contents_of_directory(s3_path)\n\n for key in keys:\n search = re.search(r'.*year=(\\d{4}).*month=(\\d{2}).*day=(\\d{2})', key)\n if search:\n year, month, day = search.groups()\n bucket_dat... | [
"0.61708826",
"0.5877487",
"0.55048525",
"0.5477997",
"0.54031044",
"0.5294818",
"0.5293787",
"0.52524304",
"0.5156226",
"0.5150664",
"0.5150446",
"0.512073",
"0.49706817",
"0.49576333",
"0.4952994",
"0.49373975",
"0.4913797",
"0.4860639",
"0.48384994",
"0.4826581",
"0.482025... | 0.7924387 | 0 |
It builds the configuration space with the needed hyperparameters. It is easily possible to implement different types of hyperparameters. Beside floathyperparameters on a log scale, it is also able to handle categorical input parameter. | def get_configspace():
cs = CS.ConfigurationSpace()
# Learning rate hyperparameter
lr = CSH.UniformFloatHyperparameter('lr', lower=1e-6, upper=1e-1, default_value='1e-2', log=True)
# Stochastic gradient descent momentum as parameter.
sgd_momentum = CSH.Unifo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_configspace():\r\n cs = CS.ConfigurationSpace()\r\n\r\n lr = CSH.UniformFloatHyperparameter('lr', lower=1e-6, upper=1e-1, default_value='1e-2', log=True)\r\n\r\n # For demonstration purposes, we add different optimizers as categorical hyperparameters.\r\n # To sh... | [
"0.7177107",
"0.68647355",
"0.66281545",
"0.6522021",
"0.6518543",
"0.651809",
"0.651809",
"0.6490908",
"0.64341015",
"0.6414481",
"0.6403292",
"0.63531125",
"0.6241054",
"0.62265354",
"0.62035",
"0.6195846",
"0.61952543",
"0.61585575",
"0.6135327",
"0.6123834",
"0.61211634",... | 0.713302 | 1 |
Method computes lookup tables of the cumulative ``galprop`` PDF defined by ``input_galaxy_table``. | def build_one_point_lookup_table(self, **kwargs):
galaxy_table = kwargs['input_galaxy_table']
prim_galprop_bins = kwargs['prim_galprop_bins']
self.one_point_lookup_table = np.zeros(
len(prim_galprop_bins)+1, dtype=object)
binned_prim_galprop = np.digitize(
galax... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _mc_galprop(self, seed=None, **kwargs):\n model_helpers.update_param_dict(self, **kwargs)\n self._set_correlation_strength()\n\n if ('galaxy_table' in kwargs.keys()) & ('halos' in kwargs.keys()):\n msg = (\"The mc_\"+self.galprop_key+\" method accepts either \" + \n ... | [
"0.5527577",
"0.48766977",
"0.48666936",
"0.48461375",
"0.48401406",
"0.48253617",
"0.48167393",
"0.47914568",
"0.4777298",
"0.46711516",
"0.46498317",
"0.46371827",
"0.46279138",
"0.46278507",
"0.4626222",
"0.46053305",
"0.45921257",
"0.45880622",
"0.4578638",
"0.45648557",
... | 0.63473904 | 0 |
Method creates ``self.param_dict`` regulating the strength of the correlation between sec_haloprop and galprop at each value of prim_galprop. | def _build_param_dict(self, **kwargs):
if 'correlation_strength' in kwargs.keys():
correlation_strength = kwargs['correlation_strength']
if custom_len(correlation_strength) > 1:
try:
self.correlation_strength_abcissa = kwargs['correlation_str... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gen_params(self) -> Dict:\n param_dict: Dict = {}\n\n gX_name: List[str] = ['g_leak', 'g_nav', 'g_kvhh', 'g_kva', 'g_kvsi', \n 'g_cav', 'g_kca', 'g_nap', 'g_kir']\n gX_log: np.ndarray = 4 * np.random.rand(9) - 2 # from -2 to 2\n gX: np.ndarray = (10 * np.one... | [
"0.6686416",
"0.6469411",
"0.64443755",
"0.6407086",
"0.5964358",
"0.5906427",
"0.5815626",
"0.57940143",
"0.5791521",
"0.5775666",
"0.5771342",
"0.5738936",
"0.57148474",
"0.57035136",
"0.56996524",
"0.5679744",
"0.56791604",
"0.56763065",
"0.56688666",
"0.56636876",
"0.5646... | 0.70243114 | 0 |
Method uses the current values in the param_dict to update the strength of the correlation between sec_haloprop and galprop at each value of prim_galprop. | def _set_correlation_strength(self):
if hasattr(self, 'correlation_strength_abcissa'):
abcissa = self.correlation_strength_abcissa
ordinates = [self.param_dict['correlation_param'+str(i+1)] for i in range(len(abcissa))]
correlation_strength_spline = model_helpers.custom_spli... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _mc_galprop(self, seed=None, **kwargs):\n model_helpers.update_param_dict(self, **kwargs)\n self._set_correlation_strength()\n\n if ('galaxy_table' in kwargs.keys()) & ('halos' in kwargs.keys()):\n msg = (\"The mc_\"+self.galprop_key+\" method accepts either \" + \n ... | [
"0.6255577",
"0.62177485",
"0.6214475",
"0.5984097",
"0.5967375",
"0.59337133",
"0.59327203",
"0.59210086",
"0.58783424",
"0.5867557",
"0.57922786",
"0.57610255",
"0.57574403",
"0.57097393",
"0.5705617",
"0.5699275",
"0.56962854",
"0.5681587",
"0.5657348",
"0.56380326",
"0.56... | 0.63643956 | 0 |
Method calls ``new_haloprop_func_dict`` to create new halo properties as columns to the mock catalog, if applicable. | def add_new_haloprops(self, galaxy_table):
if hasattr(self, 'new_haloprop_func_dict'):
d = self.new_haloprop_func_dict
for key, func in d.iteritems():
if key not in galaxy_table.keys():
galaxy_table[key] = func(galaxy_table=galaxy_table) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_make_hmp(self):\n table_factory = DataTableFactory(PACKET_DIR)\n table_factory.hmp()",
"def _parse_constructor_kwargs(self, **kwargs):\n\n try:\n halo_id = np.array(kwargs['halo_id'])\n assert type(halo_id) is np.ndarray\n Nhalos = custom_len(halo_id... | [
"0.53807044",
"0.52395046",
"0.50270265",
"0.49795195",
"0.49258766",
"0.49224955",
"0.4920414",
"0.49198395",
"0.49087453",
"0.49079537",
"0.48617426",
"0.48479292",
"0.4806662",
"0.48012027",
"0.47516495",
"0.47495013",
"0.47483745",
"0.46836653",
"0.46500537",
"0.46343023",
... | 0.639631 | 0 |
Currently not implemented First print returns date of modifications to the video file Second print prints date of Creation of the video file, literally time when it was written to folder | def creation_date_video(path_to_file):
print("Last modified: %s" % time.ctime(os.path.getmtime(path_to_file)))
print("Created: %s" % time.ctime(os.path.getctime(path_to_file)))
# return os.path.getctime(path_to_file) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_timestamps(dir_video):\n print(\"Adding creation dates to file names\")\n os.chdir(dir_video)\n # get only top level dir info\n dir_data_video_files = next(os.walk(dir_video))\n list_video_files = dir_data_video_files[2] # get file list\n for f_name in list_video_files:\n if GOPRO... | [
"0.6664668",
"0.6570803",
"0.6459046",
"0.6410988",
"0.63897413",
"0.6233249",
"0.6155345",
"0.6155294",
"0.6054676",
"0.6041707",
"0.6028616",
"0.59397346",
"0.5918884",
"0.5896831",
"0.58840746",
"0.5882793",
"0.58803463",
"0.587276",
"0.5860853",
"0.5849358",
"0.58296496",... | 0.8283047 | 0 |
Actions for Diffrn objects. | def action_diffrn(obj: Diffrn, thread: QtCore.QThread):
w_actions = []
f_setup = obj.is_attribute("setup")
f_diffrn_radiation = obj.is_attribute("diffrn_radiation")
f_diffrn_orient_matrix = obj.is_attribute("diffrn_orient_matrix")
f_diffrn_refln = obj.is_attribute("diffrn_refln")
f_phase = obj.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_diffs(history):\n\n # First get all possible representations\n mgr = plugins_get_mgr() \n keys = mgr.search('representation')['representation']\n representations = [mgr.get_by_key('representation', k) for k in keys]\n\n for i in range(len(history)):\n if i+1 > len(history) - 1:\n ... | [
"0.5404981",
"0.53203255",
"0.52869326",
"0.5260477",
"0.52597624",
"0.5186789",
"0.518508",
"0.5163919",
"0.514824",
"0.50897974",
"0.50714517",
"0.50684255",
"0.50684255",
"0.5065854",
"0.5063287",
"0.50580245",
"0.5037629",
"0.50206566",
"0.50169116",
"0.5014264",
"0.50007... | 0.5864252 | 0 |
Method to scan product. Adds the product order to the list of orders. | def scan(self, product_code):
self.order.add_product(product_code) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add(self, product):\n pass",
"def orderWatch(self, order):\r\n\t\tself.orders.append(order)",
"def add_product(self):\n self.owner.new_product(self.barcode, self.description, self.price, self._add_product_callback)",
"def orderWatch(self, order):\r\n\t\tself.pair.orders.append(order)",
"d... | [
"0.6195393",
"0.6153183",
"0.6137681",
"0.60344553",
"0.60218424",
"0.5938747",
"0.582828",
"0.57936937",
"0.576499",
"0.5742286",
"0.57390934",
"0.57390934",
"0.56984586",
"0.56835234",
"0.5683081",
"0.567723",
"0.5611014",
"0.55724466",
"0.5555511",
"0.5555511",
"0.5548241"... | 0.7857374 | 0 |
Attribute which calculates the total amount on the order after deducting discounts. | def total(self):
total_price = self.get_total_amount()
discounts = self.get_total_discount()
return total_price - discounts | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def discount_amount(self):\r\n customer = self.records.find_customers(str(self.__customer).strip())\r\n order_value = self.order_value\r\n discount = customer.get_discount(order_value)\r\n return discount",
"def total_amount(self):\n full_price = sum(item.price for item in self... | [
"0.67122465",
"0.6551784",
"0.6532095",
"0.6519561",
"0.651557",
"0.6478766",
"0.6468313",
"0.6403922",
"0.63672656",
"0.63636285",
"0.63349086",
"0.63340664",
"0.6284223",
"0.62303615",
"0.62296844",
"0.6176185",
"0.61685467",
"0.61363816",
"0.61200655",
"0.61124754",
"0.608... | 0.66989225 | 1 |
Calculates total discount applicable on this order. | def get_total_discount(self):
total_discount = 0.00
for promotion in self.pricing_rules:
discount = promotion.get_discount(self.order)
total_discount += discount
return total_discount | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def discount_amount(self):\r\n customer = self.records.find_customers(str(self.__customer).strip())\r\n order_value = self.order_value\r\n discount = customer.get_discount(order_value)\r\n return discount",
"def calculate_total(self):\n if self.total_price == 0:\n fo... | [
"0.76241744",
"0.73756224",
"0.7202873",
"0.70788705",
"0.6990974",
"0.6952235",
"0.6787426",
"0.67570555",
"0.6640429",
"0.6552841",
"0.652841",
"0.64726514",
"0.64331007",
"0.64018595",
"0.6394077",
"0.6384539",
"0.6307665",
"0.62925327",
"0.6282091",
"0.6279652",
"0.627704... | 0.8006258 | 0 |
Return total but in a pretty format with Euro sign. | def get_total_display(self):
total = self.total
return '%.2f\N{euro sign}' % total | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_total_elle(self):\r\n \r\n return str(round(self._total_elle, 2))",
"def get_total(self):\r\n \r\n return str(round(self._total, 2))",
"def amount_ui(self) -> str:\n return \"{:,.2f}\".format(self.amount)",
"def display_price(self):\n return '$ '+str(self.pri... | [
"0.6930728",
"0.6926814",
"0.6910748",
"0.69088656",
"0.65733093",
"0.6563159",
"0.65392554",
"0.6340894",
"0.62750125",
"0.62716407",
"0.62608546",
"0.6224019",
"0.6152539",
"0.61229",
"0.6107103",
"0.60937685",
"0.60425156",
"0.6040899",
"0.60386825",
"0.6008453",
"0.599921... | 0.81358236 | 0 |
MessagingCampaign a model defined in Swagger | def __init__(self):
self.swagger_types = {
'id': 'str',
'name': 'str',
'date_created': 'datetime',
'date_modified': 'datetime',
'version': 'int',
'division': 'DomainEntityRef',
'campaign_status': 'str',
'callable_tim... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post(self):\n json_data = request.get_json()\n json_data[\"sender_id\"] = current_user.id\n try:\n new_campaign = self.schema.load(json_data)\n except ValidationError as err:\n return {\"message\": err.messages}, HTTPStatus.BAD_REQUEST\n if Campaign.quer... | [
"0.5676597",
"0.56284505",
"0.528872",
"0.5195491",
"0.5169349",
"0.5091118",
"0.50815505",
"0.5049281",
"0.50430477",
"0.5014071",
"0.4998264",
"0.4988041",
"0.49813396",
"0.49767828",
"0.49386248",
"0.49370554",
"0.49350393",
"0.49330032",
"0.49310178",
"0.49302855",
"0.492... | 0.5792911 | 0 |
Sets the date_created of this MessagingCampaign. | def date_created(self, date_created):
self._date_created = date_created | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def date_created(self, date_created: datetime):\n\n self._date_created = date_created",
"def date_created(self, date_created):\n\n self._date_created = date_created",
"def date_created(self, date_created):\n\n self._date_created = date_created",
"def date_created(self, date_created):\n\n... | [
"0.80591285",
"0.79904276",
"0.79904276",
"0.79904276",
"0.7909916",
"0.7909916",
"0.7818758",
"0.7676886",
"0.7676886",
"0.7676886",
"0.7676886",
"0.7676886",
"0.7632258",
"0.759261",
"0.7258268",
"0.69510114",
"0.6808352",
"0.67060393",
"0.67060393",
"0.67060393",
"0.664208... | 0.80568826 | 1 |
Gets the date_modified of this MessagingCampaign. | def date_modified(self):
return self._date_modified | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_modified_at(self) -> str:\n return pulumi.get(self, \"last_modified_at\")",
"def last_modified_at(self) -> str:\n return pulumi.get(self, \"last_modified_at\")",
"def get_last_modified_date(self):\n\t\treturn call_sdk_function('PrlVmCfg_GetLastModifiedDate', self.handle)",
"def modifie... | [
"0.72402114",
"0.72402114",
"0.71875286",
"0.7092818",
"0.70100117",
"0.6977944",
"0.6977944",
"0.69701886",
"0.69357944",
"0.69300026",
"0.69300026",
"0.69300026",
"0.69300026",
"0.69300026",
"0.69300026",
"0.6924368",
"0.6924368",
"0.6866872",
"0.6866872",
"0.68586713",
"0.... | 0.81347257 | 0 |
Sets the date_modified of this MessagingCampaign. | def date_modified(self, date_modified):
self._date_modified = date_modified | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def date_modified(self, date_modified):\n\n self._date_modified = date_modified",
"def date_modified(self, date_modified):\n\n self._date_modified = date_modified",
"def date_modified(self, date_modified):\n\n self._date_modified = date_modified",
"def date_modified(self, date_modified):... | [
"0.7839285",
"0.7839285",
"0.7839285",
"0.7839285",
"0.7839285",
"0.7839285",
"0.7839285",
"0.75868607",
"0.75868607",
"0.64068264",
"0.64068264",
"0.63872856",
"0.6339021",
"0.6339021",
"0.6242144",
"0.61531746",
"0.6107971",
"0.6012136",
"0.5762818",
"0.5762818",
"0.575947"... | 0.7893535 | 0 |
Sets the version of this MessagingCampaign. Required for updates, must match the version number of the most recent update | def version(self, version):
self._version = version | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def version(self, version):\n self._version = version",
"def version(self, version):\n self._version = version",
"def set_version(self, version: str) -> None:\n if self.current_version == version:\n return\n self.current_version = version\n self._del_cached_propert... | [
"0.72409934",
"0.72409934",
"0.71715456",
"0.71619844",
"0.71619844",
"0.71619844",
"0.71619844",
"0.71619844",
"0.71619844",
"0.71619844",
"0.71619844",
"0.71619844",
"0.71619844",
"0.71619844",
"0.71619844",
"0.71619844",
"0.71619844",
"0.71619844",
"0.71619844",
"0.71619844"... | 0.7293403 | 0 |
Gets the division of this MessagingCampaign. The division this entity belongs to. | def division(self):
return self._division | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subdivision(self) -> Optional[str]:\n return pulumi.get(self, \"subdivision\")",
"def subdivision(self) -> Optional[str]:\n return pulumi.get(self, \"subdivision\")",
"def get_group(self):\n return self._group",
"def getGroup(self):\n\t\treturn self.Group",
"def get_domain(self):\n... | [
"0.5810358",
"0.5810358",
"0.51984763",
"0.5110629",
"0.50223154",
"0.5020974",
"0.50027514",
"0.49567127",
"0.49472067",
"0.49352798",
"0.49319625",
"0.49162114",
"0.4908078",
"0.4903234",
"0.488874",
"0.488874",
"0.488874",
"0.4876585",
"0.4860735",
"0.48574632",
"0.4844820... | 0.6648795 | 0 |
Sets the division of this MessagingCampaign. The division this entity belongs to. | def division(self, division):
self._division = division | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def division(self, division):\n\n self._division = division",
"def set_divide(self, a_divide):\n self.set_parameter('divide', a_divide)\n return self",
"def SetBoundaryCriterion(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ShapeDivideContinuity_SetBoundaryCriterion(self, *args)... | [
"0.6715935",
"0.48573586",
"0.48263213",
"0.45991567",
"0.45864677",
"0.458617",
"0.45811203",
"0.44704387",
"0.44482273",
"0.4443386",
"0.4443386",
"0.44264278",
"0.44212875",
"0.439743",
"0.43385282",
"0.43234468",
"0.43153226",
"0.4298492",
"0.4283395",
"0.42175615",
"0.41... | 0.66989917 | 1 |
Gets the campaign_status of this MessagingCampaign. The current status of the messaging campaign. A messaging campaign may be turned 'on' or 'off'. | def campaign_status(self):
return self._campaign_status | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_status(self):\n # TODO retrieve from db if not set\n return self.status",
"def get_status(self):\n return self._status",
"def get_status(self):\n statuses = dict(ACTIVITY_STATUS_CHOICES)\n return statuses.get(self.status, \"N/A\")",
"def campaign_status(self, campai... | [
"0.6404847",
"0.6360354",
"0.62657183",
"0.62341815",
"0.6217242",
"0.6217242",
"0.6217242",
"0.62143916",
"0.61250436",
"0.6114817",
"0.6114813",
"0.60491306",
"0.6047289",
"0.6042757",
"0.6023667",
"0.6022818",
"0.5983734",
"0.59719783",
"0.5946572",
"0.5946572",
"0.5946572... | 0.8441347 | 0 |
Sets the campaign_status of this MessagingCampaign. The current status of the messaging campaign. A messaging campaign may be turned 'on' or 'off'. | def campaign_status(self, campaign_status):
allowed_values = ["on", "stopping", "off", "complete", "invalid"]
if campaign_status.lower() not in map(str.lower, allowed_values):
# print("Invalid value for campaign_status -> " + campaign_status)
self._campaign_status = "outdated_sdk... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def campaign_status(self):\n return self._campaign_status",
"def set_activity(self, status):\n self._activity = status",
"def set_status(self, status):\n self.status = status",
"def set_status(self, status):\n self.status = status",
"def set_status(self, status):\n self.s... | [
"0.6368695",
"0.61262167",
"0.5973353",
"0.5973353",
"0.5973353",
"0.5827563",
"0.57827497",
"0.5776234",
"0.5757022",
"0.5722353",
"0.5680996",
"0.56777996",
"0.5648092",
"0.5639821",
"0.5627372",
"0.55989665",
"0.5592994",
"0.5582759",
"0.5582326",
"0.55720466",
"0.55364394... | 0.7548788 | 0 |
Gets the callable_time_set of this MessagingCampaign. The callable time set for this messaging campaign. | def callable_time_set(self):
return self._callable_time_set | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def callable_time_set(self, callable_time_set):\n \n self._callable_time_set = callable_time_set",
"def schedule_times(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"schedule_times\")",
"def getScheduleOnset(self):\n return DPxGetDinSchedOnset()",
"def get_schedules... | [
"0.6893189",
"0.55124503",
"0.54107213",
"0.5211071",
"0.5081652",
"0.5053929",
"0.4999273",
"0.4996595",
"0.4996595",
"0.4996595",
"0.49755397",
"0.4962994",
"0.49513596",
"0.4948963",
"0.4948963",
"0.4948963",
"0.4948963",
"0.4948963",
"0.4948963",
"0.4948963",
"0.4948963",... | 0.8133848 | 0 |
Sets the callable_time_set of this MessagingCampaign. The callable time set for this messaging campaign. | def callable_time_set(self, callable_time_set):
self._callable_time_set = callable_time_set | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def callable_time_set(self):\n return self._callable_time_set",
"def set_time(self, set_time):\n\n self._set_time = set_time",
"def setScheduleOnset(self, onset):\n DPxSetDinSchedOnset(onset)",
"def setShowCallables(self, show_callables):\n logger.debug(\"setShowCallables: {}\".fo... | [
"0.65908307",
"0.6178317",
"0.5953841",
"0.5100885",
"0.49795374",
"0.49558243",
"0.483162",
"0.48207587",
"0.48039177",
"0.477478",
"0.47390914",
"0.47065333",
"0.47013178",
"0.4697793",
"0.4662012",
"0.46349522",
"0.45914975",
"0.45656434",
"0.45478013",
"0.45220882",
"0.45... | 0.8699226 | 0 |
Gets the contact_list of this MessagingCampaign. The contact list that this messaging campaign will send messages for. | def contact_list(self):
return self._contact_list | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_contacts(self):\n return self.contacts",
"def get_contacts(self):\n\n\t\treturn self.__contacts",
"def GetContactList(self):\n\t\tfeeds = []\n\t\tfeed = self.client.GetContacts()\n\t\tfeeds.append(feed)\n\t\tnext = feed.GetNextLink()\n\t\twhile next:\n\t\t\tfeed = self.client.GetContacts(uri=ne... | [
"0.72631705",
"0.71663344",
"0.7121245",
"0.6652589",
"0.65349084",
"0.64175344",
"0.63972867",
"0.6386485",
"0.63770306",
"0.63157517",
"0.61904186",
"0.61765337",
"0.6132532",
"0.6121634",
"0.6121634",
"0.602559",
"0.6003591",
"0.59747976",
"0.5964907",
"0.5926964",
"0.5926... | 0.8081953 | 0 |
Sets the contact_list of this MessagingCampaign. The contact list that this messaging campaign will send messages for. | def contact_list(self, contact_list):
self._contact_list = contact_list | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def receiveContactList(self, contactList):",
"def set_contacts(self, contacts):\n\n\t\tif contacts is not None and not isinstance(contacts, list):\n\t\t\traise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: contacts EXPECTED TYPE: list', None, None)\n\t\t\n\t\tself.__contacts = contacts\n\t\tself.__key_modified['... | [
"0.6209503",
"0.6202445",
"0.588594",
"0.588594",
"0.5883504",
"0.5845821",
"0.5795876",
"0.5775629",
"0.55796677",
"0.5562263",
"0.5562263",
"0.5559013",
"0.5479643",
"0.5460591",
"0.53779536",
"0.5320598",
"0.53073066",
"0.5305575",
"0.52854943",
"0.5274175",
"0.5192591",
... | 0.83265656 | 0 |
Gets the dnc_lists of this MessagingCampaign. The dnc lists to check before sending a message for this messaging campaign. | def dnc_lists(self):
return self._dnc_lists | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_dmarc_messages(self):\n messages = []\n try:\n if self.opt_use_ssl:\n self.server = poplib.POP3_SSL(self.opt_pop3_server)\n self.server.user(self.opt_global_account[\"username\"])\n self.server.pass_(self.opt_global_account[\"password\"]... | [
"0.5988404",
"0.58297056",
"0.56870914",
"0.55929554",
"0.5453402",
"0.5412666",
"0.5395899",
"0.5304845",
"0.5249858",
"0.5206307",
"0.5206069",
"0.5170666",
"0.5170228",
"0.51614743",
"0.5143177",
"0.51181716",
"0.5111123",
"0.50970674",
"0.50523174",
"0.504655",
"0.5045429... | 0.70566237 | 0 |
Sets the dnc_lists of this MessagingCampaign. The dnc lists to check before sending a message for this messaging campaign. | def dnc_lists(self, dnc_lists):
self._dnc_lists = dnc_lists | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetDomainsList(self, domainsList) :\n\t\t...",
"def checklists(self, checklists):\n\n self._checklists = checklists",
"def fdsid_list(self, fdsid_list):\n\n self._fdsid_list = fdsid_list",
"def contact_list(self, contact_list):\n \n self._contact_list = contact_list",
"def d... | [
"0.5641915",
"0.55063945",
"0.52784514",
"0.5267238",
"0.51484704",
"0.5096262",
"0.48523757",
"0.48513708",
"0.48345873",
"0.48015624",
"0.47823006",
"0.47243136",
"0.47188637",
"0.47175246",
"0.4708469",
"0.47014678",
"0.46647304",
"0.466445",
"0.46205124",
"0.45986927",
"0... | 0.75755775 | 0 |
Gets the always_running of this MessagingCampaign. Whether this messaging campaign is always running | def always_running(self):
return self._always_running | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def IsRunning(self):\n return self.running",
"def running(self):\n return self.scheduler.running",
"def is_running(self):\n return self._running",
"def is_running(self):\n return self._running",
"def is_running(self):\n return self._running.is_set()",
"def running(self)... | [
"0.684747",
"0.68215805",
"0.6736479",
"0.6736479",
"0.67310226",
"0.67029005",
"0.6684114",
"0.6684114",
"0.6658457",
"0.6658457",
"0.6658457",
"0.6624625",
"0.6622321",
"0.6609278",
"0.6596",
"0.6578254",
"0.65689",
"0.65341485",
"0.6479026",
"0.6433435",
"0.6432685",
"0.... | 0.8078336 | 0 |
Sets the always_running of this MessagingCampaign. Whether this messaging campaign is always running | def always_running(self, always_running):
self._always_running = always_running | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def always_running(self):\n return self._always_running",
"def set_as_running(self):\n with self._running_condition:\n assert self._state == PENDING_STATE\n self._state = RUNNING_STATE\n self._running_condition.notify()",
"def set_running(self):\n with self... | [
"0.70217943",
"0.6201809",
"0.61069536",
"0.5851402",
"0.5851402",
"0.5851402",
"0.568576",
"0.5624877",
"0.5585618",
"0.5526143",
"0.5486297",
"0.54765916",
"0.5464183",
"0.5464183",
"0.5460435",
"0.5454445",
"0.5423037",
"0.5418796",
"0.5418796",
"0.5418796",
"0.53875816",
... | 0.8169366 | 0 |
Gets the contact_sorts of this MessagingCampaign. The order in which to sort contacts for dialing, based on up to four columns. | def contact_sorts(self):
return self._contact_sorts | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getSorted(self):\n return sorted(self.contacts)",
"def contact_sorts(self, contact_sorts):\n \n self._contact_sorts = contact_sorts",
"def get_sort_columns(self):\n col_sort_orders = self.gridpreference_sort.all().values_list('column__id', flat=True)\n return GridColumn.o... | [
"0.6996267",
"0.6311992",
"0.60650474",
"0.60044813",
"0.5959529",
"0.5943762",
"0.5862135",
"0.57969254",
"0.5660018",
"0.5624674",
"0.5591094",
"0.55369407",
"0.52994704",
"0.52872974",
"0.52799004",
"0.5243885",
"0.5241674",
"0.5228304",
"0.5202736",
"0.51900417",
"0.51636... | 0.8388801 | 0 |
Sets the contact_sorts of this MessagingCampaign. The order in which to sort contacts for dialing, based on up to four columns. | def contact_sorts(self, contact_sorts):
self._contact_sorts = contact_sorts | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def contact_sorts(self):\n return self._contact_sorts",
"def set_sorts(self, sorts: List[DataGridSort]):\n self.sorts = sorts",
"def set_contacts(self, contacts):\n\n\t\tif contacts is not None and not isinstance(contacts, list):\n\t\t\traise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: contacts... | [
"0.68852335",
"0.62442034",
"0.55268556",
"0.55110604",
"0.5504529",
"0.5504529",
"0.5466908",
"0.5404668",
"0.53766954",
"0.5268589",
"0.5230543",
"0.51540035",
"0.5129339",
"0.51096964",
"0.5105754",
"0.5105754",
"0.50918037",
"0.5086296",
"0.5057816",
"0.50474155",
"0.5042... | 0.8539102 | 0 |
Gets the messages_per_minute of this MessagingCampaign. How many messages this messaging campaign will send per minute. | def messages_per_minute(self):
return self._messages_per_minute | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def messages_per_minute(self, messages_per_minute):\n \n self._messages_per_minute = messages_per_minute",
"def get_words_per_minute(self):\n return self.words_per_minute",
"def query_plans_per_minute(self) -> int:\n return pulumi.get(self, \"query_plans_per_minute\")",
"def getNu... | [
"0.686777",
"0.6715453",
"0.5897515",
"0.57897204",
"0.5508112",
"0.5492951",
"0.5468848",
"0.5431342",
"0.5427984",
"0.54239345",
"0.5376645",
"0.5357198",
"0.52036357",
"0.5193324",
"0.5188115",
"0.51773685",
"0.51770973",
"0.51570386",
"0.51300323",
"0.512672",
"0.51112086... | 0.8563438 | 0 |
Sets the messages_per_minute of this MessagingCampaign. How many messages this messaging campaign will send per minute. | def messages_per_minute(self, messages_per_minute):
self._messages_per_minute = messages_per_minute | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def messages_per_minute(self):\n return self._messages_per_minute",
"def set_words_per_minute(self, words_per_minute):\n is_valid_wpm = 5.0 <= words_per_minute <= 60.0\n if is_valid_wpm:\n self.words_per_minute = words_per_minute\n self.dot_time_in_msec = 1200.0 / self.... | [
"0.66696775",
"0.58786",
"0.5668301",
"0.5376296",
"0.5365551",
"0.52839804",
"0.51178545",
"0.5013213",
"0.49938592",
"0.47783017",
"0.4773923",
"0.4772288",
"0.4751765",
"0.47004074",
"0.46891505",
"0.46256608",
"0.460433",
"0.45917523",
"0.45578098",
"0.45366237",
"0.45331... | 0.87528765 | 0 |
Sets the errors of this MessagingCampaign. A list of current error conditions associated with this messaging campaign. | def errors(self, errors):
self._errors = errors | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def errors(self, errors):\n\n self._errors = errors",
"def validation_errors(self, validation_errors):\n self._validation_errors = validation_errors",
"def add_errors(self, errors):\n self.errors = merge_errors(self.errors, errors)",
"def errors (self):\n return self._errors",
"... | [
"0.7063868",
"0.6316049",
"0.62133807",
"0.5995449",
"0.5995449",
"0.5993789",
"0.5955976",
"0.58611673",
"0.5738866",
"0.57359105",
"0.56898946",
"0.56828547",
"0.56606567",
"0.56536406",
"0.5637317",
"0.5577304",
"0.5540206",
"0.5453656",
"0.54534554",
"0.54445463",
"0.5427... | 0.7172415 | 0 |
Gets the sms_config of this MessagingCampaign. Configuration for this messaging campaign to send SMS messages. | def sms_config(self):
return self._sms_config | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sms_config(self, sms_config):\n \n self._sms_config = sms_config",
"def config(self):\n if self.__config is None:\n self.__config = self._get_config(self.bot)\n return self.__config",
"def sms(self):\r\n return sms.SMS(self)",
"def get_configuration(self) -> ... | [
"0.66070634",
"0.592993",
"0.56343",
"0.54566157",
"0.5446236",
"0.5412347",
"0.53807044",
"0.53407514",
"0.5317883",
"0.52791315",
"0.52556473",
"0.52439207",
"0.52439207",
"0.52175206",
"0.52175206",
"0.52135134",
"0.5207754",
"0.5194879",
"0.5194879",
"0.5194879",
"0.51929... | 0.8423905 | 0 |
Sets the sms_config of this MessagingCampaign. Configuration for this messaging campaign to send SMS messages. | def sms_config(self, sms_config):
self._sms_config = sms_config | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sms_config(self):\n return self._sms_config",
"def sms_enabled(self, sms_enabled):\n\n self._sms_enabled = sms_enabled",
"def send_sms(self, sms):\n pass",
"def sms_phone_number(self, sms_phone_number):\n\n self._sms_phone_number = sms_phone_number",
"def sms_disabled(self, ... | [
"0.6710091",
"0.6376342",
"0.61567897",
"0.5817117",
"0.5528274",
"0.5234292",
"0.5205838",
"0.515643",
"0.5122757",
"0.5109166",
"0.51015836",
"0.50929946",
"0.50358784",
"0.5014341",
"0.49991947",
"0.49899116",
"0.49732202",
"0.49195576",
"0.4918217",
"0.4918136",
"0.490152... | 0.84385973 | 0 |
seaborn time series, with errorbands | def sns_time_series(x_tuple,y_tuple,outputname,errors=0,two=False, *args,**kwargs):
if (type(outputname)==str)|(type(x_tuple)==tuple)|(type(y_tuple)==tuple):
pass
else:
raise TypeError()
import matplotlib
matplotlib.use("pdf")
import matplotlib.pyplot as plt
import numpy as np
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def visualize_time_series(fig_ax, data, inp_color, missing_data, lag_color, first_date,\n x_label=\"Number of Days\", y_label=\"Log of Aluminium Price\", title=\"Prices over time\"):\n fig, ax = fig_ax\n ((x_train_raw, y_train_raw), y_pred_list) = data\n\n missing_x, missing_y = missing_data\n is_mi... | [
"0.5816549",
"0.5654263",
"0.5647554",
"0.5641937",
"0.5606311",
"0.5547447",
"0.5509094",
"0.5484054",
"0.54816675",
"0.5443533",
"0.5367257",
"0.5338084",
"0.52920187",
"0.52789783",
"0.5228553",
"0.5223728",
"0.52207625",
"0.52193207",
"0.5198728",
"0.5193151",
"0.518719",... | 0.580105 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.