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
is registered atexit by seamless.core, because it must run first
def _cleanup(): for ( _, transformation, transformation_dict, _, _, increfed, _, ) in _queued_transformations: # For some reason, the logic here is different than for the async version # (see run_transformation_dict_async) if ( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_exit(self):\n pass", "def on_exit(self, userdata):\n pass", "def __exit__(self, *args):\n pass", "def exit(self):\n pass", "def __exit__(self, *args, **kwargs):\n\n pass", "def analyze_on_exit(self):\n atexit.register(exit_handler, self)", "def __exit__(se...
[ "0.8405066", "0.77342", "0.7492898", "0.7473296", "0.7405325", "0.7272851", "0.7258801", "0.7255138", "0.7184624", "0.7150937", "0.70914876", "0.7074723", "0.7052433", "0.7050494", "0.70430213", "0.70367646", "0.70103276", "0.7006843", "0.7004235", "0.6999749", "0.69552046", ...
0.0
-1
Wraps a function in an imperative transformer Imperative transformers can be called as normal functions, but the source code of the function and the arguments are converted into a Seamless transformation.
def transformer(func, **kwargs): result = Transformer(func, is_async=False, **kwargs) update_wrapper(result, func) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wrap_function(self, fn):\n\n @functools.wraps(fn)\n def wrapper(*args):\n fname = fn.__name__\n if len(args) > len(self._insigs):\n raise TypeError(\n (\"{}() takes {} positional arguments but {} were \" \"given\").format(\n ...
[ "0.6748444", "0.6532556", "0.6502756", "0.62839186", "0.6222247", "0.6147785", "0.610159", "0.60612243", "0.6060405", "0.6051406", "0.60026", "0.5921052", "0.5905336", "0.5902974", "0.58616257", "0.585651", "0.5852412", "0.5837479", "0.5837196", "0.5832682", "0.5831985", "0...
0.6421178
3
Wraps a function in an asynchronous imperative transformer Asynchronous imperative transformers can be called and awaited as normal async functions, but the source code of the function and the arguments are converted into a Seamless transformation.
def transformer_async(func, **kwargs): result = Transformer(func, is_async=True, **kwargs) update_wrapper(result, func) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def awaitify(\n function: Union[Callable[..., T], Callable[..., Awaitable[T]]]\n) -> Callable[..., Awaitable[T]]:\n if iscoroutinefunction(function):\n return function\n else:\n return Awaitify(function)", "def transformer(func, **kwargs):\n result = Transformer(func, is_async=False, **...
[ "0.7207748", "0.7180752", "0.662931", "0.6521321", "0.6519227", "0.64941007", "0.64194334", "0.6393317", "0.63527554", "0.63411", "0.63243544", "0.6189952", "0.6173813", "0.6163481", "0.616196", "0.61088103", "0.60895604", "0.6084321", "0.6061671", "0.60611814", "0.60355884",...
0.7630319
0
Consumer task processing function. Retrieves a task, i.e., an URL, from a tasks queue and finds new URLs within its content. These URLs are then written to a result queue that gets validated by the producer for URL freshness.
def run(self): proc_name = self.name while True: next_task = self.task_queue.get() if next_task is None: debug('{}: Exiting'.format(proc_name)) self.task_queue.task_done() break debug('{}: {}'.format(proc_name, next_task...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def monitor_urls_task():\n monitor_urls()", "def collect(self):\n while True:\n if not self._queue.empty():\n message = self._queue.get()\n self.working_on = message['job_type']\n else:\n break\n logging.info(\"Popped off mes...
[ "0.6155511", "0.59778655", "0.59610295", "0.59575444", "0.5953605", "0.5900195", "0.58324873", "0.5825867", "0.5793246", "0.5773043", "0.5716391", "0.5669684", "0.5654354", "0.56210995", "0.56099325", "0.560327", "0.55939645", "0.5573766", "0.5569519", "0.5538796", "0.5520383...
0.5116285
68
Downloads the associated SLD file for a given GeoNode layer The current implementation goes to the layer's detail page and follows the link to the GeoServer's REST API endpoint. It needs the username and password, because by default GeoServer restricts read access to those. It returns the raw content of the SLD file in...
def get_style(layer, url, username=None, password=None): # Get the style json information from GeoServer's REST API if ':' in layer['name']: name = layer['name'].split(':')[1] else: name = layer['name'] style_raw_url = urlparse.urljoin(url, '/geoserver/styles/' + name + '.sld') req...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_district_file(state=48, district=7, leg_body='US-REP'):\r\n\r\n district_file = get_district_geojson_filename(\r\n state=state, district=district, leg_body=leg_body)\r\n geojson_path = 'static/geojson/' \r\n state = \"{0:0>2}\".format(state)\r\n district = \"{0:0>2}\".format(district...
[ "0.51435786", "0.5060452", "0.5042644", "0.50079465", "0.50066674", "0.4934583", "0.4906796", "0.48551863", "0.48342174", "0.48276514", "0.48184407", "0.47778517", "0.4752442", "0.4740819", "0.47388965", "0.4708768", "0.4708768", "0.4708768", "0.4708768", "0.4708768", "0.4708...
0.5460917
0
Carga los datos en una matriz virtual.
def obtenerCodigos(self): listado = [] columnaCodigos = self.Hoja.col(1) for i, c in enumerate(columnaCodigos): if self.patronCodigo.match(c.value.strip()) != None: contenido = {} fila = self.Hoja.row(i) contenido["codigo"] = fila[1].value.strip() contenido["localidad"] = fila[2].value.strip() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process(self, mat):", "def inicializar_tablero(self):\n\n cont_pixels_x = 0 # Para contar los pixeles en x, y tenerlos como referencia en la casilla correspondiente\n cont_pixels_y = 0 # Para contar los pixeles en y, y tenerlos como referencia en la casilla correspondiente\n ...
[ "0.5794498", "0.5604141", "0.559151", "0.5584371", "0.54417795", "0.54280925", "0.53887373", "0.52649343", "0.5252468", "0.5251203", "0.52439296", "0.52343273", "0.5227572", "0.5213526", "0.52045697", "0.52024114", "0.5180278", "0.5143329", "0.5140579", "0.5092611", "0.508244...
0.0
-1
Find approved Local Group for User based on Affiliations and Roles
def find_local_group_by_user(user): """Find affiliation for approved group with non-empty roles""" if hasattr(user, 'localgroupprofile'): local_group_profile = user.localgroupprofile # TODO: support multiple group affiliations? local_group_affiliation = LocalGroupAffiliation.objects.fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def approve_me_group(message):\n users = hf.get_users()\n sender_id = message._get_user_id()\n\n for user in users:\n if user[\"id\"] == sender_id:\n if (user[\"approval_level\"] == \"unapproved\"):\n message.reply(Strings['APPROVE_ME_REQUEST'])\n else:\n ...
[ "0.56001335", "0.5562444", "0.5394826", "0.5330982", "0.5330448", "0.52975655", "0.52975655", "0.52913195", "0.5282262", "0.52379805", "0.52347904", "0.5206128", "0.5173483", "0.5135821", "0.5120979", "0.5120678", "0.51147497", "0.5096916", "0.50951266", "0.5092302", "0.50867...
0.7091184
0
Get Affiliation for Local Group, otherwise None
def get_affiliation_for_local_group(self, local_group): affiliation = self.localgroupaffiliation_set.filter( local_group=local_group ).first() return affiliation
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_local_group_by_user(user):\n\n \"\"\"Find affiliation for approved group with non-empty roles\"\"\"\n if hasattr(user, 'localgroupprofile'):\n local_group_profile = user.localgroupprofile\n # TODO: support multiple group affiliations?\n local_group_affiliation = LocalGroupAffili...
[ "0.63540494", "0.56002915", "0.53682905", "0.5253615", "0.5183216", "0.5118596", "0.5111766", "0.5097221", "0.50937724", "0.5056007", "0.5025186", "0.50088257", "0.49927133", "0.49780655", "0.49780655", "0.49780655", "0.49780655", "0.49780655", "0.49780655", "0.4931689", "0.4...
0.7823385
0
Get Affiliations for Local Group Role
def get_affiliations_for_local_group_role_id(self, local_group_role_id): affiliations = self.localgroupaffiliation_set.filter( local_group_roles=local_group_role_id ) return affiliations
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_affiliation_for_local_group(self, local_group):\n affiliation = self.localgroupaffiliation_set.filter(\n local_group=local_group\n ).first()\n return affiliation", "def getRoles(self):", "def get_granted_roles(self):", "def get_roles(role):", "def getRoleInfo(self, r...
[ "0.6443044", "0.5803436", "0.56780136", "0.5676261", "0.55866474", "0.5524369", "0.5498116", "0.54259", "0.54050255", "0.537135", "0.53391683", "0.5308558", "0.5215137", "0.5186496", "0.51822263", "0.51781356", "0.514466", "0.5111531", "0.50909424", "0.5088191", "0.5073385", ...
0.7087874
0
Get Affiliation and check if any Role has permission
def has_permission_for_local_group(self, local_group, permission): affiliation = self.get_affiliation_for_local_group(local_group) if affiliation: for role in affiliation.local_group_roles.all(): if role.has_permission(permission): return True ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_granted_roles(self):", "def get_everyone_granted(self):", "def has_permission(self, request, view):\n classroom_id = view.get_related_classroom_id()\n return models.OrganizationAccess.objects.filter(\n **self.role_filter,\n organization__playlists__classrooms__id=cla...
[ "0.631585", "0.6202307", "0.6124932", "0.6025372", "0.6019463", "0.6019463", "0.60174704", "0.6017422", "0.5904694", "0.5859971", "0.5859971", "0.58589804", "0.58207655", "0.5818452", "0.5817845", "0.57995033", "0.57822394", "0.5770664", "0.5770578", "0.5766735", "0.5762725",...
0.0
-1
Verify if user has all permissions for local group
def has_permissions_for_local_group(self, local_group, permissions): for permission in permissions: if not self.has_permission_for_local_group( local_group, permission ): return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_call_permission_for_local_group(user, local_group, permission):\n\n \"\"\"Check Feature Access and Local Group Permissions\"\"\"\n if hasattr(user, 'localgroupprofile'):\n local_group_profile = user.localgroupprofile\n if has_call_feature_access_for_local_group(local_group):\n ...
[ "0.72938764", "0.7188845", "0.7178073", "0.7147893", "0.7076484", "0.70290804", "0.69174296", "0.68604577", "0.6854978", "0.68198705", "0.68117577", "0.68110144", "0.67625076", "0.6760685", "0.67337173", "0.6719916", "0.67017484", "0.6683048", "0.66474944", "0.6646154", "0.66...
0.7626319
0
determine whether it is the time match the value
def is_cron(date, cron): for value in cron: match = True sp = value.split() if len(sp) != 5: continue for item in zip(sp, ['minute', 'hour', 'day', 'month', 'week']): if not match_one_slot(date, *item): match = False break ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _matchTime(self, time: float):\n return self._comparator['Time'] < time", "def is_time(self) -> bool:\n return self.times > 1", "def check_time():\n times = get_times()\n time_difference = abs((times['local'] - times['target']).total_seconds())\n return time_difference < post_time_to...
[ "0.7932951", "0.7081564", "0.6943009", "0.6732508", "0.6701646", "0.6625867", "0.66120315", "0.66054475", "0.6548123", "0.6528006", "0.65005785", "0.6489311", "0.6469224", "0.6447675", "0.64441067", "0.6416212", "0.6372087", "0.6372087", "0.63624656", "0.6337099", "0.6295595"...
0.0
-1
called by is_cron determine one type of format value is a string like '/5' or '2' or ''
def match_one_slot(now, value, slot_type): n = getattr(now, slot_type) if slot_type != 'week' else ((now.weekday() + 1) % 7) for area in value.split(','): sp = area.split('/') mod = int(sp[1]) if len(sp) > 1 else 1 mod_start = 0 pattern = sp[0] sp = pattern.split('-') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cron_validator(value: str) -> str:\n try:\n croniter(value)\n return value\n except ValueError as e:\n raise ValueError(f\"Invalid cron expression: {e}\")", "def _convert_value_type_phantom(value: str) -> Any:\n float_regexes = [r'\\d*\\.\\d*[Ee][-+]\\d*', r'-*\\d*\\.\\d*']\n ...
[ "0.6175953", "0.61083525", "0.60954404", "0.5807934", "0.57584554", "0.5745843", "0.57443875", "0.57112896", "0.5705848", "0.5654694", "0.5537839", "0.55081826", "0.55081826", "0.5490227", "0.54891634", "0.5483027", "0.54803103", "0.5464592", "0.5455121", "0.5388687", "0.5387...
0.0
-1
Get the temperature and humidity readings from the DHT22
def get_temp(): count = 0 while True: # Temp output = subprocess.check_output( ["/home/andy/python/bitbucket/pitemp/Adafruit_DHT", "2302", "4"]) count += 1 print ("Attempt %s: %s") % (count, output) temp_match = re.search("Temp =\s+([0-9.]+)", output) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDHT():\n dht_humidity, cels = Adafruit_DHT.read(DHT_TYPE, DHT_PIN)\n if cels and dht_humidity:\n dht_temp = cels_fahr(cels)\n else:\n checkDebug(\"*** Unable to get DHT values! ***\")\n dht_temp = 0\n dht_humidity = 0\n return dht_temp, dht_humidity", "def getReadin...
[ "0.80469584", "0.7289412", "0.7213233", "0.71664774", "0.7082346", "0.7033855", "0.70154285", "0.6909565", "0.69016886", "0.68563807", "0.67824906", "0.6751205", "0.6674529", "0.66686547", "0.6618873", "0.6603632", "0.65937096", "0.659243", "0.6579795", "0.657381", "0.6572413...
0.7513158
1
using openweathermap, get the tempertare at time of call
def get_external_temp(): baseurl = "http://api.openweathermap.org/data/2.5/weather" query = "?q=salhouse&mode=xml" url = baseurl + query r = requests.get(url) root = ET.fromstring(r.text) kelvin = float(root[1].attrib.get('value')) celcius = kelvin - 272.15 return celcius
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetWeatherByLocation():\n Location = GetLocation()\n WeatherUrl =\"http://api.openweathermap.org/data/2.5/weather?\"+ Location +\"&appid=b4bacbe2dc824431289800439f1ec3df&units=metric\"\n WeatherRequest = requests.get(WeatherUrl)\n WeatherInfo = WeatherRequest.json()\n pprint(WeatherInfo)\n Wi...
[ "0.73430747", "0.7219593", "0.70897", "0.70270735", "0.7026885", "0.7024297", "0.69723505", "0.6922745", "0.6915942", "0.6911002", "0.6752948", "0.67127615", "0.6671463", "0.6656679", "0.66137683", "0.65941185", "0.65843254", "0.65228355", "0.6494854", "0.64923435", "0.649100...
0.70066583
6
write our data to a google spreadsheet
def write_to_gdocs(temp, ext_temp, humidity): # Account details for google docs email = 'andy.christmas@gmail.com' password = 'oknifzuxspiwyobt' spreadsheet = 'pitemp' # Login with your Google account try: gc = gspread.login(email, password) except: print "Unable to log in. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_to_google_doc(garage_name):\n credentials = get_credentials()\n http = credentials.authorize(httplib2.Http())\n discoveryUrl = ('https://sheets.googleapis.com/$discovery/rest?'\n 'version=v4')\n service = discovery.build('sheets', 'v4', http=http,\n ...
[ "0.7423907", "0.7285951", "0.69080824", "0.67927396", "0.66957605", "0.64543587", "0.6417485", "0.63839656", "0.6382554", "0.6335684", "0.6277677", "0.62326854", "0.62056553", "0.61578435", "0.61242294", "0.6038023", "0.59626985", "0.5898779", "0.589671", "0.5867132", "0.5859...
0.71502435
2
Do not return anything, modify board inplace instead.
def solve(self, g: List[List[str]]) -> None: n = len(g) m = len(g[0]) for i in range(n): for j in range(m): if g[i][j] == 'O': g[i][j] = ' ' def dfs(x, y): g[x][y]='O' for nx, ny in (x+1,y),(x-1,y),(x,y+1),(x,y-1): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def applyMove(self, (from_row,from_col), (to_row,to_col)):\n newboard = deepcopy(self)\n piece = newboard.board[from_row][from_col]\n newboard.board[from_row][from_col] = None\n newboard.board[to_row][to_col] = piece\n newboard.toplay = 'BLACK' if self.toplay == 'WHITE' else 'WHI...
[ "0.7664789", "0.70971596", "0.70476234", "0.7024398", "0.69861203", "0.6829364", "0.6778242", "0.6727011", "0.66938925", "0.6692377", "0.6625323", "0.6625323", "0.65893996", "0.6565318", "0.6564258", "0.65587217", "0.6539339", "0.65249294", "0.65223134", "0.6520972", "0.65202...
0.0
-1
Returns the current running version of the NarrativeMethodStore.
def ver(self, context=None): return self._client.call_method( 'NarrativeMethodStore.ver', [], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_version(self):\n raise NotImplementedError(\"get_current_version is not implemented\")", "def get_current_version(self) -> str:\n raise NotImplementedError()", "def version(self):\n return self.get_current_version()", "def get_current_version(self):\n current_v...
[ "0.6512809", "0.63084924", "0.61486477", "0.6109447", "0.60974246", "0.60258347", "0.6008531", "0.5985272", "0.59202164", "0.588994", "0.5848776", "0.5826109", "0.581803", "0.5815346", "0.57916784", "0.5784185", "0.5784185", "0.57801336", "0.5741982", "0.5714112", "0.56952345...
0.67785263
0
Simply check the status of this service to see what Spec repository it is using, and what commit it is on
def status(self, context=None): return self._client.call_method( 'NarrativeMethodStore.status', [], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_api_repo_status_get(self):\n default_api = DefaultApi(api_client=self.api_client)\n params = dlrnapi_client.Params2()\n path, method = default_api.api_repo_status_get(params)\n self.assertEqual(path, '/api/repo_status')\n self.assertEqual(method, 'GET')", "def repo_inf...
[ "0.6290309", "0.61508894", "0.60253596", "0.60048544", "0.60048544", "0.59942687", "0.5931565", "0.5881851", "0.5874795", "0.58716065", "0.581333", "0.5795904", "0.57705116", "0.57519764", "0.5674119", "0.56673056", "0.56659055", "0.5664796", "0.565564", "0.5643056", "0.56372...
0.0
-1
Initiaization of an agent
def __init__(self, name='Custom_Q1'): self.equity_alive = 0 self.actions = [] self.last_action_in_stage = '' self.temp_stack = [] self.name = name self.autoplay = True self.model = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def agent_init(self):\n pass", "def Init(self, agentEnv):\n self.agentEnv = agentEnv", "def init(self,agent,env,init_agent=True,init_env=True):\n self.agent = agent\n self.env = env\n env.sim = self\n agent.sim = self\n if init_env and 'init' in dir(env): env.in...
[ "0.8951175", "0.7957733", "0.78189933", "0.7702978", "0.7676049", "0.7395348", "0.7351769", "0.7303888", "0.7244825", "0.7209048", "0.7170026", "0.71536285", "0.71505994", "0.6998607", "0.6944967", "0.6930277", "0.692447", "0.69098514", "0.6903294", "0.6844676", "0.67983186",...
0.0
-1
initiate a deep Q agent
def initiate_agent(self, nb_actions): self.model = Sequential() self.model.add(Dense(512, activation='relu', input_shape=env.observation_space)) # pylint: disable=no-member self.model.add(Dropout(0.2)) self.model.add(Dense(512, activation='relu')) self.model.add(Dropout(0.2)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, state_size, action_size, seed, verbose=False, **kwargs):\n\n # Set agent class variables\n self.t_step = 0\n self.name = kwargs.get('name', 'dqn_agent')\n self.run_id = kwargs.get('run_id', int(time.time()))\n self.output = kwargs.get('output', \n Pa...
[ "0.63848686", "0.63155115", "0.62402976", "0.6093653", "0.6084465", "0.605853", "0.6046808", "0.5912488", "0.5911071", "0.5867974", "0.57739097", "0.57384944", "0.5736225", "0.5723581", "0.57170814", "0.57157934", "0.5702523", "0.56985986", "0.56985986", "0.5696703", "0.56675...
0.0
-1
Mandatory method that calculates the move based on the observation array and the action space.
def action(self, action_space, observation, info): # pylint: disable=no-self-use,unused-argument _ = (observation, info) # not using the observation for random decision action = None # decide if explore or explot # forward # save to memory # backward # decid...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move(self, action):\n ligne = self.location_[0] + self.actions_[action][0]\n column = self.location_[1] + self.actions_[action][1]\n newLocation = (ligne, column)\n self.location_ = newLocation\n newState = (self.location_[0] * self.width ) + self.location_[1]\n\n if s...
[ "0.71843594", "0.7148835", "0.6950665", "0.6886336", "0.6754202", "0.6627188", "0.656436", "0.6517572", "0.6510112", "0.6508334", "0.64900416", "0.6472217", "0.6470072", "0.6412494", "0.6408156", "0.63610137", "0.63610137", "0.63369983", "0.6327728", "0.63103485", "0.62928414...
0.5917045
62
Returns a list of dicts with information about the known hosts.
def get_hosts_info(fritz_connection): result = [] index = 0 while index < int(fritz_connection.call_action(service_name='Hosts1', action_name='GetHostNumberOfEntries')['NewHostNumberOfEntries']): host = fritz_connection.call_action( service_name='Hosts1', action_name='GetGenericHostEntry...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_hosts_info(self):\n result = []\n index = 0\n while index < self.host_numbers:\n host = self.get_generic_host_entry(index)\n result.append({\n 'ip': host['NewIPAddress'],\n 'name': host['NewHostName'],\n 'mac': host['Ne...
[ "0.81384796", "0.7985254", "0.7883518", "0.77191", "0.7698054", "0.7652779", "0.75794536", "0.7463888", "0.7463888", "0.744163", "0.74139315", "0.7349807", "0.7320968", "0.73131204", "0.7303293", "0.7303293", "0.72887516", "0.71810454", "0.7142172", "0.7123331", "0.711269", ...
0.72933143
16
Turn dictionary into a table definition for insert / update
def get_table_def(dict_in, db_in): meta = MetaData(db_in) val_mapping = { 'pressure': Integer, 'temperature': Float, 'humidity': Float, 'battery': Integer, 'colorTemperature': Integer, } val_type = val_mapping.get(dict_in['name'], String) table...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_table_insert_command_from_dict(table, dict):\n sql = 'INSERT OR REPLACE INTO ' + table\n sql += ' ('\n sql += ','.join(dict.keys())\n sql += ') VALUES ('\n sql += ','.join(map(wrap_with_strings, dict.values()))\n sql += ');'\n return sql", "def insertFromDict(table, dict):\n sql =...
[ "0.7155662", "0.71258026", "0.6667329", "0.65658313", "0.6420979", "0.6384658", "0.6334637", "0.6307397", "0.6301272", "0.62599754", "0.6255697", "0.62162805", "0.61943555", "0.6179605", "0.61544657", "0.615358", "0.61356205", "0.6111473", "0.6109597", "0.6108918", "0.6085554...
0.74472284
0
Helper function to get dimension and activation at every layer.
def get_dim_act_curv(args): if not args.act: act = lambda x: x else: act = getattr(F, args.act) acts = [act] * (args.num_layers - 1) dims = [args.feat_dim] + ([args.dim] * (args.num_layers - 1)) if args.task in ['lp', 'rec']: dims += [args.dim] acts += [act] n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_layer_units_and_activation(num_classes):\n\n if num_classes == 2:\n activation = 'sigmoid'\n units = 1\n else:\n activation = 'softmax'\n units = num_classes\n return units, activation", "def __find_net_dims(self):\n\n input_params = INPUT_CHANNELS * INPUT...
[ "0.66866094", "0.6563066", "0.649521", "0.64911073", "0.6467558", "0.6388287", "0.6290154", "0.6276665", "0.626234", "0.6150908", "0.61501795", "0.61420166", "0.6097287", "0.6096627", "0.6094242", "0.6094008", "0.608809", "0.6067222", "0.6047609", "0.60404927", "0.60219836", ...
0.0
-1
load requirements from a pip requirements file
def parse_requirements(filename): lineiter = (line.strip() for line in open(filename)) return [line for line in lineiter if line and not line.startswith("#")]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_requirements():\n reqs_path = path.join('.', 'requirements.txt')\n with open(reqs_path, 'r') as f:\n requirements = [line.rstrip() for line in f]\n return requirements", "def parse_requirements_from_pipfile():\n lineiter = (line.strip() for line in open('Pipfile'))\n requirements_p...
[ "0.7208096", "0.71944356", "0.71887195", "0.7140441", "0.7139842", "0.70933205", "0.7042971", "0.7024391", "0.7011328", "0.69305325", "0.6918911", "0.69032866", "0.69032866", "0.6902263", "0.6824025", "0.6822713", "0.68031853", "0.6721816", "0.67179585", "0.67171687", "0.6677...
0.0
-1
function to run simulated annealing with locking parameters of interest to estimate confidence intervals (see Avni 1976)
def param_locked_SA(fn, *x, **kwargs): num_steps=int(kwargs.get("num_steps",10)) #num of locked values to test/param max_steps=int(kwargs.get("max_steps",400)) #max num iterations for chi2_lim=int(kwargs.get("chi2_lim",4)) param_ranges={k:v for k,v in kwargs.iteritems() if not k in "max_steps chi2_lim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run():\n trials = 100\n\n multipliers = [0.25, 0.3, 0.35, 0.5, 0.75, 1, 1.25, 1.45, 1.5, 1.55, 1.6] # Coefficients for learning rate\n\n mean_penalty = []\n median_penalty = []\n std_penalty = []\n\n mean_trial_time = []\n median_trial_time = []\n std_trial_time = []\n\n mean_success...
[ "0.639129", "0.6058943", "0.5970634", "0.5945297", "0.58814967", "0.5872302", "0.578764", "0.57837385", "0.57783204", "0.57097524", "0.56957453", "0.56942284", "0.56926584", "0.5692271", "0.566857", "0.56545794", "0.5608923", "0.5578606", "0.55784506", "0.55730087", "0.551097...
0.5902709
4
Data comes from the statistics module so we know what columns to extract.
def make_cumulative_distr_plot(data): x = data.index y = data["cumprop"] plot = go.Bar(x=x, y=y, showlegend=False) return plot
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collect_data_stats(data):\n # We re-import this module here because this code will run\n # remotely.\n \n stats_0 = data.shape[0]\n stats_1 = data.sum(axis=0)\n stats_2 = (data**2).sum(axis=0)\n retval = (\n stats_0,\n stats_1,\n stats_2\n )\n return retval", ...
[ "0.6484838", "0.6460287", "0.6440635", "0.6405562", "0.6365789", "0.6240767", "0.62230766", "0.61519736", "0.61396885", "0.6130455", "0.6072003", "0.60497946", "0.59280187", "0.592497", "0.584765", "0.5842835", "0.58196837", "0.58196837", "0.58172494", "0.58029133", "0.578339...
0.0
-1
Return all the results.
def results(self): return self._result_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getResults():", "def results(self):\n pass", "def results(self):\r\n pass", "def returnAll(self):\n try:\n # self.checkValName()\n self.conn.execute(self.query, self.val)\n self.results = self.cursor.fetchall()\n except Exception as e:\n ...
[ "0.82004106", "0.80559415", "0.78920054", "0.78862983", "0.7812203", "0.7789513", "0.7789513", "0.7782172", "0.76648796", "0.7646572", "0.758851", "0.75599325", "0.7545099", "0.7463143", "0.7463143", "0.7463143", "0.7448202", "0.74450177", "0.7416247", "0.7414506", "0.7344550...
0.766413
9
Return the ideal heavy outputs dictionary.
def heavy_outputs(self): return self._heavy_outputs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def outputs(self):\n\t\treturn {k: v * self.throughput for k, v in self.per_process_outputs.items()}", "def _get_output_dictionary(self):\n\n return_dictionary = {}\n\n for output_path in self.provided_outputs:\n return_dictionary[output_path.full_path] = self.get_value(output_path)\n\n ...
[ "0.71540225", "0.66443044", "0.6476039", "0.63870174", "0.63750595", "0.62371063", "0.61654824", "0.5891897", "0.58325523", "0.5820708", "0.5816429", "0.5775973", "0.5712373", "0.5689303", "0.5686148", "0.5658862", "0.56549037", "0.56337756", "0.5616627", "0.55943936", "0.558...
0.74387336
0
Return the number of heavy output counts as measured.
def heavy_output_counts(self): return self._heavy_output_counts
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_total_n_cpu(self) -> int:", "def get_num_measured_outputs(self):\n i = 0\n for o in self.outputs:\n if o.is_measured_output():\n i += 1\n return i", "def get_load_factor(self):\n # Your code here\n return self.count/len(self.data)", "def co...
[ "0.71255594", "0.69156873", "0.691443", "0.6907816", "0.6891827", "0.6658858", "0.6616153", "0.65334684", "0.64919555", "0.64853454", "0.6436298", "0.6350555", "0.6333117", "0.63138413", "0.62498355", "0.6235761", "0.62287235", "0.6218069", "0.62089247", "0.6206654", "0.62056...
0.86212903
0
Return the heavy output probability ideally.
def heavy_output_prob_ideal(self): return self._heavy_output_prob_ideal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def heavy_output_counts(self):\n return self._heavy_output_counts", "def calculate_probability(self):\n return 0", "def get_raw_probability(self):\n\t\tproba = RunOrder.BASE_SUCCESS_PROBABILITY\n\t\tproba += (self.additional_percents + self.hidden_percents) * 10\n\t\treturn proba", "def _sample...
[ "0.6726189", "0.6637995", "0.65333253", "0.6518991", "0.64057547", "0.62862617", "0.62339973", "0.62322354", "0.6227328", "0.621576", "0.62151796", "0.6209667", "0.6204549", "0.61985916", "0.6196905", "0.60965973", "0.60711235", "0.6070062", "0.604483", "0.6011984", "0.598720...
0.82184976
0
Return the average and std of the output probability.
def ydata(self): return self._ydata
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mean_and_std(arr):\r\n return np.round(np.mean(arr), 3), np.round(np.std(arr), 3)", "def meanstd(self):\n\t\tmean = [125.3, 123.0, 113.9] # R,G,B\n\t\tstddev = [63.0, 62.1, 66.7] # R,G,B\n\t\treturn [mean, stddev]", "def std(self):\n variance, mean = self.variance()\n standard_deviatio...
[ "0.70449084", "0.7043109", "0.6978316", "0.6852284", "0.6841782", "0.66968536", "0.6690958", "0.66258425", "0.6623504", "0.66085225", "0.65911907", "0.657682", "0.65750706", "0.65664196", "0.655174", "0.65426177", "0.6504903", "0.6488045", "0.6473558", "0.64526904", "0.644693...
0.0
-1
Add the ideal results and convert to the heavy outputs. Assume the result is from 'statevector_simulator'
def add_statevectors(self, new_statevector_result): if new_statevector_result is None: return if not isinstance(new_statevector_result, list): new_statevector_result = [new_statevector_result] for result in new_statevector_result: for qvcirc in result.resul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def optimize(self):\n self.vbe_step()\n self.compute_responsibilities()\n self.compute_sufficient_stats()\n self.vbmstep()", "def run_step_blackbox_optimizer(config,\n current_input,\n blackbox_optimizer,\n ...
[ "0.63052976", "0.6089504", "0.60357183", "0.6035258", "0.6003312", "0.5961215", "0.5948271", "0.58839226", "0.5879852", "0.58772993", "0.5877175", "0.5877175", "0.5875996", "0.58399993", "0.5806366", "0.58054745", "0.57685876", "0.5761752", "0.5757717", "0.5743019", "0.574125...
0.715707
0
Add a new result. Re calculate fit
def add_data(self, new_backend_result, rerun_fit=True): if new_backend_result is None: return if not isinstance(new_backend_result, list): new_backend_result = [new_backend_result] for result in new_backend_result: self._result_list.append(result) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_result(params, new_result):\r\n ret = load_results(params)\r\n ret[\"evaluations\"].append(new_result)\r\n for m in params.metrics:\r\n if m not in ret[\"best_results\"] or \\\r\n new_result['result'][m] > ret['best_results'][m]['result'][m]:\r\n ret[\"best_results...
[ "0.6892044", "0.67279345", "0.6616967", "0.64829034", "0.63191", "0.63128453", "0.6259763", "0.62043417", "0.6196137", "0.61875445", "0.61663514", "0.61645406", "0.61546844", "0.6143772", "0.6133166", "0.6111425", "0.60890394", "0.6085135", "0.6066645", "0.60634667", "0.60536...
0.7006938
0
Make a count dictionary for each unique circuit from all the results. Calculate the heavy output probability.
def calc_data(self): circ_counts = {} for trialidx in range(self._ntrials): for _, depth in enumerate(self._depths): circ_name = 'qv_depth_%d_trial_%d' % (depth, trialidx) # get the counts form ALL executed circuits count_list = [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculates_results_stats(results_dic): \n # Creates empty dictionary for results_stats_dic\n results_stats_dic = dict()\n \n # Sets all counters to initial values of zero so that they can \n # be incremented while processing through the images in results_dic \n results_stats_dic['n_dog...
[ "0.61174583", "0.5979128", "0.59502864", "0.59438497", "0.588107", "0.5872179", "0.5854523", "0.5853185", "0.5838517", "0.582985", "0.5792049", "0.5788493", "0.5747312", "0.57070863", "0.5683165", "0.56690836", "0.5651664", "0.56500936", "0.5638528", "0.56252235", "0.5620967"...
0.7440842
0
Convert the heavy outputs in the different trials into mean and error for plotting. Here we assume the error is due to a binomial distribution. Error (standard deviation) for binomial distribution is sqrt(np(1p)), where n is the number of trials (self._ntrials) and p is the success probability (self._ydata[0][depthidx]...
def calc_statistics(self): self._ydata = np.zeros([4, len(self._depths)], dtype=float) exp_vals = np.zeros(self._ntrials, dtype=float) ideal_vals = np.zeros(self._ntrials, dtype=float) for depthidx, depth in enumerate(self._depths): exp_shots = 0 for trialidx...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_average(self, error=None):\n\n nbjobs = len(self)\n if not nbjobs:\n return\n max_xsec = max(one.xsec for one in self)\n min_xsec = min(one.xsec for one in self)\n self.axsec = sum([one.axsec for one in self]) / nbjobs\n self.xsec = sum([one.xsec for...
[ "0.5766995", "0.56980366", "0.5663932", "0.5614797", "0.5601893", "0.5589843", "0.55717117", "0.54917", "0.5472309", "0.5471716", "0.54600525", "0.5459562", "0.54394954", "0.5420097", "0.54192245", "0.5417687", "0.54014593", "0.53909767", "0.5388067", "0.53818923", "0.5379945...
0.57208174
1
Plot the qv data as a function of depth
def plot_qv_data(self, ax=None, show_plt=True): if not HAS_MATPLOTLIB: raise ImportError('The function plot_rb_data needs matplotlib. ' 'Run "pip install matplotlib" before.') if ax is None: plt.figure() ax = plt.gca() xdata = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plotTimeDepth(d,v):\n\n dpth,t = getTimeDepth(d,v)\n plt.figure(num=0, figsize = (6, 4))\n plt.plot(dpth,t,linewidth=2);\n plt.title('Depth-Time');\n plt.grid()\n plt.gca().set_xlabel('Depth (m)',fontsize=9)\n plt.gca().set_ylabel('Two Way Time (s)',fontsize=9)\n\n plt.tight_layout()\n ...
[ "0.6400747", "0.6309371", "0.5897968", "0.5883097", "0.5827929", "0.57120794", "0.5667824", "0.56546575", "0.5633852", "0.5633506", "0.5629356", "0.5629136", "0.55853975", "0.55837226", "0.5576259", "0.5524679", "0.5516089", "0.55156636", "0.54890054", "0.5484", "0.5473993", ...
0.60016423
2
Return whether each depth was successful (> 2/3 with confidence level > 0.977 corresponding to z_value = 2) and the confidence level.
def qv_success(self): success_list = [] confidence_level_threshold = self.calc_confidence_level(z_value=2) for depth_ind, _ in enumerate(self._depths): success_list.append([False, 0.0]) hmean = self._ydata[0][depth_ind] sigma = self._ydata[1][depth_ind] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_confidence_level(self, z_value):\n\n confidence_level = 0.5 * (1 + math.erf(z_value/2**0.5))\n\n return confidence_level", "def test_depth_known(our_bsts):\n assert our_bsts[0].depth() == our_bsts[1]", "def depth_check(self, depth):\r\n if depth >= self.ply:\r\n retu...
[ "0.63002855", "0.59713274", "0.56828445", "0.5625449", "0.5499978", "0.53820795", "0.5372017", "0.53469354", "0.5323189", "0.5317821", "0.52830386", "0.52818173", "0.52780604", "0.52708024", "0.52566534", "0.520605", "0.5182075", "0.5137559", "0.5129822", "0.5129321", "0.5120...
0.7041239
0
Calculate z value using mean and sigma.
def calc_z_value(self, mean, sigma): if sigma == 0: # assign a small value for sigma if sigma = 0 sigma = 1e-10 warnings.warn('Standard deviation sigma should not be zero.') z_value = (mean - 2/3) / sigma return z_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zvalue(value, sigma, mu):\n return (value - mu) / sigma", "def st(self, sigma, z):\n \n aa = self.params[0]\n a = self.params[1]\n p = self.params[2]\n delta_c = self.params[3]\n \n return aa * sqrt(2.e0*a/pi) * (delta_c/sigma) * exp( (-a*delta_c*delta_c) / (2.e0*sigma*sigma) )*(1.e0 ...
[ "0.8171789", "0.7375456", "0.72756827", "0.7109719", "0.7064882", "0.70063514", "0.6902822", "0.6774692", "0.6765704", "0.6713272", "0.6691268", "0.66450894", "0.66226393", "0.6510892", "0.6501101", "0.6431476", "0.64067405", "0.63954693", "0.6350348", "0.63368845", "0.630019...
0.8530953
0
Calculate confidence level using z value. Accumulative probability for standard normal distribution in [z, +infinity] is 1/2 (1 + erf(z/sqrt(2))), where z = (X mu)/sigma = (hmean 2/3)/sigma
def calc_confidence_level(self, z_value): confidence_level = 0.5 * (1 + math.erf(z_value/2**0.5)) return confidence_level
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def z_score(num, mean, std_dev):\n\treturn (num - mean) / std_dev", "def ztest(x, sigma, mu0, tail=\"both\"):\n z = (np.mean(x) - mu0) / (sigma * np.sqrt(len(x)))\n if tail == \"both\":\n return 1 - gaussian_cdf(abs(z))\n elif tail == \"lower\":\n return 1 - gaussian_cdf(-z)\n elif tail...
[ "0.715361", "0.6694587", "0.66217506", "0.65117896", "0.64892626", "0.64612925", "0.6436323", "0.63603866", "0.63508487", "0.63461494", "0.6304591", "0.6231899", "0.6225367", "0.6213088", "0.618859", "0.6163113", "0.6139677", "0.6118483", "0.6117616", "0.6099324", "0.6080637"...
0.780776
0
Return the volume for each depth.
def quantum_volume(self): qv_list = 2**np.array(self._depths) return qv_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def volume(self):\n return [node.volume for node in self]", "def liquid_depth_from_volume(self, volume):\n pass", "def get_volumes(self, dim):\n cdef np.ndarray[float64, mode='c', ndim=1] out\n\n if dim == 0:\n raise ValueError('vertices have no volume!')\n\n else:...
[ "0.7146934", "0.70729226", "0.6740552", "0.6670343", "0.6596108", "0.6588211", "0.6556776", "0.6515275", "0.64560103", "0.62961024", "0.62239367", "0.62239367", "0.62239367", "0.62217087", "0.62002766", "0.6194247", "0.61679393", "0.6157088", "0.61398983", "0.61199176", "0.61...
0.67647994
2
Return the set of heavy output strings.
def _heavy_strings(self, ideal_distribution, ideal_median): return list(filter(lambda x: ideal_distribution[x] > ideal_median, list(ideal_distribution.keys())))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def heavy_outputs(self):\n return self._heavy_outputs", "def warmup():\n return ''", "def warmup():\n return ''", "def warmup():\n return ''", "def heavy_output_counts(self):\n return self._heavy_output_counts", "def warmup():\n\treturn ''", "def warmup():\n\treturn ''", "def g...
[ "0.6685322", "0.60754466", "0.60754466", "0.60754466", "0.60534275", "0.5970344", "0.5970344", "0.5633713", "0.5552471", "0.5551753", "0.5551753", "0.55019474", "0.54330987", "0.5421413", "0.5420922", "0.53687084", "0.53495884", "0.53442305", "0.53319967", "0.53194577", "0.53...
0.5743243
7
Return a list of median probabilities.
def _median_probabilities(self, distributions): medians = [] for dist in distributions: values = np.array(list(dist.values())) medians.append(float(np.real(np.median(values)))) return medians
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_median(numlist):\n return np.median(numlist)", "def samples_median(samples):\n return [np.median(s) for s in samples.T]", "def samples_median(samples):\n return [np.median(s) for s in samples.T]", "def test_median():\n\tnt.assert_equal(median([1]),1)\n\tnt.assert_equal(median([36,1]),37/2)\n...
[ "0.73932344", "0.72494096", "0.72494096", "0.710843", "0.7065595", "0.703823", "0.6990909", "0.69747156", "0.68316686", "0.6797866", "0.6795603", "0.67906797", "0.67541087", "0.6665891", "0.664005", "0.66362786", "0.66300714", "0.6621718", "0.66211194", "0.6590604", "0.657295...
0.8528012
0
Return the probability of a subset of outcomes.
def _subset_probability(self, strings, distribution): return sum([distribution.get(value, 0) for value in strings])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prob_choice(p):\n \n return np.random.random_sample() < p", "def _get_selection_probabilities(self):\r\n probabilities = np.arange(1, self.population_size+1, dtype=float)[::-1]\r\n probabilities /= probabilities.sum()\r\n return probabilities", "def probability(p):\n return p ...
[ "0.6821689", "0.67696875", "0.6436847", "0.64071983", "0.6406339", "0.63569266", "0.63522875", "0.6315154", "0.6314635", "0.6299025", "0.6292079", "0.62745064", "0.6267829", "0.62092435", "0.62041795", "0.6172376", "0.617028", "0.61331636", "0.61071104", "0.61071104", "0.6101...
0.59165615
39
Constructor ui reference to the main window (UserInterface) parent reference to the parent widget (QWidget)
def __init__(self, ui, parent=None): super(LogViewer, self).__init__(parent) self.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) self.__ui = ui self.__logViewer = LogViewerEdit(self) from .SearchWidget import SearchWidget self.__searchWidget ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, parent=None):\n super(MainWindow, self).__init__(parent)\n self.setupUi(self)", "def __init__(self, parent=None):\n super(MainWindow, self).__init__(parent)\n self.setupUi(self)", "def __init__(self, parent=None):\n super(MainWindow, self).__init__(parent)\...
[ "0.82350004", "0.82350004", "0.82350004", "0.82350004", "0.82350004", "0.8185358", "0.8032135", "0.79948115", "0.7969998", "0.79270154", "0.7819043", "0.7819043", "0.773617", "0.75984144", "0.74537635", "0.74435335", "0.7442315", "0.7403857", "0.73323625", "0.730685", "0.7301...
0.6493565
93
Public slot to appand text to the "stdout" tab. txt text to be appended (string)
def appendToStdout(self, txt): added = self.__logViewer.appendToStdout(txt) if added: self.__ui.showLogViewer()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def OutputWritten(self, text):\n QCoreApplication.processEvents()\n curr_time = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))\n cursor = self.textBrowser.textCursor()\n cursor.movePosition(cursor.End)\n cursor.insertText(curr_time + \" \"+ text + \"\\n\")\n ...
[ "0.7482801", "0.7261511", "0.7244599", "0.720063", "0.7188345", "0.718575", "0.7184656", "0.71401066", "0.69680303", "0.68485945", "0.679058", "0.67819744", "0.67572594", "0.675322", "0.67429894", "0.6706542", "0.6696108", "0.66819763", "0.6659889", "0.6647642", "0.6574028", ...
0.671469
15
Public slot to appand text to the "stderr" tab. txt text to be appended (string)
def appendToStderr(self, txt): added = self.__logViewer.appendToStderr(txt) if added: self.__ui.showLogViewer()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def appendToStderr(self, txt):\n if self.__filterMessage(txt, isErrorMessage=True):\n return False\n \n self.__appendText(txt, isErrorMessage=True)\n QApplication.processEvents()\n return True", "def write(self, text):\n text = text.rstrip()\n self.fh.w...
[ "0.7090004", "0.6849034", "0.66713625", "0.6516882", "0.64910644", "0.6442643", "0.6423258", "0.63393724", "0.6339147", "0.6331438", "0.6298789", "0.6186379", "0.61783814", "0.6166383", "0.6135533", "0.6119889", "0.6112705", "0.61096954", "0.6097498", "0.60961694", "0.6094443...
0.7113195
0
Public slot to handle a change of the preferences.
def preferencesChanged(self): self.__logViewer.preferencesChanged()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preferencesChanged(self):\n # do nothing\n pass", "def on_preference(self, widget, data=None):\n print \"This feature will be implemented soon\"", "def settings_changed(self, name, value):\n return", "def on_preferences(self, evt):\n # Passing `self` sets the main windo...
[ "0.836825", "0.696788", "0.69385743", "0.6643918", "0.66390264", "0.6639006", "0.662247", "0.63510144", "0.62935555", "0.6276403", "0.5999134", "0.595508", "0.59206355", "0.58903795", "0.5876009", "0.5861567", "0.5837277", "0.58289695", "0.5823236", "0.5754941", "0.5744263", ...
0.74983895
1
Public method to display the search widget. txt text to be shown in the combo (string)
def showFind(self, txt=""): self.__searchWidget.showFind(txt)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_btn_clicked(self, widget, data=None):\n # Method to handle search here.\n search_text = self.get_text(\"txt_search\")\n print search_text", "def show(self, txt=\"\"):\n if self.project and self.project.isOpen():\n self.projectButton.setEnabled(True)\n else...
[ "0.7130795", "0.67692786", "0.66564894", "0.6606529", "0.6601016", "0.6525232", "0.64659023", "0.62841177", "0.62814045", "0.62212634", "0.62060475", "0.61433583", "0.6109773", "0.6086807", "0.6080016", "0.60007834", "0.5988855", "0.5972837", "0.5971392", "0.5954917", "0.5953...
0.74640363
0
Constructor parent reference to the parent widget (QWidget)
def __init__(self, parent=None): super(LogViewerEdit, self).__init__(parent) self.setAcceptRichText(False) self.setLineWrapMode(QTextEdit.NoWrap) self.setReadOnly(True) self.__mainWindow = parent self.__lastSearch = () # create the context menu ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(self, parent):\n self.widget = QtCore.QObject(parent)", "def __init__(self, parent=None):\n super(Dialog, self).__init__(parent)\n self.setupUi(self)", "def __init__(self, parent=None):\n super(QCTP, self).__init__(parent)\n self.setupUi(self)", "def __init__(sel...
[ "0.7972963", "0.78757006", "0.78260714", "0.7736561", "0.7736561", "0.7710844", "0.76728547", "0.76728547", "0.76728547", "0.76728547", "0.76728547", "0.7637473", "0.7616171", "0.7532309", "0.751696", "0.7494485", "0.7493463", "0.7466432", "0.7432897", "0.7411248", "0.7399342...
0.0
-1
Private slot to show the context menu. coord the position of the mouse pointer (QPoint)
def __handleShowContextMenu(self, coord): coord = self.mapToGlobal(coord) self.__menu.popup(coord)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aboutToShowContextMenuEvent(self):\n\t\tpass", "def contextMenuEvent(self, event):\n menu = QMenu()\n self.action_options.add_to_context_menu(menu)\n menu.exec_(event.globalPos()) # show menu at mouse position", "def _contextMenu(self, pos):\n # Create the context menu\n ...
[ "0.75065196", "0.7436941", "0.72276735", "0.7113408", "0.6953456", "0.6902781", "0.67719257", "0.67107254", "0.6703465", "0.66487324", "0.6640975", "0.66332203", "0.660269", "0.65667784", "0.6547808", "0.65213984", "0.6477128", "0.64716405", "0.64531463", "0.6429861", "0.6425...
0.77717066
0
Private method to append text to the end. txt text to insert (string) isErrorMessage flag indicating to insert error text (boolean)
def __appendText(self, txt, isErrorMessage=False): tc = self.textCursor() tc.movePosition(QTextCursor.End) self.setTextCursor(tc) if isErrorMessage: self.setCurrentCharFormat(self.cErrorFormat) else: self.setCurrentCharFormat(self.cNormalFormat) se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_text(self, text):\n self.str += text", "def appendToStderr(self, txt):\n if self.__filterMessage(txt, isErrorMessage=True):\n return False\n \n self.__appendText(txt, isErrorMessage=True)\n QApplication.processEvents()\n return True", "def appendT...
[ "0.6722547", "0.66592216", "0.6510563", "0.64271134", "0.64247394", "0.63934827", "0.6375307", "0.63571197", "0.62390053", "0.61722606", "0.6146331", "0.61434925", "0.6101763", "0.6097587", "0.60783285", "0.60442173", "0.60272783", "0.6019607", "0.6007922", "0.5957822", "0.59...
0.8345409
0
Private method to filter messages. message message to be checked (string) isErrorMessage flag indicating to check an error message (boolean) flag indicating that the message should be filtered out (boolean)
def __filterMessage(self, message, isErrorMessage=False): message = Utilities.filterAnsiSequences(message) if isErrorMessage: filters = self.__stderrFilter + self.__stdxxxFilter else: filters = self.__stdoutFilter + self.__stdxxxFilter for msgFilter in fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_filter_messages_non_message(self):\n pass", "def test_filter_messages(self):\n pass", "def filter_msg(filter_id, message_event):\n\n # Get Filter dictionary from database\n filter_dict = MessageFilter.get_filter(filter_id)\n if filter_dict == False:\n logg...
[ "0.7443896", "0.7188733", "0.6862448", "0.6229173", "0.6100408", "0.6090096", "0.60198677", "0.60012406", "0.5910933", "0.5826428", "0.5755305", "0.5703322", "0.5652608", "0.54677546", "0.5449713", "0.54274654", "0.54244184", "0.5418442", "0.5385313", "0.5383934", "0.53787565...
0.7593951
0
Public slot to appand text to the "stdout" tab. txt text to be appended (string) flag indicating text was appended (boolean)
def appendToStdout(self, txt): if self.__filterMessage(txt, isErrorMessage=False): return False self.__appendText(txt, isErrorMessage=False) QApplication.processEvents() return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def OutputWritten(self, text):\n QCoreApplication.processEvents()\n curr_time = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))\n cursor = self.textBrowser.textCursor()\n cursor.movePosition(cursor.End)\n cursor.insertText(curr_time + \" \"+ text + \"\\n\")\n ...
[ "0.70400643", "0.7015361", "0.7013764", "0.70053005", "0.68868065", "0.688227", "0.6823797", "0.681689", "0.6801883", "0.6796628", "0.6590792", "0.6586444", "0.6567516", "0.65234804", "0.65059614", "0.64641756", "0.63731325", "0.63181657", "0.63092464", "0.6303457", "0.629153...
0.69117224
4
Public slot to appand text to the "stderr" tab. txt text to be appended (string) flag indicating text was appended (boolean)
def appendToStderr(self, txt): if self.__filterMessage(txt, isErrorMessage=True): return False self.__appendText(txt, isErrorMessage=True) QApplication.processEvents() return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def appendToStderr(self, txt):\n added = self.__logViewer.appendToStderr(txt)\n if added:\n self.__ui.showLogViewer()", "def appendToStdout(self, txt):\n if self.__filterMessage(txt, isErrorMessage=False):\n return False\n \n self.__appendText(txt, isError...
[ "0.7131635", "0.69916844", "0.65884924", "0.6549952", "0.64397687", "0.63425803", "0.6304723", "0.62501556", "0.6219554", "0.62107515", "0.61767924", "0.61755544", "0.6130405", "0.612813", "0.60715383", "0.60263234", "0.60234535", "0.5950326", "0.5940821", "0.5916329", "0.590...
0.748794
0
Public slot to handle a change of the preferences.
def preferencesChanged(self): self.cErrorFormat.setForeground( QBrush(Preferences.getUI("LogStdErrColour"))) self.__stdoutFilter = Preferences.getUI("LogViewerStdoutFilter") self.__stderrFilter = Preferences.getUI("LogViewerStderrFilter") self.__stdxxxFilter = Prefer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preferencesChanged(self):\n # do nothing\n pass", "def preferencesChanged(self):\n self.__logViewer.preferencesChanged()", "def on_preference(self, widget, data=None):\n print \"This feature will be implemented soon\"", "def settings_changed(self, name, value):\n return...
[ "0.836825", "0.74983895", "0.696788", "0.69385743", "0.6643918", "0.66390264", "0.6639006", "0.662247", "0.63510144", "0.62935555", "0.6276403", "0.5999134", "0.595508", "0.59206355", "0.58903795", "0.5876009", "0.5861567", "0.5837277", "0.58289695", "0.5823236", "0.5754941",...
0.5380965
57
Private method to open the configuration dialog.
def __configure(self): e5App().getObject("UserInterface").showPreferences("logViewerPage")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure(self):\n dlg = ConfigureDialog(QtGui.QApplication.activeWindow().currentWidget())\n dlg.identifierOccursCount = self._identifierOccursCount\n\n if dlg.exec_():\n self._config = dlg.getConfig()\n dlg.setConfig(self._config)\n dlg.validate()\n dlg.se...
[ "0.7398324", "0.7382618", "0.7198106", "0.7065822", "0.68237156", "0.6805797", "0.6776057", "0.6762591", "0.6651452", "0.66366065", "0.65517604", "0.64832693", "0.64487994", "0.6366388", "0.63451636", "0.6292334", "0.62853116", "0.62831134", "0.6249468", "0.62483114", "0.6236...
0.58736664
43
Private slot to show the find widget.
def __find(self): txt = self.textCursor().selectedText() self.__mainWindow.showFind(txt)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showFind(self, txt=\"\"):\n self.__searchWidget.showFind(txt)", "def showSearchWidget(self):\n self.__replaceWidget.hide()\n self.__searchWidget.show()\n self.__searchWidget.show(self.textForFind())", "def showReplaceWidget(self):\n self.__searchWidget.hide()\n sel...
[ "0.7884159", "0.77857125", "0.7361547", "0.6747991", "0.67186236", "0.67044073", "0.6603263", "0.6467566", "0.64356214", "0.6360518", "0.63409036", "0.6309805", "0.62796915", "0.62747115", "0.6253527", "0.61946625", "0.6164726", "0.61540496", "0.61296016", "0.61011505", "0.60...
0.7261589
3
Public method to search the next occurrence of the given text. txt text to search for str caseSensitive flag indicating to perform a case sensitive search bool wholeWord flag indicating to search for whole words only bool regexp flag indicating a regular expression search bool
def searchNext(self, txt, caseSensitive, wholeWord, regexp): self.__lastSearch = (txt, caseSensitive, wholeWord, regexp) flags = QTextDocument.FindFlags() if caseSensitive: flags |= QTextDocument.FindCaseSensitively if wholeWord: flags |= QTextDocument.FindWholeWo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search(self, word):", "def searchPrev(self, txt, caseSensitive, wholeWord, regexp):\n self.__lastSearch = (txt, caseSensitive, wholeWord, regexp)\n flags = QTextDocument.FindFlags(QTextDocument.FindBackward)\n if caseSensitive:\n flags |= QTextDocument.FindCaseSensitively\n ...
[ "0.72954684", "0.7041482", "0.69674814", "0.68977845", "0.67025536", "0.67025536", "0.6673565", "0.6507456", "0.64674175", "0.6399412", "0.6399412", "0.6386298", "0.6366086", "0.6335018", "0.62625635", "0.62615824", "0.6250894", "0.61997473", "0.6198586", "0.6180251", "0.6164...
0.8265198
0
Public method to search the previous occurrence of the given text. txt text to search for str caseSensitive flag indicating to perform a case sensitive search bool wholeWord flag indicating to search for whole words only bool regexp flag indicating a regular expression search bool
def searchPrev(self, txt, caseSensitive, wholeWord, regexp): self.__lastSearch = (txt, caseSensitive, wholeWord, regexp) flags = QTextDocument.FindFlags(QTextDocument.FindBackward) if caseSensitive: flags |= QTextDocument.FindCaseSensitively if wholeWord: flags |=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def searchNext(self, txt, caseSensitive, wholeWord, regexp):\n self.__lastSearch = (txt, caseSensitive, wholeWord, regexp)\n flags = QTextDocument.FindFlags()\n if caseSensitive:\n flags |= QTextDocument.FindCaseSensitively\n if wholeWord:\n flags |= QTextDocument....
[ "0.7309876", "0.6953325", "0.6770723", "0.6280625", "0.6257286", "0.61789984", "0.6094383", "0.6067818", "0.60331005", "0.60331005", "0.5976145", "0.5943898", "0.5943898", "0.5899375", "0.5889473", "0.5876788", "0.58638805", "0.5851523", "0.5833547", "0.58262193", "0.5814099"...
0.8197999
0
Protected method handling key press events. evt key press event (QKeyEvent)
def keyPressEvent(self, evt): if evt.modifiers() == Qt.ControlModifier: if evt.key() == Qt.Key_F: self.__find() evt.accept() return elif evt.key() == Qt.Key_C: self.copy() evt.accept() return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _on_key_press(self, event):", "def keyPressEvent(self, event):\n self.game_engine.input_manager.keyPressEvent(event)", "def key_press_event(self, event):\n pass", "def _on_key_release(self, event):", "def keyPressEvent(self, event):\n if type(event) == QtGui.QKeyEvent:\n ...
[ "0.8021571", "0.79255205", "0.78411543", "0.76083416", "0.7573805", "0.7522604", "0.7464646", "0.74589956", "0.74232554", "0.7396078", "0.7387043", "0.7385233", "0.72452533", "0.7222583", "0.7205222", "0.7179626", "0.71417075", "0.7135096", "0.7130467", "0.7126081", "0.712549...
0.6345191
71
Return a callback that sets the player's choice.
def create_callback(throw, rand=False): obj = self r = rand def wrapped(widget): """Set the player's throw.""" if r: obj.player_choice = random.choice(list(evilrps.Throws)) else: # print(widget, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SelectPlayer(self):\n\n player = input(data['player'])\n if player == \"1\":\n return 0\n elif player == \"2\":\n return 1\n else:\n return 'invalid'", "def choose(self, choice):\n if self.available(choice):\n self.select(choice)"...
[ "0.608662", "0.5984766", "0.5920916", "0.584878", "0.56991035", "0.5676789", "0.5674178", "0.56540287", "0.5653703", "0.5614996", "0.5610299", "0.5587594", "0.5587594", "0.55697864", "0.5551329", "0.5529739", "0.55192184", "0.5471437", "0.5465435", "0.54512185", "0.5445069", ...
0.5996838
1
Set the player's throw.
def wrapped(widget): if r: obj.player_choice = random.choice(list(evilrps.Throws)) else: # print(widget, 'throw', throw) obj.player_choice = throw obj.advance()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def throw(self, currentplayer):\n\t\tif self.roll_speed < 2000:\n\t\t\tself.roll()\n\t\t\tpygame.time.set_timer(STOP_DIE, self.roll_speed)\n\t\t\tself.roll_speed = round(self.roll_speed**1.53)\n\t\telse:\n\t\t\t# Die is still. Call roll one last time and set the number\n\t\t\tprint(\"die is still\")\n\t\t\tself.nu...
[ "0.65709543", "0.601663", "0.5953763", "0.5794381", "0.5505258", "0.5496749", "0.5469549", "0.5466819", "0.54637325", "0.5406805", "0.5403799", "0.53923684", "0.5384944", "0.5324972", "0.52134234", "0.51807", "0.51762146", "0.5167459", "0.51670873", "0.51628953", "0.51511955"...
0.6507764
1
Advance the rps game state.
def advance(self): self.game.advance() print(self.game.scores, 'predicted:', self.ai.move(None))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def advance(self):\n self._state = self._next_state", "def advance_stage(self):\n if self.stage == 0:\n self.curr_i = self.I\n elif self.stage == 1:\n self.curr_d = self.D\n elif self.stage == 2:\n self.curr_r == self.R", "def advance_state_machine()...
[ "0.6842811", "0.6789772", "0.64858675", "0.64496166", "0.6409055", "0.638327", "0.63207763", "0.6268779", "0.62569475", "0.61562276", "0.6127646", "0.6104714", "0.6080776", "0.60701704", "0.60344154", "0.59827906", "0.5969602", "0.59635156", "0.5930304", "0.5925497", "0.59034...
0.638971
5
Completely reset the game.
def reset(self, *args): self.state = GameStates.playing self.human = evilrps.Player('Human', self.get_player_choice) self.ai = evilrps.Player('AI', evilrps.create_ai()) self.game = evilrps.Game(self.human, self.ai)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\n\n game.reset()\n sm.get_screen('game_screen').reset()", "def reset_game(self):\n self.bHasWon = False\n self.game_over = False\n self.game_active = False\n self.player_points = 0\n self.enemy_points = 0\n self.remainingBalls = 0", "def ...
[ "0.89050704", "0.82614374", "0.81766", "0.81052315", "0.80964696", "0.8023091", "0.8023091", "0.80088645", "0.79854536", "0.7885862", "0.78433055", "0.7837507", "0.78110635", "0.77500886", "0.77500886", "0.77440757", "0.7739373", "0.7739373", "0.7739373", "0.7737097", "0.7728...
0.78635454
10
Returns the (X, Y, Z) coordinates of the selected planet, based on the approximated orbital elements stored in the ssb_data subdirectory.
def planet_position_ecliptic(epoch, planet='Earth'): Teph0 = 2451525.0 - 2400000.5 spp = ssb_planet_positions[planet] sma = spp['sma'] + spp['sma-dot'] * (epoch - Teph0) / 36525 ecc = spp['ecc'] + spp['ecc-dot'] * (epoch - Teph0) / 36525 inc = spp['inc'] + spp['inc-dot'] * (epoch - Teph0) / 3...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extractCoords(self):\n if not self.rank:\n logging.info('Extracting atomic poitions')\n\n # Extract coordinates from liggghts\n self.lmp.command('variable x atom x')\n x = Rxn.lmp.extract_variable(\"x\", \"group1\", 1)\n\n self.lmp.command('variable y atom y')\n y = Rxn.lmp.extract_varia...
[ "0.6475528", "0.63765836", "0.6246942", "0.58566284", "0.5681731", "0.561328", "0.561173", "0.5607087", "0.55989844", "0.5598273", "0.5591495", "0.55538386", "0.5547111", "0.5540559", "0.5540559", "0.55231494", "0.5523089", "0.55014765", "0.54945064", "0.54685754", "0.5449557...
0.59425086
3
Returns the components of a unit vector pointing in the direction of a pulsar, given its ecliptic coordinates.
def pulsar_position_ecliptic(ecl_beta, ecl_lambda): b = ecl_beta * d2r l = ecl_lambda * d2r return np.array([np.cos(b) * np.cos(l), np.cos(b) * np.sin(l), np.sin(b)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _velocity_cylindrical2cartesian(pos,vel):\n \n \n #save cartesian position of each particle\n theta=pos[:,1]\n\n #save cyindrical velocities\n vr=vel[:,0]\n vtheta=vel[:,1]\n vz=vel[:,2]\n\n #compute cartesian velocities\n vx = vr*np.cos(theta) - vtheta*np.sin(theta)\n vy = vr*...
[ "0.632112", "0.61373264", "0.61305547", "0.60959405", "0.60692185", "0.6038618", "0.6021945", "0.60091394", "0.5999259", "0.59942216", "0.5973342", "0.596096", "0.595709", "0.5954926", "0.5946866", "0.5887819", "0.58393794", "0.5838806", "0.58021325", "0.5777013", "0.57634085...
0.0
-1
Gets a value depending on the type
def __getitem__(self, item: tp.Union[str, Port, Block]): from blox.core.port import Port from blox.core.block import Block # For block it returns the block state if isinstance(item, Block): return self._block_states[item] # For ports its returns the port value (if a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, key, default=None, type=None):\n if key not in self:\n return default\n value = self[key]\n if type is not None:\n value = type(value)\n return value", "def type(self, value):\n return value", "def get_value(self, *args, **kwargs) -> Option...
[ "0.7243727", "0.7098295", "0.7058654", "0.6919209", "0.6867007", "0.67963964", "0.6788333", "0.6744703", "0.6739587", "0.66799533", "0.66526216", "0.6598322", "0.65327364", "0.6527443", "0.6474913", "0.6466382", "0.64621156", "0.64370406", "0.64132726", "0.6412232", "0.640525...
0.0
-1
The display names for the layout, keyed by locale.
def get_display_names(self): return self.display_names
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unit_display_names(self) -> localedata.LocaleDataDict:\n return self._data['unit_display_names']", "def __addDisplayNames(self, tree):\n \n display = self.__getStore(self.__data, \"display\")\n \n for key in [\"languages\", \"scripts\", \"territories\", \"variants\", \"keys...
[ "0.65902203", "0.63141036", "0.59343654", "0.5896136", "0.5887964", "0.571129", "0.5668694", "0.5665444", "0.56587344", "0.5622306", "0.5622306", "0.5622306", "0.5532029", "0.5532029", "0.5532029", "0.5532029", "0.5532029", "0.5532029", "0.5532029", "0.5532029", "0.5532029", ...
0.68131506
0
The decimal key. Nominally a '.' or ','.
def get_decimal(self): return self.decimal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _key(self):\n return self._base_currency, self._quote_currency", "def comma(self, key):\n\n if \"~\" in key or key == \"title\": v = self(key, u\"\")\n else: v = self.get(key, u\"\")\n if isinstance(v, int): return v\n elif isinstance(v, float): return v\n else: retu...
[ "0.6343967", "0.6244802", "0.59830934", "0.5963279", "0.5771395", "0.5763239", "0.5757519", "0.5678802", "0.5640032", "0.55916613", "0.554849", "0.5544409", "0.5524648", "0.54881525", "0.5486991", "0.54867923", "0.5470435", "0.54458165", "0.54252225", "0.53635424", "0.5348248...
0.5621652
9
An override for space keys on some OSes. Keyed by target.
def get_space(self): return self.space
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def action_space(self):\n raise NotImplementedError", "def _newKey(self, key):\n pass", "def setup_space_keys(cls):\n if cls.KEYS:\n return\n\n from pkg_resources import iter_entry_points\n\n for entry_point in iter_entry_points(group=cls.CATKIN_SPACES_GROUP):\n ...
[ "0.55596", "0.54498404", "0.5355201", "0.52229035", "0.5219056", "0.51753014", "0.51325864", "0.5125508", "0.5094069", "0.5094069", "0.5070225", "0.5040799", "0.50238055", "0.5005845", "0.4960309", "0.49433982", "0.49389476", "0.49339324", "0.4911114", "0.49085042", "0.490843...
0.0
-1
Dead keys present, keyed by layer code.
def get_dead_keys(self): return self.dead_keys
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _KeyMissing(side):\n return 'Key missing from %s' % side", "def __missing__(self, key):\n global MISSING\n MISSING = key # For debugging - save name of missing key\n return INVALID", "def check_keys(self):", "def nonull_dict(self):\n return {k: v for k, v in self.dict.items(...
[ "0.6184343", "0.6163819", "0.60199106", "0.59758276", "0.5957718", "0.5918987", "0.590742", "0.5805495", "0.57982516", "0.57472", "0.56828254", "0.56575924", "0.55706435", "0.5555966", "0.5551071", "0.55498147", "0.553602", "0.5524895", "0.5492279", "0.5481055", "0.5466095", ...
0.7085765
0
The items to be shown when a key is longpressed. Values are space separated in one string.
def get_longpress(self): return self.longpress
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_menu(self):\n return ', '.join(menu.name for menu in self.menu.all()[:3])", "def large_list_display(keyval: str, record: dict, title: str):\n if keyval in record:\n if len(record[keyval]):\n res = \", \".join(t[\"value\"].title() for t in record[keyval])\n res =...
[ "0.5640079", "0.5445398", "0.54022485", "0.53781897", "0.5216053", "0.51973593", "0.51728255", "0.5163935", "0.51503533", "0.51231754", "0.5043115", "0.5041491", "0.5036622", "0.50175095", "0.5008519", "0.49813303", "0.4977073", "0.49757114", "0.49716103", "0.49562913", "0.49...
0.57792985
0
The chain of inputs necessary to provide an output after a deadkey is pressed. Keyed by each individual input.
def get_transforms(self): return self.transforms
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def input_pipe():\n x = ''\n while True:\n x = yield x\n yield # to keep the generator in lock step with input", "def getInput(self):\n\t\tkeyPressed = self.screen.getch()\n\t\tif keyPressed == 113:\t\t# <escape>\n\t\t\tself.terminate()\n\t\t\tself.running = False\n\t\treturn...
[ "0.58133096", "0.54694873", "0.54534346", "0.54528296", "0.54200315", "0.5354491", "0.5294017", "0.5281807", "0.5273875", "0.52114314", "0.5192176", "0.51811224", "0.51698774", "0.51678205", "0.5164294", "0.5162319", "0.51345146", "0.51119673", "0.5111289", "0.5074566", "0.50...
0.0
-1
Strings to be shown on some OSes
def get_strings(self): return self.strings
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n # return self.text + r'(' + self.os_type + r')'\n return self.text", "def str_info(self):\n return \"\"", "def _getDiagnosticString():\n text = '\\n## Diagnostic output from minimalmodbus ## \\n\\n'\n text += 'Minimalmodbus version: ' + __version__ + '\\n'\n t...
[ "0.66682065", "0.66339743", "0.6589484", "0.64419574", "0.641821", "0.63756377", "0.62500685", "0.6244203", "0.6181548", "0.6174325", "0.61551094", "0.6135339", "0.60749084", "0.60699975", "0.6056397", "0.60540384", "0.6035675", "0.60164315", "0.6002382", "0.5998069", "0.5978...
0.0
-1
The actual locale within Windows, as per their broken ISO 6393 scheme or secret hardcoded lists.
def get_locale(self): return self.locale
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_locale():\n return \"he\"", "def get_locale():\n return babel.Locale.parse(_get_locale())", "def get_locale(self):\n raise Unimplemented()", "def get_current_locale(self) -> str:\n return self.locale", "def get_locale():\n if (session.get(\"language\") is not None):\n ...
[ "0.8170935", "0.74171996", "0.73266846", "0.72431475", "0.7204481", "0.71956164", "0.69699496", "0.6927595", "0.6870211", "0.6692858", "0.66917896", "0.66642165", "0.66637677", "0.65771824", "0.6489513", "0.6489513", "0.639199", "0.6304806", "0.62689406", "0.6267389", "0.6267...
0.73260343
3
The language name to be cached, in order to try to mask the ugly ISO code name that often shows.
def get_language_name(self): return self.language_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def language_name(value):\n return pycountry.languages.get(alpha_2=value)", "def get_full_language(self, language):\n if language:\n language = pycountry.languages.get(alpha_2=language)\n if language:\n language = language.name\n return language.title...
[ "0.75973505", "0.7356066", "0.71743286", "0.7026327", "0.6870655", "0.6802082", "0.6762619", "0.6721745", "0.6658814", "0.6624989", "0.65874517", "0.6509002", "0.6431443", "0.64213145", "0.6367904", "0.6357529", "0.6356453", "0.6338784", "0.6312103", "0.6305461", "0.63022894"...
0.71839124
2
Minimum SDK can be specified for a specific layout
def get_minimum_sdk(self): return self.minimum_sdk
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_sdk():", "def patch_sdk():", "def patch_sdk():", "def LayoutExtension_getDefaultVersion():\n return _libsbml.LayoutExtension_getDefaultVersion()", "def getDefaultVersion():\n return _libsbml.LayoutExtension_getDefaultVersion()", "def _is_supported_version(cls, sdk: WindowsSDK) -> bool:\...
[ "0.5549726", "0.5549726", "0.5549726", "0.5302558", "0.5261856", "0.5232488", "0.51780313", "0.51780313", "0.5163853", "0.5131185", "0.5089466", "0.5065264", "0.5031135", "0.50159204", "0.49809512", "0.49809512", "0.49733624", "0.49484175", "0.49484143", "0.49197415", "0.4899...
0.6702781
0
Initializes the PPM auctioneer.
def __init__(self, use_price_token=False, token_duration=10): self._res_man = ResourceManagerSim() self._revenue = 0 self._expenses = 0 # If freezing prices for some time... self._use_price_token = use_price_token self._history_lock = Lock() self._hist_q = Priorit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, bidders, item, starting_price):\n self._bidders = bidders\n self._item = item\n self._starting_price = starting_price\n self._auctioneer = Auctioneer(self._bidders, self._starting_price)", "def __init__(self, bidders):\n self._bidders = bidders\n self....
[ "0.70375913", "0.6652079", "0.6631571", "0.6515782", "0.63053185", "0.63053185", "0.63053185", "0.6213423", "0.6186894", "0.6186894", "0.6186894", "0.6186894", "0.6186894", "0.6146217", "0.61441207", "0.6132294", "0.612012", "0.612012", "0.6060765", "0.60542196", "0.6038398",...
0.0
-1
Returns a list of perunit prices for each resource.
def get_price_list(self): # Fetch the resource info then get a copy of it self._res_man.collect_resource_info() res_list = self._res_man.get_resource_info() # Pack the price response! price_response = PriceResponse() for res in res_list: price = res.post_price...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_prices(self):\n pass", "def get_prices(self):\n price = self.get_price()\n if price:\n return [price]\n return []", "def pricing_tiers(self):\n return self._pricing_tiers", "def dishlist_prices(n: list) -> list:\r\n return [dish.price for dish in n]", ...
[ "0.6714753", "0.6411341", "0.5797565", "0.5681848", "0.5652119", "0.55678576", "0.5514863", "0.54805094", "0.54659945", "0.54233706", "0.54232615", "0.5406653", "0.53926927", "0.53788614", "0.53477395", "0.5330629", "0.52775955", "0.52491933", "0.5243184", "0.5242636", "0.523...
0.66409034
1
Causes timedependent updates to be performed, if any.
def evolve_time(self): if isinstance(self._res_man, ResourceManagerSim): # If our resource manager has simulated aspects, then evolve the # simulation self._res_man.evolve_time() # Update price histories, if needed if self._use_price_token: t = tim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dummy_update( self ):\r\n pass", "async def _async_forced_update(self, _now):\n await self.async_update(True)", "def maybe_schedule_update(self):\n if self.hass and not self._update_scheduled:\n self.hass.add_job(self._schedule_update)", "def acUpdate(deltaT):#------------...
[ "0.6980316", "0.6804522", "0.66973734", "0.66435385", "0.6616813", "0.66162574", "0.6601037", "0.65447533", "0.65447533", "0.6490595", "0.6448297", "0.6433478", "0.6414337", "0.6356438", "0.63531363", "0.6352944", "0.6352944", "0.6344273", "0.6343252", "0.631912", "0.6315999"...
0.0
-1
Returns the current price of the given bundle.
def _compute_bundle_price(self, bundle): details = '' # 1. Build a mapping from resource-specific info to price res_to_price_map = self._res_man.get_res_to_price_mapping() if self._use_price_token and bundle.has_price_token(): # Use token if enabled & provided. If token has e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def price(self) -> float:\n if self.product:\n price = self.product.prices.filter(active=True).first()\n return int(price.unit_amount / 100)\n return -1", "def get_product_price(product):\n return latest_product_version(product).price", "def get_price(self):\r\n re...
[ "0.69588786", "0.67926645", "0.6792079", "0.67808473", "0.67808473", "0.67808473", "0.6713399", "0.6700769", "0.66505605", "0.6636159", "0.66124856", "0.65355116", "0.65275353", "0.65275353", "0.6403931", "0.63826656", "0.63824165", "0.6373656", "0.63707584", "0.63482493", "0...
0.77867067
0
Returns True if the bundle is feasible, otherwise False. If False, a reason for infeasibility is returned as well. Feasibility pertains to
def _bundle_is_feasible(self, bundle): is_feasible = True reason = '' # 1. Build a mapping from resource-specific info to resource record res_to_record_mapping = self._res_man.get_res_to_record_mapping() # 2. Check feasibility of zones zones = bundle.copy_zones() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_feasible(self, reaction: RetroReaction) -> bool:\n feasible, _ = self.feasibility(reaction)\n return feasible", "def check_flag(self):\r\n # Loop over each checking result to see if it is feasible or not\r\n self.flag = True\r\n for key in self.is_feasible.keys():\r\n ...
[ "0.6595232", "0.647888", "0.6157761", "0.6096559", "0.5975216", "0.5878665", "0.584841", "0.5840081", "0.58008516", "0.5754537", "0.57277006", "0.5725054", "0.5685567", "0.5676987", "0.5675551", "0.5673959", "0.5664556", "0.5614692", "0.5601372", "0.5601372", "0.5593105", "...
0.6935166
0
Updates resource usage levels as a result of accepting the given bundle.
def _accept_bundle(self, bundle): duration = bundle.duration supply_cost = 0 # 1. Build a mapping from resource-specific info to resource record res_to_record_mapping = self._res_man.get_res_to_record_mapping() # 2. Add usage for zones zones = bundle.copy_zones() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_resources(self, action, change):\n # Currently we only track total number of resources gained.\n if change.type is ChangeType.LOSS:\n return\n # The type of change should be ChangeType.GAIN if it is not ChangeType.LOSS.\n assert change.type == ChangeType.GAIN\n ...
[ "0.5329043", "0.51712257", "0.5116945", "0.5046905", "0.5043918", "0.49968824", "0.49490806", "0.49222466", "0.4785849", "0.4771061", "0.47685286", "0.47432888", "0.4739252", "0.47347093", "0.47280532", "0.46981636", "0.46888036", "0.4668939", "0.46645257", "0.46629402", "0.4...
0.68926334
0
Do a request and check the signature using our public key verifier.
def request(uri: str, verify: bool = False) -> dict: logger.info(f"Requesting {uri}") try: response = requests.get(uri) except Exception as e: msg = f"Got exception {e} requesting {uri}" logger.debug(msg) raise if response.status_code != 200: msg = f"Got error cod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify(self, signature, body, external_aad, public_key):", "def verify(self):\n if not self.public_key:\n self.fetch_public_key()\n data = self.doc.find(\".//{http://salmon-protocol.org/ns/magic-env}data\").text\n sig = self.doc.find(\".//{http://salmon-protocol.org/ns/magic-e...
[ "0.6396814", "0.6349299", "0.62295365", "0.6210947", "0.6133341", "0.6093118", "0.59670794", "0.5934376", "0.591127", "0.5888875", "0.5883411", "0.577507", "0.57463634", "0.57440543", "0.5724053", "0.5709604", "0.5698415", "0.56949526", "0.56776196", "0.5675322", "0.5673441",...
0.5699221
16
Do an oauth request and check if there are no issues
def oauth_request(oauth: OAuth2Session, uri: str, method: str = 'get'): call = getattr(oauth, method) response = call(uri) if response.status_code != 200: msg = f"Got error code {response.status_code} requesting {uri}" logger.error(msg) raise IOError(msg) return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_oauth(self):\n resp = dict(self.__httprequest.POST.dict())\n orderedresp = OrderedDict(sorted(resp.items(), key=lambda t: t[0]))\n query_string = urllib.urlencode(orderedresp)\n oauth_headers = dict(signature.collect_parameters(query_string, exclude_oauth_signature=False))\n ...
[ "0.715353", "0.6777823", "0.6545526", "0.65246654", "0.6503861", "0.6289855", "0.6267704", "0.6158522", "0.6158522", "0.6142744", "0.6065474", "0.6041998", "0.6039942", "0.60227084", "0.6016405", "0.6006328", "0.59879154", "0.59832644", "0.5980791", "0.59799135", "0.59799135"...
0.627958
6
Return the version of the API.
def get_version(): f = open("version.txt", 'r') version = f.readline().strip('\n') f.close() return jsonify({"version": version})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_version(self):\n return self.api_version", "def get_version(self):\n return self.__make_api_call('get/version')", "def get_api_version(self):\n major, minor, patch = self.client.config['api_version']\n return '%s.%s.%s' % (major, minor, patch)", "def api_version(self):\n\n...
[ "0.90025836", "0.89061993", "0.8716989", "0.8657681", "0.86539876", "0.86539876", "0.86539876", "0.86539876", "0.86539876", "0.86539876", "0.86539876", "0.86539876", "0.86539876", "0.86539876", "0.86539876", "0.86539876", "0.86539876", "0.86539876", "0.86539876", "0.86539876", ...
0.0
-1
Method to know if a user exist or not. Will be used during the registration. Therefor there is no authentication.
def get_user(user_id): db_conn = sqlite3.connect(db_path) db = db_conn.cursor() status = "free" try: for row in db.execute("SELECT username FROM users WHERE username=?", [user_id]): status = "taken" db_conn.close() except sqlite3.IntegrityError: db_conn.close() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_user_existence():\n from sfa_api.utils.storage import get_storage\n storage = get_storage()\n if not storage.user_exists():\n try:\n info = request_user_info()\n except (requests.exceptions.HTTPError, JSONDecodeError):\n return False\n else:\n ...
[ "0.7877361", "0.78142726", "0.77534586", "0.76637346", "0.75764394", "0.7486906", "0.745509", "0.74219614", "0.73705447", "0.7301696", "0.7292554", "0.72660506", "0.72537667", "0.7239692", "0.72176826", "0.7173528", "0.71641886", "0.71169126", "0.71069545", "0.70948565", "0.7...
0.0
-1
Register a new user into the system. A free username and a public key must be provided.
def add_user(): if not request.json: abort(400) db_conn = sqlite3.connect(db_path) db = db_conn.cursor() username = request.json['username'] public_key = request.json['public_key'] try: db.execute("INSERT INTO users (username) VALUES (?)", [username]) db.execute("INSER...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_user():\n pass", "def register():\n (status, userRecord) = cs411_user.registerUser(\n request.form.get('username', 'USER NAME IS MISSING'),\n request.form.get('password', 'PASSWORD IS MISSING'),\n request.form.get('Email', 'EMAIL IS MISSING'),\n request.form.get('UF...
[ "0.76486194", "0.75184065", "0.7350934", "0.72548455", "0.7211615", "0.71909344", "0.7078263", "0.69950366", "0.6975175", "0.69536066", "0.691021", "0.689108", "0.68568265", "0.68518394", "0.68503255", "0.680697", "0.67902875", "0.6782427", "0.6748222", "0.6715007", "0.670487...
0.7488205
2
Return the list of valid public keys of the said user. Must be authenticated to access. Access from everyone.
def get_keys(user_id): db_conn = sqlite3.connect(db_path) db = db_conn.cursor() keys = [] try: for row in db.execute("SELECT public_key FROM public_keys WHERE username=? AND status=?", [user_id, PK_STATUS_OK]): keys.append({"public": row[0]}) db_conn.close() except sqlit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_public_keys():\n return public_keys", "def get_keys(self):\n return list(self.public_keys.keys())", "def get_public_keys(self):\n return self.control_connection.call('get_agents_publickeys')", "def list_user_keys(self):\n return AlgoliaUtils_request(self.headers, self.read_hos...
[ "0.75384676", "0.73028004", "0.6946655", "0.6916864", "0.68987983", "0.6813009", "0.67889047", "0.6687356", "0.6545935", "0.6528826", "0.64058113", "0.63240856", "0.6302718", "0.62851524", "0.62485427", "0.6236034", "0.62176347", "0.6172782", "0.6122093", "0.6115551", "0.6075...
0.7573916
0
Add or revoke a public key. Must be authenticated. Access only from said user.
def update_keys(user_id): if not request.json: abort(400) new_pub_keys = request.json["public_keys"] db_conn = sqlite3.connect(db_path) db = db_conn.cursor() db_pub_keys = [] try: for row in db.execute("SELECT public_key FROM public_keys WHERE username=? AND status=?;", [user_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put(self, id=None):\n key_data = self.request.get('key_data', None)\n if id and key_data:\n id = str(urllib.unquote(id))\n public_key = PublicKey.get_by_id(long(id))\n if public_key:\n public_key.publickey = key_data\n public_key.put(...
[ "0.69506633", "0.6889679", "0.6803422", "0.6688398", "0.6636699", "0.6617013", "0.6614632", "0.66007", "0.6559509", "0.6494737", "0.64211977", "0.64067656", "0.6394275", "0.635394", "0.6291167", "0.62655604", "0.62646776", "0.62606", "0.62560594", "0.61684334", "0.616301", ...
0.6569146
8
Return the list IPs of the said user. Must be authenticated to access. Access only from said user.
def get_endpoints(user_id): db_conn = sqlite3.connect(db_path) db = db_conn.cursor() ips = [] try: for row in db.execute("SELECT ip FROM ips WHERE username=?", [user_id]): ips.append({"address": row[0]}) db_conn.close() except sqlite3.IntegrityError: db_conn.clos...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_ip_list(uid):\r\n session = tables.get_session()\r\n res = []\r\n if session is None:\r\n return res\r\n try:\r\n ip_table = IpAddrs()\r\n res.extend(ip_table.get_ips_by_uid(uid, session))\r\n except SQLAlchemyError as err:\r\n LOGGER.error('Get user ip list fail...
[ "0.795319", "0.666011", "0.6497928", "0.6403793", "0.63878393", "0.63719064", "0.63704145", "0.6297277", "0.62290305", "0.6214081", "0.62139285", "0.61943746", "0.6181467", "0.6174886", "0.61484414", "0.6107543", "0.59926903", "0.59848166", "0.5971071", "0.59601325", "0.59520...
0.7062204
1
Update the list of public IPs. Must be authenticated to access. Access only from said user.
def update_endpoints(user_id): if not request.json: abort(400) new_ips = request.json["ips"] db_conn = sqlite3.connect(db_path) db = db_conn.cursor() db_ips = [] try: for row in db.execute("SELECT ip FROM ips WHERE username=?;", [user_id]): db_ips.append(row[0]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_public_ips(self, available=False):\n raise NotImplementedError", "def ips(self, ips):\n\n self._ips = ips", "def _get_public_ips(self, ec2_ids):\n public_ips = []\n\n for ec2_id in ec2_ids:\n while True:\n response = self.ec2_client.describe_instan...
[ "0.61807686", "0.5956417", "0.58494085", "0.5769545", "0.5759603", "0.57557684", "0.57165754", "0.5652518", "0.5611022", "0.5555582", "0.550084", "0.54947275", "0.5474508", "0.54668987", "0.5459335", "0.5434339", "0.53766274", "0.53693134", "0.5358921", "0.5346657", "0.531700...
0.6376176
0
Require a list of arguments
def launch_test(self): if not self.kwargs_list: raise Exception("Before beginning testing, arguments should be added to the 'kwargs' list by calling " "method 'fill_kwargs_list'.") beginning_time = time() print("********************") self.curs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_args(args):\n return args is not None and len(args) > 0", "def test_require_at_least_one_and_several_provided(self):\n _func = at_least_one_of('arg1', 'arg2')(undecorated_func)\n self.assertEqual(_func('ahoy', 'there'), 'foo')\n self.assertEqual(_func(arg1='ahoy', arg2='there'),...
[ "0.7128091", "0.70020956", "0.6891069", "0.6814578", "0.67912555", "0.677897", "0.67640096", "0.6759186", "0.673653", "0.6700114", "0.6686065", "0.6652981", "0.66316456", "0.6593369", "0.65902126", "0.6559956", "0.65512276", "0.654839", "0.65271443", "0.6523756", "0.64847624"...
0.0
-1
List detailed onchain and channel balance information
def balance(plugin, unit='btc'): if not is_valid_unit(unit): return "Value units are %s" % ', '.join(valid_units) rpc = plugin.rpc data = { 'unit': unit, 'onchain_total_balance': lib.node_stats.onchain_balance(rpc).to(unit), 'onchain_confirmed_balance': lib.node_stats.oncha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def balances():\n loop.run_until_complete(app.exchanges.fetch_balances())\n print(app.exchanges.balances_str)", "def fetch_balance(self, params={}):\n self.load_markets()\n response = self.privateGetAccountBalanceV2(params)\n #\n # {\n # \"AVAILABLE_NIS\": 0.0...
[ "0.65891165", "0.65710926", "0.63991106", "0.6259437", "0.6248992", "0.6130115", "0.6110029", "0.6083231", "0.6082878", "0.60591674", "0.6051145", "0.59900695", "0.58911794", "0.58784384", "0.58672345", "0.5823202", "0.5822904", "0.5795", "0.578415", "0.5768946", "0.5768684",...
0.0
-1
Do not return anything, modify root inplace instead.
def flatten(self, root: TreeNode) -> None: if not root: return None self.flatten(root.right) self.flatten(root.left) root.right = self.prev root.left = None self.prev = root
{ "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.71672195", "0.70915145", "0.7055208", "0.69615245", "0.67885584", "0.66141015", "0.6551368", "0.6512747", "0.6512747", "0.6512747", "0.6512747", "0.6431704", "0.6411715", "0.6395968", "0.6395968", "0.6368781", "0.63604164", "0.6329711", "0.6324841", "0.6305654", "0.6276602...
0.6019179
48
Extract problem number and language from filename.
def parse_filename(f): problem = f[2:5] extension = f.split('.')[-1] if extension not in langs.keys(): # if the extension isn't in our list we don't care about the file return (None, None) return (problem, extension)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_language_from_file_name(filename: str) -> str:\n return Path(filename).resolve().with_suffix(\"\").name", "def get_language(fn):\n # FIXME - this expects the fn to be '.../XX/LC_MESSAGES/messages.po'\n return fn.split(os.sep)[-3]", "def guess_problem(self, path):\n problem, ext = os.pat...
[ "0.65099007", "0.6477955", "0.5991345", "0.5938866", "0.592048", "0.5904813", "0.5881841", "0.586952", "0.58304256", "0.5703422", "0.570281", "0.56935406", "0.56826293", "0.5662054", "0.56574833", "0.5641236", "0.5618889", "0.5614232", "0.5544081", "0.5519197", "0.5504639", ...
0.727911
0
Return the date based on a string
def get_date(datestring): elements = [int(a) for a in re.split("[-/]", "{0}".format(datestring))] if len(elements) == 3: return datetime.date(elements[0], elements[1], elements[2])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_date(self, string):\n # remove new lines\n string = string.replace('\\n', '')\n # first, get first digit - day is then number value of following 2 chars \n firstDigit = re.search('\\d', string)\n day = string[firstDigit.start():firstDigit.start()+2]\n day = ...
[ "0.7944126", "0.7938226", "0.7935511", "0.7503411", "0.7453887", "0.73857206", "0.73674685", "0.7331715", "0.73282623", "0.7153773", "0.7129029", "0.7127417", "0.71102756", "0.710494", "0.7076858", "0.7067842", "0.7044849", "0.7010005", "0.69808936", "0.6917407", "0.6900842",...
0.7813421
3
Creates a type of Student based on the type.
def getStudent(self, studentType, name, year, args): # studentType is either "member" or "officer" # args is the list of arguments for that type of student if studentType.lower() == "member": student = Member(name, year) # args[0] is number of events attended ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_student_and_isa(schema: Dict[Any, Any]) -> ISA:\n student = User.get_user_by_email(schema[\"client\"][\"email\"])\n if not student:\n student = Student.create_user(**schema[\"client\"])\n schema.pop(\"client\")\n schema[\"student_id\"] = student.id\n\n isa = ISA.create_isa(**schema...
[ "0.6547995", "0.6182564", "0.5940756", "0.5895027", "0.5793554", "0.57386863", "0.5712727", "0.566294", "0.56127495", "0.5601429", "0.5539315", "0.5526455", "0.5522167", "0.544809", "0.5425604", "0.5386397", "0.5375305", "0.5346075", "0.533195", "0.5305634", "0.5300623", "0...
0.64118683
1