query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
e7a2f3379f168ddfaf0cb2364bead9d1
Parses fastq file looking for first (identifier) and second (sequence) lines only. Outputs a dictionary in which the key is the identifies and the value is the sequence Useful for downstream processing such as finding all the sequences of a particular length or eliminating sequences with invalid characters
[ { "docid": "528c9a047aa083bba315d5b80e413a8e", "score": "0.68678826", "text": "def parse_fastq(self, file_name):\t\n\t\tfile = open(file_name)\n\t\tfile_content = file.readlines()\n\t\ti = 0\n\t\twhile i < len(file_content):\n\t\t\tif i % 4 == 0:\n\t\t\t\tself.fastq_dict[file_content[i].strip('\\n')] = ...
[ { "docid": "a6f7439dcec856bf127c0d3dc25181c0", "score": "0.71526283", "text": "def parse_fastq(fastq):\n with gzip.open(fastq, 'rb') if fastq.endswith('.gz') else open(fastq, 'r') as f:\n counter = 0\n header = ''\n seq = ''\n qual = ''\n fas...
6095ae754736c9740a4e3ce047fafdc7
Displays the server info if any.
[ { "docid": "f1a1fc5a37110aafc100a88402524f90", "score": "0.6602481", "text": "async def info(self, ctx):\n\n # Check if we're suppressing @here and @everyone mentions\n if self.settings.getServerStat(ctx.message.guild, \"SuppressMentions\"):\n suppress = True\n else:\n ...
[ { "docid": "6e2feebea8ad91bef927d600a232cd0f", "score": "0.7686046", "text": "async def server_info(self, ctx):\r\n try:\r\n server = ctx.message.server\r\n description = \"**Server owner:** {}#{}\\n\".format(server.owner.name, server.owner.discriminator)\r\n desc...
187d2f8ecb05b9da510a34ff96078a2c
Get the poll stats. Fetch all the answers from the JotForm API and convert them to cumilative statistics.
[ { "docid": "debe01e9e473e79dcf0176c0cffc413d", "score": "0.7560663", "text": "async def get_poll_stats(uuid: str):\n credentials = redis.get(uuid)\n if credentials is None:\n raise HTTPError(401, \"Unauthorised request.\")\n app_key, poll_id = credentials.decode(\"utf-8\"...
[ { "docid": "a3a21061c83e3eccdebbeb5612841a12", "score": "0.6668814", "text": "def stats(poll_id):\n \n poll_id = int(poll_id)\n poll = Poll.get_by_id(poll_id)\n return render_template(\"stats.html\", \n choice_a=poll.choice_a, \n choice_b=p...
2f856edd516ea41b56043c18b779c784
Method used for merging the transactions together. A single paypal payment is often translated into multiple transactions (e.g. conversion to foreign currency means +2 transactions). As this is a redundant information for us, we'd like to merge this into a single record.
[ { "docid": "9e04f7b2e1c283576dec06245eac7afb", "score": "0.5725072", "text": "def combine_transactions(trx_data):\n result = {}\n bar = ChargingBar('3/3 Merging trx ', max=len(trx_data.keys()), suffix = '%(percent).1f%% - %(eta)ds remaining')\n for i in sorted(trx_data.keys()):\n # Fir...
[ { "docid": "32b3fdd5a2519df39368ae454f3f83c8", "score": "0.6524009", "text": "def merge_transactions(base, new):\n\n result = base\n\n # Check the fields one-by-one\n for i in range(max(len(base), len(new))):\n # Generic element handling\n try:\n if result[i] == \"\":\n...
e1ab27fa6412f3971e20f851c2ccf3ef
Give the user the option of automatically copying an encrypted/decrypted string to the Windows clipboard if Windows is the OS running on the user's computer.
[ { "docid": "57b0ac6d36cf54d1601e78d07775b737", "score": "0.79971385", "text": "def clipboard(cipher_text):\n\n frame = str(inspect.stack())\n\n if platform.system() == 'Windows':\n if 'multiple_encryption' not in frame:\n import win32clipboard\n print cipher_text\n ...
[ { "docid": "8a5b87d7917bdaa8c4f4fbab9968cf45", "score": "0.6691027", "text": "def copy_to_clipboard(text):\n # try windows first\n try:\n import win32clipboard\n\n win32clipboard.OpenClipboard()\n win32clipboard.EmptyClipboard()\n win32clipboard.SetClipboardText(text)\n...
30cc9bea2320336e2024d02064a23c56
Return 0/day average if task(s) does not exists
[ { "docid": "ac21eeb1e1ca9948918a76a50b87232d", "score": "0.67772514", "text": "def test_average_completed_report_with_not_existing_tasks(self):\n self.create_test_user()\n token = self.client.post(self.login_url, self.user_login_data, format=\"json\").data['token']\n\n res = self.cl...
[ { "docid": "a45ccb2b23a9377058f43a9de041582c", "score": "0.6399138", "text": "def get_average(days):\n average = 0\n for i in range(days):\n average = average + workloads[-1-i]\n average = average / days\n return average", "title": "" }, { "docid": "334f04a4879085f0a7589af...
bda7477a24eb68e08cb740b5646017e8
Get the value of GPIO_DSn
[ { "docid": "a54678832faf27520d90b3ba3965f6b4", "score": "0.762052", "text": "def DS(self):\n val = self.chip[\"GPIOConfig_DS\"][\"GPIO_DS<8:0>\"]\n if val & (1<<self.n)>0:\n return 1\n return 0", "title": "" } ]
[ { "docid": "8cc13613535efa6b50a0e48ee178d9ca", "score": "0.71249497", "text": "def get_digital(self):\n [error,digital_value] = self.controller.GPIODigitalGet(self.input_digital_channel)\n return digital_value", "title": "" }, { "docid": "38ae247f1193754b27cd48cbdb120c5b", ...
0ed61c7c3a1069b92b788921b076cd49
Exeute a training step of the network
[ { "docid": "014643795bd534fce953ef32ea38328a", "score": "0.0", "text": "def RunTrainingStep(self, _input_data):\n\n data = []\n label = []\n for batch in _input_data:\n data.append(batch['data'])\n label.append(batch['label'])\n\n pred, loss, _ = (self.t...
[ { "docid": "45e18b87448924a6c7959ae9e64a3345", "score": "0.78879696", "text": "def training_step(self, *args, **kwargs):", "title": "" }, { "docid": "eb0802a9681d93c4fa95c1b9150625c2", "score": "0.7701176", "text": "def train(self):\n print(\"Training not yet implemented.\")",...
d7574399af854a5dcf2ec9f029cf30f0
Command launched when 'Duplicate' QMenuItem is triggered. Duplicate cache version
[ { "docid": "769d74ecd271bda126770aa98dee5905", "score": "0.69807845", "text": "def on_miDuplicateCache(self):\n #-- Check --#\n if not os.path.exists(os.path.normpath(self.pItem.cacheFullPath)):\n raise IOError, \"!!! Cache file not found: %s !!!\" % self.pItem.cacheFullPath\n ...
[ { "docid": "41371b400127f7426b313b81795478c3", "score": "0.6907194", "text": "def on_duplicateSelected():\n toolBoxCmds.duplicateSelected()", "title": "" }, { "docid": "40f1f0a1823da38422e53dadfa4d6dcc", "score": "0.6071569", "text": "def copyCommand(self):\n\n selectio...
fbb66c295298d642ea346b8998a7d514
TCPSocket specifies an action involving a TCP port.
[ { "docid": "ea1836355d8f29e6c48cc2de789a993b", "score": "0.7387273", "text": "def tcp_socket(self) -> 'outputs.TCPSocketActionResponse':\n return pulumi.get(self, \"tcp_socket\")", "title": "" } ]
[ { "docid": "fb0171d918a4881bd87aa287bf0ed002", "score": "0.6811422", "text": "def open_tcp_port(ec2_resource, port, vpc_id):\n try:\n vpc = ec2_resource.Vpc(id=vpc_id)\n defaultSg = list(vpc.security_groups.all())[0]\n defaultSg.authorize_ingress(\n GroupName=defaultSg...
1d6071a8d7ae909fcf0d44cb3e19d560
Creates a tree representation as a set of nodes and a mapping from nodes to children Also creates two vptrees for Euclidean and assisting metrics, used for nearest neighbour queries
[ { "docid": "24194cd4d239b01000f1816a0e4d2fbd", "score": "0.6277342", "text": "def __init__(self, root, space, assisting_dist_fn = lambda a, b: np.linalg.norm(a.pos - b.pos)):\n self.root = root\n self.nodes = set()\n self.edges = {}\n self.back_edges = {}\n self.node_a...
[ { "docid": "4bc6e510335ff66acf124c19b506fc82", "score": "0.6659278", "text": "def generate_tree(self):\n calculate_criterion = None\n if(self.criterion == \"entropy\"):\n calculate_criterion = calculate_entropy\n elif self.criterion == \"accuracy\":\n calculate...
ff56ebfcdc84a9c0a7c66a26c96c92f3
Yield items for which the indices match
[ { "docid": "c86d89c67dc21a52ec5d455e38133ce9", "score": "0.7073103", "text": "def _yield_subset(iterable, indices):\n if not indices:\n return\n remaining = sorted(indices, reverse=True)\n cur = remaining.pop()\n for idx, item in tqdm(enumerate(iterable)):\n ...
[ { "docid": "7ac2b4fa3302390e27de2e0f054f793f", "score": "0.69100356", "text": "def select_indices(self, indices):\n indices = copy(indices) # passed indices is a reference, need own copy to modify\n for idx, record in enumerate(self):\n if idx in indices:\n yield...
9afcd2fe6299150fc06b983f24909787
Successful job submit with incorrect image link
[ { "docid": "6e4bfc6a94d06c4c548f190db9772e1e", "score": "0.61634725", "text": "def test_submit_successful_bad_link(self):\n payload = json.dumps({\n \"count\": 2,\n \"visits\": [\n {\n \"store_id\": \"S00339218\",\n \"imag...
[ { "docid": "d7ad10b1cdc5147deb72870a688c0aaf", "score": "0.66116846", "text": "def saveimage(self, info=False):\r\n request_image_content = requests.get(self.job_content)\r\n if request_image_content.status_code == 404:\r\n print(\"Нет подключения к https://elksale.xyz/\")\r\n ...
7341d6aa13b1cc286ce04d5827817308
Dump the value for database storage.
[ { "docid": "b577095ab886f50393e79e4e1d752c46", "score": "0.0", "text": "def db_value(self, val: 'Optional[Union[str, IPAddress]]') -> 'Optional[int]': # pylint: disable=inconsistent-return-statements\n if val is not None:\n if isinstance(val, str):\n val = ipaddress.ip_...
[ { "docid": "58aad9c81ff71b941b78cdf189ef4a8e", "score": "0.8058299", "text": "def dump(self, value):\n return", "title": "" }, { "docid": "58aad9c81ff71b941b78cdf189ef4a8e", "score": "0.8058299", "text": "def dump(self, value):\n return", "title": "" }, { "d...
4262ba2169fb9af58bdba7293847d736
Edit an entire list. Danger Will Robinson! Only staff members should be allowed to access this view.
[ { "docid": "fc5bb10fae3692184a40801cd44250b3", "score": "0.7460019", "text": "def edit_list(request, list_id):\t\n\tif request.user.is_staff:\n\t\tcan_edit = 1\n\n # Get this list's object (to derive list.name, list.id, etc.)\n\tlist = get_object_or_404(List, pk=list_id)\n\n\tif list.team.uuid == req...
[ { "docid": "c70565b6317d6080ce923f2da04457d2", "score": "0.69857556", "text": "def edit_list(name):\n user = session['username']\n description = ''\n\n user_lists = list_object.show_lists(user)\n\n for s_list in user_lists:\n if s_list['name'] == name:\n description = s_lis...
feca5e961fa911131bf43c91b42fcfd9
Write the nifti file to disk
[ { "docid": "b06bf425afbdbec5b966634675f994ba", "score": "0.75929457", "text": "def write_nifti(self, output_path):\n nib.save(self.niftiImage, output_path)\n print('Image saved at: {}'.format(output_path))", "title": "" } ]
[ { "docid": "d9a1fcb314f9516ffb3c235ebf492d2a", "score": "0.6979252", "text": "def save_nifti(self, path):\n meta = {'te': self.te, 'tr': self.tr, 'sw': self.sw}\n if self.sequence_type == 'STEAM':\n meta['tm'] = self.tm\n\n # store real and imaginary components in last 2 ...
fd18bd86a69e92f4b68845489ca18d22
asks the player if he wants to hit or stand
[ { "docid": "1d581f916b0bce561d52d363362b7407", "score": "0.7071528", "text": "def hit_or_stand(self, _):\n while True:\n move = input(\"Do you want to hit or stand? (H or S): \")\n if move not in ['H', 'S']:\n print(\"Wrong input. Please try again.\")\n ...
[ { "docid": "e32daeee8ff2c30e0fee55e15db46ec1", "score": "0.70723826", "text": "def get_player_action(self) -> None:\n print(f\"\\nYou have: {self.user.hand.cards} totalling to {self.user.hand.value}\")\n while not self.get_game_ending_hands():\n action = self.validate_input(\"Do...
05445aab07c768eec636fe901ab66bd9
Turn on the entity.
[ { "docid": "0413af31cc498d121ee7207c9afb775a", "score": "0.0", "text": "def turn_on(self, speed: str = None, **kwargs) -> None:\n if speed is None:\n speed = SPEED_MEDIUM\n self.set_speed(speed)", "title": "" } ]
[ { "docid": "5636f7ded24b3e11bfd3c30745e713ea", "score": "0.8618475", "text": "def turn_on(self, **kwargs):\n setattr(self._device, self.entity_description.key, True)", "title": "" }, { "docid": "0787e3138df52f64d7bccfce51a74eff", "score": "0.81042206", "text": "async def async...
f8c00adb9f1397b1a0557dda391b3234
Parse arguments to the detect module
[ { "docid": "f27ae0cbc8200bbb4fec7d1bc9817c08", "score": "0.5837996", "text": "def arg_parse():\n\n parser = argparse.ArgumentParser(description='YOLO v3 Video Detection')\n parser.add_argument(\"--dataset\", dest=\"dataset\",\n help=\"Dataset on which the network has been trained\", def...
[ { "docid": "34fe4fe55514d90b708cb95166c13d37", "score": "0.7203778", "text": "def parse_args(self):", "title": "" }, { "docid": "97d2ccf7f996b3021796b0ea822e65de", "score": "0.7183488", "text": "def parse(args):", "title": "" }, { "docid": "d2d066d8732dafb3e689637147415fd...
674908d1db925dbcc1adc35da09ca96b
get target network actions from all the agents in the MADDPG object
[ { "docid": "28a5892506b36c1f6f35cd172af47eef", "score": "0.72622454", "text": "def target_act(self, obs_all_agents, noise=0.0):\n target_actions = [agent.target_act(obs) for agent, obs in zip(self.maddpg_agent, obs_all_agents)]\n return target_actions", "title": "" } ]
[ { "docid": "3a6f213e3e825c2203028c4d9e180f76", "score": "0.731483", "text": "def target_act(self, obs_all_agents, noise=0.0):\n target_actions = [ddpg_agent.target_act(obs, noise) for ddpg_agent, obs in zip(self.maddpg_agent, obs_all_agents)]\n return target_actions", "title": "" }, ...
1f7fdb3fa2fb40d9710441a1a0f17b84
Gathers recursively all inertial object children from the specified object. The inertia objects need to be in the specified objectlist to be encluded. Also, links which are not in the objectlist, will be considered, too. This will gather inertial objects which are child of a link not in the list.
[ { "docid": "369087941b79d35fd4c096e7677171b3", "score": "0.8509039", "text": "def gatherInertialChilds(obj, objectlist):\n\n # only gather the links that are not in the list\n childlinks = [\n link for link in obj.children if link.phobostype == 'link' and link not in objectlist\n ]\n ...
[ { "docid": "43c145cbaf3e9fe77a99d33e6097f801", "score": "0.598192", "text": "def _object_list_helper(self, **params):\n\n if not self.is_folder:\n raise SolveError(\n \"Only folders contain child objects. This is a {}\"\n .format(self.object_type))\n\n ...
509a286e60fce150300aabb366f83175
django.test.client.Client gets confused with templates when using the cache, that's why we need to clear it.
[ { "docid": "e86263ace9d9f65d37bbbb5eae3575f8", "score": "0.0", "text": "def setUp(self):\n cache.clear()\n self.author = User.objects.create_user(username='joe', password='qwerty')\n self.teaser = \"this is a teaser\"\n self.body = \"and this is the body\"", "title": "" ...
[ { "docid": "4fbfbe6153af5f24a44f085add23e075", "score": "0.732025", "text": "def clear_template_cache(request):\n bottle.TEMPLATES.clear()", "title": "" }, { "docid": "aa32e576cf2aba393dcface5a14020e7", "score": "0.72820395", "text": "def test_cached_views(self):\n response...
0263a2c1fabaf9b3dbe87411b3d2a161
Checks if the server process is healthy
[ { "docid": "93ddbcc47b26f4c9bc06d42eda0099da", "score": "0.77359974", "text": "def server_is_healthy(self):\r\n\r\n if get_settings(active_view(), 'jsonserver_debug', False) is True:\r\n return True\r\n\r\n if self.process.poll() is None:\r\n try:\r\n s...
[ { "docid": "c750bab4d329fd8a29dd3926ae56d7e8", "score": "0.7100369", "text": "def CheckIfSyncServerRunning(port):\n sync_server_healthz_url = ('%s:%s/healthz' % (HTTP_SERVER_URL, port))\n req = urllib2.Request(sync_server_healthz_url)\n try:\n response = urllib2.urlopen(req)\n except urllib2.HTTP...
101c5fb6c67e4feb997767ddaf69b7dc
today returns today's date
[ { "docid": "666a6159a5dc480c0343a4ebadb44753", "score": "0.8839325", "text": "def today() -> date:\n return datetime.datetime.now().date()", "title": "" } ]
[ { "docid": "c27bb3e457eaa5764e0d5be961713deb", "score": "0.9091201", "text": "def get_today_date():\n return datetime.date.today()", "title": "" }, { "docid": "dfdd837ef405d39242b663e7550ab03e", "score": "0.87969136", "text": "def get_today_date():\r\n now = datetime.datetime.n...
9945b198ee2819f25a1b4b7fc922fb45
Imports an CSV files. First row must be a header row!
[ { "docid": "b64b6452c8f571043df0a297554acb4d", "score": "0.6596792", "text": "def import_csv(self, filename, delimiter=',', quotechar='\"'):\n with open(filename) as data_file:\n reader = csv.reader(data_file, delimiter=delimiter, quotechar=quotechar)\n header = [h.strip() f...
[ { "docid": "e455c173c1f80b526afba4f9ca27056f", "score": "0.7136156", "text": "def import_csv_command(csvdir):\n import_tables_from_csv_files(csvdir)", "title": "" }, { "docid": "4e9f35441ca60f248a8412d0d1fa470b", "score": "0.70805323", "text": "def load_lar_csv():\n cur, pg_con...
381f74c2b4051b21303d642135e54e72
Fetch graph from one frame; include streams that start in the frame.
[ { "docid": "03d08c27c27d534ab48214ee8dfa10d2", "score": "0.545553", "text": "def fetch_frame(self, start, minutes=0, seconds=0):\n total_secs = minutes * 60 + seconds\n end = start + total_secs\n with self._database:\n g = networkx.MultiDiGraph()\n with self._d...
[ { "docid": "ff58a4182114fc95691a872a0ed2b5c9", "score": "0.52892774", "text": "def fetch(self):\n if self.queries is None:\n version_identifier = get_pg_version(self.connection)\n self.queries = queries_for_version(QUERIES, version_identifier)\n print(\"multigraph %s\...
018880b1d5d6c22529a88b74d8db0eb8
Returns the manifest associated with the given tag.
[ { "docid": "118dccbdaeffbf0f698c7ad2b47e4a0e", "score": "0.6995916", "text": "def get_manifest_for_tag(self, tag, backfill_if_necessary=False, include_legacy_image=False):\n try:\n tag_manifest = database.TagManifest.get(tag_id=tag._db_id)\n except database.TagManifest.DoesNotEx...
[ { "docid": "a1a8b9bf202f253570d1492e7d682672", "score": "0.72691697", "text": "def backfill_manifest_for_tag(self, tag):\n # Ensure that there isn't already a manifest for the tag.\n tag_manifest = model.tag.get_tag_manifest(tag._db_id)\n if tag_manifest is not None:\n re...
4dba8ed3cddff94b4b7072f76b0d80c4
Test if ID is unique
[ { "docid": "05ab68083158ee7bba35180202897740", "score": "0.0", "text": "def test_RepetitiveID(self):\r\n self.assertRaises(RepetitiveID, lambda: self.x5.analyze())", "title": "" } ]
[ { "docid": "0ac5efe74d321f18377f5ccb07de5d2c", "score": "0.7788738", "text": "def isUnique(self) -> bool:\n ...", "title": "" }, { "docid": "147ce7c02042b875c8daf79145db0348", "score": "0.7677853", "text": "def check_id(self, id):\n\n if id in self.unique_ids:\n ...
d2627244a03bd1c854720b1d51c79609
kth force dependent contribution to the model covariance function.
[ { "docid": "5c0866cc3035e94fa5bc483edd5b21b9", "score": "0.0", "text": "def Lambdag_k(k, vecg, beta, logphi_k, gamma_k, mlfm,\n eval_gradient=True):\n # structure matrices\n if beta is None:\n A = np.asarray(\n [np.zeros((mlfm.dim.K, mlfm.dim.K)),\n *mlfm....
[ { "docid": "c7c5de377203ac744f5111948e9c9ed8", "score": "0.66864216", "text": "def autocovariance(H, k):\n return 0.5 * (abs(k - 1) ** (2 * H) - 2 * abs(k) ** (2 * H) +\n abs(k + 1) ** (2 * H))", "title": "" }, { "docid": "88a1ca40a00dd305bc1120fc6500d2fb", "score": "...
7f7d4113fc302ccc6ad2684a5d6e1a10
Nothing should be checked w/no Manifest files.
[ { "docid": "03e3aaa9c501bc5a9576d6fe39437b18", "score": "0.679476", "text": "def testNoManifests(self):\n self.file_mock.return_value = [\n '/foo/bar.txt',\n '/readme.md',\n '/manifest',\n '/Manifest.txt',\n ]\n ret = pre_upload._check_manifests('PROJECT', 'COMMIT')\...
[ { "docid": "e5c8ce4283e35b3c3f0bc3eb507785a3", "score": "0.6807853", "text": "def _can_run(self, manifest):\n pass", "title": "" }, { "docid": "3a57e0dad785654907e4bb733f8d9293", "score": "0.6682673", "text": "def manifest(self):", "title": "" }, { "docid": "2a3255...
d908c79cf431b7186e893f10afbe7144
Add a new permission on the host to the group in the system.
[ { "docid": "6b3f4d4434a976a4e1a139caaabe4aa1", "score": "0.6871351", "text": "def add_host_permission(\n self,\n permission,\n headers=None,\n query=None,\n wait=True,\n **kwargs\n ):\n # Check the types of the parameters:\n Service._check_types...
[ { "docid": "91f301f95dfc9b19905b0ce6fd7c4a77", "score": "0.76909554", "text": "def add(self, group_name, permission_name):\n\n self.permissions[group_name].append(permission_name)", "title": "" }, { "docid": "17571a8f960466ab9f49a77f66a96c26", "score": "0.74283016", "text": "d...
409a756a82c98341bd6b8d5cb1648861
Return Position instance for given node (or None if no node).
[ { "docid": "054171e61f10cfe8177f27ab038fc20a", "score": "0.8076458", "text": "def _make_position(self, node):\n return self.Position(self, node) if node is not None else None", "title": "" } ]
[ { "docid": "4a6fb3b81190a656753251f00e63b148", "score": "0.73565936", "text": "def newPosition(self, node):\n return self.Position(node, self) if node is not None else None", "title": "" }, { "docid": "7ef673963e5db890c4f42bcebc464d13", "score": "0.6869997", "text": "def _make...
762d615cea8ef6f6790668f7190a5359
Reprioritise tasks to pri if current date is days before due date. Will not reprioritise tasks if they are already higher priority than pri.
[ { "docid": "50fea5512faf7e418884eb9e87225891", "score": "0.56365365", "text": "def main(todo_file, todo_full_sh, days=1, pri=\"A\", list_tasks=False):\n days = int(days)\n tasks_with_due_date = []\n\n # Open todo.txt file\n with open(todo_file, \"r\") as f:\n content = f.readlines()\n...
[ { "docid": "f48dcd47e2fc719ffe12251564205dd0", "score": "0.6258063", "text": "def change_task_prio():\n\n user = current_user.self\n fields = 'proj_name', 'task_name', 'dir'\n fields = proj_name, task_name, dir_ = [request.args.get(i) for i in fields]\n\n if not all(fields) or not dir_ in ('...
b088dddebe4dd8c763a816df39d4bd07
Given a boolean array, we select generators from a barcode basis. Example >>> print(base3) Barcode basis [[0 2] [0 1] [1 3]] >>> base5 = base3.bool_select([True,False,True]) >>> print(base5) Barcode basis [[0 2] [1 3]]
[ { "docid": "c6cf5734120bfe5000e95948f7e28282", "score": "0.6890537", "text": "def bool_select(self, selection):\n if self.prev_basis is None:\n return barcode_basis(self.barcode[selection])\n\n return barcode_basis(self.barcode[selection], self.prev_basis,\n ...
[ { "docid": "c9c6f4e162dc8602c6845ab763118195", "score": "0.5711035", "text": "def seqselect(test, list): \n selected = [ ]\n for item in list: \n if test(item) == True: \n selected.append(item)\n return selected", "title": "" }, { "docid": "9dc0b1d43ce0cbc171247...
1732c168881102eb89121f0aa6d38507
Create virtualenv for running unit tests
[ { "docid": "201d6b11ddbc6da6d2c9fc87dd73c84b", "score": "0.6648784", "text": "def create_venv_dir():\n SHELL_EXEC = []\n SHELL_EXEC.append(F'set -e')\n SHELL_EXEC.append(F'virtualenv {VENV_DIR}')\n\n return_code = os.system(';'.join(SHELL_EXEC))\n return return_code", "title": "" } ...
[ { "docid": "189f06ad80b7b2ec683c7774ef1026f2", "score": "0.77171963", "text": "def create_virtualenv():\n require('virtualenv_root', provided_by=('staging', 'production'))\n args = '--clear --distribute --no-site-packages'\n try:\n run('rm -rf %s' % env.virtualenv_root)\n except:\n ...
8f3322cbece87d4cd2d4aed1847f9ac1
Returns a list of words contained by an identifier.
[ { "docid": "ebf7095286e0d19491a13934e837cdfb", "score": "0.80292684", "text": "def identifier_to_words(identifier):\n identifier = identifier.strip('_')\n\n if not identifier:\n return []\n\n lowered = identifier.lower()\n\n split = lowered.split('_')\n if len(split) > 1:\n ...
[ { "docid": "a7bcb6fba7f8bad6e6745830aff48630", "score": "0.6666058", "text": "def get_hate_word_list():\n return list(i['word'] for i in db.hateword.find())", "title": "" }, { "docid": "6f0239e2d00df96a06ea7ff27bfc076d", "score": "0.64950097", "text": "def get_words(data):\n ...
bd00d22d75d3e8398074e98ff4793c1e
Adds a step to the factory to update the script folder.
[ { "docid": "74f798e23fbee8505eca1454de0ef392", "score": "0.56004137", "text": "def AddUpdateScriptStep(self, gclient_jobs=None):\n # This will be run in the '..' directory to udpate the slave's own script\n # checkout.\n command = [chromium_utils.GetGClientCommand(self._target_platform),\n ...
[ { "docid": "da6f256ea87182c3396057839a71cae9", "score": "0.607602", "text": "def test_steps_add(self):\n support.create_project(self, 'bob')\n project = cauldron.project.get_internal_project()\n\n r = support.run_command('steps add first.py')\n self.assertFalse(r.failed, 'sho...
e65d8166479645f4b886344fd1e0c04b
Convert a pair of rgb and depth map to colored point cloud
[ { "docid": "7349737b67d3843bc44a0a1fc241a082", "score": "0.6349855", "text": "def rgbd_to_colored_pc(self, depth, rgb, f_x, f_y, c_x, c_y, cap=100):\r\n\r\n rgb_height, rgb_width, _ = rgb.shape\r\n x_map, y_map = np.meshgrid(np.arange(rgb_width), np.arange(rgb_height))\r\n xyz_rgb =...
[ { "docid": "a5754be415e7011d3d6a8987eeae038a", "score": "0.7130225", "text": "def world_to_color(params, pcloud, color):\n x, y, z = pcloud[..., 0], pcloud[..., 1], pcloud[..., 2]\n x = x * params['fx_rgb'] / z + params['cx_rgb']\n y = y * params['fy_rgb'] / z + params['cy_rgb']\n x1, xw1, x2, xw2, ...
ff1b78c3ab6c17b32de402a44284ff0e
Return the default parameters to use for this instrument.
[ { "docid": "29ecb96dd0a73340f5b590baf576e00a", "score": "0.63064265", "text": "def default_pypeit_par(cls):\n par = super().default_pypeit_par()\n\n # Ignore PCA\n par['calibrations']['slitedges']['sync_predict'] = 'nearest'\n # Bound the detector with slit edges if no edges ...
[ { "docid": "a700ce8225135b8cb4346a035e703959", "score": "0.8122184", "text": "def getDefaultParameters():\n param = {}\n return param", "title": "" }, { "docid": "f076a91fe2bc8e56f0b1a28e10c6e71a", "score": "0.80809766", "text": "def _get_default_parameters(self):\n ...
2d61504f4f2f4eb5f0650c9977e4266b
Send all avaleble pages to frontend
[ { "docid": "83b799e7681ebd13a03275005bae9630", "score": "0.5553395", "text": "def all_reed_pages(id):\n if not g.user:\n flash('You have to Login')\n return redirect('/')\n\n \n book = Book.query.get_or_404(id)\n\n if book.user_id != g.user.id:\n flash(\"This is not your...
[ { "docid": "391186b4f0f909aa1e6774c9c86f8638", "score": "0.63025695", "text": "def send_pages(self, response):\n # The internal 'overview' page\n pages = {\"main\": OVERVIEW_ID,\n \"pages\": [OVERVIEW_ID],\n \"names\": [OVERVIEW_ID.title()]}\n\n # Pre...
5e1a891d3b7866607a29f1974d1ce28e
DMLablike interface for a Craft environment. Given a `scenario` (basically holding an initial world state), will provide the usual DMLab API for use in RL.
[ { "docid": "1768a3f30f25b192ca42f33c21871d27", "score": "0.0", "text": "def __init__(self,\n scenario,\n task_name,\n task,\n max_steps=100,\n visualise=False,\n render_scale=10,\n extra_pickup_penalty=0.3)...
[ { "docid": "bed98706b436b68588217f2ebed80aaa", "score": "0.5636561", "text": "def func_with_scenario():\n Scenario(test=my_scenario)()", "title": "" }, { "docid": "7cecb62700356ff3bdc1e0f8a36300d8", "score": "0.5341338", "text": "def _run_scenario(self, scenario):\r\n \r\n s...
edb5457970fd4d56ccfdc469aad81c35
DCN+ Dynamic Decoder. Builds decoder graph that iterates over possible solutions to problem until it returns same answer in two consecutive iterations or reaches `max_iter` iterations.
[ { "docid": "7c7734fd4e07a8e8edda01b29ca9d7cc", "score": "0.5828644", "text": "def dcn_decode(encoding, document_length, state_size=100, pool_size=4, max_iter=4, keep_prob=1.0):\n\n with tf.variable_scope('decoder_loop', reuse=tf.AUTO_REUSE):\n batch_size = tf.shape(encoding)[0]\n lstm_d...
[ { "docid": "a0cc24fd0397519dd87475cb3d28dda1", "score": "0.5929235", "text": "def dynamic_bidecode(fw_decoder, bw_decoder,\n output_time_major=False,\n impute_finished=False,\n maximum_iterations=None,\n parallel_iterations=32,\n ...
bb93233fea2728dbe7a710491dbd20c3
Override. Filter the orders
[ { "docid": "64f1bc9be7d931e4af09562d6f9d9f9e", "score": "0.5655497", "text": "def get_queryset(self):\n qs = super(OrderListView, self).get_queryset()\n if self.request.user.profile.is_designer:\n qs = qs.filter(preferred_designer=self.request.user)\n\n params = self.get_...
[ { "docid": "a4e89f8f2340058f683b47dde9083f5d", "score": "0.7153317", "text": "def filter(self):\n\n keys = ('ord-af', 'clt-af', 'qty-af', 'dat-af', 'tes-af', 'sta-af')\n new_dict = {}\n if 'orders' in self.data_dict:\n self.data_dict.pop('orders')\n for key in keys...
02f315b9135f4b22ee9ffddc20ae764a
TABLE(viterbi_combined_cs self) > pmt_vector_cfloat
[ { "docid": "8edf48582ac73e74d4876415aca92560", "score": "0.54545975", "text": "def TABLE(self):\n return _trellis_swig.viterbi_combined_cs_TABLE(self)", "title": "" } ]
[ { "docid": "9ca7f83d9e04bbe56e55a5794b3300c5", "score": "0.5984601", "text": "def get_bvec():\n return np.array([0.0000000, 0.0000000, 0.0000000, 0.0000000,\n 0.0000000, 0.0000000, 0.0000000, 0.0000000,\n 0.0000000, 0.0000000, 0.0000000, 0.0000000,\n ...
346d3ed1deeac006fe47ca51b0c1dd9d
No hint returned. Readonly routing to the SEGMENTS_EXEC_CONNECTION is handled manually in the Segment model. This is 'less surprising' than routing all Segment reads through the SEGMENTS_EXEC_CONNECTION.
[ { "docid": "8bd1a3437ac212071979be4f57181f99", "score": "0.0", "text": "def db_for_read(self, model, **hints):\n return None", "title": "" } ]
[ { "docid": "c4f28fca8b39034d3677e853378cef94", "score": "0.5777611", "text": "def test_get_segment_bind(self):\n pass", "title": "" }, { "docid": "a45cab6f8492d86060ab03fadce251a7", "score": "0.5474118", "text": "def _get_segment_routing(self):\n return self.__segment_routi...
767b313f27de008c06873b5506f74731
Concatenate several GenomicArrays, keeping this array's metadata. This array's data table is not implicitly included in the result.
[ { "docid": "fef4b50b2b7e631f7ecc7e10a12b1c97", "score": "0.6265276", "text": "def concat(self, others):\n result = self.as_dataframe(pd.concat([otr.data for otr in others]))\n result.sort()\n return result", "title": "" } ]
[ { "docid": "15a61d1834cdf3ed63f0ebfd38933e33", "score": "0.6837463", "text": "def concatenate(arrays, axis=0):\n if not isinstance(arrays, tuple):\n raise ValueError(\"data type not understood\")\n arrays = tuple([asarray(a) for a in arrays])\n from numpy import concatena...
7612886b5c1c75952937468ef4de0f84
Start a busy loop checking for file changes every interval seconds. If blocking is False make one loop then return.
[ { "docid": "34b86190c20808af2caaeaef05906339", "score": "0.7577745", "text": "def loop(self, interval=0.1, blocking=True):\n # May be overridden in order to use pyinotify lib and block\n # until the directory being watched is updated.\n # Note that directly calling readlines() as we...
[ { "docid": "6d5e0b4b914132edacb2fa8bbd1018de", "score": "0.64747286", "text": "def loop_forever(self):\r\n while self.running:\r\n time.sleep(0.1)", "title": "" }, { "docid": "dc72b9d7b7d88b6fc569acd8b1bd22a0", "score": "0.625984", "text": "def _loop(self):\n ...
20616c335706dead03dbd0b355751bb7
Renvoie un dictionnaire contenant les noeuds de steiner
[ { "docid": "2d825c430d9e0d9e277a6470bf367ad8", "score": "0.0", "text": "def heuristique_ACPM(self,draw=False):\n\n def getVertricesOfPath(edges):\n set_node = set()\n for e in edges:\n id1,id2 = self.getIdVerticesOfEdge(e)\n set_node.add(id1)\n ...
[ { "docid": "54c14ee0b7392691fb50c0ffb9f8ea26", "score": "0.6221054", "text": "def creer_dictionnaire_vide():\n dico = {}\n return dico", "title": "" }, { "docid": "82e0cf18839180689903b7d5cd2d1912", "score": "0.59172213", "text": "def get_dictionary(self):\n dct = super(...
f93c6b5d2fe60a9cdcdbdfcf373aa071
Look through a list of buildrequests and return bug number from push comments
[ { "docid": "374a6dcfd50381706b98c26bda1809c1", "score": "0.7646013", "text": "def GetBugNumbers(self, buildrequests):\n bugs = []\n for value in buildrequests.values():\n br = value.to_dict()\n for comment in br['comments']:\n # we only want the bug spe...
[ { "docid": "900b60e5c518d7f522a1b0d26c2ac663", "score": "0.6280939", "text": "def ProcessPushType(self, revision, buildrequests, flag_check=True):\n push_type = None\n for value in buildrequests.values():\n br = value.to_dict()\n for comments in br['comments']:\n ...
7b7f4594694f8cfb3398fee97cad1b09
Builds a map of all the available XSD files.
[ { "docid": "be58a6fc0c24417875c01449a15e6348", "score": "0.72942144", "text": "def get_xsd_files():\n all_files = []\n xsd_directory = get_xsd_directory()\n for root, unused_dirs, files in os.walk(xsd_directory):\n all_files.extend(\n os.path.join(root, filename)\n for filename in fi...
[ { "docid": "a31e20d3a39b037126aee79ba974b98f", "score": "0.59901017", "text": "def build_file_map(buildset_files, minimal_files,\n full_files, context_files, docs_files):\n\n sys.stderr.write(\"making file map...\\n\")\n file_map = {}\n for f in buildset_files:\n file_m...
58b4c21a6b2aa69ec9a7f44cb57cdf77
Should erase itself from self.surface and return a list of dirty rectangles
[ { "docid": "0f01a94c876eb3204446440d5d404949", "score": "0.0", "text": "def erase(self):\r\n raise Exception(\"erase not implemented\")", "title": "" } ]
[ { "docid": "ba4440c20abcd1b1a8ef3e790b5735c9", "score": "0.740515", "text": "def erase(self):\r\n if self.is_focus:\r\n dirty_rect=pygame.draw.circle(self.surface, 0, (int(self.cx),int(self.cy)), self.radius, self.border_width)\r\n else:\r\n dirty_rect=pygame.draw.cir...
b4ee8b559c2f4b6f1cb5f7335cc4859b
Add placeholders and classes, remove autogenerated labels and set autofocus on first field
[ { "docid": "ba0e42ff03f5470d6030d92c8536c04d", "score": "0.5561623", "text": "def __init__(self, *args, **kwargs):\n\n # We call the default init method to set the form up\n # as it would be by default.\n super().__init__(*args, **kwargs)\n\n # Create dictionary of placeholde...
[ { "docid": "ee58ce594e73263af8c770f223304e5d", "score": "0.6516639", "text": "def __init__(self, *args, **kwargs):\n super().__init__(*args, **kwargs)\n placeholders = {\n 'title': 'Title',\n 'body': 'Body',\n 'slug': 'Slug'\n }\n\n self.field...
d1ab94935e1af99e184fbbc6b888b926
Encodes obj as bytes.
[ { "docid": "bbfcc47a776f32e4075a6592a8af4227", "score": "0.8698663", "text": "def encode(self, obj: Any) -> bytes:", "title": "" } ]
[ { "docid": "bc24fde68354c537e45fcf8c96b600d1", "score": "0.84944046", "text": "def encode(self, obj: Any) -> bytes:\n return self.encoder.encode(obj).encode(\"utf8\")", "title": "" }, { "docid": "9eabecd52ef02bc813bb5e953625cca1", "score": "0.778802", "text": "def encode(self,...
08b62f4fb374af1c8cfcc184505c65f9
Asserts that the cycle parameters are correctly updated.
[ { "docid": "ffdf0b4a006e974cc807d2374817e258", "score": "0.67932165", "text": "def test_cycle_updater_function_wrong_length(self):\n data = CellParameters(**CELL_DATA)\n new_cycle_values = {\n \"phase_0\": 20.0,\n \"phase_1\": 180.0,\n \"phase_2\": 240.0,\n...
[ { "docid": "3039942404e954fea5c6d5299e65357b", "score": "0.7294884", "text": "def test_cycle_updater_function(self):\n data = CellParameters(**CELL_DATA)\n new_cycle_values = {\n \"phase_0\": 20.0,\n \"phase_1\": 180.0,\n \"phase_2\": 240.0,\n \"...
ffbcdbe876282ffb2f40846e205be13a
obj.text_payload is a base64encoded payload as text.
[ { "docid": "65369942118cfb69adb3b58495223283", "score": "0.6641096", "text": "def test_text_payload(self):\n payload = pem.parse(KEY_PEM_PKCS5_UNENCRYPTED)[0].text_payload\n\n assert (\n KEY_PEM_PKCS5_UNENCRYPTED_PAYLOAD.decode().replace(\"\\n\", \"\")\n == payload\n ...
[ { "docid": "3b63a512897ae29d232ed7d2ee66b267", "score": "0.63219917", "text": "def _encode_text(text):\n message_bytes = text.encode('ascii')\n base64_bytes = base64.b64encode(message_bytes)\n base64_text = base64_bytes.decode('ascii')\n return base64_text", "title": "" ...
1a7f9536a35fd590d40a3a1d37600ab3
Test we handle unexisting board.
[ { "docid": "857333b605e27b3d26e62b606955f50b", "score": "0.0", "text": "async def test_form_cannot_connect(hass: HomeAssistant) -> None:\n result = await hass.config_entries.flow.async_init(\n DOMAIN, context={\"source\": config_entries.SOURCE_USER}\n )\n\n assert result[\"step_id\"] == ...
[ { "docid": "ccca7c5d0b148ca39efee43c41233dbe", "score": "0.7050416", "text": "def test_empty(self):\n with self.assertRaises(Board.InvalidDimensionsError):\n Board(())", "title": "" }, { "docid": "1f214f4a3140b583029b4e1844f0fb37", "score": "0.6889755", "text": "def...
c7b86c990e593c07e47e1f64422f60c7
Print HTTP headers to sys.stdout.
[ { "docid": "f7744652dcc4edfcdef486badb665637", "score": "0.0", "text": "def set_debug_http(self, handle):\r\n level = int(bool(handle))\r\n for scheme in \"http\", \"https\":\r\n h = self._ua_handlers.get(scheme)\r\n if h is not None:\r\n h.set_http_deb...
[ { "docid": "be4423dde5e95970d93f0e179b855163", "score": "0.7317722", "text": "def print_headers(self, headers={}, nocache=True):\n if self.sent_headers:\n return\n if not headers.has_key('Content-Type'):\n headers['Content-Type'] = 'text/html'\n if nocache:\n ...
ea836898f81f53deeddd339eb098744f
Redis instance used to cache value. Replace redis instance if you want.
[ { "docid": "c7b7573e500a55046ada3753831be40d", "score": "0.7362848", "text": "def mc(self):\n ctx = stack.top\n if ctx is not None:\n if not hasattr(ctx, 'cache_redis'):\n ctx.cache_redis = self.init_redis()\n return ctx.cache_redis", "title": "" ...
[ { "docid": "6881087f66a27160ef90604730473508", "score": "0.7461873", "text": "def redis(self):\n if not self._redis:\n self._redis = Redis(self)\n return self._redis", "title": "" }, { "docid": "3e2ee58f21b6db258445b49769a72274", "score": "0.7202681", "text":...
d90d3b15455d45d6b597a96330b7666c
Finds location of the arm in space relative to the base.
[ { "docid": "56370a7d6be6343b3cbb6bd1907dcf21", "score": "0.55456394", "text": "def armLocation(length, theta, position = [0,0]):\n #print \"Angle:\",theta\n width = 263.5\n dx = 125\n dy = 40\n p1 = (position[0]+dx*cos(theta)+dy*cos(pi/2 - theta),position[1]-dx*sin(theta)+dy*sin(pi/2 - th...
[ { "docid": "978abb5b8a42371efd3b228c57c9b245", "score": "0.6127112", "text": "def GetBasePosition(self):\n ...", "title": "" }, { "docid": "5dfe8dc953ab0ca7337b4fb32f866076", "score": "0.58375865", "text": "def find_arm(self, arm):\n for idx in range(self.n_arms):\n ...
632fd86eb40d2badbab4f3c78dc6354a
Constructs a ResNet50 model.
[ { "docid": "5cd82c73ff832d739fb6bedd9ee42fa5", "score": "0.75137323", "text": "def resnet50(pretrained=False, **kwargs):\n model = ResNet(Bottleneck, [3, 4, 6, 3], **kwargs)\n # if pretrained:\n # model.load_state_dict(model_zoo.load_url(model_urls['resnet50']))\n return model", "tit...
[ { "docid": "93476a99b995c376193072cffd72e9f0", "score": "0.7939585", "text": "def resnet50():\n model = models.resnet50()\n model.apply(weights_init)\n return model", "title": "" }, { "docid": "7d29192d3203989df7a6d6610b2c6abd", "score": "0.77827954", "text": "def build_mode...
a404e163ba2393e46165fbcedf3f1591
command to display all the regrade requests
[ { "docid": "34f89319cd2655565707459797320655", "score": "0.6930176", "text": "async def display_requests(ctx):\n for name, questions in db.select_query(\n 'SELECT name,questions FROM regrade'\n ):\n if name:\n await ctx.send(name + \" \" + questions)\n else:\n ...
[ { "docid": "9e26b7c479dffb6328178f7b140df671", "score": "0.59886205", "text": "def show_requested(self):\n results = []\n for name, comp in sorted(self._requested):\n results.append(\n ansiformat(\n self._get_color(comp), \"{} {}\".format(name, ...
20bf984df908d1fb52677a7b15e96b59
Return an iterator to the link counts. Returned values have the form (start, end), count
[ { "docid": "acade2d19f779ef287dd95e2b6e85d02", "score": "0.64247334", "text": "def iterCounts(self):\n\n if self._obsCount:\n for period in sorted(self._obsCount.keys()):\n if self._obsCount[period]:\n yield period, self._obsCount[period] \n ...
[ { "docid": "f741166bf40f0bef0de6e35a4ccb277b", "score": "0.71143895", "text": "def count_sources(edge_iter: EdgeIterator) -> Counter:\n return Counter(u for u, _, _ in edge_iter)", "title": "" }, { "docid": "ff3aa2b5ab802e53c14ebe5ed8a281e0", "score": "0.67742", "text": "def getNu...
b96fb0c336541696d73fb3e20a0c16e4
loop over each image as query and evaluate its performance based on top_r selection
[ { "docid": "abd2b101df9f7c3f228309044a374c6c", "score": "0.0", "text": "def oneAgainstAllFaiss(y_true, hash_binary, cls_num_ac, top_r):\n precisions, recalls, dist = [], [], []\n numSample = hash_binary.shape[0]\n # index = faiss.IndexFlatL2(hash_binary.shape[1])\n # index.add(np.ascontiguou...
[ { "docid": "c36dbba6bc9e1aeb9366f525170254c5", "score": "0.58435273", "text": "def query(self, images):\n if self.pool_size == 0:\n return images\n return_images = []\n for image in images:\n if self.num_imgs < self.pool_size:\n self.num_imgs += ...
b2e98536efdc0cb2f58835cb49f27af1
The menu is seslected, create a click control.
[ { "docid": "8972ba31eb913b59f9149eddadeb28bd", "score": "0.5932137", "text": "def OnItem(self, e):\n self.process_control(e, \"click\")", "title": "" } ]
[ { "docid": "091f72e3307c61510e4290029546b2c2", "score": "0.6858837", "text": "def sig_activate(self, widget, menu):\n menu.event('clicked')", "title": "" }, { "docid": "8ab69f90be7788607bbdb641781d43ac", "score": "0.6697031", "text": "def click():", "title": "" }, { ...
3c22b47464a2ef66e958ecb9f5d8c7f5
Computes mutual information between two images variate from a joint histogram.
[ { "docid": "559f2a37553f7fa9c6f0e143c7d09a98", "score": "0.60261965", "text": "def similarity_measure(image1,image2,norm=True,bin_rule=None,measure=\"MI\"):\n arr1 = image1.ravel()\n arr2 = image2.ravel()\n if bin_rule == None or bin_rule == \"sturges\":\n dx,Nbins = sturges_bin_width(a...
[ { "docid": "44c5f9982842ac43a6b6ab9c7cab0b07", "score": "0.6591423", "text": "def mutual_information(X, Y):\n\n\n # compute limits\n X = X.compute()\n xmin = da.min(X).compute()\n xmax = da.max(X).compute()\n\n Y = Y.compute()\n ymin = da.min(Y).compute()\n ymax = da.max(Y).compute(...
1a33aa71cb2299b7dac98ae50b67f1f6
r"""Runs XFuse on the given data
[ { "docid": "db94527214781b4480b669c00dd34c4f", "score": "0.0", "text": "def model(self, xs):\n\n def _go(experiment, x):\n zs = [\n p.sample(\n f\"z-{experiment.tag}-{i}\",\n (\n # pylint: disable=not-callable\...
[ { "docid": "1a1581ba904d4e719c5c6aa04a0b3511", "score": "0.61807793", "text": "def multiFuse(self):\n ...", "title": "" }, { "docid": "1837128fa80992267a139987a47e61af", "score": "0.5791556", "text": "def run(data):", "title": "" }, { "docid": "f9424006c706b7763b8b...
0f103fc209bd989834da306461e14d99
Copy weights of Trainers model to this models weights.
[ { "docid": "91516ef8a36fe1c7703d319f56089274", "score": "0.6777867", "text": "def copyModel(self, model):\n self.model.set_weights(model.get_weights())", "title": "" } ]
[ { "docid": "f3a34e4992226f0c7fe056c772df87bc", "score": "0.72203034", "text": "def set_weights(self, weights):\n # Legacy support\n if legacy_models.needs_legacy_support(self):\n layers = legacy_models.legacy_sequential_layers(self)\n for layer in layers:\n ...
0cb0fb633d76572e5b881ae74abbc422
Update the hash by removing the previous item previtm and adding the next item nextitm. Return the updateed hash value.
[ { "docid": "213175198ac4dd069bc90b5e87438ad7", "score": "0.71016806", "text": "def slide(self, previtm, nextitm):\n self.curhash = (self.curhash * self.HASH_BASE) + ord(nextitm)\n self.curhash -= ord(previtm) * (self.HASH_BASE ** self.seqlen)\n return self.curhash", "title": "" ...
[ { "docid": "7bcef7fa2b1c6e9d48abb1a27dfdd9d4", "score": "0.59157664", "text": "def __re_cal_rhash(self):\n time_stp = datetime.datetime.now()\n self._prev_hashes.append(Hash(self.root_hash, time_stmp))", "title": "" }, { "docid": "304a18c014e428671494e225b163d128", "score":...
c3ebe951af73157175644fe9992ba196
gives a list of the faces
[ { "docid": "36e3fe5aabc13febf76929dbb5a3bb45", "score": "0.8191274", "text": "def list_faces(self):\n\t\tface = sorted(self.faces.items(), key=itemgetter(1), reverse =True);f =[]\n\t\tfor each in face: f.append(each[0])\n\t\treturn f", "title": "" } ]
[ { "docid": "8b5285d9316ec1c056307da87a87dc2c", "score": "0.76194733", "text": "def faces(img):\n return detector(img, 1)", "title": "" }, { "docid": "f65231c2483b76edc38e022adfab5345", "score": "0.7515052", "text": "def detect_faces(self):\n try:\n response = sel...
0c052b6fe1ad9e414a31d295b27d6d14
Return the postprocessed estimated halfwidth of the confidence interval.
[ { "docid": "c3ef6a9f70af4c303d73ee4b2f351256", "score": "0.0", "text": "def epsilon_estimated_processed(self) -> float:\n return self._epsilon_estimated_processed", "title": "" } ]
[ { "docid": "122d794a68ecb72583b6485cbec6a157", "score": "0.5895502", "text": "def band_width(self) -> pulumi.Output[Optional[int]]:\n return pulumi.get(self, \"band_width\")", "title": "" }, { "docid": "480a4bb0243d51ce844d30275d4c3e80", "score": "0.58554256", "text": "def get...
8c455e029d6f65c2169ccaf702a3d6e0
Gnerating data from homogenized diffusion problem.
[ { "docid": "05e6111125de46140914ec76980f55c1", "score": "0.0", "text": "def GenerateData(n_traj: int, length_traj: float, filename: str):\n\n U,U_fd,U_ref = [],[],[]\n\n # epss=np.logspace(-6,-3,21)\n eps = 1e-5\n\n for _ in range(n_traj):\n ttin = timeit.default_timer()\n prin...
[ { "docid": "c5fe77eb85d7111315011d81b34c315c", "score": "0.6364072", "text": "def diffusion():", "title": "" }, { "docid": "e78cfd5e581ba3e0c686a8f133343e1c", "score": "0.60929483", "text": "def g():\r\n\t# use only genes that are correlated with liver disease\r\n\tgene_cor_sorted_in...
e00d4854127bcc72d1cd6d58082bb8aa
Reads a YAML file and return a dictionary of its contents.
[ { "docid": "befca0db1c00c8ff4b3347f5daa50d39", "score": "0.6859964", "text": "def read_yaml_config(path):\n with open(path) as input_file:\n data = input_file.read()\n try:\n return yaml.load(data)\n except yaml.YAMLError, e:\n raise ValueError('Error parsing YAML file %s: %s' % (path, e))",...
[ { "docid": "8790fe5b5c4502b493d535daebb90b16", "score": "0.82360923", "text": "def read_yaml() -> dict:\n with open(CONFIG_FILE) as config_file:\n return yaml.load(config_file, Loader=yaml.FullLoader)", "title": "" }, { "docid": "f2b97221e12faf0a13d9506dc59f0d55", "score": "0.8...
2c0be3bdb13395e5faec089c68c32cc0
Loop for receiving messages from the server and calling the given handler.
[ { "docid": "3457228a51d88c8edcc897239a313816", "score": "0.64994836", "text": "async def handle(self):\n\n # wait until the socket object is created\n while self.__socket is None:\n await asyncio.sleep(0)\n\n # wait until the socket is ready\n await self.__socket.e...
[ { "docid": "1f6eb6286e8f5b57133d53eb6f7141b0", "score": "0.73473716", "text": "def handle(self):\n sock = self.request\n response = \"\"\n\n while True:\n try:\n objects = _read_objects(sock)\n response = server._callb...
36afa34acf326a9c7053b818cecc01ff
Convert list of tiles as returned by SH WFS into list of time ranges whose time deltas are not greater than max_timedelta.
[ { "docid": "c32b8a492c9b5dc658dfb7c466e6b815", "score": "0.7689309", "text": "def tile_features_to_time_ranges(cls, tile_features, max_timedelta: Union[str, pd.Timedelta] = '1H') \\\n -> List[Tuple[pd.Timestamp, pd.Timestamp]]:\n max_timedelta = pd.to_timedelta(max_timedelta) if isinst...
[ { "docid": "322f66d335834d6e7191aa041611eaff", "score": "0.6455336", "text": "def split(self, max_delta):\n assert isinstance(max_delta, timedelta)\n chunks = []\n chunk_since = self.since\n while chunk_since < self.until:\n chunk_delta = min(max_delta, self.until ...
a7c90f3bc19198d782a98754c8220f05
calculate a and b of y=a.x+b before including in the point p
[ { "docid": "d6e7219911aa3e8d7f7c2c10c2fa4687", "score": "0.6427087", "text": "def evalPoint(self, p):\n if not self._points:\n raise EvalPointError(\"\"\"Cannot calculate slope\n and intercept with a single point.\n \"\"\")\n x = p.x\n...
[ { "docid": "3420fc09cc7a6c8ccb3050887f7e8572", "score": "0.7422088", "text": "def point_add(a, b, p, x0, y0, x1, y1):\n\n # ADD YOUR CODE BELOW\n assert isinstance(a, Bn)\n assert isinstance(b, Bn)\n assert isinstance(p, Bn) and p > 0\n assert (isinstance(x0, Bn) and isinstance(y0, Bn)) o...
5c23c20f83b7e5f6c4fde5503aa792ee
Run aflshowmap on the target and get the coverage bitmap for a particular testcase.
[ { "docid": "7976f8ba9da94bc5b4cef400affa0d06", "score": "0.7753865", "text": "def run_afl_showmap(target: str, afl_stats: FuzzerStats, testcase: str) -> bytes:\n # Base afl-showmap options and arguements on afl-fuzz options and arguments\n afl_showmap_opts = ['-b', '-q']\n for opt, arg in afl_s...
[ { "docid": "40e66fffa9607e4942f5d9355e8da9d7", "score": "0.56286484", "text": "def show_coverage(self, viewer_id=None, table_group='main'):\n\n view_type = 'coverImage'\n cid = viewer_id if viewer_id else (\"%s-%s\" % (LO_VIEW_DICT[view_type], table_group))\n payload = {'viewerType'...
7de2e432a41ce01f92bdcf930bbdbe45
A rule statement that defines a string match search for AWS WAF to apply to web requests. See Byte Match Statement below for details.
[ { "docid": "588cd4e70cd75d6bde629d1c0c44578a", "score": "0.54430264", "text": "def byte_match_statement(self) -> Optional[pulumi.Input['WebAclRuleStatementRateBasedStatementScopeDownStatementByteMatchStatementArgs']]:\n return pulumi.get(self, \"byte_match_statement\")", "title": "" } ]
[ { "docid": "90ea33f01c95e611308c46f7671fe928", "score": "0.6055283", "text": "def byte_match_statement(self) -> Optional[pulumi.Input['WebAclRuleStatementAndStatementStatementAndStatementStatementAndStatementStatementByteMatchStatementArgs']]:\n return pulumi.get(self, \"byte_match_statement\")",...
bce6738a1a6462f06b945c022ba3e93f
Read solution from a binary file. Please refer to README.md for description of the binary file format used here.
[ { "docid": "eea1f3696bea425597d502f3e1952a69", "score": "0.6074145", "text": "def read_solution_from_file(path_to_data):\n\n data = open(path_to_data, \"rb\").read()\n\n # nx: number of x points\n # ----------\n\n start = 0\n end = 4*3\n (_, nx, _) = struct.unpack(\"@iii\", data[start:...
[ { "docid": "54d9052ff2375d0421dc2be1610b999e", "score": "0.65914464", "text": "def read_binary(filename):\n with FileBinaryReader(filename) as f:\n return f.read()", "title": "" }, { "docid": "83beb9771c450aa37bce0e79e62b5fcc", "score": "0.6584203", "text": "def load_soluti...
16d29fd4457273d8c9392acf2e3ee714
Builds predefined pages and puts them into the paginator.
[ { "docid": "13d00e00d4e316949f7f6b0d7981e6b5", "score": "0.758468", "text": "async def build_pages(self):\n paginator = LinePaginator(prefix=\"\", suffix=\"\")\n\n # Add general info page\n paginator.add_page(Page(\n strings.Info.bot_welcome,\n \"\",\n ...
[ { "docid": "d4904c1eae48a04ca36df142f4678fa7", "score": "0.71009964", "text": "def generate_all_pages():\n fetcher = getattr(parent, fetcher_str)\n\n first_page = fetcher.get(**kwargs)\n kwargs['page_size'] = len(first_page)\n count = fetcher.current_total_cou...
afe6f0ceb315a8b809fa6471a104b182
Returns the number of days between year1/month1/day1 and year2/month2/day2. Assumes inputs are valid dates in Gregorian calendar.
[ { "docid": "d8b73162f072e405ab0afb00e8a23a25", "score": "0.75588286", "text": "def daysBetweenDates(year1, month1, day1, year2, month2, day2):\n # program defensively! Add an assertion if the input is not valid!\n assert month1 in range(1, 13) and month2 in range(1, 13), \" the value of month shou...
[ { "docid": "5bb3242f99f100bec5f8ed8c05ac123d", "score": "0.84254104", "text": "def days_between_dates(year1, month1, day1, year2, month2, day2):\n\n days = date_in_days(year2, month2, day2) - date_in_days(year1, month1, day1)\n return days", "title": "" }, { "docid": "ff3fe8202499476d8...
05bbe2e0b7965809ebd65daeb904cc8c
Helper method to locate row in database
[ { "docid": "dbdd4b554715401408c8f7b90e2a0625", "score": "0.0", "text": "def check_for_app(app):\n if (app == \"all\"):\n return -1\n count = 0\n for row in cur.execute(\"SELECT * FROM passwords WHERE application=?\", (app,)):\n count+=1\n else:\n return count", "titl...
[ { "docid": "297fb191bddda71a9dc5e40d64edc8c6", "score": "0.667747", "text": "async def find(self, pk_value: Any) -> RowProxy:", "title": "" }, { "docid": "6c84afbfd114dc604b825ace3583251d", "score": "0.64952505", "text": "def find_row(table, row):\n for idx in range(len(table)):\n...
61f0f13a2701498ff9538f00e55c8cc6
Returns the log of probability estimates.
[ { "docid": "6719902eb571034a7a96440a4eb1d871", "score": "0.68925774", "text": "def predict_log_proba(self, X):\n return np.log(self.predict_proba(X))", "title": "" } ]
[ { "docid": "e0cf42a38133d6cf396650edba63c72c", "score": "0.73786455", "text": "def priorlogprob(self):\n return numpy.array([p.logpdf(x) for p, x in zip(self.getpriors(), self.getparams())])", "title": "" }, { "docid": "01f0ec5bea8d6e48c9938f08f2177d9b", "score": "0.7042134", ...