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
This function answers a onehop (singleedge) query using NGD (with the assistance of KG2).
def answer_one_hop_query(self, query_graph: QueryGraph) -> Tuple[DictKnowledgeGraph, Dict[str, Dict[str, str]]]: log = self.response continue_if_no_results = self.response.data['parameters']['continue_if_no_results'] final_kg = DictKnowledgeGraph() edge_to_nodes_map = dict() # V...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def graph_search(self, node, query):\n\n\t\t\"\"\"\n\t\t<query> ::= <n_query> | <g_query>\n\t\t<n_query> ::= \"NEIGHBOURS WHO HAVE\" <n_conditions> | \"ALL NEIGHBOURS\"\n\t\t<n_conditions> ::= <n_and_condition> | <n_and_condition> \"OR\" <n_and_condition>\n\t\t<n_and_condition> ::= <n_condition> | <n_condition> \"...
[ "0.5460548", "0.5453947", "0.52025557", "0.51701957", "0.5130239", "0.51206386", "0.5064141", "0.5026112", "0.49954873", "0.49836746", "0.4943305", "0.4921272", "0.49076694", "0.4891348", "0.48813057", "0.48529524", "0.4844709", "0.4819694", "0.48096135", "0.48028374", "0.479...
0.7049062
0
This is the command line application MEI2Volpiano
def main(): start = timer() parser = argparse.ArgumentParser() option = parser.add_mutually_exclusive_group(required=True) # options for either neume or CWN option.add_argument( "-N", action="store_true", help="An MEI neume encoded music file representing neume notation", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():", "def cli():"...
[ "0.63343185", "0.63343185", "0.63343185", "0.63343185", "0.63343185", "0.63343185", "0.63343185", "0.63343185", "0.63343185", "0.63343185", "0.63343185", "0.63343185", "0.63343185", "0.63343185", "0.63343185", "0.63343185", "0.63343185", "0.63343185", "0.63343185", "0.63343185"...
0.6585868
0
choose a random header from a list of browsers
def get_random_header(browser): return np.random.choice(browser)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pick_random_fakeheader(ua, browsers):\n\n browser_to_fetch = get_random_header(browsers)\n total_browsers = len(ua.data['browsers'][browser_to_fetch])\n final_choice = np.random.choice(np.arange(0,total_browsers))\n\n return ua.data['browsers'][browser_to_fetch][final_choice]", "def random_header...
[ "0.82136023", "0.70924", "0.6852964", "0.6709336", "0.66573715", "0.6303137", "0.62959445", "0.6246944", "0.61391836", "0.60612166", "0.60612166", "0.5849485", "0.5843458", "0.58139086", "0.57858175", "0.56270903", "0.561433", "0.5580197", "0.54564226", "0.54546094", "0.54447...
0.8076699
1
Sets the cluster_resource_blacklist of this V1alpha1AppProjectSpec.
def cluster_resource_blacklist(self, cluster_resource_blacklist): self._cluster_resource_blacklist = cluster_resource_blacklist
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def namespace_resource_blacklist(self, namespace_resource_blacklist):\n\n self._namespace_resource_blacklist = namespace_resource_blacklist", "def cluster_resource_whitelist(self, cluster_resource_whitelist):\n\n self._cluster_resource_whitelist = cluster_resource_whitelist", "def namespace_resou...
[ "0.6568799", "0.6556435", "0.48343667", "0.48002732", "0.47786647", "0.4554653", "0.45341927", "0.45097786", "0.44528902", "0.44080153", "0.43625948", "0.43624744", "0.4346612", "0.43173265", "0.43173265", "0.43173265", "0.43173265", "0.43173265", "0.43173265", "0.42959046", ...
0.82667166
0
Sets the cluster_resource_whitelist of this V1alpha1AppProjectSpec.
def cluster_resource_whitelist(self, cluster_resource_whitelist): self._cluster_resource_whitelist = cluster_resource_whitelist
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_resource_blacklist(self, cluster_resource_blacklist):\n\n self._cluster_resource_blacklist = cluster_resource_blacklist", "def namespace_resource_whitelist(self, namespace_resource_whitelist):\n\n self._namespace_resource_whitelist = namespace_resource_whitelist", "def setWhitelist(se...
[ "0.62739164", "0.60411185", "0.5089617", "0.50537497", "0.48310104", "0.47624213", "0.47124147", "0.45890537", "0.45889914", "0.45767656", "0.4558406", "0.44039834", "0.4389433", "0.4330078", "0.4303742", "0.42995507", "0.42841667", "0.42841667", "0.42841667", "0.42841667", "...
0.81803614
0
Sets the destinations of this V1alpha1AppProjectSpec.
def destinations(self, destinations): self._destinations = destinations
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_dests(self, increment=1000000):\n modified = 0\n pb = Progress(len(self.graph.routers), 'Setting destinations', increment=increment, callback=lambda: 'Modified {:,d}'.format(modified))\n for router in pb.iterator(self.graph.routers.values()):\n for interface in router.interf...
[ "0.47158515", "0.4665349", "0.4608839", "0.4501391", "0.4247299", "0.41732445", "0.4047182", "0.40161753", "0.40159917", "0.40157002", "0.39602298", "0.39117265", "0.38896346", "0.38875103", "0.3867983", "0.3847913", "0.37956917", "0.3780831", "0.37749454", "0.37608975", "0.3...
0.60614246
0
Sets the namespace_resource_blacklist of this V1alpha1AppProjectSpec.
def namespace_resource_blacklist(self, namespace_resource_blacklist): self._namespace_resource_blacklist = namespace_resource_blacklist
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_resource_blacklist(self, cluster_resource_blacklist):\n\n self._cluster_resource_blacklist = cluster_resource_blacklist", "def namespace_resource_whitelist(self, namespace_resource_whitelist):\n\n self._namespace_resource_whitelist = namespace_resource_whitelist", "def results_blackli...
[ "0.66674614", "0.6185001", "0.48380986", "0.47621787", "0.47287998", "0.46488237", "0.45955205", "0.4574053", "0.45668086", "0.45283675", "0.44960856", "0.42551893", "0.42438513", "0.42251417", "0.42251417", "0.4125466", "0.4125295", "0.41019773", "0.40750888", "0.40675256", ...
0.8122667
0
Sets the namespace_resource_whitelist of this V1alpha1AppProjectSpec.
def namespace_resource_whitelist(self, namespace_resource_whitelist): self._namespace_resource_whitelist = namespace_resource_whitelist
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_resource_whitelist(self, cluster_resource_whitelist):\n\n self._cluster_resource_whitelist = cluster_resource_whitelist", "def namespace_resource_blacklist(self, namespace_resource_blacklist):\n\n self._namespace_resource_blacklist = namespace_resource_blacklist", "def field_whitelist...
[ "0.63100505", "0.5779759", "0.5463231", "0.5450754", "0.52660394", "0.49888772", "0.48200515", "0.47032884", "0.4639689", "0.46117297", "0.45605776", "0.44705164", "0.44587287", "0.42739424", "0.4259641", "0.4259641", "0.42567164", "0.42109194", "0.41819394", "0.41524276", "0...
0.7851198
0
Sets the orphaned_resources of this V1alpha1AppProjectSpec.
def orphaned_resources(self, orphaned_resources): self._orphaned_resources = orphaned_resources
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_orphan_nodes(self):\n used=np.zeros( self.Nnodes(),'b1')\n valid_cells=~self.cells['deleted']\n valid_nodes=self.cells['nodes'][valid_cells,:].ravel()\n valid_nodes=valid_nodes[ valid_nodes>=0 ]\n used[ valid_nodes ]=True\n\n valid_edges=~self.edges['deleted']\n...
[ "0.47404408", "0.46289498", "0.4556851", "0.44946486", "0.44773713", "0.4323399", "0.43131456", "0.42577386", "0.42407513", "0.41813985", "0.41481432", "0.41410577", "0.41238782", "0.41153413", "0.4063514", "0.40551057", "0.4039265", "0.4014042", "0.40008706", "0.39848053", "...
0.7421018
0
Sets the roles of this V1alpha1AppProjectSpec.
def roles(self, roles): self._roles = roles
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iam_roles(self, iam_roles):\n\n self._iam_roles = iam_roles", "def init_roles(self):\n self.role_owner = Role.objects.get_or_create(\n name=PROJECT_ROLE_OWNER, rank=ROLE_RANKING[PROJECT_ROLE_OWNER]\n )[0]\n self.role_delegate = Role.objects.get_or_create(\n n...
[ "0.5656673", "0.54616374", "0.54347897", "0.52515507", "0.5167078", "0.51326984", "0.51121455", "0.5077801", "0.5017687", "0.5017687", "0.49672422", "0.4964679", "0.48843944", "0.4881705", "0.4875122", "0.48712397", "0.4836624", "0.48284185", "0.4817877", "0.48141718", "0.480...
0.6300075
1
Sets the signature_keys of this V1alpha1AppProjectSpec.
def signature_keys(self, signature_keys): self._signature_keys = signature_keys
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_keys(self, keys=None):\n self.keys = keys\n self.is_keys_configured = True\n return self.keys", "def signatures(self, signatures):\n\n self._signatures = signatures", "def signatures(self, signatures):\n\n self._signatures = signatures", "def multipart_signatures(se...
[ "0.56306034", "0.5552292", "0.5552292", "0.52918816", "0.5252791", "0.5088407", "0.50518364", "0.50301355", "0.50301355", "0.49673504", "0.4959093", "0.49469665", "0.49469665", "0.49447834", "0.49075145", "0.4883841", "0.48422343", "0.48071453", "0.4736776", "0.46558493", "0....
0.71489954
0
Sets the source_repos of this V1alpha1AppProjectSpec.
def source_repos(self, source_repos): self._source_repos = source_repos
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sources(self, sources):\n\n self._sources = sources", "def set_source(self, val: str) -> list:\n sources = self.source_control.list_sources()\n index = self.source().index(val)\n self.source_control.set_source(sources[index])\n return sources", "def install_packages_from_...
[ "0.5843343", "0.5224188", "0.51058424", "0.50227916", "0.5002087", "0.4969106", "0.4968547", "0.48985454", "0.48435324", "0.4793096", "0.47807917", "0.46721166", "0.46662378", "0.4548366", "0.45473292", "0.44902623", "0.44819576", "0.44649464", "0.4457664", "0.44451606", "0.4...
0.81240124
0
Sets the sync_windows of this V1alpha1AppProjectSpec.
def sync_windows(self, sync_windows): self._sync_windows = sync_windows
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setSyncObj(self, sync_obj):\n \n self.sync_obj = sync_obj", "def sync(self, sync):\n self._sync = sync", "def sync(self, sync):\n\n self._sync = sync", "def sync_ready_files(self, sync_config=None):\n\n if sync_config is None:\n sync_config = config.getSettin...
[ "0.5222951", "0.48990247", "0.48569527", "0.47897488", "0.4723029", "0.46186468", "0.45443392", "0.45117566", "0.4501894", "0.44092584", "0.43864316", "0.43804726", "0.4367945", "0.42415252", "0.42376322", "0.4209161", "0.41754746", "0.41705188", "0.41681433", "0.41671357", "...
0.73873824
0
V.FindGrid([float, float, float], int, int) > bool
def FindGrid(self, p_float=..., p_float=..., p_float=..., *args, **kwargs): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_grid(grid: List):\n for row in range(9):\n for col in range(9):\n if grid[row][col] == 0:\n return False\n return True", "def solve(grid):\n values = grid_values(grid);\n values = search(values);\n if values is False:\n return F...
[ "0.6904694", "0.69035083", "0.68831736", "0.6778803", "0.66752994", "0.6653471", "0.66272354", "0.66272354", "0.66214526", "0.6614329", "0.6614329", "0.6577785", "0.6537437", "0.64780456", "0.64228785", "0.64004683", "0.6384666", "0.63720965", "0.6305891", "0.6291061", "0.628...
0.7508737
0
V.GetAMRBlockSourceIndex(int, int) > int
def GetAMRBlockSourceIndex(self, p_int, p_int_1): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSourceIndex(self):\n return self.sourceIndex", "def getscanind(self,blk=None,zarange=[0,90]):\n ind=self.getind('ss','se',arr(blk))\n ind=ind[(self.za[ind]>=zarange[0]) & (self.za[ind]<=zarange[1])]\n return ind", "def getNum(self):\r\n return self.blockNum", "def Ge...
[ "0.6078317", "0.5616232", "0.54190886", "0.5382564", "0.5380426", "0.5380426", "0.5368612", "0.53090084", "0.52938646", "0.5292369", "0.5249408", "0.52143323", "0.517606", "0.51496434", "0.5127336", "0.51235336", "0.51099914", "0.51083034", "0.50858516", "0.5071685", "0.50665...
0.89148974
0
V.GetAMRBox(int, int) > vtkAMRBox
def GetAMRBox(self, p_int, p_int_1): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetBoxOrigin(self, vtkAMRBox, , , p_float=..., p_float=..., p_float=...):\n ...", "def GetBounds(self, vtkAMRBox, , , p_float=..., p_float=..., p_float=..., p_float=..., p_float=..., p_float=...):\n ...", "def DoesBoxIntersectAlongDimension(self, vtkAMRBox, p_int):\n ...", "def Compu...
[ "0.7127239", "0.66509455", "0.6135703", "0.6081684", "0.60808533", "0.5734712", "0.5517648", "0.54851764", "0.54445744", "0.54122233", "0.53573936", "0.532762", "0.5322254", "0.52572924", "0.52508837", "0.5245788", "0.52172005", "0.52098083", "0.5199811", "0.51943064", "0.518...
0.8429009
0
V.GetChildren(int, int, int) > (int, ...)
def GetChildren(self, p_int, p_int_1, p_int_2): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_children(self):\n return self.children", "def Children(self) -> _n_1_t_2:", "def GetChildren(self, *args, **kwargs):\n pass", "def getChildren():", "def get_children(self):\n raise NotImplementedError()", "def get_children(self):\n\n pass", "def get_children(self):\r\n ...
[ "0.74495816", "0.743867", "0.74178755", "0.73059773", "0.7110207", "0.6971802", "0.6961303", "0.68350554", "0.683379", "0.67108226", "0.67108226", "0.67108226", "0.66719663", "0.66513085", "0.6649762", "0.6645837", "0.66429794", "0.6609459", "0.65970117", "0.6580709", "0.6564...
0.82302654
0
V.GetParents(int, int, int) > (int, ...)
def GetParents(self, p_int, p_int_1, p_int_2): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getParents(obj):", "def get_parents(self):\n return self.parents", "def get_parents(self):\r\n\r\n raise NotImplementedError()", "def get_parents(self, node):\n pass", "def _get_parents(self):\n parents = []\n parent = self.parent\n while(parent):\n pare...
[ "0.71629727", "0.71202075", "0.6965256", "0.6814471", "0.665683", "0.6568503", "0.653097", "0.6529805", "0.6519751", "0.6515182", "0.6492262", "0.64920664", "0.64552474", "0.64396226", "0.6394068", "0.6392005", "0.6386981", "0.63630295", "0.63480735", "0.6283615", "0.6281372"...
0.8392016
0
V.GetSpacing(int, [float, float, float])
def GetSpacing(self, p_int, p_float=..., p_float=..., p_float=...): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSpacing(self):\n\t\tif not self.spacing:\n\t\t\ta, b, c = self.getVoxelSize()\n\t\t\tself.spacing = [1, b / a, c / a]\n\t\treturn self.spacing", "def GetSpacing(self):\r\n\r\n return self._spacing", "def SetSpacing(self, p_int, ):\n ...", "def GetNiceExtentsBySpacing(minval,maxval,spacin...
[ "0.73958474", "0.6804658", "0.67101395", "0.6645179", "0.6613635", "0.62137085", "0.61841726", "0.61377025", "0.5912062", "0.5882472", "0.5834353", "0.5795799", "0.5764464", "0.5720836", "0.56411296", "0.5636155", "0.5580743", "0.55806106", "0.55604494", "0.552074", "0.550080...
0.8345666
0
V.SetSpacing(int, (float, float, float))
def SetSpacing(self, p_int, ): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetSpacing(self, p_int, p_float=..., p_float=..., p_float=...):\n ...", "def SetSpacing(self, spacing):\r\n \r\n self._spacing = spacing\r\n self._dirty = True", "def setSpace(*args):", "def spacing(self, spacing):\n\n self._spacing = spacing", "def setS2(self, num):\...
[ "0.7220863", "0.71452504", "0.69280785", "0.6901124", "0.67545503", "0.6707529", "0.64424914", "0.6371636", "0.6304656", "0.6161201", "0.6105386", "0.6027554", "0.60183966", "0.5996043", "0.5894791", "0.5878667", "0.5807304", "0.56933963", "0.5641319", "0.56217706", "0.559906...
0.8255248
0
Shift an individual timestamp by time (in seconds) specified by shift.
def shift_timestamp(self, shift, timestamp): shift_msecs = self.convert_shift_to_msecs(shift) timestamp_msecs = self.convert_timestamp_to_msecs(timestamp) shifted_timestamp_msecs = timestamp_msecs + shift_msecs new_timestamp = self.convert_msecs_to_timestamp(shifted_timestamp_msecs) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timeshift(self, shift='random'):\n\n if shift == 'random':\n one_month = pd.Timedelta('30 days').value\n two_years = pd.Timedelta('730 days').value\n random_timedelta = - pd.Timedelta(random.uniform(one_month, two_years)).round('min')\n self.timeshift(random_t...
[ "0.7490555", "0.6513127", "0.62462676", "0.6163517", "0.61389947", "0.61330914", "0.61143714", "0.6098659", "0.6073621", "0.5846323", "0.58403003", "0.5821474", "0.5817079", "0.5774835", "0.5763053", "0.57360756", "0.573162", "0.5708343", "0.5635046", "0.56247425", "0.5597457...
0.80548173
0
Returns a list of nfp role ids for the given country_code
def get_nfps_for_country(agent, country_code): out = [] filterstr = "(objectClass=groupOfUniqueNames)" nfp_roles = agent.filter_roles("eionet-nfp-*-%s" % country_code, prefix_dn="cn=eionet-nfp,cn=eionet", filterstr=filterstr, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_country_roles(country):\n cnx,cur = connect_to_db()\n cur.execute(\"SELECT DISTINCT role FROM locations, movie_crew \"\n \"WHERE locations.country LIKE '%\" + country + \"%' AND locations.movie_id = movie_crew.movie_id\")\n lst = cur.fetchall()\n cur.close()\n cnx.close()\n return ls...
[ "0.68543124", "0.60308", "0.58834505", "0.58374494", "0.5726656", "0.57035583", "0.5563071", "0.5394777", "0.5363848", "0.53490204", "0.52890545", "0.52733433", "0.5223569", "0.5066113", "0.5039613", "0.5030031", "0.5021796", "0.49816248", "0.4973988", "0.49356353", "0.489882...
0.7458555
0
Get the "canonical" national organisation for the given user_id It will return the organisation info only if the organisation is set to exist in the country for that role.
def get_national_org(agent, user_id, role_id): # test if the user is member of a national organisation # for that role country_code = role_id.split('-')[-1] if country_code == "eea": country_code = 'eu' user_orgs = agent._search_user_in_orgs(user_id) for org_id in user_orgs: or...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def users_organizations(user):\n if not user or not user.is_authenticated():\n return None\n else:\n return get_users_organizations(user)", "def get_organisation_with_role(user, rolecode):\n return get_organisations_with_role(user, rolecode).get()", "def _get_default_org(user):\n org ...
[ "0.6496113", "0.6446185", "0.6237947", "0.5795275", "0.5413031", "0.5384386", "0.5371785", "0.5363697", "0.5116979", "0.50656396", "0.50544775", "0.49874184", "0.49597615", "0.49081486", "0.48514292", "0.48420817", "0.48097688", "0.48048013", "0.47731102", "0.47703958", "0.47...
0.74825794
0
Tests if logged in user is allowed to manage Eionet Groups members for `country` (whether he is an NFP member for country)
def _allowed(self, agent, request, country_code): uid = logged_in_user(request) if not uid: return False filterstr = ("(&(objectClass=groupOfUniqueNames)(uniqueMember=%s))" % agent._user_dn(uid)) nfp_roles = agent.filter_roles("eionet-nfp-*-%s" % country_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_admin(user):\n return user.groups.filter(name='Profesores').exists()", "def get_is_por_holder(self, obj):\n user = self.context['request'].user\n if not user.is_authenticated:\n return False\n # pylint: disable=no-member\n profile = UserProfile.objects.get(user=us...
[ "0.627715", "0.61944795", "0.6048954", "0.595665", "0.59496796", "0.59434396", "0.5931241", "0.59159684", "0.5903144", "0.58679557", "0.58426243", "0.58424985", "0.5840404", "0.5839861", "0.5824786", "0.58187926", "0.58106774", "0.5775222", "0.5749774", "0.56927633", "0.56713...
0.84610283
0
get the ldap agent
def _get_ldap_agent(self, bind=True, secondary=False): return _get_ldap_agent(self, bind, secondary)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def agent(self):\n return self.__agent", "def get_agent(self, agent_id: str) -> Mapping[str, Any]:\n return self.__get_one_by_id(\"agents\", \"agent_id\", agent_id)", "def getAgentID(self):\n\t\treturn self.agentID", "def manager_agents(self):\n return self.get(\"manager_agents\")", "def g...
[ "0.6153555", "0.5888479", "0.58839697", "0.57423484", "0.5736684", "0.5730297", "0.5509301", "0.5477947", "0.5460218", "0.5418989", "0.53976846", "0.531001", "0.528273", "0.5275227", "0.52713215", "0.52711236", "0.5260928", "0.5240722", "0.5205437", "0.51857626", "0.5157785",...
0.80129576
0
Check if the role belongs to an Eionet Group branch
def is_eionet_group(self, role_id): for role in EIONET_GROUPS: if role in role_id: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_group(group, user, request):\n return group_names[group] in groupfinder(user.username, request)", "def is_in_group(user, group_name):\n return is_in_group_user_id(user.id, group_name)", "def in_group(self, group):\n\n return self.secondary_groups.filter(\n groups...
[ "0.6374182", "0.62234205", "0.6183245", "0.61474323", "0.604928", "0.5973084", "0.596522", "0.5956546", "0.5949658", "0.59449756", "0.5893639", "0.58863354", "0.5872401", "0.585149", "0.5829334", "0.58139235", "0.579164", "0.5755576", "0.57402104", "0.5737842", "0.5730022", ...
0.67998475
0
Connect to browser target.
async def connect_to_browser(self) -> 'Target': if not self.http_session: raise RuntimeError('Not connected') version = await self.version() debugger_url = version['webSocketDebuggerUrl'] return await Target.connect_to(self, debugger_url)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def connect_to_page(self, target_id: cdp.target.TargetID) -> 'Target':\n if not self.http_session:\n raise RuntimeError('Not connected')\n\n url = f'ws://{self.host}:{self.port}/devtools/page/{target_id}'\n\n return await Target.connect_to(self, url)", "def _connect_to_targe...
[ "0.68850845", "0.66236496", "0.64335054", "0.63396275", "0.6337935", "0.6335964", "0.63318574", "0.62778044", "0.62761956", "0.62761956", "0.62761956", "0.62761956", "0.62761956", "0.62761956", "0.62761956", "0.62761956", "0.62594175", "0.62427133", "0.6182503", "0.61807597", ...
0.78972465
0
Connect to page target.
async def connect_to_page(self, target_id: cdp.target.TargetID) -> 'Target': if not self.http_session: raise RuntimeError('Not connected') url = f'ws://{self.host}:{self.port}/devtools/page/{target_id}' return await Target.connect_to(self, url)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect(self, **kwargs):\n pass", "def goto(self, page: str):\n self.get(urllib.parse.urljoin(settings.config.host, page))", "def connect(self):", "def connect(self):", "def setup_page(self):\n raise NotImplementedError", "def connect(self):\n\t\tpass", "def setup_page(self):\r...
[ "0.6041468", "0.6036182", "0.6009564", "0.6009564", "0.6003629", "0.5994629", "0.59842205", "0.5970292", "0.5951099", "0.5947242", "0.5947242", "0.5947242", "0.5947242", "0.5947242", "0.5947242", "0.5947242", "0.5947242", "0.5939789", "0.5881336", "0.5872837", "0.584142", "...
0.73689544
0
Return list of notes filtered with search string. Based on the search mode that has been selected in self.config, this method will call the appropriate helper method to do the actual work of filtering the notes. Returns a list of filtered notes with selected search mode and sorted
def filter_notes(self, search_string=None, search_mode='gstyle', sort_mode='date'): if search_mode == 'gstyle': filtered_notes, match_regexp, active_notes = \ self.filter_notes_gstyle(search_string) else: filtered_notes, match_regexp, active_notes = \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search(self, filter):\n return [note for note in self.notes if note.match(filter)]", "def filter_notes_regex(self, search_string=None):\n sspat = utils.build_regex_search(search_string)\n\n filtered_notes = []\n active_notes = 0 # total number of notes, including deleted ones\n\n ...
[ "0.7003456", "0.6391022", "0.63331777", "0.61903375", "0.61632293", "0.60038686", "0.57961875", "0.5764786", "0.55892396", "0.548495", "0.5374986", "0.5354947", "0.5272562", "0.5247351", "0.5233451", "0.521227", "0.51795834", "0.515085", "0.51381636", "0.51201856", "0.5106415...
0.7813836
0
Return a list of notes filtered using the regex search_string. Each element in the list is a tuple (local_key, note).
def filter_notes_regex(self, search_string=None): sspat = utils.build_regex_search(search_string) filtered_notes = [] active_notes = 0 # total number of notes, including deleted ones for k in self.notes: n = self.notes[k] active_notes += 1 if not s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search(self, filter):\n return [note for note in self.notes if note.match(filter)]", "def search(self, filtr):\n return [note for note in self.notes if note.match(filtr)]", "def filter_notes(self, search_string=None, search_mode='gstyle', sort_mode='date'):\n\n if search_mode == 'gstyl...
[ "0.74945545", "0.7010573", "0.6944499", "0.6774287", "0.63493174", "0.6244763", "0.6007675", "0.5778099", "0.5591814", "0.55637234", "0.5515972", "0.5496392", "0.54534", "0.5441066", "0.5410709", "0.5406766", "0.5405156", "0.5382933", "0.53828", "0.53801614", "0.53514516", ...
0.76642567
0
provides the new mapping for the feet and elevator region The numbers can be found in doc/roi_map_R2.pdf
def feetRegionMapping(sectorId, roiId): etacode = -1 phicode = -1 if sectorId in [23,24,55,56]: # elevator region # eta etaMap = { 23 : [ [0,1,2,3,5,7], [4,6,8,9,10,11], range(12,20) + [21,23], [20,22] + range(24,28) ], 24 : [ [0,1,2,3,4,6], [5,7,8,9,10,11],...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_farness_map(self,ind):", "def complete_mapping(self):\r\n\r\n self._reset_map()\r\n #position_prey = self.prey.position\r\n #self.complete_map[position_prey[1], position_prey[0]] = 1.0\r\n position_body = [part.position for part in self.body]\r\n\r\n for position in...
[ "0.65188205", "0.61094123", "0.60542434", "0.58556753", "0.58161896", "0.58019525", "0.5801687", "0.5796364", "0.5788499", "0.5770133", "0.5747545", "0.56993014", "0.5617317", "0.558814", "0.55693185", "0.5557276", "0.55380374", "0.55127054", "0.5511414", "0.5502563", "0.5497...
0.71320045
0
Applying assembling procedure on stiffness operator.
def apply_stiffness_assembling(fe_space, param, stiffness): if stiffness.format is 'lil': for ie in range(fe_space.get_nelem()): local_stiffness = fe_space.apply_dbasis_diag_dbasis(fe_space.eval_at_quadrature_pnts( lambda k, s: fe_space.get_quadrature_weight(k) * ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assemble_operator(self, parameters, space_group='default'):\n operator = super(RWGDominantSystem, self).assemble_operator(parameters, space_group)\n return operator.weak_form()", "def __init__(self):\n super(OperatorCodegen, self).__init__()", "def __init__(self, workdir, encut, struct...
[ "0.54695237", "0.54459226", "0.52665687", "0.5183384", "0.51749873", "0.51478934", "0.51361424", "0.50997984", "0.50707746", "0.50151825", "0.49721244", "0.49668637", "0.49660572", "0.49462074", "0.4940909", "0.49275163", "0.4913201", "0.4913201", "0.49054685", "0.48903242", ...
0.6116024
0
This function takes in a reference array and a target array, and returns a list of indices corresponding to the reference array representing the nearest location for each element in the target array.
def find_nearest(ref_array,target_array): ref_tree = scipy.spatial.cKDTree(ref_array) dist, indices = ref_tree.query(target_array, k=1) return indices
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_nearest(numbers, target):\n numbers = np.asarray(numbers)\n idx = (np.abs(numbers - target)).argmin()\n return numbers[idx]", "def find_closest(A, target):\n idx = A.searchsorted(target)\n idx = np.clip(idx, 1, len(A)-1)\n left = A[idx-1]\n right = A[idx]\n idx -= tar...
[ "0.7376947", "0.71696067", "0.68925834", "0.6638693", "0.6502767", "0.6429031", "0.642404", "0.6402894", "0.6369818", "0.62598187", "0.62439954", "0.6227487", "0.6172433", "0.61081296", "0.6093826", "0.60883665", "0.6081583", "0.6078421", "0.60658765", "0.6052211", "0.6019307...
0.88203615
0
Return the current night
def what_night_is_it(): d = datetime.datetime.utcnow() - datetime.timedelta(7 / 24 + 0.5) tonight = int(d.strftime('%Y%m%d')) return tonight
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_twilight(self, datetime_today, lon, lat, alt):\r\n\r\n dusk = self._astral.dusk_utc(datetime_today, lat, lon,\r\n observer_elevation=alt,\r\n depression=self.twilight_alt)\r\n\r\n dawn = self._astral.dawn_utc(datetime_to...
[ "0.6685126", "0.6504532", "0.6377594", "0.6233825", "0.61677843", "0.6145368", "0.6081653", "0.599185", "0.59623015", "0.59606326", "0.59022343", "0.5895444", "0.58787614", "0.58345497", "0.5812852", "0.58105254", "0.57725716", "0.5744524", "0.5730577", "0.5730475", "0.570804...
0.78487873
0
Defines the time of day that the desi_daily_proc_manager should start (in Tucson local time). Before this time, the manager being woken by a cron job will exit immediately. Selected to give plenty of time between end of night and start of the next, but early enough to catch and begin running afternoon calibrations.
def get_nightly_start_time(): return 14 # 2PM local Tucson time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_timer(self):\n self.start_time = datetime.now()", "def schedule(self):\n\n crontab = self._crontab\n return datetime.now() + timedelta(\n seconds=math.ceil(\n crontab.next(default_utc=False)\n )\n )", "def startSchedule(self):\n ...
[ "0.5864404", "0.5845078", "0.5782451", "0.57714564", "0.5747688", "0.5735679", "0.5727533", "0.5707443", "0.5707243", "0.5669906", "0.5666356", "0.56551886", "0.5653813", "0.56412345", "0.55963415", "0.55686224", "0.5544438", "0.55299264", "0.54894394", "0.5469584", "0.544465...
0.589263
0
Defines when a night ends for desi_daily_proc_manager in local Tucson time. Once this time is exceeded, the manager will enter into queue cleanup mode and then exit when the jobs have finished. End of night is altered slightly for summer vs. winter.
def get_nightly_end_time(): month = time.localtime().tm_mon if np.abs(month - 6) > 2: end_night = 8 else: end_night = 7 return end_night # local Tucson time the following morning
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def end_time(self) -> float:\r\n ...", "def end_time(self):\n pass", "def work_refresh(self):\n now = dt.now()\n self.eisenhower_priority()\n p_week = now.isocalendar()[1] - self.work_datetime.isocalendar()[1]\n\n if (1 <= p_week) and (self.priority not in [1, 2]):\n ...
[ "0.56307155", "0.5593822", "0.54645705", "0.5344776", "0.5312911", "0.53107923", "0.52935", "0.52770907", "0.5271404", "0.5250609", "0.5230171", "0.5203919", "0.51776296", "0.51651216", "0.511294", "0.5087598", "0.5057946", "0.50208515", "0.5020203", "0.50135165", "0.5006336"...
0.56841046
0
load data from h5py and pickle cache files, which is generate by take step by step of preprocessing.ipynb
def load_data(cache_file_h5py,cache_file_pickle): if not os.path.exists(cache_file_h5py) or not os.path.exists(cache_file_pickle): raise RuntimeError("############################ERROR##############################\n. " "please download cache file, it include training data and voc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ReadData(self, path):\n os.chdir(path)\n folders=os.listdir()\n if 'data.hdf5' in folders:\n print('Loading data from hdf5 file! Might take some time, be patient!')\n file=h5py.File('data.hdf5','r+')\n data=(np.array(list(file['imgs'])),np.array(list(file['...
[ "0.66427547", "0.6617532", "0.6526976", "0.65033656", "0.65017515", "0.6462454", "0.6357204", "0.63428587", "0.625926", "0.62496346", "0.62292343", "0.622499", "0.6170811", "0.61558926", "0.6155771", "0.6155618", "0.6142324", "0.6141928", "0.6135481", "0.6128751", "0.6126239"...
0.67743564
1
Test startTest on a TestProtocolClient.
def test_start_test(self): self.protocol.startTest(self.test) self.assertEqual(self.io.getvalue(), compat._b( "test: %s\n" % self.test.id()))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def startTest(self, test):\n test = proto_test(test)\n self.start_time = time.time()\n self.reinitialize()\n if self.start_callback:\n self.start_callback(test)", "def setUp(self):\n super(TestTestProtocolServerAddSkip, self).setUp()\n self.client = doubles.Ex...
[ "0.7089606", "0.6991087", "0.69811773", "0.69811773", "0.67669487", "0.6764599", "0.67337006", "0.6575118", "0.6541605", "0.62071294", "0.6202682", "0.619467", "0.61365044", "0.6099138", "0.60862267", "0.6084381", "0.6083515", "0.6083515", "0.60576314", "0.60086185", "0.60042...
0.78042114
0
Test addSuccess on a TestProtocolClient.
def test_add_success(self): self.protocol.addSuccess(self.test) self.assertEqual( self.io.getvalue(), compat._b("successful: %s\n" % self.test.id()))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addSuccess(self, test):\n self.passing.append(proto_test(test))", "def addSuccess(self, test):\n test.status = \"success\"", "def addUnexpectedSuccess(self, test):\n self.unexpectedSuccesses.append(proto_test(test))", "def test_add_unexpected_success(self):\n self.protocol.add...
[ "0.78897375", "0.7432925", "0.7042965", "0.69792974", "0.6970298", "0.69608134", "0.69081587", "0.6784713", "0.67432046", "0.67134386", "0.67088974", "0.6281571", "0.62530994", "0.61994356", "0.61389357", "0.60578483", "0.6054586", "0.60060495", "0.59793675", "0.59591967", "0...
0.80909115
0
Test addFailure on a TestProtocolClient.
def test_add_failure(self): self.protocol.addFailure( self.test, pysubunit.RemoteError(compat._u("boo qux"))) self.assertEqual( self.io.getvalue(), compat._b( ('failure: %s [\n' + _remote_exception_str + ': boo qux\n]\n') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addFailure(self, test, err):\n self.failures.append((proto_test(test), proto_error(err)))", "def test_add_expected_failure(self):\n self.protocol.addExpectedFailure(\n self.test, pysubunit.RemoteError(compat._u(\"phwoar crikey\")))\n self.assertEqual(\n self.io.getv...
[ "0.7555378", "0.73333305", "0.71542907", "0.6998989", "0.69609314", "0.6880364", "0.6709455", "0.6667108", "0.6650538", "0.66448617", "0.6593037", "0.65581167", "0.6512226", "0.64881617", "0.63991416", "0.6398955", "0.639351", "0.63903075", "0.6375204", "0.6323293", "0.629793...
0.7836011
0
Test addFailure on a TestProtocolClient with details.
def test_add_failure_details(self): self.protocol.addFailure( self.test, details=self.sample_tb_details) self.assertThat([ compat._b(("failure: %s [ multipart\n" "Content-Type: text/plain\n" "something\n" "F\r\n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_add_failure(self):\n self.protocol.addFailure(\n self.test, pysubunit.RemoteError(compat._u(\"boo qux\")))\n self.assertEqual(\n self.io.getvalue(),\n compat._b(\n ('failure: %s [\\n' +\n _remote_exception_str + ': boo qux\\n]\\...
[ "0.78175", "0.7429148", "0.73572826", "0.7057278", "0.6990474", "0.6846735", "0.6801991", "0.6781444", "0.666402", "0.6654897", "0.65940017", "0.6585273", "0.6525825", "0.6523674", "0.6441117", "0.6371629", "0.63609", "0.63361716", "0.6314415", "0.63051534", "0.6202819", "0...
0.74894166
1
Test addExpectedFailure on a TestProtocolClient.
def test_add_expected_failure(self): self.protocol.addExpectedFailure( self.test, pysubunit.RemoteError(compat._u("phwoar crikey"))) self.assertEqual( self.io.getvalue(), compat._b(('xfail: %s [\n' + _remote_exception_str + ": phwoar crikey\n" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_add_failure(self):\n self.protocol.addFailure(\n self.test, pysubunit.RemoteError(compat._u(\"boo qux\")))\n self.assertEqual(\n self.io.getvalue(),\n compat._b(\n ('failure: %s [\\n' +\n _remote_exception_str + ': boo qux\\n]\\...
[ "0.7448379", "0.72454816", "0.6925539", "0.6829574", "0.6638397", "0.6590699", "0.6576527", "0.6523018", "0.64959174", "0.64842033", "0.63974303", "0.6350911", "0.62821376", "0.62781614", "0.62781125", "0.625326", "0.61696154", "0.6166211", "0.616511", "0.6037276", "0.6036271...
0.7563909
0
Test addSkip on a TestProtocolClient.
def test_add_skip(self): self.protocol.addSkip( self.test, "Has it really?") self.assertEqual( self.io.getvalue(), compat._b('skip: %s [\nHas it really?\n]\n' % self.test.id()))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addSkip(self, test, reason):\n self.skipped.append((proto_test(test), reason))", "def addSkip(self, test):\n test.status = \"skipped\"", "def addSkip(self, test, reason):\r\n self.skipped.append((test, reason))", "def addSkip(self, test, reason, test_time=None):\n test = proto...
[ "0.76838744", "0.7376305", "0.72299814", "0.7081819", "0.69312227", "0.68714046", "0.6506891", "0.6466875", "0.6466856", "0.6417001", "0.6377712", "0.6368462", "0.63548523", "0.63357544", "0.62715966", "0.6225051", "0.6100105", "0.5993911", "0.5903022", "0.5883527", "0.580368...
0.7646681
1
Test addUnexpectedSuccess on a TestProtocolClient.
def test_add_unexpected_success(self): self.protocol.addUnexpectedSuccess(self.test) self.assertEqual( self.io.getvalue(), compat._b("uxsuccess: %s\n" % self.test.id()))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addUnexpectedSuccess(self, test):\n self.unexpectedSuccesses.append(proto_test(test))", "def test_add_success(self):\n self.protocol.addSuccess(self.test)\n self.assertEqual(\n self.io.getvalue(), compat._b(\"successful: %s\\n\" % self.test.id()))", "def addUnexpectedSuccess...
[ "0.75503165", "0.7299932", "0.71680415", "0.701285", "0.6661378", "0.6583948", "0.6548976", "0.64214855", "0.63754934", "0.62810117", "0.6240336", "0.62012625", "0.61962175", "0.61581457", "0.6152776", "0.61113435", "0.60741615", "0.59891045", "0.59119743", "0.58895236", "0.5...
0.7628601
0
add a new AlissCatalog object
def manage_addAlissCatalog(self, REQUEST=None): ob = AlissCatalog() self._setObject(ALISS_CATALOG_ID, ob) ob = self._getOb(ALISS_CATALOG_ID) if REQUEST is not None: return self.manage_main(self, REQUEST, update_menu=1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def catalogAdd(type, orig, replace):\n ret = libxml2mod.xmlCatalogAdd(type, orig, replace)\n return ret", "def AddCatalog(*args):\n return _gdi_.Locale_AddCatalog(*args)", "def newCatalog(sgml):\n ret = libxml2mod.xmlNewCatalog(sgml)\n if ret is None:raise treeError('xmlNewCatalog() failed')...
[ "0.68184793", "0.6708821", "0.6705245", "0.64603", "0.64104664", "0.6301568", "0.6301568", "0.6301568", "0.6268189", "0.6244777", "0.617665", "0.611244", "0.60263735", "0.5946354", "0.58789617", "0.57902205", "0.57871777", "0.5760815", "0.57286006", "0.56823784", "0.56240755"...
0.8322521
0
return the default Lexicon object
def getLexicon(self): #return self._getOb('Lexicon') return self._getOb('LexiconUnicode')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lexicon() -> Lexicon:\n return Lexicon()", "def createDefaultTerm(self):\n return _libsbml.Transition_createDefaultTerm(self)", "def __init__(self, lexicon):\n self._lexicon = set(lexicon)", "def getDefault():", "def createDefaultTerm(self):\n return _libsbml.ListOfFunctionT...
[ "0.82436305", "0.6282878", "0.6117525", "0.6072888", "0.60672706", "0.60583323", "0.60296947", "0.5933384", "0.5875077", "0.58136445", "0.5806923", "0.5744499", "0.573025", "0.57245", "0.5693584", "0.56908846", "0.5625971", "0.5610396", "0.5593642", "0.55851114", "0.5525295",...
0.6939543
1
build a path for items to be added in catalog
def BuildCatalogPath(self, p_item): #create a path for a GlossElement object if p_item.meta_type == METATYPE_ALISSELEMENT: return '%s/%s' % (p_item.center_parent, p_item.id) #create a path for a Google object elif p_item.meta_type == METATYPE_ALISSGOOGLE: return '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path_entries(self):", "def putioPath(self, itemID=None):\r\n\r\n path = self.get_items(id_Number=itemID)[0].name\r\n\r\n while 1:\r\n itemID = self.get_items(id_Number=itemID)[0].parent_id\r\n if itemID == \"0\":\r\n break\r\n else:\r\n ...
[ "0.6349046", "0.59432155", "0.592059", "0.57067627", "0.55969167", "0.5571004", "0.55395555", "0.55165714", "0.551252", "0.5412942", "0.5376559", "0.53650856", "0.5339648", "0.53159803", "0.52989215", "0.5286366", "0.52775544", "0.52657396", "0.5261524", "0.5260877", "0.52554...
0.71182406
0
check if catalog contain all required language indexes
def checkCatalogIndexes(self, trans): for lang in trans.keys(): index_id = 'objecttrans_%s' % lang if not index_id in self.indexes(): self.__createObjecttransIndex(index_id) index_id = 'objectname_%s' % lang if not index_id in self.indexes(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_search_catalogs(self):\n # Implemented from kitosid template for -\n # osid.resource.BinQuerySession.can_search_bins_template\n return self._get_provider_session('catalog_query_session').can_search_catalogs()", "def _check_indexes(cls, document: dict) -> bool:\n criteria = [\n...
[ "0.5804809", "0.5803072", "0.5777058", "0.57221395", "0.56718177", "0.55868465", "0.5575644", "0.55626893", "0.55131245", "0.54899025", "0.54793316", "0.54623723", "0.54423916", "0.5422075", "0.54200166", "0.5405952", "0.5383554", "0.5367854", "0.53635687", "0.5351064", "0.53...
0.71843207
0
Convert XLIFF for OS into files for Fastlane.
def parse_xliff_for_os(target_dir_name, os_name, target_language, body_element): for trans_unit in body_element: trans_unit_id = trans_unit.attrib['id'] trans_unit_target = '' for trans_unit_element in trans_unit: if trans_unit_element.tag.endswith('target'): tran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_prep_sffs_in_dir_FLX(self):\r\n output_dir = mkdtemp()\r\n gz_output_dir = mkdtemp()\r\n\r\n prep_sffs_in_dir(\r\n self.sff_dir, output_dir, make_flowgram=True, convert_to_flx=True)\r\n prep_sffs_in_dir(\r\n self.gz_sff_dir, gz_output_dir, make_flowgram=Tr...
[ "0.5209742", "0.5079297", "0.5062647", "0.50184184", "0.49853018", "0.4953047", "0.49354112", "0.49220338", "0.49107054", "0.48852277", "0.47603548", "0.4758385", "0.47563154", "0.47334105", "0.47260725", "0.4633263", "0.45723534", "0.4567473", "0.4533931", "0.45197284", "0.4...
0.52549684
0
Returns the first argument of the current command. In case of C_ARITHMETIC the command itself(add, sub, etc) should be returned Should not be called if the current command is C_RETURN
def arg1(self): if self.command_type() == Parser.C_PUSH or self.command_type() == Parser.C_POP: arg1 = self._line.split()[1] elif self.command_type() == Parser.C_ARITHMETIC: arg1 = self._line.split()[0] else: raise Exception("Not to be invoked with any other c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arg1(self):\n t = self.command_type()\n if t == 'C_RETURN':\n return\n\n args = self.current_command.split(' ')\n\n if t == 'C_ARITHMETIC':\n # Return the command itself.\n return args[0]\n\n return args[1]", "def arg1(self):\n\n if s...
[ "0.84906065", "0.7668968", "0.74903506", "0.67605907", "0.6582214", "0.64484614", "0.62341356", "0.6226234", "0.6101848", "0.6075553", "0.6045665", "0.60451514", "0.6028199", "0.60166526", "0.59489936", "0.5822253", "0.5749517", "0.57383287", "0.57357925", "0.5717175", "0.571...
0.7707823
1
Returns the second argument of the current command. Should be called if the current command is C_PUSH, C_POP, C_FUNCTION, C_CALL
def arg2(self): if self.command_type() == Parser.C_PUSH or self.command_type() == Parser.C_POP: arg1 = self._line.split()[2] else: raise Exception("Not to be invoked with any other command") return arg1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arg2(self):\n t = self.command_type()\n if t not in ['C_PUSH', 'C_POP', 'C_FUNCTION', 'C_CALL']:\n return\n\n return int(self.current_command.split(' ')[2])", "def arg2(self):\n\n if self.cmd_arg2 is not None:\n return self.cmd_arg2\n if self.cmd_type ...
[ "0.8713521", "0.8159917", "0.7639201", "0.7521386", "0.71248466", "0.7054335", "0.69981486", "0.6655983", "0.58813435", "0.58761126", "0.5847901", "0.58203095", "0.5697673", "0.5697662", "0.56924695", "0.5633464", "0.5614543", "0.5549985", "0.55434513", "0.5522409", "0.551069...
0.831895
1
Any line starting with // with optional blank at beginning is comment line
def _is_comment_line(self): pattern = re.compile(r"^(\s)*(//)+") return pattern.search(self._line)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_comment_or_blank(line):\n return re.sub(\"#.*\", \"\", line).rstrip() == \"\"", "def test_line(line):\r\n if not line.strip():\r\n return False # if the last line is blank\r\n if line.startswith(\"#\"):\r\n return False # comment line\r\n if line.startswith(\" #\"):\r\n ...
[ "0.81134015", "0.7671486", "0.7571881", "0.74947685", "0.74947685", "0.74259174", "0.73317593", "0.7184068", "0.70719975", "0.6939862", "0.6884402", "0.6863583", "0.6854358", "0.6839799", "0.6826999", "0.6790105", "0.67788965", "0.6721242", "0.67054063", "0.6656393", "0.66031...
0.8121222
0
Any line starting with empty white space
def _is_blank_line(self): pattern = re.compile(r"^(\s)*$") return pattern.search(self._line)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def emptyline(self):", "def emptyline(self):\n pass", "def emptyline(self):\n pass", "def emptyline(self):\n pass", "def emptyline(self):\n pass", "def emptyline(self):\n pass", "def emptyline(self):\n pass", "def emptyline(self):\n pass", "def empty...
[ "0.75008094", "0.72994244", "0.72994244", "0.72994244", "0.72994244", "0.72994244", "0.72994244", "0.72994244", "0.72994244", "0.72994244", "0.72994244", "0.72994244", "0.72994244", "0.72994244", "0.72994244", "0.72994244", "0.72994244", "0.72994244", "0.72303194", "0.72284067"...
0.7674267
0
Opens the output file/stream and gets ready to write into it
def __init__(self, output_file): self.file = open(output_file, "w")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, output_path):\n self._file = open(output_path, 'w')\n # TODO when do we close the file?", "def open_file(self):\n self.file = open(os.path.join(self.__output_dir,\n self.__file_name), 'a+')", "def _open_output_files(self):\n se...
[ "0.71359557", "0.69334805", "0.67140836", "0.66441375", "0.6581463", "0.6475662", "0.6460137", "0.62968624", "0.62951654", "0.62649393", "0.62639534", "0.62474906", "0.62474906", "0.6239776", "0.61994517", "0.6194923", "0.615737", "0.61560625", "0.6155741", "0.6146083", "0.61...
0.6967602
1
Writes the assembly code that is the translation of the given command where command is C_PUSH or C_POP
def write_pushpop(self, command): commands = command.split(',') command_type = commands[0] vir_mem = commands[1] offset = commands[2] file_name = commands[3] vm_assembly_map = {Parser.LOCAL: "LCL", Parser.ARGUMENT: "ARG", Parser.THIS: "THIS", Parser.THAT: "THAT"} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writePushPop(self, command_type, m_segment, index):\r\n #This list contains the traduction of the vm command\r\n assemblerTraduction = []\r\n\r\n #We get the adress where we going to push/pop\r\n self.getAdressaAndStore(m_segment,index)\r\n \r\n #Then we do the push or...
[ "0.689484", "0.68493456", "0.66462064", "0.6622019", "0.62338036", "0.62115765", "0.62091494", "0.61357534", "0.6017542", "0.5943167", "0.58944315", "0.5875879", "0.58081526", "0.5718805", "0.5708593", "0.5662727", "0.56334895", "0.5627864", "0.5602732", "0.5549107", "0.55292...
0.7299073
0
SP = SP +1
def _incr_stack_pointer(self): return ["@SP", "M=M+1"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _push_d_sp_inc(self):\n return [\"@SP // RAM[*SP]=D\", \"A=M\", \"M=D\", \"@SP // SP++\", \"M=M+1\"]", "def increment(self):\r\n return self.add(1)", "def CALL(self):\n self.sp -= 1\n self.ram[self.sp] = self.pc\n # print(f\"RAM AT : {self.sp} is set to : {self.pc + 1}\")\n...
[ "0.6085644", "0.584796", "0.5800999", "0.5585802", "0.5571556", "0.5524629", "0.5375343", "0.5327831", "0.52963525", "0.52570647", "0.5236387", "0.52348053", "0.5165136", "0.5055833", "0.5041387", "0.503783", "0.50241363", "0.5013815", "0.50092274", "0.49935445", "0.49916047"...
0.65130466
0
Set the D register of the RAM from the symbol pointer
def _set_D(self, symbol, address): return ["@{s}".format(s=symbol), "A={a}".format(a=address), "D=M"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_memory_d(self, d_k):\n self.mem_d[self.mem_idx-1] = d_k", "def set_ds9(ds9_name, command):\n os.system('xpaset -p {} {}'.format(ds9_name, command))", "def _setReg(address, new_value):\n mem[address:address+4] = struct.pack(\"<L\", new_value)", "def GET():\n global pointer, memory, ...
[ "0.6385568", "0.59522706", "0.58477545", "0.584509", "0.5782657", "0.57523876", "0.5726411", "0.571431", "0.5680936", "0.56203526", "0.5557392", "0.5534914", "0.5495749", "0.5351116", "0.53005564", "0.52993613", "0.5296203", "0.52939737", "0.528468", "0.5284453", "0.52667445"...
0.69734484
0
Set stack pointer to any constant SP = const
def _set_stack(self, val): return ["@SP", "A=M", "M={v}".format(v=val)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _incr_stack_pointer(self):\n return [\"@SP\", \"M=M+1\"]", "def set_local(self, where: Any, what: Any, depth: int = 0) -> None:\n self.scope_stack[depth][where] = what", "def setSorConstant(*argv):", "def _decr_stack_pointer(self):\n return [\"@SP\", \"M=M-1\"]", "def setConstant(s...
[ "0.5734654", "0.55372083", "0.55030084", "0.54901266", "0.5262003", "0.5204025", "0.5192936", "0.5097905", "0.5074397", "0.5071584", "0.5019008", "0.5004177", "0.4986717", "0.49833924", "0.49660513", "0.4894534", "0.4894309", "0.4871328", "0.48550794", "0.4847307", "0.4823604...
0.608921
0
persist stock data into cassandra
def persist_data(stock_data, cassandra_session, table): # noinspection PyBroadException try: logger.debug('Start to persist data to cassandra %s' % stock_data) parsed = json.loads(stock_data)[0] symbol = parsed.get('StockSymbol') trade_price = float(parsed.get('LastTradePri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def persist_data(tweet_data, cassandra_session):\n try:\n logger.debug('Start to persist data to cassandra %s \\n', tweet_data)\n parsed = json.loads(tweet_data)\n unit_id = str(parsed.get('_unit_id'))\n gender = parsed.get('gender')\n tweet_text = str(parsed.get('text'))\n ...
[ "0.6677104", "0.65452754", "0.62983066", "0.6296236", "0.6266032", "0.621209", "0.61236465", "0.6112263", "0.60899127", "0.6061804", "0.6055768", "0.6041199", "0.598814", "0.5959243", "0.5887244", "0.58861655", "0.58861655", "0.58861655", "0.58861655", "0.58861655", "0.588616...
0.77135867
0
Returns a string representation of this Tensor.
def __str__(self): if self._tensor.base is not None: base_id = id(self._tensor.base) else: base_id = id(self._tensor) return ("MKLTensor(base 0x%x" % (base_id))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n string = 'input dim: {} \\noutput dim: {} \\n'.format(\n self.dim_inputs, self.dim_outputs\n )\n string += 'sequence length: {} \\n'.format(\n self.tensors[0].shape[1]\n )\n key = 'train' if self.train else 'test'\n string += '{}_...
[ "0.7433959", "0.7367101", "0.7339814", "0.73187244", "0.7249028", "0.71606815", "0.7145521", "0.7142435", "0.71130675", "0.708897", "0.70708287", "0.70708287", "0.702908", "0.7016489", "0.69857943", "0.69173187", "0.6839453", "0.6839453", "0.6839453", "0.6839453", "0.6839453"...
0.74641913
0
Doing following operations ( is dot product) C = alpha A B + beta C C = alpha A.T B + beta C C = alpha A B.T + beta C.
def compound_dot(self, A, B, C, alpha=1.0, beta=0.0, relu=False, bsum=None): # checking type and shape assert A.dtype == B.dtype == C.dtype assert A.shape[0] == C.shape[0] assert B.shape[1] == C.shape[1] assert A.shape[1] == B.shape[0] # cleaner implementation, shall be...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dot_product(a, b):\n a1, a2, a3 = a\n b1, b2, b3 = b\n return a1 * b1 + a2 * b2 + a3 * b3", "def dot(a,b):\n return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]", "def dot_product(a,b):\n return sum(pairwise_mult(a,b))", "def dot(a, b):\n return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]", "def dotproduct(fi...
[ "0.703049", "0.6972193", "0.6962898", "0.6943959", "0.6843877", "0.6811131", "0.6810457", "0.6789144", "0.67202604", "0.67055047", "0.6690397", "0.66159105", "0.6615744", "0.65986776", "0.6591225", "0.6581338", "0.6566474", "0.6558373", "0.6546115", "0.6546061", "0.652328", ...
0.76985675
0
Generates the delta function given an odd square dimension N by creating zero matrix.
def delta(N): assert assert_odd(N) # Make sure kernel is odd X = np.zeros((N,N)) # Square matrix with all 0s middle = int(N/2) # Get the middle cell X[middle, middle] = 1 return X
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delta_n(n, zeros):\n #return log(zeros[n]/2.0/pi/e)/2.0/pi*(zeros[n+1]-zeros[n])\n return log(zeros[n]/2.0/pi)/2.0/pi*(zeros[n+1]-zeros[n])", "def delta(feat, N):\n if N < 1:\n raise ValueError('N must be an integer >= 1')\n NUMFRAMES = len(feat)\n denominator = 2 * sum([i**2 for i in r...
[ "0.65351194", "0.626917", "0.6144308", "0.60009986", "0.5902635", "0.58943486", "0.5870464", "0.58662266", "0.5857804", "0.5853089", "0.5787235", "0.5757295", "0.5757295", "0.57562304", "0.5748507", "0.56821865", "0.5650267", "0.5640219", "0.5623418", "0.5582307", "0.55793285...
0.711521
0
This function will perform convolution with the given matrix and kernel. This function uses 0 padding on the outside borders.
def convolution(matrix, kernel): assert assert_odd(kernel.shape[0]) # Padded matrix (0s on the outsides) N = kernel.shape[0] # Get the dim for the kernel I = np.pad(matrix, int(N/2), "constant") # Now do the convolution C = np.zeros(matrix.shape) # This is the convolved image h, w ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convolution(img, kernel, padding='fill'):\n kernel = np.rot90(kernel, 2)\n h,w = kernel.shape[:2]\n t,b,l,r = (h-1)//2, h//2, (w-1)//2, w//2 # Use numpy padding because it works for >2d\n padshape = [(t,b),(l,r)]+[(0,0)]*(len(img.shape[2:]))\n padded_img = np.pad(img, padshape, mode={'fill':'...
[ "0.7632912", "0.76311946", "0.7551659", "0.7400428", "0.7213529", "0.71208394", "0.7003862", "0.69647676", "0.6909829", "0.6783065", "0.673895", "0.6738016", "0.6705835", "0.66465807", "0.65897006", "0.6584861", "0.6547534", "0.6535303", "0.653341", "0.6512233", "0.6511599", ...
0.82693774
0
This function will convolute the image with the kernel given. It differs from the previous convolution as it uses OpenCV's filter2D function.
def image_conv(image, kernel): # Filter2D used for performance return cv2.filter2D(image, -1, kernel)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convolve2d(img, kernel):\n #Flip the kernel\n kernel = utils.flip2d(kernel) \n #print(len(kernel))\n \n c = copy.deepcopy(img)\n \n #print(len(c))\n #Padd the image\n pad = int((len(kernel)-1)/2)\n\n\n padded_img = utils.zero_pad(img,pad,pad)\n #print(len(padded_img), len(padde...
[ "0.75807047", "0.755509", "0.74828804", "0.74383056", "0.7352", "0.72860307", "0.7280619", "0.72026116", "0.7106084", "0.70763195", "0.70723087", "0.70494944", "0.7045266", "0.7028931", "0.6998131", "0.69829017", "0.69829017", "0.69670445", "0.6938216", "0.69115037", "0.68828...
0.79748696
0
Calls the iterative and recursive string split algorithms.
def run_algorithms(string_list): string_count = int(string_list[0]) for i in range(1, string_count+1): string = string_list[i] print("Phrase number: ", i) print(string, "\n") split_string = [] memo = set() print("Iterative attempt:") if iterative_string_split(string, split_string) is True: print("Y...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testSplit(self):\n\n s = StrObject(u\"first second\")\n result = s.call(u\"split\", [StrObject(u\" \")])\n pieces = [obj._s for obj in unwrapList(result)]\n self.assertEqual(pieces, [u\"first\", u\"second\"])", "def split(self, splits, catchall=False):\r\n raise NotImplementedE...
[ "0.62122536", "0.6134692", "0.6108132", "0.60939974", "0.60594094", "0.6029314", "0.59996396", "0.5980705", "0.58860856", "0.5850706", "0.57737094", "0.5751543", "0.57350135", "0.5734275", "0.57134223", "0.5694736", "0.5676853", "0.5648834", "0.56419", "0.56327176", "0.560755...
0.7042849
0
Prints a list of strings.
def print_string_list(string_list): final_string = "" for string in string_list: final_string += string + " " return final_string
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_list(words):\r\n for w in words:\r\n print w,\r\n print", "def print_list(l):\n print('[' + ', '.join([x.__str__() for x in l]) + ']')", "def print_list(self, items):\n\t\tstrtype = unicode if self.encoding else bytes\n\t\titems = map(strtype, items)\n\t\twidth = self.get_width()\n\t\...
[ "0.76438946", "0.75164205", "0.748451", "0.7393484", "0.7275923", "0.71694815", "0.716044", "0.711536", "0.71125954", "0.70837015", "0.70613664", "0.6909535", "0.6881573", "0.6851617", "0.6836259", "0.68032455", "0.67870075", "0.6785108", "0.6715998", "0.6679586", "0.6675944"...
0.7805148
0
Create audio accessor and return it. Returns
def add_audio_accessor(self): audio_accessor_id = RPR.CreateTakeAudioAccessor(self.id) audio_accessor = reapy.AudioAccessor(audio_accessor_id) return audio_accessor
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_audio():\n text, lang = introduction()\n ses = boto3.Session(profile_name=\"default\")\n pol = ses.client(\"polly\")\n res = pol.synthesize_speech(Text=text, LanguageCode=lang, OutputFormat=\"mp3\", VoiceId=VOICE)\n return res", "def getAudio(self):\n audioString = self.inStrea...
[ "0.6465167", "0.6328515", "0.6179556", "0.6107397", "0.6034401", "0.6018769", "0.5870362", "0.5847598", "0.5831167", "0.5803803", "0.5749984", "0.5747774", "0.5709184", "0.56122506", "0.5576906", "0.55568016", "0.5556429", "0.54971176", "0.544475", "0.5437719", "0.5427778", ...
0.7842098
0
Add FX to track and return it.
def add_fx(self, name, even_if_exists=True): index = RPR.TakeFX_AddByName( self.id, name, 1 - 2*even_if_exists ) if index == -1: raise ValueError("Can't find FX named {}".format(name)) fx = reapy.FX(self, index) return fx
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def track_add(self,funcion,frecuencia,volumen):\n if funcion.lower() not in self.FUNCIONES_DISPONIBLES:\n raise ValueError('El sonido introducido no existe')\n self.tracks.append(Track(funcion,int(frecuencia),float(volumen)))", "def addFluxBound(self, *args):\n return _libsbml.Fbc...
[ "0.52352136", "0.51723623", "0.51553804", "0.5089635", "0.49874738", "0.49824634", "0.49613124", "0.49419165", "0.4853188", "0.48438746", "0.48097977", "0.47895956", "0.47816634", "0.47659492", "0.4743335", "0.4737471", "0.4737072", "0.4730966", "0.47089824", "0.46991047", "0...
0.6419147
0
Add MIDI note to take.
def add_note( self, start, end, pitch, velocity=100, channel=0, selected=False, muted=False, unit="seconds", sort=True ): start, end = self._resolve_midi_unit((start, end), unit) sort = bool(not sort) args = ( self.id, selected, muted, start, end, channel, pitch, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_note():\n pass", "def addNote(self, note):\n logger.debug(\"Func: addNote\")\n\n if not self._currentBaseSceneName:\n logger.warning(\"No Base Scene file selected\")\n return\n if self._currentVersionIndex == -1:\n logger.warning(\"No Version selec...
[ "0.71667445", "0.70768654", "0.70387894", "0.68380475", "0.67640305", "0.66590583", "0.66462284", "0.65161556", "0.6501385", "0.64305705", "0.642117", "0.641453", "0.63144004", "0.63112724", "0.61634254", "0.61127084", "0.6105304", "0.60731876", "0.6060299", "0.60444415", "0....
0.7366842
0
List of CC events on take.
def cc_events(self): return reapy.CCList(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_event_list(self):\n pass", "def get_events() -> list[Event]:\n g.ledger.changed()\n return [e for e in g.filtered.entries if isinstance(e, Event)]", "def event_list(self):\n return self._event_list", "def get_events(self):\n ret = []\n while True:\n event ...
[ "0.65192", "0.62722546", "0.6251977", "0.62055224", "0.61939764", "0.6192634", "0.6109327", "0.6096709", "0.6096626", "0.6086525", "0.6086525", "0.60827553", "0.60766375", "0.6051133", "0.6030181", "0.6002381", "0.6002381", "0.59612936", "0.593539", "0.59297603", "0.59164214"...
0.76935804
0
Whether ReaScript ID is still valid. For instance, if take has been deleted, ID will not be valid anymore.
def has_valid_id(self): try: project_id = self.track.project.id except (OSError, AttributeError): return False pointer, name = self._get_pointer_and_name() return bool(RPR.ValidatePtr2(project_id, pointer, name))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid(self):\r\n return self.resumable and self.sessionID", "def _is_validation(video_id):\n hasher = md5()\n hasher.update(bytes(video_id, 'utf-8'))\n first = hasher.hexdigest()[0]\n return first in ['0', '1']", "def is_id_valid(id_code: str) -> bool:\n if is_valid_gender_number(int(...
[ "0.7354887", "0.6795416", "0.6768334", "0.66990465", "0.66942537", "0.66586214", "0.66546863", "0.6602308", "0.6545459", "0.648796", "0.64288986", "0.6393287", "0.6326219", "0.63156664", "0.63025767", "0.62743765", "0.62597466", "0.6255308", "0.6232115", "0.6216911", "0.62074...
0.6873217
1
Whether take is active.
def is_active(self): return self == self.item.active_take
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def active(self):\n return self.starting == 0 and self.stopped == 0", "def is_active(self):\n return not self.pending", "def is_active(self) -> bool:", "def is_active():\n return True", "def is_active(self):\r\n return True", "def active(self):\n\n return True", "def ...
[ "0.6794356", "0.67920685", "0.67610353", "0.67032784", "0.6647585", "0.66244113", "0.65905803", "0.65905803", "0.65905803", "0.65905803", "0.65905803", "0.65905803", "0.65905803", "0.65905803", "0.65905803", "0.65905803", "0.65905803", "0.65905803", "0.65905803", "0.65905803", ...
0.7830599
0
Whether take contains MIDI or audio.
def is_midi(self): return bool(RPR.TakeIsMIDI(self.id))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_audio(self):\n return self.__audio_format is not None", "def is_audio(self):\n val = False\n if self.__dict__['codec_type']:\n if str(self.__dict__['codec_type']) == 'audio':\n val = True\n return val", "def isAudio(pinName):\n if pinName == \"LI...
[ "0.66094893", "0.65880245", "0.6505816", "0.6472316", "0.6421153", "0.63718694", "0.6214294", "0.61489916", "0.6133003", "0.61106575", "0.6103051", "0.60940456", "0.6083482", "0.6031961", "0.5999309", "0.5959167", "0.5945099", "0.59228003", "0.5898946", "0.58739114", "0.58566...
0.6803668
0
Get all midi events as EventList. Returns MIDIEventList
def midi_events(self): return reapy.core.item.midi_event.MIDIEventList(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getListOfEvents(self):\n return self.model.getListOfEvents()", "def midis2events(midis, device_id):\n evs = []\n for midi in midis:\n ((status, data1, data2, data3), timestamp) = midi\n\n event = pygame.event.Event(\n MIDIIN,\n status=status,\n data...
[ "0.6822723", "0.68098927", "0.6762957", "0.6744406", "0.6731891", "0.67026216", "0.668505", "0.6669647", "0.6441596", "0.63799524", "0.635254", "0.63444805", "0.6258808", "0.6229186", "0.62111807", "0.6128854", "0.6083547", "0.60380894", "0.6020876", "0.5977008", "0.5977008",...
0.82092845
0
Get hash of MIDIdata to compare with later.
def midi_hash(self, notes_only=False): return RPR.MIDI_GetHash(self.id, notes_only, 'hash', 1024**2)[3]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_hash(self, data: Optional[bytes] = None) -> str:\n return self.__handle__.hash", "def __hash__( self ):\n return hash( self.data )", "def hash(self):\n return RPR.GetAudioAccessorHash(self.id, \"\")[1]", "def get_data_hash(args):\n pass", "def hash(self) -> bytes:", "def _...
[ "0.68989176", "0.68385345", "0.6656423", "0.65962106", "0.6554911", "0.65464014", "0.6545518", "0.6403817", "0.63712454", "0.63694465", "0.634125", "0.6311672", "0.6288034", "0.6279469", "0.6247735", "0.6164899", "0.61614835", "0.6158576", "0.6155589", "0.611178", "0.610721",...
0.7289913
0
Number of MIDI CC events in take (always 0 for audio takes).
def n_cc(self): return RPR.MIDI_CountEvts(self.id, 0, 0, 0)[3]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def n_midi_events(self):\n return RPR.MIDI_CountEvts(self.id, 1, 1, 1)[0]", "def timerCount(cmds):\n return int(sum(np.asarray(cmds) == 0x400001)) # numpy version\n #return cmds.count(0x400001) # python list version", "def count(self):\n self._read_keypad()\n return len(self...
[ "0.7358859", "0.6818781", "0.67067504", "0.6610065", "0.65946704", "0.6358299", "0.63434064", "0.6332136", "0.6310088", "0.624408", "0.6192134", "0.61647713", "0.6150198", "0.6066189", "0.60188764", "0.59741735", "0.5971756", "0.5968689", "0.59467006", "0.59401083", "0.591222...
0.73484296
1
Number of envelopes on take.
def n_envelopes(self): return RPR.CountTakeEnvelopes(self.id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def envelope_participation(sps,k=5):\n env = get_envelope(sps,k)\n return float(len(env))/len(sps)", "def count():", "def count(self, trace):\n return len(trace)", "def nspins(self):\n return len(self)", "def num_trials(self):", "def countSimulationEventQueues(self):\r\n raise ...
[ "0.6731806", "0.65108633", "0.6508906", "0.6474984", "0.6420046", "0.6338395", "0.6335041", "0.63253707", "0.6298664", "0.62495315", "0.62495315", "0.62495315", "0.62495315", "0.6234927", "0.6230693", "0.62291867", "0.62236977", "0.6207558", "0.62070596", "0.61965567", "0.616...
0.83681583
0
Number of FXs on take.
def n_fxs(self): return RPR.TakeFX_GetCount(self.id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count():", "def tally(self):\n return self.count", "def num_trials(self):", "def num_wires(self):", "def numberConsumed(self):\n\n\t\treturn len([bottle for bottle in self.bottles if bottle.consumption != None])", "def __len__(self):\n return self.params['nbins_sfh']+2 # z, mass, met, + l...
[ "0.6771969", "0.67568135", "0.6722359", "0.654579", "0.64711595", "0.6452907", "0.6452907", "0.6452907", "0.6452907", "0.64477485", "0.64477485", "0.64477485", "0.64477485", "0.64226276", "0.63510334", "0.63372463", "0.63343763", "0.6282955", "0.6256763", "0.62334794", "0.621...
0.7029452
0
Number of MIDI events in take.
def n_midi_events(self): return RPR.MIDI_CountEvts(self.id, 1, 1, 1)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def n_notes(self):\n return RPR.MIDI_CountEvts(self.id, 0, 0, 0)[2]", "def count(self):\n self._read_keypad()\n return len(self._current_events)", "def count(time):\n \n return len(events(time))", "def timerCount(cmds):\n return int(sum(np.asarray(cmds) == 0x400001)) # nump...
[ "0.70329607", "0.68840927", "0.6836261", "0.67308927", "0.6693897", "0.655722", "0.6544327", "0.65297204", "0.6526927", "0.6394104", "0.6382071", "0.63399196", "0.62570053", "0.6221037", "0.62072825", "0.61730546", "0.61529934", "0.614693", "0.6127423", "0.6124295", "0.612003...
0.7652136
0
Number of MIDI notes in take (always 0 for audio takes).
def n_notes(self): return RPR.MIDI_CountEvts(self.id, 0, 0, 0)[2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_note_histogram(self):\n np_melody = np.array(self.events, dtype=int)\n return np.bincount(\n np_melody[np_melody >= MIN_MIDI_PITCH] % NOTES_PER_OCTAVE,\n minlength=NOTES_PER_OCTAVE)", "def n_midi_events(self):\n return RPR.MIDI_CountEvts(self.id, 1, 1, 1)[0]", "def getNoteLen...
[ "0.68767166", "0.67473865", "0.64695424", "0.64414644", "0.63774467", "0.62265354", "0.6211419", "0.6190068", "0.5995702", "0.59607434", "0.5875745", "0.5866915", "0.58337027", "0.5827423", "0.57987976", "0.57838327", "0.57831204", "0.57373357", "0.57061625", "0.5696729", "0....
0.79600376
0
Number of MIDI text/sysex events in take (0 for audio takes).
def n_text_sysex(self): return RPR.MIDI_CountEvts(self.id, 0, 0, 0)[4]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def n_midi_events(self):\n return RPR.MIDI_CountEvts(self.id, 1, 1, 1)[0]", "def n_notes(self):\n return RPR.MIDI_CountEvts(self.id, 0, 0, 0)[2]", "def timerCount(cmds):\n return int(sum(np.asarray(cmds) == 0x400001)) # numpy version\n #return cmds.count(0x400001) # python list ver...
[ "0.72692955", "0.6792744", "0.6432492", "0.64297915", "0.6381721", "0.5992169", "0.59499276", "0.5868702", "0.5860987", "0.58480495", "0.58280736", "0.58244467", "0.5819328", "0.5815293", "0.5758553", "0.5724", "0.57089055", "0.5694248", "0.5672282", "0.56603855", "0.56568587...
0.69428986
1
List of MIDI notes on take. Unless ``Take.add_note`` has been called with ``sort=False``, notes are timesorted.
def notes(self): return reapy.NoteList(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def notes_played(self) -> List[Dict]:\n return [\n dict(note=self._midi_to_note(note.note), time=note.time)\n for note in self._on_note()\n ]", "def notes(self):\n return self._notes", "def listNotes() -> list:\n list_of_notes = []\n for note in Note.objects.all...
[ "0.7016727", "0.69875723", "0.6977277", "0.6881413", "0.68452406", "0.6818396", "0.6794229", "0.6783812", "0.67647517", "0.67645264", "0.66836673", "0.66700953", "0.6650867", "0.6637694", "0.66352856", "0.662355", "0.6600355", "0.65772814", "0.65592974", "0.65592974", "0.6529...
0.7450945
0
Select or unselect all MIDI events.
def select_all_midi_events(self, select=True): RPR.MIDI_SelectAll(self.id, select)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unselect_all_midi_events(self):\n self.select_all_midi_events(select=False)", "def select_all(self, event=None):\n print('select all')\n textArea = self.get_current()\n\n textArea.tag_add(\"sel\", \"1.0\", \"end-1c\")\n return \"break\" # Deleting default Control + a selec...
[ "0.8546475", "0.66916764", "0.59567887", "0.58351403", "0.5559912", "0.552272", "0.5515481", "0.55150115", "0.5482371", "0.54445446", "0.5418354", "0.54162484", "0.535911", "0.5338933", "0.5315302", "0.52739936", "0.5230624", "0.52299994", "0.52007455", "0.5184299", "0.516779...
0.8558998
0
Sort MIDI events on take. This is only needed if ``Take.add_note`` was called with ``sort=False``. Examples The following example creates 100 MIDI notes on take in reversed order, with ``sort=False`` for efficiency. Thus, ``take.notes`` is not timesorted. ``take.sort_events`` is called afterwards so that ``take.notes``...
def sort_events(self): RPR.MIDI_Sort(self.id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort(self):\n self.notes.sort()", "def sortByTimeGenerated(self, records, verbose=False, in_place=False):\n tmp = records\n if (verbose):\n print \"[EVT] Sorting by time generated\"\n\n swapped = True\n while swapped:\n swapped = False\n for...
[ "0.64417505", "0.59254515", "0.5611884", "0.55610234", "0.55175054", "0.54124165", "0.51662916", "0.51262325", "0.5062692", "0.50385", "0.49755296", "0.4942598", "0.4932713", "0.49131915", "0.48869115", "0.4809124", "0.48028725", "0.47965485", "0.47886294", "0.4780833", "0.47...
0.69051874
0
Unselect all MIDI events. See also Take.select_all_midi_events
def unselect_all_midi_events(self): self.select_all_midi_events(select=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_all_midi_events(self, select=True):\n RPR.MIDI_SelectAll(self.id, select)", "def deselectall(self):\n if self.selection:\n for node in self.selection[:]: node.deselect()", "def off_all(self) -> None:\n self._event_tree.clear()\n del self._any_listeners[:]", "def clear_...
[ "0.7149535", "0.6194721", "0.6064942", "0.59529597", "0.5879792", "0.5878868", "0.58575743", "0.5855593", "0.57977474", "0.57819146", "0.57066834", "0.5652586", "0.56394154", "0.56082886", "0.55718887", "0.5563717", "0.5560593", "0.55161434", "0.5473677", "0.54584724", "0.544...
0.9224441
0
Visible FX in FX chain if any, else None.
def visible_fx(self): with reapy.inside_reaper(): return self.fxs[RPR.TakeFX_GetChainVisible(self.id)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top_visible_entity(self):\n if self.size == 0:\n return None\n\n i = self.size - 1\n while i >= 0:\n e = self[i]\n if e.visible:\n return e\n i = i - 1\n return None", "def __nonzero__(self):\n return self.has_prev ...
[ "0.53373814", "0.53178656", "0.5271839", "0.5211952", "0.51810837", "0.5171741", "0.51141864", "0.5083324", "0.5035248", "0.49406222", "0.49327287", "0.4929157", "0.49219638", "0.4916191", "0.49136445", "0.48643497", "0.48127857", "0.478809", "0.4787628", "0.47870132", "0.478...
0.7164335
0
Create a new project with a project name and a target dollar amount
def project(projectname,targetamount): if (validatename(projectname) and validatenum(targetamount)): targetamount=float(targetamount) con = lite.connect(databasefile) with con: cur = con.cursor() cur.execute("SELECT Id FROM projects where name=?", (projectname,)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_project():\n client = RequestManager()\n project_name = \"\".join(choices(string.ascii_letters + string.digits, k=10))\n client.set_method(\"POST\")\n client.set_endpoint(\"/projects\")\n body = {\"name\": project_name}\n client.set_body(json.dumps(body))\n ...
[ "0.6957025", "0.69491005", "0.68790776", "0.68650573", "0.67545635", "0.66347504", "0.65675503", "0.65304005", "0.648689", "0.6420559", "0.64139545", "0.64139545", "0.64139545", "0.6375946", "0.63685745", "0.63547033", "0.63528305", "0.6281067", "0.6255283", "0.6245015", "0.6...
0.77185667
0
Back a project with a given backer name, the project to be backed, a credit card number and a backing dollar amount
def back(backername,projectname,creditcard,backeramount): if (validatename(backername) and validatename(projectname) and validateCC(creditcard) and validatenum(backeramount)): backeramount=float(backeramount) con = lite.connect(databasefile) with con: cur = con.cursor() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def backer(backername):\n con = lite.connect(databasefile)\n with con:\n cur = con.cursor() \n cur.execute(\"SELECT * FROM backers where Name=?\", (backername,))\n rows = cur.fetchall()\n if len(rows) > 0:\n for row in rows:\n click.echo(\"-- Backed %s...
[ "0.5589954", "0.5525599", "0.5395451", "0.5278826", "0.52544004", "0.5148102", "0.5106608", "0.5076449", "0.50684446", "0.5049228", "0.5039509", "0.5036791", "0.50305325", "0.50295347", "0.5008624", "0.5005926", "0.4997279", "0.49887538", "0.4981601", "0.49708396", "0.4965588...
0.764195
0
Creating a maintenance with a bad server number should return a 400
def test_create_with_bad_server(self): self.mockAuthToken() self.mockServerGetDetailsByComputers() self.mockTicketGetTicket() maint_params = "master_ticket=080102-00121&service_type_id=1&employee_contact_id=1&servers=9999" response = self.app.post(url_for(controller='/maintenance...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_missing_server_list(self):\n self.mockTicketGetTicket()\n maint_params = {\n 'master_ticket' : '080102-00121',\n 'description' : 'do stuff',\n 'expedite' : False,\n 'additional_duration_minutes': '60',\n 'servi...
[ "0.69782364", "0.68012285", "0.64444596", "0.6433693", "0.6354885", "0.6035027", "0.5929665", "0.58716375", "0.5776372", "0.5728069", "0.5697766", "0.56893617", "0.56873506", "0.56677437", "0.56408584", "0.56265163", "0.55740774", "0.5557121", "0.5555586", "0.5555289", "0.551...
0.74875385
0
Status code should be 400 when missing server_list.
def test_create_missing_server_list(self): self.mockTicketGetTicket() maint_params = { 'master_ticket' : '080102-00121', 'description' : 'do stuff', 'expedite' : False, 'additional_duration_minutes': '60', 'service_type_id' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_with_bad_server(self):\n self.mockAuthToken()\n self.mockServerGetDetailsByComputers()\n self.mockTicketGetTicket()\n maint_params = \"master_ticket=080102-00121&service_type_id=1&employee_contact_id=1&servers=9999\"\n response = self.app.post(url_for(controller='...
[ "0.6061596", "0.60476696", "0.5971526", "0.5775313", "0.57593954", "0.57020354", "0.5686953", "0.5639251", "0.56079996", "0.55966985", "0.55747646", "0.54868317", "0.54784334", "0.547263", "0.5455668", "0.5448346", "0.5430323", "0.5426539", "0.54029393", "0.5386585", "0.53825...
0.6700875
0
Reads ASTs from |filepaths| and builds IRs from ASTs.
def load_and_register_idl_definitions(filepaths, register_ir, create_ref_to_idl_def, idl_type_factory): assert callable(register_ir) for filepath in filepaths: asts = AstGroup.read_from_file(filepath) builder = _IRBuilder( component=Component(as...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def paths_to_ast(self, paths):\n nodes = []\n ast = {'node': 'DSubTree', '_nodes': nodes}\n for path in paths:\n self.update_until_STOP(nodes, path, 1)\n return ast", "def __init__(self, paths):\n self._makefile = pymake.data.Makefile(env={}, justprint=True)\n self._d...
[ "0.5950787", "0.5745208", "0.55234224", "0.54999834", "0.5307115", "0.52148706", "0.52119863", "0.52101713", "0.5198967", "0.5175929", "0.509865", "0.50825286", "0.5065307", "0.5044392", "0.5023761", "0.49675572", "0.49675572", "0.4943538", "0.4940431", "0.4940431", "0.494043...
0.5971303
0
Constructs a list of new instances of Argument.
def _create_arguments(self, args): assert isinstance(args, (list, tuple)) arguments = [] index = 0 for arg in args: assert isinstance(arg, (list, tuple)) assert len(arg) == 2 or len(arg) == 3 identifier = arg[0] if isinstance(arg[1], str)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_argument_list(self):\n raise NotImplementedError", "def __init__(self, arg_list: List[_Argument]):\n self.arg_list: List[_Argument] = arg_list", "def get_args(cls) -> List[argparse.ArgumentParser]:\n raise NotImplementedError()", "def create_list(cls, *args):\n return _...
[ "0.78217214", "0.7046545", "0.6705336", "0.64734864", "0.64734864", "0.63527244", "0.62128866", "0.62043273", "0.6133261", "0.61222565", "0.6004906", "0.5996085", "0.59814084", "0.595139", "0.5933375", "0.58820444", "0.58703023", "0.5851335", "0.5822", "0.57987845", "0.579855...
0.72398114
1
Constructs a set of async iterable operations.
def _create_async_iterable_operations(self, node, interface_identifier, arguments): return { Identifier('entries'): self._create_operation( Identifier('entries'), arguments=make_copy(arguments), ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build() -> List[asyncio.Task]:", "async def async_comprehension() -> List[float]:\n return [i async for i in async_generator()]", "def __init__(self):\n self.uris = AsyncSet('uris')\n self.sockets = AsyncSet('sockets')", "def from_async_iterable(iterable: AsyncIterable[T]) -> AsyncObserv...
[ "0.6722258", "0.6367045", "0.63418335", "0.60655946", "0.60089046", "0.5855957", "0.5829593", "0.579584", "0.57785064", "0.57628924", "0.5672897", "0.5651059", "0.563409", "0.56108654", "0.56046355", "0.55937046", "0.556971", "0.55471206", "0.5526845", "0.55235445", "0.549551...
0.6903996
0
Constructs a new ExtendedAttributes from a dict of key and values.
def _create_extended_attributes(self, key_values): assert isinstance(key_values, dict) return ExtendedAttributes([ ExtendedAttribute(key=key, values=values) for key, values in key_values.items() ])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_from_dict(self, d):\n for k, v in d.items():\n # First, keys must be strings, not ints\n if isinstance(k, int):\n k = str(k)\n # Now, assign to the key, handling nested AttrDicts properly\n if isinstance(v, dict):\n self.set_...
[ "0.6382485", "0.6297906", "0.62670505", "0.60473675", "0.5974632", "0.5972618", "0.5915098", "0.59051406", "0.5895183", "0.58589345", "0.58556575", "0.5846577", "0.5841459", "0.57766926", "0.57535666", "0.5723234", "0.5703971", "0.5693542", "0.56668705", "0.5658858", "0.56458...
0.8257896
0
Constructs a set of iterable operations.
def _create_iterable_operations(self, node, interface_identifier): return { Identifier('forEach'): self._create_operation(Identifier('forEach'), arguments=self._create_arguments([ (Identifier('callback'), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_operations(self):\n combinations = self.COMBINATIONS.items()[:self.limit]\n for (term1, term2), type in combinations:\n yield (term1, term2, type)", "def run_all(operations=ops):\n for operation in operations:\n run(operation)", "def list_operations():", "def _...
[ "0.66479367", "0.61796206", "0.617214", "0.6136139", "0.6042505", "0.5998093", "0.59342134", "0.5931429", "0.5831438", "0.58205277", "0.5804747", "0.5788443", "0.5765504", "0.5751591", "0.5671264", "0.5652595", "0.5614151", "0.5614151", "0.55802244", "0.5579228", "0.5578962",...
0.6544586
1
Constructs a new Operation.IR from simple parameters.
def _create_operation(self, identifier, arguments=None, return_type=None, extended_attributes=None, node=None): if not return_type: return_type = self._create_type('void'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, osi):\n self.osi = osi\n self._parameters = [self.op_type]\n self.to_process(osi)", "def __init__(self, osi):\n self.osi = osi\n self._parameters = [self.op_type]\n self.to_process(osi)", "def __init__(self, osi):\n self.osi = osi\n sel...
[ "0.6135305", "0.6135305", "0.6135305", "0.6135305", "0.6135305", "0.61084044", "0.59634215", "0.5880054", "0.5851098", "0.5848407", "0.5813872", "0.5797516", "0.5786671", "0.57640713", "0.57393676", "0.5716554", "0.5714805", "0.5707394", "0.56981313", "0.56833816", "0.5668892...
0.6603862
0
Constructs a new IdlType from a type keyword or identifier.
def _create_type(self, keyword_or_identifier, **kwargs): name = keyword_or_identifier if isinstance(name, Identifier): return self._idl_type_factory.reference_type(name, **kwargs) elif isinstance(name, str): return self._idl_type_factory.simple_type(name, **kwargs) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, identifier, basetype):\n self.identifier = identifier\n self.basetype = basetype", "def create_ontic_type(name: str, schema: (dict, Schema)) -> OnticType:\n if name is None or name == '':\n raise ValueError('The string \"name\" argument is required.')\n if schema is ...
[ "0.54257274", "0.5379449", "0.5370976", "0.5301959", "0.52540165", "0.52436066", "0.5238133", "0.5227538", "0.5170947", "0.5130724", "0.50727123", "0.50668633", "0.5033649", "0.5033367", "0.5029658", "0.5023271", "0.50096726", "0.4991125", "0.4971329", "0.49601963", "0.491657...
0.7283346
0
Takes a node of |node_class| from |node_list| if any, and then builds and returns an IR. The processed node is removed from |node_list|. Returns None if not found.
def _take_and_build(self, node_class, build_func, node_list, **kwargs): for node in node_list: if node.GetClass() == node_class: node_list.remove(node) return build_func(node, **kwargs) return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _process_node(self, node):\n if node.type == \"program\":\n self._process_children(node)\n\n elif node.type == \"qreg\":\n self.qregs[node.name] = int(node.index)\n self.backend.new_qreg(node.name, int(node.index))\n\n elif node.type == \"creg\":\n ...
[ "0.5286745", "0.5144883", "0.4972789", "0.49217257", "0.49139586", "0.49002394", "0.48360255", "0.47712216", "0.47509867", "0.47312656", "0.4660547", "0.46351904", "0.46129632", "0.45896357", "0.45694485", "0.45612094", "0.45593596", "0.45561674", "0.45561674", "0.45482197", ...
0.72631943
0
Update destination file_name with adding `COUNTER` to the beginning
def update_destination_file_name (file_name): global COUNTER COUNTER += 1 splitted = file_name.split('/') return file_name[:len(file_name)-len(splitted[-1])] + 'Image%05d' % COUNTER +'_'+splitted[-1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _increment_file_counter(self):\n self._add_to_file_counter(1)", "def _setcounter():\n fname = os.path.basename(camera.status.lastfile)\n tname = fname.split('.')[0]\n i = len(tname)-1\n if i > -1:\n while tname[i].isdigit() and i>-1:\n i = i - 1\n nname = fname[:-4]\n bname = tname[:...
[ "0.6977839", "0.6867697", "0.68112785", "0.67667574", "0.65450245", "0.6543996", "0.65065265", "0.6247555", "0.6239038", "0.62120277", "0.60918236", "0.60896754", "0.6086038", "0.60803545", "0.6055999", "0.60375446", "0.5983654", "0.59313905", "0.5922904", "0.5911708", "0.589...
0.7942006
0
Convert bmp to dicom using pydicom
def convert_to_dicom(file_name): path = get_testdata_file("CT_small.dcm") ds = pydicom.dcmread(path) img = Image.open(file_name+".bmp") npa = np.asarray(img) ds.PixelData = img.tobytes() name = update_destination_file_name(file_name) ds.save_as(name+'.dcm') print("DONE\t "+name+".dcm")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def img2dcm_from_bmp(file_name):\n\tname = update_destination_file_name(file_name)\n\tos.system('img2dcm -i BMP '+file_name+'.bmp '+name+'.dcm ')\t\n\tprint(\"DONE\\t \"+name+\".dcm\")", "def test():\n\n fname='./MedData/Lung-PET-CT-Dx/Lung_Dx-A0164/04-12-2010-PET01PTheadlung Adult-08984/8.000000-Thorax 1.0 ...
[ "0.768513", "0.6757691", "0.6445389", "0.6011967", "0.6011967", "0.60043854", "0.59479976", "0.58544636", "0.57549274", "0.567367", "0.56666934", "0.5630678", "0.5518617", "0.55067134", "0.54975426", "0.54918313", "0.5471199", "0.5439955", "0.543612", "0.53972185", "0.5390664...
0.7176947
1