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
Sets the base_currency_tax_amount of this PostPurchaseInvoicesPurchaseInvoice.
def base_currency_tax_amount(self, base_currency_tax_amount): self._base_currency_tax_amount = base_currency_tax_amount
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base_tax_amount(self, base_tax_amount):\n\n self._base_tax_amount = base_tax_amount", "def base_price_incl_tax(self, base_price_incl_tax):\n\n self._base_price_incl_tax = base_price_incl_tax", "def base_currency_withholding_tax_amount(self, base_currency_withholding_tax_amount):\n\n se...
[ "0.848173", "0.77531976", "0.77411664", "0.7264693", "0.6878026", "0.68439895", "0.68439895", "0.67864394", "0.6710065", "0.65416086", "0.62501335", "0.61729133", "0.6073354", "0.5881891", "0.58193517", "0.5781668", "0.5765058", "0.57221466", "0.56993634", "0.5637668", "0.558...
0.8522543
0
Sets the base_currency_total_amount of this PostPurchaseInvoicesPurchaseInvoice.
def base_currency_total_amount(self, base_currency_total_amount): self._base_currency_total_amount = base_currency_total_amount
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base_row_total(self, base_row_total):\n\n self._base_row_total = base_row_total", "def base_discount_amount(self, base_discount_amount):\n\n self._base_discount_amount = base_discount_amount", "def base_currency(self, base_currency):\n\n self._base_currency = base_currency", "def bas...
[ "0.6678808", "0.66203034", "0.66065305", "0.65990907", "0.6465834", "0.6432214", "0.64186174", "0.6417187", "0.6088956", "0.6038598", "0.58702946", "0.5646479", "0.55989957", "0.5529933", "0.5402454", "0.5397846", "0.5319007", "0.52826804", "0.52421385", "0.51199967", "0.5061...
0.8098732
0
Sets the status_id of this PostPurchaseInvoicesPurchaseInvoice.
def status_id(self, status_id): self._status_id = status_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def id_status(self, id_status):\n self._id_status = id_status", "def status_ids(self, status_ids):\n\n self._status_ids = status_ids", "def status(self, status: int):\n if status is None:\n raise ValueError(\"Invalid value for `status`, must not be `None`\") # noqa: E501\n\n ...
[ "0.66867805", "0.6269005", "0.60735667", "0.6006876", "0.6006876", "0.6006876", "0.5977543", "0.59016436", "0.58946407", "0.58686817", "0.5849853", "0.58398247", "0.58384484", "0.57777655", "0.57777655", "0.57777655", "0.57777655", "0.57777655", "0.57777655", "0.57777655", "0...
0.68944526
0
Sets the tax_address_region_id of this PostPurchaseInvoicesPurchaseInvoice.
def tax_address_region_id(self, tax_address_region_id): self._tax_address_region_id = tax_address_region_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def region_id(self, region_id):\n\n self._region_id = region_id", "def region_id(self, region_id: str):\n\n self._region_id = region_id", "def tax_id(self, tax_id):\n\n self._tax_id = tax_id", "def tax_id(self, tax_id: str):\n\n self._tax_id = tax_id", "def region(self, region):...
[ "0.6961345", "0.68046737", "0.6641272", "0.6401707", "0.6218123", "0.6210708", "0.6210708", "0.6210708", "0.60235435", "0.58885276", "0.58303213", "0.57958144", "0.57958144", "0.57350045", "0.564631", "0.5592496", "0.55791825", "0.551334", "0.5487734", "0.5478908", "0.5380571...
0.85072464
0
Sets the withholding_tax_rate of this PostPurchaseInvoicesPurchaseInvoice.
def withholding_tax_rate(self, withholding_tax_rate): self._withholding_tax_rate = withholding_tax_rate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def withholding_tax_amount(self, withholding_tax_amount):\n\n self._withholding_tax_amount = withholding_tax_amount", "def base_currency_withholding_tax_amount(self, base_currency_withholding_tax_amount):\n\n self._base_currency_withholding_tax_amount = base_currency_withholding_tax_amount", "def...
[ "0.79745823", "0.66085917", "0.6052419", "0.5912024", "0.5801561", "0.5801561", "0.5786464", "0.5782962", "0.5737863", "0.5449971", "0.54267114", "0.5393848", "0.5131201", "0.51016635", "0.5095233", "0.50948745", "0.5068685", "0.5043877", "0.5039536", "0.5026704", "0.5011863"...
0.8479475
0
Sets the withholding_tax_amount of this PostPurchaseInvoicesPurchaseInvoice.
def withholding_tax_amount(self, withholding_tax_amount): self._withholding_tax_amount = withholding_tax_amount
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def withholding_tax_rate(self, withholding_tax_rate):\n\n self._withholding_tax_rate = withholding_tax_rate", "def base_currency_withholding_tax_amount(self, base_currency_withholding_tax_amount):\n\n self._base_currency_withholding_tax_amount = base_currency_withholding_tax_amount", "def price_i...
[ "0.7966494", "0.70016366", "0.6372031", "0.6286463", "0.6286463", "0.62060547", "0.6153063", "0.5853375", "0.57399887", "0.572403", "0.5694159", "0.5603339", "0.558254", "0.54101205", "0.53796035", "0.5371992", "0.53061646", "0.52751434", "0.5230884", "0.52134377", "0.5109179...
0.8674601
0
Sets the base_currency_withholding_tax_amount of this PostPurchaseInvoicesPurchaseInvoice.
def base_currency_withholding_tax_amount(self, base_currency_withholding_tax_amount): self._base_currency_withholding_tax_amount = base_currency_withholding_tax_amount
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base_tax_amount(self, base_tax_amount):\n\n self._base_tax_amount = base_tax_amount", "def base_price_incl_tax(self, base_price_incl_tax):\n\n self._base_price_incl_tax = base_price_incl_tax", "def base_currency_tax_amount(self, base_currency_tax_amount):\n\n self._base_currency_tax_am...
[ "0.77139866", "0.77095586", "0.7681474", "0.7222452", "0.70390123", "0.698594", "0.668541", "0.6615273", "0.65054595", "0.6208536", "0.61111945", "0.608172", "0.6018472", "0.59591424", "0.5919831", "0.5897508", "0.5897508", "0.58287764", "0.5810557", "0.5624996", "0.5437361",...
0.86875385
0
Sets the invoice_lines of this PostPurchaseInvoicesPurchaseInvoice.
def invoice_lines(self, invoice_lines): if self.local_vars_configuration.client_side_validation and invoice_lines is None: # noqa: E501 raise ValueError("Invalid value for `invoice_lines`, must not be `None`") # noqa: E501 self._invoice_lines = invoice_lines
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invoice_ids(self, invoice_ids):\n\n self._invoice_ids = invoice_ids", "def stripe_invoices(self, stripe_invoices):\n\n self._stripe_invoices = stripe_invoices", "def invoice_line_create(self, invoice_id, qty):\n invoice_lines = self.env['account.invoice.line']\n precision = self...
[ "0.7089234", "0.63822126", "0.6080149", "0.59047717", "0.58448255", "0.5641987", "0.56416446", "0.5589948", "0.5580606", "0.5540686", "0.5474156", "0.5368353", "0.53361195", "0.5256505", "0.5207284", "0.5125516", "0.5105482", "0.50821394", "0.50798434", "0.50782615", "0.50628...
0.82710296
0
Sets the tax_analysis of this PostPurchaseInvoicesPurchaseInvoice.
def tax_analysis(self, tax_analysis): self._tax_analysis = tax_analysis
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tax(self, tax_dict: dict):\n if tax_dict:\n self._tax = SalesTransactionTaxModel(**tax_dict)\n else:\n self._tax = None", "def tax_id(self, tax_id):\n\n self._tax_id = tax_id", "def tax_amount(self, tax_amount):\n\n self._tax_amount = tax_amount", "def ta...
[ "0.6248358", "0.62429315", "0.6214527", "0.6214527", "0.6038242", "0.5996619", "0.5962267", "0.59383696", "0.5884016", "0.5773423", "0.57103175", "0.5688809", "0.55462104", "0.5465174", "0.54630834", "0.54471326", "0.5442984", "0.5407754", "0.5372956", "0.53676564", "0.532534...
0.8053622
0
Show all items that are done
def show_done(): #conncetion to the database conn = sqlite3.connect('todo.db') c = conn.cursor() #if status of task is 0 it means task is completed. c.execute("SELECT Task_id, Description FROM task WHERE status LIKE 0") result = c.fetchall() c.close() return render_template("show_done.h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_unfinished():\n\n cur = db.get_db().cursor()\n\n create_new_task(cur)\n\n cur.execute('SELECT * FROM todos WHERE completed = false')\n todos = cur.fetchall()\n cur.close()\n\n return render_template(\"index.html\", todos=todos)", "def show_completed():\n\n cur = db.get_db().cursor()...
[ "0.6926421", "0.66491157", "0.64588314", "0.62094814", "0.61295784", "0.6097523", "0.6093246", "0.6081391", "0.6081391", "0.6081391", "0.6077147", "0.606738", "0.60199165", "0.6007922", "0.59220415", "0.5860986", "0.58108354", "0.5756759", "0.5740302", "0.5728025", "0.5717546...
0.6666197
1
Initialize scoreboard with given maximum capacity. All entries are initially None
def __init__(self, capacity=10): self._board = [None] * capacity # list of 10 None elements self._n = 0 # number of actual entries
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, capacity=4):\n self.capacity = capacity\n self.size = 0\n self.table = [None] * capacity", "def __init__(self, capacity=100):\n \n self.capacity = capacity\n self.size = 0\n self._keys = []\n self._entry = [[] for _ in range(capacity)]", ...
[ "0.67683524", "0.6371191", "0.63432086", "0.62862325", "0.62553024", "0.6222461", "0.61878484", "0.61712694", "0.6169245", "0.6145208", "0.6140555", "0.61396277", "0.61255", "0.6111086", "0.60980326", "0.60916114", "0.6087876", "0.59849685", "0.5927859", "0.58971035", "0.5861...
0.7896567
0
Adding entry to high scores.
def add(self, entry): score = entry.get_score() # Does the new entry qualify as high score. # The high score is True if board not full or score is higher than last entry good = self._n < len(self._board) or score > self._board[-1].get_score() if good: if self._n < l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def appendScore(self, l):\r\n score = Highscore(l[0], l[1])\r\n self.scores.append(score)", "def update_highscores(self):\n for i in range(len(self.highscores)):\n if self.score >= self.highscores[i]:\n self.highscores.insert(i, self.score)\n self.hig...
[ "0.7270524", "0.6948711", "0.6822405", "0.6729844", "0.67079157", "0.66634095", "0.6532558", "0.6468222", "0.64384425", "0.6431057", "0.6395388", "0.63379437", "0.63102686", "0.62902826", "0.62627566", "0.6226965", "0.6210354", "0.61903185", "0.61809653", "0.6158102", "0.6108...
0.7784681
0
Describes an InputArgument instance.
def _describe_input_argument(self, argument, **options): default = argument.get_default() if default is not None and (not isinstance(default, list) or len(default)): default = '<comment> [default: %s]</comment>' % self._format_default_value(default) else: default = '' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _describe_input_definition(self, definition, **options):\n definition_options = definition.get_options()\n definition_arguments = definition.get_arguments()\n total_width = self._calculate_total_width_for_options(definition_options)\n\n for argument in definition_arguments:\n ...
[ "0.59210414", "0.58519936", "0.58147615", "0.5766577", "0.5692795", "0.5683087", "0.5683087", "0.56350607", "0.5586473", "0.55778843", "0.5559575", "0.5520351", "0.5499528", "0.54866934", "0.5482103", "0.54739946", "0.5449429", "0.54181015", "0.53034705", "0.5289484", "0.5276...
0.70471895
0
Describes an InputOption instance.
def _describe_input_option(self, option, **options): accept_value = option.accept_value() default = option.get_default() if accept_value and default is not None and (not isinstance(default, list) or len(default)): default = '<comment> [default: %s]</comment>' % self._format_default_v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def option_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"option_name\")", "def option_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"option_name\")", "def _describe_input_argument(self, argument, **options):\n default = argument.get_default()\n if defaul...
[ "0.64484894", "0.64484894", "0.5869311", "0.5820671", "0.5737298", "0.5725624", "0.57092786", "0.56956017", "0.569341", "0.5663559", "0.5578332", "0.5526767", "0.54862744", "0.54690254", "0.5443656", "0.5431728", "0.5431728", "0.5431728", "0.5431728", "0.5431728", "0.54199153...
0.7317485
0
Describes an InputDefinition instance.
def _describe_input_definition(self, definition, **options): definition_options = definition.get_options() definition_arguments = definition.get_arguments() total_width = self._calculate_total_width_for_options(definition_options) for argument in definition_arguments: total_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def definition(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"definition\")", "def validate_input(self, definition):\n \"\"\"Implement your own validation logic to validate the input stanza configurations\"\"\"\n # This example accesses the modular input variable\n opt_labels...
[ "0.66014844", "0.6400844", "0.59794855", "0.59771925", "0.5836755", "0.5828988", "0.5828988", "0.5828988", "0.5828988", "0.5828988", "0.5823333", "0.5816482", "0.5776391", "0.5660998", "0.5528685", "0.55202717", "0.550304", "0.5479787", "0.5437394", "0.54349285", "0.53951913"...
0.73851436
0
Describes a Command instance.
def _describe_command(self, command, **options): command.get_synopsis(True) command.get_synopsis(False) command.merge_application_definition(False) self._write_text('<comment>Usage:</comment>', **options) for usage in [command.get_synopsis(True)] + command.get_aliases() + comman...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_description(self):\n return self['command_name']", "def command_help(self, *args, **kwargs):\n print(\"Commands available:\\n\")\n for name in dir(self):\n if not name.startswith(\"command_\"):\n continue\n name_clean = name[len(\"command_\"):]\n ...
[ "0.7016542", "0.68423754", "0.66205174", "0.65364707", "0.64342946", "0.6388005", "0.63779217", "0.63639605", "0.6343113", "0.6279874", "0.62601334", "0.6245082", "0.6243775", "0.6231478", "0.6228441", "0.6216107", "0.62120724", "0.61996216", "0.612282", "0.6108063", "0.60977...
0.69266784
1
Describes an Application instance.
def _describe_application(self, application, **options): described_namespace = options.get('namespace') description = ApplicationDescription(application, described_namespace) raw_text = options.get('raw_text') if raw_text: width = self._get_column_width(description.get_comma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n return '<Application({name})>'.format(name=self.name)", "def get_app(self):\n return Application()", "def create_application(name=None, description=None):\n pass", "def get_app(self, name): # TODO Return type doc # TODO Return type DOC\n raise NotImple...
[ "0.74708414", "0.6621223", "0.6442728", "0.6429494", "0.64094234", "0.6325035", "0.61599565", "0.6157096", "0.6157096", "0.61566883", "0.61534095", "0.614636", "0.6115106", "0.61109525", "0.6090034", "0.6080304", "0.60745126", "0.6070533", "0.60552526", "0.6055024", "0.604768...
0.66566926
1
Formats command aliases to show them in the command description.
def _get_command_aliases_text(self, command): text = '' aliases = command.get_aliases() if aliases: text = '[{}] '.format('|'.join(aliases)) return text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def usage(self, subcommand):\n if subcommand == self.run_alias:\n return self.usage_alias(subcommand)\n return \"\"\"\n ./manage.py alias\n ./manage.py alias name\n ./manage.py alias name[=value]\n ./manage.py unalias name\n\n Save commands and parameters as shortcuts.\n ...
[ "0.7058821", "0.66600275", "0.6500226", "0.64749056", "0.6377386", "0.62829494", "0.6279109", "0.6261735", "0.6139605", "0.6116843", "0.6104513", "0.6073603", "0.6023681", "0.6013967", "0.6003477", "0.5927639", "0.59076446", "0.58509386", "0.58469206", "0.58266294", "0.581327...
0.75280523
0
Formats input option/argument default value.
def _format_default_value(self, default): return json.dumps(default)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fmt_option_val(option):\n if option is None:\n return \"\"\n return str(option)", "def argument(arg, default):\n return \"{0}={1}\".format(arg, default) if default else arg", "def fmt_option_key(key, value):\n if value is None:\n return \"\"\n return f\"{key}={value...
[ "0.6827997", "0.6561471", "0.6364031", "0.61552995", "0.6107596", "0.6093259", "0.6087198", "0.60865474", "0.5992713", "0.58819455", "0.5865339", "0.58590937", "0.5824338", "0.5818822", "0.5764736", "0.57210845", "0.57101643", "0.57047987", "0.5692047", "0.5684764", "0.566860...
0.6711178
1
How much time is left until the event is due. A float representing a number of fractional seconds.
def time_remaining(self) -> float: return self.event.time - time.time()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_left(self) -> float:\n return self._alarm_silence - time.monotonic()", "def time_left(self):\n return self.timeout - self.current_milli_time()", "def time_left(self):\r\n return 10 - (int(time.time()) - self.start_time)", "def calculate_time_percentage_left(self):\n time_...
[ "0.7303336", "0.7276682", "0.7171401", "0.7125182", "0.7052059", "0.70496154", "0.69713485", "0.69650203", "0.6961257", "0.69600976", "0.69576603", "0.693156", "0.68766725", "0.6844249", "0.6839123", "0.68200284", "0.6804199", "0.67955136", "0.6793093", "0.67820007", "0.67489...
0.78907555
0
Define the CherryPy messages to listen for and start running the scheduler. This plugin owns the scheduler prefix.
def start(self) -> None: self.bus.subscribe("cache:ready", self.revive) self.bus.subscribe("scheduler:add", self.add) self.bus.subscribe("scheduler:persist", self.persist) self.bus.subscribe("scheduler:remove", self.remove) self.bus.subscribe("scheduler:upcoming", self.upcoming) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schedule_start(self):\n print(\"Scheduler for monitoring request is running\")\n self.initialize_scheduler()", "def start(self):\n\n self.loadConf()\n self.loadDrivers()\n self.loadFeeds()\n self.runScheduler()\n self.scheduler.print_jobs()\n self.sched...
[ "0.6129773", "0.60142535", "0.58273554", "0.5809722", "0.5755783", "0.57529825", "0.57413936", "0.5729364", "0.56516635", "0.565082", "0.56482786", "0.5635094", "0.56076664", "0.5604253", "0.55955064", "0.5595327", "0.5587749", "0.5584195", "0.55713946", "0.5560268", "0.55359...
0.63112
0
Converts numpy special values to the corresponding GDX versions. Parmeters
def convert_np_to_gdx_svs(df, num_dims): # converts a single value; NANs are assumed already handled def convert_approx_eps(value): # eps values are not always caught by ==, use is_np_eps which applies # a tolerance if is_np_eps(value): return SPECIAL_VALUES[4] retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_numpy(self, **kwargs):\n pass", "def convert_named_parameters_to_array(self):\n\n dtype_parameters = np.dtype([ ('name', '<U40'), #TODO change hardcoded 40 here\n ('uncertainty_type', 'u1'), \n ('amount', '<f4'),\n ...
[ "0.5350533", "0.53502005", "0.5202527", "0.51642376", "0.51642376", "0.5164176", "0.514542", "0.5098366", "0.5064316", "0.50474006", "0.5047286", "0.50083333", "0.5005441", "0.50028294", "0.49927756", "0.4958686", "0.49454325", "0.493184", "0.49254322", "0.49254322", "0.49206...
0.610499
0
Utility function for identifying None or NaN (which are indistinguishable in pandas).
def pd_isnan(val): return val is None or val != val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nonull(val):\n return val if not pd.isnull(val) else None", "def checkfornan(chosen_df):\n if not chosen_df.isnull().values.any():\n raise ValueError('NaN in DataFrame')", "def nan_value(data):\n return data.isnull().any()", "def check_for_null_values(self):\r\n print(self.datafram...
[ "0.71783274", "0.70431757", "0.70316005", "0.6984072", "0.6919569", "0.6919569", "0.69018906", "0.6888324", "0.6856946", "0.67733264", "0.6759643", "0.6682732", "0.6587395", "0.6574805", "0.6506592", "0.6495209", "0.649387", "0.6485422", "0.6485422", "0.6485422", "0.64384454"...
0.75288576
0
Utility function for equating the GDX special values that map to None or NaN (which are indistinguishable in pandas).
def gdx_isnan(val,gdxf): return val in [SPECIAL_VALUES[0], SPECIAL_VALUES[1]]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pd_isnan(val):\n return val is None or val != val", "def nonull(val):\n return val if not pd.isnull(val) else None", "def non_null_validation(x):\n return not pd.isnull(x), {}", "def na_value():\n return pd.NA", "def nan_value(data):\n return data.isnull().any()", "def na_value() -> pa...
[ "0.68950284", "0.65749776", "0.65275276", "0.65230495", "0.6327822", "0.62868214", "0.62868214", "0.62667626", "0.6195091", "0.6181579", "0.6174638", "0.61355746", "0.61351633", "0.611894", "0.6078733", "0.60174775", "0.6006587", "0.5975572", "0.5935271", "0.59312856", "0.593...
0.6817969
1
Load special values Needs to be called after gdxcc is loaded. Populates the module attributes SPECIAL_VALUES, GDX_TO_NP_SVS, and NP_TO_GDX_SVS.
def load_specials(gams_dir_finder): global SPECIAL_VALUES global GDX_TO_NP_SVS global NP_TO_GDX_SVS H = gdxcc.new_gdxHandle_tp() rc = gdxcc.gdxCreateD(H, gams_dir_finder.gams_dir, gdxcc.GMS_SSSIZE) if not rc: raise Exception(rc[1]) # get special values special_values = gdxcc.dou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\r\n ScriptedLoadableModuleLogic.__init__(self)\r\n self.rgbport = 18944\r\n self.depthPort = 18945", "def extra_options():\n extra_vars = {\n 'PrgEnv': [None, 'PrgEnv module to load, e.g., cray to load PrgEnv-cray, or None for automatic determination', CUSTOM],\n ...
[ "0.5282057", "0.52767676", "0.52151394", "0.52031267", "0.5186222", "0.5156148", "0.5088976", "0.50813544", "0.50585204", "0.503575", "0.5013093", "0.4966342", "0.49523473", "0.49503928", "0.49227092", "0.492037", "0.4915148", "0.48633942", "0.47920096", "0.47756898", "0.4762...
0.64522123
0
Given the passed in year int, return the date Mother's Day is celebrated assuming it's the 2nd Sunday of May.
def get_mothers_day_date(year): day = date(year=year, month=5, day=1) while 1: if day.weekday() == 6: day += timedelta(days=7) break day += timedelta(days=1) return day
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mothers_day_date(year):\r\n start_date = parse(f\"Jan {year}\").date()\r\n for date in rrule(YEARLY, dtstart=start_date, bymonth=5, byweekday=SU, bysetpos=2):\r\n if date.year == year:\r\n return date.date()", "def MayDay(year):\n\n day = datetime.date(year, 5, 1)\n count = ...
[ "0.77131706", "0.70227295", "0.6665983", "0.6531064", "0.631456", "0.6304032", "0.6263735", "0.6196798", "0.6044712", "0.60194397", "0.5968703", "0.5963185", "0.5954675", "0.5948111", "0.5934555", "0.5930232", "0.5923172", "0.5892827", "0.5892083", "0.5849721", "0.58482796", ...
0.76806295
1
Return items for the query string
def get_items_for_query(self, query_str): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query(self, page) -> [str, dict]:", "def get_items():\n return requester.perform_request(Uri.items)", "def query_items_handler(query):\n items = getItemsByName(query)\n return jsonify(items=[i.serialize for i in items])", "def get_items(self):\n\n if not self.ITEM_MODEL:\n rais...
[ "0.6645086", "0.663785", "0.66042507", "0.65585864", "0.6459582", "0.6403286", "0.6402202", "0.63776314", "0.6326497", "0.63088065", "0.6275777", "0.627013", "0.62459636", "0.6233619", "0.621484", "0.6162958", "0.6160105", "0.6134535", "0.6132275", "0.61244655", "0.6122165", ...
0.69858867
0
Change paint brush size.
def changeSize(self, value): self.layer.brush_size = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def brush_size(self, new_value: int) -> None:\n # get the brush size context and set its value\n with self._brush_size.get_lock():\n # if the brush size is different, queue a cursor update\n if self._brush_size.value != new_value:\n self.is_cursor_change = True\n ...
[ "0.7269925", "0.71825314", "0.64976054", "0.63540244", "0.6324197", "0.63128537", "0.62028074", "0.611255", "0.59607494", "0.5957093", "0.5942443", "0.5918784", "0.5917844", "0.58312374", "0.58261544", "0.5815518", "0.58011025", "0.5742538", "0.57363546", "0.5732532", "0.5694...
0.81343627
0
Toggle contiguous state of label layer.
def change_contig(self, state): if state == Qt.Checked: self.layer.contiguous = True else: self.layer.contiguous = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toggle(self) -> None:", "def toggle(self) -> None:", "def toggle_at(self,x,y):\n\t\tself.set_at(x,y,self.get_at(x,y) != 1)", "def toggle(self):", "def toggle(self) -> None:\n ...", "def toggle_container(self,new_bool):\n self.container = new_bool", "def toggle_layer_visibility(sel...
[ "0.60808074", "0.60808074", "0.606117", "0.6056355", "0.59041405", "0.58587897", "0.5735585", "0.57107216", "0.5677991", "0.5658743", "0.5606915", "0.54991287", "0.5494509", "0.54911256", "0.54543304", "0.542509", "0.536494", "0.52967775", "0.5288977", "0.5277838", "0.5250168...
0.70443076
0
Toggle ndimensional state of label layer.
def change_ndim(self, state): if state == Qt.Checked: self.layer.n_dimensional = True else: self.layer.n_dimensional = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_contig(self, state):\n if state == Qt.Checked:\n self.layer.contiguous = True\n else:\n self.layer.contiguous = False", "def toggle_satni_grid(self, x):\r\n self.konfig.satni.set_grid(x)\r\n self.satniGraf.toggle_grid(x)", "def toggle_layer_visibilit...
[ "0.6059153", "0.599458", "0.59669966", "0.57741034", "0.5693036", "0.56325614", "0.5547909", "0.54542124", "0.54534805", "0.5438521", "0.54213804", "0.541526", "0.5398659", "0.5373098", "0.5365086", "0.5355618", "0.5355618", "0.53497714", "0.5324464", "0.53182477", "0.5302966...
0.7209815
0
Update brush size for the label layer.
def _on_brush_size_change(self, event=None): with self.layer.events.brush_size.blocker(): value = self.layer.brush_size value = np.clip(int(value), 1, 40) self.brushSizeSlider.setValue(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def changeSize(self, value):\n self.layer.brush_size = value", "def updateWidthFromLabel(self):\n prevWidth = self.rect().width()\n width = self.text.boundingRect().width() + \\\n CurrentTheme.VERSION_LABEL_MARGIN[0] - 4\n r = self.rect()\n r.setX(r.x()+(prevWidth-wi...
[ "0.7270034", "0.6487877", "0.5974214", "0.5835992", "0.5795688", "0.57761484", "0.5775763", "0.5771066", "0.56442857", "0.56108147", "0.55753416", "0.55071026", "0.5385948", "0.53778565", "0.5361523", "0.5349698", "0.5339982", "0.53221536", "0.53209877", "0.52994895", "0.5251...
0.6542076
1
Return input and output datastore dictionaries, generated based on syntactically valid initial configurations located at init_path.
def create_DAOs_from_config_file(self, init_path: str) -> (dict, dict): # with open(init_path, 'r') as stream: # try: # parsed_DS_init = yaml.safe_load(stream) # # print(parsed_DS_init) # input_datastore_interfaces = self._get_DAOs(parsed_DS_init[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_dicts():\n load_data_for_dict('data/atis/train/seq.in', 'data/atis/voc/vocabulary.json')\n load_data_for_dict('data/atis/valid/seq.in', 'data/atis/voc/vocabulary.json')\n load_data_for_dict('data/atis/test/seq.in', 'data/atis/voc/vocabulary.json') \n load_data_for_dict('data/atis/train/seq.o...
[ "0.6738415", "0.64996654", "0.6115677", "0.5925436", "0.58811384", "0.58632267", "0.5732923", "0.57277656", "0.56880146", "0.56592333", "0.5634841", "0.5559244", "0.5527044", "0.551145", "0.5510065", "0.5490425", "0.5487149", "0.54870075", "0.5474068", "0.54618686", "0.545724...
0.68697155
0
For booking the room using Customer and Room.
def booking(self, customer, room): self.room[room] = customer return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def room_of(self, guest_name):\n pass", "def create_room(self, name, typ):\n if typ == \"O\":\n if not name in self.all_rooms.keys():\n new_room = Office(name)\n self.offices[name] = {'room': new_room, \"occupants\": []}\n\n return \"Room crea...
[ "0.64795667", "0.57897615", "0.5745798", "0.5570147", "0.5515708", "0.5510785", "0.5508158", "0.5461325", "0.5366731", "0.5321122", "0.5318914", "0.5311966", "0.52889794", "0.52789605", "0.5276173", "0.52691346", "0.52631843", "0.5259885", "0.5246008", "0.52401894", "0.523523...
0.82782364
0
r"""Extract the mixture terms from a `Subtensor` applied to stacked `RandomVariable`\s.
def get_stack_mixture_vars( node: Apply, ) -> Optional[List[TensorVariable]]: if not isinstance(node.op, subtensor_ops): return None # pragma: no cover joined_rvs = node.inputs[0] # First, make sure that it's some sort of concatenation if not (joined_rvs.owner and isinstance(joined_rvs.ow...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mixture_evals(self, x):\n \n q_xs_list, _ = theano.scan(lambda i: \n self.get_importance_evals(x,\n T.transpose(self.mix_means[i,:]) \n ),\n sequences = [T.a...
[ "0.55834293", "0.50222605", "0.49869108", "0.49364597", "0.49183375", "0.48811042", "0.48319003", "0.48164538", "0.47995472", "0.47973362", "0.47691363", "0.47144553", "0.46347365", "0.46280158", "0.46203306", "0.46174857", "0.45873952", "0.45866102", "0.45717448", "0.45710167"...
0.6243767
0
r"""Identify mixture subgraphs and replace them with a placeholder `Op`. The basic idea is to find ``stack(mixture_comps)[I_rv]``, where ``mixture_comps`` is a ``list`` of `RandomVariable`\s and ``I_rv`` is a `RandomVariable` with a discrete and finite support. From these terms, new terms ``Z_rv[i] = mixture_comps[i][i...
def mixture_replace(fgraph, node): rv_map_feature = getattr(fgraph, "preserve_rv_mappings", None) if rv_map_feature is None: return None # pragma: no cover out_var = node.default_output() if out_var not in rv_map_feature.rv_values: return None # pragma: no cover mixture_res = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_stack_mixture_vars(\n node: Apply,\n) -> Optional[List[TensorVariable]]:\n if not isinstance(node.op, subtensor_ops):\n return None # pragma: no cover\n\n joined_rvs = node.inputs[0]\n\n # First, make sure that it's some sort of concatenation\n if not (joined_rvs.owner and isinstance...
[ "0.48551553", "0.4668693", "0.4667983", "0.46275043", "0.46109214", "0.45990863", "0.45923537", "0.45872626", "0.45784506", "0.45719367", "0.43989074", "0.4373217", "0.437228", "0.4353748", "0.4318418", "0.43084306", "0.4281538", "0.42777875", "0.42493328", "0.42295888", "0.4...
0.57059693
0
graph is a snap.PNEANet network (directed edges, attributes allowed for edges and nodes) k is an integer, the desired number of seed nodes returns a Python set of node ids selected from graph according to an algorithm
def select_seeds(self, graph, k): raise NotImplementedError return set()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __generate_random_nodes(self,k=3):\n if k < 3:\n k = 3\n\n k = min(k,len(self.G.nodes()))\n self.__logger.info(\"RANDOM_NODES: try to generate a set of {} nodes sampled with uniform distribution\".format(k))\n \n return random.sample(self.G.nodes(),k)", "def er(n...
[ "0.64143175", "0.620035", "0.61946857", "0.61219895", "0.61113346", "0.5961747", "0.5887081", "0.5886752", "0.58330846", "0.5804238", "0.57467055", "0.5741677", "0.5725308", "0.56924754", "0.568418", "0.5681005", "0.56661713", "0.56397796", "0.56176865", "0.5561148", "0.55509...
0.6774652
0
Computes a digest for the dataset. Called if the user doesn't supply a digest when constructing the dataset.
def _compute_digest(self) -> str: return compute_numpy_digest(self._features, self._targets)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def digest(self):\n pass", "def digest(self):\n pass", "def digest(self):\n pass", "def set_digest(self):\n if self.digest_algorithm is None:\n return None\n data_string = self.data_body.encode(self.encoding)\n data_string_hash = ''\n if self.digest...
[ "0.65124106", "0.65124106", "0.65124106", "0.6466326", "0.64347214", "0.6321843", "0.6317176", "0.6317176", "0.6317176", "0.6317176", "0.6317176", "0.6317176", "0.6212462", "0.6019567", "0.5889227", "0.57566303", "0.564534", "0.5605357", "0.55732524", "0.5570474", "0.5570474"...
0.6704181
0
The source of the dataset.
def source(self) -> DatasetSource: return self._source
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def source_dataset_id(self):\n return self._source_dataset_id", "def data_source_info(self) -> pulumi.Input['DatasourceArgs']:\n return pulumi.get(self, \"data_source_info\")", "def Source(self):\r\n\t\treturn self._get_attribute('source')", "def source(self) -> Dict:\n return self._db_d...
[ "0.7541831", "0.72478783", "0.724627", "0.71518767", "0.7126025", "0.71041816", "0.71041816", "0.71041816", "0.71041816", "0.71041816", "0.7062488", "0.7022122", "0.6989261", "0.6989261", "0.6989261", "0.69596076", "0.6942921", "0.68912834", "0.6875898", "0.68747234", "0.6871...
0.85655135
0
MLflow TensorSpec schema representing the dataset features and targets (optional).
def schema(self) -> Optional[TensorDatasetSchema]: try: features_schema = _infer_schema(self._features) targets_schema = None if self._targets is not None: targets_schema = _infer_schema(self._targets) return TensorDatasetSchema(features=features_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _to_tf_example_spec(tensor_info: feature_lib.TensorInfo):\n # Convert the dtype\n\n # TODO(b/119937875): TF Examples proto only support int64, float32 and string\n # This create limitation like float64 downsampled to float32, bool converted\n # to int64 which is space ineficient, no support for complexes o...
[ "0.6172608", "0.6149214", "0.6114057", "0.58575547", "0.58365905", "0.58267176", "0.5788207", "0.57629424", "0.57576257", "0.5705018", "0.5704263", "0.5703192", "0.566839", "0.5665321", "0.5627584", "0.55843943", "0.55625784", "0.55468464", "0.554591", "0.55359155", "0.552948...
0.648192
0
Converts the dataset to a collection of pyfunc inputs and outputs for model evaluation. Required for use with mlflow.evaluate().
def to_pyfunc(self) -> PyFuncInputsOutputs: return PyFuncInputsOutputs(self._features, self._targets)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def input_fn():\n features = {\n feature_name: tf.constant(features_np_list[i])\n for i, feature_name in enumerate(feature_names)\n }\n return tf.data.Dataset.zip((tf.data.Dataset.from_tensors(features),\n tf.data.Dataset.from_tensors(la...
[ "0.61746734", "0.61374897", "0.6083815", "0.6053833", "0.6007179", "0.59673", "0.5955934", "0.59508663", "0.5942239", "0.5942239", "0.5942239", "0.59358454", "0.5880781", "0.58665", "0.5807461", "0.5754803", "0.57299024", "0.56901157", "0.5661878", "0.56292754", "0.56081635",...
0.6980432
0
Converts the dataset to an EvaluationDataset for model evaluation. Required for use with mlflow.sklearn.evalute().
def to_evaluation_dataset(self, path=None, feature_names=None) -> EvaluationDataset: return EvaluationDataset( data=self._features, targets=self._targets, path=path, feature_names=feature_names, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_eval_data() -> GraphDataset:\n _load_data_if_needed()\n return eval_data", "def evaluate(self, dataset):\n\t\tpass", "def evaluate(self, dataset):\n return self.model.evaluate(dataset.X_val, dataset.y_val)", "def eval_data(dataset):\n # If dataset.num_examples is not divisible by BATC...
[ "0.6774075", "0.6744373", "0.66345686", "0.65091926", "0.62376094", "0.618386", "0.6159577", "0.607923", "0.60575503", "0.6050721", "0.6041465", "0.60004973", "0.59957707", "0.5931379", "0.5911266", "0.58230925", "0.58049375", "0.5771877", "0.57202196", "0.5719813", "0.571688...
0.6878348
0
Return the first task instance that is a module node.
def get_module_task_instance_id(task_instances): for id in task_instances: if task_instances[id] == 'module_node': return id return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def module(self) -> Optional[Module]:\n return self._module", "def get_task_module(self, \n task: ExtendedTaskHandle\n ) -> Tuple[Optional[WorkflowHandle], int]:\n # Get the handle for the head workflow of the specified branch\n branch = self.projects.get_branch(\n ...
[ "0.6600685", "0.65903246", "0.65830636", "0.6556782", "0.63857734", "0.63069093", "0.6235564", "0.61656743", "0.61501455", "0.611349", "0.60614616", "0.60614616", "0.60614616", "0.60614616", "0.60614616", "0.60064524", "0.5984121", "0.5916643", "0.5814278", "0.5775703", "0.57...
0.72872007
0
Map the mode parameter to the server parameter
def get_mode_parameter(mode): if mode == 'job': return 'cli' elif mode == 'serve': return 'serving' else: return mode
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mode (self, mode) :\r\n self.mode_ = mode", "def setMode(self, newmode=None):\n if newmode==None and self.mode: return\n \n # find it in my dictionary\n for k,v in self.items():\n if k.lower() == \"mode\":\n if newmode:\n self.mode...
[ "0.635774", "0.60149217", "0.59254426", "0.5823498", "0.5807443", "0.58069754", "0.5754248", "0.57435066", "0.5737549", "0.57359874", "0.571183", "0.5698831", "0.5697614", "0.5690271", "0.5669028", "0.5634995", "0.56066734", "0.56063735", "0.5555581", "0.55531603", "0.5553160...
0.72800505
0
Create new payment profile for the customer.
def create_payment_profile(self, cr, uid, ids, context=None): parent_model = context.get('active_model') parent_id = context.get('active_id') partner_obj = self.pool.get('res.partner') if parent_model == 'res.partner': partner = self.pool.get(parent_model).browse(cr, uid, par...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_payment_profile(self):\n self.cim.create_payment_profile(\n customer_profile_id=u'300',\n customer_type=u'individual',\n card_number=u'42222222222',\n expiration_date=u'2009-10'\n )", "def create(self, validated_data):\n request = s...
[ "0.8113861", "0.6803075", "0.66814816", "0.66451013", "0.66234976", "0.65802914", "0.65286195", "0.65008765", "0.642572", "0.64240277", "0.63918406", "0.6382911", "0.6370696", "0.6349128", "0.63416743", "0.634033", "0.6339571", "0.63367665", "0.6333817", "0.6331093", "0.63268...
0.7938045
1
to initialise appium session
def appium_init(self): desired_cups = {} desired_cups['platformName'] = 'Android' desired_cups['platformVersion'] = android_version desired_cups['deviceName'] = device_name desired_cups['appPackage'] = pkg_name desired_cups['appActivity'] = activity desired_cups['...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self):\n # iPhone\n #driver = webdriver.Remote(browser_name=\"iphone\", command_executor='http://172.24.101.36:3001/hub')\n # Android\n #driver = webdriver.Remote(browser_name=\"android\", command_executor='http://127.0.0.1:8080/hub')\n # Google Chrome \n #driver...
[ "0.6816856", "0.6816856", "0.68139327", "0.6655823", "0.6655823", "0.6626038", "0.6626038", "0.66065925", "0.645404", "0.6411942", "0.6389164", "0.6338833", "0.63149637", "0.63143766", "0.63131344", "0.6253837", "0.62187976", "0.6192686", "0.61241", "0.6083325", "0.6061882", ...
0.776544
0
Get nucleotides of this sequence, in uppercase.
def nucleotides(self): return self._nucleotides # 将字符串变作一个列表
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_nuclei(self):\n sim_layer = self._wrap_ns(self.setup_config[\"sim_layer\"])\n return cmds.listRelatives(sim_layer, ad=True, type=\"nucleus\") or []", "def upper(self):\n return asarray(upper(self))", "def dna(self):\n return self.seq.replace('U', 'T').replace('u', 't')", "...
[ "0.6221535", "0.57340753", "0.5714895", "0.56844956", "0.5653716", "0.56452274", "0.557825", "0.55324304", "0.54807276", "0.5480158", "0.543583", "0.5420287", "0.54026365", "0.5389998", "0.5383956", "0.53357613", "0.53158224", "0.5280269", "0.5272753", "0.5239405", "0.5234903...
0.7338413
0
Method that splits the serialized string of icon image file names into a list of individual file names. Multiple icons are used in the construction of the card header. As such they are stored as a single CharField in the database in serialized fashion
def serialized_icon_names(self): return self.card_icons.split(':')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map_csv_images(images: str):\n api_images = []\n images = [x.strip() for x in images.split(\",\")]\n for image in images:\n api_images.append({\n \"src\": image,\n \"name\": os.path.basename(image)\n })\n return api_images", "def...
[ "0.6400396", "0.5860754", "0.57949525", "0.5718788", "0.5458824", "0.54264355", "0.5403684", "0.5375585", "0.53601956", "0.5342643", "0.5326965", "0.5322093", "0.52950233", "0.52893776", "0.5179342", "0.5177226", "0.5173529", "0.5165671", "0.5163858", "0.51581997", "0.5148642...
0.7203977
0
Create a job. phases must be one of PHASES.keys(). centers must be a list of one or more RegistrationCenter instances input_arguments must be a dict in the form of INPUT_ARGUMENTS_TEMPLATE user is a string identifying the user running this job output_path is a directory name defining where output will be written The of...
def __init__(self, phase, centers, input_arguments, user, output_path): # Phase, centers, output_path, input_arguments, and user are set here in __init__() and # don't change hereafter. self.phase = phase self.centers = centers self.output_path = output_path self.input_ar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createJob(self, joboptions, previousId=None):\n root = self.manifest.getRootResource()\n assert self.manifest.tosca\n job = Job(self, root, joboptions, previousId)\n\n if (\n self.manifest.localEnv\n and not joboptions.parentJob\n and not joboptions....
[ "0.5533345", "0.5213588", "0.51955056", "0.516616", "0.51181", "0.5107653", "0.5101743", "0.50921166", "0.50266856", "0.49986887", "0.4986976", "0.49820703", "0.49472883", "0.49226782", "0.48967683", "0.4893118", "0.48863333", "0.48440933", "0.48361593", "0.483129", "0.481736...
0.55117947
1
Given a PDF filename and the number of pages in that PDF, add it to the tracker dict.
def add(self, filename, n_pages): with open(filename, 'rb') as f: content = f.read() size = len(content) # Before storing the filename I strip first part of output path which is the parent # directory of all of these files. We don't want that info in here because it will bec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def registerPDF(self, filename):\n now = datetime.now()\n pdfs = self.getPDFList()\n pdfs[filename] = now\n\n if (now - self.get_last_clean()).seconds > 1000:\n self.cleanPDFs()", "def filna_dict(mes):\n key = [f'pdf_{count+1}'for count in range(mes)]\n value = ['stan...
[ "0.6534924", "0.6090865", "0.60869336", "0.59436446", "0.5868866", "0.5390245", "0.5375487", "0.53754574", "0.536451", "0.52692294", "0.52630335", "0.52019525", "0.5193707", "0.51578474", "0.51526153", "0.51440996", "0.5133691", "0.5101988", "0.51002026", "0.5093113", "0.5057...
0.6580294
0
Return the phaseappropriate fully qualified filename. The filename is populated with the passed params. type_ is only appropriate when the phase is polling, and should be one of 'list', 'book', or 'sign'.
def get_filename(self, path, params, type_=None): phase = self.phase if type_: phase += ('_' + type_) filename = self.FILENAME_TEMPLATES[phase].format(**params) return os.path.join(path, filename)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hap_filename(self, filetype):\n if filetype == 'events':\n return self.folder('events') / 'run_{:07d}_{}_eventlist.fits'.format(self.obs_id, self.hap_config)\n # return self.folder('events') / 'events_{:06d}.fits.gz'.format(self.obs_id)\n elif filetype == 'aeff':\n ...
[ "0.67909026", "0.67909026", "0.67909026", "0.65891576", "0.6553777", "0.63155633", "0.6274934", "0.6262169", "0.6254593", "0.6119", "0.6093251", "0.60287684", "0.5907386", "0.5858226", "0.5752533", "0.57360524", "0.5710416", "0.57093847", "0.56988305", "0.5657184", "0.5637816...
0.8178857
0
Decorator for ProtoRPC methods. It wraps the target method with typechecking assertions as well as attaching additional a spec information placeholder.
def ProtoRPCServiceMethod(method): def wrapper(self, request): assert isinstance(request, wrapper.rpc_method_spec.request_type) logging.info("Request:\n%s", request) response = method(self, request) assert isinstance(response, wrapper.rpc_method_spec.response_type) logging.info("Response:\n%s", r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decorator(fn):\n\n def wrapper(self, *args, **kw):\n \"\"\" Type-checking method wrapper. \"\"\"\n\n actual_args = _validate_args(self, fn, trait_types, args)\n actual_kw = _validate_kw(self, fn, trait_types, kw)\n\n return_value = fn(self, *actual_args, **a...
[ "0.60659105", "0.5912555", "0.58886683", "0.58547", "0.57721925", "0.5689005", "0.5655442", "0.55839217", "0.55835086", "0.55412114", "0.5478024", "0.5463142", "0.54402745", "0.5428867", "0.53808486", "0.5377946", "0.53717476", "0.53613156", "0.5339921", "0.5330359", "0.53012...
0.6692588
0
Register the given ProtoRPC service to the given flask app.
def RegisterProtoRPCServiceToFlaskApp(app_inst, path, service_inst, service_name=None): service_name = service_name or service_inst.SERVICE_DESCRIPTOR.name endpoint_name = '__protorpc_service_view_func_' + str(uuid.uuid1()) view_func = _ProtoRPCServiceFlaskAppViewFunc(service...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_extensions(app):\n grpc_channel = grpc.insecure_channel(\n f\"{app.config['GRPC_SERVICE']}:{app.config['GRPC_PORT']}\",\n )\n grpc_client = GrpcClient(grpc_channel)\n grpc_client.init_app(app)", "def init_app(app):\n api.add_namespace(ns)\n app.register_blueprint(bp, url_pre...
[ "0.684879", "0.63785636", "0.6195718", "0.6144309", "0.6022506", "0.5998161", "0.5946135", "0.58834434", "0.5868399", "0.57719165", "0.57716846", "0.57502633", "0.57319796", "0.57161766", "0.57101405", "0.57094955", "0.57058537", "0.5704365", "0.5697186", "0.56832206", "0.567...
0.8534716
0
This function calculates the number of days that the person has had a twitter, as well as some other useful information including the average number of statuses per day, followers gained per day, and the average number of status's per day.
def calculate_days(self): tweet_time = self.data['created_at'] birthday = self.data['user']['created_at'] my_dates = {"Jan": 1, "Feb": 2, "Mar": 3, "Apr": 4, "May": 5, "Jun": 6, "Jul": 7, "Aug": 8, "Sep": 9, "Oct": 10, "Nov": 11, "Dec": 12} # This could have easily be...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def number_of_tweets_per_day(df):\n \n df['Date'] = pd.to_datetime(df['Date']) #converts date column to datetime\n df['Date'] = df['Date'].dt.date #extract only the date part of the datetime in the date column \n twitter_cnt=df.groupby('Date').count() #group the dataframe by uni...
[ "0.612147", "0.606729", "0.60178035", "0.5950646", "0.5867576", "0.56735176", "0.5570279", "0.5558129", "0.5488189", "0.5467281", "0.54378587", "0.54360205", "0.53557104", "0.53261715", "0.5321209", "0.53164685", "0.53025293", "0.5279916", "0.52756876", "0.5268043", "0.526465...
0.7308051
0
This function cleans the user description, removing all but alphabetical characters, and casting everything to lowercase.
def clean_user_desc(self): desc = self.data['user']['description'] if desc is not None: desc = ' '.join(re.sub("(RT : )|(@[\S]+)|(&\S+)|(http\S+)", " ", desc).split()) desc = " ".join(re.sub("(#\S+)", ' ', desc).split()) desc = ''.join(list(filter(lambda x: x.isalpha(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_data(s):\n s = s.strip()\n s = s.lower()\n return s", "def clean_title(self):\n # split into tokens by white space\n tokens = self.title.split(\" \")\n # remove punctuation from each token\n table = str.maketrans('', '', punctuation)\n tokens = [w.translate(t...
[ "0.6863414", "0.6794864", "0.67131686", "0.6657555", "0.66470045", "0.6622348", "0.6603716", "0.65749097", "0.6541394", "0.6529431", "0.65282935", "0.64713013", "0.64514095", "0.6423274", "0.64184916", "0.64184916", "0.64184916", "0.64184916", "0.64184916", "0.64184916", "0.6...
0.7214416
0
The following function stores the data into the specified database. This function is the heart of the program the_main_dict is an example of the power of dictionary unpacking, it also makes it very easy to modify the scraper. If new information is wanted to be gleaned, a new function can be created above, since the ent...
def store_data(self, data): self.data = data # HERE the_main_dict = {**self.user_data(), **self.entities_data(), **self.extract_relevant(), **self.locate(), **self.calculate_days(), **self.clean_user_desc()} # The below is the reason that the table creation must ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_data4test():\n administrators = {\n 'field': ['name', 'password'],\n 'data': [\n ('admin', '123'),\n ]\n }\n\n countries = {\n 'field': 'name',\n 'data': [\n 'China',\n 'India'\n ]\n }\n\n positions = {\n 'field...
[ "0.60441715", "0.5996043", "0.596327", "0.5798956", "0.5781478", "0.5778059", "0.57121223", "0.5704134", "0.5683769", "0.5660329", "0.56462157", "0.56408316", "0.56344336", "0.56295013", "0.56281066", "0.55866694", "0.5582469", "0.5556601", "0.5539738", "0.55344856", "0.55253...
0.6890705
0
Finds the class folders in a dataset.
def _find_classes(self, dir): if sys.version_info >= (3, 5): # Faster and available in Python 3.5 and above classes = [d.name for d in os.scandir(dir) if d.is_dir()] else: classes = [d for d in os.listdir(dir) if os.path.isdir(os.path.join(dir, d))] # accordin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_filenames_and_classes(dataset_dir):\n # print 'DATASET DIR:', dataset_dir\n # print 'subdir:', [name for name in os.listdir(dataset_dir)]\n # dataset_main_folder_list = []\n # for name in os.listdir(dataset_dir):\n # \tif os.path.isdir(name):\n # \t\tdataset_main_folder_list.append(name)...
[ "0.6685375", "0.6506525", "0.62016714", "0.60406756", "0.60406756", "0.6014239", "0.60130084", "0.5867808", "0.5866093", "0.58132404", "0.5808638", "0.57448393", "0.5679017", "0.5648068", "0.5646736", "0.56428564", "0.5630292", "0.55694395", "0.5536598", "0.5508448", "0.54997...
0.66070235
1
Make a pool of threads each associated with a host machine
def __init__(self, hostFileName, cwd=os.getcwd(), daemons=True): # Queues for each IO to threads: self.Q = {'in': Queue.Queue(), 'out': Queue.Queue(), 'err': Queue.Queue()} self.pool = [] self.hostList = [] if hostFileName: if not os.path.exists(h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parallel_ping(host_list):\n global __parallel_ping_results\n __parallel_ping_results = {}\n for host in host_list:\n #print host\n t = Thread(target=ping_host, args=([host, True]))\n t.start()\n start_time = time.time()\n while len(__parallel_ping_results.keys()) < len(host_...
[ "0.655178", "0.63555986", "0.6245442", "0.6185018", "0.61387515", "0.612153", "0.611084", "0.6075717", "0.60519487", "0.602758", "0.6015372", "0.60052943", "0.5999975", "0.5924911", "0.58949304", "0.5872436", "0.586431", "0.5798052", "0.57938457", "0.5767427", "0.5758079", ...
0.6361351
1
Check that the host is fine
def _hostOK(self, host): if os.system("ping -c 1 $node &> /dev/null"): # No access to host return False elif os.system("ssh -n -a -x $node 'ls' &> /dev/null"): # No route to host return False else: return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_host(host):\n if host in ACCEPTED_HOSTS:\n return True\n return False", "def validate_host(host):\n # FIXME: not convinced that pinging the machine is a good choice. it's definitely not needed for localhost\n route = os.system(\"ping -t 2 -c 1 \" + host)\n\n if route != 0:\n ...
[ "0.7338", "0.7260215", "0.71741664", "0.7165072", "0.7075928", "0.70757973", "0.70631474", "0.69782174", "0.690107", "0.6894701", "0.68894523", "0.685175", "0.68494964", "0.6840691", "0.6822734", "0.6805809", "0.68029505", "0.67868817", "0.677428", "0.67692775", "0.6760407", ...
0.7349484
0
Work requests are posted as (data, flag) pairs to self.Q['in']
def enqueue(self, data, flag='process'): self.Q['in'].put((data, flag))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def work(self, request):\n raise NotImplementedError", "def make_work_request(self):\n request = StoreRequest()\n self.bb_client.read_wait(request, self.handle_request)", "def request(self, *args, **kwargs):\n self.work_request_queue.put((args, kwargs))\n return self.result_q...
[ "0.5949052", "0.58619964", "0.57354426", "0.57354426", "0.5660954", "0.56253475", "0.56113654", "0.54027313", "0.53991187", "0.5320281", "0.5314689", "0.53037", "0.52673256", "0.5247165", "0.51981235", "0.51882434", "0.51666546", "0.51304704", "0.5116723", "0.50657135", "0.50...
0.6283745
0
We report errors by adding error information fo self.Q['err']
def reportError(self): self.Q['err'].put(sys.exc_info()[:2])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ERR(self):", "def error(self):\n ...", "def error_info(self, step=None):\n pyfusion.warn('acquisition-specific error_info not implemented for ', self.name)\n if hasattr(self, 'errmsg'):\n return(self.errmsg)\n else:\n return('(further info not provided by %...
[ "0.68169886", "0.6703832", "0.6664828", "0.6615991", "0.6601394", "0.65937", "0.6505076", "0.64830595", "0.6382777", "0.63823426", "0.63559157", "0.63317305", "0.63274634", "0.63117236", "0.630325", "0.6293461", "0.6269772", "0.62692386", "0.6142895", "0.61417747", "0.6118879...
0.77644986
0
routine that generates the python files for a network given with its id
def generate_files_from_network(id): folder_prefix = "results/"+id+"/" network_prefix = "results/"+id+"_" g = open(network_prefix+'network.json', 'r') data = json.load(g) names = [] for node in data: my_name = data[node]['my_name'] names.append(my_name) targets = data[node]['target'] n_receive = data[node...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, folder):\n try:\n os.makedirs(folder)\n print(\"Created directory for generated code.\")\n except FileExistsError:\n pass\n\n with open(os.path.join(folder, \"network.cpp\"), \"w\") as f:\n f.write(self.network_code)\n\n with op...
[ "0.590788", "0.5874324", "0.5737762", "0.5696103", "0.56890774", "0.5685596", "0.5632882", "0.55999607", "0.5585361", "0.55723614", "0.5542163", "0.55384207", "0.55001885", "0.5442196", "0.5412975", "0.5404587", "0.53930384", "0.53915316", "0.5383674", "0.53525513", "0.533193...
0.8110321
0
Performs n_runs runs. Calculates the mean run time and its standard deviation.
def measure(self): # --- perform repeated runs for i_run in range(self.n_runs): if self.verbosity > 0: print("Run {0} / {1} ...".format(i_run, self.n_runs), end = '') tdelta = self._timed_execute() self._run_times[i_run] = tdelta if sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def std_run_time(self) -> float:\n return float(self.result_array.sum(axis=0).std())", "def mean_run_time(self) -> float:\n return float(self.result_array.sum(axis=0).mean())", "def test(self, n_test_runs: int = 10) -> None:\n steps: np.ndarray = np.zeros(n_test_runs)\n rewards: np....
[ "0.7128686", "0.69186974", "0.66802835", "0.65363413", "0.65032595", "0.62969327", "0.6180399", "0.6155547", "0.6077361", "0.60721064", "0.6061706", "0.6055162", "0.6038555", "0.59914356", "0.59811", "0.59722203", "0.59655726", "0.59520245", "0.59504795", "0.59392256", "0.592...
0.769376
0
Sets the array to store the run times.
def _set_runtimes(self): self._run_times =np.zeros(self.n_runs, dtype = np.float)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rt_arr_time(self, rt_arr_time):\n\n self._rt_arr_time = rt_arr_time", "def arr_time(self, arr_time):\n\n self._arr_time = arr_time", "def set_analysis_time(self, t):\n for z in self.zones:\n z.set_demand_rate_per_t(t)", "def times(self):\n if self._times is None:\n ...
[ "0.71060574", "0.6831951", "0.6094944", "0.6023629", "0.59301555", "0.5927784", "0.59000695", "0.5893799", "0.5794831", "0.5782335", "0.57754135", "0.5765112", "0.5756272", "0.5755968", "0.57552105", "0.57426566", "0.57202667", "0.5710866", "0.5678358", "0.56748104", "0.56742...
0.7519892
0
Construct the JSONRPC payload for NXAPI.
def _build_payload(self, commands, method, rpc_version="2.0", api_version=1.0): payload_list = [] id_num = 1 for command in commands: payload = { "jsonrpc": rpc_version, "method": method, "params": {"cmd": command, "version": api_versio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _build_payload(self, body: Dict) -> Dict[str, Any]:\n return {'jsonrpc': '2.0',\n 'id': self._id_count,\n **body}", "def build_payload():\n payload = json.dumps({\"method\": \"ListAccounts\", \"params\": {}, \"id\": 1})\n return payload", "def build_payload():\r\n...
[ "0.6646184", "0.6353114", "0.616185", "0.59743214", "0.57910913", "0.5551115", "0.54774815", "0.53832793", "0.53814846", "0.5377377", "0.5373829", "0.53335816", "0.5316359", "0.5309334", "0.5300158", "0.5277427", "0.5255529", "0.5246911", "0.5226832", "0.5224673", "0.5212027"...
0.67363757
0
Normalize the API response including handling errors; adding the sent command into the returned data strucutre; make response structure consistent for raw_text and structured data.
def _process_api_response(self, response, commands, raw_text=False): response_list = json.loads(response) if isinstance(response_list, dict): response_list = [response_list] # Add the 'command' that was executed to the response dictionary for i, response_dict in enumerate(r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _format_output(self, cmd, resp):\n cmd_words = cmd.split()\n\n # Fixup the white spaces first, as some devices are inserting backspace\n # characters in the command echo\n cmd_output = self._fixup_whitespace(resp.data)\n\n # Command regex in the output\n # [SPACE]{Comm...
[ "0.6389262", "0.600444", "0.5834561", "0.5768502", "0.5764521", "0.5759925", "0.5750538", "0.5715554", "0.5705946", "0.56335557", "0.5578416", "0.5562781", "0.55509615", "0.5543795", "0.5529896", "0.54988384", "0.54969996", "0.5450568", "0.5446612", "0.54351443", "0.5430926",...
0.71244085
0
Show a scan result.
def show_result(): return scan_result(request.args.get('filename'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_results():\n pass", "def help_scan(self):\n print(SCAN)", "def _show_results(results):\n if len(results) == 0:\n click.echo(\"Could not find any command with these parameters.\")\n else:\n for kw, result in results.items():\n click.echo(kw.upper())\n ...
[ "0.7223766", "0.677393", "0.67441875", "0.67141116", "0.6668098", "0.6641182", "0.6638432", "0.6629325", "0.6602097", "0.6531959", "0.6531959", "0.6452159", "0.6336791", "0.62745404", "0.625516", "0.62364453", "0.62256175", "0.62189597", "0.6214998", "0.62118405", "0.6148223"...
0.7591922
0
Reads the constant/polyMesh/points file in polymesh directory and stores the points coordinates into region.mesh.nodeCentroids
def cfdReadPointsFile(self): with open(self.pointsFile,"r") as fpid: print('Reading points file ...') points_x=[] points_y=[] points_z=[] for linecount, tline in enumerate(fpid): if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_velodyne_points(filename):\n points = np.fromfile(filename, dtype=np.float32).reshape(-1, 4)\n points[:, 3] = 1.0 # homogeneous\n return points", "def load_point_cloud(filename, min_norm_normal=1e-5, dtype=torch.float64):\n v, _, n = pcu.load_mesh_vfn(filename, dtype=np.float64)\n v, idx...
[ "0.6062852", "0.57921666", "0.57784444", "0.56458706", "0.55713", "0.5558169", "0.55507755", "0.55493534", "0.5425793", "0.5417503", "0.54126066", "0.53848904", "0.5382733", "0.53797793", "0.5339229", "0.5333565", "0.5318457", "0.53098196", "0.5277149", "0.5276916", "0.526966...
0.71026045
0
Reads the constant/polyMesh/faces file and stores the nodes pertaining to each face in region.mesh.faceNodes Starts with interior faces and then goes through the boundary faces.
def cfdReadFacesFile(self): with open(self.facesFile,"r") as fpid: print('Reading faces file ...') self.faceNodes=[] for linecount, tline in enumerate(fpid): if not io.cfdSkipEmptyLines(tline): conti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_faces(zone_id, Nmin, Nmax, bc_type, face, ifile):\n \n line = ifile.readline()\n readline = False\n if re.search(re_parant, line): # check for initial paranthesis\n readline = True\n\n ls = []\n for i in range(Nmin, Nmax + 1):\n if readline:\n line = ifile.readli...
[ "0.6993801", "0.6767997", "0.6753028", "0.64349353", "0.6316006", "0.6189894", "0.60601133", "0.59800917", "0.5853179", "0.5815255", "0.581318", "0.5743881", "0.5725399", "0.5717558", "0.56922877", "0.5675419", "0.56725353", "0.56649673", "0.5658588", "0.5642614", "0.5559848"...
0.71428
0
Reads the polyMesh/constant/owner file and returns a list where the indexes are the faces and the corresponding element value is the owner cell
def cfdReadOwnerFile(self): with open(self.ownerFile,"r") as fpid: print('Reading owner file ...') ## (list) 1D, indices refer to faces, list value is the face's owner cell self.owners=[] start=False for linecount, tline in enu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cfdReadNeighbourFile(self): \r\n with open(self.neighbourFile,\"r\") as fpid:\r\n print('Reading neighbour file ...')\r\n\r\n ## (list) 1D, indices refer to faces, list value is the face's neighbour cell\r\n self.neighbours=[]\r\n start=False\r\n \r...
[ "0.66420263", "0.6579439", "0.63877815", "0.6324881", "0.6302976", "0.6147343", "0.58106387", "0.5799776", "0.57816786", "0.57456756", "0.57350624", "0.5637943", "0.5578968", "0.55768037", "0.5548322", "0.5527934", "0.55235755", "0.55125314", "0.55076975", "0.5487378", "0.547...
0.73924744
0
Reads the polyMesh/constant/neighbour file and returns a list where the indexes are the faces and the corresponding element value is the neighbour cell
def cfdReadNeighbourFile(self): with open(self.neighbourFile,"r") as fpid: print('Reading neighbour file ...') ## (list) 1D, indices refer to faces, list value is the face's neighbour cell self.neighbours=[] start=False for linec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readmesh(filename):\n f = open(filename, 'rb')\n cells = []\n edges = []\n\n # create each cell and edge, etc\n for line in f:\n \n return cells, edges", "def read_faces(zone_id, Nmin, Nmax, bc_type, face, ifile):\n \n line = ifile.readline()\n readline = False\n if re.se...
[ "0.7080466", "0.64505947", "0.63280064", "0.6270814", "0.6220118", "0.6151964", "0.60763824", "0.60697734", "0.6054703", "0.59938693", "0.59748435", "0.5961096", "0.5877808", "0.58437073", "0.57785225", "0.5757771", "0.57321125", "0.5708412", "0.570145", "0.56631637", "0.5645...
0.78006417
0
Reads the polyMesh/boundary file and reads its contents in a dictionary (self.cfdBoundary)
def cfdReadBoundaryFile(self): with open(self.boundaryFile,"r") as fpid: print('Reading boundary file ...') ## (dict) key for each boundary patch self.cfdBoundaryPatchesArray={} for linecount, tline in enumerate(fpid): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_mesh_boundary(sFilename_boundary_in):\n iReturn_code = 1\n if os.path.isfile(sFilename_boundary_in):\n pass\n else:\n print('This mesh file does not exist: ', sFilename_boundary_in )\n iReturn_code = 0\n return iReturn_code\n\n \n pDriver_json = ogr.GetDriverByNa...
[ "0.7112741", "0.644018", "0.60160327", "0.59527653", "0.5865294", "0.58180267", "0.57285446", "0.5676365", "0.56467867", "0.56242234", "0.56193817", "0.56067514", "0.5567469", "0.55593663", "0.555075", "0.55375695", "0.548389", "0.5441604", "0.5419088", "0.5406433", "0.540432...
0.8183857
0
Checks if there are any inlets or outlets in the domain, based on the boundary types found in system/boundary if any of the boundaries is an inlet or outlet returns self.foundPatch = True
def cfdCheckIfCavity(self): self.foundPatch=False for patch, value in self.cfdBoundaryPatchesArray.items(): if value['type'] == 'inlet' or 'outlet': self.foundPatch =True break
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _find_intersection(self):\n count = 0\n for each_list in self.lab.look():\n if each_list[1] == 'wall':\n count += 1\n if count < 2:\n return True\n else:\n return False", "def interior_contains(self, point):\n try:\n ...
[ "0.58113116", "0.5307988", "0.52947986", "0.52334994", "0.5190707", "0.5190707", "0.51829594", "0.5167576", "0.51436496", "0.51150495", "0.5106681", "0.5100987", "0.5083269", "0.5073458", "0.50527287", "0.5050111", "0.5048492", "0.5039095", "0.5037185", "0.5035715", "0.501976...
0.66645414
0
Populates self.elementNeighbours and self.elementFaces also populates self.upperAnbCoeffIndex self.lowerAnbCoeffIndex
def cfdProcessElementTopology(self): ## (list of lists) List where each index represents an element in the domain. Each index has an associated list which contains the elements for which is shares a face (i.e. the neighouring elements). Do not confuse a faces 'neighbour cell', which refers to a face's neighbou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(\n self,\n nodes: np.ndarray,\n elements: np.ndarray,\n neighbours: np.ndarray,\n aabb_nsteps=None,\n ):\n self.nodes = np.array(nodes)\n if self.nodes.shape[1] != 3:\n raise ValueError(\"Nodes must be 3D\")\n self.n_nodes = self.no...
[ "0.6303371", "0.62767035", "0.61436707", "0.60005885", "0.5964688", "0.59249604", "0.5861333", "0.5815559", "0.58108765", "0.58006907", "0.5785534", "0.5781038", "0.5741886", "0.5725045", "0.57079613", "0.5664946", "0.5640401", "0.56379163", "0.5558144", "0.5535824", "0.55279...
0.7260362
0
Invokes the cfdInvertConnectivity method on self.elementNodes and self.faceNodes
def cfdProcessNodeTopology(self): self.nodeElements = self.cfdInvertConnectivity(self.elementNodes) self.nodeFaces = self.cfdInvertConnectivity(self.faceNodes)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evert(self):\n for e in self.edges:\n self.invert()\n for f in self.faces:\n f.invert()", "def cfdProcessElementTopology(self):\r\n ## (list of lists) List where each index represents an element in the domain. Each index has an associated list which contains the ele...
[ "0.5821849", "0.5730969", "0.55383444", "0.53221613", "0.5241864", "0.52088916", "0.5162908", "0.5152647", "0.5081784", "0.5039433", "0.5026532", "0.50008416", "0.49971217", "0.4968445", "0.49261603", "0.49011883", "0.48973167", "0.4884325", "0.487053", "0.4816284", "0.480662...
0.76931965
0
Returns an array with the inverted connectivty of an input array. For example self.cfdInvertConnectivty(self.elementNodes) takes the elementNodes connectivity array and returns an inverted array with the elements belonging to each node.
def cfdInvertConnectivity(self,theConnectivityArray): theInvertedSize=0 for i in range(len(theConnectivityArray)): for j in range(len(theConnectivityArray[i])): theInvertedSize=max(theInvertedSize, int(theConnectivityArray[i][...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _inverse_edges(edges: np.array) -> np.array:\n inversed_edges = edges.copy()\n inversed_edges[:, [0, 1]] = inversed_edges[:, [1, 0]]\n return inversed_edges", "def invert(array):\n\n f = [1, 1, 1]\n\n result = np.array(array)\n\n for row in range(result.shape[0]):\n ...
[ "0.66534036", "0.6518351", "0.62958425", "0.6038272", "0.5926876", "0.5920651", "0.57210755", "0.5666739", "0.56622314", "0.56140095", "0.56013304", "0.559019", "0.5585894", "0.55741835", "0.55702674", "0.5544531", "0.5525082", "0.54965556", "0.54877883", "0.5465165", "0.5461...
0.7595942
0
Creates a list of the boundary elements pertaining to a patch in self.cfdBoundaryPatchesArray
def cfdGetBoundaryElementsSubArrayForBoundaryPatch(self): for iBPatch, theBCInfo in self.cfdBoundaryPatchesArray.items(): startBElement=self.numberOfElements+self.cfdBoundaryPatchesArray[iBPatch]['startFaceIndex']-self.numberOfInteriorFaces endBElement=startBElement+se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cfdGetFaceSfSubArrayForBoundaryPatch(self):\r\n\r\n for iBPatch, theBCInfo in self.cfdBoundaryPatchesArray.items():\r\n \r\n startBFace=self.cfdBoundaryPatchesArray[iBPatch]['startFaceIndex']\r\n \r\n endBFace=startBFace+self.cfdBoundaryPatchesArray[iBPatch]['...
[ "0.66238856", "0.6583019", "0.63319707", "0.62509674", "0.5810478", "0.57850915", "0.57772857", "0.5755381", "0.574208", "0.57319623", "0.5693091", "0.5677913", "0.565698", "0.5656909", "0.5631149", "0.56236035", "0.561628", "0.5594505", "0.5521329", "0.5518038", "0.5511095",...
0.7922706
0
Creates a list with the centroids for each face of the patch in self.cfdBoundaryPatchesArray[patch]['faceCentroids']
def cfdGetFaceCentroidsSubArrayForBoundaryPatch(self): for iBPatch, theBCInfo in self.cfdBoundaryPatchesArray.items(): startBFace=self.cfdBoundaryPatchesArray[iBPatch]['startFaceIndex'] endBFace=startBFace+self.cfdBoundaryPatchesArray[iBPatch]['numberOfBFaces']...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_centroids(array_boxes_detected):\n\tarray_centroids = [] # Initialize empty centroid.\n\tfor index,box in enumerate(array_boxes_detected):\n\t\t# Get the centroid\n\t\tcentroid = get_points_from_box(box)\n\t\tarray_centroids.append(centroid)\n\treturn array_centroids", "def _face_center(mesh, face):\n ...
[ "0.7046401", "0.68242687", "0.66444397", "0.65953606", "0.6481809", "0.6481589", "0.64815354", "0.63812876", "0.63800615", "0.63506544", "0.6348983", "0.6310201", "0.6302741", "0.6266533", "0.62410563", "0.6238148", "0.62018365", "0.61793166", "0.61717063", "0.6156559", "0.61...
0.8348199
0
Creates a list with the element owners of each boundary patch face in self.cfdBoundaryPatchesArray[patch]['owners_b']
def cfdGetOwnersSubArrayForBoundaryPatch(self): for iBPatch, theBCInfo in self.cfdBoundaryPatchesArray.items(): startBFace=self.cfdBoundaryPatchesArray[iBPatch]['startFaceIndex'] endBFace=startBFace+self.cfdBoundaryPatchesArray[iBPatch]['numberOfB...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cfdGetFaceCentroidsSubArrayForBoundaryPatch(self):\r\n \r\n for iBPatch, theBCInfo in self.cfdBoundaryPatchesArray.items():\r\n \r\n startBFace=self.cfdBoundaryPatchesArray[iBPatch]['startFaceIndex']\r\n endBFace=startBFace+self.cfdBoundaryPatchesArray[iBPatch]['n...
[ "0.6272683", "0.60468376", "0.5986283", "0.57262784", "0.5703393", "0.55589825", "0.55589825", "0.5371412", "0.5351118", "0.53406864", "0.53110504", "0.52749026", "0.526567", "0.5182851", "0.50886273", "0.50434333", "0.5027783", "0.5022201", "0.5004965", "0.5003028", "0.50030...
0.869975
0
Creates a list with the surface vectors (Sf) of each face belonging to each boundary patch in self.cfdBoundaryPatchesArray[patch]['facesSf']
def cfdGetFaceSfSubArrayForBoundaryPatch(self): for iBPatch, theBCInfo in self.cfdBoundaryPatchesArray.items(): startBFace=self.cfdBoundaryPatchesArray[iBPatch]['startFaceIndex'] endBFace=startBFace+self.cfdBoundaryPatchesArray[iBPatch]['numberOfBFaces'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def faces(self):\r\n \r\n faceset = set()\r\n for faset in self.SCFaset:\r\n for face in sub_lists(faset):\r\n faceset.add(tuple(face))\r\n return list(faceset)", "def cfdGetFaceCentroidsSubArrayForBoundaryPatch(self):\r\n \r\n for iBPatch, theB...
[ "0.64100915", "0.6369873", "0.5976773", "0.5858078", "0.58520514", "0.5828252", "0.5824009", "0.5809718", "0.5668565", "0.5609101", "0.5503548", "0.54885036", "0.5488245", "0.5477704", "0.54684967", "0.54319197", "0.5385", "0.5378606", "0.5357985", "0.53174233", "0.5314159", ...
0.8260415
0
r"""Convert a Luv image to RGB.
def luv_to_rgb(image: torch.Tensor, eps: float = 1e-12) -> torch.Tensor: if not isinstance(image, torch.Tensor): raise TypeError(f"Input type is not a torch.Tensor. Got {type(image)}") if len(image.shape) < 3 or image.shape[-3] != 3: raise ValueError(f"Input size must have a shape of (*, 3, H, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yuv_to_rgb(img_yuv):\n\n y = img_yuv[..., 0]\n u = img_yuv[..., 1]\n v = img_yuv[..., 2]\n\n r = y + 1.14 * v\n g = y - 0.396 * u - 0.581 * v\n b = y + 2.029 * u\n\n img_rgb = np.stack((r, g, b), axis=2)\n img_rgb = np.clip(img_rgb, 0, 1)\n return img_rgb", "def l_to_rgb(img_l):\n ...
[ "0.73143035", "0.7251187", "0.69873387", "0.6914302", "0.68804914", "0.67810845", "0.6616803", "0.66152626", "0.64903414", "0.6427586", "0.63789034", "0.63629293", "0.63492566", "0.6346568", "0.62895", "0.6284679", "0.6284679", "0.6266191", "0.6226339", "0.62138724", "0.61786...
0.75251347
0
The expectation this result refers to.
def expectation(self): return self._expectation
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getExpectations():", "def expectation_results(self):\n return self._expectation_results", "def expectation(self):\n\n return self.rate", "def result(self):\n return self['result']", "def actual(self):\n return self._actual", "def result( self):\n return self._result...
[ "0.70949036", "0.7075736", "0.6562889", "0.6487446", "0.6379067", "0.6245184", "0.6228066", "0.6214718", "0.61826444", "0.61826444", "0.61826444", "0.61301345", "0.6068082", "0.6041326", "0.6041326", "0.60401314", "0.60295284", "0.60284936", "0.60033375", "0.59891444", "0.596...
0.8067844
0
This method adds a HeapNode instance to the heap If value == None the new node's value should be set to key
def add(self, key, value=None): if value is None: value = key node = HeapNode(key, value) self.store.append(node) self.heap_up(len(self.store)-1) return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self, key, value):\n self.heap.append(None)\n hi = HeapItem(key,value)\n self.siftup(hi, len(self.heap)-1)\n return hi", "def insert(self,key, value):\n if key in self._position:\n # reset value for this node\n node_pos = self._position[key]\n ...
[ "0.7648072", "0.74902827", "0.7373115", "0.7234341", "0.7136891", "0.7116028", "0.71096873", "0.7027108", "0.6964224", "0.69391847", "0.6913161", "0.68906623", "0.6862145", "0.6831916", "0.6826557", "0.6810585", "0.6748281", "0.674702", "0.674702", "0.6721699", "0.67169315", ...
0.8569193
0
This helper method takes an index and moves the corresponding element down the heap if it's larger than either of its children and continues until the heap property is reestablished.
def heap_down(self, index): left_child = (2*index) + 1 right_child = (2*index) + 2 if left_child < len(self.store): if right_child >= len(self.store): min_child = left_child elif self.store[left_child].key < self.store[right_child].key: m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shift_item_up(self, index):\n while index > 0:\n parent_index = index // 2\n if parent_index > 0 and self.heaplist[parent_index] < self.heaplist[index]:\n self.heaplist[parent_index], self.heaplist[index] = self.heaplist[index], self.heaplist[parent_index]\n ...
[ "0.78819776", "0.78374714", "0.775684", "0.7716298", "0.76782036", "0.76622623", "0.7653643", "0.7625856", "0.76255757", "0.75629497", "0.7516674", "0.74774665", "0.74676585", "0.74305683", "0.7408693", "0.7344564", "0.7340051", "0.72780806", "0.7258266", "0.7112251", "0.7103...
0.7925526
0
Creates a hypothesis space of concepts defined by 1D lines
def create_line_hyp_space(n_features): hyp_space = [] for i in range(1, n_features + 1): for j in range(n_features - i + 1): hyp = [0 for _ in range(n_features)] hyp[j:j + i] = [1 for _ in range(i)] hyp_space.append(hyp) hyp_space = np.array(hyp_space) return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def theory_line(dm):\n x_eq = [0.001 + i*0.0005 for i in range (2050) ]\n x_eq = [ x for x in x_eq if x < 1 and x> 0]\n y = [ dna_dx(i, dm=dm) for i in x_eq ]\n return x_eq, y", "def _create_examples(self, lines, set_type):\n examples = []\n for (i, line) in enumerate(tqdm(lines)):\n ...
[ "0.6020074", "0.59520864", "0.59442204", "0.58756053", "0.58735186", "0.5824095", "0.5824095", "0.5824095", "0.58126694", "0.58126694", "0.58126694", "0.58126694", "0.58126694", "0.5809688", "0.58067495", "0.57860094", "0.57855606", "0.5772822", "0.5760834", "0.5738889", "0.5...
0.65992
0
Creates a hypothesis space of concepts defined by a linear boundary
def create_boundary_hyp_space(n_features): hyp_space = [] for i in range(n_features + 1): hyp = [1 for _ in range(n_features)] hyp[n_features-i:n_features] = [0 for _ in range(i)] hyp_space.append(hyp) hyp_space = np.array(hyp_space) return hyp_space
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_hyperplane(bounds):\n\n (bounds, dimension) = infer_dimension(bounds)\n intercept_points = random_plane_points(dimension, bounds)\n\n # Solve for weights. Bias is arbitrary\n bias = 1\n line_weights = np.linalg.solve(intercept_points, \n np.ones((dimensio...
[ "0.5739141", "0.5739122", "0.56194", "0.55579776", "0.55400413", "0.53403825", "0.5319491", "0.53076965", "0.5300392", "0.5287453", "0.5264358", "0.526128", "0.524128", "0.5218088", "0.5199668", "0.51865673", "0.5182549", "0.5162166", "0.51524615", "0.51202494", "0.5112061", ...
0.6190379
0
copy directory from a location in bcdbfs file system to another
def dir_copy_from_bcdbfs(self, path, dest, recursive=True): if path == j.sal.fs.getParent(dest): raise j.exceptions.Base("{} can not copy directory into itself".format(path)) dir_source = self._dir_model.get_by_name(name=path)[0] source_files = dir_source.files for file_id in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_copy_form_bcdbfs(self, path, dest):\n source_file = self._file_model.get_by_name(name=path)[0]\n if self.is_dir(dest):\n dest = j.sal.fs.joinPaths(dest, j.sal.fs.getBaseName(path))\n dest_file = self.file_create_empty(dest)\n if source_file.blocks:\n dest_...
[ "0.71023744", "0.6703752", "0.66856694", "0.66723436", "0.65399146", "0.63844293", "0.6352645", "0.63223726", "0.63185656", "0.6199637", "0.61854225", "0.61737543", "0.6067853", "0.6042175", "0.60249907", "0.60219187", "0.60057676", "0.59954137", "0.5986715", "0.5986715", "0....
0.67592067
1
copies a dir from either local file system or from bcdbfs
def dir_copy(self, path, dest, recursive=True): if j.sal.fs.exists(path): self.dir_copy_from_local(path, dest, recursive=recursive) else: self.dir_copy_from_bcdbfs(path, dest, recursive=recursive)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copydir(self):\n pass", "def _staf_dir_copy(self, local_path, remote_path):\n\n staf_request = ('COPY DIRECTORY \"{0}\" TODIRECTORY \"{1}\" TOMACHINE \"{2}\" RECURSE '\n 'KEEPEMPTYDIRECTORIES'.format(unix_style_path(local_path),\n ...
[ "0.69788426", "0.6934568", "0.6863278", "0.6720416", "0.6607559", "0.6459997", "0.64516854", "0.64001465", "0.6382422", "0.6349111", "0.6315824", "0.629438", "0.6192204", "0.61501163", "0.6110513", "0.6094284", "0.60623604", "0.60623604", "0.60409164", "0.60317975", "0.602858...
0.71716106
0
copies file to another location in bcdbfs
def file_copy_form_bcdbfs(self, path, dest): source_file = self._file_model.get_by_name(name=path)[0] if self.is_dir(dest): dest = j.sal.fs.joinPaths(dest, j.sal.fs.getBaseName(path)) dest_file = self.file_create_empty(dest) if source_file.blocks: dest_file.blocks...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy(self, source_host, dest_host, filename):", "def copy(self, src_path: str, tgt_path: str) -> None:", "def _copy_file ( self, source, dest ):\n return", "def copy_file(fs, inpath, outpath):\n fs.copy(inpath, outpath)", "def do_push_file(dbsync, bibkey):\n dbsync.push_file_to_dpt(bibkey)",...
[ "0.67937577", "0.66439027", "0.654227", "0.6463044", "0.6287584", "0.62027806", "0.61824614", "0.61824614", "0.61824614", "0.6136874", "0.604777", "0.60458636", "0.60160655", "0.600383", "0.5992231", "0.5968232", "0.59613574", "0.5906236", "0.58963025", "0.5890744", "0.588497...
0.741343
0
list dirs in path
def list_dirs(self, path="/"): path = j.sal.fs.pathClean(path) dir_obj = self._dir_model.get_by_name(path) if not dir_obj: raise j.exceptions.Base("path {} does not exist".format(path)) res = [self._dir_model.get(item).name for item in dir_obj[0].dirs] return res
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_dir(self, path):", "def listdir(self, path):\n return os.listdir(path)", "def dirs_in_dir(path):\n listing = sorted(os.listdir(path))\n\n dirs = []\n for name in listing:\n longname = path + '/' + name\n if name[0] == '.':\n continue\n if not os.path.isd...
[ "0.8267754", "0.7876088", "0.7820517", "0.7818989", "0.77918345", "0.77914023", "0.7739141", "0.77061784", "0.76079226", "0.75877917", "0.75667036", "0.75333965", "0.75106966", "0.75100106", "0.7388306", "0.7373784", "0.73734975", "0.73007804", "0.7268687", "0.7239512", "0.71...
0.81010455
1
list files and dirs in path
def list_files_and_dirs(self, path="/"): dirs = self.list_dirs(path) files = self.list_files(path) return dirs + files
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_dir(self, path):", "def listdir(self, path):\n return os.listdir(path)", "def files_in_dir(path):\n return os.listdir(path)", "def list_dir(*path):\n path = os.path.join(*path)\n return next(os.walk(path))[1]", "def listFiles(path):\n outputList = []\n for root, dirs, files in os...
[ "0.83185124", "0.77946", "0.77197695", "0.76397246", "0.7593888", "0.7554509", "0.7526815", "0.7493109", "0.74290884", "0.7417148", "0.74146575", "0.74083495", "0.7353827", "0.7349735", "0.73133796", "0.73091555", "0.73030275", "0.7291771", "0.7282867", "0.72654945", "0.72480...
0.8275478
1
Genere le message en bytes. Override dans sousclasse pour ajouter le contenu apres le prefixe.
def encoder(self): prefixe = pack('=BHB', VERSION_PROTOCOLE, self.type_message, self.node_id) return prefixe
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_message(command_code, body=b''):\n return bytes([MESSAGE_START_BYTE, command_code.value]) + body", "def _encode_message(cls, message):\n if message.magic == 0:\n msg = b''.join([\n struct.pack('>BB', message.magic, message.attributes),\n write_int_str...
[ "0.6714725", "0.65364087", "0.65004826", "0.63879657", "0.6349289", "0.63001084", "0.62998873", "0.62687963", "0.6251672", "0.6228639", "0.62227476", "0.6194817", "0.6192922", "0.6158864", "0.6133761", "0.6112788", "0.608351", "0.60514784", "0.60459346", "0.60445726", "0.6040...
0.68999904
0
Builds the boson destruction operator acting on the `site`th of the Hilbert space `hilbert`. If `hilbert` is a nonBosonic space of local dimension M, it is considered as a bosonic space of local dimension M.
def destroy(hilbert, site): N = hilbert.local_size D = _np.array([_np.sqrt(m) for m in _np.arange(1, N)]) mat = _np.diag(D, 1) return _LocalOperator(hilbert, mat, [site])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(hilbert, site):\n N = hilbert.local_size\n\n D = _np.array([_np.sqrt(m) for m in _np.arange(1, N)])\n mat = _np.diag(D, -1)\n return _LocalOperator(hilbert, mat, [site])", "def number(hilbert, site):\n N = hilbert.local_size\n\n D = _np.array([m for m in _np.arange(0, N)])\n mat =...
[ "0.6290069", "0.53099203", "0.47968534", "0.46895236", "0.45717433", "0.451291", "0.44885474", "0.44701657", "0.4418953", "0.43638197", "0.43075168", "0.4289404", "0.42596105", "0.42549556", "0.4237475", "0.41826403", "0.41396168", "0.41315678", "0.41115475", "0.41025934", "0...
0.729138
0
Builds the boson creation operator acting on the `site`th of the Hilbert space `hilbert`. If `hilbert` is a nonBosonic space of local dimension M, it is considered as a bosonic space of local dimension M.
def create(hilbert, site): N = hilbert.local_size D = _np.array([_np.sqrt(m) for m in _np.arange(1, N)]) mat = _np.diag(D, -1) return _LocalOperator(hilbert, mat, [site])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy(hilbert, site):\n N = hilbert.local_size\n\n D = _np.array([_np.sqrt(m) for m in _np.arange(1, N)])\n mat = _np.diag(D, 1)\n return _LocalOperator(hilbert, mat, [site])", "def number(hilbert, site):\n N = hilbert.local_size\n\n D = _np.array([m for m in _np.arange(0, N)])\n mat =...
[ "0.564184", "0.5433242", "0.50121003", "0.49951243", "0.4933285", "0.4894892", "0.48709813", "0.48672333", "0.48644358", "0.48452857", "0.47882035", "0.47766116", "0.4766582", "0.47354895", "0.47061607", "0.47037676", "0.47027504", "0.4696975", "0.46951973", "0.468996", "0.46...
0.6524111
0
Builds the number operator acting on the `site`th of the Hilbert space `hilbert`. If `hilbert` is a nonBosonic space of local dimension M, it is considered as a bosonic space of local dimension M.
def number(hilbert, site): N = hilbert.local_size D = _np.array([m for m in _np.arange(0, N)]) mat = _np.diag(D, 0) return _LocalOperator(hilbert, mat, [site])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(hilbert, site):\n N = hilbert.local_size\n\n D = _np.array([_np.sqrt(m) for m in _np.arange(1, N)])\n mat = _np.diag(D, -1)\n return _LocalOperator(hilbert, mat, [site])", "def destroy(hilbert, site):\n N = hilbert.local_size\n\n D = _np.array([_np.sqrt(m) for m in _np.arange(1, N)])...
[ "0.6771396", "0.5815839", "0.49444807", "0.49004087", "0.4797901", "0.4637707", "0.4502494", "0.44976076", "0.44949082", "0.44010517", "0.43764675", "0.43704367", "0.4364607", "0.43233228", "0.43232355", "0.42927074", "0.42909387", "0.4273869", "0.4253853", "0.42340866", "0.4...
0.8114373
0
Expects two string values. It will split the string by whitespace and compare each value. It will return True if both lists are the same, contain the same elements and the same order.
def _values_is_equal(self, a, b): if a is None or b is None: return False a = a.split() b = b.split() if len(a) != len(b): return False return len([i for i, j in zip(a, b) if i == j]) == len(a)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _equals(a: Union[str, Iterable[str]], b: Union[str, Iterable[str]]) -> bool:\n if isinstance(a, str) and isinstance(b, str):\n return a.replace(' ', '') == b.replace(' ', '')\n elif isinstance(a, Iterable) and isinstance(b, Iterable):\n return all(_equals(a_, b_) for a_, b_ in zip(a, b))\n ...
[ "0.7319941", "0.7307705", "0.72201157", "0.71603656", "0.71158296", "0.7112527", "0.707442", "0.70609844", "0.70270646", "0.7018493", "0.69326353", "0.68619174", "0.6841695", "0.67556494", "0.67496127", "0.6725949", "0.66723907", "0.66213095", "0.66050696", "0.653433", "0.653...
0.7565415
0
Parses command line agurments into inps variable.
def command_line_parse(iargs=None): parser = create_parser() inps = parser.parse_args(args=iargs) return inps
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parseCommandLine_(self):\n\n self.ensureNotCreated()\n\n import sys\n\n parseCommandLine = False\n for argv in sys.argv:\n if 'globalTag' in argv or 'era' in argv or 'process' in argv:\n parseCommandLine = True\n break\n\n if parseComm...
[ "0.65227515", "0.65122056", "0.63378614", "0.6276157", "0.62659657", "0.62586796", "0.6198163", "0.61730486", "0.6158182", "0.61317056", "0.6121698", "0.61182", "0.6096393", "0.6095885", "0.6090988", "0.6068605", "0.60453767", "0.6045358", "0.6036918", "0.6021604", "0.6017237...
0.7018008
0
Convert a CSV to a list of JSON
def convert_to_json(self, csvname): csvfile = open(csvname, 'r') self.__obtain_csv_delimiter__(csvfile) self.__obtain_csv_fieldnames__(csvfile) data = self.__obtain_data_from_csv__(csvfile) jsons = self.__convert_data_to_list_of_dict__(data) list_of_jsons = self.__transfo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_json(csvfile):\n\n data = []\n with open(csvfile, encoding='utf-8') as csvf:\n csvreader = csv.DictReader(csvf)\n for rows in csvreader:\n data.append(rows)\n\n return data", "def csv_to_json(csv_filename):\n csv_trimmed = csv_filename[:-3]\n json_added = csv_trim...
[ "0.73354983", "0.7008232", "0.6929692", "0.6769878", "0.6741087", "0.67357653", "0.6640372", "0.6511125", "0.6499063", "0.64680725", "0.6278612", "0.6272191", "0.62165207", "0.62025166", "0.6182589", "0.61714834", "0.61651", "0.61524814", "0.61047995", "0.60625005", "0.606244...
0.74640024
0
Obtain the field names of the CSV file
def __obtain_csv_fieldnames__(self, csvfile): self.__fieldnames__ = csvfile.readline() self.__obtain_csv_delimiter__(self.__fieldnames__) self.__fieldnames__ = self.__remove_break_line__(self.__fieldnames__) self.__fieldnames__ = self.__split_for_delimiter__(self.__fieldnames__)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_sample_csv(self):\n f = open('sample.csv')\n lines = f.readline()\n fields = lines.split(',')\n fieldnames_lst = [i.strip() for i in fields]\n f.close()\n return fieldnames_lst", "def csv_get_fields(filename):\n fields = []\n with open(filename, encoding='...
[ "0.7433153", "0.74118084", "0.71527684", "0.70616245", "0.70249975", "0.6968129", "0.6966762", "0.69185925", "0.690343", "0.6839324", "0.66399145", "0.66257787", "0.66196024", "0.65886885", "0.65837795", "0.6529052", "0.64627826", "0.6451939", "0.6417422", "0.63877517", "0.63...
0.7788106
0
Remove the break line character
def __remove_break_line__(self, string): return string.rstrip()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __stripEol(self, txt):\n return txt.replace(\"\\r\", \"\").replace(\"\\n\", \"\")", "def _remove_new_line(self, message):\n if message.endswith('\\n'):\n return message[:-1]\n return message", "def clean_hanging_newline(t):\n if t and t[-1] == \"\\n\":\n return t[:...
[ "0.76215065", "0.71807075", "0.6921383", "0.69167554", "0.6844915", "0.68255997", "0.6781862", "0.674791", "0.6742343", "0.6693356", "0.66213566", "0.6612505", "0.65977067", "0.65780264", "0.6550401", "0.6543287", "0.65358347", "0.6526621", "0.6501473", "0.6458589", "0.645570...
0.7870445
0
Split a string based in the delimiter
def __split_for_delimiter__(self, string): if not self.__delimiter__ == '': return string.split(self.__delimiter__) return string.split()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenize(string, delimiter):\n return (str(string).split(delimiter), 0)", "def split(value, delimiter):\n return value.split(delimiter)", "def split(self, string):\n return (re.split('; |, |: |\"(\"|\"(\"|;|,|:| |', string))", "def split_escaped_delim (delimiter, string, count=0):\n assert ...
[ "0.77813756", "0.76802945", "0.75526756", "0.752244", "0.7469365", "0.7433634", "0.7283374", "0.71207726", "0.7106403", "0.7060476", "0.70436823", "0.69787467", "0.69647413", "0.69125754", "0.6893149", "0.6883725", "0.6867856", "0.68612695", "0.68592024", "0.68591124", "0.685...
0.84172904
0