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
Information about Configuration page for app
def infoAboutConfiguration(request): username = request.session.get('username', False) profile = request.session.get('profile', False) if(username): context = {'username': username,'profile':profile} return render(request, 'MedTAG_sket_dock_App/index.html', context) else: return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configuration():", "def show_info(self):\n print 'Querying the station for the configuration...'\n config = self.station.getConfig()\n for key in sorted(config):\n print '%s: %s' % (key, config[key])", "def config(self):\n pass", "def config(self):\n pass", ...
[ "0.70983917", "0.6656398", "0.661873", "0.661873", "0.65734", "0.65734", "0.64934826", "0.6467568", "0.63883966", "0.6383557", "0.6382818", "0.63664263", "0.6353951", "0.6350565", "0.63502836", "0.6347238", "0.6346799", "0.63267547", "0.6300264", "0.6297027", "0.6291528", "...
0.0
-1
Tutorial page for app
def tutorial(request): username = request.session.get('username', False) profile = request.session.get('profile', False) if(username): context = {'username': username,'profile':profile} return render(request, 'MedTAG_sket_dock_App/index.html', context) else: return redirect('Med...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tutorials(request):\n # Test Comment\n assert isinstance(request, HttpRequest)\n return render(\n request,\n 'tutorials.html',\n context_instance=RequestContext(request, {})\n )", "def callForTutorials(request):\n # Test Comment\n assert isinstance(request, HttpRequest)...
[ "0.7307964", "0.67953116", "0.6754259", "0.66745186", "0.66534", "0.6528225", "0.64401436", "0.64039856", "0.63926584", "0.63527006", "0.6335105", "0.62391394", "0.6103462", "0.60975313", "0.6084304", "0.6075097", "0.6068865", "0.603304", "0.6026463", "0.59866536", "0.5966442...
0.5979742
20
User's reports stats page for app
def my_stats(request): username = request.session.get('username', False) profile = request.session.get('profile', False) if(username): context = {'username': username,'profile':profile} return render(request, 'MedTAG_sket_dock_App/index.html', context) else: return redirect('Med...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index():\r\n\r\n title = \"Global Statistics\"\r\n\r\n n_auth = n_auth_users()\r\n\r\n n_anon = n_anon_users()\r\n\r\n n_total_users = n_anon + n_auth\r\n\r\n n_published_apps = cached_apps.n_published()\r\n n_draft_apps = cached_apps.n_draft()\r\n n_total_apps = n_published_apps + n_draft...
[ "0.75568897", "0.7478348", "0.7337845", "0.7281632", "0.72750634", "0.726631", "0.7097302", "0.69867873", "0.6986714", "0.69798213", "0.6931392", "0.68784565", "0.6758122", "0.66787434", "0.659769", "0.6564091", "0.65558517", "0.6452271", "0.64451945", "0.64124894", "0.638154...
0.6499229
17
Reports' stats page for app
def reports_stats(request): username = request.session.get('username', False) profile = request.session.get('profile', False) if(username): context = {'username': username,'profile':profile} return render(request, 'MedTAG_sket_dock_App/index.html', context) else: return redirect...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index():\r\n\r\n title = \"Global Statistics\"\r\n\r\n n_auth = n_auth_users()\r\n\r\n n_anon = n_anon_users()\r\n\r\n n_total_users = n_anon + n_auth\r\n\r\n n_published_apps = cached_apps.n_published()\r\n n_draft_apps = cached_apps.n_draft()\r\n n_total_apps = n_published_apps + n_draft...
[ "0.76013976", "0.75708693", "0.73110414", "0.70818317", "0.70160705", "0.7005195", "0.6829563", "0.66889244", "0.662684", "0.6610973", "0.6600029", "0.6582012", "0.6565331", "0.655495", "0.65318143", "0.6431495", "0.6416689", "0.63672954", "0.6351216", "0.63458294", "0.631499...
0.68279994
7
This view returns the current session parameters
def get_session_params(request): json_resp = {} usecase = request.session.get('usecase',None) language = request.session.get('language',None) institute = request.session.get('institute',None) annotation = request.session.get('mode',None) team_member = request.session.get('team_member',None) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_params(self):\n \n return self.params[self.profile]", "def get_parameters(self):\n return self.context.params", "def SessionInfo(self):\r\n\t\treturn self._get_attribute('sessionInfo')", "def get(self):\n return self.params", "def get(self):\n return self._params", ...
[ "0.6704671", "0.64286435", "0.624347", "0.6236312", "0.6195294", "0.6193571", "0.61749065", "0.61749065", "0.6170325", "0.6170325", "0.6170325", "0.6147238", "0.6137965", "0.61196494", "0.6095869", "0.6027674", "0.60054123", "0.5997175", "0.5986101", "0.5984785", "0.59830755"...
0.6681705
1
Login page for app
def login(request): print('login') if request.method == 'POST': md5_pwd = '' admin = False username = request.POST.get('username', False) mode1 = 'Human' mode = NameSpace.objects.get(ns_id=mode1) password = request.POST.get('password', False) if username...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login():", "def login():", "def login():\n login_page = Login()\n login_page.login_main_page()", "def login():\n return render_template('auth/login.html')", "def login():\n return render_template('auth/login.html')", "def login():\n\n return render_template('login.html')", "def login...
[ "0.8198486", "0.8198486", "0.8095299", "0.80503243", "0.80503243", "0.80076325", "0.7953975", "0.7920944", "0.7919374", "0.7890743", "0.7798588", "0.7792746", "0.7684994", "0.76642966", "0.75997424", "0.75369537", "0.7479572", "0.7455991", "0.7453318", "0.74508756", "0.744456...
0.0
-1
This view handles the GET and POST requestes for LABELS ANNOTATION ACTION
def annotationlabel(request,action=None): username = request.session['username'] mode1 = request.session['mode'] auto_required = request.GET.get('ns_id', None) mode = NameSpace.objects.get(ns_id=mode1) # print('mode',mode1) usecase = request.session['usecase'] # language = request.GET.get(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def label():\n\n if request.method == \"GET\":\n return render_template(\"/label.html\")\n\n else:\n # initialise the variables from the hidden html form input\n type = request.form.get(\"type\")\n url = request.form.get(\"url\")\n thumb = request.form.get(\"thumb\")\n\n ...
[ "0.66144353", "0.63546795", "0.63470924", "0.60510325", "0.5695163", "0.5651894", "0.5647814", "0.5625091", "0.5582534", "0.5574167", "0.5572838", "0.55621165", "0.5510184", "0.5436197", "0.54305923", "0.5367623", "0.5344053", "0.532556", "0.5323372", "0.526705", "0.5223831",...
0.7058827
0
This view handles the GET and POST requests concerning the mentions identification action
def mention_insertion(request,action=None): username = request.session['username'] mode1 = request.session['mode'] mode = NameSpace.objects.get(ns_id=mode1) # language = request.GET.get('language',request.session['language']) # print(language) usecase = request.session['usecase'] type = 'm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mentor_list_view(request):\n # TODO: this view\n pass", "def mentee_list_view(request):\n # TODO: this view\n pass", "def insert_link(request,action=None):\n\n username = request.session['username']\n mode1 = request.session['mode']\n mode = NameSpace.objects.get(ns_id=mode1)\n # la...
[ "0.73995537", "0.73620844", "0.60392785", "0.5866405", "0.56873083", "0.56122965", "0.5517016", "0.54710096", "0.5438025", "0.54133826", "0.5351744", "0.5338681", "0.5333359", "0.53294235", "0.5317595", "0.5270952", "0.5252377", "0.52442586", "0.5146937", "0.51071715", "0.505...
0.6561825
2
This view handles ENTITY LINKING action.
def insert_link(request,action=None): username = request.session['username'] mode1 = request.session['mode'] mode = NameSpace.objects.get(ns_id=mode1) # language = request.GET.get('language',request.session['language']) usecase = request.session['usecase'] auto_required = request.GET.get('ns_id...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getLink(self):", "async def link_to(self, *args):\n pass", "def link(self):\n if self.resource is None:\n self.resource = self.client.get_resource(self.href)\n self.client.post_linked_resource(\n self.resource, RelationType.LINK_TO_TEMPLATE,\n EntityTyp...
[ "0.6529409", "0.6261671", "0.6061944", "0.5991588", "0.5865839", "0.5847417", "0.58065325", "0.57768536", "0.57447076", "0.5732444", "0.56826234", "0.5680303", "0.5644154", "0.562023", "0.56031066", "0.55818963", "0.5573664", "0.5553531", "0.5547808", "0.55261755", "0.5525279...
0.53762984
35
This view handles the GET AND POST requests to insert, delete, get concepts.
def contains(request, action=None): username = request.session.get('username', False) mode1 = request.session.get('mode', False) mode = NameSpace.objects.get(ns_id=mode1) error_json = {"Error": "No user authenticated"} if (username): response_json = {} if request.method == 'GET': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conc_view(request):\n\n usecase = request.session['usecase']\n mode = request.session['mode']\n auto_required = request.GET.get('ns_id',None)\n jsonDict = {}\n concepts = {}\n notEmpty = False\n jsonDict['concepts'] = []\n if mode == 'Human' or auto_required == 'Human':\n cursor ...
[ "0.61219996", "0.59057087", "0.56041396", "0.5594849", "0.55910647", "0.5548109", "0.5538304", "0.55363566", "0.551329", "0.551329", "0.5454264", "0.5444275", "0.5436636", "0.5426927", "0.54256684", "0.5419429", "0.5403076", "0.53987503", "0.53939396", "0.5388849", "0.5387255...
0.60170645
1
This view allows to test the four actions a user can perform.
def test(request, table): username = request.session.get('username', False) error_json = {"Error": "No user authenticated"} if (username): context = {'username': username} if table == "contains": return render(request, 'MedTAG_sket_dock_App/test/test-contains.html', context) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_user_actions_post(self):\n pass", "def test_view_displays_all(self):\n set_up_one_user(self, 1, 0)\n login = self.client.login(username='test', password='2HJ1vRV0Z&3iD')\n response = self.client.get(reverse('index'))\n self.assertEqual(response.status_code, 200)\n ...
[ "0.7148795", "0.67888236", "0.66133183", "0.6519565", "0.6417866", "0.6320076", "0.6318223", "0.63096946", "0.62790465", "0.62453616", "0.6233635", "0.6223224", "0.6203222", "0.6198867", "0.61912817", "0.6169254", "0.61673194", "0.6163158", "0.612668", "0.61203367", "0.611683...
0.0
-1
This view returns the list of reports associated to a single use_case, institute and language
def get_reports(request): inst = request.GET.get('institute',None) use = request.GET.get('usec',None) print(use) lang = request.GET.get('lang',None) batch = request.GET.get('batch',None) all = request.GET.get('all',None) actual_report = request.GET.get('actual_report',None) if all == 'a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(request):\n\n json_resp = {}\n # reports = Report.objects.filter(name = UseCase.objects.get(name=request.session['usecase']),institute = request.session['institute'],language = request.session['language'])\n\n json_resp['reports'] = []\n institute = request.GET.get('institute',request.sess...
[ "0.61894846", "0.60761696", "0.5919785", "0.58525854", "0.5772856", "0.575343", "0.5743181", "0.57404655", "0.5713519", "0.56065595", "0.5573967", "0.5552891", "0.54978424", "0.5465102", "0.5448308", "0.5387445", "0.53673327", "0.5361622", "0.53593826", "0.52845144", "0.52631...
0.6606941
0
This view returns the admin of MedTAG (if any)
def get_admin(request): jsonResp = {} jsonResp['admin'] = '' if User.objects.filter(profile = 'Admin').exists(): mode = NameSpace.objects.get(ns_id='Human') name = User.objects.get(profile = 'Admin',ns_id=mode) admin = name.username jsonResp['admin'] = admin return Json...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAdmin():", "def admin(request):\n response = {\n 'articleform': ArticleForm(),\n 'categoryform': CategoryForm(),\n 'tagform': TagForm()\n }\n\n return render(request, 'knowledgebase/admin.html', response)", "def admin_only():\n return 'Super-seekrit admin page.'", "def...
[ "0.68099904", "0.6166164", "0.6129299", "0.6103094", "0.6095433", "0.60935694", "0.6068538", "0.5937125", "0.5867055", "0.58188266", "0.57358885", "0.57048804", "0.5703868", "0.56482583", "0.5623533", "0.5601087", "0.55903524", "0.5528616", "0.5527308", "0.5515824", "0.550808...
0.5809595
10
This view checks whether the configuration files the user inserted are well formed and returns the response
def check_input_files(request): reports = [] labels = [] pubmedfiles = [] concepts = [] type1 = request.POST.get('type',None) username = request.POST.get('username',None) # email = request.POST.get('email',None) password = request.POST.get('password',None) for filename, file in requ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config_verify(self,\n raw_response: Any,\n *args,\n **kwargs) -> bool:\n pass", "def edit_config_verify(self,\n raw_response: Any,\n *args,\n **k...
[ "0.59801537", "0.5930928", "0.59076905", "0.58123827", "0.5767755", "0.5741729", "0.5710974", "0.5606", "0.5606", "0.5601504", "0.5598409", "0.5596937", "0.5566562", "0.55586517", "0.5556762", "0.5550772", "0.55330944", "0.55282456", "0.5525261", "0.5514157", "0.5479723", "...
0.61117023
0
This view returns the list of groundtruths associated to a user and a specific configuration of institute, usecase and language.
def get_gt_list(request): groundTruths = 0 json_resp = {} username =request.GET.get('username',None) ins = request.GET.get('inst',None) lang = request.GET.get('lang',None) use = request.GET.get('use',None) action = request.GET.get('action',None) token = request.GET.get('token',None) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_ground_truth(request):\n\n user = request.GET.get('user',None)\n action = request.GET.get('action',None)\n mode = request.GET.get('mode',None)\n report = request.GET.get('report',None)\n language = request.GET.get('language',request.session['language'])\n mode_obj = NameSpace.objects...
[ "0.5999815", "0.56888205", "0.55822563", "0.50436574", "0.5027748", "0.5008548", "0.49218768", "0.49068975", "0.48958996", "0.48903573", "0.48482397", "0.4839935", "0.48096266", "0.48037243", "0.4765853", "0.47516873", "0.4731364", "0.47203898", "0.469531", "0.4694096", "0.46...
0.5156828
3
This view checks whether the files inserted by the user to update the configuration are well formed
def check_files_for_update(request): reports = [] pubmedfiles = [] labels = [] concepts = [] type1 = request.POST.get('type',None) for filename, file in request.FILES.items(): if filename.startswith('reports'): reports.append(file) if filename.startswith('pubmed'): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_config(self):\n try:\n config_metadata = self.dbc.get_metadata(\"config.txt\")\n except rest.ErrorResponse:\n print str(datetime.datetime.now()) \\\n + \": No config.txt in Dropbox directory. Exiting.\"\n sys.exit()\n if config_metadata...
[ "0.5990421", "0.5856733", "0.58000755", "0.5700677", "0.5700643", "0.5694012", "0.56602377", "0.5652492", "0.5576875", "0.5533964", "0.55261713", "0.5525095", "0.54940057", "0.5441861", "0.54376626", "0.54344094", "0.5424616", "0.5412756", "0.54043454", "0.53829175", "0.53707...
0.6431848
0
This view handles the update of the database once the files check went well
def update_db(request): reports = [] pubmedfiles = [] labels = [] concepts = [] usecase = request.session['usecase'] type1 = request.POST.get('type', None) for filename, file in request.FILES.items(): if filename.startswith('reports'): reports.append(file) if f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_update_files():\n _populate_table_files(File)\n _populate_table_files(Software)\n return redirect(url_for('view_index'))", "def check_files_for_update(request):\n\n reports = []\n pubmedfiles = []\n\n labels = []\n concepts = []\n type1 = request.POST.get('type',None)\n for file...
[ "0.78468007", "0.6518412", "0.6347776", "0.6281645", "0.6253969", "0.6233721", "0.6062642", "0.5973955", "0.59582907", "0.589399", "0.5749623", "0.57444847", "0.5734826", "0.5730112", "0.5681989", "0.56654054", "0.5635508", "0.5635349", "0.5631634", "0.5626919", "0.5592777", ...
0.6331503
3
This view handles the initial configuration, the first the admin performs
def configure_db(request): reports = [] pubmedfiles = [] areas = [] labels = [] concepts = [] type = request.POST.get('type',None) load_concepts = request.POST.get('exa_concepts',None) load_labels = request.POST.get('exa_labels',None) for filename, file in request.FILES.items(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure(self):\n inject(self.urls, self.names_for(\"urls\"))\n inject(self.models, self.names_for(\"models\"))\n self.load_admin()", "def load_admin(self):\n self.config.load_admin()", "def initialConfig(self):\r\r\n\r\r\n loggerCmw = logging.getLogger('initialConfig')\...
[ "0.67497563", "0.6583361", "0.6476776", "0.64530045", "0.6267945", "0.62559855", "0.62546116", "0.6244819", "0.6207696", "0.6193051", "0.6186991", "0.6186991", "0.6175873", "0.6175873", "0.6175873", "0.6175873", "0.6153204", "0.61281705", "0.6114283", "0.6088599", "0.6088599"...
0.0
-1
This view returns the list of all the distinct keys present in the json reports. This view is called during configuration
def get_keys(request): keys=[] reports = Report.objects.all().exclude(institute = 'PUBMED') for report in reports: json_rep = report.report_json for el in json_rep.keys(): if el not in keys: keys.append(el) json_resp = {'keys':keys} return JsonResponse(js...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def AllKeys(self) -> _n_0_t_1[str]:", "def distinct(self, key):\n return self.database.command({'distinct': self.name,\n 'key': key})['values']", "def keys(self) -> KeysView:\n return self._dict.keys()", "def GET(self, key):\n header('Content-Type', '...
[ "0.6015251", "0.5963718", "0.5916041", "0.58546275", "0.5769133", "0.57459795", "0.5695538", "0.5680063", "0.5674234", "0.56573683", "0.56514174", "0.56393325", "0.5621896", "0.55753326", "0.55740577", "0.5571665", "0.55628973", "0.55588096", "0.55510443", "0.55476856", "0.55...
0.79304016
0
This view returns the ground truths created by the user according to the configuration she required.
def download_ground_truths(request): workpath = os.path.dirname(os.path.abspath(__file__)) # Returns the Path your .py file is in path1 = os.path.join(workpath, './static/temp/temp.csv') path2 = os.path.join(workpath, './static/BioC/temp_files/to_download.csv') if os.path.exists(path1): os.rem...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_ground_truth(request):\n\n user = request.GET.get('user',None)\n action = request.GET.get('action',None)\n mode = request.GET.get('mode',None)\n report = request.GET.get('report',None)\n language = request.GET.get('language',request.session['language'])\n mode_obj = NameSpace.objects...
[ "0.6326191", "0.62316513", "0.5909118", "0.58245844", "0.57520556", "0.56995493", "0.56758773", "0.5547157", "0.55310655", "0.5481521", "0.5378445", "0.53661126", "0.5318335", "0.53141564", "0.5298512", "0.52543676", "0.52284783", "0.52028716", "0.5168641", "0.51581955", "0.5...
0.52988386
14
This view returns ALL the ground truths to be downloaded. This view can be called only by the admin and the ground truths returned are those of ALL the users in the platform
def download_all_ground_truths(request): json_resp = {} json_resp['ground_truth'] = [] cursor = connection.cursor() mode = request.GET.get('gt_mode',None) if mode is None: human = NameSpace.objects.get(ns_id = 'Human') robot = NameSpace.objects.get(ns_id = 'Robot') gt_human ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_ground_truths(request):\n\n workpath = os.path.dirname(os.path.abspath(__file__)) # Returns the Path your .py file is in\n path1 = os.path.join(workpath, './static/temp/temp.csv')\n path2 = os.path.join(workpath, './static/BioC/temp_files/to_download.csv')\n if os.path.exists(path1):\n ...
[ "0.6390326", "0.6114309", "0.5874675", "0.5586476", "0.54724544", "0.54573137", "0.538209", "0.5373068", "0.5310844", "0.5264944", "0.5234574", "0.5225719", "0.52199984", "0.52116776", "0.52091205", "0.5126838", "0.5124764", "0.5122737", "0.5103302", "0.51019853", "0.50845915...
0.71700454
0
This view returns the key files of BioC mentions and linking.
def download_key_files(request): workpath = os.path.dirname(os.path.abspath(__file__)) # Returns the Path your .py file is in path = os.path.join(workpath, './static/BioC/linking.key') path1 = os.path.join(workpath, './static/BioC/mention.key') ment = request.GET.get('type_key',None) if ment == 'm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def take_auth_data():\n home = str(Path.home())\n path_to_keys = '/Documents/twitter/keys/'\n\n files = [f for f in listdir(home+path_to_keys) if '.DS' not in f]\n\n tokens = []\n for f in files:\n with open(home+path_to_keys+f, 'r') as lines:\n ln = lines.readline().replace(\" \",...
[ "0.5546954", "0.5437735", "0.5268663", "0.5253988", "0.52061164", "0.52018476", "0.5182864", "0.51804817", "0.5095209", "0.5094157", "0.50905", "0.5058644", "0.5009201", "0.50003994", "0.49914286", "0.4987616", "0.49603057", "0.49587998", "0.4955711", "0.49460372", "0.4943244...
0.7325465
0
This view returns an array of tuples, where each tuple contains the id of the annotated report and the associated insertion time
def get_reports_from_action(request): username = request.session['username'] mode1 = request.session['mode'] mode = NameSpace.objects.get(ns_id=mode1) language = request.session['language'] report_to_ret = [] action = request.GET.get('action',None) user = User.objects.get(username = usernam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_analysis_annotations():\n sample_id = demisto.getArg('id')\n r = req('GET', SUB_API + 'samples/' + sample_id + '/analysis/annotations')\n\n annotations = []\n context_path = 'ThreatGrid.AnalysisResults.Sample.Id.Annotations'\n ec = {context_path: []} # type: ignore\n ips = demisto.get(...
[ "0.5831102", "0.5541697", "0.5499951", "0.5450239", "0.5385076", "0.53237146", "0.53190696", "0.52947676", "0.5173303", "0.51707757", "0.5157042", "0.513702", "0.5134033", "0.5115707", "0.51066285", "0.507436", "0.5073391", "0.5015745", "0.49979466", "0.4995804", "0.49945", ...
0.5134248
12
This view returns the last ground truth created by the user for the session's parameters
def get_last_gt(request): username = request.session['username'] mode1 = request.session['mode'] mode = NameSpace.objects.get(ns_id=mode1) language = request.session['language'] usecase = request.session['usecase'] institute = request.session['institute'] batch = request.session['batch'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_ground_truth(request):\n\n user = request.GET.get('user',None)\n action = request.GET.get('action',None)\n mode = request.GET.get('mode',None)\n report = request.GET.get('report',None)\n language = request.GET.get('language',request.session['language'])\n mode_obj = NameSpace.objects...
[ "0.6362369", "0.5618397", "0.55958295", "0.5394522", "0.53271693", "0.532361", "0.524949", "0.52235365", "0.5198521", "0.51720786", "0.5165802", "0.51398844", "0.5132665", "0.5132122", "0.51075196", "0.5077153", "0.503414", "0.5029794", "0.5022567", "0.50175035", "0.49976113"...
0.65990674
0
This view returns the concept_urls related to each semantic_area. The concepts can be those added by the admin (in the manual mode), those of EXAMODE added EXCLUSIVELY for automatic annotation (in the automatic mode) or those of EXAMODE added for automatic AND manual mode.
def conc_view(request): usecase = request.session['usecase'] mode = request.session['mode'] auto_required = request.GET.get('ns_id',None) jsonDict = {} concepts = {} notEmpty = False jsonDict['concepts'] = [] if mode == 'Human' or auto_required == 'Human': cursor = connection.cu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lookup_semantic_areas(semantic_areas, use_case_ontology):\r\n\t\t\r\n\t\tif type(semantic_areas) == list: # search for list of semantic areas\r\n\t\t\trows = use_case_ontology.loc[use_case_ontology['semantic_area_label'].isin(semantic_areas)][['iri', 'label', 'semantic_area_label']]\r\n\t\telse: # search for...
[ "0.6080792", "0.543983", "0.52979267", "0.49308932", "0.49278787", "0.48732424", "0.4748727", "0.47321576", "0.47175422", "0.47168556", "0.46896112", "0.46763754", "0.46462524", "0.46427807", "0.4632604", "0.46277106", "0.46203625", "0.45999643", "0.45799875", "0.45757028", "...
0.5373202
2
This view returns the json report of the required report
def report(request,report_id,language): json_resp = {} error_json = {'error':'the report does not exist!'} if Report.objects.filter(id_report = report_id, language = language).exists(): report = Report.objects.get(id_report = report_id, language = language) json_resp['report_json'] = repor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def json_report(request):\n\n close_old_connections()\n\n # Not allow unauthenticated users.\n if not request.user.is_authenticated:\n return HttpResponseForbidden(\"You're not authenticated.\")\n \n # Get orders.\n orders = get_orders(request)\n\n # Form the audit.\n audit = {\n ...
[ "0.7473013", "0.71653223", "0.71193326", "0.711113", "0.7037173", "0.7030517", "0.69930786", "0.68160874", "0.6811237", "0.67936546", "0.67578363", "0.66909", "0.66839343", "0.66407305", "0.65476006", "0.6539282", "0.6421162", "0.6380125", "0.6352547", "0.62871504", "0.624473...
0.6822793
7
This view returns for each key of the json report required its text, the indexes of the start and stop chars in the json report string and the number of words that compose the fields to annotate.
def report_start_end(request): report = request.GET.get('report_id') lang = request.GET.get('language',None) usecase = request.session['usecase'] data = get_fields_from_json() json_keys_to_display = data['fields'] json_keys_to_display.extend(['journal','authors','year','volume']) json_keys_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def annotation_all_stats(request):\n\n id_report = request.GET.get('report',None)\n language = request.GET.get('language',None)\n\n json_dict = get_annotations_count(id_report,language)\n\n # print('annotations',json_dict)\n return JsonResponse(json_dict)", "def keyword_analysis(request): \n ...
[ "0.5901755", "0.557389", "0.5426363", "0.53363323", "0.53263783", "0.530319", "0.529372", "0.52915365", "0.52282554", "0.52024233", "0.51975214", "0.5193073", "0.5190849", "0.5155429", "0.51324636", "0.51046854", "0.51033866", "0.50946844", "0.5073294", "0.5071243", "0.507050...
0.5978528
0
This view returns the fields to display and annotate. If the annotation mode is automatic the fields to annotate are those the concepts and mentions have been extracted from. The fields are returned to give the user the chance to update the fields she wants to display/annotate in MANUAL CONFIGURATION.
def get_fields(request): json_resp = {} json_resp['fields'] = [] json_resp['fields_to_ann'] = [] all = request.GET.get('all',None) workpath = os.path.dirname(os.path.abspath(__file__)) # Returns the Path your .py file is in auto_request = request.GET.get('ns_id', None) report = request.GET...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_auto_annotations(request): # post\n\n request_body_json = json.loads(request.body)\n usecase_list = request_body_json['usecase']\n fields_list = request_body_json['selected']\n report_key = request_body_json['report_type']\n batch = request_body_json['batch']\n\n # check existence of e...
[ "0.5912422", "0.5710874", "0.5643516", "0.5519478", "0.5514924", "0.541801", "0.5411552", "0.5356129", "0.52762175", "0.5274392", "0.5206856", "0.51891625", "0.5185114", "0.51487356", "0.51449263", "0.5080195", "0.5075947", "0.50657296", "0.50644743", "0.50619006", "0.5053078...
0.63069195
0
This view creates the HttpResponse object with the CSV examples files, these are the examples the user can download.
def download_examples(request): file_required = request.GET.get('token',None) path = '' workpath = os.path.dirname(os.path.abspath(__file__)) # Returns the Path your .py file is in if file_required == 'reports': path = os.path.join(workpath, './static/examples/report.csv') elif file_requi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def csv_download_view(request):\n logging.info(\" CSV file download is working\")\n now = datetime.now()\n timestamp = now.strftime(\"%Y_%m_%d\")\n response = HttpResponse(content_type='text/csv')\n response['Content-Disposition'] = 'attachment; filename=\"results_' + \\\n GLOBAL_VARIABLE.get...
[ "0.66388816", "0.6486266", "0.6369911", "0.6286953", "0.62677735", "0.6229694", "0.6140815", "0.60950977", "0.60798424", "0.6048974", "0.588191", "0.5857587", "0.5844419", "0.58400095", "0.58131593", "0.5644796", "0.5629658", "0.5619012", "0.5589778", "0.55788064", "0.5575425...
0.8027104
0
This view creates the HttpResponse object with the appropriate CSV header, these are the templates the user can download.
def download_templates(request): file_required = request.GET.get('token',None) path = '' workpath = os.path.dirname(os.path.abspath(__file__)) # Returns the Path your .py file is in if file_required == 'reports': path = os.path.join(workpath, './static/templates/report.csv') elif file_re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def csv_download_view(request):\n logging.info(\" CSV file download is working\")\n now = datetime.now()\n timestamp = now.strftime(\"%Y_%m_%d\")\n response = HttpResponse(content_type='text/csv')\n response['Content-Disposition'] = 'attachment; filename=\"results_' + \\\n GLOBAL_VARIABLE.get...
[ "0.77301335", "0.73666567", "0.7355991", "0.7228909", "0.7226983", "0.7217648", "0.7094669", "0.70587486", "0.7015085", "0.7014507", "0.7010828", "0.70096016", "0.6967033", "0.69572055", "0.69189924", "0.6718752", "0.66366225", "0.6557932", "0.64799553", "0.6463194", "0.64586...
0.75247663
1
This view returns the list of all the keys found in report files (other than institute,usecase,id_report,language) and the list of usecases, this list contains the usecases where automatic annotation can be applied.
def get_keys_and_uses_from_csv(request): labels = [] pubmed = [] reports = [] concepts = [] json_resp = {} type_selected = '' for filename, file in request.FILES.items(): if filename.startswith('reports'): type_selected = 'reports' reports.append(file) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_keys(request):\n\n keys=[]\n reports = Report.objects.all().exclude(institute = 'PUBMED')\n for report in reports:\n json_rep = report.report_json\n for el in json_rep.keys():\n if el not in keys:\n keys.append(el)\n json_resp = {'keys':keys}\n return ...
[ "0.64362574", "0.5788912", "0.56906444", "0.5603826", "0.55491775", "0.54180676", "0.5360192", "0.53036547", "0.5195319", "0.513031", "0.50899893", "0.50872195", "0.5049063", "0.5038411", "0.5025842", "0.5022587", "0.50090915", "0.5000231", "0.49811894", "0.49524757", "0.4935...
0.5535878
5
This view returns the list of all the keys found in report files (other than institute,usecase,id_report,language) the admin has just inserted to update the database (only the keys that have never been detected before are returned).
def get_keys_from_csv_update(request): reports = [] json_resp = {} for filename, file in request.FILES.items(): if filename.startswith('reports'): reports.append(file) elif filename.startswith('pubmed'): reports.append(file) keys,uses = get_keys_csv_update(repor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_keys(request):\n\n keys=[]\n reports = Report.objects.all().exclude(institute = 'PUBMED')\n for report in reports:\n json_rep = report.report_json\n for el in json_rep.keys():\n if el not in keys:\n keys.append(el)\n json_resp = {'keys':keys}\n return ...
[ "0.71772546", "0.5747411", "0.5723134", "0.569637", "0.5561608", "0.54670197", "0.5361327", "0.5307448", "0.53016967", "0.5248564", "0.5241497", "0.52275854", "0.5220743", "0.52100676", "0.5197569", "0.5185162", "0.5140861", "0.5136076", "0.51293594", "0.51133555", "0.5111757...
0.6515069
1
This view returns the list of usecases (colon,uterine cervix,lung) for which the examode concepts have not been added in the database.
def get_presence_examode_concepts(request): json_resp = {} json_resp['concepts'] = get_presence_exa_concepts() json_resp['labels'] = get_presence_exa_labels() # print(json_resp) return JsonResponse(json_resp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_uses_missing_exa(request):\n\n use_to_ret = {}\n use_to_ret['labels_present'] = []\n use_to_ret['concepts_present'] = []\n use_to_ret['labels_missing'] = []\n use_to_ret['concepts_missing'] = []\n uses = ['colon','uterine cervix','lung']\n for el in uses:\n usecase = UseCase.obj...
[ "0.6790827", "0.6196254", "0.5533098", "0.5533098", "0.5495612", "0.54655147", "0.53392214", "0.5315234", "0.5315234", "0.5278193", "0.5278193", "0.51534927", "0.51332116", "0.51185906", "0.5101442", "0.5099715", "0.50912744", "0.5083736", "0.5083736", "0.5083736", "0.5004337...
0.48476055
33
This view returns for each usecase the statistics concerning the user's annotations
def get_stats_array_per_usecase(request): mode = request.GET.get('mode',None) usern = request.GET.get('member',request.session['username']) username = User.objects.get(username=usern, ns_id=mode) language = request.GET.get('language',request.session['language']) institute = request.GET.get('institu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def annotation_all_stats(request):\n\n id_report = request.GET.get('report',None)\n language = request.GET.get('language',None)\n\n json_dict = get_annotations_count(id_report,language)\n\n # print('annotations',json_dict)\n return JsonResponse(json_dict)", "def overview(request):\n LOGGER.info...
[ "0.6520774", "0.61430424", "0.57960534", "0.5767102", "0.5748662", "0.57239825", "0.5620116", "0.5618035", "0.5600986", "0.5587978", "0.5550349", "0.55432135", "0.5471583", "0.54518664", "0.5439032", "0.5402873", "0.53957576", "0.53901374", "0.5381438", "0.53607213", "0.53559...
0.585126
2
This view returns the rows to be inserted in the reports' table
def get_data(request): json_resp = {} # reports = Report.objects.filter(name = UseCase.objects.get(name=request.session['usecase']),institute = request.session['institute'],language = request.session['language']) json_resp['reports'] = [] institute = request.GET.get('institute',request.session['instit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rows(self):\n for investment_project in get_spi_report_queryset().iterator():\n yield self.get_row(investment_project)", "def reports(self, request):\n serializer = ReportSerializer(data=request.data, context={'request': request})\n serializer.is_valid(raise_exception=True)\n ...
[ "0.5972984", "0.5820921", "0.57325846", "0.5699228", "0.5583971", "0.55286187", "0.5527511", "0.54847753", "0.5472222", "0.5400356", "0.53834754", "0.5373838", "0.5370028", "0.53676057", "0.5362646", "0.5357459", "0.53312767", "0.53297734", "0.5322626", "0.53118074", "0.53095...
0.0
-1
Check the number of reports annotated by the machine. It is needed by frontend to display how many reports have not been alg annotated yet if one or more reports have been inserted later.
def report_missing_auto(request): usecases = UseCase.objects.all() json_resp = {} languages = ['english', 'English'] for el in usecases: use = el.name batches = [] batches.append('all') if use.lower() in ['colon','lung','uterine cervix']: report = Report.obje...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetNumberOfAnalysisReports(self):\n return self._analysis_report_stream_number - 1", "async def test_nr_of_missing_metrics_without_correct_report(self):\n self.reports[\"reports\"] = []\n response = await self.collect(get_request_json_side_effect=[self.data_model, self.reports])\n sel...
[ "0.68508667", "0.644907", "0.6323937", "0.6197335", "0.61852753", "0.58833945", "0.58439714", "0.5674733", "0.56427646", "0.56376135", "0.5631575", "0.5622997", "0.5576571", "0.55721563", "0.5543924", "0.55300975", "0.5517729", "0.55001414", "0.54755", "0.5464594", "0.5449464...
0.0
-1
Check the number of reports annotated by the machine. It is needed by frontend to display how many reports have not been alg annotated yet if one or more reports have been inserted later.
def pubmed_missing_auto(request): usecases = UseCase.objects.all() json_resp = {} json_resp['annotated'] = 0 json_resp['tot'] = 0 json_resp['usecase'] = [] languages = ['English','english'] for el in usecases: use = el.name json_resp[use] = {} batches = [] ba...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetNumberOfAnalysisReports(self):\n return self._analysis_report_stream_number - 1", "async def test_nr_of_missing_metrics_without_correct_report(self):\n self.reports[\"reports\"] = []\n response = await self.collect(get_request_json_side_effect=[self.data_model, self.reports])\n sel...
[ "0.6849571", "0.64489937", "0.6324095", "0.6198976", "0.61840296", "0.58828866", "0.584472", "0.567382", "0.56436783", "0.5636645", "0.563118", "0.56241053", "0.557589", "0.55721855", "0.5544101", "0.5530149", "0.5517418", "0.5499138", "0.54746366", "0.5463975", "0.5450596", ...
0.0
-1
This view handles the creation of automatic annotations
def create_auto_annotations(request): # post request_body_json = json.loads(request.body) usecase_list = request_body_json['usecase'] fields_list = request_body_json['selected'] report_key = request_body_json['report_type'] batch = request_body_json['batch'] # check existence of examode labels...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def annotate(self, request, pk=None):\n\n # Get the document of the detail view and deserialize data\n document = self.get_object()\n serializer = AnnotationSerializer(\n data=request.data,\n context={'request': request, 'document': document}\n )\n\n # Val...
[ "0.6415329", "0.639421", "0.639421", "0.635931", "0.63100845", "0.6303881", "0.6297316", "0.6156496", "0.6034312", "0.60098106", "0.60085005", "0.5985925", "0.5960007", "0.593711", "0.59337866", "0.5889605", "0.5885899", "0.58781826", "0.5856027", "0.58548445", "0.58407944", ...
0.6387488
3
It returns the statistics of all the annotations, depending on Automatic or Manual annotation mode.
def annotation_all_stats(request): id_report = request.GET.get('report',None) language = request.GET.get('language',None) json_dict = get_annotations_count(id_report,language) # print('annotations',json_dict) return JsonResponse(json_dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showAnnotationsExamples(annotation=1.0, showTotalOnly=False):\n total = 0\n # get the right annotation\n if type(annotation) is float:\n annotation = str(annotation)\n # get the lists of annotations and sentences\n annotatedFolderPathList = [u'./002manuallyAnnotated/', u'./003negativeNaiv...
[ "0.6183956", "0.60259265", "0.60116893", "0.59949404", "0.5988531", "0.5978838", "0.57993627", "0.57060766", "0.57036275", "0.568836", "0.56590897", "0.55572796", "0.54674685", "0.5456113", "0.54523754", "0.54500777", "0.54468614", "0.54467595", "0.53747386", "0.53728575", "0...
0.60161185
2
This view removes one or more entries from the reports table
def delete_reports(request): request_body_json = json.loads(request.body) report_list = request_body_json['report_list'] # print(type(report_list)) try: with transaction.atomic(): json_resp = {'msg':'ok'} for report in report_list: # print(report) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def purge_entries_command():\n incident = demisto.args().get('id', get_investigation_id())\n cursor = COLLECTION.find({})\n deleted = 0\n # Iterate, collecting any name/value pairs associated with the incident\n for i in cursor:\n if incident in i:\n object_id = i.get('_id')\n ...
[ "0.6340911", "0.6036938", "0.5985408", "0.5947363", "0.5903566", "0.5845712", "0.5842439", "0.58321166", "0.5829431", "0.5829399", "0.5783813", "0.57735264", "0.57605934", "0.5721502", "0.57111275", "0.5709054", "0.5609433", "0.5608257", "0.55689377", "0.5568891", "0.55685073...
0.595967
3
This view returns the number of ground truths for the required action.
def get_gt_action_based(request): action = request.GET.get('action',None) ns = request.GET.get('annotation_mode',None) if ns == 'Manual': ns = 'Human' elif ns == 'Automatic': ns = 'Robot' gts = GroundTruthLogFile.objects.filter(gt_type=action) if ns is not None: ns_id ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_num_actions():\n return 6", "def action_count(self):\n raise NotImplementedError", "def get_number_of_actions(self):\n return self.__environment.action_space.n", "def n_actions(self):\n return sum(op.action is not None for op in self)", "def n_actions(self) -> int:\n retu...
[ "0.6762627", "0.66855824", "0.6623974", "0.65036833", "0.6470496", "0.6316444", "0.629149", "0.60368526", "0.6007", "0.59856224", "0.59587497", "0.5945216", "0.59185743", "0.5913962", "0.59077424", "0.59077424", "0.59077424", "0.59077424", "0.59077424", "0.59077424", "0.59077...
0.60456795
7
This view returns the insertion time of the ground truth of a specific report and action
def get_insertion_time_record(request): report = request.GET.get('rep',None) language = request.GET.get('language',None) user_obj = request.GET.get('username',request.session['username']) ns_id_str = request.GET.get('ns_id',None) action = request.GET.get('action',None) report1 = Report.objects....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def action_time(self):\n return self._action_time", "def getSubmitTime():", "def action(self):\n return self.rowTime.activity", "def get_reports_from_action(request):\n\n username = request.session['username']\n mode1 = request.session['mode']\n mode = NameSpace.objects.get(ns_id=mode1...
[ "0.61869544", "0.6098068", "0.59390426", "0.5899511", "0.57239664", "0.5698437", "0.55129707", "0.5507397", "0.54787785", "0.5462038", "0.542069", "0.5413636", "0.5274124", "0.5269431", "0.52571", "0.52457213", "0.52457213", "0.52457213", "0.52457213", "0.52457213", "0.524572...
0.5993164
2
This view returns the list of users
def get_users_list(request): if request.method == 'POST': request_body_json = json.loads(request.body) lista = [] reports = request_body_json['reports'] action = request_body_json['action'] for rep in reports: r = Report.objects.get(id_report=rep[0], language=rep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_list():\n\n users = User.query.all()\n\n return render_template(\"user_list.html\", users=users)", "def user_list():\n\n users = User.query.all()\n return render_template(\"/user_list.html\", users=users)", "def user_list():\n\n users = User.query.all()\n return render_template(\"use...
[ "0.8763392", "0.8762155", "0.874486", "0.874486", "0.874486", "0.874486", "0.874486", "0.874486", "0.8736582", "0.8494802", "0.83495146", "0.83075815", "0.82329273", "0.82251996", "0.8126732", "0.81214386", "0.8088157", "0.8074572", "0.8040432", "0.8009119", "0.80086416", "...
0.0
-1
This view returns the groundtruth associated to a specific user,action,report
def get_user_ground_truth(request): user = request.GET.get('user',None) action = request.GET.get('action',None) mode = request.GET.get('mode',None) report = request.GET.get('report',None) language = request.GET.get('language',request.session['language']) mode_obj = NameSpace.objects.get(ns_id=m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_reports_from_action(request):\n\n username = request.session['username']\n mode1 = request.session['mode']\n mode = NameSpace.objects.get(ns_id=mode1)\n language = request.session['language']\n report_to_ret = []\n action = request.GET.get('action',None)\n user = User.objects.get(usern...
[ "0.6772657", "0.6000003", "0.59264755", "0.5880304", "0.57433313", "0.5722247", "0.56435704", "0.5437227", "0.5424971", "0.54028565", "0.5310623", "0.5304719", "0.5268187", "0.5193207", "0.51647246", "0.51642805", "0.51576793", "0.515311", "0.5151735", "0.5143959", "0.5133754...
0.69742775
0
This view returns the number of reports automatically annotated by the algorithm, needed when a set has not been annotated yet
def check_auto_presence_for_configuration(request): report_type = request.GET.get('report_type',None) usecase = request.GET.get('usecase',None) language = request.GET.get('language',None) institute = request.GET.get('institute',None) batch = request.GET.get('batch',None) languages = ['English',...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetNumberOfAnalysisReports(self):\n return self._analysis_report_stream_number - 1", "def get_annotation_count(self):\n return self._num_annos", "def test_set_count(self) -> int:\n return pulumi.get(self, \"test_set_count\")", "def count():", "def count(self):\n\n raise NotImple...
[ "0.63487315", "0.61534566", "0.5975057", "0.59637153", "0.5936202", "0.59227645", "0.59115213", "0.58910114", "0.58910114", "0.58910114", "0.58910114", "0.5875141", "0.5845569", "0.5814561", "0.5792397", "0.5784166", "0.5683807", "0.56606853", "0.5635077", "0.5620295", "0.559...
0.0
-1
This view returns the list of batches associated to a use case
def get_batch_list(request): json_resp = {} json_resp['batch_list'] = [] usecase = request.GET.get('usecase',None) # print(usecase) if usecase is None: batch = Report.objects.all().exclude(institute='PUBMED').values('batch') else: use_obj = UseCase.objects.get(name=usecase) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_batches(request):\n\n template = 'batch_list.html'\n\n context = {\n 'invalid_due_date': request.GET.get('invalid_due_date')\n }\n\n try:\n get_batches(request, context)\n except Exception as e:\n context['error'] = '{} {}'.format(e, traceback.format_exc())\n\n # TOD...
[ "0.65461797", "0.6110669", "0.60014474", "0.5702793", "0.56802934", "0.5664144", "0.56525695", "0.5584406", "0.5498826", "0.5481742", "0.5451509", "0.54278344", "0.53596485", "0.53492475", "0.53231066", "0.52532625", "0.52472556", "0.5156872", "0.5120976", "0.51208967", "0.51...
0.6295193
1
This view returns the list of batches associated to a use case which have english language
def get_auto_anno_batch_list(request): json_resp = {} usecase = request.GET.get('usecase') # print(usecase) use_obj = UseCase.objects.get(name=usecase) json_resp['batch_list'] = [] languages = ['English','english'] batch = Report.objects.filter(name=use_obj,language__in = languages).exclude...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_auto_anno_PUBMED_batch_list(request):\n\n json_resp = {}\n usecase = request.GET.get('usecase')\n # print(usecase)\n languages = ['English', 'english']\n use_obj = UseCase.objects.get(name=usecase)\n json_resp['batch_list'] = []\n batch = Report.objects.filter(name=use_obj,language__in...
[ "0.6487992", "0.5999556", "0.58158106", "0.57203585", "0.5676394", "0.56275505", "0.5532938", "0.5520498", "0.5510358", "0.55094916", "0.5498899", "0.54472136", "0.53090847", "0.5303731", "0.52797216", "0.5278192", "0.52427185", "0.5226427", "0.5222747", "0.5220931", "0.52123...
0.6674985
0
This view returns the list of batches associated to a PUBMED use case
def get_PUBMED_batch_list(request): json_resp = {} usecase = request.GET.get('usecase') # print(usecase) use_obj = UseCase.objects.get(name=usecase) json_resp['batch_list'] = [] batch = Report.objects.filter(name=use_obj,institute = 'PUBMED').values('batch') for el in batch: if el['...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_batches(request):\n\n template = 'batch_list.html'\n\n context = {\n 'invalid_due_date': request.GET.get('invalid_due_date')\n }\n\n try:\n get_batches(request, context)\n except Exception as e:\n context['error'] = '{} {}'.format(e, traceback.format_exc())\n\n # TOD...
[ "0.6342829", "0.6229871", "0.59056467", "0.58580834", "0.5704401", "0.5654031", "0.5634934", "0.5585", "0.5473519", "0.53536516", "0.53245217", "0.53240734", "0.52888346", "0.5250839", "0.52369195", "0.5228739", "0.52019703", "0.5178603", "0.5165569", "0.5162922", "0.51555914...
0.6636962
0
This view returns the list of batches associated to a PUBMED use case in english language
def get_auto_anno_PUBMED_batch_list(request): json_resp = {} usecase = request.GET.get('usecase') # print(usecase) languages = ['English', 'english'] use_obj = UseCase.objects.get(name=usecase) json_resp['batch_list'] = [] batch = Report.objects.filter(name=use_obj,language__in = languages,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_PUBMED_batch_list(request):\n\n json_resp = {}\n usecase = request.GET.get('usecase')\n # print(usecase)\n use_obj = UseCase.objects.get(name=usecase)\n json_resp['batch_list'] = []\n batch = Report.objects.filter(name=use_obj,institute = 'PUBMED').values('batch')\n for el in batch:\n ...
[ "0.65641147", "0.6093252", "0.59606016", "0.5839453", "0.55629605", "0.5310953", "0.5296694", "0.51423275", "0.5020829", "0.49711797", "0.49675223", "0.496288", "0.49492076", "0.48867327", "0.48834974", "0.48540273", "0.48291108", "0.4824442", "0.48152086", "0.48104975", "0.4...
0.6816767
0
This view returns whether the automatic annotations are available given an id,language,usecase
def get_presence_robot_user(request): id_report = request.GET.get('id_report', None) language = request.GET.get('language', None) use = request.GET.get('usecase', None) rep = request.GET.get('report_type', None) json_resp = {'auto_annotation_count': 0} cursor = connection.cursor() reports_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def annotationlabel(request,action=None):\n\n username = request.session['username']\n mode1 = request.session['mode']\n auto_required = request.GET.get('ns_id', None)\n mode = NameSpace.objects.get(ns_id=mode1)\n\n # print('mode',mode1)\n usecase = request.session['usecase']\n # language = re...
[ "0.59271", "0.57985866", "0.56535566", "0.54744357", "0.5473918", "0.545701", "0.54296786", "0.5419987", "0.5314468", "0.52762425", "0.5261458", "0.5237899", "0.5226847", "0.52122855", "0.51996255", "0.51626873", "0.51587135", "0.50677544", "0.5053909", "0.5049901", "0.503424...
0.47268173
45
This view returns true if for a usecase there are only examode labels and concepts
def check_presence_exa_conc_lab(request): # reports = request.GET.get('reports',None) rep = request.GET.get('id_report',None) language = request.GET.get('language',None) usecase = request.GET.get('usecase',None) reports = None if request.method == 'POST': request_body_json = json.loads(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isOk(annots):\n if annots == []:\n return True\n for a in annots:\n for label in a.labels:\n if (label != 'hasOkCopies' and\n label != 'hasBadCopies' and\n not label.startswith('count_')):\n return False\n return True", "def get_uses_missing_exa(request):\n\n use_to_...
[ "0.5940529", "0.59398687", "0.5865526", "0.58527815", "0.5814739", "0.5643155", "0.5637188", "0.56277835", "0.5610501", "0.558338", "0.5558472", "0.5549566", "0.550001", "0.5440629", "0.5440629", "0.54309857", "0.54284567", "0.5419301", "0.5419301", "0.53711116", "0.5362047",...
0.5685875
5
This view handles the download of one or more reports' groundtruths (including the GT majority vote based.
def download_all_reports(request): request_body_json = json.loads(request.body) report_list = request_body_json['report_list'] mode = request_body_json['format'] action = request_body_json['action'] annot = request_body_json['annotation_mode'] if annot == 'Manual': annot = 'Human' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_all_ground_truths(request):\n\n json_resp = {}\n json_resp['ground_truth'] = []\n cursor = connection.cursor()\n mode = request.GET.get('gt_mode',None)\n if mode is None:\n human = NameSpace.objects.get(ns_id = 'Human')\n robot = NameSpace.objects.get(ns_id = 'Robot')\n ...
[ "0.6838261", "0.65341705", "0.62299836", "0.6090916", "0.59187865", "0.5832907", "0.5767083", "0.5675658", "0.56663036", "0.5666215", "0.5635911", "0.5478633", "0.5468885", "0.54647183", "0.54031974", "0.5370372", "0.53674585", "0.5365349", "0.5343065", "0.53406143", "0.53295...
0.65963656
1
This view returns the number of pubmed articles in the db
def check_PUBMED_reports(request): json_resp = {} json_resp['count'] = 0 pubmed_arts = Report.objects.filter(institute = 'PUBMED') for el in pubmed_arts: if el.id_report.startswith('PUBMED'): json_resp['count'] += 1 return JsonResponse(json_resp,safe=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_article_count(cls):\n return int(cls.db.get(\"article_count\"))", "def num_articles(self):\n\t\treturn len(index)", "def count_articles(all_articles):\n print(f\"There are {len(all_articles)} articles.\")", "def n_published():\r\n sql = text('''\r\n WITH published_apps as\r...
[ "0.717347", "0.7089709", "0.67698693", "0.67413735", "0.66592926", "0.66326725", "0.6570169", "0.65614486", "0.6494197", "0.6483129", "0.6440703", "0.62871206", "0.6274295", "0.6271812", "0.6266821", "0.6202164", "0.6179825", "0.61742187", "0.6136083", "0.6135398", "0.6103563...
0.6168546
18
This view returns the number of pubmed articles in the db
def check_medtag_reports(request): json_resp = {} json_resp['count'] = 0 medtag_arts = Report.objects.all().exclude(institute = 'PUBMED') # for el in pubmed_arts: # if el.id_report.startswith('PUBMED'): json_resp['count'] = medtag_arts.count() return JsonResponse(json_resp,safe=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_article_count(cls):\n return int(cls.db.get(\"article_count\"))", "def num_articles(self):\n\t\treturn len(index)", "def count_articles(all_articles):\n print(f\"There are {len(all_articles)} articles.\")", "def n_published():\r\n sql = text('''\r\n WITH published_apps as\r...
[ "0.7172277", "0.7088439", "0.6768442", "0.6739416", "0.6658017", "0.6632473", "0.6568596", "0.6559386", "0.64938533", "0.6480836", "0.64391303", "0.62844735", "0.62724674", "0.62704456", "0.6265808", "0.6203237", "0.6178769", "0.6171713", "0.6168154", "0.6135542", "0.6135206"...
0.5918936
36
This view returns the usecases which have not nor exa labels nor exa concepts
def get_uses_missing_exa(request): use_to_ret = {} use_to_ret['labels_present'] = [] use_to_ret['concepts_present'] = [] use_to_ret['labels_missing'] = [] use_to_ret['concepts_missing'] = [] uses = ['colon','uterine cervix','lung'] for el in uses: usecase = UseCase.objects.get(name=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_presence_exa_conc_lab(request):\n\n # reports = request.GET.get('reports',None)\n rep = request.GET.get('id_report',None)\n language = request.GET.get('language',None)\n usecase = request.GET.get('usecase',None)\n reports = None\n if request.method == 'POST':\n request_body_json ...
[ "0.59388274", "0.58805186", "0.58260775", "0.53480375", "0.53480375", "0.53390783", "0.5233926", "0.5202363", "0.5183914", "0.5163577", "0.5127641", "0.5122592", "0.5121663", "0.5119788", "0.51088226", "0.5098412", "0.5095758", "0.5095758", "0.50584406", "0.50419766", "0.5028...
0.7342495
0
This view handles the transfer of the ground truths from a user to another. COPY WHEN DATABASE IS SHARED
def handle_copy_rows(request): request_body_json = json.loads(request.body) username = request_body_json['username'] print(username) overwrite = request_body_json['overwrite'] if overwrite == 'true': overwrite = True elif overwrite == 'false': overwrite = False usecases = U...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_from_teamusercopy(apps, schema_editor):\n TeamUser = apps.get_model('status', 'TeamUser')\n TeamUserCopy = apps.get_model('status', 'TeamUserCopy')\n\n for teamusercopy in TeamUserCopy.objects.all():\n if TeamUser.objects.filter(team_id=teamusercopy.team_id, user_id=teamusercopy.user_id).c...
[ "0.5468712", "0.54597455", "0.53516954", "0.5244661", "0.52367324", "0.52106", "0.5095629", "0.5095629", "0.50866884", "0.50758433", "0.49885663", "0.49556786", "0.4921544", "0.4918357", "0.4901763", "0.48940924", "0.4889287", "0.48406535", "0.48265398", "0.48065147", "0.4802...
0.51210505
6
This view checks the files uploaded for the transfer of the groundtruths
def handle_check_upload_files(request): files = [] for filename, file in request.FILES.items(): files.append(file) json_message = check_uploaded_files(files) return JsonResponse(json_message)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_file_can_be_uploaded_and_viewed_by_correct_users(self):\n \n project = self.testproject \n \n name1 = self.giverandomfilename(self.root)\n name2 = self.giverandomfilename(self.projectadmin)\n name3 = self.giverandomfilename(self.participant)\n name4 ...
[ "0.71557355", "0.6669732", "0.6654686", "0.6649415", "0.6637934", "0.65880555", "0.6528329", "0.65050566", "0.64086163", "0.62588286", "0.62116396", "0.621024", "0.61883146", "0.61708736", "0.6109043", "0.6054689", "0.60014397", "0.59427094", "0.5915164", "0.5909347", "0.5896...
0.65448797
6
This view adds in the database the data included in the files uploaded for the transfer of the groundtruths
def handle_upload_files(request): files = [] for filename, file in request.FILES.items(): files.append(file) overwrite = request.POST.get('overwrite',None) if overwrite == 'false': overwrite = False elif overwrite == 'true': overwrite = True json_message = upload_files...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upload(request):\n gi = GalaxyInstance(url=request.session.get('server'), email=request.session.get('galaxyemail'), password=request.session.get(\"galaxypass\"))\n selected = request.POST.get('selected')\n selectedmeta = request.POST.get('meta')\n filetype = request.POST.get('filetype')\n dbkey ...
[ "0.69999224", "0.62321997", "0.6190771", "0.61144507", "0.6061765", "0.59894365", "0.59611374", "0.5958438", "0.59491634", "0.59320164", "0.59125924", "0.5912157", "0.58943003", "0.5881315", "0.58605087", "0.58275455", "0.5812308", "0.5809562", "0.5800417", "0.57793623", "0.5...
0.0
-1
This view returns the languages available for a report
def get_report_translations(request): id_report = request.GET.get('id_report',None) if id_report is not None: languages = [] lang = Report.objects.filter(id_report = id_report) for el in lang: if el.language not in languages: languages.append(el.language) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def languages(self):\r\n url = '{0}/{1}'.format(self.get_url(), 'languages')\r\n\r\n return http.Request('GET', url), parsers.parse_json", "def wikiLanguages():\n return languages", "def languages(self):\n\n return self._request('/languages')", "def languages():\n r = requests.get(...
[ "0.7279651", "0.72215253", "0.7170446", "0.6814636", "0.6712208", "0.66994166", "0.66713786", "0.6651076", "0.65438974", "0.6543734", "0.6529538", "0.65234035", "0.6458752", "0.64573747", "0.6453006", "0.6448716", "0.64473933", "0.64339", "0.64140487", "0.6352627", "0.633507"...
0.7563172
0
This view returns return the usecases of medtag reports
def medtag_reports(request): json_resp = {} json_resp['usecase'] = [] reps = Report.objects.all() for r in reps: if not r.id_report.startswith('PUBMED_') and not str(r.name_id) in json_resp['usecase']: json_resp['usecase'].append(str(r.name_id)) return JsonResponse(json_resp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_medtag_reports(request):\n\n json_resp = {}\n json_resp['count'] = 0\n medtag_arts = Report.objects.all().exclude(institute = 'PUBMED')\n # for el in pubmed_arts:\n # if el.id_report.startswith('PUBMED'):\n json_resp['count'] = medtag_arts.count()\n return JsonResponse(json_resp,...
[ "0.665116", "0.59123224", "0.55685633", "0.55224574", "0.5493389", "0.5459506", "0.54581726", "0.5311828", "0.530699", "0.52737117", "0.5272512", "0.527097", "0.52511895", "0.5246451", "0.5195243", "0.5169995", "0.51681095", "0.5164607", "0.51173073", "0.50936943", "0.5049706...
0.7262409
0
This view returns return the usecases of pubmed reports
def pubmed_reports(request): json_resp = {} json_resp['usecase'] = [] reps = Report.objects.all() for r in reps: if r.id_report.startswith('PUBMED_') and not str(r.name_id) in json_resp['usecase']: json_resp['usecase'].append(str(r.name_id)) return JsonResponse(json_resp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pubmed_missing_auto(request):\n\n usecases = UseCase.objects.all()\n json_resp = {}\n json_resp['annotated'] = 0\n json_resp['tot'] = 0\n json_resp['usecase'] = []\n languages = ['English','english']\n for el in usecases:\n use = el.name\n json_resp[use] = {}\n batches...
[ "0.6889685", "0.67816097", "0.6578456", "0.6462005", "0.6354941", "0.60960084", "0.6039205", "0.5924308", "0.59200716", "0.58842385", "0.58725315", "0.58610183", "0.58609855", "0.5834699", "0.5742797", "0.5734736", "0.572304", "0.56792724", "0.5666692", "0.56550825", "0.56486...
0.7125116
0
This view checks if a user has an associated gt for a report
def check_gt_existence(request): action = request.GET.get('action',None) id_report = request.GET.get('id_report',None) language = request.GET.get('language',None) username = request.session['username'] mode = request.session['mode'] cursor = connection.cursor() cursor.execute("SELECT COUNT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reported_by(self, user):\n return Report.objects.filter(recipe=self, chef=user).exists()", "def has_ta(self, user, allow_superusers=True):\n return (user.is_superuser and allow_superusers) or len(self.tas.filter(id=user.id)) > 0", "def _can_download_report(user):\r\n try:\r\n access...
[ "0.6260666", "0.6116303", "0.5899749", "0.5702829", "0.5593343", "0.5565848", "0.5547417", "0.5547417", "0.5541943", "0.5512871", "0.55068207", "0.5493356", "0.54900455", "0.5473812", "0.5417657", "0.53915375", "0.5383512", "0.53717935", "0.5370812", "0.53642553", "0.5324591"...
0.5986029
2
Returns the fuzz target of |benchmark|
def get_fuzz_target(benchmark): # Do this because of OSS-Fuzz-on-demand. # TODO(metzman): Use classes to mock a benchmark config for # OSS_FUZZ_ON_DEMAND. return benchmark_config.get_config(benchmark).get( 'fuzz_target', environment.get('FUZZ_TARGET'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fuzzer_benchmark_key(fuzzer: str, benchmark: str):\n return fuzzer + ' ' + benchmark", "def get_benchmark(self, benchmark):\n\t\tif not isinstance(benchmark, str) and not callable(benchmark): return benchmark\n\t\telif benchmark in self.classes:\treturn self.classes[benchmark]()\n\t\traise TypeError('...
[ "0.6541956", "0.62079185", "0.57205427", "0.5588023", "0.55567586", "0.543854", "0.54338294", "0.53948295", "0.5363798", "0.532333", "0.5268365", "0.5229397", "0.5206228", "0.51935446", "0.51308554", "0.5129264", "0.5088721", "0.5079886", "0.5032553", "0.5032553", "0.50242513...
0.8522614
0
Returns the project of |benchmark|
def get_project(benchmark): return benchmark_config.get_config(benchmark)['project']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def benchmark_result(self):\n return self._benchmark_id", "def benchmark_selection(self):\n return self._benchmark_selection", "def get_benchmark(client):\n r = client.get(config.API_PATH() + '/benchmarks')\n benchmarks = json.loads(r.data)\n return benchmarks['benchmarks'][0]['id']", ...
[ "0.6512932", "0.6404195", "0.634007", "0.62146837", "0.6029168", "0.59504235", "0.5943799", "0.5894067", "0.581235", "0.5640167", "0.54331803", "0.53937525", "0.53754103", "0.53711575", "0.53711575", "0.53711575", "0.53711575", "0.53711575", "0.53711575", "0.53711575", "0.537...
0.81019706
0
Returns the type of |benchmark|
def get_type(benchmark): # TODO(metzman): Use classes to mock a benchmark config for # OSS_FUZZ_ON_DEMAND. default_value = os.getenv('EXPERIMENT_TYPE', BenchmarkType.CODE.value) return benchmark_config.get_config(benchmark).get('type', default_value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_benchmark(self, benchmark):\n\t\tif not isinstance(benchmark, str) and not callable(benchmark): return benchmark\n\t\telif benchmark in self.classes:\treturn self.classes[benchmark]()\n\t\traise TypeError('Passed benchmark is not defined!')", "def validate_type(benchmark):\n benchmark_type = get_type(...
[ "0.7427512", "0.6534945", "0.6310375", "0.63042027", "0.6122598", "0.6042788", "0.58986205", "0.58470327", "0.58307236", "0.58241946", "0.5813828", "0.5782032", "0.5728832", "0.570958", "0.5697104", "0.56663436", "0.56439966", "0.5572599", "0.5552849", "0.5550577", "0.5532445...
0.8139171
0
Get the URL of the docker runner image for fuzzing the benchmark with fuzzer.
def get_runner_image_url(experiment, benchmark, fuzzer, docker_registry): tag = 'latest' if environment.get('LOCAL_EXPERIMENT') else experiment return f'{docker_registry}/runners/{fuzzer}/{benchmark}:{tag}'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_builder_image_url(benchmark, fuzzer, docker_registry):\n return f'{docker_registry}/builders/{fuzzer}/{benchmark}'", "def _to_dockerfile_url(image):\n path = \"/\".join((image.platform, image.release, image.architecture, \"Dockerfile\"))\n return git.get_github_blob_url(path, ref=f\"v{image.vers...
[ "0.8196786", "0.6458271", "0.5928085", "0.5869728", "0.5578148", "0.55031866", "0.5449406", "0.54289633", "0.5422988", "0.53856117", "0.5382283", "0.534175", "0.5297771", "0.5248548", "0.5238496", "0.5210609", "0.5198708", "0.519582", "0.5189414", "0.512294", "0.51160717", ...
0.87715006
0
Get the URL of the docker builder image for fuzzing the benchmark with fuzzer.
def get_builder_image_url(benchmark, fuzzer, docker_registry): return f'{docker_registry}/builders/{fuzzer}/{benchmark}'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_runner_image_url(experiment, benchmark, fuzzer, docker_registry):\n tag = 'latest' if environment.get('LOCAL_EXPERIMENT') else experiment\n return f'{docker_registry}/runners/{fuzzer}/{benchmark}:{tag}'", "def _to_dockerfile_url(image):\n path = \"/\".join((image.platform, image.release, image.a...
[ "0.800936", "0.68247736", "0.62919927", "0.6119331", "0.60827637", "0.5836558", "0.5680232", "0.5606805", "0.5593281", "0.55321765", "0.5527971", "0.55201703", "0.5511697", "0.5464959", "0.5450358", "0.5436414", "0.5423743", "0.5383551", "0.53793126", "0.5351387", "0.53473455...
0.8987414
0
Returns True if |benchmark| is a valid fuzzbench benchmark name.
def validate_name(benchmark): if VALID_BENCHMARK_REGEX.match(benchmark) is None: logs.error('%s does not conform to %s pattern.', benchmark, VALID_BENCHMARK_REGEX.pattern) return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate(benchmark):\n if not validate_name(benchmark):\n return False\n\n if benchmark not in get_all_benchmarks():\n logs.error('%s must have a benchmark.yaml.', benchmark)\n return False\n\n # Validate config file can be parsed.\n try:\n get_fuzz_target(benchmark)\n ...
[ "0.75245595", "0.70732296", "0.5810576", "0.5674972", "0.5586452", "0.55509335", "0.55345166", "0.5492754", "0.54216146", "0.5396599", "0.533939", "0.52890986", "0.52809453", "0.5276064", "0.5262049", "0.5236118", "0.5226639", "0.51745903", "0.51519513", "0.51472944", "0.5053...
0.816597
0
Returns True if |benchmark| has a valid type.
def validate_type(benchmark): benchmark_type = get_type(benchmark) if benchmark_type not in BENCHMARK_TYPE_STRS: logs.error('%s has an invalid benchmark type %s, must be one of %s', benchmark, benchmark_type, BENCHMARK_TYPE_STRS) return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate(benchmark):\n if not validate_name(benchmark):\n return False\n\n if benchmark not in get_all_benchmarks():\n logs.error('%s must have a benchmark.yaml.', benchmark)\n return False\n\n # Validate config file can be parsed.\n try:\n get_fuzz_target(benchmark)\n ...
[ "0.6986698", "0.6440675", "0.6303851", "0.62154716", "0.6090882", "0.608178", "0.6064316", "0.6046675", "0.5970051", "0.5952641", "0.58843154", "0.58391774", "0.5755268", "0.57513607", "0.5732901", "0.57144207", "0.56996477", "0.56742626", "0.55769104", "0.5570763", "0.556722...
0.837678
0
Returns True if |benchmark| is a valid fuzzbench benchmark.
def validate(benchmark): if not validate_name(benchmark): return False if benchmark not in get_all_benchmarks(): logs.error('%s must have a benchmark.yaml.', benchmark) return False # Validate config file can be parsed. try: get_fuzz_target(benchmark) except yaml.pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_type(benchmark):\n benchmark_type = get_type(benchmark)\n if benchmark_type not in BENCHMARK_TYPE_STRS:\n logs.error('%s has an invalid benchmark type %s, must be one of %s',\n benchmark, benchmark_type, BENCHMARK_TYPE_STRS)\n return False\n return True", "de...
[ "0.69998956", "0.67811495", "0.5615518", "0.5273485", "0.5138776", "0.5041119", "0.48480907", "0.48040372", "0.47753853", "0.47583094", "0.4682528", "0.4670917", "0.466327", "0.4620052", "0.45891234", "0.45834735", "0.45678422", "0.4562975", "0.45465788", "0.45328742", "0.451...
0.7685098
0
Returns the list of all benchmarks.
def get_all_benchmarks(): all_benchmarks = [] for benchmark in os.listdir(BENCHMARKS_DIR): benchmark_path = os.path.join(BENCHMARKS_DIR, benchmark) if os.path.isfile(os.path.join(benchmark_path, 'benchmark.yaml')): all_benchmarks.append(benchmark) return sorted(all_benchmarks)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_all(self):\n runs = []\n for run in self.benchmarks:\n run.start()\n run.wait()\n runs.append(run.metadata)\n return runs", "def list(self, classes):\n\n def add(benchmarks, parts, flags, exclude):\n if (\n flags[\"lan...
[ "0.71444166", "0.6889727", "0.64351124", "0.6397667", "0.6397363", "0.62924254", "0.6077235", "0.59082776", "0.58880574", "0.57301986", "0.56475395", "0.5644938", "0.5587757", "0.55655915", "0.5550465", "0.5548563", "0.5522972", "0.5509917", "0.5496706", "0.54954356", "0.5495...
0.79568917
0
Returns the list of all coverage benchmarks.
def get_coverage_benchmarks(): return [ benchmark for benchmark in get_all_benchmarks() if get_type(benchmark) == BenchmarkType.CODE.value ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_benchmarks():\n all_benchmarks = []\n for benchmark in os.listdir(BENCHMARKS_DIR):\n benchmark_path = os.path.join(BENCHMARKS_DIR, benchmark)\n if os.path.isfile(os.path.join(benchmark_path, 'benchmark.yaml')):\n all_benchmarks.append(benchmark)\n return sorted(all_ben...
[ "0.6990162", "0.6294294", "0.61898667", "0.57358605", "0.5668825", "0.5625119", "0.5591114", "0.54327077", "0.5404844", "0.5391268", "0.53692985", "0.5357925", "0.5353722", "0.5342524", "0.53213197", "0.5292404", "0.52296937", "0.52178067", "0.5196261", "0.51935357", "0.51894...
0.80346346
0
Returns the list of standard bug benchmarks.
def get_bug_benchmarks(): return [ benchmark for benchmark in get_all_benchmarks() if get_type(benchmark) == BenchmarkType.BUG.value ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_benchmarks():\n all_benchmarks = []\n for benchmark in os.listdir(BENCHMARKS_DIR):\n benchmark_path = os.path.join(BENCHMARKS_DIR, benchmark)\n if os.path.isfile(os.path.join(benchmark_path, 'benchmark.yaml')):\n all_benchmarks.append(benchmark)\n return sorted(all_ben...
[ "0.6447797", "0.58259064", "0.5799858", "0.5799062", "0.5770896", "0.5712318", "0.5706508", "0.5695553", "0.5673421", "0.5479634", "0.54711425", "0.5403768", "0.5383399", "0.5374102", "0.5373461", "0.5352589", "0.5352316", "0.5337508", "0.5330979", "0.53233963", "0.5322599", ...
0.8056906
0
Returns True if |benchmark| is written in C/C++.
def is_cpp(benchmark): return get_language(benchmark) == 'c++'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _c_optimizations_required():\n pure_env = os.environ.get('PURE_PYTHON')\n require_c = pure_env == \"0\"\n return require_c", "def _should_attempt_c_optimizations():\n if PYPY:\n return False\n\n if _c_optimizations_required():\n return True\n return not _c_optimizations_ignore...
[ "0.6263037", "0.6229608", "0.6097612", "0.6020831", "0.5982895", "0.58478355", "0.57693976", "0.57392836", "0.5669367", "0.55203027", "0.5460529", "0.53889805", "0.5354336", "0.5303164", "0.5300068", "0.5299565", "0.5283687", "0.5242149", "0.52138", "0.5201266", "0.5121601", ...
0.82368374
0
Returns |benchmarks| with only benchmarks written in C/C++.
def exclude_non_cpp(benchmarks): return [benchmark for benchmark in benchmarks if is_cpp(benchmark)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_coverage_benchmarks():\n return [\n benchmark for benchmark in get_all_benchmarks()\n if get_type(benchmark) == BenchmarkType.CODE.value\n ]", "def get_bug_benchmarks():\n return [\n benchmark for benchmark in get_all_benchmarks()\n if get_type(benchmark) == Benchmark...
[ "0.69631344", "0.64020723", "0.61482394", "0.56974643", "0.5492792", "0.54700804", "0.5441572", "0.5409977", "0.5309843", "0.52634937", "0.5233209", "0.52182776", "0.52005297", "0.5169763", "0.5148801", "0.51456755", "0.51412374", "0.51203877", "0.5105856", "0.5091856", "0.50...
0.801431
0
Returns the prorgamming language the benchmark was written in.
def get_language(benchmark): config = benchmark_config.get_config(benchmark) return config.get('language', 'c++')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def programming_language(self) -> str:\n return self.random.choice(PROGRAMMING_LANGS)", "def generation_language(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"generation_language\")", "def code(self):\n return self.language()", "def language(self):\n return \"...
[ "0.72861236", "0.65404236", "0.6198768", "0.61458135", "0.6069835", "0.6027784", "0.59970075", "0.5983806", "0.5961204", "0.5961204", "0.5915103", "0.5895517", "0.5860599", "0.58391285", "0.58170784", "0.57956773", "0.5790107", "0.57584816", "0.57295835", "0.572077", "0.57125...
0.76412416
0
Remove any nonwhite listed chars from a string
def _filter_string(cls, string, extra_chars=""): char_white_list = ascii_letters + digits + extra_chars return "".join([char for char in string if char in char_white_list])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _removeWhitespaces(self, s):\n return s.translate({ord(c): None for c in string.whitespace})", "def filter(string):\n # remove all unwanted characters\n return regex2.sub(' ', string)", "def stripword( s ) :\n return re.sub( '[\\W\\d]', '', s )", "def string_cleanup(s, garbage=\":,-()&\")...
[ "0.7945294", "0.7738483", "0.7600506", "0.75452673", "0.74735063", "0.7469556", "0.7400172", "0.73478335", "0.73437715", "0.73410106", "0.7331665", "0.7326543", "0.7289203", "0.72830564", "0.728172", "0.727238", "0.7259143", "0.7258027", "0.72176147", "0.7203688", "0.72031343...
0.7396111
7
Return the object whose id is _id
def by_id(cls, _id): return dbsession.query(cls).filter_by(id=_id).first()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_object(id):", "def get_object(self, id_):\n return self._objects.get(id_, None)", "def at(cls, _id):\n return cls.where(cls.primarykey == _id)", "def get(self, _id):", "def get_object(self, id=None):\n if id is None and self.kwargs.get('field') == 'id':\n id = self.k...
[ "0.85694164", "0.8270094", "0.7589233", "0.75782853", "0.7455623", "0.7441776", "0.7432799", "0.7382152", "0.73811334", "0.7301479", "0.72642654", "0.7239448", "0.7217969", "0.72114927", "0.71807003", "0.7132641", "0.71304023", "0.71304023", "0.7111594", "0.70885956", "0.7020...
0.7470613
6
Return the object whose uuid is _uuid
def by_uuid(cls, _uuid): return dbsession.query(cls).filter_by(uuid=_uuid).first()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_by_uuid(self, uuid):\n return self.get(uuid=uuid)", "def by_uuid(cls, uuid):\n return dbsession.query(cls).filter_by(uuid=uuid).first()", "def find(cls, uuid):\n entries = cls.objects.filter(uuid=uuid)\n if not entries:\n return None\n else:\n re...
[ "0.82511705", "0.7933739", "0.7587574", "0.74948627", "0.74105513", "0.705008", "0.69275194", "0.6883316", "0.68186414", "0.68186414", "0.6762099", "0.6762099", "0.6734712", "0.67203295", "0.6711133", "0.66830343", "0.6674249", "0.6659611", "0.6656396", "0.6648054", "0.660445...
0.7979588
2
Return the object whose name is _name
def by_name(cls, name): return dbsession.query(cls).filter_by(_name=str(name)).first()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_real_object(self, name):\n name = name if isinstance(name, str) else name.name\n for obj in self._objects:\n if name == obj.name:\n return obj\n else:\n raise ValueError(\"Cannot retrieve object. Unknown name {}. \".format(name))", "def getObject...
[ "0.81269974", "0.80951434", "0.7999025", "0.79542536", "0.79282635", "0.7537779", "0.73879355", "0.73344094", "0.7329022", "0.7317708", "0.7281263", "0.7255151", "0.7209064", "0.7190735", "0.71191245", "0.7043156", "0.7034967", "0.703377", "0.703377", "0.69024086", "0.683505"...
0.72039217
15
Remove any nonwhite listed chars from a string
def _filter_string(cls, string, extra_chars=""): char_white_list = ascii_letters + digits + extra_chars return "".join([char for char in string if char in char_white_list])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _removeWhitespaces(self, s):\n return s.translate({ord(c): None for c in string.whitespace})", "def filter(string):\n # remove all unwanted characters\n return regex2.sub(' ', string)", "def stripword( s ) :\n return re.sub( '[\\W\\d]', '', s )", "def string_cleanup(s, garbage=\":,-()&\")...
[ "0.7945294", "0.7738483", "0.7600506", "0.75452673", "0.74735063", "0.7469556", "0.7400172", "0.73478335", "0.73437715", "0.73410106", "0.7331665", "0.7326543", "0.7289203", "0.72830564", "0.728172", "0.727238", "0.7259143", "0.7258027", "0.72176147", "0.7203688", "0.72031343...
0.7396111
8
Returns list of IDs of tags for specified model name by (code, name) pair
def get_tag_ids(self, cr, uid, model, code=None, name=None, context=None): assert bool(code) or bool(name), "code or name must not be None! (code=%s;name=%s)" % (code, name) tag_domain = [('model_id.model', '=', model)] if code is not None: tag_domain.append(('code', '=', code)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getTagIDs(self):\n paths = self._criteria.get('paths')\n if paths:\n store = getMainStore()\n return list(store.find(Tag.id, Tag.path.is_in(paths)))", "def get_tag_ids(tag_names):\n\ttag_names = tuple(tag_names)\n\twith postgres, postgres.cursor() as cur:\n\t\tcur.execute...
[ "0.6331528", "0.61098045", "0.5848875", "0.5817225", "0.57898426", "0.57898426", "0.5781574", "0.5777682", "0.5743095", "0.56093746", "0.5590287", "0.5589514", "0.5496177", "0.54333645", "0.5430249", "0.5416349", "0.54159564", "0.54110205", "0.54062647", "0.53955483", "0.5384...
0.8124625
0
Adds tag new tag to object.
def add_tag(self, cr, uid, ids, code=None, name=None, create=False, context=None): tag_obj = self.pool.get('res.tag') tag_ids = tag_obj.get_tag_ids(cr, uid, self._name, code=code, name=name, context=context) if not tag_ids and create: model_id = self.pool.get('res.tag.model').search(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, tag):\n self.tags[tag.name] = tag", "def add_tag(self, tag):\n self.tags.append(tag)", "def add_tag(self, obj, tag_name):\r\n tag_names = parse_tag_input(tag_name)\r\n if not len(tag_names):\r\n raise AttributeError(_('No tags were given: \"%s\".') % tag_nam...
[ "0.8477626", "0.83942044", "0.7990679", "0.79390234", "0.77830034", "0.7674143", "0.7644332", "0.761934", "0.72644126", "0.7179257", "0.7171568", "0.71568304", "0.70963436", "0.70908105", "0.6981176", "0.69674325", "0.69674325", "0.69674325", "0.69674325", "0.68249136", "0.68...
0.0
-1
Removes tags specified by code/name from specified cargoes
def remove_tag(self, cr, uid, ids, code=None, name=None, context=None): tag_obj = self.pool.get('res.tag') tag_ids = tag_obj.get_tag_ids(cr, uid, self._name, code=code, name=name, context=context) if tag_ids: self.write(cr, uid, ids, {'tag_ids': [(3, tid) for tid in tag_ids]}, conte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_tag(args):", "def remove_tags(self, tags):\n\n tags = H.to_list(tags)\n # self._tags.difference_update(tags)\n self.tags.difference_update(tags)", "def remove_tags(html, *tags):\n to_remove = []\n for t in tags:\n to_remove.extend(list(_make_tag_patterns(t)))\n r...
[ "0.7223684", "0.65725476", "0.6513158", "0.64437586", "0.64056754", "0.6315268", "0.6279433", "0.6213618", "0.6207464", "0.6185791", "0.6162285", "0.60926586", "0.6090244", "0.6027659", "0.5954956", "0.5875241", "0.58474445", "0.58383733", "0.5830504", "0.5779694", "0.5775148...
0.56744355
26
Checks if all of supplied objects have tag with specified code and/or name Return True if all object ids has specified tags
def check_tag(self, cr, uid, ids, code=None, name=None, context=None): assert bool(code is None) or bool(name is None), "code or name must not be None" tag_domain = [('id', 'in', ids)] if code is not None: tag_domain.append(('tag_ids.code', '=', code)) if name is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_for_tag(tags, tagged_events):\n found_tags = set()\n tags_set = set(tags)\n for tag in tags:\n for tag_event in tagged_events:\n if tag in tag_event[1][\"tag\"][\"labels\"]:\n found_tags.add(tag)\n not_found = tags_set - found_tags\n tag_status = {}\n fo...
[ "0.61141014", "0.6103309", "0.5986072", "0.5873774", "0.5779968", "0.57688856", "0.57678956", "0.576175", "0.5726771", "0.57225233", "0.57074004", "0.563474", "0.5622186", "0.5621437", "0.5620893", "0.56001145", "0.55933976", "0.55933976", "0.5574528", "0.5566219", "0.5503636...
0.67218775
0
A simple slug generator. Slugs are pure ASCII lowercase strings that can be used in URLs an other places where a name has to be machinesafe.
def slugify(value: Any, sep: str = "-") -> Optional[str]: text = stringify(value) if text is None: return None text = text.replace(sep, WS) # run this first because it'll give better results on special # characters. text = category_replace(text, SLUG_CATEGORIES) text = latinize_text(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_slug(self):\n return slugify(self.name)", "def generate_slug(name):\n # Slugify the title and check\n slug = secure_filename(name).lower().replace('_', '-')\n slug_n = slug\n n = 1\n\n # Append an increasing number to the slug until we find an available url\n while not slug_...
[ "0.7597692", "0.7439659", "0.7417883", "0.7406391", "0.73748773", "0.7310329", "0.72734207", "0.72529685", "0.717194", "0.7162989", "0.70815015", "0.70509", "0.70415765", "0.7019472", "0.69859445", "0.6970225", "0.694027", "0.69378775", "0.6929656", "0.68890053", "0.68677574"...
0.0
-1
(train / valid / test) are all using data from 20102017
def split_dataset(valid_datetime): print("all_frames: ", valid_datetime.shape[0]) print("valid_frames: ", np.sum(valid_datetime[:,1])) print("no_valid_frames: ", np.sum(1-valid_datetime[:,1])) valid_datetime_bool = (valid_datetime[:,1] == 1) valid_datetime_idx = np.where(valid_datetime_bool)[0] valid_datetime = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_data(self):\n\n return self.__valid_data, self.__valid_labels", "def test_training(self):\n\t\tpass", "def prep_data_fn(self, st_train_dt, end_train_dt, st_val_dt, end_val_dt, st_test_dt, end_test_dt):\n df = self.get_prep_data()\n train = df[(df['ft_data_dt'] >= st_train_dt) & (d...
[ "0.70418376", "0.6841699", "0.68156826", "0.67502785", "0.6705622", "0.66910946", "0.66823065", "0.6620052", "0.66126984", "0.6508516", "0.64929533", "0.6471718", "0.644612", "0.6441467", "0.64393294", "0.64252573", "0.64106035", "0.6407785", "0.6401149", "0.6393558", "0.6393...
0.6403365
18
read train/valid/test datetime set
def read_datetime_set(filename, seq_len): date_set = [] with open(os.path.join(info_path, "squence_len_{}".format(seq_len), filename), 'r') as f: for line in f: new_line = line.rstrip('\n').split('\t') date_set.append([int(new_line[0]), int(new_line[1])]) return np.array(date_set)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_dataset(valid_datetime):\n\tprint(\"all_frames: \", valid_datetime.shape[0])\n\tprint(\"valid_frames: \", np.sum(valid_datetime[:,1]))\n\tprint(\"no_valid_frames: \", np.sum(1-valid_datetime[:,1]))\n\n\tvalid_datetime_bool = (valid_datetime[:,1] == 1)\n\tvalid_datetime_idx = np.where(valid_datetime_bool)...
[ "0.66455895", "0.6168198", "0.6038736", "0.6012535", "0.59450936", "0.5928109", "0.5890639", "0.5885514", "0.58625025", "0.58129436", "0.57628024", "0.57618076", "0.5719605", "0.5701487", "0.5698947", "0.569637", "0.5668824", "0.5663031", "0.565223", "0.5649751", "0.5647297",...
0.6003768
4
Take the path to a raw json asset and convert it to target directory.
def processed_json_dir(path): return os.path.dirname(path.replace(RAW_ASSETS_PATH, ASSETS_PATH))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def processed_json_path(path):\n return path.replace(RAW_ASSETS_PATH, ASSETS_PATH).replace('.json', '.bin')", "def copy_json():\n sourcePath = 'contents/external/'\n targetPath = 'build/external/'\n for base,subdirs,files in os.walk(sourcePath):\n for file in files:\n orig = os.path.j...
[ "0.7122769", "0.6316052", "0.5610777", "0.54790395", "0.52522516", "0.522991", "0.5213277", "0.51795095", "0.51795095", "0.51695764", "0.51168185", "0.5074967", "0.5063665", "0.50393045", "0.50152886", "0.4990693", "0.49906608", "0.49886268", "0.49885842", "0.49729767", "0.49...
0.6894641
1
Initializes this object's schema, input_files and output_path.
def __init__(self, schema, input_files, output_path): self.schema = schema self.input_files = input_files self.output_path = output_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n\n self.read_input_file()\n self.read_simulation_files()", "def __init__(self):\n\t\tself.parsed = False\n\t\tdir_path = os.path.dirname(os.path.realpath(__file__))\n\t\tself.xsdfilename = os.path.join(dir_path, 'xml', 'schema.xsd')\n\t\tself.schema = 'schema.xsd'\n\t\tself.pr...
[ "0.69186145", "0.6781864", "0.6756163", "0.6735031", "0.6637486", "0.6575436", "0.6545899", "0.65405905", "0.6535554", "0.65054566", "0.6497379", "0.6446711", "0.6439875", "0.64162254", "0.6388665", "0.63697845", "0.63621044", "0.63425386", "0.6337463", "0.6333185", "0.633097...
0.8291974
0
Take the path to a raw png asset and convert it to target webp path.
def processed_texture_path(path): return path.replace(RAW_ASSETS_PATH, ASSETS_PATH).replace('png', 'webp')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def img2webp(path):\n file, ext = os.path.splitext(path)\n image = Image.open(path).convert(\"RGBA\")\n image = ImageOps.expand(image, 75)\n image.save(file + \".webp\", \"WEBP\")\n os.remove(path)", "def image_webp():\n data = resource(\"images/wolf_1.webp\")\n return Response(data, headers...
[ "0.66254675", "0.6108834", "0.59269124", "0.57612014", "0.54063636", "0.5362226", "0.5322664", "0.53141046", "0.5290474", "0.5259612", "0.520573", "0.51810825", "0.51549965", "0.51190436", "0.5110097", "0.51075953", "0.50395477", "0.5022422", "0.48821872", "0.48676977", "0.48...
0.72864443
0
Searches for a file with named `name` in the given paths and returns it.
def find_executable(name, paths): for path in paths: full_path = os.path.join(path, name) if os.path.isfile(full_path): return full_path # If not found, just assume it's in the PATH. return name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_in_paths(name, paths):\n for path in paths:\n file_ = osp.join(path, name)\n if osp.exists(file_) and not osp.isdir(file_):\n abs_file = osp.abspath(file_)\n if os.access(file_, os.X_OK):\n return abs_file", "def search_file(file_name, search_path):\...
[ "0.80682737", "0.72417116", "0.706997", "0.7050534", "0.67950416", "0.6720487", "0.67091864", "0.6678427", "0.6671641", "0.6649197", "0.6628015", "0.6592693", "0.6471008", "0.6440933", "0.64034975", "0.63482285", "0.63181823", "0.63181823", "0.6291936", "0.62775", "0.62671673...
0.66123325
11
Run the flatbuffer compiler on the given json file and schema.
def convert_json_to_flatbuffer_binary(json, schema, out_dir): command = [FLATC, '-o', out_dir, '-b', schema, json] run_subprocess(command)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(\n self,\n input_file=sys.stdin,\n output_file=sys.stdout,\n schema_map=None,\n ):\n schema_map, error_logs = self.deduce_schema(\n input_file, schema_map=schema_map\n )\n\n for error in error_logs:\n logging.info(\n f...
[ "0.6357114", "0.634119", "0.6240263", "0.6036583", "0.598429", "0.59565043", "0.57677084", "0.56092983", "0.5584701", "0.55134827", "0.54945713", "0.5492932", "0.5417545", "0.5400936", "0.5390043", "0.53854465", "0.5339671", "0.53241897", "0.5318094", "0.5313744", "0.5285585"...
0.69766474
0
Run the webp converter on the given png file.
def convert_png_image_to_webp(png, out, quality=80): command = [CWEBP, '-q', str(quality), png, '-o', out] run_subprocess(command)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def img2webp(path):\n file, ext = os.path.splitext(path)\n image = Image.open(path).convert(\"RGBA\")\n image = ImageOps.expand(image, 75)\n image.save(file + \".webp\", \"WEBP\")\n os.remove(path)", "def generate_webp_textures():\n input_files = PNG_TEXTURES['input_files']\n output_files = PNG_...
[ "0.59895134", "0.5819123", "0.5774753", "0.5767522", "0.57351494", "0.57216007", "0.56728303", "0.5661198", "0.5626706", "0.55680203", "0.5460881", "0.5396583", "0.53937674", "0.5302584", "0.5294534", "0.5288155", "0.52613574", "0.523901", "0.51677066", "0.5115962", "0.510950...
0.67798376
0
Checks if the source file needs to be rebuilt.
def needs_rebuild(source, target): return not os.path.isfile(target) or ( os.path.getmtime(source) > os.path.getmtime(target))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_source_file( self ):\n return self._source_file is not None", "def source_changed(source, cache):\n return os.path.getmtime(source)>os.path.getmtime(cache)", "def should_run(self):\n # from IPython.html.tasks.py\n\n css_targets = [pjoin(static, 'css', 'style.min.css')]\n ...
[ "0.6899336", "0.66479534", "0.6410455", "0.63760024", "0.63628346", "0.63059103", "0.62350976", "0.619009", "0.61705863", "0.615026", "0.6144818", "0.6059382", "0.6036777", "0.5976113", "0.5958864", "0.5946087", "0.5920723", "0.591227", "0.5905643", "0.58806807", "0.58798784"...
0.78058094
0
Take the path to a raw json asset and convert it to target bin path.
def processed_json_path(path): return path.replace(RAW_ASSETS_PATH, ASSETS_PATH).replace('.json', '.bin')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def processed_json_dir(path):\n return os.path.dirname(path.replace(RAW_ASSETS_PATH, ASSETS_PATH))", "def processed_texture_path(path):\n return path.replace(RAW_ASSETS_PATH, ASSETS_PATH).replace('png', 'webp')", "def copy_json():\n sourcePath = 'contents/external/'\n targetPath = 'build/external/'\n ...
[ "0.61563104", "0.57579714", "0.54303104", "0.5163897", "0.5136838", "0.5134525", "0.50500184", "0.50419426", "0.50137776", "0.50136286", "0.50113374", "0.49979314", "0.49422348", "0.49397087", "0.493285", "0.49240142", "0.49194804", "0.48922402", "0.48879048", "0.487408", "0....
0.74835473
0
Run the flatbuffer compiler on the all of the flatbuffer json files.
def generate_flatbuffer_binaries(): for element in FLATBUFFERS_CONVERSION_DATA: schema = element.schema output_path = element.output_path if not os.path.exists(output_path): os.makedirs(output_path) for json in element.input_files: target = processed_json_path(json) if needs_rebuild(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n os.makedirs(PATH)\n fetch_data()\n convert_to_json(model_list, 'models.json', is_model=True)\n convert_to_json(backend_list, 'backends.json')\n convert_to_json(type_list, 'types.json')\n convert_to_json(featurizer_list, 'featurizers.json')", "def main(gtfs_file, input_json_file):\...
[ "0.608436", "0.6008992", "0.59380484", "0.5935062", "0.5781285", "0.5768037", "0.5759169", "0.57256293", "0.57182896", "0.5655328", "0.5653805", "0.56392854", "0.5626525", "0.55395234", "0.5531216", "0.5497599", "0.5481104", "0.54802907", "0.5461012", "0.5456868", "0.5416904"...
0.73920244
0
Run the webp converter on off of the png files.
def generate_webp_textures(): input_files = PNG_TEXTURES['input_files'] output_files = PNG_TEXTURES['output_files'] if not os.path.exists(TEXTURE_PATH): os.makedirs(TEXTURE_PATH) for png, out in zip(input_files, output_files): if needs_rebuild(png, out): convert_png_image_to_webp(png, out, WEBP_QU...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n argvs = sys.argv\n argc = len(argvs)\n if argc == 1:\n print('usage: convert2png.py <path/to/*.ppm> ...')\n sys.exit(1)\n\n os.makedirs('result/convert2png', exist_ok=True)\n\n for i in range(1, argc):\n img = cv2.imread(argvs[i])\n\n # root, ext = os.path.s...
[ "0.6570944", "0.64156437", "0.61769783", "0.5975264", "0.5974723", "0.5941165", "0.59038806", "0.5838966", "0.58314997", "0.5811597", "0.5809414", "0.5798533", "0.5736212", "0.56903666", "0.56399405", "0.56066835", "0.557636", "0.557636", "0.5565635", "0.5556461", "0.55448854...
0.70537895
0
Delete all the processed webp textures.
def clean_webp_textures(): for webp in PNG_TEXTURES['output_files']: if os.path.isfile(webp): os.remove(webp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean():\n clean_flatbuffer_binaries()\n clean_webp_textures()", "def delete(self):\n\t\tif self.hasUdim:\n\t\t\tfor a in self.udimPaths:\n\t\t\t\ta.delete()\n\t\telse:\n\t\t\tsuper( textureFile, self ).delete()", "def destroy(self):\n\n self.cmapTexture.destroy()\n\n for tex in (self.modul...
[ "0.70913655", "0.6556138", "0.6525104", "0.6477908", "0.6368207", "0.6253116", "0.62028897", "0.6191404", "0.6172181", "0.6160886", "0.6124062", "0.6107779", "0.60488415", "0.60330206", "0.6033018", "0.6028536", "0.6020569", "0.6011445", "0.5983217", "0.590569", "0.5905648", ...
0.8128452
0
Delete all the processed flatbuffer binaries.
def clean_flatbuffer_binaries(): for element in FLATBUFFERS_CONVERSION_DATA: for json in element.input_files: path = processed_json_path(json) if os.path.isfile(path): os.remove(path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean():\n clean_flatbuffer_binaries()\n clean_webp_textures()", "def clean(self):\n # Delete vertices / faces / colors / normals :\n self._vert_buffer.delete()\n self._index_buffer.delete()\n self._normals_buffer.delete()\n self._xrange_buffer.delete()\n self._mat...
[ "0.7080938", "0.6617103", "0.64717567", "0.6464323", "0.6414247", "0.6351224", "0.6346113", "0.6323048", "0.6296938", "0.62765425", "0.6252906", "0.6217102", "0.61619747", "0.61525744", "0.6143297", "0.6128095", "0.6123065", "0.6101668", "0.60976034", "0.6087722", "0.6086085"...
0.7819535
0