query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Test the internal _parse_image_meta methode Feed it an 'zvol' image as we get it from from imgadm list j
def test_parse_image_meta_zvol(image_zvol): ret = { "description": ( "Ubuntu 18.04 LTS (20180808 64-bit). Certified Ubuntu Server " "Cloud Image from Canonical. For kvm and bhyve." ), "name": "ubuntu-certified-18.04", "os": "linux", "published": "2018-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_parse_image_meta_lx(image_lx):\n ret = {\n \"description\": (\n \"Container-native Ubuntu 16.04 64-bit image. Built to run on \"\n \"containers with bare metal speed, while offering all the \"\n \"services of a typical unix host.\"\n ),\n \"name\": ...
[ "0.70250654", "0.68019986", "0.6737672", "0.6549403", "0.64224327", "0.6239823", "0.622689", "0.62021476", "0.61582226", "0.60746354", "0.60221714", "0.6009213", "0.59953326", "0.59682703", "0.595405", "0.59428936", "0.5934149", "0.5909532", "0.58560014", "0.5851444", "0.5839...
0.7878405
0
Test the internal _parse_image_meta methode Feed it an 'docker' image as we get it from from imgadm list j
def test_parse_image_meta_docker(image_docker): ret = { "description": ( "Docker image imported from " "busybox42/zimbra-docker-centos:latest on " "2019-03-23T01:32:25.320Z." ), "name": "busybox42/zimbra-docker-centos:latest", "os": "linux", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_parse_image_meta_lx(image_lx):\n ret = {\n \"description\": (\n \"Container-native Ubuntu 16.04 64-bit image. Built to run on \"\n \"containers with bare metal speed, while offering all the \"\n \"services of a typical unix host.\"\n ),\n \"name\": ...
[ "0.71701115", "0.70583767", "0.6989357", "0.6883845", "0.632691", "0.63088745", "0.62557995", "0.622059", "0.6174179", "0.61586636", "0.6079249", "0.60274893", "0.5975001", "0.59731615", "0.59721625", "0.59384054", "0.59312916", "0.59061134", "0.59037596", "0.58676225", "0.58...
0.8324207
0
Return valid filename for image. If there are multiple files in the database they append it with ',{number}'. For example image.png,0. This method will put the `number` between the filename and the extension. Thus 'image.png,0' becomes 'image0.png'. Returns str Converted filename.
def get_filename(self) -> str: fname = self.url.split("/")[-1] if "," in fname: _fname, _i = fname.split(",") _split_fname = _fname.split(".") _name = _split_fname[0] _extension = _split_fname[-1] return _name + _i + "." + _extension el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_file_name(self):\n # create a unique id for the file name\n index = self.helpers.alpha_uuid()\n\n filename = self.form['FieldStorage'][self.image_cid].filename\n extension = guess_extension(guess_type(filename)[0])\n return ( # concatenates the following data\n ...
[ "0.712252", "0.6974862", "0.67796457", "0.6768139", "0.6755476", "0.6694814", "0.66734874", "0.6669626", "0.6649419", "0.664161", "0.65641737", "0.65102273", "0.6467254", "0.6443507", "0.64337325", "0.6411749", "0.6411749", "0.6411749", "0.64037764", "0.6389226", "0.63800997"...
0.70944995
1
Loads image from url. Returns Image PIL Image object. Source
def from_url(self) -> PngImagePlugin.PngImageFile: response = requests.get(self.url) img = Image.open(BytesIO(response.content)) return img
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_pil_image(self, url):\r\n return Image.open(urlopen(url))", "def getImage(url):\n response = requests.get(url)\n img = Image.open(BytesIO(response.content))\n return img", "def fetch_image(url: str) -> Image.Image:\n r = httpx.get(url)\n if not r.status_code == httpx.codes.OK...
[ "0.77640134", "0.7749962", "0.7725904", "0.77168554", "0.74839956", "0.73880714", "0.7365719", "0.7333797", "0.7217801", "0.7201707", "0.7050136", "0.69685555", "0.6968352", "0.695745", "0.69478923", "0.69186074", "0.69104034", "0.68546426", "0.6788575", "0.67859113", "0.6744...
0.78676915
0
Reduce the amount of whitespace around an image.
def reduce_whitespace(self, border: int = 5) -> None: if self.img is None: raise FileExistsError("Load an image first with from_url.") pix = np.asarray(self.img) pix = pix[:, :, 0:3] # Drop the alpha channel idx = np.where(pix - 255)[0:2] # Drop the color when finding edg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trim(self):\n result = library.MagickTrimImage(self.wand)\n if not result:\n self.raise_exception()", "def _trim_margins(self, img):\n oldsize = (0, 0)\n while oldsize != img.shape: # while the size is changing\n oldsize = img.shape\n for i in ran...
[ "0.6564348", "0.6462592", "0.64356196", "0.64125997", "0.64088434", "0.63586885", "0.6321339", "0.6209154", "0.61482376", "0.6099185", "0.60608566", "0.60138977", "0.5960579", "0.59480804", "0.5920281", "0.591606", "0.59075433", "0.5890236", "0.5870133", "0.57548124", "0.5712...
0.7336111
0
When creating a log pass all essential information about the instance of the climb, where the style will need to be corrected.
def __init__(self, date: dt_date, style: str, partners: list, notes: str, climb: Climb): self._date = date self._styles = { 'Lead RP': 'read point', 'AltLd O/S': 'onsight', 'Solo O/S': 'onsight', 'Lead rpt': 'no log', 'Lead O/S':...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, study_dir):\n super(LogfileStyleFormatter, self).__init__(\n fmt='%(levelname)s: %(file_indicator)s:'\n '%(line_indicator)s%(column_indicator)s'\n ' %(message)s%(cause_indicator)s')\n self.study_dir = study_dir\n self.previous_filenam...
[ "0.57048947", "0.55396056", "0.5465881", "0.54398954", "0.541957", "0.54109883", "0.5315492", "0.5292643", "0.5258789", "0.5210646", "0.51873815", "0.5179873", "0.51721483", "0.51535904", "0.5147601", "0.50989956", "0.5095159", "0.5091493", "0.50643826", "0.50538623", "0.5044...
0.59754187
0
If the found style is not in the dictionary of styles then add the style to the dictionary.
def add_style_to_styles(self, style_key: str, style_value: str): self._styles[style_key] = style_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_style(self, style, keepdefault=False):\n for key, styledict in style.items():\n target = self.style[key]\n for k, v in styledict.items():\n if keepdefault:\n target.setdefault(k, v)\n else:\n target[k] = v\n ...
[ "0.7267755", "0.64935213", "0.6178218", "0.61260563", "0.6113688", "0.61129606", "0.60676706", "0.58556426", "0.5807858", "0.56835294", "0.56551135", "0.55858433", "0.5543673", "0.5537918", "0.5495871", "0.54484546", "0.54361624", "0.54099387", "0.5384072", "0.53600764", "0.5...
0.6535367
1
Correct the UKC style to a more readable type of style, using the already created list of styles. If the style isn't in the already created dictionary then ask the user what style it is, then add.
def match_style(self, input_style: str) -> str: try: # Try to get from the dictionary return self.get_style_from_styles(input_style) except KeyError: # If you get a key error, it is not in the dictionary new_style = input(input_style + '\nWhat style is this?') # Ask the us...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_style(self, style, keepdefault=False):\n for key, styledict in style.items():\n target = self.style[key]\n for k, v in styledict.items():\n if keepdefault:\n target.setdefault(k, v)\n else:\n target[k] = v\n ...
[ "0.6187341", "0.59183043", "0.5915758", "0.5880331", "0.5701508", "0.5542363", "0.55048287", "0.54951644", "0.5477289", "0.54621917", "0.5402817", "0.53932166", "0.53902596", "0.5368642", "0.53416634", "0.53233325", "0.5313398", "0.53032255", "0.5299673", "0.5295995", "0.5259...
0.66815335
0
Returns the first sunday of the given month of the given year. >>> GetFirstSundayOfMonth(2016, 2) 7 >>> GetFirstSundayOfMonth(2016, 3) 6 >>> GetFirstSundayOfMonth(2000, 1) 2
def GetFirstSundayOfMonth(year, month): weeks = calendar.Calendar().monthdays2calendar(year, month) # Return the first day in the first week that is a Sunday. return [date_day[0] for date_day in weeks[0] if date_day[1] == 6][0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first_day_of_month(date):\n return date.replace(day=1)", "def first_day_of_month(date):\n return date.replace(day=1)", "def countSundaysFirstOfMonth(startYear, endYear):\n\tdayOfWeek = 1\n\tnumSundays = 0\n\tfor year in xrange(1900, endYear + 1):\n\t\tfor month in xrange(1, 13):\n\t\t\tif year >= sta...
[ "0.64842963", "0.64842963", "0.6202308", "0.6187605", "0.6112335", "0.6027973", "0.60278654", "0.6023816", "0.5930069", "0.5766985", "0.5711467", "0.5659422", "0.56270677", "0.5547177", "0.55425495", "0.5527288", "0.5471577", "0.54612195", "0.5457487", "0.54439706", "0.540590...
0.85827523
0
Gets the approximate build date given the specific build type. >>> GetBuildDate('default', datetime.datetime(2016, 2, 6, 1, 2, 3))
def GetBuildDate(build_type, utc_now): day = utc_now.day month = utc_now.month year = utc_now.year if build_type != 'official': first_sunday = GetFirstSundayOfMonth(year, month) # If our build is after the first Sunday, we've already refreshed our build # cache on a quiet day, so just use that day. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetBuildDate(build_filename):\n try:\n with open(build_filename) as f:\n return float(f.readline())\n except (IOError, ValueError):\n return 0.0", "def build_date(self) -> str:\n data = \"none yet\"\n if self.STARTED:\n data = self.about.get(\"Build Date\", \"UNKNOWN\")\...
[ "0.68794686", "0.6811394", "0.6633875", "0.6123327", "0.6031452", "0.59449786", "0.5787215", "0.5717675", "0.5698179", "0.5636052", "0.562484", "0.55658007", "0.5552328", "0.55515826", "0.5527472", "0.5517274", "0.55112916", "0.54897165", "0.5476035", "0.54652506", "0.5418371...
0.7833104
0
List current checks on given repo ref.
async def list(app: AppIdentity, repo: str, ref: str): repo = RepoName.parse(repo) async with aiohttp.ClientSession( headers=await app.installation_headers(repo.owner)) as sesh: fetch = checks.GetRuns(owner=repo.owner, repo=repo.repo, ref=ref) print(await fetch.execute(sesh))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_refs(config, args):\n for item in lib.input_json_lines():\n yield config.repo.ref(item)", "def git_status():\n\tl = []\n\tdebug(\"Not implemented\",1)\n\n\treturn l", "def list_refs(self):\n pass", "def checklists(self):\n return self.pods.all().checklists", "def check_build_stat...
[ "0.584414", "0.58094585", "0.57224625", "0.5621346", "0.5513199", "0.54575586", "0.5441844", "0.5393468", "0.53929275", "0.5325349", "0.5319219", "0.5276341", "0.5242121", "0.5219414", "0.52133495", "0.52090275", "0.52059555", "0.5200033", "0.5191004", "0.5177645", "0.5156163...
0.71473974
0
Returns a sorted list of stops, sorted by distance from the given point.
def get_stops_sorted( latitude, longitude ): returnvalue = [] stops_file = open( 'google_transit/stops.txt' ) stops_iter = DictReader( stops_file ) for stop in stops_iter: distance = angular_distance( latitude, longitude, float( stop[ 'stop_lat' ] ), float( stop[ 'stop_lon' ])) stop[ 'distance' ] = dis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sortDistance(self, point = (-1, -1)):\n return FeatureSet(sorted(self, key = lambda f: f.distanceFrom(point)))", "def sort(points):\n if len(points) == 0:\n return []\n \n starting_vertex = min(points)\n reference_point = starting_vertex + Point2D(0, 1)\n ...
[ "0.7020484", "0.63203174", "0.62495136", "0.5769085", "0.5747792", "0.56788474", "0.5570238", "0.54841065", "0.53662777", "0.5289484", "0.52861816", "0.5244743", "0.52408653", "0.5218816", "0.5199385", "0.5181247", "0.5177152", "0.5161949", "0.5161203", "0.5150489", "0.513137...
0.657288
1
Returns the angular distance between two points
def angular_distance( lat1, lon1, lat2, lon2 ): pi_180 = pi / 180 return acos( cos( lat1 * pi_180 ) * cos( lon1 * pi_180 ) * cos( lat2 * pi_180) * cos( lon2 * pi_180 ) + cos( lat1 * pi_180) * sin( lon1 * pi_180 ) * cos( lat2 * pi_180) * sin( lon2 * pi_180 ) + sin( lat1 * pi_180 ) * sin( lat2 * pi_180 ))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def angular_distance(lng1, lat1, lng2, lat2):\n\n phi1 = math.radians(lat1)\n phi2 = math.radians(lat2)\n\n d_phi = math.radians(lat2 - lat1)\n d_lmd = math.radians(lng2 - lng1)\n\n A = math.pow(math.sin(d_phi / 2), 2) + \\\n math.cos(phi1) * math.cos(phi2) * \\\n math.pow(math.sin(d_lmd / 2), 2)\n\n return 2 * ...
[ "0.74848044", "0.69298506", "0.6856045", "0.6851529", "0.6850949", "0.6821571", "0.6805049", "0.68026394", "0.6726844", "0.67224205", "0.6722374", "0.671347", "0.67133456", "0.6711086", "0.6701511", "0.66720694", "0.667153", "0.66648185", "0.666308", "0.66407585", "0.6630755"...
0.7870642
0
Add the close image to this button.
def __add_icon_to_button(self): self.set_relief(gtk.RELIEF_NONE) icon_box = gtk.HBox(False, 0) image = gtk.Image() image.set_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_MENU) settings = gtk.Widget.get_settings(self) width, height = gtk.icon_size_l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def click_close_button(self):\n self.click_img(target_img=SETTINGS['img_paths']['buttons']['close'])", "def createCloseButton(self, parent):\n return Button(parent, Message.LABEL_BUTTON_CLOSE, Icon.ACTION_CLOSE, \n command=self.close)", "def closeImage(j):\n displayMes...
[ "0.78842396", "0.6995919", "0.65193367", "0.63515306", "0.63302755", "0.63203615", "0.62561536", "0.61974", "0.61519027", "0.60773885", "0.6056336", "0.6036248", "0.59958935", "0.5840996", "0.5732481", "0.5679623", "0.5643048", "0.56095254", "0.5570533", "0.55596006", "0.5543...
0.72414094
1
Run redmapper on a single healpix pixel. This method will check if files already exist, and will skip any steps that already exist. The border radius will automatically be calculated based on the richest possible cluster at the lowest possible redshift. All files will be placed in self.config.outpath (see self.__init__...
def run(self): # need to think about outpath # Make sure all files are here and okay... if not self.config.galfile_pixelized: raise ValueError("Code only runs with pixelized galfile.") self.config.check_files(check_zredfile=True, check_bkgfile=True, check_bkgfile_componen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n if not self.config.galfile_pixelized:\n raise ValueError(\"Code only runs with pixelized galfile.\")\n\n self.config.check_files(check_zredfile=False, check_bkgfile=True, check_bkgfile_components=False, check_parfile=True, check_zlambdafile=True)\n\n # Compute the b...
[ "0.67487633", "0.63081914", "0.62226206", "0.59950316", "0.57797056", "0.5724643", "0.5548937", "0.5396003", "0.53287005", "0.53171885", "0.5274112", "0.5228013", "0.52234906", "0.52086335", "0.5201472", "0.5201053", "0.5174415", "0.5171564", "0.51695555", "0.51538444", "0.51...
0.71805817
0
Run runcat on a single healpix pixel. All files will be placed in self.config.outpath (see self.__init__)
def run(self): if not self.config.galfile_pixelized: raise ValueError("Code only runs with pixelized galfile.") self.config.check_files(check_zredfile=False, check_bkgfile=True, check_bkgfile_components=False, check_parfile=True, check_zlambdafile=True) # Compute the border size ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n\n # need to think about outpath\n\n # Make sure all files are here and okay...\n\n if not self.config.galfile_pixelized:\n raise ValueError(\"Code only runs with pixelized galfile.\")\n\n self.config.check_files(check_zredfile=True, check_bkgfile=True, check_...
[ "0.6371441", "0.5963486", "0.5613234", "0.555862", "0.5553763", "0.5502191", "0.5487119", "0.5415223", "0.538835", "0.5333105", "0.5228279", "0.52231663", "0.5197447", "0.5101565", "0.5088998", "0.50669104", "0.5051589", "0.50342584", "0.5012079", "0.49999022", "0.49969113", ...
0.78551203
0
Run zmask on a single healpix pixel. This method will check if files already exist, and will skip any steps that already exist. The border radius will automatically be calculated based on the richest possible cluster at the lowest possible redshift. All files will be placed in self.config.outpath (see self.__init__)
def run(self): if not self.config.galfile_pixelized: raise ValueError("Code only runs with pixelized galfile.") self.config.check_files(check_zredfile=False, check_bkgfile=True, check_parfile=True, check_randfile=True) # Compute the border size ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n if not self.config.galfile_pixelized:\n raise ValueError(\"Code only runs with pixelized galfile.\")\n\n self.config.check_files(check_zredfile=True, check_bkgfile=True, check_bkgfile_components=True, check_parfile=True, check_zlambdafile=True)\n\n # Compute the bor...
[ "0.6629627", "0.62719816", "0.6038128", "0.60295534", "0.5812431", "0.57740736", "0.57329434", "0.5661095", "0.56264246", "0.5604142", "0.5582197", "0.5575477", "0.55748725", "0.5556835", "0.55290353", "0.5528477", "0.55214965", "0.5478416", "0.5466864", "0.5445852", "0.54371...
0.7799771
0
Run zscan on a single healpix pixel. All files will be placed in self.config.outpath (see self.__init__)
def run(self): if not self.config.galfile_pixelized: raise ValueError("Code only runs with pixelized galfile.") self.config.check_files(check_zredfile=True, check_bkgfile=True, check_bkgfile_components=True, check_parfile=True, check_zlambdafile=True) # Compute the border size ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n if not self.config.galfile_pixelized:\n raise ValueError(\"Code only runs with pixelized galfile.\")\n\n self.config.check_files(check_zredfile=False, check_bkgfile=True,\n check_parfile=True, check_randfile=True)\n\n # Compute the bor...
[ "0.7093423", "0.66149205", "0.6384764", "0.6182628", "0.5557666", "0.55530584", "0.5510526", "0.54714817", "0.54650265", "0.5442735", "0.54236215", "0.5420005", "0.54110485", "0.5377501", "0.53124654", "0.530529", "0.5301755", "0.5270496", "0.5258963", "0.52395946", "0.523777...
0.8213629
0
Load df to TD Table
def load_td_table(tab_df_list, if_exists='append'): try: dest_table, dataframe, client = tab_df_list if dataframe.empty: print(f'Table {dest_table} has no new data to load...') else: # Converting 'NaN' to NULL dataframe = dataframe.where(pd.notnull(datafra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_table_to_tracy_file(latname: str, df: pd.DataFrame, filename: str) -> None:\n save_string(parse_table_to_tracy_string(latname, df), filename)", "def __load_gt(df_table, df_idx, p_csv):\n idx_start = df_idx\n with open(p_csv, 'rb') as f_csv:\n for line in f_csv:\n...
[ "0.6317331", "0.62949616", "0.62701654", "0.6240764", "0.6213843", "0.6152276", "0.61426777", "0.6128492", "0.61188745", "0.61170876", "0.6106664", "0.6071195", "0.6043488", "0.60277236", "0.59732497", "0.59642226", "0.5963602", "0.58879924", "0.5873924", "0.587109", "0.58623...
0.6952426
0
From complete_routes.txt generated by fetch_mbta_routes, outputs list of possible mbta route_ids
def mbta_route_list(): f = open('complete_routes.txt', 'r') complete_routes = ast.literal_eval(f.read()) #creates list of all route_ids in MBTA system subway_route_list = [] for x in range(len(complete_routes['mode'])): if complete_routes['mode'][x]['mode_name'] == 'Subway': for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_routes():\n\n return Db().get_line_ids()", "def bus_routes_direction():\n route_list = []\n os.chdir(\"../Data\")\n for file in glob.glob(\"*.csv\"):\n print(file) #useful for monitoring progress of function\n reader = csv.reader(open(file))\n for line in reader:\n ...
[ "0.6657399", "0.623016", "0.608577", "0.60547775", "0.5974454", "0.5870919", "0.583147", "0.58048505", "0.58005136", "0.5778787", "0.5746239", "0.573472", "0.57338464", "0.5691639", "0.56693816", "0.5650809", "0.56485844", "0.56442", "0.56375074", "0.562753", "0.5611618", "...
0.815749
0
Fetch from url or from file if it has been cached previously
def fetch_maybe(cls, url, path, save=False): if os.path.isfile(path): # print("Found %s" % os.path.basename(path)) with open(path, "rb") as file: return file.read(), True if save: return cls.fetch_and_save(url, path), False return cls.fetch_wit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_and_cache(data_url, file, data_dir=\"data\", force=False):\n data_dir = Path(data_dir)\n data_dir.mkdir(exist_ok = True)\n file_path = data_dir / Path(file)\n if force and file_path.exists():\n file_path.unlink()\n if force or not file_path.exists():\n print('Downloading...',...
[ "0.71518296", "0.7033755", "0.70170456", "0.70076776", "0.6999763", "0.6917222", "0.68979603", "0.6897935", "0.6821177", "0.6820702", "0.6801673", "0.67860883", "0.6752806", "0.6752673", "0.6666926", "0.66282046", "0.6614238", "0.6608379", "0.66022563", "0.6602047", "0.65935"...
0.76373774
0
Fetch file and save to disk
def fetch_and_save(cls, url, path): content = cls.fetch_with_retry(url) if not content: return False # print("Saving {}".format(os.path.basename(path))) with open(path, "wb") as file: file.write(content) return content
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_save(url):\n\n name = url.split(\"/\")[-1]\n response = requests.get(url, stream=True)\n if response.status_code == 200:\n with open(f\"{DATA_PATH}/{name}\", \"wb\") as f:\n f.write(response.raw.read())\n else:\n logging.info(f\"Failed {url} download\")", "def save(...
[ "0.74186593", "0.6852157", "0.67538196", "0.6674495", "0.66473705", "0.66278994", "0.65727353", "0.6508837", "0.6444663", "0.64405197", "0.6414596", "0.6410541", "0.63965726", "0.6357957", "0.63492334", "0.6310455", "0.6295792", "0.6293493", "0.6283312", "0.6273704", "0.62687...
0.7322474
1
Implementatin of sim(n1, n2) from Collins and Duffy (2001). Parsing with a Single Neuron. Given two (dependency parse) graphs and a node from each one, returns the set of common dependency targets. Each target consists of a (target node ID, target node ID) tuple, where the first target is from the first graph and the s...
def common_dependency_targets(graph1, graph2, n1, n2, node_attrib='label', edge_attrib='label'): n1_children = dependency_children(graph1, n1, edge_attrib=edge_attrib) n2_children = dependency_children(graph2, n2, edge_attrib=edge_attrib) n1_rels, n2_rels = defaultdict(list), d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_diff(self):\n if self.input1 is None or self.input2 is None:\n raise Exception(\"Missing input: please run the populate() method first\")\n if self.node_dict1 is None or self.node_dict2 is None:\n self.make_node_dict()\n # Initialize dictonaries to keep track of ...
[ "0.64068115", "0.60855806", "0.602546", "0.60104007", "0.5977929", "0.5904355", "0.57879174", "0.5684651", "0.5627905", "0.56069714", "0.55558586", "0.5541558", "0.5518867", "0.5504052", "0.5490307", "0.5487288", "0.54431766", "0.5415038", "0.5405841", "0.53724426", "0.533716...
0.72850496
0
Counts the number of common (dependency parse) subgraphs rooted at n1 and n2. This is an implementation of Cm(n1, n2) for dependency structures from Collins and Duffy (2001). Parsing with a Single Neuron.
def count_common_subgraphs(graph1, graph2, n1, n2, node_attrib='label', edge_attrib='label'): for graph in (graph1, graph2): assert nx.is_directed_acyclic_graph(graph) if graph1.node[n1][node_attrib] != graph2.node[n2][node_attrib]: return 0 n1_children = dependenc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def common_count(self, node_1, node_2):\n return int(len(set(nx.neighbors(self.graph, node_1)).intersection(set(nx.neighbors(self.graph, node_2)))))", "def countComponents(self, n: int, edges: List[List[int]]) -> int:\n # BFS O_n time and space\n \n # union find ALG\n uf = Unio...
[ "0.714576", "0.6026852", "0.59091425", "0.5810028", "0.5807212", "0.5753279", "0.5661298", "0.56599116", "0.56133384", "0.559882", "0.5597078", "0.5583921", "0.55722636", "0.55678254", "0.554752", "0.5523636", "0.5515944", "0.55092716", "0.55087376", "0.54997736", "0.5478763"...
0.7671494
0
Given a graph, returns a set of its dependency rules. If root_node is given, returns only those rules from the subgraph rooted at that node. A dependency rules is represented by a (source node label, edge/relation label, target node label) triple, e.g. ('woman', 'dt', 'the'). Returns
def get_dependency_rules(graph, root_node=None, node_attrib='label', edge_attrib='label'): rules = set() if not root_node: # root node is the first element in a topological sort of the graph root_node = nx.topological_sort(graph)[0] for source, target in nx.dfs_edg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dependencies(graph: Graph, node: Node):\n dependencies: Set[Node] = set()\n def traverse_nodes(nodes):\n for candidate in nodes:\n if candidate not in dependencies:\n dependencies.add(candidate)\n traverse_nodes(graph[candidate])\n traverse_nodes(gra...
[ "0.64498824", "0.6156136", "0.6010759", "0.58395386", "0.5650117", "0.5455874", "0.5448717", "0.54439825", "0.54088295", "0.53029513", "0.5287118", "0.5284669", "0.5279773", "0.5236452", "0.52084494", "0.5171899", "0.51481843", "0.5142804", "0.5123818", "0.5096218", "0.507359...
0.8420895
0
returns True, iff a graph contains all dependency rules of the given subgraph candidate.
def includes_all_subgraph_rules(graph, subgraph_candidate, subgraph_root_node=None, node_attrib='label', edge_attrib='label'): graph_rules = get_dependency_rules(graph, node_attrib=node_attrib, edge_attrib=edge_at...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_dependency_subgraph(graph, subgraph_candidate,\n node_attrib='label', edge_attrib='label'):\n if len(subgraph_candidate) > 1:\n if nx.is_weakly_connected(subgraph_candidate):\n if includes_all_subgraph_rules(graph, subgraph_candidate,\n ...
[ "0.7680446", "0.64932567", "0.616087", "0.59788954", "0.59330606", "0.5835182", "0.5783123", "0.5766517", "0.5704794", "0.56961316", "0.5679903", "0.5674052", "0.5671569", "0.56623936", "0.5658264", "0.5634861", "0.5614241", "0.56140757", "0.5604958", "0.55928236", "0.5573771...
0.7791654
0
returns True, if the graph contains all of the subgraph candidate's dependency rules. The subgraph must also be (weakly) connected and contain at least two nodes.
def is_dependency_subgraph(graph, subgraph_candidate, node_attrib='label', edge_attrib='label'): if len(subgraph_candidate) > 1: if nx.is_weakly_connected(subgraph_candidate): if includes_all_subgraph_rules(graph, subgraph_candidate, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def includes_all_subgraph_rules(graph, subgraph_candidate,\n subgraph_root_node=None,\n node_attrib='label', edge_attrib='label'):\n graph_rules = get_dependency_rules(graph, node_attrib=node_attrib,\n edge_attri...
[ "0.7630183", "0.68231225", "0.64021075", "0.6321216", "0.6030239", "0.60031056", "0.60005057", "0.59945226", "0.5991897", "0.59907985", "0.5969818", "0.59631526", "0.59560096", "0.5941007", "0.5937184", "0.593042", "0.5920621", "0.5900079", "0.589987", "0.5840563", "0.5838228...
0.7640155
0
naively generate all (dependency parse) subgraphs of a given graph by iterating through all possible node combinations. HIGHLY INEFFICIENT.
def get_dependency_subgraphs(graph, node_attrib='label', edge_attrib='label'): assert nx.is_directed_acyclic_graph(graph) for n in xrange(graph.number_of_nodes()): for subnodes in itertools.combinations(graph.nodes(), n+1): subgraph_candidate = graph.subgraph(subnodes) if is_depe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_subgraphs(graph):\n nodes_powerset = get_nodes_combinations(graph)\n #print(\"Doing\")\n #draw_graph(graph)\n subgraphs = []\n for nodes in nodes_powerset:\n subg = graph.subgraph(nodes)\n nodes = subg.nodes(data=True)\n if nx.is_weakly_connected(subg):\n subg...
[ "0.71944106", "0.658198", "0.6509555", "0.64392537", "0.640974", "0.6388047", "0.6185399", "0.61799556", "0.61649305", "0.61399496", "0.6015442", "0.60139364", "0.6005733", "0.6004381", "0.599298", "0.59746885", "0.59744376", "0.59430206", "0.5927151", "0.5919803", "0.5884523...
0.6886045
1
dp[i][j] represent the length of longest palindrome subseq from s[i] to s[j] so the answer is dp[0][n 1]
def longestPalindromeSubseq(self, s: str) -> int: n = len(s) dp = [[1] * n for _ in range(n)] for length in range(1, n + 1): for i in range(n - length + 1): j = i + length - 1 print(i, j) if length == 1: dp[i][j] = 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def longestPalindrome(self, s):\n if not s:\n return 0\n #init i and list\n i = 0\n singles = []\n while i < len(s):\n count_in_singles = singles.count(s[i])\n if count_in_singles > 0:\n singles.pop(singles.index(s[i]))\n ...
[ "0.7569497", "0.739337", "0.7330967", "0.7084973", "0.7000375", "0.6921926", "0.68645984", "0.68183255", "0.6751637", "0.66429085", "0.65716267", "0.6562179", "0.65591437", "0.6377998", "0.6305075", "0.6299351", "0.62958795", "0.62937003", "0.6278404", "0.6270836", "0.6138917...
0.8747813
0
Sets GoogleMediaItem object attributes to values given in dictionary
def from_dict(self, dictionary): required_keys = ['filename', 'id', 'baseUrl'] assert all(key in list(dictionary.keys()) for key in required_keys), \ 'Dictionary missing required key. GoogleMediaItem.from_dict() ' \ 'requires keys: {}'.format(required_keys) self.name = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, data):\n # add play_guid as it sometimes doesn't exist\n if 'play_guid' not in data:\n data['play_guid'] = ''\n # loop through data\n for x in data:\n # set information as correct data type\n mlbgame.object.setobjattr(self, x, data[x])...
[ "0.60931814", "0.6062052", "0.60582787", "0.5953111", "0.5953111", "0.5855602", "0.5801648", "0.5776378", "0.5689186", "0.5677398", "0.5652272", "0.5617211", "0.56029904", "0.55923235", "0.5581952", "0.55641544", "0.5533538", "0.5525152", "0.55217475", "0.5504772", "0.5480044...
0.6487751
0
Name of stages to initialize as string or list (not tuple!) or None to skip. Skip single axes with "" or None as item in the list.
def stages(self, stages): if stages is None: self._stages = None else: self._stages = stages if isinstance(stages, list) else [stages] * len(self.pidevice.allaxes) debug('ControllerStartup.stages = %s', itemstostr(self._stages))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def skip_stage(stage):\n stage_values[stage] = 0\n stage_maxes[stage] = 0\n canvas.itemconfig(\n 'text_' + stage,\n text=stage_names[stage] + ': ' + trans_skipped,\n )\n bar_length(stage, 1) # Force stage to be max filled.\n canvas.delete('tick_' + s...
[ "0.51637655", "0.49777758", "0.49761155", "0.49150392", "0.4887601", "0.48852953", "0.48852953", "0.48343307", "0.47870418", "0.47764853", "0.47706214", "0.47684795", "0.47631693", "0.476252", "0.46925962", "0.4682446", "0.466207", "0.46271232", "0.46085522", "0.4608084", "0....
0.5163081
1
Name of axes as list of strings or None.
def axesnames(self): return self._axesnames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def axesNames(self, data, info):\n return []", "def allAxes( mv ):\n if mv is None: return None\n return mv.getAxisList()", "def customAxisNames(self):\n return []", "def axis_name(self):\n return self._axis_name", "def _get_axes_numbers(self, axes):\n if axes is None:\n ...
[ "0.7990254", "0.69446003", "0.69080454", "0.65960664", "0.65699506", "0.6543819", "0.6498505", "0.64880943", "0.6442048", "0.6376614", "0.63446236", "0.6276407", "0.6262554", "0.6262554", "0.6227108", "0.6180861", "0.6115117", "0.6089225", "0.5930945", "0.5925059", "0.5902349...
0.79235536
1
Call INI command if available.
def callini(self): debug('ControllerStartup.callini()') if not self.pidevice.HasINI() or self.prop['skipini']: return self.pidevice.INI()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_if_interactive(self):\n pass", "def cmd_INTERFACE(self, line):\r\n config = InterfaceOptions(self.terminal)\r\n\r\n try:\r\n config.parseOptions(line)\r\n cmd = config.subCommand\r\n opts = config.subOptions if hasattr(config, 'subOptions') else {}\r\...
[ "0.5661725", "0.5556138", "0.55064124", "0.52995545", "0.5288064", "0.52753496", "0.5252175", "0.52297914", "0.5213469", "0.5204751", "0.51983714", "0.5183917", "0.517432", "0.5154659", "0.51525563", "0.51415825", "0.51256984", "0.5110826", "0.51041824", "0.5098343", "0.50814...
0.678965
0
Reset servo if it has been changed during referencing.
def resetservo(self): debug('ControllerStartup.resetservo()') if self.servostates is not None: setservo(self.pidevice, self.servostates) elif self._databuf['servobuf']: setservo(self.pidevice, self._databuf['servobuf'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def servo_off(self):\n self.logger.info('Setting servo OFF')\n self.electronics.move_servo(0)\n self.config['servo']['status'] = 0", "def poweron(self) -> None:\n self.servo_reset()", "def servo_on(self):\n self.logger.info('Setting servo ON')\n self.electronics.move_s...
[ "0.6844293", "0.6448711", "0.64227194", "0.6132651", "0.60031986", "0.59832084", "0.59482604", "0.58659905", "0.5832211", "0.577215", "0.56202066", "0.5544754", "0.55105555", "0.55058527", "0.5457077", "0.5444339", "0.54216516", "0.54005915", "0.53958654", "0.5393592", "0.535...
0.7412218
0
Reference unreferenced axes if according option has been provided and wait on completion.
def referencewait(self): debug('ControllerStartup.referencewait()') if not self.refmodes or self.prop['skipref']: return self._databuf['servobuf'] = getservo(self.pidevice, self.pidevice.axes) toreference = {} # {cmd: [axes]} for i, refmode in enumerate(self._refmode...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _ref_with_refcmd(self, axes, refmode):\n debug('ControllerStartup._ref_with_refcmd(axes=%s, refmode=%s)', axes, refmode)\n for axis in axes:\n if self.pidevice.HasRON():\n try:\n self.pidevice.RON(axis, True)\n except GCSError as exc:\n ...
[ "0.5747913", "0.5492766", "0.5326451", "0.53198856", "0.53106946", "0.52366793", "0.52360547", "0.50930434", "0.5065622", "0.5005657", "0.49565744", "0.49383938", "0.49214408", "0.48142612", "0.47483495", "0.47238323", "0.4721073", "0.471163", "0.4707206", "0.4698941", "0.469...
0.5793726
0
Check if 'axis' has already been referenced with 'refmode'.
def _isreferenced(self, refmode, axis): if self.prop['forceref']: return False if refmode in ('POS',): return False if refmode == 'ATZ': return self.pidevice.qATZ(axis)[axis] if refmode == 'REF': return self.pidevice.qREF(axis)[axis] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_ref_known(self):\r\n \r\n if \"N\" in self.ref:\r\n return False\r\n else:\r\n return True", "def checkRefs(self, export_refs):\r\n return True", "def _ref_with_refcmd(self, axes, refmode):\n debug('ControllerStartup._ref_with_refcmd(a...
[ "0.62752515", "0.6220863", "0.6005233", "0.59288573", "0.5925373", "0.58923024", "0.58557653", "0.5796622", "0.570388", "0.5672749", "0.5603658", "0.5603465", "0.55883646", "0.55624634", "0.55470496", "0.55324847", "0.5511487", "0.5494428", "0.5420732", "0.53797483", "0.53541...
0.7821823
0
Enable RON, change servo state if appropriate and reference 'axes' with the 'refmode' command.
def _ref_with_refcmd(self, axes, refmode): debug('ControllerStartup._ref_with_refcmd(axes=%s, refmode=%s)', axes, refmode) for axis in axes: if self.pidevice.HasRON(): try: self.pidevice.RON(axis, True) except GCSError as exc: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def servo_on(self):\n self.logger.info('Setting servo ON')\n self.electronics.move_servo(1)\n self.config['servo']['status'] = 1", "def turn_on(self):\n # read out the current pose of the robot\n configuration = self.robot.get_all_servo_position()\n\n # interpolate to th...
[ "0.6464424", "0.60598856", "0.57750314", "0.5707349", "0.57046753", "0.566332", "0.5652935", "0.5643225", "0.5640739", "0.560289", "0.55447114", "0.54740083", "0.54580873", "0.5457564", "0.540518", "0.53942823", "0.5375577", "0.53675616", "0.5366244", "0.53644043", "0.5353949...
0.6683219
0
Autozero 'axes' and move them to position "0.0".
def _autozero(self, axes): debug('ControllerStartup._autozero(axes=%s)', axes) self.pidevice.ATZ(axes, ['NaN'] * len(axes)) waitonautozero(self.pidevice, axes, **self._kwargs) setservo(self.pidevice, axes, [True] * len(axes), **self._kwargs) moveandwait(self.pidevice, axes, [0.0]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def moveToZero(self):\n\t\tself.grp.a.t.v = [0,0,0]\n\t\tself.grp.a.r.v = [0,0,0]", "def adjust_axes(axes):\n # TODO: Uncomment & decide for each subplot!\n for ax in axes.itervalues():\n core.hide_axis(ax)\n\n for k in [\n \"placeholder\",\n \"placeholder1\",\n \...
[ "0.6837609", "0.64958775", "0.61919284", "0.59692055", "0.59586036", "0.59518695", "0.5851395", "0.58473384", "0.5823534", "0.58203787", "0.5774866", "0.5774172", "0.57657653", "0.5747361", "0.5743723", "0.5738721", "0.57278085", "0.5712758", "0.57062715", "0.56823045", "0.56...
0.7430454
0
Set RON accordingly and reference 'axes' with the POS command to position "0.0".
def _ref_with_pos(self, axes): debug('ControllerStartup._ref_with_pos(axes=%s)', axes) assert self.pidevice.HasPOS(), 'controller does not support the POS command' self.pidevice.RON(axes, [False] * len(axes)) self.pidevice.POS(axes, [0.0] * len(axes)) waitonready(self.pidevice, *...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_axes(self):\n self += helper.line(stroke=\"black\", x1=self.__dict__['x'], x2=self.__dict__['x'], y1=0, y2=self.__dict__['y']*2)\n self += helper.line(stroke=\"black\", x1=0, x2=self.__dict__['x']*2, y1=self.__dict__['y'], y2=self.__dict__['y'])", "def set_relpos(self, relpos):\n ...
[ "0.5808343", "0.57251", "0.56590384", "0.5630359", "0.5607852", "0.56060356", "0.5588824", "0.5571485", "0.5571485", "0.5540956", "0.5528975", "0.5477126", "0.54330236", "0.5341452", "0.53389716", "0.5327909", "0.5302402", "0.5279917", "0.52782357", "0.5261827", "0.52607894",...
0.69301665
0
Enable all connected axes if appropriate.
def enableaxes(self): debug('ControllerStartup.enableaxes()') if not self.pidevice.HasEAX() or self.prop['skipeax']: return for axis in self.pidevice.axes: try: self.pidevice.EAX(axis, True) except GCSError as exc: if exc != gcs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setAxisAllColor(idx=-1, axes='XYZ'):\n dislin.axclrs(idx, 'ALL', axes)", "def set(self, **kwargs):\n for ax in self.axes.flat:\n ax.set(**kwargs)\n return self", "def enable(self):\n self.enabled = True\n for child in self.children:\n child.enable()", "def clear_gra...
[ "0.6418385", "0.6268001", "0.6101318", "0.5986963", "0.59757614", "0.575294", "0.5737837", "0.56969994", "0.56938237", "0.5679895", "0.56635314", "0.5643768", "0.5632977", "0.5628028", "0.5533893", "0.5533893", "0.5528595", "0.54902184", "0.53917605", "0.5374233", "0.5358677"...
0.6553111
0
Write 'wavepoints' for 'wavetable' in bunches of 'bunchsize'. The 'bunchsize' is device specific. Please refer to the controller manual.
def writewavepoints(pidevice, wavetable, wavepoints, bunchsize=None): if not isdeviceavailable([GCS2Commands, GCS21Commands], pidevice): raise TypeError('Type %s of pidevice is not supported!' % type(pidevice).__name__) wavepoints = wavepoints if isinstance(wavepoints, (list, set, tuple)) else [wavepoi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trackBunchTurns(self, bunch):\n\t\tturns = self.__turns\n\t\t#start\n\t\tfor i in range(turns-1):\t\t\t\n\t\t\tself.trackBunch(bunch)\t\n\t\t\tsyncPart = bunch.getSyncParticle()\n\t\t\ttime = syncPart.time()\n\t\t\tself.setTimeDepStrength(time)\n\t\t\tprint \"debug trackBunchTurns time\",time,\"in\",i,\"turn\"...
[ "0.51027554", "0.49448773", "0.48653984", "0.48416498", "0.48164257", "0.48011476", "0.47285727", "0.46642175", "0.46641108", "0.46604708", "0.4649817", "0.46433756", "0.4642581", "0.45872566", "0.4520838", "0.450811", "0.44464996", "0.44350323", "0.44100547", "0.44029313", "...
0.7523045
0
Return dictionary of servo states or "False" if the qSVO command is not supported.
def getservo(pidevice, axes): if not isdeviceavailable([GCS2Commands, GCS21Commands], pidevice): raise TypeError('Type %s of pidevice is not supported!' % type(pidevice).__name__) axes = getaxeslist(pidevice, axes) if not axes: return {} if pidevice.HasqSVO(): return pidevice.qS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def servo_codes(self):\r\n return self._arm.servo_codes", "def setservo(pidevice, axes, states=None, toignore=None, **kwargs):\n if not isdeviceavailable([GCS2Commands, GCS21Commands], pidevice):\n raise TypeError('Type %s of pidevice is not supported!' % type(pidevice).__name__)\n\n if not p...
[ "0.5569695", "0.5473434", "0.54679066", "0.5196154", "0.51944697", "0.5161103", "0.5157473", "0.5153603", "0.5144221", "0.51405114", "0.50765646", "0.50393516", "0.49805614", "0.49218124", "0.49120718", "0.48817956", "0.4870195", "0.4847555", "0.48379037", "0.48323292", "0.48...
0.574958
0
Return dictionary of on target states for open or closedloop 'axes'. If qOSN is not supported open loop axes will return True.
def ontarget(pidevice, axes): if not isdeviceavailable([GCS2Commands, GCS21Commands], pidevice): raise TypeError('Type %s of pidevice is not supported!' % type(pidevice).__name__) axes = getaxeslist(pidevice, axes) if not axes: return {} servo = getservo(pidevice, axes) closedloopax...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def axes_coupled(robot):\n\n target_ctrl_path = get_target_ctrl_path(robot)\n attr_name = 'axisCoupling'\n\n attr_path = target_ctrl_path + '.' + attr_name\n\n if not pm.objExists(attr_path):\n return False\n else:\n return pm.getAttr(attr_path)", "def axes_active(self) -> np.ndarray...
[ "0.52759826", "0.51507485", "0.49435332", "0.48457035", "0.48273617", "0.47947535", "0.47759688", "0.47717133", "0.4736952", "0.47318158", "0.4717859", "0.471497", "0.46966356", "0.4686796", "0.4681813", "0.4674398", "0.46723193", "0.46713328", "0.46647486", "0.46268576", "0....
0.5636245
0
Wait until referencing of 'axes' is finished or timeout.
def waitonreferencing(pidevice, axes=None, timeout=300, predelay=0, postdelay=0, polldelay=0.1): if not isdeviceavailable([GCS2Commands, GCS21Commands], pidevice): raise TypeError('Type %s of pidevice is not supported!' % type(pidevice).__name__) axes = getaxeslist(pidevice, axes) if not axes: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _UpdatePlot( self ):\n self._BusyDoOp( self._UpdatePlotImpl )", "def plot_finalize():\n global figure\n global axes\n\n plot_refresh()\n plt.ioff()\n plt.show()\n\n figure, axes = None, None", "def waitontarget(pidevice, axes=None, timeout=300, predelay=0, postdelay=0, polldelay=0.1):\...
[ "0.5682072", "0.56637263", "0.5506973", "0.54727566", "0.54668844", "0.54668844", "0.54668844", "0.54668844", "0.53185624", "0.5282941", "0.5264092", "0.5264092", "0.52434653", "0.52239007", "0.5200853", "0.51965016", "0.5195598", "0.5181763", "0.5116212", "0.51093733", "0.50...
0.5684494
0
Set servo of 'axes' to 'states'. Calls RNP for openloop axes and waits for servo operation to finish if appropriate. EAX is enabled for closedloop axes.
def setservo(pidevice, axes, states=None, toignore=None, **kwargs): if not isdeviceavailable([GCS2Commands, GCS21Commands], pidevice): raise TypeError('Type %s of pidevice is not supported!' % type(pidevice).__name__) if not pidevice.HasSVO(): return False if not axes: return True ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enableaxes(self):\n debug('ControllerStartup.enableaxes()')\n if not self.pidevice.HasEAX() or self.prop['skipeax']:\n return\n for axis in self.pidevice.axes:\n try:\n self.pidevice.EAX(axis, True)\n except GCSError as exc:\n ...
[ "0.56432706", "0.5405429", "0.5404202", "0.5402343", "0.54009134", "0.5158554", "0.50665253", "0.50475216", "0.5013823", "0.49779767", "0.49649036", "0.4883331", "0.48517424", "0.4835422", "0.48264295", "0.48081583", "0.47999898", "0.4750046", "0.47117424", "0.47070265", "0.4...
0.6717641
0
Wait until all 'axes' are on phase.
def waitonphase(pidevice, axes=None, timeout=300, predelay=0, postdelay=0, polldelay=0.1): if not isdeviceavailable([GCS2Commands, GCS21Commands], pidevice): raise TypeError('Type %s of pidevice is not supported!' % type(pidevice).__name__) axes = getaxeslist(pidevice, axes) if not axes: re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findphase(self):\n debug('ControllerStartup.findphase()')\n if not self.pidevice.HasFPH() or self.prop['skipfph']:\n return\n if not self._databuf['cstdone']:\n debug('no need to do find phase for axes %r', self.pidevice.axes)\n return\n for axis in ...
[ "0.5853217", "0.56518406", "0.5579938", "0.5540883", "0.55369157", "0.5502633", "0.54975456", "0.54909974", "0.5422398", "0.5422398", "0.5422398", "0.5422398", "0.5417364", "0.5417364", "0.54161793", "0.54110414", "0.53737473", "0.53620887", "0.534525", "0.53452307", "0.53350...
0.59770775
0
Wait until all macros are finished, then query and raise macro error.
def waitonmacro(pidevice, timeout=300, predelay=0, polldelay=0.1): if not isdeviceavailable([GCS2Commands, GCS21Commands], pidevice): raise TypeError('Type %s of pidevice is not supported!' % type(pidevice).__name__) maxtime = time() + timeout waitonready(pidevice, timeout=timeout, predelay=predela...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interrupted(self):\n print(\"Macro interrupted!\")", "def waitUntilFinished():", "def waitUntilFinished():", "def waitUntilFinished():", "def waitUntilFinished():", "def fatal_error_processor(self):\n while True:\n _ = (yield)\n self.failed = True\n self...
[ "0.53399175", "0.5052747", "0.5052747", "0.5052747", "0.5052747", "0.50137264", "0.501022", "0.496639", "0.4937988", "0.4925063", "0.49245542", "0.48591673", "0.48575124", "0.48339245", "0.48310927", "0.48293483", "0.48289663", "0.47969922", "0.4782267", "0.47466642", "0.4740...
0.51521873
1
Call MOV with 'axes' and 'values' and wait for motion to finish.
def moveandwait(pidevice, axes, values=None, timeout=300): if not isdeviceavailable([GCS2Commands, GCS21Commands], pidevice): raise TypeError('Type %s is not supported!' % type(pidevice).__name__) if not axes: return pidevice.MOV(axes, values) if isinstance(axes, dict): axes = l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def moveto(self, x, y, z):\n t = self.moveTime * 3\n N = self.moveSamples * 3\n # read initial position for all channels\n texts = [getattr(self, ax + \"Label\").text()\n for ax in self.activeChannels]\n initPos = [re.findall(r\"[-+]?\\d*\\.\\d+|[-+]?\\d+\", t)[0]...
[ "0.55523056", "0.55200475", "0.53758305", "0.5306232", "0.5270305", "0.5266047", "0.51731163", "0.51722825", "0.51123303", "0.5110023", "0.509963", "0.5097408", "0.5087578", "0.5083483", "0.5082668", "0.5075423", "0.5070343", "0.50366646", "0.5011553", "0.5005982", "0.4999176...
0.7088165
0
Test ability to generate csv with simple input data.
def test_csv_simple_input(self): # Mix of integer and string data. Ensure that commas and # quotes are escaped properly. data = [ { 'name': 'Normal string', 'item_num': 1, }, { 'name': 'String, with, commas', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_csv_no_callback(self):\n csvfile = testdata.create_csv({\n \"foo\": testdata.get_int(),\n \"bar\": testdata.get_words(),\n })\n self.assertEqual(1, len(csvfile))", "def test_to_csv(self):\n sale = SaleFactory(total_value=12347)\n self.assertIn('12...
[ "0.77176857", "0.74230194", "0.73120224", "0.7183386", "0.71010906", "0.7078166", "0.7026054", "0.69418746", "0.6898602", "0.6708954", "0.66887707", "0.6599895", "0.6592151", "0.65827006", "0.6554669", "0.65479755", "0.6535834", "0.6514693", "0.65141994", "0.65083003", "0.650...
0.7783978
0
Test that unicode cell values are converted correctly to csv.
def test_csv_with_unicode(self): data = [ { 'name': 'Normal string', 'item_num': 1, }, { 'name': u'String with ' + unichr(0x16c) + ' char', 'item_num': 2, }, ] table = TableReportFor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unicode_with_csv():\n data = [['观音', '1'], ['Ποσειδῶν', '456']]\n headers = ['letters', 'number']\n output = delimited_output_adapter.adapter(data, headers)\n assert \"\\n\".join(output) == dedent('''\\\n letters,number\\n\\\n 观音,1\\n\\\n Ποσειδῶν,456''')", "def unicode_...
[ "0.8036314", "0.6922067", "0.69172096", "0.69118446", "0.6771992", "0.6746358", "0.6688988", "0.6558301", "0.6473094", "0.6323869", "0.6294369", "0.6276984", "0.62547374", "0.62028056", "0.6178271", "0.61072475", "0.60752225", "0.6039979", "0.600815", "0.5966141", "0.59431046...
0.84924006
0
Ensure that excludesomecolumnsfromreport works.
def test_exclude_from_report(self): data = [ { 'name': 'page 1', 'item_num': 1, }, { 'name': 'page 2', 'item_num': 2, }, ] class TableWithExclude(TableReportForTesting): c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exclude_cols(self, *_, **__) -> Tuple[str, ...]:", "def _these_columns_cannot_annotate_exp_cons(self):\n _cols = set([]) #\n for param_name, req_cols in self.required_columns.items():\n _cols |= req_cols\n\n return _cols | self.other_useful_columns", "def test_overall_repor...
[ "0.664114", "0.6371519", "0.61428374", "0.6074265", "0.60691434", "0.5899227", "0.5741733", "0.5681908", "0.56517905", "0.5642689", "0.5597826", "0.5576453", "0.5570386", "0.55462635", "0.5531787", "0.55221844", "0.550766", "0.55015415", "0.5487185", "0.5482595", "0.5481908",...
0.7021682
0
Test ability to generate excel output with simple input data.
def test_excel_simple_input(self, extension='xls'): excel_support = getattr(settings, 'EXCEL_SUPPORT', django_tables2_reports.utils.get_excel_support()) response = self.table.treatement_to_response( self.table.as_csv(HttpRequest()), report_format='xls') self.assertEqual(r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_generate_sample_sheet(self):\n pass", "def test_export_spreadsheet(self):\r\n client = self.getClient()\r\n if client:\r\n exp = [['#SampleID', 'DOB'],\r\n ['#Example mapping file for the QIIME analysis package. '\r\n 'These 9 samples...
[ "0.780116", "0.69337434", "0.6777988", "0.6512617", "0.640232", "0.6325789", "0.6285732", "0.6262961", "0.62007165", "0.6108699", "0.6036565", "0.6028895", "0.60118926", "0.5993342", "0.59584403", "0.5911351", "0.5878128", "0.5867191", "0.5837545", "0.58317214", "0.58210737",...
0.72343
1
Takes a list of vertices and corresponding weights and returns the list of vertices resulting from the weighted average
def averageCurve(vertices, weights,a): weightedCurve = [[PVector.mult(j,i[0]) for j in i[1]] for i in zip(weights,vertices)] average = [averageVertices(i,weights,a) for i in zip(*weightedCurve)] return average
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _weightedAverage(list_):\n\n\t\taccum = [0, 0]\n\n\t\tfor point, weight in list_:\n\n\t\t\taccum[0] += point[0] * weight\n\t\t\taccum[1] += point[1] * weight\n\n\t\ttotalWeight = sum([weight for point, weight in list_])\n\n\n\t\tif totalWeight == 0:\n\t\t\t\n\t\t\treturn (0, 0)\n\n\n\t\taccum[0] /= float(total...
[ "0.76076883", "0.7525749", "0.73337907", "0.7230022", "0.71708345", "0.7100033", "0.70964843", "0.6970508", "0.68913996", "0.68118274", "0.68118274", "0.68118274", "0.6765599", "0.65661603", "0.64742553", "0.6403966", "0.6368752", "0.63204116", "0.62720555", "0.6237824", "0.6...
0.81328255
0
Loads knowledge base to memory
def load_knowledge_base(): knowledge_base = {} with open('knowledge_base.json') as f: knowledge_base = json.load(f) return knowledge_base
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_knowledge(self):\n MemoryManager.load_memory(self.knowledge_file)", "def load_knowledge(net, filepath):\n\treloaded = loadz(filepath)\n\tknowledge = [(name, reloaded[name]) for name in sorted(reloaded.keys())]\n\tset_knowledge(net, knowledge)", "def load(self):", "def load(self):\n pas...
[ "0.81079787", "0.671406", "0.6534463", "0.6513961", "0.6513961", "0.6513961", "0.6513961", "0.6447636", "0.6335379", "0.63297707", "0.63297707", "0.63241786", "0.62627333", "0.62624913", "0.61553985", "0.61483", "0.61483", "0.613253", "0.610389", "0.60957575", "0.5902059", ...
0.696881
1
Get recording's size in seconds
def get_recording_size(file_name): recording_size = check_output( ["mp3info", "-p", "%m:%s\n", "{}".format(file_name)]).decode("utf-8") print("Recording size:", str(recording_size)) minutes_seconds = (int(recording_size.split(":")[0]) * 60) seconds = int(recording_size.split(":")[1].replace("\n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duration(self):\n return self.sound.nframes", "def record_duration(self):\n return self.config.get('record_duration', 5)", "def get_frame_duration(self):\n return self._frame_duration", "def get_record_count(self):\n return os.path.getsize(self.path) / self._get_record_size()", ...
[ "0.7078902", "0.70021707", "0.68017805", "0.67804694", "0.6737474", "0.6670569", "0.6666141", "0.6623355", "0.6576982", "0.65693134", "0.6568904", "0.6546339", "0.65320414", "0.65001947", "0.64856166", "0.64756674", "0.6467947", "0.6441833", "0.6434663", "0.6421729", "0.63782...
0.7635485
0
Test that webhook returns 500 for unkown action
def test_webhook_unkown_action(self): event = { "body": json.dumps({ "queryResult": { "action": "1manage_bmi" }}) } context = {} resp = webhook(event, context) self.assertEqual(resp["statusCode"], 500) self.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unsupported_action(self):\r\n self.xmodule.verify_oauth_body_sign = Mock()\r\n request = Request(self.environ)\r\n request.body = self.get_request_body({'action': 'wrongAction'})\r\n response = self.xmodule.grade_handler(request, '')\r\n real_response = self.get_response...
[ "0.69867796", "0.698422", "0.6960273", "0.67963976", "0.6699416", "0.6666364", "0.6647646", "0.6636956", "0.6598994", "0.6533085", "0.65311563", "0.653109", "0.651041", "0.64883715", "0.6477502", "0.64637", "0.6421816", "0.6410432", "0.6400015", "0.639822", "0.6357702", "0....
0.8470133
0
Test that webhook return 500 for empty body/action in event
def test_webhook_empty_event(self): event = { 'body': json.dumps({}) } context = {} resp = webhook(event, context) self.assertEqual(resp["statusCode"], 500) self.assertEqual(resp["body"], json.dumps({}))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_webhook_unkown_action(self):\n event = {\n \"body\": json.dumps({\n \"queryResult\": {\n \"action\": \"1manage_bmi\"\n }})\n }\n context = {}\n resp = webhook(event, context)\n self.assertEqual(resp[\"statusCode...
[ "0.82119334", "0.7412875", "0.7366841", "0.72384053", "0.70663595", "0.67772496", "0.6771868", "0.6729244", "0.66838586", "0.6642581", "0.66096735", "0.6549085", "0.65390784", "0.64993393", "0.64882827", "0.64425206", "0.64246047", "0.6402282", "0.63719505", "0.6359598", "0.6...
0.87026906
0
Calculates surface area of square
def square_surface_area(a): return (a*a)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_surface_area(self):\n return np.sum(self._find_triangle_areas())", "def surface_area(self) -> float:\n return 4 * np.pi * self.radius**2", "def surfaceArea(self):\n surfaceArea = self.sideLength**2 * 6\n return surfaceArea", "def rectangle_surface_area(a,b):\n retur...
[ "0.7919954", "0.76347554", "0.76003134", "0.73753244", "0.7210805", "0.70903355", "0.7076613", "0.7038129", "0.7034476", "0.6993899", "0.69891864", "0.6846133", "0.6832713", "0.6830783", "0.68109065", "0.6806593", "0.68017524", "0.6777848", "0.6749091", "0.67174566", "0.66962...
0.8115568
0
Calculates total circumferences of a rectangle
def rectangle_circumference(a,b): return (2*(a+b))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def circumference(self):\n return self.width + self.height", "def circumference(self):\n raise NotImplementedError", "def circumference(self):\n return math.pi * self.radius * 2", "def circumference(self):\n return (2 * math.pi * self.__radius)", "def calculateperimeter(self):\r...
[ "0.738668", "0.7031609", "0.69710547", "0.6853785", "0.6589618", "0.65277773", "0.6506341", "0.6492389", "0.64720625", "0.644245", "0.643771", "0.64178556", "0.6397216", "0.6363049", "0.63360244", "0.6303689", "0.62996864", "0.6289533", "0.6289518", "0.6276146", "0.6274405", ...
0.74838096
0
calculates surface area of a rectangle
def rectangle_surface_area(a,b): return (a*b)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_surface_area(self):\n return np.sum(self._find_triangle_areas())", "def rect_area(rect):\n return rect[2] * rect[3]", "def _area(bounds):\n return (bounds[0, 1] - bounds[0, 0]) * (bounds[1, 1] - bounds[1, 0])", "def area_rect(w, h):\n return w * h", "def surfaceArea(self):\n ...
[ "0.77162355", "0.75253814", "0.7490359", "0.74618113", "0.7423974", "0.7329641", "0.72515327", "0.725146", "0.7233866", "0.721391", "0.72130924", "0.7122993", "0.7114237", "0.7041266", "0.7039922", "0.7016561", "0.6981435", "0.69292253", "0.692703", "0.6900223", "0.6870387", ...
0.8167863
0
Calcualtes surface area of a circle
def circle_surface_area(a): return (a*a*math.pi)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def surface_area(self) -> float:\n return 4 * np.pi * self.radius**2", "def circle_area(circle):\n return pi * circle.radius * circle.radius", "def circleArea(radius):\n return math.pi * radius * radius", "def circle_area(radius):\n return math.pi * radius ** 2", "def area_of_circle(radius)...
[ "0.8024205", "0.78188527", "0.7663585", "0.7590993", "0.7516806", "0.7515295", "0.74730927", "0.747086", "0.7412868", "0.7388443", "0.7359613", "0.72836643", "0.72836643", "0.7241308", "0.7222641", "0.7126074", "0.71226263", "0.7098659", "0.7098659", "0.7093549", "0.7084029",...
0.8019704
1
If there are X company families currently running plan b, AND config throttles to Y company families, AND X is less than Y, then we should find Y X company families to run.
def test_get_company_families_in_need_of_plan_b_positive(self): self.mock.max_simultaneous_plan_bs = 5 self.mock.currently_running_companies = [[1, "run_id"], [2, "run_id"], [3, "run_id"]] needs_plan_b_companies = [[4, None], [5, None], [6, None]] expected_number_of_tasks_to_create = 4 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_company_families_in_need_of_plan_b_negative(self):\n self.mock.max_simultaneous_plan_bs = 5\n self.mock.currently_running_companies = [[1, \"run_id1\"], [2, \"run_id2\"], [3, \"run_id3\"], [4, \"run_id4\"], [5, \"run_id5\"]]\n self.mock.company_families_in_need_of_plan_b = None\n\...
[ "0.67352563", "0.5475269", "0.5326035", "0.5268679", "0.5139634", "0.50883186", "0.5016358", "0.5006616", "0.49998176", "0.4940894", "0.49228308", "0.49202496", "0.4916913", "0.49167457", "0.49084124", "0.49008963", "0.4895143", "0.4878588", "0.486629", "0.48580933", "0.48329...
0.6558399
1
If there are X company families currently running plan b, AND config throttles to Y company families, AND Y is less than or equal Y, then we should find exactly 0 company families to run.
def test_get_company_families_in_need_of_plan_b_negative(self): self.mock.max_simultaneous_plan_bs = 5 self.mock.currently_running_companies = [[1, "run_id1"], [2, "run_id2"], [3, "run_id3"], [4, "run_id4"], [5, "run_id5"]] self.mock.company_families_in_need_of_plan_b = None self.mox.Re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_company_families_in_need_of_plan_b_positive(self):\n self.mock.max_simultaneous_plan_bs = 5\n self.mock.currently_running_companies = [[1, \"run_id\"], [2, \"run_id\"], [3, \"run_id\"]]\n needs_plan_b_companies = [[4, None], [5, None], [6, None]]\n expected_number_of_tasks_...
[ "0.6650879", "0.53565973", "0.5267262", "0.5114545", "0.503734", "0.5020609", "0.5002152", "0.49946842", "0.49886012", "0.49717385", "0.4968225", "0.49662775", "0.49640682", "0.49217176", "0.48952708", "0.4893934", "0.48644662", "0.48617876", "0.48533925", "0.48433372", "0.48...
0.70370907
0
Gets alignment alphabet for codon alignment. Only nucleotide alphabet is accepted. Raise an error when the type of alphabet is incompatible.
def get_codon_alphabet(alphabet, gap="-", stop="*"): from Bio.Alphabet import NucleotideAlphabet if isinstance(alphabet, NucleotideAlphabet): alpha = alphabet if gap: alpha = Gapped(alpha, gap_char=gap) if stop: alpha = HasStopCodon(alpha, stop_symbol=stop) el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def alphabet(self):\n if(self.seq_type.upper()==\"DNA\"):\n return \"ATCG\"\n elif(self.seq_type.upper()==\"RNA\"):\n return \"AUCG\"\n elif(self.seq_type.upper()==\"PROTEIN\"):\n return \"ACDEFGHIKLMNPQRSTVWY\"\n else:\n return None", "def ...
[ "0.73950106", "0.6471855", "0.64095986", "0.62704057", "0.62704057", "0.62704057", "0.624696", "0.6093315", "0.6060211", "0.605598", "0.60510933", "0.6047748", "0.5968646", "0.5776322", "0.5776322", "0.5757764", "0.5732608", "0.5713657", "0.5650256", "0.56352204", "0.56350553...
0.66349137
1
Choose which generator and discriminator architecture to use by uncommenting one of these lines.
def GeneratorAndDiscriminator(): # Baseline (G: DCGAN, D: DCGAN) return ResnetGenerator, DCGANDiscriminator # No BN and constant number of filts in G # return WGANPaper_CrippledDCGANGenerator, DCGANDiscriminator # 512-dim 4-layer ReLU MLP G # return FCGenerator, DCGANDiscriminator # No n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def discriminator(self) -> str:", "def discriminator(self) -> Any:\r\n return None", "def discriminator(self, images): # pylint: disable=R0201\n return standard_discriminator(images)", "def architecture(self):\n return self.random.choice([\n 'x86_64', \n 'x86'\n ...
[ "0.6232599", "0.5788706", "0.568151", "0.56580734", "0.56220806", "0.556002", "0.5512114", "0.55085623", "0.5438574", "0.5433415", "0.5423314", "0.54211974", "0.5416163", "0.5398142", "0.5363023", "0.5358023", "0.53553355", "0.53334403", "0.5310332", "0.528972", "0.5268406", ...
0.6607731
0
Test case for add_relation_type
def test_add_relation_type(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_add_relation_types(self):\n pass", "def test_change_relation_type(self):\n pass", "def test_change_relation_types(self):\n pass", "def test_get_relation_type(self):\n pass", "def test_find_relation_types(self):\n pass", "def test_remove_relation_type(self):\n ...
[ "0.9133543", "0.8214896", "0.812729", "0.7941225", "0.7591235", "0.7403597", "0.7184459", "0.65345156", "0.6493854", "0.6439015", "0.6344578", "0.6220084", "0.6152567", "0.6058518", "0.60384", "0.6002407", "0.59824777", "0.5944071", "0.58435047", "0.5840866", "0.584035", "0...
0.94728637
0
Test case for add_relation_types
def test_add_relation_types(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_add_relation_type(self):\n pass", "def test_change_relation_types(self):\n pass", "def test_find_relation_types(self):\n pass", "def test_change_relation_type(self):\n pass", "def test_get_relation_type(self):\n pass", "def test_remove_relation_types(self):\n ...
[ "0.93007845", "0.8362059", "0.80940545", "0.80459434", "0.7731855", "0.7619851", "0.73669165", "0.6537363", "0.62040925", "0.61279976", "0.5987119", "0.5975522", "0.5888174", "0.5873747", "0.5861829", "0.5845702", "0.5827523", "0.57859147", "0.57804865", "0.5750537", "0.57220...
0.9475202
0
Test case for change_relation_type
def test_change_relation_type(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_change_relation_types(self):\n pass", "def test_add_relation_type(self):\n pass", "def test_get_relation_type(self):\n pass", "def test_add_relation_types(self):\n pass", "def test_remove_relation_type(self):\n pass", "def test_remove_relation_types(self):\n ...
[ "0.9128707", "0.8218508", "0.79304695", "0.79276407", "0.7637085", "0.7394804", "0.73342395", "0.67068696", "0.65558094", "0.61641324", "0.60887015", "0.60078526", "0.58326256", "0.58233964", "0.5810466", "0.5723773", "0.5695491", "0.56949335", "0.56716394", "0.56711334", "0....
0.93498015
0
Test case for change_relation_types
def test_change_relation_types(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_change_relation_type(self):\n pass", "def test_add_relation_types(self):\n pass", "def test_add_relation_type(self):\n pass", "def test_remove_relation_types(self):\n pass", "def test_get_relation_type(self):\n pass", "def test_find_relation_types(self):\n ...
[ "0.9235462", "0.84471434", "0.8330656", "0.78718644", "0.77977645", "0.77977455", "0.7726924", "0.6432496", "0.6326128", "0.600536", "0.5909689", "0.58644736", "0.58470744", "0.5787336", "0.57735205", "0.57534206", "0.5746941", "0.5716575", "0.57018447", "0.5683999", "0.56820...
0.9392614
0
Test case for find_relation_types
def test_find_relation_types(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_relation_type(self):\n pass", "def test_add_relation_types(self):\n pass", "def test_add_relation_type(self):\n pass", "def test_change_relation_types(self):\n pass", "def test_change_relation_type(self):\n pass", "def test_remove_relation_types(self):\n ...
[ "0.82754517", "0.7830468", "0.7545067", "0.74384326", "0.7220789", "0.7081365", "0.67301106", "0.6446792", "0.63950753", "0.6385406", "0.6292394", "0.6291715", "0.614222", "0.61386603", "0.6076577", "0.6062812", "0.59512234", "0.5938554", "0.5795784", "0.5777835", "0.5776928"...
0.93213457
0
Test case for get_relation_type
def test_get_relation_type(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_find_relation_types(self):\n pass", "def test_change_relation_type(self):\n pass", "def test_add_relation_type(self):\n pass", "def test_change_relation_types(self):\n pass", "def test_add_relation_types(self):\n pass", "def test_returns_correct_relation(self):...
[ "0.8218984", "0.79172564", "0.7896453", "0.748885", "0.74482447", "0.7196202", "0.70477825", "0.6910506", "0.66051215", "0.6566184", "0.6536505", "0.64464283", "0.6385503", "0.6298449", "0.6128046", "0.6045418", "0.5934041", "0.58843106", "0.58825374", "0.5873009", "0.5872792...
0.93895334
0
Test case for remove_relation_type
def test_remove_relation_type(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_remove_relation_types(self):\n pass", "def test_change_relation_type(self):\n pass", "def test_relation_before_remove():\n assert query_row(db_conf, 'osm_buildings', 50011)['type'] == 'yes'\n assert query_row(db_conf, 'osm_landusages', -50021)['type'] == 'park'", "def test_relati...
[ "0.9083394", "0.7434875", "0.74198115", "0.7399699", "0.73606783", "0.70979846", "0.6849677", "0.682214", "0.64918333", "0.6335386", "0.60610294", "0.6020467", "0.6011264", "0.60044837", "0.59442806", "0.59359443", "0.5918776", "0.59070355", "0.588445", "0.58156455", "0.57834...
0.94640315
0
Test case for remove_relation_types
def test_remove_relation_types(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_remove_relation_type(self):\n pass", "def test_change_relation_types(self):\n pass", "def test_change_relation_type(self):\n pass", "def test_add_relation_types(self):\n pass", "def test_relation_before_remove():\n assert query_row(db_conf, 'osm_buildings', 50011)['t...
[ "0.93458295", "0.77008176", "0.73982656", "0.7369096", "0.722008", "0.7153807", "0.71069854", "0.7079776", "0.6732576", "0.6067846", "0.60438186", "0.60327435", "0.5947649", "0.59213793", "0.5895194", "0.5893429", "0.5832505", "0.5761203", "0.5755601", "0.5693539", "0.5652264...
0.946908
0
After the applications have been sent to Ahjo, the handlers should not be able to modify the applications. If the batch is returned without decision (as might theoretically happen), then the handlers may need to make changes again.
def applications_can_be_modified(self): return self.status in [ ApplicationBatchStatus.DRAFT, ApplicationBatchStatus.RETURNED, ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __update_application(self, apps, **extra_args):\n update_on_error = extra_args.get('update_on_error', False)\n # auto_enable_auth = extra_args.get(\n # 'auto_enable_auth', self.auto_enable_auth)\n\n for app in apps:\n state = app.execution.state\n old_state...
[ "0.5827715", "0.5719476", "0.56643564", "0.5472756", "0.5467907", "0.5407844", "0.53933734", "0.5391382", "0.5365639", "0.53107524", "0.5281012", "0.5252762", "0.5197593", "0.51716983", "0.5165487", "0.51599896", "0.515447", "0.5153859", "0.51419616", "0.5130705", "0.51278067...
0.60474586
0
Sets the template_name of this UpdateSmtpTemplate.
def template_name(self, template_name): self._template_name = template_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def template_id(self, template_id):\n\n self._template_id = template_id", "def setTemplate(self, template):\n self.template = template", "def set_template(self, name, value):\n\n self.templates[name] = value", "def template_name(self, template_type: Union[TemplateType, str]) -> str:\n ...
[ "0.6428923", "0.63492084", "0.6289518", "0.62629175", "0.6210519", "0.6139613", "0.60831803", "0.6069467", "0.6065459", "0.60353065", "0.60353065", "0.58650047", "0.5752538", "0.5721378", "0.56142247", "0.5564095", "0.5535376", "0.55189353", "0.54267377", "0.5419198", "0.5413...
0.8125446
0
Sets the html_content of this UpdateSmtpTemplate.
def html_content(self, html_content): self._html_content = html_content
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def html(self, html):\n\n self._html = html", "def html(self, html: str):\n self._html = html", "def update_html(self, plain_text):\n ENGINE.reset()\n self.html = ENGINE.convert(self.content)\n self.save()", "def html_body(self, val: str):\n self._html_body = val", ...
[ "0.6777866", "0.6499594", "0.63532406", "0.6333052", "0.6280877", "0.6247843", "0.6218343", "0.6115204", "0.6115204", "0.6045669", "0.59877867", "0.59831834", "0.59341025", "0.58511275", "0.58511275", "0.5782569", "0.5731653", "0.5688748", "0.56725824", "0.5663702", "0.563356...
0.7471381
0
Sets the html_url of this UpdateSmtpTemplate.
def html_url(self, html_url): self._html_url = html_url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def html(self, html):\n\n self._html = html", "def html(self, html):\n if html is None:\n raise ValueError(\"Invalid value for `html`, must not be `None`\")\n\n self._html = html", "def html(self, html: str):\n self._html = html", "def _set_url(self): \n s...
[ "0.62924886", "0.61350495", "0.61285585", "0.5689741", "0.56686664", "0.5647783", "0.55292785", "0.54630464", "0.5364144", "0.5364144", "0.5364144", "0.5364144", "0.5364144", "0.5364144", "0.5364144", "0.535659", "0.5326547", "0.5304783", "0.5257629", "0.5238786", "0.5238786"...
0.73619145
0
Sets the reply_to of this UpdateSmtpTemplate.
def reply_to(self, reply_to): self._reply_to = reply_to
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_reply_to(self, address):\n if not self.validate_email_address(address):\n raise Exception(\"Invalid email address '%s'\" % address)\n self._reply_to = address", "def reply_to_email_address(self, val: EmailAddress):\n self._reply_to = val", "def reply_to_email_address(sel...
[ "0.7322558", "0.7314207", "0.6876749", "0.66572744", "0.59876484", "0.5975135", "0.5907021", "0.56865406", "0.5629698", "0.5629698", "0.5587288", "0.5441423", "0.5376826", "0.5339525", "0.52932507", "0.5237598", "0.5151917", "0.5135997", "0.5020687", "0.5015476", "0.50064665"...
0.7736451
0
Sets the attachment_url of this UpdateSmtpTemplate.
def attachment_url(self, attachment_url): self._attachment_url = attachment_url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attachment_id(self, attachment_id):\n\n self._attachment_id = attachment_id", "def avatar_url(self, avatar_url):\n\n self._avatar_url = avatar_url", "def attachment_file_name(self, attachment_file_name):\n\n self._attachment_file_name = attachment_file_name", "def attachment_file_nam...
[ "0.57066125", "0.56993", "0.5668265", "0.5668265", "0.5528204", "0.54329574", "0.54173625", "0.5387698", "0.5307973", "0.5294027", "0.52891266", "0.52693737", "0.51740557", "0.516391", "0.516391", "0.5150971", "0.5148844", "0.5120335", "0.5108294", "0.50362116", "0.50353986",...
0.7963267
0
Load an OpenVINO model for inference from directory.
def _load(path, device=None, cache_dir=None, shapes=None): status = KerasOpenVINOModel._load_status(path) if status.get('xml_path', None): xml_path = Path(status['xml_path']) invalidInputError(xml_path.suffix == '.xml', "Path of openvino model must b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load(path):\n status = KerasOpenVINOModel._load_status(path)\n if status.get('xml_path', None):\n xml_path = Path(status['xml_path'])\n invalidInputError(xml_path.suffix == '.xml',\n \"Path of openvino model must be with '.xml' suffix.\")\n ...
[ "0.7958504", "0.7205654", "0.7140051", "0.70383066", "0.6961791", "0.6906793", "0.6895013", "0.68585163", "0.6748528", "0.67198235", "0.6706158", "0.67056614", "0.6662578", "0.66614515", "0.6654411", "0.66251373", "0.6618571", "0.66169584", "0.65785086", "0.65668833", "0.6556...
0.7251669
1
A VIEW token contract.
def token(chain: BaseChain) -> Contract: return deploy_contract(chain, 'DSToken', args=['VIEW'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view(self) -> 'outputs.ViewDefinitionResponse':\n return pulumi.get(self, \"view\")", "def auth_token(self):", "def UserToken(self) -> object:", "def getToken(self):\n \n raise NotImplementedError", "def odb_token():\n return genToken()", "def __call__(self, access_token):", ...
[ "0.5675292", "0.564114", "0.5602083", "0.55689275", "0.5393377", "0.53466725", "0.5294759", "0.5293489", "0.5281176", "0.5270128", "0.52660847", "0.525514", "0.5247107", "0.52470833", "0.52422994", "0.5205387", "0.5194465", "0.51940876", "0.51932335", "0.5175761", "0.51593035...
0.7534058
0
A blank ViewlySeedSale contract.
def sale(chain: BaseChain, token: Contract, beneficiary) -> Contract: args = [token.address, beneficiary] seed_sale = deploy_contract(chain, 'ViewlySeedSale', args=args) token.transact().setOwner(seed_sale.address) return seed_sale
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def running_sale(chain: BaseChain, token: Contract, sale) -> Contract:\n sale.transact().startSale(DURATION, BLOCK_OFFSET)\n chain.wait.for_block(sale.call().startBlock())\n return sale", "def test_cannot_get_empty_sales(self):\n reply = self.admin_add_product()\n\n resp = self.admin_creat...
[ "0.53047764", "0.5272284", "0.5200053", "0.5149378", "0.5132936", "0.512546", "0.5105635", "0.5097565", "0.5085872", "0.5041826", "0.5026435", "0.49941793", "0.49609843", "0.4953554", "0.49455854", "0.49263102", "0.4923898", "0.4923678", "0.49153724", "0.49101308", "0.4887956...
0.7222951
0
A running ViewlySeedSale contract.
def running_sale(chain: BaseChain, token: Contract, sale) -> Contract: sale.transact().startSale(DURATION, BLOCK_OFFSET) chain.wait.for_block(sale.call().startBlock()) return sale
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sale(chain: BaseChain, token: Contract, beneficiary) -> Contract:\n args = [token.address, beneficiary]\n seed_sale = deploy_contract(chain, 'ViewlySeedSale', args=args)\n token.transact().setOwner(seed_sale.address)\n return seed_sale", "def sale_call(data):\n print('-' * 80)\n print(\"\")...
[ "0.76732326", "0.5601624", "0.5313552", "0.5237656", "0.5188305", "0.51351535", "0.49769667", "0.4958542", "0.49149904", "0.4875205", "0.4873706", "0.48463243", "0.48374844", "0.48354483", "0.48138532", "0.48032266", "0.47857577", "0.4776219", "0.47309092", "0.46917468", "0.4...
0.6293835
1
Creates embeddings for every item in the loader
def get_embeddings(model, loader, device=torch.device('cpu')): embeddings = [] labels = [] for item in loader: data, label = item data = data.view(-1, 1, data.shape[-1]) data = data.to(device) label = label.to(device) output = model(data).squeeze(1) embedding...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def embed(self, loader, model):\n print(\" ** Embedding words\")\n\n words = loader.words\n vectors = [model.get_word_vector(word) for word in words]\n\n return [(w, *v) for w, v in zip(words, vectors)]", "def set_embeddings(self):", "def init_emb(self):\n # Initialize use...
[ "0.67582995", "0.66326225", "0.6497315", "0.63573134", "0.63262516", "0.6318618", "0.62867075", "0.6257674", "0.6143834", "0.6126161", "0.6125036", "0.6078507", "0.6047278", "0.6044256", "0.59935606", "0.5948337", "0.594831", "0.5913711", "0.59136695", "0.5887492", "0.5886963...
0.66390866
1
Generate a new ocpnplugins.xml.
def generate(sourcedir, destfile, version, date): tree = ET.Element('plugins') version_elem = ET.SubElement(tree, "version") version_elem.text = version date_elem = ET.SubElement(tree, "date") date_elem.text = \ date if date else datetime.datetime.now().strftime('%Y-%m-%d %H:%M') for pat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build(self):\n self.output.write(\"\"\"<?xml version=\"1.0\" encoding=\"utf-8\"?>\\n\"\"\")\n\n self.write_plugin_info()\n self.write_timers()\n self.write_custom_events()\n self.write_databases()\n self.write_resources()\n self.write_macroses()\n\n self....
[ "0.66747826", "0.57758486", "0.5733098", "0.5577461", "0.5462274", "0.5429898", "0.53631663", "0.52749896", "0.52611405", "0.5177107", "0.51359594", "0.51344335", "0.5099594", "0.50879645", "0.50810367", "0.50763667", "0.50714844", "0.5053349", "0.50524765", "0.50442195", "0....
0.6637632
1
Remove automations for a Tasmota device.
async def async_remove_automations(hass, device_id): await device_trigger.async_remove_triggers(hass, device_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def AptUninstall(vm):\n remove_str = 'sudo apt-get --purge autoremove -y '\n for package in APT_PACKAGES:\n vm.RemoteCommand(remove_str + package)", "def clear_all_devices():\n adapter = get_adapter()\n for key in devices_by_adr.keys():\n device = get_device(key)\n try:\n adap...
[ "0.60911405", "0.60012424", "0.5825712", "0.5750088", "0.56554925", "0.56551033", "0.5607625", "0.5587846", "0.55782807", "0.55749226", "0.5565252", "0.5552191", "0.5530161", "0.5520082", "0.55070865", "0.5495222", "0.5493418", "0.5478428", "0.5467731", "0.5467223", "0.545583...
0.6749313
0
Handle the removal of a device.
async def async_device_removed(event): if event.data["action"] != "remove": return await async_remove_automations(hass, event.data["device_id"])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _handle_device_remove(hass: HomeAssistant):\n\n async def device_registry_updated(event: Event):\n if event.data['action'] != 'update':\n return\n\n registry = hass.data['device_registry']\n hass_device = registry.async_get(event.data['device_id'])\n\n # check em...
[ "0.807616", "0.71581817", "0.70584047", "0.69244736", "0.67771333", "0.6472483", "0.64140743", "0.64140743", "0.6394929", "0.63806874", "0.63092977", "0.6286962", "0.62104803", "0.6186973", "0.61726636", "0.6109445", "0.61076254", "0.6100079", "0.60897523", "0.60897523", "0.6...
0.75656223
1
Discover and add a Tasmota device automation.
async def async_discover(tasmota_automation, discovery_hash): if tasmota_automation.automation_type == AUTOMATION_TYPE_TRIGGER: await device_trigger.async_setup_trigger( hass, tasmota_automation, config_entry, discovery_hash )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_add_device(self):\n\n pass", "def flash_tasmota(self, flash_mode, serial_port):\n # Make sure device is tasmota\n if self.software != 'tasmota':\n print('{f_name} is {software}, not tasmota'.format(**self))\n return(False)\n if current_tasmota_version !=...
[ "0.60325503", "0.5852927", "0.5784722", "0.5700005", "0.5697959", "0.56872237", "0.56154716", "0.55423445", "0.5498065", "0.5475614", "0.54548955", "0.54334223", "0.5419632", "0.541176", "0.5364658", "0.53400034", "0.5306633", "0.53012794", "0.528794", "0.5286875", "0.5280587...
0.5898973
1
Returns average color distance between pixels in originalPixels list and newPixels list
def checkQualityOfSection(originalPixels, newPixels): totalDistance = 0 numPixels = 0 for r in range(originalPixels.shape[0]): for c in range(originalPixels.shape[1]): if r == 0 or r == originalPixels.shape[0] - 1 or c == 0 or c == originalPixels.shape[1] - 1: continue ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(rgb1, rgb2):\n diffs = np.array(rgb1) - np.array(rgb2)\n return math.sqrt(np.sum(diffs**2))", "def color_distance(RGB1, RGB2):\n d2_r = (RGB1[0] - RGB2[0]) ** 2\n d2_g = (RGB1[1] - RGB2[1]) ** 2\n d2_b = (RGB1[2] - RGB2[2]) ** 2\n return d2_r + d2_g + d2_b", "def mold_image(self,...
[ "0.6561033", "0.6329309", "0.62736565", "0.62726533", "0.62004334", "0.61687744", "0.6100622", "0.60588473", "0.5993518", "0.59609854", "0.59419906", "0.593154", "0.5862414", "0.57588434", "0.5679564", "0.5677268", "0.56682885", "0.5631702", "0.5587156", "0.55482876", "0.5501...
0.6925194
0
Get the price of this membership as a string of pounds and pence.
def price_pounds(self): price = '{0:03d}'.format(self.price) return price[:-2] + '.' + price[-2:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_price(self):\n return self.price", "def get_price(self):\n return self.price", "def get_price(self):\n return self.price", "def price(self):\n return self.price_", "def display_price(self):\n return '$ '+str(self.price)", "def get_price(self):\n return se...
[ "0.7219085", "0.7219085", "0.7219085", "0.7204589", "0.7165673", "0.7139111", "0.7138113", "0.70815927", "0.7050938", "0.7050938", "0.69639355", "0.6915576", "0.68036145", "0.66906595", "0.6688339", "0.66788113", "0.65983194", "0.6585856", "0.6581671", "0.6524062", "0.6460041...
0.7743524
0
Reports API calls in highest to lowest usage order.
def stats(): # Log all API requests exception = log_api() if exception: return jsonify({'error': exception}), HTTPStatus.INTERNAL_SERVER_ERROR try: data = redis.zrevrangebyscore( REDIS_LOG_KEY_NAME, REDIS_INT64_MAX, 0, withscores=True) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_call_statistics(self):\n try:\n days = int(request.args.get('days'))\n except TypeError:\n self.logger.debug(messages.MISSING_FIELDS_ERROR % \"days\")\n return messages.ERROR_JSON % messages.MISSING_FIELDS_ERROR % \"days\", 400\n api_call_statistics = s...
[ "0.5769262", "0.5703401", "0.55801475", "0.55431765", "0.55145115", "0.5480181", "0.5457197", "0.5449271", "0.5439773", "0.5354681", "0.53495103", "0.53266394", "0.5295815", "0.52953917", "0.5255003", "0.5252155", "0.525124", "0.5247804", "0.52282375", "0.52236444", "0.522195...
0.6157702
0
Log the API request in redis.
def log_api(): try: redis.zincrby(REDIS_LOG_KEY_NAME, 1, request.path) except RedisError as exc: return exc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rest_api_log(self):\n with self.resource_lock:\n pass", "def log_request(self, r):\n\n token = r.headers.get(self.header, None)\n r.token = token\n self.requests.append(r)\n if r.token:\n self.log.debug('[%s] %s', token or '/', r.url)", "def _log_req...
[ "0.6821955", "0.64709324", "0.6096815", "0.5952896", "0.59290445", "0.59065264", "0.5817935", "0.5794073", "0.5787633", "0.5737805", "0.57194245", "0.5627782", "0.5594348", "0.5563636", "0.5562566", "0.55471605", "0.545164", "0.5435416", "0.54187465", "0.53533846", "0.5352551...
0.80186987
0
The decorator avoid print statements to print messages on console.
def disable_print_statements_on_console(func): @wraps(func) def wrap(*args, **kw): suppress_text = io.StringIO() sys.stdout = suppress_text result = func(*args, **kw) sys.stdout = sys.__stdout__ return result return wrap
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def suppressMessages():\n dislin.unit(0)", "def suppress(self):\n pass", "def disable_console():\n logger.removeHandler(CONSOLE)", "def nologger(*args, **kwargs):\n return", "def _disable_decorator(msg):\n def decorator(func):\n @functools.wraps(func)\n def _wrapper(self, *...
[ "0.639712", "0.63451016", "0.62081826", "0.61555076", "0.61396784", "0.6103333", "0.6075437", "0.6004607", "0.5957251", "0.5941743", "0.5940628", "0.591935", "0.5900067", "0.58858734", "0.5809405", "0.5779688", "0.5759825", "0.5730924", "0.5709933", "0.5699943", "0.5698221", ...
0.80535823
0
This function is a helper to create `PipelineML` object directly from two Kedro `Pipelines` (one of training and one of inference) .
def pipeline_ml_factory( training: Pipeline, inference: Pipeline, input_name: str = None, conda_env: Optional[Union[str, Path, Dict[str, Any]]] = None, model_name: Optional[str] = "model", model_signature: Union[ModelSignature, str, None] = "auto", **kwargs ) -> PipelineML: pipeline = P...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_pipeline(self, train: LAMLDataset) -> LAMLTransformer:\n raise NotImplementedError", "def build_own_pipeline() -> Pipeline:\n nn_pipeline = None\n\n nn_pipeline = Pipeline([\n ('vect', CountVectorizer()),\n ('tfidf', TfidfTransformer()),\n ('clf', MLPClassifier()) \n ]...
[ "0.6714538", "0.66688484", "0.6507657", "0.64806324", "0.6373428", "0.6265111", "0.623573", "0.6211704", "0.61999327", "0.60997534", "0.605733", "0.6053077", "0.6050286", "0.6048502", "0.60207784", "0.60169214", "0.6010641", "0.5995517", "0.595444", "0.5943461", "0.59082496",...
0.6966813
0
Ensure disabled_options values are part of the list of options
def _validate_disabled_options(self, proposal) -> List[str]: if proposal.value is None or not proposal.value: return [] proposal_diff = set(proposal.value).difference_update(set(self._options_labels)) assert ( not proposal_diff ), f"Invalid passed options for 'dis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_disabled_options(self, change) -> None:\n disabled_options = change.new\n self.set_trait(\"_disabled_options_labels\", disabled_options)\n if not self._initializing_traits_:\n if disabled_options:\n if (\n self.grouping\n ...
[ "0.61743283", "0.6131734", "0.61109066", "0.6102916", "0.6051576", "0.59848464", "0.5836519", "0.5722256", "0.5664706", "0.56453407", "0.56433475", "0.56023014", "0.55838335", "0.5579797", "0.55560064", "0.55560064", "0.5544571", "0.55273265", "0.55273265", "0.55205566", "0.5...
0.78630537
0
Put options into desired grouping, updating `options`
def _set_grouping(self, change) -> None: grouping = self._grouping_full self.options = self._flat_groupings(grouping) self.set_trait( "_grouping_labels", tuple( [ (header, tuple([_[0] for _ in options])) for header, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_switching_options(self, options):\n\n #preserve old \"non-switching options\"\n # pylint: disable=not-an-iterable\n new_options = [opt for opt in self._rec.options if \"grp:\" not in opt]\n new_options += options\n\n self._rec.set_options(new_options)\n\n if not se...
[ "0.67893493", "0.62553436", "0.5973312", "0.5946463", "0.5807036", "0.5781266", "0.5774601", "0.5742214", "0.56995493", "0.56685764", "0.56570464", "0.5636705", "0.56341064", "0.5572815", "0.5570275", "0.5524016", "0.5508672", "0.54946196", "0.5492006", "0.5484445", "0.548337...
0.6826257
0
Get group headers from self._grouping_labels
def _group_headers(self) -> List[str]: return [_[0] for _ in self._grouping_labels]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_group_names(self):\n return [self.frame.columns[i] for i in self.group_cols]", "def get_group_names(self):\r\n return self.groups.keys()", "def _flat_groupings(\n self, grouping: Tuple[Tuple[str, Tuple[Tuple[str, Any]]]] = None\n ) -> List[Tuple[str, Any]]:\n grouping = g...
[ "0.6871165", "0.6661643", "0.62353957", "0.6033604", "0.5959639", "0.59267735", "0.57593286", "0.5736832", "0.57264966", "0.57093465", "0.5673237", "0.56410503", "0.56166875", "0.5601591", "0.5574714", "0.5573216", "0.5543794", "0.54342717", "0.5420204", "0.53577757", "0.5335...
0.8808598
0
Return label,valuepair of grouping index. The index is expected to match `_flat_groupings`, i.e., the actual dropdown.
def _get_grouping_label_value( self, index: int, grouping: Tuple[Tuple[str, Tuple[Tuple[str, Any]]]] = None, ) -> Tuple[str, Any]: grouping = grouping if grouping is not None else self._grouping_full res = self._flat_groupings(grouping)[index] if not isinstance(res, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_group_index(self, index):\n\n g_index = 0\n for group in self.groups:\n if group[0] == index:\n g_index = group[1]\n break\n return g_index", "def _get_group_attributes(self, index):\n\n g_case = (None, None, -1)\n for group in ...
[ "0.651733", "0.6260821", "0.60948837", "0.60557127", "0.59572226", "0.59572226", "0.57136685", "0.5596377", "0.55802846", "0.5566664", "0.5566664", "0.5500841", "0.5449907", "0.54491603", "0.54484546", "0.54018337", "0.52841455", "0.52841455", "0.52841455", "0.5266494", "0.52...
0.75741416
0
mirror triples from endpoints according to resource paths specified in res_paths. Each resource path is a tuple consisting of a list of start resources and a list of patterns describing which edges to follow. A very simple example of a resource path may consist of just a start resource, e.g.
def mirror (self, res_paths): self.start_time = time.time() self.todo = [] self.done = set() for res_path in res_paths: resolved_paths = map( lambda p: map( lambda p: (s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def paths_from_src(\n src: str = Query(..., description=\"starting article\"),\n dsts: list[str] = Query(..., description=\"destination articles\"),\n db: Session = Depends(database.get_db),\n):\n paths: dict[str, Optional[ArticlePath]] = {}\n ppd = multi_target_bfs(db, src)\n for dst in ds...
[ "0.5787563", "0.5532622", "0.52188444", "0.51296246", "0.51131874", "0.5054744", "0.50351787", "0.5021035", "0.5006877", "0.49568886", "0.49561077", "0.4940913", "0.49389237", "0.49387565", "0.49158677", "0.48937976", "0.48498455", "0.48478934", "0.4830131", "0.48278594", "0....
0.73886305
0
Create new endpoint mirror helper with P2E (propert to entity mapping) support Like LDFMirror but fetches property entities as well. graph target RDFLib graph endpoints dict mapping host names to LDF endpoints, e.g. {
def __init__ (self, graph, endpoints, aliases, prefixes, p2e_mapper ): self.p2e_mapper = p2e_mapper super (LDFMirrorP2E, self).__init__(graph, endpoints, aliases, prefixes)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def endpoint_definition(domain, resource):\n ret = {}\n ret['description'] = resource.get('description', {})\n ret['paths'] = paths(domain, resource)\n return ret", "def generate_proxy(classname, endpoints):\n # Replace path vars like (?<schemaname>.*) with {schemaname} for Retrofit's annotation\n...
[ "0.56358564", "0.5607735", "0.55940396", "0.54928416", "0.53302336", "0.5305283", "0.5174993", "0.5160754", "0.5151699", "0.5118873", "0.5010737", "0.5006742", "0.49543652", "0.49301457", "0.491819", "0.48860794", "0.48694873", "0.48264706", "0.48234227", "0.4815397", "0.4803...
0.6947705
0