query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
6c3f7c11e36323549ee6baccc7129fab
create a RDKit molecule object from scratch info
[ { "docid": "d63a27b58fac7413d276ab63049e13ef", "score": "0.0", "text": "def build(self, sort_atom=F, sanitize=True, removeHs=False):\n if self.na > 999:\n ctab = write_pdb( (self.zs, self.chgs, self.bom, self.coords), sort_atom=sort_atom)\n m = Chem.MolFromPDBBlock(ctab, san...
[ { "docid": "f490e9fb88f43e9e2bd73e8f595c1a62", "score": "0.5770976", "text": "def makeRecipe(molecule, datname):\n\n ## The Profile\n profile = Profile()\n\n # Load data and add it to the profile\n profile.loadtxt(datname)\n profile.setCalculationRange(xmin=1.2, xmax=8)\n\n ## The Prof...
56294e61d8944a90327bc76db58b1e8e
function which returns the molecular mass of a chemical species based on its name >>> molecule='nitrogen_dioxide' >>> print(molecule, get_molmass(molecule)) nitrogen_dioxide 46.00682 If attempt to get the molecular mass of a cube where the molecule name is not recognised, a value error is raised To extend this function...
[ { "docid": "7f4d78385c3d285af5a6ca8d3ce383c0", "score": "0.80399835", "text": "def get_molmass(molecule):\n\n # note that we need to replace underscores with spaces\n molecule = molecule.replace('_', ' ')\n\n # Now try and look up the molecule passed in\n # if it is not in the dictionary rai...
[ { "docid": "85ac180ccc58ee5f950a14da7ffd4e48", "score": "0.7116969", "text": "def getMass( self, unit ) :\n\n# FIXME Still need to correct for electron masses and binding energy.\n if len(self.mass) > 0: return self.mass[0].float(unit)\n return self.nuclide.getMass(unit)", "title": "" ...
78a76e3aad152a82a60cf576ac3411a8
Only keeps rectangular possiblynested sequences of primitives.
[ { "docid": "476137becee5dcbc0b3b6f13856c728e", "score": "0.0", "text": "def TENSOR_LIKE_SEQUENCE_FILTER(arg_value):\n return arg_value.is_sequence and arg_value.sequence_dtype is not None", "title": "" } ]
[ { "docid": "e03bc414556dff6905fd101e1817436c", "score": "0.5820732", "text": "def removeContainedBoxes(boxes):\n if boxes is None:\n return\n\n inside_id = []\n for i in range(len(boxes)):\n ri_x = boxes[i][0]; ri_y = boxes[i][1]; ri_w = boxes[i][2]; ri_h = boxes[i][3]\n\n ...
ef0dc0aafaea8e44f1f5be1248ccd400
Return tuple of positional and keywrord argument names for a function, method, class or callable. In case of a class, its ``__init__`` method is considered. For methods the ``self`` parameter is not included.
[ { "docid": "e6d257693c0aaa0749862f8a8ce2b631", "score": "0.6350734", "text": "def varnames(func):\n cache = getattr(func, \"__dict__\", {})\n try:\n return cache[\"_varnames\"]\n except KeyError:\n pass\n\n if inspect.isclass(func):\n try:\n func = func.__init...
[ { "docid": "4c90ad3810d0e33a1daac63b151a5a3c", "score": "0.69376844", "text": "def _get_funcargs(cls, varname: str) -> tuple:\n return getattr(cls, varname, (...,))", "title": "" }, { "docid": "eba33dc643d6ea78fe704731e895f898", "score": "0.69193465", "text": "def arg_names(self):...
335758eb754227fcc0c48c709f4d0ba8
Copies driver files from a VirtIO CD to the guest. The kernel driver (.sys), setup information file (.inf) and signed catalog file (.cat) are copied.
[ { "docid": "b344df495b4ba0e73f9c6e721e2b0694", "score": "0.6024463", "text": "def install_driver(self, name, overwrite=False):\n exts = {\n \"sys\": \"system32/drivers\",\n \"inf\": \"inf\",\n \"cat\": \"system32/CatRoot\",\n }\n vio_win_name = _WIND...
[ { "docid": "1c708092656f1cdb27930811e53e2d64", "score": "0.59442574", "text": "def make_add_cdrom_device_spec(cdrom):\n (c_bus_number, d_unit_number) = cdrom['vdev_node'].split(':')\n cdrom_spec = vim.vm.device.VirtualDeviceSpec()\n cdrom_spec.operation = \"add\"\n cdrom_spec.device = vim.vm...
48bca57f33f077bf1c973e4c39d0734e
Creates the database tables.
[ { "docid": "a0c82c0aa67bdf918dfc0fe0ee9ca9d4", "score": "0.0", "text": "def init_db():\n with closing(connect_db()) as db:\n with app.open_resource('schema.sql') as f:\n db.execute(f.read())", "title": "" } ]
[ { "docid": "21b848f6d5f2677acb386f94c490794b", "score": "0.8628246", "text": "def setup_tables():\n db = config['Default']['database']\n try:\n cm = ConnectionManager(db)\n cm.connect()\n metadata.create_all(cm.engine)\n print(\"Tables successfully created.\")\n exce...
29eb4a58d7c2a25a7cc6533a13edd3a7
Executes a saved command.
[ { "docid": "a263b9f0dca237ea6250865b2ec6a83e", "score": "0.0", "text": "def cli(ctx, pattern):\n json_path = os.path.join(os.path.expanduser('~'), '.keep', 'commands.json')\n if not os.path.exists(json_path):\n click.echo('No commands to run. Add one by `keep new`.')\n else:\n FOU...
[ { "docid": "e5ad654b54a14bdc5b67f0b25e1d9d32", "score": "0.73189586", "text": "def save(self, *args, **kwargs):\n self.execute = \"\\n\".join(self.execute.splitlines())\n super(Command, self).save(*args, **kwargs)", "title": "" }, { "docid": "aeda881dc630cfcb36681f5b5e2e9376", ...
642566e4f57772c7726a487643b9c8d6
Gets the next image.
[ { "docid": "a40ab87ad5587261e89c0df1719fcfb8", "score": "0.64370894", "text": "def get_next_det_image(self): \n self.det_main_img_axis.clear()\n self.det_cur_img_index += 1\n img,label = self.det_dataloader.dataset[self.det_cur_img_index]\n img = img.unsqueeze(0)\n sel...
[ { "docid": "c8e603529fa23ce56e4a76e0ad554ad1", "score": "0.84023815", "text": "def load_next_image(self):\n return self.q.get()", "title": "" }, { "docid": "3ebca855ec72178a384dc8b5ffa89a9e", "score": "0.79071504", "text": "def nextImage(self):\n\t\tif (self.current_image_inde...
bef603b0b2ac4818a051d293f7055c86
Assumes all lists are same length
[ { "docid": "38f5462a8e128b482cbf4dd3d805dc59", "score": "0.5995612", "text": "def addLists(list_of_lists):\n sumOfLists = []\n x = -1\n y = -1\n for i in range(0, len(list_of_lists[0])):\n x += 1\n keep = 0\n while y < len(list_of_lists) - 1:\n y += 1\n ...
[ { "docid": "dd024997d6b82616e3c8346ee8cb74f9", "score": "0.671178", "text": "def listsizes():", "title": "" }, { "docid": "8072e90822feb2d3ea4c7723a95116b3", "score": "0.6422881", "text": "def sequential_comparison(list_of_lists):\n return [sequential_neighbor(List) for List in li...
0a12739b3ca783797695c8157478c16e
Obtiene los miembros del equipo y los guarda en la base de datos. team es Github.Team.
[ { "docid": "c3f97272580890f6be38f882fdaeb7b5", "score": "0.0", "text": "def save_dev_membership(team):\n for member in team.get_members():\n query = session.query(models.Member).\\\n filter(models.Member.dev_id == member.login,\n models.Memb...
[ { "docid": "5e74950d1fed29bedf12b29611fb7865", "score": "0.62554234", "text": "def save_teams(data, page):\n \n # Ver si hay un equipo que exista con los datos entrantes\n team = Team.objects.filter(name=data['club']['name']).first()\n\n # Bool para saber si es registro nuevo\n is_new = F...
15bc3575da9286681864ce5d6191cbfd
Return a `str` version of this GatewayPortIdentity object.
[ { "docid": "2cf9b875eb06b425502cda82c259817d", "score": "0.0", "text": "def __str__(self) -> str:\n return json.dumps(self.to_dict(), indent=2)", "title": "" } ]
[ { "docid": "be9ce849c92e7bfb9d8d919c7210c71f", "score": "0.7250259", "text": "def to_string(self):\n return \"{}.{}[{}]->{}\".format(self.driver, self.port, self.pin, self.interconnect)", "title": "" }, { "docid": "a28972152c2a23083b160280dc4b1ba5", "score": "0.7187217", "text...
ab7fca2470ff47b20b2a98fce4c41a75
This method returns all Event connectors related to the run Process and Event. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response.
[ { "docid": "583a885d20092dafd8acb8cd9a9ea4e3", "score": "0.47278807", "text": "def find_event_connector_by_id_with_http_info(self, process_id, event_id, connector_id, **kwargs):\n\n all_params = ['process_id', 'event_id', 'connector_id']\n all_params.append('callback')\n all_params....
[ { "docid": "761f93a80a0746b8115d597be6cdf74a", "score": "0.6226422", "text": "def find_event_connectors(self, process_id, event_id, **kwargs):\n kwargs['_return_http_data_only'] = True\n if kwargs.get('callback'):\n return self.find_event_connectors_with_http_info(process_id, ev...
0809ee599aa6b07f86a053854ceee480
Backup the games assets
[ { "docid": "71bcd836f8cc25ecf4dbd856096a81a0", "score": "0.6175193", "text": "def backup_vanilla_assets(sc_path: str, vanilla_dir: str) -> bool:\n speech_dir = os.path.join(sc_path, 'fx', 'Speech')\n binks_dir = os.path.join(sc_path, 'binks')\n aiv_dir = os.path.join(sc_path, 'aiv')\n\n fx_f...
[ { "docid": "c322445b95b73659de869e4ff9f56c11", "score": "0.6529334", "text": "def backup(self):\n pass", "title": "" }, { "docid": "3345cd0b243a01f345c7bfec9cbc1b7a", "score": "0.64462405", "text": "def save_base(self, path):\n pickle.dump([self.players, self.games, sel...
c9234869cb20d6ee80388ff29681fd58
Test old hotfix. CMFPlone has patches/publishing.py, containing the publishing patch from Products.PloneHotfix20160419. This avoids publishing some methods inherited from Zope or CMF, which upstream does not want to fix, considering it no problem to have these methods available. I can imagine that. But in Plone we have...
[ { "docid": "d433c3e33b6bdeb150f4119ca54eb02f", "score": "0.6920851", "text": "def test_old_hotfix(self):\n self.portal.invokeFactory(\"Document\", \"doc\")\n transaction.commit()\n portal_url = self.portal.absolute_url()\n doc_url = self.portal.doc.absolute_url()\n bro...
[ { "docid": "6066b1f5d5ee09a70b578930fc54ac93", "score": "0.58093923", "text": "def test_bug_18045_normal(self):\n\n self.pkgsend_bulk(self.rurl, self.installed_18045)\n self.api_obj.refresh(immediate=True)\n self._api_install(self.api_obj, [\"runtime/python-2...
4b0ed3361004aee2b49d45c7f9dd7253
Returns True if the position passed represents a double press. i.e. The last interaction was the button was to release it, and the time to press is less than the double_press_time.
[ { "docid": "aa8d0ed46050df0d980390b591fbede1", "score": "0.8744822", "text": "def is_double_press(self, position):\r\n double_press = False\r\n #was there a previous interaction\r\n if self._interaction:\r\n # was the previous interaction complete (i.e. had it been releas...
[ { "docid": "4c91afadab945154784cf9d6e3c31d2b", "score": "0.75115657", "text": "def when_double_pressed(self):\r\n return self._when_double_pressed", "title": "" }, { "docid": "91f5f906aa17bb31c7636e771ac8fa53", "score": "0.73344475", "text": "def wait_for_double_press(self, ti...
b143cf43dc587895dae0f19526af567b
Make the Pelvis Axis function Takes in a dictionary of x,y,z positions and marker names, as well as an index. Calculates the pelvis joint center and axis and returns both.
[ { "docid": "ef6a50cecd41320235fe57ba5a6aa9f0", "score": "0.55933523", "text": "def pelvis_joint_center(frame):\n # Get the Pelvis Joint Centre\n RASI = frame['RASI']\n LASI = frame['LASI']\n\n try:\n RPSI = frame['RPSI']\n LPSI = frame['LPSI']\n # If no sacrum, mean of ...
[ { "docid": "143bc4c330ec71ffc7200ab1efd27805", "score": "0.60773385", "text": "def returnAxesInfoForFootTransform(transform, foot_vec_dict):\n # Get the vector crossing the length of the foot \n foot_cross_vec = foot_vec_dict['cross']\n\n # Get the vector along the aim of the foot\n foot_ai...
d9de6404eb0e425b298065aeb305abb1
print the json response to the console
[ { "docid": "499f5d26bb626a07969b8dd9b850454d", "score": "0.7942105", "text": "def print_result(self):\n json_resp = json.dumps(self.query_response)\n print('--> JSON Response', json_resp)", "title": "" } ]
[ { "docid": "5b7e4f130682f48d02726199d1818b48", "score": "0.79296833", "text": "def print_one_string(response):\r\n print(response.json())", "title": "" }, { "docid": "86632caa905d24bccf2c05347d9605ee", "score": "0.77987415", "text": "def print_json(self):\n pass", "titl...
79f2cdf206a4b88984cbc147ede5b3d0
Search references in the database
[ { "docid": "61f143eebf464034b6bda01d73091e6c", "score": "0.58271915", "text": "def search(args):\n try:\n sys.path.append(os.getcwd())\n\n import database\n from .operations import load_work, work_to_bibtex, reload, find\n reload()\n results = {x for x in find(args....
[ { "docid": "792f6c0f77427c671da4682308163a61", "score": "0.6469385", "text": "def get_references(ref):\n table = DB.table(ref)\n return table.all()", "title": "" }, { "docid": "84065e58a5dd5ed3a5ed961fa33a7667", "score": "0.6444353", "text": "def references(self, param=\"\"):\n...
e4e0141d306486215cf018c6763b08ca
Performs a depthfirst traversal of the state tree, where each branch is a different fork
[ { "docid": "eab29860c1ff62fbc987aa46172cb77d", "score": "0.6549031", "text": "def print_fork_tree(states: typing.Dict[int, StateDescriptor]):\n\n def df_print(state_id, depth=0):\n state = states[state_id]\n\n # Prepare a debug message about the state based on its current status\n ...
[ { "docid": "e91cf865a445bd3ba897bdce131be220", "score": "0.6715602", "text": "def iterative_deepening(initial_state):\n depth = 0\n\n while True:\n ret = dfs(initial_state, depth) # return value of the `dfs`\n print(\"Depth:\", depth)\n if ret is not None:\n return...
ce823a009f4154cc77cb7f3def4aed24
OAuth callback. Will load the state and the response and login the user if it can.
[ { "docid": "f551014ea28a16070c87ecb6ce1bf861", "score": "0.6258861", "text": "def authorize(self):\n try:\n state = json.loads(base64.b64decode(request.args.get('state')).decode('UTF-8'))\n except Exception as e:\n print(e)\n state = {'next': url_for('MetaV...
[ { "docid": "ff24c61c1ae6dcec64d37e395c0f7a46", "score": "0.68280095", "text": "def authorized_callback(app, oauth_type):\n oauth = _oauth_client(app, oauth_type)\n resp = oauth.authorized_response()\n if not resp:\n pkdlog('missing oauth response')\n werkzeug.exceptions.abort(403)...
705056acb7a2a373c56004ccbe4d94da
Downloads a single URL to a file on disk.
[ { "docid": "7dec849541fd8f30da30d03e65c69dcb", "score": "0.7134277", "text": "def download_single_url(self, url):\n\n infodict = {'url': url}\n if len(url) > 0:\n filename_on_disk = self.compute_unique_filename_on_disk(url)\n\n # download file:\n try:\n ...
[ { "docid": "99bc8585b8f8fb2913d8c58e78a0cbfe", "score": "0.7879106", "text": "def download_file(url, filename):\n print(\"Starting Download...\\nDownload URL: {}\".format(url))\n with requests.get(url, stream=True) as r, open(filename, 'wb') as f:\n shutil.copyfileobj(r.raw, f)\n\n print...
b1d03757531cc0ad42ff390d76701dd9
Forward data from one side to the other.
[ { "docid": "14ac17326ae340271da5fdf870590f54", "score": "0.0", "text": "async def forward_data_task(\n self,\n dir_str: str,\n reader: StreamReader,\n writer: StreamWriter,\n exit_q: asyncio.Queue,\n exit_status: int,\n ):\n try:\n while Tru...
[ { "docid": "d5acecabaf6d17bdd23207a7bc855a29", "score": "0.7457351", "text": "def forward(self):", "title": "" }, { "docid": "d5acecabaf6d17bdd23207a7bc855a29", "score": "0.7457351", "text": "def forward(self):", "title": "" }, { "docid": "c205a780d50e749fde6e6c9398dcc404...
30a2e41d50fb7b3e87ce7e6eea0b0ba7
Loads the scene at cursor position
[ { "docid": "c53ae83809d367e51ec734532d2a05ce", "score": "0.5126262", "text": "def loadBaseScene(self, force=False):\n logger.debug(\"Func: loadBaseScene\")\n relSceneFile = self._currentSceneInfo[\"Versions\"][self._currentVersionIndex-1][\"RelativePath\"]\n absSceneFile = os.path.j...
[ { "docid": "f886132f410f52dc182ae21dae9d0c53", "score": "0.63543177", "text": "def menu_load_scene(self):\n file_name = QtGui.QFileDialog().getOpenFileName(self, \"Choose Scene File\", get_data_path(), \"*.pkl\")\n with open(file_name, \"rb\") as f:\n self.scene = pickle.load(f)...
72df6a14864fed43bf41a7c37c7c91e0
Equivalent to 'snap rename '
[ { "docid": "a011e09c0d546535e6e616a2c7bef3a1", "score": "0.6832444", "text": "def snapshot_rename(self, current_name, new_name):\n\n self.filer.invoke('snapshot-rename',\n 'volume', self.name,\n 'current-name', current_name,\n ...
[ { "docid": "1be7a7de8532e616b561f8f832af01ea", "score": "0.67915624", "text": "def rename(old, new):\n run([\"rename\", old, new])", "title": "" }, { "docid": "eaefe78f79682e952d12712bd3a45ec5", "score": "0.67752296", "text": "def rename(src, dst):\n pass", "title": "" },...
75b08366253a5f3026dc998fa26f67e4
Given two strings, write a method to decide if one is a permutation of the other
[ { "docid": "0d359c7af9d5371d2ad776b186e59e32", "score": "0.82985634", "text": "def check_permutation(first, second):\n\n # first of all, both strings must have the same length\n if len(first) != len(second):\n return False\n\n # we will use a counter dictionary to count the chars in both...
[ { "docid": "adec46ad7c2bdb0f7aa0e2b0a5459235", "score": "0.86076456", "text": "def is_string_permutation(s1, s2):\n if len(s1) == len(s2): # must be same size to be a permutation of the other string\n s1_lst = list(s1)\n s2_lst = list(s2)\n for currentChr in s1_lst:\n ...
9cd8165fec1ca7f8dffcd547b4e6f91a
UnpPack a route into a string
[ { "docid": "628ada664ad4d8c93eb8fd7343045ce1", "score": "0.65899783", "text": "def routeunpack(value):\n return str(value).replace(\"!\",\"/\")", "title": "" } ]
[ { "docid": "17f387f4db30ee49bf8fce84afe609c1", "score": "0.52920175", "text": "def make_full_route(self):\r\n regpath = ''\r\n for part in self.routelist:\r\n if isinstance(part, dict):\r\n regpath += '%(' + part['name'] + ')s'\r\n else:\r\n ...
b2ba2ac873afeee2f0725e6f1b0652ce
Sets the specified weights to the network.
[ { "docid": "215e22f93f0c60d30e7618d068bb133f", "score": "0.85788", "text": "def set_weights(self, weights: object):\n pass", "title": "" } ]
[ { "docid": "5811e3ba3e60902c890d72ab3904ed76", "score": "0.8840008", "text": "def set_weights(self, weights):\n pass", "title": "" }, { "docid": "b412838cc98f709b131ae37ef79435d2", "score": "0.8778187", "text": "def set_weights(self, weights):\n self.weights = weights",...
7a8b6443d7c16773755e199995c953ef
Create a directory at the current working directory
[ { "docid": "5a20c5ee703087727b98d0c7985ac5a5", "score": "0.7041337", "text": "def mkdir(name):\n os.mkdir(name)", "title": "" } ]
[ { "docid": "3a138e9cc890b1c597e55c1914ee3fc7", "score": "0.796372", "text": "def createDir(self):\n try:\n os.makedirs(os.path.join(self.path))\n except OSError:\n # Fail silently on any OS errors\n pass", "title": "" }, { "docid": "c52fee7d47d9...
5eac6d32105cd42aa814f9b07007065f
Does a tensor contain NaNs.
[ { "docid": "214ed8a0710bac163123c17fd80695ea", "score": "0.83893895", "text": "def has_nans(tensor, verbose=True):\n tensor_numpy = tensor.data.cpu().numpy().flatten()\n where_nan = numpy.argwhere(tensor_numpy != tensor_numpy)\n\n nan_count = len(where_nan)\n nan = nan_count != 0\n\n if v...
[ { "docid": "710c8a8b9c40cbf54b856a60b56d26e7", "score": "0.82159275", "text": "def has_nan(x):\n return bool((x != x).sum() > 0)", "title": "" }, { "docid": "7a6f17acfc46fddada1ce23bcad5da8a", "score": "0.8094285", "text": "def torch_isnan(x):\n if isinstance(x, numbers.Number)...
9a6310fa7d99ceecb5c05a2681894c4b
Simply quits the program.
[ { "docid": "4bc218877aefa6278912a926a696f8b7", "score": "0.7919135", "text": "def quit_the_program():\n print('Tschüss')\n sys.exit()", "title": "" } ]
[ { "docid": "9ff06877bd1a23fddb29ff0853b1ffb8", "score": "0.81753623", "text": "def quitProgram():\r\n print(\"Program exited\")\r\n sys.exit()", "title": "" }, { "docid": "26b52d0300420fea5c9af688063ed615", "score": "0.8020633", "text": "def exit_program():\n quit()", ...
66b9e28684d35392a3b1e4e55560012a
Return emoji score and emoji char
[ { "docid": "8c03fe698333ce6daceb4e54c918a6f4", "score": "0.0", "text": "def movie_data_2016():\n # query for the top 10 revenue movie data\n results = db.session.query(Movie.title, Movie.revenue, Movie.budget).\\\n filter(and_(Movie.release_date.like('%16'), (Movie.budget >= 1000000.0))).\\...
[ { "docid": "aad6fb5f76d8bbf5a9458cc4e969d8f6", "score": "0.64628303", "text": "def nearest_emoji(score: float) -> str:\n array = np.asarray(list(EMOJI_EMOTIONS.keys()))\n index = (np.abs(array - score)).argmin()\n emoji_index = array[index]\n if emoji_index:\n return EMOJI_EMOTIONS[em...
5a6d6b48dd51876df21beb6fa5d41174
Returns a function that deploys a compiled contract
[ { "docid": "2a48149318dcd140d738f77fd03a8ca1", "score": "0.73027295", "text": "def deploy_contract(deploy_contract_txhash):\n def fn(\n web3,\n deployer_address,\n abi,\n bytecode,\n args,\n ):\n contract = web3.eth.contract(abi=abi, by...
[ { "docid": "e16dfdd9c5fc9c158dfe9782ba90532b", "score": "0.71858716", "text": "def deploy_tester_contract(\n web3,\n contracts_manager,\n deploy_contract,\n):\n def f(contract_name, libs=None, args=None):\n json_contract = contracts_manager.get_contract(contract_name)\n ...
8973dd8bd398458801e87546276df3ad
Configure the quantization behavior by setting config variables.
[ { "docid": "f9e8b2fad0099b851f22dd0b77d171fa", "score": "0.6312448", "text": "def qconfig(**kwargs):\n node_args = {k: v if k not in kwargs else kwargs[k]\n for k, v in QConfig._node_defaults.items()}\n return _make.node(\"relay.quantize.QConfig\", **node_args)", "title": "" ...
[ { "docid": "5e4373596af0532af838a55e803f69bc", "score": "0.63947123", "text": "def for_dynamic(cls) -> 'QuantizationConfig':\n return QuantizationConfig()", "title": "" }, { "docid": "a5446a51cee2c0db335a7d627ce8d031", "score": "0.61188734", "text": "def setup(self):\n \n ...
8c068de81227aeefa72a67b73b566180
synthesize image from source to target
[ { "docid": "21b1a88713452af041f2c1558227f591", "score": "0.0", "text": "def stereo_synthesize_loss(self, source_img, target_ms, target_depth_ms, pose_t2s, intrinsic, suffix=\"\"):\n pose_stereo = cp.pose_matr2rvec_batch(tf.expand_dims(pose_t2s, 1))\n\n # synth_target_ms: list of [batch, 1,...
[ { "docid": "c73c5b0fb8da6c806ee50bb6afd52f59", "score": "0.66019917", "text": "def set_source_image(self, source_ndarray):\n raise RuntimeError(\"Unimplemented method\")", "title": "" }, { "docid": "349d5921b94572a878e049b6b722a642", "score": "0.6539507", "text": "def set_imag...
9d7be8d547a1edf89626848380c5d3d8
Show available discard, choose where to get card.
[ { "docid": "3db8855b8343e5fc0ae558ba802e9798", "score": "0.6061682", "text": "def turn_start(self, move: Move) -> None:\n self.print_turn_screen()\n self.action_text(\"Take discard or draw?\")\n print()\n self.context(\"Available discard: {}\".\n format(mo...
[ { "docid": "73a6ac0425f826599468137fdf6e729f", "score": "0.71386373", "text": "def on_cards_chosen(self, discards):\n pass", "title": "" }, { "docid": "95f503cc60ef150e05aff695428d191d", "score": "0.70201945", "text": "def discard(hand, dealer):\n visual.clear_screen()\n ...
f0433c70cb26564958485c0ea3a6018b
Returns an OptionParser object with all the default options.
[ { "docid": "a015d716708034c492ca0d950c1787ec", "score": "0.0", "text": "def MakeArgParser(estimators):\n parser = ArgumentParser(description='A script for running OBD analysis for a gradient of concentrations')\n parser.add_argument('-c', '--config_fname', action='store',\n ...
[ { "docid": "d0bb6b1423d0a2de82e1c0bd68953516", "score": "0.71966404", "text": "def _create_parser(self):\n parser = optparse.OptionParser(usage='', add_help_option=False)\n parser.disable_interspersed_args()\n self.configure_parser(parser)\n return parser", "title": "" ...
5954f0514a703681399511e7be646635
Sets the owner_references of this V1ObjectMeta.
[ { "docid": "3ea9368cdcd9889056309e54ead156e3", "score": "0.82682514", "text": "def owner_references(self, owner_references):\n\n self._owner_references = owner_references", "title": "" } ]
[ { "docid": "ca100a0fb99b4a3199f69f71ccd5761b", "score": "0.65113187", "text": "def owners(self, owners):\n\n self._owners = owners", "title": "" }, { "docid": "ca100a0fb99b4a3199f69f71ccd5761b", "score": "0.65113187", "text": "def owners(self, owners):\n\n self._owners ...
81cff0c557b6cfd56de7e42f977b8227
Creates a dvport group on the specified Distributed Virtual Switch with the vlan tags supplied.
[ { "docid": "89fb6983e88f25c738d23e155c936d19", "score": "0.70796925", "text": "def create_port_group(session, dvs_name, pg_name, vlan_id):\n LOG.debug(\"Entered create_port_group :\"\n \" (dvs name, portgroup name, vlanid) : (%s, %s, %s)\" %\n (dvs_name, pg_name, vlan_id))\n...
[ { "docid": "f0a7c6396e0f9f3854dc906925af032d", "score": "0.5728364", "text": "def _get_add_vswitch_port_group_spec(client_factory,\n port_group_name, vlan_id):\n vswitch_port_group_spec = client_factory.create(\n 'ns0:DVPortgroupConfigSpec')\n vswitch_por...
e56cf55cd1ac51af31afc7241fcad5a3
Return fileId from a url.
[ { "docid": "6ddf031d3d7f70b93a2cb984afc19374", "score": "0.83659995", "text": "def fileId_from_url(url):\n raw_fileId = re.findall(r'~[\\w]+/[0-9]+$', url)[0][1:]\n return raw_fileId.replace('/', ':')", "title": "" } ]
[ { "docid": "c3eb208742793a70362a1015a94c54e4", "score": "0.8446173", "text": "def fileId_from_url(url):\r\n\r\n raw_fileId = re.findall(\"~[A-z.]+/[0-9]+\", url)[0][1: ]\r\n\r\n return raw_fileId.replace('/', ':')", "title": "" }, { "docid": "b732360ee57a8234e39e6962832ef33e", "sco...
89d4207af1a49d95a3b2b6eafb19909c
Apply formatting to command, after escaping all arguments.
[ { "docid": "7aa9f32ebf801ec42dd3789761f86a41", "score": "0.7210737", "text": "def format(cls, command, *args, **kwargs):\n fargs = [cls.escape(arg) for arg in args] # pylint: disable=E1120\n fkwargs = dict(\n (key, cls.escape(value)) # pylint: disable=E1120\n ...
[ { "docid": "a71f651003c1aa5640ce1b258e3d7a97", "score": "0.6286698", "text": "def __call__(self, command, **format_args):\n git = self.set(command, **format_args)\n\n git_command = f\"git {' '.join(git._args)}\"\n git_command = re.sub(' +', ' ', git_command)\n\n # Format to s...
e2c704f095f831535252bea14553ba67
Converts string production to deserialized objects of all productions
[ { "docid": "fef3538d4de52754907a61fc7ef4742f", "score": "0.6497535", "text": "def _parse_production(cls, production: str):\n productions = []\n string_productions = production.split('|')\n for string_production in string_productions:\n productions.append(cls._parse_symbol...
[ { "docid": "31bc3f8939eaed9dccd3a877d1e88c68", "score": "0.5999906", "text": "def _parse_productions(*productions):\n return [parser_types.Production.parse(p) for p in productions]", "title": "" }, { "docid": "45f08cafda83671baf031614b8533fd2", "score": "0.5975294", "text": "def des...
12545d6c23df672406f3c22eb656f99f
min is the start of the range, inclusive.
[ { "docid": "a184d7c0e02cc2cf4e2d77542ef46b67", "score": "0.70370907", "text": "def min(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"min\")", "title": "" } ]
[ { "docid": "b05c1e2d7762ffab21e951ce3145d680", "score": "0.81204927", "text": "def minimum(self, start, end):\n return self.foldl1(start, end, min)", "title": "" }, { "docid": "d977ee08a74221f1311eaf99d1df4cce", "score": "0.8115792", "text": "def min_range(self):\n retu...
fd5f5cf260757f399b179eb623bcc45c
Method to execute an auction and return its result.
[ { "docid": "f8935e72861a708102a1f2ad9370af27", "score": "0.81326866", "text": "def _execute_auction(self, auction):\r\n result = Result()\r\n if self._is_valid_auction(auction):\r\n # if we have a valid auction determine the site\r\n site = self._config.get_site(aucti...
[ { "docid": "104cfb40cb15a5477671a8a9a73c7d62", "score": "0.6842456", "text": "def execute_auctions(self, auctions_json):\r\n results = list()\r\n for auction in JsonObj.loads(Auction, auctions_json):\r\n results.append(self._execute_auction(auction))\r\n # return auction ...
26159be2323045ebd344100f2fa3af72
Reports a given candidate as positive, effectively removing its points from the incache PointSet, making sure they never come up again, and don't misguide the rest of the search.
[ { "docid": "2d9c4d64496d460506765dfb3c354dc3", "score": "0.8525394", "text": "def report_positive(self, candidate):\n for point in candidate.points:\n try:\n self.pset.remove(point)\n self.banned_starts.remove(point)\n except (ValueError, KeyErr...
[ { "docid": "5f1b20435a1fe04c0a9537d0257eeefc", "score": "0.64094204", "text": "def remove_point(self, x):\n idx = np.sum(np.abs(self.proposed_points - x), axis=1).argmin()\n self.proposed_points = np.delete(self.proposed_points, idx, axis=0)\n for i in range(len(self.search_strategi...
6d069b0bcbcb59c12d7d514a7722ef3d
Retrieve a volume attachment. This request retrieves a single volume attachment specified by the identifier in the URL.
[ { "docid": "97f9ae20c7500d032daea06dcebc3570", "score": "0.6519782", "text": "def get_instance_volume_attachment(self,\n instance_id: str,\n id: str,\n **kwargs\n ) -> DetailedResponse:\n\n if instance_id is None:\n raise ValueError('instance_id must be provided...
[ { "docid": "ad7703cff10340dff77cced6ba6097fc", "score": "0.7413413", "text": "def get(self):\n return attachment_service.get_attachment(get_uuid(request))", "title": "" }, { "docid": "720f954ca7018f6364496865e4e79c5a", "score": "0.69237274", "text": "def get_attachment(self, d...
c2bf9027ac7a97e212050ec645335c0e
Predicts new data using the pretrained classifier.
[ { "docid": "4e2798d8e4bdd7fa046e0215bb606711", "score": "0.0", "text": "def predict(self, X_val, I_val=None):\n\n if not self.subgraph:\n raise e.BuildError('KNNSubgraph has not been properly created')\n\n if not self.subgraph.trained:\n raise e.BuildError('Classifier...
[ { "docid": "7a9cae06ee961dc3a0f9f63c3e31e580", "score": "0.77232546", "text": "def predict():\n model = load_model()\n run_predict(lambda sents: make_preds(model, sents))", "title": "" }, { "docid": "82574c2b37cc35e3adf32c2b7da304d8", "score": "0.7268341", "text": "def predict_...
4a4dab7fbb0b85e114e91b9bdabd7154
XORs two cipher block
[ { "docid": "91f01cd0dbf4f86e0568d5ca846a0b20", "score": "0.7651875", "text": "def block_xor(block1, block2):\n assert len(block1) == Serpent.get_block_size() and len(block2) == len(block1)\n return bytes(block1[i] ^ block2[i] for i in range(Serpent.get_block_size()))", "title": "" } ...
[ { "docid": "cb08eb881810245db8d0155d6416cb47", "score": "0.80599743", "text": "def xor(a: bytes, b: bytes) -> bytes:\n return bytes(x^y for x, y in zip(a, b))", "title": "" }, { "docid": "377ab9a364770789c5bca001dd285278", "score": "0.7936208", "text": "def xor(s1: bytes, s2: byte...
efd310992b39d2c58f3369b4291c17ec
Get whether sales person is required.
[ { "docid": "64231859862ba5ea85e4271ca30b1007", "score": "0.9003576", "text": "def get_is_sales_person_required(self):\n return self.is_sales_person_required", "title": "" } ]
[ { "docid": "edbe7e993eeb92fc3370e8d05e3bc252", "score": "0.7079675", "text": "def set_is_sales_person_required(self, is_sales_person_required):\n self.is_sales_person_required = is_sales_person_required", "title": "" }, { "docid": "794608a3c516ad7479da210280b844ef", "score": "0.66...
602e18f1acf50fdaae4276a260c3a313
Returns whatever theme is, from the submission.
[ { "docid": "a9457a7caef25dc4350e7a6b02f60878", "score": "0.6223251", "text": "def theme(self) -> str:\n bit = self.soup.find(\"strong\", text=\"Category:\").next_sibling\n theme = CATEGORY_THEME_REGEX.match(bit).group(2)\n return clean(theme)", "title": "" } ]
[ { "docid": "24964504539bfcec3ae7205b7fc87c3f", "score": "0.6489319", "text": "def get_theme_from_request(request):\n \n selected_theme=None\n \n theme_var = _local_thread.keys['form']\n \n #Check if is a request\n if request:\n # Check if there is in POST or HEAD a change the...
e85279bf4032b5b70a6c0e16dfb07361
Command launched when QPushButton 'Add' is clicked. Update parent widget
[ { "docid": "98aff5ea19554b7a024bf454db66005e", "score": "0.0", "text": "def accept(self):\n stepName = str(self.leStep.text())\n stepLabel = str(self.leStepLabel.text())\n if stepName in ['', ' '] or stepLabel in ['', ' ']:\n log = \"Step name or label can not be empty !!...
[ { "docid": "9760706cafd4939d3b4ddc15e0e36c6e", "score": "0.78889227", "text": "def buttonAddClicked(self):\n\t\tbutton=self.sender()\n\t\tself.emit(SIGNAL(\"addItem\"),button.text())\n\t\tself.deleteButtons(button.stackIndex)", "title": "" }, { "docid": "8832e4e808f3a1ea1b63b7364cc80ddb", ...
8125f16b08ec1559d258d73c014b3e78
We are being sent PATH plus binary name. Strip off the PATH.
[ { "docid": "7b404bdb51a7de911901fa012d71a50c", "score": "0.0", "text": "def remove_class_name(path):\n return path.split('/')[-1]", "title": "" } ]
[ { "docid": "1a62985c3b2cf64735eb933e07aa3a52", "score": "0.6172189", "text": "def get_binary_name():\n return os.path.basename(sys.argv[0])[:16].replace(' ', '_')", "title": "" }, { "docid": "2ecf451aeb402524cda278a8b0a10e81", "score": "0.59092593", "text": "def strip_path():\n ...
949c6b033d9b3389bf9cb412d6e9db4b
Profiles dataframe while calling `count` action and return execution time, execution plan stage and number of rows.
[ { "docid": "9e37daa7b6f9014e8ac92937cfa82336", "score": "0.61490655", "text": "def _get_rows_and_execution_time(df: DataFrame) -> Tuple[int, float]:\n\n # total time and count\n ts_start = pd.Timestamp.now()\n rows = df.count()\n ts_end = pd.Timestamp.now()\n total_tim...
[ { "docid": "9a982092ec3e528339bc5e864445b8cf", "score": "0.6167149", "text": "def profiler(self):\n dfProfiler = self.__df\n return spark_df_profiling_optimus.ProfileReport(dfProfiler)", "title": "" }, { "docid": "7dcb96edc0b60b73f166bcb818ab22d1", "score": "0.61443484", ...
b4bd2654e317fe09f3796570365993a1
Input new position values for current position with tuple or list of length 4 that defines position for each axis [A,B,C,D]. If you do not wish to change the value of an axis, set list element to None
[ { "docid": "444c2ff7aa2774cc861bde95fe218dad", "score": "0.63630646", "text": "def set_position(self, positions):\n if len(positions) == 4: # check input length\n self.galil.GCommand(list_to_galil_input(\"DP\", positions)) # Write new positio...
[ { "docid": "774b187cc71b930a7998b8ce09b41a8b", "score": "0.61919117", "text": "def position(self, new_position) -> None:\n self.x, self.y, = new_position[:2]", "title": "" }, { "docid": "5f4a1de7ee84e4de485236db3a5528b7", "score": "0.6103263", "text": "def set_position(self, p...
fff563977116392e6e08b93e82e6ba7c
Analyze full SQuAD dataset (joined both versions).
[ { "docid": "48b102371bfb7135f4faea0900222498", "score": "0.74554676", "text": "def analyze_full_squad_dataset():\n squad_1_1_json_filename = DATA_DIR / f\"squad/raw/squad_full_dev_and_train-v{VERSION1_1}.json\"\n squad_2_0_json_filename = DATA_DIR / f\"squad/raw/squad_full_dev_and_train-v{VERSION2...
[ { "docid": "4b138f2adc461c0a9d5fcd330438e8e5", "score": "0.58067715", "text": "def analyze():", "title": "" }, { "docid": "a35fdf3f3e44e70e39eb216ab596ab63", "score": "0.5611722", "text": "def run_queries(self):\n spark = SparkSession.builder.appName('BDS-DAS Spark ' + self.na...
a2c3035cf9e15d8dbe110af7d6204d5b
This test if the input file is an unWISE file
[ { "docid": "e960a3e53aaf5f3710a20cd8529d59ec", "score": "0.72966903", "text": "def is_wise_file(filename):\n # No useful info in the header! So must rely on filename itself\n return \"unwise\" in filename", "title": "" } ]
[ { "docid": "5ada01101fbe39bb3cc5eb9ffd57ca4d", "score": "0.628483", "text": "def test_09_is_allowed_file_no_ext(self):\n\n filename = \"somename\"\n is_allowed = utils.is_allowed_file(filename)\n self.assertFalse(is_allowed)", "title": "" }, { "docid": "0365cff43bcb32e30...
dfb83bced3931a6b6d975e925fb4bf25
Numero de componentes fuertemente conectados
[ { "docid": "3969d0c04efd588978c104d1ab3ff783", "score": "0.0", "text": "def connectedComponents(analyzer):\n return model.connectedComponents(analyzer)", "title": "" } ]
[ { "docid": "475f2657e0b7bb8c8cb3c824257f0fe0", "score": "0.58194244", "text": "def n_components(self):\n to_ret = len(self.components)\n return to_ret", "title": "" }, { "docid": "8029c26b3dc0354593b6afeeae33293a", "score": "0.5778188", "text": "def getNumComponents(sel...
4b0ada919b7658a4a449132b88ab5dbc
runs the model for userdefined iteration numbers. If user doesnt specify the iteration then the model run for default 1000 times.
[ { "docid": "17456902123b4a3ffc3b7212e5d1b81b", "score": "0.0", "text": "def run_model(self, n_iterations=1000):\n male = female = 0\n for count in range(n_iterations):\n self.step()\n for index, value in enumerate(self.population):\n if value.sex == \"Male\" an...
[ { "docid": "1af615c217dbc797bb9f79ad7059fd70", "score": "0.6972713", "text": "def run_model(self, step_count=200):\n for i in range(step_count):\n self.step()", "title": "" }, { "docid": "8a848e4574a4f59bcb6245ef3fb4c824", "score": "0.6647719", "text": "def run_iter...
a8571bd27a3d3fce3e6017aaf4a8925b
Return length of Big Integer
[ { "docid": "9ab10e8539c2157c9d93ea54fabbb639", "score": "0.0", "text": "def __len__(self):\n return len(self.nodes)", "title": "" } ]
[ { "docid": "8f12c369a7eaced3bfbf24fac348e2f2", "score": "0.79488444", "text": "def BinaryLength(self) -> int:", "title": "" }, { "docid": "3959f2a960e6ec7276258139efce0fd4", "score": "0.7470769", "text": "def length(self) -> long:\n ...", "title": "" }, { "docid": ...
c1db58188a5b3ea43d26d40572fdd85d
Representation of an Dependency object in string.
[ { "docid": "3f4036cb88b454c228d8981460eac5e8", "score": "0.0", "text": "def __repr__(self):\n return \"groupId: {}\\nartifactId: {}\"\\\n .format(self.root.groupId, self.root.artifactId)", "title": "" } ]
[ { "docid": "204edaa40862caebc6dcd3b97a1e5544", "score": "0.74531114", "text": "def dep_tostring(self):\n for i in self.deps:\n print(\"{}({}, {})\".format(i.dtype, i.gov, i.dependent))", "title": "" }, { "docid": "3f2662017c19df9bbc1cdfe009603ee9", "score": "0.70947254"...
b297c7434d86edc62542cc3945c7de28
Computes the varPhragmen rule. Uses a Mixed Integer Quadratic Programming (MIQP) implemention and requires Gurobi 7.0+. This function returns one optimal committees (this is a limitation with the MIQP solver of Gurobi).
[ { "docid": "0735704e9f255c55d174a893a98f7ffa", "score": "0.69625366", "text": "def compute_varphragmen(profile, committeesize):\n return rule_approval_ilp.compute_optphragmen_ilp(profile, committeesize, \"varphrag\")", "title": "" } ]
[ { "docid": "cede51e62b21f2b67b6bf7f0fe98be71", "score": "0.6235433", "text": "def solve_qp(self):\n # Revert to default settings\n self.m.setParam('BarHomogeneous',-1)\n self.m.setParam('NumericFocus',0)\n # self.m.setParam('OutputFlag',0)\n\n # Solve\n self.m.o...
d053982513f9aad36837ac2ce7ce19bb
1) Learned clauses are not supported Return true if a contradiction occurs, otherwise false 2) Learned clauses are supported If a contradiction occurs, return a clause which causes the contradiction, otherwise return None
[ { "docid": "3223ba7c010d97a8fe19f9507d28c294", "score": "0.596008", "text": "def unit_propagation(self):\n\n temp_contradiction = self.__unit_propagation()\n\n # Learned clauses are not supported\n if (not self.__use_learned_clauses):\n # No contradiction\n if ...
[ { "docid": "351c5df084004ca3e526d1dd047dfedf", "score": "0.61939806", "text": "def all_clauses_satisfied(clauses):\n if(len(clauses) == 0):\n return True\n return False", "title": "" }, { "docid": "47246288f3488e5971bfe3ca128f0490", "score": "0.58200014", "text": "def te...
15b0cf90ab67e5d3f5137709fbafdb58
Extract interquantile range (25%75%) Input
[ { "docid": "ddd14f3aaba1c165ba4b128b699169bf", "score": "0.55874294", "text": "def iqr(series):\n Q1 = series.quantile(0.25)\n Q3 = series.quantile(0.75)\n IQR = Q3 - Q1\n return IQR", "title": "" } ]
[ { "docid": "dfa9f2fc5a32246ceaafb360b77168a9", "score": "0.76805675", "text": "def interquartile_range(x):\n return quantile(x, 0.75) - quantile(x, 0.25)", "title": "" }, { "docid": "4077e7dd30f70ad22b8bcac762c1e85b", "score": "0.74730366", "text": "def interquartile_range(a):\n ...
1cc757ad3d19f9bc9b089dfb3ff50080
Sorts a single file.
[ { "docid": "29b0f3d843bc261dc266b991be56fcc7", "score": "0.7040347", "text": "def sortFile(path, newPath, filename):\n\tprint('Begin sorting file: ' + filename)\n\tnewName = newPath.replace(' ', '\\ ')+filename + '_sorted.bam'\n\tstart = time.time()\n\tos.system('samtools sort -@ 12 -o {0} {1}'.format(n...
[ { "docid": "fe45d9da508fc27012f0e3a708bcc702", "score": "0.7231363", "text": "def sort_file(file_path, encoding=ENCODING):\n file_path = os.path.normpath(file_path)\n input_file = open_fr(file_path, encoding)\n lines = [line.strip().replace('\\x00', '') for line in input_file]\n input_file.c...
913881d0daaee0e1a17a9c18ede3c603
Test adding multiple items to an empty bimap by value.
[ { "docid": "b79327f424d73139b0a256f944c212af", "score": "0.8132962", "text": "def test_add_by_value_to_empty(self):\n bimap = BiMap()\n bimap.update_by_value({\"first\": 1, \"second\": 2})\n\n self.assertEqual(2, len(bimap))\n self.assertEqual(\"first\", bimap.get_key(1))\n ...
[ { "docid": "d4ead005ebcb3552724cf1c4daab67d6", "score": "0.81062824", "text": "def test_add_to_nonempty(self):\n bimap = BiMap({1: \"first\", 2: \"second\"})\n bimap.add_key(3, \"third\")\n bimap.add_value(\"fourth\", 4)\n\n self.assertEqual(4, len(bimap))\n self.asser...
d794b04fc3e27dc1608b7f638b86f9fa
Sums the session counter upon new page request to keep user signed in
[ { "docid": "8deae0c37d33174b9afa1c57df487e43", "score": "0.77163893", "text": "def sumsessioncounter():\n try:\n session['counter'] += 1\n except KeyError:\n session['counter'] = 1", "title": "" } ]
[ { "docid": "b9b94e3909ddef9eeb1a8be9c009c26a", "score": "0.7454385", "text": "async def add_session_count(self):\n session_id = await self.ex.u_cache.get_session_id()\n self.ex.cache.current_session += 1\n self.ex.cache.total_used += 1\n await self.ex.conn.execute(\"UPDATE st...
9c85b455cd259a9ef9630b05275d18e3
Have some timeouts expired?
[ { "docid": "c8efa7c5cd2d44de2688fe2aef4031b6", "score": "0.0", "text": "def hclock(ctx, _jso):\n #ctx[\"_clock\"]=jso\n tm=ctx[\"_tm\"]\n \n timeout_state_report=ctx[\"timeout_state_report\"]\n \n ### go through all 'ttype' and decrease their timeout\n ttypes=ctx[\"task_types\"]\n ...
[ { "docid": "785fc845b4b028ded484f971f459d1e5", "score": "0.7448214", "text": "def check_time_has_expired(self, timeout: datetime.timedelta) -> bool:\n timeout_expiration = datetime.datetime.now() + timeout\n return datetime.datetime.now() <= timeout_expiration", "title": "" }, { ...
fd0b274e31999af0dca7f358e36a4a64
x, y, w, h > x, y, x+w, x+h
[ { "docid": "237d7376b6ec0d9dbd14f025c89861b4", "score": "0.0", "text": "def pil_crop_rect(rect_tup):\n x, y, w, h = [int(x) for x in rect_tup]\n return (x, y, x + w, y + h)", "title": "" } ]
[ { "docid": "816939a9f7ba2d48eeaf9df158ca4801", "score": "0.67684543", "text": "def in_bound(x, y, width, height):\n if 0 <= x < width and 0 <= y < height:\n return True\n return False", "title": "" }, { "docid": "8e86f94be1a3368756238cdf614b8259", "score": "0.67358947", ...
b74d9d05c3c2dd3e1e817d1e3a6bb336
Print a warning when called.
[ { "docid": "bd298b891fa5482d793bc5b2fb2330ea", "score": "0.0", "text": "def _missing_warn():\n warnings.warn(\"One of the clusters is empty. \"\n \"Re-run kmeans with a different initialization.\")", "title": "" } ]
[ { "docid": "de704c7adfe544749027e2604a0ae588", "score": "0.82660335", "text": "def warning(self, msg):\n pass", "title": "" }, { "docid": "92ad80e88c1b3d3346b12d3c8542a735", "score": "0.7983018", "text": "def warning(self, msg, *args):\n print(str(msg) % args, file=self...
414115057c84d443c63dc799c9808212
Return the value of G(n), computed recursively. >>> g(1) 1 >>> g(2) 2 >>> g(3) 3 >>> g(4) 10 >>> g(5) 22 >>> from construct_check import check >>> check(HW_SOURCE_FILE, 'g', ['While', 'For']) True
[ { "docid": "fc71e62ab3196fdab2695f5624a87eb0", "score": "0.6365963", "text": "def g(n):\n \"*** YOUR CODE HERE ***\"\n if n<=3:\n return n\n else:\n return g(n - 1) + 2 * g(n - 2) + 3 * g(n - 3)", "title": "" } ]
[ { "docid": "0a5ca6bada61dbb8e5f5735adb7599b9", "score": "0.6579224", "text": "def gen_g(n):\r\n while True:\r\n a = rsa.randnum.randint(n-1)\r\n if rsa.prime.are_relatively_prime(n, a):\r\n if g_f(a,n):\r\n return a*a", "title": "" }, { "docid": "c9...
8f827431eb712e0ae50130e71ce9fafc
validate that a command is send via the websocket and the response contains expected results
[ { "docid": "b1000da8b51b94ec1e4664d6925428bf", "score": "0.6972805", "text": "def validate_command_execution(websocket, command, log_obj, checking):\n\n send_a_command(websocket, command)\n print('\\nshell command and output:\\n' + log_obj.last_message + '\\n')\n for i in checking:\n ass...
[ { "docid": "5f31467a177d89a192f6a157c14c345b", "score": "0.6918964", "text": "def validateConnection(self): # pylint: disable=C0103\n self._assert_connected()\n random_str = str(random.randint(0, 10000000))\n cmd = \"_vCnt\\t%s\" % random_str\n logger.debug(\"validateConnect...
3813a0a3a6a535d2dd1322bbdfe9107a
"Only calculate the scales if needed, for performance.
[ { "docid": "2dc7d62cdec24385882469bf68a04166", "score": "0.64434797", "text": "def calculate_scales(self, block_id=0):\n if self._n_refl[block_id] > 1:\n value, _, __ = self._smoother.multi_value_weight(\n self._normalised_values[block_id], self.value\n )\n ...
[ { "docid": "b322254a56ef5e26c9de11c341d862d5", "score": "0.6770345", "text": "def scales(self) -> Union[paddle.Tensor, np.ndarray]:\n pass", "title": "" }, { "docid": "f16e9d087d3fe5a04e852ca3acbc7b4a", "score": "0.6761587", "text": "def _downscale(self):\n pass", "...
65c919ea24a9ad705b76f5fb815ebe66
find a package using TagCollector2
[ { "docid": "ce266a276de1feb706f0a35e67018d0d", "score": "0.59297603", "text": "def main(args):\n\n import PyUtils.AmiLib as amilib\n client = amilib.Client()\n\n pkgs = args.pkg\n if isinstance(pkgs, basestring):\n pkgs = [pkgs]\n\n for pkg in pkgs:\n client.msg.info('lookin...
[ { "docid": "39a4e6daf5ff068dffd96a194019643f", "score": "0.63264567", "text": "def find_package(*args):\n pass", "title": "" }, { "docid": "08179e7ad410703928e7cb679d30deac", "score": "0.5906656", "text": "def main():\n if TAG_ENV not in os.environ:\n print(ERROR_MSG, fi...
59892f052fb5357c5cf20ae9778373a1
Determine the server URL.
[ { "docid": "8672951c4eeb562387df6ad3b9df68a2", "score": "0.6708006", "text": "def site_url(url):\n base_url = 'http://%s' % socket.gethostname()\n\n if server.port is not 80:\n base_url += ':%d' % server.port\n\n return urlparse.urljoin(base_url, url)", "title": "" } ]
[ { "docid": "d5f0a3a6f20b696f5f7142f1197d5931", "score": "0.8548539", "text": "def get_server_url(self):\n return self.__server_url", "title": "" }, { "docid": "5d0d4f7314234ea3d73c90fe7a619ef1", "score": "0.8101123", "text": "def _server():\n return urlparse.urlunparse((req...
f553809667ff58cbb006dc3ff1570f88
Get a random number in the range [a, b) or [a, b] depending on rounding.
[ { "docid": "9efe57cc3670869da903e85162f9f86e", "score": "0.0", "text": "def uniform(self, a, b):\n pass", "title": "" } ]
[ { "docid": "6f56cf354ae85a03c8e578521aacd40d", "score": "0.76068443", "text": "def rand (a, b):\n return a + int(round(random.random()*(b - a)))", "title": "" }, { "docid": "141edcafc1fad2580301b4097d708c4e", "score": "0.75378996", "text": "def randint(a,b):\n return int(random()...
9e6e4fd307fe655adbb4fb03e17753b9
Takes sequence of constellation indices from range {0,1,2,3} and maps them to a sequence of QPSK constellation symbols
[ { "docid": "0cd82ad1f1d14ecbaf4ce814c39063d1", "score": "0.6679043", "text": "def map_indices_to_constellation(constellation_indices):\r\n\r\n # UNIT TEST: check constellation indices belong to range {0,1,2,3}\r\n assert not np.isin([False], np.isin(constellation_indices, [0,1,2,3])), \"Indices do...
[ { "docid": "d2598221522cf25d35da1b69f0b333b1", "score": "0.61352867", "text": "def symbolsToIq(syms, constellation):\n return constellation[syms]", "title": "" }, { "docid": "2363cf12e816d5988ee0cf4ba33ef244", "score": "0.5707883", "text": "def per_sym_block(I,J,K):\n out = num...
910fc38e6de509fb9b8878560199883a
Create a client that will connect to addr. Once created, this class will autoconnect and reconnect to the controller as needed.
[ { "docid": "fd10602c59a4259aa6dd1c77417341a6", "score": "0.0", "text": "def __init__(self, addr):\n self.addr = addr\n self.url = 'http://%s:%s/' % self.addr\n self._proxy = webxmlrpc.Proxy(self.url)\n self._deferredIDCallbacks = {}\n # This class manages some pending ...
[ { "docid": "6fda1795974d5a6849b2a3528b154d47", "score": "0.6795558", "text": "def connectClient(self, address, portNumber, clientCreator):\n raise NotImplementedError()", "title": "" }, { "docid": "bc42c2097360fd3d40a411a1c2de38f2", "score": "0.66389805", "text": "def client()...
1c0a72730c8b273ec5ef48dc1f7beea5
Get the CW power value from the given channel.
[ { "docid": "c71098f72e15b14d335afefb8075d9ab", "score": "0.6012683", "text": "def get_cw_val(cw_scale,gain,fft_shift,test_channel):\n local_freq = ch_list[self.n_chans-test_channel] + f_offset\n\n try:\n Aqf.step(\"Setting digital gain to: {}\".format(gain))\n ...
[ { "docid": "4565b9102a442dffebb389111819faaa", "score": "0.78215754", "text": "def getPower(self, channel):\n if channel not in self.allchannels:\n raise ValueError(\n \"Invalid Laser Thorlabs channel id. Should be in %s\" %\n str(self.allchannels))\n ...
921045a46ee596a4a476b465043c27a8
Saves the current GNSS AzEl plot
[ { "docid": "4d88b79ea24d23caf3feedc85a59b70b", "score": "0.80356157", "text": "def save_AzElPlot(self):\n file_choices = \"PNG (*.png)|*.png\"\n\n path = unicode(QtGui.QFileDialog.getSaveFileName(self,\n 'Save file', '',\n file_choices))\n ...
[ { "docid": "3da7c11e9a1ba80e044c38e2249e9ee7", "score": "0.6852159", "text": "def save_plot(self):\r\n self.plot()\r\n plt.savefig('saved_graph.png', bbox_inches='tight')\r\n plt.clf()\r\n # plt.plot(x, y)\r", "title": "" }, { "docid": "f933916428f4e89e0266ce7a5cd...
6cbd04da0413b5a028fefae422175402
A simple parser that splits data by commas
[ { "docid": "a5b92357123d45f89a4fa01a83798b3c", "score": "0.6035004", "text": "def comma_decoder(data):\n if isinstance(data, bytes):\n data = data.decode('latin')\n try:\n data = np.array([float(x) for x in data.split(',')])\n except ValueError:\n return None\n return da...
[ { "docid": "f8ebd5077eba1d8ccb531e61f27dbe17", "score": "0.73508716", "text": "def line_parse(line):\r\n line = line.replace(',', ' ')\r\n return line.strip().split()", "title": "" }, { "docid": "b1d0fe61444734d756ac515665f0b820", "score": "0.7275903", "text": "def comma_parse(...
37b5a80db4e42b79650f9914f2393e39
Returns the dictionary of the branch order of each node. The branch order denotes the number of branch points that are crossed when tracing the path back to the soma.
[ { "docid": "724814b922e8efd3066b12590654c2a2", "score": "0.7339895", "text": "def get_branch_order(self):\n return self._get_branch_order(1,0)", "title": "" } ]
[ { "docid": "f3e53ab5f0c901b2650cfe45350bb7df", "score": "0.8029624", "text": "def _get_branch_order(self, start, bo):\n d = {}\n edges = self.edges(start)\n d[start] = bo\n if len(edges) > 1:\n for e in edges:\n d.update(self._get_branch_order(e[1], ...
5fc48e3f864a1447a85086954100c72a
Given a symmetric, real NxN matrix, M, an eigen decomposition is always possible, such that M can be written as M = T_transp S T (orthogonal transformation) with T_transp T = 1_N and S being a diagonal matrix with the eigenvalues of M on the diagonal. Returns
[ { "docid": "b29fb740dcbe35969f7e43c3080baa47", "score": "0.694518", "text": "def eigenDecomposition(mat):\n from scipy import linalg\n from numpy import matrix\n import numpy\n\n A = matrix(mat)\n S, T_trans = linalg.eig(A)\n if numpy.iscomplex(S).any():\n raise ValueError(\"Giv...
[ { "docid": "9a33d6904c6d3ad929b3d4137e1e72ea", "score": "0.66076136", "text": "def sym_eig(A, dt=None):\n assert all(A == A.transpose()), \"A needs to be symmetric\"\n if dt is None:\n dt = impl.get_runtime().default_fp\n if A.n == 2:\n return sym_eig2x2(A, dt)\n if A.n == 3:\n...
f8f1208d7de5e25851eb3d9d9abb3e25
Get the url for a file
[ { "docid": "06f436330056e464833500ead9705187", "score": "0.7538725", "text": "def getFileUrl(self, host, path):\n return self.build_url('file', host, path) + '?view=read&format=auto'", "title": "" } ]
[ { "docid": "b67eb8f01f5b7342fd9c6f20b0d0597a", "score": "0.76272726", "text": "def url(self, filename, base_dir=None):\n filename = os.path.join(base_dir or self.base_dir, filename)\n\n file_url = urljoin(self.base_url, filename)\n\n if self.private:\n expires, token = se...
2b6854efb52ee4dc489239424c714963
Checks if filepath exists.
[ { "docid": "4455d9f30dc5440658404123554c1ab4", "score": "0.0", "text": "def remote_filepath_exists(ssh_cmd, host, path):\n return ssh_cmd(host, 'test -e {}'.format(path))", "title": "" } ]
[ { "docid": "f7e1bf97ad7f69e7bf4c2f4810440a92", "score": "0.8392589", "text": "def file_exists_path(self, filename):\n\n if os.path.isfile(filename):\n return True\n else:\n return False", "title": "" }, { "docid": "cdc50f22a1d3e4d55433363448e09a54", "s...
60534a882bad6489130ae88e1b87ad99
Calculates weighted harmonic mean from this and other densities.
[ { "docid": "d4ee8d6a2c824d28cace73d5b256677d", "score": "0.616609", "text": "def _mean_scalar_density(self, other):\n\n new_density = (self._concentration + other._concentration) / \\\n (self._concentration / self._density +\n other._concentration / other._density)\n\n ...
[ { "docid": "da685280af95152519d2289f1e64f4b8", "score": "0.6433477", "text": "def normalize_weight(self):\n\n # For each input synapse\n avg = 0\n # Compute the average\n for syn in self.in_syn:\n avg += syn.weight\n avg /= len(self.in_syn)\n\n # For ...
ba4e832995d2d6719ce11f6647011340
Returns True if this is an interface type.
[ { "docid": "5e0f8440b0f07aa08160bfd58e96d6f1", "score": "0.7727358", "text": "def is_interface(self):\n return False", "title": "" } ]
[ { "docid": "cf53c05b32b6516e32b063c592955d88", "score": "0.7480001", "text": "def has_interface(self, resource_type):\n if self.type() == resource_type:\n return True\n\n try:\n ri = self.stack.env.get_resource_info(self.type(),\n ...
63f22b3e28f12a682ffd26858f1e0efb
The unique identifier of the pair of prices (bid and ask) the position is closed at.
[ { "docid": "cb8a5e586b69c38c628924521be306ca", "score": "0.5273115", "text": "def get_close_quote_id(self, trade_id):\r\n row = self._find_row(trade_id)\r\n if row:\r\n return row.getCloseQuoteID()", "title": "" } ]
[ { "docid": "fd513a4c15168533dc835befb5e43cb2", "score": "0.5583561", "text": "def getClosePrice(ticker):\n try:\n yesterday = time.strftime(\"%m/%d/%y\", time.localtime(time.time() - 86400))\n close = list(si.get_data(ticker, start_date=yesterday).to_dict()[\"close\"].values())[0]\n return clo...
02ccca2b4b0c4d9786cbcb62426bbd92
Use positive semidefiniteness to identify likely zerovalued eigenvalues due to floating point imprecision.
[ { "docid": "bcb2f01e5855d0ebefec3ad2f381a49a", "score": "0.0", "text": "def from_correlations(\n cls: Type[Eigenvalues],\n data: ndarray,\n atol: float = float(1e3 * np.finfo(np.float64).eps),\n lower: bool = True,\n ) -> Eigenvalues:\n if len(data.shape) > 2:\n ...
[ { "docid": "ffa4c774fada3e0ed2a46ad5aab82bec", "score": "0.74455935", "text": "def test_eigenvalues_of_too_few_points_results_in_0():\n a = np.array([5])\n pc = create_point_cloud(a, a, a)\n\n compute_features(pc, [[0]], pc, [\"eigenv_1\", \"eigenv_2\", \"eigenv_3\"], InfiniteCylind...
014f941460669fd601096f185f218dca
estimator a la scikit but we want to customize a few thing in particular the predict we add a predict_verbose method which gives the argmax of predict and all other kind of info
[ { "docid": "b33b48f7146ba4208a877df886f8387b", "score": "0.0", "text": "def __init__(self,method=\"manhattan\"):\n\t\tself.liste_of_games=[]\n\t\tself.dictofplayer={}\n\t\t#self.liste_of_players=[]\n\t\tself.liste=False #do we use a list of game or a dict of player with a list of games", "title": ""...
[ { "docid": "37fc8baf70ddba5073708b5e25b2031b", "score": "0.68523747", "text": "def meta_predict_clf():\n pass", "title": "" }, { "docid": "1bdc25b629b990ea75d72e0f323a6ef5", "score": "0.66119105", "text": "def getPrediction(self,data_arg1,data_arg2,data_lbl):", "title": "" }...
cf7821d1283da30486f382a5c57d3344
For synching saved procedures with mobile clients. Request Params username A valid username. password A valid password.
[ { "docid": "48da06603589bead9d42a2649bc268cc", "score": "0.0", "text": "def saved_procedure_list(request):\n logging.info(\"entering patient list proc\")\n username = request.REQUEST.get(\"username\", None)\n password = request.REQUEST.get(\"password\", None)\n url = settings.OPENMRS_SERVER_...
[ { "docid": "e58d47573d0131e4705220e41ccb057e", "score": "0.58704257", "text": "def set_params(usr, password):\n\n\tglobal user\n\tglobal pwd\n\tuser = usr\n\tpwd = password", "title": "" }, { "docid": "3239ac6fbe8975fc0fdbabef8fa9de8c", "score": "0.5728726", "text": "def store_auth_i...
76343038078799a671baedba71af10ec
return length of rope in O(logn) Rope.size will also returns the same in O(1) but this function is also required at several palces. Users should use Rope.size.
[ { "docid": "9b058c778dce24f1e7290a4696583400", "score": "0.0", "text": "def __len__(self,root=False):\n if root==False:\n root=self.root\n head=root\n count=0\n while head:\n count+=head.weight\n head=head.rc\n return count", "title...
[ { "docid": "83ecf4f070784835708b257862d12647", "score": "0.7059134", "text": "def house_number(self, rope_len):\n len_sum = 0\n \n for rope in self.rope_array:\n len_sum += rope // rope_len\n \n return len_sum", "title": "" }, { "docid": "59a...
84cc43a4fbc9223bee4e7fc6e0f497de
self the test_case in question id the id number of the test_case 'self' in the database created the date when the test_case 'self' was created created_by the user that created the test_case 'self' question the question associated with 'self' weight the weight given to this test_case content the code for this test_case ...
[ { "docid": "fe6bf431b10601c1924d6d6f91e4e7f6", "score": "0.7035684", "text": "def __init__(self, id, created, created_by, question, weight, content, active):\n self.id = id\n self.created = created\n self.created_by = created_by\n self.question = question\n ...
[ { "docid": "10e245c73b225e7a8ab6b9696c7f322a", "score": "0.5976718", "text": "def __init__(self, test: TriangleTest, subject_id: int, correct: bool):\n\n self.test = test\n self.subject_id = subject_id\n self.correct = correct", "title": "" }, { "docid": "3825ebf774494f9...
89fa3e4594421fa702c0fb4c1dd03800
Get Fuel grade details by FuelRewardId or RewardName
[ { "docid": "3f250a5ac03b4c98a51f71f930ab65d5", "score": "0.76041454", "text": "def GetFuelGradesById(FuelRewardId=\"1\", RewardName=\"FuelReward1\"):\n result = \"\"\n if (FuelRewardId == \"\" and RewardName == \"\"):\n log.info(\"FuelRewardId or RewardName must be not empty\")\n ret...
[ { "docid": "48ee6941c505a3dd30e77f5efa10c4aa", "score": "0.74738145", "text": "def GetFuelRewardsById(FuelRewardId=\"1\", RewardName=\"FuelReward1\"):\n result = \"\"\n if (FuelRewardId == \"\" and RewardName == \"\"):\n log.info(\"FuelRewardId or RewardName must be not empty\")\n re...
a5eb1395ef001d2fb07bc4f9a4250243
Try to get application name, that we're connected to. If it couldn't get the name, it returns empty string.
[ { "docid": "5e8df666c206686584ea9c6dc5fd265c", "score": "0.77397156", "text": "def __get_app_name():\n executer = service_manager.CommandExecuter()\n try:\n app_info = executer.execute_command('app.introduce()')\n return app_info['name']\n except Exception:\n #In case of an...
[ { "docid": "c00fe9e1c4301ef07e40d89efba46a17", "score": "0.7748835", "text": "def _get_application_name(self):\n return self.__application_name", "title": "" }, { "docid": "6b05b966e198a38ec887dd965578dedd", "score": "0.7464836", "text": "def application_name(self):\n if \"...
78db8c500389249841d2390ed7b6e221
Test a simple circuit with a single sample measurement for shot vectors
[ { "docid": "4d2d4d61ee906fb9a0477bedab95d5f0", "score": "0.64724594", "text": "def test_sample_shot_vector(self, max_workers, shots):\n x = np.array(0.732)\n shots = qml.measurements.Shots(shots)\n qs = qml.tape.QuantumScript([qml.RY(x, wires=0)], [qml.sample(wires=range(2))], shots...
[ { "docid": "839434dfcbb582513f5d2a98de523b9a", "score": "0.6360883", "text": "def test_sample_values(self, device, shots, tol):\n dev = device(1)\n par = 1.5708\n\n observable = qml.PauliZ(wires=[0])\n\n dev.apply(\n [\n qml.RX(par, wires=[0]),\n ...
924948d35b7fe68ec1ca9f608b6f8a54
Returns the 'base' silo object that an object operates on. Includes special handling for Twitter photo URLs, e.g.
[ { "docid": "4ad0af60344efd2b2cfcd871cde66a90", "score": "0.70898885", "text": "def base_object(self, obj):\n base_obj = super(Twitter, self).base_object(obj)\n url = base_obj.get('url')\n if url:\n try:\n parsed = urlparse.urlparse(url)\n parts = parsed.path.split('/')\n ...
[ { "docid": "495f4ed4f383e264827d73752466ae8b", "score": "0.619478", "text": "def get_base():\r\n return _base", "title": "" }, { "docid": "edf7a898d9f719bbf07cf25c2d5703fe", "score": "0.59034413", "text": "def get_base_image(self):\n return self.get_image_and_tag()[0]", ...
639ae350ec8ef52a509371edd6bce2af
Tests that writing text like 'lrename from to' calls the put action and passes 'from' as the original filename and 'to' as the new filename.
[ { "docid": "57d5a5b7e9c035083711aa25d4d048e4", "score": "0.7171982", "text": "def test_lrename_invokes_rename_action(capsys, monkeypatch, sftp):\n\n # Replace the real action with our mocked function\n monkeypatch.setattr(rename_files_local, \"rename_local_file\", mock_rename)\n\n # Pass in a v...
[ { "docid": "5070ce0417bc7fba6eda6cafe103ebc2", "score": "0.68994135", "text": "def mock_rename(before: str, after: str):\n\n assert before == FROM\n assert after == TO\n print(SUCCESS_STRING)", "title": "" }, { "docid": "80e9e5047d64afe6b307ffc273d28fe6", "score": "0.66226196", ...
de97c516d14954426965ccc70629522e
Do not return anything, modify s inplace instead.
[ { "docid": "ad50449cb5ff4102482424c51fef92e2", "score": "0.0", "text": "def reverseWords(self, s: List[str]) -> None:\n if not s:\n return\n def reverse(s,start,end):\n i,j=start,end\n while i<j:\n s[i],s[j]=s[j],s[i]\n i+=1\n ...
[ { "docid": "31d79ffbb36821823f943aee39e09f63", "score": "0.62795085", "text": "def modifiable_chars(self, s):\n self.replace_in_range((self.x_modifiable, len(self._buffer)), s)", "title": "" }, { "docid": "16389be01038261a31222f1a48d6bab5", "score": "0.59871805", "text": "def ...
92fdae44e288b1efac5c4c32ca43cd36
method that does the same as test on old page templates
[ { "docid": "19a65991270b27665e8da46d5b6d675b", "score": "0.0", "text": "def test(self, condition, true_value, false_value):\n\n if condition:\n return true_value\n else:\n return false_value", "title": "" } ]
[ { "docid": "116ee17c0eac19f4dc5c111ec94c6a03", "score": "0.7356265", "text": "def test_templates(self):\n\t\tpass", "title": "" }, { "docid": "6a5eb435727277a1882a9d380302dcf0", "score": "0.69098026", "text": "def _assertPageTemplatesUsed(self, response):\n self.assertTemplateUsed...
d7ea8a8e35003f145cb58edd2f6bb6df
Returns the command's stderr as a string.
[ { "docid": "008c90d9c024641373debcdb186bb746", "score": "0.74979025", "text": "def stderr(self): \n return self._stderr", "title": "" } ]
[ { "docid": "374a0b366ef567928cf96393fb1a88ac", "score": "0.8082867", "text": "def stderr(self):\n if not self._stderr_str:\n self._stderr_str = self.raw_stderr.decode(encoding=self._encoding)\n return self._stderr_str", "title": "" }, { "docid": "0ab8ea5c425e8a450dd8...
c24f08615fc30efad9f87465a3ef1f7c
Invite user to group (inviteGroupPublicV1) Required valid user authentication
[ { "docid": "66fef9c12b9b0b4cb300b50530fd2936", "score": "0.71501696", "text": "def invite_group_public_v1(\n user_id: str,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_ser...
[ { "docid": "4459c330912a73c413cf5d1668233bb8", "score": "0.7699805", "text": "def invite_member(request):\n group = get_object_or_404(models.Group, id=request.POST.get(\"group\"))\n user = get_user_from_username(request.user, request.POST[\"user\"])\n\n if not group.user == request.user:\n ...