query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Generates site containing first page of recipes list sorted by published_date.
def recipes_list(request): recipes = Recipe.objects.all().order_by('published_date') # prawidlowy sposob zbierania URLa - object.image.url # recipe = recipes[0] # print("path: " + recipe.image.url) paginator = Paginator(recipes, INITIAL_PAGE_SIZE) page = paginator.page(1) context = { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recipes_page(request):\n page_number = request.GET.get('page', None)\n if page_number is None:\n raise Http404\n\n # Get sorting parameter, if none is provides, sort by published_date\n sorting = request.GET.get('sorting', 'published_date')\n\n possible_sortings = ['up_votes', 'published_...
[ "0.6796219", "0.6157274", "0.61321515", "0.5978671", "0.5944646", "0.5935294", "0.5908201", "0.5867303", "0.5837911", "0.5787703", "0.57855505", "0.57358456", "0.5721771", "0.57205456", "0.57116795", "0.56696147", "0.56615347", "0.5653457", "0.55879027", "0.55861884", "0.5579...
0.6504416
1
View responding to AJAX request for list of all ingredients currently stored in database.
def get_ingredients(request): items = Ingredient.objects.all().order_by('name') # return list of {item.name: item.pk} context = [] for item in items: context.append({item.name: item.pk}) return HttpResponse(json.dumps(context), content_type='application/json')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _show_ingredient_list(self):\n if self._ingredients_view:\n self._ingredients_view.destroy()\n\n username = self.food_service.get_user().get_username()\n ingredients = self.food_service.list_added_ingredients(username, expire=True)\n self._ingredients_view = IngredientsVi...
[ "0.71443564", "0.6621847", "0.6533707", "0.6456862", "0.63419956", "0.62605214", "0.6260338", "0.6219494", "0.61849874", "0.61646134", "0.61379063", "0.6126435", "0.608624", "0.60640466", "0.60598683", "0.6016408", "0.6010413", "0.5991127", "0.59910214", "0.59663296", "0.5936...
0.72881126
0
Add a Global User ACL to the database
def add_global_user_acl(session, user_id=None, is_admin=False, is_global=True, allow_read=False, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=False...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_global_group_acl(session, group_id=None, is_admin=False,\n is_global=True, allow_read=False, allow_install=False,\n allow_uninstall=False, allow_reboot=False, allow_schedule=False,\n allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapshot_r...
[ "0.6790956", "0.66984755", "0.6193511", "0.60840625", "0.6061878", "0.59698826", "0.5953534", "0.5937081", "0.59253997", "0.5908613", "0.58513284", "0.57258356", "0.56943804", "0.5650924", "0.55833733", "0.5550112", "0.55397975", "0.550241", "0.550241", "0.54835874", "0.54700...
0.7756629
0
Add a Global Group ACL to the database
def add_global_group_acl(session, group_id=None, is_admin=False, is_global=True, allow_read=False, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=Fal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_global_group_acl(session, group_id=None, is_admin=False,\n is_global=True, allow_read=False, allow_install=False,\n allow_uninstall=False, allow_reboot=False, allow_schedule=False,\n allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapsho...
[ "0.7196082", "0.6934653", "0.67724866", "0.6646024", "0.64088714", "0.62780404", "0.6215141", "0.6154451", "0.6126776", "0.6117893", "0.6082822", "0.60679877", "0.6067281", "0.60590637", "0.60528725", "0.603411", "0.6033565", "0.59680486", "0.5946027", "0.5942363", "0.5935729...
0.81567854
0
Add a User ACL to a node in the database
def add_node_user_acl(session, node_id=None, user_id=None, allow_read=False, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=False, allow_tag_creation...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_node_user_acl(session, node_id=None, user_id=None,\n allow_install=False, allow_uninstall=False, allow_reboot=False,\n allow_schedule=False, allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapshot_revert=False,\n allow_tag_creation=False...
[ "0.66488713", "0.65743196", "0.6349004", "0.63126117", "0.6273757", "0.61371654", "0.611919", "0.61177486", "0.60286134", "0.60237795", "0.60100114", "0.59730655", "0.59480417", "0.59110665", "0.5888698", "0.58862835", "0.58632857", "0.5845603", "0.58204746", "0.5783785", "0....
0.75014323
0
Add a Group ACL to a Node in the database
def add_node_group_acl(session, node_id=None, group_id=None, allow_read=False, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=False, allow_tag_creati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_node_group_acl(session, node_id=None, group_id=None,\n allow_install=False, allow_uninstall=False, allow_reboot=False,\n allow_schedule=False, allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapshot_revert=False,\n allow_tag_creation=Fal...
[ "0.7298856", "0.67762434", "0.6739489", "0.64854664", "0.6471868", "0.64582276", "0.6363607", "0.6359242", "0.63551635", "0.63349617", "0.6279043", "0.6272919", "0.6272078", "0.6271495", "0.6215116", "0.6162174", "0.6120281", "0.6107547", "0.60900867", "0.6056464", "0.6030693...
0.7867277
0
Add a User ACL to a Tag in the database
def add_tag_user_acl(session, tag_id=None, user_id=None, allow_read=False, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=False, allow_tag_creation=F...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_tag_user_acl(session, tag_id=None, user_id=None,\n allow_install=False, allow_uninstall=False, allow_reboot=False,\n allow_schedule=False, allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapshot_revert=False,\n allow_tag_creation=False, ...
[ "0.6768385", "0.66185904", "0.6288666", "0.62353295", "0.62045974", "0.61111546", "0.5938137", "0.59312445", "0.5828969", "0.58216935", "0.5819768", "0.58164734", "0.57813776", "0.5755194", "0.56963474", "0.5630525", "0.56261504", "0.5620099", "0.5584222", "0.5578137", "0.557...
0.7627426
0
Add a Group ACL to a Tag in the database
def add_tag_group_acl(session, tag_id=None, group_id=None, allow_read=False, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=False, allow_tag_creation...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_tag_group_acl(session, tag_id=None, group_id=None,\n allow_install=False, allow_uninstall=False, allow_reboot=False,\n allow_schedule=False, allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapshot_revert=False,\n allow_tag_creation=False...
[ "0.7413525", "0.6949173", "0.6515452", "0.638341", "0.6300268", "0.619689", "0.618565", "0.6143435", "0.6096526", "0.6077261", "0.60423136", "0.60403264", "0.6036486", "0.60344684", "0.60183716", "0.6016755", "0.59663004", "0.5962972", "0.59606135", "0.5952664", "0.5943046", ...
0.80384266
0
Add a dependency to the corresponding toppatch_id into the database
def add_dependency(session, data, username='system_user'): session = validate_session(session) failed_count = 0 for deps in data['data']: pkg_id = deps['toppatch_id'] for dep in deps['dependencies']: dep_exists = session.query(LinuxPackageDependency).\ filter(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_dependency(self, dep):\n self.dependency.append(dep)", "def add_depend(self, data):\n try:\n self._session.add(StepDependencyEntity(\n child_id=data['child_id'],\n parent_id=data['parent_id']\n ))\n except SQLAlchemyError as err:\n...
[ "0.6426406", "0.64062476", "0.5922514", "0.5561254", "0.5473387", "0.53967816", "0.5364266", "0.5284696", "0.5237298", "0.51207536", "0.50454897", "0.5004042", "0.4978844", "0.49685213", "0.49589285", "0.49584004", "0.49383095", "0.49302614", "0.49144408", "0.4911285", "0.491...
0.65303063
0
Add a list of nodes to an existing tag into the database arguments.... session == SQLAlchemy Session nodes = list of nodes tag_id = id of tag or tag_name = name of tag
def add_tag_per_node(session, nodes=[], tag_id=None, tag_name=None, user_id=None, username='system_user'): session = validate_session(session) completed = False count = 0 tag = None if not tag_id and tag_name: tag = tag_exists(session, tag_name=tag_name) elif tag_id and n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_tag(args):\n\n if not args.nodespec and not args.software_profile and \\\n not args.hardware_profile:\n sys.stderr.write('Error: must specify --nodes'\n '/--software-profile/--hardware-profile\\n')\n sys.stderr.flush()\n sys.exit(1)\n\n session ...
[ "0.72279805", "0.66229963", "0.62487316", "0.62040484", "0.60978645", "0.60316706", "0.59950036", "0.58186054", "0.5780188", "0.57044286", "0.56786096", "0.5670054", "0.56257105", "0.56120104", "0.56080633", "0.55849946", "0.5579145", "0.55715966", "0.55562085", "0.5544375", ...
0.6936174
1
Add a new timeblock to RV. arguments below.. session == SQLAlchemy Session label == The name of the timeblock that you added start_date == "12/1/2012"
def add_time_block(session, label, start_date, start_time, end_time, days, end_date=None, span_end_date_time=None, span=False, enabled=False, username='system_user'): session = validate_session(session) try: add_block = TimeBlocker(label, start_date, start_time, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_block(self, drip_campaign_id, start_time, nodes_id):\n new_block = Block(\n drip_campaign_id=drip_campaign_id,\n start_time=start_time,\n nodes_id=nodes_id\n )\n new_block.save()", "def insert_machine_time(self, start: int, end: int):\n today ...
[ "0.59659165", "0.5863345", "0.58183277", "0.5808236", "0.5762933", "0.5504239", "0.5437054", "0.543419", "0.541414", "0.53787965", "0.5373741", "0.53152436", "0.53119665", "0.53105295", "0.5307636", "0.5295561", "0.5291936", "0.52910906", "0.52751726", "0.52628547", "0.526211...
0.7227159
0
Add a new Certificate Signed Request into RV arguments below.. session == SQLAlchemy Session client_ip == "192.168.0.1" location == The directory location ("/opt/TopPatch/var/lib/ssl/client/csr/192.168.0.1.csr")
def add_csr(session, client_ip, location, csr_name, signed=False, signed_date=False, username='system_user'): session = validate_session(session) try: add_csr = CsrInfo(csr_name, client_ip, location, signed, signed_date) session.add(add_csr) session.commit() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_ssl_cert_request ( ssl_hostnames ) :\n first_hostname = ssl_hostnames[ 0 ]\n csr_filename = get_ssl_csr_filename( first_hostname )\n key_filename = get_ssl_key_filename( first_hostname )\n openssl_cnf = \"\"\"\n[req]\ndistinguished_name = req_distinguished_name\nreq_extensions = san_ext\n\n[req_...
[ "0.61794984", "0.6074754", "0.59074855", "0.5900829", "0.5836028", "0.5689883", "0.5686247", "0.562675", "0.55683374", "0.5503503", "0.5464923", "0.5438911", "0.5392701", "0.5382747", "0.53479296", "0.5293224", "0.5291298", "0.526492", "0.526492", "0.5234707", "0.51935923", ...
0.6758308
0
Add a new Signed Certificate into RV arguments below.. session == SQLAlchemy Session node_id == 1 This is the id of the node that this cert belongs too. cert_id == 1 This is the id corresponding csr_id cert_location == The directory location ("/opt/TopPatch/var/lib/ssl/client/keys/192.168.0.1.cert")
def add_cert(session, node_id, cert_id, cert_name, cert_location, cert_expiration, username='system_user'): session = validate_session(session) try: add_cert = SslInfo(node_id, cert_id, cert_name, cert_location, cert_expiration) session.add(add_cert) sessi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sign_certificate(csr):\n unique_filename = str(uuid.uuid4().hex)\n\n file = open(\"./csr_req/%s.csr\" % unique_filename, \"w\")\n file.write(csr.decode(\"utf-8\"))\n file.close()\n\n subprocess.run([\"../ca/scripts/sign.sh\", unique_filename], check=False)\n\n file = open(\"./csr_req/%s.p7b\"...
[ "0.64046806", "0.6280815", "0.58989143", "0.58835256", "0.5829155", "0.5638251", "0.5638251", "0.5616477", "0.561596", "0.56122303", "0.56050044", "0.55840075", "0.5552402", "0.5530964", "0.5524219", "0.55238885", "0.547166", "0.5467346", "0.5456534", "0.54513323", "0.5449576...
0.7471709
0
Add a new Operation into RV arguments below.. session == SQLAlchemy Session node_id == 1 The id of the node that this operation belongs too. operation == reboot|install|uninstall (The operation type)
def add_operation(session, node_id, operation, operation_sent=None, operation_received=None, username='system_user'): session = validate_session(session) add_oper = Operations(node_id, operation, operation_sent, operation_received, username ) if add_oper: session.add(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_operation(self, op):\n\n self.operations[op.name] = op", "def AddOperation(self, op):\n self._operations.append(op)", "def add(self, **kwargs) -> None:\n self.append(Operation(**kwargs))", "def addOp(self, op):\n self.operations << op", "def _register_operation(self, **opera...
[ "0.6588329", "0.65164876", "0.6259452", "0.61404794", "0.61376673", "0.6107332", "0.5795392", "0.5693794", "0.55513954", "0.55419517", "0.5538352", "0.55040187", "0.5494577", "0.5494577", "0.5481137", "0.5445538", "0.5424925", "0.5406836", "0.5382247", "0.5344137", "0.5303606...
0.7123489
0
update the stats of the node in the node_stats table in RV arguments below.. session == SQLAlchemy Session node_id == the id of the node
def update_node_stats(session, node_id, username='system_user'): session = validate_session(session) rebootspending = session.query(NodeInfo).\ filter(NodeInfo.reboot == True).\ filter(NodeInfo.id == node_id).count() agentsdown = session.query(NodeInfo).\ filter(NodeInfo....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update(self, context, values, prune_stats=False):\n return db.compute_node_update(context, self.compute_node['id'],\n values, prune_stats)", "def update_node(session, node_id, ipaddress, username='system_user'):\n session = validate_session(session)\n node = node_exists(session, ...
[ "0.64276147", "0.63328195", "0.6140318", "0.61300564", "0.59009504", "0.5846118", "0.58422846", "0.5800655", "0.5799475", "0.5791402", "0.5769188", "0.5705976", "0.5678018", "0.56424344", "0.56188697", "0.5593942", "0.54787344", "0.54753065", "0.5434515", "0.54333824", "0.541...
0.76589245
0
update the global stats in network_stats table in RV arguments below.. session == SQLAlchemy Session
def update_network_stats(session, username='system_user'): session = validate_session(session) rebootspending = session.query(NodeInfo).\ filter(NodeInfo.reboot == True).count() agentsdown = session.query(NodeInfo).\ filter(NodeInfo.agent_status == False).count() agentsup = sessi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_stats():\n list_db = get_list_database()\n\n list_db.group_stats_force_update()\n transaction_commit(None, 'GroupStatsUpdate')\n\n list_db.user_stats_force_update()\n transaction_commit(None, 'UserStatsUpdate')", "def RefreshStats(self):\n with self.ctx.Profile(\n 2,\n lamb...
[ "0.6264449", "0.6093104", "0.6002179", "0.59345603", "0.5877387", "0.5864414", "0.57928675", "0.5755806", "0.56649154", "0.5663315", "0.5632987", "0.5613733", "0.5571354", "0.5542132", "0.5508326", "0.5491335", "0.5465955", "0.54624546", "0.5394556", "0.5383795", "0.53818923"...
0.7032283
0
update the global tag stats in tag_stats table in RV arguments below.. session == SQLAlchemy Session
def update_tag_stats(session, username='system_user'): session = validate_session(session) tags = session.query(TagInfo).all() if len(tags) > 0: for tag in tags: nodes = session.query(TagsPerNode).\ filter(TagsPerNode.tag_id == tag.id).all() patchesinstalled =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags_stats():\n # Update total search count of tag\n yesterday = timezone.now() - timezone.timedelta(days=1)\n yesterdays_tag_stats = DailyStats.objects.filter(date=yesterday)\n for daily_stat in yesterdays_tag_stats:\n tag_stat, created = TagStats.objects.get_or_create(tag=daily_stat.tag)\n...
[ "0.5773769", "0.54053193", "0.5400968", "0.52657", "0.52549785", "0.52491444", "0.5185269", "0.5166207", "0.5146414", "0.5125556", "0.5114296", "0.5061952", "0.5055679", "0.5025211", "0.50249416", "0.5000762", "0.49919817", "0.4971272", "0.49520138", "0.49110574", "0.48714864...
0.7582618
0
Add the system information of an existing node arguments below.. session == SQLAlchemy Session data == this is the message that was sent by the agent and received by rvlistener. node_id == 1 The id of the node that this information belongs too.
def add_system_info(session, data, node_info, username='system_user'): session = validate_session(session) operation = operation_exists(session, data['operation_id']) node_id = node_info.id if node_id: if 'computer_name' in data: node_info.computer_name = data['computer_name'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_node(session, client_ip=None, agent_timestamp=None,\n node_timestamp=None, host_name=None, display_name=None,\n computer_name=None, username='system_user'):\n session = validate_session(session)\n if not host_name and client_ip:\n try:\n host_name = gethostbyaddr(clien...
[ "0.55243963", "0.5523504", "0.5343963", "0.5328363", "0.528189", "0.5176631", "0.51527655", "0.5116902", "0.51146966", "0.50991744", "0.50980383", "0.5058517", "0.5044866", "0.50412124", "0.502948", "0.5010761", "0.49565998", "0.4954844", "0.49528837", "0.49521717", "0.490679...
0.6849514
0
Create a new entry in the packages_per_node table arguments below.. session == SQLAlchemy Session data == this is the message that was sent by the agent and received by rvlistener.
def add_software_per_node(session, data, username='system_user'): session = validate_session(session) session.commit() operation = operation_exists(session, data['operation_id']) node_id = data['node_id'] if node_id: node = session.query(SystemInfo).\ filter(SystemInfo.node_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_node(self, node_tup):\n signature = hashlib.sha256((node_tup[0]+node_tup[4]).encode('utf-8')).hexdigest()\n app_process = sqlite3.connect('app_process::memory:', check_same_thread=False)\n app_process_cursor = app_process.cursor()\n app_process_cursor.execute(\"INSERT INTO no...
[ "0.5677619", "0.52482593", "0.5195922", "0.5182733", "0.5168917", "0.5161152", "0.5148398", "0.5096421", "0.5047914", "0.5011684", "0.4945328", "0.49099624", "0.49062672", "0.48959848", "0.48884022", "0.48753202", "0.48561898", "0.4854296", "0.48465168", "0.48298782", "0.4828...
0.59259677
0
Create a new entry in the software_available table This table is as of right now, strictly for Windows 3rd party applications arguments below.. session == SQLAlchemy Session data == this is the message that was sent by the agent and received by rvlistener.
def add_software_available(session, data, username='system_user'): session = validate_session(session) operation = operation_exists(session, data['operation_id']) node_id = data['node_id'] if node_id: if operation: results = add_results_non_json(session, node_id=node_id, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_software_installed(session, data, username='system_user'):\n session = validate_session(session)\n operation = operation_exists(session, data['operation_id'])\n node_id = data['node_id']\n if node_id:\n if operation:\n results = add_results_non_json(session, node_id=node_id,\n...
[ "0.6103432", "0.5414766", "0.5199664", "0.5104203", "0.5090083", "0.5016022", "0.495569", "0.4950043", "0.49389824", "0.49013168", "0.4894648", "0.48890445", "0.486498", "0.48560277", "0.48234528", "0.47895136", "0.4771943", "0.47551453", "0.47511882", "0.47435394", "0.473403...
0.7131
0
Create a new entry in the software_installed table This table is a foreignKey to an existing row in software_available for a node. This table is as of right now, strictly for Windows 3rd party applications arguments below.. session == SQLAlchemy Session data == this is the message that was sent by the agent and receive...
def add_software_installed(session, data, username='system_user'): session = validate_session(session) operation = operation_exists(session, data['operation_id']) node_id = data['node_id'] if node_id: if operation: results = add_results_non_json(session, node_id=node_id, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_software_available(session, data, username='system_user'):\n session = validate_session(session)\n operation = operation_exists(session, data['operation_id'])\n node_id = data['node_id']\n if node_id:\n if operation:\n results = add_results_non_json(session, node_id=node_id,\n...
[ "0.70858717", "0.6096228", "0.60859156", "0.5863044", "0.51974237", "0.5174665", "0.5118672", "0.50887364", "0.49734944", "0.4848716", "0.4818761", "0.4803903", "0.47979134", "0.47967765", "0.4779577", "0.47724435", "0.4764106", "0.47607633", "0.47565302", "0.47553998", "0.47...
0.73042756
0
Remove a tag from the database arguments below.. session == SQLAlchemy Session tagname == name of the tag you want to remove
def remove_tag(session, tagname, username='system_user'): session = validate_session(session) tag = tag_exists(session, tag_name=tagname) tagid= tag.id tag_stats = session.query(TagStats).\ filter(TagStats.tag_id == tag.id) if tag: try: tag_stats.delete() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_tag(args):", "def delete_tag(self, session, tag):\n self._tag(session.delete, key=tag, delete=True, session=session)", "def delete_tag(self,tag):\r\n\r\n # with shelf\r\n if self.using_shelf:\r\n del self.tag_dict[tag]", "def delete_tags(self, session):\n sel...
[ "0.70557207", "0.6804026", "0.67596817", "0.6461948", "0.6456595", "0.63579917", "0.6332792", "0.63208556", "0.6299995", "0.61536014", "0.6106683", "0.6092737", "0.6069462", "0.60459316", "0.6033632", "0.6030218", "0.6010136", "0.59909695", "0.5976501", "0.5967643", "0.595496...
0.6806664
1
Remove all nodes from a tag in the database arguments below.. session == SQLAlchemy Session tag_name == name of the tag you want to remove
def remove_all_nodes_from_tag(session, tagname, username='system_user'): session = validate_session(session) tag = tag_exists(session, tag_name=tagname) if not tag: return(False, "Tag %s does not exists" % (tagname), tagname) tags_per_node = \ session.query(TagsPerNode, TagInfo).\ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_node_by_tagname(nodes: List, tagname: str):\n\n for remove in [node for node in nodes if node.tagname == tagname]:\n nodes.remove(remove)", "def remove_nodes_from_tag(session, tag_name, nodes=[], username='system_user'):\n session = validate_session(session)\n nodes_completed = []\n ...
[ "0.6951803", "0.6640433", "0.65312904", "0.64291734", "0.63873076", "0.6245773", "0.6116087", "0.60846364", "0.5978277", "0.5966734", "0.59097797", "0.5845086", "0.57912904", "0.57787085", "0.5764835", "0.5753481", "0.56975526", "0.56918705", "0.56644845", "0.56517816", "0.56...
0.7298875
0
Remove a timeblock from the database arguments below.. session == SQLAlchemy Session id == the id of the timeblock label == the name of the timeblock
def remove_time_block(session, id=None, label=None, start_date=None, start_time=None, username='system_user'): session = validate_session(session) timeblock = time_block_exists(session, id, label, start_date, start_time) if timeblock: object_deleted = False, "Time Block %s ha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _do_remove_block(self, args):\r\n bus_type = args[1]\r\n slave_id = int(args[2])\r\n name = args[3]\r\n if bus_type == 'rtu':\r\n slave = self.server._servers[0].get_slave(slave_id)\r\n elif bus_type == 'tcp':\r\n slave = self.server._servers[1].get_slav...
[ "0.62156653", "0.61247504", "0.6073977", "0.59137785", "0.58951217", "0.5816906", "0.56836355", "0.56813055", "0.56748646", "0.5583618", "0.5541887", "0.55088216", "0.5492939", "0.54708785", "0.54360646", "0.5434126", "0.5344612", "0.5317905", "0.53122264", "0.52653545", "0.5...
0.7277625
0
update an existing node in the RV database arguments below.. session == SQLAlchemy Session node_id == the id of the node ipaddress == The ipaddress of the node
def update_node(session, node_id, ipaddress, username='system_user'): session = validate_session(session) node = node_exists(session, node_id=node_id) error = None if not node.ip_address == ipaddress: try: node.ip_address = ipaddress session.commit() except Except...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_node(uuid, **values):\n fields_ver = values.copy()\n with session_for_write() as session:\n stmt = update(\n model.Node\n ).where(\n model.Node.uuid == uuid\n ).values(\n fields_ver\n ).execution_options(\n synchronize_session...
[ "0.72816133", "0.6820707", "0.65893435", "0.63527095", "0.63042516", "0.62814516", "0.62209684", "0.62012744", "0.6197582", "0.617847", "0.61486435", "0.6116205", "0.60991526", "0.60634166", "0.60237116", "0.597929", "0.5899573", "0.58901024", "0.5856175", "0.578596", "0.5714...
0.7498598
0
update the reboot status on a node in the node_info table in RV arguments below.. session == SQLAlchemy Session node_id == The node_id of the node oper_type == "reboot"
def update_reboot_status(session, node_id, oper_type, username='system_user'): session = validate_session(session) node = node_exists(session, node_id=node_id) if node: if oper_type == 'reboot': try: node.reboot = False node.agent_status = False ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reboot(self, node):", "def reboot_node(self, node):\n params = {'Action': 'RebootInstances'}\n params.update(self._pathlist('InstanceId', [node.id]))\n res = self.connection.request(self.path, params=params).object\n return self._get_boolean(res)", "def reboot(self):\n mo...
[ "0.75722855", "0.65329576", "0.6325448", "0.63181406", "0.6158265", "0.6149083", "0.61210716", "0.5949359", "0.5911771", "0.58813804", "0.5879121", "0.58717173", "0.5868806", "0.58477396", "0.58019197", "0.57642186", "0.569657", "0.5694058", "0.56701624", "0.5667073", "0.5651...
0.81069905
0
Modify the Global ACL of a User in the database
def update_global_user_acl(session, user_id=None, is_admin=False, is_global=True, allow_read=False, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=Fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_global_user_acl(session, user_id=None, is_admin=False,\n is_global=True, allow_read=False, allow_install=False,\n allow_uninstall=False, allow_reboot=False, allow_schedule=False,\n allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapshot_rev...
[ "0.67252845", "0.64107996", "0.6400784", "0.63297886", "0.62673974", "0.62673974", "0.6256225", "0.6214258", "0.61393476", "0.6122256", "0.6052427", "0.59978604", "0.5933742", "0.5896206", "0.5861808", "0.5853026", "0.5822896", "0.5802331", "0.5785494", "0.57674253", "0.57431...
0.7438068
0
Modify the Global ACL of a Group in the database
def update_global_group_acl(session, group_id=None, is_admin=False, is_global=True, allow_read=False, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_global_group_acl(session, group_id=None, is_admin=False,\n is_global=True, allow_read=False, allow_install=False,\n allow_uninstall=False, allow_reboot=False, allow_schedule=False,\n allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapshot_r...
[ "0.7254382", "0.7022326", "0.6990606", "0.66523886", "0.6245156", "0.6238742", "0.6161424", "0.60740215", "0.6051832", "0.60211515", "0.60041064", "0.5945894", "0.5921249", "0.59133536", "0.58938885", "0.5891286", "0.5863889", "0.5847468", "0.5813295", "0.58117294", "0.579712...
0.7849561
0
modify the global permissions of a user on a node in the database
def update_node_user_acl(session, node_id=None, user_id=None, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=False, allow_tag_creation=False, allow_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_admin_permission(self) -> None:\n session = self.appbuilder.get_session\n dag_resources = session.scalars(\n select(Resource).where(Resource.name.like(f\"{permissions.RESOURCE_DAG_PREFIX}%\"))\n )\n resource_ids = [resource.id for resource in dag_resources]\n\n ...
[ "0.6568234", "0.6538204", "0.6426908", "0.6406976", "0.63939655", "0.62912196", "0.62615925", "0.62319654", "0.62132657", "0.60724735", "0.60161483", "0.59777075", "0.5943838", "0.5896214", "0.5890716", "0.58770514", "0.58673644", "0.58455306", "0.5797841", "0.5782578", "0.57...
0.665373
0
Modify the Global ACL of a Group on a node in the database
def update_node_group_acl(session, node_id=None, group_id=None, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=False, allow_tag_creation=False, allow...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_global_group_acl(session, group_id=None, is_admin=False,\n is_global=True, allow_read=False, allow_install=False,\n allow_uninstall=False, allow_reboot=False, allow_schedule=False,\n allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapsho...
[ "0.7562661", "0.69415545", "0.6795446", "0.67245346", "0.65660304", "0.63047767", "0.61979157", "0.60958225", "0.604146", "0.60362536", "0.6010592", "0.5890728", "0.5883822", "0.58646387", "0.5860503", "0.5860379", "0.5858269", "0.5849576", "0.5836339", "0.58308", "0.5780648"...
0.7714923
0
Modify the Global ACL of a User on a Tag in the database
def update_tag_user_acl(session, tag_id=None, user_id=None, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=False, allow_tag_creation=False, allow_tag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_global_user_acl(session, user_id=None, is_admin=False,\n is_global=True, allow_read=False, allow_install=False,\n allow_uninstall=False, allow_reboot=False, allow_schedule=False,\n allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapshot_...
[ "0.6504644", "0.6162827", "0.6132806", "0.6129733", "0.6129733", "0.61052823", "0.5915916", "0.5805578", "0.5663717", "0.56336033", "0.56317526", "0.56130934", "0.55700725", "0.5557551", "0.5554141", "0.5528745", "0.5457469", "0.5451234", "0.54343987", "0.54223025", "0.541061...
0.7183954
0
Modify the Global ACL of a Group on a Tag in the database
def update_tag_group_acl(session, tag_id=None, group_id=None, allow_install=False, allow_uninstall=False, allow_reboot=False, allow_schedule=False, allow_wol=False, allow_snapshot_creation=False, allow_snapshot_removal=False, allow_snapshot_revert=False, allow_tag_creation=False, allow_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_global_group_acl(session, group_id=None, is_admin=False,\n is_global=True, allow_read=False, allow_install=False,\n allow_uninstall=False, allow_reboot=False, allow_schedule=False,\n allow_wol=False, allow_snapshot_creation=False,\n allow_snapshot_removal=False, allow_snapsho...
[ "0.7220257", "0.68494946", "0.667716", "0.6487375", "0.6400578", "0.6063529", "0.6004117", "0.59780467", "0.59366125", "0.5917353", "0.59126985", "0.5803076", "0.5781316", "0.5769561", "0.5747072", "0.5723387", "0.56890684", "0.5651428", "0.5624252", "0.56194323", "0.56056285...
0.7822554
0
Add a new entry in the results table in RV arguments below.. session == SQLAlchemy Session data == the json message received from the agent
def add_results(session, data, username='system_user'): session = validate_session(session) operation = operation_exists(session, data['operation_id']) node = node_exists(session,node_id=data['node_id']) if node: node_id = data['node_id'] if data['operation'] == 'reboot': nod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_records(self, data: dict, execution_context: dict):", "def add_row(self, row_id):", "def add_next_iteration_results(self, *args, **kwargs):\n \n # Passing all the parameters to the graph object\n # which upates the internal state of the graph\n self.sql_model_instance.graphs...
[ "0.62482166", "0.58265", "0.5792383", "0.57908404", "0.57755756", "0.5740843", "0.57107496", "0.55978835", "0.55917794", "0.54867315", "0.5469462", "0.5465754", "0.5449438", "0.5412065", "0.5400628", "0.53911936", "0.5387508", "0.5379521", "0.5369491", "0.536726", "0.536726",...
0.6078163
1
Task handler for sftp_download plugin
def on_task_download(cls, task: Task, config: dict) -> None: socket_timeout_sec: int = config['socket_timeout_sec'] connection_tries: int = config['connection_tries'] # Download entries by host so we can reuse the connection for sftp_config, entries in groupby(task.accepted, cls._get_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ssh_download_files(data):\n with _ssh_connect() as ssh:\n with ssh.open_sftp() as sftp:\n with click.progressbar(data, label='downloads') as items: # noqa\n for item in items:\n _, filename = os.path.split(item)\n sftp.get(item, f'{DOWN...
[ "0.6760415", "0.6119707", "0.61096543", "0.605568", "0.6042737", "0.5958615", "0.5922521", "0.5888617", "0.5864169", "0.58393395", "0.58332944", "0.58228356", "0.5801318", "0.5736366", "0.5667004", "0.56512177", "0.5642449", "0.55854475", "0.55769396", "0.55599636", "0.554756...
0.6754636
1
Creates an SFTP connection from a Flexget config object
def task_config_to_sftp_config(config: dict) -> SftpConfig: host: int = config['host'] port: int = config['port'] username: str = config['username'] password: str = config['password'] private_key: str = config['private_key'] private_key_pass: str = config['private_key_pass'] host_key: Optio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, config):\n self.config = config\n\n # setup logging\n if config.get('ssh_log_path'):\n ssh.util.log_to_file(config['ssh_log_path'])\n\n hostname = config.get('remote_host', 'localhost')\n port = config.get('remote_port', 22)\n username = confi...
[ "0.6799001", "0.65101117", "0.6486627", "0.64719737", "0.640493", "0.616897", "0.60081565", "0.59975857", "0.58954567", "0.5877264", "0.5876884", "0.58517414", "0.5846761", "0.575433", "0.57234526", "0.56997186", "0.5404839", "0.5399757", "0.5369568", "0.5320579", "0.5308505"...
0.664715
1
Convert symbolic permission notation to numeric notation.
def symb_to_num(symbolic): if len(symbolic) == 9: group = (symbolic[:-6], symbolic[3:-3], symbolic[6:]) try: numeric = notation[group[0]] + notation[group[1]] + notation[group[2]] except: numeric = "Invalid Symbolic Representation!" else: numeric = "Symbo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_to_symb(num):\n\n num = str(num)\n if len(num) == 3:\n group = (num[0], num[1], num[2])\n symbolic = \"\"\n\n for key, value in notation.items():\n for g in group:\n if int(g) > 8 or int(g) < 0:\n symbolic = \"Invalid Numerical Represe...
[ "0.5681998", "0.521568", "0.51752305", "0.5127067", "0.5117769", "0.50925183", "0.5087651", "0.50793535", "0.50348747", "0.5022774", "0.4999135", "0.49990058", "0.49702394", "0.4968009", "0.4900085", "0.4852676", "0.48500445", "0.4836129", "0.47774908", "0.4772518", "0.476453...
0.6173098
0
Convert number permission notation to symbolic notation.
def num_to_symb(num): num = str(num) if len(num) == 3: group = (num[0], num[1], num[2]) symbolic = "" for key, value in notation.items(): for g in group: if int(g) > 8 or int(g) < 0: symbolic = "Invalid Numerical Representation!" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_octal_from_file_permission(rwx: str) -> str:\n octals = {'r': 4, 'w': 2, 'x': 1, '-': 0}\n chars = []\n temp = []\n \n for i in range(len(rwx)):\n val = octals.get(rwx[i])\n temp.append(val)\n if len(temp) == 3:\n chars.append(list(t for t in temp))\n ...
[ "0.53374124", "0.527418", "0.5249602", "0.520306", "0.5150457", "0.5133376", "0.51284754", "0.5085775", "0.5078872", "0.50376916", "0.5032838", "0.50220686", "0.50122875", "0.4994668", "0.4976482", "0.49640882", "0.49295864", "0.4921475", "0.48928908", "0.48783267", "0.486434...
0.6568608
0
Convert between mu/[sigma|theta|alpha] parameterization and p/r
def convertParameters(self,mu,sigma=None,theta=None,alpha=None): if sigma is not None: r = mu**2 / (sigma**2-mu) elif theta is not None: r = theta elif alpha is not None: r = 1./alpha p = r / (r + mu) return r,p
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pdf(self,x,mu,sigma=None,theta=None,alpha=None):\n\t\n\t\tr,p = self.convertParameters(mu,sigma,theta,alpha)\n\t\treturn self.pdfPR(x,p,r)", "def normalisedProductionPDF(p, theta, mDarkPhoton, epsilon, norm):\n return (1. / norm) * dNdPdTheta(p, theta, mDarkPhoton, epsilon)", "def A(param):\n return ...
[ "0.6166494", "0.592515", "0.58565605", "0.58215654", "0.57992804", "0.5755113", "0.57434535", "0.57369626", "0.572879", "0.56506467", "0.562362", "0.56022376", "0.5598592", "0.5592415", "0.55910724", "0.55903745", "0.5589684", "0.55826247", "0.55582327", "0.5554927", "0.55528...
0.7524006
0
Create list of player objects
def __init__(self, number_players=1000): self.player_list = [] for i in range(number_players): self.player_list.append(Player())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_players_list(self):\n for p in self.players_names:\n self._players_list.append(Player(p))", "def create_players(self):\n players = []\n count = self.query('player', 'count', '?')\n for index in range(0, int(count)):\n player_id = self.query('player', '...
[ "0.8415683", "0.77281135", "0.7500566", "0.74741745", "0.7420029", "0.74105877", "0.7283305", "0.7032042", "0.7028725", "0.69137144", "0.6816953", "0.67063427", "0.66382223", "0.65988654", "0.65697956", "0.6518914", "0.6506067", "0.6476675", "0.6456089", "0.6455565", "0.64398...
0.80597174
1
Testing if amount of players initialized is correct
def _test_player_list_size(self): return len(self.player_list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enough_players():\n return True", "def noOfPlayers(self):\n\t\tnumber = 0\n\t\tfor n in range(6):\n\t\t\tif self.playerList[n] != None:\n\t\t\t\tnumber = number + 1\n\t\treturn number", "def test_valid_game_setup(self):\n self.assertEqual(self._game.active_players(), 1)\n for x in xrange(1...
[ "0.7769488", "0.72755575", "0.72210413", "0.71589714", "0.7081436", "0.7074838", "0.70711625", "0.68413734", "0.6811846", "0.6798778", "0.6792549", "0.6791493", "0.66448987", "0.6587905", "0.65837675", "0.6579726", "0.65554416", "0.6517425", "0.64908224", "0.64804053", "0.645...
0.7485758
1
Test that no line in the corpus exceeds the maximum number of characters.
def test_character_count(self): from chatterbot_corpus.corpus import DIALOG_MAXIMUM_CHARACTER_LENGTH corpora = corpus.load_corpus('chatterbot.corpus') for conversations in corpora: for conversation in conversations: for statement in conversation: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_max_length(self, p: list) -> bool:\n\n return (\n len(p[0].split(\" \")) < self.max_length\n and len(p[1].split(\" \")) < self.max_length\n )", "def test__limit_string_length(string, max_length):\n return limit_string_length(string, max_length)", "def is_doc_le...
[ "0.67271656", "0.65961367", "0.65796036", "0.65796036", "0.6576228", "0.64568543", "0.6453824", "0.64388967", "0.6435205", "0.6282319", "0.62795603", "0.6278928", "0.62316865", "0.62316865", "0.62293184", "0.62266916", "0.6223264", "0.6187261", "0.6175471", "0.61711305", "0.6...
0.68706644
0
Adds the obstacle as a GL_QUAD, does not allow obstacles less than step size
def add_to_default_batch(self): ''' self.shape = shared.batch.add(4, gl.GL_QUADS, None, ('v2f', (self.x, self.y, self.x + self.width, self.y, self.x + self.width, self.y +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_obstacle(self, obstacle_to_add):\n if self.obstacles.size != 0:\n self.obstacles = np.hstack((self.obstacles, obstacle_to_add))\n else:\n self.obstacles = np.array([obstacle_to_add])", "def draw_cube(self, vec):\n # TOP FACE\n gl.glBegin(gl.GL_QUADS)\n ...
[ "0.5752157", "0.5704695", "0.55139184", "0.5475178", "0.54358566", "0.5433752", "0.54157096", "0.54004365", "0.5338123", "0.5258591", "0.51662725", "0.5163054", "0.51443285", "0.51314676", "0.5076834", "0.5071217", "0.50524515", "0.5043967", "0.5039486", "0.5000148", "0.49988...
0.5838143
0
Deletes the obstacle Deletes the graphics object if it exists then remove from the obstacles list
def delete(self): if self.shape is not None: self.shape.delete() if self in shared.obstacles: shared.obstacles.remove(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_obstacle(self, x, y):\n self.BOARD[y][x].traversable = True\n self.board_array[y][x] = 0", "def remove_dead_obstacles(obstacle_list):\n\tfor obstacle in obstacle_list:\n\t\tobstacle.lifetime -= 1\n\t\tif obstacle.lifetime == 0:\n\t\t\tobstacle_list.remove(obstacle)\n\t\tprint(obstacle)",...
[ "0.71443987", "0.6765844", "0.65129733", "0.6281675", "0.6277408", "0.62500167", "0.61455756", "0.6092859", "0.6083727", "0.6079878", "0.59569687", "0.5912045", "0.5907866", "0.5899834", "0.5867926", "0.58546644", "0.58154076", "0.57985085", "0.5795229", "0.57503587", "0.5691...
0.79736793
0
Add the contents of another jam to this object. Note that, by default, this method fails if file_metadata is not identical and raises a ValueError; either resolve this manually (because conflicts should almost never happen), force an 'overwrite', or tell the method to 'ignore' the metadata of the object being added.
def add(self, jam, on_conflict='fail'): if on_conflict not in ['overwrite', 'fail', 'ignore']: raise ParameterError("on_conflict='{}' is not in ['fail', " "'overwrite', 'ignore'].".format(on_conflict)) if not self.file_metadata == jam.file_metadata: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __add__(self, other):\r\n # Make a defaultdict of defaultdicts, the latter of which returns\r\n # None when an key is not present\r\n merged_data = defaultdict(lambda: defaultdict(lambda: None))\r\n\r\n # We will keep track of all unique sample_ids and metadata headers\r\n # ...
[ "0.6023381", "0.5716449", "0.5619332", "0.5605447", "0.5589624", "0.5504831", "0.54868376", "0.546581", "0.5444086", "0.54176193", "0.54172623", "0.53960514", "0.5354634", "0.52778107", "0.5238899", "0.52343297", "0.5198953", "0.5158326", "0.5157256", "0.51571655", "0.5131289...
0.649641
0
Set the current values of the RAMSTKMode data model attributes.
def set_attributes(self, attributes): _error_code = 0 _msg = "RAMSTK SUCCESS: Updating RAMSTKMode {0:d} attributes.". \ format(self.hardware_id) try: self.critical_item = int( none_to_default(attributes['critical_item'], 0)) self.descriptio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_parameters(self, mode, data):\n if mode == 'design' or self.local_design:\n self.new_design = True\n\n for key, dc in self.variables.items():\n if isinstance(dc, dc_cp):\n if ((mode == 'offdesign' and not self.local_design) or\n (mod...
[ "0.59262383", "0.5660007", "0.55965436", "0.5562529", "0.5450975", "0.54298156", "0.54060215", "0.53941303", "0.53482354", "0.5345499", "0.53415346", "0.53402495", "0.5300903", "0.52654946", "0.52514917", "0.52222824", "0.5211762", "0.52113414", "0.5209696", "0.5204078", "0.5...
0.6953201
0
Calculate the Criticality for the Mode. Mode Criticality = Item Hazard Rate Mode Ratio Mode Operating Time Effect Probability
def calculate_criticality(self, item_hr): _error_code = 0 _msg = 'RAMSTK SUCCESS: Calculating failure mode {0:d} criticality.'.\ format(self.mode_id) if item_hr < 0.0: _error_code = 2010 _msg = _(u"RAMSTK ERROR: Item hazard rate has a negative value.") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conductivity(self):\n m = 1.67296736e-02 # Determined from optimisation\n c = 8.54665149e-05 # Determined from optimisation\n return m * self.concentration + c", "def coherence(self):\r\n return np.abs(self.coherency) ** 2", "def functionality(self):\n self._functionali...
[ "0.6149671", "0.581926", "0.5749423", "0.569552", "0.5639848", "0.5627742", "0.54855204", "0.547161", "0.5445516", "0.5431224", "0.5431224", "0.5400731", "0.539497", "0.5374824", "0.53717357", "0.53432816", "0.53290373", "0.5251396", "0.5239214", "0.5225909", "0.52176267", ...
0.7476894
0
List of signals is split into lists of single signals
def test_process_signal_list(self): input_signals = [Signal({"hello": "n.io"}), Signal({"hello": "n.io"}), Signal({"hello": "n.io"})] blk = SignalListSplitter() self.configure_block(blk, {}) blk.start() # one list of signals is pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_process_signal_list_of_one(self):\n input_signals = [Signal({\"hello\": \"n.io\"})]\n blk = SignalListSplitter()\n self.configure_block(blk, {})\n blk.start()\n # one list of signals is processed\n blk.process_signals(input_signals)\n blk.stop()\n se...
[ "0.67559826", "0.637552", "0.6127554", "0.58000535", "0.5581344", "0.5568421", "0.5567797", "0.5507483", "0.54910624", "0.546959", "0.5445433", "0.539266", "0.53553843", "0.53532606", "0.5294758", "0.52855957", "0.52851367", "0.5276394", "0.52736336", "0.5243967", "0.5243068"...
0.68666124
0
List of signals is split into lists of single signals
def test_process_signal_list_of_one(self): input_signals = [Signal({"hello": "n.io"})] blk = SignalListSplitter() self.configure_block(blk, {}) blk.start() # one list of signals is processed blk.process_signals(input_signals) blk.stop() self.assert_num_sig...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_process_signal_list(self):\n input_signals = [Signal({\"hello\": \"n.io\"}),\n Signal({\"hello\": \"n.io\"}),\n Signal({\"hello\": \"n.io\"})]\n blk = SignalListSplitter()\n self.configure_block(blk, {})\n blk.start()\n # o...
[ "0.68666124", "0.637552", "0.6127554", "0.58000535", "0.5581344", "0.5568421", "0.5567797", "0.5507483", "0.54910624", "0.546959", "0.5445433", "0.539266", "0.53553843", "0.53532606", "0.5294758", "0.52855957", "0.52851367", "0.5276394", "0.52736336", "0.5243967", "0.5243068"...
0.67559826
1
Html representation of Facets Overview for use in a Jupyter notebook.
def _repr_html_(self) -> str: protostr = base64.b64encode(self._proto.SerializeToString()).decode('utf-8') html_template = ''' <script src="{webcomponents_js}"></script> <link rel="import" href="{facets_html}"> <facets-overview id="overview_elem"></facets-overview> <script> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _repr_html_(self) -> str:\n html_template = \"\"\"\n <script src=\"{webcomponents_js}\"></script>\n <link rel=\"import\" href=\"{facets_html}\">\n <facets-dive id=\"dive_elem\" height=\"{height}\"></facets-dive>\n <script>\n document.querySelector(\"#dive_elem\").data = ...
[ "0.5600265", "0.5545297", "0.5515862", "0.52539235", "0.52248704", "0.51869327", "0.518335", "0.5182476", "0.51630205", "0.5079258", "0.5056503", "0.50485706", "0.50290495", "0.50201535", "0.5011314", "0.49888295", "0.496754", "0.49586928", "0.4941969", "0.49364", "0.4936073"...
0.577709
0
Html representation of Facets Dive for use in a Jupyter notebook.
def _repr_html_(self) -> str: html_template = """ <script src="{webcomponents_js}"></script> <link rel="import" href="{facets_html}"> <facets-dive id="dive_elem" height="{height}"></facets-dive> <script> document.querySelector("#dive_elem").data = {data}; </script>"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _repr_html_(self) -> str:\n protostr = base64.b64encode(self._proto.SerializeToString()).decode('utf-8')\n html_template = '''\n <script src=\"{webcomponents_js}\"></script>\n <link rel=\"import\" href=\"{facets_html}\">\n <facets-overview id=\"overview_elem\"></facets-overview>\n ...
[ "0.5747352", "0.5307675", "0.5240231", "0.51319224", "0.5109449", "0.50896925", "0.50568515", "0.5052512", "0.49906644", "0.49706864", "0.49553403", "0.4881878", "0.48760134", "0.48600367", "0.48523626", "0.48476768", "0.48415962", "0.4828744", "0.48147592", "0.48147592", "0....
0.62843364
0
MSE over features of FC layer of Discriminator.
def mse_on_features(feature, recon_feature, logvar): mse = F.mse_loss(recon_feature, feature) / (2 * logvar.exp()) mse = torch.mean(mse) return mse
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def discriminator_loss(discriminator, fake_images, real_images, fake_labels, real_labels, con_aug, stage):\n discriminator.train()\n criterion = nn.BCELoss()\n fake = fake_images.detach()\n condition = con_aug.detach()\n batch_size = real_images.size(0)\n \"\"\"\n *****************************...
[ "0.58933586", "0.5687825", "0.5670145", "0.5515114", "0.5477524", "0.54765", "0.54389805", "0.5409658", "0.5407765", "0.53701", "0.5356318", "0.5349838", "0.5349151", "0.5302134", "0.52876115", "0.5284638", "0.5263813", "0.52621937", "0.5254285", "0.52520597", "0.5234978", ...
0.59223557
0
Add new contact to the database
def add_contact(self, contact): self.db.insert_contact(contact) return self.update_contacts()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_contact_to_db(self):\n self.init_db(self._testing)\n\n # make sure that the object is not in the db\n assert self.uid == \"\"\n\n self._insert_row_into_db(Contact.table_name, Contact.columns, self.values)\n\n # update this objects uid\n self.uid = self._get_id_of_l...
[ "0.84468395", "0.8155297", "0.7787158", "0.7690058", "0.7496616", "0.73814785", "0.73638916", "0.73298204", "0.7302359", "0.7158444", "0.7154227", "0.71142626", "0.7102266", "0.7028337", "0.69548136", "0.6899097", "0.68859565", "0.6878193", "0.6827072", "0.6824314", "0.681856...
0.8165148
1
Update contacts after change
def update_contacts(self): self.contacts = self.db.list_contacts() return self.list_contacts()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contacts_list_update(self):\n\t\tself.database.contacts_clear()\n\t\tclient_log.debug(f'Запрос контакт листа для пользователся {self.name}')\n\t\treq = {\n\t\t\tACTION: GET_CONTACTS,\n\t\t\tTIME: time.time(),\n\t\t\tUSER: self.username\n\t\t}\n\t\tclient_log.debug(f'Сформирован запрос {req}')\n\t\twith socket_...
[ "0.75325215", "0.71713334", "0.71713334", "0.70067936", "0.6914438", "0.687053", "0.68023425", "0.67809993", "0.67450345", "0.6729109", "0.67007273", "0.66972715", "0.6619613", "0.65905577", "0.64673847", "0.639455", "0.63806546", "0.62849957", "0.6272024", "0.62464106", "0.6...
0.7861427
0
Delete all contact from database
def delete_contacts(self): self.db.delete_all_contacts() return self.update_contacts()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def RemoveAll(self):\n\t\tcontacts = self.GetContactList()\n\t\t\n\t\tfor contact in contacts:\n\t\t\tself.BatchEnqueue('delete', contact)\n\t\tself.ExecuteBatchQueue()", "def del_contact_all(self):\n\n send_key(KEY_MENU)\n delstr = contact.get_value('contact_delete')\n if search_text(delstr...
[ "0.75905544", "0.7518111", "0.7328898", "0.72868043", "0.7197841", "0.71404386", "0.6918222", "0.6866233", "0.68557423", "0.675412", "0.6746233", "0.6720648", "0.6713548", "0.67038", "0.66817254", "0.6613652", "0.66043967", "0.6591996", "0.65602887", "0.65030277", "0.6497577"...
0.8326911
0
List contact by searching for a given value
def list_contact(self, key, value): self.db.list_contact( key, value, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_contact_list(self):\n\n search_db = Database()\n result = search_db.contact_search(self.name)\n if not result:\n print Fore.YELLOW + ' No such contact'\n return None\n if result > 1:\n print ' Which contact ??'\n for items in result:\n...
[ "0.8009426", "0.68117666", "0.6737137", "0.6643471", "0.64197785", "0.63611305", "0.63020825", "0.6217333", "0.6197536", "0.61852074", "0.6019509", "0.60167944", "0.60021037", "0.5823502", "0.58208525", "0.57927597", "0.5778662", "0.5749409", "0.5742812", "0.5683135", "0.5647...
0.7042657
1
read label,image from tfrecord datafile read number is not limited, 0 indefinite use tensorflow.Session
def fun_read_tfrecord_filelist(file_list, read_num=100): # check file list is ok if type(file_list) != list: if type(file_list) == str: file_list = [file_list] else: print('need a file_name or files_name_list!') return for s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_single():\n\n\n filename = glob.glob(\"rawdata/tfrecords_cleaned/*.tfrecords\")\n\n\n filename_queue = tf.train.string_input_producer(filename, num_epochs=None)\n img, label, rk, links = read_and_decode_file(filename_queue)\n\n init = tf.global_variables_initializer()\n\n sess = tf.Session(...
[ "0.7381145", "0.7147946", "0.70476395", "0.6901313", "0.68394387", "0.6806212", "0.6792378", "0.6766865", "0.6712281", "0.66669863", "0.66519564", "0.6645036", "0.6624598", "0.65483457", "0.6527235", "0.65252674", "0.6501299", "0.64654404", "0.6465048", "0.6458233", "0.645600...
0.71598876
1
Test whether the auditor respects the alert schedule
def test_alert_schedule(cinq_test_service): setup_info = setup_test_aws(cinq_test_service) account = setup_info['account'] prep_s3_testing(cinq_test_service) # Add resources client = aws_get_client('s3') bucket_name = dbconfig.get('test_bucket_name', NS_CINQ_TEST, default='testbucket') cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_for_alerts(self, cr, uid, context=None):\n\n dept_obj = self.pool.get('hr.department')\n detail_obj = self.pool.get('hr.schedule.detail')\n attendance_obj = self.pool.get('hr.attendance')\n rule_obj = self.pool.get('hr.schedule.alert.rule')\n\n # TODO - Someone who care...
[ "0.65938187", "0.6176482", "0.61750144", "0.61458766", "0.604789", "0.60455877", "0.60449404", "0.59740597", "0.59729266", "0.5958995", "0.5948456", "0.5939794", "0.5884633", "0.58724236", "0.5820209", "0.58177555", "0.57953286", "0.578536", "0.5773353", "0.57711244", "0.5767...
0.6369556
1
Counting sort arr in place.
def counting_sort(arr): # No need to sort if arr is None: return arr n = len(arr) if n <= 1: return arr # find the counting scope, i.e., the max value max_value = arr[0] for i in range(1, n): if arr[i] > max_value: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def countingSort2(arr):\n freq = [0] * 100\n for el in arr:\n freq[el] += 1\n\n sorted_arr = []\n for i in range(len(freq)):\n sorted_arr = sorted_arr + [i] * freq[i]\n return sorted_arr", "def counting_sort(arr):\n # Given that numbers are integers in range 0 <= x < 100\n coun...
[ "0.78273445", "0.77633786", "0.7481935", "0.7466987", "0.7410261", "0.7389358", "0.7366042", "0.7251443", "0.7188289", "0.71487", "0.7146158", "0.70710707", "0.6989624", "0.6783512", "0.6743108", "0.66933733", "0.66844094", "0.65865797", "0.648153", "0.646309", "0.6394911", ...
0.8207626
0
Gets and sets the vppTokenId
def vpp_token_id(self): if "vppTokenId" in self._prop_dict: return self._prop_dict["vppTokenId"] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def token_id(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"token_id\")", "def get_token(self):\n auth_data = {\"auth\": {\"tenantName\": 'service',\n \"passwordCredentials\":{ \"username\": 'vsm',\n \"password\": self._password...
[ "0.61384207", "0.611807", "0.5994977", "0.5994693", "0.5693623", "0.55299115", "0.5475123", "0.5429745", "0.5429745", "0.5375773", "0.53675216", "0.5362576", "0.53347", "0.53136176", "0.53107935", "0.5303457", "0.5282872", "0.5282872", "0.5282872", "0.5258768", "0.5255631", ...
0.82442844
0
Gets and sets the appleId
def apple_id(self): if "appleId" in self._prop_dict: return self._prop_dict["appleId"] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apple_id(self, apple_id):\n\n self._apple_id = apple_id", "def appid(self):\n return self._item[\"appid\"]", "def ApplicationId(self) -> _n_0_t_0:", "def app_id(self):\n return self._app_id", "def app_id(self) -> str:\n return self._app_id", "async def slashtagset_appid(se...
[ "0.8069875", "0.59851646", "0.5909273", "0.5829789", "0.5814948", "0.5765417", "0.5722226", "0.5701442", "0.5638001", "0.562049", "0.5616317", "0.5522016", "0.55123824", "0.55114925", "0.54531074", "0.54511666", "0.5419831", "0.5416108", "0.54157305", "0.53459615", "0.5323140...
0.8489338
0
Gets and sets the vppOrganizationName
def vpp_organization_name(self): if "vppOrganizationName" in self._prop_dict: return self._prop_dict["vppOrganizationName"] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def organization_name(self):\n if self.organization is not None:\n return self.organization.name\n\n return ''", "def organization(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"organization\")", "def getOrganization(self):\n return _libsbml.ModelCreato...
[ "0.684137", "0.6185486", "0.61104095", "0.60688007", "0.6068101", "0.6055266", "0.59143037", "0.5851724", "0.5840031", "0.58396685", "0.58396685", "0.58298886", "0.5803846", "0.5779328", "0.5779328", "0.56808895", "0.56748295", "0.56549084", "0.5612998", "0.5557546", "0.54901...
0.83878106
0
Gets and sets the genres
def genres(self): if "genres" in self._prop_dict: return self._prop_dict["genres"] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_genres(self) -> List[Genre]:\n raise NotImplementedError", "def get_genre(self):\n self.genre = imdb.get_title_genres(self.ID)\n self._genre_printer()", "async def get_genres(self) -> APIReturn:\n return await self._request(\"GET\", \"/getGenres\")", "def recommendation_ge...
[ "0.73216236", "0.73034143", "0.73029256", "0.72081995", "0.6950199", "0.67357016", "0.67327183", "0.66221786", "0.66032404", "0.6553856", "0.64852357", "0.64766", "0.646072", "0.6298506", "0.6285007", "0.626418", "0.6256165", "0.62560207", "0.6246242", "0.62147844", "0.614064...
0.7478756
0
Gets and sets the seller
def seller(self): if "seller" in self._prop_dict: return self._prop_dict["seller"] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seller(self, seller):\n\n self._seller = seller", "def get_contact_seller(self):\n return self.contact.seller", "def buyer(self, buyer):\n\n self._buyer = buyer", "def seller_from_user(context: Dict[str, Any]) -> Optional[Seller]:\n user: User = context[\"user\"]\n if user.is_a...
[ "0.8109366", "0.698005", "0.62128127", "0.6178388", "0.6039728", "0.6028439", "0.5871527", "0.57780135", "0.5721163", "0.56939894", "0.56875074", "0.5485203", "0.5411141", "0.53689885", "0.5301218", "0.5298088", "0.5297234", "0.52722865", "0.52558464", "0.5248467", "0.5244013...
0.83205086
0
Gets and sets the totalLicenseCount
def total_license_count(self): if "totalLicenseCount" in self._prop_dict: return self._prop_dict["totalLicenseCount"] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def used_license_count(self):\n if \"usedLicenseCount\" in self._prop_dict:\n return self._prop_dict[\"usedLicenseCount\"]\n else:\n return None", "def license_count(self) -> pulumi.Output[Optional[int]]:\n return pulumi.get(self, \"license_count\")", "def license_cou...
[ "0.75288534", "0.7378034", "0.7028874", "0.7028874", "0.6017668", "0.590693", "0.5812739", "0.5784844", "0.57754", "0.5763398", "0.57567894", "0.57275337", "0.56986785", "0.5680325", "0.5677107", "0.5677107", "0.5677107", "0.5677107", "0.5677107", "0.5677107", "0.5677107", ...
0.81494826
0
Gets and sets the usedLicenseCount
def used_license_count(self): if "usedLicenseCount" in self._prop_dict: return self._prop_dict["usedLicenseCount"] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_license_count(self):\n if \"totalLicenseCount\" in self._prop_dict:\n return self._prop_dict[\"totalLicenseCount\"]\n else:\n return None", "def license_count(self) -> pulumi.Output[Optional[int]]:\n return pulumi.get(self, \"license_count\")", "def license_...
[ "0.70619345", "0.6962623", "0.68865573", "0.68865573", "0.61004454", "0.60076684", "0.5775451", "0.56807685", "0.562454", "0.5619409", "0.56166327", "0.5587048", "0.5587048", "0.5530649", "0.5519855", "0.5512422", "0.5486493", "0.5413517", "0.5413517", "0.5386872", "0.5385942...
0.81816816
0
Density of gas assuming ideal gas law in kg/m^3.
def density(self): return (1e-3*self.molar_mass) * self.pressure / (gas_constant * self.temperature) # kg/m^3
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fGasDensity(GasGravity, Temperature, Pressure):\n\tGasConstant = 8.314\n\tPress = Pressure / 145.038 # MPa\n\tTemp = Temperature + 273.16 # Deg K\n\tPr = Press / (4.892 - (0.4048 * GasGravity))\n\tTr = Temp / (94.72 + (170.75 * GasGravity))\n\tA = 0.03 + 0.00527 * ((3.5 - Tr)**3)\n\tB = (0.642 * Tr) - (0.007 *...
[ "0.74058163", "0.7005451", "0.68938565", "0.6806513", "0.6706316", "0.6634284", "0.6574425", "0.65566623", "0.651678", "0.6436798", "0.63436514", "0.633899", "0.6326834", "0.6320278", "0.63081455", "0.6297625", "0.62733966", "0.62247926", "0.6177332", "0.61762756", "0.6155900...
0.81784177
0
Vapour pressure in Pascals.
def vapour_pressure(self): return self.relative_humidity * self.solvent.equilibrium_vapour_pressure(self.temperature)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def PPV(self):\n return _div(self.TP, self.TP + self.FP)", "def vaporPressure(temp: float) -> float:\n exponent = (17.27*temp)/(temp + 237.3)\n vp = 611*np.exp(exponent)\n\n return vp", "def VaporPressure(dwpt):\n\n return 611.2*exp(17.67*dwpt/(243.5+dwpt))", "def volt_to_pressure(volt):\n...
[ "0.7080288", "0.69284487", "0.68418944", "0.6743915", "0.66257185", "0.6582194", "0.6576109", "0.6573769", "0.6532861", "0.65210193", "0.65180355", "0.64524937", "0.64445084", "0.63541234", "0.6329281", "0.6282231", "0.62752527", "0.62735087", "0.62735087", "0.62735087", "0.6...
0.80786455
0
Calculate mean free path via hard sphere approximation.
def mean_free_path(self): return self.dynamic_viscosity / self.density * np.sqrt(np.pi * 1e-3*self.molar_mass / (2*gas_constant * self.temperature))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sphere_sre(solution):\n a = 0\n bias = 0.2\n x = solution.get_x()\n x1 = x[:10]\n x2 = x[10:]\n value1 = sum([(i-bias)*(i-bias) for i in x1])\n value2 = 1/len(x) * sum([(i-bias)*(i-bias) for i in x2])\n return value1 + value2", "def mean_free_path(self, n, T):\n lambda_0 = 1 / ...
[ "0.6078268", "0.6036835", "0.5775312", "0.57285535", "0.57063246", "0.56906533", "0.5667456", "0.5667456", "0.5620325", "0.5604258", "0.552257", "0.5496041", "0.5470228", "0.54219", "0.54151326", "0.54068613", "0.5400745", "0.5382959", "0.53717446", "0.5362374", "0.5358026", ...
0.73044544
0
Handler for 500 errors.
def handler500(request): response = render_to_response('500.html', {}, RequestContext(request)) response.status_code = 500 return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handler500(request):\n \n #Setting the variable and template page for the 500 error\n response = render_to_response('500.html', {}, context_instance=RequestContext(request))\n response.status_code = 500\n return response", "def handler500(request, *args, **argv):\n response = render_to_resp...
[ "0.82592165", "0.82579106", "0.7647247", "0.7604049", "0.75217336", "0.7434948", "0.73925203", "0.7364613", "0.73038787", "0.7235353", "0.7229959", "0.7197154", "0.717115", "0.71682864", "0.71582335", "0.7123201", "0.7115274", "0.7104952", "0.70137286", "0.6970803", "0.697080...
0.82960117
0
Join all party as party key
def all_party_key(all_party): if not all_party: all_party_key = 'all' elif isinstance(all_party, dict): sorted_role_name = sorted(all_party.keys()) all_party_key = gen_key_string_separator.join([ ('%s-%s' % ( role_name, '_'.join([str(p) for p i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def combine_election_public_keys(\n election_public_keys: DataStore[GUARDIAN_ID, ElectionPublicKey]\n) -> ElectionJointKey:\n public_keys = map(lambda public_key: public_key.key, election_public_keys.values())\n\n return elgamal_combine_public_keys(public_keys)", "def party_id(self):\n pass", "...
[ "0.5744274", "0.5568393", "0.54927176", "0.52470684", "0.5210263", "0.5195514", "0.5135702", "0.51080775", "0.5093896", "0.50771976", "0.50136244", "0.50063086", "0.499069", "0.4975437", "0.49622023", "0.49614578", "0.49185023", "0.49098763", "0.48865524", "0.48730585", "0.48...
0.63631517
0
check if the table is partitioned table and return the partition details
def get_table_partition_details( # pylint: disable=unused-argument self, table_name: str, schema_name: str, inspector: Inspector, ) -> Tuple[bool, Optional[TablePartition]]: return False, None # By default the table will be a Regular Table
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_partitioned(self):\n ## check if the table are partitioned, need the split because of a change in the type of partitions in pydantic\n partitions = self.table_config[\"partitions\"]\n if partitions is None or len(partitions) == 0:\n return False\n\n if isinstance(part...
[ "0.72047216", "0.690783", "0.6624961", "0.657136", "0.64423627", "0.6396148", "0.62411654", "0.624026", "0.61577463", "0.606659", "0.606659", "0.6044867", "0.6042913", "0.60408926", "0.6003339", "0.5997353", "0.5991223", "0.5967711", "0.5941188", "0.59136415", "0.5886885", ...
0.7471435
0
From topology. Prepare a table request and pass it to the sink
def yield_table( self, table_name_and_type: Tuple[str, str] ) -> Iterable[Optional[CreateTableRequest]]: table_name, table_type = table_name_and_type schema_name = self.context.database_schema.name.__root__ db_name = self.context.database.name.__root__ try: colum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(event, context):\n # pylint: enable=unused-argument\n data = decode(event[\"data\"])\n to_table([data], PROJECT, DATASET, TABLE)", "def _create_input_data(self):\n SCHEMA = parse_table_schema_from_json(\n '{\"fields\": [{\"name\": \"data\", \"type\": \"BYTES\"}]}')\n\n def format_r...
[ "0.5877059", "0.54798776", "0.53474665", "0.53415745", "0.53346676", "0.5334067", "0.5324117", "0.53053784", "0.5297837", "0.5297153", "0.52415204", "0.521387", "0.52090687", "0.51502633", "0.5119904", "0.51124084", "0.5107619", "0.5088214", "0.5088214", "0.50813437", "0.5080...
0.5579226
1
Method to fetch tags associated with table
def fetch_table_tags( self, table_name: str, schema_name: str, inspector: Inspector, ) -> None:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_id_and_tags(self):\n return self.database.select(self.tname,\n [self.primary_key, 'tags'])", "def get_tags(self) -> List:\n LOGGER.info('Get all the tags')\n\n with self.client.create_session() as session:\n tag_count = (func.count(RD...
[ "0.6922398", "0.66747177", "0.65673965", "0.65502906", "0.65502906", "0.64735454", "0.6464283", "0.6420494", "0.64154035", "0.64154035", "0.6354844", "0.62586063", "0.6207295", "0.62069833", "0.6197782", "0.61720955", "0.6168536", "0.6159042", "0.61435735", "0.6085799", "0.60...
0.72872764
0
Create an invalid base log entry for stepbystep creation.
def create_base_entry(vin="INVALID", time_unix=None): return LogEntry(vin=vin, app_id="INVALID", time_unix=time_unix)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_step(self, step):\n raise NotImplementedError", "def createBaseLine(arguments): \n projectSource, projectName = \"\", \"\"\n projectSource, projectName = checkOS(arguments)\n testTempFile = tempfile.TemporaryFile()\n outputFile_name = \"RUN_\" + projectName + \"-planner_g_rt.\" + projectName +...
[ "0.6236393", "0.55243593", "0.54124093", "0.5270877", "0.518995", "0.5183555", "0.5180253", "0.5169412", "0.5137834", "0.5133438", "0.51106143", "0.51106143", "0.5109858", "0.5108779", "0.5071119", "0.50596637", "0.5050473", "0.5044926", "0.50438124", "0.5026648", "0.50259256...
0.60312283
1
Create a LogEntry from the log string produced by get_log_string().
def from_log_string(log_string): first_part = None second_part = None if not log_string.endswith("}"): # Value error for later use value_error = ValueError("Given string has invalid format: {}".format(log_string)) bracket_idx = log_string.find("}") last_comma_idx = log_string.find(",", bracket_idx)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_log_line(cls, log_line: str):\n match = cls.entry_format.match(log_line)\n if not match:\n return None\n\n date = match.group(\"date\")\n time = match.group(\"time\")\n offset = match.group(\"offset\")\n\n entry = cls(\n ip_address=match.grou...
[ "0.8345061", "0.68320376", "0.67686236", "0.6422642", "0.6405456", "0.62253773", "0.6163121", "0.601324", "0.6002534", "0.59997934", "0.5892316", "0.5799083", "0.5459042", "0.54550475", "0.54225075", "0.5376155", "0.53600734", "0.533564", "0.5331905", "0.5318096", "0.5290036"...
0.7880306
1
Create a LogEntry from the given dictionary.
def from_data(data_dict, intrusion=None): # Data is verified in the ctor and setters return LogEntry(vin=data_dict[LogEntry.VIN_FIELD], app_id=data_dict[LogEntry.APP_ID_FIELD], level=data_dict[LogEntry.LEVEL_FIELD], log_message=data_dict[LogEntry.LOG_MESSAGE_FIELD], gps_position=data_dict[LogEntry.GPS_POSITI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(self, dict_entry, line_length=80):\r\n try:\r\n # Set the entry object's attributes to the corresponding\r\n # values in the dictionary entry. Type conversions need to\r\n # be done for non-string attributes.\r\n for key in dict_entry:\r\n ...
[ "0.6882139", "0.68295366", "0.6646199", "0.6632009", "0.634357", "0.6288146", "0.6288146", "0.62512225", "0.6236364", "0.6207709", "0.61589706", "0.6122494", "0.5947414", "0.59346", "0.5900016", "0.5896469", "0.58897763", "0.58897763", "0.58897763", "0.58897763", "0.58897763"...
0.7672826
0
Valuecopy the given LogEntry object.
def copy(log_entry): assert(isinstance(log_entry, LogEntry)) return LogEntry.from_data(log_entry.data, log_entry.intrusion)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __copy__(self):\n return type(self)(self.value)", "def copy(self):\n return type(self)(self._val, lsd=self._lsd)", "def copy(self, source_valueid, dest_valueid):\n raise NotImplementedError(\"abstract\")", "def copy_entry(self, row, col):\n if self.results and self.settings['a...
[ "0.58514726", "0.57540035", "0.56757045", "0.5513019", "0.544298", "0.5388371", "0.5373151", "0.53523105", "0.53194475", "0.53194475", "0.53194475", "0.53140247", "0.52943194", "0.52818", "0.52673143", "0.5245059", "0.52405113", "0.52405113", "0.52405113", "0.5237511", "0.521...
0.75690794
0
Set the field with the given key to the value specified if that is not None.\n
def _set_if_not_none(self, field_key, value, verifier=str): if value is None: return if verifier is not None: value = verifier(value) self.data[field_key] = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setnoempty(self, key, value):\r\n if value:\r\n self[key] = value", "def set(self, key, value):\n if key in self.fields:\n return self.fields.get(key).set(value)\n else:\n self.fields[key] = CustomField(default=value)\n return True", "def set...
[ "0.7059926", "0.6968242", "0.66217285", "0.66039425", "0.6589556", "0.65186286", "0.649909", "0.649909", "0.6493354", "0.63856846", "0.6376981", "0.6247511", "0.619377", "0.61290056", "0.6116902", "0.6098176", "0.60701644", "0.6058743", "0.6058516", "0.6049325", "0.6034123", ...
0.7619028
0
Return the given time or the current time if it's None.
def _get_current_time_if_none(given_time): return given_time or time.time()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_time(self, _time: Optional[float] = None) -> float:\n if _time is None:\n return time.time()\n\n return _time", "def get_time():\n return datetime.datetime.now()", "def time(self) -> Optional[str]:\n return pulumi.get(self, \"time\")", "def time(self) -> Optional[s...
[ "0.80231345", "0.7069105", "0.6942688", "0.6942688", "0.6942688", "0.6942688", "0.6942688", "0.6942688", "0.6916243", "0.68154377", "0.66877276", "0.66112775", "0.6595094", "0.655087", "0.65502095", "0.6544651", "0.65381604", "0.6524668", "0.64543414", "0.6442125", "0.6438368...
0.85907197
0
Return the given UUID or generate one if it's None.
def _generate_uuid_str_if_none(given_uuid): return given_uuid or uuid.uuid4().__str__()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_uuid():\n return str(uuid.uuid4())", "def generate_uuid():\n return uuid.uuid4()", "def _generate_uuid():\n return str(uuid.uuid4())", "def generate_uuid():\n return f'{uuid.uuid1()}'", "def get_uuid():\n\n x = uuid.uuid1()\n return str(x)", "def generate_uuid():\n return uu...
[ "0.7421662", "0.7368809", "0.73120177", "0.72946113", "0.7287514", "0.72534025", "0.7210841", "0.7191255", "0.7175415", "0.71420234", "0.70950955", "0.70928544", "0.70928544", "0.7074644", "0.6998014", "0.6964532", "0.69394946", "0.6919046", "0.6864828", "0.6823264", "0.67820...
0.79678607
0
read 4 chars to buf
def read4(buf): return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read(self, buf, n):\n l = min(len(self.prev), n)\n buf[:l] = self.prev[:l]\n self.prev = self.prev[l:] # pitfall self.prev = []\n\n idx = l # the next reading\n while idx < n:\n buf4 = [\"\" for _ in xrange(4)]\n r = read4(buf4)\n if idx+r <...
[ "0.59958696", "0.59186286", "0.59186286", "0.5890578", "0.5830287", "0.58239377", "0.57918686", "0.5736559", "0.57338023", "0.5728563", "0.5623694", "0.5568525", "0.55537534", "0.55537534", "0.5420426", "0.54010665", "0.53901047", "0.5340353", "0.532755", "0.5276123", "0.5266...
0.81999147
0
read n chars to buf, called multiple times
def read(self, buf, n): l = min(len(self.prev), n) buf[:l] = self.prev[:l] self.prev = self.prev[l:] # pitfall self.prev = [] idx = l # the next reading while idx < n: buf4 = ["" for _ in xrange(4)] r = read4(buf4) if idx+r < n: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readbuf(self, n):\n if n == 0:\n return ''\n try:\n msg = self.sock.recv(n)\n except BaseException:\n msg = ''\n n2 = min(n - len(msg), n / 2)\n return msg + self.readbuf(n2)", "def read(self, n=1):\n s = self._RX_buf[0:n]\n se...
[ "0.7296429", "0.7184826", "0.71118164", "0.6764044", "0.65951157", "0.6557776", "0.6513806", "0.6513806", "0.6513788", "0.6481166", "0.6312328", "0.6295568", "0.62502605", "0.62111115", "0.61962515", "0.6186824", "0.6165042", "0.6112361", "0.60271007", "0.60082614", "0.600411...
0.7302957
0
Build the model with args.inn_depth many layers If args.inn_glow is true, then each layer includes 1x1 convolutions.
def build_fc_inn( args: ClusterArgs, input_shape: Tuple[int, ...], level_depth: Optional[int] = None ) -> layers.Bijector: input_dim = input_shape[0] level_depth = level_depth or args.inn_level_depth chain: List[layers.Bijector] = [layers.Flatten()] for i in range(level_depth): if args.inn_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_layers(self) -> None:\n self.convs_all_levels = nn.ModuleList()\n for i in range(self.start_level, self.end_level + 1):\n convs_per_level = nn.Sequential()\n convs_per_level.add_module(\n f'conv{i}',\n ConvModule(\n self...
[ "0.6300217", "0.6081184", "0.6023422", "0.60000265", "0.5995302", "0.59686184", "0.59679914", "0.5925756", "0.59211046", "0.5914937", "0.59135234", "0.5860571", "0.5852755", "0.5852108", "0.581896", "0.5807225", "0.5793126", "0.57791585", "0.577166", "0.5771581", "0.57675666"...
0.66995215
0
Subclasses may override this to return a list of external files, that clients can observe for changes.
def getExternalFiles(self): return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_files(self):\r\n return self._filelist", "def getFiles(self):\n\t\treturn os.listdir(self.getPath())", "def listFiles(self):\n pass", "def get_files(self):\n return self.ebook_file.get_files()", "def files(self):\r\n return self._files", "def files(self):\n try:\n ...
[ "0.76476604", "0.74927044", "0.7429381", "0.73926634", "0.7326719", "0.7309371", "0.7282806", "0.7274433", "0.722302", "0.7204074", "0.71247035", "0.7104432", "0.7064401", "0.7045729", "0.70131254", "0.7007956", "0.69954735", "0.6967799", "0.6939747", "0.69316167", "0.6928061...
0.9027203
0
`externalFilePath` is None or an external file. If it is None, the main source file was changed on disk, else the externalFilePath was changed. This method should return True if it can update itself, in which case font.load() will be called. If it returns False, the font will be discarded and rebuilt from scratch.
def canReloadWithChange(self, externalFilePath): return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fix_font(src_root, dst_root, file_path, is_hinted, save_unmodified):\n\n src_file = os.path.join(src_root, file_path)\n\n print('Font file: %s' % src_file)\n font = ttLib.TTFont(src_file)\n modified = False\n\n modified |= fix_revision(font)\n modified |= fix_fstype(font)\n modified |= fix...
[ "0.5081905", "0.50366616", "0.50216615", "0.49829918", "0.49263966", "0.49156058", "0.4806569", "0.47662523", "0.47610694", "0.47367972", "0.47354025", "0.47352326", "0.47022414", "0.47002628", "0.46964857", "0.46519396", "0.46338332", "0.46322864", "0.46244994", "0.4612329", ...
0.64111775
0
Set the exclusive state of the action group.
def setExclusive(self, exclusive): super(QCustomActionGroup, self).setExclusive(exclusive) if exclusive: last = self._last_checked if last is not None: last.setChecked(True) for action in self.actions(): if action is not last: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def action_lock(self):\n self.state = 'locked'", "def set_exclusive(self, exclusive):\n self.widget.setExclusive(exclusive)", "def set_exclusive_active(self, name):\n self.set_all_inactive()\n self.set_active(name)", "def disable(self):\n if self.active != DISABLED:\n ...
[ "0.63360256", "0.6294087", "0.6230919", "0.5686868", "0.56087244", "0.5578127", "0.5569583", "0.5548554", "0.54780567", "0.5418087", "0.5412914", "0.54105514", "0.53850436", "0.535912", "0.535912", "0.5358296", "0.52563006", "0.52535677", "0.5228041", "0.5220662", "0.52197784...
0.77546895
0
Create the underlying action group widget.
def create_widget(self): self.widget = QCustomActionGroup(self.parent_widget())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_action(self, *args, **kwargs):\n action_group = kwargs.pop('action_group', None)\n act = QAction(*args, **kwargs)\n if action_group:\n act.setActionGroup(action_group)\n\n return act", "def init_layout(self):\n super(QtActionGroup, self).init_layout()\n ...
[ "0.75482804", "0.6695908", "0.66494614", "0.62164736", "0.60830635", "0.6036351", "0.6004404", "0.58673584", "0.5848936", "0.5833886", "0.5833164", "0.5814237", "0.5802912", "0.5681113", "0.5641236", "0.55654967", "0.5556217", "0.55348945", "0.5505949", "0.5497972", "0.544596...
0.84242666
0
Locate the QAction object which logically follows the child. If the given child is last in the list of children, then the parent object will be invoked to find the QAction which follows this action group.
def find_next_action(self, child): found = False for dchild in self.children(): if found and isinstance(dchild, QtAction): return dchild.widget else: found = child is dchild parent = self.parent() if parent is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def child_added(self, child):\n super(QtActionGroup, self).child_added(child)\n if isinstance(child, QtAction):\n self.widget.addAction(child.widget)\n parent = self.parent()\n if parent is not None:\n before = self.find_next_action(child)\n ...
[ "0.65133506", "0.5764956", "0.56135213", "0.5588276", "0.556616", "0.5460327", "0.54077643", "0.53608245", "0.53120625", "0.52631944", "0.52541935", "0.5245333", "0.5144854", "0.513944", "0.51289624", "0.50804204", "0.5078679", "0.5062347", "0.5059294", "0.50372154", "0.50300...
0.7250408
0
Handle the child added event for a QtActionGroup. This handler will also add the widget to the parent widget, since a QActionGroup only serves as a management container.
def child_added(self, child): super(QtActionGroup, self).child_added(child) if isinstance(child, QtAction): self.widget.addAction(child.widget) parent = self.parent() if parent is not None: before = self.find_next_action(child) parent.w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_widget(self):\n self.widget = QCustomActionGroup(self.parent_widget())", "def child_added(self, child):\n super(QtToolButton, self).child_added(child)\n if isinstance(child, QtMenu):\n self.widget.setMenu(child.widget)", "def child_removed(self, child):\n super...
[ "0.67494166", "0.6715713", "0.6624586", "0.612766", "0.58904576", "0.5739347", "0.56276655", "0.5609154", "0.5497478", "0.5419861", "0.53794026", "0.5364947", "0.5319612", "0.5314476", "0.53119785", "0.5293082", "0.52860713", "0.5270443", "0.5258827", "0.5233708", "0.52084774...
0.8052653
0
Handle the child removed event for a QtActionGroup. This handler will also remove the widget to the parent widget, since a QActionGroup only serves as a management container.
def child_removed(self, child): super(QtActionGroup, self).child_removed(child) if isinstance(child, QtAction) and child.widget is not None: self.widget.removeAction(child.widget) parent = self.parent() if parent is not None: parent.widget.removeAction...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def child_removed(self, child):\n super(QtToolButton, self).child_removed(child)\n if isinstance(child, QtMenu):\n if child.widget is self.widget.menu():\n self.widget.setMenu(None)", "def child_removed(self, child):\n super(AbstractItemView, self).child_removed(chi...
[ "0.66755563", "0.6194727", "0.6103499", "0.59941256", "0.5964826", "0.59547776", "0.56917274", "0.5554345", "0.53270316", "0.5319716", "0.5318732", "0.53073436", "0.5299997", "0.52597994", "0.5187974", "0.51409185", "0.51390886", "0.5129079", "0.51237017", "0.5121978", "0.508...
0.8089256
0
Get the QAction children for this action group. Returns
def actions(self): isinst = isinstance return [c.widget for c in self.children() if isinst(c, QtAction)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getChildren(self):\n \n return self._children", "def children(self):\n \n return self._children", "def children(self):\n return self._children", "def children(self):\n return self._children", "def get_children(self):\n return self._children", "def get_...
[ "0.68728095", "0.67529786", "0.66481596", "0.66481596", "0.65832484", "0.65597486", "0.65548855", "0.65548855", "0.65548855", "0.6481813", "0.64334065", "0.6417876", "0.6396768", "0.63655233", "0.63655233", "0.63300586", "0.63013625", "0.62966573", "0.62869656", "0.6238286", ...
0.72453445
0
Set the exclusive state of the underlying control.
def set_exclusive(self, exclusive): self.widget.setExclusive(exclusive)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setExclusive(self, exclusive):\n super(QCustomActionGroup, self).setExclusive(exclusive)\n if exclusive:\n last = self._last_checked\n if last is not None:\n last.setChecked(True)\n for action in self.actions():\n if action is...
[ "0.6620294", "0.6611052", "0.65280485", "0.6495654", "0.6394166", "0.6288686", "0.62424856", "0.6240522", "0.61622685", "0.61020094", "0.6073353", "0.60687214", "0.604627", "0.5999525", "0.5999525", "0.59711045", "0.5961201", "0.5957905", "0.5943796", "0.59436667", "0.5928598...
0.7793201
0
Set the enabled state of the underlying control.
def set_enabled(self, enabled): self.widget.setEnabled(enabled)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setEnabled( self, cCtrlName, bEnabled=True ):\n self.setControlModelProperty( cCtrlName, \"Enabled\", bEnabled )", "def setEnabled(self, enable: bool) -> None:\n self.enabled = ...", "def set_enabled(self, enabled=True):\n self._enabled = enabled", "def enable(self):\r\n self....
[ "0.7554714", "0.7493753", "0.739995", "0.7382345", "0.731879", "0.731879", "0.72874004", "0.7201384", "0.7166079", "0.71536714", "0.71536714", "0.7085178", "0.7085178", "0.7061498", "0.70269674", "0.68897516", "0.6885137", "0.6868981", "0.6791306", "0.67691064", "0.67643887",...
0.81380314
1
Set the visible state of the underlying control.
def set_visible(self, visible): self.widget.setVisible(visible)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_visible(self, visible):\n widget = self.widget\n if visible:\n widget.setVisible(True)\n widget.raise_()\n widget.activateWindow()\n else:\n widget.setVisible(False)", "def set_visible(self, visible):\n # Make sure the 'visible' attr...
[ "0.8229523", "0.8191319", "0.79702616", "0.7886644", "0.77734816", "0.7673497", "0.7571436", "0.7353849", "0.73125196", "0.71429527", "0.7117967", "0.711646", "0.70657074", "0.70528007", "0.68809277", "0.6869344", "0.6869344", "0.6869344", "0.6869344", "0.6869344", "0.6869344...
0.8712535
1
Generates a series of reflections for an intial point p and first impact q
def reflect_gen(p,q): while True: yield q # n is a unit vector normal to the ellipse at point q n = unit([ci*qi for (ci,qi) in zip((-4,-1),q)]) # d is a unit vector from p to q, e.g. the laser beams path d = unit([pi - qi for (pi,qi) in zip(p,q)]) # r is a unit vector in the direction of the reflected lase...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mutation(i,N_p,t,T,P,N_vars,F_min,F_const):\n\n #Adaptive scaling factor\n if N_vars >= 3:\n F=F_min*2**np.exp(1-(T/(T+1-t)))\n else:\n F = F_const\n #candidates are assigned without the i-th element\n candidates= np.delete(np.arange(N_p), np.where(np.arange(N_p)==i))\n #3 targe...
[ "0.55361575", "0.5507782", "0.5372579", "0.5360624", "0.53593516", "0.53491974", "0.53188616", "0.53064805", "0.52135396", "0.519285", "0.51851183", "0.51435244", "0.51339656", "0.5130794", "0.51189184", "0.5111052", "0.5100512", "0.50761175", "0.5057054", "0.50560147", "0.50...
0.6714796
0
The intersection of vector v and cell 4 x^2 + y^2 = 100 starting from p
def intersect(v, p): # Solve for t: 100 = 4 * (px + t * vx)^2 + (py + t * vy)^2 # Note: 4 * px^2 + py^2 - 100 = 0 t = sum([c*vi*pi for (c,vi,pi) in zip((-8.0, -2.0),v,p)]) t /= sum([c * vi**2 for (c,vi) in zip((4.0,1.0),v)]) return [pi + vi * t for (pi, vi) in zip(p, v)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intersection(x, y, f, p):", "def getIntersectPoint(p1, p2, p3, p4):\n points = p1, p2, p3, p4\n gradients = (\n CollisionUtility.calculate_gradient(p1, p2), CollisionUtility.calculate_gradient(p3, p4)\n )\n\n # See if the the lines are parallel\n if gradients[0] ...
[ "0.724931", "0.65389293", "0.64866877", "0.64301056", "0.6412559", "0.6410918", "0.64012647", "0.6370324", "0.6325234", "0.6305374", "0.62554836", "0.6230082", "0.620606", "0.6137867", "0.61155015", "0.6092252", "0.6087884", "0.60685384", "0.6036107", "0.60347986", "0.6028091...
0.8056194
0
Set the power of all motors in the system
def set_motors(self,power): for i in range(len(self.motors)): self.motors[i].power = power #print "Motor %i: %d" % (i, self.motors[i].power)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_power(self, power):\n print('Setting santec power to %.4f mW' % power)\n self.santec1.write(\"LP %.2f\" % power)\n self.santec2.write(\"LP %.2f\" % power)\n self.santec3.write(\"LP %.2f\" % power)\n self.santec4.write(\"LP %.2f\" % power)", "def set_powers(self, power_1...
[ "0.7091687", "0.70202076", "0.6936355", "0.68218803", "0.6769513", "0.6765122", "0.6765122", "0.67307574", "0.67279464", "0.6608434", "0.6575763", "0.65288085", "0.65074164", "0.6494266", "0.64406693", "0.64244634", "0.6414524", "0.6405676", "0.6385484", "0.63689655", "0.6355...
0.7770252
0
Updates the thrust, climb rate and height of the QuadCopter model.
def update_all(self,delta_t): self.update_thrust() self.update_climb_rate() self.update_height(delta_t)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_vehicle_state(self):\n #vel = self.v + self.commands['throttle']/self.m/self.simulation_rate\n\n vel = self.commands['speed']\n steer = self.commands['steering_angle']\n\n if steer > 0.5:\n steer_cmd = 25\n elif steer < -0.5:\n steer_cmd = 185\n ...
[ "0.5559533", "0.5498132", "0.54623824", "0.54417586", "0.5429667", "0.54125965", "0.5399066", "0.5371565", "0.53581613", "0.5342093", "0.5301803", "0.5297535", "0.52953154", "0.5255505", "0.52489734", "0.52468264", "0.5231706", "0.5230685", "0.51868993", "0.517444", "0.517129...
0.6069336
0
Print Hall Account statements for specified hall_ID
def print_statement(Hall): pdf = FPDF('P', 'mm', 'A4') pdf.add_page('P') pdf.set_font('Times', 'B', 14) pdf.multi_cell(0, 5, ('Hall Account Statement for Hall: %s' % Hall.name)) pdf.ln() pdf.multi_cell(0, 5, ('Mess Account: %s' % Hall.mess_account)) pdf.ln() pdf.multi_cell(0, 5, ('Sala...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_out_account_balances(list_of_all_accounts_known):\n for account in list_of_all_accounts_known:\n print('{0} {1}'.format(account.account_id, account.balance))", "def printout_all(self, indent_level):\n indent = \" \"*indent_level*INDENTATION_MULTIPLIER\n\n print(indent, \"Challen...
[ "0.5709103", "0.5544263", "0.5517013", "0.5512406", "0.539924", "0.53783804", "0.534881", "0.53042066", "0.5273528", "0.5243377", "0.5196611", "0.5160384", "0.51566947", "0.5139505", "0.5105222", "0.5089654", "0.50697607", "0.50514734", "0.50506085", "0.5023857", "0.5022506",...
0.7365047
0
Print list of all employees and respective salary details for specified hall Take dict of Worker objects as parameter
def generate_salary_list(Hall): pdf = FPDF('P', 'mm', 'A4') pdf.add_page('P') pdf.set_font('Times', 'B', 14) pdf.multi_cell(0, 5, ('Hall Salary List: Hall %s' % Hall.hall_ID)) pdf.ln() worker_list = dbr.rebuild("worker") title = "Role" wage = 0 for key in worker_list: if w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_employee(self):\n print \"[Name: %s] [Salary: %d]\" % (self.name, self.salary)", "def process_employees_salary(self, employees_info: List[List[str]]) -> None:\n pass", "def get_employee():\n\n employee_id = get_employee_input_int('Enter employee ID to get the data ')\n employee ...
[ "0.6291626", "0.60116225", "0.5826728", "0.574985", "0.5696388", "0.5555719", "0.551769", "0.546262", "0.54150295", "0.5407232", "0.5379048", "0.5360772", "0.5356221", "0.53249127", "0.52363753", "0.52281964", "0.5221268", "0.5192776", "0.5192633", "0.51646", "0.5135642", "...
0.7293566
0