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
Creates listeners for the default balancer of the current environment.
def create_listeners(self): target_groups_config = self.get_target_groups_config() balancer_arn = self.get_balancer_arn() response_data = {} for short_name in target_groups_config.keys(): target_group_name = self.get_target_group_name(short_name) response = self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_listeners(ctx):\n data = self.create_listeners()\n ctx.info('Created listeners for load balancer {}:'.format(\n self.get_balancer_name()\n ))\n ctx.pp.pprint(data)", "def create(ctx):\n create_target_groups(ctx)\n create_...
[ "0.74984", "0.6155189", "0.6015609", "0.6012771", "0.5820154", "0.57435435", "0.56980133", "0.5667754", "0.5656363", "0.5631498", "0.5504685", "0.5498395", "0.5460351", "0.54144293", "0.5363359", "0.53238726", "0.5311425", "0.53105676", "0.52813196", "0.5230505", "0.52195066"...
0.6311822
1
Deletes listeners for the default balancer of the current environment.
def delete_listeners(self): listeners_info = self.describe_listeners() for listener in listeners_info: response = self.client.delete_listener( ListenerArn=listener['ListenerArn'] ) assert response['ResponseMetadata']['HTTPStatusCode'] == 200 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_listeners(ctx):\n if self.balancer_exists():\n self.delete_listeners()\n ctx.info('Deleted all listeners for load balancer {}:'.format(self.get_balancer_name()))\n else:\n ctx.info('Load balancer {} does not exist, no listeners to remove...
[ "0.76726115", "0.62180847", "0.6021032", "0.595186", "0.5938151", "0.5872455", "0.56657547", "0.56461865", "0.55808574", "0.55471516", "0.5535369", "0.5481285", "0.54216963", "0.5404566", "0.53681505", "0.5311279", "0.52753246", "0.52654445", "0.5250673", "0.5249863", "0.5236...
0.7043698
1
Deletes balancer for current environment.
def delete_balancer(ctx): if self.balancer_exists(): self.delete_balancer() ctx.info('Successfully deleted load balancer {}:'.format(self.get_balancer_name())) else: ctx.info('Load balancer {} does not exist, nothing to delete.'.format( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_balancer(self):\n response = self.client.delete_load_balancer(\n LoadBalancerArn=self.get_balancer_arn()\n )\n assert response['ResponseMetadata']['HTTPStatusCode'] == 200", "def delete(ctx):\n delete_listeners(ctx)\n delete_balancer(ctx)\n ...
[ "0.75917363", "0.75186515", "0.73194486", "0.7260747", "0.6964305", "0.67855936", "0.67139965", "0.66862214", "0.6370703", "0.6285855", "0.5962687", "0.5895908", "0.58747965", "0.58266735", "0.5814123", "0.58118564", "0.5759592", "0.5751461", "0.5717588", "0.5677057", "0.5676...
0.7533795
1
Describes balancer for current environment.
def describe_balancer(ctx): data = self.get_balancer_info() if data is not None: ctx.info('Load balancer {} details:'.format(self.get_balancer_name())) ctx.pp.pprint(data) else: ctx.info('Load balancer {} does not exist.'.format(self.ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_balancer_name(self):\n return '{}-{}'.format(\n self.config['namespace'],\n self.get_current_env(),\n )", "def balancer():\n pass", "def load_balancer_name(self) -> str:\n return pulumi.get(self, \"load_balancer_name\")", "def balancer_id(self) -> pulumi....
[ "0.7542367", "0.68922436", "0.6775603", "0.6484639", "0.6443855", "0.6258168", "0.61299396", "0.6095195", "0.6012776", "0.6012776", "0.6012776", "0.5973077", "0.59008837", "0.5856403", "0.5793592", "0.56712395", "0.5651833", "0.5561907", "0.5521645", "0.54867375", "0.5463622"...
0.78482044
0
Creates load balancer target groups for current environment.
def create_target_groups(ctx): data = self.create_target_groups() ctx.info('Created target groups for the load balancer {}:'.format(self.get_balancer_name())) ctx.pp.pprint(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(ctx):\n create_target_groups(ctx)\n create_balancer(ctx)\n create_listeners(ctx)\n\n ctx.info('Load balancers setup completed.')", "def ensure_target_group_created(vpc, environment):\n name = environment + '-web'\n\n # If it already exists, create retu...
[ "0.67362416", "0.6500324", "0.6379159", "0.6233221", "0.5968006", "0.5882499", "0.585659", "0.57661116", "0.57613397", "0.57101214", "0.56413764", "0.55966014", "0.5414972", "0.5409071", "0.53946424", "0.53711516", "0.5329309", "0.5283815", "0.5232401", "0.5230137", "0.522713...
0.84025216
0
Describes target groups for current environment.
def describe_target_groups(ctx): data = self.get_target_groups_info() ctx.info('Target groups details for load balancer {}:'.format(self.get_balancer_name())) ctx.pp.pprint(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_target_groups(ctx):\n data = self.create_target_groups()\n ctx.info('Created target groups for the load balancer {}:'.format(self.get_balancer_name()))\n ctx.pp.pprint(data)", "def get_target_groups_config(self):\n return self.config['target_groups']", "def ta...
[ "0.6801498", "0.6745524", "0.6559486", "0.63894445", "0.6366864", "0.62445754", "0.62445754", "0.62445754", "0.62445754", "0.62445754", "0.62445754", "0.6178109", "0.6038597", "0.6031735", "0.5996421", "0.5938765", "0.59342307", "0.58795434", "0.5793468", "0.5752609", "0.5745...
0.7605977
0
Creates listeners between load balancer and target groups for current environment.
def create_listeners(ctx): data = self.create_listeners() ctx.info('Created listeners for load balancer {}:'.format( self.get_balancer_name() )) ctx.pp.pprint(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_listeners(self):\n target_groups_config = self.get_target_groups_config()\n balancer_arn = self.get_balancer_arn()\n response_data = {}\n\n for short_name in target_groups_config.keys():\n target_group_name = self.get_target_group_name(short_name)\n\n re...
[ "0.78298986", "0.63762605", "0.6211721", "0.61374104", "0.59323144", "0.5882233", "0.5827499", "0.58116966", "0.57650423", "0.5760158", "0.5666049", "0.5589464", "0.5575253", "0.55505455", "0.5464185", "0.5462238", "0.53863287", "0.5379138", "0.5339459", "0.533056", "0.528759...
0.745263
1
Deletes listeners for current environment.
def delete_listeners(ctx): if self.balancer_exists(): self.delete_listeners() ctx.info('Deleted all listeners for load balancer {}:'.format(self.get_balancer_name())) else: ctx.info('Load balancer {} does not exist, no listeners to remove.'.format(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_listeners(self):\n listeners_info = self.describe_listeners()\n\n for listener in listeners_info:\n response = self.client.delete_listener(\n ListenerArn=listener['ListenerArn']\n )\n assert response['ResponseMetadata']['HTTPStatusCode'] == 2...
[ "0.73083454", "0.6432149", "0.63611424", "0.6352538", "0.6321875", "0.6212454", "0.6150953", "0.61417234", "0.6006233", "0.59870964", "0.59372544", "0.58935", "0.58164805", "0.5792932", "0.5735109", "0.5699852", "0.56589717", "0.5654272", "0.56454384", "0.56419045", "0.562823...
0.6964974
1
Describes listeners for current environment.
def describe_listeners(ctx): data = self.describe_listeners() ctx.info('Listeners details for load balancer {}:'.format(self.get_balancer_name())) ctx.pp.pprint(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def listener_description(self) -> str:\n return pulumi.get(self, \"listener_description\")", "def _add_listeners(vehicle):\n @vehicle.on_attribute('mode')\n def mode_listener(self,name, msg):\n util.log_info(\"Mode switched to %s\" % msg.name)\n \n if msg.name != shared.status['...
[ "0.70811313", "0.62785274", "0.60060024", "0.5958816", "0.59439224", "0.58731776", "0.5746067", "0.5714471", "0.5663927", "0.56183153", "0.56144804", "0.5483228", "0.5462865", "0.53911906", "0.5357568", "0.53405404", "0.5337399", "0.5294675", "0.52753985", "0.5265671", "0.525...
0.6852199
1
Creates fully operational load balancer setup for the current environment.
def create(ctx): create_target_groups(ctx) create_balancer(ctx) create_listeners(ctx) ctx.info('Load balancers setup completed.')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_loadbalancer(self, context, lb):\n super(ArrayDeviceDriverV2, self).create_loadbalancer(context, lb)\n deployment_model = self._get_setting(\n lb.tenant_id, \"lbaas_settings\", \"deployment_model\"\n )\n if deployment_model == \"PER_LOADBALANCER\":\n sel...
[ "0.7192584", "0.70757085", "0.693216", "0.63125825", "0.6119484", "0.6114502", "0.60211533", "0.6003069", "0.5949105", "0.59401405", "0.59334785", "0.5905166", "0.5893923", "0.58604234", "0.5814833", "0.57674474", "0.5761494", "0.5756742", "0.5689999", "0.56665444", "0.565720...
0.7706572
0
Deletes load balancer for current environment and all related resources.
def delete(ctx): delete_listeners(ctx) delete_balancer(ctx) delete_target_groups(ctx) ctx.info('Load balancers deletion completed.')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self):\r\n return self.connection.delete_load_balancer(self.name)", "def delete_loadbalancer(self, context, lb):\n deployment_model = self._get_setting(\n lb.tenant_id, \"lbaas_settings\", \"deployment_model\"\n )\n hostnames = self._get_hostname(lb)\n if ...
[ "0.7630601", "0.74928415", "0.7286447", "0.7257088", "0.7153159", "0.6958919", "0.68135", "0.6746743", "0.65986437", "0.62686634", "0.6249868", "0.61619234", "0.6124974", "0.61239636", "0.6012765", "0.5994635", "0.5989202", "0.5975469", "0.5961489", "0.58851093", "0.58708817"...
0.81043327
0
Resets load balancer setup for the current environment.
def reset(ctx): delete(ctx) create(ctx) ctx.info('Load balancers reset completed.')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset():\n from . import core\n core.http.reset()", "def reset(self, env):\n self._env = env\n return", "def reset(self):\n self._config = Config()\n self._router = Router(())\n self._middleware = []\n self._start_response = None", "def reset_env(self):\n re...
[ "0.6528185", "0.62851256", "0.6279536", "0.6173153", "0.6142136", "0.60960215", "0.60925925", "0.6026478", "0.6022415", "0.6013986", "0.59514946", "0.58933365", "0.58326983", "0.5831264", "0.5827723", "0.5823984", "0.58123845", "0.57883435", "0.5766599", "0.57214874", "0.5714...
0.79088813
0
Momentum update in the paper model_ema = m model_ema + (1m) model
def moment_update(model, model_ema, m): for p1, p2 in zip(model.parameters(), model_ema.parameters()): p2.data.mul_(m).add_(1-m, p1.detach().data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def moment_update(model, model_ema, m):\r\n for p1, p2 in zip(model.parameters(), model_ema.parameters()):\r\n p2.data.mul_(m).add_(1 - m, p1.detach().data)\r\n # p2.data.mul_(m).add_(1 - m, p1.data)", "def update_ema(self):", "def momentum_update(model_q, model_k, m=0.999):\n for p1, p2 in...
[ "0.8465972", "0.7067352", "0.6589039", "0.61633873", "0.6113697", "0.6102108", "0.6092487", "0.60704297", "0.6068411", "0.6004033", "0.6002073", "0.59967154", "0.5994754", "0.59732616", "0.5970538", "0.5949824", "0.5927358", "0.5924119", "0.59215385", "0.59203863", "0.5901667...
0.8590939
1
Set an alternative useragent header
def set_user_agent(self, user_agent: str) -> None: self.headers['User-Agent'] = user_agent
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_agent_header(self):\n self._api_client.set_default_header('User-Agent', self._api_client.user_agent)", "def setUA(self, useragent):\n\t\tpass", "def _change_user_agent(self):\n index = (self.current_user_agent_index + 1) % len(_USER_AGENT_LIST)\n self.headers['User-Agent'] = _USER...
[ "0.76518005", "0.7450856", "0.7234104", "0.70967805", "0.68636405", "0.6850527", "0.66897154", "0.65973204", "0.63424844", "0.6313411", "0.6176743", "0.6160825", "0.611805", "0.60785663", "0.6078315", "0.6071037", "0.6050875", "0.6050875", "0.59958977", "0.58809", "0.5868236"...
0.7914726
0
Extract announcement data from the extracted html partial The html partial should be a Tag object returned from BeautifulSoup4.find()
def parse_announcement_data(self) -> 'Scraper': logger.info('Parsing extracted html partial') for tag in self.html_partial: # there are 63 tags if tag.name == 'h4': announcement_data = self.get_data_from_tag(tag) self.announcement_data_list.append(announcemen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_article_html(page_resp):\n article_url = page_resp.url\n \n article_page_soup = bs4.BeautifulSoup(page_resp.text, \"lxml\")\n \n title_html = article_page_soup.find_all(\"h1\")[0]\n title_text = title_html.contents[0]\n \n date = article_page_soup.find_all(\"small\", {'class': 'gr...
[ "0.62940294", "0.6138685", "0.582471", "0.57500374", "0.5688174", "0.56493", "0.5640577", "0.56324977", "0.56077284", "0.55874634", "0.5580428", "0.5561971", "0.5549291", "0.5466563", "0.53989834", "0.53752327", "0.53721714", "0.5323852", "0.5306437", "0.5299389", "0.5295665"...
0.80006164
0
check the title and url of the announcement
def check_announcement_content_validity(self, a: dict) -> None: url_regex = r'[(http(s)?):\/\/(www\.)?a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)' if a['title'] == '' or type(a['title']) is not NavigableString: raise AnnouncementContentNotFound('Announcement title...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify(self):\r\n self.title = self.title and self.title or '' \r\n self.descr = self.descr and self.descr or '' \r\n self.link = self.link and self.link or ''\r\n self.channelURL = self.channelURL and self.channelURL or ''", "def tes...
[ "0.68196785", "0.6165887", "0.59821224", "0.592882", "0.59199625", "0.58730316", "0.5831485", "0.57923007", "0.57597804", "0.5742691", "0.5737139", "0.5727141", "0.5695846", "0.5685224", "0.5685224", "0.5685224", "0.5685224", "0.5685224", "0.5685224", "0.5685224", "0.5685224"...
0.7364866
0
Extract announcement data from a BeautifulSoup4 Tag object
def get_data_from_tag(self, tag: Tag) -> dict: self.verify_tag_structure(tag) title = tag.string url = tag.contents[0]['href'] # tag.contents[0].name is 'a' date_string = tag.next_sibling.next_sibling.contents[0] published_date = (self.get_date_from_string(date_string)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_announcement_data(self) -> 'Scraper':\n logger.info('Parsing extracted html partial')\n for tag in self.html_partial: # there are 63 tags\n if tag.name == 'h4':\n announcement_data = self.get_data_from_tag(tag)\n self.announcement_data_list.append(a...
[ "0.6747848", "0.61468184", "0.61101943", "0.6023411", "0.59465456", "0.5922927", "0.5907416", "0.583392", "0.5683404", "0.56611496", "0.5640813", "0.5633416", "0.562401", "0.5576179", "0.55751514", "0.5558634", "0.555051", "0.55294627", "0.55007476", "0.5500726", "0.5455654",...
0.7399995
0
Returns a collection of announcement objects in the form of an AnnouncementCollection object
def get_announcements(self, factory: 'AnnouncementFactory') -> 'AnnouncementCollection': collection = factory.get_announcement_collection(self.get_announcement_data_list()) return collection
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n announcements = Announcement.query.all()\n announcements = announcements_schema.dump(announcements)\n\n if not announcements:\n return {'status': 'success', 'announcements': announcements}, 206 # Partial Content Served\n\n return {'status': 'success', 'annou...
[ "0.62996197", "0.59415793", "0.58581275", "0.57568336", "0.56691045", "0.563069", "0.5609823", "0.5570636", "0.5570226", "0.5568708", "0.55073804", "0.5450226", "0.54384685", "0.5434181", "0.54055053", "0.53166115", "0.5299681", "0.5296883", "0.525246", "0.5247528", "0.523049...
0.7739937
0
Create a date only datetime object by extracting a date from a string The date string should be in the format "May 11st, 2020 by " else method raises DateStringFormatMismatch exception.
def get_date_from_string(date_string: str) -> datetime: regex = r'^(January|February|March?|April|May|June|July|August|September|October|November|December)' \ r' (\d{1,2})(st|nd|rd|th), (\d{4}) by $' if re.match(regex, date_string) is None: raise DateStringFormatMismatch('Sc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def string_to_date(string):\n params = string.strip().split('-')\n year = int(params[0])\n month = int(params[1])\n day = int(params[2])\n d = date(year, month, day)\n return d", "def get_date(string):\r\n string = re.sub(' +', ' ', string)\r\n try:\r\n retu...
[ "0.76573557", "0.76182073", "0.75150347", "0.7463151", "0.7463052", "0.7450171", "0.7438522", "0.7346099", "0.7337427", "0.7319477", "0.73107994", "0.72941107", "0.7282974", "0.72484726", "0.7245461", "0.71994174", "0.7198044", "0.71857935", "0.71590173", "0.7078841", "0.7065...
0.813079
0
Generator that reads from the terminal and yields "interactive inputs". Due to temporary limitations in tf.learn, if we don't want to reload the whole graph, then we are stuck encoding all of the input as one fixedsize numpy array.
def _interactive_input_fn(hparams, decode_hp): num_samples = decode_hp.num_samples if decode_hp.num_samples > 0 else 1 decode_length = decode_hp.extra_length input_type = "text" p_hparams = hparams.problem_hparams has_input = "inputs" in p_hparams.modality vocabulary = p_hparams.vocabulary["inputs" if has_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_input(self) -> None:\n raw_input = sys.stdin.read()\n\n self._input = raw_input.split('\\n')\n self._input = self._input[0:-1]\n\n for line in self._input:\n direction, steps = line.split()\n self._instructions.append((direction, int(steps)))", "def iter...
[ "0.6167433", "0.5872662", "0.5866722", "0.58653957", "0.57514834", "0.57471544", "0.57423514", "0.5693443", "0.5675602", "0.56751627", "0.56751627", "0.5635416", "0.5626456", "0.5626456", "0.5626456", "0.561444", "0.56078106", "0.5591231", "0.55875516", "0.5550704", "0.554291...
0.6619003
0
Shows an image using matplotlib and saves it.
def show_and_save_image(img, save_path): try: import matplotlib.pyplot as plt # pylint: disable=g-import-not-at-top except ImportError as e: tf.logging.warning( "Showing and saving an image requires matplotlib to be " "installed: %s", e) raise NotImplementedError("Image display and save...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_image(path):\n img = mpimg.imread(path)\n imgplot = plt.imshow(img)\n plt.show()\n plt.close()", "def save(image, name):\n from matplotlib import pyplot\n import matplotlib as mpl\n fig = pyplot.figure()\n ax = fig.add_subplot(1,1,1)\n imgplot = ax.imshow(image, cmap=mpl.cm.Gr...
[ "0.7841939", "0.77371234", "0.7698087", "0.7367039", "0.7197469", "0.7056606", "0.70549476", "0.7029917", "0.70056736", "0.69819826", "0.6958245", "0.6957882", "0.69477004", "0.69260085", "0.6901715", "0.68855405", "0.6878939", "0.6877376", "0.6875134", "0.68697375", "0.68548...
0.7918635
0
Run hooks after decodes have run.
def run_postdecode_hooks(decode_hook_args, dataset_split): hooks = decode_hook_args.problem.decode_hooks if not hooks: return global_step = latest_checkpoint_step(decode_hook_args.estimator.model_dir) if global_step is None: tf.logging.info( "Skipping decode hooks because no checkpoint yet avail...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_decode(self, encoded_data):\n \n config.COD_PROMPT = config.DEC_PROMPT\n print config.DEC_PROMPT + \" decoding...\"\n \n # while there is another decoder, run each item through the next decoder\n data = encoded_data\n success = False\n for decoder ...
[ "0.6479824", "0.6342177", "0.61132634", "0.5872782", "0.57890147", "0.5770451", "0.57692546", "0.5649763", "0.56200325", "0.56200325", "0.56200325", "0.56200325", "0.56200325", "0.5566848", "0.55566543", "0.5554071", "0.5554071", "0.55202794", "0.55136657", "0.5511754", "0.55...
0.6441413
1
Turn LED on for the duration at the given intensity.
def blink(self, duration: int=1, intensity: int=0xff): # Turn LED on self.intensity(max(0, min(intensity, 0xff))) # Turn LED off (after a delay) upyt.sched.loop.call_later_ms(duration, self.off)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_on(self, **kwargs: Any) -> None:\n if self._dimmable:\n level = kwargs.get(ATTR_BRIGHTNESS, self._last_brightness)\n else:\n level = 255\n self._light.turn_on(to_futurenow_level(level))", "def set_intensity(intensity):\n ret = _LIB.led_matrix_click_set_inten...
[ "0.67766994", "0.6760989", "0.6644507", "0.6636387", "0.6633147", "0.6597575", "0.65660846", "0.65433735", "0.65252846", "0.6483592", "0.6381838", "0.6280884", "0.6212819", "0.61426216", "0.6135334", "0.6120748", "0.61169463", "0.60711604", "0.6065121", "0.6059004", "0.604653...
0.76953053
0
Install a fresh Drupal site Use Drush to setup the Drupal structure in database
def site_install(path, db_user, db_pass, db_host, db_name): db_url = 'mysql://%s:%s@%s/%s' % (db_user, db_pass, db_host, db_name) warning = """ WARNING: This is an inherently insecure method for interacting with the database since the database password will be written to the command line and will be visible to ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vanilla_site(parent, name, db_name, base_url=None, rewrite_base=None):\n\n # TODO check for trailing slash\n path = parent + '/' + name\n\n print header(\"Checking dependencies\")\n if exists(path):\n warning = \"\"\"\nA folder already exists at your destination path.\n\nDo you wish to overw...
[ "0.63983303", "0.6073262", "0.5945958", "0.5833292", "0.5776026", "0.56814235", "0.5650706", "0.5622328", "0.5554226", "0.5548526", "0.55232364", "0.5519522", "0.54835784", "0.5424124", "0.5408809", "0.5405939", "0.53874534", "0.5381521", "0.5368194", "0.53665733", "0.5350601...
0.7213197
0
Download the latest Drupal project
def download(parent, name=None): with cd(parent): if not name: run("drush dl") else: run("drush dl --drupal-project-rename=%s" % name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download(self):\n logger.info(f\"downloading project {self}\")\n self.project.storage.download(f\"{self.path}/releasemanifest\", None)\n self.extract()", "def _download_project(name, apikey):\n payload = {'apikey': apikey, 'project': name, 'version': 'portia'}\n r = requests.get(DA...
[ "0.6580372", "0.6464609", "0.63208455", "0.6228037", "0.6014168", "0.5966778", "0.5897198", "0.5885061", "0.581801", "0.57892925", "0.5750816", "0.5717377", "0.5698092", "0.5602394", "0.5602394", "0.5602394", "0.5594754", "0.55718493", "0.5547418", "0.5503806", "0.54807496", ...
0.67670256
0
Create a dev site by copying an existing live site
def dev_site(live_path, dev_parent, dev_name, dev_db_name='', base_url='', rewrite_base=''): with mute(): remote = git.get_remote_url(live_path) dev_path = '%s/%s' % (dev_parent, dev_name) if exists(dev_path): warning = """ A folder already exists at your destination path. Do y...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_site(apps, schema_editor):\n return site_models.Site.objects.create(\n name='The SATNet Network',\n domain='localhost:8000'\n )", "def create(site):\n\n # Run the \"createsite\" script on the VM. \n # That will create the site for you.\n Vagrant.run_script_on_v...
[ "0.6176075", "0.60619366", "0.6060742", "0.6030078", "0.59882927", "0.5953914", "0.5896026", "0.58862174", "0.5880198", "0.5772577", "0.568508", "0.5643675", "0.5567811", "0.55583143", "0.5544927", "0.5542888", "0.55298686", "0.5514869", "0.5511138", "0.5498806", "0.548514", ...
0.708023
0
Setup a complete, vanilla Drupal install Download Drupal, configure the settings.php database file, configure the .htaccess file, and then populate the database with the default Drupal structure.
def vanilla_site(parent, name, db_name, base_url=None, rewrite_base=None): # TODO check for trailing slash path = parent + '/' + name print header("Checking dependencies") if exists(path): warning = """ A folder already exists at your destination path. Do you wish to overwrite? """ co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_module():\n svrhelp.setup_module()\n\n # Create the db now the server is running in its own dir.\n #db.init(...)", "def setup():\n\n debs = (\"python-setuptools\", \"apache2\", \"libapache2-mod-wsgi\")\n\n require(\"hosts\", provided_by=[production, staging])\n sudo(\"apt-get install ...
[ "0.61548936", "0.60947293", "0.6059112", "0.59985375", "0.5975852", "0.59535164", "0.5928912", "0.58542085", "0.58447844", "0.58415353", "0.5792753", "0.5785525", "0.5685478", "0.568248", "0.5669951", "0.55929977", "0.55778635", "0.55460817", "0.553817", "0.5500487", "0.54691...
0.6883463
0
an iterator over the keys of metakey and its dereferenced values.
def __getitem__(self, metakey): for key in self.metadb[metakey]: yield key, self.datadb[key]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n\n # For each key in set of keys\n for key in self.keys_set:\n\n # Yield that key and associated value\n yield key, self.__getitem__(key)", "def items(self):\n for metakey in self:\n yield metakey, self[metakey]", "def iteritems(self):\...
[ "0.74286705", "0.74038", "0.7262638", "0.7250744", "0.7151584", "0.7122191", "0.70534873", "0.7005466", "0.69557893", "0.6933972", "0.6917245", "0.69147", "0.69001734", "0.69001734", "0.6877285", "0.68627656", "0.6821079", "0.6786858", "0.67688274", "0.6751377", "0.6750948", ...
0.74917674
0
an iterator over the metakeys and their corresponding values.
def items(self): for metakey in self: yield metakey, self[metakey]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n\n # For each key in set of keys\n for key in self.keys_set:\n\n # Yield that key and associated value\n yield key, self.__getitem__(key)", "def __getitem__(self, metakey):\n for key in self.metadb[metakey]:\n yield key, self.datadb[key]"...
[ "0.77093714", "0.7637563", "0.7584621", "0.7581623", "0.7512615", "0.7484198", "0.7458412", "0.7443295", "0.73784", "0.73640764", "0.7329393", "0.73129827", "0.73129827", "0.7273179", "0.7223564", "0.7205529", "0.7146982", "0.71324456", "0.71234393", "0.7087726", "0.707989", ...
0.7975261
0
an iterator over the unique keys of all metakeys and their dereferenced values.
def unique_values(self): for key in self.metadb.unique_values(): yield key, self.datadb[key]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def items(self):\n for metakey in self:\n yield metakey, self[metakey]", "def iteritems(self):\n for key in self:\n yield key, self[key]", "def iteritems(self):\n return iter((kvp.key, kvp.value) for kvp in self.keyvaluepair_set.all())", "def __iter__(self):\n\n ...
[ "0.7411535", "0.71149856", "0.70268494", "0.6994934", "0.69928217", "0.69273615", "0.68922776", "0.6891039", "0.6890184", "0.6890184", "0.6867791", "0.6856759", "0.6842534", "0.67885214", "0.67820734", "0.6760459", "0.6741788", "0.6714845", "0.67108667", "0.6708048", "0.67042...
0.75245976
0
an iterator over the keys whose metakeys satisfy q and their dereferenced values.
def query(self, q): for key in self.metadb.query(q): yield key, self.datadb[key]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n\n # For each key in set of keys\n for key in self.keys_set:\n\n # Yield that key and associated value\n yield key, self.__getitem__(key)", "def iterkeys(self):\n return iter(kvp.key for kvp in self.keyvaluepair_set.all())", "def _key_index_iter(s...
[ "0.65659654", "0.6442065", "0.63845867", "0.62278324", "0.6215119", "0.62128973", "0.6139345", "0.61231196", "0.61042035", "0.6099117", "0.60899293", "0.6079643", "0.6071832", "0.59990674", "0.598659", "0.5984135", "0.5984135", "0.59521896", "0.59317625", "0.59167755", "0.589...
0.7133837
0
Overwrite default hyperparameters of a network, based on the flags
def overwrite_hyperparams(self): try: default_hyperparams = self.hyperparams for key in default_hyperparams: try: flag = self.FLAGS[key] param_value = flag.value if param_value is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_hyperparams(use_defaults):\n if use_defaults:\n n_neurons, n_hidden, n_steps, k_prob = default_hyperparams()\n return n_neurons, n_hidden, n_steps, k_prob\n\n print (\"Select number of neurons in recurrent layer (default \" +\n \"100):\")\n n_neurons = int(input())\n pr...
[ "0.6560901", "0.6490657", "0.62144095", "0.6189958", "0.6081534", "0.60703486", "0.6063563", "0.60463375", "0.60463375", "0.60463375", "0.6041865", "0.6037213", "0.60356396", "0.60238945", "0.5970691", "0.59528214", "0.5942642", "0.59286654", "0.5928044", "0.5914245", "0.5908...
0.75112396
0
Saves session = weights as a checkpoint
def save_session(self): # Checkpoint directory. Tensorflow assumes this directory already exists so we need to create it checkpoint_dir = os.path.abspath(os.path.join(self.FLAGS.model_dir, "checkpoints")) checkpoint_prefix = os.path.join(checkpoint_dir, "model") if not os.path.exists(ch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, checkpoint) -> None:\r\n self.model.save(checkpoint)", "def save_checkpoint(self):\n \n if not os.path.isdir(self.path + '/checkpoint/'):\n os.makedirs(self.path + '/checkpoint/')\n\n if self.saver == None:\n with self.graph.as_default():\n ...
[ "0.7273272", "0.721551", "0.7180363", "0.717209", "0.7092982", "0.70917594", "0.70860475", "0.70602214", "0.7046638", "0.7022896", "0.70210314", "0.69389325", "0.69260246", "0.6919135", "0.6914021", "0.6907725", "0.6904546", "0.6894275", "0.6886038", "0.68804497", "0.6876584"...
0.7346784
0
converts pdf file to xml file
def pdftoxml(pdfdata): pdffout = tempfile.NamedTemporaryFile(suffix='.pdf') pdffout.write(pdfdata) pdffout.flush() xmlin = tempfile.NamedTemporaryFile(mode='r', suffix='.xml') tmpxml = xmlin.name # "temph.xml" cmd = '/usr/bin/pdftohtml -xml -nodrm -zoom 1.5 -enc UTF-8 -noframes "%s" "%s"' % (pdf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_grobid_xml(self, paper_id):\n\n filename=cfg.folder_pdf+paper_id+\".pdf\"\n filename_xml=cfg.folder_content_xml+paper_id+\".xml\"\n\n ## check if XML file is already available\n if os.path.isfile(filename_xml):\n ## yes, load from cache\n root=etree.parse(filename_xml)...
[ "0.67023027", "0.6365666", "0.60989606", "0.6029197", "0.5841964", "0.5824973", "0.5780665", "0.5717895", "0.57166094", "0.564895", "0.56473297", "0.56250364", "0.5558366", "0.5530251", "0.5512295", "0.55119246", "0.5511825", "0.5509534", "0.55055887", "0.54943115", "0.548590...
0.71766394
1
converts pdf file to xml file
def pdftoxml(pdfdata): pdffout = tempfile.NamedTemporaryFile(suffix='.pdf') pdffout.write(pdfdata) pdffout.flush() xmlin = tempfile.NamedTemporaryFile(mode='r', suffix='.xml') tmpxml = xmlin.name # "temph.xml" cmd = '/usr/bin/pdftohtml -xml -nodrm -zoom 1.5 -enc UTF-8 -noframes "%s" "%s"' % (pdf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_grobid_xml(self, paper_id):\n\n filename=cfg.folder_pdf+paper_id+\".pdf\"\n filename_xml=cfg.folder_content_xml+paper_id+\".xml\"\n\n ## check if XML file is already available\n if os.path.isfile(filename_xml):\n ## yes, load from cache\n root=etree.parse(filename_xml)...
[ "0.67023027", "0.6365666", "0.60989606", "0.6029197", "0.5841964", "0.5824973", "0.5780665", "0.5717895", "0.57166094", "0.564895", "0.56473297", "0.56250364", "0.5558366", "0.5530251", "0.5512295", "0.55119246", "0.5511825", "0.5509534", "0.55055887", "0.54943115", "0.548590...
0.71766394
0
Train weak classifier based on a given feature.
def trainWeakClassifier(trainingSamples, weights, feature): #compute feature values featureValues = [] positiveOrNegative = [] for sample in trainingSamples: featureValues.append(feature.computeScore(sample[0], 0, 0)) positiveOrNegative.append(sample[1]) #zip with weights an...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trainModel( self, featureTrain, classTrain):", "def train(self, features, labels, seed=None):\n raise NotImplementedError('Not implemented')", "def train(self, features, labels):\n pass", "def train(self, features, labels):\n self._clf.fit(features, labels)", "def train(self, features,...
[ "0.6870671", "0.6641588", "0.6511581", "0.64583826", "0.64583826", "0.6346193", "0.63030595", "0.6284348", "0.62136", "0.618147", "0.61618143", "0.61618143", "0.6142733", "0.61174417", "0.6100654", "0.60273075", "0.5981706", "0.592598", "0.5914481", "0.59115297", "0.5890265",...
0.7230463
0
Converts a list of finished workers into a result.
def getResults(workers): results = [] for worker in workers: results += worker.getResults() return results
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after_split_results(msg, config, checklist):\n next_workers = {\n \"crash\": [],\n \"failure hindcast\": [],\n \"success hindcast\": [],\n }\n if msg.type.startswith(\"success\"):\n if config[\"results tarballs\"][\"archive hindcast\"]:\n last_date = max(map(arro...
[ "0.6667437", "0.6196105", "0.61376584", "0.6127806", "0.6084685", "0.58928", "0.58717954", "0.5821175", "0.57959896", "0.57860565", "0.5752882", "0.57220596", "0.5717673", "0.5701846", "0.5694865", "0.56930745", "0.5682493", "0.567067", "0.5606531", "0.5564939", "0.55476886",...
0.69760686
0
unpacks buffer contents into dictionary
def read(self, buf): contents = dict() for element in self.elements: if element.offset + element.size > len(buf): logger.trace("cannot unpack {} for {}.{} buffer too small {}", element.name, element.block_name, element.block_version, len(buf)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode(cls, buffer: bytes) -> Dict[str, Any]:\n pstruct = Struct()\n pstruct.ParseFromString(buffer)\n dictionary = dict(pstruct)\n cls._patch_dict_restore(dictionary)\n return dictionary", "def unpack (self, buffer):\n\t\timport struct\n\t\tvalues = struct.unpack (self.str...
[ "0.7675933", "0.66703975", "0.61456925", "0.61004704", "0.5928765", "0.58829206", "0.5864981", "0.58403814", "0.5826353", "0.5808131", "0.5780132", "0.5750063", "0.5699226", "0.56634146", "0.5656456", "0.5635454", "0.56325823", "0.56243306", "0.56127644", "0.5570557", "0.5561...
0.7160867
1
Translates a word into Pig Latin. The "word" parameter is assumed to be an English word, returned as a string.
def pig_latin(word): if word[0] in 'aeiou': return f'{word}way' return f'{word[1:]}{word[0]}ay'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pig_latin(word):\n if word[0] in 'aeiou':\n return f\"{word}way\"\n\n return f\"{word[1:]}{word[0]}ay\"", "def pigLatinTranslator(word):\n\n vowels = \"aeiouAEIOU\"\n word = str(word)\n if not word.isalpha():\n return \"Please submit a single word.\"\n elif len(word) < 2:\n ...
[ "0.80773824", "0.80713946", "0.79174745", "0.7726841", "0.76903975", "0.75911087", "0.7572945", "0.7533277", "0.73740995", "0.71870416", "0.7040902", "0.68419164", "0.68339497", "0.67273414", "0.66776496", "0.66121346", "0.6572036", "0.6488959", "0.64439183", "0.6443493", "0....
0.80754715
1
Cleans the database before fully installing the module by uninstalling old Soupese modules and remapping data
def _clean_database(self): # noinspection PyUnresolvedReferences env = self.env cr = env.cr modules_to_resolve = [ 'ch_vendor_info', 'API_PDA_receiver', 'delivery_report_custom', 'myevo_base', 'myevo_nobutton_sending_email', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_db(self):\n drop_all_product_lists(server=self.server_url,\n username=self.API_USERNAME,\n password=self.API_PASSWORD)\n drop_all_products(server=self.server_url,\n username=self.API_USERNAME,\n ...
[ "0.68918467", "0.6858987", "0.67867607", "0.6762056", "0.67421025", "0.66503596", "0.66246384", "0.66123", "0.65286297", "0.6502771", "0.6472854", "0.6469703", "0.64444715", "0.6402137", "0.6390408", "0.6326387", "0.632179", "0.63064533", "0.629369", "0.62919813", "0.62892485...
0.7934076
0
Transform a PropertiesList into a list of names
def property_list_to_str(properties: th.PropertiesList) -> List[str]: return [name for (name, prop) in properties.items()]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPropertyNames(self):\n return self._property_names", "def list_to_names(names):\n names_list = []\n for n in names:\n names_list.append(names[n].details['name'])\n return names_list", "def getPropertyNamesAsStrings(self):\n return self._propertyStringNames", "def transfor...
[ "0.6508711", "0.6318532", "0.62844825", "0.61966", "0.6056604", "0.60518324", "0.603768", "0.60026366", "0.5970194", "0.59697604", "0.5968708", "0.5859622", "0.58432716", "0.58058524", "0.5804858", "0.5763744", "0.5757145", "0.57084846", "0.56631404", "0.5659311", "0.55932015...
0.779912
0
Merge multiple PropertiesList objects into a single one
def merge_properties_lists(*properties_lists: th.PropertiesList) -> th.PropertiesList: result = th.PropertiesList() for properties_list in properties_lists: for name, prop in properties_list.items(): result.append(prop) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge_list(metas: List[ProjectMeta]) -> ProjectMeta:\n res_meta = ProjectMeta()\n for meta in metas:\n res_meta = res_meta.merge(meta)\n return res_meta", "def update_multiple_objects_properties(self, object_list):\n\n #if self.settings.LOG_VERBOSE and self.settings.ENA...
[ "0.6601269", "0.624817", "0.60950977", "0.5915258", "0.58907413", "0.5888157", "0.58808917", "0.56685555", "0.5652203", "0.56403077", "0.5575447", "0.5571971", "0.5523679", "0.55089104", "0.55035204", "0.5478272", "0.5384981", "0.53160214", "0.5303527", "0.52926284", "0.52909...
0.8291769
0
r"""Downsample a batch of 2D images with the given filter. Accepts a batch of 2D images of the shape `[N, C, H, W]` or `[N, H, W, C]` and downsamples each image with the given filter. The filter is normalized so that if the input pixels are constant, they will be scaled by the specified `gain`. Pixels outside the image...
def downsample_2d(x, k=None, factor=2, gain=1, data_format='NHWC'): assert isinstance(factor, int) and factor >= 1 if k is None: k = [1] * factor k = _setup_kernel(k) * gain p = k.shape[0] - factor return _simple_upfirdn_2d( x, k, down=factor, pad0=(p + 1) // 2, pad1=p // 2,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conv_downsample_2d(x, w, k=None, factor=2, gain=1, data_format='NHWC'):\n\n assert isinstance(factor, int) and factor >= 1\n convH, convW, _inC, _outC = w.shape\n assert convW == convH\n if k is None:\n k = [1] * factor\n k = _setup_kernel(k) * gain\n p = (k.shape[0] - factor) + (convW - 1)\n s = [fa...
[ "0.59208506", "0.5851584", "0.5679151", "0.5676317", "0.565813", "0.5653539", "0.55858755", "0.55676895", "0.5492554", "0.5436388", "0.5431901", "0.5408714", "0.54077697", "0.536935", "0.5363559", "0.5292055", "0.52802724", "0.5259954", "0.51976967", "0.5101671", "0.50778955"...
0.590075
1
Writes an object to a text file, using JSON representation
def save_to_json_file(my_obj, filename): import json with open(filename, 'w', encoding='utf-8') as f: obj = json.dumps(my_obj) f.write(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_to_json_file(my_obj, filename):\n with open(filename, 'w', encoding='utf-8') as file:\n return file.write(json.dumps(my_obj))", "def save_to_json_file(my_obj, filename):\n with open(filename, mode=\"w\", encoding=\"utf-8\") as writer:\n json.dump(my_obj, writer)", "def save_to_json...
[ "0.7918543", "0.7879459", "0.7872899", "0.7861363", "0.7859837", "0.7836132", "0.7831267", "0.77715296", "0.77463853", "0.7736864", "0.7728628", "0.7719162", "0.76741004", "0.7646637", "0.76425725", "0.7556395", "0.7547116", "0.7506853", "0.74896044", "0.74833363", "0.7456059...
0.79062027
1
Function that takes a dataframe and outputs a BedTool object
def get_Bedtool_from_dataframe(df: object, output_file: str): pybedtools.BedTool.from_dataframe(df).saveas( output_file ) return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataframe_features(df, db):\n def generator():\n for gene_id in df.index:\n yield asinterval(db[gene_id])\n\n return pybedtools.BedTool(generator())", "def transform(self, dataframe: DataFrame) -> DataFrame:", "def my_feature_xxx(df: pd.DataFrame):\n\n # CODE HERE\n\n return d...
[ "0.64251095", "0.5862894", "0.5698449", "0.56902516", "0.56305456", "0.5613798", "0.56004375", "0.5597725", "0.550653", "0.547061", "0.54529804", "0.5449333", "0.54357535", "0.5413284", "0.54047763", "0.53786874", "0.5349155", "0.5321677", "0.5304573", "0.5302112", "0.5267031...
0.7643427
0
Function that extracts the information for motifs functional in a specified tissue from a psql database
def get_BedTool_for_functional_motifs(funMotifs: dict, tissue: str, db_user_name: str, db_name: str, output_file: str): # establish connection conn = psycopg2.connect( database=db_name, user=db_user_name) # create list of motif ids that will be extracted from table motifs = "(" for f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tag_info(xint,conn):\n\n get_tags = ('SELECT DISTINCT fip2.value '\n 'FROM interaction i, feature_interaction fi, feature_interactionprop fip, '\n 'feature f, cvterm cvt, feature_interactionprop fip2, cvterm cvt2 '\n 'WHERE f.feature_id = fi.feature_id AND fi.interaction...
[ "0.5965515", "0.5776989", "0.55274004", "0.54846585", "0.5407883", "0.5313562", "0.53060126", "0.5265161", "0.5230755", "0.52072334", "0.52070326", "0.5163418", "0.511316", "0.5105761", "0.5102435", "0.5078438", "0.50740546", "0.506678", "0.5064191", "0.50562096", "0.5044499"...
0.6454166
0
Function that extracts the essential information of a variant file and returns it as BedTool object
def get_BedTool_from_variant_file(variant_file: str): # TODO: create checks for file format os.system(f"grep -v '#' {variant_file} " + "| awk -F '\t' '{print substr($2, 4), $3, $4, $5, $6, $7, $8, $9}' " + f" >{variant_file}_tmp") pybedtools.BedTool(variant_file + "_tmp").saveas(variant_fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def variants ( self ) :\n vars = []\n items = [ 'distrib' , 'default' ]\n items += [ 'stat_%s' % d for d in range ( 10 ) ]\n items += [ 'syst_%s' % d for d in range ( 10 ) ]\n \n from ostap.core.core import rootError \n from ostap.logger.logger import log...
[ "0.6277935", "0.6057433", "0.5900633", "0.58670485", "0.55492175", "0.553204", "0.5512067", "0.5456865", "0.5435115", "0.5340725", "0.5321985", "0.52944624", "0.52684426", "0.5254221", "0.5221966", "0.5205385", "0.5181874", "0.5172438", "0.51690716", "0.51534516", "0.5139977"...
0.70042205
0
Function that overlaps variants and functional motifs
def overlap_variants_and_motifs(motifs, variants, output_file: str): # TODO: if necessary to make BedTool again, change architecture, figure out why one file okay and the other not mot = pybedtools.BedTool(motifs) mot.intersect(variants, wo=True, header=True).saveas(output_file) return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def define_overlap_operations(self):\n self._d_i = lambda q:np.roll(q,-1,axis=-1) - q\n self._d_j = lambda q:np.roll(q,-1,axis=-2) - q", "def overlap_with(self, other):", "def do_overlap(ds,iterno,algo=\"FordRollett\",ignore=1,unit_weights=False,top=None,bottom=None,\n exact_angles=...
[ "0.5386559", "0.5349724", "0.5311513", "0.52570933", "0.5200758", "0.5150732", "0.51487786", "0.51306033", "0.50855744", "0.50761193", "0.5048707", "0.50270504", "0.5025168", "0.5003984", "0.500078", "0.4981427", "0.49697068", "0.4929684", "0.49271542", "0.49192476", "0.49067...
0.6052787
0
Function that returns the overlaps between functional motifs of a tissue and variants
def find_funMotif_variants_in_tissue(funMotifs: dict, tissue: str, variant_BedTool_file: str, db_name: str, db_user_name: str, output_file: str, motif_BedTool_file: str): get_BedTool_for_functional_motifs(funMotifs, tissue, db_user_name, db_name, motif_BedTool_file) overl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def listOfOverlappingTTPairs():\n listOfHalfModules = listOfTTHalfModules()\n ttmap = TTModulesMap_instance\n pairs = []\n regions = {'A':1, 'B':2, 'C':3}\n print \"Overlapping TT half modules:\"\n for hm1 in listOfHalfModules:\n for hm2 in listOfHalfModules:\n # they must be di...
[ "0.6330254", "0.6144375", "0.59117013", "0.59072804", "0.589387", "0.58324665", "0.5793861", "0.5779408", "0.5762815", "0.57379043", "0.57379043", "0.57379043", "0.568813", "0.5677085", "0.5668019", "0.5660958", "0.5658951", "0.564026", "0.55824566", "0.5566513", "0.5563497",...
0.6276271
1
Connect WS to DUT then change sec wpa2 to wpa/wpa2
def test_wpa2_to_wpa(self, setUp): network = conn() assertion = Assert() # select wireless interface and enable wireless radio_page = RadioPage(self.firefox) radio_page.select_wifi_interface(iface="2.4GHZ") radio_page.enable(radio_page.get_wireless()) radio_page...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetWPADriver(self, driver):\n print \"setting wpa driver\", str(driver)\n self.wifi.wpa_driver = driver\n config = ConfigParser.ConfigParser()\n config.read(self.app_conf)\n config.set(\"Settings\",\"wpa_driver\",driver)\n configfile = open(self.app_conf, \"w\")\n ...
[ "0.5978321", "0.58212847", "0.58156854", "0.5704995", "0.5696726", "0.5637298", "0.5594164", "0.5589521", "0.5555769", "0.55137855", "0.5432683", "0.53863645", "0.53759515", "0.5316402", "0.53031844", "0.5301522", "0.52578723", "0.5247004", "0.52416503", "0.5241068", "0.52191...
0.7137283
0
insert document; All values need to be passed as string eventHub, consumerGroup, partitionId and offset, These match the requirements of the EventHub This method does not allow any additional storage; other option does
def insert_offset_document(self, eventHub, consumerGroup,partition_id, offset, messageType, removeExisting=True): dictObject = self._getDictionaryObjectOffset(eventHub, consumerGroup,partition_id, offset, messageType) return self.insert_offset_document_from_dict(dictObject, removeExisting)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_document(self, messageId, experimentName,offset, currentCount=0, maxItems=-1, elapsedTime='', status='', removeExisting=True):\r\n dictObject = self._getDictionaryObject(messageId, experimentName,offset, currentCount, maxItems, elapsedTime, status)\r\n return self.insert_document_from_dict...
[ "0.6077333", "0.6035941", "0.58997524", "0.58779824", "0.58216363", "0.57659096", "0.57516026", "0.57416564", "0.5729385", "0.5709184", "0.5698257", "0.55731833", "0.5570711", "0.553568", "0.55046153", "0.5484645", "0.54827213", "0.5445576", "0.5431838", "0.54205877", "0.5384...
0.6825649
0
Method to create a feedback matrix
def create_matrix(self): self.matrix = np.zeros((len(self.users), len(self.items))) for user in self.train_set['users']: for item in self.train_set['feedback'][user]: self.matrix[self.user_to_user_id[user]][self.item_to_item_id[item]] = \ self.train_set[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_matrix(self):\n self.lb_make = LabelEncoder()\n self.lb_make.fit(self.Y_train)\n tokenizer = Tokenizer(num_words=2000)\n x_array_train = numpy.asarray(self.train['text'])\n x_array_test = numpy.asarray(self.test['text'])\n tokenizer.fit_on_texts(x_array_train)\n ...
[ "0.63164544", "0.62677366", "0.61268675", "0.61268675", "0.60406196", "0.60257655", "0.5969459", "0.59561974", "0.5900327", "0.5802533", "0.5766169", "0.5753086", "0.5722668", "0.57204777", "0.5712716", "0.570938", "0.570938", "0.5708698", "0.56675833", "0.566741", "0.5665452...
0.70631033
0
Execute SSM automation document DigitoBreakLambdaSecurityGroupTest_20200921
def test_break_security_group_usual_case_specify_sg():
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_break_security_group_failed():", "def test_break_security_group_usual_case():", "def windows_execution(session, elb_name, elb_type, command_type, instance_id_list, tag_value, platform_type, username, password_parameter_name):\n document_name = 'AWS-RunPowerShellScript'\n if str(elb_name) != 'Non...
[ "0.6400182", "0.55930215", "0.5586425", "0.5353389", "0.53464097", "0.53002477", "0.5164097", "0.507528", "0.4907058", "0.48738712", "0.48730302", "0.48474395", "0.48301867", "0.4826344", "0.4807329", "0.47893655", "0.4769453", "0.476463", "0.47354424", "0.470779", "0.4698064...
0.5934422
1
Execute SSM automation document DigitoBreakLambdaSecurityGroupTest_20200921 in rollback
def test_break_security_group_rollback_previous():
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rollback(self, stage, enodes, exception):", "def test_break_security_group_failed():", "def test_rollback():", "def test_blog_rollback():", "def test_create_namespaced_deployment_config_rollback_rollback(self):\n pass", "def test_create_namespaced_deployment_config_rollback(self):\n pas...
[ "0.64744663", "0.64101356", "0.6137421", "0.57786536", "0.5720763", "0.55458915", "0.55042726", "0.5476576", "0.543377", "0.5422985", "0.53976566", "0.5366955", "0.53626645", "0.5321181", "0.526184", "0.5221793", "0.5215912", "0.51713467", "0.5148279", "0.51433945", "0.508609...
0.74641716
0
Execute SSM automation document DigitoBreakLambdaSecurityGroupTest_20200921 to test failure case
def test_break_security_group_failed():
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_break_security_group_usual_case_specify_sg():", "def test_break_security_group_usual_case():", "def test_break_security_group_rollback_previous():", "def test_launch_failures_hw(self):\n self.test_launch_failures()", "def test_aws_service_api_vm_security_group_delete(self):\n pass", ...
[ "0.6433916", "0.625285", "0.61371636", "0.5679316", "0.5658691", "0.5625501", "0.5586798", "0.5442719", "0.543764", "0.5374043", "0.5356653", "0.53561103", "0.53547144", "0.5347069", "0.53156495", "0.53008205", "0.53002393", "0.52783585", "0.5273181", "0.52685493", "0.5261219...
0.73794866
0
Return the smearing (in ms) in each channel at the specified DM
def chan_smear(self, DM): try: DM = where(DM-cDM==0.0, cDM+self.dDM/2.0, DM) except TypeError: if (DM-cDM==0.0): DM = cDM+self.dDM/2.0 return dm_smear(DM, self.obs.chanwidth, self.obs.f_ctr, self.obs.cDM)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_smear(self, DM):\n return sqrt((1000.0*self.obs.dt)**2.0 +\n (1000.0*self.obs.dt*self.downsamp)**2.0 +\n self.BW_smearing**2.0 +\n self.sub_smearing**2.0 +\n self.chan_smear(DM)**2.0)", "def DM_for_smearfact(self, smearf...
[ "0.708876", "0.67770237", "0.66845757", "0.5880866", "0.58423823", "0.578846", "0.5712183", "0.56510144", "0.5630121", "0.5609441", "0.55745095", "0.5538945", "0.55093586", "0.5484867", "0.54699725", "0.54063857", "0.5374911", "0.5356186", "0.53358334", "0.5315479", "0.531303...
0.70364016
1
Return the total smearing in ms due to the sampling rate, the smearing over each channel, the smearing over each subband (if numsub > 0) and the smearing over the full BW assuming the worstcase DM error.
def total_smear(self, DM): return sqrt((1000.0*self.obs.dt)**2.0 + (1000.0*self.obs.dt*self.downsamp)**2.0 + self.BW_smearing**2.0 + self.sub_smearing**2.0 + self.chan_smear(DM)**2.0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DM_for_smearfact(self, smearfact):\n other_smear = sqrt((1000.0*self.obs.dt)**2.0 +\n (1000.0*self.obs.dt*self.downsamp)**2.0 +\n self.BW_smearing**2.0 +\n self.sub_smearing**2.0)\n return smearfact*0.001*other_smear/se...
[ "0.59962463", "0.5847587", "0.58467317", "0.57997197", "0.56424934", "0.5639254", "0.5608289", "0.55960196", "0.5570163", "0.54857546", "0.5478621", "0.54403645", "0.54202724", "0.5409923", "0.53928995", "0.53849053", "0.5364623", "0.53559995", "0.5340608", "0.53223324", "0.5...
0.66381943
0
Return the DM where the smearing in a single channel is a factor smearfact larger than all the other smearing causes combined.
def DM_for_smearfact(self, smearfact): other_smear = sqrt((1000.0*self.obs.dt)**2.0 + (1000.0*self.obs.dt*self.downsamp)**2.0 + self.BW_smearing**2.0 + self.sub_smearing**2.0) return smearfact*0.001*other_smear/self.obs.cha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chan_smear(self, DM):\n try:\n DM = where(DM-cDM==0.0, cDM+self.dDM/2.0, DM)\n except TypeError:\n if (DM-cDM==0.0): DM = cDM+self.dDM/2.0\n return dm_smear(DM, self.obs.chanwidth, self.obs.f_ctr, self.obs.cDM)", "def DM_for_newparams(self, dDM, downsamp):\n ...
[ "0.6319029", "0.54660326", "0.5425173", "0.5357689", "0.49636364", "0.495898", "0.4931268", "0.48972967", "0.4890005", "0.48887098", "0.48865256", "0.48845127", "0.48681086", "0.48547518", "0.48524323", "0.48474807", "0.4844403", "0.48379698", "0.48337555", "0.48272544", "0.4...
0.69869906
0
Return the DM where the smearing in a single channel is causes the same smearing as the effects of the new dosnsampling rate and dDM.
def DM_for_newparams(self, dDM, downsamp): other_smear = sqrt((1000.0*self.obs.dt)**2.0 + (1000.0*self.obs.dt*downsamp)**2.0 + BW_smear(dDM, self.obs.BW, self.obs.f_ctr)**2.0 + self.sub_smearing**2.0) return 0.001*other_sme...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DM_for_smearfact(self, smearfact):\n other_smear = sqrt((1000.0*self.obs.dt)**2.0 +\n (1000.0*self.obs.dt*self.downsamp)**2.0 +\n self.BW_smearing**2.0 +\n self.sub_smearing**2.0)\n return smearfact*0.001*other_smear/se...
[ "0.75583947", "0.720625", "0.65490854", "0.62852675", "0.61138403", "0.59767824", "0.5833507", "0.5808786", "0.57996666", "0.5796143", "0.5689878", "0.56716835", "0.5656901", "0.5634969", "0.5612287", "0.5561598", "0.55413216", "0.5523513", "0.54446", "0.54412264", "0.5428417...
0.781685
0
cls hold db while self hold field_name, and model
def full_init_self(self, db, field_name, model): if not self.db: self.__class__.db = db self.field_name = field_name self.model = model # property
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_fields(self):", "def _prepare(cls):\n # the dbmodel is either the proxy base or ourselves\n dbmodel = cls._meta.concrete_model if cls._meta.proxy else cls\n cls.__dbclass__ = dbmodel\n if not hasattr(dbmodel, \"__instance_cache__\"):\n # we store __instance_cache__ o...
[ "0.7178065", "0.66852754", "0.6673914", "0.6491509", "0.6480346", "0.64386976", "0.64381945", "0.63003075", "0.6217057", "0.618554", "0.61548877", "0.6149434", "0.6130378", "0.61014885", "0.6080942", "0.6079171", "0.60749394", "0.6051769", "0.60350996", "0.6010226", "0.601002...
0.7959181
0
Make sure we have a markdown folder to write to.
def directory(self) -> Path: (directory := Path("markdown").resolve(strict=False)).mkdir(exist_ok=True, parents=True) return directory
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wrap_md(a_path, comments):\r\n if not a_path:\r\n say_it(\"-- Error. No value specified for %s\" % comments)\r\n return 1\r\n if not os.path.isdir(a_path):\r\n try:\r\n os.makedirs(a_path)\r\n except Exception as e:\r\n say_it(\"-- Error. can not makedir ...
[ "0.646971", "0.646971", "0.6396185", "0.5985568", "0.5970417", "0.5954497", "0.5881312", "0.5827589", "0.57743984", "0.5773752", "0.5702826", "0.5683667", "0.56506604", "0.5638995", "0.5618831", "0.5608611", "0.5591611", "0.5572487", "0.5526632", "0.5501867", "0.54801977", ...
0.6719051
0
Construct an hparam dictionary from the flags.
def _build_flags_hparam_dict(): logging.info('Show FLAGS for debugging:') for f in HPARAM_FLAGS: logging.info('%s=%s', f, FLAGS[f].value) hparam_dict = collections.OrderedDict([ (name, FLAGS[name].value) for name in HPARAM_FLAGS ]) return hparam_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_hparam_flags():\n hparam_dict = utils_impl.lookup_flag_values(shared_flags)\n\n # Update with optimizer flags corresponding to the chosen optimizers.\n opt_flag_dict = utils_impl.lookup_flag_values(optimizer_flags)\n opt_flag_dict = optimizer_utils.remove_unused_flags('client', opt_flag_dict)\n opt_f...
[ "0.7335772", "0.65748584", "0.64927566", "0.64463437", "0.6262838", "0.6255742", "0.6103088", "0.60578626", "0.5906162", "0.5896976", "0.58742887", "0.58281696", "0.5815971", "0.57891846", "0.5757716", "0.5731962", "0.56256163", "0.5611377", "0.55976546", "0.55887145", "0.558...
0.8174391
0
Use the state_map for this instance to map a state string into a ServerState constant
def _api_state_to_serverstate(self, api_state): try: return self.state_map[api_state] except KeyError: self.logger.warn( "Unmapped Server state '%s' received from system, mapped to '%s'", api_state, ServerState.UNKNOWN ) ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_esi_name(cls, esi_state_name: str) -> \"StructureService.State\":\n STATES_ESI_MAP = {\"offline\": cls.OFFLINE, \"online\": cls.ONLINE}\n return (\n STATES_ESI_MAP[esi_state_name]\n if esi_state_name in STATES_ESI_MAP\n else cls.OFFLINE\n ...
[ "0.6379251", "0.63019204", "0.62902385", "0.61279786", "0.5973234", "0.5935471", "0.5809283", "0.58044195", "0.58006954", "0.5798137", "0.57211673", "0.5705519", "0.5704255", "0.5701755", "0.5689011", "0.56670773", "0.56380117", "0.5636881", "0.5626896", "0.56248236", "0.5580...
0.6673923
0
Return True if the server is in the process of being powered on.
def is_powering_on(self): return self._get_state() == ServerState.POWERING_ON
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_on(self):\n if self._power_state == HYSEN_POWERON :\n return True\n else:\n return False", "def is_host_on(self):\n status = False\n cmd = \"/usr/local/bin/wedge_power.sh status\"\n data = run_shell_cmd(cmd)\n Logger.info(\"[FSCD Testing] Exe...
[ "0.7806083", "0.7783991", "0.77826375", "0.7498044", "0.73826337", "0.7230849", "0.7181862", "0.711774", "0.70670676", "0.70519984", "0.6885925", "0.68290555", "0.6812099", "0.67613184", "0.67492056", "0.6744383", "0.674361", "0.6732181", "0.6730665", "0.67200327", "0.6720032...
0.8435485
0
Return True if the server is in the process of powered off.
def is_powering_off(self): return self._get_state() == ServerState.POWERING_OFF
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_off(self):\n return self._get_state() == ServerState.OFF", "def is_powered_off(self, instance_name):\n return self._smtclient.get_power_state(instance_name) == 'off'", "def is_powering_on(self):\n return self._get_state() == ServerState.POWERING_ON", "def is_on(self):\n run...
[ "0.7824", "0.7776749", "0.74727935", "0.72223604", "0.70757234", "0.7032411", "0.68682", "0.67982227", "0.6795486", "0.6750043", "0.6710196", "0.6682203", "0.66467077", "0.6633493", "0.660809", "0.66007054", "0.65932846", "0.6574245", "0.65727454", "0.6453709", "0.6424308", ...
0.8522721
0
Divides the signal into several, possibly overlapping frames.
def signal_to_frames(signal, frame_len, frame_step, win_func=None): assert signal.ndim == 1 signal_len = len(signal) frame_len = int(round(frame_len)) frame_step = int(round(frame_step)) num_frames = number_frames(signal_len, frame_len, frame_step) indices = indices_grid(frame_len, frame_step,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enframe(wavData, frameSize=400, step=160):\n coef = 0.97\n wlen = wavData.shape[0]\n frameNum = math.ceil(wlen / step)\n frameData = np.zeros((frameSize, frameNum))\n\n window = signal.windows.hamming(frameSize)\n\n for i in range(frameNum):\n singleFrame = wavData[i * step : min(i * s...
[ "0.6031604", "0.59864634", "0.58658904", "0.58351475", "0.57659346", "0.5749059", "0.5747793", "0.567315", "0.56341195", "0.5571236", "0.5405695", "0.53920823", "0.5365756", "0.5362583", "0.5350319", "0.53134966", "0.53134966", "0.53134966", "0.53134966", "0.53134966", "0.530...
0.60254115
1
Computes the number of frames for a given signal length.
def number_frames(signal_len, frame_len, frame_step): frames = 1 if signal_len > frame_len: temp = (1.0 * signal_len - frame_len)/frame_step frames += int(np.floor(temp)) return frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_frames(length, fsize, fshift):\n pad = (fsize - fshift)\n if length % fshift == 0:\n M = (length + pad * 2 - fsize) // fshift + 1\n else:\n M = (length + pad * 2 - fsize) // fshift + 2\n return M", "def lws_num_frames(length, fsize, fshift):\n pad = (fsize - fshift)\n if l...
[ "0.7928671", "0.76205933", "0.7365137", "0.7048614", "0.69185", "0.6758897", "0.67540646", "0.6622454", "0.65737015", "0.6522947", "0.65163374", "0.6490955", "0.64401543", "0.64093006", "0.6391117", "0.637485", "0.6360134", "0.6314284", "0.62693727", "0.62614816", "0.6247267"...
0.87695944
0
Computes a grid of indices for possibly overlapping frames.
def indices_grid(frame_len, frame_step, num_frames): indices = np.tile(np.arange(0, frame_len), (num_frames, 1)) + \ np.tile(np.arange(0, num_frames * frame_step, frame_step), (frame_len, 1)).T indices = np.array(indices, dtype=np.int32) return indices
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def master_ndindex(self): # itermaster_indices(self):\n return itertools_product(\n *[range(*r) for r in self.location]\n ) # TODO check", "def construct_indices(after_pooling):\n our_indices = np.zeros_like(after_pooling, dtype=np.int64)\n batch_num, channel_num, row_num, col_nu...
[ "0.66452646", "0.6411415", "0.6340614", "0.6286571", "0.6212913", "0.61323994", "0.6022557", "0.60102123", "0.59811884", "0.5980919", "0.5949921", "0.5935643", "0.5918394", "0.58906466", "0.58795816", "0.5863771", "0.5861669", "0.58537227", "0.5849864", "0.5849568", "0.583424...
0.82699645
0
Computes either the hamming window or its inverse and applies it to a sequence of frames.
def apply_hamming(frames, inv=False): M = frames.shape[1] win = np.hamming(M)**(-1) if inv else np.hamming(M) return frames * win
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def windowing(input):\n return input * hamming(input.shape[1], sym=0)", "def windowing(input):\n N, M = np.shape(input)\n\n window = signal.hamming(M, sym=0)\n\n window_axis = lambda sample: sample * window\n\n output = np.apply_along_axis(window_axis, 1, input)\n\n # myplot(output, 'Hamming Wi...
[ "0.6625369", "0.6422833", "0.6392129", "0.5698724", "0.561408", "0.5579971", "0.5555758", "0.549854", "0.54475296", "0.5434125", "0.5420006", "0.5349881", "0.53259605", "0.5276302", "0.5256042", "0.5244462", "0.524319", "0.5211385", "0.51988655", "0.5157169", "0.5148183", "...
0.7515329
0
Copy the basic env file and config file to a tmp_path.
def copy_basic_fixtures(cfngin_fixtures: Path, tmp_path: Path) -> None: copy_fixture( src=cfngin_fixtures / "envs" / "basic.env", dest=tmp_path / "test-us-east-1.env" ) copy_fixture( src=cfngin_fixtures / "configs" / "basic.yml", dest=tmp_path / "basic.yml" )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tmp_configuration_copy(chmod=0o600, include_env=True, include_cmds=True):\n cfg_dict = conf.as_dict(\n display_sensitive=True, raw=True, include_cmds=include_cmds, include_env=include_env\n )\n temp_fd, cfg_path = mkstemp()\n\n with os.fdopen(temp_fd, \"w\") as temp_file:\n # Set the ...
[ "0.68297136", "0.63292444", "0.60993797", "0.60852176", "0.6083526", "0.5991829", "0.59314793", "0.5919459", "0.59138197", "0.58782107", "0.58720523", "0.5813424", "0.578418", "0.5774709", "0.5765266", "0.573933", "0.5734823", "0.5723604", "0.5715323", "0.57145584", "0.571262...
0.6842399
0
Configure a mock action.
def configure_mock_action_instance(mock_action: Mock) -> Mock: mock_instance = Mock(return_value=None) mock_action.return_value = mock_instance mock_instance.execute = Mock() return mock_instance
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_setup(self, mocker):\n # pylama: ignore=W0201\n self.url = '/api/v0/publish'\n self.client = wsgi.application.test_client()\n self._retryable = mocker.patch.object(wsgi, '_retryable')", "def _set_action(self, action):\n raise NotImplementedError()", "def _set_acti...
[ "0.5844788", "0.5802622", "0.5802622", "0.5802622", "0.5802622", "0.5802622", "0.5802622", "0.58012307", "0.5685793", "0.5590533", "0.5575047", "0.55686426", "0.5557722", "0.5527817", "0.5527817", "0.5523214", "0.55023485", "0.54832983", "0.5477297", "0.5472402", "0.54713327"...
0.78626853
0
Test load a CFN template.
def test_load_cfn_template(self, caplog: LogCaptureFixture, tmp_path: Path) -> None: cfn_template = tmp_path / "template.yml" cfn_template.write_text("test_key: !Ref something") cfngin = CFNgin(ctx=self.get_context(), sys_path=tmp_path) caplog.set_level("ERROR", logger="runway.cfngin") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_starting_template(checker):\n contents = labeled.contents(label=\"template\")\n _ = tomllib.loads(contents)", "def load(template):\n with open(template) as f:\n return f.read()", "def test_read_namespaced_template(self):\n pass", "def test_templates(self):\n path = str(...
[ "0.71696216", "0.6851754", "0.66243255", "0.64899427", "0.6404037", "0.63239944", "0.6242543", "0.61893934", "0.6188154", "0.6186724", "0.6116805", "0.6085659", "0.60642785", "0.60526496", "0.6009952", "0.59993297", "0.5983575", "0.59523255", "0.5914063", "0.59060115", "0.590...
0.72675973
0
input iperf client log; output final bw value in kbps
def get_iperf_bw(self, filename): #last line has avg values for line in open(filename, 'r'): pass bw = line.split(',')[-1].strip() return int(bw)/1000 # bw in kbps
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iperf3_bandwidth(self, client, port):\n\n if not client:\n return\n\n iperf_res = None\n\n if self.nma.conf['databases']['tinydb_enable']:\n speed = self.speed_db.all()\n\n measured_bw = {'upload': 0, 'download': 0}\n measured_jitter = {'upload': 0, 'dow...
[ "0.6555676", "0.5904527", "0.5810257", "0.5724674", "0.56913453", "0.5641988", "0.5623032", "0.55325526", "0.5453401", "0.5430281", "0.54273736", "0.54010695", "0.5346723", "0.53466177", "0.5341869", "0.5321154", "0.5310894", "0.52825856", "0.5252985", "0.52407163", "0.523529...
0.6255306
1
Takes visibilities from the last result, if there is one, and associates them with galaxies in this search where fullpath galaxy names match. If the galaxy collection has a different name then an association is not made. e.g.
def associate_hyper_visibilities( self, instance: af.ModelInstance ) -> af.ModelInstance: if self.hyper_galaxy_visibilities_path_dict is not None: for galaxy_path, galaxy in instance.path_instance_tuples_for_class( ag.Galaxy ): if galaxy...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_galaxy_file_mapping(self):\n galaxy_to_refinery_mapping_list = []\n for node in self.tool._get_input_nodes():\n galaxy_to_refinery_mapping_list.append(\n {\n WorkflowTool.GALAXY_DATASET_HISTORY_ID:\n self.FAKE_DATASET_HIS...
[ "0.526028", "0.5191906", "0.5074366", "0.4874031", "0.487003", "0.4859161", "0.48347816", "0.48158997", "0.4813295", "0.47717586", "0.47441304", "0.47319773", "0.47140983", "0.47064015", "0.47041777", "0.46938083", "0.46632653", "0.4642102", "0.4637065", "0.46200624", "0.4604...
0.5272391
0
The Amazon Resource Name (ARN) of the inference scheduler being created.
def inference_scheduler_arn(self) -> Optional[str]: return pulumi.get(self, "inference_scheduler_arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def task_definition_arn(self) -> str:\n return pulumi.get(self, \"task_definition_arn\")", "def invoke_arn(self) -> str:\n return pulumi.get(self, \"invoke_arn\")", "def scheduler(self):\n return self._get_param(\"Scheduler\")", "def arn(self) -> pulumi.Output[str]:\n return pulum...
[ "0.6681855", "0.6431098", "0.6323862", "0.6243085", "0.6243085", "0.6243085", "0.6243085", "0.6243085", "0.6243085", "0.6243085", "0.6243085", "0.6243085", "0.6243085", "0.6243085", "0.6243085", "0.6243085", "0.6243085", "0.6243085", "0.6243085", "0.6243085", "0.6243085", "...
0.85025364
0
Any tags associated with the inference scheduler.
def tags(self) -> Optional[Sequence['outputs.InferenceSchedulerTag']]: return pulumi.get(self, "tags")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags(self) -> Optional[Sequence['outputs.FuotaTaskTag']]:\n return pulumi.get(self, \"tags\")", "def tags():", "def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ResolverRuleTagArgs']]]]:\n return pulumi.get(self, \"tags\")", "def tag_specifications(self) -> pulumi.Output[Optio...
[ "0.6255115", "0.60453326", "0.5894944", "0.5880745", "0.58180666", "0.5779538", "0.5779538", "0.5774154", "0.5734583", "0.57167625", "0.56472594", "0.5631142", "0.5600881", "0.55336976", "0.5526532", "0.5525852", "0.55180365", "0.55180365", "0.5504982", "0.54882246", "0.54819...
0.7780149
0
Resource schema for LookoutEquipment InferenceScheduler.
def get_inference_scheduler(inference_scheduler_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetInferenceSchedulerResult: __args__ = dict() __args__['inferenceSchedulerName'] = inference_scheduler_name opts = pulumi.InvokeOptions.merge(_uti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instance_schema(self):\n raise NotImplementedError", "def get_inference_scheduler_output(inference_scheduler_name: Optional[pulumi.Input[str]] = None,\n opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetInferenceSchedulerResult]:\n ...", "def infer...
[ "0.49787045", "0.4933817", "0.48545372", "0.48421177", "0.48299405", "0.482916", "0.47866398", "0.47530758", "0.47223446", "0.4716753", "0.47071758", "0.47028518", "0.46939448", "0.4683963", "0.46800286", "0.46705967", "0.46699038", "0.46512488", "0.46383926", "0.46343276", "...
0.5230324
0
Method(isInternal, docstring name, args, isConst) > Method Creates a new Method description with the given docstring, name and args, for the language, with special consideration if the method was declared constant and/or internal.
def __init__ (self, isInternal, docstring, name, args, isConst): self.name = name self.isConst = isConst self.isInternal = isInternal if isInternal: if language == 'java': # We have a special Javadoc doclet that understands a non-standard # Javadoc tag, @internal. When ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, exact=None, javadocs=None, modifiers=None,\n return_type=None, name=None, params=None, exceptions=None,\n body=None, indent=4):\n super(JavaMethod, self).__init__(exact=exact, javadocs=javadocs,\n modifiers=modifiers,...
[ "0.6497778", "0.6236314", "0.61402524", "0.583954", "0.575997", "0.572355", "0.5714042", "0.5590507", "0.55856365", "0.557706", "0.5535297", "0.5442776", "0.5375448", "0.53494215", "0.53286654", "0.5320115", "0.5189196", "0.51168287", "0.5111711", "0.5095843", "0.50664973", ...
0.750537
0
CClassDoc(docstring, name) > CClassDoc Creates a new CClassDoc with the given docstring and name.
def __init__ (self, docstring, name, isInternal): # Take out excess leading blank lines. docstring = re.sub('/\*\*(\s+\*)+', r'/** \n *', docstring) self.docstring = docstring self.name = name self.isInternal = isInternal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__ (self, isInternal, docstring, name, args, isConst):\n\n self.name = name\n self.isConst = isConst\n self.isInternal = isInternal\n\n if isInternal:\n if language == 'java':\n # We have a special Javadoc doclet that understands a non-standard\n # Javadoc tag, @in...
[ "0.619224", "0.6169938", "0.61175907", "0.59712034", "0.58990765", "0.5855205", "0.58150935", "0.5814917", "0.57944465", "0.5758752", "0.57489455", "0.5739099", "0.5705725", "0.57024103", "0.5677019", "0.56496066", "0.56422275", "0.5635301", "0.56168365", "0.5609705", "0.5590...
0.65876174
0
getHeadersFromSWIG (filename) > (filename1, filename2, .., filenameN) Reads the list of %include directives from the given SWIG (.i). The list of C/C++ headers (.h) included is returned.
def getHeadersFromSWIG (filename): stream = open(filename) lines = stream.readlines() stream.close() lines = [line for line in lines if line.strip().startswith('%include')] lines = [line for line in lines if line.strip().endswith('.h')] return [line.replace('%include', '').strip() for line in lines]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def headers(path):\n for item in listdir(path):\n if not isfile(path_join(path, item)):\n continue\n\n if not item.endswith(\".h\"):\n continue\n\n yield item", "def _getHeaders(self, headers):\n\n exclude_indeces = [headers.index(x) for x in self.parser.EXCLU...
[ "0.61545664", "0.58099794", "0.58025914", "0.5752392", "0.5665402", "0.56634474", "0.5662152", "0.55984664", "0.5509919", "0.5410221", "0.54100114", "0.5409726", "0.5372038", "0.5359347", "0.53312", "0.5306133", "0.53054756", "0.5291724", "0.526709", "0.5260466", "0.52375114"...
0.8412772
0
sanitizeForHTML (docstring) > docstring Performs HTML transformations on the C++/Doxygen docstring.
def sanitizeForHTML (docstring): # Remove @~, which we use as a hack in Doxygen 1.7-1.8 docstring = docstring.replace(r'@~', '') # First do conditional section inclusion based on the current language. # Our possible conditional elements and their meanings are: # # java: only Java # python: on...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_html(docstring: str) -> str:\n # careful: markdown2 returns a subclass of str with an extra\n # .toc_html attribute. don't further process the result,\n # otherwise this attribute will be lost.\n return pdoc.markdown2.markdown( # type: ignore\n docstring,\n extras=markdown_extensi...
[ "0.6426833", "0.60326535", "0.5976255", "0.5938563", "0.59128064", "0.58987826", "0.5814522", "0.5779177", "0.5754586", "0.57343876", "0.5713335", "0.5580562", "0.55243945", "0.55169314", "0.5503092", "0.5473832", "0.54169965", "0.53993046", "0.53867984", "0.53826857", "0.536...
0.7580223
0
rewriteDocstringForJava (docstring) > docstring Performs some mimimal javadocspecific sanitizations on the C++/Doxygen docstring.
def rewriteDocstringForJava (docstring): # Preliminary: rewrite some of the data type references to equivalent # Java types. (Note: this rewriting affects only the documentation # comments inside classes & methods, not the method signatures.) docstring = docstring.replace(r'const char *', 'String ') docstr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rewriteDocstringForPython (docstring):\n\n # Take out the C++ comment start and end.\n\n docstring = docstring.replace('/**', '').replace('*/', '')\n p = re.compile('^(\\s*)\\*([ \\t]*)', re.MULTILINE)\n docstring = p.sub(r'\\2', docstring)\n\n # Rewrite some of the data type references to equivalent Pyth...
[ "0.747815", "0.7309348", "0.6963823", "0.6864948", "0.65862286", "0.62206876", "0.61575556", "0.6104046", "0.5784846", "0.57597166", "0.5673069", "0.56552356", "0.55879945", "0.55521667", "0.55452293", "0.5543954", "0.54484963", "0.541877", "0.54074806", "0.54048115", "0.5378...
0.8334153
0
rewriteDocstringForCSharp (docstring) > docstring Performs some mimimal Cspecific sanitizations on the C++/Doxygen docstring.
def rewriteDocstringForCSharp (docstring): # Preliminary: rewrite some of the data type references to equivalent # C# types. (Note: this rewriting affects only the documentation # comments inside classes & methods, not the actual method signatures.) docstring = docstring.replace(r'const char *', 'string ') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rewriteDocstringForPython (docstring):\n\n # Take out the C++ comment start and end.\n\n docstring = docstring.replace('/**', '').replace('*/', '')\n p = re.compile('^(\\s*)\\*([ \\t]*)', re.MULTILINE)\n docstring = p.sub(r'\\2', docstring)\n\n # Rewrite some of the data type references to equivalent Pyth...
[ "0.71808505", "0.68017626", "0.65541434", "0.64886326", "0.6318638", "0.6209112", "0.59584296", "0.5808757", "0.5648765", "0.55061555", "0.55013335", "0.5500921", "0.5479426", "0.54745865", "0.5454628", "0.5422479", "0.5376744", "0.5362173", "0.53605646", "0.52951014", "0.527...
0.8077192
0
rewriteDocstringForPython (docstring) > docstring Performs some mimimal Python specific sanitizations on the C++/Doxygen docstring.
def rewriteDocstringForPython (docstring): # Take out the C++ comment start and end. docstring = docstring.replace('/**', '').replace('*/', '') p = re.compile('^(\s*)\*([ \t]*)', re.MULTILINE) docstring = p.sub(r'\2', docstring) # Rewrite some of the data type references to equivalent Python types. # (No...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rewriteDocstringForPerl (docstring):\n\n # Get rid of the /** ... */ and leading *'s.\n docstring = docstring.replace('/**', '').replace('*/', '').replace('*', ' ')\n\n # Get rid of indentation\n p = re.compile('^\\s+(\\S*\\s*)', re.MULTILINE)\n docstring = p.sub(r'\\1', docstring)\n\n # Get rid of parag...
[ "0.77604336", "0.7191963", "0.6982577", "0.6753266", "0.6694719", "0.66529524", "0.6194092", "0.5882187", "0.58658916", "0.5842359", "0.58198625", "0.57814825", "0.576712", "0.5761573", "0.5745436", "0.56991446", "0.5682727", "0.5671348", "0.5625877", "0.5596721", "0.5591246"...
0.77743816
0
rewriteDocstringForPerl (docstring) > docstring Performs some mimimal Perl specific sanitizations on the C++/Doxygen docstring.
def rewriteDocstringForPerl (docstring): # Get rid of the /** ... */ and leading *'s. docstring = docstring.replace('/**', '').replace('*/', '').replace('*', ' ') # Get rid of indentation p = re.compile('^\s+(\S*\s*)', re.MULTILINE) docstring = p.sub(r'\1', docstring) # Get rid of paragraph indentation n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rewriteDocstringForPython (docstring):\n\n # Take out the C++ comment start and end.\n\n docstring = docstring.replace('/**', '').replace('*/', '')\n p = re.compile('^(\\s*)\\*([ \\t]*)', re.MULTILINE)\n docstring = p.sub(r'\\2', docstring)\n\n # Rewrite some of the data type references to equivalent Pyth...
[ "0.7227808", "0.71237713", "0.6798946", "0.659024", "0.65335333", "0.6318953", "0.59368324", "0.57682997", "0.5699257", "0.56764704", "0.56011766", "0.5599349", "0.55534387", "0.54998285", "0.5464047", "0.54257745", "0.53807503", "0.53759325", "0.5368533", "0.5310211", "0.530...
0.8084435
0
processFile (filename, ostream) Reads the the given header file and writes to ostream the necessary SWIG incantation to annotate each method (or function) with a docstring appropriate for the given language.
def processFile (filename, ostream): istream = open(filename) header = CHeader(istream) istream.close() processClassDocs(ostream, header.classDocs) processClasses(ostream, header.classes) processFunctions(ostream, header.functions) ostream.flush()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_headers(src_files, out_root, doc_root):\r\n\r\n if not os.path.exists(out_root):\r\n os.makedirs(out_root)\r\n did_print_heading = False\r\n changed = False\r\n for (name, files) in src_files:\r\n if files.__class__ == str:\r\n src = files\r\n files = (...
[ "0.57407814", "0.56480074", "0.5549426", "0.54974544", "0.546188", "0.5447185", "0.5371064", "0.53704304", "0.53466254", "0.5297166", "0.5248141", "0.52199423", "0.5143805", "0.5138736", "0.51352113", "0.51151234", "0.51053274", "0.50510335", "0.5038631", "0.5025414", "0.4998...
0.7371441
0
Check if file exist on ftp
def file_exist() -> bool: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_exists(host, fqpath):\n command = \"ls -ld %s\" % fqpath\n rcode, _, rerr = g.run(host, command)\n if rcode == 0:\n return True\n\n g.log.error('File does not exist: %s', rerr)\n return False", "def file_exist(file_url):\n try:\n response = requests.head(file_url)\n ...
[ "0.74532896", "0.7116993", "0.7072668", "0.7024049", "0.69683254", "0.69101447", "0.67568624", "0.67281693", "0.67112243", "0.66904974", "0.6664261", "0.6625451", "0.66163576", "0.66149956", "0.6562228", "0.6517187", "0.65167314", "0.65086555", "0.6495261", "0.6487371", "0.64...
0.7150851
1
Plot the background of the regime diagram following Fig. 3 of Belcher et al., 2012
def plot_regime_diagram_background_BG12( ax=None, ): if ax is None: ax = plt.gca() # range of power xpr = [-1, 1] ypr = [-3, 3] # range xlims = [10**i for i in xpr] ylims = [10**i for i in ypr] # size of x and y nx = 500 ny = 500 xx = np.logspace(xpr[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_regime_diagram_background_L19(\n ax=None,\n ):\n if ax is None:\n ax = plt.gca()\n # range of power\n xpr = [-1, 1]\n ypr = [-3, 3]\n # range\n xlims = [10**i for i in xpr]\n ylims = [10**i for i in ypr]\n # background following Fig. 3 of Belcher et al., 2012\n...
[ "0.78450114", "0.64191943", "0.61604625", "0.60969305", "0.60660625", "0.604256", "0.6025813", "0.6011967", "0.6009165", "0.59734505", "0.59395015", "0.5934679", "0.5891089", "0.58235943", "0.5800634", "0.5736051", "0.56845856", "0.5660219", "0.56601167", "0.5652296", "0.5646...
0.7641587
1
Plot the background of the reegime diagram in Li et al., 2019
def plot_regime_diagram_background_L19( ax=None, ): if ax is None: ax = plt.gca() # range of power xpr = [-1, 1] ypr = [-3, 3] # range xlims = [10**i for i in xpr] ylims = [10**i for i in ypr] # background following Fig. 3 of Belcher et al., 2012 nx = 500 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_regime_diagram_background_BG12(\n ax=None,\n ):\n if ax is None:\n ax = plt.gca()\n\n # range of power\n xpr = [-1, 1]\n ypr = [-3, 3]\n # range\n xlims = [10**i for i in xpr]\n ylims = [10**i for i in ypr]\n # size of x and y\n nx = 500\n ny = 500\n x...
[ "0.68946487", "0.63277197", "0.62353915", "0.6234131", "0.6109965", "0.60741985", "0.6040554", "0.60065895", "0.59854", "0.59645796", "0.5899287", "0.5894221", "0.5870427", "0.5811376", "0.57827985", "0.57744455", "0.5766635", "0.5760677", "0.5701814", "0.56806076", "0.566518...
0.7338029
0
Use multiple colors in the ylabel
def set_ylabel_multicolor( ax, strings, colors, anchorpad = 0., **kwargs, ): from matplotlib.offsetbox import AnchoredOffsetbox, TextArea, HPacker, VPacker boxes = [TextArea(text, textprops=dict(color=color, ha='left',va='bottom',rotation=90,**kwargs)) for text,co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ylabel(text, fontsize=FONT_SIZE_M, color='medium ink', ax=None):\n\n if ax is None:\n ax = plt.gca()\n color = decode_color(color)\n return ax.set_ylabel(text, fontsize=fontsize, color=color)", "def setAxisLabelColor(idx=-1, axes='XYZ'):\n dislin.axclrs(idx, 'LABELS', axes)", "def y_formatter_cb(s...
[ "0.68434757", "0.6531821", "0.648328", "0.63563305", "0.62593186", "0.6250489", "0.61543673", "0.61458606", "0.613033", "0.6076741", "0.6069385", "0.6053534", "0.5973648", "0.59678274", "0.595456", "0.59413916", "0.59286755", "0.59199375", "0.589542", "0.5882302", "0.5799317"...
0.68740535
0
Redirect mobile browsers to /mobile and others to /home.
def desktop_or_mobile(request): url_name = 'home.mobile' if request.MOBILE else 'home' return redirect_to(request, url_name, permanent=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home_page():\n return redirect(url_for(_DEFAULT_ROUTE, _external=True))", "def handle_forbidden_for_homepage(self, request):\n\n login_url = request.link(Auth.from_request_path(request), name='login')\n\n if URL(request.url).path() == '/':\n return morepath.redirect(login_url)\n\n return h...
[ "0.5935401", "0.569237", "0.5678945", "0.54713297", "0.5317255", "0.53092873", "0.5183884", "0.5179762", "0.5162804", "0.5144536", "0.51287115", "0.51033294", "0.5092589", "0.5091707", "0.5090215", "0.50564617", "0.50066596", "0.49919397", "0.49904168", "0.49904168", "0.49762...
0.7651228
0
Print all datatypes in the model.
def print_datatypes(model: nn.Module, model_name: str, sep: str = "\n") -> None: log = model_name + "'s datatypes:" + sep log += sep.join(str(t) for t in model_utils.get_model_tensor_datatype(model)) logger.info(log)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_all_types(df):\n \n printmd (\"**Type of every column in the data**\")\n print(\"\")\n print(df.dtypes)", "def show_features_datatypes(df):\n\tfor inum,icol in enumerate(df.columns):\n\t\tprint('Column id: {0:3d} \\tName: {1:12s} \\tDataType: {2}'.format(inum, icol, df[icol].dtypes))", "de...
[ "0.6963292", "0.68407357", "0.66779065", "0.6490826", "0.6259917", "0.62305534", "0.62192714", "0.6191834", "0.61866474", "0.61513305", "0.6119368", "0.61187154", "0.596671", "0.5951513", "0.59312636", "0.5927027", "0.59191304", "0.5916792", "0.59138525", "0.5900104", "0.5892...
0.7769597
0
Load the trained model with the best accuracy.
def _load_best_model(self) -> None: self.trainer.resume()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_best_model(self) -> None:\n self.resume()", "def load_model(self):\n print(\"=============start loading models=============\")\n # load models from basemodel and fine-tune layers\n base_model = DenseNet(reduction=0.5, classes=1000, weights_path=BASE_WEIGHT_DIR)\n base_...
[ "0.7404185", "0.73254263", "0.73121685", "0.7288304", "0.71412724", "0.7104152", "0.6995499", "0.6952824", "0.6943414", "0.6898542", "0.68605185", "0.6857538", "0.6857538", "0.68334395", "0.6812487", "0.67689997", "0.6748135", "0.67441106", "0.673847", "0.67283577", "0.672243...
0.753348
0
Test the basic sleet calculation works.
def test_basic_calculation(self): expected_result = np.array( [ [[0.5, 0.5, 0.0], [0.5, 0.5, 0.4], [0.9, 0.5, 0.4]], [[0.5, 0.5, 0.0], [0.5, 0.5, 0.4], [0.9, 0.5, 0.4]], ], dtype=np.float32, ) result = calculate_sleet_probabilit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_solution(self):\n pass", "def test_secant_system(testFunctions, tol, printFlag): \n pass", "def test_check_cost():", "def test_suite():\n test(sum_of_squares([2, 3, 4]) == 29)\n test(sum_of_squares([ ]) == 0)\n test(sum_of_squares([2, -3, 4]) == 29)", "def test_secant(tes...
[ "0.6918797", "0.6694533", "0.6680471", "0.66613245", "0.63638985", "0.63563555", "0.6344537", "0.63026416", "0.6276182", "0.62295896", "0.6196068", "0.61565745", "0.6153773", "0.6133147", "0.61278003", "0.61272407", "0.61217076", "0.6105129", "0.6069144", "0.6065967", "0.6062...
0.6764586
1
Test the basic sleet calculation works with int8 data.
def test_with_ints(self): rain_prob_cube = self.rain_prob_cube.copy( np.array( [[[1, 0, 0], [0, 1, 1], [0, 0, 1]], [[1, 0, 0], [0, 1, 1], [0, 0, 1]]], dtype=np.int8, ) ) snow_prob_cube = self.snow_prob_cube.copy( np.array( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testGetOne(self):\n data = b'0123456789'\n inst = WireData(data)\n for i, byte in enumerate(bytearray(data)):\n self.assertEqual(inst[i], byte)\n for i in range(-1, len(data) * -1, -1):\n self.assertEqual(inst[i], bytearray(data)[i])", "def test_numbers_round...
[ "0.6081037", "0.58889943", "0.5885166", "0.5839974", "0.57514775", "0.5720629", "0.569138", "0.5677612", "0.56651866", "0.56646323", "0.56623197", "0.5593129", "0.5531913", "0.5520678", "0.5516416", "0.5483794", "0.54793435", "0.54614264", "0.5461213", "0.5455815", "0.5453234...
0.66065717
0
Test that an exception is raised for negative values of probability_of_sleet in the cube.
def test_negative_values(self): rain = self.rain_prob_cube high_prob = self.high_prob_cube msg = "Negative values of sleet probability have been calculated." with self.assertRaisesRegex(ValueError, msg): calculate_sleet_probability(rain, high_prob)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_negativexvalue(self):\n Square.reset_objects()\n with self.assertRaises(ValueError) as e:\n s1 = Square(1, -2)\n self.assertEqual(str(e.exception), \"x must be >= 0\")", "def test_error_when_probabilities_negative(self):\n self._assert_raise_error(\n pro...
[ "0.71974754", "0.696715", "0.68571836", "0.6828799", "0.67281663", "0.6592654", "0.65832895", "0.65570897", "0.65449387", "0.6540636", "0.65332764", "0.6524829", "0.64873177", "0.6453737", "0.6445203", "0.64262295", "0.641401", "0.6391509", "0.63878036", "0.6383371", "0.63822...
0.8309056
0
Test that the name has been changed to sleet_probability
def test_name_of_cube(self): result = calculate_sleet_probability(self.snow_prob_cube, self.rain_prob_cube) name = "probability_of_sleet" self.assertEqual(result.long_name, name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_name_shower(self):\n self.assertTrue(self.ec.name_shower(self.ec.names))", "def test_first_name_sim_nones():\n assert nedss.first_name_similarity_scorer(None, None) == 1", "def testMapTitle(self) -> None:\n def testNewTitle(name:str, solution:list[float]):\n self._nameClass...
[ "0.5866515", "0.58143824", "0.579036", "0.5770138", "0.5757495", "0.57450956", "0.56818116", "0.5674922", "0.5635623", "0.5598415", "0.5589073", "0.5589073", "0.5558196", "0.5556718", "0.55326825", "0.55205125", "0.55205125", "0.55115056", "0.55009645", "0.5485113", "0.547381...
0.64126116
0
Assert an appropriate exception is raised when UMAP is not installed
def test_umap_unavailable(): from yellowbrick.text.umap_vis import UMAP assert UMAP is None with pytest.raises( YellowbrickValueError, match="umap package doesn't seem to be installed" ): UMAPVisualizer()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_not_units(self):\n with self.assertRaises(AssertionError):\n _unit_map(\"WiB\")", "def test_lookup_exception(self):\n self.assertIsInstance(BuildGraph.TransitiveLookupError(), AddressLookupError)", "def test_ip_addr_fails(self, mock_ghn, mock_grnam, mock_pwnam):\n # Should ...
[ "0.6245788", "0.6064388", "0.5946757", "0.59312123", "0.58708656", "0.58636844", "0.5819605", "0.57972056", "0.5749107", "0.5747986", "0.5737053", "0.573631", "0.57356614", "0.57354164", "0.5728028", "0.5724836", "0.5716993", "0.5716395", "0.56910515", "0.56907964", "0.568734...
0.7728401
0
Verify the pipeline creation step for UMAP
def test_make_pipeline(self): umap = UMAPVisualizer() # Should not cause an exception. assert umap.transformer_ is not None assert len(umap.transformer_.steps) == 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert_pipeline_running(self, request):\r\n self.assertTrue(pipeline.running(request))", "def test_build_pipeline_six(self):\n args = \"Test_APP FIVE A B\".split(\" \")\n task_list = build_pipeline(args, False)\n self.assertEqual(1, len(task_list))", "def verify():", "def give...
[ "0.5749236", "0.5503751", "0.543985", "0.5400903", "0.5394067", "0.53700024", "0.5339371", "0.5339371", "0.533054", "0.5328124", "0.5322165", "0.5309885", "0.5309038", "0.5307369", "0.5306281", "0.5295248", "0.52881926", "0.52841985", "0.5281725", "0.52551985", "0.5247717", ...
0.781539
0
Check to make sure sklearn's UMAP doesn't use the size param
def test_sklearn_umap_size(self): # In UMAPVisualizer, the internal sklearn UMAP transform consumes # some but not all kwargs passed in by user. Those not in get_params(), # like size, are passed through to YB's finalize method. This test should # notify us if UMAP's params change on th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_custom_size_umap(self):\n umap = UMAPVisualizer(size=(100, 50))\n\n assert umap._size == (100, 50)", "def test_no_target_umap(self):\n ## produce random data\n X, y = make_classification(\n n_samples=200,\n n_features=100,\n n_informative=20,\...
[ "0.6389161", "0.627912", "0.61946136", "0.5868766", "0.57942975", "0.5700335", "0.567017", "0.5652609", "0.55832916", "0.5576838", "0.55651337", "0.5560315", "0.5551153", "0.5548372", "0.5547365", "0.55050397", "0.5484217", "0.54676306", "0.53981966", "0.5370509", "0.53530574...
0.8239812
0