query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Sets the gateway_serial of this UpdateVehicleRequest.
def gateway_serial(self, gateway_serial): self._gateway_serial = gateway_serial
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setGateway(self, gateway):\n # type: (str)->None\n\n self._validator.validate_one(\n 'gateway', VALID_OPTS['gateway'], gateway)\n self._ifAttributes['gateway'] = gateway", "def gateway_id(self, gateway_id):\n\n self._gateway_id = gateway_id", "def set_serial(self, ser...
[ "0.63021106", "0.5979875", "0.56400514", "0.5633011", "0.54569376", "0.526742", "0.52273846", "0.51936847", "0.5030974", "0.49815518", "0.49481562", "0.4906431", "0.4822673", "0.47393987", "0.47254622", "0.47191525", "0.4696486", "0.46910635", "0.46563208", "0.46563208", "0.4...
0.8186771
0
Sets the harsh_acceleration_setting_type of this UpdateVehicleRequest.
def harsh_acceleration_setting_type(self, harsh_acceleration_setting_type): allowed_values = ["passengerCar", "lightTruck", "heavyDuty", "off", "automatic"] # noqa: E501 if self.local_vars_configuration.client_side_validation and harsh_acceleration_setting_type not in allowed_values: # noqa: E501 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_acceleration(self, acceleration):\n self.device.set_acceleration(acceleration)\n return \"OK\"", "def set_adjustment_type(self, adjustment_type):\n self.single_selection_from_kendo_dropdown(self.adjustment_type_dropdown_locator, adjustment_type)\n self.wait_for_ajax_spinner_lo...
[ "0.5853659", "0.50912744", "0.49172306", "0.48173192", "0.47014672", "0.4634827", "0.46120846", "0.4590229", "0.4576279", "0.45042148", "0.4476712", "0.43912166", "0.43879282", "0.4383811", "0.4366613", "0.4360031", "0.4352631", "0.43397018", "0.43366387", "0.43263713", "0.43...
0.8702775
0
Sets the license_plate of this UpdateVehicleRequest.
def license_plate(self, license_plate): if (self.local_vars_configuration.client_side_validation and license_plate is not None and len(license_plate) > 12): raise ValueError("Invalid value for `license_plate`, length must be less than or equal to `12`") # noqa: E501 self._l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def license(self, license):\n\n self._license = license", "def save(self, *args, **kwargs):\n if self.license_plate:\n self.license_plate = self.license_plate.replace('-','').replace(' ','')\n super(VehicleRegistration,self).save(*args, **kwargs)", "def license_number(self, lice...
[ "0.6482215", "0.60094345", "0.5971417", "0.57393056", "0.5617041", "0.55561376", "0.53961915", "0.5359062", "0.5322539", "0.5291167", "0.52001405", "0.5070711", "0.5057579", "0.49738538", "0.49601606", "0.49601606", "0.49461326", "0.4945529", "0.49165577", "0.4910613", "0.487...
0.7658375
0
Sets the notes of this UpdateVehicleRequest.
def notes(self, notes): if (self.local_vars_configuration.client_side_validation and notes is not None and len(notes) > 255): raise ValueError("Invalid value for `notes`, length must be less than or equal to `255`") # noqa: E501 self._notes = notes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def notes(self, notes):\n\n self._notes = notes", "def notes(self, notes):\n\n self._notes = notes", "def notes(self, notes):\n\n self._notes = notes", "def notes(self, notes):\n\n self._notes = notes", "def notes(self, notes):\n\n self._notes = notes", "def notes(self,...
[ "0.68845856", "0.68845856", "0.68845856", "0.68845856", "0.68845856", "0.6636343", "0.65447444", "0.6384112", "0.59179527", "0.58897984", "0.5507248", "0.5370536", "0.51564264", "0.51564264", "0.5099891", "0.5076104", "0.50644374", "0.505969", "0.5039264", "0.4936329", "0.493...
0.64006484
7
Sets the odometer_meters of this UpdateVehicleRequest.
def odometer_meters(self, odometer_meters): self._odometer_meters = odometer_meters
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def obd_odometer_meters(self, obd_odometer_meters):\n\n self._obd_odometer_meters = obd_odometer_meters", "def gps_odometer_meters(self, gps_odometer_meters):\n\n self._gps_odometer_meters = gps_odometer_meters", "def drive_distance_meters(self, drive_distance_meters):\n\n self._drive_dist...
[ "0.78520304", "0.6952166", "0.6625439", "0.5700278", "0.5330142", "0.51499796", "0.49836195", "0.49621317", "0.49096128", "0.4897436", "0.4849823", "0.4838554", "0.4810013", "0.47394198", "0.4714336", "0.4705788", "0.4705542", "0.46347386", "0.46201065", "0.45941296", "0.4515...
0.8017434
0
Sets the static_assigned_driver_id of this UpdateVehicleRequest.
def static_assigned_driver_id(self, static_assigned_driver_id): self._static_assigned_driver_id = static_assigned_driver_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def driver_id(self, driver_id):\n\n self._driver_id = driver_id", "def driver_id(self, driver_id: int):\n if driver_id is None:\n raise ValueError(\"Invalid value for `driver_id`, must not be `None`\") # noqa: E501\n\n self._driver_id = driver_id", "def static_finding(self, sta...
[ "0.58979875", "0.52223", "0.50875014", "0.45650956", "0.45579106", "0.45233056", "0.45233056", "0.44840404", "0.44335097", "0.43853715", "0.4371814", "0.43593413", "0.43487522", "0.42879018", "0.42818657", "0.42814112", "0.42524332", "0.4240414", "0.4240414", "0.4225884", "0....
0.8492683
0
Sets the tag_ids of this UpdateVehicleRequest.
def tag_ids(self, tag_ids): self._tag_ids = tag_ids
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_tags(self, tags):\r\n current_tags = set(self.tag_names())\r\n updated_tags = set(tags)\r\n removed_tags = current_tags.difference(updated_tags)\r\n new_tags = updated_tags.difference(current_tags)\r\n \r\n for tag in new_tags:\r\n self.add_tag(tag)\r\n ...
[ "0.6124682", "0.61125207", "0.60852545", "0.6005471", "0.6005471", "0.6005471", "0.6005471", "0.6005471", "0.6005471", "0.6005471", "0.6005471", "0.6005471", "0.6005471", "0.5952815", "0.59259295", "0.59259295", "0.59259295", "0.5924576", "0.5871416", "0.5602764", "0.55914205...
0.75711256
0
Sets the vin of this UpdateVehicleRequest.
def vin(self, vin): if (self.local_vars_configuration.client_side_validation and vin is not None and len(vin) > 17): raise ValueError("Invalid value for `vin`, length must be less than or equal to `17`") # noqa: E501 if (self.local_vars_configuration.client_side_validation a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_vin(self, value):\n return self.sendCMD(\"ATSET VIN={}\".format(value))", "def vm_volume_num_in(self, vm_volume_num_in):\n\n self._vm_volume_num_in = vm_volume_num_in", "def vehicle(self, vehicle):\n\n self._vehicle = vehicle", "def vehicle(self, vehicle):\n\n self._vehicl...
[ "0.6181508", "0.54808533", "0.5342333", "0.5342333", "0.5278952", "0.51032424", "0.50570464", "0.4902143", "0.48931664", "0.48747736", "0.48244667", "0.4768621", "0.47286236", "0.46440622", "0.4581164", "0.4552281", "0.44910336", "0.44724986", "0.44671312", "0.44606727", "0.4...
0.7512381
0
Returns the model properties as a dict
def to_dict(self): result = {} for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dict(self):\n return self.properties", "def to_dict(self):\n return self.properties", "def get_properties(self):\n return self.properties", "def asdict(self):\n return self._prop_dict", "def json(self):\n rv = {\n prop: getattr(self, prop)\n f...
[ "0.7751993", "0.7751993", "0.73391134", "0.7334895", "0.7297356", "0.727818", "0.7159078", "0.71578115", "0.71494967", "0.71494967", "0.71283495", "0.71275014", "0.7122587", "0.71079814", "0.7060394", "0.7043251", "0.7034103", "0.70233124", "0.69635814", "0.69586295", "0.6900...
0.0
-1
Returns the string representation of the model
def to_str(self): return pprint.pformat(self.to_dict())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self) -> str:\n # noinspection PyUnresolvedReferences\n opts = self._meta\n if self.name_field:\n result = str(opts.get_field(self.name_field).value_from_object(self))\n else:\n ...
[ "0.8585678", "0.7814723", "0.77902746", "0.7750817", "0.7750817", "0.7713574", "0.7699132", "0.7670784", "0.76510423", "0.7600937", "0.7582941", "0.7570682", "0.75406617", "0.75233835", "0.75168735", "0.75013274", "0.74877244", "0.74877244", "0.74700385", "0.7451798", "0.7446...
0.0
-1
For `print` and `pprint`
def __repr__(self): return self.to_str()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pprint(*args, **kwargs):\n if PRINTING:\n print(*args, **kwargs)", "def print_out():\n pass", "def custom_print(*objects):\n print(*objects, sep=OFS, end=ORS)", "def _print(self, *args):\n return _ida_hexrays.vd_printer_t__print(self, *args)", "def _printable(self):\n ...
[ "0.7558307", "0.73389274", "0.6988327", "0.69856334", "0.6945482", "0.6925032", "0.6899363", "0.6898346", "0.6816579", "0.68078375", "0.6752314", "0.67512006", "0.6746616", "0.6699348", "0.6691914", "0.6676349", "0.66583097", "0.6610652", "0.66092956", "0.66036814", "0.656279...
0.0
-1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, UpdateVehicleRequest): return False return self.to_dict() == other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, UpdateVehicleRequest): return True return self.to_dict() != other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", ...
0.0
-1
Return command display name
def display_name(self): answer = self._call('display_name') return answer.display_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def command_name(self):\n return None", "def get_description(self):\n return self['command_name']", "def get_command(self) -> str:\n return 'title'", "def get_commandname(self):\n for line in self.helplines:\n if \"Usage:\" in line and self.parser_type is 'optparse':\n ...
[ "0.7897006", "0.77417815", "0.7687815", "0.7538277", "0.7479918", "0.7479918", "0.7479918", "0.7479918", "0.7479918", "0.7479918", "0.7479918", "0.7479918", "0.7479918", "0.7479918", "0.7331462", "0.7311507", "0.72114635", "0.72114635", "0.72114635", "0.72114635", "0.72114635...
0.715899
23
Set command display name
def set_display_name(self, display_name): self._call('set_display_name', display_name=display_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setDisplayName( self, name ):\n self._displayName = name\n self._titleFont = None", "def display_name(self, display_name):\n self._display_name = display_name", "def display_name(self, display_name):\n self._display_name = display_name", "def display_name(self, display_name):\...
[ "0.69433814", "0.6910722", "0.6910722", "0.6910722", "0.6910722", "0.6910722", "0.6910722", "0.66846985", "0.6682046", "0.6644311", "0.66321164", "0.66321164", "0.66321164", "0.66321164", "0.66321164", "0.66321164", "0.65823704", "0.6447359", "0.6352545", "0.63462025", "0.633...
0.6806753
7
Return True if command return type is string
def is_string(self): answer = self._call('is_string') return answer.yes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_string(arg):\n return isinstance(arg, types.StringTypes)", "def is_string(value):\n return isinstance(value, (str, bytes))", "def is_string_action(func: CLIActionType) -> bool:\n return check_function_type(func, [HammerDriver, Callable[[str], None]], Optional[str]) is None", "def _is...
[ "0.72101504", "0.67675126", "0.67398417", "0.66946656", "0.6686076", "0.667609", "0.6644599", "0.66220903", "0.65879357", "0.65586376", "0.65518516", "0.6525141", "0.6505778", "0.6503069", "0.6468777", "0.64370143", "0.6400437", "0.6391969", "0.63687015", "0.6319832", "0.6310...
0.7352662
0
Return True if command return type is long
def is_long(self): answer = self._call('is_long') return answer.yes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convertToLong(boolean: bool) -> int:\n ...", "def is_of_type(cmd):\r\n raise NotImplementedError()", "def hasNextLong(self) -> bool:\n raise NotImplementedError", "def command_type(self):\n if self.cmd_type is not None:\n return self.cmd_type # should be true only ...
[ "0.5989811", "0.57864743", "0.5738203", "0.5530481", "0.55091196", "0.5501726", "0.5487508", "0.54735243", "0.5433546", "0.5368896", "0.534729", "0.5277097", "0.52574474", "0.5248837", "0.51971203", "0.5174398", "0.5158678", "0.515556", "0.51363266", "0.5130246", "0.5119427",...
0.74627966
0
Return True if command return type is double
def is_double(self): answer = self._call('is_double') return answer.yes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_double(self, size=None):\n return False", "def _type_check_double(self, data):\n if type(data) not in self._VALID_TYPES:\n return False\n return True", "def double(self):\n if self.__valeur1 == self.__valeur2:\n return True\n else:\n return...
[ "0.68060154", "0.6694105", "0.6278531", "0.6156558", "0.6122468", "0.60317355", "0.59308475", "0.59101456", "0.58420163", "0.5835771", "0.56978625", "0.5695271", "0.56179863", "0.55873126", "0.5555344", "0.5545467", "0.54628015", "0.54531217", "0.5441905", "0.5435553", "0.540...
0.7801225
0
Return True if command return type is datetime
def is_datetime(self): answer = self._call('is_datetime') return answer.yes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_datetime(self) -> bool:\n return False", "def has_datetime_type(obj: _std_typing.Any) -> bool:\n return obj.dtype == sc.DType.datetime64", "def is_datetime(s: Union[str, int, float]):\n if is_number(s):\n return False\n\n try:\n parse_datetime(s)\n return True\n e...
[ "0.7951076", "0.6984303", "0.6577533", "0.6427492", "0.6338919", "0.62653446", "0.62532926", "0.6224089", "0.6207788", "0.6151861", "0.5996967", "0.59684855", "0.59437066", "0.58614635", "0.584531", "0.5838218", "0.5837798", "0.5829952", "0.5794449", "0.57770663", "0.57770663...
0.7957955
0
Return True if command return type is bool
def is_bool(self): answer = self._call('is_bool') return answer.yes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_bool(self):\n return False", "def is_bool (self, phrase):\r\n \r\n return isinstance(phrase,bool)", "def __bool__(self) -> bool:\n return self.return_code == 0", "def __bool__(self) -> bool:\n return self.return_code == 0", "def __bool__(self) -> bool:\n ...
[ "0.7300168", "0.6982025", "0.69479877", "0.69479877", "0.69479877", "0.6931669", "0.6860637", "0.684384", "0.6820059", "0.6804663", "0.6776833", "0.6743398", "0.67413884", "0.67388", "0.6701831", "0.66715646", "0.66706675", "0.6627555", "0.6617246", "0.6615943", "0.65937847",...
0.71876997
1
Return True if command return type is map
def is_map(self): answer = self._call('is_map') return answer.yes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _msg_is_command(self, msg):\n return isinstance(msg, dict)", "def is_mapping(self) -> bool:\n return isinstance(self.yaml_node, yaml.MappingNode)", "def is_map(self, alias):\n maps = {\"Ensembl2Reactome_All_Levels\": False,\n \"ReactomePathways\": True,\n ...
[ "0.6289078", "0.6281217", "0.6242795", "0.61640793", "0.6034122", "0.5948415", "0.58508986", "0.58115065", "0.5724521", "0.56458396", "0.5560745", "0.55398226", "0.55355984", "0.5446891", "0.54456025", "0.5439933", "0.5427514", "0.54028404", "0.53899914", "0.53831494", "0.537...
0.69451547
0
Return True if command return type is list
def is_list(self): answer = self._call('is_list') return answer.yes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_list(self) -> bool:\n return False", "def is_multi_commands(args: list) -> bool:\n for arg in args:\n if not isinstance(arg, list):\n return False\n # all elements must be lists\n return True", "def _is_list(arg):\n return isinstance(arg, collecti...
[ "0.74882597", "0.7068153", "0.69201654", "0.68849444", "0.68486714", "0.6833843", "0.6674785", "0.66685194", "0.6642766", "0.66335183", "0.66288596", "0.6529805", "0.65188724", "0.6512905", "0.6460788", "0.64399505", "0.6422735", "0.6361648", "0.6349589", "0.63341206", "0.630...
0.7490665
0
Set command return value
def set_result(self, value): value_rpc = utils.get_rpc_value(type(value), value) self._call('set_result', value=value_rpc)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute_success(self, *args, **kwargs):\n return 0, self.shell_output, None", "def execute_return(cmd):\n args = cmd.split()\n proc = Popen(args,stdout=PIPE,stderr=PIPE)\n out,err = proc.communicate()\n return out,err", "def execute(self, rc):\n pass", "def _set_returncode(self,...
[ "0.64630413", "0.6332911", "0.62538105", "0.6227985", "0.61576617", "0.6150565", "0.61106575", "0.6073182", "0.59837717", "0.59783006", "0.5948261", "0.5886567", "0.58848333", "0.58677804", "0.58380526", "0.5837768", "0.5819132", "0.5764613", "0.5763976", "0.5747505", "0.5742...
0.63785946
1
Set exception in command. Information about exception will be called for adapter's side.
def set_exception(self, reason): self._call('set_exception', exception=reason)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_exception(self, exception):\n self._is_done = True\n if self._exception:\n self._log(logging.DEBUG, \"'{}.{}' has overwritten exception. From '{}.{}' to '{}.{}'.\".format(\n self.__class__.__module__,\n self.__class__.__name__,\n self._e...
[ "0.65251386", "0.65130377", "0.640264", "0.6400604", "0.6305449", "0.6302403", "0.62972367", "0.6162168", "0.6148929", "0.6125187", "0.60864145", "0.60796374", "0.6046624", "0.6018471", "0.59831905", "0.5967945", "0.59093523", "0.5906773", "0.5851401", "0.58388805", "0.581141...
0.67082244
0
Return list of command arguments
def argument_list(self): answer = self._call('argument_list') return answer.names
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def args(self):\n return self.cmd_args", "def command_args(self):\n return self._command_args", "def get_cli_arguments(self):\n pass", "def get_list_cmd_args(self):\r\n return self.get_args(OSPL.list)", "def argv(self) -> List[str]:\n if self.command:\n rtn = [...
[ "0.7973005", "0.79610753", "0.790767", "0.7871847", "0.7840145", "0.78197145", "0.7674125", "0.7649114", "0.7543827", "0.74511504", "0.7441568", "0.74175024", "0.7386672", "0.7376045", "0.7367075", "0.7319357", "0.7280918", "0.7225539", "0.71992487", "0.7197082", "0.71324563"...
0.7323704
15
Return command argument with value by argument name
def argument(self, name_argument): answer = self._call('argument', argument=name_argument) return answer.name, answer.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_arg(self, name):\n return getattr(self.args, f\"{self.key}_{self.alias}_{name}\")", "def get_argument(self, name):\n val = self.arguments.get(name)\n if val:\n return val[0]\n return None", "def _get_arg_name(self, arg, variable_name):", "def get_commandlinearg(...
[ "0.7868346", "0.7503411", "0.7101116", "0.70896965", "0.69831675", "0.6580327", "0.6580327", "0.6569697", "0.65403503", "0.64810604", "0.6404887", "0.6322416", "0.6288537", "0.6264791", "0.62477183", "0.62242115", "0.61972386", "0.6181981", "0.6164855", "0.6125793", "0.612284...
0.6707078
5
Add command argument / overwrite argument value
def update_or_create_argument(self, name_arg, value): cur_choices = self.choices[name_arg] if name_arg in self.choices else None if cur_choices is None: value_rpc = utils.get_rpc_value(type(value), value) self._call('update_or_create_argument', argument=name_arg, value=value_rpc)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_cli_arg(self, name, value):\n if value:\n self._cli[name] = value", "def add_argument(self, *args, **kwargs):\n self.parser.add_argument(*args, **kwargs)", "def add_argument(self, *args, **kwargs):\n self.parser.add_argument(*args, **kwargs)", "def add_argument(self, *...
[ "0.76907533", "0.74852", "0.74852", "0.74852", "0.73830616", "0.7321316", "0.72542834", "0.7191633", "0.7164311", "0.69988096", "0.694312", "0.69101125", "0.67392266", "0.6697106", "0.66787034", "0.6673152", "0.6657486", "0.66390574", "0.657421", "0.65677625", "0.65416545", ...
0.6180719
51
Return ID of the command's owner
def owner(self): answer = self._call('owner') return answer.owner
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def owner_id(self) -> str:\n return pulumi.get(self, \"owner_id\")", "def owner_id(self) -> str:\n return self.__owner_id", "def owner_id(self) -> int:\n return self.proto.owner", "def owner_id(self):\n return self._owner_id", "def owner_id(self) -> Optional[str]:\n retur...
[ "0.7799616", "0.7753633", "0.76906127", "0.76573384", "0.7629729", "0.7515706", "0.7453457", "0.73210293", "0.73210293", "0.73126256", "0.7185304", "0.7171606", "0.71175456", "0.7111413", "0.705751", "0.70522135", "0.703091", "0.69719386", "0.692131", "0.68922853", "0.6857497...
0.7285534
10
Call function when command executed
def call_function(self): try: arg_list = self.argument_list() function_dict = {} info = [] for name_arg in arg_list: type_arg = self.arguments_type[name_arg] function_dict[name_arg] = utils.value_from_rpc(self.argument(name_arg)[1])...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def command():\n pass", "def oncmnd(self, func):\n self._oncmnd = func", "def _command(self, *cmd, handler=None):", "def cmd(self):", "def ConsoleRun(self, command, sender):\n pass", "def on_execute(self):\n pass", "def do_command(self, args):\n pass", "def on_comma...
[ "0.7412077", "0.7403746", "0.7057318", "0.6878284", "0.6829968", "0.6819889", "0.6819451", "0.67954874", "0.6765732", "0.6708852", "0.6705811", "0.67045647", "0.6689721", "0.66895926", "0.66880935", "0.6661755", "0.6661755", "0.6661755", "0.6661755", "0.66312814", "0.6618891"...
0.629185
43
The pure, immutable value of this datatype, as a Python value, which is unique for each datatype.
def value(self): return self._value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Value(self) -> _n_0_t_14:", "def value_type(self) -> global___Type:", "def value(self) -> any:\r\n\r\n return self.__value", "def value(self):\n return self.value()._value", "def new_value(self):\n return data_value_factory(self.type)", "def value(self):\n return self._val...
[ "0.7019517", "0.6918032", "0.6752796", "0.67268085", "0.67126024", "0.6682515", "0.6682515", "0.6663475", "0.6654946", "0.6654946", "0.6651974", "0.6647169", "0.6625683", "0.6625683", "0.6623158", "0.66080546", "0.65716547", "0.65649635", "0.6532604", "0.6529765", "0.65256613...
0.6407975
54
The opaque context for this type, if it was previously fetched.
def context(self): if self._context: return self._context[:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def context(self) -> _C_out:\n return self._context", "def context(self):\n return self._context", "def context(self):\n return self._context", "def context(self):\n return self._context", "def context(self):\n return self._context", "def context(self):\n return ...
[ "0.6449475", "0.6230645", "0.6230645", "0.6230645", "0.6230645", "0.6230645", "0.6230645", "0.6230645", "0.61244285", "0.61199605", "0.60543615", "0.6044594", "0.5966144", "0.5949891", "0.5942338", "0.5937547", "0.59329396", "0.5925352", "0.5906197", "0.59033287", "0.58872193...
0.6135836
8
Whether this datatype has staged local modifications.
def modified(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_local_state(self) -> bool:\n return True", "def is_modified(self):\n return len(self.modified_fields) > 0", "def is_local(self) -> bool:\n if not self.source:\n return False\n\n if self.source.master_name.startswith(MODULE_NAME):\n return True\n\n ...
[ "0.7210056", "0.7106617", "0.70620275", "0.69745135", "0.69522744", "0.69439024", "0.6663222", "0.66631716", "0.66554046", "0.6641709", "0.66392136", "0.6631838", "0.6622982", "0.6613594", "0.66110885", "0.6608613", "0.6608613", "0.65780777", "0.65697205", "0.6561284", "0.655...
0.0
-1
Reloads the datatype from Riak.
def reload(self, **params): if not self.bucket: raise ValueError('bucket property not assigned') if not self.key: raise ValueError('key property not assigned') dtype, value, context = self.bucket._client._fetch_datatype( self.bucket, self.key, **params) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reload_data(self):\n self._avro_payload.reload_data()", "def reload(self):\n self.restore()", "def reloadData(self):\n self.dto.readFromData()\n print(\"Record reloaded.\")", "def reload(self):", "def reload(self):", "def reload(self):\n\n pass", "def reload_data(self...
[ "0.69468844", "0.6571157", "0.652524", "0.6443367", "0.6443367", "0.62622434", "0.6048451", "0.6042948", "0.6036892", "0.60049", "0.5873903", "0.5867182", "0.5855046", "0.58414084", "0.5838228", "0.58149874", "0.57650065", "0.5740696", "0.57311875", "0.5674174", "0.56657064",...
0.6577614
1
Sends locally staged mutations to Riak.
def update(self, **params): if not self.modified: raise ValueError("No operation to perform") params.setdefault('return_body', True) self.bucket._client.update_datatype(self, **params) self.clear() return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def send(self) -> None:\n await self._mutations.send()\n await self._counters.send()", "def _send(self, batch):\n return self.agent.emitBatch(batch)", "def send(self, payload):\n self.emitter.input(payload)", "async def send(self):", "def sendTrame(self,ident,newState):\n ...
[ "0.6106689", "0.543575", "0.50269085", "0.5017469", "0.49475446", "0.49401817", "0.4917079", "0.48982352", "0.48926118", "0.48706728", "0.48510456", "0.48082152", "0.48071888", "0.47755742", "0.47697464", "0.47678038", "0.47575727", "0.475492", "0.4753376", "0.47499636", "0.4...
0.0
-1
Removes all locally staged mutations.
def clear(self): self._post_init()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def purge():\n all_hashes = read_all()\n used_hashes = read_used()\n\n for kind, hashes in used_hashes.items():\n to_remove = all_hashes[kind].difference(hashes)\n if kind == 'evs':\n delete_from_directory_by_hashes(EV_DIRECTORY, to_remove)\n elif kind == 'cache':\n ...
[ "0.612864", "0.6037659", "0.6037659", "0.59406775", "0.59103316", "0.5905609", "0.5856978", "0.5830242", "0.58279985", "0.5785966", "0.5730709", "0.57132196", "0.5688773", "0.5679879", "0.5665355", "0.56624067", "0.5651841", "0.5639386", "0.5639386", "0.5627537", "0.5626215",...
0.0
-1
Extracts the mutation operation from this datatype, if any. Each type must implement this method, returning the appropriate operation, or `None` if there is no queued mutation.
def to_op(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_update_op():\n update_ops = tf.get_collection(tf.GraphKeys.UPDATE_OPS)\n if update_ops is not None:\n return tf.group(*update_ops)\n return None", "def resolve(self) -> Mutation:\n return Mutation(self.is_delete, self.col, self.value, self.wal)", "def op(self) -> ...
[ "0.6340196", "0.6219872", "0.6157111", "0.6128742", "0.6128742", "0.6057564", "0.60432756", "0.6023882", "0.5999299", "0.5998789", "0.59433234", "0.5942077", "0.58093363", "0.5725967", "0.56265205", "0.5621546", "0.55118114", "0.54859066", "0.5438187", "0.5438187", "0.5438187...
0.5308875
27
Checks that initial values of the type are appropriate. Each type must implement this method.
def _check_type(self, new_value): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_vals(self):\n\n try:\n self.is_set = True\n self.pack()\n except Exception as err:\n # Set default values again\n raise ValueError(\"Invalid arguments. Could not packed since: {}\".format(err))\n self.__init__()", "def validate(self)...
[ "0.72296953", "0.68276614", "0.6670829", "0.6625079", "0.65226156", "0.6468805", "0.6381933", "0.6350073", "0.6303018", "0.62150484", "0.62101245", "0.61515135", "0.6143909", "0.607562", "0.60541034", "0.605045", "0.60136133", "0.5985306", "0.59744245", "0.5973214", "0.594714...
0.6040458
16
Coerces the input value into the internal representation for the type. Datatypes may override this method.
def _coerce_value(self, new_value): return new_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(self, value):\n\n return value", "def convert(self, value):\r\n return value", "def convert(self, value):\n return value", "def cast(self, value):\n if value is None:\n return None\n return self.type(value)", "def convert_type(self, value, schema_type,...
[ "0.7340099", "0.7334982", "0.71864617", "0.70573217", "0.6916039", "0.6905666", "0.6802524", "0.67618734", "0.6731091", "0.6684977", "0.6664414", "0.6664414", "0.661957", "0.661957", "0.65944105", "0.65559506", "0.6547864", "0.6535139", "0.652875", "0.65159434", "0.64829975",...
0.6767681
7
Returns what the initial value of an empty datatype should be.
def _default_value(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mempty(self):\n return identity", "def initial_value(self):\n return self._initial_value", "def noneType(value):\r\n return ''", "def empty_value(self, context):\n if self._default is NoValueSet:\n return None\n return self._default", "def get_default_value...
[ "0.6657491", "0.654826", "0.6507052", "0.6405415", "0.64019907", "0.6348621", "0.6144814", "0.61387604", "0.60783243", "0.6064034", "0.60356885", "0.5976399", "0.5905335", "0.58722705", "0.5867641", "0.5866738", "0.58534896", "0.58521265", "0.582249", "0.5811923", "0.579623",...
0.58259237
18
Raises an exception if the context is not present
def _require_context(self): if not self._context: raise ContextRequired()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_context_invalid():\n\n with pytest.raises(ContextAttributeError):\n application_services.get_context('not_present_context')", "def handle_context_missing(self):", "def test_stored_context_err(self):\n self.stack = stack.Stack(self.ctx, 'creds_stack', self.tmpl)\n ex = self....
[ "0.76646805", "0.7559883", "0.6614295", "0.6527365", "0.64800733", "0.64293313", "0.6406461", "0.6245151", "0.6196592", "0.61848545", "0.6142678", "0.60623604", "0.60348666", "0.6032899", "0.60134035", "0.60021675", "0.5999621", "0.59995925", "0.5892164", "0.5860368", "0.5839...
0.800951
0
Scrubs sys.path and sys.modules to a raw state.
def _scrub_import_environment(sys_modules_whitelist: typing.List[str], logger: typing.Callable): pex_root = pathlib.Path(Variables().PEX_ROOT) # A generator that emits sys.path elements def scrubbed_sys_path(): """Yields a scrubbed version of sys.path.""" for p in sys.path[:]: if not isinstance(p, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_sys(cls):\n def patch_dict(old_value, new_value):\n old_value.clear()\n old_value.update(new_value)\n\n def patch_all(path, path_importer_cache, modules):\n sys.path[:] = path\n patch_dict(sys.path_importer_cache, path_importer_cache)\n patch_dict(sys.modules, modules)\n\n ...
[ "0.6124312", "0.6062598", "0.59543145", "0.5901678", "0.56766284", "0.56067514", "0.5542571", "0.54748863", "0.5422463", "0.5348224", "0.53475314", "0.53056484", "0.52948594", "0.51196456", "0.51149005", "0.51118445", "0.50935435", "0.5014209", "0.50100213", "0.5005435", "0.4...
0.64339405
0
Yields a scrubbed version of sys.path.
def scrubbed_sys_path(): for p in sys.path[:]: if not isinstance(p, str): yield p # Scrub any/all pex locations from sys.path. pp = pathlib.Path(p) if pex_root not in pp.parents: yield p
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scrub_from_sys_modules():\n for k, m in sys.modules.items():\n if k in sys_modules_whitelist:\n continue\n\n if hasattr(m, '__file__') and m.__file__ is not None:\n mp = pathlib.Path(m.__file__)\n if pex_root in mp.parents:\n yield k", "def add_sys_paths(paths):\n ...
[ "0.6704874", "0.64456856", "0.63815147", "0.61018676", "0.6091217", "0.6007068", "0.596048", "0.5937054", "0.5828322", "0.5781934", "0.5675717", "0.567165", "0.56604296", "0.5641513", "0.56188345", "0.5617912", "0.55805993", "0.5579308", "0.5575357", "0.5502024", "0.54931635"...
0.80444944
0
Yields keys of sys.modules as candidates for scrubbing/removal.
def scrub_from_sys_modules(): for k, m in sys.modules.items(): if k in sys_modules_whitelist: continue if hasattr(m, '__file__') and m.__file__ is not None: mp = pathlib.Path(m.__file__) if pex_root in mp.parents: yield k
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_registered_modules():\n yield from iterchain(modules.values() for modules in Registry.monomers.values())", "def modules(self):\n for desc in self._mappings.values():\n if hasattr(desc, 'module'):\n yield desc.module\n else:\n continue", "def...
[ "0.6842569", "0.6502843", "0.6499838", "0.647568", "0.6403681", "0.6330229", "0.62831795", "0.62433136", "0.61260855", "0.6123235", "0.60469973", "0.6040864", "0.603489", "0.59373957", "0.59103936", "0.58853215", "0.5881549", "0.5876056", "0.5848127", "0.5820939", "0.5803232"...
0.80843186
0
Extracts exactly 1 binary from a dir and returns a Path.
def _extract_resulting_binary(self, build_dir: pathlib.PosixPath, extension: str) -> pathlib.PosixPath: assert build_dir.is_dir(), f'build_dir {build_dir} was not a dir!' # N.B. It's important we use pathlib.Path.rglob (recursive) here, since pants v2 prefixes dist dirs # with their address namespace. b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dir_bin():\n return abspath('bin')", "def _search_path_to_file(self, directory, binary_name):\n for root, dirs, files in os.walk(directory):\n if binary_name in files:\n return os.path.join(root, binary_name)\n raise micp_kernel.NoExecutableError", "def _extract_a...
[ "0.57858336", "0.5713639", "0.5676852", "0.5615714", "0.5572907", "0.541237", "0.53744745", "0.5344345", "0.5302235", "0.5284864", "0.52758974", "0.52424115", "0.51901644", "0.5142074", "0.51340926", "0.5104739", "0.50982463", "0.50942296", "0.50817", "0.50708187", "0.5032798...
0.65847987
0
Creates an Accordion widget and yields under care of its output capturer.
def _accordion_widget(self, title, height='300px', collapsed=True): # Generate unique class for multiple invocations unique_class = self._append_random_id('nb-console-output') auto_scroll_script = ''' const config = { childList: true, subtree: true }; const callback = function(mutationsList, observe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_accordion(summary, main):\n return \"\"\"\n <details>\n <summary>{}</summary>\n <main>{}</main>\n </details>\n \"\"\".format(summary, main)", "def render_accordion(request, course, chapter, section, field_data_cache):\r\n # grab the table ...
[ "0.5763516", "0.5742236", "0.53615534", "0.50737333", "0.50410753", "0.5024527", "0.49162087", "0.4911946", "0.48652512", "0.47383875", "0.45927936", "0.44744775", "0.44410545", "0.44230998", "0.43919158", "0.4383531", "0.43767828", "0.43757036", "0.4363259", "0.4358932", "0....
0.72215044
0
Runs a pexproducing command with streaming output and returns the pex location.
def _stream_binary_build_with_output( self, cmd: str, title: str, work_dir: pathlib.PosixPath, extension: str, spin_refresh_rate: float = .3 ) -> pathlib.PosixPath: async def spin_driver( set_glyph: typing.Callable, is_complete: asyncio.Event, seq: str = SPINNER_SEQ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def paexec_out_stream(buffer_size=4096):\n b_data = pkgutil.get_data('pypsexec', 'paexec.exe')\n byte_count = len(b_data)\n for i in range(0, byte_count, buffer_size):\n yield b_data[i:i + buffer_size], i", "def _run_pex(self, requirements: str) -> pathlib.PosixPath:\n with temporary_dir(clean...
[ "0.5712724", "0.56551373", "0.56470096", "0.5454696", "0.5122776", "0.507601", "0.49487308", "0.49423507", "0.49052173", "0.4890243", "0.48846006", "0.48796877", "0.48617193", "0.48416793", "0.4835402", "0.48257113", "0.48232624", "0.4817348", "0.48100555", "0.47776985", "0.4...
0.0
-1
Runs pex with widget UI display.
def _run_pex(self, requirements: str) -> pathlib.PosixPath: with temporary_dir(cleanup=False) as tmp_dir: tmp_path = pathlib.PosixPath(tmp_dir) output_pex = tmp_path.joinpath('requirements.pex') title = f'[Resolve] {requirements}' safe_requirements = ' '.join(shlex.quote(r) for r in shlex.sp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self):\n self.show()", "def main():\n PanelDemo().mainloop()", "def XPShowWidget(inWidget):\n pass", "def main():\n LayoutsWithPanels().mainloop()", "def start_ui(self):\n\t\tself.start_animation()\n\t\tself.app.exec()", "def run():\n gui = GUI()\n gui.mainloop()", ...
[ "0.6615083", "0.6588207", "0.6397241", "0.6359986", "0.6233552", "0.61983424", "0.6130469", "0.6127166", "0.6080013", "0.6046031", "0.60392225", "0.6005095", "0.59748983", "0.59184897", "0.5896124", "0.5874832", "0.58666897", "0.58025247", "0.57882017", "0.5737901", "0.573191...
0.0
-1
Runs pants with widget UI display.
def _run_pants( self, pants_repo: pathlib.PosixPath, pants_target: str, extension: str ) -> pathlib.PosixPath: # Version check for pants v1 vs v2 flags/behavior. is_pants_v1 = pants_repo.joinpath('pants.ini').exists() if is_pants_v1: goal_name = 'binary' tmp_root = None el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\r\n return render_template(\"UI.html\")", "def main():\n LayoutsWithPanels().mainloop()", "def run(self):\n self.ui['main_window'].widgets['main'].show_all()\n gtk.main()", "def __call__(self):\n self.show()", "def show():\n from siding.addons import ui\n ui...
[ "0.647995", "0.6331577", "0.6194317", "0.6100214", "0.6095271", "0.60570043", "0.6056826", "0.60278785", "0.602337", "0.5976977", "0.59542185", "0.59354967", "0.5921027", "0.5767655", "0.57602316", "0.5725509", "0.57194537", "0.57082164", "0.5705206", "0.5700503", "0.5695546"...
0.0
-1
Bootstraps a pex with widget UI display.
def _bootstrap_pex(self, pex_path: pathlib.PosixPath): title = f'[Bootstrap] {pex_path.name}' with self._accordion_widget(title) as (expand, collapse, set_output_glyph): try: with environment_as(PEX_VERBOSE='2'): # Scrub the environment. _scrub_import_environment(self._ORIGINAT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bootstrap():\n Bootstrap()", "def bootstrap(self):\n None", "def create_widgets(self):", "def _do_bootstrap(self, configs=None):\n pass", "def create_widgets( self ):", "def widgets(self):\r\n self.setWindowTitle(\"PyCrypt\")\r\n self.setMinimumSize(QSize(500, 5...
[ "0.63333535", "0.5799136", "0.5798117", "0.57466966", "0.57229584", "0.5599561", "0.5393727", "0.5355387", "0.5324116", "0.5302776", "0.52597296", "0.5256661", "0.5252348", "0.52225083", "0.522084", "0.521721", "0.51877075", "0.5168642", "0.5132846", "0.51302344", "0.51216316...
0.61450976
1
Validates a given or stored path is a valid pants repo.
def _validate_pants_repo(self, pants_repo: pathlib.PosixPath) -> bool: return ( pants_repo and pants_repo.is_dir() and pants_repo.joinpath('pants').is_file() )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ValidateRepoPath(context, parameter, value):\n if value.startswith('/TEST/'):\n # Hackish command to allow for unit testing\n return value\n\n for name in ['BUILD.gn', '.gn', os.path.join('scripts', 'bootstrap.sh')]:\n expected_file = os.path.join(value, name)\n if not os.path...
[ "0.6693658", "0.64390516", "0.6414603", "0.6258947", "0.62280005", "0.6122691", "0.6122691", "0.61224514", "0.60444325", "0.5846379", "0.5826569", "0.58253604", "0.5780301", "0.57039803", "0.57003903", "0.5675232", "0.5675232", "0.5665029", "0.5649705", "0.56372535", "0.56351...
0.77448916
0
Do not return anything, modify root inplace instead.
def recoverTree(self, root: TreeNode) -> None: self.tmp, self.left, self.right = None, None, None self.helper(root) self.left.val, self.right.val = self.right.val, self.left.val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uproot(self):\n self.__root__ = self\n return self", "def root_replace(self,node):\r\n self.feature_index = node.feature_index\r\n self.threshold = node.threshold\r\n self.label = node.label\r\n self.left = node.left\r\n self.right = node.right\r\n self.substit...
[ "0.7168473", "0.7090963", "0.7052572", "0.6962144", "0.6789953", "0.6550694", "0.65128064", "0.65128064", "0.65128064", "0.65128064", "0.6433237", "0.6413718", "0.63980967", "0.63980967", "0.63697755", "0.636143", "0.63303053", "0.63263005", "0.6307079", "0.62776786", "0.6276...
0.66157037
5
Starts the game loop to control the sequence of play.
def start_game(self): self._puzzle.get_puzzle() self._do_outputs() while self._keep_playing: print("") print("+-----+-----+-----") print("") self._get_inputs() self._do_updates() self._do_outputs() print("+-----...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __loop(self):\n if self.loops is \"inf\":\n self.play()\n else:\n if self.loops > self.current_loop:\n self.current_loop += 1\n self.play()\n else:\n self.stop()", "def start_game(self) -> None:\n self.init_gam...
[ "0.7627953", "0.7565402", "0.7463202", "0.7400862", "0.7386307", "0.73736656", "0.7361174", "0.72038347", "0.71543676", "0.70834076", "0.70724666", "0.70218325", "0.699285", "0.69390196", "0.69162875", "0.6906955", "0.6866626", "0.6851633", "0.68471336", "0.68463635", "0.6830...
0.71472657
9
Gets the inputs at the beginning of each round of play. In this case, that means getting a guess of a letter from a user.
def _get_inputs(self): getting_letter = True while getting_letter: try: guess = self._console.read("Guess a letter [a-z]:") if guess.lower() >= "a" and guess.lower() <= "z": self._puzzle.get_guess(guess) getting_letter =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_guess():\n print('Choose a letter:')\n return input()", "def get_input(self, guess):\r\n print\r\n print \"The player guessed = \", guess\r\n result = self.process_player_input(guess)\r\n print result\r\n if ((self.remaining_guesses == 0) or ( result == self.corre...
[ "0.7509543", "0.7491407", "0.74310565", "0.7291458", "0.69766635", "0.68765074", "0.6809997", "0.6743882", "0.6592322", "0.6544128", "0.65432173", "0.6507807", "0.644701", "0.6304738", "0.6294809", "0.62744343", "0.6259689", "0.62528425", "0.6220888", "0.6186611", "0.6178402"...
0.7264798
4
Updates the important game information for each round of play. In this case, that means the puzzle is revealed and the jumper is cut if necessary.
def _do_updates(self): is_right = self._puzzle.is_guess_right() if is_right: self._puzzle.reveal_puzzle() else: self._jumper.cut_line()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def game_updated(self):\n # <<-- Creer-Merge: game-updated -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\n game = self.game\n\n for x in range(game.board_width):\n for y in range(game.board_height):\n self.checke...
[ "0.6821897", "0.65869373", "0.6301358", "0.6244406", "0.6205162", "0.61089224", "0.60870314", "0.6009552", "0.59923613", "0.59637344", "0.5959768", "0.59509295", "0.5935243", "0.59325224", "0.59208655", "0.5909505", "0.59034586", "0.5883476", "0.5867642", "0.58632934", "0.586...
0.69500154
0
Outputs the important game information for each round of play. In this case, that means the hider provides a hint.
def _do_outputs(self): self._puzzle.display_revealed_puzzle() hint = self._puzzle.get_hint() self._console.write(hint) print("") self._jumper.draw_jumper() print("") # These ifs end the game if self._puzzle.is_solved(): self._keep_playing = Fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info():\n print(\"Made using the OOP RPG game creator (c) Claire.\\n\")", "def player_tie(self):\r\n\r\n self.summary = (\" \"* 78) + \"TIE. TRY AGAIN\"\r\n print(\"Match ends in a draw.\\n\")", "def print_statistics(self):\n print 'Ran %s iterations in %0.3f seconds\\n' % (\n ...
[ "0.66959804", "0.662896", "0.661329", "0.65989345", "0.6507802", "0.64726734", "0.6438309", "0.6436374", "0.63636094", "0.6347345", "0.6319752", "0.6309312", "0.6309008", "0.62329", "0.6201972", "0.6197924", "0.618897", "0.6177045", "0.617191", "0.6145641", "0.61397576", "0...
0.66408557
1
Locate optimizer from hparams, take a step
def optimize_step(self, loss, glbl_step): Opt = locate("tensorflow.train." + hparams.optimizer) if Opt is None: raise ValueError("Invalid optimizer: " + hparams.optimizer) optimizer = Opt(hparams.l_rate) grads_vars = optimizer.compute_gradients(loss) capped_grads = [(None if grad is None else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_optimizer(self):\n raise NotImplementedError", "def optimization_step(self):\n \n if \"CSS\" in self.algorithm:\n \n input_dict = {self.x: self.train_inputs[self.minibatch_set,:]}\n \n var_list = [self.x_tilda, self.minibatch_set]...
[ "0.6217628", "0.61910707", "0.6007577", "0.5974602", "0.5930321", "0.5929612", "0.58880615", "0.5886796", "0.58155364", "0.5755176", "0.57254344", "0.5718326", "0.5693191", "0.567812", "0.56665564", "0.56651974", "0.56435186", "0.5641517", "0.5597855", "0.5471214", "0.5469395...
0.51227474
79
If trainable, returns variable, otherwise the original embedding
def embedding_setup(self, embedding, emb_trainable): if emb_trainable == True: emb_variable = tf.get_variable( name="embedding_matrix", shape=embedding.shape, initializer = tf.constant_initializer(embedding)) return emb_variable else: return embedding
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def embedding_trainable_variables(self) -> Sequence[tf.Variable]:\n return self._embedding_layer.trainable_variables", "def forward(self, input_variable):\r\n return self.embedding(input_variable)", "def embedding_layer(self):\n with tf.name_scope(\"Embedding_Layer\"):\n V_size = le...
[ "0.7058622", "0.702349", "0.6737134", "0.66756374", "0.665749", "0.6568265", "0.65501094", "0.6522559", "0.6482883", "0.64559466", "0.64411855", "0.64393085", "0.6317404", "0.630891", "0.62915754", "0.62392634", "0.62351906", "0.62319773", "0.6220624", "0.6140934", "0.6062287...
0.7045865
1
Swap ints for dense embeddings, on cpu. word_ids correspond the proper row index of the embedding_tensor
def embedded(self, word_ids, embedding_tensor, scope="embedding"): with tf.variable_scope(scope): with tf.device("/cpu:0"): inputs = tf.nn.embedding_lookup(embedding_tensor, word_ids) return inputs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_embeddings(self, weight, words):\n # wrap in tensor\n if isinstance(weight, list):\n weight = torch.Tensor(weight).float()\n if isinstance(weight, np.ndarray):\n weight = torch.from_numpy(weight).float()\n # check embedding size\n if weight.size(1) ...
[ "0.6119837", "0.59848696", "0.5960104", "0.5842461", "0.5810946", "0.5780748", "0.5766295", "0.57428074", "0.57310194", "0.56487286", "0.5628087", "0.56140584", "0.55454993", "0.5531869", "0.5505317", "0.5502685", "0.54835695", "0.5437871", "0.5430117", "0.5428947", "0.541484...
0.563496
10
Dynamic encoder for one direction
def encoder_one_way(self, cell, x, seq_len, init_state=None): # Output is the outputs at all time steps, state is the last state with tf.variable_scope("dynamic_rnn"): outputs, state = tf.nn.dynamic_rnn(\ cell, x, sequence_length=seq_len, initial_state=init_state, dtype...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encoder(self, inputs):\n pass", "def _define_encoder(self):\n raise NotImplementedError", "def build_encoder(shift):\n ### TODO.", "def _define_encoder(self):\n self.encoder = nn.Sequential(View((-1, 64 * 64 * 3)),\n nn.Linear(64 * 64 * 3, 5120, bias=False)...
[ "0.71723115", "0.7158449", "0.68865305", "0.67140174", "0.6679422", "0.65452635", "0.65233946", "0.6394681", "0.6371668", "0.63569164", "0.63405526", "0.63349515", "0.6313551", "0.6290213", "0.6112942", "0.60763985", "0.60718226", "0.60718226", "0.6067417", "0.6055014", "0.60...
0.5588849
64
Dynamic encoder for two directions
def encoder_bi(self, cell_fw, cell_bw, x, seq_len, init_state_fw=None, init_state_bw=None): # Output is the outputs at all time steps, state is the last state with tf.variable_scope("bidirectional_dynamic_rnn"): outputs, state = tf.nn.bidirectional_dynamic_rnn(\ cell_fw...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_encoder(shift):\n ### TODO.", "def encoder(self, inputs):\n pass", "def _define_encoder(self):\n raise NotImplementedError", "def build_encoder_bi(tparams, options):\n\t# word embedding (source)\n\tembedding = tensor.tensor3('embedding', dtype='float32')\n\tembeddingr = embedding[::-1]...
[ "0.6631168", "0.65565383", "0.6201778", "0.62013143", "0.59247094", "0.58589214", "0.5825668", "0.5816675", "0.5806047", "0.5725331", "0.56664294", "0.5655551", "0.56482124", "0.56449974", "0.5614309", "0.55975485", "0.55925363", "0.5589105", "0.5589105", "0.5589105", "0.5578...
0.5178888
59
Concatenate input and classes. Do not use for classification
def emb_add_class(self, enc_embedded, classes): num_classes = tf.shape(classes)[1] # final_emb_dim = tf.to_int32(tf.shape(enc_embedded)[2] + num_classes) time_steps = tf.shape(enc_embedded)[1] classes = tf.tile(classes, [1, time_steps]) # copy along axis=1 only classes = tf.reshape(classes, [-1, ti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def concat_model():\n x = tf.keras.Input(shape=[10, 10, 3, ])\n x1 = tf.keras.layers.Conv2D(5, (2, 2))(x)\n x2 = tf.keras.layers.Conv2D(6, (2, 2))(x)\n x3 = tf.keras.layers.Conv2D(7, (2, 2))(x)\n z = tf.keras.layers.concatenate([x2, x1, x3], axis=-1)\n z1 = tf.keras.layers.Conv2D(10, (2, 2))(z)\n...
[ "0.6314391", "0.6092329", "0.60063756", "0.5983007", "0.59544957", "0.58480245", "0.58458734", "0.58191264", "0.5818284", "0.5805948", "0.5792468", "0.5790514", "0.5706972", "0.5682198", "0.56583315", "0.5657247", "0.56488144", "0.56450874", "0.56161106", "0.5582381", "0.5574...
0.5815715
9
Concatenate hidden state with class labels
def add_classes_to_state(self, state_tuple, classes): # h is shape [batch_size, num_units] classes = tf.cast(classes, self.floatX) h_new = tf.concat([state_tuple.h, classes], 1) # concat along 1st axis new_state_tuple = tf.contrib.rnn.LSTMStateTuple(state_tuple.c, h_new) return new_state_tuple
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _hide_labels(self):\n pass", "def __str__(self):\n return ''.join(str(e) + ' ' for e in self.state)", "def prepare_labels(labels, class_mask):\n mask = [1 if elt else -1 for elt in class_mask]\n mask = np.array(mask)\n return labels.dot(mask)", "def is_hidden(self):\n return se...
[ "0.5912269", "0.589453", "0.56474185", "0.5618521", "0.54821837", "0.54815704", "0.5479171", "0.5475139", "0.5450685", "0.53647417", "0.53514713", "0.5336808", "0.5324306", "0.531324", "0.5307073", "0.5299472", "0.5298668", "0.5289933", "0.5288108", "0.5247261", "0.52441347",...
0.5141507
30
Output projection function To be used for single timestep in RNN decoder
def output_logits(self, decoded_outputs, num_units, vocab_size, scope): with tf.variable_scope(scope): w = tf.get_variable("weights", [num_units, vocab_size], dtype=self.floatX, initializer=glorot()) b = tf.get_variable("biases", [vocab_size], dtype=self.floatX, initializer=tf.consta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_projection(self):\n return self.projection(what='output')", "def projection(self, rnn_outputs):\n \n with tf.variable_scope('Projection'):\n # U = tf.get_variable('Matrix', [self.config.mRNN._hidden_size*2, self.config.data_sets._len_vocab])\n U = tf.get_vari...
[ "0.6591502", "0.6589933", "0.6281211", "0.6193335", "0.61072457", "0.5835417", "0.5775195", "0.57721055", "0.5758339", "0.5727146", "0.5715693", "0.5715132", "0.56472784", "0.5622119", "0.5531096", "0.54391927", "0.54026216", "0.5401652", "0.53889", "0.5381454", "0.53649795",...
0.0
-1
Logits for the sequence
def sequence_class_logits(self, decoded_outputs, pool_size, max_seq_len, num_classes): with tf.variable_scope("pooling"): features = tf.expand_dims(self.decoded_outputs.rnn_output, axis=-1) pooled = tf.nn.max_pool( value=features, # [batch, height, width, channels] ksize=[1, 1, pool_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __convert_to_log(self):\n for i in range(self.nStates):\n if self.pi[i]>0:\n self.pi[i]=log(self.pi[i])\n else:\n self.pi[i]=float('-inf')\n for j in range(self.nStates):\n if self.t[i][j]>0:\n self.t[i][j]=...
[ "0.70746166", "0.6858346", "0.6793603", "0.67382306", "0.6614052", "0.6479097", "0.6446664", "0.6408251", "0.63404495", "0.6335923", "0.6316904", "0.63131297", "0.6306427", "0.63032484", "0.63011235", "0.6253789", "0.6236438", "0.622002", "0.6219435", "0.620701", "0.62040913"...
0.0
-1
Class loss. If binary, two outputs
def classification_loss(self, classes_true, classes_logits): entropy_fn = tf.nn.sparse_softmax_cross_entropy_with_logits classes_max = tf.argmax(classes_true, axis=1) class_loss = entropy_fn( labels=classes_max, logits=classes_logits) return class_loss
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rpn_cls_loss(*args):\n y_true, y_pred = args if len(args) == 2 else args[0]\n indices = tf.where(tf.not_equal(y_true, -1))\n target = tf.gather_nd(y_true, indices)\n output = tf.gather_nd(y_pred, indices)\n lf = tf.losses.BinaryCrossentropy()\n return lf(target, output)", "def class_balance...
[ "0.6800373", "0.6765104", "0.6725985", "0.6667496", "0.6605275", "0.65954643", "0.65091467", "0.6487406", "0.6465686", "0.6384776", "0.6372204", "0.6337602", "0.63248986", "0.631258", "0.6306866", "0.63045424", "0.6264657", "0.6255827", "0.62363243", "0.62358147", "0.6233365"...
0.6565122
6
Returns class label (int) for prediction and gold
def predict(self, pred_logits, classes): y_pred = tf.nn.softmax(pred_logits) y_pred = tf.argmax(y_pred, axis=1) y_true = tf.argmax(classes, axis=1) return y_pred, y_true
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode_prediction(self, prediction):\n index = np.argmax(prediction)\n\n inv_map = {v: k for k, v in self.class_index.items()}\n label = inv_map[index]\n return label, np.amax(prediction)", "def get_classLabel(self, dataset, class_label): \n\t\tnode = self.root\n\t\tbroken=0\n...
[ "0.71386623", "0.7114175", "0.6994599", "0.69635314", "0.6898009", "0.6869533", "0.68645144", "0.68268377", "0.67881536", "0.6773684", "0.6773116", "0.6743014", "0.67140216", "0.67077726", "0.67069185", "0.670076", "0.66936386", "0.6687495", "0.66666144", "0.6652521", "0.6644...
0.0
-1
Loss on sequence, given logits and onehot targets Default loss below is softmax cross ent on logits
def sequence_loss(self, logits, targets, seq_len): # creates mask [batch_size, seq_len] mask = tf.sequence_mask(seq_len, dtype=tf.float32) # We need to delete zeroed elements in targets, beyond max sequence max_seq = tf.reduce_max(seq_len) max_seq = tf.to_int32(max_seq) # Slice time dimension t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_loss(logits, labels):\n predictions = tf.nn.softmax(logits)\n cost = tf.losses.softmax_cross_entropy(onehot_labels=labels,\n logits=logits,\n )\n return predictions, cost", "def loss(self, labels, logits, mask=...
[ "0.7389702", "0.72658104", "0.70894176", "0.7064109", "0.70640814", "0.70170397", "0.69140756", "0.69122744", "0.6881433", "0.68809944", "0.68779224", "0.6874104", "0.68733245", "0.68332094", "0.683017", "0.6797566", "0.6795389", "0.6769141", "0.67469865", "0.6745877", "0.674...
0.6511102
54
Output projection over all timesteps
def sequence_output_logits(self, decoded_outputs, num_units, vocab_size): # We need to get the sequence length for *this* batch, this will not be # equal for each batch since the decoder is dynamic. Meaning length is # equal to the longest sequence in the batch, not the max over data max_seq_len = tf.sh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _project(self):\n ghosts_w = self.input_field.topology.ghosts()\n self.input_field.data[0], self.input_field.data[1], \\\n self.input_field.data[2] = \\\n fftw2py.projection_om_3d(self.input_field.data[0],\n self.input_field.data[1],...
[ "0.57561207", "0.5720776", "0.5714521", "0.56881714", "0.5681513", "0.56547904", "0.5637628", "0.5561602", "0.5546136", "0.5512237", "0.5484176", "0.54627526", "0.54291105", "0.5403807", "0.53816235", "0.53636557", "0.53605634", "0.5359459", "0.5359459", "0.5342748", "0.53420...
0.0
-1
This function runs as a thread. It is responsible for listening to the neighboring nodes
def runNodesListener(self): socketNodes = socket.socket(socket.AF_INET, socket.SOCK_STREAM) socketNodes.bind((self.ip_address, 5003)) while True: socketNodes.listen(5) try : conn, addr1 = socketNodes.accept() data = conn.recv(self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def receive_broadcast_thread():\r\n while True:\r\n data, (ip, port) = broadcaster.recvfrom(4096)\r\n print_blue(f\"RECV: {data} FROM: {ip}:{port}\")\r\n data = data.decode(\"utf-8\").split()\r\n node_id = data[0]\r\n node_port = data[2]\r\n\r\n # to put a condition for...
[ "0.659177", "0.6297411", "0.62773734", "0.62352943", "0.6219053", "0.61664134", "0.615619", "0.6095733", "0.60638076", "0.60447717", "0.60328406", "0.59789217", "0.59214437", "0.58944476", "0.58753955", "0.5852265", "0.58251584", "0.58106416", "0.5809751", "0.5801766", "0.580...
0.60037047
11
Function sending infomrmations to other nodes
def runNodesMessage(self): while True: for neighbour in self.nextIP: socketNodes = socket.socket(socket.AF_INET, socket.SOCK_STREAM) while True: try: socketNodes.connect((neighbour, 5003)) socketNodes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invoke(self, msg, req):\n node = Node.create()\n node.acquire_lock()\n\n if msg.name == 'forward':\n try:\n with node.graph.as_default():\n if node.num_devices == 5:\n output, name = Model_5.forward(req['input'], req['next...
[ "0.5952947", "0.5846011", "0.57124156", "0.5598955", "0.5477898", "0.54727274", "0.5461603", "0.54390836", "0.54278105", "0.5402687", "0.53933555", "0.53694874", "0.5343483", "0.5285376", "0.5242901", "0.52267", "0.52222073", "0.519734", "0.5159041", "0.5159041", "0.5159041",...
0.48762402
79
Looks if the received block is in the waiting list. If yes we check if the address is already recorded. If no it is added to the waiting list and broadcasted.
def arrivingBlock(self,data, addr, receivedBlock): if self.blockchain.waiting_blocks == []: self.confirmed.clear() self.neighboursOk.clear() self.confirmed.append(addr) self.blockchain.putting_block(receivedBlock) self.message = self.setMessa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_call_waiting(self) -> bool:", "def BlockheightCheck(self):\n if self.CurrentBlockheight == BC.Default().Height:\n if len(self.Peers) > 0:\n logger.debug(\"Blockheight is not advancing ...\")\n next_hash = BC.Default().GetHeaderHash(self.CurrentBlockheight + ...
[ "0.5706097", "0.5541932", "0.5535595", "0.55307394", "0.5490348", "0.5457724", "0.5444099", "0.54275596", "0.542084", "0.54196537", "0.5404514", "0.53694296", "0.53550977", "0.5339095", "0.5308351", "0.5284784", "0.5277014", "0.52734613", "0.526288", "0.52274597", "0.5192736"...
0.614878
0
Constructor of the node
def __init__(self): config=ConfigParser() config.read('../config/host.ini') self.ip_address=config.get('node','ip_address') self.username=config.get('node','username') self.server_address=config.get('registration','ip_address') self.password=config.get('registrat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.root = Node('')", "def __init__(self):\n self.start = Node('-1')", "def __init__(self):\n self.root = Node(\"\")", "def __init__(self):\n self.root = Node(\"\")", "def __init__(self, node_text=\"\", node_type=0, node_parent=None):\n self.node_te...
[ "0.782463", "0.7795853", "0.7745167", "0.7745167", "0.7734531", "0.7705406", "0.7700045", "0.769647", "0.76576585", "0.7647589", "0.76450074", "0.762918", "0.7583373", "0.7583373", "0.7583373", "0.7575243", "0.7563161", "0.75337684", "0.7517065", "0.7516046", "0.74705166", ...
0.0
-1
Test updating a cadence_frequency for an existing cadence
def test_submit_calibration_valid(self): new_form_data = { 'site': 'tlv', 'cadence_frequency': 2, # new cadence_frequency 'target_id': self.target.id } response = self.client.post(reverse('nres_calibrations:nres_submission'), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_occurrence(self):\n pass", "def update_frequencies():\n pass", "def UpdateFrequency(self, newfreq):\n\n if self.strategy:\n setattr(self.strategy, managers.UTICK, newfreq)", "def test_check_freq_crashed(self):\n self.assertEqual(check_freq(self.jobset2), 'fc...
[ "0.6354806", "0.6300095", "0.6059406", "0.60465586", "0.5993218", "0.57028705", "0.56660575", "0.56660575", "0.5645263", "0.5643915", "0.55231625", "0.55107856", "0.55028033", "0.55010307", "0.55003303", "0.5495829", "0.54729825", "0.5471072", "0.5441614", "0.5434374", "0.543...
0.62852836
2
Test that a new DynamicCadence is created by form submission
def test_create_cadence_for_new_site(self): new_form_data = { 'site': 'cpt', 'cadence_frequency': 10, 'target_id': self.target.id } original_dc_count = DynamicCadence.objects.all().count() response = self.client.post(reverse('nres_calibrations:nres_sub...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_submit_calibration_valid(self):\n new_form_data = {\n 'site': 'tlv',\n 'cadence_frequency': 2, # new cadence_frequency\n 'target_id': self.target.id\n }\n response = self.client.post(reverse('nres_calibrations:nres_submission'),\n ...
[ "0.70193005", "0.6708431", "0.66458005", "0.6469265", "0.64464295", "0.6391832", "0.6252196", "0.62489915", "0.6191535", "0.6154543", "0.6122482", "0.6101032", "0.60874194", "0.6073931", "0.604443", "0.6040367", "0.6038633", "0.6028261", "0.6002224", "0.59992266", "0.5994009"...
0.7397608
0
Test that the nres_home target list contains the NRES calibration targets
def test_nres_targets_list(self): response = self.client.get(reverse('nres_calibrations:nres_home')) self.assertContains(response, self.target.id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_which_targets():\n num_multi_targets = 0\n for which_targets_day in which_targets:\n # All inputs have a label\n assert np.all(which_targets_day.sum(axis=1) > 0)\n # No inputs have more than 3 targets\n assert np.all(which_targets_day.sum(axis=1) < 4)\n\n num_multi...
[ "0.58674073", "0.5667292", "0.5577143", "0.5518126", "0.54473", "0.54211724", "0.5411076", "0.5409779", "0.54086864", "0.53584373", "0.53370976", "0.531879", "0.52858996", "0.52696484", "0.52417976", "0.52324855", "0.5231467", "0.51975954", "0.51834714", "0.5156341", "0.51380...
0.7668798
0
Test that the NRES Cadence list contains the ObservationGroup name of the DynamicCadence
def test_nres_cadence_list(self): response = self.client.get(reverse('nres_calibrations:nres_home')) self.assertContains(response, self.observation_group_name) # should appear in History column
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_check_ca_groups(self, admin_dashboard):\n ca_tab = admin_dashboard.select_custom_attributes()\n expected_ca_groups_set = set(\n [objects.get_normal_form(item) for item in objects.ALL_CA_OBJS])\n actual_ca_groups_set = set(\n [item.text for item in ca_tab.get_items_list()])\n asse...
[ "0.51378435", "0.502584", "0.50022244", "0.49259534", "0.48699087", "0.48539323", "0.48403198", "0.4828131", "0.48271948", "0.48038292", "0.47950238", "0.47871473", "0.4785799", "0.4756255", "0.47553796", "0.47491336", "0.4746582", "0.4743038", "0.47408164", "0.47399324", "0....
0.6860291
0
Gets user input such as the localhost and the similarity value for the comparision. Reads all the ringsugars in the given database and and creates a data frame with aglycons, their coconut_id and taxonomy. The biological names are delete and if there are two different taxonomies for an aglycon, the taxonomy is called '...
def complete_databank(port="localhost:27017",coconut_database="COCONUT2020-10",sweetcoconut_database="sweetcoconut"): client = MongoClient(port) db_complete = client[coconut_database] collection = db_complete.uniqueNaturalProduct db_complete_only_ring_sugars = pd.DataFrame(list(collection.find({"contain...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sweetcoconut_databank(df_tax_id_fromCompleteDatabank, taxonomy_Double,sweetcoconut_database,port):\n client2 = MongoClient(port)\n db_s = client2[sweetcoconut_database]\n collection2 = db_s.sweetNaturalProduct\n sweetnp = pd.DataFrame(list(collection2.find({\"contains_sugar\": True})))\n sweetnp...
[ "0.58430374", "0.5564186", "0.54623526", "0.5419678", "0.5353768", "0.5343155", "0.5265147", "0.5263287", "0.5258324", "0.52520347", "0.5207315", "0.51895225", "0.51715577", "0.51707095", "0.5153093", "0.51300794", "0.50969017", "0.5094018", "0.5078065", "0.50657225", "0.5031...
0.652284
0
Gets the created data frame with the three columns aglycon, coconut id and taxonomy Merges sweetcocunt data frame with incoming data frame via their coconut id. Replaces nan with "no" if there isn't a known taxonomy in the row for the aglycon. Summarize all aglycons with the same structure into one row. Writes a .pkl f...
def sweetcoconut_databank(df_tax_id_fromCompleteDatabank, taxonomy_Double,sweetcoconut_database,port): client2 = MongoClient(port) db_s = client2[sweetcoconut_database] collection2 = db_s.sweetNaturalProduct sweetnp = pd.DataFrame(list(collection2.find({"contains_sugar": True}))) sweetnp_with_tax = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reduce_and_save():\n ### Get the signature information\n sig_info = pd.read_csv(join(FILE_PATH, \"GSE92742_Broad_LINCS_sig_info.txt\"), sep=\"\\t\")\n ### Columns are:\n ### Index([u'sig_id', u'pert_id', u'pert_iname', u'pert_type', u'cell_id',\n ### u'pert_dose', u'pert_dose_unit', u'per...
[ "0.615126", "0.5918436", "0.5613667", "0.55950755", "0.5493555", "0.5440564", "0.53833544", "0.53545773", "0.53458494", "0.53149766", "0.5311221", "0.5273746", "0.526471", "0.5234631", "0.5224225", "0.52036613", "0.5177393", "0.5147963", "0.5131519", "0.5126816", "0.51184547"...
0.6074063
1
Gets a data frame with all the same aglycon structures in one row. Counts all taxonomies and create a barplot. 'Double' is also a taxonomy. Saves the bar plot with the numbers of different taxonomies as .png.
def bar_plot(df_NP): cnt = Counter() for tax_list in df_NP.taxonomy: for tax in list(tax_list): if tax != 'no': cnt[tax] += 1 plt.bar(cnt.keys(),cnt.values()) plt.xlabel('taxonomic provenance') plt.ylabel('number of molecules') plt.title('number of aglycons wi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eda_plot():\n\n df1 = pd.read_csv('eda_malware.csv')\n df2 = pd.read_csv('eda_random.csv')\n df3 = pd.read_csv('eda_popular.csv')\n\n df = pd.concat([df1, df2, df3], ignore_index=True)\n df['label'].replace([0,1],['Benign','Malware'],inplace=True)\n\n colors = ['#EAB6AB','#D9E6F3','#CBAACB','...
[ "0.670801", "0.6379678", "0.62803435", "0.62481606", "0.621397", "0.6171354", "0.614709", "0.612319", "0.6084341", "0.604334", "0.6034777", "0.5924511", "0.5897462", "0.5889659", "0.5855359", "0.58464646", "0.58460945", "0.57800704", "0.57795185", "0.57522184", "0.572955", ...
0.7676816
0
Gets a data frame with all the same aglycon structures in one row. Counts all taxonomies and creates a venn diagram with the four taxonomies plants, bacteria, animals, fungi. Reads the original taxonmies of the 'Double' entries. Saves a venndiagram of the different taxonmies as .png.
def venn_diagram(df_NP, taxonomy_Double): taxonomy_Single = [list(tax) for tax in df_NP.taxonomy if 'double' not in tax] taxonomy_All = taxonomy_Single + taxonomy_Double plants = set() bacteria = set() animals = set() fungi = set() for tax_list in taxonomy_All: if "plants" in tax_lis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eda_plot():\n\n df1 = pd.read_csv('eda_malware.csv')\n df2 = pd.read_csv('eda_random.csv')\n df3 = pd.read_csv('eda_popular.csv')\n\n df = pd.concat([df1, df2, df3], ignore_index=True)\n df['label'].replace([0,1],['Benign','Malware'],inplace=True)\n\n colors = ['#EAB6AB','#D9E6F3','#CBAACB','...
[ "0.61547685", "0.5806181", "0.5550293", "0.5549266", "0.5513179", "0.54985404", "0.5479837", "0.54608345", "0.54200816", "0.54113746", "0.5385822", "0.5380591", "0.53727204", "0.53407085", "0.5332196", "0.5309217", "0.5293119", "0.5277534", "0.526739", "0.52268946", "0.520937...
0.7490416
0
Gets a data frame with all the same aglycon structures in one row. Deletes all rows with more than one entry in the taxonomy row. Passes a data frame with only one entry (superkingdom or 'no') in the taxonomy row.
def aglycon_single_tax(df_NP): # **seperate aglycons with at least two different entries in taxonomy** index_Unique_Tax = [ind for ind, tax_list in enumerate(df_NP.taxonomy) if len(tax_list) == 1] df_Without_Double = df_NP.iloc[index_Unique_Tax[:]] #df_Without_Double # **check for 'double' or 'tripl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean(df):", "def gb_cleaner(df):\n df['tag'] = df.tags.apply(retagger)\n \n c_list = df.text.tolist()\n\n clean_corpus = []\n for docs in c_list:\n clean_corpus.append(data_cleaner(docs))\n \n df['clean'] = clean_corpus\n\n df = df.drop(['text', 'tags', 'stars'], axis= 1)\n ...
[ "0.5444545", "0.5277261", "0.52311677", "0.5200804", "0.51652235", "0.51347816", "0.51267016", "0.51248044", "0.50985575", "0.5084206", "0.50411373", "0.5032984", "0.5006409", "0.49748224", "0.49653932", "0.48951414", "0.48935908", "0.48864013", "0.4885388", "0.48809195", "0....
0.5743044
0
Get a list of all available capabilities.
def get(self): try: response = requests.get(CONF.api.github_api_capabilities_url) LOG.debug("Response Status: %s / Used Requests Cache: %s" % (response.status_code, getattr(response, 'from_cache', False))) if response.status_code =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def capabilities(self):\n return []", "def capabilities(self):\n pass", "def capabilities(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"capabilities\")", "def list_caps():\n global _CAPABILITIES_MAP\n\n try:\n return tuple(sorted(_CAPABILITIES_MAP.keys()))\n\...
[ "0.8241211", "0.75479233", "0.7545116", "0.73705965", "0.73676735", "0.73322165", "0.7275096", "0.72728455", "0.71944684", "0.7132316", "0.712093", "0.70567423", "0.7039903", "0.6985127", "0.695252", "0.69255227", "0.6894365", "0.6881602", "0.6828689", "0.67913085", "0.677973...
0.53967273
93
Handler for getting contents of specific capability file.
def get_one(self, file_name): github_url = ''.join((CONF.api.github_raw_base_url.rstrip('/'), '/', file_name, ".json")) try: response = requests.get(github_url) LOG.debug("Response Status: %s / Used Requests Cache: %s" % (respon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n try:\n response = requests.get(CONF.api.github_api_capabilities_url)\n LOG.debug(\"Response Status: %s / Used Requests Cache: %s\" %\n (response.status_code,\n getattr(response, 'from_cache', False)))\n if response....
[ "0.588543", "0.588543", "0.57889295", "0.5763682", "0.5716423", "0.5572932", "0.55056", "0.5486656", "0.5476102", "0.54738456", "0.5465829", "0.5389476", "0.5356889", "0.5339783", "0.53378046", "0.52965707", "0.52622104", "0.52595115", "0.5175876", "0.51711446", "0.5162143", ...
0.0
-1
Draw a histogram given the graph.
def draw_histogram(graph: Graph) -> Optional[Graph]: if not graph: return None try: # generate and open a new figure figure, ax = plt.subplots() # When graph.x or y is str, the histogram is ill-defined. ax.barh(graph.y, graph.x, color=graph.color) ax.set_title(graph.title) if graph.xlabe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_histogram(xx, hist_ax, alpha=1.0, colorV=None, facecolor='#80D080', edgecolor=None, nbins=75,\n fontsize=8, linewidth=1, xlabel=None, ylabel=None, label=None):\n plt.sca(hist_ax)\n if colorV is None:\n n, bins, patches = hist_ax.hist(xx, nbins, histtype='stepfilled', alpha=a...
[ "0.6689416", "0.65681064", "0.6548414", "0.6526117", "0.64784855", "0.6347681", "0.62804496", "0.6251401", "0.62138206", "0.62123525", "0.6209556", "0.62087065", "0.6201147", "0.6197796", "0.61838293", "0.61743563", "0.6154292", "0.61535", "0.61413497", "0.61310756", "0.61112...
0.74443585
0
Converts a Matplotlib figure to a base64 string encoding.
def figure_to_base64str(fig: matplotlib.figure.Figure) -> str: buf = io.BytesIO() fig.savefig(buf, bbox_inches='tight', format='png') return base64.b64encode(buf.getbuffer().tobytes()).decode('ascii')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot2uri(figure):\n image = io.BytesIO()\n figure.savefig(image, format=\"png\")\n image.seek((0))\n string = base64.b64encode(image.read())\n uri = urllib.parse.quote(string)\n\n return uri", "def base64(self):\n image = self.png.getvalue()\n return base64.encodestring(image)...
[ "0.7147997", "0.68165886", "0.6809981", "0.6809981", "0.6721276", "0.6467986", "0.6416611", "0.64131576", "0.6268338", "0.62255985", "0.6189878", "0.6181082", "0.5922518", "0.5921818", "0.5912652", "0.5896791", "0.5858558", "0.5847519", "0.5846032", "0.58170253", "0.5803382",...
0.88419247
0
Stringifies a slice key.
def stringify_slice_key(slice_key: SliceKeyType) -> Tuple[str, str]: key_count = len(slice_key) if not key_count: return ('Overall', 'Overall') keys = [] values = [] separator = ', ' for (feature, value) in slice_key: keys.append(feature) values.append(value) # To use u'{}' instead of '{}' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _key_to_str(self, key: Any) -> Any:\n if isinstance(key, str):\n return key\n if isinstance(key, int):\n return list(self._data_vars.keys())[key]\n if isinstance(key, slice):\n s = key.indices(len(self))\n return self._key_to_str(list(range(*s)))...
[ "0.7414618", "0.7386717", "0.680454", "0.6604581", "0.62448543", "0.6166507", "0.5966563", "0.58570135", "0.5843735", "0.58304656", "0.5780478", "0.57421565", "0.57346904", "0.5700808", "0.56465274", "0.5616167", "0.5615734", "0.5599783", "0.55980146", "0.55510175", "0.554406...
0.73211503
2
Get the report data and do the computation for each and every product in the stock and divided it into the relevant time period
def compute_ageing(self): self.env['ageing.result'].search([]).unlink() # Get current company id current_compnay_id = self.env.user.company_id.id # Get products that related to the company products = self.env['product.product'].search([('company_id', '=', current_compnay_id)]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_data_with_warehouse(self,from_date,to_date,warehouses,all_products):\n data_dict = {}\n stock_quant_obj=self.env['stock.quant']\n for warehouse in warehouses:\n all_locations = self.get_all_locations(warehouse)\n if not all_locations:\n continu...
[ "0.686364", "0.6636723", "0.65827537", "0.65092677", "0.6497481", "0.64481914", "0.6316854", "0.6294505", "0.6278176", "0.61984044", "0.6180829", "0.6168524", "0.6148737", "0.61187345", "0.6070621", "0.6064129", "0.605158", "0.6049545", "0.60449344", "0.6044796", "0.60137326"...
0.0
-1
Test 'image lookup t days' and check for correct display and enum value printing.
def test(self): self.build() exe = self.getBuildArtifact("a.out") self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) lldbutil.run_to_source_breakpoint( self, '// Breakpoint for bitfield', lldb.SBFileSpec("main.c")) self.expect("fr var a", DATA_TYPES_DISPLAYED_CORREC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Image():\n assert Image(cur, \"Simple_Linear\").detect_image() == True\n assert Image(cur, \"Logistic_Linear\").detect_image() == False\n assert Image(cur, \"Simple_Linear\").date == \"2021-04-20\"\n assert Image(cur, \"Breslow-Day_Test\").source == \"Course BIOSTAT703 slide\"", "def test_ch...
[ "0.5828093", "0.5741669", "0.5531521", "0.5446059", "0.54444784", "0.54125243", "0.5405248", "0.5379844", "0.5291747", "0.5263877", "0.5116462", "0.51097274", "0.51079166", "0.5055522", "0.50463736", "0.5033744", "0.50264347", "0.5025332", "0.50177395", "0.49971616", "0.49969...
0.0
-1
Simulatesa walker in a 1D potential.
def simulate_1Dsystem(inps, mdps, method, potfunc, bcs, filetitle, makeplot, plot_freq, make_movie, ebound): steps = inps[0] dt = inps[1] x0 = inps[2] T = inps[3] m = inps[4] xmin = inps[5] xmax = inps[6] xinc = inps[7] kb = inps[13] winit = mdps[0] del...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def walk(self):\n self.speed = self.speed + (0.2 * self.legs)", "def simple_walker(data_simple_tracking):\n def dist_fun(tracks, detections_test):\n \"\"\"Function to calculate distance between track and detection.\"\"\"\n np_track = np.array([(track.meta[DETKEY][-1].x, track.meta[DETKEY]...
[ "0.6046353", "0.5641975", "0.5520832", "0.55019075", "0.54966307", "0.53194624", "0.530925", "0.529421", "0.52837753", "0.5268337", "0.5266113", "0.5240376", "0.5227442", "0.517567", "0.5159675", "0.5157245", "0.5153656", "0.51477164", "0.5130458", "0.51271415", "0.5116963", ...
0.5240417
11
Receive and returns an array that recreates the FES.
def recreate_1DFES(FES, icount, coord, xinc, xmin, xmax, E): index = int(round((round(coord, int(abs(math.log10(xinc)))) + (0-xmin))/xinc)) if coord > xmin and coord < xmax: FES[index] = ((FES[index] * (icount[index]) + E) / (icount[index] + 1)) icount...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _recv(self) -> List[np.ndarray]:", "def recv_array(self, flags=0, copy=True, track=False):\n md = self.recv_json(flags=flags)\n msg = self.recv(flags=flags, copy=copy, track=track)\n A = numpy.frombuffer(msg, dtype=md['dtype'])\n return A.reshape(md['shape'])", "def recv_array(s...
[ "0.62769", "0.574053", "0.574053", "0.5360778", "0.531635", "0.52670115", "0.52535814", "0.52504945", "0.5225411", "0.52028364", "0.51303285", "0.51203173", "0.50971043", "0.50925493", "0.50638926", "0.50428754", "0.5041201", "0.5023313", "0.49668166", "0.4948956", "0.4937544...
0.0
-1
Get person's ID from mbank.tcredits (turnes DB)
def get_person_id(contract_num, phone): exfin_connection = MySQLdb.connect( host="10.10.100.27", # host of MySQL database user="root", # user's username passwd="Orraveza(99)", # your password db="mbank", # nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_person_id_and_tel(contract_num):\n exfin_connection = MySQLdb.connect(\n host=\"10.10.100.27\", # host of MySQL database\n user=\"root\", # user's username\n passwd=\"Orraveza(99)\", # your password\n db=\"mbank\", ...
[ "0.6560628", "0.6496635", "0.6305405", "0.62735915", "0.6225594", "0.6144446", "0.60823274", "0.5909578", "0.5867553", "0.5829623", "0.5829623", "0.5829623", "0.5829623", "0.5757211", "0.57547575", "0.57257414", "0.5696543", "0.56823105", "0.56737465", "0.56495553", "0.564790...
0.68747634
0
Get person's ID from mbank.tcredits (turnes DB)
def get_person_id_and_tel(contract_num): exfin_connection = MySQLdb.connect( host="10.10.100.27", # host of MySQL database user="root", # user's username passwd="Orraveza(99)", # your password db="mbank", # na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_person_id(contract_num, phone):\n exfin_connection = MySQLdb.connect(\n host=\"10.10.100.27\", # host of MySQL database\n user=\"root\", # user's username\n passwd=\"Orraveza(99)\", # your password\n db=\"mbank\", ...
[ "0.68761975", "0.6497191", "0.63046885", "0.6275422", "0.62251246", "0.61442626", "0.6080249", "0.59082514", "0.58671093", "0.58295715", "0.58295715", "0.58295715", "0.58295715", "0.5758327", "0.5754676", "0.5724665", "0.56968856", "0.56817", "0.5672638", "0.5647657", "0.5647...
0.65625286
1
Test for validity based on requirements
def check_for_validity_puzzle_1(limits: tuple, rep_char: str, password: str): reps = password.count(rep_char) lower, upper = limits if lower <= reps <= upper: return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_validity(self):", "def _check_validity(self):\n pass", "def validate():", "def _is_valid(self):\n self._is_allows_valid()\n self._is_denies_valid()", "def check_validity(self) -> None: # pylint: disable=no-self-use # pragma: nocover\n return None", "def validate(se...
[ "0.82199275", "0.79411346", "0.743704", "0.742443", "0.7148247", "0.7051586", "0.7041749", "0.70136297", "0.7004299", "0.6997353", "0.6975964", "0.69480985", "0.6946532", "0.6919911", "0.69067806", "0.6880522", "0.68750596", "0.68696904", "0.6835599", "0.6833236", "0.68319005...
0.0
-1
count number of valid passwords in a list
def number_of_valid_pass_puzzle_1(input_list: list): num_of_valid = 0 for item in input_list: data = split_data(item) if check_for_validity_puzzle_1(*data): num_of_valid += 1 return num_of_valid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_valid_passwords(passwords, validator):\n count = len(list(filter(validator, passwords)))\n print(f\"Found {count} valid passwords\")\n return count", "def find_valid_passwords(values: List[str]) -> int:\n search_reg = re.compile(\n r\"\\b(?P<first>[0-9]+)-(?P<second>[0-9]+)\\s(?P<let...
[ "0.8193186", "0.77443373", "0.68906647", "0.6878371", "0.6711917", "0.66513747", "0.65652156", "0.6556296", "0.6551484", "0.64362067", "0.6362422", "0.6224782", "0.62063307", "0.6202379", "0.61953527", "0.6195113", "0.609859", "0.6089273", "0.60875905", "0.60206604", "0.59888...
0.67687905
4
Test for validity based on requirements
def check_for_validity_puzzle_2(pos: tuple, char: str, password: str): valid_pos, invalid_pos = pos # using xor if (password[valid_pos-1] == char) ^ (password[invalid_pos-1] == char): return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_validity(self):", "def _check_validity(self):\n pass", "def validate():", "def _is_valid(self):\n self._is_allows_valid()\n self._is_denies_valid()", "def check_validity(self) -> None: # pylint: disable=no-self-use # pragma: nocover\n return None", "def validate(se...
[ "0.8219967", "0.79417014", "0.74356925", "0.74248713", "0.7148919", "0.7052276", "0.70417863", "0.70133173", "0.7005105", "0.69962347", "0.69762856", "0.69475913", "0.6946524", "0.6920208", "0.69087297", "0.6881058", "0.6874956", "0.6867467", "0.68364275", "0.68317467", "0.68...
0.0
-1
count number of valid passwords in a list
def number_of_valid_pass_puzzle_2(input_list: list): num_of_valid = 0 for item in input_list: data = split_data(item) if check_for_validity_puzzle_2(*data): num_of_valid += 1 return num_of_valid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_valid_passwords(passwords, validator):\n count = len(list(filter(validator, passwords)))\n print(f\"Found {count} valid passwords\")\n return count", "def find_valid_passwords(values: List[str]) -> int:\n search_reg = re.compile(\n r\"\\b(?P<first>[0-9]+)-(?P<second>[0-9]+)\\s(?P<let...
[ "0.8193358", "0.7743638", "0.6891725", "0.6769792", "0.67102826", "0.6652063", "0.6565883", "0.6556342", "0.655014", "0.6436412", "0.6360499", "0.62254614", "0.6205677", "0.62009424", "0.61975265", "0.61939204", "0.6100244", "0.6088316", "0.6086228", "0.6019474", "0.5987997",...
0.687942
3
Adapting numpy.int64 type to SQLconform int type using psycopg extension, see [1]_ for more info.
def adapt_numpy_int64(numpy_int64): return AsIs(numpy_int64)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def castData(data, type='int64'):\n data = data.astype(type)\n return data", "def cast_to_integer(array, attributes):\n atts = array.att_names\n\n for nm, typ, null in array.sdbtype.full_rep:\n if nm not in attributes:\n continue\n if 'int' in typ:\n continue\n ...
[ "0.6342146", "0.62293154", "0.6208453", "0.5914053", "0.5862272", "0.5841508", "0.5763204", "0.5722632", "0.57082486", "0.5705555", "0.5675615", "0.5662397", "0.565685", "0.5637229", "0.5554309", "0.54482377", "0.5430291", "0.53955346", "0.5389029", "0.53852504", "0.53627807"...
0.7526429
0
Reshapes arrays of amplitudes which may have been flattened.
def reshape_params(params, nstates): params['Vnn'] = params['Vnn'].reshape(nstates.n, nstates.m) params['Vno'] = params['Vno'].reshape(nstates.n, nstates.mo) params['Von'] = params['Von'].reshape(nstates.no, nstates.m) params['Voo'] = params['Voo'].reshape(nstates.no, nstates.mo) for key in ['fluctu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flatten_stimulus(stimulus):\n n, h, w = stimulus.shape\n return stimulus.reshape((n, h * w))", "def flatten_layers(data):\n return data.reshape((data.shape[0], data.shape[1], -1))", "def flatten_numpy(ndarray):\n return np.reshape(ndarray, (-1,), 'F')", "def flatten_image(inputs):\n ...
[ "0.66989696", "0.63066256", "0.62929034", "0.62222356", "0.6163883", "0.60748667", "0.60659355", "0.60219", "0.5942159", "0.59354687", "0.59175", "0.5854167", "0.5835814", "0.58319926", "0.5804624", "0.57921964", "0.5790089", "0.5758622", "0.57350016", "0.5733529", "0.5720575...
0.0
-1
Gets a dict of bestfit information from the database regarding the specified form factor. Also gets some "meta" information like the associated momentum, current, and lattice size.
def get_best_fit_information(engine, form_factor_id): Nstates = collections.namedtuple( 'NStates', ['n', 'no', 'm', 'mo'], defaults=(1, 0, 0, 0) ) def _float_or_none(astr): if astr is None: return None if (astr.lower() == 'nan') or (astr.lower() == 'none'): r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_stats(trj_datasets, ff_form):\n\n stats_data = {}\n\n params = ff_form['hyperparams']\n stats_func = ff_func[ff_form['potential']]\n\n for key, trj in trj_datasets.items():\n \n stats_dict = {'energy':[]}\n \n for ii, (xyz, box) in enumerate(zip(trj['xyz'], trj['box'])):...
[ "0.5544596", "0.54875684", "0.5375364", "0.5314797", "0.5159251", "0.51468754", "0.51262325", "0.5124719", "0.50992376", "0.5055376", "0.5029532", "0.5029249", "0.49983555", "0.4981368", "0.4980224", "0.49532855", "0.49397266", "0.4906085", "0.48953032", "0.48906365", "0.4883...
0.75372094
0
Reads all the required correlators for analyzing the specified form factor from the table "glance_correlator_n_point". The data from this table lacks any information about correlations and usually only employs partial statistics (often having restricted to 'fine' solves only). However, such data serves a useful cache o...
def get_glance_data(form_factor_id, engine, apply_alias=True): query = f""" select form_factor.form_factor_id, rtrim(name, '-_fine') as basename, glance_correlator_n_point.data from form_factor join junction_form_factor using(form_factor_id) join correlator_n_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_corr (mdp,num):\n ctr=0 # line counter\n mdp.corr_file.seek(0)\n lfsp=mdp.corr_file.read().split(\"\\n\")\n for i in range(0,len(lfsp)-1):\n lin=lfsp[i].strip() # strip preceeding and trailing spaces?\n if lin.startswith(\"0\"): # check whether it is the right form\n if test_line_type(lin,0):\n ...
[ "0.56094223", "0.5485572", "0.52754664", "0.5258015", "0.5176021", "0.5160623", "0.4980546", "0.49767244", "0.49409404", "0.48738986", "0.48393074", "0.47858018", "0.4778757", "0.47687766", "0.47029915", "0.46986908", "0.4646122", "0.4598063", "0.45766872", "0.4559931", "0.45...
0.51926357
4