query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Returns the derivative of x^2 (2x) at the input.
def derivative_x_squared(x): return 2*x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _derivative_(self, x, diff_param=None):\n return 2*exp(-x**2)/sqrt(pi)", "def derivative(xi, x, y):\n yi = ((xi-x[1])+(xi-x[2]))/((x[0]-x[1])*(x[0]-x[2])) * y[0]\\\n +((xi-x[0])+(xi-x[2]))/((x[1]-x[0])*(x[1]-x[2])) * y[1]\\\n +((xi-x[0])+(xi-x[1]))/((x[2]-x[0])*(x[2]-x[1])) * y[2]\n ...
[ "0.7365888", "0.70614064", "0.68726707", "0.66712064", "0.6648913", "0.66283107", "0.65764946", "0.6571925", "0.6523418", "0.6518763", "0.64251024", "0.6420016", "0.6417492", "0.6384178", "0.6384178", "0.63834196", "0.63289374", "0.6325209", "0.6280928", "0.6278116", "0.62667...
0.7727061
0
Plots decision boundaries of model predicting on X in comparison to y.
def plot_decision_boundary(model: torch.nn.Module, X: torch.Tensor, y: torch.Tensor): # Put everything to CPU (works better with NumPy + Matplotlib) model.to("cpu") X, y = X.to("cpu"), y.to("cpu") # Setup prediction boundaries and grid x_min, x_max = X[:, 0].min() - 0.1, X[:, 0].max() + 0.1 y_m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_decision_boundary(model, X, y):\r\n \r\n x1_array, x2_array = np.meshgrid(np.arange(-4, 4, 0.01), np.arange(-4, 4, 0.01))\r\n grid_coordinates = np.c_[x1_array.ravel(), x2_array.ravel()]\r\n Z = model.predict(grid_coordinates)\r\n Z = Z.reshape(x1_array.shape)\r\n plt.contourf(x1_array, ...
[ "0.8054798", "0.73881155", "0.7206806", "0.7151029", "0.711216", "0.6997906", "0.69841933", "0.6887967", "0.6825581", "0.67859906", "0.6708926", "0.66935503", "0.65128684", "0.64355475", "0.63302207", "0.6269152", "0.6213755", "0.6213755", "0.6212411", "0.6185586", "0.618256"...
0.7896736
1
Plots linear training data and test data and compares predictions.
def plot_predictions( train_data, train_labels, test_data, test_labels, predictions=None ): plt.figure(figsize=(10, 7)) # Plot training data in blue plt.scatter(train_data, train_labels, c="b", s=4, label="Training data") # Plot test data in green plt.scatter(test_data, test_labels, c="g", s=4...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_predictions(net, x_train, y_train, idx_train, x_val, y_val, idx_val):\n fig, (ax1, ax2) = plt.subplots(nrows=2, figsize=(20, 30))\n pred1 = net.predict(x_val, batch_size=batch_size)\n # print(\"pred1.shape:\", pred1.shape)\n ax1.plot(idx_val, y_val, label=\"Actual Data\", marker=\"+\")\n ax...
[ "0.72882015", "0.7282593", "0.72544914", "0.7217795", "0.7205552", "0.7156762", "0.7100601", "0.70941764", "0.70696867", "0.7020257", "0.70124346", "0.69700366", "0.69683397", "0.6883977", "0.6824197", "0.68232703", "0.6814974", "0.67807734", "0.6724453", "0.6710409", "0.6707...
0.7473647
0
Plots training curves of a results dictionary.
def plot_loss_curves(results): loss = results["train_loss"] test_loss = results["test_loss"] accuracy = results["train_acc"] test_accuracy = results["test_acc"] epochs = range(len(results["train_loss"])) plt.figure(figsize=(15, 7)) # Plot loss plt.subplot(1, 2, 1) plt.plot(epochs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_results(self):\n\n\n f1, ax1 = plt.subplots()\n h1, = ax1.plot(self.history[\"step\"], self.history[\"trainLoss\"],\\\n \"b-\", label=\"Loss - Train\")\n h2, = ax1.plot(self.history[\"step\"], self.history[\"validLoss\"],\\\n \"b.\", label=\"Loss - Validation\")\n\n ax1.set_ylabe...
[ "0.73199534", "0.6965311", "0.68503076", "0.67942816", "0.67708904", "0.67640346", "0.6739242", "0.67283684", "0.6645533", "0.6638372", "0.662731", "0.66138786", "0.65995955", "0.6582078", "0.65773195", "0.65718424", "0.6564452", "0.6562502", "0.65578455", "0.6557553", "0.655...
0.7243514
1
where filename is "utterances.json" or "utterances.jsonl" for example
def load_from_utterance_file(filename, utterance_start_index, utterance_end_index): with open(filename, "r") as f: try: ext = filename.split(".")[-1] if ext == "json": utterances = json.load(f) elif ext == "jsonl": utterances = [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file_path(name: str) -> str:\n return os.path.join(DIR, 'scores', f'{name}.json')", "def nomenclatures_filepath() -> str:\n\n return resource_filename(__name__, \"nomenclatures.json\")", "def get_file(filename: str) -> dict:\n return loads(open(f\"data/gamedata/{filename}.json\", \"r\", encodi...
[ "0.6079545", "0.60274947", "0.59357136", "0.584401", "0.57462204", "0.57069373", "0.56726766", "0.5670628", "0.5644448", "0.56124604", "0.5609508", "0.5602887", "0.55800635", "0.5560429", "0.55577207", "0.55325127", "0.5473897", "0.54703003", "0.54700845", "0.5463936", "0.543...
0.6224914
0
For merging adjacent utterances by the same speaker
def merge_utterance_lines(utt_dict): new_utterances = {} for uid, utt in utt_dict.items(): merged = False if utt.reply_to is not None and utt.speaker is not None: u0 = utt_dict[utt.reply_to] if u0.root == utt.root and u0.speaker == utt.speaker: new_utteran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def join_utterances(transcript_lines):\n lines = []\n for _, group in groupby(transcript_lines, lambda n: n[0]):\n lines.append(' '.join((utt for (speaker, utt) in group)).strip())\n return lines", "def regroup_utterances(utterances, words):\n all_words = []\n original_bounds = []\n for uttera...
[ "0.669353", "0.63342464", "0.57753056", "0.5721863", "0.559374", "0.5538936", "0.5463268", "0.545168", "0.54357594", "0.5416302", "0.5312209", "0.53028685", "0.529585", "0.52375203", "0.5232808", "0.52073246", "0.514966", "0.5133685", "0.51289994", "0.51008934", "0.5087894", ...
0.65508693
1
Initialize Conversation objects from utterances and conversations metadata
def initialize_conversations(corpus, utt_dict, convos_meta): # organize utterances by conversation convo_to_utts = defaultdict(list) # temp container identifying utterances by conversation for u in utt_dict.values(): convo_key = u.root # each root is considered a separate conversation convo_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_speakers_and_utterances_objects(corpus, utt_dict, utterances, speakers_dict, speakers_meta):\n if len(utterances) > 0: # utterances might be empty for invalid corpus start/end indices\n KeySpeaker = \"user\" if \"user\" in utterances[0] else \"speaker\"\n for i, u in enumerate(utterance...
[ "0.64719737", "0.6312043", "0.5735298", "0.5610898", "0.55534637", "0.53624684", "0.5338579", "0.52947074", "0.52843666", "0.52603316", "0.52556956", "0.51028484", "0.50719315", "0.50575566", "0.50543827", "0.50524753", "0.49875817", "0.49830174", "0.49307454", "0.49234688", ...
0.73922026
0
Returns a test suite for all location tests.
def suite(): return unittest.TestSuite([ LocationClassTestCase, LocationInstanceTestCase, ])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def suite():\r\n\r\n current = os.path.dirname(os.path.realpath(__file__))\r\n top = os.path.normpath(os.path.join(current, \"..\", \"..\"))\r\n return unittest.TestLoader().discover(current, pattern='test_*.py', top_level_dir=top)", "def testsuite():\n return unittest.TestLoader().discover(os.path.d...
[ "0.7122921", "0.7113091", "0.6947209", "0.6926214", "0.6915536", "0.68930066", "0.6865551", "0.6807367", "0.68023527", "0.6744231", "0.67071944", "0.6669298", "0.66309464", "0.6624882", "0.66220117", "0.6611806", "0.65562296", "0.65505385", "0.65493685", "0.6549264", "0.65226...
0.8112259
0
Clean up the location instance after each test method.
def tearDown(self): del self.location
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def teardown(self):\n del self.testInst, self.bounds1, self.bounds2\n\n return", "def teardown_method(self):\n world.clear_paths()\n print(\"\\nEnd of tests in: %s\\n-------------------\\n\" % __name__)\n self.bigml = {}", "def teardown(self):\n pass", "def teardown(...
[ "0.74866843", "0.7443962", "0.7375999", "0.7375999", "0.7375999", "0.73740506", "0.7343697", "0.7343697", "0.7343697", "0.73230755", "0.7300045", "0.7299457", "0.7288138", "0.7288138", "0.7288138", "0.7236019", "0.7230098", "0.7230098", "0.7220404", "0.72043955", "0.72043955"...
0.8396972
0
Location 'active' property is boolean and read only
def test_property_active(self): active = self.location.active self.assertIsInstance(active, bool) self.assertRaises(DataObjectError, setattr(self, "active", False) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_active(self) -> bool:", "def is_active(self):\r\n return True", "def is_active():\n return True", "def isActive(self):\n pass", "def is_active(self):\n return True", "def is_active(self):\n return True", "def is_active(self):\n return True", "def is_active...
[ "0.7136036", "0.69710106", "0.68649447", "0.6848407", "0.6804945", "0.6804945", "0.6804945", "0.6804945", "0.6804945", "0.6804945", "0.6804945", "0.6804945", "0.6804945", "0.6804945", "0.6804945", "0.6804945", "0.6804945", "0.6804945", "0.6804945", "0.6804945", "0.6804945", ...
0.7300854
0
Location 'code' property is a string and read only
def test_property_code(self): code = self.location.code self.assertIsInstance(code, str) self.assertRaises(DataObjectError, setattr(self, "code", "NEW_LOCATION_CODE") )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def un_location_code(self) -> UNLocationCode1:\n return self._un_location_code", "def set_location(self, location = {}):\n\t\t# Clearing cookie jar\n\t\tself.crawler.empty_cookie_jar()\n\t\tif 'city_name' in location and 'postal_code' in location and 'address' in location and re.match(r'(\\d{5})', locatio...
[ "0.6540331", "0.61929756", "0.60789806", "0.60786414", "0.598112", "0.59574646", "0.57843566", "0.5780052", "0.5778666", "0.57519937", "0.57044095", "0.5668204", "0.56674135", "0.5652053", "0.56036025", "0.5594148", "0.55905277", "0.55905277", "0.55692285", "0.55663836", "0.5...
0.72116286
0
Location 'description' property is a string and read only
def test_property_description(self): description = self.location.description self.assertIsInstance(description, str) self.assertRaises(DataObjectError, setattr(self, "description", "Bogus location description") )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def describe_locations():\n pass", "def __init__(self, name, description, location):\n self._name=name\n self._description=description\n self._location = location", "def __str__(self):\n return self.location_name", "def test_str(self):\n location = self.location\n\n ...
[ "0.66359466", "0.6581826", "0.6540588", "0.64317", "0.6395693", "0.6342205", "0.6248683", "0.62481844", "0.62460047", "0.6178843", "0.6156483", "0.6148335", "0.6147104", "0.6146926", "0.6146804", "0.6138766", "0.60903406", "0.60691404", "0.60556227", "0.6045912", "0.6039163",...
0.73353493
0
Loation 'latitude' property is a float and read only
def test_property_latitude(self): latitude = self.location.latitude self.assertIsInstance(latitude, float) self.assertRaises(DataObjectError, setattr(self, "latitude", 12.34567) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_latitude(self, latitude):\n self.Latitude = latitude\n return self.Latitude", "def latitude(self, value: float):\n self._point.latitude = value", "def get_latitude0(self):\n return self.B", "def latitude(self, lat):\n data = float(lat[1:])\n if lat[0] == \"N\...
[ "0.73521113", "0.696685", "0.6956238", "0.6937698", "0.69267344", "0.68921655", "0.6858194", "0.6858194", "0.6858194", "0.6853016", "0.6801292", "0.6794576", "0.6787522", "0.67859286", "0.67501837", "0.67501837", "0.67501837", "0.6602967", "0.6595398", "0.65770763", "0.656992...
0.7069242
1
Location 'longitude' property is a float and read only
def test_property_longitude(self): longitude = self.location.longitude self.assertIsInstance(longitude, float) self.assertRaises(DataObjectError, setattr(self, "longitude", 76.54321) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_longitude(self, longitude):\n self.Longitude = longitude\n return self.Longitude", "def longitude(self, value: float):\n self._point.longitude = value", "def longitude(self):\n return self._longitude", "def longitude(self):\n return self._longitude", "def longitud...
[ "0.72810644", "0.7169328", "0.71487415", "0.71487415", "0.71487415", "0.6997113", "0.6967382", "0.69533795", "0.69244426", "0.69147533", "0.6906567", "0.6847106", "0.68260485", "0.68260485", "0.68260485", "0.68113166", "0.68078125", "0.67414093", "0.6720943", "0.6652836", "0....
0.73650473
0
Location 'name' property is a string and read only
def test_property_name(self): name = self.location.name self.assertIsInstance(name, str) self.assertRaises(DataObjectError, setattr(self, "name", "Bogus Location name") )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_location_name(self):\n self.assertIsInstance(self.location.name, str)\n self.assertEqual(self.location.name, \"Chez Toto\")", "def __str__(self):\n return self.location_name", "def test_str(self):\n location = self.location\n\n self.assertEqual(str(location), self.lo...
[ "0.70269114", "0.67926973", "0.65986204", "0.64508355", "0.6266161", "0.62315613", "0.62305284", "0.62195677", "0.61200136", "0.6101911", "0.6088573", "0.6076609", "0.606484", "0.60486925", "0.60262805", "0.5998244", "0.59206045", "0.5917874", "0.59066683", "0.59027463", "0.5...
0.7014828
1
Location 'timezone' property is a string and read only
def test_property_timezone(self): timezone = self.location.timezone self.assertIsInstance(timezone, str) self.assertRaises(DataObjectError, setattr(self, "timezone", "US/Nowhere") )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timezone():\n \n pass", "def timezone(self):\n return self.data.get(\"timezone\")", "def timezone():\n\n return time.timezone", "def _get_tz():\n return 'UTC'", "def timezone(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"timezone\")", "def may_the_timezone...
[ "0.77013266", "0.7056254", "0.6911636", "0.67390406", "0.6734337", "0.6714615", "0.66699046", "0.66157573", "0.66157573", "0.66157573", "0.65575933", "0.65553015", "0.6510364", "0.6510364", "0.6510364", "0.6510364", "0.6510364", "0.6510364", "0.6510364", "0.6510364", "0.65103...
0.727748
1
_count_elements(mapping, iterable) > None Count elements in the iterable, updating the mappping
def _count_elements(mapping, iterable): # real signature unknown; restored from __doc__ pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getValueCounts(mapping):\n return Counter({k: len(v) for k, v in viewitems(mapping)})", "def count(iterable):\n\treturn sum(1 for _ in iterable)", "def cnt(iterable):\n return len(iterable) if iterable is not None else 0", "def count(iterable):\n return sum(1 for _ in iterable)", "def count(i...
[ "0.68665785", "0.64859897", "0.6274903", "0.6183809", "0.61292946", "0.6100246", "0.6100246", "0.59945166", "0.59695774", "0.59519863", "0.5928386", "0.59193695", "0.58959067", "0.58830833", "0.58752507", "0.58698165", "0.58508575", "0.58389974", "0.5821972", "0.5813583", "0....
0.9014913
0
defaultdict(default_factory[, ...]) > dict with default factory The default factory is called without arguments to produce a new value when a key is not present, in __getitem__ only. A defaultdict compares equal to a dict with the same items. All remaining arguments are treated the same as if they were passed to the di...
def __init__(self, default_factory=None, **kwargs): # known case of _collections.defaultdict.__init__ pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dd_factory(d=None):\n\n return defaultdict(dd_factory, d) if d else defaultdict(dd_factory)", "def dict_default(x, key=None):\n if isinstance(x, NoDefault):\n if key is None:\n raise KeyError()\n else:\n raise KeyError(key)\n elif isinstance(x, CallIfDefault):\n ...
[ "0.70216703", "0.67569506", "0.6676711", "0.6577754", "0.6436993", "0.64144355", "0.63161874", "0.6273302", "0.6219484", "0.6170354", "0.61125654", "0.6028017", "0.60000736", "0.5943458", "0.59333163", "0.5908543", "0.58643436", "0.58596593", "0.58394593", "0.5761025", "0.573...
0.72984344
0
D.index(value, [start, [stop]]) > integer return first index of value. Raises ValueError if the value is not present.
def index(self, value, start=None, stop=None): # real signature unknown; restored from __doc__ return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index(self, value, start=0, stop=-1):\n return self.elem.index(value, start, stop)", "def index(self, element, start=0, end=None):\n if end is None: # Only bound end if value has been provided\n end = self._length\n if end < 0: # For negative indexing, convert to positive co...
[ "0.7962", "0.6861745", "0.6848216", "0.68206054", "0.66506827", "0.6420335", "0.6407462", "0.6382083", "0.6328646", "0.62298006", "0.62259185", "0.62259185", "0.6210666", "0.6164073", "0.61577684", "0.61506253", "0.61481315", "0.61431164", "0.6141292", "0.6053241", "0.602599"...
0.76280576
1
D.insert(index, object) insert object before index
def insert(self, index, p_object): # real signature unknown; restored from __doc__ pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self, index, value):\n list.insert(self, index, value)\n self.emit('inserted', index, value)\n self.emit('modified')", "def insert(self, index, value):\n self.__field.validate_element(value)\n return list.insert(self, index, value)", "def insert(self, index, item):\n ...
[ "0.746913", "0.74307674", "0.74128157", "0.7411915", "0.7396504", "0.73503435", "0.7316301", "0.7279709", "0.7261814", "0.7213098", "0.7187839", "0.70939094", "0.70410836", "0.7025001", "0.6983108", "0.6979845", "0.69769627", "0.69607824", "0.6959883", "0.68334556", "0.682531...
0.8354621
0
OD.fromkeys(S[, v]) > New ordered dictionary with keys from S. If not specified, the value defaults to None.
def fromkeys(cls, S, v=None): # real signature unknown; restored from __doc__ pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fromkeys(cls, keys, value=0):\n d = cls()\n for key in keys:\n d[key] = value\n return d", "def fromkeys( # type: ignore[override]\n cls: type[_ST1],\n iterable: Iterable[str],\n value: npt.DTypeLike = None,\n ) -> _ST1:\n value = np.dtype(value...
[ "0.6573945", "0.62918013", "0.6171748", "0.60350966", "0.6004509", "0.58814245", "0.5639037", "0.56140774", "0.5496467", "0.5479194", "0.5450264", "0.544827", "0.53370917", "0.5313253", "0.52647454", "0.52112585", "0.5206309", "0.516781", "0.5076425", "0.50664467", "0.5063943...
0.7610581
0
This function will transliterate the incoming word to english. Defaults to Hindi
def ms_transliterate_word(logger, word, lang_code=None, script_code=None): if lang_code is None: lang_code = 'hi' if script_code is None: script_code = 'Deva' params = { 'api-version' : '3.0', 'language' : lang_code, 'fromScript' : script_code, 'toScript' : 'L...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ta2en(text):\n return IITB_translator(\"ta\", \"en\", text)", "def translate_leet(phrase):", "def correctWord (w):\r\n if len(re.findall(r\"[а-я]\",w))>len(re.findall(r\"[a-z]\",w)):\r\n return w.translate(eng_rusTranslateTable)\r\n else:\r\n return w.translate(rus_engTranslateTable)...
[ "0.65575683", "0.65483755", "0.6408531", "0.6263702", "0.6163009", "0.61440736", "0.60640424", "0.60445297", "0.6042301", "0.6039007", "0.59957576", "0.5979443", "0.5969418", "0.59624153", "0.5928102", "0.5915809", "0.59140784", "0.5896922", "0.58896583", "0.5843601", "0.5827...
0.679018
0
Calculate loading at specified pressure. Careful! For the Virial model, the loading has to be computed numerically.
def loading(self, pressure): def fun(x): return (self.pressure(x) - pressure)**2 opt_res = optimize.minimize(fun, pressure, method='Nelder-Mead') if not opt_res.success: raise CalculationError(f"Root finding failed. Error: \n\t{opt_res.message}") return opt_res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loading(self, pressure):\n kp = self.params[\"K\"] * pressure\n return self.params[\"n_m\"] * kp / (1.0 + kp)", "def pressure(self, loading):\n return loading / (self.params[\"K\"] * (self.params[\"n_m\"] - loading))", "def pressure(self, loading):\n return loading * numpy.exp(\...
[ "0.7761237", "0.74184006", "0.7224176", "0.6882702", "0.6783641", "0.6344419", "0.6282932", "0.6148101", "0.61202985", "0.61202985", "0.61006767", "0.6029048", "0.5969615", "0.58875024", "0.5865621", "0.5857995", "0.5818628", "0.5727974", "0.5711347", "0.5698814", "0.5594582"...
0.74807274
1
Calculate pressure at specified loading. The Virial model calculates the pressure directly.
def pressure(self, loading): return loading * numpy.exp( -numpy.log(self.params['K']) + self.params['A'] * loading + self.params['B'] * loading**2 + self.params['C'] * loading**3 )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pressure(self, loading):\n return loading / (self.params[\"K\"] * (self.params[\"n_m\"] - loading))", "def loading(self, pressure):\n kp = self.params[\"K\"] * pressure\n return self.params[\"n_m\"] * kp / (1.0 + kp)", "def loading(self, pressure):\n def fun(x):\n ret...
[ "0.82703584", "0.68636125", "0.6701423", "0.6674728", "0.646471", "0.62407786", "0.62407786", "0.62407786", "0.6091799", "0.6011328", "0.6011328", "0.5980501", "0.5977851", "0.5957151", "0.59392357", "0.58457243", "0.5834206", "0.5801399", "0.57670504", "0.5747486", "0.572263...
0.7911134
1
r""" Calculate spreading pressure at specified gas pressure. Function that calculates spreading pressure by solving the following integral at each point i.
def spreading_pressure(self, pressure): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spreading_pressure(self, pressure):\n return self.params[\"n_m\"] * numpy.log(1.0 + self.params[\"K\"] * pressure)", "def pe_solver(Aij, Bij, pi):\n # =========================================================================\n # Calculating the pressure at row i + 1\n # ====================...
[ "0.60875744", "0.5909409", "0.58963007", "0.5856508", "0.5853163", "0.56551546", "0.565293", "0.5651308", "0.5635103", "0.56299776", "0.5573696", "0.54921234", "0.54191667", "0.54033726", "0.5397786", "0.5392483", "0.5389225", "0.53229916", "0.53043896", "0.53041255", "0.5297...
0.6265869
0
Delete all score configuration
def handle(self, *args, **options): verbosity = int(options.get('verbosity')) if verbosity > 0: self.stdout.write('Deleting all score configuration\n') for m in [ValidationCriteria, ScorePanel, ScoreDisplay, ScoreArgument, ScoreFunction]: m.objects.all().delete() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def erase_scores(self):\n self.database.erase_scores(self.difficulty)", "def delete_all(self):\n models.CourseLearningOutcome.objects.all().delete()\n #models.CoreLearningOutcome.objects.all().delete()\n #models.CreditType.objects.all().delete()\n models.Course.objects.all().de...
[ "0.69454193", "0.6546078", "0.6443415", "0.6409388", "0.63856024", "0.6313784", "0.62154984", "0.6212009", "0.61081666", "0.61081666", "0.6101001", "0.6087648", "0.60675603", "0.60401803", "0.60372365", "0.599629", "0.59878975", "0.5925357", "0.5922226", "0.5905187", "0.58675...
0.6900742
1
Returns the index of the given start date. Subclasses should define default behavior for start = None. That isn't handled here. Start can be a string or an integer if self.data.dates is None.
def _get_predict_start(self, start): dates = self.data.dates if isinstance(start, str): if dates is None: raise ValueError("Got a string for start and dates is None") dtstart = self._str_to_date(start) self.data.predict_start = dtstart try:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index(self, value: Any, start: int = 0, stop: int = 9223372036854775807) -> int:\n if isinstance(value, str):\n value = getattr(self, value)\n return super().index(value, start, stop)", "def get_indices_for_start_and_end_dates(lines, startdate, enddate):\n if startdate > enddate:\...
[ "0.6237462", "0.6043197", "0.6005817", "0.59620655", "0.5915492", "0.58372396", "0.5765468", "0.57453346", "0.5734087", "0.57179147", "0.5700057", "0.56639326", "0.56639326", "0.5638481", "0.5627662", "0.56263804", "0.5608273", "0.5594991", "0.5594771", "0.5572557", "0.554843...
0.61722726
1
Displays gdb, python and pwndbg versions.
def version(): gdb_str = 'Gdb: %s' % _gdb_version() py_str = 'Python: %s' % _py_version() pwndbg_str = 'Pwndbg: %s' % pwndbg.__version__ print('\n'.join(map(pwndbg.color.light_red, (gdb_str, py_str, pwndbg_str))))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def procinfo() -> None:\n if pwndbg.gdblib.qemu.is_qemu():\n print(\n message.error(\n \"QEMU target detected: showing result for the qemu process\"\n \" - so it will be a bit inaccurate (excessive for the parts\"\n \" used directly by the qemu proc...
[ "0.58584183", "0.5799228", "0.5718138", "0.57022464", "0.56987303", "0.56808305", "0.565004", "0.5633334", "0.56296754", "0.5593212", "0.5548865", "0.5545501", "0.5505103", "0.55022025", "0.5490566", "0.5462117", "0.54433", "0.5443051", "0.5426775", "0.5402759", "0.54006475",...
0.7932732
0
Convolves this convolvable with another.
def conv(self, other): e = ConvolutionEngine(self, other) return e.fire()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bind(self, other):\n self.vector = vu.circular_convolution(self.vector, other.vector)", "def convolve(self, other, mode='full', normalize=False):\n sdata = self.data\n if isinstance(other, type(self)) or isinstance(self, type(other)):\n odata = other.data\n else:\n ...
[ "0.6724221", "0.637059", "0.63206565", "0.6064529", "0.6034717", "0.59805596", "0.5881951", "0.5866943", "0.5817646", "0.58126557", "0.57981867", "0.56897146", "0.56793183", "0.5669159", "0.56677943", "0.5661402", "0.5655507", "0.5610205", "0.55945444", "0.55842274", "0.55833...
0.7053095
0
Perform the deconvolution of this convolvable object by another.
def deconv(self, other, balance=1000, reg=None, is_real=True, clip=False, postnormalize=True): from skimage.restoration import wiener result = wiener(self.data, other.data, balance=balance, reg=reg, is_real=is_real, clip=clip) if postnormalize: result += result.min() res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deconvolve(self, img, psf):\n self.data = pysap.Image(data=self.deconv.deconvolve(img, psf))", "def __call__(self, in_obj, channel_axes=\"C\", spatial_axes=(\"D\", \"H\", \"W\"), **kwargs):\n output = super(Deconvolution, self).__call__(in_obj, channel_axes, spatial_axes, **kwargs)\n ret...
[ "0.68992805", "0.6815754", "0.6741422", "0.6736246", "0.64551014", "0.6419349", "0.62005055", "0.61742294", "0.61718756", "0.61710554", "0.5945474", "0.5871932", "0.58637685", "0.5858193", "0.5831152", "0.58216107", "0.5800072", "0.5791091", "0.5787095", "0.5780973", "0.56778...
0.78200763
0
Compute the kspace representation of the convolution of c1 and c2.
def compute_kspace_data(self): if self.c1.has_analytic_ft: # units came directly from c2, pad and FT c1 c2_pad = pad2d(self.c2.data, self.Q, mode=self.pad_method) c2_ft = e.fft.fftshift(e.fft.fft2(e.fft.ifftshift(c2_pad))) xx, yy = e.meshgrid(self.kspace_x, self.k...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convolve_spikes_2d(spikes_a,spikes_b,kernel_a,kernel_b):\n output = np.zeros((spikes_a.shape[0]+kernel_a.shape[0],kernel_a.shape[1]*kernel_b.shape[1]))\n for k_i in range(kernel_a.shape[1]):\n for k_j in range(kernel_b.shape[1]):\n mat = np.zeros((kernel_a.shape[0],kernel_b.shape[0]))\n...
[ "0.6622937", "0.6582223", "0.63201", "0.62596244", "0.604878", "0.6032157", "0.59560096", "0.5954059", "0.5891244", "0.5878694", "0.5878535", "0.58306956", "0.58252686", "0.5810245", "0.5799397", "0.5788745", "0.5710298", "0.5698216", "0.5696955", "0.5694709", "0.567409", "...
0.6871816
0
Compute the kspace domain of the convolution of c1 and c2.
def compute_kspace_units(self): if self.c1.has_analytic_ft: support_x, support_y = self.c2.support_x, self.c2.support_y sample_spacing = self.c2.sample_spacing elif self.c2.has_analytic_ft: support_x, support_y = self.c1.support_x, self.c1.support_y sample...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_kspace_data(self):\n if self.c1.has_analytic_ft:\n # units came directly from c2, pad and FT c1\n c2_pad = pad2d(self.c2.data, self.Q, mode=self.pad_method)\n c2_ft = e.fft.fftshift(e.fft.fft2(e.fft.ifftshift(c2_pad)))\n xx, yy = e.meshgrid(self.kspace...
[ "0.677047", "0.60246885", "0.59901", "0.58771664", "0.5805315", "0.5770881", "0.576414", "0.57456946", "0.56268406", "0.56164414", "0.5613573", "0.5556114", "0.55199736", "0.5470195", "0.54700226", "0.5465693", "0.546004", "0.5440685", "0.5399082", "0.53947973", "0.5393431", ...
0.61327595
1
Crop the output in the spatial domain to remove the padded area.
def crop_output(self): s = self.kspace_data.shape npx_x, npx_y = s[1] / self.Q / 2, s[0] / self.Q / 2 cx_left, cx_right = int(e.ceil(npx_x)), int(e.floor(npx_x)) cy_top, cy_bottom = int(e.ceil(npx_y)), int(e.floor(npx_y)) self.spatial_data = self.spatial_data[cy_top:-cy_bottom, c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def crop(self, coords):\n pass", "def crop(self):\n return np.array([f.crop() for f in self])", "def crop(self, bbox):\n return self.__pyramid[0].crop(bbox)", "def uncrop( self ):\n \n if self._cropped:\n self._reset_bounds()\n self._cropped = False\n ...
[ "0.6534662", "0.65172464", "0.65136725", "0.6378351", "0.63503134", "0.6315051", "0.6095345", "0.60757214", "0.5977777", "0.5964763", "0.59285325", "0.5916318", "0.5899073", "0.5897073", "0.58668625", "0.5856448", "0.5832293", "0.58322656", "0.58321166", "0.58314306", "0.5828...
0.74691224
0
Postprocess the spatial domain.
def postprocess_spatial(self): if self.spatial_finalization is not None: for func in self.spatial_finalization: self.spatial_data = func(self.spatial_data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geo_transform(self):\n pass", "def spatial(self):", "def postprocess(self, t, y):\n return", "def initializeDomainBorder(self):\n #Read image of the structure\n if (self.PictureExistance == \"'yes'\"):\n self.__processImage()\n #re-define the domain size ...
[ "0.56396085", "0.561659", "0.5499944", "0.5437898", "0.53270626", "0.5260923", "0.5223429", "0.5222997", "0.51489437", "0.5124702", "0.5118264", "0.5118264", "0.5118264", "0.5118264", "0.5118264", "0.51041156", "0.5095841", "0.50939804", "0.5088009", "0.5068781", "0.50685513"...
0.7470984
0
Merge c1 and c2 if they both have analytic FTs, else raise. Raises ValueError c1 or c2 does not have an analytic FT.
def merge_analytics(self): if not (self.c1.has_analytic_ft and self.c2.has_analytic_ft): raise ValueError('both convolvables must have analytic FTs') else: c_out = Convolvable(None, None, None, has_analytic_ft=True) c_out.s1 = self.c1.copy() c_out.s2 = sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_sub_error_checking(self, other):\n\n if not isinstance(other, Spectrum):\n raise TypeError(\n 'Spectrum addition/subtraction must involve a Spectrum object')\n if len(self) != len(other):\n raise SpectrumError(\n 'Cannot add/subtract spectr...
[ "0.5343811", "0.50858563", "0.49748346", "0.49334633", "0.49170998", "0.49069658", "0.49052873", "0.49000084", "0.4858432", "0.4825097", "0.48104608", "0.4782", "0.47751856", "0.4774436", "0.4762947", "0.47617707", "0.4747233", "0.4744684", "0.4731122", "0.4719853", "0.466042...
0.6672611
0
Spatial representation, x, y, data.
def spatial(self): return self.spatial_x, self.spatial_y, self.spatial_data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spatialData(self):\n return self.__spatial_data", "def spatial(self):", "def spatial(self):\n return self._spatial", "def dump_coords(geom): # -> Any | list[Unknown]:\n ...", "def coords_to_structure(self) -> None:\n ...", "def geo(self):\n return vec2geo_linear_signed...
[ "0.76539093", "0.74566436", "0.7049526", "0.6558142", "0.64257413", "0.63625216", "0.6302409", "0.6250071", "0.62437385", "0.6218912", "0.6217882", "0.6128089", "0.6105279", "0.60940295", "0.60849136", "0.60689294", "0.60689294", "0.6067746", "0.60565007", "0.6054923", "0.604...
0.8060801
0
kspace representation, fx, fy, data.
def kspace(self): return self.kspace_x, self.kspace_y, self.kspace_data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_kspace_data(self):\n if self.c1.has_analytic_ft:\n # units came directly from c2, pad and FT c1\n c2_pad = pad2d(self.c2.data, self.Q, mode=self.pad_method)\n c2_ft = e.fft.fftshift(e.fft.fft2(e.fft.ifftshift(c2_pad)))\n xx, yy = e.meshgrid(self.kspace...
[ "0.58392346", "0.5674713", "0.5634144", "0.5628359", "0.5627151", "0.5572235", "0.5487891", "0.54786855", "0.53963286", "0.53055847", "0.5251676", "0.5217676", "0.5217386", "0.521247", "0.51859796", "0.5154917", "0.5137192", "0.5125154", "0.5112798", "0.5112395", "0.5086484",...
0.70029235
0
Plot the trace and posterior of a parameter.
def plot_trace(param, param_name='parameter'): # Summary statistics mean = np.mean(param) median = np.median(param) cred_min, cred_max = np.percentile(param, 2.5), np.percentile(param, 97.5) # Plotting plt.subplot(1,2,1) plt.plot(param,color="b") plt.xlabel('samples') plt.ylabel(param_name) pl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_parameter(self, parm):\n # If user wants to plot density, make sure it exists\n if parm == 'density' and 'density' not in self.ds.data_vars:\n self.insert_density()\n \n if parm == 'theta' and 'theta' not in self.ds.data_vars:\n self.insert_potential_densi...
[ "0.7102128", "0.7056802", "0.67294407", "0.66463816", "0.6530784", "0.65170753", "0.64658314", "0.6400332", "0.6375186", "0.63123643", "0.6279139", "0.6274265", "0.62650234", "0.6264103", "0.6264037", "0.6246267", "0.6236599", "0.6216537", "0.6200111", "0.6199557", "0.6144523...
0.77418745
0
Save the overload for the given signature.
def save_overload(self, sig, data):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_overload(self, sig, cres):", "def save_overload(self, sig, data):\n with self._guard_against_spurious_io_errors():\n self._save_overload(sig, data)", "def save_overload(self, sig, cres):\n if not self._enabled:\n return\n if not self._check_cachable(cres):\n ...
[ "0.76616406", "0.7318339", "0.72504723", "0.60353947", "0.60353947", "0.56379944", "0.5604159", "0.5581672", "0.54502296", "0.54502296", "0.54502296", "0.5439635", "0.5431044", "0.5431044", "0.5420505", "0.53660655", "0.5362865", "0.5345172", "0.53441656", "0.5332401", "0.529...
0.80685765
0
Get a string disambiguator for this locator's function. It should allow disambiguating different but similarlynamed functions.
def get_disambiguator(self):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disambiguate(self, string: str) -> str:\n if string in self.names:\n return self.disambiguate(f'_{string}')\n return string", "def display_name(self) -> str:\n return f\"{self.func.__module__}.{self.func.__qualname__}\"", "def disambiguating_description(self) -> str:\n ...
[ "0.66879505", "0.6324092", "0.6207215", "0.6108938", "0.6057423", "0.6028567", "0.6028567", "0.6026598", "0.602391", "0.5969164", "0.5946004", "0.59298944", "0.59163475", "0.5873664", "0.5841203", "0.5837057", "0.58369607", "0.58057874", "0.58042955", "0.5779693", "0.5779693"...
0.7789377
1
Given the Python file path, compute a suitable path inside the cache directory. This will reduce a file path that is too long, which can be a problem on some operating system (i.e. Windows 7).
def get_suitable_cache_subpath(cls, py_file): path = os.path.abspath(py_file) subpath = os.path.dirname(path) parentdir = os.path.split(subpath)[-1] # Use SHA1 to reduce path length. # Note: windows doesn't like long path. hashed = hashlib.sha1(subpath.encode()).hexdigest...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _2to3_cache_path(self, path):\n head, tail = os.path.split(path)\n base_filename, sep, tail = tail.partition('.')\n filename = ''.join([base_filename, sep, self.tag, sep, tail])\n return os.path.join(head, '__pycache__', filename)", "def get_cache_file_path(self):\n home_pa...
[ "0.75197756", "0.6979441", "0.697423", "0.6858296", "0.6771398", "0.6562598", "0.653863", "0.6503854", "0.6472874", "0.6472874", "0.64712125", "0.6465422", "0.64368236", "0.64188576", "0.6399139", "0.6397813", "0.6395925", "0.6395925", "0.6387998", "0.6315491", "0.6304801", ...
0.7476729
1
Load the cache index and return it as a dictionary (possibly empty if cache is empty or obsolete).
def _load_index(self): try: with open(self._index_path, "rb") as f: version = pickle.load(f) data = f.read() except FileNotFoundError: # Index doesn't exist yet? return {} if version != self._version: # This is anoth...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_index(self):\n try:\n with open(self._index_path, \"rb\") as f:\n version = pickle.load(f)\n data = f.read()\n except EnvironmentError as e:\n # Index doesn't exist yet?\n if e.errno in (errno.ENOENT,):\n return {...
[ "0.7845512", "0.78338426", "0.73281765", "0.7003806", "0.6881631", "0.6730933", "0.63391733", "0.624169", "0.6137112", "0.61090744", "0.60896146", "0.60757184", "0.6046908", "0.6012206", "0.60055953", "0.59455705", "0.5943277", "0.59431076", "0.59424853", "0.59376806", "0.592...
0.7843387
1
Open filepath for writing in a race conditionfree way (hopefully). uuid4 is used to try and avoid name collisions on a shared filesystem.
def _open_for_write(self, filepath): uid = uuid.uuid4().hex[:16] # avoid long paths tmpname = '%s.tmp.%s' % (filepath, uid) try: with open(tmpname, "wb") as f: yield f os.replace(tmpname, filepath) except Exception: # In case of error,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lock_file(path):\n #TODO if open fails and the lockfile is present, check its creation date\n # and, if it's more than ??? remove it and retry\n # pylint: disable=global-statement\n try:\n lock_fd = os.open(path, os.O_CREAT | os.O_WRONLY | os.O_EXCL)\n except OSError:\n return Fals...
[ "0.668164", "0.6516395", "0.6424874", "0.6403693", "0.6300181", "0.61996514", "0.6184526", "0.6141328", "0.611773", "0.59993446", "0.59687716", "0.5897366", "0.5844649", "0.5839704", "0.5805919", "0.5803006", "0.5792367", "0.57910913", "0.5783868", "0.57838196", "0.57606786",...
0.6601588
1
Compute index key for the given signature and codegen. It includes a description of the OS, target architecture and hashes of the bytecode for the function and, if the function has a __closure__, a hash of the cell_contents.
def _index_key(self, sig, codegen): codebytes = self._py_func.__code__.co_code if self._py_func.__closure__ is not None: cvars = tuple([x.cell_contents for x in self._py_func.__closure__]) # Note: cloudpickle serializes a function differently depending # on how ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _index_key(self, sig, codegen):\n return (sig, codegen.magic_tuple())", "def make_cache_key(udf, sig):\n codebytes = udf.__code__.co_code\n constants = udf.__code__.co_consts\n names = udf.__code__.co_names\n\n if udf.__closure__ is not None:\n cvars = tuple(x.cell_contents for x in...
[ "0.72252923", "0.6538476", "0.64127934", "0.6329711", "0.6059263", "0.5660305", "0.5593759", "0.5520308", "0.55068314", "0.5473412", "0.54489034", "0.5417199", "0.5338839", "0.533809", "0.5323202", "0.52939135", "0.5284064", "0.52755153", "0.5265266", "0.5235198", "0.52217406...
0.800436
0
Create a Cache class for additional compilation features to cache their result for reuse. The cache is saved in filename pattern like in ``FunctionCache`` but with additional prefix as specified.
def make_library_cache(prefix): # avoid cache prefix reuse assert prefix not in _lib_cache_prefixes _lib_cache_prefixes.add(prefix) class CustomCodeLibraryCacheImpl(CodeLibraryCacheImpl): _filename_prefix = prefix class LibraryCache(Cache): """ Implements Cache that saves a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def creator(cls, cache_key, device, **kwargs):\n function = cls(cache_key, device, **kwargs)\n _GLOBAL_CACHED_FUNCTIONS[cache_key] = function\n return function", "def build_cache(klass: \"PrefixCache\", operators: Tuple[Operator, ...]) -> \"PrefixCache\":\n prefix_cache = ...
[ "0.65252244", "0.6232623", "0.61772084", "0.6131773", "0.6113805", "0.6067904", "0.6055208", "0.60465133", "0.604173", "0.60404664", "0.5942605", "0.5918185", "0.5878135", "0.58679765", "0.58394307", "0.57930905", "0.57804304", "0.5763037", "0.57537156", "0.57318455", "0.5596...
0.73110455
0
Updates the ingredients and money report
def report_update(): resources["water"] = resources["water"] - MENU[order]["ingredients"]["water"] resources["milk"] = resources["milk"] - MENU[order]["ingredients"]["milk"] resources["coffee"] = resources["coffee"] - MENU[order]["ingredients"]["coffee"] resources["money"] = resources["money"] + tot...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def UpdateInvoice(self):\n self.builder.get_object('GuiInvProd').get_buffer().set_text(\"Product:\\n\")\n self.builder.get_object('GuiInvPrice').get_buffer().set_text(\"Price:\\n\")\n self.amount = 0\n for items in self.prod_list:\n self.builder.get_object('GuiInvProd').get_b...
[ "0.69491446", "0.6937188", "0.624171", "0.615062", "0.61246806", "0.5851611", "0.577501", "0.5767337", "0.57491696", "0.57274073", "0.5685894", "0.56232226", "0.55793214", "0.55764127", "0.55750525", "0.55363756", "0.5525862", "0.54876465", "0.54687643", "0.5466047", "0.54615...
0.6961457
0
Copy a file from src to dest.
def copyFile( src, dest ): inFile = open( src, 'r' ) outFile = open( dest, 'w' ) for line in inFile: outFile.write( line ) outFile.close() inFile.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_file(src, dest):\n with open_local_or_gcs(src, 'r') as h_src:\n with open_local_or_gcs(dest, 'w') as h_dest:\n shutil.copyfileobj(h_src, h_dest)", "def copyFile(srcPath, destPath):\n shutil.copy(srcPath, destPath)", "def _copy_file ( self, source, dest ):\n return", "def copy_fi...
[ "0.84503955", "0.8284259", "0.8224076", "0.7914803", "0.7899344", "0.7874945", "0.7804064", "0.7781178", "0.7581826", "0.7569853", "0.75525105", "0.7490443", "0.748294", "0.748294", "0.748294", "0.74761105", "0.74332446", "0.740162", "0.72671205", "0.72248304", "0.72095156", ...
0.8481214
0
Strip from the OSM anything that isn't a building or roadway.
def StripOSM( filename ): osmFile = open( filename, 'r' ) strippedFile = open( "tmpfile.osm", "w" ) tmpBuf = []; bufferData = False inWay = False keepWay = False for line in osmFile: curr = line.lstrip() if curr[0] != '<': continue # we ignore lines that aren't xml tags. loc = curr.find(" ") if loc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _strip(self, mols):\n\n # The order of operations is important here as stripping atom map\n # numbers first will lead to total removal of the molecules.\n return self._strip_map(self._strip_env(mols))", "def trim_features():\n pass", "def _cleanupAddress(self, address):\n cle...
[ "0.5836073", "0.5740132", "0.55415165", "0.5534584", "0.5508347", "0.54715186", "0.5459436", "0.5450962", "0.53126204", "0.52967423", "0.5288662", "0.5279558", "0.5274554", "0.5258989", "0.5252854", "0.52408457", "0.52288187", "0.5203492", "0.51565176", "0.5141238", "0.512748...
0.65634924
0
check_extent() > None Makes sure left limit is less than right limit, and lower limit is less than upper limit. In other words, ensures that, immediately after the
def check_extent(self): if self.lower_left.x > self.upper_right.x: dlx = self.lower_left.x self.lower_left.x = self.upper_right.x self.upper_right.y = dlx if self.lower_left.y > self.upper_right.y: dly = self.lower_left.y self.lower_left.y = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkInBound(self,value,checkEdge):\n assert(checkEdge==0 or checkEdge==1)\n if checkEdge==0: # width\n assert(value>=0 and value<self.w)\n else:\n assert(value>=0 and value<self.h)", "def check(self):\n self.lower_bound(5e-4)\n self.upper_bound(5e2)",...
[ "0.6588729", "0.6540092", "0.6471849", "0.64596236", "0.64591676", "0.63633776", "0.6347359", "0.62776583", "0.62022114", "0.6195664", "0.61871344", "0.6115332", "0.6110427", "0.610017", "0.60153145", "0.6003828", "0.6001943", "0.6001682", "0.5999328", "0.59796566", "0.596419...
0.78591186
0
Create Theta from a graph and energy ranges.
def from_graph(cls, graph, linear_energy_ranges, quadratic_energy_ranges): get_env().enable_infix_notation = True # not sure why we need this here theta = cls.empty(dimod.SPIN) theta.offset += Symbol('offset', REAL) def Linear(v): """Create a Symbol for the linear bias in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_ta(data):\n raise NotImplementedError", "def test1(self):\n start = 10\n end = 50\n e1_start = 10\n e1_end = 20\n e2_start = 30\n e2_end = 40\n e3_start = 45\n e3_end = 50\n\n t = Transcript(\"t1\", \"chr1\", start, end, \"+\", \"gene...
[ "0.57671505", "0.5232842", "0.52054393", "0.51504564", "0.5138185", "0.51044846", "0.51040995", "0.5096642", "0.5041972", "0.50195026", "0.50011444", "0.4983142", "0.48868716", "0.48841518", "0.4837323", "0.4819436", "0.48100612", "0.48051208", "0.48042378", "0.47978282", "0....
0.6531703
0
Create a Symbol for the linear bias including the energy range constraints.
def Linear(v): bias = Symbol('h_{}'.format(v), REAL) min_, max_ = linear_energy_ranges[v] theta.assertions.add(LE(bias, limitReal(max_))) theta.assertions.add(GE(bias, limitReal(min_))) return bias
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_autoregressive_bias(max_length: int, name: str) -> mx.sym.Symbol:\n return mx.sym.BlockGrad(mx.symbol.Custom(length=max_length,\n name=name,\n op_type='auto_regressive_bias'))", "def bias(self, shape, name=\"\"):\n...
[ "0.5577916", "0.5482133", "0.53778195", "0.5216755", "0.5212458", "0.51867956", "0.518636", "0.5136741", "0.513553", "0.5105823", "0.51026034", "0.50898635", "0.5083048", "0.5078185", "0.5056547", "0.5046213", "0.5030413", "0.50291514", "0.5009451", "0.5005152", "0.49887642",...
0.6969406
0
Create a Symbol for the quadratic bias including the energy range constraints.
def Quadratic(u, v): bias = Symbol('J_{},{}'.format(u, v), REAL) if (v, u) in quadratic_energy_ranges: min_, max_ = quadratic_energy_ranges[(v, u)] else: min_, max_ = quadratic_energy_ranges[(u, v)] theta.assertions.add(LE(bias, limitReal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_sym(self):\n\n phi_list = []\n sym_vars = sym.zeros(len(self.rigid_body_list) * 12, 1)\n\n for i, rigid_body in enumerate(self.rigid_body_list): # Global symbolic variable matrix (column vector)\n for j, sim_var in enumerate(rigid_body.symbolic_variables):\n ...
[ "0.57510895", "0.5623526", "0.5601682", "0.542738", "0.53913754", "0.52267146", "0.5215311", "0.5179779", "0.5169181", "0.51482487", "0.51384854", "0.5135478", "0.51248145", "0.51022685", "0.50652033", "0.50476104", "0.50382876", "0.50235695", "0.49986368", "0.49941644", "0.4...
0.65538627
0
Given a pysmt model, return a bqm. Adds the values of the biases as determined by the SMT solver to a bqm.
def to_bqm(self, model): linear = ((v, float(model.get_py_value(bias))) for v, bias in self.linear.items()) quadratic = ((u, v, float(model.get_py_value(bias))) for (u, v), bias in self.quadratic.items()) offset = float(model.get_py_value(self.offset)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bias_model_qso(z):\n alpha = 0.278\n beta = 2.393\n return alpha * ((1+z)**2 - 6.565) + beta", "def to_bayesianmodel(model, verbose=3):\n if isinstance(model, dict):\n adjmat = model.get('adjmat', None)\n else:\n adjmat = model\n if adjmat is None: raise Exception('[bnlearn] >...
[ "0.58180714", "0.5365426", "0.5264869", "0.52307314", "0.5063534", "0.5056869", "0.50428975", "0.5012015", "0.4948588", "0.4947882", "0.49017915", "0.48730212", "0.48512527", "0.48471758", "0.4818126", "0.4804862", "0.4782352", "0.47638148", "0.4756062", "0.47536507", "0.4732...
0.72276294
0
Return a list of directories where config files may be located.
def _get_config_dirs(project=None): snap = os.environ.get('SNAP') snap_c = os.environ.get('SNAP_COMMON') cfg_dirs = [ _fixpath(os.path.join('~', '.' + project)) if project else None, _fixpath('~'), os.path.join('/etc', project) if project else None, '/etc', os.path.j...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_config_dirs(project=None, prog=None, extension='.conf.d'):\n return _find_config_files(project, prog, extension)", "def get_directories():\n # get current working dir\n directory = os.getcwd()\n # list of dir to look in repo for files\n directories = [\n directory,\n os.path...
[ "0.7564852", "0.7387399", "0.7233537", "0.6963005", "0.6894056", "0.6831714", "0.6804748", "0.677448", "0.677448", "0.6741197", "0.67373717", "0.67180187", "0.6709801", "0.6678156", "0.66746753", "0.66457397", "0.6629224", "0.6600579", "0.6596342", "0.6596183", "0.65905786", ...
0.78862596
0
Search a list of directories for a given filename or directory name. Iterator over the supplied directories, returning the first file found with the supplied name and extension.
def _search_dirs(dirs, basename, extension=""): for d in dirs: path = os.path.join(d, '%s%s' % (basename, extension)) if os.path.exists(path): return path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def searchfiles(directory, filenames, ext=None):\n if ext:\n filenames = [f'{file}{ext}' for file in filenames]\n return [\n file for file in Path(directory).glob('*')\n if file.name in filenames\n ]", "def find_file(directory, extensions):\n for filename in os.listdir(directory)...
[ "0.70626944", "0.6983475", "0.6861826", "0.6779584", "0.6739452", "0.66785127", "0.6648111", "0.66227525", "0.6488702", "0.6425789", "0.63920844", "0.63781744", "0.6368373", "0.63675183", "0.63463944", "0.6340417", "0.6220207", "0.6209838", "0.61906016", "0.61889917", "0.6180...
0.73700005
0
Check whether an opt with the same name is already registered. The same opt may be registered multiple times, with only the first registration having any effect. However, it is an error to attempt to register a different opt with the same name.
def _is_opt_registered(opts, opt): if opt.dest in opts: if opts[opt.dest]['opt'] != opt: raise DuplicateOptError(opt.name) return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def option_is_known(self, opt):\n return opt in self.results", "def _register_opt(self, opt, cli=False):\n if _is_opt_registered(self._opts, opt):\n return False\n\n self._opts[opt.dest] = {'opt': opt, 'cli': cli}\n\n return True", "def is_manually_set(option_name: str) -...
[ "0.6331475", "0.627013", "0.6052041", "0.59516907", "0.58679914", "0.5855124", "0.5831757", "0.5785038", "0.5709831", "0.57043004", "0.56285954", "0.5602084", "0.555738", "0.5547354", "0.55465233", "0.5541336", "0.55118954", "0.5507576", "0.54976946", "0.5475445", "0.54089284...
0.8065388
0
Report use of a deprecated option Uses versionutils from oslo.log if it is available. If not, logs a simple warning message.
def _report_deprecation(format_str, format_dict): if oslo_log: # We can't import versionutils at the module level because of circular # imports. Importing just oslo_log at the module level and # versionutils locally allows us to unit test this and still avoid the # circular problem....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _mark_if_deprecated(self, option):\n option_str = f\"{option!r}\"\n if option in self.deprecated:\n option_str = f\"{option_str} (deprecated)\"\n return option_str", "def _check_deprecated(self, dest: str, kwargs, print_warning: bool = True) -> None:\n removal_version =...
[ "0.74900407", "0.7320259", "0.7144705", "0.694346", "0.6741097", "0.6562329", "0.64783347", "0.64122975", "0.6364655", "0.6360188", "0.6353762", "0.6298623", "0.62559795", "0.6255233", "0.62422", "0.6237876", "0.6182147", "0.6168086", "0.6155336", "0.614209", "0.6131457", "...
0.73208296
1
Check if default is a reference to another var.
def _default_is_ref(self): if isinstance(self.default, str): tmpl = self.default.replace(r'\$', '').replace('$$', '') return '$' in tmpl return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_default(self):\r\n return self.default is not None", "def isReference(node):\n return bool(isinstance(node, nodes.Referential)\n and node.get(DuAttrRefid, None))", "def is_ref_known(self):\r\n \r\n if \"N\" in self.ref:\r\n return False\r\n ...
[ "0.60578936", "0.60276395", "0.599565", "0.5985731", "0.59614575", "0.59157443", "0.58454174", "0.58381283", "0.57921386", "0.5720587", "0.5720587", "0.5720587", "0.5659847", "0.5643267", "0.5641084", "0.5606325", "0.5597429", "0.5592746", "0.557228", "0.55702686", "0.5562748...
0.7120536
0
Build a prefix for the CLI option name, if required. CLI options in a group are prefixed with the group's name in order to avoid conflicts between similarly named options in different groups.
def _get_argparse_prefix(self, prefix, group_name): if group_name is not None: return group_name + '-' + prefix else: return prefix
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_deprecated_cli_name(self, dname, dgroup, prefix=''):\n if dgroup == 'DEFAULT':\n dgroup = None\n\n if dname is None and dgroup is None:\n return None\n\n if dname is None:\n dname = self.name\n\n return self._get_argparse_prefix(prefix, dgroup) ...
[ "0.6956963", "0.66877687", "0.6615358", "0.62137544", "0.6103239", "0.60400987", "0.5929751", "0.59120864", "0.58202034", "0.5755803", "0.5744125", "0.5740628", "0.573101", "0.5690901", "0.5690901", "0.5690901", "0.5690901", "0.5690901", "0.5690901", "0.5690901", "0.5690901",...
0.7660147
0
Build a CLi arg name for deprecated options. Either a deprecated name or a deprecated group or both or
def _get_deprecated_cli_name(self, dname, dgroup, prefix=''): if dgroup == 'DEFAULT': dgroup = None if dname is None and dgroup is None: return None if dname is None: dname = self.name return self._get_argparse_prefix(prefix, dgroup) + dname
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _mark_if_deprecated(self, option):\n option_str = f\"{option!r}\"\n if option in self.deprecated:\n option_str = f\"{option_str} (deprecated)\"\n return option_str", "def _check_deprecated(self, name, current, deprecated):\n if name in deprecated and name not in self._e...
[ "0.66326666", "0.65294325", "0.6403947", "0.624564", "0.6129196", "0.60114485", "0.5811011", "0.5666793", "0.56374454", "0.5630713", "0.56239223", "0.56049407", "0.5603676", "0.56028104", "0.55581677", "0.5537236", "0.5512842", "0.55099005", "0.5489011", "0.54872274", "0.5468...
0.66377604
0
Extends the base argparse keyword dict for boolean options.
def _get_argparse_kwargs(self, group, action='store_true', **kwargs): kwargs = super(BoolOpt, self)._get_argparse_kwargs(group, **kwargs) # type has no effect for BoolOpt, it only matters for # values that came from config files if 'type' in kwargs: del kwargs['type'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_to_cli(self, parser, group=None):\n super(BoolOpt, self)._add_to_cli(parser, group)\n self._add_inverse_to_argparse(parser, group)", "def boolean_flag(parser, name, default=False, help=None):\n dest = name.replace('-', '_')\n parser.add_argument(\"--\" + name, action=\"store_true\", ...
[ "0.68028235", "0.6555863", "0.6393419", "0.6357621", "0.6339471", "0.63170356", "0.6312979", "0.6211804", "0.6058865", "0.6033186", "0.5981442", "0.5976067", "0.5940165", "0.5934198", "0.5897695", "0.58884656", "0.58622855", "0.5858163", "0.58570737", "0.58304465", "0.5827504...
0.75665027
0
Extends the base argparse keyword dict for multi value options.
def _get_argparse_kwargs(self, group, **kwargs): kwargs = super(MultiOpt, self)._get_argparse_kwargs(group) if not self.positional: kwargs['action'] = 'append' else: kwargs['nargs'] = '*' return kwargs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _arg_parse(self, **options) -> Dict[str, Any]:\n extra_options = dict()\n for key, value in options.items():\n private_key = f\"__{key}\"\n if hasattr(self, private_key):\n setattr(self, private_key, value)\n else:\n extra_options[key...
[ "0.722063", "0.65066826", "0.6404572", "0.63677996", "0.6324855", "0.62528473", "0.613492", "0.6089233", "0.6063307", "0.59679955", "0.59511244", "0.59473217", "0.5942773", "0.59241116", "0.5915229", "0.5900823", "0.5883231", "0.5870752", "0.5848868", "0.5848112", "0.58399445...
0.73584485
0
Extends the base argparse keyword dict for the config file opt.
def _get_argparse_kwargs(self, group, **kwargs): kwargs = super(_ConfigFileOpt, self)._get_argparse_kwargs(group) kwargs['action'] = self.ConfigFileAction return kwargs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _arg_parse(self, **options) -> Dict[str, Any]:\n extra_options = dict()\n for key, value in options.items():\n private_key = f\"__{key}\"\n if hasattr(self, private_key):\n setattr(self, private_key, value)\n else:\n extra_options[key...
[ "0.6924684", "0.69160116", "0.662033", "0.64342576", "0.63868946", "0.6357921", "0.63394636", "0.6206222", "0.61673665", "0.6104571", "0.6096398", "0.60958225", "0.60860926", "0.607301", "0.6052012", "0.5960533", "0.59060645", "0.58930594", "0.5884471", "0.58780336", "0.58775...
0.70935756
0
Extends the base argparse keyword dict for the config dir option.
def _get_argparse_kwargs(self, group, **kwargs): kwargs = super(_ConfigDirOpt, self)._get_argparse_kwargs(group) kwargs['action'] = self.ConfigDirAction return kwargs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_argparse_kwargs(self, group, **kwargs):\n kwargs = super(_ConfigFileOpt, self)._get_argparse_kwargs(group)\n kwargs['action'] = self.ConfigFileAction\n return kwargs", "def _arg_parse(self, **options) -> Dict[str, Any]:\n extra_options = dict()\n for key, value in opti...
[ "0.6527066", "0.6048787", "0.59673876", "0.5844325", "0.5787769", "0.57625425", "0.5752619", "0.56567395", "0.5550613", "0.5537233", "0.55264187", "0.54958665", "0.5465519", "0.54520327", "0.5428953", "0.5423342", "0.5413744", "0.54107046", "0.53974277", "0.53936297", "0.5376...
0.7404303
0
Save known driver opts.
def _save_driver_opts(self, opts): self._driver_opts.update(opts)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_opts(self):\n models_dir = os.path.join(self.log_path, \"models\")\n if not os.path.exists(models_dir):\n os.makedirs(models_dir)\n to_save = self.opt.__dict__.copy()\n\n with open(os.path.join(models_dir, 'opt.json'), 'w') as f:\n json.dump(to_save, f, in...
[ "0.69671524", "0.6543403", "0.6231791", "0.6212636", "0.6182456", "0.6044342", "0.60087734", "0.5932012", "0.5884828", "0.5847112", "0.58463055", "0.5681478", "0.5674279", "0.55638546", "0.555631", "0.55554354", "0.5552454", "0.55351865", "0.5525659", "0.55110675", "0.5455581...
0.8868057
0
Remove an opt from this group.
def _unregister_opt(self, opt): if opt.dest in self._opts: del self._opts[opt.dest]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_option(self, option):\n self.__options.pop(option)", "def remove_option(self, label):\n del self._options[label]\n index = self._menu.index(label)\n self._menu.delete(index, index)", "def remove_option(self, option):\n splitvals = option.split('/')\n section...
[ "0.7601888", "0.7089738", "0.68687624", "0.63850886", "0.633357", "0.62517875", "0.6192582", "0.61474115", "0.60994935", "0.5978598", "0.5904799", "0.58712596", "0.58339113", "0.58313996", "0.55683416", "0.55648714", "0.5531496", "0.5502401", "0.55021584", "0.54822797", "0.54...
0.7215181
1
Clear this group's option parsing state.
def _clear(self): self._argparse_group = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear(self):\n self._args = None\n self._oparser = None\n self._namespace = None\n self._mutable_ns = None\n # Keep _mutate_hooks\n self._validate_default_values = False\n self.unregister_opts(self._config_opts)\n for group in self._groups.values():\n ...
[ "0.73303413", "0.685091", "0.6504384", "0.6282898", "0.6230489", "0.6220013", "0.6206353", "0.614225", "0.61022544", "0.61022544", "0.61022544", "0.60787666", "0.6057678", "0.605484", "0.605274", "0.599765", "0.5972635", "0.59272355", "0.5913401", "0.5902073", "0.5867685", ...
0.7670279
0
Parse a config file and store any values in the namespace.
def _parse_file(cls, config_file, namespace): config_file = _fixpath(config_file) sections = {} normalized = {} parser = cls(config_file, sections) parser._add_normalized(normalized) try: parser.parse() except iniparser.ParseError as pe: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_config(self):\n # TODO: parse config file\n pass", "def parseConfigFile(self, config_file_path):\n parser = configparser.SafeConfigParser()\n parser.read(config_file_path)\n self.seuil_snr = int(parser.get('seuils', 'snr'))\n self.seuil_elev_sat = int(parser.ge...
[ "0.731248", "0.6914968", "0.68401694", "0.66398644", "0.66343355", "0.6620561", "0.6553748", "0.6548188", "0.65037996", "0.6460869", "0.6430972", "0.6420938", "0.6378057", "0.63775843", "0.6335188", "0.6333005", "0.6332918", "0.631246", "0.6309967", "0.6256032", "0.6240674", ...
0.7184585
1
Add a parsed config file to the list of parsed files.
def _add_parsed_config_file(self, filename, sections, normalized): for s in sections: self._sections_to_file[s] = filename self._parsed.insert(0, sections) self._normalized.insert(0, normalized)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_new_file(self, filename):\n self.load_config()\n if not self.__is_file_in_working_directory(filename):\n path = os.path.join(self.__directory.working_path,\n filename)\n raise FileNotFoundError(f\"No such file '{filename}' in '{path}'!\")\n...
[ "0.60479593", "0.58200353", "0.58160853", "0.5808242", "0.5770087", "0.57630605", "0.57359755", "0.56901276", "0.56881946", "0.5685556", "0.56854904", "0.56601936", "0.56576794", "0.5641899", "0.5613813", "0.55737597", "0.55645066", "0.5543084", "0.5508572", "0.5502041", "0.5...
0.74126667
0
Record that we have no permission to open a config file.
def _file_permission_denied(self, config_file): self._files_permission_denied.append(config_file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def not_authorized(context):\n context.config_file = 'NON_EXISTENT_FILE.cfg'", "def test_get_authz_file_notdefined_raises(self):\n self.env.config.remove('authz_policy', 'authz_file')\n self.assertRaises(ConfigurationError, self.check_permission,\n 'WIKI_VIEW', 'änon', N...
[ "0.70574796", "0.6591872", "0.6469537", "0.6372442", "0.6370357", "0.63236177", "0.61849016", "0.6177655", "0.60897315", "0.6087917", "0.608167", "0.59476143", "0.5843255", "0.58201694", "0.5805474", "0.57601726", "0.5749933", "0.5740695", "0.5707795", "0.56733406", "0.565720...
0.70143473
1
Check for usage of deprecated names.
def _check_deprecated(self, name, current, deprecated): if name in deprecated and name not in self._emitted_deprecations: self._emitted_deprecations.add(name) current = (current[0] or 'DEFAULT', current[1]) format_dict = {'dep_option': name[1], 'dep_group': name[0], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _initIsDeprecated(self):\n self._isDeprecated = re.search(\"deprecated\", self._description, re.IGNORECASE) is not None", "def _check_deprecated(self, dest: str, kwargs, print_warning: bool = True) -> None:\n removal_version = kwargs.get(\"removal_version\", None)\n if removal_version is...
[ "0.72658837", "0.7140323", "0.6854603", "0.6726529", "0.6421924", "0.64193845", "0.63751596", "0.63482946", "0.6326504", "0.628319", "0.62435097", "0.6208854", "0.6197348", "0.6195174", "0.61420184", "0.61409336", "0.60527736", "0.6013756", "0.5943957", "0.5941051", "0.593668...
0.78808707
0
Return True if key is the name of a registered opt or group.
def __contains__(self, key): return key in self._opts or key in self._groups
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __contains__(self, key):\n return key in self._group._opts", "def has_option(self, key):\n\n return key in self.__opt", "def has_option(self, key):\n if self.integration is None:\n return False\n return self.integration.has_option(f'{self.get_config_name()}.{key}'...
[ "0.77895975", "0.7694707", "0.70475066", "0.6766627", "0.6758752", "0.6596774", "0.6586676", "0.6470519", "0.6451084", "0.63794994", "0.63258165", "0.6319451", "0.6235656", "0.62245107", "0.6178423", "0.6177946", "0.61314416", "0.6112933", "0.6108597", "0.60401213", "0.603623...
0.78486896
0
Iterate over all registered opt and group names.
def __iter__(self): for key in itertools.chain(list(self._opts.keys()), list(self._groups.keys())): yield key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n for key in self._group._opts.keys():\n yield key", "def _all_opt_infos(self):\n for info in self._opts.values():\n yield info, None\n for group in self._groups.values():\n for info in group._opts.values():\n yield ...
[ "0.7567697", "0.7475738", "0.7017148", "0.671733", "0.6640219", "0.65766746", "0.64068633", "0.6219975", "0.6218623", "0.6152937", "0.614937", "0.6130754", "0.6128727", "0.61218375", "0.6074151", "0.60709363", "0.60493124", "0.59369487", "0.59345245", "0.5849164", "0.58019507...
0.7498136
1
Return the number of options and option groups.
def __len__(self): return len(self._opts) + len(self._groups)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __len__(self):\n return len(self._group._opts)", "def __len__(self) -> int:\n return len(self._options)", "def __len__(self):\n return len(self.options)", "def get_num_of_choices(self) -> int:\n return len(self._choices)", "def countCmdLineFlags(options, flag):\n coun...
[ "0.73808205", "0.7043727", "0.7009886", "0.6895047", "0.6802186", "0.6629693", "0.63553905", "0.6296944", "0.6218308", "0.61587685", "0.6127125", "0.61127216", "0.6090173", "0.60494286", "0.6040229", "0.60401887", "0.60301775", "0.60240996", "0.602239", "0.5981844", "0.595045...
0.78100467
0
Clear the object state and unset overrides and defaults.
def reset(self): self._unset_defaults_and_overrides() self.clear()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __reset__(self):\n\n for i in self.__dict__.keys():\n self.__dict__[i] = None", "def reset(self):\n self.values = None\n self.keys = None\n self.mask = None", "def reset(self):\n self.data = self._defaults", "def reset(self):\n self.bbox = None\n ...
[ "0.7513436", "0.7504329", "0.7382586", "0.73587936", "0.7335779", "0.7181764", "0.71783435", "0.71731496", "0.7166891", "0.71596307", "0.7131605", "0.7131605", "0.7131605", "0.7120651", "0.7113026", "0.71078473", "0.71010566", "0.7085051", "0.70633346", "0.70485395", "0.70431...
0.8070819
0
Reset the state of the object to before options were registered. This method removes all registered options and discards the data from the command line and configuration files. Any subparsers added using the add_cli_subparsers() will also be removed as a sideeffect of this method.
def clear(self): self._args = None self._oparser = None self._namespace = None self._mutable_ns = None # Keep _mutate_hooks self._validate_default_values = False self.unregister_opts(self._config_opts) for group in self._groups.values(): group....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reset(self):\r\n self._state = self.INITIALIZING\r\n self._option_values = options.Values()\r\n self._argv = []", "def reset(self):\n self.setOptions(self._options)", "def _clear(self):\n self._argparse_group = None", "def _reset(self, _recursive=False):\n if self._isDefault:\n...
[ "0.7158082", "0.6936063", "0.6645678", "0.66184276", "0.6555833", "0.6354448", "0.6195515", "0.6144815", "0.6127792", "0.61175495", "0.60678995", "0.60590035", "0.5987018", "0.5962955", "0.59321475", "0.59296006", "0.5918888", "0.59034526", "0.59034526", "0.5885978", "0.58462...
0.7182712
0
Register a CLI option schema. CLI option schemas must be registered before the command line and config files are parsed. This is to ensure that all CLI options are shown in help and option validation works as expected.
def register_cli_opt(self, opt, group=None): if self._args is not None: raise ArgsAlreadyParsedError("cannot register CLI option") return self.register_opt(opt, group, cli=True, clear_cache=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_schema(command, conf, vars):", "def register_options(cls, register):", "def pytest_addoption(parser):\n add_cli_options(parser)", "def register_opts():\n _register_api_opts()\n _register_db_opts()", "def argparse_options(\n parser: ArgumentParser,\n schema: Schema,\n defaults: d...
[ "0.5983539", "0.5937496", "0.58101785", "0.5701256", "0.56649864", "0.5554111", "0.5477824", "0.54570204", "0.5456049", "0.5419055", "0.54048353", "0.54002374", "0.538646", "0.5364972", "0.5316939", "0.5300753", "0.52865905", "0.5283853", "0.52807015", "0.5248503", "0.5244365...
0.5994866
0
Register an option group. An option group must be registered before options can be registered with the group.
def register_group(self, group): if group.name in self._groups: return self._groups[group.name] = copy.copy(group)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addOptionToGroup(self, groupName, *args, **kwargs):\n group = self._optionGroupDict.get(groupName)\n group.add_argument(*args, **kwargs)", "def register(self):\n group = cfg.OptGroup(self.group_name, title='Azure Options')\n self._config.register_group(group)\n self._config...
[ "0.7081009", "0.66981834", "0.66604084", "0.66506994", "0.6512721", "0.6285733", "0.6227285", "0.6201564", "0.61801", "0.61622953", "0.60227597", "0.6002337", "0.58905244", "0.58869904", "0.5876821", "0.5841373", "0.57848936", "0.57651156", "0.57332844", "0.57332844", "0.5733...
0.6809599
1
Unregister multiple CLI option schemas at once.
def unregister_opts(self, opts, group=None): for opt in opts: self.unregister_opt(opt, group, clear_cache=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_all(self):\n self._options.clear()\n self._programs.clear()", "def del_psana_options(self, keys):\n try:\n for key in keys:\n self._data.psana_cfg_dict.pop(key, None)\n except:\n print 'Invalid keys to remove from psana options:', keys",...
[ "0.5964021", "0.586294", "0.5776725", "0.56381816", "0.5468189", "0.5437627", "0.5424014", "0.54194176", "0.54077125", "0.53646135", "0.5330415", "0.5321576", "0.53118795", "0.5261534", "0.52327305", "0.52186877", "0.52124214", "0.51766646", "0.5158654", "0.51378983", "0.5121...
0.6467625
0
Import an option definition from a module. Import a module and check that a given option is registered. This is intended for use with global configuration objects like cfg.CONF where modules commonly register options with CONF at module load time. If one module requires an option defined by another module it can use th...
def import_opt(self, name, module_str, group=None): __import__(module_str) self._get_opt_info(name, group)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure(self, module=None, **kw):\r\n if module not in self._option_targets:\r\n if not self._import_module(module):\r\n raise self.Error('Unknown module to configure: %s' % module)\r\n def configure_option(name, value):\r\n if name not in self._option_targets[module]:\r\n raise...
[ "0.5951268", "0.58797187", "0.5590272", "0.5439318", "0.5182936", "0.51802623", "0.5010149", "0.50074905", "0.49976552", "0.49830472", "0.49267715", "0.49101672", "0.48939022", "0.48886496", "0.48194766", "0.48016703", "0.47696725", "0.47647026", "0.47075847", "0.46773195", "...
0.7214747
0
Import an option group from a module. Import a module and check that a given option group is registered. This is intended for use with global configuration objects like cfg.CONF where modules commonly register options with CONF at module load time. If one module requires an option group defined by another module it can...
def import_group(self, group, module_str): __import__(module_str) self._get_group(group)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def import_opt(self, name, module_str, group=None):\n __import__(module_str)\n self._get_opt_info(name, group)", "def import_module(module: str):\n logging.info('Importing %s.', module)\n try:\n importlib.import_module(module)\n except RuntimeError as e:\n if (str(e) ==\n 'Attempted...
[ "0.7216497", "0.56376237", "0.51931006", "0.50996983", "0.5075684", "0.49750656", "0.49031028", "0.48882616", "0.486968", "0.4784764", "0.46870106", "0.46525583", "0.46525565", "0.4651934", "0.46394154", "0.46158612", "0.46131277", "0.4608411", "0.46020162", "0.45970598", "0....
0.66852075
1
Clear an override an opt value. Clear a previously set override of the command line, config file and default values of a given option.
def clear_override(self, name, group=None): opt_info = self._get_opt_info(name, group) opt_info.pop('override', None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_default(self, name, group=None):\n opt_info = self._get_opt_info(name, group)\n opt_info.pop('default', None)", "def _unset_defaults_and_overrides(self):\n for info, group in self._all_opt_infos():\n info.pop('default', None)\n info.pop('override', None)", "...
[ "0.6960496", "0.6850129", "0.5948785", "0.57643515", "0.56869066", "0.56651413", "0.5632882", "0.561309", "0.5597346", "0.5583079", "0.55463177", "0.55251265", "0.5491744", "0.54872173", "0.54665095", "0.5449267", "0.54451716", "0.54356176", "0.54346263", "0.542347", "0.53642...
0.767148
0
Clear an override an opt's default value. Clear a previously set override of the default value of given option.
def clear_default(self, name, group=None): opt_info = self._get_opt_info(name, group) opt_info.pop('default', None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_override(self, name, group=None):\n opt_info = self._get_opt_info(name, group)\n opt_info.pop('override', None)", "def _unset_defaults_and_overrides(self):\n for info, group in self._all_opt_infos():\n info.pop('default', None)\n info.pop('override', None)", ...
[ "0.77190924", "0.7266398", "0.6248375", "0.6074347", "0.6028291", "0.59844416", "0.5972622", "0.5948366", "0.5909248", "0.5894575", "0.5894575", "0.58872086", "0.5825965", "0.57462126", "0.5731998", "0.57185876", "0.55860066", "0.5575102", "0.55405176", "0.5508069", "0.549443...
0.7840706
0
A generator function for iteration opt infos.
def _all_opt_infos(self): for info in self._opts.values(): yield info, None for group in self._groups.values(): for info in group._opts.values(): yield info, group
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n\n return iter(self.opts)", "def iter_implementations(self, opt):\n opt_desc = self.opt_dict[opt]\n for imp in self.imp_dict[opt_desc['imptype']]:\n yield imp", "def __iter__(self):\n if self.use_dic:\n for data in sorted(self.dic):\n ...
[ "0.6445151", "0.6250673", "0.6140299", "0.60329556", "0.59302264", "0.5902869", "0.5858899", "0.57583934", "0.5728059", "0.5662011", "0.56542474", "0.56542474", "0.56542474", "0.56542474", "0.5643439", "0.5617522", "0.56096804", "0.55817264", "0.5580915", "0.5569075", "0.5567...
0.6812646
0
A generator function for iterating CLI opts.
def _all_cli_opts(self): for item in self._cli_opts: yield item['opt'], item['group']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_opts():\n for mod in load_conf_modules():\n mod_opts = mod.list_opts()\n yield mod_opts[0], mod_opts[1]", "def __iter__(self):\n\n return iter(self.opts)", "def processCmdlineOpts(cmdOpts):\n global opts\n opts = {}\n for i in range(1,len(cmdOpts)):\n if re.matc...
[ "0.7090049", "0.7044086", "0.6606617", "0.66045487", "0.6486917", "0.6385719", "0.63293564", "0.6302572", "0.6247702", "0.61636925", "0.6114822", "0.61042386", "0.6079736", "0.60050106", "0.5978289", "0.5959675", "0.59370434", "0.59168625", "0.5901363", "0.5868692", "0.585890...
0.79697543
0
Unset any default or override on all options.
def _unset_defaults_and_overrides(self): for info, group in self._all_opt_infos(): info.pop('default', None) info.pop('override', None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\n self.setOptions(self._options)", "def clear_override(self, name, group=None):\n opt_info = self._get_opt_info(name, group)\n opt_info.pop('override', None)", "def clear_default(self, name, group=None):\n opt_info = self._get_opt_info(name, group)\n opt_info...
[ "0.71972984", "0.7072469", "0.6940144", "0.6929514", "0.68601364", "0.68182623", "0.68142444", "0.67376035", "0.66293514", "0.6578881", "0.6476741", "0.6432213", "0.6417212", "0.6417212", "0.6347809", "0.6333577", "0.63260645", "0.629644", "0.62680244", "0.62535524", "0.62425...
0.8660574
0
Log the value of all registered opts. It's often useful for an app to log its configuration to a log file at startup for debugging. This method dumps to the entire config state to the supplied logger at a given log level.
def log_opt_values(self, logger, lvl): logger.log(lvl, "*" * 80) logger.log(lvl, "Configuration options gathered from:") logger.log(lvl, "command line args: %s", self._args) logger.log(lvl, "config files: %s", hasattr(self, 'config_file') and self.config_file or []) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_config(self, level=logging.DEBUG):\n for key in sorted(self._config.keys()):\n if key in self._config:\n config_value = self._config[key].get_highest_priority()\n actual_value = self._raw_get(key) # for multiple this is a combined value\n logg...
[ "0.6452014", "0.5896501", "0.5883174", "0.5801464", "0.5800431", "0.5760263", "0.5731674", "0.57270265", "0.57141536", "0.56924695", "0.56790054", "0.5672609", "0.56678", "0.5664735", "0.5656508", "0.5650992", "0.5635257", "0.56096315", "0.55799025", "0.5543767", "0.5528634",...
0.75198716
0
Obfuscate values of options declared secret.
def _sanitize(opt, value): return value if not opt.secret else '*' * 4
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_secrets():\n for name, value in Secrets.__dict__.items():\n if name[0] != '_':\n os.environ[name] = value", "def _wrap_secret(self, val):\n return {\"SecretString\": val}", "def test_mask_secret_nosecrets():\n assert utils.mask_secrets(\"ls -lh /tmp\", None) == \"ls -lh...
[ "0.6073997", "0.57886994", "0.5655198", "0.56368905", "0.5629651", "0.56048554", "0.5524392", "0.55131763", "0.5477601", "0.5472171", "0.5472171", "0.5452148", "0.5433178", "0.5389291", "0.5369678", "0.5368027", "0.5362087", "0.53474724", "0.52772665", "0.52772665", "0.527554...
0.6614282
0
Perform value type conversion. Converts values using option's type. Handles cases when value is actually a list of values (for example for multi opts).
def _convert_value(self, value, opt): if opt.multi: return [opt.type(v) for v in value] else: return opt.type(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coerce_value(type, value):\n # type: (Any, Any) -> Union[List, Dict, int, float, bool, str, None]\n if isinstance(type, GraphQLNonNull):\n # Note: we're not checking that the result of coerceValue is\n # non-null.\n # We only call this function after calling isValidValue.\n re...
[ "0.6900873", "0.6853463", "0.67070705", "0.66894156", "0.65918666", "0.6575776", "0.65247655", "0.650786", "0.6464579", "0.64572144", "0.64548916", "0.6415733", "0.6384103", "0.63813144", "0.63727653", "0.6369388", "0.63493025", "0.62712467", "0.622532", "0.6217071", "0.62166...
0.86292493
0
Looks up a OptGroup object. Helper function to return an OptGroup given a parameter which can either be the group's name or an OptGroup object. The OptGroup object returned is from the internal dict of OptGroup objects, which will be a copy of any OptGroup object that users of the API have access to. If autocreate is T...
def _get_group(self, group_or_name, autocreate=False): group = group_or_name if isinstance(group_or_name, OptGroup) else None group_name = group.name if group else group_or_name if group_name not in self._groups: if not autocreate: raise NoSuchGroupError(group_name) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_or_create_group(fw, group_id, group_label):\n\n groups = fw.groups.find(f\"label={group_label}\")\n if len(groups) > 0:\n print(f\"Found group.\")\n group = groups[0]\n print(f\"group.label {group.label}\")\n print(f\"group.id {group.id}\")\n else:\n print(\"Grou...
[ "0.6759299", "0.60877013", "0.60528624", "0.59975374", "0.5916042", "0.586834", "0.58652806", "0.58489466", "0.5845936", "0.58272856", "0.57695836", "0.57575345", "0.56905895", "0.5609092", "0.55882233", "0.55346185", "0.55117035", "0.5487932", "0.5482693", "0.5480422", "0.54...
0.7939079
0
Check that all opts marked as required have values specified.
def _check_required_opts(self, namespace=None): for info, group in self._all_opt_infos(): opt = info['opt'] if opt.required: if 'default' in info or 'override' in info: continue if self._get(opt.dest, group, namespace) is None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate(self):\r\n for opt in self.required:\r\n if not getattr(self, opt):\r\n print \"Error: %s is not specified.\" % opt\r\n self.optp.print_help()\r\n sys.exit(1)", "def check_required(self, required):\n for k in required:\n ...
[ "0.7407233", "0.7334348", "0.7077362", "0.6895428", "0.6851394", "0.68227977", "0.6793502", "0.6709447", "0.6585882", "0.65796953", "0.6555604", "0.647639", "0.6409517", "0.6363187", "0.6356992", "0.6353699", "0.6344366", "0.63334626", "0.63206524", "0.63181174", "0.6315916",...
0.80924314
0
Registers a hook to be called by mutate_config_files.
def register_mutate_hook(self, hook): self._mutate_hooks.add(hook)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hook(callback):\n hooks.append(callback)", "def add_hook(f, h):\n if f in hooks:\n hooks[f] += [h]\n else:\n hooks[f] = [h]", "def add_hook(self, name: str, callable):\n assert name in self.typenames, \"'{}' not in '{}'\".format(name, self.typenames)\n self.__hooks[name] ...
[ "0.7207172", "0.71314234", "0.67257357", "0.6657688", "0.6635599", "0.6606672", "0.65896666", "0.6588926", "0.6521", "0.6484242", "0.6471821", "0.6458929", "0.64326704", "0.6411307", "0.64044803", "0.63579804", "0.6277713", "0.62653995", "0.6219611", "0.6214314", "0.6185811",...
0.7760895
0
Reload configure files and parse all options. Only options marked as 'mutable' will appear to change. Hooks are called in a NONDETERMINISTIC ORDER. Do not expect hooks to be called in the same order as they were added.
def mutate_config_files(self): self.__cache.clear() old_mutate_ns = self._mutable_ns or self._namespace self._mutable_ns = self._reload_config_files() self._warn_immutability() fresh = self._diff_ns(old_mutate_ns, self._mutable_ns) def key_fn(item): # Py3 wo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reload_config(self):\n pass", "def reload_configurations(self) -> None:\n ...", "def load_from_conf(self):\n for checkbox, (option, default) in list(self.checkboxes.items()):\n checkbox.setChecked(self.get_option(option, default))\n # QAbstractButton works differe...
[ "0.68745553", "0.6762867", "0.67564315", "0.65564734", "0.65564734", "0.65564734", "0.6516325", "0.6301534", "0.6271866", "0.62382674", "0.6125972", "0.6064127", "0.60506916", "0.6049131", "0.6016698", "0.596741", "0.5958814", "0.5926327", "0.5899636", "0.5887778", "0.5874567...
0.7228162
0
Check immutable opts have not changed. _do_get won't return the new values but presumably someone changed the config file expecting them to change so we should warn them they won't.
def _warn_immutability(self): for info, group in self._all_opt_infos(): opt = info['opt'] if opt.mutable: continue groupname = group.name if group else 'DEFAULT' try: old, _ = opt._get_from_namespace(self._namespace, groupname) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mutate_config_files(self):\n self.__cache.clear()\n\n old_mutate_ns = self._mutable_ns or self._namespace\n self._mutable_ns = self._reload_config_files()\n self._warn_immutability()\n fresh = self._diff_ns(old_mutate_ns, self._mutable_ns)\n\n def key_fn(item):\n ...
[ "0.5664764", "0.56622595", "0.5518915", "0.5443618", "0.54073", "0.5376391", "0.5347626", "0.5343356", "0.5339408", "0.5336005", "0.5327928", "0.5316939", "0.5316822", "0.52819717", "0.5263806", "0.524712", "0.51804066", "0.5166823", "0.5162186", "0.515542", "0.5121774", "0...
0.71408397
0
Compare mutable option values between two namespaces. This can be used to only reconfigure stateful sessions when necessary.
def _diff_ns(self, old_ns, new_ns): diff = {} for info, group in self._all_opt_infos(): opt = info['opt'] if not opt.mutable: continue groupname = group.name if group else None try: old, _ = opt._get_from_namespace(old_ns, g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mutate_config_files(self):\n self.__cache.clear()\n\n old_mutate_ns = self._mutable_ns or self._namespace\n self._mutable_ns = self._reload_config_files()\n self._warn_immutability()\n fresh = self._diff_ns(old_mutate_ns, self._mutable_ns)\n\n def key_fn(item):\n ...
[ "0.56138116", "0.55997956", "0.55656856", "0.55114657", "0.5509423", "0.54854023", "0.5478659", "0.544709", "0.5445873", "0.54137886", "0.54088736", "0.53872824", "0.5385281", "0.53654575", "0.5339014", "0.53189796", "0.52979785", "0.5281633", "0.5275743", "0.52694964", "0.52...
0.6053338
0
List all sections from the configuration. Returns a sorted list of all section names found in the configuration files, whether declared beforehand or not.
def list_all_sections(self): s = set([]) if self._mutable_ns: s |= set(self._mutable_ns._sections()) if self._namespace: s |= set(self._namespace._sections()) return sorted(s)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def section_list(self):\n return self._config_parser.sections()", "def get_section_names(self):\n return list(self._sections.keys())", "def _config_sections(self):\n data = []\n section_data = []\n for index, line in enumerate(self.running_config):\n if self._nextl...
[ "0.8102443", "0.7045524", "0.69549686", "0.69119966", "0.69037443", "0.6789558", "0.67123705", "0.65812343", "0.65111744", "0.64617395", "0.64489716", "0.642443", "0.6361483", "0.6334821", "0.62805927", "0.62209433", "0.6202845", "0.61661047", "0.6106681", "0.6095767", "0.609...
0.70844007
1
Return the location where the option is being set.
def get_location(self, name, group=None): opt_group = OptGroup(group) if group is not None else None value, loc = self._do_get(name, opt_group, None) return loc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_location(self):\n return self._overridden_location or self.get_default_location()", "def location(self) -> Optional[str]:\n return pulumi.get(self, \"location\")", "def location(self) -> Optional[str]:\n return pulumi.get(self, \"location\")", "def location(self) -> Optional[str]...
[ "0.6903988", "0.68077296", "0.68077296", "0.68077296", "0.67958254", "0.6782258", "0.67711407", "0.67711407", "0.67711407", "0.67711407", "0.67711407", "0.67711407", "0.67711407", "0.67711407", "0.67711407", "0.67711407", "0.67711407", "0.67711407", "0.67711407", "0.67711407", ...
0.68130344
1
Return True if key is the name of a registered opt or group.
def __contains__(self, key): return key in self._group._opts
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __contains__(self, key):\n return key in self._opts or key in self._groups", "def has_option(self, key):\n\n return key in self.__opt", "def has_option(self, key):\n if self.integration is None:\n return False\n return self.integration.has_option(f'{self.get_config_na...
[ "0.7847408", "0.7693858", "0.7045953", "0.6766539", "0.67575264", "0.65977633", "0.658752", "0.64708203", "0.6450258", "0.63809115", "0.6323196", "0.6320237", "0.623745", "0.6223753", "0.6179101", "0.6178904", "0.6129936", "0.61142755", "0.6109694", "0.60394", "0.60359406", ...
0.7788411
1
Iterate over all registered opt and group names.
def __iter__(self): for key in self._group._opts.keys(): yield key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n for key in itertools.chain(list(self._opts.keys()),\n list(self._groups.keys())):\n yield key", "def _all_opt_infos(self):\n for info in self._opts.values():\n yield info, None\n for group in self._groups.values():...
[ "0.7498136", "0.7475738", "0.7017148", "0.671733", "0.6640219", "0.65766746", "0.64068633", "0.6219975", "0.6218623", "0.6152937", "0.614937", "0.6130754", "0.6128727", "0.61218375", "0.6074151", "0.60709363", "0.60493124", "0.59369487", "0.59345245", "0.5849164", "0.58019507...
0.7567697
0
Return the number of options and option groups.
def __len__(self): return len(self._group._opts)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __len__(self):\n return len(self._opts) + len(self._groups)", "def __len__(self) -> int:\n return len(self._options)", "def __len__(self):\n return len(self.options)", "def get_num_of_choices(self) -> int:\n return len(self._choices)", "def countCmdLineFlags(options, flag):\...
[ "0.78100467", "0.7043727", "0.7009886", "0.6895047", "0.6802186", "0.6629693", "0.63553905", "0.6296944", "0.6218308", "0.61587685", "0.6127125", "0.61127216", "0.6090173", "0.60494286", "0.6040229", "0.60401887", "0.60301775", "0.60240996", "0.602239", "0.5981844", "0.595045...
0.73808205
1