query_id
stringlengths
32
32
query
stringlengths
9
4.01k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
da7a2df3f31b97024c5a6eeab2efd4f5
Validates an RGB hex string.
[ { "docid": "0872061ec045c3138ccc910b7eb9d2a7", "score": "0.8695411", "text": "def validate_hex_color(hex_str):\n match_str = r'#[0-9a-fA-F]{6}'\n if re.match(match_str, hex_str) is None:\n raise ValidationError(u'{} is not a valid RGB hex string.'.format(hex_str))", "title": "" } ]
[ { "docid": "cd2bbf914df6bd31966866bb868315f3", "score": "0.7722918", "text": "def is_hex_color(string):\n return bool(re.match(r'^(#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6})$', string))", "title": "" }, { "docid": "7a76e6bb7522a826fdd5fb27b885a8d8", "score": "0.7716813", "text": "def test_i...
cb8257fde6a717dc3afb0edd26d64e01
get the crystal scatter, background scatter, and photon counting noise for the reflections listed in the table R
[ { "docid": "1f95c0828e2b8648d84a4bced66f2729", "score": "0.0", "text": "def integrate2(R, badmask, data, gain=28, fit_bg=True, zscore=8, sz=8):\n from dials.algorithms.shoebox import MaskCode\n fg_code = MaskCode.Foreground.real\n Nrefl = len(R)\n fs_dim = 194\n ss_dim = 185\n\n Rpp = ...
[ { "docid": "a3f78ab103b74584dba2bd44abbf3b38", "score": "0.58177507", "text": "def get_colors( simtable, dz=0.1 ):\n if 'FLT' not in simtable.__dict__ :\n simtable.getLightCurves()\n i7 = np.where( simtable.FLT=='7' )\n i8 = np.where( simtable.FLT=='8' )\n iI = np.where( simtable.FLT=...
f0baa7c754f29a744c55ad7ba6c87488
Read Darcs changeset information for the Bcfg2 repository.
[ { "docid": "bae4f46d9c2febcf535a0977b0c8c9b4", "score": "0.5081105", "text": "def get_revision(self):\r\n try:\r\n data = Popen(\"env LC_ALL=C darcs changes\",\r\n shell=True,\r\n cwd=self.vcs_root,\r\n stdout=PIPE...
[ { "docid": "3cf297d97dffd87d3b90afe85d8fd56d", "score": "0.5314179", "text": "def read_dependencies():\r\n\r\n\t## read from file: prog2default.csv\r\n\tdependencies_file = file_list(\"dependencies\")\r\n\treturn(HCGB_main.get_data(dependencies_file, ',', 'index_col=0'))", "title": "" }, { "...
1e252dea36c1c96f1a91d2d3b7d0f701
convert grayscale annotation to inner bound
[ { "docid": "ad655c4f31bcbbd1fe7c5e371ebb8c14", "score": "0.5521034", "text": "def gray2innerbound(gray, width):\n h, w = gray.shape[:2]\n gray[gray == 76] = 255\n gray[gray == 151] = 255\n\n label = gray2mask(gray)\n label_binary = label_binarize(label.flatten(), classes=range(0, 3))\n ...
[ { "docid": "c72b82fd27377184306b8188a338c97e", "score": "0.6239534", "text": "def classify_image(self):", "title": "" }, { "docid": "109a085d249590784c5f23a9833de41f", "score": "0.6049097", "text": "def convert_to_mask(x_coord, y_coord, sample_name, class_name, ann_img):\n \n #...
032798927d4a503e48066d0471f63a83
Label connected domains, calculate area fractions of dominant domain Also marks domains that are present on both sides with BLUE v0.2
[ { "docid": "3462743ba1f2afaed0f77efcbc9ed176", "score": "0.5651883", "text": "def Label(im, Opt):\n BCount=(im==0).sum()\n WCount=(im.size-BCount)\n BFrac=BCount/(im.size)\n WFrac=WCount/(im.size)\n LabArray, LNumFeat = scipy.ndimage.measurements.label(im)\n WDomFrac=(LabArray==1).sum(...
[ { "docid": "581cae9893a0ea09573afb9484c4db18", "score": "0.613723", "text": "def areaDisjFraction(hemlabels, dablabels):\n botharea = np.count_nonzero(np.logical_or(hemlabels, dablabels))\n if botharea == 0:\n return 0.\n else:\n return float(np.count_nonzero(dablabels)) / bothare...
d47023e0d7e2286a238bfd7f0b51b634
Computes the mean area of all labeled objects and takes the square root. Gives a length in number of pixels. To get a length in physical units, multiply the output of this function by the physical pixel size.
[ { "docid": "cb1160591f9c92c2a9ec269dca24c420", "score": "0.752876", "text": "def mean_length_scale(object_labels):\n objects_area = _get_objects_area(object_labels=object_labels)\n return np.sqrt(np.mean(objects_area))", "title": "" } ]
[ { "docid": "56fa449ff4f5652e6c489edb3c0794f9", "score": "0.715483", "text": "def mean_perimeter_length(object_labels):\n objects_perim = _get_objects_property(\n object_labels=object_labels, property_name=\"perimeter\"\n )\n return np.mean(objects_perim)", "title": "" }, { "d...
dc4acd4f73f049a04aa09ecf11788814
Get the name of the environment either from current conda environment, from remote directory, or inferred from git repo.
[ { "docid": "f789b3b2d6563fa62e592b2215c5cb76", "score": "0.7944121", "text": "def get_env_name(infer: bool = False) -> str:\n # pylint: disable=redefined-outer-name\n if not infer:\n return get_active_conda_env_name()\n try:\n remote_dir = infer_remote_dir()\n history = Env...
[ { "docid": "09e74824f0c88194610f3ef561ad4b14", "score": "0.7596804", "text": "def get_conda_env_path(conn: fabric.Connection, envname: str = 'base') -> pathlib.Path:\n stream = io.StringIO()\n conn.run('conda info --envs --json', replace_env=False, out_stream=stream)\n info = json.loads(stream....
274993236c68c93987a2bd3d55fd0eb4
Returns the number of unread messages in the user's mbox of a given type.
[ { "docid": "940b33f472fb0674c8ac24b43ad96f72", "score": "0.82448024", "text": "def get_unread(self, site, profile_name, mbox_type='inbox'):\n total = 0\n \n if _get_mailbox(site, profile_name, mbox_type) is None:\n return total\n mbox_queues = self.get_queues(site,...
[ { "docid": "98429e9cb42c0c5b03da2b2fcc1326e9", "score": "0.694137", "text": "def unread_messages_count(self) -> int:\n return self._message_storage.unread_count", "title": "" }, { "docid": "d5e526e27ef01e5174d787af7c57ef22", "score": "0.69291246", "text": "def get_unread(self)...
5fb757af84b6bfa9a340d6aa2823062e
Get liquor quantities and prices given our input.
[ { "docid": "9c076f0e7c9c00d70a4860a404aaf472", "score": "0.5931924", "text": "def calculate_liquor_quantities(\n config_dict: dict, user_dict: dict, rounding_method: str = CEILING\n) -> dict:\n # Calculate total required drinks\n total_required_drinks = user_dict[\"num_drinks\"]\n\n required...
[ { "docid": "bbc54cc4d369fd04982582b0d78faad6", "score": "0.6300638", "text": "def get_subscription_prices():", "title": "" }, { "docid": "5686b248a3e2355aae9e165865fb32cf", "score": "0.6073003", "text": "def get_prices(self):\n\t\treturn self.prices", "title": "" }, { "do...
e06ffe70235da5f096ff2777716e69a3
Appoint the most trusted validator as the primary validator
[ { "docid": "3245e9c37abd18fdc4c111e3a30b76a0", "score": "0.7344275", "text": "def appoint_primary_validator():\n\n current_primary_validator = get_primary_validator()\n\n most_trusted_validator = Validator.objects.filter(\n primary_validator_invalid_blocks__isnull=True\n ).order_by('-tru...
[ { "docid": "17d0cdba702d967f38720e05e7ad7e0e", "score": "0.68256813", "text": "def SetValidator(self, validator):", "title": "" }, { "docid": "e9c886c1c783c96ea7228212c7806ef3", "score": "0.65641963", "text": "def GetValidator(self):", "title": "" }, { "docid": "1189796a9...
e22ddb62e752ac2dc25b190613bd2c48
set value expecting date time
[ { "docid": "0f4c3b387a27a29c2c3cf80812c71dfc", "score": "0.64594984", "text": "def set(self, v):\n if not isinstance(v, datetime.datetime):\n raise ValueError(\"Invalid datetime value!\")\n\n if v.tzinfo is None: # naive time -> assumed to be in UTC\n self.__v = v.rep...
[ { "docid": "cb2f92086af4884a5e191426c2037c27", "score": "0.7544321", "text": "def date(self, value):\n self._date = value", "title": "" }, { "docid": "edf1608f8e9bbeeff627462e0a44b525", "score": "0.75029093", "text": "def setValue (self, val):\n \n if isinstance(...
3a7b4464ebf99794d8c116b42038d4d8
Processes the image and returns it
[ { "docid": "1fc64426902988012c1a7778bfd6ceca", "score": "0.0", "text": "def img_pre_process(img):\n # Chop off 1/3 from the top and cut bottom 150px(which contains the head of car)\n shape = img.shape\n img = img[int(shape[0] / 3):shape[0] - 150, 0:shape[1]]\n img = img / 255.\n print(img...
[ { "docid": "4b27d0b9a56e8d4d8524a2066c858a1d", "score": "0.79944336", "text": "def process(self, image):\n pass", "title": "" }, { "docid": "b92044a4dd259f62f19f82eaa207ff3e", "score": "0.74050933", "text": "def process(self, grabbed_image):\n raise NotImplementedError(...
6f79505ce9f122994b5991bf039a6436
polbasis(self) > string Summary Return the polarization basis in the calibration table ('L' for linear or 'C' for circular). Description This member function returns the polarization basis in the calibration table ('L' for linear or 'C' for circular).
[ { "docid": "72c4ec11feddbef5fcda6ddb2747b04e", "score": "0.79458225", "text": "def polbasis(self):\n return _calanalysis.calanalysis_polbasis(self)", "title": "" } ]
[ { "docid": "9ddff4da2e30336611fc206b7183ff3b", "score": "0.61899257", "text": "def Lri_basis(self):\n return self.Lri_basis_set", "title": "" }, { "docid": "8a5e35c53d30934fa38fb888e9874ef7", "score": "0.6093768", "text": "def getBasis(self):\n return self.__basis", ...
f73a218e6f4e61b5fc497d4418151388
Randomly select one of the variables in the test defined.
[ { "docid": "7af41151fcc2e2c972c0fbf47c98c16b", "score": "0.67626154", "text": "def _select_random_variable_for_call(\n test_case: tc.TestCase, position: int\n ) -> vr.VariableReference | None:\n candidates: list[vr.VariableReference] = [\n var\n for var in test_cas...
[ { "docid": "3f010e7a53633bac681ffacf96171642", "score": "0.68720555", "text": "def rndvar(self, ln):\n\n if len(ln) < 2:\n error(\"Use: RndSet Variable_Name <list of possible values>\")\n\n v = self.getvname(ln[0])\n\n self.vars[v] = random.choice(ln[1:])\n\n if gb...
bef78b64f61cc20b6a443e9b8269d5d2
Resets the number of steps a dot has taken.
[ { "docid": "1dec7687e2aa8e2f0589fc101ecc18d9", "score": "0.7511817", "text": "def reset_steps(self):\r\n self.step = 0", "title": "" } ]
[ { "docid": "668d3dd6e7a95dd3d12f410de40432fe", "score": "0.6291966", "text": "def reset(self):\n self.distance_traveled = 0\n self.state = Reindeer.MOVING\n self.internal_clock = 0\n self.total_ticks = 0\n self.points = 0", "title": "" }, { "docid": "443556...
82e6d7f2553b9e80a9ca0596efe04e84
Apply Wordnet lemmatizer to text (go to root word)
[ { "docid": "de04606a08eb8f89ecf33e73eaccd774", "score": "0.76061803", "text": "def lemmatizer(text):\n wnl = WordNetLemmatizer()\n text = [wnl.lemmatize(word) for word in text.split()]\n return \" \".join(text)", "title": "" } ]
[ { "docid": "04bc11774c8564671a1c272290fcbd55", "score": "0.7877054", "text": "def lemmatizer(text):\n lemmatizer = WordNetLemmatizer()\n\n #Iterate through words and lemmatize\n i = 0\n for word in text:\n text[i] = lemmatizer.lemmatize(word)\n i = i + 1\n return text", ...
1fb062405dd05b13bd0419651eb3cbe4
Function that makes and save the figure with the local power spectrum
[ { "docid": "4a5d367a67fff5a98d7a0e2bc5885895", "score": "0.58250314", "text": "def makeAveragePSLocalFigure(averagePSLocal,figureFileName,gridSize): \r\n pylab.figure()\r\n for i in range(gridSize[0]):\r\n for j in range(gridSize[1]):\r\n pylab.subplot(gridSize[0],gridSize[1],i*g...
[ { "docid": "5c6401c84a8eda78f36dc21df5ceb618", "score": "0.6694815", "text": "def plotter_saver():\n xdat = get_xdat()\n FFCache.xdat = xdat\n\n p0 = [\n 2.14928399e+00, 6.30221940e-01, 2.75166059e+00, -1.96259549e+00,\n 7.03808465e-01, 5.26047000e-03, 1.49757697e-02, 5.81073410e-...
d7721b2c84a1088f629f9e0fab2d0634
Video streaming home page.
[ { "docid": "a905fb886ac06831242b1eb30e3c08d3", "score": "0.0", "text": "def index():\n return render_template('index.html')", "title": "" } ]
[ { "docid": "f8fc737c05951ba93953b96f7af39dfa", "score": "0.7695669", "text": "def index():\r\n return render_template('video.html')", "title": "" }, { "docid": "b609a4c6e85aa233bafd14bfcf25d5aa", "score": "0.6744941", "text": "def stream(request):\n # Get a list of rooms, order...
6c0e12b0634e743b2e8588efbc847419
Make Windows and POSIX compatible absolute paths automatically.
[ { "docid": "a35283b24e3488954e811d6e8f32c2f4", "score": "0.6681356", "text": "def makePath(path):\n\n compatPath = os.path.abspath(os.path.expanduser(path))\n\n return compatPath", "title": "" } ]
[ { "docid": "08c7a8fd11865ea66f5944d77bc7b886", "score": "0.71546054", "text": "def win2unix(a_path, use_abs=1):\r\n if use_abs:\r\n a_path = os.path.abspath(a_path)\r\n return re.sub(r\"\\\\\", \"/\", a_path)", "title": "" }, { "docid": "08c7a8fd11865ea66f5944d77bc7b886", "s...
2f4f0d8423f6ecc13377132d7754a67e
Turn selected bars on other off
[ { "docid": "92d9f575597c61a0ce457e38318d744d", "score": "0.64476544", "text": "def selectedBarsOn(strip, color):\n for i in range(strip.numPixels()):\n if leds[i] == True:\n strip.setPixelColor(i, color)\n else:\n strip.setPixelColor(i, Color(0, 0, 0))\n strip.s...
[ { "docid": "fca8ef6d118cf293f5681412d3b06a9c", "score": "0.68102723", "text": "def allBarsOff(strip):\n setAll(strip, Color(0, 0, 0))\n strip.show()", "title": "" }, { "docid": "43c8c3bc1f6fd947ad5058d5a9316b9e", "score": "0.6350631", "text": "def deselect(self):\n self....
766ceaba5bfcfc6970b6b5c9006dc0f4
Return update operation string with random values x y z w UPDATE x y z w
[ { "docid": "ecb0c9b2dd34d88ab35ca778d1f9e9ca", "score": "0.6559078", "text": "def random_update_string(edgesize):\n x, y, z = np.random.randint(edgesize, size=3) + np.array([1, 1, 1])\n w = int(np.random.uniform(-10e9, 10e9))\n return f'UPDATE {x} {y} {z} {w}'", "title": "" } ]
[ { "docid": "b756e050907f15b4c563749e003c97d4", "score": "0.62117904", "text": "def update():\n\n return 0, \"\"", "title": "" }, { "docid": "2668478b44a072326982505a1a41252f", "score": "0.60683626", "text": "def test_10_update_simple(self):\n\n User = \"User.update(\\\"38f2...
3b2ca89911346bae817b9127aabd70e3
plots the baselined data
[ { "docid": "1a5e5a9858fa3e8ce25ccbdc3b39dd32", "score": "0.0", "text": "def plot_data_bas(save_folder, electrode = 'all', save_name = 'data_bas', save_ext = '.png'):\n data_bas, fs = reader.read_databas(save_folder)\n plot_data(data_bas, fs, save_folder, electrode = 'all', save_name = save_name, s...
[ { "docid": "c53b6e855fb9c1e6c35c8eb1a4de3a95", "score": "0.7291515", "text": "def stat_plot():", "title": "" }, { "docid": "b15382ff7e5413c58f939ddcb600f9cc", "score": "0.72905284", "text": "def plot(self):", "title": "" }, { "docid": "a4240a5aadf84ac63cc47713c81c8741", ...
7fab4685d4907d969bd93e4e11fe13da
Deletes an index and returns the Response.
[ { "docid": "9ae801eac2ec0c7b235c50e123742490", "score": "0.70268214", "text": "def delete(self,index_name):\r\n try:\r\n return self.client.delete_edge_index(index_name)\r\n except LookupError:\r\n return None", "title": "" } ]
[ { "docid": "20c4a6d50b9d9e8a7160621773fc11d0", "score": "0.81049603", "text": "def delete_index(self, name):\r\n path = build_path(index_path,name)\r\n return self.request.delete(path,params=None)", "title": "" }, { "docid": "48fc0bcbd5e887e6669b330ad32e82f5", "score": "0.7...
69e1b9bb94dfdc0b51ac7e8fb8227fdb
Generates reads with a given error rate. >>> from Bio.Seq import Seq >>> contigs = dict() >>> contigs['1'] = Seq('ACGATGAGTAGAGACAGAGATAGAGAGATAGAACGATGAGTAGAGAG') >>> rec = None
[ { "docid": "6ac9ac1b7ee9747624ea4b8ba384f9b0", "score": "0.5562005", "text": "def gen_reads(contigs, n, read_length, sub_erate):\n \n contig_names = list(contigs.keys())\n contig_lens = dict()\n\n for i in contigs:\n contig_lens[i] = len(contigs[i])\n \n nread = 0\n done = Fa...
[ { "docid": "8a9afa899340c5163c92f8b1efa1fa13", "score": "0.52502173", "text": "def iter_record(record: SeqRecord) -> Generator[Tuple, None, None]:\n for nuc, qual in zip(record, record.letter_annotations[\"phred_quality\"]):\n # prob of error\n prob = 10 ** -(qual / 10)\n yield n...
8043ab3390a3fe7221896f6dbe791964
Retrieve the picture from TwitPic
[ { "docid": "0647cd8cb20444896cbcb30038f69059", "score": "0.83215106", "text": "def get_twit_pic(**kargs):\r\n twitpage = api_call(*urlsplit(kargs['url'])).read()\r\n anchor = '<img class=\"photo\" id=\"photo-display\" src=\"'\r\n start = twitpage.index(anchor) + len(anchor)\r\n end = twitpag...
[ { "docid": "f03a07b9e9453c460107bcb1bc2c8829", "score": "0.84223866", "text": "def get_twitgoo_pic(**kargs):\r\n host, path, secure = urlsplit(kargs['url'])\r\n pic = api_call(host, path +'/img', secure).read()\r\n return pic", "title": "" }, { "docid": "22e35d95f91d07a40d8079ddd05f...
25f31fa66315ff122abe3ecdb28aea6b
Sets the keyguard_disabled of this EnterprisePolicyData. Should KeyGuard be disabled?
[ { "docid": "16f2d6be8939f474fc51d4968abbf9c9", "score": "0.8649095", "text": "def keyguard_disabled(self, keyguard_disabled):\n\n self._keyguard_disabled = keyguard_disabled", "title": "" } ]
[ { "docid": "01e0ff0e55526b4b4f5e9f5c55b1e085", "score": "0.7613828", "text": "def keyguard_disabled(self):\n return self._keyguard_disabled", "title": "" }, { "docid": "a26b8f8bf253dc943f1427bc1a1603c8", "score": "0.59514517", "text": "def disable(self) -> Awaitable[Dict]:\n ...
eb71efa1a2962d64023d5d4afc01b0fa
Returns if there is any word in the trie that starts with the given prefix.
[ { "docid": "c41d511488f18931b5996f998378ce6c", "score": "0.7661376", "text": "def startsWith(self, prefix: str) -> bool:\n node = self.root\n for char in prefix:\n if char not in node.children:\n return False\n node = node.children[char]\n\n retu...
[ { "docid": "5d1a552ce96f28a17ff02733ba0212b7", "score": "0.84394646", "text": "def startsWith(self, prefix: str) -> bool: \n return(self.searchTrie(self.root, prefix, True))", "title": "" }, { "docid": "0a82b07344eb20900f183e4a08b3d6a7", "score": "0.843329", "text": "def start...
4ac27fb0f988bff24354ee1a1b987a18
Renders the home page.
[ { "docid": "79a1cec6577b7e28956c3623e2ffc701", "score": "0.0", "text": "def home(request):\n\n #assert savesave_to_bd.save_to_bd()\n save_to_bd.save_to_bd()\n\n assert isinstance(request, HttpRequest)\n\n table, folium_map = plot_map.show()\n\n return render(\n request,\n 'a...
[ { "docid": "93b0d81a4e377798d73883654df1785e", "score": "0.86085397", "text": "def home():\n\treturn render_template('home.html')", "title": "" }, { "docid": "93b0d81a4e377798d73883654df1785e", "score": "0.86085397", "text": "def home():\n\treturn render_template('home.html')", "...
93a4e194462b6657722b80220b536963
_main_ provide support for some basic docker operations so that building images can be standardised as part of a workflow
[ { "docid": "ecd643d4ccd428e0fa21ebc05bb2a5ce", "score": "0.64680725", "text": "def main():\n opts = build_parser()\n config = load_configuration()\n if not config.has_section('docker'):\n msg = (\n \"Unable to find docker section in cirrus.conf\"\n #TODO: Link to do...
[ { "docid": "1f58d9f59126c05bb35db12984aabc71", "score": "0.72338295", "text": "def docker() -> None:\n pass", "title": "" }, { "docid": "6c1687f1282d12b20080c89c4e51a02e", "score": "0.6880054", "text": "def build(ctx):\n ctx.run('docker build -t {} .'.format(cli_image_name))", ...
ac413010644727bcbf79d8d69b379b03
Helper function to calculate the sum of Loggamma functions for calculate the score.
[ { "docid": "584d5b7712ab1a056c6130fa1819055b", "score": "0.59813946", "text": "def bayesian_score_component(M, alpha):\n M_values= [M[i] for i in M.keys()]\n p = np.sum(loggamma(alpha + M_values))\n p -= np.sum(loggamma(alpha))\n p += np.sum(loggamma(np.sum(alpha, axis=1)))\n p -= np.sum(...
[ { "docid": "2d9472ac0b40863e837c622553d8e6ac", "score": "0.71171165", "text": "def loggamma(*args, **kwargs): # real signature unknown\n pass", "title": "" }, { "docid": "7af8e16cfcd828e9e2ad587e0b056dd0", "score": "0.6929556", "text": "def log_Beta(alphas):\n #return product(m...
4f20628cc01c7ef652bdba4cc4450d0b
Allow to convert the iso code language list into a list of titles
[ { "docid": "1d7b00379515f47b11a4c7a2df993c20", "score": "0.55227435", "text": "def get_languages(self, iso_codes):\n langList = []\n for isoCode in iso_codes:\n if CONSTANTS.dico_languages.has_key(isoCode):\n langList.append(CONSTANTS.dico_languages[isoCode])\n ...
[ { "docid": "6832b39328905e63f1a7613e38e97b4d", "score": "0.67992806", "text": "def translated_titles(self, iso_format=None):\n\n fmt = iso_format or self._iso_format\n\n trans_titles = {}\n if 'v12' in self.data['article']:\n for title in self.data['article']['v12']:\n ...
f7336e3c5843aec041b3eabb6d1a0311
Take integer y (tensor or variable) with n dims and convert it to 1hot representation with n+1 dims.
[ { "docid": "6e5732d85223adf236219a11551c52e0", "score": "0.8346173", "text": "def to_one_hot(y, n_dims=None):\n y_tensor = y.data\n y_tensor = y_tensor.type(torch.LongTensor).view(-1, 1)\n n_dims = n_dims if n_dims is not None else int(torch.max(y_tensor)) + 1\n y_one_hot = torch.zeros(y_ten...
[ { "docid": "16ae1ce18896056ce2bb276fb97081be", "score": "0.8294972", "text": "def to_one_hot(y, N):\n y_tensor = y#.data if isinstance(y, torch.autograd.Variable) else y\n y_tensor = y_tensor.long().view(-1, 1)\n if int(N) <= 0:\n N = torch.max(y_tensor).long() + 1\n y_one_hot = torch...
3e2a1a41a04d3c65373b88054dd9463f
Decode given bytes object `data` as given type `name` and return the decoded data as a dictionary. >>> foo.decode('Question', b'0\\x0e\\x02\\x01\\x01\\x16\\x09Is 1+1=3?')
[ { "docid": "5a88bf17a05e248dbe34a7f77b98c0b1", "score": "0.7317871", "text": "def decode(self, name, data):\n\n return self._types[name].decode(data)", "title": "" } ]
[ { "docid": "603690964ff48e76ef4b6e52c09673fc", "score": "0.703049", "text": "def decode(data: dict):\n pass", "title": "" }, { "docid": "4047129ee4cf8585707fee8949b61464", "score": "0.7024252", "text": "def decode_data(data):\n return data.decode(encoding='utf-8') if isinst...
d43e4579041b8be2490d535ce802d27f
The arguments have the same meaning as in the dropout_layer function.
[ { "docid": "39c9b2b3ee640bd9c9519a3485bbd8b8", "score": "0.0", "text": "def enable_dropout(train_premasks, train_postmasks):\n for premask in train_premasks:\n premask.set_value(1)\n for postmask in train_postmasks:\n postmask.set_value(np.cast[floatX](1))", "title": "" } ]
[ { "docid": "c25be25acb9e00e6b9991291b5072f2e", "score": "0.64838076", "text": "def create_dropout_layer(self):\n raise NotImplementedError", "title": "" }, { "docid": "3ce062bbf7af24958e07c6fe63adccf0", "score": "0.6317723", "text": "def push_dropout_layer(self, keep_prob):\n ...
fea7c20246b3976198808fa8c7a94e6d
Load image from base64
[ { "docid": "194aa7db8e2d52e9e5fb4d999046ced4", "score": "0.83857167", "text": "def _load_from_base64(self, value):\n search_results = re.search(self.BASE64_REGEX, value)\n data = search_results.group(2)\n if len(data) % 4:\n data += '=' * (4 - len(data) % 4)\n data...
[ { "docid": "f7722b5e811a9bfbac4a10b63e8fd8ed", "score": "0.80330646", "text": "def _load_image_from_base64_image(base64_image: str) -> np.ndarray:\n return ImageUtilities._pil_to_numpy(\n ImageUtilities._base64_to_pil(base64_image), _format=\"BGR\"\n )", "title": "" }, {...
bed5dcbe4383c9988164b8bcee8f4ae3
Returns True if the given string is in Google Music id form.
[ { "docid": "b19cfb950577f0622b596c172db40f15", "score": "0.7482086", "text": "def is_gm_id(s):\r\n return re.match(gm_id_regex, s) is not None", "title": "" } ]
[ { "docid": "12e69c27f1ba64c6839ef55fd6a0a90a", "score": "0.65633464", "text": "def stringcheck_id(self, string):\n string = str(string) # because of 2.7 input problem\n if re.match(\"^[a-zA-Z_][a-zA-Z0-9_]*$\", string) != None:\n return True\n else:\n return Fa...
f60393a5315a0be0bd462b1ad5888fd5
Converts a connectivity tensor to a dgl graph with edge and node features.
[ { "docid": "5609fad7909b17ecf78df3cf43f4ba09", "score": "0.6688228", "text": "def _connectivity_to_dgl_edge(connectivity,sparsify=False):\n assert len(connectivity.shape)==3, \"Should have a shape of N,N,2\"\n N,_,_ = connectivity.shape\n distances = connectivity[:,:,1]\n mask = torch.ones_l...
[ { "docid": "428149d33b5dcdfa8fa35ea1acbb7cb4", "score": "0.7025889", "text": "def adj_to_dgl_graph(adj):\n nx_graph = nx.from_scipy_sparse_matrix(adj)\n dgl_graph = dgl.DGLGraph(nx_graph)\n return dgl_graph", "title": "" }, { "docid": "760c8511bc57de853e2a221c132ee3bd", "score":...
ec6ec90b5353cfd5cfc372183415c6a7
check missing percentage of every feature
[ { "docid": "925655d1faa0bbaf4b620a03b04e768d", "score": "0.64688915", "text": "def missing_value_pct(self, data):\n tmp_data = data.copy()\n if tmp_data.empty:\n return False\n missing_rate_df = pd.DataFrame(tmp_data.isnull().mean(), columns=['missing_rate'])\n ret...
[ { "docid": "6fc001d90fc77d9d7be6395036917507", "score": "0.6547822", "text": "def _is_ok_feature(self, feature) -> bool:\n if feature.isnull().mean() >= self.max_nan_rate:\n return False\n if (feature.value_counts().values[0] / feature.shape[0]) >= self.max_constant_rate:\n ...
213a4ea178810f219a88f61ad163e5e2
Returns LFS for current node
[ { "docid": "0b8195ae715b1ebb5d4948e0e91d1633", "score": "0.510134", "text": "def get_lfs(conf, ring, datadir, default_port, logger):\n fs = conf.get('fs', 'xfs')\n try:\n module_name = 'swift_lfs.fs.%s' % fs\n cls_name = 'LFS%s' % fs.upper()\n module = __import__(module_name, ...
[ { "docid": "be7ee2215b02a613745df021d80db130", "score": "0.65237695", "text": "def lft(self):\n return self._lft", "title": "" }, { "docid": "d4e35465f4e9efa5863436ea473cfab4", "score": "0.6152094", "text": "def bfs(self):\n\n queue = Queue()\n queue.put(self)\n\...
a0f7b02c15b120e78b8ea99e523bd88a
Test that the report is correct.
[ { "docid": "2cee7de2673fae20e61b01ceaced3c26", "score": "0.7139832", "text": "def test_report(self):\n self.__birt.nr_manual_ltcs.return_value = 10, []\n self.__birt.nr_manual_ltcs_too_old.return_value = 5\n self.__birt.date_of_last_manual_test.return_value = datetime.datetime.now()...
[ { "docid": "33413fe45069fc706964ce3f54eb8e12", "score": "0.77926624", "text": "def test_report(self):\n self.assertEqual('Van 4 van de 12 handmatige logische testgevallen is de uitvoeringstijd niet ingevuld.',\n self.__metric.report())", "title": "" }, { "docid...
d04a316f8aae73b9a1bd180338544829
Forward method for NetVladOrthoReg.
[ { "docid": "cf964e07b576847f8055ac4ab4df9c93", "score": "0.0", "text": "def forward(self, inputs, **unused_params):\n\n reshaped_input = tf.reshape(inputs, [-1, self.max_frames, self.feature_size])\n\n #\n # New: Compute attention-based cluster similarity weights:\n #\n ...
[ { "docid": "71873500bedcb65572a0302e356690c9", "score": "0.6630026", "text": "def forward(self):\n self.HR_G = self.netG(self.LR)", "title": "" }, { "docid": "c5b726b3aa05d9e7850ccdbcc9745924", "score": "0.63454056", "text": "def forward(self):\n self.fodpred = self.net...
beaf0668b7f4e27436a093896c5aac5c
Description contains select property options.
[ { "docid": "4bad8f2c849cc57db064cf607e5f9106", "score": "0.6118933", "text": "def test_description(self):\n description = SampleClass.get_description()\n descr_json = json.dumps(description)\n self.assertIsInstance(json.loads(descr_json), dict)\n self.assertIn('select_propert...
[ { "docid": "e2512257a3a8f5dfb5d85dfad4e052fd", "score": "0.7056538", "text": "def getOptionDescriptions(self) -> List[unicode]:\n ...", "title": "" }, { "docid": "f6d2d26e25b447083259be74f68c47d8", "score": "0.66717213", "text": "def _select (self, name, description=None):\n ...
2c45436778ad7ce358304fdbf918c506
Check if an element exists on page for the given html xpath
[ { "docid": "1e4d1a418f66980ddb3dd3fbbc47c247", "score": "0.7942066", "text": "def __check_exists_by_xpath(self, xpath):\n\n try:\n self.browser.find_element_by_xpath(xpath)\n except NoSuchElementException:\n return False\n return True", "title": "" } ]
[ { "docid": "0413ab94fca2024c2b3c704acc52310e", "score": "0.8264476", "text": "def elem_exists(self, xpath):\r\n try:\r\n self.driver.find_element_by_xpath(xpath)\r\n return True\r\n except:\r\n return False", "title": "" }, { "docid": "57c27d411...
fac0c73ff53d4aabbc7b5486460264a9
Edits all constants dependent on TEST_DIR.
[ { "docid": "f837724e3253e8bbc4d88dd36f79bc34", "score": "0.0", "text": "def set_save_dir(save_name):\n\n global SAVE_DIR, SAVE_NAME, MODEL_SAVE_DIR, SUMMARY_SAVE_DIR, RES_SAVE_DIR\n\n SAVE_NAME = save_name\n MODEL_SAVE_DIR = get_dir(os.path.join(SAVE_DIR, 'Models/', SAVE_NAME))\n SUMMARY_SAV...
[ { "docid": "f8af1f1f9c72bf95108b654dee7cefb3", "score": "0.6374559", "text": "def setUp(self):\n super(TestConstants, self).setUp()", "title": "" }, { "docid": "fbc5782d868b60b19dec637d5154487a", "score": "0.5857609", "text": "def _patch_main_src(project_dir, placeholder, valu...
6de1468ded4e201bad09caa6bd19724c
update parameters theta to make move probabilities (p, v) = f_theta(S) more closely match the improved search probabilities and self play closer to self play winner (pi, z). parameters f_theta^t+1 will theoretically be stronger
[ { "docid": "0d4e7e628cf81276cea6a848a60c8d36", "score": "0.0", "text": "def PSEUDO_backward(self):\n pass", "title": "" } ]
[ { "docid": "9839b71af2270eef26b36476b6975aff", "score": "0.6501566", "text": "def updateW(self, trj_Sp_theta, W_0):\n def fun(x):\n global trj_Sp_theta_z\n W_0 = [[x[0], x[1]],[x[2], x[3]]]\n r_0 = self.reward_trj(trj_Sp...
0c4c6dd2c51c2603b9664594c8f91331
add_new_action(action) > None Call this function to add a new action to the vistrail being controlled by the vistrailcontroller.
[ { "docid": "f1ccc36bc99322d00b2852fc0a974e5c", "score": "0.68400925", "text": "def add_new_action(self, action, description=None):\n if action is not None:\n BaseController.add_new_action(self, action, description)\n self.emit(QtCore.SIGNAL(\"new_action\"), action)\n ...
[ { "docid": "dbabcc32c1471581471bccd01caecead", "score": "0.733523", "text": "def add_action(self, action):\n self.action.append(action)", "title": "" }, { "docid": "1ce8936babc98ab865f03fc98c217138", "score": "0.7085356", "text": "def register_action(self, action):\n se...
c0d786c1e94cc697f1b50ea9592d76c8
Predict the class for a new given data.
[ { "docid": "7a06abf630e048043c35be2fb7f84503", "score": "0.0", "text": "def predict(self, data):\n feat_df = data[['value']].copy()\n feat_df['length'] = feat_df['value'].apply(lambda val: len(val))\n feat_df['digit_frac'] = feat_df['value'].apply(\n lambda val: 0 if len(...
[ { "docid": "5448685d9015ae40b0c3e981383ba774", "score": "0.78026956", "text": "def predict_class(self, X_new):\n result = [self.predict_class_single(x) for x in X_new]\n return result", "title": "" }, { "docid": "af34c97d9232b7d9a55031dcf07ddbc8", "score": "0.7721786", ...
70ef012d45d6735cabcc3559dbf60dea
Reorganise correlation product dim of vis so that correlations are grouped as given in cp_argsort.
[ { "docid": "68dbac0613c9b8f44e24e710655b1b80", "score": "0.6483097", "text": "def _reorganise_product(vis, cp_argsort, out_vis):\n n_time = vis.shape[0]\n n_chan = vis.shape[1]\n n_bl = cp_argsort.shape[0]\n n_stok = cp_argsort.shape[1]\n for tm in range(n_time):\n bstep = 128\n ...
[ { "docid": "5bd7cb3cf863508164617877e800fafb", "score": "0.5846539", "text": "def argsort(self, axis=-1, kind=None, order=None):\n ...", "title": "" }, { "docid": "383269bebe3899d49aa4ec6c45b2b337", "score": "0.58052355", "text": "def _sort(self):\n\n indices = self.xar...
34065d080ef4038154acee194ae6693c
Get a random note sequence from training set.
[ { "docid": "afe2ca4defa15ef4b4b0f50983be91fd", "score": "0.5828556", "text": "def get_random_sequence_i(i,direction,sequences,durseqs,chordseqs,lows,highs,spseq):\n i += direction*1\n if i >= len(sequences)-1 or i <= 0:\n direction *= -1\n notes = sequences[i]\n durs = durseqs[i]\n ...
[ { "docid": "9efef894a4effa2c2a1f8c61a64c5a52", "score": "0.65925586", "text": "def playRandom(self):\r\n\t\tindex = random.randint(0, len(self.notes)-1)\r\n\t\tnote = list(self.notes.values())[index]\r\n\t\t#return note\r\n\t\tnote.play()", "title": "" }, { "docid": "27c293fdfdbad760c9135fca...
44188704f713f90f0cc6cef7bc8e768d
SetMaskValue(itkMaskedImageToHistogramFilterICF3ISS3 self, itkSimpleDataObjectDecoratorSS _arg) SetMaskValue(itkMaskedImageToHistogramFilterICF3ISS3 self, short const & _arg)
[ { "docid": "613ab156bf6cd5556dffcf7d31191dfd", "score": "0.8657261", "text": "def SetMaskValue(self, *args) -> \"void\":\n return _itkMaskedImageToHistogramFilterPython.itkMaskedImageToHistogramFilterICF3ISS3_SetMaskValue(self, *args)", "title": "" } ]
[ { "docid": "30a00a57275b8763d29c667bf2f392c2", "score": "0.8788932", "text": "def SetMaskValueInput(self, _arg: 'itkSimpleDataObjectDecoratorSS') -> \"void\":\n return _itkMaskedImageToHistogramFilterPython.itkMaskedImageToHistogramFilterICF3ISS3_SetMaskValueInput(self, _arg)", "title": "" ...
166a4a04e4927ffada15efd6da0a1719
Returns a tuple containing various accuracy metrics.
[ { "docid": "2b887430f4857c841603d0818710045c", "score": "0.6452261", "text": "def get_accuracy(model: Model,\n result: Result,\n example: Example) -> Tuple[float, float, float, float, float]:\n del model # Unused.\n\n # TODO(kshi): Refactor to reuse the simpler code in...
[ { "docid": "5e1ecb6edb312cf47bb0601254ba1805", "score": "0.7734463", "text": "def accuracy(self):\n\n\t\treturn (self.truePositives + self.trueNegatives) / self.items", "title": "" }, { "docid": "e9c2bf54ead0f330e10b9669a8749124", "score": "0.77266836", "text": "def _get_accuracy(sel...
4623600639342d32adeb153e3e2c9649
Loads TIFF images from paths as numpy arrays.
[ { "docid": "bd8456f3f24ed1c045f7ed3f6bda792e", "score": "0.65337104", "text": "def load_images(self) -> Generator[np.ndarray, None, None]:\n for path_ in self._paths:\n if not os.path.exists(path=path_):\n raise ImageNotFoundError(path_)\n\n try:\n ...
[ { "docid": "37bc7bb047c51d9c59c99605658da6b9", "score": "0.7312007", "text": "def read_tiff_sequence (path):\n\ttomo_files = sorted(glob(path))\n\tnum_files = len(tomo_files)\n\n\t# Read first to understand sizes:\n\ttomo = imread(tomo_files[0])\n\n\t# Prepare dataset:\n\tdata = zeros((tomo.shape[0], to...
f68ccc29c713b415872ba580eb64f23a
Compute the cosine similarity of all pairs in ``X``. To be added.
[ { "docid": "eb0c58c1d49eab42e27d8b5a21698968", "score": "0.74439645", "text": "def transform(self, X):\n n_pairs, two = X.shape\n Xt = np.zeros(n_pairs, dtype=float)\n i=0\n for x1, x2 in X:\n Xt[i] = cosine_similarity(x1, x2)\n i+=1\n\n return Xt...
[ { "docid": "7cd76d82ac6c4ff23bce6e140b37c164", "score": "0.75480765", "text": "def cosine_similarity(self, x1, x2, dim=1):\n w12 = torch.sum(x1 * x2, dim)\n w1 = torch.norm(x1, 2, dim)\n w2 = torch.norm(x2, 2, dim)\n return (w12 / (w1 * w2).clamp(min=self.eps)).squeeze()", ...
73d4f1f8bd56fd8e6e8a192a4a148516
Used for AllXY measurement and calibration for multiple qubits simultaneously.
[ { "docid": "3e9c1545d6f0eb6c0c3e576e4611f682", "score": "0.6008026", "text": "def multi_qubit_AllXY(qubits_idx: list, platf_cfg: str, double_points: bool = True) -> OqlProgram:\n\n p = OqlProgram(\"Multi_qubit_AllXY\", platf_cfg)\n\n allXY = [['i', 'i'], ['rx180', 'rx180'], ['ry180', 'ry180'],\n ...
[ { "docid": "051cce46202ff410a55de1980f5f67e2", "score": "0.5637091", "text": "def AP_Keq_examples(self):\n\n # calculate keq values using latest parameter values\n c1, c2, c3 = self.coeffs\n\n # calc keq for all\n for its in self.dg100 + self.dg400:\n its.calc_keq(...
a177402ca95837ce905adefe4e4b8d25
Load user in login manager after successful authentication
[ { "docid": "be28d3224ee95759744be9229953ab08", "score": "0.0", "text": "def load_user(id):\n return User.query.get(int(id))", "title": "" } ]
[ { "docid": "2e9c56a0d4e0780642877e9c4cf20843", "score": "0.7383222", "text": "def load_user():\n g.user = User.objects(email=session.get('logged_in')).first()", "title": "" }, { "docid": "9921d39e5804f4838eab20edbbce2cad", "score": "0.7299501", "text": "def authentication(app, use...
f262780237a318b08ee6533c0c2b718c
The initial requested URI cannot be modified during the user interactive authentication session.
[ { "docid": "89a8b1d7679d46e64d3283cc34e9200c", "score": "0.5436516", "text": "def test_cannot_change_uri(self) -> None:\n # Create a second login.\n self.login(\"test\", self.user_pass, \"dev2\")\n\n # Attempt to delete the first device.\n # Returns a 401 as per the spec\n ...
[ { "docid": "e27c96184d3d5eb28e76d38f0383954d", "score": "0.5817669", "text": "def test_authenticated_uri(self):\n request = self.factory.get(self.uri)\n force_authenticate(request, self.user)\n response = self.view(request)\n response.render()\n self.assertEqual(respon...
f87df1f868d8a0937a9ece2303097018
Returns the UID, the UID where the Brick is connected to, the position, the hardware and firmware version as well as the device identifier. The position can be '0''8' (stack position).
[ { "docid": "ff1efcecb313519d85108b3f0b5cec55", "score": "0.0", "text": "def get_identity(self):\n return GetIdentity(*self.ipcon.send_request(self, BrickDC.FUNCTION_GET_IDENTITY, (), '', '8s 8s c 3B 3B H'))", "title": "" } ]
[ { "docid": "81f8d864177e6dabd9725d2750ae5105", "score": "0.59945315", "text": "def read_uid(self):\n return self.ipcon.send_request(self, BrickHAT.FUNCTION_READ_UID, (), '', 'I')", "title": "" }, { "docid": "e4d920a2598f5f2aad915fd74784a61c", "score": "0.59237516", "text": "de...
9929accb08cf07af7a71119ec5e2502c
Parse packages from filename.
[ { "docid": "f66162ef1cde617aa750947290fd4e76", "score": "0.0", "text": "def get_packages_async_2(filename):\n pool = Pool(processes=cpu_count() + 2)\n num = 0\n for packages in pool.map(_get_packages, _iter(filename)):\n if packages:\n for package in packages:\n ...
[ { "docid": "69f75f8ea60b3debaabd6fc32d0dabc1", "score": "0.66556424", "text": "def parse(self, filename):\n pass # implemented in Ada", "title": "" }, { "docid": "e39c948dfe9585ded737137cfc2c7717", "score": "0.6559397", "text": "def get_packages(filename):\n num = 0\n p...
f5cf5fc9fafde2916e90572ab278c0bf
Creates a MongoDB filter for new documents. By "new", we mean documents in this Store that were last updated later than any document in targets.
[ { "docid": "f6226e52defd180c7c9cbc3640c0ea6b", "score": "0.59591556", "text": "def lu_filter(self, targets):\n if isinstance(targets, Store):\n targets = [targets]\n\n lu_list = [t.last_updated for t in targets]\n return {self.lu_field: {\"$gt\": self.lu_key[1](max(lu_lis...
[ { "docid": "202637605fe0d6c4cd9b4f70374b6863", "score": "0.54216784", "text": "def changesWithFilter(self, filter, limit=1000, since=-1):\n if since < 0:\n since = self.last_seq\n data = self.get('/%s/_changes?limit=%s&since=%s&filter=%s' % (self.name, limit, since, filter))\n ...
4cfcf17fb7ed12a4a17e4ecac43019fe
Get version number from the pkmodel module. The easiest way would be to just ``import pkmodel ``, but note that this may fail if the dependencies have not been installed yet. Instead, we've put the version number in a simple version_info module, that we'll import here by temporarily adding the oxrse directory to the py...
[ { "docid": "1f2fc9112122d6cd672fa39a911acc3b", "score": "0.8605629", "text": "def get_version():\n import os\n import sys\n\n sys.path.append(os.path.abspath('pkmodel'))\n from version_info import VERSION as version\n sys.path.pop()\n\n return version", "title": "" } ]
[ { "docid": "d98e82f0b1ecff5519def17ba5a4e53f", "score": "0.73453414", "text": "def get_model_version():\n from .. import __model_version__\n\n return __model_version__", "title": "" }, { "docid": "e3003c2756e7ba9382ad7419a59451ea", "score": "0.6573163", "text": "def get_version...
118cd7923b03484afb4cefa3d6f41144
Show spectrum and SB map in a given direction of MoCaLaTA output. Example >>> showobs('gal03/0068/','xm')
[ { "docid": "323b42005808b2f724446e4cce0907ac", "score": "0.66047466", "text": "def showobs(galdir, view,\n spatial_aperture = None,\n spec_ap = None,\n mother = './',\n cosmo = Planck15,\n vmin = None,\n vmax = Non...
[ { "docid": "674790eb55368a06bbb1c8dcc4ff1401", "score": "0.5732015", "text": "def show_obs(obs_index):\n if obs_index == 27:\n return '*'\n elif obs_index == 26:\n return ' '\n else:\n return chr(obs_index + ord('a'))", "title": "" }, { "docid": "754eabd45fa8e1e47de1319d01eb6429"...
ab1c464dbeffedcad2295dc61d6040f9
Category are correctly named
[ { "docid": "a5c6b7ce12746d005f0e84b77c840071", "score": "0.6557743", "text": "def test_class_name(self):\n category = Category.objects.get(name=\"MED\")\n self.assertEqual(category.name, 'MED')", "title": "" } ]
[ { "docid": "04b89e3005840b483d9d68614f7db866", "score": "0.7223058", "text": "def __str__(self):\n return \"%s\" %(self.category_name)", "title": "" }, { "docid": "17f31039bc63e05d2c29cbfddac669f2", "score": "0.7195257", "text": "def category():\n pass", "title": "" }...
6a55ef7b5337d6440def0fb227d5dd4c
Global application exception handler. For "basic" errors (I/O errors, keyboard interrupt, etc.) just the error message is printed as there's generally no need to confuse the user with a complete stack trace when it's just a missing file. Other exceptions, however, are logged with the usual full stack trace.
[ { "docid": "59fb904953040acebe4029f7cf6808ee", "score": "0.0", "text": "def error_handler(exc_type, exc_value, exc_trace):\n if issubclass(exc_type, (SystemExit,)):\n # Exit with 0 (\"success\") for system exit (as it was intentional)\n return 0\n elif issubclass(exc_type, (KeyboardI...
[ { "docid": "cfc6405b65231024c8845a59cdfa5f6b", "score": "0.74804026", "text": "def global_exception_handler(exception: Exception) -> None:\n log.error('occur %s %s', exception.__class__.__name__, str(exception.args))\n print(exception)", "title": "" }, { "docid": "9d3b6a24b4f6e9bea2a7d...
2c51f84424129b9c3d172d5617a4d18d
This endpoint does a special onetime bootstrap of the ACL system, making the first management token if the acl_master_token is not specified in the Consul server configuration, and if the cluster has not been bootstrapped previously. This is available in Consul 0.9.1 and later, and requires all Consul servers to be upg...
[ { "docid": "e39d22b980fcafe79ee8f139b0f1f886", "score": "0.5312343", "text": "def bootstrap(self):\n return self._put_response_body(['bootstrap'])['ID']", "title": "" } ]
[ { "docid": "29e5ddf142f447f368aa51fed9c847d9", "score": "0.5988396", "text": "def cmd_bootstrap(args):\n if getuser() != \"root\":\n error(\"Command has to run as root.\")\n\n if args.nodes is None:\n nodelist = [vm.name for vm in clusterdef.vm]\n else:\n nodelist = args.no...
8e444fb4ab189b2b1342a799914c2ce0
Query backend to set new risk limit.
[ { "docid": "6fc80801b87db66e6f435ccc23132824", "score": "0.67008007", "text": "def set_risk_limit(self):\n name, symbol = self._get_selected()\n riskLimit = int(self.riskSpin.get())\n try:\n core.position_risk_limit([name], symbol, riskLimit)\n self.update_inst...
[ { "docid": "4027090ba44f9d7b789a7adc225e048b", "score": "0.6715031", "text": "def risk_limit(self, risk_limit):\n\n self._risk_limit = risk_limit", "title": "" }, { "docid": "208d7e671dd414b0b0c63ed3c1b72284", "score": "0.6701142", "text": "def set_limits(self):", "title":...
6b0bda8dd2dc34d181e9106c82a2a85b
generated source for method __init__
[ { "docid": "69a03b0b49aef10faed120ddbf5197d2", "score": "0.0", "text": "def __init__(self, finder):\n super(TablingSolver, self).__init__(finder)\n self.simpleFinder = SudokuStepFinder(True)\n i = 0\n while len(tmpOnSets):\n self.tmpOnSets[i] = SudokuSet()\n ...
[ { "docid": "2fc2e6931a140e00b1ded6302e3cb897", "score": "0.8635625", "text": "def __init__(__self__):\n pass", "title": "" }, { "docid": "2fc2e6931a140e00b1ded6302e3cb897", "score": "0.8635625", "text": "def __init__(__self__):\n pass", "title": "" }, { "doc...
8cee350d51966e0ec041726df5615876
returns a sequence with the first and last characters swapped
[ { "docid": "c24010c590ecec8b99a867a3ada4c4e7", "score": "0.7389425", "text": "def exchange_first_last(seq):\n\tfirst = seq[0]\n\tmid = seq[1:-1]\n\tlast = seq[-1]\n\t\n\tif type(seq) == str:\n\t\treturn last + mid + first\n\telse:\n\t\teos=len(seq)\n\t\tmid.insert(0,last)\n\t\tmid.insert(eos,first)\n\t\...
[ { "docid": "acecd658cbf3c6f2e8fd53588ee88c6c", "score": "0.77933437", "text": "def seq_swap_first_last(seq):\n return (seq if (len(seq) < 2) else seq[-1:] + seq[1:-1] + seq[0:1])", "title": "" }, { "docid": "8085456ed54e7f29145e05cbbaaf882d", "score": "0.76585096", "text": "def ex...
4a365ce584eee01290f5a160284042b9
Returns the tests in |tests| that have at least one of their compile targets in |compile_targets|.
[ { "docid": "26fe9329c821b898fee803f75a5b3580", "score": "0.80282277", "text": "def tests_in_compile_targets(api, compile_targets, tests):\n result = []\n for test in tests:\n test_compile_targets = test.compile_targets(api)\n\n # Always return tests that don't require compile. Otherwise we'd nev...
[ { "docid": "7c1f73c51d4e05474cc4179520270cfc", "score": "0.64364606", "text": "def all_compile_targets(api, tests):\n return sorted(set(x\n for test in tests\n for x in test.compile_targets(api)))", "title": "" }, { "docid": "77041d9d085c52ac692244cfa90...
45b3623ba61966a94edbc20b2bdf4fe8
Convenience method for merging replicates. Merge will extrapolate times to `number_per_run=1` and will not transfer any metadata. (Since it might differ between replicates)
[ { "docid": "4a14c333dc41744af2af5f93dce71346", "score": "0.44534874", "text": "def merge(measurements): # type: (Iterable[Measurement]) -> List[Measurement]\r\n grouped_measurements: DefaultDict[TaskSpec, List[Measurement]] = collections.defaultdict(list)\r\n for m in measurements:\r\n ...
[ { "docid": "5c48bdd3d85f9a61a258cddfddf4a793", "score": "0.57867146", "text": "def merge_runs(ctx, args):\n from . import merge_impl\n\n merge_impl.main(args, ctx)", "title": "" }, { "docid": "9061efa9a9fc791c8dbbeddcbf57705d", "score": "0.57148755", "text": "def run_merge(self...
a2705f464cacd4cac18658eb5c83b576
Get the abbreviated metaedges for an abbreviated metapath. Pass a hetio.MetaGraph object to `standardize_by` to standardize metaedge abbreviations based on the noninverted orietatation. Pass `text` to standardize by alphabetical/forwarddirection arrangment of the abbreviation. Default (`None`) does not standardize.
[ { "docid": "d03621972f35fb52df1ff13fc44441a9", "score": "0.7505954", "text": "def metaedges_from_metapath(abbreviation, standardize_by=None):\n if isinstance(standardize_by, hetio.hetnet.MetaGraph):\n metapath = standardize_by.metapath_from_abbrev(abbreviation)\n return [metaedge.get_st...
[ { "docid": "f621f2899b05db266c51a54b3830006c", "score": "0.5728711", "text": "def create_abbreviations(metagraph):\n kind_to_abbrev = find_abbrevs(metagraph.node_dict.keys())\n kind_to_abbrev = {kind: abbrev.upper()\n for kind, abbrev in kind_to_abbrev.items()}\n\n edge_set...
e7a0978044c28389b858fd2862c54aaa
Wrapper for main function
[ { "docid": "e696deb90cf7e8b40da734a53d2bb0d6", "score": "0.0", "text": "def main():\n # Constants\n y_label = \"Survived\"\n factor_cols = [\"Embarked\", \"Sex\"]\n\n # Load and clean training data\n print(\"Loading, cleaning training data...\")\n training_data = extract_clean_data(\"t...
[ { "docid": "6a72f0523c7f4b19a3ff495c1baaa5c5", "score": "0.8710058", "text": "def main() -> None:", "title": "" }, { "docid": "6a72f0523c7f4b19a3ff495c1baaa5c5", "score": "0.8710058", "text": "def main() -> None:", "title": "" }, { "docid": "82c54a749d7508e492693a3059faed...
d3f1b8b59075de171a62c9387ab95df1
Execute the decorated test only if running in v2 mode. This function is intended to be applied to tests that exercise v2 only functionality. If the test is run in v1 mode it will simply be skipped. See go/tftestdecoratorcheatsheet for the decorators to use in different v1/v2/eager/graph combinations.
[ { "docid": "da0fa67a1dfe1d3c0c9f4710dd11ae72", "score": "0.8331696", "text": "def run_v2_only(func=None):\n\n def decorator(f):\n if tf_inspect.isclass(f):\n raise ValueError('`run_v2_only` only supports test methods.')\n\n def decorated(self, *args, **kwargs):\n if not tf2.enabled():\n...
[ { "docid": "aac29693e6b53172179e0026e37e8d2c", "score": "0.60816467", "text": "def decorated(test):\n\n @wraps(test)\n def test_with_version(self):\n \"Only run the test if ES version is not less than specified.\"\n actual_version = self.get_es().info()['version']['nu...
8815029ce05be0962e676d03a39cb105
get GS states behind and other states at front
[ { "docid": "f0fd1d1e4410d79516a30bb815aeb5d6", "score": "0.0", "text": "def ordered_states(state_list):\n labels = [s.label for s in state_list]\n indices = np.argsort(labels)\n state_list = np.array(state_list)[indices].tolist()\n\n ordered_list = []\n for state in state_list:\n i...
[ { "docid": "8bb41154d12cc8e694ed65d92ee342b4", "score": "0.67085534", "text": "def states(self):", "title": "" }, { "docid": "c78ef67cf415cc2aeb46b1bde676b289", "score": "0.6554295", "text": "def getStates(self):\r\n return self.grid", "title": "" }, { "docid": "04...
59c71601c11f442754b4945bc8de09ad
Switch the coordinate base of a wiggle file
[ { "docid": "2e3f63eb028b90fcdfc784afd6c1d18a", "score": "0.554798", "text": "def switch_base(opts):\n functional.switch_base(opts.i, opts.o, from_base=1-opts.to, to_base=opts.to)", "title": "" } ]
[ { "docid": "ab04d55cfd56dced47f1aa034242f7b2", "score": "0.57458204", "text": "def SetBase(self, base):", "title": "" }, { "docid": "d81d1619137b8199755643751174e59e", "score": "0.5698028", "text": "def setImageBase(self, base: ghidra.program.model.address.Address) -> None:\n ...
1133fbd07407924ef118cf63f878dc14
Like get_observations() but handles pagination so you get all the results in one shot.
[ { "docid": "56a7866671c7575d9da7ba58c8febe31", "score": "0.7313944", "text": "def get_all_observations(params: Dict, user_agent: str = None) -> List[Dict[str, Any]]:\n\n # According to the doc: \"The large size of the observations index prevents us from supporting the page parameter\n # when retri...
[ { "docid": "da7f164f0dfe32607542dab96d5e45d8", "score": "0.72840744", "text": "def observations(self):\n ro = self._create_basic_request_object('observations_get')\n\n ro.set_owner(self.owner_name)\n ro.set_description('retrieve observations for {}'.format(self._reference_indicator)...
b8a317bbc561ef78b076ac96213c320d
Callback of stop order update.
[ { "docid": "3d97f6c0964c4dd3ffebfefaf4a1e725", "score": "0.7922227", "text": "def on_stop_order(self, stop_order: StopOrder):\n pass", "title": "" } ]
[ { "docid": "434387fcfcd9e863bf8d93d3048974d5", "score": "0.70248485", "text": "def triggerStopOrders(self):\n for soID,so in self.workingLimitOrdersDict.items():\n if so.direction == DIRECTION_LONG:\n triggered = (self.bar.High>=so.price)\n elif so.direction =...
978f74abfb77ac10e4d0bc386de42f9c
Constructor for a generic pipeline
[ { "docid": "716e68cd8ffc66ec9e99b1381224e6e3", "score": "0.64695215", "text": "def __init__(self, name=None):\n if not name:\n # w/o a name, generate a random UUID to name this pipeline\n self.name = str(uuid.uuid4())\n else:\n self.name = name \n se...
[ { "docid": "80e68f1c67c09d30204dd32ad82e5c03", "score": "0.7773082", "text": "def from_pipeline(cls, pipeline):\n self = object.__new__(cls)\n self.data = pipeline.data\n return self", "title": "" }, { "docid": "4ab57fb936d17c796e937df740d6fe7e", "score": "0.7675824"...
6afc41a59914e0674305218c865b34ae
Calls openMVG to do compute matches
[ { "docid": "4822d5fcfbdeda71bb433a957a3e5049", "score": "0.7459588", "text": "def openmvg_matches(pth_sfm, pth_matches, video_mode=None, force=False):\n\n cmd = \"{}/openMVG_main_ComputeMatches -i {} -o {} -v {}\".format(PATH_OMVG, pth_sfm,\n ...
[ { "docid": "4e08f7c38ca53640306f5e8ebfb60f23", "score": "0.5903164", "text": "def exec_matching(infr, vsone=False, prog_hook=None):\n if infr.verbose:\n print('[infr] exec_matching')\n #from ibeis.algo.hots import graph_iden\n ibs = infr.ibs\n aid_list = infr.aids\...
75bc406279890dfbecf82c2784606de1
Loads all data, first it creates list of data points and then populates each data point with data by loading the contour and dicom files.
[ { "docid": "d1b8031ee16956ff92b461f44f8f4605", "score": "0.6711694", "text": "def load_all_data(dicom_dir, contour_dir, link_file):\n data_points = create_data_points(dicom_dir, contour_dir, link_file)\n return get_image_and_masks(data_points)", "title": "" } ]
[ { "docid": "05efec025234f1f56eeac96532b96fa5", "score": "0.73711884", "text": "def load_dataset(self, contour): \n self.dataset = []\n for patient_id in self.link_dict.keys():\n self.dataset += self.get_patient_data(patient_id, contour)", "title": "" }, { "docid":...
b0863bb99a634fc50175ddef28794392
Draw a correlation heatmap and return the frame.
[ { "docid": "e8041ceb481120c7ee9fd76c08fa2068", "score": "0.69290173", "text": "def get_correlation(frame, outdir=None):\n\n corr = frame.corr()\n\n if outdir != None:\n corr.to_csv(outdir/'correlation.csv')\n plt.figure()\n sns.heatmap(corr, cmap=plt.cm.RdYlBu_r)\n plt....
[ { "docid": "c32d7300ec62ae5ea0e58e19b2099924", "score": "0.74469304", "text": "def correlation_heatmap(df):\n _, ax = plt.subplots(figsize=(14, 12))\n colormap = sns.diverging_palette(220, 10, as_cmap=True)\n\n _ = sns.heatmap(df.corr().round(3),\n cmap=colormap,\n ...
a6f121548d76e6dc98afa53d020aa3df
Check if this task failed.
[ { "docid": "dd5c1773e64de9e555e6c0c34cc41a45", "score": "0.7249489", "text": "def failed(self) -> bool:\n return self.completed is not None and not self.completed", "title": "" } ]
[ { "docid": "6af889faa0e6ed8836e8b78b10e2a744", "score": "0.77773494", "text": "def task_is_failure(task):\n\n if task and task.state == 'FAILURE':\n return True\n return False", "title": "" }, { "docid": "c14544e02e3f0b540cbf63fd7c879100", "score": "0.76552993", "text": ...
1f741524474d86566b65cfc9c0d6fb19
Gets the mapping of pickleable python attribute name and values.
[ { "docid": "00f6279d2da02e8235168a49f842043f", "score": "0.5921677", "text": "def _get_python_attributes(self):\r\n python_attrs = dict()\r\n for key, value in vars(self).iteritems():\r\n if key.startswith('_'):\r\n continue\r\n if isinstance(value, hou...
[ { "docid": "26012275e08f96726959da3317a3d693", "score": "0.67514306", "text": "def attributes(self) -> t.Dict[str, str]:", "title": "" }, { "docid": "9449c140f2f9e78549c886a816759fab", "score": "0.6637769", "text": "def get_attributes(self) -> Mapping[str, typing.Any]:\n retur...
daf973153a7da1e68c0c9d42349d0b2c
Function to calculate the conditional priors p(xp|xeff,q) on a set of {xp,xeff,q} posterior samples. INPUTS
[ { "docid": "f87f1caa5f85a8a02591eeabab79177f", "score": "0.5392014", "text": "def joint_prior_from_isotropic_spins(q,aMax,xeffs,xps,ndraws=10000,bw_method='scott'):\n\n # Convert to arrays for safety\n xeffs = np.reshape(xeffs,-1)\n xps = np.reshape(xps,-1)\n \n # Compute marginal prior o...
[ { "docid": "3df82a3c097cc9531b6d612c43603726", "score": "0.6071597", "text": "def chi_p_prior_given_chi_eff_q(q,aMax,xeff,xp,ndraws=10000,bw_method='scott'):\n\n # Draw random spin magnitudes.\n # Note that, given a fixed chi_eff, a1 can be no larger than (1+q)*chi_eff,\n # and a2 can be no lar...
fa3504efd3ea644eaeb652cc41290809
Returns the energy (in keV) associated with a given Xray line. By example, if xray_line = 'Mn_Ka' this function returns 5.8987
[ { "docid": "ddb0535509d1c85afca40d5ae14511c0", "score": "0.8575026", "text": "def _get_energy_xray_line(xray_line):\n element, line = _get_element_and_line(xray_line)\n return elements_db[element]['Atomic_properties']['Xray_lines'][\n line]['energy (keV)']", "title": "" } ]
[ { "docid": "d3e919af76ff67321b75206d1b772a8f", "score": "0.7023946", "text": "def line_energy(element,line):\n z = elementDB[element][\"Z\"]\n if not isinstance(line,LinePair):\n line = _lookupxlsubline(line)\n return xraylib.LineEnergy(z,line.subline)", "title": "" }, { "doc...
03e7c53a79ac094226a73f5970f9b23b
Utility function to get the timeout value used in requests
[ { "docid": "c8799e09a6258eab949006f89eb0cde2", "score": "0.81352955", "text": "def _timeout(self, timeout):\n if timeout is None:\n return self._request_timeout\n return timeout", "title": "" } ]
[ { "docid": "22dfdd2cc0a669d48d7d0ff56ef6578b", "score": "0.8522555", "text": "def gettimeout(self): # real signature unknown; restored from __doc__\n return timeout", "title": "" }, { "docid": "ddc80f25e3f51af1150befad01524a0a", "score": "0.8129886", "text": "def get_timeout(s...
291fe1dfc69deae35dbac946b041f543
Actually set the volume via `amixer`.
[ { "docid": "6339ec27cb24476ee916f2cb7eda5b98", "score": "0.8421663", "text": "def set_volume(self):\n subprocess.call([\"amixer\", \"set\", \"PCM\", \"--\", \"%d%%\" % (self.volume,)])", "title": "" } ]
[ { "docid": "008be544c722e9ddde9fbf00f2f58a24", "score": "0.7889102", "text": "def set_volume(self, volume):\r\n if self.is_active:\r\n if 0 < volume < 1:\r\n volume = int(volume*100)\r\n self.sp.volume(volume)", "title": "" }, { "docid": "2fba4be3c921afd787309e29022ba900"...
a3dff4a0b5a3b63b7a71b29519ee5309
Moves duplicate files to a separate directory, while preserving the subdirectory structure in there.
[ { "docid": "320ae484e2d52eae10f58cdc2fc7bd2b", "score": "0.7337616", "text": "def __call__(self, directory_to_move_duplicates_to=None):\n if directory_to_move_duplicates_to is None:\n directory_to_move_duplicates_to = os.path.join(self.directory, \"duplicates\")\n directory_to_m...
[ { "docid": "b996a5c6073bbe3944cfbade4eb38d7a", "score": "0.65459585", "text": "def scan_and_remove_duplicate(from_dir, debug=False):\n all_files = defaultdict(list)\n for root, dirs, files in os.walk(from_dir):\n for file in files:\n full_path = os.path.join(root, file)\n ...
dd403594a26d4ed6b1599a1e49a12d9a
Draws the points onto the GUI canvas
[ { "docid": "3d0fe5e512da5b59f5dc44f3070a7bab", "score": "0.6598843", "text": "def on_paint(self, event):\n dc = wx.PaintDC(self.panel)\n dc.SetPen(wx.Pen('black', 1))\n dc.SetBrush(wx.Brush('black', 1))\n for point in self.annealing.state.points:\n dc.DrawCircle(po...
[ { "docid": "ab4edc0d7656931e0deb95b2ce5bd993", "score": "0.74049175", "text": "def _draw(self):\n if self.colorTable != {}: CT = self.colorTable\n else:\n CT = self._genColorTable()\n self.plotter.clear()\n for p in self.points:\n self.plotter.setCo...
768e00ec8ddd94a666938045bfd89fe0
Matches the NDC to db
[ { "docid": "671597d49d82516294ea16dbefe37f43", "score": "0.58281344", "text": "def match_ndc(ndc):\n\n def find_recent_db():\n \"\"\" returns most recent db csv file. Gives error pop up if no db file found \"\"\"\n files = glob.glob('ndcdb-*.csv')\n if len(files) == 0:\n ...
[ { "docid": "e0c3d258c19d4d7fa03901c154ec7bfa", "score": "0.5899773", "text": "def inspect_db(self):", "title": "" }, { "docid": "4c75ae12209357a13cd26ecb99d48a79", "score": "0.56975514", "text": "def getdb(self):\n if self.cl._db is not None:\n return self.cl._db\n ...
c6ccb384e1ab09d3b8f9ca491cfa70c2
Fetch and format documents screen. Content is supplied from self.DATA_INDEX. App handles formatting and display
[ { "docid": "933d4bea7adbf38994604d04c98390c4", "score": "0.6130742", "text": "def setup_document(self, *args, **kwargs):\n doc_dict = self.DATA_INDEX.current_doc\n doc_idx, group_len = self.DATA_INDEX.current_index\n self.current_document_title = doc_dict['Job_Title']\n self....
[ { "docid": "792b5fddc5dab6657fbe27fdc6166895", "score": "0.63426816", "text": "def process_data(self):\n\n # Drivers License\n if self.Data.DriversLicence is not None:\n doc = Document.DriversLicense(None, self.Data.DriversLicence, self.photoImage)\n self.Documents.ap...
8abadc08d2224205c0322496613c7174
Returns followers/following, number of posts
[ { "docid": "268b1f4295be22b013434acc84c45951", "score": "0.0", "text": "def get_instagram_stats(self, username):\n user = self.get_user(username)\n user_info = self.get_user_profile(user[\"id\"])\n return user_info[\"data\"][\"counts\"]", "title": "" } ]
[ { "docid": "0c002c2cc4835dc347d3d1959dbbd10a", "score": "0.7136349", "text": "def followers_count(self):\n user_type = ContentType.objects.get_for_model(self)\n return UserInterest.objects\\\n .filter(interest_type='follow', content_type__pk=user_type.id, object_id=self.id)\\\n ...
53bf878325c3da25c2bdf2b255812f70
Wraps up the different methods to get the complex trajectories in experiment
[ { "docid": "2cd396a60027d05589a8224e8825f982", "score": "0.6717981", "text": "def get_complex_trajectories(experiment):\n raco_before,raco_after=experiment.trajectory_racomodation()\n \n list_of_raccomodated = []\n for i,(frame,label,number) in enumerate(raco_after):\n index = raccomo...
[ { "docid": "704c0d232adc815ba1223712ec930fbb", "score": "0.5725358", "text": "def test_step_methods_in_each_level(self):\n _, model, _ = mv_simple()\n _, model_coarse, _ = mv_simple_coarse()\n _, model_very_coarse, _ = mv_simple_very_coarse()\n with model:\n initia...
c187fe94c06737319ce6a05f9f97bdf6
Decodes the auth token
[ { "docid": "02be4b20298fe9880c620e1a3a35e5a0", "score": "0.7484995", "text": "def decode_auth(auth_token):\n try:\n payload = jwt.decode(auth_token, app.config.get('SECRET_KEY'))\n return payload['sub']\n except jwt.exceptions.InvalidTokenError:\n return 'Invalid token. Please...
[ { "docid": "ca7dd14a048ddd0283f1e392a638ab5b", "score": "0.7767273", "text": "def decode_auth_token(auth_token):\n try:\n pyload= jwt.decode(auth_token, JWT_SECRET_KEY)\n return pyload['id']\n except jwt.ExpiredSignatureError:\n return 'Signature expired. P...
68f06fdad826c9bce003a7c53d88e283
Compute inverse CDF for a given value.
[ { "docid": "cd4d641d3fb9a0113530e0471fedd092", "score": "0.5649419", "text": "def at(self, value):\n assert(0 <= value <= 1)\n return bisect.bisect_right(self.cdf, value)", "title": "" } ]
[ { "docid": "2b8d83cb66b7de2be6af77838e1cc5db", "score": "0.82533187", "text": "def inverse_cdf(self, value):\n raise NotImplementedError", "title": "" }, { "docid": "8a47abed2865294dce40758967737770", "score": "0.66790795", "text": "def inverse_cdf(self, u):\n return no...
4086f19c350b78f3c7029a5d86742ae7
This class holds all the models for a dataset
[ { "docid": "5f8fa3d84739edffa3cf68ed1dc1e208", "score": "0.0", "text": "def __init__(self, id):\n self.id = id\n self.models = BTrees.OOBTree.BTree()\n self.constructor_id = -1\n self.dataset_id = -1\n self.group_connection_id = -1", "title": "" } ]
[ { "docid": "ea662cd6f629aaa29b6be895da859b88", "score": "0.7318091", "text": "def _get_model_dataset(self):\n\n # Instantiate the model object\n model = getattr(\n importlib.import_module('models.' + self._args.model),\n self._args.model)()\n\n # Instantiate th...
80687f3cf13f915b78d9c85561dd33fb
Return readable informal exception description about checksumed exception.
[ { "docid": "1747be14a5b639183ce75ef786e8178c", "score": "0.0", "text": "def __str__(self):\n return 'Invalid {} checksum for the {} file'.format(self.algo, 'original' if self.decrypted else 'encrypted')", "title": "" } ]
[ { "docid": "9271c80dc57fab8ae115327f3df1069a", "score": "0.6199383", "text": "def exception(self):\r\n buf = traceback.format_exception_only(self.exc_type, self.exc_value)\r\n return ''.join(buf).strip().decode('utf-8', 'replace')", "title": "" }, { "docid": "fb1ae58044d5b91590...
889e0e73799057cf38eacd20067fa5b8
Test case for api_v1_statuses_secrets_get
[ { "docid": "22d22c4deda381211a78dce4bd31ebf8", "score": "0.9513433", "text": "def test_api_v1_statuses_secrets_get(self):\n pass", "title": "" } ]
[ { "docid": "db56674662f0780175ab53fac68d5b6a", "score": "0.6973698", "text": "def test_get_all_secrets(self):\n pass", "title": "" }, { "docid": "233629767b99031fd14f7b095067d9ae", "score": "0.66280454", "text": "def get_secrets(self):\n secret_url = \"{}/secrets\".form...
ded8dd55a74a3491147509032239a5c2
Display a dialog asking the user to input the range of frames they would like to export
[ { "docid": "911b2d5a62a538eb21b7466296923e33", "score": "0.6653546", "text": "def ask_frame_range(self, n_frames):\n valid_input = False\n _, ext = os.path.splitext(self.output.GetPath())\n show_single_btn = (ext == '.h5')\n dlg = FrameSelectDialog(n_frames, show_single_btn)\...
[ { "docid": "ba3807dc066092db7439c382f1f79169", "score": "0.5913335", "text": "def getFrameRangeFromShotSettings(self):\r\n\t\ttry:\r\n\t\t\t#frRange = \"%d-%d\" %(int(os.environ['STARTFRAME']), int(os.environ['ENDFRAME'])) # Icarus\r\n\t\t\tfrRange = \"%d-%d\" %(int(os.environ['UHUB_STARTFRAME']), int(...
b98d9695c5f2e060e667f6137c06d0dd
isFinished(ALInterpolationArticular3D self, float const & time) > bool
[ { "docid": "0e7f4cffb3df33943aaf7f315f84553f", "score": "0.875447", "text": "def isFinished(self, time):\n return _almathinternal.ALInterpolationArticular3D_isFinished(self, time)", "title": "" } ]
[ { "docid": "84e91adf599c004b342da77fe818c9b4", "score": "0.78961587", "text": "def isFinished(self, time):\n return _almathinternal.ALInterpolationArticular_isFinished(self, time)", "title": "" }, { "docid": "839e708c13e4da3ccd16b2b6bb407622", "score": "0.70739007", "text": "d...
8e050be4735a3412803428f673375b18
Save the outputs from the simulation run.
[ { "docid": "cc27b8307d07d7bd03068df1bc203cd3", "score": "0.59313", "text": "def save_simulation(\n output: str,\n profile_type: str,\n simulation_outputs: Solution,\n solar_irradiance: dict[int, float],\n) -> None:\n\n # Assemble the CSV datafile structure\n output_data = simulation_ou...
[ { "docid": "62357c71511468de2da3ef87b7e3c34b", "score": "0.75556", "text": "def save(self):\n # Message #\n self.parent.log.info(\"Saving final simulations results to disk.\")\n # The classifier values #\n self['values'] = self.sim.sit.classifier_value_ids\n # All...