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 default stylesheet for initialisation.
def _get_default_stylesheet(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_default_stylesheet(css=None):\n # delayed import to speed up time\n from sphinx.builders.html import Stylesheet\n rel = \"_static/\" + style_figure_notebook[0]\n res = [Stylesheet(rel=\"stylesheet\", filename=rel)]\n if css is not None:\n for cs in css:\n res.append(Stylesh...
[ "0.7612366", "0.71538943", "0.68552953", "0.6705769", "0.63715017", "0.62876076", "0.6276924", "0.6063882", "0.6021457", "0.599238", "0.59920126", "0.5862865", "0.58443964", "0.58114856", "0.56867677", "0.5677089", "0.561359", "0.5606028", "0.5537884", "0.55240893", "0.548393...
0.90836686
1
Toast is the floating colour legend to display when industry groups have been added. This method returns the toast component with the styled colour legend.
def _get_toast(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_log_message_color(self):\n if self.message_type == LogType.INFORMATION:\n return UIStyle.log_info_text_color\n elif self.message_type == LogType.WARNING:\n return UIStyle.log_warning_text_color\n elif self.message_type == LogType.ERROR:\n return UIStyle...
[ "0.5257114", "0.5247487", "0.51646096", "0.5055877", "0.50061303", "0.49108547", "0.48814926", "0.4858989", "0.48480874", "0.48279214", "0.48195937", "0.4759101", "0.4742276", "0.47390276", "0.47380358", "0.4732325", "0.472986", "0.47064045", "0.46838963", "0.4678632", "0.466...
0.5684839
0
Returns the default controls for initialisation.
def _get_default_controls(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_controls(self):\n\t\tcontrol_list = []\n\t\tconfig = ConfigParser.ConfigParser()\n\t\tconfig.read(\"./config.ini\")\n\t\tcontrols = config.options(\"default_controls\")\n\t\tfor c in controls:\n\t\t\ttry: control_list.append( config.get(\"default_controls\", c) )\n\t\t\texcept:\n\t\t\t\tprint \"ERROR: ...
[ "0.766934", "0.6780177", "0.67102987", "0.66357875", "0.6284056", "0.628019", "0.621974", "0.6097437", "0.6070818", "0.6061227", "0.60532206", "0.6040778", "0.6013755", "0.5995571", "0.5957354", "0.59330523", "0.5925834", "0.59165984", "0.5887465", "0.58804715", "0.5843376", ...
0.89480484
0
Gets the default stylesheet and adds the MST styling.
def _get_default_stylesheet(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_default_stylesheet(css=None):\n # delayed import to speed up time\n from sphinx.builders.html import Stylesheet\n rel = \"_static/\" + style_figure_notebook[0]\n res = [Stylesheet(rel=\"stylesheet\", filename=rel)]\n if css is not None:\n for cs in css:\n res.append(Stylesh...
[ "0.66855425", "0.6603924", "0.6506026", "0.62592185", "0.6248695", "0.608737", "0.5933665", "0.5905418", "0.5669941", "0.566091", "0.56513274", "0.5638535", "0.5500436", "0.54015076", "0.53981215", "0.5393446", "0.5332817", "0.53197426", "0.5295694", "0.5295092", "0.5271544",...
0.82121766
0
Starts a schedule to organise the desktop once a day
def schedule_start(folders): with open('./settings.txt', 'wb') as setting_file: pickle.dump(folders, setting_file) if sys.platform == 'darwin' or sys.platform == 'linux': my_cron = CronTab(user=getpass.getuser()) job = my_cron.new(command=str(sys.executable + ' ' + pwd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def startSchedule(self):\n DPxStartDinSched()", "def schedule_start(self):\n self.initialize_scheduler()", "def schedule_start(self):\n print(\"Scheduler for monitoring request is running\")\n self.initialize_scheduler()", "def start_monitor():\n monitor_enabled = config_json[e...
[ "0.73257655", "0.69387317", "0.63344073", "0.60987467", "0.6092284", "0.60867745", "0.60753965", "0.60585904", "0.5996617", "0.59959626", "0.5983267", "0.5958481", "0.5922537", "0.5806208", "0.5792331", "0.57860106", "0.57738113", "0.5754569", "0.57438713", "0.5738916", "0.57...
0.7372482
0
Verify the value is less than 700 as any exponent greater would be too large and unnecessary to calculate. Code adapted from Ashley Teufel and Claus Wilke.
def safe_calc(exponent): if exponent > 700: return sys.float_info.max else: return math.exp(exponent)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def safe_exp(value):\n try:\n ans = math.exp(value)\n except OverflowError:\n ans = float(\"inf\")\n return ans", "def dangerouslySmall(c, e):\n return e < -limit and e < (-integerLog10(abs(c))) - 1", "def test_tax_age_bracket_above_65(self):\n net_pay_age = elijah.total_calc_t...
[ "0.60527706", "0.58420205", "0.5731356", "0.57095146", "0.5680747", "0.563804", "0.5586251", "0.55581003", "0.55530256", "0.5543645", "0.5531748", "0.5525074", "0.5520125", "0.55115527", "0.5506519", "0.55041265", "0.54892987", "0.54859746", "0.5482984", "0.5479736", "0.54721...
0.69888055
0
Compact name variation (foo_bar > foobar). Used for Python bits.
def name_compact(self) -> str: return self._name.replace('_', '')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_python_name(self, name):\n # FIXME see cindex.SpellingCache\n for k, v in [('<', '_'), ('>', '_'), ('::', '__'), (',', ''), (' ', ''),\n (\"$\", \"DOLLAR\"), (\".\", \"DOT\"), (\"@\", \"_\"), (\":\", \"_\"),\n ('-', '_')]:\n if k in name: #...
[ "0.72092044", "0.70837706", "0.70017123", "0.69060445", "0.6852302", "0.6790686", "0.67368764", "0.67301154", "0.6723791", "0.6697025", "0.6687644", "0.66645944", "0.6645596", "0.66227174", "0.65600747", "0.6552142", "0.65347916", "0.65264", "0.65232784", "0.6522164", "0.6510...
0.7328212
0
Python package name (foo_bar > bafoobar).
def name_python_package(self) -> str: return f'ba{self.name_compact}'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def package_name(self):", "def get_package_name(name):\n name = _strip_package_name(name)\n return name", "def get_package_name(x):\n return re.search(r\"^(\\w|-)*\", x).group()", "def get_package_name(self):\n return self.name + '-' + self.version", "def pkg_name() -> None:\n print(\"my...
[ "0.7802671", "0.75589204", "0.74844223", "0.74083513", "0.7396375", "0.73311585", "0.72014767", "0.71992296", "0.7198206", "0.71890205", "0.7133495", "0.70935524", "0.7046587", "0.7010299", "0.6984604", "0.6965003", "0.6937701", "0.69292194", "0.69005734", "0.6784283", "0.676...
0.77707565
1
The name of our meta Python package.
def name_python_package_meta(self) -> str: return f'ba{self.name_compact}meta'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def package_name(self):", "def package_name(self) -> str:\n return pulumi.get(self, \"package_name\")", "def get_package_name(self):\n return self.name + '-' + self.version", "def get_package_name(self):\n return self.name + '-' + self.version + '-' + self.release", "def package_name(s...
[ "0.83136874", "0.80815744", "0.8010351", "0.7895029", "0.78263307", "0.76894945", "0.7307445", "0.719269", "0.7149254", "0.71328926", "0.7130444", "0.7103416", "0.70467144", "0.7021031", "0.69923323", "0.6991908", "0.6982521", "0.69714886", "0.6969627", "0.6966185", "0.694944...
0.83562034
0
The name of our Python tests package.
def name_python_package_tests(self) -> str: return f'test_{self.name}'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_name(self):\r\n parts = []\r\n if self.test.__module__ != '__main__':\r\n parts.append(self.test.__module__)\r\n if hasattr(self.test, 'im_class'):\r\n parts.append(self.test.im_class.__name__)\r\n parts.append(self.test.__name__)\r\n return '.'.joi...
[ "0.7614973", "0.7340865", "0.72238606", "0.70523906", "0.7002703", "0.69971913", "0.69915104", "0.6881626", "0.6747455", "0.67229694", "0.66461825", "0.6642513", "0.6629779", "0.66168725", "0.6610189", "0.66076714", "0.6606683", "0.65378916", "0.6522058", "0.6521821", "0.6507...
0.87345755
0
Python binary module name (foo_bar > _bafoobar).
def name_python_binary_module(self) -> str: return f'_ba{self.name_compact}'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def module_name(self):\n return \"py{0:s}\".format(self.library_name[3:])", "def get_binary_name():\n return os.path.basename(inspect.stack()[-1][1])[:16]", "def _get_module_name(filename: str) -> str:\n return \".\".join(_get_relative(filename).split(os.path.sep)[2:]).replace(\".pyi\", \"\").replace(...
[ "0.7546075", "0.7114579", "0.6999545", "0.6886598", "0.6764898", "0.6624938", "0.66246974", "0.657698", "0.6512699", "0.65046734", "0.65046734", "0.6479276", "0.6373066", "0.6355679", "0.61710465", "0.6162536", "0.6161039", "0.61425453", "0.61399764", "0.6135938", "0.61155504...
0.82277036
0
Validate a standard snakecase featureset name. Throws descriptive CleanErrors if provided name is invalid.
def validate_name(name: str) -> None: # Disallow empty. if not name: raise CleanError('Feature set name cannot be empty.') # Require starting with a letter. if not name[0].isalpha(): raise CleanError( f"Invalid feature set name '{name}'" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_name_must_be_capitalized(self):\n form = self.make_validator_form(name='PATRICK alves')\n # O cleaned_data é um dicionário que armazena todos os valores do\n # formulários já validados\n self.assertEqual('Patrick Alves', form.cleaned_data['name'])", "def validate_names(name):...
[ "0.6528864", "0.64682025", "0.64260954", "0.64159584", "0.63975006", "0.6374721", "0.6373527", "0.63026065", "0.62711906", "0.6178945", "0.6118398", "0.6058018", "0.60236096", "0.6016193", "0.6013604", "0.59900844", "0.59703535", "0.59681535", "0.596218", "0.59524107", "0.594...
0.8318447
0
Return all featuresets for the current project.
def get_all_for_project(cls, project_root: str) -> list[FeatureSet]: project_root_abs = os.path.abspath(project_root) # Only do this once per project. if project_root_abs not in _g_feature_sets: _g_feature_sets[project_root_abs] = _build_feature_set_list( project_roo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_feature_sets(self, exclude=None):\n\n # Create list containing features per dataframe as sets\n feat_sets = [set(df) for df in self]\n # exclude unwanted features\n if exclude:\n feat_sets = [df_set.difference(exclude) for df_set in feat_sets]\n\n return feat_s...
[ "0.68803585", "0.67854035", "0.6417478", "0.6407367", "0.63556254", "0.6232964", "0.621337", "0.6193179", "0.6169055", "0.604998", "0.60312", "0.6023309", "0.59618753", "0.5951713", "0.5950332", "0.5944593", "0.59377426", "0.5859368", "0.5852736", "0.58499783", "0.5808731", ...
0.77272886
0
Resolve all required featuresets based on a given set of them. Throws descriptive CleanErrors if any are missing.
def resolve_requirements( cls, featuresets: list[FeatureSet], reqs: set[str] ) -> set[str]: fsets = {f.name: f for f in featuresets} reqs_out = set[str]() for req in reqs: cls._resolve_requirements(fsets, reqs_out, req) return reqs_out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_supported_feature_sets(flags) -> List[str]:\n\n # find all supported feature sets\n supported = []\n for one_feature_set in sorted(REQUIRED_FEATURES.keys()):\n if supports_feature_set(flags, one_feature_set):\n supported.append(one_feature_set)\n return supported", "def feat...
[ "0.5816875", "0.5670274", "0.55299795", "0.5424976", "0.5307449", "0.5194688", "0.5172353", "0.5112441", "0.5104348", "0.5083573", "0.50816107", "0.5043048", "0.5033401", "0.5017118", "0.50144035", "0.50140226", "0.49766505", "0.497452", "0.49236235", "0.48342466", "0.4815203...
0.7123226
0
Check if a collectible was collected
def checkCollection(self, collectible, objectGroup, collectionType): if isinstance(collectible, SpriteGroup): for collectibleItem in collectible: self.checkCollection(collectibleItem, objectGroup, collectionType) return if not isinstance(collectible, GameCollecti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_be_collected(self):\n return True", "def is_collecting(self) -> bool:\n return self.orders and self.orders[0].ability.id in {AbilityId.HARVEST_GATHER, AbilityId.HARVEST_RETURN}", "def _memocollect(self):\n return self._memoizedcall('_collected', self.collect)", "def collect(self,...
[ "0.801737", "0.6463925", "0.59672666", "0.5924895", "0.5883728", "0.5679102", "0.5631183", "0.549886", "0.53650904", "0.5328696", "0.52748203", "0.5273568", "0.52670014", "0.52434397", "0.524142", "0.524142", "0.52371", "0.5186041", "0.51766354", "0.5151708", "0.51407593", ...
0.65038925
1
Obtaining creds based on Service account scenario
def _obtain_service_account_creds(self) -> service_account.Credentials: credentials_json = self._raw_credentials.get("credentials_json") admin_email = self._raw_credentials.get("email") account_info = self._load_account_info(credentials_json) creds = service_account.Credentials.from_serv...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_credentials():\n return ServiceAccountCredentials.from_json_keyfile_dict(SERVICE_ACCOUNT, scopes = SCOPES)", "def get_credentials():\n # Get the credential\n if os.path.exists(os.getenv(\"GCP_AUTOMATION_CONFIG\")):\n credential_location = os.getenv(\"GCP_AUTOMATION_CONFIG\")\n with...
[ "0.70070016", "0.6854385", "0.6802494", "0.67998236", "0.6595801", "0.6574853", "0.6565174", "0.6560746", "0.65402925", "0.6524312", "0.65098447", "0.65069044", "0.6385952", "0.6383993", "0.6376316", "0.63596356", "0.6358337", "0.63353604", "0.6328066", "0.6303917", "0.628187...
0.7083937
0
Parse the ASSETMAP. Extract the id, path, volume index, offset and length for each asset, and the validate the paths of the downloaded files against the paths from the ASSETMAP file.
def parse(self): try: self.validate() except Exception as e: raise AssetmapError(e) tree = ET.parse(self.path) root = tree.getroot() # ElementTree prepends the namespace to all elements, so we need to extract # it so that we can perform sensible s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ProcessAsl(self):\n for entry in self.info:\n if self.info[entry]['type'] == 'asl':\n if self.verbose:\n print 'Processing ASL data in %s' % os.path.basename(entry)\n cmd = 'convert_file %s %s %s' % (entry, \\\n self.info[...
[ "0.53743875", "0.53447956", "0.5330288", "0.5124707", "0.5091952", "0.49572468", "0.4952503", "0.49349928", "0.4925209", "0.4908599", "0.48845872", "0.48748866", "0.4862467", "0.4831969", "0.48251778", "0.4807871", "0.4794465", "0.47831804", "0.47804418", "0.47712243", "0.473...
0.7702807
0
Call the validate_xml function in util to validate the xml file against the schema.
def validate(self, schema=os.path.join(os.path.dirname(__file__), 'am.xsd')): return validate_xml(schema, self.path, from_path=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate(self, xmlfilename):\n\t\tdata = open(self.xsdfilename, 'rb') \n\t\tschema_root = etree.XML(data.read())\n\t\tschema = etree.XMLSchema(schema_root)\n\t\txmlparser = etree.XMLParser(schema=schema)\n\t\ttry:\n\t\t\twith open(xmlfilename, 'rb') as f:\n\t\t\t\tetree.fromstring(f.read(), xmlparser)\n\t\t\tp...
[ "0.7257575", "0.703743", "0.70065236", "0.69398814", "0.69287056", "0.68658084", "0.6804349", "0.67123705", "0.6704274", "0.6661033", "0.6616021", "0.6581538", "0.64962155", "0.64928204", "0.6456374", "0.645341", "0.63339424", "0.62629205", "0.61588585", "0.61291087", "0.6109...
0.76123047
0
Check the paths of the downloaded files against the paths specified in the ASSETMAP file.
def validate_files(self, dcp_path): for asset_data in self.assets.itervalues(): full_path = os.path.join(dcp_path, asset_data.path) if not os.path.isfile(full_path): raise AssetmapValidationError("File not found: {0}".format(full_path))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_paths(self) -> None:\n bad_keys = []\n for key, path in self.paths.items():\n # we only check specified paths, and drop them otherwise\n if path is not None:\n if isinstance(path, str):\n path = Path(path)\n if not path...
[ "0.6088639", "0.5996096", "0.5901346", "0.5755525", "0.5755525", "0.57543945", "0.5746286", "0.57071006", "0.57020295", "0.5658305", "0.5655015", "0.5637754", "0.5578904", "0.5575141", "0.5564971", "0.55589986", "0.5548486", "0.5547291", "0.5497737", "0.5492473", "0.5478081",...
0.64971614
0
return a DataFrame with the mean and maximum rainfall by day of year
def aggregate_data(df: pd.DataFrame, timescale: str = 'day'): return df.groupby(timescale)['rain'].agg(['max', 'mean'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDayMeans(gdf,\r\n year_min,month_min,day_min,\r\n year_max,month_max,day_max,\r\n Long_min,Long_max,\r\n Lat_min,Lat_max,\r\n ValueName,Error_name = '',UnCorr_name=''):\r\n output_all = gdf[(gdf.Date >= datetime.date(year_min...
[ "0.6231592", "0.6204572", "0.6055584", "0.59300655", "0.5737968", "0.5690061", "0.564241", "0.5627225", "0.5584849", "0.55523795", "0.55365604", "0.55314213", "0.5527125", "0.54895324", "0.5480004", "0.5471478", "0.54222876", "0.54027545", "0.540115", "0.5396308", "0.5371288"...
0.6215351
1
check if values in `df` are higher than those in `df2`.
def record_high(df, df2, agg='max'): if agg == 'max': return df[df['max'] > df2['max']].drop('mean', axis=1) elif agg == 'mean': return df[df['mean'] > df2['mean']].drop('max', axis=1) else: raise ValueError('unknown test')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isLessEqual(df1, df2):\n indices = list(set(df1.index).intersection(df2.index))\n dff1 = df1.loc[indices, :]\n dff2 = df2.loc[indices, :]\n df = dff1 - dff2\n df_tot = df.applymap(lambda v: v <= 0)\n result = df_tot.sum().sum() == df.size\n return result", "def eq(df1, df2, precision=0.5) -> bool:\n ...
[ "0.7089077", "0.65464246", "0.6446613", "0.6308537", "0.62558085", "0.62524134", "0.6236358", "0.616724", "0.61446786", "0.61343825", "0.6126738", "0.60659033", "0.60639274", "0.6008289", "0.59934646", "0.5992191", "0.5976035", "0.59452075", "0.59068024", "0.5898108", "0.5892...
0.66314673
1
get the start and end years from a DataFrame
def get_start_end_years(df: pd.DataFrame) -> Tuple[int, int]: return df.iloc[0].year, df.iloc[-1].year
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def year_range(df):\n\n if not isinstance(df, pd.DataFrame):\n print(\"year_range was not passed a pandas DataFrame.\")\n return\n\n df['year_start'] = df['year'].min()\n df['year_end'] = df['year'].max()\n df.drop('year' , axis = 1, inplace = True)\n return df", "def grab_by_year(da...
[ "0.7826247", "0.7017622", "0.6697128", "0.66366935", "0.6628828", "0.6628049", "0.6550676", "0.65276664", "0.64672714", "0.6382625", "0.6288827", "0.6258033", "0.6226718", "0.62136394", "0.6213179", "0.6179827", "0.612485", "0.61044294", "0.6085206", "0.6076908", "0.6065222",...
0.8673896
0
Given a dict of backlinks and target node, follow backlinks to root node (whose backlink is None)
def get_path(backlinks, target): path = [] path_node = target while path_node is not None: path.append(path_node) path_node = backlinks.get(path_node, None) return list(reversed(path))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def digraph_walker_backwards(graph, element, call_back):\r\n call_back(graph, element)\r\n for predecessor in graph.predecessors(element):\r\n call_back(graph, predecessor)\r\n for predecessor in graph.predecessors(element):\r\n digraph_walker_backwards(graph, predecessor, call_back)", "de...
[ "0.5648151", "0.5488971", "0.54664606", "0.5310924", "0.52912784", "0.5289262", "0.5274313", "0.5230764", "0.52206784", "0.51807314", "0.5165986", "0.5156442", "0.5133577", "0.5111778", "0.5108086", "0.51073754", "0.50598913", "0.5047111", "0.5039473", "0.50038743", "0.499000...
0.6177677
0
select a node with probability proportional to its "weight"
def select(weights): r = random.random() * sum(weights) s = 0.0 for k,w in enumerate(weights): s += w if r <= s: return k raise RuntimeError("select WTF from %s" % weights)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def selection_wheel(self, weighted_population):\n weight_total = sum((item[1] for item in weighted_population))\n n = random.uniform(0, weight_total)\n for item, weight in weighted_population:\n if n < weight:\n return item\n n = n - weight\n return ...
[ "0.65005463", "0.6445915", "0.64428365", "0.6432262", "0.6391787", "0.6374304", "0.62815565", "0.62567943", "0.6231263", "0.620618", "0.6164405", "0.6152822", "0.6147155", "0.6115305", "0.60935456", "0.609052", "0.6071665", "0.6063455", "0.60628206", "0.6059221", "0.6043407",...
0.67206573
0
Modifies a string to determine the correct case for each individual character in the string. A character will be uppercase if the bit representing it in the iteration value is set to 1. For example, the string "hello" with an iteration of 3 would be return "HEllo".
def case_iteration(header, iteration): if iteration <= 0: return header.lower() chars = [] removed = [] # First create lists of workable and unworkable characters for i, char in enumerate(header): if char not in string.ascii_letters: removed.append({"char": char, "pos":...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def case_i(string: str) -> str:\n return \"\".join(\"[\" + c.upper() + c.lower() + \"]\"\n if c.isalpha() else c for c in re.escape(string))", "def ReplaceCapitals(string):\n\n newString = \"\"\n for char in string:\n if char.isupper():\n newString += \"_%s\"%char.lo...
[ "0.72456825", "0.7035167", "0.6963037", "0.6683893", "0.6570315", "0.65661544", "0.6561868", "0.65565664", "0.65565664", "0.65565664", "0.65565664", "0.6546514", "0.6458094", "0.6431306", "0.6342048", "0.6290183", "0.6276903", "0.6270719", "0.625104", "0.6237894", "0.6229199"...
0.7466728
0
Return the GeoDataFrame geometry coordinates as list. >>> from shapely.geometry import LineString >>> geo_dataframe_to_list(gpd.GeoDataFrame(geometry=[LineString([(0, 0), (1, 1)])])) [[(0.0, 0.0), (1.0, 1.0)]]
def geo_dataframe_to_list(data_frame, polygon=False): to_return = [] for line in data_frame.geometry: lines = [] if polygon: for values in line.exterior.coords: lines.append(values) else: for values in line.coords: lines.append(valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geom_as_list(geometry):\n if geometry.geom_type == \"Polygon\":\n return [geometry]\n elif geometry.geom_type == \"MultiPolygon\":\n return geometry.geoms", "def _tolist(data, name='sources'):\n\tmsg = 'contains geometries that are not points'\n\tif isinstance(data, (list, tuple)):\n\t\ti...
[ "0.73027647", "0.67995375", "0.6595124", "0.6595124", "0.6595124", "0.65617627", "0.6501597", "0.6494119", "0.6448384", "0.639071", "0.6296989", "0.6264255", "0.6244541", "0.62118316", "0.6195807", "0.6195759", "0.6193018", "0.611168", "0.6107985", "0.6086046", "0.6048354", ...
0.8569541
0
Normalize slack based on unit vector of line.
def normalize_slack(unit_vector: np.ndarray, slack: int) -> int: sqrt_two = 1 / np.sqrt(2) max_val = abs(abs(sqrt_two) + abs(sqrt_two)) min_val = 1 a = unit_vector[0] b = unit_vector[1] diff = abs(abs(a) + abs(b)) inverse_weight = minmax_scale( [min_val, diff, max_val], feature_range...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_vector(line):\n if isinstance(line, pd.DataFrame):\n line = line.values\n try:\n n = np.sqrt(line[:, 0]**2 + line[:, 1]**2).reshape(-1, 1)\n except:\n n = np.sqrt(line[0]**2 + line[1]**2)\n line = line / n\n return line", "def normalize_l2(x):\n return x / (np...
[ "0.6656875", "0.6343031", "0.62964976", "0.61440474", "0.60583997", "0.6046406", "0.60433424", "0.6031524", "0.6007217", "0.5994561", "0.5986066", "0.5934934", "0.5921113", "0.59105307", "0.5890694", "0.5888642", "0.5873673", "0.5871411", "0.58642465", "0.584027", "0.58154416...
0.7518934
0
Determine ratio to transform real units to pixels. >>> determine_real_to_pixel_ratio((155, 155), 0, 0, 100, 100) 1.55
def determine_real_to_pixel_ratio( image_shape: Tuple[int, int], min_x: float, min_y: float, max_x: float, max_y: float, ): image_x = image_shape[1] image_y = image_shape[0] diff_x = max_x - min_x diff_y = max_y - min_y resolution_x = image_x / diff_x resolution_y = image_y ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_meters_to_pixels_coefficient():\n return 1/get_pixels_to_meters_coefficient()", "def get_scaling_ratio(img):\n\n healthy_img_area = 4872 * 6496\n input_img_area = img.shape[0] * img.shape[1]\n ratio = input_img_area / healthy_img_area\n return ratio", "def pixel_size_ratio(self):\n ...
[ "0.57218885", "0.5695205", "0.56670064", "0.5639818", "0.5583204", "0.55717343", "0.54913086", "0.54902655", "0.5475159", "0.54592144", "0.5391389", "0.5386133", "0.5377819", "0.5377819", "0.5377819", "0.5377819", "0.5377819", "0.5377819", "0.5377819", "0.5377819", "0.5377819...
0.7477013
0
Return a binary matrix where 1s correspond to the coordinates in the dataframe. Slack determines how accurately the pixels in return array are turned into 1s. I.e. it is equivalent to a buffer around each trace. The higher abs(slack) the more "rounded" the areas. >>> from shapely.geometry import LineString, box >>> geo...
def geo_dataframe_to_binmat( data_frame: gpd.GeoDataFrame, dims, relative_geo_data: gpd.GeoDataFrame, slack: int = 0, ): def append_coord_list( coord_list: List[Tuple[int, int]], line_string: LineString, convert_x: Callable, convert_y: Callable, ): x_list...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _grid_points_to_binary_image(\n rows_in_object, columns_in_object, num_grid_rows, num_grid_columns):\n\n binary_image_matrix = numpy.full(\n (num_grid_rows, num_grid_columns), False, dtype=bool)\n binary_image_matrix[rows_in_object, columns_in_object] = True\n return binary_image_matrix"...
[ "0.5656183", "0.5549513", "0.52041864", "0.49339083", "0.492434", "0.49073893", "0.49058205", "0.49001232", "0.48872524", "0.4862354", "0.48543525", "0.48536086", "0.48409858", "0.4837322", "0.481904", "0.4791744", "0.4698955", "0.4665087", "0.4663252", "0.46290466", "0.46201...
0.74961513
0
Longrunning task in 5 steps.
def runLongTask(self): for i in range(5): sleep(1) self.reportProgress(i + 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def task5(self):\n\n pass", "def task():", "def task_func(num_loops):\n for _ in range(num_loops):\n time.sleep(0.01)\n task_result['count'] += 1\n task_result['completed'] = True", "def tasks():", "def long_task(self):\n verb = ['Starting up', ...
[ "0.67212135", "0.6318764", "0.6315987", "0.6208478", "0.59078443", "0.59078443", "0.59078443", "0.59078443", "0.59078443", "0.58665955", "0.5830901", "0.5830901", "0.57990795", "0.5777676", "0.5777676", "0.5771104", "0.57677716", "0.57324564", "0.5663045", "0.5638576", "0.562...
0.7404947
0
Price data for the requested assets, update automatically. This function will return a cached copy of the asset prices unless its time to fetch fresh data. We'll use the REFRESH_RATE environment variable to determine if it's time to refresh data.
def price_data(self): # Determine if the cache is stale cache_is_stale = (time.time() - self._last_fetch_time) > self.refresh_rate # See if we should return the cached price data if self._cached_price_data and not cache_is_stale: logger.info('Using cached price data.') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def poll_price_data():\n resp = requests.get(COINDESK_ENDPOINT) # Powered by CoinDesk\n if resp.status_code == 200:\n logging.info(\"GET request succeeded\")\n data = resp.json()\n data_dict = {\n \"id\": str(uuid.uuid1()),\n \"time\": data['time']['updated'],\n ...
[ "0.62359464", "0.6235423", "0.6201182", "0.61914015", "0.5995575", "0.5969635", "0.59436256", "0.58941567", "0.5737649", "0.5686681", "0.56745803", "0.55970454", "0.55837536", "0.5576935", "0.55695647", "0.5507921", "0.55015045", "0.5497846", "0.54641825", "0.54590416", "0.54...
0.74335635
0
Build the ticker canvas given an asset
def get_ticker_canvas(self, asset): # Generate a fresh canvas canvas = self.matrix.CreateFrameCanvas() canvas.Clear() # Create fonts for displaying prices font_symbol = graphics.Font() font_symbol.LoadFont('fonts/7x13.bdf') font_price = graphics.Font() f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_graph(self, ticker):\r\n mc = mpf.make_marketcolors(up='#00c223', down='#e83c3c', inherit=True, )\r\n custom_style = mpf.make_mpf_style(marketcolors=mc, gridstyle='dotted', rc={'font.size': 500})\r\n\r\n file_format = tk.IntVar()\r\n frame = tk.Frame(self)\r\n frame....
[ "0.56376857", "0.55300814", "0.5274521", "0.5206839", "0.51505625", "0.51411843", "0.51057196", "0.5099484", "0.50795835", "0.50159657", "0.50159657", "0.50159657", "0.49279717", "0.4845161", "0.48440674", "0.48408684", "0.4836014", "0.48273098", "0.48027334", "0.4793942", "0...
0.75880075
0
Build an error canvas to show on errors
def get_error_canvas(self): canvas = self.matrix.CreateFrameCanvas() canvas.Clear() font = graphics.Font() font.LoadFont('../rpi-rgb-led-matrix/fonts/7x13.bdf') color = graphics.Color(194, 24, 7) graphics.DrawText(canvas, font, 15, 20, color, 'ERROR') return canva...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error():\n\n # Make data set using errors\n dataset_a = DataSet(oscillating,error_y=oscillating_error,plot='error_bar',label='Data and error')\n dataset_a.set_error(interval=5,width=1,cap=2)\n dataset_b = DataSet(oscillating,plot='error_shade',error_y=oscillating_error,order=0,colour='lightgrey',la...
[ "0.71648633", "0.69945556", "0.63856214", "0.6350546", "0.6101287", "0.60539216", "0.6037241", "0.6001505", "0.5964424", "0.59381825", "0.58647335", "0.58630085", "0.5833194", "0.5773308", "0.57699627", "0.57670736", "0.5765603", "0.56721157", "0.56712943", "0.5667362", "0.56...
0.75534284
0
Generator method that yields assets infinitely. Since it uses `self.price_data` it will always return the latest prices, respecting the REFRESH_RATE.
def get_assets(self): # The size of the price_data list should not change, even when updated price_data_length = len(self.price_data) for index in itertools.cycle(range(price_data_length)): try: yield self.price_data[index] except IndexError: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ticker_generator():\n return (v for v in load_equities().values)", "def price_data(self):\n # Determine if the cache is stale\n cache_is_stale = (time.time() - self._last_fetch_time) > self.refresh_rate\n\n # See if we should return the cached price data\n if self._cached_price...
[ "0.60698056", "0.583853", "0.5758215", "0.56412697", "0.5631402", "0.55540204", "0.5479603", "0.54297745", "0.5417542", "0.5366437", "0.5348646", "0.53434026", "0.5329076", "0.5299541", "0.5253494", "0.52528137", "0.524483", "0.5216345", "0.5192477", "0.5185164", "0.5173073",...
0.71537364
0
Cosine pulse generating function
def cosine(x, period=10.0, start_phase=0.0, name=''): return sine(x, period, start_phase + np.pi/2, name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initiatecos(width, x0):\n y = np.cos((x-x0)*np.pi/width)\n for i in range(xsize):\n if x[i]<-width/2. or x[i]>width/2.:\n y[i] = 0\n return y", "def trans(x):\r\n return np.arccos(1-2*x)", "def accPulse (t,Dp,t1,Tp):\r\n\tdiscretePulse=-(Dp*math.pi**2)/(float(2)*Tp**2)*np.sin(...
[ "0.61798626", "0.6140709", "0.6071488", "0.6045542", "0.60245466", "0.6011503", "0.59842557", "0.59655726", "0.5922175", "0.590323", "0.5898829", "0.589867", "0.5871508", "0.5859501", "0.58440024", "0.5836109", "0.58257824", "0.57952887", "0.5793671", "0.57907647", "0.578821"...
0.6633522
0
Given x, y ,create a corresponding dictionary package.
def packer(x, y, variables={}, appendRule=[True, True], name=''): properties = { 'name': name, 'variables': variables, 'x': x, 'y': y, 'appendRule': appendRule } return properties
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, x: Bn, X1: G1Element, y: Dict[str, Bn]):\n self.x = x\n self.X1 = X1\n self.y = y", "def hotelling_dict(x, y=None, bessel=True):\n t2_stat, f_stat, p_value, s = hotelling_t2(x, y, bessel)\n return dict(t2_stat=t2_stat, f_stat=f_stat, p_value=p_value, pooled_var=s)", ...
[ "0.59778416", "0.5780195", "0.57800084", "0.55100757", "0.5426242", "0.5424647", "0.5411364", "0.53972995", "0.53143847", "0.53103423", "0.53089607", "0.5308609", "0.52735543", "0.5211334", "0.5186195", "0.51677966", "0.51639503", "0.5146656", "0.5129476", "0.5121083", "0.512...
0.6179001
0
Decorate a function to ensure all processor get the same returns in MPI environment. After decoration, only processor 0 runs and then bcast result to all other processors.
def mpisync(func, comm=MPI.COMM_WORLD): def mpifunc(*args, **kwargs): if comm.Get_rank() == 0: res = func(*args, **kwargs) else: res = None res = comm.bcast(res, root=0) return res return mpifunc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_add_processor_wrapper_override(caplog):\n\n testapp = holocron.Application()\n marker = None\n\n def processor(app, items):\n yield from items\n\n def processor_wrapper_a(app, items, processor):\n nonlocal marker\n marker = 42\n yield from app.invoke([processor])\n\...
[ "0.59892446", "0.5823251", "0.578183", "0.5740165", "0.5726525", "0.5721768", "0.5658518", "0.55888045", "0.55763066", "0.55297124", "0.5499596", "0.546849", "0.546835", "0.546068", "0.54011464", "0.53454393", "0.52274793", "0.5171449", "0.5110456", "0.50790656", "0.50727296"...
0.6195927
0
Test partition of global matrix to local blocks
def test_partition(self): mat = self.mat self.assertSequenceEqual( [mat.m, mat.n, mat.shape[2], mat.shape[3], mat.dtype], [self.m, self.n, self.p, self.q, self.dtype] ) if not mat.is_active: self.assertSequenceEqual( [mat.mloc, mat.msta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_44():\n def block_array(a, rows=3, cols=4, col_first=True, nodata=-1):\n \"\"\" a variant on array_split\n requires a N*m array\n \"\"\"\n s = np.array(a.shape)\n w = np.array([rows, cols])\n m = divmod(s, w)\n new_shape = w*m[0] + w*(m[1]!=0)\n yp...
[ "0.57724035", "0.56319845", "0.5593753", "0.5501332", "0.54796", "0.545134", "0.54132617", "0.5396879", "0.53927976", "0.53756773", "0.5371264", "0.5370682", "0.5353141", "0.53522795", "0.5345777", "0.531631", "0.5298214", "0.5293086", "0.5290374", "0.52791387", "0.5278845", ...
0.6354414
0
Overwrite hash operator for use with pandas objects.
def __hash__(self): hashable = tuple(self.pandas_object.values.tobytes()) if isinstance(self.pandas_object, pd.DataFrame): hashable += tuple(self.pandas_object.columns) else: hashable += tuple(self.pandas_object.name) return hash(hashable)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_pandas_hash(val):\n return PandasHash(val) if isinstance(val, pd.DataFrame) else val", "def hash_pandas_object(\n obj: Index | DataFrame | Series,\n index: bool = True,\n encoding: str = \"utf8\",\n hash_key: str | None = _default_hash_key,\n categorize: bool = True,\n) -> Series:\n ...
[ "0.69685143", "0.66122323", "0.6510842", "0.63720214", "0.6320213", "0.6320213", "0.6234773", "0.6182048", "0.6134328", "0.6083319", "0.60784006", "0.6055297", "0.60447973", "0.6031913", "0.5970905", "0.5944961", "0.5929581", "0.5887661", "0.58601254", "0.5856895", "0.5835120...
0.7206795
0
Check if specified columns have the same base dtypes across both DataFrames.
def has_same_base_dtype(df_1, df_2, columns=None): if columns is None: if any(set(df_1.columns).symmetric_difference(set(df_2.columns))): print( "Cannot test all columns because they are not all shared across DataFrames" ) return False columns = df...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checktypestest(chosen_df):\n for i in chosen_df:\n if not chosen_df.dtypes[1] == chosen_df.dtypes[i]:\n raise ValueError('Types do not match')", "def _assert_dtypes(self, other: 'PlainFrame'):\n\n left_dtypes = {column.name: column.dtype\n for column in self....
[ "0.7408321", "0.71147156", "0.6641731", "0.65087014", "0.63816726", "0.6321202", "0.629999", "0.6283512", "0.6265409", "0.6262452", "0.6251955", "0.6239271", "0.6219968", "0.6186627", "0.6135912", "0.6122012", "0.61172754", "0.6110978", "0.60853505", "0.60832155", "0.6078434"...
0.8694105
0
Check columns of DataFrame inputs. This includes the checks on 1. whether the input columns exist in the input DataFrames. 2. whether the data types of col_user as well as col_item are matched in the two input DataFrames.
def check_column_dtypes(func): @wraps(func) def check_column_dtypes_wrapper( rating_true, rating_pred, col_user=DEFAULT_USER_COL, col_item=DEFAULT_ITEM_COL, col_rating=DEFAULT_RATING_COL, col_prediction=DEFAULT_PREDICTION_COL, *args, **kwargs ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkcolumnstest(chosen_columns, chosen_df):\n if not all([item in chosen_columns for item in chosen_df.columns]):\n raise ValueError('Columns do not match')", "def _check_columns(df: pd.DataFrame, names: typing.Sequence[str]) -> None:\n for expected in names:\n if expected not in df.colu...
[ "0.7297595", "0.7219656", "0.6985565", "0.6940473", "0.68711317", "0.67589295", "0.67561454", "0.6635416", "0.65715855", "0.6518252", "0.65078294", "0.6379187", "0.6378104", "0.63751537", "0.63514984", "0.6336134", "0.6325551", "0.62211627", "0.62177145", "0.6204443", "0.6203...
0.72755945
1
Return PandaHash object if input is a DataFrame otherwise return input unchanged.
def to_pandas_hash(val): return PandasHash(val) if isinstance(val, pd.DataFrame) else val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_pandas_hash(val):\n return val.pandas_object if isinstance(val, PandasHash) else val", "def __hash__(self):\n hashable = tuple(self.pandas_object.values.tobytes())\n if isinstance(self.pandas_object, pd.DataFrame):\n hashable += tuple(self.pandas_object.columns)\n ...
[ "0.72663486", "0.63530517", "0.5911948", "0.5852822", "0.58434385", "0.5614876", "0.5448136", "0.5297867", "0.5278967", "0.52182263", "0.51952344", "0.5191671", "0.5180135", "0.51582223", "0.51481515", "0.5144734", "0.5135141", "0.50788695", "0.5053674", "0.5035852", "0.49951...
0.7050849
1
Extract DataFrame if input is PandaHash object otherwise return input unchanged.
def from_pandas_hash(val): return val.pandas_object if isinstance(val, PandasHash) else val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_frame(self, arg=None):\n if arg is None:\n return pl.DataFrame()\n if isinstance(arg, pl.DataFrame):\n return arg\n if isinstance(arg, pl.LazyFrame):\n return arg.collect()\n return pl.DataFrame(arg)", "def from_object(cls, input_object, copy_...
[ "0.60082215", "0.5908675", "0.57271177", "0.566998", "0.5632717", "0.55908114", "0.55680734", "0.5502315", "0.54927725", "0.54608554", "0.5424388", "0.54204285", "0.54083925", "0.5380768", "0.5374433", "0.5349548", "0.53432214", "0.53338194", "0.53303623", "0.53286755", "0.53...
0.68835825
0
Calculate the logloss metric. Calculate the logloss metric for implicit feedback typed recommender, where rating is binary and prediction is float number ranging from 0 to 1.
def logloss( rating_true, rating_pred, col_user=DEFAULT_USER_COL, col_item=DEFAULT_ITEM_COL, col_rating=DEFAULT_RATING_COL, col_prediction=DEFAULT_PREDICTION_COL, ): y_true, y_pred = merge_rating_true_pred( rating_true=rating_true, rating_pred=rating_pred, col_user=co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logloss(self,tple):\n feats = self.dataset.input_features\n res = 0\n cc = self.class_counts\n fc = self.feature_counts\n for c in range(self.num_classes):\n res += prod(fc[i][feat(tple)][c]\n for (i,feat) in enumerate(feats))/(cc[c]**(len(fe...
[ "0.72008324", "0.70512086", "0.69764256", "0.6916149", "0.6830032", "0.6809137", "0.677975", "0.6727248", "0.67057824", "0.6705693", "0.667858", "0.6667303", "0.65973073", "0.6578052", "0.65646046", "0.65525097", "0.65485096", "0.65409243", "0.65386796", "0.65288085", "0.6527...
0.74137414
0
Get the input customeritemrating tuple in the format of Pandas. DataFrame, output a Pandas DataFrame in the dense format of top k items for each user.
def get_top_k_items( dataframe, col_user=DEFAULT_USER_COL, col_rating=DEFAULT_RATING_COL, k=DEFAULT_K ): # Sort dataframe by col_user and (top k) col_rating top_k_items = ( dataframe.groupby(col_user, as_index=False) .apply(lambda x: x.nlargest(k, col_rating)) .reset_index(drop=True)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_item_based_topk(self, items, top_k=10, sort_top_k=False):\n\n # convert item ids to indices\n item_ids = items[self.col_item].map(self.item2index)\n\n # if no ratings were provided assume they are all 1\n if self.col_rating in items.columns:\n ratings = items[self.col...
[ "0.76997507", "0.7033235", "0.6871656", "0.6757518", "0.648818", "0.6308447", "0.62011886", "0.6135281", "0.60730785", "0.60105807", "0.5873768", "0.58291805", "0.58223766", "0.58178335", "0.581585", "0.581476", "0.5809048", "0.57145905", "0.5685763", "0.56792456", "0.5619674...
0.7610045
1
Changes the token of the corresponding metaboard label
def assign_token(self, frame): print(str(frame))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def token(self, value):\r\n self._token = value", "async def token(self, token):\n # [p]set token <token>\n\n if len(token) < 50:\n await self.bot.say(\"Invalid token.\")\n else:\n CacheAPI.set(key='dwarf_token', value=token, timeout=None)\n await self...
[ "0.6168763", "0.6022221", "0.59754705", "0.59754705", "0.5901143", "0.576621", "0.5724145", "0.56781507", "0.5577876", "0.5548934", "0.5504071", "0.55032206", "0.54323393", "0.53948724", "0.53948724", "0.53948724", "0.53948724", "0.53948724", "0.53874254", "0.5360425", "0.534...
0.6059372
1
Gets the number of votes for the user in the current time period
def get_user_votes(user_id: int) -> int: session = Session() # get user by id to ensure user exists get_user_by_id(user_id) # count votes for the user that haven't expired user_votes: int = session.query(Vote)\ .filter(Vote.user_id == user_id)\ .filter(Vote.vote_expiry > datetime.da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nay_voter_cnt(self):\n\n return len(self._nay_voters())", "def count_votes(self):\n return self.annotate(sum=Sum('value'))", "def vote_count(self):\n return QuestionVotes.objects.filter(question=self).count()", "def count_upvotes(self):\n return self.filter(value=1).count()", ...
[ "0.6736549", "0.6720337", "0.6686188", "0.66822815", "0.66710454", "0.6633917", "0.64099306", "0.6256817", "0.6232871", "0.61680764", "0.61316186", "0.6032293", "0.5953367", "0.5953367", "0.592545", "0.5907419", "0.5899787", "0.5866186", "0.5854506", "0.5841369", "0.5812565",...
0.7320272
0
Checks whether the user has made their alotted suggestions.
def check_user_suggestion(user_id: int) -> bool: user = get_user_by_id(user_id) if not user.suggestion_expiry: return True if (datetime.datetime.now() > user.suggestion_expiry): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seesSuggestions(self):\n return self.floor.owner == self.user and self.floor.permissiveness == \"permissive\"", "def _validate_has_suggestion(cls, item):\n if not item.has_suggestion:\n suggestion_model = (\n suggestion_models.GeneralSuggestionModel.get_by_id(item.id))...
[ "0.7264127", "0.6384408", "0.6201536", "0.59286994", "0.58816457", "0.58173037", "0.5709878", "0.57058215", "0.5687286", "0.56222606", "0.55829567", "0.5530757", "0.5518788", "0.5514722", "0.55002046", "0.54953927", "0.546055", "0.545773", "0.5453648", "0.5449479", "0.5448132...
0.7010763
1
sets user suggestion expiry to the end of the alotted period
def set_user_suggestion(user_id: int): session = Session() user = get_user_by_id(user_id) user.suggestion_expiry = properties.vote_expiration() session.merge(user) session.commit() session.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expiry(self, expiry):\n\n self._expiry = expiry", "def setexpiry(self, search_filter, expiry_seconds, no_expiry_req=False):\n self.transaction_start()\n try:\n res = self.search(base=self.domain_dn(), scope=ldb.SCOPE_SUBTREE,\n expression=search_fi...
[ "0.60479116", "0.60419", "0.59231645", "0.5898375", "0.5760003", "0.57343674", "0.56527895", "0.5634012", "0.56003344", "0.5595664", "0.5567588", "0.55449843", "0.54444087", "0.53122205", "0.52961826", "0.5292571", "0.5288794", "0.52471364", "0.5235673", "0.5230684", "0.52291...
0.6103804
0
Generate recommended movies as a list of list. Each pair follows the pattern [movie_id, movie_name]
def _recommend_movie(user_id, movie_id, number_movies): #get the recommended movie ids from pickled model rec_movies = sparkrecommender.movie_recomendation(user_id,movie_id,number_movies) #get a list of movies ids used in model moviesdf = pd.read_csv('movies.csv',index_col='movieId') #build lis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_recommendations(sc, myRatings, model):\n #myRatedMovieIds = set([x[1] for x in myRatings])\n uid = get_uid_from_ratings(myRatings)\n #print \"uid:\", uid\n myRatedMovieIds = set([x[1] for x in myRatings.collect()])\n #print \"myRatedMovieIds:\", myRatedMovieIds\n candidates = sc.paralle...
[ "0.66664183", "0.66051596", "0.64752805", "0.6385976", "0.63380176", "0.62887806", "0.62088114", "0.61928946", "0.61829585", "0.6144586", "0.60651815", "0.6046803", "0.60459685", "0.6028135", "0.5990239", "0.59774137", "0.5977353", "0.5893035", "0.5870495", "0.5861246", "0.58...
0.7156391
0
bias_variable generates a bias variable of a given shape.
def bias_variable(shape): #{{{ initial = tf.constant(np.float64(0.1), shape=shape) return tf.Variable(initial)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bias_variable(self, shape):\n bias_var = tf.constant(0.1, shape=shape)\n return(tf.Variable(bias_var))", "def bias_variable(shape):\n initial = tf.zeros(shape)\n return tf.Variable(initial)", "def bias_variable(shape):\n initial = tf.constant(0.1, shape=shape)\n return tf.get_variable('bi...
[ "0.8401969", "0.8346871", "0.83350545", "0.8331357", "0.8331357", "0.8331357", "0.83219254", "0.8306474", "0.8306474", "0.8306474", "0.8306474", "0.8306474", "0.8306474", "0.8306474", "0.8306474", "0.8306474", "0.8306474", "0.82828844", "0.8262709", "0.8175319", "0.80248195",...
0.8365742
1
max_pool_2x2 downsamples a feature map by 2X.
def max_pool_2x2(x): #{{{ return tf.nn.max_pool(x, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_pool_2x2(x):\r\n return tf.nn.max_pool(x, ksize=[1, 2, 2, 1],\r\n strides=[1, 2, 2, 1], padding='SAME')", "def max_pool_2x2(x):\r\n return tf.nn.max_pool(x, ksize=[1, 2, 2, 1],\r\n strides=[1, 2, 2, 1], padding='SAME')", "def max_pool_2x2(x):\n return ...
[ "0.68067825", "0.68067825", "0.67499536", "0.67499536", "0.67499536", "0.6734547", "0.67319095", "0.66933113", "0.6690389", "0.6583703", "0.64665014", "0.64330786", "0.6387615", "0.6385633", "0.6264008", "0.608816", "0.60004395", "0.5963627", "0.5905329", "0.58929497", "0.589...
0.6847307
0
padding() returns a string of blanks of length = sef._length n.
def padding(self, n): if n < self._length: # pad with blanks k = self._length - n pad_str = " " * k else: pad_str = "" return pad_str
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pad(self, n):\n pad = \"\"\n for i in range(0, n):\n pad += \" \"\n return pad", "def pad(seq, n):\n return", "def str_padding(length, val):\n return '{0:<{fill}}'.format(val, fill=length)", "def get_pad1(n):\n if n < 10:\n return \" \"\n if n < 1...
[ "0.77095324", "0.7241551", "0.71492046", "0.6978052", "0.69771516", "0.68425393", "0.68122023", "0.6712878", "0.66968906", "0.6604552", "0.647674", "0.64627826", "0.64183015", "0.64101464", "0.6407314", "0.6399155", "0.6342096", "0.6270587", "0.6259474", "0.62424386", "0.6241...
0.82964647
0
adjustl() implements the ADJUSTL() function of Fortran. This function removes leading blanks and adds blanks on the right so that the result is the same length as the input string.
def adjustl(self): s = self._val.lstrip() pad_str = self.padding(len(s)) return s + pad_str
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ljust(value, length):\n\n if value is None:\n value = ''\n else:\n value = str(value)\n value = value.ljust(length, ' ')\n return value", "def ljust(a, width, fillchar=' '):\n a_arr = numpy.asarray(a)\n width_arr = numpy.asarray(width)\n size = int(numpy.max(width_arr.flat)...
[ "0.62654585", "0.596987", "0.5963607", "0.59515417", "0.586714", "0.5814819", "0.5747125", "0.57406837", "0.5735657", "0.5645955", "0.56457543", "0.5636314", "0.5615963", "0.5606711", "0.5600981", "0.55577034", "0.5537392", "0.5415384", "0.54068834", "0.5337946", "0.5337058",...
0.72271615
0
adjustr() implements the ADJUSTR() function of Fortran. This function removes trailing blanks and adds blanks on the left so that the result is the same length as the input string.
def adjustr(self): s = self._val.rstrip() pad_str = self.padding(len(s)) return pad_str + s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _wadifyString(s):\n\n if len(s) < 8:\n s += \"\\x00\" * (8 - len(s))\n return s", "def un_pad(s):\n return s[0:-ord(s[-1])]", "def distillString(someString):\n if someString is None:\n return None\n sb = ''\n prev = ''\n for c in list(someString):\n if ((c == ' ' o...
[ "0.6095933", "0.5585714", "0.5557114", "0.5552244", "0.54674214", "0.5430286", "0.5427943", "0.5414906", "0.53891265", "0.53726435", "0.5364792", "0.5364071", "0.5317057", "0.5269162", "0.52576226", "0.5257291", "0.52342814", "0.5223157", "0.51983124", "0.5173976", "0.5164005...
0.6290218
0
f_index() implements the string search function of Fortran's INDEX() function; we use the name f_index to emphasize that the behavior of Fortran's INDEX() is slightly different from that of Python's index(). f_index() returns the position within a string where substring first occurs; 0 if there is no such occurrence. I...
def f_index(self, substring, direction=[]): substr = self.value(substring) if "back" in direction: pos = self._val.rfind(substr) else: pos = self._val.find(substr) return pos + 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def indexOf(self, p_str): # real signature unknown; restored from __doc__\n return 0", "def indexOf(self, p_str): # real signature unknown; restored from __doc__\n return 0", "def findWithIndex(astring, achar, start):\n ix = start\n found = False\n while ix < len(astring) and not found:\...
[ "0.60573", "0.60573", "0.58074844", "0.58074844", "0.58074844", "0.5792177", "0.5750158", "0.5609151", "0.5556066", "0.55419356", "0.55386984", "0.55075634", "0.5502474", "0.5472665", "0.5461235", "0.5408519", "0.5397678", "0.52989614", "0.5279691", "0.5266489", "0.52330625",...
0.7782096
0
get_substr(i, j) returns the substring of the given string beginning at position i (start position = 1) and ending at position j.
def get_substr(self, i, j): return self._val[(i-1):j]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def substr(string, beg, end):\n require_type(isa(string, str), 'the first parameter of substring must be a string')\n if beg < 0 or end >= len(string) or beg > end:\n raise IndexError('the index of substring is invalid')\n return string[beg:end]", "def get_substring(self, start, end):\n re...
[ "0.7102797", "0.68288594", "0.64927953", "0.64316636", "0.6314851", "0.6238048", "0.62012887", "0.58048654", "0.5691622", "0.56832325", "0.5678427", "0.56664056", "0.5606885", "0.54606634", "0.5420446", "0.5417869", "0.5375365", "0.5370675", "0.53160095", "0.53092986", "0.530...
0.8085877
0
text to be displayed on fallback
def fallback_text(self): text = "" text += "bad keyword {}" + "\n" text += "retry" + "\n" text += "\n" text += "available functions" + "\n" for keyword in self.keywords: text += f'{keyword}\n' return text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_text(downgrade_titles=False):", "def ugettext(self, text):\r\n if text == \"There was a problem with the staff answer to this problem.\":\r\n text = \"TRANSLATED!\"\r\n return text", "def display_message():", "def _getTextForAvailability(self, obj):\n\...
[ "0.673872", "0.6617963", "0.65699875", "0.644673", "0.6443022", "0.6382578", "0.63536584", "0.6295738", "0.6244421", "0.6229137", "0.6193567", "0.61418337", "0.61418337", "0.61418337", "0.61418337", "0.61418337", "0.61325455", "0.608816", "0.608816", "0.6082628", "0.60578644"...
0.72570765
0
get wordlist_path and corpus_stem
def get_wordlist_path_corpus_stem(language, corpus, datafolder, filename, maxwordtokens, use_corpus): if maxwordtokens: word_token_suffix = "_{}-tokens".format(maxwordtokens) else: word_token_suffix = "" if filename: # if "filename" has a corpus fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fcorpustxt(self):\n return self.prefix + 'corpus.txt'", "def load_corpus():\n # Define directory structure\n parent_path = os.getcwd() + '/'\n corpus_path = parent_path + 'corpus_data/'\n corpus_name = corpus_path + 'train_corpus_vocab.pickle'\n # Load corpus vocabulary\n with open(...
[ "0.60399586", "0.59600186", "0.5834007", "0.58183396", "0.5739848", "0.5727535", "0.5660425", "0.5645314", "0.5611074", "0.558899", "0.5577429", "0.5527239", "0.5518893", "0.5514296", "0.54966754", "0.548855", "0.5485229", "0.5448807", "0.5447388", "0.5421932", "0.53668135", ...
0.752322
0
determine if a corpus text or a wordlist is used as input dataset
def determine_use_corpus(): while True: user_input = input("\nWhat kind of input data are you using? " "[\"c\" = corpus text, \"w\" = wordlist]\n>>> ") user_input = user_input.strip().casefold() if user_input and user_input in {"c", "w"}: if user_input ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_train(args):\n return (args.training_set or args.source or args.dataset or\n args.datasets or args.source_file or args.dataset_file or\n args.train_stdin or args.source_file)", "def test_get_corpus(self):\n references = pre.read_data(self.testfilename)\n corpus = pre.get_co...
[ "0.5926495", "0.567662", "0.56606513", "0.5578526", "0.55772436", "0.5575582", "0.55664927", "0.55572", "0.5547332", "0.55463207", "0.5519774", "0.54779357", "0.5473844", "0.5466143", "0.54434884", "0.543381", "0.543381", "0.5418396", "0.5412083", "0.54025376", "0.5367671", ...
0.7067628
0
Returns a list of of folds, where each fold contains indices Ratio determines the amount of over/under sampling.
def resample_bco_splits(bco_splits, ratio=1): folds = [] for bco in bco_splits: n_max = max([df.shape[0] for df in bco]) n_min = min([df.shape[0] for df in bco]) # interpolate n = int(np.interp(ratio, [0, 1], [n_min, n_max])) fold_indices = sample_bco(bco, n) fold...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cv_folds(bco_splits, resampling_ratio):\n folds = resample_bco_splits(bco_splits, resampling_ratio)\n # for each step, choose (n-1) train folds and 1 test fold\n n_folds = len(folds)\n cv_folds = []\n for i in range(n_folds):\n if n_folds > 1:\n fold_indices = np.delete(np.aran...
[ "0.647986", "0.6114347", "0.60269487", "0.5942258", "0.5910836", "0.58712506", "0.5850095", "0.5834566", "0.5795476", "0.5532058", "0.55036455", "0.5471625", "0.5458207", "0.5423512", "0.5372009", "0.5326974", "0.52965224", "0.5281078", "0.5248077", "0.52228177", "0.5179693",...
0.63148105
1
fixture for creating a spark context
def spark_context(request): spark = SparkSession.builder.master("local[1]").appName("pytest-test").getOrCreate() request.addfinalizer(lambda: spark.stop()) quiet_py4j() return spark
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spark():\n\n quiet_log4j()\n\n builder = (\n SparkSession.builder\n .master(\"local[2]\")\n .appName(\"pytest-pyspark-local-testing\")\n # By default spark will shuffle to 200 partitions, which is\n # way too many for our small test cases. This cuts execution\n #...
[ "0.7401126", "0.7185849", "0.7147665", "0.71358913", "0.6700026", "0.66479564", "0.6571936", "0.6427863", "0.6411044", "0.636135", "0.6243758", "0.6203419", "0.6150244", "0.61185306", "0.6116119", "0.6085249", "0.6083701", "0.60627055", "0.6043724", "0.60128736", "0.6011979",...
0.77547735
0
Switch if the cell is filled or not.
def _switch(self): self.fill= not self.fill
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_if_filled(self, new_cell, cell_color, filled_edges, filled_surrounded):\n new_cell_color = self.get_color(new_cell)\n if new_cell_color != cell_color:\n return False\n\n if new_cell not in filled_edges + filled_surrounded:\n filled_edges.append(new_cell)\n\n ...
[ "0.68163425", "0.6659631", "0.6656614", "0.66115654", "0.651746", "0.6487824", "0.6445386", "0.63897294", "0.63885236", "0.63622", "0.63271534", "0.6198121", "0.6198121", "0.6194476", "0.6193286", "0.61416614", "0.61198235", "0.6091679", "0.6076134", "0.6050749", "0.6040034",...
0.75554085
0
Plot true ASA run compared with HiPPO
def plot_asa_with_hippo(self, env): print(f'Plotting ASA with HiPPO - {env}') plt.figure() params = self.env_params[env] basic_run_split = max(11, min([itr for _, itr in params['true_asa_runs']])) # Basic run self.draw_reward_range( self.data(env, 'asa') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apolco(a,minfeh=-3,out=None) :\n apo=np.where((a['TELESCOPE'] == 'apo25m') & (a['RV_FEH']>minfeh) )[0]\n fig=vscat(a[apo],marker='o',density=True)\n lco=np.where((a['TELESCOPE'] == 'lco25m') & (a['RV_FEH']>minfeh) )[0]\n vscat(a[lco],fig=fig,ls=':',marker='+',density=True)\n if out is not None :...
[ "0.6887815", "0.64656186", "0.6435197", "0.62759936", "0.6235954", "0.6210733", "0.6191794", "0.61725485", "0.6162632", "0.6129419", "0.612244", "0.6118562", "0.61135715", "0.61098814", "0.6102237", "0.60932934", "0.60818464", "0.60807157", "0.6049199", "0.6049192", "0.602450...
0.7668582
0
Plot a) individual runs (seeds) of true ASA, b) new skill usage
def plot_asa_individual_runs(self, env): print(f'Plotting ASA - individual runs - {env}') params = self.env_params[env] plt.figure() seeds = sorted(list({int(row['ExpSeed'][1:]) for row in self.data(env, 'asa').get_all()})) colors = [f'C{i}' for i in range(10)] # DEBUG: c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_new_skill_usage(self, env):\n print(f'Plotting new skills\\' usage - {env}')\n params = self.env_params[env]\n plt.figure()\n seeds = sorted(list({int(row['ExpSeed'][1:]) for row in self.data(env, 'asa').get_all()}))\n colors = ['#a65628', '#377eb8', '#4daf4a', '#984ea3'...
[ "0.76209044", "0.6815889", "0.63866997", "0.62457716", "0.6147542", "0.6114735", "0.6040957", "0.59494144", "0.5938997", "0.5926191", "0.58519053", "0.5828255", "0.58169913", "0.5813524", "0.580589", "0.580589", "0.5805672", "0.57964367", "0.5776254", "0.57657826", "0.5753761...
0.72207856
1
Plot new skills' usage
def plot_new_skill_usage(self, env): print(f'Plotting new skills\' usage - {env}') params = self.env_params[env] plt.figure() seeds = sorted(list({int(row['ExpSeed'][1:]) for row in self.data(env, 'asa').get_all()})) colors = ['#a65628', '#377eb8', '#4daf4a', '#984ea3', '#ff7f00'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot(self, *args):\n return self.vocab().plot(*args)", "def plot_skillpercountry(data_df, **args):\n\n name = args.get('name', 'VARIABLE NAME')\n idx = args.get('idx', data_df.index.values)\n dd = args.get('dd', 5.8) # 3.3\n wdth = args.get('wdth', 8) # 7\n hght = args.get('hght', 4)\n ...
[ "0.65072656", "0.5949703", "0.5912668", "0.588025", "0.5827645", "0.5817794", "0.5751593", "0.5722429", "0.5675521", "0.56704324", "0.56592697", "0.5657695", "0.5644083", "0.5621631", "0.5621557", "0.56197244", "0.56017005", "0.55769265", "0.55576116", "0.55514646", "0.554535...
0.7730445
0
Plot performance of ideal, ASA, and bad skill from true ASA runs
def plot_ideal_asa_bad_all(self, env): print(f'Plotting ideal, ASA, and bad skill - all runs in subplots - {env}') rcParams.update({'figure.autolayout': False}) params = self.env_params[env] fig, _ = plt.subplots(3, 1, sharex='all', sharey='all') fig.subplots_adjust(hspace=0, lef...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SA_data_display(opt_df, all_df):\n fig, axs = plt.subplots(2, 3)\n\n axs[0,0].set_title(\"Optimal rewire attempts for circularity\")\n axs[0,0].set_ylabel(\"Percent waste %\")\n axs[0,0].set_xlabel(\"Time (s)\")\n axs[0,0].plot(opt_df[\"Time (s)\"], opt_df[\"Percent waste (%)\"])\n\n axs[0,1]...
[ "0.68732715", "0.67297244", "0.65767056", "0.64183366", "0.6295292", "0.62588423", "0.6218353", "0.6215405", "0.6206997", "0.61392593", "0.61350924", "0.6121879", "0.6117055", "0.6096504", "0.6095275", "0.605361", "0.6038837", "0.59880257", "0.5976123", "0.59702027", "0.59686...
0.67751837
1
Plot range of reward high and low percentile
def draw_reward_range(self, data_builder, env, color=None, alpha=0.2, **kwargs): x, mean = data_builder.get_reward_mean() _, low = data_builder.get_reward_percentile(self.env_params[env]['high_low_percentile']) _, high = data_builder.get_reward_percentile(100 - self.env_params[env]['high_low_pe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_stability_function(self,bounds=[-20,1]):\n import matplotlib.pyplot as plt\n p,q=self.stability_function()\n xx=np.arange(bounds[0], bounds[1], 0.01)\n yy=p(xx)/q(xx)\n fig, = plt.plot(xx,yy)\n plt.draw()", "def set_color_by_percentile(this, start, end):\n\tif s...
[ "0.61897177", "0.6142304", "0.61223316", "0.60464966", "0.5764064", "0.57531226", "0.5688331", "0.5688129", "0.56239134", "0.56094724", "0.5551428", "0.55341935", "0.55000323", "0.5484973", "0.5470953", "0.5462968", "0.5457872", "0.5455016", "0.5430253", "0.53900945", "0.5378...
0.6613888
0
Show plot, and save it if save_plots option is set to True
def show_save_plot(self, name=''): if self.save_plots: plt.savefig(os.path.join(self.out_folder, f'{name}.png'), dpi=300) plt.show()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_plot(self, ):\n pass", "def show_plots():\n plt.show()", "def show_plot(self):\r\n\t\tself.generate_plot()\r\n\t\tplt.show()", "def show_plot_in_new_figure(data, ylim=(-0.3, 0.3),\n to_save=False, fname=\"extractor_test_results/result.png\"):\n \n plt.figur...
[ "0.7559468", "0.74072784", "0.72638154", "0.72340393", "0.72013384", "0.71042204", "0.702345", "0.7010208", "0.70073694", "0.69981927", "0.69832957", "0.69563615", "0.69117415", "0.69117415", "0.69117415", "0.68788403", "0.6811917", "0.6804485", "0.6789407", "0.67648935", "0....
0.7906443
0
Get aggregation from desired attribute. Default aggregation is mean. Optionally apply exponential smoothing average on result. Returns tuple (iterations, values)
def get_aggr(self, attribute, aggregator=None, smooth=0., **kwargs): if aggregator is None: aggregator = np.mean data = self.get_all() itrs = {row['Iteration'] for row in data} itrs = sorted(list(itrs)) vals = [] running_avg = 0 for itr in itrs: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_agg_by_mean_value(self):\n return self._data_agg_by_mean_value", "def _agg_by_mean(self):\n return self._data_grouped_by_manufacturer.agg('mean')[['car_value']]", "def mean(self):\n return self._lift(\"mean\")", "def aggregator():\n return Aggregator(\n agg_col=\"col_a...
[ "0.62106574", "0.5946525", "0.5774657", "0.5759817", "0.5689681", "0.5685861", "0.564786", "0.5614064", "0.56111246", "0.559214", "0.5569175", "0.55457115", "0.55432856", "0.55221975", "0.5517469", "0.5474798", "0.54685223", "0.54628175", "0.54484236", "0.5440685", "0.5436520...
0.7840999
0
Append data of previous iteration from Basic runs to dataset
def append_prev_itr(self): self.data = self.get_all() # need to materialize, since filter can be consumed only once min_itr = min([row['Iteration'] for row in self.data]) basic_runs = DatasetBuilder(self.default_data)\ .filter_basic_runs()\ .filter_itr(min_itr - 1)\ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_data(self, data):\n start_time = data.index[-1].strftime(\"%Y-%m-%dT%H:%M:%S.000000Z\")\n temp_data = self.gather_data(start=start_time)\n temp_data = self._list_to_df(temp_data)\n if (len(temp_data) > 1):\n # temp_data[0] is the same as data[-1]\n out_d...
[ "0.6593105", "0.650919", "0.6474083", "0.6434774", "0.63275266", "0.6271331", "0.6217509", "0.613502", "0.6121314", "0.6089031", "0.6079092", "0.60508895", "0.6035106", "0.6029957", "0.598083", "0.59598243", "0.5951078", "0.5941797", "0.5933535", "0.5932469", "0.5922286", "...
0.6811474
0
Decorator for limiting a command to gamemasters only.
def gamemaster(f): def is_gamemaster(self, *args, **kwargs): """ :param self: :param args: :param kwargs: :type self: controllers.play.PlayController :return: """ if hasattr(self, "account") and hasattr(self, "universe"): if self.universe_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_not_limit(command):\n if not isinstance(command, commands.Command):\n raise TypeError(\"one_command.not_limited is a decorator for Commands\")\n\n exempted.append(command)\n return command", "def owners_only(command):\n @wraps(command)\n def wrapped_up(bot):\n if bot.message.n...
[ "0.6239382", "0.590238", "0.5829754", "0.58270633", "0.5791091", "0.5610494", "0.5574893", "0.55652374", "0.54386795", "0.54035664", "0.5370867", "0.5244041", "0.52132875", "0.5179439", "0.51760167", "0.5160789", "0.5153043", "0.51125693", "0.5110468", "0.50576633", "0.504835...
0.5945089
1
Check that computer's allocation scope is not set it is unavailable
def test_allocation_scope_empty(self): sequence_list = SequenceList() sequence_string = self.stabilise_accounting + """ LoginTestVifibCustomer CustomerRegisterNewComputer Tic Logout LoginDefaultUser SetComputerCoordinatesFromComputerTitle Logout LoginTestVifibC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ComputeEAvailable(self):\r\n pass", "def _check_local_constraints(launcher: str, batch: bool) -> None:\n if launcher == \"local\" and batch:\n msg = \"Local orchestrator can not be launched with batch=True\"\n raise SmartSimError(msg)", "def pollable(self):\n return bool(self...
[ "0.602547", "0.60143745", "0.5976272", "0.5933032", "0.5920864", "0.59010035", "0.5809373", "0.5761211", "0.5735884", "0.5735884", "0.5735884", "0.5716058", "0.57144475", "0.57112986", "0.56781214", "0.5624605", "0.56244206", "0.55972403", "0.5596996", "0.5587138", "0.5583771...
0.6715929
0
Return a list of all the class names in the module.
def _get_all_classnames( module: ModuleType ) -> List[str]: return list(map(lambda x: x[0], inspect.getmembers(module, inspect.isclass)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_class_list_from_modulelist(self):\n class_list = []\n class_name_list = []\n for module in self.module_list:\n for name, obj in inspect.getmembers(module, inspect.isclass):\n if inspect.getmodule(obj) == module:\n class_list.append(obj)\n ...
[ "0.7970343", "0.778804", "0.7739137", "0.76824117", "0.7575166", "0.7443842", "0.7386211", "0.7357736", "0.7351146", "0.7286444", "0.7215662", "0.72059363", "0.7193735", "0.71765983", "0.71485496", "0.70892346", "0.7048585", "0.700074", "0.6967808", "0.69447535", "0.69165826"...
0.89381725
0
Return a list of configurations corresponding to the idx.
def get_nth_idx( cfg: DictConfig, idx: int ) -> dict: codekeys = [] prodlist = [] # datasets _append_one(cfg['datasets']['train'], codekeys, prodlist, 'datasets') _append_one(cfg['datasets']['train'], codekeys, prodlist, 'dataloaders') _append_options(cfg['datasets']['train'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_config(self):\n return {\n 'settings': self.settings,\n 'mappings': self.mappings\n }", "def list_configurations(MaxResults=None, NextToken=None):\n pass", "def get_optimizer_config(idx):\n names = [x.strip() for x in _get_opt_name_content().split(\"\\n\") if x...
[ "0.6059511", "0.5893411", "0.5837585", "0.5811953", "0.5794028", "0.5758744", "0.5702596", "0.5695984", "0.5665997", "0.5618487", "0.5591765", "0.5557274", "0.5554529", "0.5473284", "0.546775", "0.54606825", "0.54116267", "0.54077166", "0.54038906", "0.5385782", "0.5372215", ...
0.5965964
1
Build the highway following the parameters given >>> construct_highway(10, 2, 6) [[6, 1, 6, 1, 6, 1, 6, 1, 6, 1]] >>> construct_highway(10, 10, 2) [[2, 1, 1, 1, 1, 1, 1, 1, 1, 1]]
def construct_highway( number_of_cells: int, frequency: int, initial_speed: int, random_frequency: bool = False, random_speed: bool = False, max_speed: int = 5, ) -> list: highway = [[-1] * number_of_cells] # Create a highway without any car i = 0 initial_speed = max(initial_speed,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_highway(self):\n input_dim = sum(f[0] for f in self.convolutions_params)\n highway_layers = []\n for k in range(self.num_highway_layers):\n highway_layer = HighwayLayer(input_dim)\n w_transform = np.transpose(self.npz_weights['W_transform_{}'.format(k)])\n ...
[ "0.5803849", "0.5394107", "0.53300154", "0.5328335", "0.53035086", "0.5287974", "0.52004945", "0.51906157", "0.51589894", "0.50909424", "0.50770885", "0.50326085", "0.5024153", "0.49995005", "0.4995877", "0.49833056", "0.49815786", "0.49703053", "0.49518657", "0.49355233", "0...
0.66447014
0
Get the distance between a car (at index car_index) and the next car >>> get_distance([6, 1, 6, 1, 6], 2) 1 >>> get_distance([2, 1, 1, 1, 3, 1, 0, 1, 3, 2], 0) 3 >>> get_distance([1, 1, 1, 1, 2, 1, 1, 1, 3], 1) 4
def get_distance(highway_now: list, car_index: int) -> int: distance = 0 cells = highway_now[car_index + 1 :] for cell in range(len(cells)): # May need a better name for this if cells[cell] != -1: # If the cell is not empty then return distance # we have the distance we wanted ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _distance_next(self):\n\n self.distance = 10\n\n # Here a set index to 0 if the car is finishing a lap\n # Also reset the farthest\n if self.index > (len(self.x_trajectory) - 6) and self.closed:\n self.index = 0\n self.farthest = -1\n self.laps += 1\...
[ "0.70231766", "0.65699023", "0.59429544", "0.5798166", "0.5675009", "0.56145936", "0.5482934", "0.5434051", "0.540333", "0.5358817", "0.53466207", "0.5341085", "0.53376293", "0.53287554", "0.5325054", "0.5303098", "0.5299434", "0.52843094", "0.5254244", "0.52535033", "0.52379...
0.74189913
0
This function initiate numerical scaler.
def __init__(self) -> None: self.name = "minmaxScaler" self.min = 0 self.max = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prescaler(self) -> int:", "def prescaler(self, value: int, /) -> None:", "def __create_scaler(self):\n \n self.scaler = {}\n for component in self.comp_list:\n self.scaler[component] = self.__create_scaler_type()", "def __create_scaler_type(self):\n\n if self.scaler...
[ "0.6779692", "0.67784566", "0.64900774", "0.63679314", "0.6365388", "0.6351939", "0.6209125", "0.6183904", "0.6130047", "0.6105554", "0.6095403", "0.60318804", "0.6009167", "0.597821", "0.5901653", "0.5894329", "0.5842079", "0.57997465", "0.5728228", "0.57261974", "0.5720552"...
0.6889837
0
Creates an AMI stack and waits for the AMI to be created.
def create_stack(self, template: str, parameters: dict, debug_mode: bool, output: AbstractOutputWriter): stack = Stack.create_stack( cf=self._cf, StackName=self._stack_name, TemplateBody=template, Parameters=[{'ParameterKey': key, 'ParameterValue': value} for key,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _wait_for_cf_stack_create_to_complete(self):\n cf_waiter = self.cf_client.get_waiter(\"stack_create_complete\")\n logger.info(\"Waiting for stack to get to CREATE_COMPLETE state....\")\n try:\n cf_waiter.wait(\n StackName=self.shared_resource_stack_name,\n ...
[ "0.68156826", "0.64606255", "0.6183377", "0.6039398", "0.60068554", "0.5906674", "0.5698402", "0.5537973", "0.54384285", "0.5377508", "0.53572005", "0.53136116", "0.5274387", "0.52605295", "0.525386", "0.5251287", "0.5245722", "0.52077144", "0.5199662", "0.5197044", "0.516476...
0.6862462
0
Perform nearest neighor upsampling on NCHW layout input.
def upsampling_nchw(data, scale): batch, channel, height, width = data.shape out_height = util.simplify(height * scale) out_width = util.simplify(width * scale) return tvm.compute((batch, channel, out_height, out_width), \ lambda n, c, h, w: data[n, c, h/scale, w/scale])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_upsampling_weight(in_channels, out_channels, kernel_size):\n factor = (kernel_size + 1) // 2\n if kernel_size % 2 == 1:\n center = factor - 1\n else:\n center = factor - 0.5\n og = np.ogrid[:kernel_size, :kernel_size]\n filt = (1 - abs(og[0] - center) / factor) * \\\n ...
[ "0.6083806", "0.6083806", "0.6083806", "0.60267305", "0.59680855", "0.59439045", "0.59292346", "0.58890015", "0.58562356", "0.5796987", "0.5742798", "0.5689665", "0.56567746", "0.56455714", "0.55968994", "0.5583747", "0.54634154", "0.5460309", "0.54537714", "0.54535866", "0.5...
0.6292095
0
Perform nearest neighor upsampling on NHWC layout input.
def upsampling_nhwc(data, scale): batch, height, width, channel = data.shape out_height = util.simplify(height * scale) out_width = util.simplify(width * scale) return tvm.compute((batch, out_height, out_width, channel), \ lambda n, h, w, c: data[n, h/scale, w/scale, c])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upsampling_nchw(data, scale):\n batch, channel, height, width = data.shape\n out_height = util.simplify(height * scale)\n out_width = util.simplify(width * scale)\n\n return tvm.compute((batch, channel, out_height, out_width), \\\n lambda n, c, h, w: data[n, c, h/scale, w/sca...
[ "0.62180877", "0.6142492", "0.61057913", "0.59959435", "0.59959435", "0.59959435", "0.5990773", "0.58951765", "0.58815444", "0.5808927", "0.5727946", "0.5697279", "0.56794965", "0.56690705", "0.5668623", "0.5601717", "0.5517809", "0.54951996", "0.5450498", "0.54454947", "0.54...
0.6447749
0
Return True once the User enters a valid hint threshold, that should be a digt between 0 and 81
def validate_correct_hint(self): is_response_hint_valid = False while is_response_hint_valid is False: hint_value = self.ask_user_input("Enter maximum hint threshold") if not hint_value.isdigit(): print("Not a number, please try again") elif 0 <= int(h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_hint_condition(self, hxml_set, student_answers):\r\n pass", "def check(self):\n self.lower_bound(5e-4)\n self.upper_bound(5e2)", "def ask_for_threshold():\n threshold_question = [\n {\n 'type': 'input',\n 'message': 'Enter the threshold value that ...
[ "0.63531274", "0.62666655", "0.6229901", "0.62169504", "0.60620344", "0.6060476", "0.60587007", "0.6028009", "0.5978142", "0.59722835", "0.59545875", "0.59284127", "0.58977365", "0.5889698", "0.58445185", "0.58356386", "0.5808149", "0.5755779", "0.5751373", "0.57439446", "0.5...
0.807371
0
Return True once the User enters a valid puzzle string, it should have a length of 81 chars and should contain only digits.
def validate_puzzle_string(self): is_puzzle_string_valid = False while is_puzzle_string_valid is False: question = "Enter a valid puzzle. (81 inline digits where zeros " +\ "represent empty spots) E.g. 01040506.... and so on\npuzzle" puzzle_parameter = self.ask_us...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def input_validation(input_: str) -> bool:\n return fullmatch('[1-9]', input_) is not None", "def check_for_validity_puzzle_1(limits: tuple, rep_char: str, password: str):\n\n reps = password.count(rep_char)\n\n lower, upper = limits\n\n if lower <= reps <= upper:\n return True\n else:\...
[ "0.6988238", "0.687215", "0.6835534", "0.68153137", "0.6782101", "0.64769334", "0.64731705", "0.6458984", "0.643432", "0.6433204", "0.6431435", "0.64165646", "0.6377844", "0.6358205", "0.6288739", "0.6282731", "0.62333125", "0.6206595", "0.6188043", "0.61569345", "0.61154485"...
0.9071734
0
rotacijom nastaju dvije kupe veca kupa k1 i manja kupa k2
def rotacija_pravouglog_trougla_oko_hipotenuze(s2, s1): c = math.sqrt(s2 * s2 + s1 * s1) povrsina_trougla= (s2 * s1) / 2 hc = (2 * povrsina_trougla) / c H1 = math.sqrt(s1 * s1 - hc * hc) H2 = math.sqrt(s2 * s2 - hc * hc) pi= 3.14 povrsina = hc * pi * (s1 + s2) zapremina = (hc * h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_sign(k1, k2):\n\n def ordering_sign(permu, weights):\n \"\"\"Returns the exponent of the Koszul sign of the given\n permutation acting on the elements of degrees given by the\n list of weights\n\n \"\"\"\n sign_exp = ...
[ "0.5893688", "0.58475995", "0.58050233", "0.5798079", "0.57161826", "0.56585133", "0.56338", "0.5618302", "0.55728865", "0.5557525", "0.5520247", "0.55194056", "0.5481362", "0.5461619", "0.54547805", "0.54395205", "0.54311895", "0.54175323", "0.54173046", "0.54041135", "0.540...
0.6510673
0
determines the skin and image path
def _get_skin_path( self, skin, xml_name, skin_path, image_path ): base_path = os.path.join( os.getcwd().replace( ";", "" ), skin_path ) if ( skin == "Default" ): current_skin = xbmc.getSkinDir() else: current_skin = skin if ( not os.path.exists( os.path.join( base_path, current_skin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_style_img_path(style):\n return f\"images/style/{style}.jpg\"", "def path_for(filename):\n if settings.value(Key.Theme) == Themes.Light.value:\n return (IMAGES_PATH / Themes.Light.value / filename).as_posix()\n return (IMAGES_PATH / Themes.Dark.value / filename).as_posix()", "def _targe...
[ "0.63674694", "0.6175937", "0.604926", "0.601352", "0.5925964", "0.59227854", "0.5921144", "0.59142697", "0.5882779", "0.58082664", "0.58032", "0.57874", "0.5763839", "0.5698368", "0.5691128", "0.56903887", "0.5643252", "0.56127405", "0.5581269", "0.55716574", "0.5545956", ...
0.8096417
0
clears variables and unlinks docs
def _clear_variables( self ): self.navigation = None self.resPath = None self.resolutions = None self.currentResolution = None self.resolution = None for doc in self.include_doc: try: doc.unlink() except: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_doc():\n for obj in DOC.Objects:\n DOC.removeObject(obj.Name)", "def clean_docs(c):\n c.run(f\"rm -fr {DOCS_BUILD_DIR}\")", "def remove_refs(self):\n\n self.reference = None\n self.url = None", "def reset_document(self):\n # FIXME: this state does not make sense\n ...
[ "0.715275", "0.6817802", "0.6728616", "0.6473941", "0.63902086", "0.62670666", "0.62519234", "0.6240092", "0.61637795", "0.61538225", "0.6152298", "0.61403656", "0.61283565", "0.61209446", "0.60822624", "0.60822624", "0.60822624", "0.5960402", "0.59600127", "0.59307086", "0.5...
0.7568627
0
sets the coordinate resolution compensating for widescreen modes
def _set_resolution( self ): offset = 0 # if current and skinned resolutions differ and skinned resolution is not # 1080i or 720p (they have no 4:3), calculate widescreen offset if ( ( not ( self.currentResolution == self.resolution ) ) and self.resolution > 1 ): # check...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setCoordinateResolution(*args):", "def setCoordinateResolution(*args):", "def setCoordinateResolution(*args):", "def setCoordinateResolution(*args):", "def set_resolution(self, width, height):\n self.driver.set_window_size(width, height, self.driver.window_handles[0])", "def change_resolution(...
[ "0.7374984", "0.7374984", "0.7374984", "0.7374984", "0.70681846", "0.6822153", "0.666692", "0.65758234", "0.6553731", "0.63714325", "0.6261697", "0.6256251", "0.6256015", "0.62161744", "0.6200401", "0.61687154", "0.6166341", "0.6126656", "0.6108641", "0.60438824", "0.6021129"...
0.782831
0
corrects control id's for some visible conditions and set's visible status
def _set_visibility_and_animations( self ): import re pattern = [ "control.hasfocus\(([0-9]+)\)", "control.isvisible\(([0-9]+)\)" ] rvalue = [ "control.hasfocus(##)", "control.isvisible(##)" ] for key in self.win.controls.keys(): visible = self.win.controls[ key ][ "visi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setVisibleCondition(*args):", "def setVisibleCondition(*args):", "def setVisibleCondition(*args):", "def setVisibleCondition(*args):", "def setVisibleCondition(*args):", "def setVisibleCondition(*args):", "def setVisibleCondition(*args):", "def setVisibleCondition(*args):", "def setVisibleCondi...
[ "0.6163428", "0.6163428", "0.6163428", "0.6163428", "0.6163428", "0.6163428", "0.6163428", "0.6163428", "0.6163428", "0.6163428", "0.6163428", "0.59627444", "0.59627444", "0.59627444", "0.59627444", "0.59627444", "0.59627444", "0.59627444", "0.59627444", "0.59627444", "0.5962...
0.67552465
0
Default the container to use specified encryption scope for all writes.
def default_encryption_scope(self) -> Optional[str]: return pulumi.get(self, "default_encryption_scope")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_encryption(key):\n global_scope['enc'] = Encryption(key.encode())", "def require_encryption_for_write_access(self):\n if \"requireEncryptionForWriteAccess\" in self._prop_dict:\n return self._prop_dict[\"requireEncryptionForWriteAccess\"]\n else:\n return None", "...
[ "0.5898364", "0.5772351", "0.57698435", "0.57698435", "0.56035644", "0.5572135", "0.5525414", "0.53106827", "0.5251916", "0.5183517", "0.5142388", "0.51339895", "0.5103925", "0.5067164", "0.5056541", "0.5053999", "0.49991542", "0.4992962", "0.4899988", "0.48994812", "0.488171...
0.5906583
0
Indicates whether the blob container was deleted.
def deleted(self) -> bool: return pulumi.get(self, "deleted")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_deleted(self):\n if self.deleted:\n return True\n return False", "def is_deleted(self):\n return self._is_record_status(self.DELETED)", "def is_deleted(self):\n return self.state == TrackState.Deleted", "def is_deleted(self):\n return self.state == TrackSt...
[ "0.75460166", "0.74645084", "0.74422354", "0.74422354", "0.704655", "0.7039166", "0.6884362", "0.67491156", "0.66223323", "0.658387", "0.65623987", "0.6494725", "0.6439837", "0.6394126", "0.633334", "0.6312207", "0.6191566", "0.61636865", "0.6140195", "0.6054131", "0.5987963"...
0.7785083
0
Blob container deletion time.
def deleted_time(self) -> str: return pulumi.get(self, "deleted_time")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_time(self) -> str:\n return pulumi.get(self, \"delete_time\")", "def delete_time(self) -> str:\n return pulumi.get(self, \"delete_time\")", "def destroy_time(self) -> str:\n return pulumi.get(self, \"destroy_time\")", "def deletion_date(self) -> str:\n return pulumi.get...
[ "0.6757511", "0.6757511", "0.6391669", "0.60606277", "0.6034591", "0.5872625", "0.5741222", "0.57014793", "0.5586075", "0.5581689", "0.55687076", "0.5513604", "0.54916656", "0.5476148", "0.5452357", "0.5422727", "0.5405777", "0.5405063", "0.5344909", "0.5299095", "0.5296455",...
0.69253606
0
Block override of encryption scope from the container default.
def deny_encryption_scope_override(self) -> Optional[bool]: return pulumi.get(self, "deny_encryption_scope_override")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_encryption_scope(self) -> Optional[str]:\n return pulumi.get(self, \"default_encryption_scope\")", "def _disable_encryption(self):\n # () -> None\n self.encrypt = self._disabled_encrypt\n self.decrypt = self._disabled_decrypt", "def __attrs_post_init__(self):\n # ...
[ "0.631411", "0.5649546", "0.5613646", "0.5610693", "0.5610693", "0.5471035", "0.525332", "0.52506113", "0.5231042", "0.51970994", "0.5156052", "0.51467603", "0.51388496", "0.5093976", "0.50799906", "0.5070148", "0.5070148", "0.5068921", "0.5068921", "0.5044759", "0.4956732", ...
0.68169653
0
Enable NFSv3 all squash on blob container.
def enable_nfs_v3_all_squash(self) -> Optional[bool]: return pulumi.get(self, "enable_nfs_v3_all_squash")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enable_nfs_v3_root_squash(self) -> Optional[bool]:\n return pulumi.get(self, \"enable_nfs_v3_root_squash\")", "def enable_block_storage_management(self):\n self._request({\"enable-block-storage-management\": True})", "def test_patch_hyperflex_cluster_storage_policy(self):\n pass", "d...
[ "0.6709516", "0.55639", "0.545884", "0.5003434", "0.48975673", "0.48793584", "0.48588356", "0.4837607", "0.48020577", "0.47319454", "0.47129622", "0.4671482", "0.46343964", "0.45899332", "0.457097", "0.4570335", "0.4567491", "0.4531356", "0.45203787", "0.45097044", "0.4500137...
0.6979441
0
Enable NFSv3 root squash on blob container.
def enable_nfs_v3_root_squash(self) -> Optional[bool]: return pulumi.get(self, "enable_nfs_v3_root_squash")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enable_nfs_v3_all_squash(self) -> Optional[bool]:\n return pulumi.get(self, \"enable_nfs_v3_all_squash\")", "def check_nfs_root_squashing(self):\n result = []\n sfile = '/etc/exports'\n fm = FileManager(sfile)\n\n if fm.file.is_readable:\n result = fm.parse_nfs_c...
[ "0.668075", "0.562571", "0.55504173", "0.5461187", "0.54172707", "0.5305383", "0.5261275", "0.51766163", "0.5138223", "0.5091472", "0.50642455", "0.50311345", "0.49841017", "0.49506837", "0.49222878", "0.48838237", "0.48459184", "0.48159763", "0.48008415", "0.47991055", "0.47...
0.7416718
0
The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container.
def has_immutability_policy(self) -> bool: return pulumi.get(self, "has_immutability_policy")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def immutability_policy(self) -> 'outputs.ImmutabilityPolicyPropertiesResponse':\n return pulumi.get(self, \"immutability_policy\")", "def immutability_settings(self) -> Optional['outputs.ImmutabilitySettingsResponse']:\n return pulumi.get(self, \"immutability_settings\")", "def immutable(self) -...
[ "0.6947443", "0.57288796", "0.56547576", "0.5653203", "0.54542214", "0.53227615", "0.5313179", "0.5109668", "0.5021372", "0.49839082", "0.49568674", "0.49565306", "0.49460852", "0.4944232", "0.49010536", "0.48988754", "0.48743588", "0.48399776", "0.48239785", "0.481021", "0.4...
0.7187662
0
The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account.
def has_legal_hold(self) -> bool: return pulumi.get(self, "has_legal_hold")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def legal_hold(self) -> 'outputs.LegalHoldPropertiesResponse':\n return pulumi.get(self, \"legal_hold\")", "def put_object_legal_hold(Bucket=None, Key=None, LegalHold=None, RequestPayer=None, VersionId=None, ContentMD5=None):\n pass", "def holds(self, holds):\n\n self._holds = holds", "def g...
[ "0.6164107", "0.5949666", "0.53569585", "0.521271", "0.5170427", "0.5158645", "0.50515044", "0.50422853", "0.49300393", "0.4894968", "0.48720074", "0.48439923", "0.48301715", "0.45754418", "0.45518515", "0.45304394", "0.45300534", "0.45096922", "0.45069468", "0.44847918", "0....
0.6395818
0
The ImmutabilityPolicy property of the container.
def immutability_policy(self) -> 'outputs.ImmutabilityPolicyPropertiesResponse': return pulumi.get(self, "immutability_policy")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_immutability_policy(self) -> bool:\n return pulumi.get(self, \"has_immutability_policy\")", "def immutable(self) -> bool:\n return self._immutable", "def make_immutable(self):\n # just set the flag to make object immutable and hashable\n self.immutable = True", "def set_im...
[ "0.6724837", "0.6064643", "0.6055344", "0.58650666", "0.58313537", "0.5815303", "0.57381237", "0.5712028", "0.55716753", "0.53449214", "0.52274925", "0.5226579", "0.51626766", "0.5150507", "0.51446116", "0.5144324", "0.5127594", "0.5093364", "0.5093364", "0.5058616", "0.50429...
0.76103365
0
Lease state of the container.
def lease_state(self) -> str: return pulumi.get(self, "lease_state")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refresh(self):\n self.lease = self.blazar.lease.get(self.id)", "def stay(self):\n\n pass", "def checkin(self):\n\n if self._in_use:\n self._in_use = False\n self._lock_expiration = datetime.now()\n self._machine.tear_down()", "def __getstate__(self):\...
[ "0.5611428", "0.55364203", "0.54420424", "0.5274527", "0.5207571", "0.51432246", "0.5123803", "0.5105368", "0.50982726", "0.50893354", "0.5050808", "0.5027233", "0.5005233", "0.49838635", "0.49052903", "0.49014875", "0.48901102", "0.48775828", "0.48646852", "0.48646852", "0.4...
0.581948
0
The lease status of the container.
def lease_status(self) -> str: return pulumi.get(self, "lease_status")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status(self):\n self.refresh()\n # NOTE(priteau): Temporary compatibility with old and new lease status\n if self.lease.get('action') is not None:\n return self.lease['action'], self.lease['status']\n else:\n return self.lease['status']", "def lease_state(sel...
[ "0.7424254", "0.72336745", "0.71879756", "0.6754345", "0.65131927", "0.65131927", "0.6513006", "0.64881545", "0.64881545", "0.64881545", "0.64881545", "0.64881545", "0.64881545", "0.64881545", "0.64881545", "0.64881545", "0.64881545", "0.64881545", "0.64881545", "0.64881545", ...
0.81459934
0
The LegalHold property of the container.
def legal_hold(self) -> 'outputs.LegalHoldPropertiesResponse': return pulumi.get(self, "legal_hold")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_legal_hold(self) -> bool:\n return pulumi.get(self, \"has_legal_hold\")", "def holding(self) -> float:\n return self._holding", "def is_holding(self):\n return self.holding", "def legalhold(self):\n return self._sdk_dependencies.legal_hold_client", "def holding_potential...
[ "0.6950015", "0.6617283", "0.6608082", "0.65530616", "0.6069495", "0.5876936", "0.5788632", "0.57656586", "0.56702924", "0.554948", "0.55005586", "0.54388154", "0.5437349", "0.5409783", "0.53826857", "0.53826237", "0.5350724", "0.53141326", "0.52572477", "0.5217246", "0.52019...
0.7630905
0