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
Get list of raw device data from API.
async def get_discovered_device_data(self): json = self._api_call("monitors/%s/devices" % self.sense_monitor_id) return await json
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_devices(self):\n return self.api_request('GET', self.url + '/device', {})", "def list_devices(self):\n response = self.oauth.get(url=f'{self.base_url}/json/devices/list')\n\n result = response.json()['device']\n for device in result:\n print(device)", "def ret_dev...
[ "0.7556791", "0.7139203", "0.7127991", "0.7123771", "0.7021001", "0.7011559", "0.7006216", "0.69802994", "0.6968453", "0.69045895", "0.68921715", "0.68710256", "0.6829667", "0.6820097", "0.6667134", "0.6664936", "0.6608421", "0.6592165", "0.65915847", "0.6578008", "0.65389687...
0.63385224
34
Get date based on timezone and offset of days.
def get_date(zone, offset=0): return datetime.date(datetime.fromtimestamp( time.time() + 86400 * offset, tz=zone))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_offset():\n offset = datetime.date.today() - start_day\n return int(offset.days) - 4", "def create_timestamp_w_tz_and_offset(timezone=None, days=0, hours=0, minutes=0,\n seconds=0):\n if timezone is None:\n timezone = time.strftime(\"%z\")\n\n timest...
[ "0.60791385", "0.60785997", "0.5883528", "0.58224887", "0.5757241", "0.56442636", "0.5641485", "0.5621444", "0.56058043", "0.5598488", "0.5572765", "0.5568681", "0.55648154", "0.55442834", "0.5543557", "0.55406404", "0.5535026", "0.5504079", "0.54825795", "0.54570186", "0.544...
0.7589974
0
Sets the position/orientation of the camera
def set_transform(self, tf): self.camera.SetTransform(tf)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setCamera(self, viewX=0, viewY=0):\n self.viewX = viewX\n self.viewY = viewY", "def setup_camera(self) -> None:\n self.world.camera.update(\n cam_base_pos=(0, -3, 0),\n cam_dist=1.2*self.world.env_dim,\n cam_yaw=0,\n cam_pitch=-60\n )", ...
[ "0.74517936", "0.7075922", "0.70559186", "0.69642186", "0.69341475", "0.6802597", "0.67273635", "0.67115855", "0.671129", "0.6621609", "0.65148026", "0.6513595", "0.64830905", "0.6422106", "0.6420938", "0.6412979", "0.64069223", "0.6376349", "0.635086", "0.6345944", "0.632475...
0.6305347
21
Gets the number of link geometries associated with a given kinbody and link
def get_num_link_geometries(self, body, link_idx=0): with self.lock: return self.send_command('get_num_link_geometries ' + body.GetName() + ' ' + str(link_idx))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_num_forward_link(link):\n text = req_obj.get_html_text(link)\n soup = bs4.BeautifulSoup(text, 'lxml')\n le = soup.find_all('a', href=True)\n return len(le)", "def num_links(self):\n count=0.0\n for cluster in self.clusters:\n if self.clusters[cluster] == self.clusters[cluster].an...
[ "0.6403652", "0.6362696", "0.6263744", "0.62443", "0.5989617", "0.59228563", "0.5922278", "0.5915772", "0.5889203", "0.5854099", "0.58290184", "0.5684666", "0.5638639", "0.56318015", "0.55946994", "0.55885696", "0.5576055", "0.5572077", "0.55576885", "0.55256635", "0.55130285...
0.84480274
0
Returns True if the given blog is not set up.
def not_supported(cls, website): if website in cls.urls.keys(): return False else: return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_post(self, frontmatter):\n is_post = frontmatter.get('blog', False)\n if type(is_post) != bool:\n raise AbortError(\n _('Invalid blog frontmatter (expects True or False): '\n '{blog_value}').format(blog_value=is_post))\n return is_post", "de...
[ "0.6849887", "0.58953637", "0.58428", "0.5701575", "0.5701575", "0.56238514", "0.55427474", "0.5517662", "0.549739", "0.548969", "0.5468646", "0.54302114", "0.54277956", "0.54161274", "0.534334", "0.5329911", "0.53286654", "0.53261477", "0.53107125", "0.52782327", "0.52735007...
0.5467812
11
A list of KVStore available instance classes.
def instance_classes(self) -> Sequence[str]: return pulumi.get(self, "instance_classes")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_instance_classes():\n return Base_Instance.instance_classes", "def get_instance_classes():\n return Base_Instance.get_instance_classes()", "def instance_types(self) -> Sequence[str]:\n return pulumi.get(self, \"instance_types\")", "def get_classes(self):\n return", "def get_...
[ "0.7744035", "0.7582692", "0.6712845", "0.6555117", "0.6532984", "0.64976305", "0.6492079", "0.6487971", "0.6476188", "0.6308859", "0.6283517", "0.62746876", "0.6183571", "0.6155842", "0.6133857", "0.6122481", "0.6084932", "0.60575515", "0.60575515", "0.60575515", "0.60575515...
0.77790123
0
Returns lines from a data file with blank lines skipped optionally. If preserve_blank_lines is False (the default), returns a list of all nonblank lines. If it is True, returns a list of lists.
def data_file_lines(year=None, day=None, part_num=1, preserve_blank_lines=False, testing=False): lines = read_data_file(year, day, part_num, testing).split("\n") if not preserve_blank_lines: return [line for line in lines if line] groups = [] for k, g in itertools.groupby(lines, key=lambda x: x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fileLinesToList(filename) :\n o = []\n with open(filename, \"r\") as fi :\n for l in fi :\n if l.strip() != \"\" :\n o.append(l.strip())\n return o", "def load_lines(file_path):\n with open(file_path, 'r') as f:\n lines = list(filter(bool, map(str.strip, f...
[ "0.6356116", "0.609052", "0.60165936", "0.5945445", "0.5922453", "0.5859009", "0.5858174", "0.58524704", "0.5723423", "0.56778884", "0.5658025", "0.5608927", "0.5566763", "0.5563317", "0.55261725", "0.5493119", "0.5481364", "0.5480309", "0.54704636", "0.54692996", "0.54451483...
0.6925873
0
Given an iterable, returns a (min, max) tuple.
def minmax(xs): min_val = None max_val = None for x in xs: if min_val is None or x < min_val: min_val = x if max_val is None or x > max_val: max_val = x return (min_val, max_val)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_min_max_tuple(min_max_tuple, value):\n min_v, max_v = min_max_tuple\n\n min_v = smart_min(min_v, value)\n max_v = smart_max(max_v, value)\n\n return (min_v, max_v)", "def get_min_max(ints):\n current_max = None\n current_min = None\n\n if (len(ints) == 0) or (ints is None):\n ...
[ "0.76790226", "0.75757015", "0.75199157", "0.73725224", "0.7279919", "0.72664887", "0.7221798", "0.71839345", "0.71580034", "0.71373194", "0.7022518", "0.70084894", "0.69950163", "0.69783235", "0.69182503", "0.6855367", "0.68523395", "0.67649716", "0.6733999", "0.66961884", "...
0.7536954
2
Create and read a graph protobuf file.
def read_graph_file(path): node_graph = graph_pb2.Scene() if not os.path.exists(path): getLog().error("Missing graph file: {}".format(path)) return with open(path, "rb") as read_file: node_graph.ParseFromString(read_file.read()) return node_graph
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_graph():\n # Creates graph from saved graph_def.pb.\n with tf.gfile.FastGFile(os.path.join(\n FLAGS.model_dir, pbfilename), 'rb') as f:\n graph_def = tf.GraphDef()\n graph_def.ParseFromString(f.read())\n _ = tf.import_graph_def(graph_def, name='')", "def create_graph():\n with tf.gfil...
[ "0.7529669", "0.74763846", "0.7384931", "0.7202043", "0.71508205", "0.71257687", "0.71077937", "0.71077937", "0.7067716", "0.7063199", "0.6942392", "0.68828213", "0.6814541", "0.67548376", "0.6724153", "0.66559505", "0.6634346", "0.6620662", "0.6575481", "0.6574648", "0.65454...
0.7197919
4
Copies the current Map into a new one and returns it.
def copy(self): m = Map(features=self._features, width=self._width, height=self._height, **self._attrs) m._folium_map = self._folium_map return m
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy(self) -> 'Map':\n return self.__class__(self)", "def copy(self):\n return self.__class__(*self.maps[:-1], self.maps[-1].copy())", "def copy(self):\n return self.from_dict(self.to_dict(True))", "def copy(self):\n return pdict(dict.copy(self))", "def __copy__(self):\n ...
[ "0.79360616", "0.7414414", "0.7252267", "0.7013057", "0.685424", "0.6654162", "0.6610313", "0.65832585", "0.653613", "0.65152687", "0.6422543", "0.6422543", "0.63795483", "0.6378381", "0.63778543", "0.6367959", "0.6361225", "0.62748367", "0.6230635", "0.6220477", "0.62132144"...
0.7206358
3
GeoJSON representation of the marker as a point.
def geojson(self, feature_id): lat, lon = self.lat_lon return { 'type': 'Feature', 'id': feature_id, 'geometry': { 'type': 'Point', 'coordinates': (lon, lat), }, }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _convert_point(cls, feature):\n lon, lat = feature['geometry']['coordinates']\n popup = feature['properties'].get('name', '')\n return cls(lat, lon)", "def point(self):\n return shapely.geometry.Point(self._x[0], self._x[1])", "def as_geojson(self):\n return _property_op(...
[ "0.670136", "0.6661591", "0.65117884", "0.6434769", "0.6411595", "0.61640567", "0.6153045", "0.6125911", "0.61187875", "0.611866", "0.6099605", "0.60916865", "0.60896635", "0.6006719", "0.5995462", "0.5994926", "0.5980943", "0.59537286", "0.5911788", "0.5900167", "0.58981293"...
0.6348179
5
Return markers from the columns of a table. The first two columns of the table must be the latitudes and longitudes (in that order), followed by 'labels', 'colors', 'color_scale', 'radius_scale', 'cluster_by', 'area_scale', and/or 'areas' (if applicable) in any order with columns explicitly stating what property they a...
def map_table(cls, table, clustered_marker=False, include_color_scale_outliers=True, radius_in_meters=False, **kwargs): lat, lon, lab, color, areas, colorbar_scale, index_map, cluster_labels, other_attrs = None, None, None, None, None, None, None, None, {} excluded = ["color_scale", "cluster_by", "radiu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_coordinates(table, replace_columns=False, remove_nans=False):\n assert \"zip code\" in table.labels or ((\"city\" in table.labels or \"county\" in table.labels) and \"state\" in table.labels)\n ref = Table.read_table(pkg_resources.resource_filename(__name__, \"geodata/geocode_states.csv\"))\n\n in...
[ "0.56542283", "0.53770643", "0.5304239", "0.51435244", "0.5074048", "0.5061155", "0.4993597", "0.49675688", "0.49648488", "0.49519774", "0.49303818", "0.4921288", "0.49075612", "0.48337853", "0.4819396", "0.4747756", "0.47472736", "0.4735272", "0.4717508", "0.47082648", "0.47...
0.61870337
0
Return a latitudelongitude pairs from nested GeoJSON coordinates. GeoJSON coordinates are always stored in (longitude, latitude) order.
def _lat_lons_from_geojson(s): if len(s) >= 2 and isinstance(s[0], _number) and isinstance(s[0], _number): lat, lon = s[1], s[0] return [(lat, lon)] else: return [lat_lon for sub in s for lat_lon in _lat_lons_from_geojson(sub)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge_location_features_in_one(coords):\n\tgeojson_dict = []\n\tfor element in coords:\n\t\tgeojson_loc = frappe.parse_json(element[\"location\"])\n\t\tif not geojson_loc:\n\t\t\tcontinue\n\t\tfor coord in geojson_loc[\"features\"]:\n\t\t\tcoord[\"properties\"][\"name\"] = element[\"name\"]\n\t\t\tgeojson_dict...
[ "0.6478262", "0.6418348", "0.64105254", "0.6342512", "0.6091986", "0.60729295", "0.6022129", "0.5997562", "0.59840506", "0.5970409", "0.59573513", "0.58201283", "0.58112025", "0.5772406", "0.56998754", "0.56480247", "0.5639661", "0.5599052", "0.5579919", "0.5579005", "0.55773...
0.6927235
0
Creates a sprite uning a ball image.
def __init__(self, *args, **kwargs): super(Target, self).__init__(*args, **kwargs) self.speed = kwargs.get('speed', 5) self.name = kwargs.get('name', 'andreas') self.state = kwargs.get('state', 'moving') self.z = kwargs.get('z', 2.5) pyglet.media.load('assets\\pappa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_ball_sprite(x,y):\n ball_img = pyglet.resource.image('football100.png')\n ball_img.anchor_x = ball_img.width/2\n ball_img.anchor_y = ball_img.height/2\n\n mass = 10\n radius = ball_img.width/2\n\n ball_sprite = pyglet.sprite.Sprite(ball_img)\n ball_sprite.body = pymunk.Body(mass, py...
[ "0.74396855", "0.62991494", "0.6271579", "0.62264407", "0.6178108", "0.6121294", "0.6113896", "0.61044544", "0.6046044", "0.6044197", "0.59878355", "0.5910642", "0.5910642", "0.59084773", "0.58839744", "0.58699006", "0.586375", "0.5855459", "0.58551806", "0.5843764", "0.58437...
0.0
-1
Calculate the size of a tuple of bounds. Bounds are expected to be in the `(left, top, right, bottom)` or `(start_x, start_y, end_x, end_y)` format.
def bounds2locsize( bounds: tuple[int, int, int, int], origin: str = "upper", ) -> np.ndarray: left, top, right, bottom = bounds origin = origin.lower() if origin == "upper": return np.array([left, top]), np.array([right - left, bottom - top]) if origin == "lower": return np.arra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boundaries_size(*args):\n return _ida_hexrays.boundaries_size(*args)", "def _rect_size(self):\n bnd = self._bounds\n return (bnd[1][0] - bnd[0][0], bnd[1][1] - bnd[0][1])", "def calculate_size(self):\n top_left_y = 0\n top_left_x = 0\n\n bottom_right_y = 1\n botto...
[ "0.69580454", "0.6714257", "0.6616265", "0.66041327", "0.65464944", "0.65309787", "0.65208125", "0.64766854", "0.64363474", "0.64262456", "0.64205474", "0.6420284", "0.6413827", "0.64060396", "0.64059436", "0.6396464", "0.63853353", "0.6384843", "0.6361851", "0.6298861", "0.6...
0.6836688
1
Add padding to bounds.
def pad_bounds( bounds: tuple[int, int, int, int], padding: int | tuple[int, int] | tuple[int, int, int, int], ) -> tuple[int, int, int, int]: if np.size(bounds) % 2 != 0: msg = "Bounds must have an even number of elements." raise ValueError(msg) ndims = np.size(bounds) // 2 if np.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def padding(self):\n if not self._pixels:\n return Bounds(0, 0, 0, 0)\n row_inked = tuple(self._1 in _row for _row in self._pixels)\n if not any(row_inked):\n return Bounds(self.width, self.height, 0, 0)\n bottom = row_inked[::-1].index(True)\n top = row_ink...
[ "0.66677403", "0.64813507", "0.6472545", "0.62658536", "0.62641674", "0.6205086", "0.6111384", "0.60954785", "0.6092636", "0.605166", "0.6017214", "0.5975876", "0.591297", "0.5909612", "0.5908333", "0.5863547", "0.58316946", "0.5831265", "0.58289635", "0.58284175", "0.5809569...
0.7346426
0
Get info about currently logged user.
def about_me(current_user: models.User = Depends(get_current_user)): return current_user
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_info(self):\n return self.auth.get_user_by_session()", "def current_user_info():\n\n return current_user", "def user_info(self):\n \n return self.auth.get_user_by_session()", "def get_user(self):\n\n r = requests.get(\n self._url('/usermanagement/userinfo'),...
[ "0.8687883", "0.86669225", "0.86180896", "0.8005923", "0.79692215", "0.79059416", "0.7804443", "0.7797583", "0.7788759", "0.77815187", "0.77257323", "0.7724499", "0.7636065", "0.76329255", "0.76178235", "0.75865537", "0.7576919", "0.75685453", "0.75454754", "0.75230664", "0.7...
0.0
-1
Remove null values and separate multilabel values with comma
def remove_NA(d): if d['label'] == None: d['label'] = np.array('NA') if ' ' in d['label']: d['label'] = ",".join(sorted(d['label'].split())) return d
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _remove_blank_graph_labels(data):\n # TODO: parse properly\n processed = []\n for line in data.split('\\n'):\n fields = line.split()\n if len(fields) >= 4 and _is_blank(fields[3]):\n fields = fields[:3] + fields[4:]\n processed.append(' '.join(fields))\n return '\\n'...
[ "0.6098444", "0.589943", "0.5587264", "0.5574549", "0.5546075", "0.5444395", "0.5443219", "0.54326266", "0.54279184", "0.54242325", "0.5378026", "0.53722537", "0.53632426", "0.53630877", "0.53606665", "0.5351258", "0.5329485", "0.53251725", "0.5318107", "0.53131557", "0.52734...
0.6518752
0
Function to Divide the input Array into equal subarrays
def sort(self, A, index, p, r, rc_arr): if p < r: q = (p + r) // 2 self.sort(A, index, p, q, rc_arr) self.sort(A, index, q + 1, r, rc_arr) self.merge(A, index, p, q, r, rc_arr)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_array(array, size):\n arrays = []\n while len(array) > size:\n pice = array[:size]\n arrays.append(pice)\n array = array[size:]\n arrays.append(array)\n return arrays", "def divide_array(arr, n):\r\n if n <= 0:\r\n raise ValueError(\"Number of elements value m...
[ "0.691021", "0.6753455", "0.6686531", "0.6575326", "0.6563722", "0.6514626", "0.6487273", "0.6461183", "0.6381053", "0.6315765", "0.6280236", "0.6267171", "0.617106", "0.61423326", "0.6139237", "0.6132551", "0.6123456", "0.6090952", "0.60815674", "0.607516", "0.6053057", "0...
0.0
-1
Export this relay domain to CSV.
def to_csv(self, csvwriter): csvwriter.writerow( ["relaydomain", self.name, self.target_host, self.service.name, self.enabled, self.verify_recipients] ) for rdalias in self.relaydomainalias_set.all(): rdalias.to_csv(csvwriter)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_csv(self, csvwriter):\n csvwriter.writerow(\n ['relaydomainalias', self.name, self.target.name, self.enabled]\n )", "def to_csv_row(self):\n return [\"domainalias\", self.name,\n self.target.name, self.enabled]", "def _csv_export(self, exppath):\n with o...
[ "0.77907896", "0.68435043", "0.6638725", "0.650624", "0.6448485", "0.6390192", "0.6390192", "0.63852876", "0.6364128", "0.6347593", "0.6301347", "0.6261917", "0.6258338", "0.61898685", "0.6147617", "0.6139273", "0.61114717", "0.611046", "0.6059749", "0.6042595", "0.6024399", ...
0.80410457
0
Export this relay domain alias to CSV.
def to_csv(self, csvwriter): csvwriter.writerow( ['relaydomainalias', self.name, self.target.name, self.enabled] )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_csv(self, csvwriter):\n csvwriter.writerow(\n [\"relaydomain\", self.name, self.target_host,\n self.service.name, self.enabled, self.verify_recipients]\n )\n for rdalias in self.relaydomainalias_set.all():\n rdalias.to_csv(csvwriter)", "def to_csv_row...
[ "0.825407", "0.76002574", "0.6689192", "0.6545449", "0.62185466", "0.6128807", "0.61019605", "0.60866565", "0.6078694", "0.6048245", "0.6048245", "0.60208875", "0.6018221", "0.60024756", "0.5970787", "0.5961684", "0.59460104", "0.58900034", "0.58862317", "0.5861766", "0.58261...
0.81902665
1
Evaluate the constant function. The first input must exist and should be an array. Returns an array of identical shape to args[0] (if it exists).
def __call__(self, *args): if ( len(args) > 0 ): # If there is at least one argument, return appropriately sized array if _isscalar(args[0]): return self.value else: shape = args[0].shape return self.value * np.ones(sha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, *args):\n if isinstance(args[0], (float, int, complex)):\n # scalar version:\n return self.constant\n else:\n # vectorized version:\n r = args[0].copy()\n # to get right dimension of the return array,\n # compute wit...
[ "0.66978616", "0.62859195", "0.594605", "0.5908098", "0.5888126", "0.5773916", "0.57022303", "0.56216145", "0.55789196", "0.5570677", "0.5534166", "0.55243355", "0.55147713", "0.5505828", "0.55033034", "0.5495514", "0.5486104", "0.54629415", "0.5451679", "0.54303324", "0.5404...
0.6644116
1
Returns the level and/or first derivative of the function at each value in x. Only called internally by HARKinterpolator1D.eval_and_der (etc).
def _evalOrDer(self, x, _eval, _Der): i = np.maximum(np.searchsorted(self.x_list[:-1], x), 1) alpha = (x - self.x_list[i - 1]) / (self.x_list[i] - self.x_list[i - 1]) if _eval: y = (1.0 - alpha) * self.y_list[i - 1] + alpha * self.y_list[i] if _Der: dydx = (self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _evalAndDer(self, x):\n m = len(x)\n fx = np.zeros((m, self.funcCount))\n for j in range(self.funcCount):\n fx[:, j] = self.functions[j](x)\n i = self.argcompare(fx, axis=1)\n y = fx[np.arange(m), i]\n dydx = np.zeros_like(y)\n for j in range(self.fun...
[ "0.7550486", "0.7550486", "0.7186791", "0.70551956", "0.7043025", "0.6873943", "0.6862879", "0.6830363", "0.6796635", "0.6754604", "0.6745963", "0.67324394", "0.6731821", "0.6653294", "0.6626802", "0.6607062", "0.65447855", "0.6532566", "0.6522589", "0.65153766", "0.64590067"...
0.6188456
32
Returns the derivative with respect to y of the interpolated function at each value in x,y. Only called internally by HARKinterpolator2D.derivativeY.
def _derY(self, x, y): if _isscalar(x): x_pos = max(min(self.xSearchFunc(self.x_list, x), self.x_n - 1), 1) y_pos = max(min(self.ySearchFunc(self.y_list, y), self.y_n - 1), 1) else: x_pos = self.xSearchFunc(self.x_list, x) x_pos[x_pos < 1] = 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _derY(self, x, y):\n m = len(x)\n temp = np.zeros((m, self.funcCount))\n for j in range(self.funcCount):\n temp[:, j] = self.functions[j](x, y)\n i = self.argcompare(temp, axis=1)\n y = temp[np.arange(m), i]\n dfdy = np.zeros_like(x)\n for j in range(...
[ "0.78901595", "0.7794465", "0.7762145", "0.77173203", "0.7686775", "0.7523941", "0.7513741", "0.74340695", "0.74220717", "0.72902524", "0.71225816", "0.7089417", "0.6946238", "0.6914038", "0.68854034", "0.67992306", "0.6713797", "0.67055076", "0.67055076", "0.6654436", "0.663...
0.75636476
5
Returns the level and first derivative of the function at each value in x. Only called internally by HARKinterpolator1D.eval_and_der.
def _evalAndDer(self, x): m = len(x) fx = np.zeros((m, self.funcCount)) for j in range(self.funcCount): fx[:, j] = self.functions[j](x) i = self.argcompare(fx, axis=1) y = fx[np.arange(m), i] dydx = np.zeros_like(y) for j in range(self.funcCount): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eval_with_derivative(self, x):\n z = np.asarray(x)\n y, dydx = self._evalAndDer(z.flatten())\n return y.reshape(z.shape), dydx.reshape(z.shape)", "def ddalf(x):\n return dalf_spl.derivatives(x)[1]", "def _evalAndDer(self, x):\n out_bot, out_top = self.out_of_bounds(x)...
[ "0.72046995", "0.7111631", "0.7103207", "0.70709276", "0.6977218", "0.69710857", "0.69605803", "0.69403714", "0.69211775", "0.68369675", "0.6778513", "0.67148036", "0.671473", "0.6695136", "0.66577977", "0.6651787", "0.66294825", "0.66294825", "0.6608522", "0.6582994", "0.657...
0.7743773
0
Returns the level and first derivative of the function at each value in x. Only called internally by HARKinterpolator1D.eval_and_der.
def _evalAndDer(self, x): m = len(x) fx = np.zeros((m, self.funcCount)) for j in range(self.funcCount): fx[:, j] = self.functions[j](x) i = self.argcompare(fx, axis=1) y = fx[np.arange(m), i] dydx = np.zeros_like(y) for j in range(self.funcCount): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eval_with_derivative(self, x):\n z = np.asarray(x)\n y, dydx = self._evalAndDer(z.flatten())\n return y.reshape(z.shape), dydx.reshape(z.shape)", "def ddalf(x):\n return dalf_spl.derivatives(x)[1]", "def _evalAndDer(self, x):\n out_bot, out_top = self.out_of_bounds(x)...
[ "0.7202552", "0.7110335", "0.71011454", "0.7070208", "0.69756866", "0.697058", "0.69583356", "0.693915", "0.69209385", "0.68345076", "0.6777756", "0.67133445", "0.6712377", "0.66942567", "0.66553324", "0.6649811", "0.66269326", "0.66269326", "0.66061515", "0.6581906", "0.6570...
0.77428365
1
Returns the first derivative of the function with respect to X at each value in (x,y). Only called internally by HARKinterpolator2D._derX.
def _derX(self, x, y): m = len(x) temp = np.zeros((m, self.funcCount)) for j in range(self.funcCount): temp[:, j] = self.functions[j](x, y) i = self.argcompare(temp, axis=1) dfdx = np.zeros_like(x) for j in range(self.funcCount): c = i == j ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _derX(self, x, y):\n if _isscalar(x):\n y_pos = max(min(np.searchsorted(self.y_list, y), self.y_n - 1), 1)\n alpha = (y - self.y_list[y_pos - 1]) / (\n self.y_list[y_pos] - self.y_list[y_pos - 1]\n )\n dfdx = (1 - alpha) * self.xInterpolators[y_...
[ "0.77545154", "0.7686995", "0.7682437", "0.74812585", "0.7470202", "0.7359799", "0.7295243", "0.7231755", "0.7231755", "0.71528333", "0.7034632", "0.69622344", "0.6928957", "0.6906704", "0.6903235", "0.68657786", "0.68657786", "0.68471974", "0.677717", "0.6707889", "0.6701495...
0.806046
0
Returns the first derivative of the function with respect to Y at each value in (x,y). Only called internally by HARKinterpolator2D._derY.
def _derY(self, x, y): m = len(x) temp = np.zeros((m, self.funcCount)) for j in range(self.funcCount): temp[:, j] = self.functions[j](x, y) i = self.argcompare(temp, axis=1) y = temp[np.arange(m), i] dfdy = np.zeros_like(x) for j in range(self.funcCoun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def derivativeY(self, x, y):\n xa = np.asarray(x)\n ya = np.asarray(y)\n return (self._derY(xa.flatten(), ya.flatten())).reshape(xa.shape)", "def _derY(self, x, y):\n if _isscalar(x):\n y_pos = max(min(np.searchsorted(self.y_list, y), self.y_n - 1), 1)\n dfdy = (...
[ "0.7948997", "0.7859844", "0.77774537", "0.77165264", "0.769353", "0.7629319", "0.76092196", "0.76005936", "0.74525446", "0.7343841", "0.7343631", "0.7227514", "0.71936184", "0.7110061", "0.69994664", "0.69761646", "0.686804", "0.6805346", "0.6720607", "0.6719458", "0.6686286...
0.82414746
0
Evaluate the first derivative with respect to y of the function at given state space points.
def derivativeY(self, x, y): xShift, xShiftDer = self.lowerBound.eval_with_derivative(y) dfdy_out = self.func.derivativeY( x - xShift, y ) - xShiftDer * self.func.derivativeX(x - xShift, y) return dfdy_out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _derY(self, x, y):\n m = len(x)\n temp = np.zeros((m, self.funcCount))\n for j in range(self.funcCount):\n temp[:, j] = self.functions[j](x, y)\n i = self.argcompare(temp, axis=1)\n y = temp[np.arange(m), i]\n dfdy = np.zeros_like(x)\n for j in range(...
[ "0.6900795", "0.6845462", "0.6845462", "0.6708714", "0.6702983", "0.6679759", "0.6647712", "0.663194", "0.65963435", "0.655928", "0.6544986", "0.6525072", "0.6510713", "0.64635146", "0.6395094", "0.63727236", "0.6359935", "0.6345316", "0.62427425", "0.6218147", "0.62133753", ...
0.61526406
28
Evaluate the first derivative with respect to y of the function at given state space points.
def derivativeY(self, x, y, z): xShift, xShiftDer = self.lowerBound.eval_with_derivative(y) dfdy_out = self.func.derivativeY( x - xShift, y, z ) - xShiftDer * self.func.derivativeX(x - xShift, y, z) return dfdy_out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _derY(self, x, y):\n m = len(x)\n temp = np.zeros((m, self.funcCount))\n for j in range(self.funcCount):\n temp[:, j] = self.functions[j](x, y)\n i = self.argcompare(temp, axis=1)\n y = temp[np.arange(m), i]\n dfdy = np.zeros_like(x)\n for j in range(...
[ "0.69007796", "0.684418", "0.684418", "0.6710388", "0.670343", "0.66800493", "0.6646315", "0.6631535", "0.6596558", "0.6558914", "0.6544756", "0.6523993", "0.65094334", "0.64627856", "0.63968146", "0.63744336", "0.6360619", "0.6345925", "0.6242802", "0.6219215", "0.62129736",...
0.5986237
41
Returns the derivative with respect to y of the interpolated function at each value in x,y. Only called internally by HARKinterpolator2D.derivativeY.
def _derY(self, x, y): if _isscalar(x): y_pos = max(min(np.searchsorted(self.y_list, y), self.y_n - 1), 1) dfdy = ( self.xInterpolators[y_pos](x) - self.xInterpolators[y_pos - 1](x) ) / (self.y_list[y_pos] - self.y_list[y_pos - 1]) else: m ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _derY(self, x, y):\n m = len(x)\n temp = np.zeros((m, self.funcCount))\n for j in range(self.funcCount):\n temp[:, j] = self.functions[j](x, y)\n i = self.argcompare(temp, axis=1)\n y = temp[np.arange(m), i]\n dfdy = np.zeros_like(x)\n for j in range(...
[ "0.78901595", "0.7794465", "0.77173203", "0.7686775", "0.75636476", "0.7523941", "0.7513741", "0.74340695", "0.74220717", "0.72902524", "0.71225816", "0.7089417", "0.6946238", "0.6914038", "0.68854034", "0.67992306", "0.6713797", "0.67055076", "0.67055076", "0.6654436", "0.66...
0.7762145
2
Initialize of a SK Weather Summary Api.
def __init__(self, lat, lon, api): self.lat = lat self.lon = lon self.api = api self.result = {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, api_key=\"3d34a9a9b0e544269a3ddbb97ec89ba7\", api_current=\"https://api.weatherbit.io/v2.0/current\", api_forecast = \"https://api.weatherbit.io/v2.0/forecast/hourly?\"): \n # constants\n self.API_KEY = api_key\n\n # necessary data for request\n self.API_CURREN...
[ "0.69176745", "0.6717403", "0.65796566", "0.64781904", "0.6371575", "0.63501793", "0.6176444", "0.6176444", "0.61512035", "0.6147724", "0.61464524", "0.6069864", "0.6061069", "0.6057602", "0.60323316", "0.6021811", "0.5999113", "0.5977495", "0.5958941", "0.594216", "0.5926626...
0.5567045
66
Initialize of a SK Weather Minutely Api.
def __init__(self, lat, lon, grid, api): self.lat = lat self.lon = lon self.city = grid['city'] self.county = grid['county'] self.village = grid['village'] self.api = api self.result = {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, api_key=\"3d34a9a9b0e544269a3ddbb97ec89ba7\", api_current=\"https://api.weatherbit.io/v2.0/current\", api_forecast = \"https://api.weatherbit.io/v2.0/forecast/hourly?\"): \n # constants\n self.API_KEY = api_key\n\n # necessary data for request\n self.API_CURREN...
[ "0.74783534", "0.7044016", "0.6814415", "0.67590874", "0.6758047", "0.67308754", "0.65633696", "0.6531913", "0.6523724", "0.6519265", "0.6511277", "0.65066695", "0.6500851", "0.644414", "0.63704485", "0.6347994", "0.63376015", "0.63344735", "0.63284075", "0.63238686", "0.6323...
0.0
-1
Return the entity ID.
def entity_id(self): return 'sensor.{}_{}'.format(self._name, self.var_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entity_id(self):\n return self._entity_id", "def entity_id(self):\n return self._entity_id", "def entity_id(self):\n return self._entity_id", "def entity_id(self):\n return self._entity_id", "def entity_id(self):\n return self._entity_id", "def entity_id(self) -> st...
[ "0.87450445", "0.87450445", "0.87450445", "0.87450445", "0.87450445", "0.86839527", "0.7594692", "0.7523408", "0.7392858", "0.7392858", "0.7368524", "0.7363123", "0.7363123", "0.7363123", "0.7363123", "0.7363123", "0.7363123", "0.7363123", "0.7363123", "0.7363123", "0.7363123...
0.0
-1
Get the latest state of the sensor.
def update(self): if self.api is None: return self.api.update() if self.var_type == 'Time': self.var_state = self.api.result['timeRelease'] return result = self.api.result[self.var_period.lower()] if self.var_type == 'Sky': sky = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state(self):\n if self.coordinator.data:\n return self.coordinator.data[self._sensor]", "def state(self):\n if self.ticker.values is not None:\n return round(\n float(\n self.ticker.values.get(\"last\")\n ),\n ...
[ "0.753419", "0.74876356", "0.74765736", "0.72214586", "0.7112677", "0.6995063", "0.69775915", "0.6945787", "0.69136775", "0.68911135", "0.68863803", "0.6863116", "0.6858303", "0.6834618", "0.6774382", "0.67590016", "0.6746638", "0.6699024", "0.6691935", "0.6685089", "0.666090...
0.0
-1
Get the latest state of the sensor.
def update(self): if self.api is None: return self.api.update() if self.var_type == 'Time': self.var_state = self.api.result['timeObservation'] return result = self.api.result[self.var_type.lower()] if self.var_type == 'Sky': self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state(self):\n if self.coordinator.data:\n return self.coordinator.data[self._sensor]", "def state(self):\n if self.ticker.values is not None:\n return round(\n float(\n self.ticker.values.get(\"last\")\n ),\n ...
[ "0.753419", "0.74876356", "0.74765736", "0.72214586", "0.7112677", "0.6995063", "0.69775915", "0.6945787", "0.69136775", "0.68911135", "0.68863803", "0.6863116", "0.6858303", "0.6834618", "0.6774382", "0.67590016", "0.6746638", "0.6699024", "0.6691935", "0.6685089", "0.666090...
0.0
-1
Calculate and return elapsed time. This function does dumb rounding by just plucking off anything past a dot "." in a time delta between two datetime.datetime()'s.
def elapsed(self): return str(datetime.datetime.now() - self.start).split('.')[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def elapsed(t1, t2):\n # Use the timedelta's standard formatting, except discard microseconds.\n retval = str(t2 - t1)\n m = re.match(r\"([^.]+)\\.([0-9]+)\", retval)\n if m:\n retval = m.group(1)\n return retval", "def time_difference(time1: Time, time2: Time) -> float:\n dsec = time1.s...
[ "0.74918616", "0.6743211", "0.66744083", "0.66071403", "0.6577354", "0.65730757", "0.6414249", "0.6334438", "0.63259673", "0.6322261", "0.6275683", "0.62557983", "0.62381583", "0.62063944", "0.6183206", "0.6168549", "0.6152554", "0.6147504", "0.61458874", "0.6128038", "0.6126...
0.6628156
3
Represent an entire repository in one line. This makes calls to the other methods of this class to create a formatted string, which makes nice columns.
def represent_repo(self, repo_id, h1, h2, h3, h4, h5): repo = '{0:<{1}s}'.format(repo_id, h1) if 'error' in self.repos[repo_id]: repo = self.color(repo, 'red') packages = self.color('{0:^{1}s}'.format('error', h2 + h3 + 1), 'red') percent = self.color('{0:^{1}s}'.fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\r\n text = \"\"\r\n for day in self._repo:\r\n text += str(day)\r\n text += \"\\n\"\r\n return text", "def __html__(self) -> str:\n components = [\n f'{self.name}' if self.name else '',\n f'{self.repository}',\n ]\n...
[ "0.69782203", "0.65209204", "0.6344192", "0.6319428", "0.6302434", "0.626512", "0.6190025", "0.6084072", "0.605865", "0.6006299", "0.5944347", "0.5942579", "0.5918625", "0.590097", "0.5899389", "0.58993137", "0.58966005", "0.588573", "0.5878666", "0.58483154", "0.5848314", ...
0.7043536
0
Returns Client_Info of an authenticated user, if session_obj is who they pretend to be. Returns None otherwise.
def get_user_by_session(session_obj, request_obj): user_id = session_obj.get("user_id") key = session_obj.get("key") salt = session_obj.get("salt") if(user_id is not None and key is not None and salt is not None): db_user_cursor = db.cursor() combo_super_secret = key + salt has...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_info(self):\n return self.auth.get_user_by_session()", "def getsessionuser(cls, session):\n sessionkey = session[\"credential\"][\"Authorization\"]\n if sessionkey in sessionmgr.keys():\n return True, sessionmgr[sessionkey]['username']\n return False, None", "def use...
[ "0.6947287", "0.6812252", "0.6647198", "0.6500541", "0.64448833", "0.64391583", "0.6435651", "0.6375826", "0.63754666", "0.621409", "0.62079215", "0.61822295", "0.60565025", "0.60492074", "0.60427856", "0.6021348", "0.6017516", "0.6016021", "0.59932077", "0.59932077", "0.5993...
0.706678
0
Create a JSON string from Txpk object
def encode(self): # Create dict from attributes. Maintain added order #jd = {'txpk': collections.OrderedDict()} jd = {'txpk':{}} for key in self.keys: val = getattr(self, key) if val is not None: if key == 'data': jd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toJson(self):\n text = '{'\n if len(self._sequence):\n for key in self._sequence:\n text += '\"%s\":%s,' % (key,json.dumps(self.dictionary[key]))\n text = text[:-1]\n text += '}'\n\n return text", "def to_bytes(self) -> bytes:\n proposal...
[ "0.6678453", "0.6587262", "0.6572608", "0.65183014", "0.6508378", "0.64357316", "0.6432986", "0.6404605", "0.64003295", "0.6378102", "0.6367754", "0.6367754", "0.6367754", "0.6367754", "0.6367754", "0.6367754", "0.6367754", "0.6367754", "0.6367754", "0.6367754", "0.6350733", ...
0.73501587
0
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix inorder arguments and keyword arguments.
def __init__(self, *args, **kwds): if args or kwds: super(pid_control_reqRequest, self).__init__(*args, **kwds) #message fields cannot be None, assign default values for those that are if self.yaw is None: self.yaw = 0. else: self.yaw = 0.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwds):\n if args or kwds:\n super(KomodoSpeechRecCommand, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.header is None:\n self.header = std_msgs.msg.Header()\n if self.cmd is None:\n ...
[ "0.77936506", "0.7720004", "0.7720004", "0.76861507", "0.76264745", "0.756367", "0.74394095", "0.74168324", "0.7351523", "0.7307856", "0.7280199", "0.7237893", "0.72272074", "0.7223773", "0.7223773", "0.7218694", "0.7211321", "0.7211321", "0.7211321", "0.7211321", "0.7211321"...
0.692364
50
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix inorder arguments and keyword arguments.
def __init__(self, *args, **kwds): if args or kwds: super(pid_control_reqResponse, self).__init__(*args, **kwds) #message fields cannot be None, assign default values for those that are if self.FL_vel is None: self.FL_vel = 0 if self.FR_vel is None: self.FR_vel = 0 if s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwds):\n if args or kwds:\n super(KomodoSpeechRecCommand, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.header is None:\n self.header = std_msgs.msg.Header()\n if self.cmd is None:\n ...
[ "0.7794478", "0.77204376", "0.77204376", "0.76865023", "0.7625996", "0.7563802", "0.74399596", "0.74173665", "0.73513013", "0.73086345", "0.72797984", "0.7237519", "0.7227004", "0.7224259", "0.7224259", "0.7218872", "0.72119284", "0.72119284", "0.72119284", "0.72119284", "0.7...
0.69497204
49
Compute exponentiallyweighted moving variance using decay factor.
def _numba_ewcov(input_x, input_y, alpha, state, adjust, ignore_na, minp, bias): N = len(input_x) if N == 0: output = np.empty(N, dtype=float64) output_state = state else: # np.put(input_x, np.isinf(input_x), np.nan) # np.put(input_y, np.isinf(input_y), np.nan) inpu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compute_variance(params):\n batch_grad = self._fetch_batch_grad(params, aggregate=True)\n grad = self._fetch_grad(params, aggregate=True)\n batch_size = batch_grad.size(0)\n\n if self._use_double:\n batch_grad = batch_grad.double()\n gr...
[ "0.6351689", "0.6251359", "0.6177692", "0.60938627", "0.6060738", "0.5973522", "0.5971689", "0.5960376", "0.5950262", "0.5946031", "0.59454083", "0.59414124", "0.59090704", "0.58853835", "0.58560365", "0.585269", "0.58479816", "0.58479816", "0.5832515", "0.58141994", "0.58104...
0.0
-1
Exponentialy weighted moving varaiance specified by a decay ``alpha``
def numba_ewvar(X, alpha, state=None, adjust=True, ignore_na=False, minp=1, bias=False): output_ew, output_state = _numba_ewcov(X, X, alpha=alpha, adjust=adjust, state=state, ignore_na=ignore_na, minp=minp, bias=bias) return output_ew, output_state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_exp_decay(self, alpha: float):\n x = np.linspace(0, 1, 100)\n y = np.exp(alpha * x)\n\n alpha_guess = guess.exp_decay(x, y)\n\n self.assertAlmostEqualAbsolute(alpha_guess, alpha)", "def exponentialMovingAverage(self,new,old, alpha):\n return alpha * new + (1 - alpha)* ...
[ "0.70346165", "0.70220107", "0.694109", "0.66696936", "0.6558858", "0.642652", "0.6301448", "0.6301448", "0.62372065", "0.6228585", "0.62000895", "0.61948293", "0.6171246", "0.615099", "0.61476743", "0.6146452", "0.6076681", "0.6076067", "0.6061205", "0.6051535", "0.60421926"...
0.58486634
39
Exponentialy weighted moving varaiance specified by a decay ``alpha``
def numba_ewstd(X, alpha, state=None, adjust=True, ignore_na=False, minp=1, bias=False): output_ew, output_state = _numba_ewcov(X, X, alpha=alpha, adjust=adjust, state=state, ignore_na=ignore_na, minp=minp, bias=bias) return np.sqrt(output_ew), output_state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_exp_decay(self, alpha: float):\n x = np.linspace(0, 1, 100)\n y = np.exp(alpha * x)\n\n alpha_guess = guess.exp_decay(x, y)\n\n self.assertAlmostEqualAbsolute(alpha_guess, alpha)", "def exponentialMovingAverage(self,new,old, alpha):\n return alpha * new + (1 - alpha)* ...
[ "0.70346165", "0.70220107", "0.694109", "0.66696936", "0.6558858", "0.642652", "0.6301448", "0.6301448", "0.62372065", "0.6228585", "0.62000895", "0.61948293", "0.6171246", "0.615099", "0.61476743", "0.6146452", "0.6076681", "0.6076067", "0.6061205", "0.6051535", "0.60421926"...
0.5565461
90
Minimum value of given dtype.
def min(self): if self.kind == 'u': return 0 else: try: val = iinfo._min_vals[self.key] except KeyError: val = int(-(1 << (self.bits-1))) iinfo._min_vals[self.key] = val return val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_value(dtype):\n return _api_internal._min_value(dtype)", "def MinimumValue(self):\n datatype = self.NumPyDataType\n if issubclass(datatype, numpy.integer):\n return numpy.iinfo(datatype).min\n elif issubclass(datatype, numpy.floating):\n return -numpy.inf\n ...
[ "0.89836437", "0.7967805", "0.70639545", "0.6908168", "0.6825716", "0.6807564", "0.67371494", "0.673398", "0.6700779", "0.66341376", "0.6609646", "0.6594608", "0.65847456", "0.65847456", "0.65721744", "0.65721744", "0.65162694", "0.65081006", "0.64851487", "0.6452686", "0.644...
0.6448551
21
Maximum value of given dtype.
def max(self): try: val = iinfo._max_vals[self.key] except KeyError: if self.kind == 'u': val = int((1 << self.bits) - 1) else: val = int((1 << (self.bits-1)) - 1) iinfo._max_vals[self.key] = val return val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_value(dtype):\n return _api_internal._max_value(dtype)", "def MaximumValue(self):\n datatype = self.NumPyDataType\n if issubclass(datatype, numpy.integer):\n return numpy.iinfo(datatype).max\n elif issubclass(datatype, numpy.floating):\n return numpy.inf\n ...
[ "0.90775704", "0.8017499", "0.70144606", "0.69562256", "0.69543195", "0.68937004", "0.6892016", "0.6722029", "0.66489303", "0.6634152", "0.6634152", "0.66192836", "0.6556985", "0.65388906", "0.65357316", "0.65297335", "0.65059525", "0.64996517", "0.6390727", "0.6390727", "0.6...
0.6515405
17
Check that two objects are equal.
def _assert_equal(d_0, d_1): # Compare arrays. if _is_array_like(d_0): try: ae(d_0, d_1) except AssertionError: ac(d_0, d_1) # Compare dicts recursively. elif isinstance(d_0, dict): assert set(d_0) == set(d_1) for k_0 in d_0: _assert_eq...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_eq(self):\n dummy = DummyCryptographicObject()\n self.assertTrue(dummy == dummy)", "def is_equal(o1: object, o2: object) -> bool:\n if o1 is None and o2 is None:\n return True\n if o1 is None:\n return False\n return o1 == o2", "def test_equal_o...
[ "0.77055776", "0.7702547", "0.75899476", "0.7584662", "0.7532469", "0.75270456", "0.7484226", "0.7484226", "0.7464835", "0.7463307", "0.7427616", "0.7415417", "0.7342097", "0.72788334", "0.726521", "0.72560674", "0.7250229", "0.72492105", "0.72459203", "0.72459203", "0.724592...
0.0
-1
Check if the IDs of the Artists are not equal.
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_missing_tracks(self):\n\n # Taylor Swift doesn't have her albums on Spotify\n expected_missing = [track_id for track_id, track in self.ilibrary.tracks.iteritems()\n if track.artists[0] == 'Taylor Swift']\n\n for missing_id in expected_missing:\n s...
[ "0.64833903", "0.644611", "0.6390843", "0.6369282", "0.6155727", "0.6137469", "0.6133382", "0.6084764", "0.60811174", "0.6071553", "0.60680854", "0.5912438", "0.5876045", "0.58572096", "0.58547455", "0.5842288", "0.58256054", "0.58178926", "0.5769949", "0.5754097", "0.5750971...
0.0
-1
Helper function to get a separable conv block
def separable_conv_block( data, name, depthwise_channels, pointwise_channels, kernel_size=(3, 3), downsample=False, padding=(1, 1), epsilon=1e-5, layout="NCHW", dtype="float32", ): if downsample: strides = (2, 2) else: strides = (1, 1) # depthwise con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def block_inception_c(blk, net):\n # By default use stride=1 and SAME padding\n s = net.add(Split('%s/Split' % blk, 4))\n br0 = conv2d(net, '%s/Branch_0/Conv2d_0a_1x1' % blk, 256, 1, src=s)\n\n br1 = conv2d(net, '%s/Branch_1/Conv2d_0a_1x1' % blk, 384, 1, src=s)\n br1 = net.add(Split('%s/Branch_1/Spl...
[ "0.6658487", "0.6422122", "0.6410947", "0.6348862", "0.62933296", "0.6264877", "0.6264877", "0.6258005", "0.6248073", "0.62385494", "0.62385494", "0.6237831", "0.62031955", "0.6188223", "0.61828506", "0.6160002", "0.6151201", "0.61254424", "0.60535467", "0.60428244", "0.60361...
0.6001538
22
Append a dataframe to a csv file.
def append_to_csv(df, csvFilePath, sep=",", supersede=False): if (not os.path.isfile(csvFilePath)) or supersede==True: df.to_csv(csvFilePath, index=False, sep=sep) else: d_od=df.columns f_od=pd.read_csv(csvFilePath,nrows=0,sep=sep).columns if np.setxor1d(d_od,f_od).size: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __append_to_csv(self, path, data):\n header = False\n mode = 'a'\n if not os.path.isfile(path):\n header = True\n mode = 'w'\n data.to_csv(path, mode=mode, index=False, header=header)", "def write_tocsv(file_name, dataframe) :\n print(\"\\nSaved result to ...
[ "0.742864", "0.7395803", "0.7349257", "0.7113585", "0.70768", "0.69777715", "0.6916612", "0.68025583", "0.68015575", "0.67968684", "0.6750723", "0.67476207", "0.67379546", "0.66572076", "0.6632138", "0.6631869", "0.66257817", "0.6607523", "0.6567911", "0.6561725", "0.6553552"...
0.7205393
3
Add strings together. It allows some of the strings are lists with the same length, in which case other nonlist strings are added into every string in the list, like broadcasting.
def brcadd(*args): #Find the list use a mask list. bargs=[isinstance(i,list) for i in args] #If all the elements are strings, just connect them. if not any(bargs): return ''.join(args) #Collect the lengths of the lists and check. lists=[len(args[i]) for i in range(len(args)) if bargs[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def brcadd(*args):\n \n #Find the list use a mask list.\n bargs=[isinstance(i,list) for i in args]\n \n #If all the elements are strings, just connect them.\n if not any(bargs):\n return ''.join(args)\n \n #Collect the lengths of the lists and check.\n lists=[len(args[i]) for i in ra...
[ "0.7092072", "0.6424793", "0.6379337", "0.6295208", "0.61417896", "0.6066781", "0.59680283", "0.58899206", "0.5821385", "0.5792766", "0.57742816", "0.5746547", "0.57283735", "0.5694531", "0.5617331", "0.55170596", "0.55025995", "0.5491795", "0.54904044", "0.5450006", "0.54392...
0.7035114
1
Convert class labels from scalars to onehot vectors.
def indices_one_hot(labels_indices, num_classes=10): num_labels = labels_indices.shape[0] index_offset = np.arange(num_labels) * num_classes labels_one_hot = np.zeros((num_labels, num_classes)) labels_one_hot.flat[index_offset + labels_indices.ravel()] = 1 return labels_one_hot
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot(labels, classes=None):\n return K.utils.to_categorical(labels, classes)", "def one_hot(labels, classes=None):\n\n one_hot_ = K.utils.to_categorical(labels, classes)\n return(one_hot_)", "def to_onehot(labels: torch.Tensor, num_classes: int) -> torch.Tensor:\n if len(labels.size()) == 1:...
[ "0.8250402", "0.807683", "0.80523187", "0.7977843", "0.7908335", "0.7900327", "0.7892233", "0.7869711", "0.7849721", "0.7849721", "0.7826951", "0.7826122", "0.77677035", "0.7765413", "0.77540547", "0.77540547", "0.77540547", "0.77489346", "0.7742955", "0.7737176", "0.77226317...
0.70482117
86
Get a mesh grid range which covers all the ndimentional points.
def mgrid_box(X,axis=0,linj=200j,marg_rate=0.1): if len(X.shape)!=2: raise Exception('Only 2-D array is acceptable!') o_axis=1-axis X_max=np.max(X,axis=axis) X_min=np.min(X,axis=axis) lenX=X_max-X_min Marg_X=marg_rate*lenX X_edgmin, X_edgmax = X_min - Marg_X, X_max + Marg_X n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_index_range_inclusive(self):\n nx, ny, nz = self.get_mesh_size()\n return (1, nx, 1, ny, 1, nz)", "def _build_grid(self):\n n = self.params['n']\n\n x_min, x_max = min(self.node[:, 0]), max(self.node[:, 0])\n y_min, y_max = min(self.node[:, 1]), max(self.node[:, 1])\n ...
[ "0.69853497", "0.69077355", "0.6778236", "0.6721337", "0.6685397", "0.657999", "0.6552467", "0.6536203", "0.6528703", "0.65216523", "0.6516722", "0.6493419", "0.6493419", "0.6479024", "0.6453463", "0.6423503", "0.63938653", "0.6343154", "0.6339865", "0.6307454", "0.6295072", ...
0.0
-1
Given an ndimentional array, remove its 0th dimention, ravel all other dimentions, and return an 2D matrix.
def corresponding_ravel(X,axis=0): t1=np.c_[tuple([di.ravel() for di in X])] if axis==1: t1=t1.T return t1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trans(array,dim):\n return array[filter(lambda x: x != dim,range(len(array)) ) ]", "def trim_zeros(array):\n multislice = []\n for i in range(array.ndim):\n sum_axes = tuple(j for j in range(array.ndim) if j is not i)\n edges = np.where(np.sum(array, axis=sum_axes) > 0)\n if edg...
[ "0.63218737", "0.6242444", "0.62121004", "0.6188692", "0.61529243", "0.6145004", "0.61442286", "0.6111157", "0.6050967", "0.60457695", "0.60004854", "0.59698117", "0.58646417", "0.57965857", "0.5770848", "0.5757791", "0.5743353", "0.57303023", "0.5710106", "0.5689995", "0.567...
0.0
-1
Plot scatter plot (use plot or scatter) where different classes/clusters have different colors/markers.
def color_marked_scatter_plot(data,marker_column,labels,dim=2): color_list=['C0', 'C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', 'C8', 'C9'] marker_list=['o', 'X', '8', 's', 'p', 'h', 'H', 'D', 'd', 'P'] kinds=pd.Series(marker_column).drop_duplicates().sort_values().values color_dict=dict(zip(kinds,color_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scatterPlot2DMiddle(data, title, classes):\n fig = plt.figure(figsize=(8, 8))\n colormap = np.array([\"g\", \"b\"])\n if classes is not None:\n plt.scatter(data[:, 0], data[:, 1], c=colormap[classes], s=0.2)\n else:\n plt.scatter(data[:, 0], data[:, 1], s=1)\n plt.title(title, font...
[ "0.7443335", "0.7342899", "0.72650373", "0.72446334", "0.7127825", "0.7077264", "0.69886667", "0.6961332", "0.69507563", "0.6934197", "0.69275033", "0.68454754", "0.68405694", "0.68293345", "0.6819151", "0.6815067", "0.6811122", "0.67318434", "0.6729495", "0.67065614", "0.669...
0.6213649
45
Plot a prediction 2D figure using a classification or clustering model.
def plot_region_prediction(X,model,linj=200j,marg_rate=0.1,centroids=None): zz=mgrid_box(X,axis=0,linj=linj,marg_rate=marg_rate) zz1=corresponding_ravel(zz,axis=0) Z = model.predict(zz1) Z = Z.reshape(zz[0].shape) # fig=plt.figure() plt.imshow(Z, interpolation='nearest', extent=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Plot_predict(X,Y,model,X_path): \n labels = {0: 'CNV', 1: 'DME', 2: 'DRUSEN', 3: 'NORMAL'}\n Y_pred_classes = np.argmax(model.predict(X),axis = 1) \n Y_true = np.argmax(Y,axis = 1)\n \n fig = plt.figure(figsize=(40, 40)) \n for i in range(X.shape[0]):\n ax = fig.add_subplot...
[ "0.75554115", "0.7256829", "0.72092277", "0.71589345", "0.7102002", "0.7040177", "0.69277847", "0.68633175", "0.68388", "0.6800214", "0.67997235", "0.67871094", "0.6702791", "0.6685548", "0.66744286", "0.6645946", "0.6631676", "0.66051906", "0.6604784", "0.66031694", "0.65701...
0.65801644
20
It's the inverse function of connect_array_by_last_dim. The function accepts an array, a vector of indexes of subarrays and types of subarrays and separate the input array to several arrays according to the indexes and types.
def separate_array_by_last_dim(adata,bx,atype): if(len(atype)==1): cx=adata else: cx=tuple([adata[...,slice(bx[i],bx[i+1])].astype(atype[i]) for i in np.arange(0,len(bx)-1)]) return cx
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect_array_by_last_dim(*data):\n\n aax=list(map(lambda x: x.shape[:-1], data))\n if (not all_equal(aax)):\n raise ValueError('All inputs must have the same shape except the last dimension!')\n\n ax=list(map(lambda x: x.shape[-1], data))\n bx=np.concatenate([[0],np.cumsum(ax)])\n\n atyp...
[ "0.7553976", "0.52611977", "0.5187682", "0.51793563", "0.51495737", "0.5131894", "0.51196307", "0.51024884", "0.508053", "0.508053", "0.508053", "0.5048037", "0.50126004", "0.49770287", "0.49765623", "0.49654707", "0.49325398", "0.49325398", "0.49325398", "0.49129108", "0.485...
0.6443347
1
return date from date string
def valid_date(date_string): date_string_number = re.sub('\D', '', date_string) try: date_res = datetime.strptime(date_string_number, '%Y%m%d').date() except ValueError: print("Not a valid date: '{}'.".format(date_string)) else: return date_res
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def string_to_date(string):\n params = string.strip().split('-')\n year = int(params[0])\n month = int(params[1])\n day = int(params[2])\n d = date(year, month, day)\n return d", "def get_date(self, string):\n # remove new lines\n string = string.replace('\...
[ "0.814712", "0.8117752", "0.80310565", "0.80182904", "0.7991399", "0.79541004", "0.79326606", "0.79146576", "0.791292", "0.79125684", "0.78830963", "0.7874314", "0.7794901", "0.77354354", "0.769055", "0.7676392", "0.7650168", "0.76456684", "0.76118684", "0.7600951", "0.756102...
0.6958548
69
The default include_object handler for alembic, delegates to alembic_include_object signal The return value will be considered True if all the signal handlers return True for the object to be included in migration.
def include_object(obj, name, type_, reflected, compare_to): results = signals.alembic_include_object.send( obj, name=name, type_=type_, reflected=reflected, compare_to=compare_to ) if results: return all([res[1] for res in results]) return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def include(self, obj):\n obj = load_object(obj, 'include')\n return obj(self)", "def has_db_objects(self) -> bool:\n\n def has_db_models(entity: t.Union[EntityList, Model]) -> bool:\n # pylint: disable=protected-access\n return len(entity._db_models) > 0\n\n def...
[ "0.5578377", "0.51369506", "0.5134196", "0.5019332", "0.5013733", "0.50108504", "0.5002222", "0.49532077", "0.49509904", "0.49215305", "0.49199164", "0.49062937", "0.48859465", "0.48658165", "0.48554742", "0.48484972", "0.48484972", "0.4846631", "0.48404476", "0.4834557", "0....
0.7140636
0
Return final fuel for mass, including fuel required for the fuel mass itself
def calc_total_fuel(mass): fuel = fuel_for_mass(mass) if fuel < 0: return 0 added_fuel = calc_total_fuel(fuel) return fuel + added_fuel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fuel_calc(mass):\n return max((mass / 3) - 2, 0)", "def fuel_for_mass(mass):\n return int(mass / 3) - 2", "def calculate_fuel(mass):\n return math.floor(mass/3) - 2", "def fuel_required(mass):\n return max(math.floor(mass/3) - 2, 0)", "def _calculate_fuel_simple(self):\n self._fuel_sim...
[ "0.77517503", "0.7585008", "0.75532293", "0.74950486", "0.74912846", "0.7415249", "0.7389275", "0.7333736", "0.72428846", "0.7221583", "0.71106386", "0.7086712", "0.6919534", "0.6832421", "0.6813266", "0.6525558", "0.6495971", "0.6449022", "0.6247649", "0.60281783", "0.600191...
0.6643579
15
Gets the config that corresponds the region used for the test.
def _GetDefaultConfig(self) -> str: try: region = util.GetRegionFromZone( FLAGS.zones[0] if FLAGS.zones else FLAGS.zone[0]) except IndexError: region = _DEFAULT_REGION return f'regional-{region}'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def region(self):\n return self.config.region", "def get_region(self):\n return self.creds.get('region_name')", "def get_config():\n return CONFIG", "def _est_config(self):\n return self._est_method.config", "def region(self):\n return self._get(\"region\")", "def getConfig...
[ "0.76990354", "0.69497305", "0.6896458", "0.68812346", "0.6878058", "0.66721183", "0.66566056", "0.6649459", "0.6638989", "0.65606755", "0.6527132", "0.652256", "0.652256", "0.652256", "0.652256", "0.65214604", "0.65191513", "0.6516613", "0.6516613", "0.6516613", "0.6516613",...
0.0
-1
Create the Q table based on the dimensions and borders of the grid.
def __init__(self, maze): self.alpha = 0.1 # learning rate. self.gamma = 0.8 # discount factor. self.epsilon = 1 # randomness factor. e=0 makes the agent greedy. self.maze = copy.deepcopy(maze) self.grid = copy.deepcopy(maze.grid) self.reward_table = [ [Non...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_grid(self):\n if self.Qh is not None and self.Qk is not None and self.Ql is not None:\n self.h_start, self.h_step, self.h_stop = (\n self.Qh[0], self.Qh[1]-self.Qh[0], self.Qh[-1])\n self.k_start, self.k_step, self.k_stop = (\n self.Qk[0], s...
[ "0.66219795", "0.6515786", "0.615802", "0.6086063", "0.6040049", "0.5925499", "0.588806", "0.58339053", "0.58054554", "0.5803742", "0.5801274", "0.5769361", "0.57633126", "0.5761139", "0.5712351", "0.5695646", "0.5694177", "0.56912655", "0.5675728", "0.5668972", "0.5630623", ...
0.0
-1
A reward function R(s,a) that gives the agent a reward for taking action a in state s.
def r(self, s, a): return self.reward_table[s[0]+a[0]][s[1]+a[1]]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reward(self,\n state: float) -> float:\n raise NotImplementedError", "def compute_reward(self, obs, action, state):\n pass", "def reward(input):\n state = np.array([input[0], input[1]])\n action = input[2]\n action = np.clip(action, -2.0, 2.0)\n costs = angle_normali...
[ "0.71201396", "0.70418036", "0.7033849", "0.6962767", "0.69625384", "0.6940932", "0.69279325", "0.6858305", "0.67750525", "0.6752527", "0.6749524", "0.6729078", "0.672248", "0.6710259", "0.67075175", "0.67045367", "0.6663977", "0.6602783", "0.65806645", "0.6529419", "0.650296...
0.77189755
0
Used to represent the Q table as a readable string.
def get_qtable_str(self): output = "[\n" for row in self.qtable: output += "\t" + str([round(x,2) for x in row]) + ",\n" output += "]\n" return output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printqtable(self):\n\t\tout = \"PRINTING QTABLE\\n\"\n\t\tfor key in self.qtable:\n\t\t\tout += \"state: \" + str(key) + \"\\n\"\n\t\t\tfor i in range(self.game.pips+1):\n\t\t\t\tout += f\"rew{i}: {self.qtable[key][i]:.3f} \"\n\t\t\tout += \"\\n\"\n\t\treturn out", "def toQif(self):\n out=list...
[ "0.75918627", "0.7398896", "0.73269784", "0.7318951", "0.7181966", "0.7123355", "0.7121811", "0.70063883", "0.70063126", "0.70040655", "0.7003684", "0.6933296", "0.6916354", "0.6904815", "0.6893375", "0.68866", "0.68709004", "0.6860623", "0.6851082", "0.67944276", "0.67715687...
0.853202
0
Derive the shared secret, then hash it to obtain the shared key.
def genKey(self, privateKey,otherKey): self.sharedSecret = self.genSecret(privateKey, otherKey) # Convert the shared secret (int) to an array of bytes in network order # Otherwise hashlib can't hash it. try: _sharedSecretBytes = self.sharedSecret.to_bytes( self.sharedSecret.bit_length() // 8 + 1, byteor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_sharedsecret(self):\n return self._get_shared_secret(self.public_key)", "def _create_shared_secret():\n\n randint = random.SystemRandom().randint\n bits = load_config(\"instavpn.json\")[\"shared_secret_bits\"]\n return urlsafe_b64encode(\"\".join(chr(randint(0, 255)) for _ in xrange(...
[ "0.7640213", "0.7205416", "0.70746154", "0.68951344", "0.6745594", "0.6745594", "0.67453134", "0.6744134", "0.6692583", "0.6583358", "0.65555173", "0.654887", "0.6505754", "0.6476671", "0.6457074", "0.6358782", "0.62806976", "0.62766504", "0.6227237", "0.613608", "0.61220527"...
0.632907
16
Predicts most similar items
def most_similar(self, article: str, topn: int = 5): return [article[0] for article in self._model.similar_by_word(article, topn)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_most_similar(self):\n expected = [\n 'canine.n.02',\n 'hunting_dog.n.01',\n 'carnivore.n.01',\n 'placental.n.01',\n 'mammal.n.01'\n ]\n predicted = [result[0] for result in self.vectors.most_similar('dog.n.01', topn=5)]\n s...
[ "0.6630048", "0.6552149", "0.64724743", "0.64701724", "0.6440157", "0.63585275", "0.62548983", "0.61671585", "0.6163705", "0.6159454", "0.6132848", "0.611764", "0.61156917", "0.6098454", "0.60546607", "0.6053404", "0.6047164", "0.6046118", "0.60452765", "0.60449564", "0.60429...
0.0
-1
Get the immediate children (not the grandchildren) of the element with the given tag name
def getAllChildrenWithTagName(elm, tagname): if elm.hasChildNodes() == True: elms = [] for c in elm.childNodes: if c.nodeType == Node.ELEMENT_NODE and c.tagName == tagname: elms.append(c) return elms else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getElements(self, name=\"\"):\n\n if not name:\n return self.children\n else:\n elements = []\n for element in self.children:\n if element.name == name:\n elements.append(element)\n return elements", "def get_by_tag(s...
[ "0.7677232", "0.6997111", "0.6997111", "0.67915004", "0.67745304", "0.6660673", "0.6601227", "0.6561303", "0.652329", "0.6521329", "0.65141505", "0.6488493", "0.6436748", "0.63917726", "0.6363935", "0.63298213", "0.61629736", "0.61547965", "0.6129175", "0.6115028", "0.6096198...
0.7985882
0
returns the name of this object, which is expected in field "name" of the metadata. If this field does not exist, the id is returned
def name(self): if self.metadata and "name" in self.metadata: return self.metadata["name"] else: return str(self.id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self) -> str:\n return self._id_data.get(\"name\", \"\")", "def name(self):\n return self.titleOrId()", "def name(self):\n return self._id()", "def _getName(self):\n return self.id().split('.')[-2]", "def name(self):\n alias = getattr(self, 'alias', None)\n ...
[ "0.8103507", "0.7725919", "0.7640089", "0.7607589", "0.75102824", "0.75029105", "0.75016487", "0.75016487", "0.7485146", "0.74833226", "0.7480418", "0.7474169", "0.7474077", "0.7461062", "0.7457809", "0.7451814", "0.7451202", "0.7375241", "0.7348304", "0.7342527", "0.73414063...
0.8695092
0
Return columns in 'result' dict as selected by 'regex' as DataFrame
def result_df(self, regex=None) -> pd.DataFrame: if regex: # get one random item from dict, and get keys from this random (dict) item # FIXME: how to do this better? - this is not efficient... keys = self.result[next(iter(self.result))].keys() if type(regex) == s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_dataframe(result):\n # List of elements in the search result\n names = []\n snippet = []\n url = []\n \n # Append search results to list\n for j,item in enumerate(result):\n for i,element in enumerate(result[j]['items']):\n names.append(result[j]['items'][i]['title...
[ "0.5890865", "0.57992446", "0.57377595", "0.57101476", "0.5684245", "0.5658841", "0.56454515", "0.5631638", "0.55941606", "0.54679775", "0.5451427", "0.54432905", "0.5438069", "0.54216397", "0.54214543", "0.53957313", "0.5308273", "0.5308273", "0.527904", "0.5268412", "0.5247...
0.8030273
0
Sets the id of this RuntimeHostProfile.
def id(self, id): self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, id):\n self.__id = id", "def set_id(self, id):\n self.data['id'] = id", "def set_id(self, id_):\n\n self.id_ = id_", "def SetId(self, id):\n self.id = int(id)", "def setID(self, id):\n self._id = id\n return self.callRemote('setID', id)", "def se...
[ "0.6794746", "0.6675362", "0.6616161", "0.6490015", "0.6428279", "0.6373651", "0.62868506", "0.6286546", "0.6273487", "0.6273487", "0.6273487", "0.6235025", "0.6235025", "0.6235025", "0.6235025", "0.6235025", "0.6224885", "0.6224885", "0.6224885", "0.6224885", "0.6224885", ...
0.6189813
54
Sets the account_id of this RuntimeHostProfile.
def account_id(self, account_id): self._account_id = account_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account_id(self, account_id):\n self._account_id = account_id", "def setAccount(self, account_id):\n self.data_struct['_setAccount'] = account_id", "def account_id(self, account_id: str):\n if account_id is None:\n raise ValueError(\"Invalid value for `account_id`, must not ...
[ "0.7567001", "0.7330353", "0.68081266", "0.6681811", "0.61795163", "0.616337", "0.61375535", "0.61375535", "0.61375535", "0.61375535", "0.5892122", "0.58896524", "0.5767685", "0.5749591", "0.5749591", "0.57153606", "0.5610587", "0.5585894", "0.55524015", "0.5537165", "0.55150...
0.7552642
2
Sets the collections of this RuntimeHostProfile.
def collections(self, collections): self._collections = collections
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hosts(self, hosts):\n self._hosts = hosts", "def _addCollections(self):\n\n self._colls = dict.fromkeys(self._listOfTargets)\n self._collsNew = dict.fromkeys(self._listOfTargets)\n self._collsMiss = dict.fromkeys(self._listOfTargets)\n self._collsNoLink = dict.fr...
[ "0.6044563", "0.55317533", "0.55272925", "0.5511435", "0.55066717", "0.54961985", "0.5451555", "0.5396226", "0.5396226", "0.53658885", "0.5314567", "0.5289995", "0.521273", "0.5190981", "0.5190981", "0.5190981", "0.5185109", "0.51499104", "0.51432115", "0.5136124", "0.5110687...
0.68269914
2
Sets the time of this RuntimeHostProfile.
def time(self, time): self._time = time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_time(self, time):\n self._time = time", "def set_time(self, set_time):\n\n self._set_time = set_time", "def set_exec_time(self, time):\n for task in self.tasks:\n task.exec_time = time", "def set_time(self, time):\n with self.loopback_guard('time'):\n ...
[ "0.73333746", "0.6823196", "0.6776713", "0.6684526", "0.6588802", "0.6570158", "0.65537256", "0.6552373", "0.65289706", "0.6522621", "0.64827555", "0.635388", "0.63511884", "0.63278115", "0.62772244", "0.6244531", "0.6232652", "0.6232652", "0.6227251", "0.62198496", "0.621246...
0.6853987
3
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, RuntimeHostProfile): return False return self.to_dict() == other.to_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.808826", "0.808826", "0.8054592", "0.79827315", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, RuntimeHostProfile): return True return self.to_dict() != other.to_dict()
{ "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.84564555", "0.8391999", "0.8144653", "0.81410354", "0.81326365", "0.8094085", "0.80921024", "0.80921024", "0.80921024", "0.8085453", "0.8085453", "0.807646", "0.807646", "0.806588", "0.8042693", "0.8042693", "0.8042693", "0.8042693", "0.8042693", "0.8042693", "0.8042693", ...
0.0
-1
Perform sparse warp perspective operation
def myWarpPerspectiveSparse(src, H, out_size): output = np.zeros(out_size) # Get all indices from the src matrix row, col = np.indices(src.shape[:2]) # Store as x,y,1 indices = [(c, r, 1) for r, c in zip(row.ravel(), col.ravel())] for idx in indices: new_idx = np.matmul(H,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def piecewise_transform(image, numcols=5, numrows=5, warp_left_right=10, warp_up_down=10, order=1):\n\n rows, cols = image.shape[0], image.shape[1]\n\n numcols = numcols\n numrows = numrows\n\n src_cols = np.linspace(0, cols, numcols, dtype=int)\n src_rows = np.linspace(0, rows, numrows, dtype=int)\...
[ "0.64826757", "0.62129945", "0.6200779", "0.61652124", "0.6143394", "0.6114126", "0.6090744", "0.60886073", "0.6037644", "0.5960865", "0.59427917", "0.59216195", "0.5882346", "0.58747184", "0.5835402", "0.5833598", "0.5828814", "0.5809797", "0.5805268", "0.58048403", "0.57809...
0.7067484
0
Perform warp perspective operation
def myWarpPerspective(src, H, out_size, interpolate=False): output = np.zeros(out_size) H_inv = np.linalg.inv(H) # get all indices from the src matrix row, col = np.indices(out_size) # storing as x,y,1 indices = [(c, r, 1) for r, c in zip(row.ravel(), col.ravel())] for idx in indic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def warp(img, reverse=False):\n\n img_size = (img.shape[1], img.shape[0])\n\n points = np.array(\n [(581, 460),\n (278, img_size[1] - 50),\n (1020, img_size[1] - 50),\n (700, 460)])\n src = np.float32([points])\n\n dst = np.float32(\n [[278, 0],\n [278, img...
[ "0.72561973", "0.7217962", "0.72057116", "0.7132513", "0.7092561", "0.69863075", "0.69737244", "0.6955003", "0.6919129", "0.68889093", "0.679316", "0.67540866", "0.6747154", "0.6703839", "0.6630171", "0.6587918", "0.650372", "0.6463295", "0.64027023", "0.6375255", "0.6373754"...
0.6845137
10
Load torchvision datasets. We return train and test for plots and posttraining experiments
def load_torchvision_data(data, label, test_size = 0.2, valid_size=0.1, splits=None, shuffle=True, stratified=False, random_seed=None, batch_size = 64, maxsize = None, maxsize_test=None, num_workers = 0): x_train, x_test, y_train, y_test = train_test_split(data, label, test_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loadData(self):\n batch_size = 256\n \n #if self.conv_sg == True:\n # batch_size = 1 \n \n download = True\n root = self.root + self.dataset\n if self.dataset == \"MNIST\": \n transform = transforms.Compose([transforms.ToTensor(), tra...
[ "0.76596844", "0.747729", "0.74112755", "0.738462", "0.7348428", "0.7270694", "0.7246367", "0.71473366", "0.71274614", "0.712031", "0.7084005", "0.70632833", "0.70516586", "0.7021523", "0.69970316", "0.6975201", "0.69531703", "0.69236577", "0.6915163", "0.68847543", "0.688134...
0.6602255
44
Return a deep copy of the object.
def copy(self): from copy import deepcopy return deepcopy(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deepcopy(self):\n return copymod.deepcopy(self)", "def deepcopy(self):\n return copy.deepcopy(self)", "def deepcopy(self):\n return self.copy()", "def copy(self):\n\t\treturn pythoncopy.deepcopy(self)", "def copy(self):\r\n return copy.deepcopy(self)", "def copy(self):\n ...
[ "0.8555543", "0.8542088", "0.8520465", "0.8392883", "0.8392138", "0.83688706", "0.83688706", "0.83688706", "0.83688706", "0.83688706", "0.83688706", "0.83688706", "0.83688706", "0.83688706", "0.83688706", "0.83688706", "0.83688706", "0.83688706", "0.83688706", "0.83688706", "...
0.8218706
43
If the encoder is bidirectional, do the following transformation. (directions layers, batch, hidden_size) > (layers, batch, directions hidden_size)
def _cat_directions(self, h): if self.cfg.bidirectional: new_h = torch.cat([h[0:h.size(0):2], h[1:h.size(0):2]], 2) else: new_h = h lsize, bsize, hsize = new_h.size() new_h = new_h.view(lsize, bsize, hsize, 1, 1) new_h = new_h.expand(lsize, bsize, hsize, s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encoder_decoder_archi_gan(inputs, is_train):\n\n encoder_layers = []\n\n encoded = inputs\n\n encoder_layers.append(encoded)\n\n for i in range(config.encoder_layers):\n encoded = encoder_conv_block_gan(encoded, i, is_train)\n encoder_layers.append(encoded)\n \n encoder_layers.r...
[ "0.632598", "0.62748426", "0.627022", "0.62467086", "0.6213115", "0.60864437", "0.6010484", "0.60063803", "0.5992043", "0.5968872", "0.591398", "0.5903421", "0.58470684", "0.5841379", "0.582844", "0.58225775", "0.5803318", "0.58001643", "0.57877684", "0.5756972", "0.5756004",...
0.0
-1
Checks if the array is 2D
def _assert_2d(field): assert len(np.shape(field))==2, "Variable fields must be a 2D array"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_1d_varray(arr):\r\n return len(arr.shape) < 2 or arr.shape[1] == 1", "def is_2d(self) -> bool:\n return self.layers == 1 and self.times == 1", "def _is_1d_harray(arr):\r\n return len(arr.shape) < 2 or arr.shape[0] == 1", "def check_wf_2d(ψ: ndarray):\n pass", "def is_array(a):\n ...
[ "0.7646425", "0.71329564", "0.70881116", "0.6899062", "0.68743986", "0.6768655", "0.67378604", "0.6719225", "0.65854424", "0.65656924", "0.65409255", "0.65140826", "0.6494257", "0.6494257", "0.6467487", "0.6455092", "0.6438342", "0.6427203", "0.6350165", "0.6348771", "0.63340...
0.72199917
1
Pads the field with n1 zeros to remove boundary reflections
def propagate_angular_padded(field, k, z_list, dx, dy): _assert_2d(field) n_x, n_y = np.shape(field) pad_x = int(n_x) pad_y = int(n_y) padded_field = np.zeros(shape=(2*pad_x + n_x, 2*pad_y + n_y), dtype=complex) padded_field[pad_x:-pad_x, pad_y:-pad_y] = field E_prop_padded = prop...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zero_pad(data):\n N = len(data)\n pow_2 = np.ceil(np.log2(N))\n return np.pad(data,(0,int((2**pow_2)-N)),'constant')", "def pad_zeros_(self, n):\n if n == 0:\n return\n self.factors = [np.column_stack((f, np.zeros((f.shape[0], n))))\n for f in self.fac...
[ "0.6120322", "0.6007129", "0.58964306", "0.5834645", "0.5819255", "0.57930446", "0.57852584", "0.5779508", "0.5743477", "0.5718728", "0.5648248", "0.56277984", "0.56240016", "0.5617419", "0.5600041", "0.5569863", "0.55641496", "0.5554637", "0.5545211", "0.55316246", "0.552376...
0.0
-1
This function builds the ipu_sparse_ops library for any tests that rely on it.
def ipu_sparse_ops(scope="session"): build_path = Path( public_examples_dir, "applications", "tensorflow", "dynamic_sparsity" ) completed = run(['python3-config', '--extension-suffix'], stdout=PIPE) extension = completed.stdout.decode().replace('\n', '') shared_libs =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_sparse_train_and_test(ratings, n_users, n_items):\n \n # pick a random set of data as testing data, sorted ascending\n test_set_size = len(ratings) / TEST_SET_RATIO\n test_set_idx = np.random.choice(xrange(len(ratings)), size=test_set_size, replace=False)\n test_set_idx = sorted(test_set...
[ "0.6103799", "0.57765466", "0.55403477", "0.55298257", "0.5386336", "0.5361429", "0.5325023", "0.5323519", "0.5316025", "0.53004116", "0.5269363", "0.52582884", "0.52336764", "0.5170223", "0.5126602", "0.51191247", "0.51075697", "0.51058847", "0.50810415", "0.50449145", "0.50...
0.78487676
0
Initialize SortedList with normally distributed sublist lengths.
def init_sorted_list(sl, size, moment=5, fraction=0.1): assert -5 <= moment <= 9 assert 0 < fraction sl.clear() load = sl._load half = sl._load >> 1 twice = sl._load << 1 mu = load * (1.0 + moment / 10.0) sigma = load * fraction total = 0 class WhileIterator(object): "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, initial_length=2, resizing_factor=2):\n\n # Initialise underlying list, with no elements\n self.main_list = [None] * initial_length\n\n # Initialise variable to store number of elements inserted into\n # main_list, which will always be less than or equal to list lengt...
[ "0.65299016", "0.6099598", "0.60195243", "0.5954599", "0.5823126", "0.57663524", "0.5740581", "0.5726775", "0.57207096", "0.55676484", "0.55584717", "0.5487347", "0.53776485", "0.5357228", "0.5332266", "0.5326262", "0.52863413", "0.5261904", "0.524", "0.52206004", "0.5179893"...
0.61238
1
Sends a 401 response that enables basic auth
def authenticate(): return Response( 'Could not verify your access level for that URL.\n' 'You have to login with proper credentials', 401, {'WWW-Authenticate': 'Basic realm="Login Required"'})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticate():\n return Response('Not Authorized', 401, {'WWW-Authenticate': 'Basic realm=\"api\"'})", "def authenticate():\n return Response(\n '', 401, {'WWW-Authenticate': 'Basic realm=\"Login Required\"'}\n )", "def authenticate():\n return Response(\n 'You have to login with pro...
[ "0.8093736", "0.80926424", "0.7958403", "0.7852648", "0.7843114", "0.7824419", "0.776624", "0.7754693", "0.774767", "0.774767", "0.774767", "0.774767", "0.774767", "0.774767", "0.774767", "0.774767", "0.771945", "0.7667712", "0.7664151", "0.76493174", "0.76140213", "0.76131...
0.7810746
11
Add headers to both force latest IE rendering engine or Chrome Frame, and also to cache the rendered page for 10 minutes.
def add_header(response): response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1' response.headers['Cache-Control'] = 'public, max-age=600' return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, max-age=60'\n return response", "def add_header(response):\r\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\r\n response.headers['Cache-Control'] = 'publi...
[ "0.8222987", "0.81952584", "0.816278", "0.816278", "0.816278", "0.816278", "0.816278", "0.816278", "0.816278", "0.816278", "0.816278", "0.816278", "0.816278", "0.816278", "0.816278", "0.816278", "0.816278", "0.816278", "0.816278", "0.816278", "0.816278", "0.816278", "0.81...
0.8222117
1
Find the last index of the element in y satistying y[index] <= value
def get_index(y, value): for i in range(len(y)): if y[i] <= value: continue return i
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index(x, t):\n if x < t[0]:\n return 0\n\n for i in range(len(t) - 1):\n if t[i] <= x < t[i + 1]:\n return i\n\n return len(t) - 2", "def last2(x, y):\n y = np.asarray(y)\n return y[np.argsort(x)][-1]", "def last_index_of(my_list, my_value):\n return len(my_li...
[ "0.6794036", "0.6707568", "0.63585794", "0.6342836", "0.6148874", "0.6099638", "0.6039464", "0.6016772", "0.59529793", "0.592289", "0.58838826", "0.5883006", "0.5876673", "0.58378506", "0.58141744", "0.57770437", "0.57675916", "0.57465774", "0.57417953", "0.5737373", "0.57280...
0.7851847
0
Drop any row that has one or more NaNs inside
def drop_nans(target_df): target_df.dropna(axis=0, inplace=True) return target_df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def purgeNanEveryWhere(df):\n #Row-wise dropping\n toDrop = np.array([])\n for i in range(df.shape[0]):\n if( np.sum ( pd.isnull(df.iloc[i]) ) == df.shape[1]-1 ):\n toDrop= np.append(toDrop,i)\n df.drop(df.index[toDrop.astype(int)],inplace=True) \n #Column-wise dropping\n fo...
[ "0.78563565", "0.7503848", "0.7503348", "0.74286157", "0.7296361", "0.71911144", "0.705808", "0.7032052", "0.7014551", "0.67747074", "0.67657125", "0.6744647", "0.67411155", "0.6715954", "0.66737735", "0.6608136", "0.6605209", "0.65898967", "0.65467477", "0.65297127", "0.6524...
0.6995986
9
Prepare a DataFrame specified by the settings dict for training.
def prep_dataset(settings): train_dims = settings["train_dims"] # Open HDF store. This is usually a soft link to our filtered dataset input_df, target_df, const = load_from_store(settings["dataset_path"], columns=train_dims) try: del input_df["nions"] # Delete leftover artifact from dataset sp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_dataset(self, df, **kwargs):\n\t\treturn df", "def prepare_data(args):\n logger.info('Loading dataframe from %s' % args.newspath)\n df = pd.read_csv(args.newspath, encoding='gb18030')\n logger.info('Dataframe size: %d observations %d features after loaded' % (df.shape[0], df.shape[1]))\n\n #...
[ "0.661622", "0.64497215", "0.63840836", "0.6289582", "0.62509406", "0.60111743", "0.60111654", "0.60062194", "0.59891987", "0.58764976", "0.58682853", "0.58502954", "0.57761085", "0.5765727", "0.57582617", "0.5756897", "0.5745816", "0.574068", "0.57320446", "0.5728622", "0.56...
0.73061347
0
function to display the welcome view
def display_welcome_view(screen): pygame.time.Clock().tick(30) welcome_background = pygame.image.load('resources//pictures//startb.jpg').convert() screen.blit(welcome_background, (0, 0)) pygame.display.flip()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def welcome():\n return render_template(\"NFL.html\")", "def welcome(self):\n if self.user:\n return self.render('welcome.html')\n self.redirect('/register')", "def welcome(request):\n return HttpResponse('Welcome from Site')", "def welcome(request):\n return render(request,...
[ "0.81659716", "0.7953197", "0.78840035", "0.7869111", "0.77399385", "0.7695381", "0.7640018", "0.74441355", "0.7390191", "0.7324468", "0.7288208", "0.72597754", "0.7225801", "0.72137904", "0.71989334", "0.7187326", "0.7187326", "0.7176746", "0.71108526", "0.7091964", "0.70907...
0.0
-1
Convert this SensorSnapshot into JSON form.
def to_json(self) -> str: return JSONEncoder().encode(vars(self))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_json(self):\n\n result = super(Snapshot, self).to_json()\n result.update({\n 'snapshot': self.snapshot.to_json(),\n })\n return result", "def to_json(self):\n return json.dumps(self.serialize())", "def as_json(self) -> str:\n return json.dumps(self, c...
[ "0.8040754", "0.70783985", "0.70641947", "0.7059386", "0.7059386", "0.6997043", "0.69947606", "0.69947606", "0.69695264", "0.69653475", "0.69033283", "0.6876226", "0.686225", "0.686225", "0.686225", "0.686225", "0.686225", "0.686225", "0.686225", "0.686225", "0.686225", "0....
0.0
-1
Create mne raw object from a series.
def create_mne_raw(series, s_freq, ch_names=None, highpassed=True, **kwargs): series = check_series(series) if isinstance(series, pd.DataFrame): if ch_names is None: ch_names = list(series.columns) ch_types = ["eeg"] * len(ch_names) data = series[ch_names].to_numpy() el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _CreateRaw_T(data, y = None):\r\n ch_names = [\"Fp1\", \"Fp2\", \"F7\", \"F3\", \"Fz\", \"F4\", \"F8\", \"T7\", \"C3\", \"Cz\", \"C4\", \"T8\", \"P7\", \"P3\", \"Pz\", \"P4\", \"P8\",\r\n \"O1\", \"O2\"]\r\n # ch_names=[\"FP1\", \"FP2\", \"F7\", \"F3\", \"FZ\", \"F4\", \"F8\", \"T3\", \"C3...
[ "0.59837824", "0.58643997", "0.58127844", "0.57869685", "0.5742839", "0.56402653", "0.5583588", "0.5526222", "0.55171686", "0.55095553", "0.5435582", "0.54319245", "0.54287755", "0.54075986", "0.5396219", "0.5382265", "0.53701955", "0.5355851", "0.5330161", "0.5275881", "0.52...
0.76522547
0
Initialize machine learning settings.
def __init__(self): # File settings and locations. self.DATA_DIR = 'data' self.DATA_COL_DIR = 'data_collated' self.FIRE_DATABASE = 'FPA_FOD_20170508.sqlite' self.CLIMATE_DATA = 'GlobalLandTemperaturesByCity.csv' self.STOCK_DATA = 'historical_stock_prices.csv' sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init():\n global neural_network\n global labels\n\n # load objects required by run() for inferencing\n model_dir = Model.get_model_path(\"mnist-fashion\")\n # neural model\n neural_network = keras.models.load_model(f\"{model_dir}/neural-network.h5\")\n # labels\n with open(f\"{model_dir...
[ "0.6907462", "0.69028157", "0.67091054", "0.6578323", "0.6479367", "0.6474857", "0.64642155", "0.62994725", "0.62485117", "0.62485117", "0.62485117", "0.62485117", "0.62485117", "0.62307346", "0.62269455", "0.6201985", "0.61792994", "0.61581343", "0.6156401", "0.6122177", "0....
0.0
-1
Return list of device parameters available.
def get_resource_params(): return Parameter.list()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_parameters_list(self):\n return self.description[\"config\"][\"values\"].keys()", "def get_resource_params(self):\n return Parameter.list()", "def get_resource_params(self):\n return Parameter.list()", "def get_params_list():\n return common.QOL_PARAMS", "def get_diamete...
[ "0.7016888", "0.6954558", "0.6954558", "0.68675077", "0.6849259", "0.6764339", "0.67047435", "0.6657263", "0.6595397", "0.6569685", "0.6545156", "0.6524327", "0.6512713", "0.6502569", "0.6458225", "0.64568347", "0.64514685", "0.64327735", "0.6423687", "0.6415432", "0.6366248"...
0.7098994
0
Create a new WolfSheep model with the given parameters.
def __init__( self, height=20, width=20, initial_sheep=100, initial_wolves=50, sheep_reproduce=0.04, wolf_reproduce=0.05, wolf_gain_from_food=20, grass=False, grass_regrowth_time=30, sheep_gain_from_food=4, trees_carrots_rat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_wine(title, winery, variety, country, description, designation, points, province, region_1, region_2):\n\n wine = Wine(title=title,\n winery=winery,\n variety=variety,\n country=country,\n description=description,\n designatio...
[ "0.61635625", "0.5964291", "0.5689665", "0.558931", "0.55561596", "0.548053", "0.54760915", "0.5451619", "0.5298215", "0.5262034", "0.52614903", "0.5258942", "0.5258197", "0.5246883", "0.52166355", "0.51952446", "0.5143818", "0.51381135", "0.5090104", "0.5088901", "0.5088059"...
0.48264843
44
Translate a /separated PATH to the local filename syntax. Components that mean special things to the local file system (e.g. drive or directory names) are ignored. (XXX They should probably be diagnosed.)
def py38_translate_path(self, path): # abandon query parameters path = path.split('?', 1)[0] path = path.split('#', 1)[0] # Don't forget explicit trailing slash when normalizing. Issue17324 trailing_slash = path.rstrip().endswith('/') try: path = urllib.parse....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convertString(path):\n if (\"win\" in sys.platform):\n return path.replace(\"/\",\"\\\\\")\n elif (\"linux\" in sys.platform):\n return path.replace(\"\\\\\",\"/\")", "def mangle_path(path):\n # Remove assigns\n path = servers.get_file_server().manglepath( str(path) )\n # Remove ...
[ "0.69140327", "0.6811669", "0.67799675", "0.66774404", "0.66584295", "0.6657851", "0.6601214", "0.6575706", "0.65646315", "0.65374815", "0.65302485", "0.65176374", "0.65143293", "0.65139204", "0.6498907", "0.64704174", "0.6469495", "0.6452223", "0.64402705", "0.6439241", "0.6...
0.6638346
6
Given path relative to project root, return absolute file name.
def project_file(relpath): # Kinda janky - we know this file is one directory up from the project # root, so we can work from there base = pth.abspath(pth.join(pth.dirname(__file__), '..')) return pth.join(base, relpath)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file_name(path):\n return os.path.basename(path)", "def getfilename(path):\r\n return path.split('\\\\').pop().split('/').pop().rsplit('.', 1)[0]", "def file_name(path):\n return os.path.basename(path).split('.')[0]", "def get_filename(name):\n return osp.join(osp.dirname(osp.abspath(__fi...
[ "0.7605019", "0.7406104", "0.73949474", "0.7364406", "0.72798175", "0.72485304", "0.7246973", "0.724144", "0.72349644", "0.722797", "0.7226791", "0.71522665", "0.71483123", "0.7112526", "0.7110717", "0.70421696", "0.70373565", "0.70129967", "0.7008268", "0.6997837", "0.695092...
0.71310925
13
Convert a list of RGBa colors to a list of hexadecimal color codes.
def _rgb_color_list_to_hex(color_list): color_list_rgb = [[int(x * 255) for x in c[0:3]] for c in color_list] color_list_hex = [f"#{rgb[0]:02X}{rgb[1]:02X}{rgb[2]:02X}" for rgb in color_list_rgb] return color_list_hex
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_color_map_in_hex(rgb_colors):\n list_of_hex_colors = []\n # Iterating through the list of colors given\n for i in range(len(rgb_colors)):\n rgb = []\n # Iterating through each rgb to get them into a range of 0-255\n for j in range(3):\n num = int(rgb_colors[i][j] * ...
[ "0.77719784", "0.736071", "0.73182446", "0.72566354", "0.7194788", "0.71849114", "0.71194977", "0.7065211", "0.70231956", "0.70082724", "0.6994308", "0.6944888", "0.6911907", "0.6829393", "0.68147725", "0.6799505", "0.67261803", "0.67253613", "0.6723855", "0.66871613", "0.667...
0.82162046
0
Return nlength list of RGBa colors from the passed colormap name and alpha.
def get_colors(n, cmap="viridis", start=0.0, stop=1.0, alpha=1.0, return_hex=False): colors = [cm.get_cmap(cmap)(x) for x in np.linspace(start, stop, n)] colors = [(r, g, b, alpha) for r, g, b, _ in colors] if return_hex: colors = _rgb_color_list_to_hex(colors) return colors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_colors(num_colors, alpha):\n cs = sns.color_palette(palette=\"colorblind\", n_colors=num_colors)\n cs = [list(c) for c in cs]\n for i in range(len(cs)):\n cs[i].append(alpha)\n return cs", "def _get_colors(num_colors):\n cmap = plt.get_cmap()\n return [cmap(1. * i / num_colors) f...
[ "0.7413178", "0.66224027", "0.6563501", "0.65489495", "0.6471675", "0.6420389", "0.64093435", "0.6308536", "0.62805235", "0.62725717", "0.62563044", "0.6232368", "0.6228655", "0.6195474", "0.6186616", "0.6158957", "0.6144181", "0.6141875", "0.61095834", "0.60941803", "0.60543...
0.68891746
1