query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
initializes two dictionaries and poplulates them based on f and u options
def data_from_sc_file(axes, f, uf, true_max): f_combo_dict = collections.defaultdict(list) uf_combo_dict = collections.defaultdict(list) max_x = -10000 max_y = -10000 min_x = 10000 min_y = 10000 for fileType in [uf, f]: for i, item in enumerate(fileType): with open(item)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, uplid, ufid, initial_options=None):\n self._uplid = uplid\n self._ufid = ufid\n if initial_options:\n self.results = copy.deepcopy(initial_options)\n else:\n self.results = {}", "def create_dicts(self):\n \n # remove this string from ...
[ "0.6001208", "0.573551", "0.5644616", "0.55272007", "0.5479403", "0.5444485", "0.53790003", "0.5347614", "0.5330056", "0.5307087", "0.53021747", "0.5300067", "0.52843934", "0.5281411", "0.5255877", "0.52503407", "0.52025026", "0.51949894", "0.51933396", "0.5174729", "0.517343...
0.0
-1
makes pdf of plots one plot for each A[09]_P[09]
def gen_plots(uf_dict, f_dict, min_x, max_x, min_y, max_y, axes, name, histogram, total): with PdfPages(name) as pdf: total_xuf = [] total_yuf = [] total_xf = [] total_yf = [] for entry in uf_dict: print 'Making plot for ' + entry xuf, yuf = zip(*uf_di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def three_PDF_plots(res=200,table_exts=[''],**kwargs):\n\n p = copy.copy(params)\n for key,val in kwargs.items():\n setattr(p,key,val)\n GR = glo.global_results()\n\n fig, axs = plt.subplots(3, sharex='col',\\\n figsize=(8,15),facecolor='w',\\\n ...
[ "0.6920849", "0.6908201", "0.65688", "0.65637594", "0.6536395", "0.6448138", "0.63382226", "0.6292123", "0.62799263", "0.6146602", "0.60787", "0.60698056", "0.6053234", "0.6007661", "0.59270525", "0.5922574", "0.59107745", "0.5870086", "0.5869896", "0.5864736", "0.58501446", ...
0.6363685
6
create axes variable and calls previous functions
def main(x_axis, y_axis, filtered, unfiltered, name, histogram, total, true_max): axes = [x_axis, y_axis, 'description'] uf_dict, f_dict, min_x, max_x, min_y, max_y = data_from_sc_file(axes, filtered, unfiltered, true_max) gen_plots(uf_dict, f_dict, min_x, max_x, min_y, max_y, axes, name, histogram, total)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _InitAxes( self ):\n self.ax = self.fig.add_subplot( 111 )", "def set_axes(self, a):\r\n self.axes = a", "def _set_axes(self):\n self += helper.line(stroke=\"black\", x1=self.__dict__['x'], x2=self.__dict__['x'], y1=0, y2=self.__dict__['y']*2)\n self += helper.line(stroke=\"...
[ "0.72655743", "0.720131", "0.6918141", "0.68311334", "0.679241", "0.6699963", "0.664389", "0.66430366", "0.6629697", "0.64951944", "0.6493893", "0.640936", "0.63702965", "0.6354702", "0.63313186", "0.627019", "0.6240899", "0.61389935", "0.6125609", "0.61182207", "0.61009276",...
0.0
-1
Handle Ctrl+C signal to stop tests prematurely.
def setUp(self): installHandler()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ctrl_c(u_boot_console):\n\n u_boot_console.kill(signal.SIGINT)\n assert(u_boot_console.validate_exited())", "def ctrl_c(signum, frame):\n global shutdown_event\n raise SystemExit('\\nCancelling...')", "def signal_handler(self, signal, frame):\n logger.info('CTRL+C pressed')\n ...
[ "0.78095275", "0.7525858", "0.74915695", "0.7404281", "0.7362504", "0.7248646", "0.72433", "0.7132667", "0.6990136", "0.67509204", "0.6646828", "0.65553516", "0.6463469", "0.6379708", "0.6324134", "0.63064283", "0.6285658", "0.6277192", "0.6226058", "0.621547", "0.6188076", ...
0.0
-1
Loads a data file into a list of `InputBatch`s
def convert_examples_to_features( instruction, example, max_seq_length, tokenizer, cls_token_at_end=False, cls_token="[CLS]", cls_token_segment_id=1, sep_token="[SEP]", sep_token_extra=False, pad_on_left=False, pad_token=0, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def LoadBatch(filename):", "def load_batch(fpath, label_key='labels'):\n f = open(fpath, 'rb')\n if sys.version_info < (3,):\n d = cPickle.load(f)\n else:\n d = cPickle.load(f, encoding='bytes')\n # decode utf8\n d_decoded = {}\n for k, v in d.items():\n d_d...
[ "0.7338933", "0.70891196", "0.6814439", "0.6681668", "0.66754794", "0.66753507", "0.665879", "0.6644234", "0.6614464", "0.6594897", "0.6594897", "0.6543476", "0.65322834", "0.6483556", "0.6473474", "0.64684963", "0.6405395", "0.6392082", "0.63900834", "0.6372264", "0.63704264...
0.0
-1
Logs function calls to stdout
def logged(fn): def wrapped(*args, **kwargs): retval = fn(*args, **kwargs) log_tpl = "%s called with arguments: %s %s \n\tReturning %s" print(log_tpl % (fn.__name__, args, kwargs, retval)) return retval re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_stdout(self, function):\n return function()", "def logger(func):\r\n print(f'Executing {func.__name__}...')\r\n func()\r\n print(f'Ending the {func.__name__}...')", "def generic_log(function_name, args):\n print(\"*\" * 100)\n print(\"function: \" + function_name + \"()\")\n pr...
[ "0.7681532", "0.7327888", "0.7242137", "0.719633", "0.7189399", "0.7079442", "0.70589966", "0.7017228", "0.70044196", "0.69920015", "0.6939595", "0.670841", "0.66977406", "0.66969466", "0.66775495", "0.6635336", "0.66174144", "0.6613684", "0.66000116", "0.65987974", "0.659479...
0.6759477
11
Testing a pylint fix
def increment(x): # pylint: disable=invalid-name return x + 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lint(self):\n raise NotImplementedError()", "def lint():\n load_env_vars('dev')\n from tools.static_code_analysis import Lint\n pylint = Lint()\n score = pylint.run_test()\n pylint.create_badge(score)", "def lint_py_check_per_line(_repo, cf):\n with open(cf.name, \"r\", encoding = ...
[ "0.7094025", "0.6981076", "0.6923023", "0.6833203", "0.6684813", "0.66347957", "0.66322243", "0.65936655", "0.6580039", "0.65503883", "0.64925385", "0.64903754", "0.64746773", "0.64408034", "0.6434844", "0.64206004", "0.64191663", "0.6411161", "0.6410546", "0.6397726", "0.639...
0.0
-1
Rewriting to pass rather than disable pylint
def inc_num(num): return num + 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lint(self):\n raise NotImplementedError()", "def main() -> None:\n\n # Load the declared uses of \"pylint: disable\".\n with open(YAML_ENFORCEMENT_FILE) as f:\n pylint_disable_declarations = yaml.safe_load(f)\n\n processed_pylint_disable_declarations = sorted(\n [\n P...
[ "0.64607275", "0.6234269", "0.59665763", "0.5953127", "0.5942634", "0.5873758", "0.5856863", "0.5841048", "0.58382", "0.5826286", "0.57664883", "0.5751458", "0.5749924", "0.57362413", "0.5734928", "0.57117605", "0.5707746", "0.5617214", "0.56088495", "0.56088495", "0.56088495...
0.0
-1
Return an array of arguments to pass to Project.objects.get_[drafted|proposed|active|completed].
def get_filter_args(self): return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qargs(self):\n return self._qargs", "def args(self) -> List[str]:\n return self.__args", "def flags(self) -> list[\"ProjectCommandFlag\"]:\n _args: list[Arg] = []\n _ctx = self._select(\"flags\", _args)\n _ctx = ProjectCommandFlag(_ctx)._select_multiple(\n _des...
[ "0.6088531", "0.6021877", "0.60157776", "0.60130185", "0.5944683", "0.5944683", "0.5944683", "0.59235483", "0.5874959", "0.58742183", "0.58395976", "0.5834433", "0.57406074", "0.5681138", "0.5674505", "0.56381595", "0.56236935", "0.5571274", "0.5564734", "0.55310535", "0.5531...
0.54357314
46
Log the user in and redirect them to the supplied next page.
def form_valid(self, form): auth_login(self.request, form.get_user()) if self.request.session.get('payment'): Payment.objects.filter(id=self.request.session['payment']).update( user_id=self.request.user.revolvuserprofile, entrant_id=self.request.user.revolvuserprofile) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post(self):\n cont = self.request_string('continue', default=\"/\")\n self.redirect(users.create_login_url(cont))", "def login():\n next_url = request.form.get(\"next\", None)\n\n if current_app.config[\"USE_SAML\"]:\n if next_url:\n return redirect(url_for(\"auth.saml\"...
[ "0.7510935", "0.7494407", "0.7422873", "0.7347584", "0.7279795", "0.72309744", "0.72068155", "0.70927584", "0.70770127", "0.7053909", "0.6991852", "0.6965986", "0.69090754", "0.6893353", "0.6883574", "0.6871099", "0.6870212", "0.6865512", "0.6861322", "0.6859293", "0.6858111"...
0.0
-1
View handle unsubscribe email update
def unsubscribe(request, action): data = {} if action and action.lower() == 'updates': user_profile = request.user.revolvuserprofile user_profile.subscribed_to_repayment_notifications = False user_profile.save() data = {'msg': "You have successfully unsubscribed"} elif action...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unsubscribe(self, request):\n email = self.cleaned_data.get('email')\n subscriber = Subscriber.objects.get(email=email, mailing_list=self.mailing_list)\n subscriber.unsubscribe(request)", "def unsubscribe(request):\n user = None\n if request.user.is_authenticated:\n user = r...
[ "0.78642935", "0.7602228", "0.72869647", "0.7270269", "0.70092016", "0.6895412", "0.68678045", "0.67447734", "0.66946137", "0.6653949", "0.66412675", "0.65861225", "0.65249825", "0.65249825", "0.65249825", "0.65249825", "0.65249825", "0.64214385", "0.62963414", "0.62464833", ...
0.7462505
2
View handle my social connection page
def social_connection(request): backend_map = {'facebook': {'name': 'facebook', 'connected': False, 'dc_url': reverse('social:disconnect', kwargs={'backend': 'facebook'})}, 'google': {'name': 'google-oauth2', 'connected': False, 'dc_ur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebook_connect(request, template='socialregistration/facebook.html',\n extra_context=dict()):\n # for facebook the login is done in JS, so by the time it hits our view here there is no redirect step. Look for the querystring values and use that instead of worrying about session.\n connect_object = g...
[ "0.6379492", "0.62844723", "0.619812", "0.61603844", "0.6102585", "0.6102585", "0.5913831", "0.5828857", "0.5814265", "0.58000904", "0.5722415", "0.5700442", "0.5674649", "0.56717813", "0.56276107", "0.5617314", "0.5616013", "0.56157875", "0.5579581", "0.55725545", "0.5561613...
0.75818175
0
Export financial report Excel from the admin side.
def export_xlsx(request): import openpyxl try: from openpyxl.cell import get_column_letter except ImportError: from openpyxl.utils import get_column_letter from_date = request.GET.get('from_date') to_date = request.GET.get('to_date') search = request.GET.get('search_value') or '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export(self):\n\n rpt_date = datetime.now()\n filename = 'bushfire_report_{}.xls'.format(rpt_date.strftime('%d%b%Y'))\n response = HttpResponse(content_type='application/vnd.ms-excel')\n response['Content-Disposition'] = 'attachment; filename=' + filename\n\n book = Workbook(...
[ "0.74944603", "0.7453464", "0.74425185", "0.74420345", "0.74178195", "0.74111104", "0.73946965", "0.7328942", "0.729512", "0.7261714", "0.6878788", "0.6865229", "0.67143226", "0.66296583", "0.6595517", "0.6570733", "0.6570733", "0.6454679", "0.6449948", "0.64201456", "0.63465...
0.62886864
22
Export financial report CSV from the admin side.
def export_repayment_csv(request): import csv from django.utils.encoding import smart_str # response = HttpResponse(content_type='text/csv') # response['Content-Disposition'] = 'attachment; filename=Repayment_report.csv' from_date = request.GET.get('from_date') to_date = request.GET.get('to_date...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dlCsvReport(self):\r\n requestElems = {'xf': 'csv'}\r\n requestElems.update(self.getReportConfig())\r\n \r\n csvdata = self.sendRequest(self.reportFormURL, self.fileOpener,\r\n requestElems, 'POST').read()\r\n\r\n self.writeExportFile('csv', ...
[ "0.7379921", "0.73224705", "0.7103962", "0.68414193", "0.6666803", "0.66631263", "0.6570242", "0.6528814", "0.65245694", "0.64698297", "0.6458403", "0.64346254", "0.6426312", "0.63806766", "0.6376845", "0.6372116", "0.6359299", "0.6348953", "0.6324408", "0.63181615", "0.63142...
0.65966964
6
Export financial report Excel from the admin side.
def export_repayment_xlsx(request): import openpyxl try: from openpyxl.cell import get_column_letter except ImportError: from openpyxl.utils import get_column_letter from_date = request.GET.get('from_date') to_date = request.GET.get('to_date') search = request.GET.get('search_va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export(self):\n\n rpt_date = datetime.now()\n filename = 'bushfire_report_{}.xls'.format(rpt_date.strftime('%d%b%Y'))\n response = HttpResponse(content_type='application/vnd.ms-excel')\n response['Content-Disposition'] = 'attachment; filename=' + filename\n\n book = Workbook(...
[ "0.7495683", "0.7454717", "0.7443899", "0.7443692", "0.741883", "0.7412455", "0.73961747", "0.7330415", "0.7296676", "0.72633135", "0.6880631", "0.686647", "0.67169285", "0.66300696", "0.6596857", "0.65736467", "0.65736467", "0.64546067", "0.64511687", "0.64222556", "0.634818...
0.60136884
37
Views thats renders news sources to the home page
def homepage(): general_news=get_sources('general') business_news=get_sources('business') sports_news=get_sources('sports') return render_template('sources.html',general=general_news, business=business_news, sports=sports_news)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index():\n entertainment_news = get_sources('entertainment')\n fashion_news = get_sources('fashion')\n title = 'Vnews'\n return render_template('index.html', title=title, fashion=fashion_news, entertainment=entertainment_news)", "def home_page_view(request):\n\n\t# Set the variable jse_articles t...
[ "0.75373346", "0.7415982", "0.7415839", "0.73056453", "0.72505605", "0.7163801", "0.71547955", "0.7132932", "0.7081197", "0.7004573", "0.6854891", "0.6817566", "0.6759091", "0.6715063", "0.67048156", "0.66193694", "0.65456355", "0.6536079", "0.65282154", "0.6526098", "0.65229...
0.8323401
0
View that would return news articles
def NewsArticles(): health_articles = get_articles('health') education_articles = get_articles('technology') return render_template('articles.html',health=health_articles, tech =education_articles)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def news(request):\n articles = News.objects.all()\n return render(request, 'news.html', {\"articles\": articles})", "def newsfeed(request):\n article_list = Article.objects.order_by('published_date')\n context = {'article_list': article_list}\n return render(request, 'sacms/newsfeed.html', contex...
[ "0.8422911", "0.7939385", "0.7903623", "0.7807585", "0.7735028", "0.7547046", "0.7498529", "0.7439669", "0.743487", "0.74265945", "0.7382276", "0.7278104", "0.72469956", "0.7242258", "0.71915346", "0.71299", "0.70865196", "0.707854", "0.70623153", "0.70585346", "0.7006468", ...
0.8291898
1
function that returns the searched articles
def articleSearch(article_name): search_article_name = article_name.split("") search_name_format = "+".join(search_article_name) searched_articles = search_articles(search_name_format) return render_template('search.html',articles = searched_articles)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_news(request):\n try:\n query_string = ''\n if request.GET['search_text'].strip() != '':\n query_string = '&title='+request.GET['search_text']\n response = requests.get(APIURL + '/articles/?format=json'+query_string)\n parser = json.loads(response.content)\n ...
[ "0.7186117", "0.6988905", "0.6960163", "0.6941734", "0.6911264", "0.67364365", "0.67003137", "0.66531736", "0.66310287", "0.65921223", "0.65345204", "0.6490673", "0.637851", "0.63575894", "0.62927914", "0.6282196", "0.62599754", "0.6258574", "0.6252506", "0.6247338", "0.62282...
0.7510673
0
Returns the size or number of bytes of the memory module.
def getSize(self) -> int: return len(self.mem)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSize(self):\n return self.bf.memory()", "def get_total_memory_size(self):\n return self.drt_manager.get_total_memory_size()", "def memsize(self):\n return self.xlist(\"get-memsize\")[1][0] * 1024", "def size_bytes(self):\n size_words = self.size_words()\n if size_words is None:\...
[ "0.7623135", "0.75418335", "0.7527066", "0.7176314", "0.7151762", "0.713853", "0.7124511", "0.7107852", "0.70797235", "0.7068928", "0.7054791", "0.7054791", "0.7054791", "0.7054791", "0.7054791", "0.7054791", "0.7054791", "0.7054791", "0.7054791", "0.7054791", "0.7054791", ...
0.76415974
0
Write the passed bytes to address according to size.
def write(self, address: int, value: bytearray): for i, val in enumerate(value): self.mem[address+i] = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeto_mem(self, addr: int, memaddr: int, buf: bytearray, *,\n addrsize: int = 8) -> None:\n ...", "def writeto_mem(self, addr: int, memaddr: int, buf: bytes, /, *, addrsize: int = 8) -> None:", "def writeto_mem(self, addr: int, memaddr: int, buf: bytes, /, *, addrsize: int = 8) ...
[ "0.71228886", "0.70063406", "0.70063406", "0.67409784", "0.6658709", "0.643035", "0.643035", "0.6348352", "0.61561", "0.6151975", "0.6115056", "0.60978895", "0.5946713", "0.5898338", "0.5872255", "0.5842872", "0.58293104", "0.5800161", "0.5792666", "0.5690916", "0.5675088", ...
0.6465555
5
Read address as byte
def read(self, address: int) -> bytes: return bytearray() + self.mem[address]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_byte(self, addr):\n raise NotImplementedError()", "def getByte(self, addr: ghidra.program.model.address.Address) -> int:\n ...", "def getByte(self, address: ghidra.program.model.address.Address) -> int:\n ...", "def read_io_byte(self, address):\n return self.io.read(self....
[ "0.79302216", "0.7713162", "0.7697147", "0.761327", "0.748351", "0.70024586", "0.6997179", "0.68077", "0.66201454", "0.6584616", "0.6535146", "0.6512226", "0.6469606", "0.64672464", "0.6434506", "0.6429342", "0.6408556", "0.64030266", "0.640144", "0.6396575", "0.63943136", ...
0.71491694
5
Determine if something is a valid date
def valid_date(datestring): try: datetime.strptime(datestring, '%Y-%m-%d') return True except ValueError as e: logger.info('not a valid date: ' + e) return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid_date(date):\n try:\n datetime.strptime(date, '%Y-%m-%d')\n return True\n except (ValueError, TypeError):\n return False", "def valid_date(date):\n try:\n parser.parse(date)\n return True\n except ValueError:\n return False", "def _validate(self...
[ "0.83130693", "0.82549554", "0.8185626", "0.8185626", "0.8160542", "0.8100614", "0.8053466", "0.7889536", "0.7841571", "0.7813753", "0.78100455", "0.7789335", "0.7765769", "0.7746488", "0.7712737", "0.76385385", "0.76328814", "0.75903636", "0.75843525", "0.75314015", "0.75030...
0.7633652
16
Retrieve the total portfolio value on a given data
def portfolio_value_on_date(date): if valid_date(date): try: with open(folder + 'portfolio_balance.json', encoding='utf-8') as read_file: data = json.loads(read_file.read(), object_pairs_hook=OrderedDict) return data[date]['daily...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPortfolioValue(self, start_t, t):\n sum_tmp=0\n for item in self.portfolio.keys():\n if \"DJI_\" in item:\n t_tmp=datetime.strftime(pd.date_range(end=t,periods=1,freq='B')[0],'%Y-%m-%d')\n price=universe.get_price_in_currency(item,t_tmp,'CAD')\n ...
[ "0.7542487", "0.71289545", "0.6666174", "0.6338905", "0.621734", "0.6212121", "0.61951506", "0.61915606", "0.6184136", "0.61756456", "0.61362153", "0.6114087", "0.61008483", "0.61008483", "0.609102", "0.60624725", "0.6047102", "0.60127", "0.60063684", "0.59936106", "0.5979917...
0.0
-1
Retrieve the net gain percentage in total value of portfolio at the end of the backtest
def net_gain_loss_percentage(): try: with open(folder + 'portfolio_balance.json', encoding='utf-8') as read_file: data = json.loads(read_file.read(), object_pairs_hook=OrderedDict) net_gain_loss = data['final_portfolio'] / portfolio_value lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_profit(self):", "def percentageChange(self):\n try:\n curPrice = self.dailyData[-1].currentPrice\n closePrice = self.historicData[-1].closePrice\n except IndexError: # Just return zero when no historic or dailyData is available yet\n return 0.0\n return (curPrice...
[ "0.65579927", "0.61883414", "0.61835027", "0.6162108", "0.6050546", "0.6048661", "0.599609", "0.59796023", "0.59576464", "0.5940993", "0.5906892", "0.59037197", "0.58747596", "0.58715194", "0.58649564", "0.5861075", "0.5859904", "0.5809884", "0.5800906", "0.5783402", "0.57765...
0.67480105
0
Maximum percentage drawdown experienced in the backtest
def max_drawdown(): try: with open(folder + 'portfolio_balance.json', encoding='utf-8') as read_file: data = json.loads(read_file.read(), object_pairs_hook=OrderedDict) def daily_price(): """ Record daily volume in a generator """ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def worst_score(self):\r\n pass", "def max_drawdown(returns):\n\n if returns.size < 1:\n return np.nan\n\n df_cum_rets = cum_returns(returns, starting_value=100)\n cum_max_return = df_cum_rets.cummax()\n\n return df_cum_rets.sub(cum_max_return).div(cum_max_return).min()", "def lifetim...
[ "0.71471363", "0.6878528", "0.6755007", "0.6686075", "0.66709054", "0.66709054", "0.66709054", "0.66709054", "0.6585306", "0.65748173", "0.65741765", "0.6546233", "0.64815825", "0.6458119", "0.64326763", "0.6413706", "0.6378952", "0.6353532", "0.63428664", "0.63250977", "0.63...
0.64852077
12
Record daily volume in a generator
def daily_price(): for item in data: if valid_date(item): yield data[item]['daily_value']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_volume(self):", "def volumes(interval,symbol):\n\ttoday = datetime.utcnow()\n\tcurrent_time = today.time()\n\tdaily_start_time = dtime(3,45)\n\tdaily_end_time = dtime(10,15)\n\tvolume_indicator = {} \n\tstart_timestamp = 0\n\tend_timestamp = 0\n\tif current_time < daily_start_time:\n\t\tyesterday = tod...
[ "0.6108419", "0.59582704", "0.5658194", "0.5645627", "0.55301887", "0.55294275", "0.54440314", "0.5385878", "0.5381963", "0.53462917", "0.5296795", "0.52559656", "0.523488", "0.522695", "0.5211046", "0.5203205", "0.5200433", "0.5195768", "0.51814336", "0.51171595", "0.5100563...
0.53965396
7
Gets the gradient for the consecutive pairs objective
def getGradient_Doc(obj_options, cur_scores,this_example, user_rel=1.0, user_bias = 0.0, user_scale = 1.0): this_gradient = {} bias_grad = 0.0 for doc in this_example.all_items: this_score = this_example.scored_items[doc] cur_score = cur_scores[doc] grad_ch = float(user_rel * (this_score - (user_bias+c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gradient(self):\n result = np.zeros(len(self.variables))\n result[self.bivariateGradInd] = (self.shape-1)/self.variable - self.rate\n return result", "def gradient(self):\n gradients = [func.gradient for func in self.functionals]\n return DiagonalOperator(*gradients)", "d...
[ "0.6889948", "0.68456626", "0.6809678", "0.67814624", "0.672531", "0.6724598", "0.6713636", "0.6646971", "0.6624539", "0.65632606", "0.655551", "0.6551338", "0.6533211", "0.65029466", "0.649771", "0.6495591", "0.64946824", "0.6491155", "0.6485481", "0.64754087", "0.64624405",...
0.0
-1
Convert the image labels to be integers between [0, num classes)
def format_labels(image_labels): label_values = list(set(image_labels.values())) label_values.sort() condensed_image_labels = dict([(image_id, label_values.index(label)) for image_id, label in image_labels.iteritems()]) new_id_to_original_id_map = dict([[label_values....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform_labels(self, labels):\n # Fallback:\n # return self.encoder.transform(labels)\n classes = list(self.classes_())\n return [classes.index(label) for label in labels]", "def transform_labels(self, labels):\n # Fallback:\n # return self.encoder.transform(label...
[ "0.7265107", "0.7265107", "0.72633547", "0.71937054", "0.716316", "0.7154364", "0.6947604", "0.69361037", "0.6895001", "0.6748562", "0.6731259", "0.67226684", "0.6717959", "0.67108655", "0.6666883", "0.66271544", "0.6606274", "0.6592733", "0.65913206", "0.65601665", "0.655136...
0.0
-1
Load in a dataset (that has been saved in the CUB Format) and store in a format to be written to the tfrecords file
def format_dataset(dataset_path, image_path_prefix): image_paths = load_image_paths(dataset_path, image_path_prefix) image_sizes = load_image_sizes(dataset_path) image_bboxes = load_bounding_box_annotations(dataset_path) image_parts = load_part_annotations(dataset_path) image_labels, new_label_to_o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_tfrecord():\n\n record_path = os.path.join(FLAGS.dataset_dir, \"records\")\n if not os.path.isdir(record_path):\n os.makedirs(record_path)\n\n ####### Path Definition #######\n img_path = \"data/traindata/ccmpred/\"\n ss3_path = \"data/traindata/ss3/\"\n pdb_path = \"data/traind...
[ "0.66734815", "0.6458906", "0.6237943", "0.6151958", "0.6116849", "0.60779786", "0.60597104", "0.6046932", "0.60377866", "0.60268456", "0.5986152", "0.59571415", "0.59430844", "0.59256035", "0.5916913", "0.59109616", "0.59093267", "0.5883883", "0.58668107", "0.58454967", "0.5...
0.0
-1
Take `images_per_class` from the train dataset and create a validation set.
def create_validation_split(train_data, fraction_per_class=0.1, shuffle=True): subset_train_data = [] val_data = [] val_label_counts = {} class_labels = [i['class']['label'] for i in train_data] images_per_class = Counter(class_labels) val_images_per_class = {label: 0 for label in images_per_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_train_validation_test_sets(path_to_json, out_dir, path_to_images,\n train_fraction=0.6,\n validation_fraction=0.2,\n test_fraction=0.2,\n do_print=False):\n assert...
[ "0.70862657", "0.68533665", "0.6514909", "0.65044284", "0.6460029", "0.6398828", "0.6384702", "0.6384702", "0.63737273", "0.6358643", "0.63232464", "0.63111234", "0.63051456", "0.62699944", "0.62421966", "0.622691", "0.6216368", "0.61776704", "0.61775273", "0.6167151", "0.616...
0.7281224
0
Use the card to travel
def use(self): if self.price_of_trip == 0: print("Sorry your card has been used") else: self.price_of_trip -= self.price_of_trip print("Done")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cards_to_deal(cls, context={}):\n\t\traise NotImplementedError()", "def cards_to_deal(cls, context={}):\n\t\treturn cls.CARDS_TO_DEAL", "def newDeal(self):\n self.card1 = Card(1, 'c')\n self.card2 = Card(4, 'd')\n self.stateLabel[\"text\"] = \"\"\n self.refreshImages()", "def ...
[ "0.61471826", "0.60606945", "0.6010794", "0.600401", "0.59552276", "0.59204626", "0.5904978", "0.5810135", "0.5780846", "0.57157326", "0.56504244", "0.5592343", "0.5565727", "0.5562599", "0.5559056", "0.553126", "0.5528969", "0.5528765", "0.5516053", "0.54957", "0.5476267", ...
0.5975769
4
Checks the expiration date of the card
def check(self): validity_year = int(self.date[0:4]) validity_month = int(self.date[5:7]) validity_day = int(self.date[8:10]) if datetime.today().year > validity_year: self.flag = False elif datetime.today().year == validity_year: if datetime.today().month...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_content_expiry_date(self):\n\n if self.expire_date < datetime.now():\n self.state = 'disabled'", "def is_expired(self):\n return self.expiration_date <= self._now()", "def clean_expiration_date(self):\n expiration_date = self.cleaned_data['expiration_date']\n if...
[ "0.7288992", "0.71461076", "0.71064097", "0.6798181", "0.6778251", "0.6727741", "0.67241824", "0.6718817", "0.6605499", "0.65725285", "0.6560101", "0.6555981", "0.6535536", "0.6485778", "0.6470241", "0.647006", "0.64549625", "0.64269155", "0.64255065", "0.64250386", "0.641015...
0.6089248
43
Use the card to travel
def use(self): if self.flag: if self.credit < self.price_of_trip: return "Your credit is not enough, please increase your credit" else: self.credit -= self.price_of_trip return "Done" else: return "Sorry, your card has e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cards_to_deal(cls, context={}):\n\t\traise NotImplementedError()", "def cards_to_deal(cls, context={}):\n\t\treturn cls.CARDS_TO_DEAL", "def newDeal(self):\n self.card1 = Card(1, 'c')\n self.card2 = Card(4, 'd')\n self.stateLabel[\"text\"] = \"\"\n self.refreshImages()", "def ...
[ "0.61515087", "0.6064475", "0.6013859", "0.60078645", "0.5976684", "0.5960304", "0.59248465", "0.5909907", "0.5814345", "0.57855487", "0.5720087", "0.56538814", "0.5597273", "0.5570732", "0.5567159", "0.556194", "0.55343103", "0.5533306", "0.5532688", "0.5520193", "0.54938835...
0.50508463
97
Increases the credit of the card
def charge(self, other): if self.flag: self.credit += other return "{} Tomans has been added to your card credit and now the credit of your card is {} Tomans".format( other, self.credit) else: return "Sorry, your card has expired."
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def charge(self, other):\n self.credit += other\n print(\"{} Tomans has been added to your card credit and now the credit of your card is {} Tomans\".format(other,\n self.credit))", "def ...
[ "0.7035775", "0.6908582", "0.6584606", "0.65523666", "0.6435155", "0.63019294", "0.6200756", "0.61545724", "0.6137888", "0.6132437", "0.61214805", "0.6077653", "0.60740805", "0.6062242", "0.60452324", "0.60144305", "0.6013067", "0.5982951", "0.59137625", "0.5900946", "0.58880...
0.69234675
1
Increases the credit of the card
def charge(self, other): self.credit += other print("{} Tomans has been added to your card credit and now the credit of your card is {} Tomans".format(other, self.credit))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def charge(self, other):\n if self.flag:\n self.credit += other\n return \"{} Tomans has been added to your card credit and now the credit of your card is {} Tomans\".format(\n other, self.credit)\n else:\n return \"Sorry, your card has expired.\"", "...
[ "0.69234675", "0.6908582", "0.6584606", "0.65523666", "0.6435155", "0.63019294", "0.6200756", "0.61545724", "0.6137888", "0.6132437", "0.61214805", "0.6077653", "0.60740805", "0.6062242", "0.60452324", "0.60144305", "0.6013067", "0.5982951", "0.59137625", "0.5900946", "0.5888...
0.7035775
0
Use the card to travel
def use(self): if self.credit < self.price_of_trip: print("Your credit is not enough, please increase your credit") else: self.credit -= self.price_of_trip print("Done")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cards_to_deal(cls, context={}):\n\t\traise NotImplementedError()", "def cards_to_deal(cls, context={}):\n\t\treturn cls.CARDS_TO_DEAL", "def newDeal(self):\n self.card1 = Card(1, 'c')\n self.card2 = Card(4, 'd')\n self.stateLabel[\"text\"] = \"\"\n self.refreshImages()", "def ...
[ "0.61471826", "0.60606945", "0.6010794", "0.600401", "0.5975769", "0.59552276", "0.59204626", "0.5904978", "0.5810135", "0.5780846", "0.57157326", "0.56504244", "0.5592343", "0.5565727", "0.5562599", "0.5559056", "0.553126", "0.5528969", "0.5528765", "0.5516053", "0.54957", ...
0.5069107
87
Do something with emails messages in the folder. For the sake of this example, print some headers.
def process_mailbox(M): rv, data = M.search(None, config.email['search']) if rv != 'OK': logger.info("No messages found!") return for num in data[0].split(): rv, data = M.fetch(num, '(RFC822)') if rv != 'OK': logger.error("ERROR getting message", num) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def userMessages(self, path, pattern):\n log(logging.DEBUG, \"Look for files at \" + path + \" with pattern \" + pattern)\n # if folder does not exist\n if not os.path.exists(path):\n return []\n # result message list\n message_list = []\n # retrieve file names\...
[ "0.6262737", "0.592273", "0.5789566", "0.5778403", "0.56953245", "0.5670702", "0.5649647", "0.5602646", "0.55907255", "0.55646175", "0.55509037", "0.5533535", "0.5529366", "0.5527925", "0.54993945", "0.54717857", "0.5467351", "0.5438078", "0.54356897", "0.54338974", "0.542173...
0.612142
1
Parses one line of data in file
def vasp_file_lines(vasp_file, line_continuation=False): vasp_file_stripped = (line.rstrip("\n") for line in vasp_file) line_nr = 0 for line in vasp_file_stripped: line_nr += 1 while line_continuation and line.endswith("\\"): line = line[:-1] + next(vasp_file_stripped) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_line(self, line):\n success = self.parser.handle_line(line)\n if success:\n self.data.update()\n else:\n self.bot.log(\"didn't handle line: '{}'\".format(line))", "def parse_line(self, line):\n raise NotImplementedError", "def parse(cls, line):\r\n ...
[ "0.69548947", "0.6905197", "0.68284994", "0.67083246", "0.6672508", "0.6318916", "0.6266864", "0.62573653", "0.61784714", "0.6168965", "0.61672115", "0.6151331", "0.6151331", "0.6129076", "0.61048865", "0.608141", "0.6077094", "0.60615253", "0.6015411", "0.6006627", "0.600310...
0.0
-1
execute a request in the MeteoData database
def request_meteodata(request: str): import MySQLdb import platform if platform.system() == "Windows": MySQLParams = { 'host' : "192.168.5.1", 'user' : "MeteoRobot", 'passwd': "robot", 'db' : "MeteoData" } else: MySQLParams = {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _run_query(self):", "def post(self, request):\n return self.execute_query()", "def execute():", "def query(self):\n pass", "def query(self):", "def query(self, **kwargs):", "def execute_query(self, *args, **kwargs):", "def do_request(ean):\n url = 'INSERT URL OF EAN DATABASE HERE...
[ "0.6710959", "0.6582548", "0.65078473", "0.64458466", "0.64313316", "0.6429438", "0.6367198", "0.63005024", "0.62007064", "0.6155797", "0.6154988", "0.6154988", "0.6154988", "0.6154988", "0.610536", "0.6070094", "0.6034479", "0.6034479", "0.6034479", "0.6034479", "0.5996396",...
0.64356184
4
get the database data on the last period
def get_data(last): Table = "ServerRoom" filter = "" if last == "lastone": data = request_meteodata("SELECT * from `ServerRoom` ORDER BY id DESC LIMIT 1 ") if len(data) == 0: return [SensorData(datetime.datetime.now(), 0, 0)] res = [] for d in data: re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(self, date_time):\n id_columns = ','.join([col for col in self.table_primary_keys if col not in ['EFFECTIVEDATE', 'VERSIONNO']])\n return_columns = ','.join(self.table_columns)\n with self.con:\n cur = self.con.cursor()\n cur.execute(\"DROP TABLE IF EXISTS te...
[ "0.66456187", "0.66129696", "0.65368724", "0.6481614", "0.6442516", "0.63483286", "0.63411635", "0.6279019", "0.62594837", "0.62587345", "0.62279445", "0.6175993", "0.616382", "0.6153795", "0.6136147", "0.61287874", "0.606596", "0.6036077", "0.6036077", "0.60130566", "0.59977...
0.67294055
0
smooth the curve plotted by data
def smooth_data(data, smooth_width): out = [] for i, dat in enumerate(data): low = max(0, i - smooth_width) high = min((len(data) - 1), low + 2 * smooth_width) n = 0 s_temperature = 0 s_humidity = 0 for d in data[low:high]: n += 1 s_tempera...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def curve(self, data):\n x, y, y_smoothed = data\n\n curve_keys = ['color', 'linestyle', 'alpha', 'label']\n curve_config = self.config.filter(curve_keys, prefix='curve_')\n\n curves = self.ax.plot(x, y, **curve_config)\n\n if y_smoothed is not None:\n smoothed_color =...
[ "0.7313142", "0.69398075", "0.6655488", "0.65327597", "0.63836634", "0.6375429", "0.63086617", "0.62467694", "0.6144106", "0.614324", "0.6140233", "0.6114227", "0.6062881", "0.60028267", "0.5995925", "0.5986899", "0.59816587", "0.596397", "0.5943088", "0.59140795", "0.5877314...
0.0
-1
limit the amount of dat
def resample_data(data, entity_number): if len(data) <= entity_number: # not that many entity: nothing to do return data interval = int(len(data)/entity_number + 1) out = [] for i, dat in enumerate(data): if i % interval == 0: out.append(dat) return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_data(self, limit: int):", "def limit(requestContext, seriesList, n):\n return seriesList[0:n]", "def limit(self, limit):\n raise NotImplementedError(\"This should have been implemented.\")", "def set_result_limit(self, data):\n self.add_payload('resultLimit', data)\n self._resu...
[ "0.7557813", "0.6726402", "0.6408106", "0.6167715", "0.6139555", "0.6135192", "0.60850734", "0.60437834", "0.5982196", "0.59246933", "0.58739847", "0.58739847", "0.58739847", "0.58472615", "0.5828757", "0.5822307", "0.5805646", "0.57973814", "0.57706034", "0.57259965", "0.572...
0.0
-1
linking credentials to devices
def main(): django.setup() devices = NetworkDevice.objects.all() creds = Credentials.objects.all() std_creds = creds[0] arista_creds = creds[1] for a_device in devices: if 'pynet-sw' in a_device.device_name: a_device.credentials = arista_creds else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_credentials():", "def __init__(self, user, password, device):\n self.user = user\n self.password = password\n self.device = device\n self.session = requests.session()\n\n # Hard-coded auth seed\n seed = \"oZ7QE6LcLJp6fiWzdqZc\"\n\n # Get auth tokens\n ...
[ "0.6891069", "0.66422874", "0.6202527", "0.618294", "0.60527545", "0.59875023", "0.59675354", "0.5958228", "0.59270346", "0.5901835", "0.58968145", "0.5871899", "0.58570117", "0.58440846", "0.57795954", "0.5754165", "0.5754151", "0.57462233", "0.57175606", "0.5711669", "0.570...
0.6287373
2
builds a new TensorRT engine and saves it.
def get_engine(onnx_file_path, engine_file_path=""): def build_engine(): """Takes an ONNX file and creates a TensorRT engine to run inference with""" with trt.Builder(TRT_LOGGER) as builder, builder.create_network() as network, trt.OnnxParser(network, TRT_LOGGER) as parser: builder.max_w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n parser = argparse.ArgumentParser()\n parser.add_argument(\n '-v', '--verbose', action='store_true',\n help='enable verbose output (for debugging)')\n parser.add_argument(\n '-c', '--category_num', type=int,\n help='number of object categories (obsolete)')\n par...
[ "0.67849517", "0.67617816", "0.6362268", "0.6190603", "0.6143309", "0.611478", "0.60166395", "0.5841629", "0.584155", "0.5791088", "0.57723004", "0.5698285", "0.56744826", "0.5669226", "0.562782", "0.5618678", "0.5618636", "0.56058806", "0.5582209", "0.557229", "0.5519337", ...
0.6606123
2
Takes an ONNX file and creates a TensorRT engine to run inference with
def build_engine(): with trt.Builder(TRT_LOGGER) as builder, builder.create_network() as network, trt.OnnxParser(network, TRT_LOGGER) as parser: builder.max_workspace_size = 1 << 30 # 1GB builder.max_batch_size = 1 builder.fp16_mode = mode_fp16 # builder.int8_mode...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_engine(onnx_file_path, engine_file_path=\"\"):\n def build_engine():\n \"\"\"Takes an ONNX file and creates a TensorRT engine to run inference with\"\"\"\n with trt.Builder(TRT_LOGGER) as builder, builder.create_network() as network, trt.OnnxParser(network, TRT_LOGGER) as parser:\n ...
[ "0.8031374", "0.7831621", "0.7261751", "0.71062404", "0.7080748", "0.6950961", "0.6506367", "0.64999366", "0.6419242", "0.62066257", "0.6092014", "0.5996473", "0.5924226", "0.59063506", "0.5795536", "0.5773174", "0.576665", "0.576164", "0.5756392", "0.56630164", "0.56498075",...
0.6927419
6
Create a TensorRT engine for ONNXbased YOLOv3608 and run inference.
def main(): get_engine(onnx_file_path, engine_file_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n parser = argparse.ArgumentParser()\n parser.add_argument(\n '-v', '--verbose', action='store_true',\n help='enable verbose output (for debugging)')\n parser.add_argument(\n '-c', '--category_num', type=int,\n help='number of object categories (obsolete)')\n par...
[ "0.7478217", "0.7159704", "0.69230884", "0.673915", "0.6581398", "0.6492738", "0.64049906", "0.62891704", "0.62095827", "0.6123898", "0.6090181", "0.5939654", "0.59038186", "0.58348006", "0.58271414", "0.5808182", "0.5780439", "0.5771464", "0.57401353", "0.5676676", "0.564849...
0.65200746
5
define tthe index function
def index(): if request.method == "POST": # fetch the data forms userDetails = request.form firstname = userDetails["firstname"] secondname = userDetails["secondname"] foodtoeat = userDetails["foodtoeat"] cur = mysql.connection.cursor() cur.execute("INSERT INT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index(self, x) -> int:\n pass", "def index(self) -> int:", "def index(self, sub) -> int:\n pass", "def get_index(self, *args, **dargs):\n pass", "def __index__(self, *args, **kwargs): # real signature unknown\n pass", "def __index__(self, *args, **kwargs): # real signature unknown...
[ "0.7466199", "0.74422425", "0.7333869", "0.7228359", "0.7033737", "0.7033737", "0.7033737", "0.7033737", "0.7033737", "0.7033737", "0.7033737", "0.7033737", "0.7033737", "0.7033737", "0.7033737", "0.7033737", "0.7033737", "0.7033737", "0.7033737", "0.7033737", "0.69949394", ...
0.0
-1
define the users function endpoint
def users(): cur = mysql.connection.cursor() resultValue = cur.execute("SELECT * FROM users") if resultValue > 0: userDetails = cur.fetchall() return render_template("users.html", userDetails=userDetails)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user():", "def user(request, user_id):\n raise NotImplementedError", "def user():\n pass", "def user(self):", "def standard_student_endpoint(\nendpoint_name,\nrequired_values,\nmethod,\nrequest,\nfunctor): \n try:\n\n # verify method\n if request.method != method:\n ...
[ "0.6563187", "0.6428347", "0.63846487", "0.6112737", "0.60384446", "0.5966322", "0.58806527", "0.58600867", "0.58498687", "0.5792116", "0.5780776", "0.57783985", "0.5732193", "0.56492466", "0.56412804", "0.5636319", "0.56155", "0.56095773", "0.5585259", "0.5577989", "0.555347...
0.0
-1
TODO you should not call pickle directly, rather load the file into memory and submit the string to our function as defined in SemDiscUtils.py This is for test purposes only. The createCypherQueries(edgeList) will be called from SemDiscUtils.py which in turn returns a string of cypher queries
def readPickleTest(): """ edgeList1 covers this typr of question - "What is the email id of the reader who reads Batman Hush" """ edgeList1 = {'_node1': {'Name': 'Batman Hush'}, '_node2': {'Name': 'Email_Id'}, '_attrs': {'Name': 'reads1'}} """ edgeList2 covers this t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_schema(self, cypher_file):\n if len(self.graph.nodes) > 0:\n msg = \"Cypher file specified but the graph is not empty. Aborting.\"\n raise ValueError(msg)\n cyp = open(cypher_file, 'r').read()\n self.graph.run(cyp)", "def _load_data(self):\n with open...
[ "0.5628399", "0.55132294", "0.5401076", "0.5240609", "0.52057654", "0.5204791", "0.5188983", "0.5111568", "0.5094759", "0.509352", "0.5072148", "0.5065339", "0.5056807", "0.5046235", "0.50047314", "0.49945167", "0.4992883", "0.4991696", "0.49686602", "0.4957791", "0.4950982",...
0.52642983
3
Extracts all types of products.
def task101(self): self.ex(""" SELECT a.account_id AS account_id, pt.name AS product_type, p.name AS product_name FROM account AS a RIGHT JOIN product AS p ON a.product_cd = p.product_cd INNER JOIN product_type AS pt ON p.product_type_cd = pt.product_type_cd ORDER BY account_id"""...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def product_types(self):\n return self._product_types", "def build_from_products(self, products, strict_products=False):\n p_it1, p_it2 = itertools.tee(products)\n\n # 1. Collect all possible type variants. Those are already in dict as meaningful existing types\n # matches as singleto...
[ "0.688441", "0.6707839", "0.66763467", "0.66484165", "0.65424275", "0.63596106", "0.6307602", "0.6232655", "0.6128479", "0.6125535", "0.611501", "0.607919", "0.60508305", "0.60443723", "0.60259634", "0.5969954", "0.595593", "0.5940951", "0.59290147", "0.5912695", "0.5870188",...
0.0
-1
Extracts the same as in previous task but with using another join.
def task102(self): self.ex(""" SELECT a.account_id AS account_id, p.name AS product_name FROM product AS p LEFT JOIN account AS a ON p.product_cd = a.product_cd ORDER BY account_id;""")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def task_6a(bt_df, rt_df, fg_df):\n return rt_df.join(bt_df, \"business_id\")", "def sreduce(self, key, values, task):\n list1 = []\n found_file1 = False\n found_file2 = False\n outer_file1 = (self.outer=='left' or self.outer=='both')\n outer_file2 = (self.outer=='right' or ...
[ "0.61531043", "0.58204305", "0.5783453", "0.57746005", "0.56748706", "0.5667666", "0.5576084", "0.5489864", "0.5406213", "0.5405063", "0.5404756", "0.5399502", "0.53982985", "0.5359601", "0.53233653", "0.532238", "0.52769905", "0.52728516", "0.5264537", "0.52625185", "0.50796...
0.0
-1
Extracts customer id, product cd and individual or business customer name.
def task103(self): self.ex(""" SELECT a.cust_id AS customer_id, a.product_cd AS product_cd, concat(i.fname, ' ', i.lname) AS individual_customer_name, b.name AS buisness_customer_name FROM account AS a LEFT JOIN individual AS i ON a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parseCustomerInfo(self, response):\n parser = make_parser()\n prid = ParseCustomerInfo(self.ns_customer_ent)\n parser.setContentHandler(prid)\n parser.setFeature(handler.feature_namespaces, 1)\n parser.parse(StringIO.StringIO(response))\n rval = prid.getCustomerInfo()\...
[ "0.6429363", "0.62600464", "0.6159198", "0.59811467", "0.59774333", "0.5960992", "0.58831596", "0.58690196", "0.57828003", "0.57575685", "0.5747817", "0.5723138", "0.571669", "0.57056504", "0.567384", "0.567384", "0.56684715", "0.5660668", "0.5639587", "0.5607663", "0.5591218...
0.0
-1
Generates a set {1, 2, 3, ..., 100} using cross join.
def task104(self): self.ex(""" SELECT ones.num + tens.num + 1 AS num FROM (SELECT 1 num UNION SELECT 2 num UNION SELECT 3 num UNION SELECT 4 num UNION SELECT 5 num UNION SELECT 6 num UNION SELECT 7 num UNION SELECT 8 num U...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def crossProduct( set1, set2):\n set1 = asarray( set1, _aformat(set1))\n set1 = reshape( set1, (-1, 3))\n set2 = asarray( set2, _aformat(set2))\n set2 = reshape( set2, (-1, 3))\n return cross( set1, set2 )", "def cross(a, b):\n return [s + t for s in a for t in b]", "def crossProduct4( set1, ...
[ "0.629022", "0.59710526", "0.5969501", "0.5826466", "0.57101566", "0.5662604", "0.5608783", "0.5603874", "0.55706143", "0.5552218", "0.5518106", "0.5492818", "0.54695106", "0.5463395", "0.5386702", "0.53221595", "0.5283778", "0.5282577", "0.5275992", "0.5268177", "0.5267994",...
0.5506208
11
Renvoyer le contexte d'affichage du template
def get_context(self): from scoop.editorial.models import Excerpt identifier = self.value # Vérifier que l'image existe try: excerpt = Excerpt.objects.get(name=identifier) except Excerpt.DoesNotExist: excerpt = None return {'excerpt': excerpt}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_context(self):\n pass", "def render( context, *args, **kwargs ):", "def context(self) -> CONTEXT:", "def get_context_data(self, *args, **kwargs):\n \n context = super().get_context_data(**kwargs) \n \n # Daten an Backend senden.\n serverAntwort = datenAnBacken...
[ "0.68644655", "0.6756904", "0.6574579", "0.6454107", "0.6420507", "0.6420507", "0.6420507", "0.6420507", "0.6420507", "0.6420507", "0.63759226", "0.635479", "0.63513696", "0.62880975", "0.62545836", "0.62505394", "0.6236864", "0.61906767", "0.6188532", "0.61761904", "0.617282...
0.57212514
75
Renvoyer le chemin du template d'affichage
def get_template_name(self): base = super(ExcerptInline, self).get_template_name()[0] path = "editorial/%s" % base return path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Template(Fenetre_largeur,Fenetre_hauteur):\r\n li= Select_ligne(\"Nombre de lignes: \",Fenetre_largeur,Fenetre_hauteur)\r\n nom=\"Template\"\r\n fich=\"Template\"\r\n version=0\r\n while Path(\"stages/\"+fich+\".txt\").is_file() == True:\r\n version+=1\r\n fich=nom+str(version)\r\n...
[ "0.6391667", "0.6280781", "0.6133017", "0.60334784", "0.5994215", "0.5985893", "0.59521735", "0.5860931", "0.58261806", "0.5753843", "0.57103914", "0.56576955", "0.5623416", "0.5602326", "0.55988973", "0.5591306", "0.5576477", "0.55760825", "0.5563358", "0.55583566", "0.55569...
0.0
-1
Attempt to solve the problem...
def problem_52(): for number in xrange(1, 123456789): sorted_num = ''.join(sorted(str(number))) if len([value for value in xrange(2, 7) if ''.join(sorted(str((value * number)))) == sorted_num]) == 5: return number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solve(self):", "def solve(self):\n ...", "def solve(self):\n pass", "def solve(self):\n pass", "def problem_298():\n pass", "def solution(s):", "def solve(self):\n raise NotImplementedError(\"This method needs to be implemented.\")", "def exercise_b2_106():\r\n p...
[ "0.7730392", "0.75410193", "0.7307096", "0.7307096", "0.70221806", "0.6674096", "0.6412365", "0.6365025", "0.6341411", "0.6314549", "0.6289291", "0.6278359", "0.62118804", "0.616413", "0.61261684", "0.612467", "0.6122574", "0.611507", "0.60840267", "0.60686123", "0.6067139", ...
0.0
-1
Initialize melon order attributes.
def __init__(self, species, qty, order_type, tax): self.species = species self.qty = qty self.shipped = False self.order_type = order_type self.tax = tax
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self._order_list = []", "def __init__(self, *args, **kwargs):\n self._orders = None\n super().__init__(*args, **kwargs)", "def __init__(self):\n self.orders = {}", "def initialize(self):\n self.muondEdx = []\n self.muondNdx = []\n self.mu...
[ "0.6708174", "0.662357", "0.65577954", "0.6431638", "0.6348181", "0.63275594", "0.61550564", "0.6137234", "0.6117595", "0.6087555", "0.6017396", "0.5979355", "0.59747034", "0.59043527", "0.5896923", "0.588143", "0.5866107", "0.5865401", "0.5861821", "0.5853268", "0.5838351", ...
0.55245596
56
Calculate price, including tax.
def get_total(self): base_price = 5 if self.species == "Christmas melon": base_price = base_price * 1.5 total = (1 + self.tax) * self.qty * base_price if self.order_type == "international" and self.qty>10: total += 3 return total
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_price(self):\n\n cargo_weight = self.cargo.weight\n tax_rate = Decimal(0.18)\n\n untaxed_total = Decimal(cargo_weight) * Decimal(self.price_per_unit_weight)\n\n total_price = (untaxed_total * tax_rate) + untaxed_total\n\n return total_price", "def calculate_total_...
[ "0.77471083", "0.763973", "0.7035976", "0.6969799", "0.6841924", "0.6784742", "0.6764191", "0.6706861", "0.6700252", "0.66708153", "0.6621594", "0.6610665", "0.6608133", "0.6603047", "0.66002357", "0.659871", "0.6580778", "0.6561078", "0.655176", "0.65358806", "0.65206593", ...
0.6566887
17
Record the fact than an order has been shipped.
def mark_shipped(self): self.shipped = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mark_shipped(self):\n\n self.shipped = True\n # moved from DomesticMelonOrder", "def action_ship_create(self):\n res = super(SaleOrder, self).action_ship_create()\n for sale_order in self:\n if sale_order.invoiced:\n sale_order.picking_ids.write({'x_is_pa...
[ "0.73743325", "0.651005", "0.62031525", "0.6028882", "0.5751929", "0.5704558", "0.5638554", "0.56364393", "0.563631", "0.5605549", "0.5555828", "0.554914", "0.54631656", "0.54229397", "0.5364435", "0.53255874", "0.5321269", "0.5310086", "0.53069085", "0.5291062", "0.52815145"...
0.6596032
8
Lists genomes present in selected reference databases (ensembl, phytozome, refseq)
def list_reference_genomes(self, params, context=None): return self._client.call_method( 'ReferenceDataManager.list_reference_genomes', [params], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_genomes():\n genome_list = yaml.load(open(script_dir + \"/utils/genomes.yaml\",\"r\"))\n print(\"\")\n print(\"\\033[1m%-30s\\t%-30s\\033[0m\" % (\"Reference Name\", \"Location\"))\n for k,v in genome_list.items():\n print(\"%-30s\\t%-30s\" % (k, v))\n print(\"\")", "def load_refge...
[ "0.72052234", "0.6681579", "0.65693146", "0.6492775", "0.6463348", "0.64268726", "0.60308814", "0.59824353", "0.5938681", "0.5849946", "0.5805375", "0.5713854", "0.5712395", "0.5681238", "0.56560886", "0.56373715", "0.5536142", "0.5521856", "0.5500701", "0.5477903", "0.546699...
0.7649514
0
Lists genomes loaded into KBase from selected reference sources (ensembl, phytozome, refseq)
def list_loaded_genomes(self, params, context=None): return self._client.call_method( 'ReferenceDataManager.list_loaded_genomes', [params], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_reference_genomes(self, params, context=None):\n return self._client.call_method(\n 'ReferenceDataManager.list_reference_genomes',\n [params], self._service_ver, context)", "def list_genomes():\n genome_list = yaml.load(open(script_dir + \"/utils/genomes.yaml\",\"r\"))\n ...
[ "0.7379342", "0.6987427", "0.6913297", "0.68597585", "0.6310048", "0.62025315", "0.6013068", "0.6001058", "0.5765435", "0.5684875", "0.5651807", "0.5620138", "0.5543948", "0.54923236", "0.54544765", "0.5449119", "0.540734", "0.5391047", "0.5391047", "0.5370194", "0.5368396", ...
0.6714616
4
Lists genomes indexed in SOLR
def list_solr_genomes(self, params, context=None): return self._client.call_method( 'ReferenceDataManager.list_solr_genomes', [params], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_genomes_in_solr(self, params, context=None):\n return self._client.call_method(\n 'ReferenceDataManager.index_genomes_in_solr',\n [params], self._service_ver, context)", "def list_genomes():\n genome_list = yaml.load(open(script_dir + \"/utils/genomes.yaml\",\"r\"))\n ...
[ "0.6830845", "0.65424156", "0.60664916", "0.606512", "0.60501164", "0.58641434", "0.5826815", "0.5826815", "0.58215374", "0.58214", "0.57476413", "0.56885886", "0.568328", "0.5639871", "0.5536571", "0.54968697", "0.549255", "0.5483767", "0.545044", "0.5449478", "0.5432765", ...
0.6747959
1
Index specified genomes in SOLR from KBase workspace
def index_genomes_in_solr(self, params, context=None): return self._client.call_method( 'ReferenceDataManager.index_genomes_in_solr', [params], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_index():\n for site in get_sites():\n text = read_site(site)\n while text == False:\n text = read_site(site) # keep attempting to read until successful\n index_site(site, text)", "def build_index():\n for site in get_sites():\n text = read_site(site)\n ...
[ "0.6265813", "0.6265813", "0.6139362", "0.61347544", "0.6121336", "0.6064185", "0.60180306", "0.5999387", "0.5975277", "0.596837", "0.5914677", "0.5905104", "0.5903449", "0.58965874", "0.5834955", "0.58183974", "0.5724497", "0.57202715", "0.5687734", "0.5682116", "0.5679189",...
0.72983086
0
Lists taxa loaded into KBase for a given workspace
def list_loaded_taxa(self, params, context=None): return self._client.call_method( 'ReferenceDataManager.list_loaded_taxa', [params], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_solr_taxa(self, params, context=None):\n return self._client.call_method(\n 'ReferenceDataManager.list_solr_taxa',\n [params], self._service_ver, context)", "def get_taxonomy_results(verbose=False):\n if verbose:\n pprint(taxonomy_results)\n return taxonomy_resu...
[ "0.5854104", "0.5630706", "0.5523026", "0.5359899", "0.5303297", "0.52729064", "0.5272661", "0.52519345", "0.52469647", "0.5236552", "0.52222174", "0.5208818", "0.5188408", "0.5179878", "0.51560634", "0.5141281", "0.51307255", "0.5109015", "0.51087105", "0.5079378", "0.503626...
0.5544073
2
Lists taxa indexed in SOLR
def list_solr_taxa(self, params, context=None): return self._client.call_method( 'ReferenceDataManager.list_solr_taxa', [params], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_taxa_in_solr(self, params, context=None):\n return self._client.call_method(\n 'ReferenceDataManager.index_taxa_in_solr',\n [params], self._service_ver, context)", "def index_terms(self):\n [[self.set_postings(term, id) for term in NLProcessor.process(doc)] for id, d...
[ "0.6509729", "0.6357868", "0.62683314", "0.60519195", "0.5974132", "0.5915071", "0.591159", "0.5772863", "0.5712139", "0.56651306", "0.5592324", "0.556518", "0.55518234", "0.554848", "0.55198777", "0.55016136", "0.54998034", "0.5499193", "0.5472442", "0.5457834", "0.543946", ...
0.6861536
0
Loads specified taxa into KBase workspace and indexes in SOLR on demand
def load_taxa(self, params, context=None): return self._client.call_method( 'ReferenceDataManager.load_taxa', [params], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_taxa_in_solr(self, params, context=None):\n return self._client.call_method(\n 'ReferenceDataManager.index_taxa_in_solr',\n [params], self._service_ver, context)", "def load_tas_lookup():\n logger.info('Loading TAS')\n load_tas()", "def list_solr_taxa(self, params, ...
[ "0.6498204", "0.5891013", "0.57397306", "0.5648463", "0.55865234", "0.54691", "0.525066", "0.52232873", "0.5206583", "0.5182996", "0.5106142", "0.5098938", "0.50653493", "0.5048019", "0.501896", "0.50153154", "0.50048745", "0.49948743", "0.49922657", "0.49847096", "0.49776623...
0.6328378
1
Index specified taxa in SOLR from KBase workspace
def index_taxa_in_solr(self, params, context=None): return self._client.call_method( 'ReferenceDataManager.index_taxa_in_solr', [params], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reindex_subcomponent_taxa():\n pass", "def index_siteroot(context):\n portal = getSite()\n portal.reindexObject()", "def index_fobj(fobj):\n doc = fileobject_to_dict(fobj)\n if doc is not None:\n #print doc\n SOLR.add(doc)\n else:\n pass", "def search(terms):\n ...
[ "0.6358017", "0.6279029", "0.6045649", "0.5848363", "0.5843543", "0.579074", "0.57332224", "0.5654865", "0.5615632", "0.55991507", "0.5592114", "0.5569687", "0.556002", "0.54822147", "0.54292715", "0.5420272", "0.536411", "0.5358117", "0.5352065", "0.5331198", "0.5322685", ...
0.71712476
0
Loads specified genomes into KBase workspace and indexes in SOLR on demand
def load_genomes(self, params, context=None): return self._client.call_method( 'ReferenceDataManager.load_genomes', [params], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_genomes_in_solr(self, params, context=None):\n return self._client.call_method(\n 'ReferenceDataManager.index_genomes_in_solr',\n [params], self._service_ver, context)", "def load_refgenomes(self, params, context=None):\n return self._client.call_method(\n ...
[ "0.6626249", "0.60957223", "0.60924673", "0.60247797", "0.59353334", "0.5797676", "0.56434065", "0.55891055", "0.5580639", "0.5580639", "0.55667996", "0.5544847", "0.5504955", "0.54986495", "0.5482139", "0.5481608", "0.545993", "0.54438055", "0.5425209", "0.53886104", "0.5387...
0.66491956
0
Loads NCBI RefSeq genomes into KBase workspace with or without SOLR indexing
def load_refgenomes(self, params, context=None): return self._client.call_method( 'ReferenceDataManager.load_refgenomes', [params], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_genomes(self, params, context=None):\n return self._client.call_method(\n 'ReferenceDataManager.load_genomes',\n [params], self._service_ver, context)", "def index_gcis(gcis_url, es_url, index, alias, dump_dir):\n conn = get_es_conn(es_url, index, alias)\n refList = ge...
[ "0.6063036", "0.5841345", "0.58144426", "0.5734855", "0.54659575", "0.5403981", "0.5402181", "0.5332247", "0.5307035", "0.5291659", "0.5222015", "0.5217969", "0.5209188", "0.5207623", "0.5170394", "0.51697093", "0.5144679", "0.5139786", "0.51380336", "0.51057464", "0.50968397...
0.61688125
0
Updates the loaded genomes in KBase for the specified source databases
def update_loaded_genomes(self, params, context=None): return self._client.call_method( 'ReferenceDataManager.update_loaded_genomes', [params], self._service_ver, context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gbf_pub_update():\r\n LOG.info(\"Start: Update datasets in RLIDGeo warehouse.\")\r\n month_stamps = [\r\n datetime.date.today().strftime(\"%Y_%m\"),\r\n (\r\n datetime.date.today().replace(day=1)\r\n - datetime.timedelta(days=1)\r\n ).strftime(\"%Y_%m\"),\r\n ...
[ "0.59036124", "0.57262635", "0.5505454", "0.5471788", "0.5454221", "0.53054446", "0.5293783", "0.52560055", "0.51999205", "0.5191524", "0.51797444", "0.51658607", "0.515508", "0.5140619", "0.5138678", "0.5115914", "0.5101359", "0.5012815", "0.49987558", "0.49879158", "0.49756...
0.6448755
0
Tests start of authentication (incoming auth req) and receiving auth response.
def test_entire_flow(self, context): responses.add(responses.POST, "https://graph.facebook.com/v2.5/oauth/access_token", body=json.dumps({"access_token": "qwerty", "token_type": "bearer", "e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_authentication_required(self):\n self.auth.validate_token_request(self.request)\n self.mock_validator.client_authentication_required.assert_called_once_with(self.request)", "def test_authflow(self):\n response = self.client.post('/auth/signup/', {\n ...
[ "0.69330895", "0.6900142", "0.6677716", "0.6526462", "0.6523139", "0.6522858", "0.65209544", "0.65144455", "0.6500772", "0.6499939", "0.6493193", "0.64686173", "0.63993716", "0.6384796", "0.6383272", "0.6357318", "0.63483596", "0.6325268", "0.63151926", "0.6314975", "0.630289...
0.5979925
68
Apply a mapping of namevaluepairs to a template.
def apply(self, mapping): mapping = {name: self.str(value, tolerant=self.tolerant) for name, value in mapping.items() if value is not None or self.tolerant} if self.tolerant: return self.template.safe_substitute(mapping) return self.template.su...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map_template(template: dict, input_: dict) -> None:\n for k, v in template.items():\n config_val = input_.get(k)\n\n if isinstance(v, dict) and k != 'NullHandler':\n map_template(v, input_)\n\n if config_val:\n template[k] = config_val.upper() if k == 'level' else ...
[ "0.6347333", "0.6122666", "0.5724706", "0.55872214", "0.5524677", "0.5517751", "0.549768", "0.5487899", "0.53845775", "0.530882", "0.5244786", "0.52417064", "0.5239383", "0.5211652", "0.5148122", "0.51388305", "0.51228106", "0.51005185", "0.5080841", "0.5061058", "0.50332797"...
0.6634928
0
Test case for create_nas_share_by_nas
def test_create_nas_share_by_nas(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_test_nas_share(self):\n pass", "def test_show_nas_share_by_nas(self):\n pass", "def test_test_result_nas_share(self):\n pass", "def test_update_nas_share_by_nas(self):\n pass", "def test_index_nas_shares_by_nas(self):\n pass", "def test_show_nas_share(self):\n ...
[ "0.87092817", "0.8525568", "0.8476073", "0.8432505", "0.811207", "0.8111951", "0.79742056", "0.7967393", "0.7931208", "0.7835071", "0.7778211", "0.7645673", "0.7638049", "0.75317097", "0.7366997", "0.7344222", "0.7333957", "0.7017911", "0.6752469", "0.66835386", "0.65300155",...
0.95934916
0
Test case for destroy_nas_share
def test_destroy_nas_share(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_destroy_nas_share_by_nas(self):\n pass", "def test_destroy_nas_share_by_pool(self):\n pass", "def test_test_nas_share(self):\n pass", "def test_create_nas_share_by_nas(self):\n pass", "def test_update_nas_share(self):\n pass", "def test_update_nas_share_by_nas(...
[ "0.9389554", "0.8792524", "0.76362747", "0.75515646", "0.7297889", "0.7273542", "0.7258762", "0.7239002", "0.71278036", "0.71259034", "0.71167296", "0.7033105", "0.6955307", "0.6797405", "0.67879903", "0.67438823", "0.6702528", "0.669155", "0.6557659", "0.6553244", "0.6280817...
0.95384085
0
Test case for destroy_nas_share_by_nas
def test_destroy_nas_share_by_nas(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_destroy_nas_share(self):\n pass", "def test_destroy_nas_share_by_pool(self):\n pass", "def test_create_nas_share_by_nas(self):\n pass", "def test_test_nas_share(self):\n pass", "def test_update_nas_share_by_nas(self):\n pass", "def test_dashboards_v2_delete_sha...
[ "0.9417224", "0.8834285", "0.7744262", "0.758655", "0.75549483", "0.7326083", "0.7300899", "0.7292167", "0.72800195", "0.71851236", "0.71172214", "0.70820516", "0.69532496", "0.690352", "0.67362416", "0.6723919", "0.67131734", "0.67035735", "0.6650557", "0.6545809", "0.640851...
0.9542495
0
Test case for destroy_nas_share_by_pool
def test_destroy_nas_share_by_pool(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_destroy_nas_share(self):\n pass", "def test_destroy_nas_share_by_nas(self):\n pass", "def test_update_nas_share_by_pool(self):\n pass", "def test_show_nas_share_by_pool(self):\n pass", "def test_mount_status_nas_share_by_pool(self):\n pass", "def test_test_nas_...
[ "0.87827253", "0.87459147", "0.7914171", "0.76246", "0.75718844", "0.7118149", "0.7093812", "0.708217", "0.68163544", "0.6781625", "0.67124707", "0.66831726", "0.6607139", "0.65762645", "0.6470638", "0.64604396", "0.6458959", "0.64408374", "0.6336116", "0.62824637", "0.624967...
0.9630253
0
Test case for index_nas_shares
def test_index_nas_shares(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_index_nas_shares_by_nas(self):\n pass", "def test_index_nas_shares_by_pool(self):\n pass", "def test_test_result_nas_share(self):\n pass", "def test_create_nas_share_by_nas(self):\n pass", "def test_show_nas_share_by_nas(self):\n pass", "def test_test_nas_share...
[ "0.9408521", "0.8480369", "0.7828743", "0.77089137", "0.76689196", "0.7658634", "0.7639658", "0.7374224", "0.73682296", "0.71836025", "0.70449203", "0.69670975", "0.677711", "0.675877", "0.670886", "0.6664895", "0.6502741", "0.6135646", "0.60962385", "0.5956307", "0.5926037",...
0.93974316
1
Test case for index_nas_shares_by_nas
def test_index_nas_shares_by_nas(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_index_nas_shares(self):\n pass", "def test_index_nas_shares_by_pool(self):\n pass", "def test_create_nas_share_by_nas(self):\n pass", "def test_show_nas_share_by_nas(self):\n pass", "def test_update_nas_share_by_nas(self):\n pass", "def test_test_result_nas_sha...
[ "0.91021", "0.85721266", "0.7744076", "0.7691755", "0.7667866", "0.766065", "0.7447273", "0.71588457", "0.7131582", "0.70934236", "0.7039851", "0.6991671", "0.67114615", "0.65478647", "0.6541465", "0.63235873", "0.62416536", "0.6241281", "0.60786486", "0.607121", "0.5646648",...
0.95178986
0
Test case for index_nas_shares_by_pool
def test_index_nas_shares_by_pool(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_index_nas_shares_by_nas(self):\n pass", "def test_index_nas_shares(self):\n pass", "def test_show_nas_share_by_pool(self):\n pass", "def test_update_nas_share_by_pool(self):\n pass", "def test_mount_status_nas_share_by_pool(self):\n pass", "def test_destroy_nas...
[ "0.84751886", "0.8132446", "0.80617833", "0.80411273", "0.74651307", "0.707621", "0.6979327", "0.68828", "0.6788973", "0.6761283", "0.6760841", "0.6421319", "0.6332053", "0.6197863", "0.601423", "0.59699273", "0.578675", "0.5785175", "0.5685915", "0.56655633", "0.5647678", ...
0.9608631
0
Test case for mount_status_nas_share
def test_mount_status_nas_share(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_mount_status_nas_share_by_nas(self):\n pass", "def test_mount_status_nas_share_by_pool(self):\n pass", "def test_test_nas_share(self):\n pass", "def test_show_nas_share(self):\n pass", "def test_test_result_nas_share(self):\n pass", "def test_show_nas_share_by_...
[ "0.9339884", "0.86251044", "0.7847734", "0.77573013", "0.7702383", "0.75028086", "0.7351555", "0.73283494", "0.7200713", "0.69585705", "0.68284434", "0.68067634", "0.6647951", "0.65063286", "0.6441414", "0.6424272", "0.6211882", "0.59345067", "0.5869384", "0.5858923", "0.5856...
0.94080406
0
Test case for mount_status_nas_share_by_nas
def test_mount_status_nas_share_by_nas(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_mount_status_nas_share(self):\n pass", "def test_mount_status_nas_share_by_pool(self):\n pass", "def test_test_nas_share(self):\n pass", "def test_show_nas_share_by_nas(self):\n pass", "def test_test_result_nas_share(self):\n pass", "def test_show_nas_share(sel...
[ "0.9223469", "0.8762923", "0.8201179", "0.81886965", "0.8143352", "0.8128441", "0.7978966", "0.7839654", "0.7666999", "0.7568727", "0.72756267", "0.72689754", "0.718854", "0.70526314", "0.70140773", "0.6603129", "0.6567966", "0.64892024", "0.62469953", "0.6022947", "0.5962818...
0.94895434
0
Test case for mount_status_nas_share_by_pool
def test_mount_status_nas_share_by_pool(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_mount_status_nas_share_by_nas(self):\n pass", "def test_show_nas_share_by_pool(self):\n pass", "def test_mount_status_nas_share(self):\n pass", "def test_update_nas_share_by_pool(self):\n pass", "def test_index_nas_shares_by_pool(self):\n pass", "def test_destr...
[ "0.85433346", "0.84213686", "0.8400509", "0.81344026", "0.76243025", "0.75721836", "0.7563653", "0.7507107", "0.7303699", "0.72915065", "0.7267744", "0.6979238", "0.69425905", "0.66233706", "0.6539754", "0.6512662", "0.63295096", "0.631071", "0.6240405", "0.61339945", "0.6002...
0.9529886
0
Test case for show_nas_share
def test_show_nas_share(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_show_nas_share_by_nas(self):\n pass", "def test_show_nas_share_by_pool(self):\n pass", "def test_test_result_nas_share(self):\n pass", "def test_test_nas_share(self):\n pass", "def test_create_nas_share_by_nas(self):\n pass", "def test_mount_status_nas_share_by...
[ "0.9303875", "0.85624135", "0.84599024", "0.8404861", "0.8154698", "0.80376023", "0.7731183", "0.75881684", "0.74865353", "0.74834853", "0.73471814", "0.7230511", "0.7218506", "0.7175002", "0.6964021", "0.66760683", "0.64869213", "0.6413816", "0.6327175", "0.6229252", "0.6192...
0.94518304
0
Test case for show_nas_share_by_nas
def test_show_nas_share_by_nas(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_show_nas_share(self):\n pass", "def test_show_nas_share_by_pool(self):\n pass", "def test_test_result_nas_share(self):\n pass", "def test_create_nas_share_by_nas(self):\n pass", "def test_test_nas_share(self):\n pass", "def test_mount_status_nas_share_by_nas(se...
[ "0.9115962", "0.8672631", "0.83680737", "0.83024406", "0.81769687", "0.7848348", "0.7818351", "0.7816461", "0.74024487", "0.737524", "0.73302305", "0.72978896", "0.7211219", "0.71098095", "0.6981241", "0.69681144", "0.66827077", "0.6341193", "0.633762", "0.631773", "0.6093063...
0.94415253
0
Test case for show_nas_share_by_pool
def test_show_nas_share_by_pool(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_show_nas_share_by_nas(self):\n pass", "def test_mount_status_nas_share_by_pool(self):\n pass", "def test_show_nas_share(self):\n pass", "def test_update_nas_share_by_pool(self):\n pass", "def test_index_nas_shares_by_pool(self):\n pass", "def test_destroy_nas_s...
[ "0.838688", "0.82205", "0.82004833", "0.81190896", "0.8064236", "0.76910836", "0.7640043", "0.7465289", "0.7388782", "0.7017174", "0.6918035", "0.68557525", "0.6643733", "0.65673494", "0.65449506", "0.652991", "0.6403193", "0.6230861", "0.61453474", "0.5764217", "0.56883866",...
0.9581628
0
Test case for test_nas_share
def test_test_nas_share(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_test_result_nas_share(self):\n pass", "def test_create_nas_share_by_nas(self):\n pass", "def test_show_nas_share(self):\n pass", "def test_show_nas_share_by_nas(self):\n pass", "def test_mount_status_nas_share_by_nas(self):\n pass", "def test_update_nas_share_b...
[ "0.93370456", "0.93197984", "0.9103192", "0.90562487", "0.887185", "0.87910056", "0.876829", "0.85913104", "0.8434087", "0.8427662", "0.8250264", "0.8236316", "0.8182762", "0.81814677", "0.81565195", "0.76892686", "0.7569769", "0.73527855", "0.69095725", "0.68744296", "0.6867...
0.9618386
0
Test case for test_result_nas_share
def test_test_result_nas_share(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_test_nas_share(self):\n pass", "def test_show_nas_share_by_nas(self):\n pass", "def test_show_nas_share(self):\n pass", "def test_create_nas_share_by_nas(self):\n pass", "def test_mount_status_nas_share_by_nas(self):\n pass", "def test_update_nas_share_by_nas(s...
[ "0.87205005", "0.8468603", "0.84374386", "0.84110034", "0.81306785", "0.80009717", "0.79637134", "0.795491", "0.7851127", "0.7800759", "0.77983934", "0.7788885", "0.75479025", "0.73223394", "0.73046243", "0.72120965", "0.6860787", "0.6632178", "0.64907837", "0.6297669", "0.62...
0.957169
0
Test case for update_nas_share
def test_update_nas_share(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_nas_share_by_nas(self):\n pass", "def test_update_nas_share_by_pool(self):\n pass", "def test_test_nas_share(self):\n pass", "def test_create_nas_share_by_nas(self):\n pass", "def test_test_result_nas_share(self):\n pass", "def test_destroy_nas_share_by_...
[ "0.94022584", "0.8667093", "0.82092834", "0.8034242", "0.79996043", "0.77217346", "0.76853245", "0.76770335", "0.7653774", "0.7644211", "0.7401856", "0.7383217", "0.73583794", "0.718956", "0.7073682", "0.69962233", "0.6705802", "0.658027", "0.64904004", "0.6448504", "0.636371...
0.9529857
0
Test case for update_nas_share_by_nas
def test_update_nas_share_by_nas(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_nas_share(self):\n pass", "def test_update_nas_share_by_pool(self):\n pass", "def test_create_nas_share_by_nas(self):\n pass", "def test_test_nas_share(self):\n pass", "def test_test_result_nas_share(self):\n pass", "def test_index_nas_shares_by_nas(self...
[ "0.92568874", "0.868185", "0.8243654", "0.8035217", "0.79071957", "0.7904033", "0.7861192", "0.7808969", "0.75646436", "0.75128955", "0.749248", "0.7425515", "0.71185464", "0.7093589", "0.70677394", "0.70360464", "0.6987904", "0.6672082", "0.6565424", "0.65342563", "0.6251355...
0.95343274
0
Test case for update_nas_share_by_pool
def test_update_nas_share_by_pool(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_nas_share_by_nas(self):\n pass", "def test_update_nas_share(self):\n pass", "def test_index_nas_shares_by_pool(self):\n pass", "def test_show_nas_share_by_pool(self):\n pass", "def test_destroy_nas_share_by_pool(self):\n pass", "def test_mount_status_nas...
[ "0.8472414", "0.83880275", "0.82184863", "0.8195564", "0.81169623", "0.80361986", "0.74852073", "0.74578637", "0.7348537", "0.7070271", "0.7059347", "0.70257837", "0.6890321", "0.68191767", "0.68162924", "0.6728974", "0.6446969", "0.6397714", "0.6347254", "0.616938", "0.60866...
0.96373075
0
For evaluating vhb we extract labels for vhb instead of sao2
def preprocess_vhb(batch, nr_samples=None, snr=None, magnification=None, bands_to_sortout=None): X, y = preprocess2(batch, nr_samples, snr, magnification, bands_to_sortout) return X, y["vhb"].values
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def labels_b_v(self):\n return self._labels_b_v", "def labels_b_v_all(self):\n return self._labels_b_v_all", "def _make_vbenf_label(chain_parts):\n\n # toy label for development: run simple and dijet independently.\n # simple makes Et cuts on two jets. Independently (sharing possible)\n # of jet...
[ "0.67501473", "0.6568259", "0.6314509", "0.62052965", "0.59897834", "0.59897834", "0.5946092", "0.59377635", "0.58991873", "0.5809695", "0.5798361", "0.5797039", "0.57916325", "0.57773614", "0.57766294", "0.5765343", "0.57443243", "0.57443243", "0.5742162", "0.57366246", "0.5...
0.5693916
25
Our standard method to evaluate the data. It will fill a DataFrame df which saves the errors for each evaluated setup
def evaluate_data(df_train, w_train, df_test, w_test, evaluation_setups=None, preprocessing=None): if evaluation_setups is None: evaluation_setups = standard_evaluation_setups if preprocessing is None: preprocessing = preprocess if ("weights" in df_train) and df_train["weig...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate_df(self, df):\n ## Check invariant; model inputs must be subset of df columns\n var_diff = set(self.var).difference(set(df.columns))\n if len(var_diff) != 0:\n raise ValueError(\n \"Model inputs not a subset of given columns;\\n\"\n + \"mis...
[ "0.65705955", "0.61609674", "0.61391914", "0.61067426", "0.60614115", "0.60162455", "0.60003746", "0.59906065", "0.59698033", "0.5951393", "0.5951041", "0.5949095", "0.5932602", "0.5929731", "0.59138703", "0.58937687", "0.5890896", "0.5842125", "0.58418965", "0.582007", "0.58...
0.7769943
0
Returns roman equivalent to an arabic
def to_roman(an_arabic): result = "" for level, symbol in [(1000,"M"), (900,"CM"), (500,"D"), (400,"CD"), (100,"C"), (90,"XC"), (50,"L"), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arabic_to_roman_replace(test_word):\n arabic_word = test_word\n\n \"\"\"\n testWord = \"دَرْس\"\n print(testWord, sep=\" \")\n \"\"\"\n\n # converting into roman characters\n print()\n roman_characters = \"\"\n for letter in arabic_word:\n #print(letter)\n if letter in ...
[ "0.779442", "0.74281687", "0.7296251", "0.7257054", "0.67278147", "0.67266434", "0.6697449", "0.6658061", "0.66198784", "0.65114695", "0.6464905", "0.64380807", "0.639312", "0.63480544", "0.6299207", "0.62872094", "0.62515366", "0.62329185", "0.6206833", "0.62048817", "0.6163...
0.8043565
0
Creates some B words for every pair, with the following constraints
def create_B_words(path_to_pairs, path_to_librispeech_text, path_to_phonemes, path_save, freq_sim, len_sim, edit_sim): for i in range(len(path_to_pairs)): pairs = [] dic_cl_eq =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_pairs_of_words(word_list):\n def pair_words(word_list, i, j, connector):\n return word_list[i] + connector + word_list[j]\n pairs = []\n n = len(word_list)\n for i in range(n-1):\n for j in range(i+1, n):\n pairs.append(pair_words(word_list, i, j, ' '))\n ...
[ "0.6379959", "0.6285808", "0.6200078", "0.61135346", "0.6090671", "0.6088368", "0.6056059", "0.60499376", "0.6005667", "0.5910683", "0.59056056", "0.590162", "0.5847353", "0.58410585", "0.5787261", "0.5781655", "0.5771898", "0.57667893", "0.57136333", "0.5706423", "0.56973606...
0.6256183
2
We call new, when we want to apply the pipeline to something unrelated
def new(self): self.interesting_mask = None self.previous_lines = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_own_pipeline() -> Pipeline:\n nn_pipeline = None\n\n nn_pipeline = Pipeline([\n ('vect', CountVectorizer()),\n ('tfidf', TfidfTransformer()),\n ('clf', MLPClassifier()) \n ])\n \n return nn_pipeline", "def pipeline(self) -> Pipeline:\n if self._to_pipeline is None...
[ "0.6718284", "0.6605446", "0.64793473", "0.63921684", "0.6358232", "0.63030565", "0.6258657", "0.62482244", "0.6221897", "0.62135386", "0.62027407", "0.61847925", "0.6180768", "0.61727595", "0.61503994", "0.6145696", "0.61375916", "0.6078692", "0.6036495", "0.60242677", "0.60...
0.0
-1
Helper method that calls ``tokenizer.batch_encode`` if possible, and if not, falls back to calling ``tokenizer.encode`` for each input.
def tokenize(self, inputs): if hasattr(self.tokenizer, "batch_encode"): return self.tokenizer.batch_encode(inputs) else: return [self.tokenizer.encode(x) for x in inputs]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode(batch, tokenizer):\n return tokenizer.batch_encode_plus(batch['sentence'], padding='max_length')", "def _batch_encode(self, text: List[str]) -> List[List[str]]:\n token_ids: List[List[int]] = self.bert_model.batch_encode([t.strip() for t in text])\n tokens_ids_str: List[List[str]] = [...
[ "0.7312299", "0.62325454", "0.62248653", "0.62079835", "0.61744493", "0.60844237", "0.60585696", "0.5993476", "0.59909976", "0.59304714", "0.5894535", "0.5890986", "0.5826842", "0.5709089", "0.57029486", "0.5684606", "0.56439316", "0.56439316", "0.55587023", "0.55517715", "0....
0.71921265
1
parses the command line args for options/parameters
def parse_options(self): parser = argparse.ArgumentParser() parser.add_argument( "-i", "--input_csv", type=str, help="Input CSV path(s)", required=True, nargs="+", ) parser.add_argument( "-o", "--output_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_arguments(args):", "def parse_command_line():\r\n\r\n parser = argparse.ArgumentParser(description='User args')\r\n parser.add_argument(\"--action\", choices=['train', 'predict', 'demo', 'test'], required=True, help=\"Choose action.\")\r\n parser.add_argument(\"--model\", choices=['vgg', 'unet...
[ "0.80873114", "0.7811934", "0.77932054", "0.77715003", "0.77535075", "0.76733726", "0.7649569", "0.7641751", "0.7631887", "0.75946397", "0.7534283", "0.7530792", "0.7495356", "0.7490417", "0.7487174", "0.74836403", "0.7483276", "0.7483084", "0.7479624", "0.7477241", "0.747385...
0.0
-1
distinguishes one vs. many unified input csv files and either sets the single csv as input, or merges all csvs and sets the merged csv as input.
def set_input_csv(self): if len(self["input_csv"]) > 1: raise Exception("You must only specify *one* unified CSV file!") self.csv_path = self["input_csv"][0] print("Using input file", self.csv_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def import_directory_csv(d_in, d_out, target_column, merge_columns):\n\n INPUT_FILES = grab_files(\"*.csv\", d_in)\n\n if not INPUT_FILES:\n logger.warning(\"No matching CSV files found, exiting\")\n exit(2)\n\n for f_csv in INPUT_FILES:\n f_csv_out = os.path.join(d_out, os.path.basen...
[ "0.65366405", "0.63891923", "0.63422674", "0.61547923", "0.6103674", "0.6021459", "0.5971792", "0.5885629", "0.58756024", "0.58568597", "0.58556205", "0.57153285", "0.5673784", "0.56549925", "0.563907", "0.5638952", "0.56366646", "0.56365585", "0.56354904", "0.5634072", "0.56...
0.7068569
0
Finds and notes decoys that share their sequence with a target PSM. Also counts the number of targets and decoys to get a quick estimate of how many positive/negative training examples can be "claimed".
def find_shitty_decoys(self): target_seqs = set() decoy_seqs = set() with open(self.csv_path, "r") as f: reader = csv.DictReader(f) sorted_reader = sorted( reader, reverse=self["bigger_scores_better"], key=lambda d: float(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_target(self):\n tally = {}\n for obj in self.target:\n tally[obj] = 0\n\n ind = 0\n for label in self.labelList:\n filename = self.pathLabel + label\n f = open(filename, 'r')\n content = f.read().split('\\n')\n for line in...
[ "0.59328616", "0.54016626", "0.53880644", "0.53279763", "0.5304748", "0.5270805", "0.52698284", "0.52169853", "0.5192627", "0.5187703", "0.5163138", "0.5144442", "0.5137317", "0.51321214", "0.5109379", "0.5109379", "0.5092773", "0.5085388", "0.5081025", "0.50582725", "0.50424...
0.60678124
0
Turns the unified CSV column "Protein ID" into a set of all protein IDs.
def parse_protein_ids(csv_field, sep="<|>"): clean = csv_field.replace("decoy_", "").strip() prot_id_set = set(clean.split(sep)) return prot_id_set
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_award_ids (self, column):\n raw = self[column]\n vals = map (lambda x:x.strip(), raw.split(','))\n # return list (set (vals))\n return vals\n\n if 0:\n # truncated = filter (None, map (lambda x: len(x)>5 and x[-5:] or None, vals))\n truncated = filte...
[ "0.6303952", "0.62645626", "0.60780895", "0.57484424", "0.552927", "0.552591", "0.53634834", "0.5353858", "0.53358835", "0.53217846", "0.5320453", "0.52818024", "0.523921", "0.52312315", "0.5158253", "0.5154796", "0.5145234", "0.512992", "0.51164055", "0.51120037", "0.5105347...
0.7984387
0