query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Returns the current user rating for the audio_file instance
def user_rating(self) -> int: return self._user_rating
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mean_user_rating(self, user_id):\n return self.mean_user_rating[self.mean_user_rating['user_id'] == user_id]['rating'].item()", "def _get_user_ratings(self, user_id):\n return self.ratings[self.ratings['user_id'] == user_id]", "def average_rating(self):\n return self.proto.aggregat...
[ "0.6627338", "0.6283099", "0.62079924", "0.6195082", "0.61833507", "0.61767393", "0.61595863", "0.61358863", "0.61311936", "0.6091103", "0.6088088", "0.6088088", "0.608783", "0.6077677", "0.604285", "0.60403967", "0.6000047", "0.5988844", "0.59556884", "0.595322", "0.59321564...
0.7233619
0
Returns a formatted string that shows the audio_file name and times played
def display_play_count(self): play_string = "{} has been played {} time".format(self._title, self._usage.play_count) if self._usage.play_count > 1 or self._usage.play_count == 0: play_string += 's' print(play_string)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_wav_info(file_name):\n wr = wave.open(file_name, 'r')\n sample_width = wr.getsampwidth()\n frame_rate = wr.getframerate()\n num_frames = wr.getnframes()\n n_channels = wr.getnchannels()\n s = \"sample width: {} bytes\\n\".format(sample_width) + \\\n \"frame rate: {} Hz\\n\".format(...
[ "0.6399311", "0.62130934", "0.61505574", "0.6130907", "0.61177164", "0.59263015", "0.5895166", "0.5891737", "0.58695537", "0.58237946", "0.582293", "0.5818907", "0.5816524", "0.5814739", "0.5798617", "0.5791161", "0.57439744", "0.57388574", "0.57361794", "0.5724271", "0.57057...
0.6288807
1
Gets the file path of the audio_file instance
def file_location(self) -> str: if os.path.exists(self._file_path): return "The file ({}) is located in the path ({})".format(self._file_name, self._file_path) else: raise FileNotFoundError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFilePath(self, filename):\n idx = self._soundfiles.index(filename)\n return \"{}/{}\".format(self._soundpaths[idx], filename)", "def filenameAsPath(self, app):\n return app.recordingsPath.child(self.filename).path", "def audiofile(self, directory=None):\n\n return self.make_path(dire...
[ "0.7490195", "0.74901843", "0.73469466", "0.731285", "0.72917885", "0.7277486", "0.72742766", "0.7094798", "0.70782816", "0.70298177", "0.69291383", "0.6915687", "0.6902932", "0.68999505", "0.68459857", "0.68395096", "0.68122905", "0.6755028", "0.6746607", "0.6693361", "0.667...
0.0
-1
Convert http.har to YAML.
def _convert_httphar_to_yaml(har): if har: temp_dict = ConvertHarToYAML.convert_har_to_ht(har) ConvertHarToYAML.write_case_to_yaml('', temp_dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_yaml(self):\n return yaml.dump(self.raw, Dumper=yaml.SafeDumper)", "def _dict_to_single_line_yaml(self, *, data):\n result = yaml.dump(data, default_flow_style=True)\n result = result.replace(\"\\n\", \" \").strip()\n result = re.sub(r\" *\", \" \", result)\n return res...
[ "0.6067014", "0.5750265", "0.57344013", "0.56418574", "0.563329", "0.55278426", "0.54972774", "0.54600006", "0.543247", "0.5431276", "0.54208314", "0.5402448", "0.53819096", "0.5340411", "0.53272843", "0.53181577", "0.52950203", "0.52925503", "0.5226353", "0.5226287", "0.5211...
0.8132008
0
Get file case YAML.
def _get_file_yaml(case_file): temp_list = [] # Get the yaml file name and write to the queue. if case_file: # Specify the execution CASE. fargs = '&#'.join(case_file) temp_list.append(os.path.join(os.getcwd(), fargs)) cache_dir = os.path.join(gl.loadcasePath, ".am_cache") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _convert_case_to_yaml(vert):\n if vert:\n yamlfile = os.path.join(os.getcwd(), str(vert).strip())\n scripts.generate_case_tmpl(yamlfile)", "def parse_case(case_file):\n yaml_config = open(case_file)\n config = yaml.load(yaml_config)\n config['model_dir'] = MODEL_ROOT\n return con...
[ "0.6853437", "0.6578174", "0.62572324", "0.61814916", "0.6178755", "0.6049517", "0.5951054", "0.59024477", "0.5877184", "0.57700133", "0.5766219", "0.5735199", "0.5725975", "0.57209015", "0.570617", "0.5703252", "0.57023776", "0.5657186", "0.5652669", "0.5633805", "0.56329685...
0.67364377
1
The name of the Global Datastore, it is generated by ElastiCache adding a prefix to GlobalReplicationGroupIdSuffix.
def global_replication_group_id(self) -> Optional[str]: return pulumi.get(self, "global_replication_group_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def global_replication_group_id_suffix(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"global_replication_group_id_suffix\")", "def global_replication_group_id_suffix(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"global_replication_group_id_suffix\")", "def global_replication_g...
[ "0.69785523", "0.6855184", "0.67185915", "0.658941", "0.6206801", "0.6095029", "0.5968409", "0.586667", "0.5858086", "0.5858086", "0.58393973", "0.5816872", "0.5791118", "0.57872117", "0.57731485", "0.5748173", "0.57407176", "0.5738209", "0.5688608", "0.56853837", "0.5683636"...
0.648853
4
Return the state attributes of the device.
def extra_state_attributes(self) -> dict[str, Any]: attr: dict[str, Any] = {} if isinstance(self.wemo, Maker): # Is the maker sensor on or off. if self.wemo.has_sensor: # Note a state of 1 matches the WeMo app 'not triggered'! if self.wemo.sensor_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_state_attributes(self):\r\n return self.attributes", "def device_state_attributes(self):\r\n return self._attributes", "def device_state_attributes(self):\n return self._state_attrs", "def device_state_attributes(self):\n return self._state_attrs", "def device_state_a...
[ "0.92738223", "0.92053986", "0.91516256", "0.91516256", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148746", "0.9148746", "0.9137698", "0.9110632",...
0.0
-1
Return the icon of device based on its type.
def icon(self) -> str | None: if isinstance(self.wemo, CoffeeMaker): return "mdi:coffee" return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def icon(self):\n if self.device_class:\n return None\n\n return ICONS.get(self.tesla_device.type)", "def icon(self):\n if not self.device_class:\n return ICONS.get(self.entity_type)\n return None", "def icon(self):\n if \"icon\" in self._typeconf:\n ...
[ "0.843454", "0.81947875", "0.7710127", "0.76249415", "0.76149356", "0.7585125", "0.752269", "0.7517366", "0.74961644", "0.7411755", "0.7411755", "0.74050176", "0.7388733", "0.7388733", "0.73212683", "0.7295061", "0.72667056", "0.7261132", "0.72199655", "0.7209597", "0.7197567...
0.69205046
32
Turn the switch off.
def turn_off(self, **kwargs: Any) -> None: with self._wemo_call_wrapper("turn off"): self.wemo.off()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_off(self, **kwargs):\n self.smartplug.turn_off()", "def off_switch(self):\n self._switch_callback = None", "def turn_off(self):\n self.handleCommand(1)\n self._state = STATE_OFF", "def turn_off(self, **kwargs):\n set_sonoff_state(self._host, \"off\")\n self....
[ "0.870139", "0.867637", "0.85906535", "0.8523712", "0.84588856", "0.84180963", "0.8404447", "0.8398465", "0.8375364", "0.83491224", "0.83192796", "0.82949907", "0.81680954", "0.8155346", "0.8112255", "0.8091075", "0.8072859", "0.8058921", "0.8058517", "0.8041678", "0.8036265"...
0.8277566
12
Assert that `actual_obj` is the same as `expected_obj` except keys where values are None.
def obj_assert(actual_obj, expected_obj): # Pytest shortens the diff so we have to produce the diff ourselves # to workaround this. # https://github.com/pytest-dev/pytest/issues/2256 # https://github.com/pytest-dev/pytest/issues/3632 # pylint: disable=unidiomatic-typecheck assert type(actual_obj) == type(ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expect_obj(expected, actual):\n return {k: v for k, v in expected.iteritems() if actual.get(k) != v}", "def _dict_assert(actual_dict, expected_dict):\n for key in set(actual_dict) & set(expected_dict):\n _value_assert(key, actual_dict[key], expected_dict[key])", "def _validate_dict_data(self, expect...
[ "0.74569476", "0.6970658", "0.6581951", "0.65769976", "0.6518167", "0.6475961", "0.63508976", "0.6308672", "0.62935245", "0.6293422", "0.622943", "0.6208412", "0.6177125", "0.61715347", "0.61401564", "0.6114121", "0.6101795", "0.6098102", "0.60845935", "0.6082214", "0.6074565...
0.76034325
0
adults_directory > string, directory of employed_adults_apr2020_jul2020.csv eg '../../src/csv/employed_adults_apr2020_jul2020.csv' covid_pol_directory > string, directory of pol_covid.csv eg '../../src/csv/pol_covid.csv' returns > pandas.DataFrame containing features of intereast
def catch_up(employed_adults_directory, covid_pol_directory): # load in df try: df = pd.read_csv(employed_adults_directory, index_col=0) except Exception as e: print(str(e)) print("Please enter the correct directory for employed_adults_apr2020_jul2020.csv") # create target v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_uci_adult(data_dir: pathlib.Path) \\\n -> Tuple[pd.DataFrame, pd.DataFrame]:\n train_pkl = data_dir / 'train_df.pkl'\n test_pkl = data_dir / 'test_df.pkl'\n\n if data_dir.exists() and len(tuple(data_dir.iterdir())) > 1:\n train_df = pd.read_pickle(train_pkl)\n test_df = p...
[ "0.61798716", "0.59276307", "0.58808255", "0.5871795", "0.5857944", "0.5836723", "0.57604444", "0.57296884", "0.5686535", "0.5665045", "0.5616399", "0.5515983", "0.5407081", "0.53935385", "0.537482", "0.53732526", "0.53600115", "0.5358962", "0.5354479", "0.5339399", "0.533573...
0.6207496
0
df > pandas.DataFrame directory > string location of pol_covid.csv
def merge_on_fip(df, directory): pol_fip_data = pd.read_csv(directory, index_col=0) df = df.merge(pol_fip_data, left_on='GESTFIPS', right_on='fips' ,how='left') df.drop(columns=['fips'], inplace=True) return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load(df_vouchers: pd.DataFrame, dest_path: str) -> str:\n if dest_path is None:\n dest_path = \"./\"\n else:\n dest_path = sanitize_path(dest_path)\n\n file_path: str = f\"{dest_path}vouchers.{current_time()}.csv\"\n\n df_vouchers.to_csv(file_path, index=False)\n\n return file_pat...
[ "0.72082216", "0.6750319", "0.6591459", "0.6355767", "0.63468415", "0.6325199", "0.63047373", "0.6253288", "0.6220196", "0.6212935", "0.6192336", "0.6166383", "0.61268777", "0.6115077", "0.6111146", "0.6108714", "0.6050048", "0.60345775", "0.60188013", "0.60097474", "0.600474...
0.0
-1
given a list of colors, create a larger list of colors interpolating the first one. If flatten is True a list of numers will be returned. If False, a list of (r,g,b) tuples. num_colors is the number of colors wanted in the final list
def interpolate_colors(colors, flat=False, num_colors=256): palette = [] for i in range(num_colors): index = (i * (len(colors) - 1))/(num_colors - 1.0) index_int = int(index) alpha = index - float(index_int) if alpha > 0: r = (1.0 - alpha) * colors[index_int][0]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expand(colors, cutoff=12):\n output = []\n if len(colors) != 7 or cutoff > 14:\n leds_per_color = int(cutoff / len(colors))\n for i in colors:\n output += [i] * leds_per_color\n else:\n for j, i in enumerate(colors):\n output += [i] * (1 + (j % 2 == 1))\n ...
[ "0.64414346", "0.59855473", "0.59649986", "0.5934188", "0.5889408", "0.5880003", "0.58734107", "0.58412755", "0.57989866", "0.57159334", "0.57072985", "0.564304", "0.56237763", "0.56205845", "0.55856353", "0.55585176", "0.5531769", "0.5525841", "0.55230904", "0.551889", "0.54...
0.68439347
0
given a value between 0 and 1, return an (r,g,b) tuple
def color_from_value(self, value): return ImageColor.getrgb("hsl(%d,%d%%,%d%%)" % (int( (1.0 - value) * 360 ), 80, 50))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value(self):\n return (self.r, self.g, self.b)", "def tweak(rg):\n (r, g) = rg\n if r == 0 and g == 0:\n return 0, 0\n elif r == 1 and g == 1:\n return 2, 2\n elif r == 0:\n if g == 1:\n g += 1\n else:\n g -= 1\n elif g == 0:\n if...
[ "0.72312605", "0.7091915", "0.701102", "0.701102", "0.6766909", "0.66827947", "0.64752096", "0.639378", "0.63424754", "0.63414", "0.6319955", "0.6285804", "0.6274217", "0.6233372", "0.6225892", "0.62256086", "0.62254864", "0.62160724", "0.61624867", "0.6134874", "0.6100054", ...
0.0
-1
Initialised a new ClusterListsComparer analyser.
def __init__(self): super().__init__() self.min_size = 2 # set default minium size 2 self.file_index = 0 # intermediate data structures self.cluster_lists = [[],[]] self.cluster_spectra_num = [0,0] self.sorted_spectra_dict = dict() self.stars = d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initClusters(self):\n if len(self.labelList) != len(self.pointList):\n \traise ValueError(\"Label List and Point List not the same length!\")\n for i in range(len(self.labelList)):\n self.centroids[self.labelList[i]] = self.pointList[i]\n self.pointcounts[self.labelLi...
[ "0.64214784", "0.59921706", "0.59436494", "0.59354013", "0.5909261", "0.58554983", "0.58468246", "0.58330745", "0.581329", "0.5797158", "0.5790236", "0.5758743", "0.5713067", "0.5680812", "0.56649953", "0.5616604", "0.5572494", "0.5562613", "0.55595654", "0.55140734", "0.5510...
0.5108488
80
Determine the number of nonempty rows and columns in the Excel sheet
def getValidRowsCols(self) : colns = number_of_good_cols(self.r_sheet) rowns = number_of_good_rows(self.r_sheet) # Check whether the number of good columns and rows are correct while self.isEmptyRow(rowns-1, colns) : rowns = rowns - 1 while self.isEmptyColum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_cells(self):\n if hasattr(self, '__num_cells__'):\n return self.__num_cells__\n if self.x is not None:\n return self.x.size(self.__cat_dim__('x', self.x))\n if self.boundary_index is not None:\n return int(self.boundary_index[1,:].max()) + 1\n as...
[ "0.69575936", "0.69174635", "0.69098", "0.6888946", "0.68511105", "0.66627747", "0.6610862", "0.6600963", "0.6600963", "0.6600963", "0.6600963", "0.6588624", "0.6574061", "0.6529033", "0.64814025", "0.64400804", "0.6433598", "0.64148366", "0.63986665", "0.6386033", "0.6358315...
0.66136146
6
return True/False Accepts a list of number. Check each of them for pairwise primality against the last number in the list. Presumably the numbers other than the last have been checked together already as they were added to the group
def pair_check_last(pgroup): if len(pgroup) < 2: return True #only one number, we're all good p2 = pgroup[-1] for p1 in pgroup[:-1]: # concatenate the two numbers x = concatenate_number(p1,p2) y = concatenate_number(p2,p1) if not is_prime(x) or not is_prime(y): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toate_elementele_prime(lst):\n for x in lst:\n if nr_prim(x) is False:\n return False\n return True", "def pairwise_coprime(listing: list):\n\n assert isinstance(listing, list)\n\n size = len(listing)\n\n for i in range(0, size - 1):\n for j in range(i + 1, size):\n ...
[ "0.7255272", "0.65309936", "0.6473677", "0.64144915", "0.63442236", "0.63309944", "0.6329136", "0.6321939", "0.6257557", "0.6256556", "0.6254843", "0.6244247", "0.6143883", "0.6110097", "0.60926336", "0.607919", "0.6078543", "0.6038998", "0.6021289", "0.6016878", "0.60090774"...
0.73921317
0
Compute the euclidian distance between two entities
def distance_to(self, other): return float(sqrt(pow(self._row - other._row, 2) + pow(self._col - other._col, 2)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eucl_dist(a, b):\n return np.sqrt( (a[0]-b[0])** 2 + (a[1]-b[1])** 2)", "def euclidian_distance(x1, y1, x2, y2):\n distance = sqrt(pow((x1-x2), 2)+(pow((y1-y2), 2)))\n return distance", "def eucl_dist(x_0, y_0, x_1, y_1):\n return sqrt((x_1 - x_0)**2 + (y_1 - y_0)**2)", "def euclid_dist(locat...
[ "0.7855713", "0.7762067", "0.75063074", "0.74843633", "0.7461903", "0.7419441", "0.72719705", "0.71506906", "0.7132709", "0.71245384", "0.7121117", "0.7118845", "0.7084074", "0.7067265", "0.70505553", "0.7036499", "0.70339733", "0.7030447", "0.69965035", "0.69893193", "0.6986...
0.0
-1
Compute the euclidian distance between an entity and a location
def distance_to_location(self, row, col): return float(sqrt(pow(self._row - row, 2) + pow(self._col - col, 2)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def euclid_dist(location1, location2):\n return np.sqrt((location1[0] - location2[0]) ** 2 + (location1[1] - location2[1]) ** 2)", "def distance_to(self, location):\r\n return gislib.getDistance((self.latitude, self.longitude), location)", "def distance_from(self, location_obj):\n \n distan...
[ "0.75478536", "0.69023114", "0.6899074", "0.6835795", "0.67768645", "0.67283833", "0.67283833", "0.67155427", "0.65439", "0.64630586", "0.6441155", "0.6358861", "0.63314825", "0.62575054", "0.6158897", "0.61578774", "0.61469865", "0.6115758", "0.61142504", "0.6099803", "0.609...
0.60883623
22
single HTML page web application
def index(self): single = os.path.join( os.path.dirname(os.path.abspath(__file__)), 'index.html') return serve_file(single)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n template = Constants.JINJA_ENVIRONMENT.get_template('homepage.html')\n self.response.headers['Content-Type'] = 'text/html'\n self.response.write(template.render())", "def main_page():\n return render_template(\"index.html\")", "def main():\n return render_template('i...
[ "0.74165916", "0.7397944", "0.72102684", "0.72102684", "0.71679205", "0.7127047", "0.70666337", "0.7059565", "0.70578384", "0.70578384", "0.7008427", "0.69961375", "0.6951675", "0.6951675", "0.6934824", "0.6916955", "0.6883569", "0.686649", "0.6853686", "0.6850671", "0.684193...
0.68613815
18
Return string representation of an order.
def __str__(self): return f'Order: {self.size} {self.drink_name} from {self.shop}\n' \ f'Details: {self.details}\n' \ f'Location: {self.location}\n' \ f'Contact Info: {self.customer_name}, {self.customer_number}'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_order_string(cls, order_specification):\n registry = get_current_registry()\n visitor_cls = registry.getUtility(IOrderSpecificationVisitor,\n name=EXPRESSION_KINDS.CQL)\n visitor = visitor_cls()\n order_specification.accept(visitor)\n ...
[ "0.74354815", "0.74330306", "0.7226749", "0.71246475", "0.6925106", "0.6887944", "0.6846136", "0.68099225", "0.6732186", "0.65517396", "0.65187943", "0.6409505", "0.6381712", "0.63508654", "0.63508654", "0.63508654", "0.63508654", "0.63508654", "0.63508654", "0.63508654", "0....
0.6875808
6
Select the best candidate pagenumber for the given page, with reference to neighboring pages. 'pages' must be a windowed_iterator; 'window', if provided, will look to a smaller set of neighboring pages to determine a likely page number. (Smaller than that provided by the given windowed_iterator.)
def guess_best_pageno(pageinfo, pages, window=None): if window is None: window = pages.window def tally(pageinfo, current_index, sofar, weight): for c in pageinfo.info['pageno_candidates']: if c.offset >= current_index: continue if c.offset not in sofar[c....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __window_scrollByPages(self, pages):\n pass", "def get_n_needed_pages(n_results):\n if n_results % N_RESULTS_FOR_PAGE == 0:\n return int(n_results / N_RESULTS_FOR_PAGE)\n else:\n return int(n_results / N_RESULTS_FOR_PAGE) + 1", "def select_page_like_person(pages, person):\n\n ...
[ "0.533257", "0.5093779", "0.5020989", "0.49389336", "0.49362502", "0.49140146", "0.4821802", "0.48214674", "0.4809199", "0.47486413", "0.4742521", "0.4684127", "0.46808767", "0.46710113", "0.46595886", "0.46473902", "0.4643131", "0.45898446", "0.45437312", "0.45382893", "0.45...
0.7138489
0
Generate the invocation time string
def get_time(): ct = time.time() lt = time.gmtime(ct) msec = int((ct - int(ct)) * 1000) return f'{time.strftime(DATE_FMT, lt)}.{msec:0>3}'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_time(self) -> str:\n return pulumi.get(self, \"generate_time\")", "def GenerateTime(self):\n return str(bin(int(round(time.time() * 1000))))[2:]", "def time( self, mess, args):\n return str(datetime.datetime.now())", "def time( self, mess, args):\n return str(datetim...
[ "0.76272124", "0.7544282", "0.7197232", "0.7197232", "0.70281094", "0.7017373", "0.69867426", "0.6897424", "0.6896732", "0.6896732", "0.6896732", "0.6896732", "0.6896732", "0.6896732", "0.6896732", "0.6896732", "0.6896732", "0.6896732", "0.68881077", "0.68433386", "0.6834912"...
0.0
-1
Factory method for creating a list of datasets based on the provided config.
def create_datasets(cls, dataset_config, phase): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_creator(config):\n train_dataset, val_dataset = LinearDataset(2, 5), LinearDataset(2, 5)\n train_loader = DataLoader(train_dataset, batch_size=config[\"batch_size\"])\n val_loader = DataLoader(val_dataset, batch_size=config[\"batch_size\"])\n return train_loader, val_loader", "def create_dat...
[ "0.70969605", "0.70201373", "0.68344074", "0.6776368", "0.6705866", "0.6635719", "0.6573257", "0.65120465", "0.6498575", "0.642622", "0.6426022", "0.63702697", "0.6339183", "0.63318914", "0.63004375", "0.6271441", "0.62032425", "0.6139148", "0.61390036", "0.6128331", "0.61185...
0.71189034
0
Iterates over a given ndim dataset patchbypatch with a given stride and builds an array of slice positions.
def _build_slices(dataset, patch_shape, stride_shape): slices = [] if dataset.ndim == 4: in_channels, i_z, i_y, i_x = dataset.shape else: i_z, i_y, i_x = dataset.shape k_z, k_y, k_x = patch_shape s_z, s_y, s_x = stride_shape z_steps = SliceBuilder...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_slices(\n self,\n stride: int,\n patch_size: Tuple[int, int],\n img_size: Tuple[int, int],\n pad: int = None,\n ) -> Tuple[Dict[str, slice], int, int]:\n y_end, x_end = patch_size\n nrows, pady = self._get_margins(y_end, img_size[0], stride, pad=pad)\n ...
[ "0.7005847", "0.6875334", "0.67783237", "0.669869", "0.65634847", "0.6540892", "0.64972025", "0.6417897", "0.6367937", "0.6297416", "0.62602884", "0.6231236", "0.6219337", "0.61511153", "0.6101347", "0.60946655", "0.6035865", "0.60248786", "0.6021954", "0.5969248", "0.5953036...
0.8112532
0
Returns dictionary containing the training and validation loaders (torch.utils.data.DataLoader).
def get_train_loaders(config): assert 'loaders' in config, 'Could not find data loaders configuration' loaders_config = config['loaders'] logger.info('Creating training and validation set loaders...') # get dataset class dataset_cls_str = loaders_config.get('dataset', None) if dataset_cls_str ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getloader(self):\n\t\treturn self.train_loader, self.test_loader", "def get_loaders(train_dataset, val_dataset, test_dataset, batch_size=128):\n train_loader = DataLoader(train_dataset, batch_size=batch_size, num_workers=8,\n shuffle=True)\n\n val_loader = DataLoader(val_da...
[ "0.77058", "0.75321263", "0.73289746", "0.72428334", "0.7208654", "0.7152161", "0.7123573", "0.71009004", "0.6979185", "0.6968148", "0.69598883", "0.69548553", "0.69495887", "0.6937144", "0.6812265", "0.6792436", "0.67497855", "0.671914", "0.66676164", "0.6654188", "0.6636162...
0.78866273
0
Always returns a readonly array of single characters, even for codon sequences.
def i(self): return np.array(self._sequence)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_char_array(s):\n if type(s) != bytes:\n raise ValueError('Input to to_char_array function should be in bytes')\n char_array = []\n tokens = s.split(b' ')\n for token in tokens:\n char_array.append(ord(' '))\n if isemoji(token):\n char_array.append(token)\n ...
[ "0.6162955", "0.5973711", "0.574557", "0.5743245", "0.57274646", "0.57254165", "0.5680359", "0.56634533", "0.56623495", "0.5628516", "0.56215113", "0.5609781", "0.55517864", "0.5528191", "0.5488369", "0.54747003", "0.5428007", "0.53952384", "0.537731", "0.5375679", "0.5373401...
0.50511724
51
Converts an integer to an alphabet equivilent
def alphabet_encode(number, alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ"): if not isinstance(number, (int, long)): raise TypeError("number must be an integer") if 0 <= number - 1 < len(alphabet): return alphabet[number - 1] base = '' while number != 0: number, r = divmod(number, len(a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_alphabet(number):\n return chr(number + 96)", "def get_alphabet(number):\n return chr(number + 96)", "def int_to_alpha(num):\n remainder = num\n text = []\n if num >= 26:\n major = remainder // 26\n text.append(ascii_lowercase[remainder // 26 - 1])\n remainder -= maj...
[ "0.8599202", "0.8599202", "0.8268884", "0.8218596", "0.8072347", "0.8066379", "0.80081505", "0.7729698", "0.7386837", "0.7326128", "0.7321771", "0.73217565", "0.72905993", "0.71751994", "0.7173629", "0.71488357", "0.7145458", "0.7137527", "0.7095061", "0.6982924", "0.69242847...
0.77570724
7
Sheet Size Get the size of the sheet.
def get_drawing_sheet_size(self): drawing_sheet_size_enum = { 9993: 'A0', 9994: 'A1', 9995: 'A2', 9996: 'A3', 9997: 'A4' } return drawing_sheet_size_enum[self.doc.Sheets(1).Size]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sheet_px(self):\n return self.image.size", "def width(self):\n return self.sheet.width", "def height(self):\n return self.sheet.height", "def getSize(self):\n return self.screen.get_size()", "def size(self):\n return self._ax.size", "def get_size(self):\n ...
[ "0.7155422", "0.7145198", "0.6696293", "0.6311784", "0.6203815", "0.6170172", "0.614004", "0.6112646", "0.6112646", "0.6112646", "0.6112646", "0.6112646", "0.6112646", "0.6112646", "0.6111653", "0.60817945", "0.6013408", "0.5942203", "0.5916718", "0.5890572", "0.588095", "0...
0.7440444
0
Return the energy of the satellite.
def geten(self): lat = self.getlatlon()[0] return (0.5*self._sm*(self._vr**2 + self._vt**2 + self._vp**2) + forces.wgs84_pot(self._r, lat)*self._sm) # G*self._mm*self._sm/self._r)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_energy(self):\r\n return self._energy", "def getEnergy(self):\n if not hasattr(self,\"energy\"):\n self.energy = self.calcEnergy()\n return self.energy", "def energy(self):\n return self._energy", "def E(self):\n return self.generic_getter(get_energy, \"E\", \"convert_ener...
[ "0.7802017", "0.7779786", "0.7775046", "0.77210236", "0.76014996", "0.754349", "0.7407291", "0.7307963", "0.7296487", "0.7278805", "0.7278805", "0.7273466", "0.722053", "0.7217305", "0.7211851", "0.72071874", "0.7206874", "0.72063994", "0.7061582", "0.7060914", "0.7044249", ...
0.0
-1
Return the semi major axis of the satellite.
def get_a(self): return 0.5*-G*self._mm*self._sm/self.geten()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def equatorial_flattening(self):\n return (self.semimajor_axis - self.semimedium_axis) / self.semimajor_axis", "def get_semiMajorAxes(*args):\n # call gm values\n de431a = get_semiMajorAxes_dict()\n a_out = []\n for naifID in args:\n bdyname = \"BODY\" + naifID + \"_semiMajorAxis\"\n ...
[ "0.65987885", "0.5913561", "0.5874253", "0.575957", "0.5694626", "0.5570727", "0.5450439", "0.53929514", "0.53390944", "0.53167", "0.52972984", "0.5287305", "0.5201529", "0.5170279", "0.51487815", "0.51131576", "0.508764", "0.5072412", "0.50663596", "0.50513506", "0.49880537"...
0.0
-1
Return eccentricity of orbit.
def get_ecc(self): mu_mass = G*(self._mm + self._sm) h_mom = self.sp_ang_mom() vel = self.getvel_xyz() pos = self.getpos_xyz() e_vec = 1.0/mu_mass*(np.cross(vel, h_mom) - mu_mass*pos/np.linalg.norm(pos)) return e_vec
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def orbital_eccentricity(self):\n return self._orbital_eccentricity", "def eccentricity(self):\n return sqrt(self.f * 2 - self.f ** 2)", "def eccentricity(self):\n return self.b / self.a", "def eccentricity(self):\n new_data = self._data[['pl_pnum', 'pl_orbper', 'pl_orbsmax',\n ...
[ "0.8272043", "0.8088623", "0.7950198", "0.7167175", "0.7021215", "0.6792659", "0.63974947", "0.6323228", "0.6103145", "0.60978574", "0.6093308", "0.5961122", "0.5938193", "0.59116626", "0.58898216", "0.5856262", "0.58329475", "0.5824408", "0.5822806", "0.58115864", "0.5778034...
0.6048928
11
Get the true anomaly of satellite.
def true_an(self): vel = self.getvel_sph() e_vec = self.get_ecc() pos = self.getpos_xyz() if np.linalg.norm(e_vec) == 0: h_mom = self.sp_ang_mom() e_vec = np.cross([0, 0, 1], h_mom) true_th = np.arccos(np.dot(e_vec, pos)/(np.linalg.norm(e_vec) * ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def anomaly(self):\n return self._anomaly(result_count=1, failure_amount=1)", "def galactic_correction_anomaly(self):\n anom = self.anom()\n return self.cartesian_map_array(anom, vmin=-0.1, vmax=0.1, bands=2);", "def find_anomaly():\n query_command = \"SELECT day FROM error_log WHERE error...
[ "0.7298908", "0.6191087", "0.5878371", "0.5812202", "0.5634714", "0.56208795", "0.5577764", "0.54375213", "0.5430601", "0.54168034", "0.5390509", "0.53788763", "0.5372811", "0.5371346", "0.53660834", "0.532335", "0.5296805", "0.52905905", "0.52845156", "0.5265431", "0.5243741...
0.0
-1
Sifts down heap from starting position down to stopping position. Helper for Dijkstra shortest path algorithm.
def __siftdown(heap, nodes, pos, stopPos = None): # Default stopping position to end of heap stopPos = stopPos if not None else len(heap) - 1 # Loop until past stopping position while pos < stopPos: # Set right and left child positions rChildPos = (pos + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sift_down(self, start, end):\n i, j = start, 2*start+1\n # Temporary variable to decrease exchange times\n temp = self.heap_list[start]\n # end is equal to len(self.heap_list)-1\n while j <= end:\n # compare left child node with right child node\n if j<e...
[ "0.7655046", "0.7627548", "0.7550814", "0.7384328", "0.7221247", "0.71275365", "0.70701253", "0.69876534", "0.69371676", "0.69053584", "0.67629975", "0.6756373", "0.6743562", "0.665822", "0.6635877", "0.6568616", "0.65231127", "0.6522574", "0.6501323", "0.6455546", "0.6421334...
0.70366675
7
Push a node onto the heap.
def __heappush(heap, nodes, node): pos = len(heap) heap.append(node) nodes[node[1]] = pos Graph.__siftup(heap, nodes, pos)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push(self, new_node):\n # Add a new node into the data list\n self.data.append(new_node)\n # Maintain the min heap\n self.heapify_up(len(self.data) - 1)", "def push(self, item):\n heapq.heappush(self.heap, item)", "def push(self, x):\n assert x not in self.rank\n ...
[ "0.7937989", "0.7867094", "0.7815276", "0.7815276", "0.7584626", "0.7573246", "0.748171", "0.74668956", "0.7451564", "0.7417054", "0.73625857", "0.73625857", "0.73625857", "0.7341388", "0.7313116", "0.73125184", "0.7294567", "0.7286378", "0.7274463", "0.7259147", "0.72492987"...
0.74202
9
Retrieves the value of the specified environment variable.
def env_variable(self, name: str) -> Optional[str]: _args = [ Arg("name", name), ] _ctx = self._select("envVariable", _args) return _ctx.execute_sync(Optional[str])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetEnvVariable(name):\n return os.environ.get(name)", "def getenv(self, var):\n return os.environ[var]", "def env(var):\n return os.environ[var]", "def windows_get_env_value(var_name: str) -> str:\n if var_name in os.environ.keys():\n return os.environ[var_name]", "def _get_env(k...
[ "0.81831956", "0.7972522", "0.7926396", "0.78623337", "0.783319", "0.77903026", "0.76746964", "0.76445436", "0.76375276", "0.7609442", "0.755719", "0.7531734", "0.74908495", "0.74019074", "0.7351648", "0.73402476", "0.7339749", "0.72997975", "0.72234595", "0.7216612", "0.7200...
0.6782163
40
Retrieves the list of environment variables passed to commands.
def env_variables(self) -> list["EnvVariable"]: _args: list[Arg] = [] _ctx = self._select("envVariables", _args) _ctx = EnvVariable(_ctx)._select_multiple( _name="name", _value="value", ) return _ctx.execute_sync(list[EnvVariable])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_env(self):\n env = {}\n for k, v in os.environ.items():\n k = k.decode() if isinstance(k, bytes) else k\n v = v.decode() if isinstance(v, bytes) else v\n env[k] = v\n return list(env.items())", "def get_env_vars():\n return [EnvVar(name=k, value=v...
[ "0.77872515", "0.7475562", "0.72771245", "0.72536695", "0.71774215", "0.71641856", "0.7119661", "0.7090317", "0.7089184", "0.7074179", "0.6998847", "0.6963431", "0.6893453", "0.6865305", "0.68650657", "0.6800763", "0.6800763", "0.6800763", "0.6800763", "0.6779927", "0.6779383...
0.7865112
0
Retrieves this container's root filesystem. Mounts are not included.
def fs(self) -> "Directory": warnings.warn( 'Method "fs" is deprecated: Replaced by "rootfs".', DeprecationWarning, stacklevel=4, ) _args: list[Arg] = [] _ctx = self._select("fs", _args) return Directory(_ctx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rootfs(self):\r\n return self._rootfs", "def rootfs(self):\r\n return self._rootfs", "def rootfs(self) -> \"Directory\":\n _args: list[Arg] = []\n _ctx = self._select(\"rootfs\", _args)\n return Directory(_ctx)", "def _get_mount(self):\n if not self._mount.endswi...
[ "0.7788737", "0.7788737", "0.7271668", "0.63438123", "0.629608", "0.6159942", "0.6147158", "0.60937226", "0.6086382", "0.60331404", "0.5960355", "0.5955966", "0.58940434", "0.58940434", "0.5892428", "0.58789295", "0.58696735", "0.5856978", "0.5837316", "0.5837316", "0.5836146...
0.53128815
66
Retrieves a hostname which can be used by clients to reach this container. Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable. Returns str The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freefor...
def hostname(self) -> str: _args: list[Arg] = [] _ctx = self._select("hostname", _args) return _ctx.execute_sync(str)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_hostname(self):\n\n # Display info message\n log.info(\"get_hostname\")\n\n # Get hostname\n output = await self.send_command(self.cmd_get_hostname)\n\n # Display info message\n log.info(f\"get_hostname: output: '{output}'\")\n\n # Remove the useless i...
[ "0.65890795", "0.6536303", "0.6509257", "0.64840835", "0.64606553", "0.64407516", "0.64041823", "0.63942474", "0.6393494", "0.62995166", "0.62910855", "0.6230252", "0.61710745", "0.6169512", "0.6168685", "0.61206555", "0.61118555", "0.61015284", "0.60687673", "0.60682136", "0...
0.72639436
0
Retrieves the value of the specified label. Returns Optional[str] The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raises ExecuteTimeoutError If the time to execute the query exceeds the con...
def label(self, name: str) -> Optional[str]: _args = [ Arg("name", name), ] _ctx = self._select("label", _args) return _ctx.execute_sync(Optional[str])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getValue(self, label, default=None):\n # Allow getValue using the label string\n if isinstance(label, basestring):\n label = str2Label(label)\n return self._labelDict.get(label, default)", "def string_value(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self,...
[ "0.6551689", "0.5934342", "0.5933134", "0.5895065", "0.58683586", "0.58683586", "0.58683586", "0.58683586", "0.58683586", "0.58683586", "0.58683586", "0.5774753", "0.5774753", "0.577213", "0.5752224", "0.5699184", "0.5693798", "0.5693798", "0.5693798", "0.5693798", "0.5608696...
0.57718027
14
The platform this container executes and publishes as. Returns Platform The platform config OS and architecture in a Container. The format is [os]/[platform]/[version] (e.g., "darwin/arm64/v7", "windows/amd64", "linux/arm64"). Raises ExecuteTimeoutError If the time to execute the query exceeds the configured timeout. Q...
def platform(self) -> Platform: _args: list[Arg] = [] _ctx = self._select("platform", _args) return _ctx.execute_sync(Platform)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def platform(self, return_str=True):\n architecture = self.arch(\"docker\")\n host_platform = self.osversion() + \"/\" + architecture\n if return_str:\n return host_platform.lower()\n return self.parse_platform(host_platform)", "def platform(self) -> pulumi.Output[str]:\n ...
[ "0.70846224", "0.6969208", "0.69408244", "0.68314826", "0.67310053", "0.67069256", "0.6661841", "0.6630605", "0.6626512", "0.6568049", "0.65129524", "0.633002", "0.6327338", "0.6287377", "0.6273267", "0.6258723", "0.62487274", "0.6242203", "0.62166417", "0.62071663", "0.61486...
0.7800112
0
Retrieves this container's root filesystem. Mounts are not included.
def rootfs(self) -> "Directory": _args: list[Arg] = [] _ctx = self._select("rootfs", _args) return Directory(_ctx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rootfs(self):\r\n return self._rootfs", "def rootfs(self):\r\n return self._rootfs", "def _get_mount(self):\n if not self._mount.endswith(os.path.sep):\n return \"%s%s\" % (self._mount, os.path.sep)\n else:\n return self._mount", "def GetRootFileEntry(sel...
[ "0.77884215", "0.77884215", "0.6343019", "0.62957567", "0.6158951", "0.6146067", "0.6093579", "0.6085776", "0.6032729", "0.59586734", "0.59546465", "0.58930963", "0.58930963", "0.58919084", "0.58781826", "0.5869607", "0.58564615", "0.583696", "0.583696", "0.5836034", "0.58270...
0.72710574
2
Retrieves this container plus the given environment variable.
def with_env_variable( self, name: str, value: str, expand: Optional[bool] = None, ) -> "Container": _args = [ Arg("name", name), Arg("value", value), Arg("expand", expand, None), ] _ctx = self._select("withEnvVariable", _ar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, key):\n return os.environ[key]", "def env(var):\n return os.environ[var]", "def _get_env(key: str) -> str:\n value = os.getenv(key)\n assert isinstance(value, str), (\n f\"the {key} environment variable must be set and a string, \" f\"{value=}\"\n ...
[ "0.66907495", "0.6585065", "0.6425539", "0.6366935", "0.63194776", "0.6316364", "0.6312415", "0.6297444", "0.62925535", "0.62174237", "0.6197452", "0.6173787", "0.6170713", "0.6167491", "0.6164289", "0.6162466", "0.6141566", "0.611857", "0.60782933", "0.6072546", "0.60469246"...
0.633415
4
Retrieves this container plus an env variable containing the given secret.
def with_secret_variable(self, name: str, secret: "Secret") -> "Container": _args = [ Arg("name", name), Arg("secret", secret), ] _ctx = self._select("withSecretVariable", _args) return Container(_ctx)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_secret(setting, secrets=secrets):\r\n try:\r\n return secrets[setting]\r\n except KeyError:\r\n error_msg = \"Set the {0} environment variable\".format(setting)\r\n raise ImproperlyConfigured(error_msg)", "def get_secret(setting, secrets=secrets):\n try:\n return secr...
[ "0.691501", "0.6893189", "0.67204016", "0.66619724", "0.6580341", "0.6438255", "0.6438255", "0.64169496", "0.6399984", "0.63771164", "0.62615126", "0.6224762", "0.6214608", "0.6208872", "0.61976445", "0.61972857", "0.6154571", "0.61503184", "0.6137395", "0.611469", "0.6071613...
0.5980047
25
The environment variable name. Returns str The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raises ExecuteTimeoutError If the time to execute the query exceeds the configured timeout. QueryE...
def name(self) -> str: if hasattr(self, "_name"): return self._name _args: list[Arg] = [] _ctx = self._select("name", _args) return _ctx.execute_sync(str)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def env_variable(self, name: str) -> Optional[str]:\n _args = [\n Arg(\"name\", name),\n ]\n _ctx = self._select(\"envVariable\", _args)\n return _ctx.execute_sync(Optional[str])", "def environment_name(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self,...
[ "0.7090671", "0.68008596", "0.67548966", "0.6717462", "0.67033243", "0.64816856", "0.63123107", "0.63031894", "0.6211757", "0.61837345", "0.615672", "0.6098947", "0.60560954", "0.60309213", "0.59729797", "0.59452945", "0.59197664", "0.5881984", "0.58806753", "0.5843121", "0.5...
0.5086345
89
The environment variable value. Returns str The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raises ExecuteTimeoutError If the time to execute the query exceeds the configured timeout. Query...
def value(self) -> str: if hasattr(self, "_value"): return self._value _args: list[Arg] = [] _ctx = self._select("value", _args) return _ctx.execute_sync(str)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def env_variable(self, name: str) -> Optional[str]:\n _args = [\n Arg(\"name\", name),\n ]\n _ctx = self._select(\"envVariable\", _args)\n return _ctx.execute_sync(Optional[str])", "def environment_value(self, name):\n if not os.environ.has_key(name):\n re...
[ "0.64593905", "0.61832523", "0.61599505", "0.613271", "0.60813355", "0.6045244", "0.60077274", "0.5966988", "0.5925418", "0.59231293", "0.5809414", "0.5777303", "0.57052636", "0.56948364", "0.56453896", "0.55949736", "0.5587414", "0.5586018", "0.5556676", "0.55510306", "0.553...
0.5813863
11
Lists of tags on the repository. Returns list[str] The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raises ExecuteTimeoutError If the time to execute the query exceeds the configured timeout...
def tags(self) -> list[str]: _args: list[Arg] = [] _ctx = self._select("tags", _args) return _ctx.execute_sync(list[str])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list(self):\n return self._post(\n request='list',\n uri=ApiUri.TAGS.value,\n ).get('tags')", "def do_list_tags(cs, args):\n resp, tags = cs.repositories.list_tags(args.repository)\n tags = [{\"Tag\": t} for t in tags]\n utils.print_list(tags, [\"Tag\"], sortby=\"...
[ "0.7537095", "0.7308341", "0.7147275", "0.706256", "0.69950134", "0.69553554", "0.6925393", "0.6891249", "0.6863067", "0.68479353", "0.6775054", "0.6760145", "0.66394955", "0.6558417", "0.65561694", "0.655354", "0.65425885", "0.6537936", "0.64859897", "0.643276", "0.63932294"...
0.80385756
0
The port description. Returns Optional[str] The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raises ExecuteTimeoutError If the time to execute the query exceeds the configured timeout. Query...
def description(self) -> Optional[str]: if hasattr(self, "_description"): return self._description _args: list[Arg] = [] _ctx = self._select("description", _args) return _ctx.execute_sync(Optional[str])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def description(self):\n return QueryCommand.desc_text", "def description(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"description\")", "def description(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"description\")", "def description(self) -> pul...
[ "0.6323781", "0.5866519", "0.5866519", "0.5866519", "0.5866519", "0.5866519", "0.5866519", "0.5866519", "0.5866519", "0.5866519", "0.5866519", "0.5866519", "0.5866519", "0.5866519", "0.5866519", "0.5866519", "0.5866519", "0.5866519", "0.5866519", "0.5866519", "0.5866519", "...
0.60819715
1
Documentation for what this command does. Returns Optional[str] The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raises ExecuteTimeoutError If the time to execute the query exceeds the confi...
def description(self) -> Optional[str]: if hasattr(self, "_description"): return self._description _args: list[Arg] = [] _ctx = self._select("description", _args) return _ctx.execute_sync(Optional[str])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def description(self):\n return QueryCommand.desc_text", "def query_text(self) -> str:\n return self._query_text", "def query(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"query\")", "def query(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"query\")", ...
[ "0.65657985", "0.6136409", "0.6035878", "0.5971953", "0.5971953", "0.59283996", "0.585003", "0.57558477", "0.5733034", "0.56353945", "0.55782545", "0.5556316", "0.5524568", "0.546731", "0.546731", "0.546731", "0.546731", "0.546731", "0.546731", "0.546731", "0.546731", "0.54...
0.6015443
5
The name of the command. Returns str The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raises ExecuteTimeoutError If the time to execute the query exceeds the configured timeout. QueryError I...
def name(self) -> str: if hasattr(self, "_name"): return self._name _args: list[Arg] = [] _ctx = self._select("name", _args) return _ctx.execute_sync(str)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query(self, command: str) -> str:\n return self._dmm.query(command).rstrip()", "def name(self) -> str:\n _args: list[Arg] = []\n _ctx = self._select(\"name\", _args)\n return _ctx.execute_sync(str)", "def command_name(self):\n return None", "def get_description(self):\n...
[ "0.6812283", "0.6717072", "0.66634417", "0.6342678", "0.59815717", "0.59802926", "0.59802204", "0.5974514", "0.5974514", "0.5974514", "0.591928", "0.5886252", "0.5794865", "0.5791462", "0.57757014", "0.57601476", "0.5731301", "0.5730324", "0.572132", "0.5713091", "0.5708666",...
0.6629308
6
The name of the type returned by this command. Returns Optional[str] The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raises ExecuteTimeoutError If the time to execute the query exceeds the ...
def result_type(self) -> Optional[str]: if hasattr(self, "_result_type"): return self._result_type _args: list[Arg] = [] _ctx = self._select("resultType", _args) return _ctx.execute_sync(Optional[str])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type_name(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"type_name\")", "def typeString(self):\n return Parameter.string_dict[self._field.type]", "def type_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"type_name\")", "def type_name(self) -...
[ "0.70715564", "0.6812481", "0.671579", "0.66758376", "0.6566107", "0.65146816", "0.65146816", "0.65146816", "0.65146816", "0.65146816", "0.65146816", "0.65146816", "0.65146816", "0.65146816", "0.65146816", "0.65146816", "0.65146816", "0.65146816", "0.65146816", "0.65146816", ...
0.6703356
3
Documentation for what this flag sets. Returns Optional[str] The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raises ExecuteTimeoutError If the time to execute the query exceeds the configur...
def description(self) -> Optional[str]: if hasattr(self, "_description"): return self._description _args: list[Arg] = [] _ctx = self._select("description", _args) return _ctx.execute_sync(Optional[str])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def description(self):\n return QueryCommand.desc_text", "def query_text(self) -> str:\n return self._query_text", "def text(self):\n return self.query.query", "def query(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"query\")", "def query(self) -> Optiona...
[ "0.66954607", "0.6290078", "0.5963271", "0.5948084", "0.5947623", "0.5822351", "0.5822351", "0.5822351", "0.5822351", "0.5822351", "0.5822351", "0.5822351", "0.5822351", "0.5822351", "0.5822351", "0.5822351", "0.5822351", "0.5822351", "0.5822351", "0.5822351", "0.5822351", ...
0.6148542
3
The name of the flag. Returns str The `String` scalar type represents textual data, represented as UTF8 character sequences. The String type is most often used by GraphQL to represent freeform humanreadable text. Raises ExecuteTimeoutError If the time to execute the query exceeds the configured timeout. QueryError If t...
def name(self) -> str: if hasattr(self, "_name"): return self._name _args: list[Arg] = [] _ctx = self._select("name", _args) return _ctx.execute_sync(str)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flag_name(self):\n return self._flag_name", "def flag(self) -> str:\n return pulumi.get(self, \"flag\")", "def single_flag_name(self):\n return self.enum_class.to_representation(self.flags.name)", "def name(self) -> str:\n _args: list[Arg] = []\n _ctx = self._select(\"n...
[ "0.6548668", "0.6199478", "0.6191867", "0.5886163", "0.5809203", "0.57427704", "0.57427704", "0.5735318", "0.55229014", "0.55206984", "0.5505872", "0.54994524", "0.5456496", "0.54313904", "0.5426892", "0.5407711", "0.5381708", "0.5360862", "0.5360862", "0.5356126", "0.5352852...
0.580718
8
The default platform of the builder. Returns Platform The platform config OS and architecture in a Container. The format is [os]/[platform]/[version] (e.g., "darwin/arm64/v7", "windows/amd64", "linux/arm64"). Raises ExecuteTimeoutError If the time to execute the query exceeds the configured timeout. QueryError If the A...
def default_platform(self) -> Platform: _args: list[Arg] = [] _ctx = self._select("defaultPlatform", _args) return _ctx.execute_sync(Platform)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def platform(self) -> Platform:\n _args: list[Arg] = []\n _ctx = self._select(\"platform\", _args)\n return _ctx.execute_sync(Platform)", "def platform(self):\n return self.random.choice([\n 'Laptop', \n 'Desktop', \n 'Workstation', \n 'Serv...
[ "0.7500557", "0.6820205", "0.68178904", "0.6788074", "0.67660815", "0.66832024", "0.66458005", "0.6618222", "0.6601224", "0.65934664", "0.6508021", "0.6468797", "0.64190835", "0.63798565", "0.6327381", "0.6266462", "0.6222256", "0.62124807", "0.6210097", "0.6066512", "0.60634...
0.7635805
0
The identifier for this secret. Note This is lazyly evaluated, no operation is actually run. Returns SecretID A unique identifier for a secret. Raises ExecuteTimeoutError If the time to execute the query exceeds the configured timeout. QueryError If the API returns an error.
def id(self) -> SecretID: _args: list[Arg] = [] _ctx = self._select("id", _args) return _ctx.execute_sync(SecretID)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def secret_id(self):\n if self._secret_id:\n return self._secret_id\n return self.device_id", "def credential_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"credential_id\")", "def secret(self, id: SecretID) -> \"Secret\":\n _args = [\n Arg(\"id\",...
[ "0.62632376", "0.56606525", "0.5575883", "0.5551399", "0.5475425", "0.54505223", "0.54505223", "0.542791", "0.54203725", "0.53091943", "0.5308966", "0.5299386", "0.5299386", "0.52866477", "0.5282878", "0.52595127", "0.52530897", "0.52530897", "0.52047634", "0.51913774", "0.51...
0.6752598
0
Get the model variables' config.
def get_case_variables_config() -> Any: return schemas.CaseVariableConfig.get_variables_config()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config(self):\n return self.config", "def _get_config(self):\n return self.__config", "def _get_config(self):\n return self.__config", "def _get_config(self):\n return self.__config", "def _get_config(self):\n return self.__config", "def _get_config(self):\n return self.__co...
[ "0.7204027", "0.7164446", "0.7164446", "0.7164446", "0.7164446", "0.7164446", "0.7164446", "0.7164446", "0.7164446", "0.7164446", "0.7164446", "0.7164446", "0.7164446", "0.7164446", "0.7164446", "0.7164446", "0.7164446", "0.7164446", "0.7164446", "0.7164446", "0.7164446", "...
0.6774942
86
Initialize a new Perceptron instance. A perceptron classifies data points as either belonging to a particular class (+1) or not (1). `dimensions` is the dimensionality of the data. For example, dimensions=2 would mean that the perceptron must classify 2D points.
def __init__(self, dimensions): self.w = nn.Parameter(1, dimensions)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_perceptron(train_exs: List[SentimentExample], feat_extractor: FeatureExtractor) -> PerceptronClassifier:\n raise Exception(\"Must be implemented\")", "def train_perceptron(train_exs: List[SentimentExample], feat_extractor: FeatureExtractor) -> PerceptronClassifier:\n raise Exception(\"Must be imp...
[ "0.6332484", "0.6332484", "0.6031983", "0.57528317", "0.57304436", "0.5729055", "0.5708329", "0.5662451", "0.5655464", "0.56148565", "0.55637246", "0.55211455", "0.55112016", "0.55009764", "0.545503", "0.54533994", "0.5441745", "0.54284245", "0.5391511", "0.53887767", "0.5374...
0.5600593
12
Calculates the predicted class for a single data point `x`.
def get_prediction(self, x): "*** YOUR CODE HERE question 1 ***" dProduct = nn.as_scalar(self.run(x)) if dProduct < 0: return -1 else: return 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(self,x):\n preds = [tree.predict(x) for tree in self.forest]\n if self.classify:\n cls_counts = [0] * self.param['numClasses']\n for p in preds:\n cls_counts[p] += 1\n return argmax(cls_counts)\n else:\n return sum(preds) /...
[ "0.7661384", "0.7574608", "0.755597", "0.754154", "0.7517479", "0.7363987", "0.7347751", "0.7347751", "0.73244995", "0.72761965", "0.7252081", "0.72349423", "0.7227634", "0.72211057", "0.72075224", "0.7197189", "0.7193229", "0.7173875", "0.7167893", "0.7153354", "0.7148989", ...
0.0
-1
Do a batched gather on a 3D tensor.
def batch_gather_3d(values, indices): return tf.gather(tf.reshape(values, [-1, tf.shape(values)[2]]), tf.range(0, tf.shape(values)[0]) * tf.shape(values)[1] + indices)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gather(input: torch.Tensor) -> Tuple[torch.Tensor]:\n return GatherLayer.apply(input)", "def gather(tensor):\n if PartialState().distributed_type == DistributedType.TPU:\n return _tpu_gather(tensor)\n elif PartialState().distributed_type in TORCH_DISTRIBUTED_OPERATION_TYPES:\n return _...
[ "0.6302166", "0.6237263", "0.6120555", "0.60212666", "0.6008304", "0.5993317", "0.59825003", "0.59671915", "0.59625334", "0.58826137", "0.5852146", "0.58414745", "0.57512283", "0.56198025", "0.5593949", "0.55925506", "0.5582084", "0.5577364", "0.5508032", "0.5507494", "0.5465...
0.6951424
0
Returns if the word is in the trie.
def search(self, word): def r_search(word,i,d): if len(word) <= i: return True if d == 0: return False return (word[i] in d) and r_search(word,i+1,d[word[i]]) tri = self.root.d if len(w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_trie(self, trie, word):\n current_dict = trie\n for letter in word:\n if letter in current_dict:\n current_dict = current_dict[letter]\n else:\n return False\n else:\n if '_end_' in current_dict:\n return curr...
[ "0.83870125", "0.81503856", "0.812409", "0.78561914", "0.78304696", "0.7793574", "0.7792858", "0.7764428", "0.7753157", "0.77472574", "0.7711177", "0.7680718", "0.76768374", "0.76643807", "0.7650987", "0.76334465", "0.76283187", "0.7610767", "0.75778055", "0.75693226", "0.756...
0.0
-1
Get the parent directory of this file. This makes it so the app will work, (and the db will be found) no matter the current working directory.
def getParentDirectory(): path = os.path.dirname(os.path.realpath(__file__)) path = '/'.join( path.split('/')[:-1] ) return path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_parent_path(self):\n return os.path.join(os.getcwd(), \"src\", \"data\", \"genes\")", "def get_base_dir(self):\n dir_of_this_file = os.path.dirname(os.path.abspath(__file__))\n return os.path.dirname(dir_of_this_file)", "def get_parent_dir(path):\n return os.path.dirname(path)"...
[ "0.78082865", "0.7638114", "0.7614312", "0.7529412", "0.75218713", "0.7497493", "0.74604976", "0.7340551", "0.728736", "0.7257311", "0.71410936", "0.71262145", "0.7101389", "0.70540065", "0.7024741", "0.7024741", "0.7021977", "0.7003165", "0.6980236", "0.6978866", "0.69738686...
0.82124346
0
Gets a collection of `InputExample`s for the train set.
def get_examples(self, data_dir, file_key="train"): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_train_inputs(self, example):\n return example", "def get_train_examples(self):\n raise NotImplementedError()", "def get_train_examples(self, input_file):\r\n raise NotImplementedError()", "def _create_examples(self, data, set_type):\n examples = []\n for (i, elem) in en...
[ "0.73499966", "0.7173421", "0.7126833", "0.65602446", "0.64204013", "0.64052176", "0.63422555", "0.6290186", "0.6282746", "0.625262", "0.62499267", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0.62466323", "0...
0.0
-1
Extract the bitfield value from a register value. self The Bitfield object. value Integer register value. Integer value of the bitfield extracted from `value`.
def get(self, value: int) -> int: return bfx(value, self._msb, self._lsb)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set(self, register_value: int, field_value: int) -> int:\n return bfi(register_value, self._msb, self._lsb, field_value)", "def _get_register_field(self, field):\n logger.debug(\"Getting field starting at bit {}, length {} from register {}\".format(\n field.startbit,field.length,fiel...
[ "0.651225", "0.64570737", "0.63985926", "0.6093686", "0.57431227", "0.5590481", "0.5459659", "0.5447185", "0.54428077", "0.5384992", "0.5379497", "0.53654367", "0.53242254", "0.525438", "0.52395594", "0.52010787", "0.51647145", "0.50800925", "0.50796056", "0.5056775", "0.5050...
0.55022365
6
Test whether two sequences contain the same values. Unlike a simple equality comparison, this function works as expected when the two sequences are of different types, such as a list and bytearray. The sequences must return compatible types from indexing.
def same(d1: Sequence[Any], d2: Sequence[Any]) -> bool: if len(d1) != len(d2): return False for i in range(len(d1)): if d1[i] != d2[i]: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sequence_equals(sequence1, sequence2):\n assert len(sequence1) == len(sequence2), (len(sequence1), len(sequence2))\n for item_from_s1, item_from_s2 in zip(sequence1, sequence2):\n assert item_from_s1 == item_from_s2, (item_from_s1, item_from_s2)\n\n return True", "def __eq__(self, seq):\n ...
[ "0.7813231", "0.7145499", "0.70590293", "0.7007046", "0.6919414", "0.6892941", "0.68648785", "0.6858367", "0.6839692", "0.67992145", "0.6797385", "0.6788613", "0.6783527", "0.67567945", "0.6742153", "0.67207736", "0.6698523", "0.6692463", "0.6635252", "0.6586327", "0.65729964...
0.7649041
1
Returns generator of all files with provided extension from given directory
def get_all_files(directory, extension): return (f for f in os.listdir(directory) if f.endswith(extension) and os.path.isfile(os.path.join(directory, f)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_files_in_dir(dir, ext):\n import os\n\n for root, dirs, files in os.walk(dir):\n for file in files:\n if file.split('.')[1].lower() == ext.lower() or not ext:\n file_full_path = os.path.join(root, file)\n yield file_full_path", "def __get_files(self, ...
[ "0.7799749", "0.7525258", "0.7381239", "0.7271311", "0.72625893", "0.7261094", "0.7162578", "0.7118412", "0.7086582", "0.70666647", "0.70133775", "0.699755", "0.69948506", "0.6990467", "0.6925858", "0.69024223", "0.6888082", "0.6884435", "0.68445224", "0.6844037", "0.68348545...
0.73597896
3
Returns true, if all elements of sequence are equal
def all_equal(sequence): return all(x == sequence[0] for x in sequence)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, seq):\n # If seq is different length or not a list, then it is not equal\n if self._length != len(seq) or not isinstance(seq, list):\n return False\n # seq is equal if every element at the same index has equivalent value\n return all(self._arr[i] == seq[i] fo...
[ "0.7771811", "0.7630559", "0.76040655", "0.74519235", "0.74492294", "0.74333686", "0.74333686", "0.73482615", "0.7314613", "0.7251249", "0.7221133", "0.71162134", "0.7042793", "0.69785583", "0.6889345", "0.6882769", "0.68535495", "0.68117934", "0.6715549", "0.66522205", "0.66...
0.8933809
0
Action generation method. This is a required method that generates list of actions corresponding to the list of 1units.
def gen_action(self, agent_list, observation, free_map=None): action_out = [] # for i in agent_list: # action_out.append(self.random.randint(0, 5)) # choose random action # # return action_out if free_map is not None: self.free_map = free_map for idx, agent i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_actions(self) -> list:\n pass", "def generate_actions(self):\n \n # For all state nodes\n action = 0\n \n for l in range(self.u0_n):\n for m in range(self.u1_n):\n \n u = np.array([ self.ud[0][l] , self.ud[1][m] ])\n...
[ "0.7722698", "0.67298526", "0.6564368", "0.62815326", "0.6203915", "0.6180544", "0.6176692", "0.6164795", "0.6116633", "0.59687513", "0.5946979", "0.5946116", "0.5942629", "0.5939091", "0.59108436", "0.58935547", "0.5885694", "0.5866792", "0.58295935", "0.58207333", "0.581962...
0.6441535
3
Fill episode object with episode number, name and inspectors. Perform some cleanup on episode name and inspectors.
def parse(self: object, data_row: list[str]): if len(data_row) == 0: return logging.debug("data row {}".format(data_row)) # Episode number is first element of row episode_id_raw: Match[str] = re.search(r"([0-9]+)", data_row[0]) self.episode_id = int(episode_id_raw.gro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_episode(e, debug=False):\n #{\"title\": , \"summary\": , \"image\": , \"link\": , \"season\": , \"number\": , \"rating\"}\n\n if debug:\n print(\"beginning create_episode()\")\n\n episode = {}\n\n # get BeautifulSoup data for extracting details\n episode_url = \"https://www.imdb.co...
[ "0.67322844", "0.6622096", "0.6532695", "0.6482621", "0.6362397", "0.6313687", "0.6313687", "0.63025767", "0.6289279", "0.61639607", "0.6160208", "0.6115685", "0.5955112", "0.59050155", "0.58917266", "0.58434886", "0.5837072", "0.58209985", "0.57344383", "0.5721815", "0.57147...
0.62322384
9
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
def isValid(self, s): # 1 if not s: return True # 2 if not len(s) % 2 == 0: return False comp = { ')': '(', ']': '[', '}': '{', } stack = [] for char in s: # 3 if char i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid(self, string) -> bool:\n while '()' in string or '{}' in string or '[]' in string:\n string = string.replace('()', '').replace('[]', '').replace('{}', '')\n\n return len(string) == 0", "def is_valid(s):\n in_str = False\n bb = 0\n for c in s:\n if c == '(' an...
[ "0.83772814", "0.82181084", "0.79815835", "0.7759584", "0.7669236", "0.7553811", "0.7465005", "0.7016728", "0.6838599", "0.6810634", "0.6720039", "0.6617623", "0.6605923", "0.65578765", "0.6520223", "0.64967394", "0.63794935", "0.6374473", "0.63681436", "0.63490343", "0.63196...
0.75636107
5
MonthlyScheduleParameters a model defined in Swagger
def __init__(self, start_time=None, frequency_type=None, day_of_month=None, week_of_month=None, day_of_week=None, months=None): # noqa: E501 # noqa: E501 self._start_time = None self._frequency_type = None self._day_of_month = None self._week_of_month = None self._day_of_week ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.swagger_types = {\n 'id': 'str',\n 'start_date': 'datetime',\n 'length_minutes': 'int',\n 'activities': 'list[BuAgentScheduleActivity]',\n 'manually_edited': 'bool',\n 'schedule': 'BuScheduleReference'\n }\n\...
[ "0.5771325", "0.5750534", "0.5725539", "0.5691441", "0.56467915", "0.5524476", "0.55190575", "0.55049896", "0.5370188", "0.5331168", "0.53186584", "0.5256994", "0.5249017", "0.52371025", "0.52100986", "0.52090067", "0.51944643", "0.5190768", "0.5183598", "0.51835346", "0.5168...
0.0
-1
Sets the start_time of this MonthlyScheduleParameters.
def start_time(self, start_time): self._start_time = start_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_time(self, start_time: str):\n if start_time is None:\n raise ValueError(\"Invalid value for `start_time`, must not be `None`\") # noqa: E501\n\n self._start_time = start_time", "def start_time(self, start_time):\n self._start_time = start_time", "def start_time(self,...
[ "0.6902185", "0.68328047", "0.68328047", "0.68051267", "0.6692985", "0.63848627", "0.6178726", "0.61568487", "0.61528385", "0.61297816", "0.61274856", "0.6086166", "0.6086166", "0.6086166", "0.6086166", "0.6086166", "0.6086166", "0.6086166", "0.6086166", "0.6086166", "0.60759...
0.6920715
4
Sets the day_of_month of this MonthlyScheduleParameters.
def day_of_month(self, day_of_month): self._day_of_month = day_of_month
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def monthly_day(self, monthly_day):\n\n self._monthly_day = monthly_day", "def __init__(__self__, *,\n day_of_month: Optional[pulumi.Input[str]] = None,\n day_of_week: Optional[pulumi.Input['RefreshScheduleMapScheduleFrequencyPropertiesRefreshOnDayPropertiesDayOfWeek']] = N...
[ "0.7128963", "0.6362633", "0.63394713", "0.6198328", "0.6083698", "0.59888995", "0.5959477", "0.58093905", "0.58093905", "0.5685598", "0.5654272", "0.5651076", "0.56197333", "0.56197333", "0.5604694", "0.5585938", "0.5585938", "0.5577093", "0.55378944", "0.5509653", "0.544917...
0.82245034
0
Sets the months of this MonthlyScheduleParameters.
def months(self, months): allowed_values = ["january", "feburary", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"] # noqa: E501 if not set(months).issubset(set(allowed_values)): raise ValueError( "Invalid values for `months`...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setMonth(self, *args):\n return _libsbml.Date_setMonth(self, *args)", "def set_Month(self, value):\n super(GetTimestampFromDateParametersInputSet, self)._set_input('Month', value)", "def set_monthly(self, interval, *, day_of_month=None, days_of_week=None,\n index=None, **kw...
[ "0.706509", "0.6490704", "0.63334316", "0.62851346", "0.6143732", "0.6106879", "0.60167474", "0.58650213", "0.5827655", "0.5698256", "0.5679997", "0.5614835", "0.56113094", "0.555234", "0.5551026", "0.5551026", "0.552642", "0.5522827", "0.551986", "0.5368505", "0.5368221", ...
0.72907597
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, MonthlyScheduleParameters): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.8455985", "0.83913255", "0.81440157", "0.8140831", "0.8132328", "0.80937284", "0.809181", "0.809181", "0.809181", "0.808509", "0.808509", "0.8076134", "0.8076134", "0.8065528" ]
0.0
-1
Return package version as listed in `__version__` in `init.py`.
def get_version(package): init_py = open(os.path.join(package, '__init__.py')).read() return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_version_from_package() -> str:\n path = join(dirname(__file__), \"__init__.py\")\n path = normpath(abspath(path))\n with open(path) as f:\n for line in f:\n if line.startswith(\"__version__\"):\n token, version = line.split(\" = \", 1)\n version = ve...
[ "0.84893894", "0.83908445", "0.83863354", "0.8380136", "0.8379423", "0.83694756", "0.83582735", "0.8357903", "0.835638", "0.8078477", "0.7975143", "0.7938866", "0.78928864", "0.78928864", "0.78928864", "0.78029025", "0.7722147", "0.7697877", "0.7694654", "0.7689602", "0.76594...
0.8370828
11
Return all files under the root package, that are not in a package themselves.
def get_package_data(package): walk = [ (dirpath.replace(package + os.sep, '', 1), filenames) for dirpath, dirnames, filenames in os.walk(package) if not os.path.exists( os.path.join(dirpath, '__init__.py') ) ] filepaths = [] for base, filenames in walk: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_packages( root ):\n for path, directories, files in os.walk( root ):\n if is_package( path ):\n yield path.replace( '/','.' )", "def get_all_files(self):\n\t\tfiles_list = []\n\t\tfor path, subdirs, files in os.walk(self.root):\n\t\t for name in files:\n\t\t \tfiles_list.appen...
[ "0.707678", "0.6983264", "0.6891394", "0.68547386", "0.6842646", "0.6842646", "0.6842646", "0.68319273", "0.67815185", "0.6732065", "0.6720336", "0.66818875", "0.66626537", "0.6660138", "0.6647442", "0.6609301", "0.6606118", "0.660427", "0.6595916", "0.65380406", "0.6512409",...
0.6172617
53
Explode a path into all its little giblets. _path_ should ideally be normalized first
def explode(self, path): log(6, "explode") gibs = [] head = path while True: if head == "/": gibs.insert(0, head) break head, tail = os.path.split(head) gibs.insert(0, tail) return gibs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_path(path):\n\n if type(path) != str:\n return []\n\n # replace multiple occurrences of \"/\" with just one,\n # i.e. \"page1//page2///page3\" -> \"page1/page2/page3\"\n path = re.sub('/+', '/', path)\n path = path.split(\"/\") # form a list of path steps\n ...
[ "0.76698107", "0.76123106", "0.7573121", "0.74729407", "0.7438995", "0.7427464", "0.72871464", "0.7274829", "0.7265844", "0.72539324", "0.720128", "0.70462716", "0.70108306", "0.6986025", "0.6976125", "0.697396", "0.6894155", "0.6888861", "0.6847659", "0.6845327", "0.68289995...
0.81297004
0
Returns the current pager's max record limit.
def get_max_record_limit(self): return self.max_record_limit
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_limit(self):\n return self.limit", "def get_limit(self):\n return self._limit", "def get_limit(self):\n return self._limit", "def limit(self):\n return self._limit", "def limit(self):\n return self._limit", "def get_max_per_page(self):\n return self.max_p...
[ "0.79489917", "0.7935458", "0.7935458", "0.76866376", "0.76866376", "0.7611077", "0.74051446", "0.73823917", "0.72391516", "0.71339834", "0.7114713", "0.7088168", "0.70171744", "0.6955063", "0.6900978", "0.68910086", "0.68852997", "0.68765527", "0.6857013", "0.6851564", "0.68...
0.87542504
0
Sets the current pager's max record limit.
def set_max_record_limit(self, limit): self.max_record_limit = limit
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def limit(self, limit):\n self._limit = limit", "def limit(self, limit):\n\n self._limit = limit", "def limit(self, limit):\n\n self._limit = limit", "def limit(self, limit):\n\n self._limit = limit", "def limit(self, limit):\n self._limit = limit\n return self", ...
[ "0.7553853", "0.7453811", "0.7453811", "0.7453811", "0.73704815", "0.73585373", "0.72966903", "0.72817314", "0.72808117", "0.7088113", "0.70641845", "0.7023995", "0.6950664", "0.6950664", "0.6940453", "0.68355906", "0.6828216", "0.68182147", "0.6778329", "0.6778268", "0.67564...
0.86914104
0
Sets the last page number.
def set_last_page(self, page): self.last_page = page if self.get_page() > page: self.set_page(page)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_page(self, last_page):\n\n self._last_page = last_page", "def __goToLastPage(self):\n try:\n self.currenturi = self.__baseuri + self.soup.find('li', \\\n 'lia-component-pagesnumbered').findAll('a', text=re.compile\\\n ('^\\d+$'))...
[ "0.8215517", "0.69604975", "0.6901287", "0.68505317", "0.6722965", "0.6489288", "0.6430108", "0.64163125", "0.6392034", "0.6353783", "0.6248091", "0.6230042", "0.619774", "0.6163872", "0.60937995", "0.60519964", "0.6001332", "0.59572214", "0.5896831", "0.57978165", "0.5753367...
0.8244133
0
Sets the current page.
def set_page(self, page): self.page = int(page) if self.page <= 0: # set first page, which depends on a maximum set if self.get_max_per_page() > 0: self.page = 1 else: self.page = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setCurrentPage(self):\n pass", "def current_page(self, current_page):\n\n self._current_page = current_page", "def _set_current_page(self, current_page):\n if not current_page:\n self.resolve_current_page()\n\n if not self._is_valid_page_number(current_page):\n ...
[ "0.8564853", "0.8274771", "0.7887133", "0.705451", "0.70353645", "0.70316905", "0.6863526", "0.67598087", "0.6703819", "0.66118544", "0.6544035", "0.6484599", "0.64590555", "0.6425014", "0.6299835", "0.6276845", "0.6276845", "0.6276845", "0.6276845", "0.6265614", "0.6194131",...
0.69051695
6
Sets the maximum number of results per page.
def set_max_per_page(self, max_per_page): if max_per_page > 0: self.max_per_page = max_per_page if self.page == 0: self.page = 1 elif max_per_page == 0: self.max_per_page = 0 self.page = 0 else: self.max_per_page = 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_results(self, max_results: float):\n\n self._max_results = max_results", "def paging_results(self):\n\n return 30", "def max_num_links(self, max_num_links):\n self._max_num_links = max_num_links", "def referencesearchservlet_max_pages(self, referencesearchservlet_max_pages):\n\n ...
[ "0.71293044", "0.7025348", "0.6938397", "0.6830816", "0.6801889", "0.67935455", "0.6776358", "0.6746384", "0.67307943", "0.663617", "0.6603123", "0.6603123", "0.6603123", "0.65810364", "0.6514217", "0.64977545", "0.6493299", "0.6493219", "0.6486678", "0.647359", "0.6461834", ...
0.78552073
0
Returns an ExpUserLastPlaythrough domain object given an ExpUserLastPlaythroughModel loaded from the datastore.
def get_last_playthrough_information(last_playthrough_model): return user_domain.ExpUserLastPlaythrough( last_playthrough_model.user_id, last_playthrough_model.exploration_id, last_playthrough_model.last_played_exp_version, last_playthrough_model.last_updated, last_playthroug...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_last_playthrough_information(last_playthrough_information):\n last_playthrough_information_model = (\n user_models.ExpUserLastPlaythroughModel(\n id=last_playthrough_information.id,\n user_id=last_playthrough_information.user_id,\n exploration_id=last_playthrough...
[ "0.6114415", "0.5247595", "0.515967", "0.4883792", "0.48731354", "0.4857871", "0.4835355", "0.48091578", "0.48020718", "0.475728", "0.47538674", "0.4676165", "0.46555308", "0.46250343", "0.4602909", "0.45962125", "0.45651177", "0.45483202", "0.45032454", "0.44917822", "0.4487...
0.7840123
0
Returns the next `n` tokens in a list.
def lookahead(self, n=1): while len(self._remaining) < n: self._remaining.append(next(self)) return [self._remaining[i] for i in range(n)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_n(self, n, fast_forward=False):\n return list(it.islice(self.gen, n))", "def next_n(iterator, N):\n try:\n items = []\n for _ in range(N):\n items.append(next(iterator))\n return items\n except StopIteration:\n if items:\n return items\n ...
[ "0.73431146", "0.6693711", "0.65088105", "0.64366317", "0.63886064", "0.6359041", "0.6342825", "0.6342825", "0.6342825", "0.6332765", "0.6322405", "0.6232221", "0.62166715", "0.62131953", "0.62082434", "0.619162", "0.6124147", "0.60628545", "0.60547453", "0.6005955", "0.59970...
0.60342956
19
Calculates vertical (z) acceleration of drone.
def z_dot_dot(self): # TODO 1 # Calculate the vertical component of the acceleration # You might find get_thrust_and_moment helpful c, M_x = self.get_thrust_and_moment() phi = self.X[2] zdd = (self.g - c * np.cos(phi)) / self.m print (zdd) retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAngVelZ(self):\n return self.angvel.getZ()", "def getVelZ(self):\n return self.posvel.getZ()", "def calc_vertical_velocity(self):\n # Note: again we make use of the automatically added 'grid' attribute, and the stored coef_w attribute.\n # Here we arbitrarily set the vertical...
[ "0.6356424", "0.6245218", "0.6242624", "0.6193167", "0.6136546", "0.61020046", "0.60854024", "0.60746443", "0.60497254", "0.5962692", "0.5945629", "0.58685344", "0.58629066", "0.58574307", "0.58556175", "0.58161336", "0.5802175", "0.57529724", "0.5745642", "0.5740741", "0.569...
0.67445016
0
Calculates lateral (y) acceleration of drone.
def y_dot_dot(self): # TODO 2 # Calculate the horizontal component of the acceleration c, M_x = self.get_thrust_and_moment() phi = self.X[2] ydd = (c * (1 - np.sin(phi))) / self.m print (ydd) return ydd
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accelerationCalcY(x,y):\r\n global G #glabel variables are initialised\r\n global massEarth\r\n return (-G*massEarth*y)/((x**2+y**2)**(3/2))# here from Newton's law of gravitation we return the acceleration on a projectile in the y direction\r", "def acceleration(self):\n # speed is by formul...
[ "0.66361797", "0.6630387", "0.6618695", "0.65110385", "0.6463736", "0.6398143", "0.6389902", "0.6293255", "0.6276663", "0.6251114", "0.61948687", "0.61565864", "0.6115372", "0.6078142", "0.6057548", "0.6028132", "0.59784347", "0.59588647", "0.59499264", "0.5949484", "0.589166...
0.5853288
23
Create a new RateLimitExceededResponse with either a body or json_body.
def __init__(self, status='429 Too Many Requests', status_code=429, headerlist=None, body=None, json_body=None, environ=None): super(RateLimitExceededResponse, self).__init__(headerlist=headerlist, charset="UTF-8") self.status_code = status_code self.status = status sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, message, details, retry_time):\n hdrs = RateLimitFault._retry_after(retry_time)\n self.wrapped_exc = webob.exc.HTTPTooManyRequests(headers=hdrs)\n self.content = {\n \"overLimit\": {\n \"code\": self.wrapped_exc.status_int,\n \"messag...
[ "0.6098914", "0.5905501", "0.5676667", "0.5556727", "0.54436296", "0.5438186", "0.5395934", "0.53916144", "0.5321462", "0.5206814", "0.51327455", "0.5109983", "0.50726634", "0.50726634", "0.5052899", "0.50337666", "0.503288", "0.50313205", "0.5016104", "0.49825332", "0.497274...
0.741112
0
Return whether progress bars are globally disabled or not. Progress bars used in `huggingface_hub` can be enable or disabled globally using [`~utils.enable_progress_bars`] and [`~utils.disable_progress_bars`] or by setting `HF_HUB_DISABLE_PROGRESS_BARS` as environment variable.
def are_progress_bars_disabled() -> bool: global _hf_hub_progress_bars_disabled return _hf_hub_progress_bars_disabled
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disable_progress_bars() -> None:\n if HF_HUB_DISABLE_PROGRESS_BARS is False:\n warnings.warn(\n \"Cannot disable progress bars: environment variable `HF_HUB_DISABLE_PROGRESS_BARS=0` is set and has\"\n \" priority.\"\n )\n return\n global _hf_hub_progress_bars_di...
[ "0.80954826", "0.78224474", "0.6812388", "0.6743026", "0.59798837", "0.58661014", "0.58661014", "0.5833561", "0.55916744", "0.55784994", "0.54817325", "0.5473092", "0.5446248", "0.5437637", "0.5380249", "0.531148", "0.53078437", "0.53021574", "0.53021574", "0.52922225", "0.52...
0.880397
0
Return the bssid for a access point associated with the packet
def scapy_layers_dot11_Dot11_ap_bssid(self): if self.haslayer(Dot11ProbeReq) or self.hasflag('FCfield', 'to-DS'): return self.addr1 else: return self.addr2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scapy_layers_dot11_Dot11_sta_bssid(self):\n\tif self.haslayer(Dot11ProbeReq) or self.hasflag('FCfield', 'to-DS'):\n\t\treturn self.addr2\n\telse:\n\t\treturn self.addr1", "def _ParseScanAccessPoint(self, bssid, active, output):\n logging.debug('BSSID %s data: %s', bssid, output)\n ap = AccessPoint()\n ...
[ "0.66561997", "0.5751736", "0.55849266", "0.5567842", "0.53363216", "0.5283974", "0.52727413", "0.5197677", "0.50932574", "0.5053118", "0.5039937", "0.49793264", "0.4975569", "0.49664629", "0.4964176", "0.49487025", "0.49456146", "0.49188927", "0.48956266", "0.4873034", "0.48...
0.7097048
0
Test that the scripts and container have been added to the template.
def test_template_content(self): c = Client() resp = c.get('/') self.assertIn(b'<div id="recent_reviews"></div>', resp.content) self.assertIn(b'<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>', resp.content) self.asser...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_script(self):\n path = Template().get_script()\n self.assertTrue(os.path.exists(path))", "def test_register_template(self):\n pass", "def test_container_no_assets(self):\n context = {}\n container_name = \"left\"\n html = container(context, container_name)\n ...
[ "0.68855286", "0.6569156", "0.6454451", "0.6438828", "0.6425775", "0.6329561", "0.6178871", "0.6175014", "0.60941225", "0.60901165", "0.60521126", "0.6021412", "0.6015235", "0.6014932", "0.6012382", "0.5960278", "0.59525883", "0.5903814", "0.5892183", "0.58905774", "0.5887932...
0.55412173
69
Mueller matrix operator for an quarterwave plate.
def op_quarter_wave_plate(theta): C2 = np.cos(2 * theta) S2 = np.sin(2 * theta) qwp = np.array([[1, 0, 0, 0], [0, C2**2, C2 * S2, -S2], [0, C2 * S2, S2 * S2, C2], [0, S2, -C2, 0]]) return qwp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_qmat(self):\n if self.model == 'ER':\n self.qmat = np.array([\n [-self.alpha, self.alpha],\n [self.alpha, -self.alpha],\n ])\n \n elif self.model == 'ARD':\n self.qmat = np.array([\n [-self.alpha, self.a...
[ "0.60673034", "0.6040835", "0.59534115", "0.5936303", "0.59071225", "0.5872927", "0.5841236", "0.58081967", "0.5794956", "0.5728738", "0.57063866", "0.5670171", "0.5620856", "0.5606768", "0.5600662", "0.5588184", "0.55748636", "0.55673945", "0.55352193", "0.5526969", "0.55140...
0.6152456
0
Stokes vector for light polarized at angle theta from the horizontal plane.
def stokes_linear(theta): if np.isscalar(theta): return np.array([1, np.cos(2*theta), np.sin(2*theta), 0]) return np.array([np.ones_like(theta), np.cos(2*theta), np.sin(2*theta), np.zeros_like(theta)]).T
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rayleigh(v0):\r\n # Need to sample the angle theta from the phase function\r\n loop_condition = True\r\n while loop_condition:\r\n eps = random.random()*np.pi # Sampled x coordinate from 0 to pi\r\n eta = random.random()*(3/4)*2 # Sampled y coordinate from 0 to max of Rayleigh phase func...
[ "0.60356766", "0.58448327", "0.581046", "0.5783196", "0.57799584", "0.5669861", "0.56460464", "0.56326866", "0.56157917", "0.5483285", "0.54452956", "0.5406635", "0.53951234", "0.5389403", "0.5361876", "0.5356048", "0.5340756", "0.53296983", "0.5326263", "0.5304438", "0.52986...
0.5842513
2
Stokes vector for vertical polarized light.
def stokes_vertical(): return np.array([1, -1, 0, 0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vector_polar(v):\n return vector_mag(v), vector_angle(v)", "def calcul_v_sphere(r):\n volume = 4/3 * math.pi * (r ** 3)\n return volume", "def rayleigh(v0):\r\n # Need to sample the angle theta from the phase function\r\n loop_condition = True\r\n while loop_condition:\r\n eps = ra...
[ "0.589377", "0.5741251", "0.5730084", "0.5728626", "0.5676611", "0.56667644", "0.5650076", "0.5563742", "0.55254483", "0.54606766", "0.5449218", "0.54369754", "0.54300106", "0.5413834", "0.5402253", "0.53944075", "0.5390309", "0.53888935", "0.53772324", "0.53700924", "0.53613...
0.6714072
0
Stokes vector for vertical polarized light.
def stokes_unpolarized(): return np.array([1, 0, 0, 0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stokes_vertical():\n return np.array([1, -1, 0, 0])", "def vector_polar(v):\n return vector_mag(v), vector_angle(v)", "def calcul_v_sphere(r):\n volume = 4/3 * math.pi * (r ** 3)\n return volume", "def rayleigh(v0):\r\n # Need to sample the angle theta from the phase function\r\n loop_c...
[ "0.6714072", "0.589377", "0.5741251", "0.5730084", "0.5676611", "0.56667644", "0.5650076", "0.5563742", "0.55254483", "0.54606766", "0.5449218", "0.54369754", "0.54300106", "0.5413834", "0.5402253", "0.53944075", "0.5390309", "0.53888935", "0.53772324", "0.53700924", "0.53613...
0.5728626
4
Stokes vector using ellipsometer parameters. This creates a Stokes vector for the specific set of ellipsometry parameters tanpsi and Delta. See Fujiwara table 3.1 for example.
def stokes_ellipsometry(tanpsi, Delta): psi = np.arctan(tanpsi) cp = np.cos(2*psi) sp = np.sin(2*psi) cd = np.cos(2*Delta) sd = np.sin(2*Delta) if np.isscalar(tanpsi) and np.isscalar(Delta): return np.array([1, -cp, sp*cd, -sp*sd]) return np.array([np.ones_like(tanpsi), -cp, sp*cd, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Stokes_from_linear(self):\n (Ex,Ey) = self.linear\n self.logger.debug(\"Stokes_from_linear: (Ex, Ey) = %s\", (Ex,Ey))\n (Exc,Eyc) = self.linear.conj()\n self.logger.debug(\"Stokes_from_linear: (Ex*,Ey*) = %s\", (Exc,Eyc))\n (Sxx,Syy) = abs(self.linear*self.linear.conj())\n self.logger.debug(...
[ "0.60508937", "0.5953389", "0.5497419", "0.54203093", "0.5364661", "0.53449655", "0.5343437", "0.5288109", "0.516597", "0.51629436", "0.51338726", "0.5108275", "0.5054561", "0.50430876", "0.5008257", "0.5005713", "0.49933615", "0.49854788", "0.49025834", "0.48844898", "0.4881...
0.6754775
0
Stokes vector for partially polarized elliptically polarized light.
def stokes_elliptical(DOP, azimuth, ellipticity): omega = np.arctan(ellipticity) cw = np.cos(2*omega) sw = np.sin(2*omega) ca = np.cos(2*azimuth) sa = np.sin(2*azimuth) if np.isscalar(DOP): unpolarized = np.array([1-DOP, 0, 0, 0]) polarized = DOP * np.array([1, cw*ca, cw*sa, sw])...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sphrad(vol):\n return (3.*vol/(4.*np.pi))**(1./3.)", "def sphvol(r):\n return (4./3.)*np.pi*(r**3.)", "def stokes_unpolarized():\n return np.array([1, 0, 0, 0])", "def surfaceIntSphere(r: float) -> float:\n return 4.0 * np.pi * r * r", "def getSphereRadius(self):\n return 1.5", "de...
[ "0.63318723", "0.6327714", "0.62442666", "0.6202967", "0.59498054", "0.5947127", "0.58631104", "0.5786203", "0.5764818", "0.5729561", "0.5717512", "0.5711444", "0.5681383", "0.5662926", "0.56335145", "0.56233054", "0.56137854", "0.5602428", "0.5598201", "0.5544973", "0.552453...
0.5672353
13
Update state of Kalman Filter given all observation obtained so far (up to time t1).
def update_state(self): # return initial state if no observation was yet if len(self.obs_history) == 0: return self.kf.initial_state_mean, self.kf.initial_state_covariance hist = np.ma.masked_array(self.obs_history, mask=np.zeros((1,))) for i in range(len(hist)): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter(self, likelihood=False, calculate_backwards_inital=False):\n # Initial values\n ll_hist = []\n T = self.n_observations()\n y_pred_online = np.zeros((self.observations_size, 1, T))\n final_gain_partial = None\n\n # Kalman Filter and update over all observations t...
[ "0.655686", "0.64168936", "0.6395035", "0.6384938", "0.6383031", "0.63251776", "0.622099", "0.6185678", "0.61494666", "0.61440665", "0.6137328", "0.61222386", "0.60464853", "0.59837836", "0.5950761", "0.59455943", "0.5929507", "0.57840264", "0.57721776", "0.5734677", "0.57176...
0.5416754
45
Creates a dict representation of the FeatureManager's composition. Overrides the GeometricFeature.
def getRepresentationForCollection(self): feat_data = self.getOptionQueryValues() feat_data['feature'] = self.name feat_data['GeometricFeatureQuery'] = feat_data['GeometricFeatureQuery'].name feat_data['child'] = self.features[0].getRepresentationForCollection() return feat_data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dict(self):\n\n # base features\n dict_ = {\n 'name': self.name,\n 'desc_short': self.desc_short,\n 'desc_long': self.desc_long,\n 'rating_fun': self.rating_fun,\n 'rating_scenic': self.rating_scenic,\n 'rating_aerobic': self.ra...
[ "0.73768866", "0.6599205", "0.64819133", "0.63767844", "0.6300593", "0.6230714", "0.62228936", "0.6203845", "0.6155244", "0.61520356", "0.6145497", "0.613381", "0.6129826", "0.61287194", "0.6110831", "0.6090183", "0.6058883", "0.6037409", "0.60251963", "0.6013946", "0.5963965...
0.6133701
12
Check if a string is a numeric (int or float) value
def isNumber(s): try: float(s) return True except ValueError: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid_numeric(inString):\r\n return is_int(inString) or is_float(inString)", "def is_number(string):\r\n try:\r\n float(string)\r\n return True\r\n except ValueError: return False", "def is_number(string):\n try:\n float(string)\n return True\n except ValueErro...
[ "0.90552557", "0.8473757", "0.846435", "0.84133816", "0.83821726", "0.833728", "0.8324079", "0.8320123", "0.8309022", "0.8282817", "0.8282817", "0.8282817", "0.8273851", "0.82565033", "0.8231587", "0.8166819", "0.816083", "0.8156185", "0.8136535", "0.79312146", "0.791868", ...
0.8207844
15