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
Callback will execute when a volume host path has been added Emitted to members of station
def on_station_member_volume_host_path_added( self, func, ): self._set_event_handler("stations") self._events.on_station_member_volume_host_path_added(func)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_station_admin_volume_host_path_added(\n self, func,\n ):\n self._set_event_handler(\"stations\")\n self._events.on_station_admin_volume_host_path_added(func)", "def on_station_member_volume_host_path_removed(\n self, func,\n ):\n self._set_event_handler(\"stations\...
[ "0.7944421", "0.74438643", "0.72252536", "0.69669914", "0.68353957", "0.6206719", "0.61769456", "0.5866177", "0.57220167", "0.5643982", "0.5563051", "0.5551543", "0.55144763", "0.5506383", "0.5502491", "0.54970294", "0.5471755", "0.5371724", "0.5347677", "0.53468114", "0.5338...
0.82428426
0
Callback will execute when a volume host path has been removed Emitted to admin of station
def on_station_admin_volume_host_path_removed( self, func, ): self._set_event_handler("stations") self._events.on_station_admin_volume_host_path_removed(func)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_station_member_volume_host_path_removed(\n self, func,\n ):\n self._set_event_handler(\"stations\")\n self._events.on_station_member_volume_host_path_removed(func)", "def on_station_admin_volume_removed(\n self, func,\n ):\n self._set_event_handler(\"stations\")\n ...
[ "0.8244994", "0.71275765", "0.682808", "0.6571631", "0.6213402", "0.6195549", "0.6172587", "0.61210924", "0.6077291", "0.6032837", "0.60255456", "0.60244447", "0.59594303", "0.595723", "0.5956895", "0.59038365", "0.5880435", "0.5872567", "0.58382124", "0.5814773", "0.57862276...
0.8255592
0
Callback will execute when a volume host path has been removed Emitted to members of station
def on_station_member_volume_host_path_removed( self, func, ): self._set_event_handler("stations") self._events.on_station_member_volume_host_path_removed(func)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_station_admin_volume_host_path_removed(\n self, func,\n ):\n self._set_event_handler(\"stations\")\n self._events.on_station_admin_volume_host_path_removed(func)", "def on_station_member_volume_removed(\n self, func,\n ):\n self._set_event_handler(\"stations\")\n ...
[ "0.8072026", "0.7217955", "0.7095471", "0.62476283", "0.62444943", "0.61878514", "0.61556584", "0.61227626", "0.61167973", "0.61043686", "0.6071223", "0.60201705", "0.5927294", "0.5926156", "0.5912245", "0.5901936", "0.5840458", "0.582277", "0.577391", "0.5652091", "0.5646809...
0.84106934
0
Callback will execute when a volume has been removed Emitted to admin of station
def on_station_admin_volume_removed( self, func, ): self._set_event_handler("stations") self._events.on_station_admin_volume_removed(func)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_station_member_volume_removed(\n self, func,\n ):\n self._set_event_handler(\"stations\")\n self._events.on_station_member_volume_removed(func)", "def on_station_admin_volume_host_path_removed(\n self, func,\n ):\n self._set_event_handler(\"stations\")\n sel...
[ "0.78319615", "0.68117523", "0.67949766", "0.65829384", "0.64483714", "0.64320034", "0.6410322", "0.6256674", "0.623053", "0.6175508", "0.6175117", "0.61602473", "0.61020213", "0.6085786", "0.60845757", "0.60769176", "0.60712564", "0.6064388", "0.5903153", "0.5838515", "0.583...
0.8042458
0
Callback will execute when a volume has been removed Emitted to members of station
def on_station_member_volume_removed( self, func, ): self._set_event_handler("stations") self._events.on_station_member_volume_removed(func)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_station_admin_volume_removed(\n self, func,\n ):\n self._set_event_handler(\"stations\")\n self._events.on_station_admin_volume_removed(func)", "def on_station_member_member_removed(\n self, func,\n ):\n self._set_event_handler(\"stations\")\n self._events.o...
[ "0.7637939", "0.6835926", "0.67477673", "0.6719256", "0.66722417", "0.6470083", "0.6280348", "0.6229675", "0.61881113", "0.6037404", "0.6007009", "0.59855336", "0.5976737", "0.5976737", "0.5976737", "0.5976737", "0.5976737", "0.5911461", "0.5896595", "0.5851172", "0.5844925",...
0.812461
0
Callback will execute when a station has been updated Emitted to admin
def on_station_admin_station_updated( self, func, ): self._set_event_handler("stations") self._events.on_station_admin_station_updated(func)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_station_member_station_updated(\n self, func,\n ):\n self._set_event_handler(\"stations\")\n self._events.on_station_member_station_updated(func)", "def on_station_admin_request_received(self, func):\n self._set_event_handler(\"stations\")\n self._events.on_station_ad...
[ "0.7415093", "0.7156477", "0.7076884", "0.63513875", "0.62968284", "0.62215596", "0.61810315", "0.61545247", "0.6046591", "0.6042364", "0.60024345", "0.5991592", "0.5952644", "0.59200525", "0.59006035", "0.5874148", "0.5862334", "0.58519965", "0.58262974", "0.57697856", "0.57...
0.8094356
0
Callback will execute when a station has been updated Emitted to members of the station
def on_station_member_station_updated( self, func, ): self._set_event_handler("stations") self._events.on_station_member_station_updated(func)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_station_admin_station_updated(\n self, func,\n ):\n self._set_event_handler(\"stations\")\n self._events.on_station_admin_station_updated(func)", "def on_station_member_member_added(self, func):\n self._set_event_handler(\"stations\")\n self._events.on_station_member_...
[ "0.75220203", "0.680578", "0.6737505", "0.6612835", "0.6460559", "0.6446961", "0.64370733", "0.63332766", "0.6251236", "0.6241034", "0.623026", "0.6202874", "0.61458856", "0.61341816", "0.60409355", "0.6027942", "0.60265416", "0.6012446", "0.59044623", "0.59005696", "0.589337...
0.80973333
0
Create a new station
def create_station(self, name, description="", userids=None): return self._stations_service.create_station(name, description, userids)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_station(self, station_id=None, time=None, location=None):", "def create():", "def create():", "def addstnrecord(dnaxmlroot, name, constraint, coordtype, xaxis, yaxis, height, hemi_zone, desc):\n # Define DnaStation\n dnastn = ET.SubElement(dnaxmlroot, 'DnaStation')\n\n # Create DnaStation Su...
[ "0.74736595", "0.64120275", "0.64120275", "0.6267723", "0.61928046", "0.61731315", "0.61191505", "0.6088154", "0.5894192", "0.5846477", "0.58350563", "0.58079743", "0.5801732", "0.5761114", "0.5761114", "0.5761114", "0.5737802", "0.573603", "0.57331204", "0.57280546", "0.5664...
0.7624823
0
Invite user(s) to a station
def invite_to_station(self, station_id, userids): return self._stations_service.invite_to_station(station_id, userids)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invite(self,roomName,user):\n\n self.sendCommand(roomName +\" /invite\",user)", "def invite_users(self, roomName, users, client):\n for room in self.rooms:\n if room.get_name() == roomName:\n if room.verify_owner(client.get_socket()):\n for user in u...
[ "0.7185819", "0.7024639", "0.7002899", "0.69311094", "0.67886823", "0.6631656", "0.6603037", "0.65987355", "0.6394609", "0.6352693", "0.6310312", "0.6295166", "0.6272746", "0.62447673", "0.6193484", "0.61556333", "0.60826457", "0.6071919", "0.60680705", "0.6021684", "0.593961...
0.7496825
0
Request to join a station
def request_to_join(self, station_id): return self._stations_service.request_to_join(station_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def join_room(room):\n return request.namespace.join_room(room)", "def send_join_request(self, roomname: str, username: str) -> None:\n\n get_members_query = Query.get_room_members(roomname)\n room_members: str = self.db.read_execute_query(get_members_query)[0][0]\n room_members_list = ro...
[ "0.63749075", "0.6215299", "0.6164451", "0.6145582", "0.5998566", "0.5917774", "0.5912878", "0.5875087", "0.5774321", "0.5728613", "0.5723565", "0.5690881", "0.5645923", "0.56318104", "0.5622003", "0.559943", "0.5564092", "0.5521649", "0.5515596", "0.5494662", "0.5494662", ...
0.7278721
0
Admins and owners can approve members to join a station
def approve_request_to_join(self, station_id, userids): return self._stations_service.approve_request_to_join(station_id, userids)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_accept_member_with_owner(self):\n url = '/api/v1/communities/3/accept_member/'\n data = {\n 'id': 5\n }\n\n response = self.client.post(url, data, HTTP_AUTHORIZATION=self.auth('user1'), format='json')\n self.assertEqual(status.HTTP_200_OK, response.status_code...
[ "0.58476007", "0.58360577", "0.58262056", "0.57428217", "0.56774867", "0.55834293", "0.55780417", "0.5556927", "0.5551137", "0.55447036", "0.5492902", "0.54923266", "0.54819036", "0.5471728", "0.54577434", "0.5438326", "0.54256314", "0.5422647", "0.5397372", "0.5390696", "0.5...
0.64724284
0
Remove a member from a station
def remove_member_from_station(self, station_id, userid): return self._stations_service.remove_member_from_station(station_id, userid)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_person_from_the_station(self, station: TelegramController.Station):\n\n if station.line_number in self.__stations_dict and station.station_number in self.__stations_dict[\n station.line_number]:\n if self.__stations_dict[station.line_number][station.station_number] == 1:\n ...
[ "0.7231999", "0.71628547", "0.7091446", "0.696421", "0.6904474", "0.6846963", "0.67789173", "0.67640543", "0.6744732", "0.67181224", "0.667009", "0.6612601", "0.6573163", "0.65079254", "0.6496758", "0.6491523", "0.64582545", "0.6390794", "0.63408923", "0.62991196", "0.6162946...
0.7304258
0
Add volumes to a station
def add_volumes_to_station(self, station_id, name, mount_point, access): return self._stations_service.add_volumes_to_station( station_id, name, mount_point, access )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_volume(self, volume: 'Volume'):\n self.volumes.append(volume)", "def volumes(self):", "def on_station_member_volume_added(\n self, func,\n ):\n self._set_event_handler(\"stations\")\n self._events.on_station_member_volume_added(func)", "def add_station(self, station...
[ "0.6876285", "0.65883744", "0.6548829", "0.6548801", "0.650866", "0.6502903", "0.644879", "0.63142157", "0.6198833", "0.61118776", "0.59103346", "0.5853043", "0.58503973", "0.5817452", "0.57956636", "0.5714599", "0.570767", "0.57056254", "0.56857747", "0.56784004", "0.5664109...
0.74922633
0
Add host path to volume before running a job Host path is where the landing zone will store the results of a job
def add_host_path_to_volume(self, station_id, volume_id, lz_id, host_path): return self._stations_service.add_host_path_to_volume( station_id, volume_id, lz_id, host_path )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attach_volume(self, host_path: str, container_path: str, mode: str = None):\n self.volumes[host_path] = {\n \"bind\": container_path,\n \"mode\": mode or \"Z\"\n }", "def setup_local_hosting(job, event_list, img_src, generate=False):\n msg = 'Setting up local hosting fo...
[ "0.5936039", "0.57001525", "0.5503889", "0.55032146", "0.54650307", "0.5413817", "0.54046196", "0.5382097", "0.53705764", "0.53665364", "0.5360493", "0.5356105", "0.5347707", "0.53273517", "0.5315291", "0.52915084", "0.5272269", "0.52292204", "0.5207862", "0.51584524", "0.513...
0.60400605
0
Gets the resource policy for a station
def get_station_resource_policy(self, station_id): return self._stations_service.get_station_resource_policy(station_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_station_lz_resource_policy(self, station_id, lz_id):\n return self._stations_service.get_station_lz_resource_policy(\n station_id, lz_id\n )", "def get_station_user_resource_policy(self, station_id, userid):\n return self._stations_service.get_station_user_resource_policy(...
[ "0.7137783", "0.68996143", "0.65437603", "0.64618856", "0.6394285", "0.62970984", "0.62638164", "0.6257891", "0.6249871", "0.6249871", "0.6163805", "0.6138999", "0.6137637", "0.601811", "0.601811", "0.5977792", "0.59732735", "0.59732735", "0.59732735", "0.59601575", "0.595981...
0.8375346
0
Updates an the resource policy attached to the station. Creates the policy if it does not exist.
def update_station_resource_policy( self, station_id, max_cpu_per_job=None, max_memory_per_job=None, max_gpu_per_job=None, max_cpu_per_station=None, max_memory_per_station=None, max_gpu_per_station=None, max_cpu_global=None, max_memory_glob...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_policy(self):\n pass", "def UpdatePolicy(self, request, global_params=None):\n config = self.GetMethodConfig('UpdatePolicy')\n return self._RunMethod(\n config, request, global_params=global_params)", "def update_policy(self, *args, **kwargs):\r\n pass", "def updat...
[ "0.70034754", "0.68490446", "0.6848851", "0.6585305", "0.6409433", "0.63865364", "0.6365844", "0.63255304", "0.6299784", "0.62480175", "0.62014055", "0.61207646", "0.61045474", "0.60438746", "0.594769", "0.5913758", "0.5887988", "0.58750826", "0.58524454", "0.57935315", "0.57...
0.69716793
1
Deletes the resource policy associated with the station.
def delete_station_resource_policy(self, station_id): return self._stations_service.delete_station_resource_policy(station_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_station_lz_resource_policy(self, station_id, lz_id):\n return self._stations_service.delete_station_lz_resource_policy(\n station_id, lz_id\n )", "def policy_delete(request, policy_id):\n neutronclient(request).delete_qos_policy(policy_id)", "def delete_station_role_resou...
[ "0.6996309", "0.67981726", "0.6705935", "0.6684607", "0.6345354", "0.6341522", "0.62879807", "0.6226339", "0.6173216", "0.6138595", "0.6055978", "0.5950145", "0.5929454", "0.5923848", "0.59029764", "0.58889526", "0.5878941", "0.58752054", "0.5783896", "0.5705877", "0.5645803"...
0.7915744
0
Gets the resource policy for a station user.
def get_station_user_resource_policy(self, station_id, userid): return self._stations_service.get_station_user_resource_policy( station_id, userid )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_station_resource_policy(self, station_id):\n return self._stations_service.get_station_resource_policy(station_id)", "def get_sp_policy(self, context, id):\n # handling policy method in RPC\n response = self.dns_manager.get_sp_policy(context, id)\n return response", "def get...
[ "0.75928956", "0.6324284", "0.63131595", "0.6269006", "0.6251828", "0.62097424", "0.6201756", "0.6140907", "0.6137804", "0.61294985", "0.60993993", "0.60781956", "0.60781956", "0.6061294", "0.60529894", "0.5937276", "0.5937276", "0.59300405", "0.59284604", "0.5907746", "0.589...
0.83362406
0
Updates an the resource policy attached to the station user. Creates the policy if it does not exist.
def update_station_user_resource_policy( self, station_id, userid, max_cpu_per_job=None, max_memory_per_job=None, max_gpu_per_job=None, max_cpu_per_station=None, max_memory_per_station=None, max_gpu_per_station=None, max_cpu_global=None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_policy(self):\n pass", "def update_policy(self, *args, **kwargs):\r\n pass", "def UpdatePolicy(self, request, global_params=None):\n config = self.GetMethodConfig('UpdatePolicy')\n return self._RunMethod(\n config, request, global_params=global_params)", "def updat...
[ "0.69664323", "0.68925685", "0.68764955", "0.6530893", "0.65236473", "0.63555104", "0.6232206", "0.6167887", "0.61596376", "0.60916686", "0.60891306", "0.60377425", "0.5985885", "0.5969297", "0.59439915", "0.5933762", "0.5835191", "0.5802524", "0.5733811", "0.5729675", "0.570...
0.70404005
0
Deletes the resource policy associated with the station user.
def delete_station_user_resource_policy(self, station_id, userid): return self._stations_service.delete_station_user_resource_policy( station_id, userid )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_station_resource_policy(self, station_id):\n return self._stations_service.delete_station_resource_policy(station_id)", "def policy_delete(request, policy_id):\n neutronclient(request).delete_qos_policy(policy_id)", "def delete_user_policy(self, user_name, policy_name):\r\n params =...
[ "0.70539224", "0.67015296", "0.6428582", "0.6376038", "0.61694944", "0.6121981", "0.60279536", "0.60235995", "0.6017042", "0.6014915", "0.59680825", "0.59182125", "0.5917951", "0.5912066", "0.58395255", "0.5810278", "0.5760046", "0.5715078", "0.57004225", "0.5685757", "0.5652...
0.79618543
0
Returns a list of StationRole objects that match the query string
def get_station_roles( self, station_id, page=None, items=None, names=None, role_ids=None, user_ids=None, description=None, ): return self._stations_service.get_station_roles( station_id, page, items, names, role_ids, user_ids, desc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_roles(role):", "def get_queryset(self):\r\n name = self.kwargs['name']\r\n course_id_string = self.request.QUERY_PARAMS.get('course_id')\r\n if not course_id_string:\r\n raise ParseError('course_id must be specified')\r\n course_id = SlashSeparatedCourseKey.from_dep...
[ "0.6154006", "0.6053128", "0.58233917", "0.57969815", "0.5712606", "0.5618189", "0.56120867", "0.5539877", "0.55255485", "0.5482231", "0.5460352", "0.54559606", "0.54226035", "0.5387648", "0.53858495", "0.5383354", "0.5381631", "0.5373335", "0.5343609", "0.5328805", "0.532844...
0.62000495
0
Gets the resource policy for a station role.
def get_station_role_resource_policy(self, station_id, role_id): return self._stations_service.get_station_role_resource_policy( station_id, role_id )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_station_resource_policy(self, station_id):\n return self._stations_service.get_station_resource_policy(station_id)", "def get_station_lz_resource_policy(self, station_id, lz_id):\n return self._stations_service.get_station_lz_resource_policy(\n station_id, lz_id\n )", "d...
[ "0.7808498", "0.6741654", "0.67381155", "0.6363718", "0.61435103", "0.6060915", "0.60048324", "0.59662515", "0.5936198", "0.5916579", "0.5856011", "0.5811339", "0.5811339", "0.5806208", "0.5722528", "0.56213796", "0.56213796", "0.56213796", "0.56205785", "0.56205785", "0.5620...
0.8424791
0
Updates an the resource policy attached to the station role. Creates the policy if it does not exist.
def update_station_role_resource_policy( self, station_id, role_id, max_cpu_per_job=None, max_memory_per_job=None, max_gpu_per_job=None, max_cpu_per_station=None, max_memory_per_station=None, max_gpu_per_station=None, max_cpu_global=None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_policy(self):\n pass", "def update_policy(self, *args, **kwargs):\r\n pass", "def update_station_resource_policy(\n self,\n station_id,\n max_cpu_per_job=None,\n max_memory_per_job=None,\n max_gpu_per_job=None,\n max_cpu_per_station=None,\n ...
[ "0.67759097", "0.674785", "0.6593317", "0.64226574", "0.63664657", "0.6320104", "0.61634946", "0.61117256", "0.6098283", "0.6086201", "0.6011715", "0.5842931", "0.57929426", "0.57386154", "0.5722088", "0.5717586", "0.5664545", "0.56530917", "0.56484777", "0.56353706", "0.5623...
0.7031058
0
Deletes the resource policy associated with the station role.
def delete_station_role_resource_policy(self, station_id, role_id): return self._stations_service.delete_station_role_resource_policy( station_id, role_id )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_station_resource_policy(self, station_id):\n return self._stations_service.delete_station_resource_policy(station_id)", "def delete_station_lz_resource_policy(self, station_id, lz_id):\n return self._stations_service.delete_station_lz_resource_policy(\n station_id, lz_id\n ...
[ "0.7591209", "0.6814968", "0.6757966", "0.65550244", "0.6488288", "0.6402793", "0.6321993", "0.6154831", "0.6053819", "0.60380363", "0.60269505", "0.6011725", "0.6004176", "0.59492004", "0.5919209", "0.5885387", "0.5869507", "0.5854694", "0.585314", "0.58347976", "0.5776854",...
0.7987946
0
Gets the resource policy for a station lz.
def get_station_lz_resource_policy(self, station_id, lz_id): return self._stations_service.get_station_lz_resource_policy( station_id, lz_id )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_station_resource_policy(self, station_id):\n return self._stations_service.get_station_resource_policy(station_id)", "def get_station_user_resource_policy(self, station_id, userid):\n return self._stations_service.get_station_user_resource_policy(\n station_id, userid\n )"...
[ "0.79656065", "0.6517987", "0.64155436", "0.63686657", "0.62979114", "0.6194501", "0.6194501", "0.6139178", "0.61108494", "0.6098003", "0.6068526", "0.6058087", "0.6056583", "0.5989978", "0.59861773", "0.5925483", "0.5833428", "0.58309436", "0.58218074", "0.58218074", "0.5804...
0.83841497
0
Updates an the resource policy attached to the station lz. Creates the policy if it does not exist.
def update_station_lz_resource_policy( self, station_id, lz_id, max_cpu_per_job=None, max_memory_per_job=None, max_gpu_per_job=None, max_cpu_per_station=None, max_memory_per_station=None, max_gpu_per_station=None, max_cpu_global=None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_policy(self):\n pass", "def update_policy(self, *args, **kwargs):\r\n pass", "def update_station_resource_policy(\n self,\n station_id,\n max_cpu_per_job=None,\n max_memory_per_job=None,\n max_gpu_per_job=None,\n max_cpu_per_station=None,\n ...
[ "0.69526947", "0.68280447", "0.67244333", "0.6552289", "0.65132934", "0.62864685", "0.62171924", "0.6212851", "0.6144889", "0.60913825", "0.5992739", "0.59913206", "0.5947325", "0.59427893", "0.5922444", "0.59122646", "0.58797526", "0.58437556", "0.5759834", "0.57176685", "0....
0.74657327
0
Deletes the resource policy associated with the station lz.
def delete_station_lz_resource_policy(self, station_id, lz_id): return self._stations_service.delete_station_lz_resource_policy( station_id, lz_id )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_station_resource_policy(self, station_id):\n return self._stations_service.delete_station_resource_policy(station_id)", "def policy_delete(request, policy_id):\n neutronclient(request).delete_qos_policy(policy_id)", "def delete_policies():\n if PoliciesOutput.POLICIES_EVENT not in c...
[ "0.7377336", "0.6473227", "0.632515", "0.63024485", "0.6271632", "0.62427044", "0.6179978", "0.61341244", "0.61162734", "0.60472405", "0.5986689", "0.5898976", "0.58373475", "0.5770029", "0.57500947", "0.5737896", "0.573182", "0.56944215", "0.5689364", "0.56607187", "0.563408...
0.7978579
0
Screen scr the screen object tup color the color of the circle tup pos the pos of the circle num radius the radius of the circle int width the width of the circle
def __init__(self, scr, color, pos, radius, width=0): self.scr = scr self.color = color self.pos = pos self.r = radius self.width = width return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw(self, screen):\n\t\tpygame.draw.circle(screen, self.color, self.pos, self.radius)", "def draw_circle(color, position, radius, width=0):\n #print('(color={}, position={}, radius={}, width={})')\n pygame.draw.circle(screen, color, position, radius, width)", "def render(self, screen):\n ...
[ "0.70572096", "0.69449395", "0.68427616", "0.6744472", "0.66738325", "0.6535308", "0.6443482", "0.6425591", "0.6366439", "0.6364725", "0.6347341", "0.6283256", "0.6242804", "0.6236482", "0.62143177", "0.6208872", "0.620616", "0.619483", "0.61721337", "0.61440504", "0.6120693"...
0.7033494
1
Loads url and creates a Pandas DataFrame if url identifies an existing CSV file. If an error is encountered None is returned.
def create_df_from_remote_csv(url): if url is None: return None response = requests.get(url) if response.status_code == 200: if response.headers['content-type'] == "text/csv": response.encoding = 'utf-8' data = pd.read_csv(io.StringIO(response.text)) retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_csv_data(url):\n\n csv_data = pd.read_csv(url)\n\n return csv_data", "def fetch_dataset(url, pandas_impl=pandas):\n\n print(f'fetching dataset at {url}')\n return pandas_impl.read_csv(url)", "def load_data(a_url, path, column_headers):\n print(\"Try loading the data set from a local fil...
[ "0.73868835", "0.69646496", "0.67920196", "0.6721527", "0.66859347", "0.65710497", "0.6433012", "0.6391428", "0.63573176", "0.6323003", "0.62174773", "0.6187627", "0.61755615", "0.61497045", "0.61195314", "0.6115325", "0.6088325", "0.6063198", "0.6036279", "0.6014203", "0.600...
0.8140015
0
Logs model metadata to a database table.
def log_model_metadata(model_uid, schema, db_conn): df = pd.DataFrame({ 'training_timestamp': [get_current_timestamp()], 'model_uid': [model_uid] }) df.to_sql(name='model_metadata', schema=schema, con=db_conn, if_exists='append', index=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info(self) -> str:\n return tabulate(self.model_log_msg, self.head, tablefmt=\"presto\")", "def table_log(self, iteration, dt, name, entity, extra):\n s = self.__format.format(iteration, dt, name, entity, extra)\n self.log(s)", "def log_table(data_category, table_name, value, **kwargs)...
[ "0.6266073", "0.58774227", "0.5725982", "0.5696965", "0.56802934", "0.5623638", "0.56107706", "0.5587467", "0.55410975", "0.5541007", "0.55315256", "0.5497675", "0.54699737", "0.5462768", "0.5453861", "0.53565913", "0.5330835", "0.52207965", "0.51567656", "0.51493764", "0.514...
0.75275505
0
Retrieves the application configuration from a database table.
def retrieve_app_config(schema, db_conn, environment): if environment in ['STAGE', 'LOCAL']: table_name = 'stage_config' else: table_name = 'prod_config' query = f''' select config_key, config_value from {schema}.{table_name} where meta__inserted_at = (select max(meta__inserted_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config():\n CONFIG.clear() #clear config\n sql=\"SELECT * FROM config\"\n conn=sqlite3.connect(CONNECTION_STRING)\n c=conn.cursor()\n c.execute(sql)\n results=c.fetchall()\n # iterate through the results now...\n for r in results:\n CONFIG[r[1]]=r[2]\n conn.commit()\n c...
[ "0.69780415", "0.6650375", "0.64936954", "0.6351886", "0.61351377", "0.60454375", "0.6029971", "0.6008877", "0.5933389", "0.5926853", "0.5925404", "0.5916965", "0.5909893", "0.5862593", "0.58073556", "0.57950675", "0.57017165", "0.5668814", "0.56395566", "0.5630359", "0.56258...
0.702012
0
Gets the LTV for every client_id.
def get_client_ltv_table(db_conn): query = ''' select client_id, ltv from churn_model.client_ltv; ''' df = pd.read_sql(query, db_conn) return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vlans(cohesity_client):\n vlans = cohesity_client.vlan.get_vlans()\n vlans = vlans if vlans else []\n for vlan in vlans:\n exported_res_dict[\"Vlans\"].append(vlan.iface_group_name)\n return vlans", "def get_lvs() -> List[Dict[str, str]]:\n p = subprocess.run(\n [\"lvs\", \"-...
[ "0.61351943", "0.56809396", "0.56437415", "0.5588845", "0.5520292", "0.5492891", "0.53923357", "0.53767985", "0.53720284", "0.5336398", "0.5336398", "0.5318733", "0.52917767", "0.5283435", "0.5273678", "0.5254699", "0.52530307", "0.5250357", "0.52436167", "0.52217495", "0.522...
0.57086515
1
Gets the hashed_password for username.
def get_hashed_password_for_username(username, db_conn): query = f''' select password from churn_model.app_credentials where username = '{username}'; ''' df = pd.read_sql(query, db_conn) return df['password'][0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_password_hash(self, username):\n raise NotImplementedError()", "def get_user_password(username):\n return Migration.objects.select_related().get(\n mailbox__user__username=username\n ).password", "def verify_password(username, password):\n if username in user_auth and check_passw...
[ "0.8191291", "0.7244766", "0.7074311", "0.70607644", "0.69987434", "0.6974944", "0.69589543", "0.69481957", "0.68877035", "0.68877035", "0.6855166", "0.6834302", "0.671721", "0.66408837", "0.66254514", "0.65770435", "0.65554404", "0.64969474", "0.64929354", "0.6477528", "0.64...
0.7485928
1
Logs feature importance scores to the feature_score table. This table is created by the stored procedure GenerateModelPerformanceTables.
def log_feature_importance_to_mysql(df, schema, db_conn): db.write_dataframe_to_database(df, schema, 'feature_score', db_conn)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def feature_importance(self):\n if self.model.algorithm == 'DecisionTree' or self.model.algorithm == 'RandomForest':\n print(\"Feature importance\\n\")\n print(pd.DataFrame(self.model.clf.feature_importances_, index=self.model.dataset.feature_names,\n colu...
[ "0.67162436", "0.6464881", "0.64070237", "0.6283913", "0.6113614", "0.6097828", "0.6086998", "0.6009755", "0.59902894", "0.5942613", "0.5785635", "0.5751442", "0.5746579", "0.56494594", "0.5648458", "0.5610839", "0.5572099", "0.5496251", "0.5424999", "0.5404749", "0.53926957"...
0.7160448
0
Logs model scores to the model_score table. This table is created by the stored procedure GenerateModelPerformanceTables.
def log_model_scores_to_mysql(df, schema, db_conn): db.write_dataframe_to_database(df, schema, 'model_score', db_conn)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_results(best_model, model_name, max_features, train_score, test_score,\n score_fp):\n\n # ensure the directorys where metrics are stored are created\n if not os.path.exists(os.path.dirname(score_fp)):\n os.makedirs(os.path.dirname(score_fp), exist_ok=True)\n\n st = datetime.f...
[ "0.6459586", "0.61814624", "0.5974902", "0.5917384", "0.5889728", "0.5803844", "0.5757552", "0.57390404", "0.5678101", "0.56574285", "0.5636363", "0.56240046", "0.5615831", "0.5598856", "0.554458", "0.55129594", "0.5507397", "0.5503384", "0.5486911", "0.5469208", "0.5450017",...
0.673512
0
Use mutator to change this individual chromosome and return itself
def self_mutate(self) -> 'Individual': self.mutator_cls.mutate_inplace(self.chromosome) self.fitness.cache_clear() return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mutate(self, chrom):\n pass", "def fix_chromosome(self, copy=False):\n region = self.copy() if copy else self\n if region.chromosome.startswith('chr'):\n region.chromosome = region.chromosome[3:]\n else:\n region.chromosome = 'chr' + region.chromosome\n ...
[ "0.72676206", "0.67092437", "0.66289616", "0.648467", "0.6386909", "0.62838453", "0.62317926", "0.62015957", "0.60792714", "0.6051001", "0.60253376", "0.60213035", "0.60038054", "0.59785235", "0.59625703", "0.59534687", "0.59501046", "0.5935049", "0.5840323", "0.58342373", "0...
0.7431413
0
Use recombiner to combine this individual with other argument to generate a new individual
def recombine(self, other: 'Individual') -> 'Individual': new_chromosome = self.recombiner_cls.recombine(self.chromosome,\ other.chromosome) return self.new_individual(new_chromosome, self.generation + 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recombine(parent_1, parent_2, adaptive_mutation):\n\tchild_genotype = blend_crossover(parent_1, parent_2)\n\tif adaptive_mutation:\n\t\tchild_sigma = child_sigma_v4(parent_1, parent_2)\n\telse:\n\t\t# child sigma will be ignored in this case\n\t\tchild_sigma = parent_1.sigma\n\n\t# return new child object\n\tr...
[ "0.6086238", "0.58578676", "0.553666", "0.54390365", "0.53077555", "0.53077555", "0.52834094", "0.52536505", "0.5237462", "0.5234216", "0.5207206", "0.51954985", "0.51884335", "0.51828486", "0.5159907", "0.5159907", "0.5159907", "0.5159907", "0.5159907", "0.5159907", "0.51599...
0.7004123
0
Returns a new individual with the given gene using the same fitness computer, genemutator, recombiner of this individual
def new_individual(self, chromosome: ChromosomeT, generation: int = 1) -> 'Individual': new_individual = Individual(self.chromosome_cls, self.fitness_computer_cls, self.mutator_cls, self.recombi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_gene(gene):\n\n return copy.deepcopy(gene)", "def create_individual(self):\n self.genes = np.random.rand(self.chromosome_size)\n self.personal_best = self.genes.copy", "def copy(self):\n new_genome = Genome(self.pop)\n #new_genome.node_genes = [gene.copy() for gene in sel...
[ "0.6628891", "0.6525498", "0.60412437", "0.60378706", "0.59588385", "0.5922517", "0.5874159", "0.5829749", "0.5802917", "0.57690614", "0.5691474", "0.5687709", "0.56540984", "0.5578607", "0.5549215", "0.5540947", "0.55318564", "0.5516606", "0.5513346", "0.5488842", "0.5484631...
0.6627146
1
Mount volume on authenticated client
def authenticated_mount(self, mount_obj): # Mount volume ret = mount_obj.mount() self.assertTrue(ret, ("Failed to mount %s on client %s" % (mount_obj.volname, mount_obj.client_system))) g.log.info("Successfully mounted %s on cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mount(fstype, export, vol_name, mountpoint, instance, options=None):\n with __manager__.get_state() as mount_state:\n mount_state.mount(fstype, export, vol_name, mountpoint, instance,\n options)", "def mount_volume(self, kwargs):\n\n exp_params = [('dev_name', is_str...
[ "0.70296204", "0.6949487", "0.6848037", "0.67836446", "0.67781174", "0.6720906", "0.6634265", "0.6537808", "0.64552903", "0.6415528", "0.6407578", "0.63407606", "0.6267693", "0.6193398", "0.6145909", "0.6098009", "0.609156", "0.6090751", "0.60803056", "0.60445535", "0.5968648...
0.6977928
1
Try to mount volume on unauthenticated client
def unauthenticated_mount(self, mount_obj): # Try to mount volume and verify # Sometimes the mount command is returning exit code as 0 in case of # mount failures as well. # Hence not asserting while running mount command in test case. # Instead asserting only if it is actually m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def actually_mount(self, client):\n try:\n getattr(client, self.mount_fun)(self.backend,\n mount_point=self.path)\n except hvac.exceptions.InvalidRequest as exception:\n match = re.match('existing mount at (?P<path>.+)', str(exception))...
[ "0.691883", "0.6453154", "0.64340204", "0.6410111", "0.61123747", "0.6110568", "0.6065314", "0.6004733", "0.5991444", "0.59559834", "0.59295976", "0.5829875", "0.58065104", "0.57909185", "0.57765055", "0.5771533", "0.57450986", "0.5685247", "0.564994", "0.5645701", "0.5630296...
0.6919879
0
Check if the mount failure is due to authentication error
def is_auth_failure(self, client_ip, previous_log_statement=''): # Command to find the log file cmd = "ls /var/log/glusterfs/ -1t | head -1" ret, out, _ = g.run(client_ip, cmd) self.assertEqual(ret, 0, "Failed to find the log file.") # Command to fetch latest AUTH_FAILED event l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_mount_failure(self):\n with prepared_image_file(create_filesystem=False):\n program = RsyncSystemBackup(\n crypto_device=CRYPTO_NAME,\n destination=os.path.join(MOUNT_POINT, 'latest'),\n mount_point=MOUNT_POINT,\n )\n # W...
[ "0.6506399", "0.6468886", "0.64333767", "0.6351299", "0.6179715", "0.5952573", "0.589682", "0.5854753", "0.57862586", "0.5772961", "0.5762136", "0.57615614", "0.57391673", "0.573684", "0.5726591", "0.5706865", "0.5674229", "0.5670807", "0.5654494", "0.5643797", "0.56299734", ...
0.6759158
0
returns amplitude of fouriertransformed pupil amplitude and phase.
def app(data_pupil,data_phase,oversize=4): complexr=app_complex(data_pupil,data_phase,oversize) amp=(abs(complexr)**2) return amp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app_phase(data_pupil,data_phase,oversize=4):\n return phaseangle(app_complex(data_pupil,data_phase,oversize))", "def fourier(data, temp_freq, axis, output = 'amplitude'):\n\t\t\n\t\n\t# take largest possible multiple of F1 from PSTH.\n\t# Generate freq and fft\n\t# generate amplitude\n\t# return amplitude, ...
[ "0.6694252", "0.66727966", "0.65830487", "0.6336781", "0.61794156", "0.60287464", "0.596772", "0.5951013", "0.58328754", "0.58238393", "0.5785631", "0.5715169", "0.57138133", "0.56761545", "0.5672074", "0.565094", "0.5622279", "0.55942506", "0.5587303", "0.5576583", "0.557021...
0.6754119
0
returns complex image of fouriertransformed pupil amplitude and phase.
def app_complex(data_pupil,data_phase,oversize=4): #phase colors # cdict = {'red': ((0.0, 1.0, 1.0),(0.25, 0.0, 0.0),(0.5, 0.0, 0.0),(0.75, 1.0, 1.0),(1.00, 1.0, 1.0)),'green': ((0.0, 0.0, 0.0),(0.25, 1.0, 1.0),(0.5, 0.0, 0.0),(0.75, 1.0, 1.0),(1.0, 0.0, 0.0)),'blue': ((0.0, 0.0, 0.0),(0.25, 0.0, 0.0),(0.5, 1.0, 1.0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app_phase(data_pupil,data_phase,oversize=4):\n return phaseangle(app_complex(data_pupil,data_phase,oversize))", "def phaseangle(complexr):\n return numpy.arctan2(complexr.imag,complexr.real)", "def extract(image):\n # calculate fft\n spectrum = np.fft.fft2(image)\n fshift = np.fft.fftshift(spectrum...
[ "0.61744237", "0.6044899", "0.59684455", "0.58517736", "0.5830706", "0.57864714", "0.57658476", "0.5755958", "0.5597331", "0.55942726", "0.5590746", "0.5561673", "0.5550486", "0.55422354", "0.55397385", "0.5526284", "0.5515743", "0.5509431", "0.54964", "0.5489239", "0.5486004...
0.6352824
0
returns phase of complex image
def phaseangle(complexr): return numpy.arctan2(complexr.imag,complexr.real)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def phase(self):\n return np.arctan(np.sum(np.imag(self.values)) / np.sum(np.real(self.values)))", "def real_imag_to_mag_phase(real_imag):\n return np.abs(real_imag), np.angle(real_imag, deg=True)", "def Phase(data):\r\n hil = signal.hilbert(data)\r\n return np.unwrap(np.arctan2(hil.imag, hil.r...
[ "0.7519706", "0.69542", "0.6936921", "0.6922937", "0.67136526", "0.6567651", "0.6505695", "0.6483315", "0.64587396", "0.64508444", "0.6399734", "0.6343744", "0.6315422", "0.62416685", "0.62329644", "0.6231627", "0.6222406", "0.62091786", "0.6205904", "0.61921215", "0.6128248"...
0.7439255
1
returns phase of fouriertransformed pupil amplitude and phase.
def app_phase(data_pupil,data_phase,oversize=4): return phaseangle(app_complex(data_pupil,data_phase,oversize))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def phase(self):\n return -self.attrs['RFphase']*2*np.pi", "def phase(self):\n return np.arctan(np.sum(np.imag(self.values)) / np.sum(np.real(self.values)))", "def signal_phase(signal):\n pi2 = 2.0*np.pi\n\n # Get pro-phase\n prophase = np.mod(np.angle(scipy.signal.hilbert(signal)), pi2)...
[ "0.6958312", "0.68977565", "0.68203247", "0.6671979", "0.66401994", "0.66320395", "0.6632024", "0.66139495", "0.6586814", "0.64967984", "0.64434147", "0.6384845", "0.63592", "0.6298426", "0.6295436", "0.6293789", "0.6293789", "0.6293789", "0.6251911", "0.6203516", "0.61936116...
0.7017998
0
Refreshes the data in the ArticleView using feed_manager.
def refresh(self) -> None: if self.current_feed is None: self.article_view_model.set_articles([]) return self.article_view_model.set_articles(self.feed_manager.get_articles(self.current_feed.db_id)) return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refresh(self, view_manager):\n pass", "def refresh_feed(self, feed: Feed) -> None:\n self._update_thread.force_refresh_feed(feed)", "def trigger_refresh(self):\n self.get_selected()\n self.manage_loading(loading=True)\n self.current_feed.fetch_content(unread_only=self.sho...
[ "0.72453785", "0.66812503", "0.65578246", "0.6536747", "0.6526133", "0.6474975", "0.63738227", "0.63738227", "0.63478214", "0.63305026", "0.63305026", "0.63305026", "0.627443", "0.6247356", "0.6247173", "0.62367964", "0.6196782", "0.61776346", "0.6155839", "0.6155839", "0.609...
0.8214881
0
Changes which feed's articles should be shown in the view. If feed is unspecified, the view will be blank.
def select_feed(self, feed: None | Feed = None) -> None: self.current_feed = feed self.refresh()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refresh(self) -> None:\n if self.current_feed is None:\n self.article_view_model.set_articles([])\n return\n self.article_view_model.set_articles(self.feed_manager.get_articles(self.current_feed.db_id))\n return", "def set_articles(self, articles: list[Article]) -> ...
[ "0.6986372", "0.58573174", "0.5820473", "0.56910294", "0.5664006", "0.56358176", "0.5605886", "0.5596966", "0.55824393", "0.55172175", "0.54702145", "0.53789026", "0.5349168", "0.5301037", "0.5290578", "0.5282688", "0.5260703", "0.5254529", "0.52241373", "0.52105814", "0.5208...
0.58724
1
Fires article_selected_event with the current selection, also marks the article as read. Should only be called by event.
def selection_changed(self) -> None: index = self.currentIndex() if index.isValid(): article: Article = index.internalPointer() if article.unread is True: if self.current_feed is None: logging.error("current feed is none, but article was selec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _on_articles_selection_changed(self, evt=None):\n \n # get selected articles\n articles = self._articles_view.GetSelectedArticles()\n\n # update menu bar\n self._menu_bar.SetArticles(articles)\n \n # none or multiple articles selected\n if len(articles) !...
[ "0.71925265", "0.63796103", "0.6328673", "0.63187927", "0.6288228", "0.62295455", "0.62144005", "0.61657417", "0.6164607", "0.6152132", "0.6067495", "0.60430145", "0.60293573", "0.597503", "0.5960968", "0.5940282", "0.592804", "0.5922907", "0.5919613", "0.59188336", "0.591781...
0.7677113
0
Recieves new article data from the feed manager and adds them to the views. Only adds articles which are the same as the currently highlighted feed
def recieve_new_articles(self, articles: list[Article], feed_id: int) -> None: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refresh(self) -> None:\n if self.current_feed is None:\n self.article_view_model.set_articles([])\n return\n self.article_view_model.set_articles(self.feed_manager.get_articles(self.current_feed.db_id))\n return", "def new_article(self, article: Article):\n i...
[ "0.7528689", "0.720418", "0.692853", "0.6921576", "0.68620986", "0.6790785", "0.6565504", "0.6422929", "0.6280803", "0.61094177", "0.61025864", "0.59953296", "0.59412545", "0.5922389", "0.5911398", "0.59093326", "0.58722866", "0.5855988", "0.5800653", "0.57411635", "0.5739177...
0.7575502
0
Emits a change in the unread status for a row in the article view.
def update_row_unread_status(self, index: qtc.QModelIndex): row = index.row() self.dataChanged.emit(self.index(row, 0), self.index(row, 0), [qtc.Qt.FontRole])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_article_unread_status(self, feed: Feed, article: Article, status: bool) -> None:\n if article.unread != status:\n article.unread = status\n with self._sqlite_connection:\n self._sqlite_connection.execute('''UPDATE articles SET unread = ? WHERE identifier = ? and ...
[ "0.6610092", "0.6530086", "0.6439915", "0.61828715", "0.5986247", "0.59600705", "0.59403056", "0.5910061", "0.5779649", "0.5748323", "0.5737033", "0.5721297", "0.56960934", "0.55976385", "0.5596689", "0.55765176", "0.55692303", "0.55309093", "0.53931606", "0.5327292", "0.5294...
0.765014
0
Emits a change in the flag status for a row in the article view.
def update_row_flag_status(self, index: qtc.QModelIndex): row = index.row() self.dataChanged.emit(self.index(row, 0), self.index(row, 0), [qtc.Qt.ForegroundRole])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toggle_article_flag(self, article: Article) -> None:\n article.flag = not article.flag\n with self._sqlite_connection:\n self._sqlite_connection.execute('''UPDATE articles SET flag = ? WHERE identifier = ? and feed_id = ?''', [article.flag, article.identifier, article.feed_id])", "de...
[ "0.63821006", "0.61166525", "0.5987989", "0.5966758", "0.596424", "0.56890976", "0.5656554", "0.56439316", "0.56411874", "0.56287074", "0.55548453", "0.5519157", "0.5505614", "0.5488021", "0.53846645", "0.53428745", "0.5293014", "0.5261896", "0.521931", "0.5217237", "0.520577...
0.732064
0
Emits a signal that all data has changed in the model.
def update_all_data(self): self.dataChanged.emit(qtc.QModelIndex(), qtc.QModelIndex())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_changed(self):\n self.data_changed_signal.emit(self)", "def modelChanged(self) -> None:\n ...", "def _modelUpdated(self, *args, **kwargs):\n topLeft = self.index(column=0)\n bottomRight = self.index(column=1)\n model = self.model()\n if model is not None:\n ...
[ "0.7643101", "0.7086303", "0.70106286", "0.6857245", "0.673427", "0.6695307", "0.6660293", "0.6615431", "0.6557781", "0.64898545", "0.6385076", "0.6127341", "0.60768676", "0.60747784", "0.60232943", "0.5948149", "0.59280175", "0.59114075", "0.58620363", "0.5816855", "0.577623...
0.7485482
1
Returns the microphone coordinates for the 'nearfield' planar microphone array used in the 2016 experiments with the DARP openjet wind tunnel at the ISVR, Univ. of Southampton, UK [Casagrande Hirono, 2018]. The array is a Underbrink multiarm spiral array with 36 electret microphones, with 7 spiral arms containing 5 mic...
def DARP2016_MicArray(): M = 36 # number of mics array_height = -0.49 # [m] (ref. to airfoil height at z=0) # mic coordinates (corrected for DARP2016 configuration) XYZ_array = np.array([[0., 0.025, 0.08477, 0.12044, 0.18311, 0.19394, 0.01559...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def atm241(coord: numpy.array) -> numpy.array:\n ...", "def pipeRAFT(RAFTframe, offset=128, magFactor=2):\r\n return (RAFTframe.astype(np.float16)-offset)/magFactor", "def _calc_R_T_amp(self, polarization, n, delta):\n t_amp = np.zeros((len(self.structure), len(self.structure)), dtype=complex)...
[ "0.5171409", "0.49308997", "0.4867823", "0.47905356", "0.4789269", "0.47881353", "0.47333372", "0.4732265", "0.4699188", "0.46344298", "0.45868972", "0.4577852", "0.45531473", "0.45489898", "0.45375", "0.45370263", "0.45357716", "0.45343336", "0.45169133", "0.45138884", "0.45...
0.5984168
0
Saves the DARP2016_MicArray into a .xml file, compatile with Acoular.
def DARP2016_Acoular_XML(): XYZ_array, array_cal = DARP2016_MicArray() array_name = "DARP2016" array_pos = XML_mic(XYZ_array) array_file = '<?xml version="1.0" encoding="utf-8"?>\n<MicArray name="{name}">\n{pos}</MicArray>'.format( name=array_name, pos=array_pos) calib_data = XML_calib(array...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eeg_writeavr(array,tsb,di,file):\t\t\n import shutil as shu\n f=open(file,'w')\n firstline = 'Npts= %i TSB= %i DI= %7.5f SB= %7.5f SC= %i NChan= %i\\n' %(array.shape[1],tsb,di,1,200,array.shape[0]) \n chnam = 'Cz FP1 FP2 F3 F4 C3 C4 P3 P4 O1 O2 F7 F8 T7 T8 P7 P8 Fz Pz FC1 FC2 CP1 ...
[ "0.62274456", "0.61062884", "0.5929423", "0.5853379", "0.5797951", "0.57790774", "0.5768997", "0.57282346", "0.5721275", "0.5709641", "0.56996006", "0.56984556", "0.56654245", "0.5662644", "0.56422096", "0.563271", "0.5609935", "0.55975944", "0.5596958", "0.5585382", "0.55847...
0.7865407
0
Load the required file into mongodb using mongoimport
def load_document(self, file_type, file_name): status, output = commands.getstatusoutput("mongoimport -h %s -p %s -u %s -p %s -d %s -c %s --type %s --file %s --headerline" % (self.host, self.port, self.username, self.password, self.db_name, self.collection_name, file_type, file_name)) print "status is...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mongoRestore( self, db, infile ):\n\t\tsys_command = \"mongorestore --db \" + db + \" --host \" + self.host + \" --port \" + str( self.port ) + \" \" + infile \n\t\tos.system(sys_command)", "def import_db(import_file):\n import_data(import_file)", "def load_testdata(collection_name, testdata):\n # if...
[ "0.6712259", "0.6410431", "0.64037097", "0.6304399", "0.62620705", "0.6164453", "0.6146136", "0.6092976", "0.60046375", "0.5832102", "0.5781586", "0.57550126", "0.57142764", "0.56969416", "0.56405246", "0.5624535", "0.56068236", "0.5585002", "0.5537288", "0.5528605", "0.55106...
0.7651893
0
the functions first requests all mutual friends of a given vk id and returns a dict with mutual connection per each friend filtering DELETED profiles
def get_edges(profile_id: str, friends: list, token: str, api_version: str) -> dict: method = 'friends.getMutual' mutuals = {} for friend in tqdm(friends): friend_id = friend['id'] prefix = 'https://api.vk.com/method' url = f'{prefix}/{method}?source_uid={profile_id}&target_uid={frie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_friends_graph():\n total_users = 0\n count_bad_users = 0\n count_graph_users = 0\n\n result = \"was successful\"\n\n settings.print_message(\"Create VK session for application (app_id={})\".format(settings.VK_APPLICATION_ID))\n logger.debug(\"Create VK session for application (app_id={})....
[ "0.63382936", "0.63358456", "0.6259757", "0.6252056", "0.6225435", "0.62156093", "0.61834365", "0.6100285", "0.6092287", "0.60497373", "0.60433984", "0.5978931", "0.5970519", "0.5951681", "0.59398526", "0.59226376", "0.5862549", "0.5838718", "0.5835135", "0.58246464", "0.5815...
0.79206866
0
build a graph from list of friends' vk profiles and mutual connections
def build_graph(friends: list, mutuals: dict) -> nx.classes.graph.Graph: friends_ids = [friend['id'] for friend in friends] G = nx.Graph() G.add_nodes_from(range(len(friends_ids))) for idx in tqdm(friends_ids): node_id = friends_ids.index(idx) G.nodes[node_id]['vk_id'] = idx G.n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_edges(profile_id: str, friends: list, token: str, api_version: str) -> dict:\n method = 'friends.getMutual'\n mutuals = {}\n for friend in tqdm(friends):\n friend_id = friend['id']\n prefix = 'https://api.vk.com/method'\n url = f'{prefix}/{method}?source_uid={profile_id}&targe...
[ "0.7373844", "0.73058623", "0.69654953", "0.6886941", "0.6845271", "0.6301224", "0.62846696", "0.62353754", "0.61969024", "0.61596584", "0.6117445", "0.6060678", "0.60371196", "0.6020928", "0.5997839", "0.5956715", "0.59347546", "0.59099835", "0.5846529", "0.5822966", "0.5815...
0.75277764
0
check_proc_type function checks to make sure image_proc_type is a string
def check_proc_type(image_proc_type): if isinstance(image_proc_type, str): return True else: logging.warning('Image processing type is not a string') print('Please choose only one processing technique.') raise ValueError('Please choose only one processing technique.')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_type(filename):\n try:\n im = Image.read(filename)\n except SanperaError:\n return False\n else:\n return im.original_format in [b'JPEG', b'PNG', b'GIF']", "def is_valid_instance_type(image, instancetype):\n if not is_valid_image(image):\n return False\n\n if ...
[ "0.6204283", "0.61802596", "0.6027018", "0.5975448", "0.58357644", "0.5832431", "0.58170027", "0.5793092", "0.57521164", "0.5702733", "0.5698444", "0.56756866", "0.5604621", "0.5603396", "0.5597974", "0.5592912", "0.5566657", "0.5556909", "0.55315816", "0.5526065", "0.5519633...
0.8995537
0
This function is used to parse required items from skywalkers inner job posting URLs
def parse_items(self, response): items = JobcrawlerItem() current_date = datetime.now() current_date_str = current_date.strftime("%b %d %Y %H:%M:%S") items["timestamp"] = current_date_str items["site"] = self.allowed_domains[0] items["full_html"] = response.text ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_inner_urls(self, response):\n s = Selector(response)\n\n jobs_per_site = s.xpath('//div[@class=\"col-lg-12 col-md-12 col-sm-12 aggelia-view-title\"]//a/@href').extract()\n print(jobs_per_site)\n\n for inner_site in jobs_per_site:\n url = urljoin(\"https://www.skywal...
[ "0.6349358", "0.6019938", "0.60178125", "0.59743893", "0.5815302", "0.5783507", "0.57422364", "0.567971", "0.5663422", "0.5663118", "0.56026596", "0.5588058", "0.5546029", "0.5514448", "0.54864025", "0.54769623", "0.54708314", "0.54693955", "0.5353453", "0.5291266", "0.525565...
0.624414
1
Pick a bunch of digits from MNIST dataset. Input ns = [n1,n2,n3, ...] digits = [1,2,3, ....] both must be the same length. ns contais the number of items for each class determined by digits. Output original images (vector) extracted shapes true labels
def pick_data(ns, digits): f = gzip.open('data/mnist.pkl.gz', 'rb') train_set, valid_set, test_set = cPickle.load(f) f.close() images, labels = train_set originals = []; shapes = []; true_labels = []; i = 0 for n, d in zip(ns, digits): # picking n elements with digit d ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_mnist(dataset=\"training\", digits=np.arange(10), path=\".\"):\n\n if dataset == \"training\":\n fname_img = os.path.join(path, 'train-images-idx3-ubyte')\n fname_lbl = os.path.join(path, 'train-labels-idx1-ubyte')\n elif dataset == \"testing\":\n fname_img = os.path.join(path, ...
[ "0.70157707", "0.68392736", "0.67331785", "0.6488756", "0.64213294", "0.6419488", "0.6350414", "0.63167334", "0.62259847", "0.622325", "0.621732", "0.6193779", "0.61323136", "0.6043401", "0.60221046", "0.5988012", "0.59595597", "0.5959284", "0.59491557", "0.5924892", "0.58634...
0.7900158
0
Dispatches metrics streamed by collector
def StreamMetrics(self, request_iterator, context): LOG.debug("StreamMetrics called") # set up arguments collect_args = (next(request_iterator)) max_metrics_buffer = 0 max_collect_duration = 0 cfg = Metric(pb=collect_args.Metrics_Arg.metrics[0]) try: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _dispatch_metrics(self, payload):\n for item in payload:\n try:\n self._ingest.send(gauges=item['gauges'], counters=item['counters'])\n except Exception as e:\n self._logger.error(\"Exception while sending payload to ingest : {0}\".format(e))", "def ...
[ "0.70055574", "0.6102931", "0.60963494", "0.6073839", "0.60243076", "0.6016677", "0.5912792", "0.5852973", "0.57769173", "0.57684577", "0.57476234", "0.57459253", "0.57440335", "0.5738102", "0.5669972", "0.56475574", "0.562813", "0.5589964", "0.5565725", "0.55005115", "0.5425...
0.648967
1
Copy the next node to the middle node, then delete the next node.
def del_middle_node(node): next_node = node.next node.value = next_node.value node.next = next_node.next next_node.next = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def del_middle_node(node):\n if node == None or node.next == None:\n return\n\n node.data = node.next.data\n node.next = node.next.next", "def _delete(self):\n self.prev.next = self.next\n self.next.prev = self.prev", "def middleNode(self, head: Optional[ListNode]) -> Optional[Lis...
[ "0.7971518", "0.63340133", "0.62391603", "0.6204981", "0.6087874", "0.60737926", "0.6041707", "0.603408", "0.6032834", "0.5998454", "0.5897227", "0.58756375", "0.58752173", "0.57978374", "0.57974494", "0.57950276", "0.5794725", "0.5786917", "0.5765584", "0.5761735", "0.575359...
0.8157871
0
sets the new center for all the basis functions
def set_center(self,structure): for i,b in enumerate(self.bfs): b.set_center( structure[ self.LIST1[i] ] ) return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_center(self): \r\n \r\n self.grfx[0].center = self.center\r\n\r\n self.update_bbox()", "def _set_center(self):\n sl_center = np.array(\n [self.sl_list[k].mean_pos for k in range(self.nb_sl)]\n )\n sl_nb_pts = np.array(\n [self.sl_list[k].nb_points fo...
[ "0.72818935", "0.700697", "0.66382223", "0.66292685", "0.6628437", "0.655335", "0.6530293", "0.65248847", "0.649866", "0.6433271", "0.6419035", "0.6309602", "0.63081056", "0.6298524", "0.6280932", "0.6243688", "0.6211691", "0.618607", "0.618607", "0.618607", "0.618607", "0....
0.7330404
0
Automatically call prior to each testcase to check the value of dp_setup.setup_status and skip testcase if zero
def setup_status_check(dp_setup): if dp_setup.setup_status == 0: pytest.skip("Skipping testcase because setup \ did not complete properly")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n if not self.flag:\n self.fail(self.err_msg)", "def _dpdk_pre_post_flight_check(self):\n with self.assertRaises(\n zaza.model.CommandRunFailed,\n msg='openvswitch-switch-dpdk unexpectedly installed'):\n self._openvswitch_switch_d...
[ "0.6697237", "0.6449809", "0.6417722", "0.63475215", "0.6312798", "0.63067997", "0.6280792", "0.6267606", "0.6237606", "0.6232953", "0.6168967", "0.6137572", "0.6071447", "0.6061301", "0.60566294", "0.5981247", "0.5977145", "0.5973348", "0.597259", "0.59627193", "0.59577906",...
0.86521524
0
cal takes a string as a parameter. It executes the sql and returns the output as a list of tuples.
def cal(sql): try: db = psycopg2.connect(dbname="news") c = db.cursor() c.execute(sql) car = c.fetchall() db.close() return car except Exception: print("Unable to connect to the database")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query_with_results(string, args):\n con = connect()\n cursor = con.cursor()\n results = cursor.execute(string, args).fetchall()\n con.close()\n return results", "def sql_select(self, sqlstr):\n conn = sqlite3.connect('./as400-sqlite-test.db')\n cur = conn.cursor()\n cur.execute(sqls...
[ "0.5887786", "0.5854971", "0.5711145", "0.5693882", "0.56683975", "0.56478006", "0.5559393", "0.5495691", "0.54940605", "0.5488748", "0.54423237", "0.5426292", "0.5425873", "0.5416398", "0.53532416", "0.5326119", "0.5309507", "0.53088915", "0.52948564", "0.5293744", "0.528860...
0.6434578
0
Builds the protocol, with custom __init__
def buildProtocol(self,addr): p = self.protocol(self.server) p.factory = self return p
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buildProtocol(self, addr):\n p = self.protocol()\n p.factory = self\n\n return p", "def __init__(self, protocol):\r\n self._protocol = protocol", "def __init__(self, proto):\n self.proto = proto", "def buildProtocol(self, addr):\r\n p = RCERobotProtocol(self._con...
[ "0.77524734", "0.75429153", "0.7479376", "0.72501886", "0.7247391", "0.71940553", "0.716553", "0.71436805", "0.7138097", "0.7100936", "0.7074004", "0.70103806", "0.7001368", "0.69524616", "0.69453406", "0.69388264", "0.6899926", "0.6879389", "0.6875836", "0.68434674", "0.6843...
0.7732145
1
Removes either requirements files and folderor the Pipfile.
def clean_extra_package_managment_files(): use_pipenv = '{{cookiecutter.use_pipenv}}' to_delete = [] if use_pipenv == 'yes': to_delete = to_delete + ['requirements.txt', 'requirements'] else: to_delete.append('Pipfile') try: for file_or_dir in to_delete: if os.p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanUpPackage(inProgressFilename, packageFilename, propFilename):\n try:\n for filename in (inProgressFilename, packageFilename, propFilename):\n if (filename is not None and os.path.exists(filename)):\n os.remove(filename)\n\n except OSError, osErr :...
[ "0.68664074", "0.6558787", "0.6464328", "0.64382523", "0.6396354", "0.62534225", "0.6024302", "0.59059006", "0.58895797", "0.58886045", "0.58619416", "0.5846468", "0.5843512", "0.5818951", "0.5815958", "0.58048683", "0.5797034", "0.5782184", "0.57627606", "0.57581764", "0.575...
0.78929734
0
True iff is executable file (owner, group or other).
def is_executable(fname): return os.path.isfile(fname) and os.stat(fname)[0] & MASK_EXEC
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_exe(fpath):\n\treturn os.path.isfile(fpath) and os.access(fpath, os.X_OK)", "def is_exe(fpath):\n return os.path.isfile(fpath) and os.access(fpath, os.X_OK)", "def is_exe(fpath):\n return os.path.isfile(fpath) and os.access(fpath, os.X_OK)", "def is_exe(fpath):\n return os.pat...
[ "0.7857346", "0.78550386", "0.78550386", "0.78512764", "0.78447527", "0.7804142", "0.77570915", "0.77127725", "0.74625576", "0.7386272", "0.73597187", "0.72010404", "0.6978311", "0.6937337", "0.68281883", "0.6818289", "0.6699933", "0.6605572", "0.65465957", "0.64996475", "0.6...
0.8172241
0
Format a subsection, indented from start by pad.
def sub_section(title, lines, pad_len=4, sep='-'): pad = pad_len * " " msg = "{pad}{}\n{pad}{}\n".format(title, sep * len(title), pad=pad) msg += pad + ("\n" + pad).join(lines) + "\n" return msg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_sub_section(self, s, level=0):\n section = s.capitalize()\n\n self.print_newline()\n self._write('%s+ %s\\n' % ('-' * level, section))\n self.print_newline()", "def print_section(section_name, width=120):\n section_name = ' ' + section_name + ' '\n print('{:=^{ }}'.fo...
[ "0.64485496", "0.6437143", "0.6335083", "0.61184055", "0.5702746", "0.5643843", "0.56366056", "0.5630538", "0.5606433", "0.5604374", "0.55931115", "0.5564454", "0.5529032", "0.5523129", "0.54856855", "0.54148674", "0.54050434", "0.54030937", "0.5379921", "0.532174", "0.530255...
0.7129455
0
Check for possible matches to exe at path.
def check_exec(path, exe, show_version=False): bin_path = os.path.join(path, exe) msg = "" if is_executable(bin_path): if show_version: msg += check_version(bin_path) else: msg += sub_section("!!! MATCH !!!", [bin_path, ""]) matches = glob.glob(os.path.join(path...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_in_path(self):\n exe = self.command.split()[0]\n for try_path in os.environ[\"PATH\"].split(os.pathsep):\n try_path = try_path.strip('\"')\n exe_try = os.path.join(try_path, exe).strip()\n if os.path.isfile(exe_try) and os.access(exe_try, os.X_OK):\n ...
[ "0.70977217", "0.68621993", "0.6842875", "0.6819586", "0.6773935", "0.64745903", "0.6452131", "0.64097303", "0.6400948", "0.63270223", "0.63270223", "0.6325007", "0.6302778", "0.6294873", "0.6289575", "0.62629926", "0.62488735", "0.6189989", "0.6161732", "0.6161732", "0.61418...
0.75544256
0
Print $PATH component per line.
def path_show(args): print(header("$PATH Components")) loop_fmt = "{pad}{color}{path}" pad = 4 cnt = 0 for part in os.environ["PATH"].split(":"): color = u"" if args.color: color = CODES[cnt] cnt = (cnt + 1) % len(CODES) print(loop_fmt.format(pad=pad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printPath(path):\r\n result = ''\r\n for i in range(len(path)):\r\n result = result + str(path[i])\r\n if i != len(path) - 1:\r\n result = result + '->'\r\n return result", "def printPath(path):\n result = ''\n for i in range(len(path)):\n result = result + str(...
[ "0.710203", "0.70772994", "0.70381", "0.66111684", "0.6318243", "0.6207814", "0.61670434", "0.61619496", "0.6053944", "0.5967311", "0.5917095", "0.5852896", "0.58258593", "0.5720003", "0.56615204", "0.5644261", "0.56284446", "0.56226504", "0.5602241", "0.5601295", "0.5594626"...
0.71891445
0
Print message and release semaphore
def run(self): #acquire the semaphore global wheel while True: time.sleep(2) self.s2.acquire() self.empty.acquire() #remove a table from the list wheel += 1 print "Producer2(%s):deliver wheels, now wheels:%s\n" %(self.name, wheel) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def task(t, msg, sem):\n if not t:\n while True:\n threading.Event().wait(1)\n sem.acquire()\n print(msg)\n sem.release()\n \n threading.Event().wait(t)\n sem.acquire()\n print(msg)\n sem.release()", "def printTerminal(self,message):\n s...
[ "0.6507004", "0.61781317", "0.6085564", "0.6073453", "0.5934985", "0.5912831", "0.5851326", "0.5693102", "0.5692599", "0.56209695", "0.5569729", "0.55099505", "0.5456613", "0.535847", "0.5344952", "0.53287536", "0.53285146", "0.5310402", "0.53056663", "0.5160753", "0.5154181"...
0.6246595
1
Test day 9 pt 2 example
def test_example_day9_pt2(): assert find_pt2(ex_data, 127) == 62
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def day_07_b() -> int:\n return 0", "def day_06_b() -> int:\n return 0", "def day_07_a() -> int:\n return 0", "def day_06_a() -> int:\n return 0", "def doomsday(y):", "def test_return_day(self):\n self.assertEqual(functions.return_day(1), \"Sunday\")\n self.assertEqual(functions...
[ "0.66136426", "0.65968823", "0.65888894", "0.6534475", "0.6455408", "0.62773323", "0.62683856", "0.6199411", "0.61122984", "0.6112137", "0.6108768", "0.60916567", "0.5983843", "0.5955555", "0.59325564", "0.5862882", "0.58470434", "0.58446056", "0.5806196", "0.57691044", "0.57...
0.6675447
0
Reads and parses a mobileprovision file.
def _parse_mobileprovision_file(mobileprovision_file): plist_xml = subprocess.check_output([ "security", "cms", "-D", "-i", mobileprovision_file, ]) return plist_from_bytes(plist_xml)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_file(cls, filepath):\n hdus = sunpy.io.read_file(filepath)\n return cls._parse_hdus(hdus)", "def read_file(self, path):\n # pylint: disable=unused-variable\n info, pformat, error = (\n NSPropertyListSerialization.propertyListWithData_options_format_error_(\n ...
[ "0.5590612", "0.5553365", "0.54044497", "0.534706", "0.5318232", "0.5283724", "0.5156748", "0.5154537", "0.5145966", "0.5137374", "0.5096504", "0.5045959", "0.5041562", "0.50315565", "0.50198287", "0.50038105", "0.49572635", "0.4953668", "0.49524236", "0.4924946", "0.49201283...
0.79925627
0
Iterates through all the identities in a provisioning profile, lazily.
def _get_identities_from_provisioning_profile(mpf): for identity in mpf["DeveloperCertificates"]: if not isinstance(identity, bytes): # Old versions of plistlib return the deprecated plistlib.Data type # instead of bytes. identity = identity.data yield _certificate_fingerprint(identity)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identities(self, generator=False, **kwargs):\n g = self._iter(body=self._identities_iter(), **kwargs)\n if generator:\n return g\n\n return list(g)", "def gen_all_identities():\r\n def _build_identity_dict(mail, display_name, given_name, surname):\r\n \"\"\" Helper f...
[ "0.5671057", "0.5487254", "0.54406685", "0.54327255", "0.5364077", "0.5348866", "0.52735037", "0.52366084", "0.5212863", "0.52043575", "0.51688963", "0.5133527", "0.51135033", "0.50762534", "0.50690883", "0.505527", "0.5040877", "0.498099", "0.49657348", "0.49113193", "0.4898...
0.6923592
0
Finds code signing identities on the current system.
def _find_codesign_identities(identity=None): ids = [] output, stderr = _check_output([ "security", "find-identity", "-v", "-p", "codesigning", ]) output = output.strip() pattern = "(?P<hash>[A-F0-9]{40})" if identity: name_requirement = re.escape(identity) pattern += r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _find_codesign_identity(mobileprovision):\n mpf = _parse_mobileprovision_file(mobileprovision)\n ids_codesign = set(_find_codesign_identities())\n for id_mpf in _get_identities_from_provisioning_profile(mpf):\n if id_mpf in ids_codesign:\n return id_mpf", "def select_identity(self, identity=None):...
[ "0.6421708", "0.54043686", "0.5334617", "0.52265114", "0.522643", "0.52062505", "0.5130264", "0.511829", "0.50554866", "0.5008744", "0.49713695", "0.49288473", "0.49230838", "0.49016324", "0.48784655", "0.48597527", "0.48185772", "0.4810502", "0.4771155", "0.47399005", "0.472...
0.7543346
0
Finds a valid identity on the system given a mobileprovision file.
def _find_codesign_identity(mobileprovision): mpf = _parse_mobileprovision_file(mobileprovision) ids_codesign = set(_find_codesign_identities()) for id_mpf in _get_identities_from_provisioning_profile(mpf): if id_mpf in ids_codesign: return id_mpf
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_mobileprovision_file(mobileprovision_file):\n plist_xml = subprocess.check_output([\n \"security\",\n \"cms\",\n \"-D\",\n \"-i\",\n mobileprovision_file,\n ])\n return plist_from_bytes(plist_xml)", "def validate_registration(photo_file):\n try:\n print photo_file...
[ "0.6467533", "0.5665235", "0.51435935", "0.513177", "0.50548524", "0.5017768", "0.50087833", "0.49981916", "0.4991477", "0.4970559", "0.49571303", "0.4952973", "0.49484116", "0.48670015", "0.4831454", "0.48018855", "0.47946084", "0.47926822", "0.47809008", "0.47726947", "0.47...
0.76620007
0
Filters the codesign output which can be extra verbose.
def _filter_codesign_output(codesign_output): filtered_lines = [] for line in codesign_output.splitlines(): if line and not _BENIGN_CODESIGN_OUTPUT_REGEX.search(line): filtered_lines.append(line) return "\n".join(filtered_lines)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def code_signing_flag(self) -> pulumi.Output[Optional[bool]]:\n return pulumi.get(self, \"code_signing_flag\")", "def filter_output(self, request, output):\n return output", "def code_signing_flag(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"code_signing_flag\")", "...
[ "0.5447408", "0.5430029", "0.51496136", "0.51496136", "0.51020837", "0.49993205", "0.4966443", "0.49411124", "0.49411124", "0.49401996", "0.49248642", "0.49200615", "0.49023876", "0.48853683", "0.4876729", "0.48188573", "0.47790682", "0.47667938", "0.47568908", "0.4747938", "...
0.77639204
0
Delete Review from storage. If successful, return empty dictionary with status code 200, otherwise raise 404 error.
def delete_review(review_id): obj = storage.get(Review, review_id) if obj is None: abort(404) storage.delete(obj) storage.save() return jsonify({}), 200
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_review(review_id=None):\n if storage.get(Review, review_id):\n storage.delete(storage.get(Review, review_id))\n storage.save()\n return jsonify({})\n else:\n abort(404)", "def delete_review(review_id):\n obj = storage.get(\"Review\", review_id)\n if obj is None:...
[ "0.8092912", "0.7992279", "0.7952988", "0.7860057", "0.76822627", "0.71988267", "0.70540226", "0.70251113", "0.653468", "0.6435492", "0.6234737", "0.61351496", "0.61250883", "0.6110615", "0.6102468", "0.6071161", "0.58521837", "0.5665856", "0.56452197", "0.56336355", "0.56074...
0.8044858
1
Returns the running sum of a given list of numbers
def running_sum(nums_li: List[int]) -> List[int]: for i in range(1, len(nums_li)): nums_li[i] += nums_li[i - 1] return nums_li
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_of_numbers(numbers):\r\n return sum(numbers)", "def sum_list(numbers):\n\t\n\tif len(numbers) == 0:\n\t\treturn 0 \n\n\tsum = numbers[0] +sum_list(numbers[1:])\n\treturn sum", "def sum_numbers(sequence):\r\n\r\n total = 0\r\n seq = get_numbers(sequence)\r\n for element in seq:\r\n to...
[ "0.71576524", "0.69815713", "0.6841886", "0.6837456", "0.6800794", "0.6772406", "0.67528427", "0.67181194", "0.6673988", "0.65260226", "0.65095073", "0.64830434", "0.64651746", "0.6440968", "0.6426239", "0.6422132", "0.6415855", "0.64094716", "0.63918203", "0.63566345", "0.63...
0.83650804
0
Find a block, or create it if it doesn't exist.
def FindOrCreateBlock(self, name, instance): try: return self.FindBlock(name, instance) except KeyError: return self.CreateBlock({'name': name, 'instance': instance})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_block(self, addr):\n ret_block = None\n\n tag, set_index, offset = self._decompose(addr)\n\n if set_index not in self._d:\n self._d[set_index] = []\n block_list = self._d[set_index]\n for tag_, block in block_list:\n if tag == tag_:\n ...
[ "0.63424957", "0.6085005", "0.6040332", "0.59542054", "0.595163", "0.59020936", "0.58659786", "0.5862695", "0.5800195", "0.57171696", "0.57031226", "0.56728184", "0.56365144", "0.55348146", "0.5521383", "0.5520552", "0.5496947", "0.54944897", "0.5471456", "0.54080755", "0.537...
0.78933555
0
Yield the blocks in their defined order
def __iter__(self): for block in sorted(self.blocks.values(), key=lambda b: b.ordinal): yield block
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def blocks(self):\n if self._ast:\n for block in self._ast[2]:\n yield block", "def collect_blocks():\n\n # Below are the position of (c,r) in a block.\n\n #########################\n # (0,0) # (1,0) # (2,0) #\n #########################\n #########################...
[ "0.757031", "0.6530753", "0.65174127", "0.63614154", "0.63607633", "0.63177335", "0.63156325", "0.6270871", "0.6268873", "0.62680745", "0.6179819", "0.6109972", "0.6073869", "0.60731417", "0.6064365", "0.60582024", "0.6050395", "0.6039829", "0.5925948", "0.5923637", "0.591227...
0.7572616
0
Raise a changed event, unless it's been locked out by update()
def _changed(self, name, value): have_lock = self._change_lock.acquire(blocking=False) if have_lock: self._change_lock.release() self.changed() if not name.startswith('_'): self.PropertiesChanged(self.INTERFACE, {name: value}, [])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def changed_event(self):\n return True", "def _set_changed(self) -> None:\n self._changed = True", "def setChanged(self,value=True):\n self.changed = value", "def setChanged(self,value=True):\n self.changed = value", "def changed(self):\n\t\tpass", "def __itemChanged(self, eve...
[ "0.71976435", "0.67700016", "0.6700296", "0.6700296", "0.66102016", "0.64516914", "0.64472085", "0.6384654", "0.6346707", "0.6346707", "0.63417584", "0.63403016", "0.63403016", "0.63027227", "0.6270179", "0.62422806", "0.62234294", "0.6210248", "0.61960757", "0.6192888", "0.6...
0.7286034
0
Connecto to a mongodb database.
def connect_mongo_db(): host = parsed_mongodb_url['host'] port = parsed_mongodb_url['port'] database = parsed_mongodb_url['database'] username = parsed_mongodb_url['username'] password = parsed_mongodb_url['password'] connection = Connection(host, port) if username and password: co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mongodb_connect():\n # Load environment variables\n dotenv_path = find_dotenv()\n load_dotenv(dotenv_path)\n # Connect to the db\n # DB will be created if it doesn't already exist\n client = pymongo.MongoClient(os.environ.get(\"DATABASE_URL\"), 27017)\n db = client.tweetbase\n return db...
[ "0.8210052", "0.81336415", "0.8117833", "0.80774117", "0.80349237", "0.80312437", "0.78603804", "0.7805554", "0.77723104", "0.77163285", "0.771416", "0.7606415", "0.75520486", "0.7456694", "0.7437505", "0.7350662", "0.7344814", "0.73362505", "0.73249835", "0.73201", "0.729642...
0.81907785
1
Loads into session all towns (municipios) in PR
def load_towns(): if not hasattr(g, 'towns'): #g.towns = run_query('select id, name from municipios') g.towns = get_towns() return g.towns
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cargarObras(self):\n self.cargarObjetos(self.tableOs,\n ObraSocialModel.buscarTodos(\"razon_social\", self.sesion).all(),\n (\"razon_social\", \"cuit\", \"direccion\")\n )", "def cargar_obras(self):\n self.cargarObjetos(self.tableObra,\n ObraSocialModel.b...
[ "0.5073809", "0.50361466", "0.4984311", "0.48095226", "0.47972944", "0.47878638", "0.47013986", "0.46942475", "0.46800122", "0.46402198", "0.46401247", "0.4626877", "0.4625208", "0.46250755", "0.4604238", "0.45999122", "0.45901167", "0.45484176", "0.4535182", "0.45259017", "0...
0.6556211
0
Get all videos from specified city and renders them in the videos view.
def get_videos(town): entries = get_town_videos(town) print entries if entries: return render_template('videos.html', videos=entries, town=town) else: flash('No se encontraron videos.') return render_template('videos.html', town=town)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index():\n seen = set()\n seen_add = seen.add\n videos = []\n all_videos = mythVideo.searchVideos(insertedafter = '1900-01-01 00:00:00')\n\n for video in all_videos:\n path = video.filename.split('/')[0]\n if path not in seen and not seen_add(path):\n video.url = url_for...
[ "0.6410316", "0.6264452", "0.62203085", "0.6112654", "0.6078136", "0.60360736", "0.60235083", "0.59724677", "0.5959065", "0.5951703", "0.58861005", "0.5864474", "0.58401585", "0.5825435", "0.5802346", "0.5778463", "0.57751334", "0.576849", "0.5715935", "0.57039154", "0.568702...
0.73999655
0
List available sparse deep learning sentiment analysis models.
def available_sparse_deep_model(): return ['fast-text-char']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sparse_deep_model(model = 'fast-text-char', validate = True):\n return _softmax_class.sparse_deep_model(\n PATH_SENTIMENTS,\n S3_PATH_SENTIMENTS,\n 'sentiment',\n ['negative', 'positive'],\n 2,\n model = model,\n validate = validate,\n )", "def list_avai...
[ "0.6248117", "0.58962804", "0.5852594", "0.5757067", "0.5678869", "0.5617868", "0.55847305", "0.5567628", "0.5551601", "0.55444086", "0.54956007", "0.5494975", "0.5451769", "0.5421671", "0.5360751", "0.5297726", "0.529192", "0.51928556", "0.51770246", "0.516783", "0.51540864"...
0.68045807
0
List available deep learning sentiment analysis models.
def available_deep_model(): return [ 'fast-text', 'hierarchical', 'bahdanau', 'luong', 'bidirectional', 'bert', 'entity-network', ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_available_models(cls) -> List[PretrainedModelInfo]:\n list_of_models = []\n\n # en-US, ARPABET-based\n model = PretrainedModelInfo(\n pretrained_model_name=\"tts_en_radtts_aligner\",\n location=\"https://api.ngc.nvidia.com/v2/models/nvidia/nemo/tts_en_radtts_alig...
[ "0.68529797", "0.6511286", "0.6198815", "0.6003524", "0.58048916", "0.5759036", "0.57087564", "0.5695869", "0.56604546", "0.5656096", "0.5618853", "0.55990726", "0.5555275", "0.5535813", "0.5522266", "0.5472041", "0.54421264", "0.54421264", "0.54421264", "0.54421264", "0.5425...
0.659194
1
Load multinomial sentiment model.
def multinomial(validate = True): return _softmax_class.multinomial( PATH_SENTIMENTS, S3_PATH_SENTIMENTS, 'sentiment', ['negative', 'positive'], validate = validate, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model(self):\n filePath = self.config['data_path']['train_data']\n data = self.loadCSV(filePath)\n cleandata = self.preprocess(data)\n X, y = self.dataSplit(cleandata)\n X = self.CountVect(X, self.config['transform_path']['transform_model_path'])\n X_train, X_test, y_t...
[ "0.68189096", "0.617218", "0.60250115", "0.5983554", "0.5976382", "0.5950238", "0.5835725", "0.57773966", "0.5776157", "0.5773181", "0.5766718", "0.57583266", "0.5724592", "0.57227194", "0.5721556", "0.57197523", "0.5689089", "0.5656369", "0.5639414", "0.5621266", "0.561324",...
0.69505644
0
Load XGB sentiment model.
def xgb(validate = True): return _softmax_class.xgb( PATH_SENTIMENTS, S3_PATH_SENTIMENTS, 'sentiment', ['negative', 'positive'], validate = validate, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xgb_train(X_train, y_train, write=False):\n model_xgb = xgb.XGBClassifier(max_depth=7,\n min_child_weight=1,\n learning_rate=0.01,\n n_estimators=5000,\n gamma=0.8,\n ...
[ "0.63705534", "0.600376", "0.5956303", "0.59472424", "0.5885772", "0.5884835", "0.5846589", "0.5845727", "0.5843475", "0.5840624", "0.58338577", "0.5799269", "0.5791677", "0.5769696", "0.573035", "0.5723262", "0.5718337", "0.5708251", "0.5689359", "0.5683162", "0.5681601", ...
0.6143412
1
Train a multinomial model using your own corpus / dataset.
def train_multinomial(corpus, vector = 'tfidf', split_size = 0.2, **kwargs): if not ( isinstance(corpus, str) or isinstance(corpus, list) or isinstance(corpus, tuple) ): raise ValueError( 'corpus must be a string location or list of strings or tuple of strings' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model(self):\n filePath = self.config['data_path']['train_data']\n data = self.loadCSV(filePath)\n cleandata = self.preprocess(data)\n X, y = self.dataSplit(cleandata)\n X = self.CountVect(X, self.config['transform_path']['transform_model_path'])\n X_train, X_test, y_t...
[ "0.70000553", "0.67839295", "0.6768168", "0.6745569", "0.67182845", "0.66143817", "0.64957803", "0.642929", "0.63806903", "0.6358394", "0.6341894", "0.63235986", "0.6289102", "0.6270932", "0.6254924", "0.6250245", "0.6211102", "0.6208206", "0.6197866", "0.61841744", "0.617134...
0.75276536
0
Set URL or slug.
def set_url_slug(self, slug): slug = slug[-7:] if len(slug) == 7 and \ slug[0] == "p" and \ all(x in ascii_letters + digits for x in slug): self.slug = slug self.url = "https://rpaste.com/" + slug self.api_url = "https://rpaste.com/api/...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_slug(self, slug):\n if self.slug is None:\n self.slug = slug", "def set_slug(self):\n if not self.slug:\n self.slug = slugify(self.name)[:50]", "def set_url(self, url):\n self.url = url", "def set_url(self, url):\n if url is not None:\n self.ur...
[ "0.7856565", "0.7317531", "0.71623856", "0.70424086", "0.70105034", "0.6976292", "0.69207335", "0.6873143", "0.6664493", "0.65894234", "0.6582367", "0.6552071", "0.6471977", "0.6464758", "0.6464758", "0.63565755", "0.63444626", "0.6283054", "0.62376636", "0.62376636", "0.6237...
0.74837345
1
Print a summary table with the OaxacaBlinder effects
def summary(self): if self.model_type == 2: if self.std is None: print( dedent( f"""\ Oaxaca-Blinder Two-fold Effects Unexplained Effect: {self.params[0]:.5f} Explained Effect: {self.params[1]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printSummary(self):\n pass", "def print_summary(self):\n self.model.summary()", "def print_summary(self):\n\t\t\n\t\tif not self.objects:\n\t\t\tsys.stderr.write(\"No objects.\\n\")\n\t\t\treturn\n\t\t\n\t\t# Summary header data\n\t\theader = (\"ok\", \"error\", \"zdata\", \"xdata\", \"odata\...
[ "0.6694312", "0.65748495", "0.65513104", "0.6474881", "0.64278984", "0.6423322", "0.642323", "0.6371663", "0.63329065", "0.62521726", "0.621067", "0.6206692", "0.6201745", "0.6167351", "0.616657", "0.6162669", "0.6134523", "0.61327744", "0.6120603", "0.611306", "0.6099873", ...
0.682384
0
Send OTP to given mobile number.
def send_otp_to_primary_mobile(otp, mobile): print('Sending otp to mobile: ', otp, mobile)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sendOTP(code):\n # Modify the code here to change from print to any output \n print(\"Your OTP is \" + code + \". Kindly do not share it with anyone\")", "def send_sms_via_modem(self, mobile, text=\"\"):\n\n mobile = self.sanitise_phone(mobile)\n\n # Add '+' before country code\n m...
[ "0.7327891", "0.6951887", "0.6793021", "0.6524199", "0.6296417", "0.6277992", "0.62462425", "0.62288713", "0.6222681", "0.61966944", "0.6191283", "0.61755615", "0.6162277", "0.6120458", "0.6107131", "0.6077225", "0.60114545", "0.6000302", "0.59869677", "0.5910572", "0.5873281...
0.81184644
0
view that displays the post of the board specified by the provided bid
def board(bid): form = PostForm(request.form) posts = Post.query.filter_by( bid=bid, deleted=False).outerjoin(Comment).order_by( text("comment.date desc")) brd = Board.query.get(bid) return render_template('posts.html', posts=posts, b=brd, pform=form)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_post(post_id):\n\n posts = models.Post.select().where(models.Post.id == post_id)\n if posts.count() == 0:\n abort(404)\n return render_template('detail.html', posts=posts)", "def view_post(post_id):\n\n db_post = Post.query.get_or_404(post_id)\n full_name = db_post.user.get_full_na...
[ "0.64238364", "0.64142495", "0.6369537", "0.6365728", "0.6306215", "0.63038635", "0.6273676", "0.62036043", "0.6188795", "0.6163974", "0.61500585", "0.6116142", "0.6069818", "0.60510933", "0.60215914", "0.60149276", "0.59924364", "0.59832865", "0.5954234", "0.5937921", "0.592...
0.8378358
0
creates board if form parameters meet requirements
def create_board(): form = BoardForm(request.form) if current_user.is_admin and request.method == 'POST' and form.validate(): if Board.query.filter( func.lower(Board.name) == func.lower(form.name.data) ).scalar() is None: DB.session.add(Board(form.name.data, form.desc.dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_board(self):\n for field in self.fields_start_locs:\n loc = self.loc_to_view(field[0], field[1])\n new_field = Field(loc, self.piece_size)\n self.sprite_group.add(new_field)\n self.click_sprites.add(new_field)\n self.fields.append(new_field)"...
[ "0.603793", "0.5859027", "0.57967037", "0.57193846", "0.5695587", "0.56434304", "0.56327605", "0.5564936", "0.5536575", "0.55322415", "0.5510225", "0.55069685", "0.54559624", "0.54472303", "0.5427493", "0.54243577", "0.5404887", "0.5402026", "0.5395092", "0.53867", "0.5363956...
0.6169846
0
allows the editing of a board with the provided bid
def edit_board(bid): form = BoardForm(request.form) brd = Board.query.get(bid) if current_user.is_admin and request.method == 'POST': if form.validate(): if brd.name != form.name.data or brd.desc != form.desc.data: brd.name = form.name.data brd.desc = form...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def revive_board(bid):\n if current_user.is_admin:\n Board.query.get(bid).deleted = False\n DB.session.commit()\n msg = 'Board {} is now visible again.'\n flash(msg.format(bid))\n else:\n flash(constants.DEFAULT_SUBMISSION_ERR)\n return redirect(request.referrer)", "de...
[ "0.6417084", "0.63343984", "0.6053781", "0.60441285", "0.5873083", "0.5831679", "0.5816733", "0.57996845", "0.57737195", "0.5772161", "0.57612866", "0.5756384", "0.57373023", "0.5682081", "0.56092197", "0.5580099", "0.55707616", "0.55353636", "0.5534937", "0.5500094", "0.5460...
0.8023971
0
allows the board to be flagged for deletion by an admin
def delete_board(bid): if current_user.is_admin: Board.query.get(bid).deleted = True DB.session.commit() flash('Board {} is no longer viewable.'.format(bid)) return redirect(request.referrer)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_delete(self):\r\n return True", "def on_model_delete(self, model):\n if not current_user.is_active or not current_user.is_authenticated:\n abort(403)\n if not user_has_permission(current_user, 'can_delete','admins'):\n abort(403)", "def test_handle_delete_not_...
[ "0.67879754", "0.6325901", "0.62908286", "0.62738276", "0.61669207", "0.6166666", "0.6165566", "0.6154188", "0.6142294", "0.61347324", "0.6094835", "0.6094835", "0.6094835", "0.6083285", "0.6021208", "0.6018292", "0.5990092", "0.5981776", "0.59772396", "0.5955287", "0.5955114...
0.707618
0
allows for the creation of a comment by an active user
def create_comment(bid, pid): # pylint: disable=unused-argument form = CommentForm(request.form) if request.method == 'POST': if form.validate(): DB.session.add(Comment(pid, current_user.uid, form.text.data)) DB.session.commit() flash('Comment successfully created...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def obj_create(self, bundle, request=None, **kwargs):\n return super(CommentResource, self).obj_create(bundle, request, user=request.user, site=Site.objects.get_current())", "def form_valid(self, form):\n author = Profile.objects.get(user=self.request.user)\n object = self.get_object()\n ...
[ "0.69678545", "0.68733394", "0.68367547", "0.67674065", "0.676233", "0.6698197", "0.6653947", "0.6653032", "0.6644549", "0.6617098", "0.6610111", "0.66029644", "0.65430397", "0.6537922", "0.6513555", "0.6511368", "0.6444499", "0.6426328", "0.63783514", "0.63498986", "0.627524...
0.68905306
1
allows for a 'deleted' comment to be 'revived' by an admin
def revive_comment(bid, pid, cid): # pylint: disable=unused-argument comment = Comment.query.filter_by(pid=pid, cid=cid).first() if current_user.is_admin: comment.deleted = False DB.session.commit() return redirect(request.referrer)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(request, comment_id):\n try:\n comment = comments.get_object(pk=comment_id, site__id__exact=SITE_ID)\n except comments.CommentDoesNotExist:\n raise Http404\n if not comments.user_is_moderator(request.user):\n raise Http404\n if request.POST:\n # If the comment has...
[ "0.67821044", "0.67004305", "0.6567313", "0.6491898", "0.64727014", "0.64379954", "0.6308174", "0.6294083", "0.62237483", "0.6213215", "0.61960703", "0.6177323", "0.61392194", "0.6132944", "0.61212826", "0.60846806", "0.60760844", "0.606019", "0.6057162", "0.60461766", "0.603...
0.71453315
0