query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Returns a list of presynaptic MOOSE Cells in 'projection' that are connected to mitrals
def getCellsByMitralConnection(args, network, projection, population, allcells=False): cellList = [] cellUniques = [] if args.has_key('mitrals'): for mitid in args['mitrals']: mitpath = 'mitrals_'+str(mitid) cellnum = 0 if projection in network.projectionDict: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def projection(self):\n return [row[2:-2] for row in self[2:-2]]", "def getProjections(self): \n x, y, z = self.XYZCoordinate\n origin = self.SkeletonPoints[0]\n self.coorOrigin = origin\n self.XYProjections = [GeometryToolBox.projected_point(p, origin, x, y) for p in self.S...
[ "0.6115254", "0.5847628", "0.5668224", "0.5631118", "0.5537652", "0.54864603", "0.54810447", "0.54235524", "0.5407805", "0.53630227", "0.5358039", "0.53430915", "0.5283042", "0.52807236", "0.527139", "0.52705544", "0.52069575", "0.5204649", "0.5184181", "0.5180212", "0.517869...
0.5494417
5
Excludes singles/joints/multis granules and their projections as appropriate Excludes extraexcitation from unmodeled sisters as appropriate Include only the two required mitrals (and its connected granules) if ONLY_TWO_MITS is True
def build_tweaks(mitralsclub, nospineinh, nosingles, nojoints, nomultis, nopgs, onlytwomits, includeProjections=[], twomitrals=(0,2), nolateral=False): excludePopulations = [] excludeProjections = ['SA'] ## In odor_pulses, odor_morphs, scaled_pulses, I have not specified to include ## file-bas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _remove_noise_in_o2m():\n if line.reconcile_partial_id:\n if currency_id == line.currency_id.id:\n if line.amount_residual_currency <= 0:\n return True\n else:\n if line.amount_residual <= 0:\n ...
[ "0.5953837", "0.5953837", "0.59061384", "0.5466832", "0.5309573", "0.52000713", "0.5176033", "0.51735157", "0.51045626", "0.5049013", "0.504501", "0.5029148", "0.5016187", "0.49734628", "0.49504164", "0.4943692", "0.4937262", "0.49311906", "0.4926082", "0.4921968", "0.4912275...
0.5823989
3
We record the position in S of the first occurence of a letter. If we encounter the letter a second time, we check their spacing.
def well_spaced(S, D): seen = [None] * 26 for i, c in enumerate(S): if seen[ord(c) - ord("a")] is None: seen[ord(c) - ord("a")] = i else: if i - seen[ord(c) - ord("a")] != D[ord(c) - ord("a")] + 1: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def alphabet_position(letter):\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n pos = 0\n for ltr in alphabet:\n if ltr == letter.lower():\n return pos\n pos += 1\n return pos", "def find_letter_in_dics(self,letter):\r\n if str.isupper(letter)==True and letter not in self...
[ "0.63146746", "0.60987276", "0.6056158", "0.60332364", "0.6029894", "0.60163057", "0.59288514", "0.59279585", "0.58409476", "0.5798788", "0.5759058", "0.5749839", "0.5723557", "0.5687024", "0.56397504", "0.5600619", "0.55635214", "0.556004", "0.5554876", "0.5525632", "0.55193...
0.6559219
0
Register publisher on nameserver. This works for PUBSUB only
def register_publisher(self, hostname, expire=-1):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def registerEvent(eventName, publisher, msgInterface, exclusive=FALSE):", "def register_topic(self, name, command):\n topic_name = command['topic_name']\n try:\n topic_type = self.get_interface_type(command['interface_type'], '.msg')\n self.pubs[topic_name] = self.create_publi...
[ "0.6365265", "0.62822574", "0.6280103", "0.62570566", "0.6152319", "0.60816693", "0.6038326", "0.6014652", "0.5980777", "0.58707476", "0.582609", "0.58243114", "0.5799215", "0.5795977", "0.5795272", "0.57344294", "0.5730708", "0.5672222", "0.56624746", "0.5653363", "0.5633386...
0.7828177
0
Unregister publisher on nameserver. This works for PUBSUB only
def unregister_publisher(self, hostname):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unregister(self):\n self._executor.unregister_publisher(self)", "def unregisterEvent(eventName, publisher):", "def unregister(self):\n if self.hub.is_connected:\n self._is_registered = False\n self.hub.unregister(self._private_key)\n self._hub_id = None\n ...
[ "0.7360216", "0.7246476", "0.6685116", "0.66366076", "0.6556128", "0.64936596", "0.64936596", "0.64936596", "0.64936596", "0.64936596", "0.6339355", "0.6295946", "0.6200138", "0.61934596", "0.6149258", "0.61001545", "0.60975444", "0.60746765", "0.60650426", "0.6057191", "0.60...
0.84743935
0
Get all publisherhosts from nameserver.
def get_publishers(self):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_hosts(self):\n\n raise NotImplementedError", "def all_hosts(self):\n ...", "def get_allhosts():\n connection, tablename = HomeNetwork.get_connection_info()\n query = 'SELECT hostname from {}'.format(tablename)\n output = pandas.read_sql_query(query, connection).to_jso...
[ "0.7169676", "0.7118724", "0.7061426", "0.70307904", "0.6984438", "0.6951433", "0.6951433", "0.6756767", "0.66589063", "0.6650259", "0.6539173", "0.6535899", "0.6476677", "0.6442389", "0.6417958", "0.6402432", "0.64010507", "0.6400647", "0.63974947", "0.63806397", "0.6343521"...
0.5760464
65
Register router on the nameserver. This works for ROUTER proxy only
def register_router(self, hostname, expire=-1):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_router(self, router):\n for prefix, viewset, basename in router.registry:\n self.register(prefix, viewset, base_name=basename)", "def _registerOnServer(self, daemon, nameserver,vclock):\n uri = daemon.register(self)\n nameserver.register(self._name, uri)\n self...
[ "0.69818735", "0.6787208", "0.62229717", "0.6108167", "0.60634494", "0.6024237", "0.5897947", "0.5891949", "0.57765454", "0.5680079", "0.56769615", "0.5665641", "0.5664951", "0.5652085", "0.5566623", "0.5562512", "0.553475", "0.5525856", "0.5513387", "0.54793245", "0.54617864...
0.74578744
0
Unregister router on the nameserver. This works for ROUTER proxy only
def unregister_router(self, hostname):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unregister(self, pollster):\n pollster.unregister(self._router_socket)", "def unregister_server():\n (code, message) = rest_api.unregister_server(request)\n if (code == 200):\n return message\n else:\n abort(code)", "def _unregister_from_server(self):\n self.remote_cont...
[ "0.7407919", "0.6835906", "0.6531206", "0.6473747", "0.6360587", "0.6355955", "0.62724245", "0.6237078", "0.62182945", "0.6144307", "0.61080134", "0.6107907", "0.60263836", "0.60021615", "0.59701866", "0.5969365", "0.5967524", "0.5956805", "0.59442115", "0.59275377", "0.59078...
0.84506893
0
Get all routerhosts from nameserver.
def get_routers(self):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_hosts(self):\n ...", "def getHosts(self):\n raise \"not implemented\"", "def get_allhosts():\n connection, tablename = HomeNetwork.get_connection_info()\n query = 'SELECT hostname from {}'.format(tablename)\n output = pandas.read_sql_query(query, connection).to_json(o...
[ "0.72569954", "0.7244314", "0.7196611", "0.71662074", "0.695222", "0.67746055", "0.6761021", "0.6761021", "0.67031026", "0.6651102", "0.6624952", "0.65390396", "0.6518266", "0.6515694", "0.6514505", "0.6505179", "0.648944", "0.6474391", "0.64340025", "0.63641435", "0.6350772"...
0.0
-1
Register target on nameserver. If record already exists and has expiration timeout it will be updated. Existing records without timeout will stay untouched
def register(self, target, hostname, listener_type, expire=-1):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_router(self, hostname, expire=-1):", "def touch_member(self, data, ttl=None, permanent=False):", "def register_publisher(self, hostname, expire=-1):", "def _set_target_info_by_name(self, targets, port, target_name, iqn):\n host_iqn_registered_in_target = (\n self._get_host_iqn_...
[ "0.59071237", "0.57393044", "0.56628335", "0.54713863", "0.5383242", "0.5357558", "0.5356139", "0.5307397", "0.5276759", "0.52725244", "0.52632517", "0.523391", "0.520452", "0.51832664", "0.51574975", "0.51390576", "0.5082721", "0.5064394", "0.50146466", "0.50041485", "0.4989...
0.7020003
0
Unregister target from nameserver.
def unregister(self, target, hostname, listener_type):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unregister(target: str) -> bool:\n ...", "def _unregister_from_server(self):\n self.remote_controller.unregister()", "def unregister_server(self, request):\n\n name = request.form['name']\n token = request.form['token']\n\n rest_client = RestClient.instance()\n user_in...
[ "0.7585173", "0.68528515", "0.6826376", "0.68002725", "0.67341775", "0.6664987", "0.6569992", "0.6551973", "0.6536063", "0.65019625", "0.64468646", "0.6361532", "0.63340855", "0.6244407", "0.6225373", "0.6179231", "0.6150409", "0.6149765", "0.6141956", "0.6136862", "0.6132793...
0.7942518
0
Get all hosts from nameserver by target.
def get_hosts(self, target, listener_type):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getHosts(self):\n raise \"not implemented\"", "def get_hosts(self):\n\n raise NotImplementedError", "def all_hosts(self):\n ...", "def get_list_hosts(self, path, params):\n eth_src = params.get('eth_src')\n host = self._extract_url_base(path)\n reply = self._fauc...
[ "0.6609943", "0.65855324", "0.65804106", "0.64846325", "0.63959503", "0.6352378", "0.63149804", "0.62216705", "0.6152733", "0.60675144", "0.6000524", "0.598171", "0.5977664", "0.5963793", "0.5939155", "0.590416", "0.5887089", "0.58860886", "0.5873426", "0.58689386", "0.585227...
0.72865254
0
Retry if not hosts used on client first time connection.
def get_hosts_retry(self, target, listener_type):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reconnect(self):\n self.test_cmd()\n if not self.check_network: \n self.reset()\n attempt=0\n while not self.check_network and attempt<self.retries:\n self.full_reset()\n attempt+=1", "def _retry_occurred(self):", "def retry_connect(redis_cfg, tr...
[ "0.6595895", "0.642362", "0.6300115", "0.62578905", "0.62397426", "0.62371826", "0.61907387", "0.61150855", "0.6100826", "0.60999596", "0.60886294", "0.6058668", "0.6034286", "0.59911746", "0.59811133", "0.59562373", "0.5926307", "0.5876836", "0.5873153", "0.5847975", "0.5835...
0.65693855
1
Get all hosts for fanout from nameserver by target.
def get_hosts_fanout(self, target, listener_type):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_hosts(self, target, listener_type):", "def all_hosts(self):\n ...", "def getHosts(self):\n raise \"not implemented\"", "def get_list_hosts(self, path, params):\n eth_src = params.get('eth_src')\n host = self._extract_url_base(path)\n reply = self._faucet_collector.g...
[ "0.7184551", "0.6248219", "0.6176217", "0.61702764", "0.6109676", "0.6054905", "0.60191494", "0.6009551", "0.59727305", "0.5941708", "0.591378", "0.59014225", "0.58759665", "0.5767903", "0.5579544", "0.55613315", "0.5546322", "0.55437875", "0.5537281", "0.55069554", "0.546622...
0.7517761
0
Retry if not host for fanout used on client first time connection.
def get_hosts_fanout_retry(self, target, listener_type):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reconnect(self):\n self.test_cmd()\n if not self.check_network: \n self.reset()\n attempt=0\n while not self.check_network and attempt<self.retries:\n self.full_reset()\n attempt+=1", "def _retry_occurred(self):", "def decide_to_retry(error):\n ...
[ "0.6410929", "0.6315029", "0.6292759", "0.6159722", "0.61007214", "0.60679835", "0.60382396", "0.598557", "0.5985042", "0.5976616", "0.59539026", "0.59280324", "0.591002", "0.59035325", "0.5888258", "0.5867851", "0.5821885", "0.5793011", "0.5766104", "0.57537436", "0.57288796...
0.7007031
0
Each profile model should define the __init__ method. The __init__ method must take the grid as the first input parameter. All other input parameters can be specified to define the model. The grid input parameter is automatically added as an attribute of the profile model. This method should set all three components of...
def __init__(self, grid, coef_u, coef_w=[0.01, 0.2]): # In this example, we set the u-component to increase linearly with height: # Note: we are making use of the automatically added 'grid' attribute self._u[0] = coef_u * self.grid.z[:, None] # Arbitrarily chose a factor of 0.3 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, velocity, vorticity, prof_coords, \n direction, beginMeanComput, **kwds):\n assert 'variables' not in kwds, 'variables parameter is useless.'\n super(Profiles, self).__init__(variables=[velocity, vorticity],\n **kwds)\n #...
[ "0.63615376", "0.6329917", "0.6315436", "0.6304923", "0.6211358", "0.6152573", "0.61234856", "0.6065217", "0.6056414", "0.6029072", "0.5988933", "0.5905428", "0.5902939", "0.58744293", "0.585578", "0.58418816", "0.5836042", "0.5823521", "0.5822146", "0.5813255", "0.580647", ...
0.7273586
0
Define as many methods as you like for helping the __init__ method...
def calc_vertical_velocity(self): # Note: again we make use of the automatically added 'grid' attribute, and the stored coef_w attribute. # Here we arbitrarily set the vertical velocity to increase in the # y-direction (not very realistic). return self.coef_w[0] * self.grid.y[None, :] + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwargs):\n raise NotImplementedError", "def __init__():", "def __init__(self, **kwargs):\n raise NotImplementedError", "def __init__(__self__):\n pass", "def __init__(__self__):\n pass", "def __init__(__self__):\n pass", "def __init__(__sel...
[ "0.7751955", "0.77229583", "0.76215285", "0.7580306", "0.7580306", "0.7580306", "0.7580306", "0.7580306", "0.7580306", "0.7580306", "0.7580306", "0.7580306", "0.7580306", "0.75683165", "0.7561773", "0.7561773", "0.75399697", "0.75399697", "0.75399697", "0.75399697", "0.752695...
0.0
-1
Jump to neighbour + Jump value
def neighbor(self,s): jump=20 while True: s+=random.randint(-1*jump,jump) if s < pow(10,5) and s > pow(10,-5):return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def jumpp(self):\r\n\r\n if not self.current_jump is None:\r\n self.current_jump = self.current_jump.next", "def jump(neighbour, with_piece):\n return Coords(2 * neighbour.q - with_piece.q,\n 2 * neighbour.r - with_piece.r)", "def get_jump(self):\n return self.jump"...
[ "0.68145823", "0.67673796", "0.6645872", "0.6487357", "0.6415081", "0.6255698", "0.62121266", "0.6200127", "0.61654973", "0.6137965", "0.6121287", "0.6114172", "0.6095453", "0.60946244", "0.60899633", "0.608647", "0.6084412", "0.6036776", "0.60335666", "0.59981215", "0.597359...
0.5889015
26
Random jump within the boundary
def randomNeighbor(s): s=random.randint( int(pow(10,-5)), int(pow(10,5))) return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def jump(self):\n global jumpSize\n print \"jumping...\"\n # create a range that includes all the available feature indices\n featureIndices = range(0, len(self.features))\n # remove indices until there are only jumpSize left\n while len(featureIndices) > jumpSize:\n ...
[ "0.70142347", "0.6868129", "0.65871674", "0.6577718", "0.65242577", "0.65057194", "0.6504612", "0.6504612", "0.6420313", "0.6353282", "0.63362926", "0.63140726", "0.63027316", "0.6253052", "0.62520695", "0.6213646", "0.62117517", "0.6178957", "0.6167503", "0.6145853", "0.6140...
0.0
-1
Function applies multilevel Otsu algorithm to seperate the image background from the foreground.
def multi_level_otsu( images, n_regions: int = 4, target_region: int = 3, method: OtsuMethods = OtsuMethods.IMAGES, _destination_dir: str = 'E:\\GitHub\\CovPySourceFile\\MultiLevelOtsu', draw: bool = False, write: bool = False): if not isinstance(method, Otsu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def img_process(fgMask):\n backSub = cv.createBackgroundSubtractorKNN()\n kernel1 = cv.getStructuringElement(shape=cv.MORPH_ELLIPSE, ksize=(2,2))\n kernel2 = cv.getStructuringElement(shape=cv.MORPH_ELLIPSE, ksize=(2,2))\n #kernel1 = np.ones((3,3),np.uint8)\n #kernel2 = np.ones((3,3), np.uint8)\n\n ...
[ "0.6316399", "0.5638876", "0.5601583", "0.5556231", "0.5503263", "0.55022186", "0.5480021", "0.5449055", "0.54470575", "0.54389256", "0.54091537", "0.5373376", "0.5371874", "0.5366807", "0.5364599", "0.5352649", "0.53447825", "0.5343722", "0.5341918", "0.5329113", "0.5324589"...
0.504419
53
feed rgb flow to caffenet and save output of fc7 layer
def save_features(videos, net, transformer): n_features = 4096 name = 'baseline' for video in videos: X = np.empty((0, n_features)) y = np.empty(0) print '[INFO] processing video %d / %d' % (videos.index(video) + 1, len(videos)) for reverse in [False, True]: for f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def importCaffeNetwork(modeldef, params):\n if params is None:\n net = caffe.Net(modeldef, caffe.TEST)\n else:\n net = caffe.Net(modeldef, params, caffe.TEST)\n model = caffe.proto.caffe_pb2.NetParameter()\n Merge(open(modeldef, \"rb\").read(), model)\n numLayers = len(model.layer)\n ...
[ "0.621072", "0.5873886", "0.58209074", "0.58148974", "0.5806806", "0.57959956", "0.57872665", "0.55963653", "0.5571509", "0.55707103", "0.5533724", "0.55222684", "0.5516708", "0.5472499", "0.54537", "0.54081285", "0.53981483", "0.5391341", "0.5390397", "0.5382047", "0.5375144...
0.0
-1
Take the MD5 digest of a name, convert it to hex and take the first 6 characters as an RGB value.
def dopplr(name): return "#" + hashlib.sha224(name).hexdigest()[:6]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_md5(text):\n return hashlib.md5(text).hexdigest()", "def color_name_to_hex(name, default='#000000'):\n try:\n name = str(name)\n if name.startswith('#'):\n return name\n return webcolors.name_to_hex(name)\n except ValueError:\n return default", "def get_m...
[ "0.61176944", "0.6115744", "0.61068666", "0.60837525", "0.6063438", "0.60526246", "0.6049227", "0.6043318", "0.6015899", "0.595205", "0.59485966", "0.5934476", "0.5924637", "0.59155124", "0.5902312", "0.5875135", "0.5866297", "0.5865237", "0.5853065", "0.58442265", "0.5834953...
0.65998656
0
For a given background colour, return black or white for the text
def foreground_colour(background_colour): # Get RGB values background_colour = background_colour.lstrip("#") background_colour = struct.unpack('BBB', background_colour.decode('hex')) r = background_colour[0] g = background_colour[1] b = background_colour[2] print(r, g, b) # The perceive...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def black_or_white(bgcolor):\n ary_bgcolors = re.findall(r\"[\\w']+\", bgcolor)\n R = int(ary_bgcolors[1])\n G = int(ary_bgcolors[2])\n B = int(ary_bgcolors[3])\n Lumi = (sum([R,G,B])/3)\n\n if Lumi > 125:\n colorfont = 'rgb(0,0,0)'\n else:\n colorfont = 'rgb(255,255,255)'\n\n ...
[ "0.79908603", "0.70390666", "0.70168227", "0.6928707", "0.67906517", "0.6725715", "0.6606326", "0.6565484", "0.6551614", "0.651119", "0.6485232", "0.6482854", "0.6421965", "0.6326192", "0.62925994", "0.6289619", "0.6224909", "0.6212772", "0.6126866", "0.6106249", "0.6093084",...
0.70396507
1
Find the largestsized font that'll fit this text on this cover
def largest_font_that_fits(draw, font_file, text, cover_width): text_w = cover_width + 1 font_size = 110 padding = 20 while(text_w + padding > cover_width): font_size -= 10 font = ImageFont.truetype(font_file, font_size) text_w, text_h = draw.textsize(text, font) return font
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_optimal_font_size(fontfile,text,maxwidth,maxheight):\n fontsize = 1\n font = ImageFont.truetype(fontfile, fontsize)\n while font.getsize(text)[0] < maxwidth and font.getsize(text)[1] < maxheight:\n fontsize += 1\n font = ImageFont.truetype(fontfile, fontsize-1)\n return font", "...
[ "0.7606606", "0.7251992", "0.7203537", "0.6699396", "0.65662354", "0.6466567", "0.643199", "0.63370657", "0.6304743", "0.6279057", "0.62559944", "0.6191247", "0.61713487", "0.6060088", "0.59158844", "0.58457994", "0.58386546", "0.5816909", "0.58112776", "0.58027065", "0.57712...
0.8428862
0
Get some public domain image for text
def get_an_image(text): # Get the second or fourth word index = random.choice([1, 3]) text = text.split()[index] print(text) sort = random.choice(["relevance", "interestingness-desc"]) print(sort) from flickr_search_downloadr import flickr_search_downloadr filename = flickr_search_dow...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_image_url():", "def wiki_image(pagetext):\n images = [i for i in pagetext.images if i not in EXCLUDED_IMAGES]\n if len(images) > 0:\n return images[0]\n else:\n return ''", "def process_images(text):\n # if text != None:\n if text is not None:\n soup = BeautifulSoup(...
[ "0.6494177", "0.626865", "0.62658316", "0.62218577", "0.61541396", "0.6036385", "0.6014176", "0.5989792", "0.5951417", "0.59493285", "0.58120805", "0.5806087", "0.57846344", "0.5778579", "0.577659", "0.5753518", "0.5752582", "0.5750098", "0.5733324", "0.572244", "0.5719195", ...
0.65308005
0
Generate the train and validation errors needed to plot a validation curve that we can use to select lambda.
def validation_curve(x, y, x_val, y_val): lambda_vec = np.array([0, 0.001, 0.003, 0.01, 0.03, 0.1, 0.3, 1, 3, 10]) error_train = np.zeros(len(lambda_vec)) error_val = np.zeros(len(lambda_vec)) m = x.shape[0] m_val = x_val.shape[0] for i in range(len(lambda_vec)): l = lambda_vec[i] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_train_test_errors(train_errors, test_errors, lambda_str , K , path, rng):\n plt.plot(range(rng), train_errors, marker='o', label='Training Data');\n plt.plot(range(rng), test_errors, marker='v', label='Test Data');\n plt.title('ALS-WR Learning Curve, lambda = %s, K = %d'%(lambda_str, K))\n plt...
[ "0.7372803", "0.7234287", "0.7018966", "0.6955053", "0.68787926", "0.6867536", "0.68586004", "0.6833294", "0.669417", "0.663864", "0.6621206", "0.66208285", "0.6596412", "0.65892947", "0.6574992", "0.65665126", "0.6500066", "0.64827365", "0.6461519", "0.6461419", "0.6399849",...
0.76718855
0
caculate the attention weights. q, k, v must have matching leading dimensions. The mask has different shapes depending on its type(padding or look ahead) but it must be broadcastable for addition.
def scaled_dot_product_attention(q, k, v, mask): matmul_qk = tf.matmul(q, k, transpose_b=True) # [..., q_len, kv_len] # scale matmul_qk dk = tf.cast(tf.shape(k)[-1], tf.float32) scaled_attention_logits = matmul_qk / tf.sqrt(dk) # print("scaled_attention_logits", tf.nn.top_k(scaled_attention_logits[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attention(self, q, k, v, mask):\n if (self.params.display_details == True) :\n print('Scaled dot q :', q.shape)\n print('Scaled dot k: ', k.shape)\n print('Scaled dot v: ', v.shape)\n print('Scaled dot mask: ', mask.shape)\n \n matmul_qk = tf...
[ "0.6798876", "0.6614562", "0.6541027", "0.64965683", "0.6480315", "0.63856924", "0.6354788", "0.61816657", "0.61601377", "0.6148763", "0.6042509", "0.60187286", "0.5998331", "0.59813106", "0.593155", "0.59275615", "0.5926666", "0.5925003", "0.5920547", "0.5915503", "0.5892713...
0.5744126
30
Tests for various forms of WRITE statement (R911).
def test_write_stmt(): tcls = Write_Stmt obj = tcls('write (123)"hey"') assert isinstance(obj, tcls), repr(obj) assert str(obj) == 'WRITE(123) "hey"' assert repr(obj).replace("u'", "'") == ( "Write_Stmt(Io_Control_Spec_List(',', (Io_Control_Spec(None, " "Int_Literal_Constant('123', N...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_raw_write(command): \n if command.startswith('<WRITE') and command.endswith('>'):\n return True\n else: \n return False\n # end if", "def write():\n pass", "def check_write_command(self, line):\n self.E_str = \"check_write_command\"\n err_msg = \"The writ...
[ "0.6975526", "0.65449363", "0.6222274", "0.6008429", "0.59753144", "0.582857", "0.58206147", "0.5795848", "0.57906795", "0.57885945", "0.5740177", "0.57394093", "0.57394093", "0.57394093", "0.5700389", "0.56741863", "0.56741863", "0.56551474", "0.56497926", "0.5638626", "0.56...
0.6105301
3
Check that we reject a WRITE that names the iounit argument but still has a positional format argument (containing an '='). TODO 267. This test needs expanding and probably moving to a file dedicated to R913 and its (many) constraints.
def test_named_unit_before_fmt_error(): tcls = Write_Stmt # Cannot have an un-named (positional) argument after a named argument with pytest.raises(NoMatchError): tcls('''WRITE (UNIT=6, '("write some=""'//'text'//'""")')''')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_write_stmt():\n tcls = Write_Stmt\n obj = tcls('write (123)\"hey\"')\n assert isinstance(obj, tcls), repr(obj)\n assert str(obj) == 'WRITE(123) \"hey\"'\n assert repr(obj).replace(\"u'\", \"'\") == (\n \"Write_Stmt(Io_Control_Spec_List(',', (Io_Control_Spec(None, \"\n \"Int_Li...
[ "0.6082462", "0.5905375", "0.56293344", "0.5549656", "0.5493521", "0.54801637", "0.5453339", "0.54085284", "0.53969", "0.53846806", "0.53668135", "0.53544927", "0.52869296", "0.5286741", "0.5283133", "0.52826405", "0.52780616", "0.5258492", "0.521193", "0.5171243", "0.5170175...
0.60555166
1
CPP wrapper for a grid subsampling (method = barycenter for points and features
def grid_subsampling(points, features=None, labels=None, sampleDl=0.1, verbose=0): if (features is None) and (labels is None): return cpp_subsampling.compute(points, sampleDl=sampleDl, verbose=verbose) elif (labels is None): return cpp_subsampling.compute(points, features=features, sampleDl=sam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grid_subsampling(points,\n features=None,\n labels=None,\n grid_size=0.1,\n verbose=0):\n if (features is None) and (labels is None):\n return subsample(points, sampleDl=grid_size, verbose=verbose)...
[ "0.6935368", "0.6783366", "0.62108415", "0.60858434", "0.6082025", "0.59761757", "0.59068716", "0.5906552", "0.58184594", "0.57866776", "0.5761539", "0.5757237", "0.57401824", "0.5671831", "0.56630486", "0.5643654", "0.56029594", "0.5600671", "0.5593662", "0.5565551", "0.5558...
0.6818583
3
Filter neighborhoods with max number of neighbors. Limit is set to keep XX% of the neighborhoods untouched. Limit is computed at initialization
def big_neighborhood_filter(self, neighbors, layer): # crop neighbors matrix return neighbors[:, :self.neighborhood_limits[layer]]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def big_neighborhood_filter(self, neighbors, layer):\r\n\r\n # crop neighbors matrix\r\n if len(self.neighborhood_limits) > 0:\r\n return neighbors[:, :self.neighborhood_limits[layer]]\r\n else:\r\n return neighbors", "def sample_top_neighbors( self, max_count=200 ):\n ...
[ "0.6606671", "0.6276067", "0.5996828", "0.59867924", "0.56163824", "0.55717087", "0.55626965", "0.5517689", "0.5468347", "0.54618734", "0.5459569", "0.5457384", "0.5456208", "0.5448947", "0.5426886", "0.54178387", "0.54013634", "0.538458", "0.5377331", "0.5373551", "0.5291005...
0.6176705
2
Prepare the input pipeline with tf.Dataset class
def init_input_pipeline(self, config): ###################### # Calibrate parameters ###################### print('Initiating input pipelines') # Update num classes in config config.num_classes = self.num_classes - len(self.ignored_labels) config.ignored_label_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_data(self):\n data = self._get_dataset(self.hparams.dataset_path)\n label_encoder = data[\"label_encoder\"]\n del data[\"label_encoder\"]\n\n click.secho(\"Building inputs and labels.\", fg=\"yellow\")\n datasets = {\n \"train\": defaultdict(list),\n ...
[ "0.7301273", "0.72675794", "0.7138508", "0.7046271", "0.69744396", "0.6970408", "0.6957356", "0.6834164", "0.6833312", "0.68320596", "0.67942077", "0.67686826", "0.6739864", "0.6737556", "0.6729647", "0.67112744", "0.67099994", "0.6708296", "0.6704556", "0.6680539", "0.663472...
0.0
-1
Prepare the input pipeline with tf.Dataset class
def init_test_input_pipeline(self, config): print('Initiating test input pipelines') ###################### # Calibrate parameters ###################### # Update num classes in config config.num_classes = self.num_classes - len(self.ignored_labels) config.igno...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_data(self):\n data = self._get_dataset(self.hparams.dataset_path)\n label_encoder = data[\"label_encoder\"]\n del data[\"label_encoder\"]\n\n click.secho(\"Building inputs and labels.\", fg=\"yellow\")\n datasets = {\n \"train\": defaultdict(list),\n ...
[ "0.7301273", "0.72675794", "0.7138508", "0.7046271", "0.69744396", "0.6970408", "0.6957356", "0.6834164", "0.6833312", "0.68320596", "0.67942077", "0.67686826", "0.6739864", "0.6737556", "0.6729647", "0.67112744", "0.67099994", "0.6708296", "0.6704556", "0.6680539", "0.663472...
0.0
-1
Returns colour scheme for CSI (critical success index).
def _get_csi_colour_scheme(): this_colour_map_object = pyplot.cm.Blues this_colour_norm_object = matplotlib.colors.BoundaryNorm( LEVELS_FOR_CSI_CONTOURS, this_colour_map_object.N) rgba_matrix = this_colour_map_object(this_colour_norm_object( LEVELS_FOR_CSI_CONTOURS )) colour_list ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conseguir_color(self):\n return self.pluma.conseguir_color()", "def verify_color(cci):\n\n if cci < -6.0:\n return OrangeColor.GREEN\n elif -6.0 <= cci < -1.0:\n return OrangeColor.YELLOWISH_GREEN\n elif -1.0 <= cci < 2.7:\n return OrangeColor.YELLOW\n elif 2.7 <= cci ...
[ "0.6432659", "0.6361762", "0.62378114", "0.6107295", "0.60489845", "0.6039875", "0.6022437", "0.60140353", "0.59839135", "0.5968801", "0.5968204", "0.5968204", "0.5968204", "0.5938249", "0.5938249", "0.5932919", "0.5913306", "0.5908596", "0.59029335", "0.58735913", "0.5872064...
0.7236149
0
Returns colour scheme for Peirce score.
def _get_peirce_colour_scheme(): this_colour_map_object = pyplot.cm.Blues this_colour_norm_object = matplotlib.colors.BoundaryNorm( LEVELS_FOR_PEIRCE_CONTOURS, this_colour_map_object.N) rgba_matrix = this_colour_map_object(this_colour_norm_object( LEVELS_FOR_PEIRCE_CONTOURS )) col...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conseguir_color(self):\n return self.pluma.conseguir_color()", "def get_colour(self):\n return self.colour", "def get_colour(self) -> str:\n return self.colour", "def getColor(self):\n return self._l[2]", "def get_palace_board_red(self):\n\n return self._palace_board_...
[ "0.678865", "0.6306019", "0.6232524", "0.622833", "0.6212288", "0.6193526", "0.61802113", "0.6138026", "0.6122331", "0.61007756", "0.60846984", "0.60838187", "0.60765666", "0.60642964", "0.60596305", "0.6055237", "0.604426", "0.597812", "0.5978035", "0.59603816", "0.595773", ...
0.75720006
0
Generates polygon for confidence interval. P = number of points in bottom curve = number of points in top curve
def _confidence_interval_to_polygon( x_coords_bottom, y_coords_bottom, x_coords_top, y_coords_top, for_performance_diagram=False): nan_flags_top = numpy.logical_or( numpy.isnan(x_coords_top), numpy.isnan(y_coords_top)) real_indices_top = numpy.where(numpy.invert(nan_flags_top))[0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rectpolyctl(xmin,xmax,ymin,ymax):\n pc=[]\n pc.append((xmin,ymin))\n pc.append((xmin,ymax))\n pc.append((xmax,ymax))\n pc.append((xmax,ymin))\n pc.append((xmin,ymin))\n return pc", "def generatePolygons():", "def _createpoly(self):\n return self.cv.create_polygon((0, 0, 0, 0, 0,...
[ "0.6202383", "0.6190135", "0.6152543", "0.6056553", "0.6024834", "0.58629483", "0.58027285", "0.5787738", "0.56690466", "0.5664175", "0.56515396", "0.56223565", "0.56223565", "0.5581558", "0.5581497", "0.55799574", "0.55596733", "0.55531454", "0.5548768", "0.5543551", "0.5540...
0.6431237
0
Plots background (references lines and polygons) of attributes diagram. For more on the attributes diagram, see Hsu and Murphy (1986). BSS = Brier skill score. For more on the BSS, see `model_evaluation.get_brier_skill_score`.
def _plot_background_of_attributes_diagram( axes_object, climatology, no_skill_line_colour=DEFAULT_ZERO_BSS_COLOUR, no_skill_line_width=DEFAULT_ZERO_BSS_WIDTH, other_line_colour=DEFAULT_CLIMATOLOGY_COLOUR, other_line_width=DEFAULT_CLIMATOLOGY_WIDTH): error_checking.assert_is...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_bootstrapped_attributes_diagram(\n figure_object, axes_object, ci_bottom_dict, ci_mean_dict, ci_top_dict,\n num_examples_by_bin,\n reliability_line_colour=DEFAULT_RELIABILITY_COLOUR,\n reliability_line_width=DEFAULT_RELIABILITY_WIDTH,\n perfect_relia_line_colour=DEFAULT_...
[ "0.6314721", "0.5160302", "0.5150252", "0.5146807", "0.511476", "0.5082323", "0.5072824", "0.506235", "0.50508076", "0.4978316", "0.49699628", "0.49588132", "0.49191087", "0.49132687", "0.4868202", "0.48487267", "0.48426506", "0.4834363", "0.48201233", "0.48166025", "0.480528...
0.679852
0
Plots forecast histogram inset in attributes diagram. For more on the attributes diagram, see Hsu and Murphy (1986). B = number of forecast bins
def _plot_inset_histogram_for_attributes_diagram( figure_object, num_examples_by_bin, bar_face_colour=DEFAULT_HISTOGRAM_FACE_COLOUR, bar_edge_colour=DEFAULT_HISTOGRAM_EDGE_COLOUR, bar_edge_width=DEFAULT_HISTOGRAM_EDGE_WIDTH): error_checking.assert_is_integer_numpy_array(num_examples...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_attributes_diagram(\n figure_object, axes_object, mean_forecast_by_bin,\n event_frequency_by_bin, num_examples_by_bin,\n reliability_line_colour=DEFAULT_RELIABILITY_COLOUR,\n reliability_line_width=DEFAULT_RELIABILITY_WIDTH,\n perfect_relia_line_colour=DEFAULT_PERFECT_RE...
[ "0.6258223", "0.59847486", "0.5973236", "0.59051794", "0.58949333", "0.58539087", "0.5833261", "0.58074725", "0.57988834", "0.57910645", "0.56742895", "0.566742", "0.5615893", "0.5603276", "0.5587624", "0.5563986", "0.5562396", "0.55190045", "0.55185115", "0.54872495", "0.548...
0.66039234
0
Plots ROC (receiver operating characteristic) curve. T = number of binarization thresholds For the definition of a "binarization threshold" and the role they play in ROC curves, see `model_evaluation.get_points_in_roc_curve`.
def plot_roc_curve( axes_object, pod_by_threshold, pofd_by_threshold, line_colour=DEFAULT_ROC_COLOUR, line_width=DEFAULT_ROC_WIDTH, random_line_colour=DEFAULT_RANDOM_ROC_COLOUR, random_line_width=DEFAULT_RANDOM_ROC_WIDTH): error_checking.assert_is_numpy_array(pod_by_threshold, num_d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_roc_curve(tprs, aucs, tag=''):\n fig, ax = plt.subplots()\n ax.plot([0, 1], [0, 1], linestyle='--', lw=2, color='r',\n label='Chance', alpha=.8)\n\n mean_tpr = np.mean(tprs, axis=0)\n mean_tpr[-1] = 1.0\n mean_fpr = np.linspace(0, 1, 100)\n\n mean_auc = auc(mean_fpr, mean_tpr)...
[ "0.7453535", "0.7401407", "0.7339894", "0.73027515", "0.726741", "0.72624016", "0.72515935", "0.7190205", "0.71338737", "0.71291786", "0.6982739", "0.6944182", "0.6928798", "0.6907703", "0.69071853", "0.6897306", "0.68563014", "0.6836839", "0.6823447", "0.6806698", "0.679233"...
0.5995517
64
Bootstrapped version of plot_roc_curve. T = number of probability thresholds in curve
def plot_bootstrapped_roc_curve( axes_object, ci_bottom_dict, ci_mean_dict, ci_top_dict, line_colour=DEFAULT_ROC_COLOUR, line_width=DEFAULT_ROC_WIDTH, random_line_colour=DEFAULT_RANDOM_ROC_COLOUR, random_line_width=DEFAULT_RANDOM_ROC_WIDTH): plot_roc_curve( axes_obje...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_roc_curve(y_true, y_pred_proba, threshold=0.5):\n\n y_pred = predict_with_threshold(y_pred_proba, threshold)\n roc_auc = roc_auc_score(y_true, y_pred)\n fpr, tpr, thresholds = roc_curve(y_true, y_pred_proba)\n\n plt.plot( # roc auc line\n fpr, tpr,\n label='AUC={:.3f}'.format(ro...
[ "0.7486583", "0.7387596", "0.73390347", "0.7303862", "0.71846604", "0.7127741", "0.71195436", "0.70976794", "0.7094367", "0.7023224", "0.69831747", "0.6977276", "0.6967064", "0.69567615", "0.69160146", "0.6896866", "0.6894308", "0.6850953", "0.682168", "0.6805597", "0.6803503...
0.7392667
1
Plots performance diagram. T = number of binarization thresholds For the definition of a "binarization threshold" and the role they play in performance diagrams, see `model_evaluation.get_points_in_performance_diagram`.
def plot_performance_diagram( axes_object, pod_by_threshold, success_ratio_by_threshold, line_colour=DEFAULT_PERFORMANCE_COLOUR, line_width=DEFAULT_PERFORMANCE_WIDTH, bias_line_colour=DEFAULT_FREQ_BIAS_COLOUR, bias_line_width=DEFAULT_FREQ_BIAS_WIDTH): error_checking.assert_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_speed_benchmark(dump_dir):\n\n speed_file = os.path.join(dump_dir, \"stats/rnn_speed.csv\")\n\n assert os.path.isfile(speed_file), lu.str_to_redstr(\n f\"speed_file does not exist. Run ``python run.py --speed`` first.\"\n )\n\n df = pd.read_csv(speed_file)\n\n df_cpu = df[df.device =...
[ "0.6401355", "0.6201942", "0.61735725", "0.61091715", "0.60627824", "0.59896445", "0.5984814", "0.59826", "0.5948178", "0.59363383", "0.59315336", "0.5838213", "0.5787903", "0.5731635", "0.5678382", "0.56406707", "0.56393766", "0.5616087", "0.55818635", "0.55578893", "0.55230...
0.5602536
18
Bootstrapped version of plot_performance_diagram.
def plot_bootstrapped_performance_diagram( axes_object, ci_bottom_dict, ci_mean_dict, ci_top_dict, line_colour=DEFAULT_PERFORMANCE_COLOUR, line_width=DEFAULT_PERFORMANCE_WIDTH, bias_line_colour=DEFAULT_FREQ_BIAS_COLOUR, bias_line_width=DEFAULT_FREQ_BIAS_WIDTH): plot_performa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_dashboard(h, t, k, p):\n plt.style.use('seaborn')\n # Initialize the dashboard\n fig = plt.figure(figsize=(20, 8))\n ax1 = fig.add_subplot(2, 2, 1)\n ax2 = fig.add_subplot(2, 2, 2)\n ax3 = fig.add_subplot(2, 2, 3)\n ax4 = fig.add_subplot(2, 2, 4)\n\n # Create individual graphs\n ...
[ "0.59768915", "0.57902294", "0.57902294", "0.56942993", "0.5668916", "0.56470734", "0.557234", "0.55706507", "0.55304885", "0.55228186", "0.5484611", "0.5461995", "0.5434274", "0.5413838", "0.5411302", "0.54013497", "0.5389023", "0.53875077", "0.5386788", "0.5372324", "0.5351...
0.6330226
0
Plots reliability curve. B = number of bins (separated by forecast probability)
def plot_reliability_curve( axes_object, mean_forecast_by_bin, event_frequency_by_bin, line_colour=DEFAULT_RELIABILITY_COLOUR, line_width=DEFAULT_RELIABILITY_WIDTH, perfect_line_colour=DEFAULT_PERFECT_RELIABILITY_COLOUR, perfect_line_width=DEFAULT_PERFECT_RELIABILITY_WIDTH): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_progression(weights, bhs, bvs):\n\tweights_plot = []\n\tfor i in range(40):\n\t\tweights_plot.append(weights[i][0][0])\t# only plots the first value in the matrix every time\n\tplt.plot(weights_plot)\n\n\tplt.show()", "def plot_betweeness(net, label, outpath):\n _, betweeness_values = networkit_util....
[ "0.6400032", "0.6181155", "0.609827", "0.6062676", "0.60387135", "0.6023721", "0.59199935", "0.5901988", "0.58723277", "0.5864173", "0.5836554", "0.5822969", "0.5810661", "0.5806116", "0.5801238", "0.5745483", "0.5742041", "0.5731765", "0.5709502", "0.5707094", "0.5682834", ...
0.5780638
15
Bootstrapped version of plot_reliability_curve. B = number of bins (separated by forecast probability)
def plot_bootstrapped_reliability_curve( axes_object, ci_bottom_dict, ci_mean_dict, ci_top_dict, line_colour=DEFAULT_RELIABILITY_COLOUR, line_width=DEFAULT_RELIABILITY_WIDTH, perfect_line_colour=DEFAULT_PERFECT_RELIABILITY_COLOUR, perfect_line_width=DEFAULT_PERFECT_RELIABILITY_WI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_reliability_curve(\n axes_object, mean_forecast_by_bin, event_frequency_by_bin,\n line_colour=DEFAULT_RELIABILITY_COLOUR,\n line_width=DEFAULT_RELIABILITY_WIDTH,\n perfect_line_colour=DEFAULT_PERFECT_RELIABILITY_COLOUR,\n perfect_line_width=DEFAULT_PERFECT_RELIABILITY_WI...
[ "0.61927634", "0.584321", "0.58100855", "0.57739335", "0.57387716", "0.5699075", "0.5687666", "0.5648579", "0.5588099", "0.5552348", "0.55387723", "0.55168885", "0.54948616", "0.5494651", "0.54943234", "0.5490119", "0.54568595", "0.5451723", "0.5428895", "0.54109", "0.5395559...
0.6703668
0
Plots attributes diagram (Hsu and Murphy 1986).
def plot_attributes_diagram( figure_object, axes_object, mean_forecast_by_bin, event_frequency_by_bin, num_examples_by_bin, reliability_line_colour=DEFAULT_RELIABILITY_COLOUR, reliability_line_width=DEFAULT_RELIABILITY_WIDTH, perfect_relia_line_colour=DEFAULT_PERFECT_RELIABILITY_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_attribute_dist(self, attribute='num_notes', plt_type='pca'):\n (_, _, gen_test) = self.dataset.data_loaders(\n batch_size=64, # TODO: remove this hard coding\n split=(0.01, 0.01)\n )\n z_all = []\n n_all = []\n num_samples = 5\n for sample_i...
[ "0.6157655", "0.6134641", "0.59872305", "0.5886937", "0.5886325", "0.58799595", "0.5786425", "0.57618356", "0.57104844", "0.56591445", "0.5654022", "0.5650096", "0.5631834", "0.56256115", "0.56029093", "0.55969733", "0.5561705", "0.55548537", "0.55546737", "0.5534843", "0.553...
0.5372712
35
Bootstrapped version of plot_attributes_diagram.
def plot_bootstrapped_attributes_diagram( figure_object, axes_object, ci_bottom_dict, ci_mean_dict, ci_top_dict, num_examples_by_bin, reliability_line_colour=DEFAULT_RELIABILITY_COLOUR, reliability_line_width=DEFAULT_RELIABILITY_WIDTH, perfect_relia_line_colour=DEFAULT_PERFECT_RE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, width, height, data, palette, labels, axis_labels=[], axis_label_height=16):\n\n DiagramElement.__init__(self)\n self.palette = palette\n self.labels = labels\n self.plot = DiscretePlot(width, height, data, self.labels, axis_labels,axis_label_height)\n self.plo...
[ "0.5769211", "0.5578839", "0.5578839", "0.5510679", "0.5479296", "0.5369858", "0.5342495", "0.53263974", "0.5322546", "0.51956356", "0.5170794", "0.5103581", "0.5096639", "0.505632", "0.49624193", "0.49553692", "0.49490607", "0.4941913", "0.49288616", "0.49155903", "0.4908788...
0.6774211
0
this method controls time and char relation
def alarmhandler(signum, frame): signum = signum frame = frame raise AlarmException
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ctime(self):\n return \"\"", "def ctime(self):\n return \"\"", "def _change_time(self):\r\n msg = \"Notice! if you don't write hours the time\\nwill be calculated as seconds.\\nEnter new time:\"\r\n new_time = simpledialog.askstring(title=\"Change recording time\", prompt=msg)\r...
[ "0.6375", "0.6375", "0.6288877", "0.61069393", "0.59520406", "0.59172434", "0.58609587", "0.5826218", "0.5795813", "0.578609", "0.5783455", "0.57534885", "0.5731229", "0.572486", "0.57128537", "0.5670618", "0.56288886", "0.5583386", "0.55816156", "0.55789655", "0.5555492", ...
0.0
-1
this method is to get input
def input_to(timeout=1): # time after which enemies move automatically signal.signal(signal.SIGALRM, alarmhandler) signal.alarm(timeout) try: text = G() signal.alarm(0) return text except AlarmException: print("\n Prompt timeout. Continuing") signal.signal(signal.SIG...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def input(self):", "def input(self):\r\n pass", "def get_input(self):\n pass", "def _get_input(self):\n return self.__input", "def _get_input(self):\n return self.__input", "def _get_input(self):\n return self.__input", "def _get_input(self):\n return self.__input", "def _get_in...
[ "0.83148164", "0.8185454", "0.81561816", "0.80938476", "0.80938476", "0.80938476", "0.80938476", "0.80938476", "0.80938476", "0.80938476", "0.75742227", "0.73511696", "0.73511696", "0.70644873", "0.7038125", "0.6909052", "0.6897651", "0.6852462", "0.68499005", "0.6841098", "0...
0.0
-1
this method prints board
def printboard(BNE): row = 0 col = 0 for temp in BNE: row += 1 for jtemp in temp: jtemp = jtemp col += 1 print(BNE[row - 1][col - 1], end='') col = 0 print(end='\n') # to get contents printed on new line end should be \n print('Score:'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printBoard(self):", "def print_board(self):\n print('Board:')\n print('\\n'.join([''.join(['{:4}'.format(item) for item in row]) for row in self.board]))", "def _print_board(board):\r\n pass", "def print_board(self):\n print_sp = functools.partial(print, end=' ')\n pri...
[ "0.9154919", "0.8968014", "0.8914365", "0.88704693", "0.8859892", "0.88116366", "0.87902397", "0.8749738", "0.87482935", "0.87109226", "0.8686641", "0.86753064", "0.86753064", "0.86724365", "0.8626073", "0.862481", "0.8596138", "0.85820305", "0.8566682", "0.8558604", "0.85124...
0.0
-1
this method prints board
def printboard1(): row = 0 col = 0 for temp1 in BNE: row += 1 for jtemp1 in temp1: jtemp1 = jtemp1 col += 1 if BNE[row - 1][col - 1] == 'e': # replace 'e' with ' ' BNE[row - 1][col - 1] = ' ' # after explosion print(BNE[r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printBoard(self):", "def print_board(self):\n print('Board:')\n print('\\n'.join([''.join(['{:4}'.format(item) for item in row]) for row in self.board]))", "def _print_board(board):\r\n pass", "def print_board(self):\n print_sp = functools.partial(print, end=' ')\n pri...
[ "0.9154919", "0.8968014", "0.8914365", "0.88704693", "0.8859892", "0.88116366", "0.87902397", "0.8749738", "0.87482935", "0.87109226", "0.8686641", "0.86753064", "0.86753064", "0.86724365", "0.8626073", "0.862481", "0.8596138", "0.85820305", "0.8566682", "0.8558604", "0.85124...
0.0
-1
this method starts the game
def startgame(BNE): nextstep = time.time() + 1 # value to make enemies move automatically flag = 0 # bomb is not there on the board B.score = 0 while True: inp = input_to() if inp == 'q': break if inp == 'w': BNE = B.moveup(BNE,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_game(self):\n\n\t\tpass", "def start_game(self):\n print(\"hi there, game started!\")\n self.draw()", "def start_game(self) -> None:\n self.init_game()\n self.play()", "def start(self):\n self.save_checkpoint(\"setup\")\n\n logging.info(\"Starting game...\")\n b...
[ "0.9270441", "0.87106586", "0.86542255", "0.8449429", "0.8325229", "0.8176033", "0.8027224", "0.7921875", "0.7909444", "0.78747636", "0.7840275", "0.78296155", "0.7829269", "0.77803576", "0.7773749", "0.7755486", "0.77514756", "0.7734114", "0.77219874", "0.7705575", "0.769944...
0.0
-1
Provides the spin from an int. +1 == Spin.up, 1 == Spin.down.
def from_int(i): if i == 1: return Spin.up elif i == -1: return Spin.down else: raise ValueError("Spin integers must be 1 or -1")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_spin(self, i):\n \n return 1 if self.spins[i] else -1", "def spin(mult):\n return mult - 1", "def getSpinControl(*args):", "def on_spin(self, event):\n spin_value = self.spin_run.GetValue()\n text = \"\".join([_(u\"New run spin control value: \"), str(spin_value)])\n ...
[ "0.7496796", "0.7100908", "0.66705376", "0.66398364", "0.65249074", "0.64780074", "0.6415233", "0.630757", "0.6230635", "0.6085406", "0.5867", "0.58657813", "0.5847536", "0.582126", "0.5800157", "0.57851535", "0.57549834", "0.57405555", "0.5706542", "0.5580043", "0.5572952", ...
0.8344842
0
String indicating the type of orbital. Is always uppercase. E.g., S, P, D, F, etc.
def orbital_type(self): return self.name[0].upper()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getType(self):\n if (self.type == 's'):\n #suit type\n type = \"suit\"\n elif (self.type == 'b'):\n #boss type\n type = \"boss\"\n else:\n notify.error(\"Invalid DNA type: \", self.type)\n\n return type", "def unit_type(self) ...
[ "0.64918655", "0.6483131", "0.6290639", "0.5996382", "0.5951763", "0.5928909", "0.5896806", "0.5896335", "0.5885597", "0.58396786", "0.5786302", "0.571342", "0.57116663", "0.5709346", "0.567985", "0.5675378", "0.56724256", "0.56724256", "0.56605196", "0.5654156", "0.56412363"...
0.819442
0
Returns an orbital based on the index of the orbital in VASP runs.
def from_vasp_index(i): return Orbital.all_orbitals[i]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def orbit_index():\n return OrbitController.invoke(OUTPUT_DIRECTORY)", "def get_vsolar(self):\n return self.read_register(4098, 1, 3)", "def get_orbit(self):\n return self.get_attr('orbit')", "def get_solar(self, name_building):\n return self._solar.loc[name_building]", "def solar_t...
[ "0.63372135", "0.5902144", "0.5708969", "0.5705622", "0.5473955", "0.5333812", "0.5275198", "0.5232643", "0.5220132", "0.51939213", "0.5165619", "0.5133298", "0.5122275", "0.5114667", "0.50612587", "0.50426286", "0.50406325", "0.49916345", "0.49804333", "0.49263537", "0.49151...
0.80536574
0
Returns an orbital from a string representation, e.g., "s", "px".
def from_string(orb_str): for orb in Orbital.all_orbitals: if str(orb) == orb_str: return orb raise ValueError("Illegal orbital definition!")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fromString(cls, string):\n # From SAM specification v1.5, slightly adapted for single-token parsing\n pattern = r\"^[0-9]+[MIDNSHPX=]\" \n string = string.strip()\n if string == '*':\n return CIGAR.fromList(['*'])\n parsed = []\n s = string\n # Parse ...
[ "0.5704035", "0.5645704", "0.56413406", "0.558188", "0.5521622", "0.5513611", "0.5464635", "0.54529065", "0.5443319", "0.5428483", "0.5418516", "0.53966254", "0.53935385", "0.53825116", "0.5334332", "0.5319566", "0.52879316", "0.5284919", "0.5277784", "0.5237857", "0.52367216...
0.67074496
0
Helper function to parse Asterisk mxml responses over AJAM.
def etree_to_dict(t): d = {t.tag: {} if t.attrib else None} children = list(t) if children: dd = defaultdict(list) for dc in map(etree_to_dict, children): for k, v in dc.items(): dd[k].append(v) d = {t.tag: {k:v[0] if len(v) == 1 else v for k, v in dd.item...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_aunit_response(aunit_results_xml):\n\n xml_handler = AUnitResponseHandler()\n xml.sax.parseString(aunit_results_xml, xml_handler)\n\n return xml_handler", "def parse_aprs (packet):\n\n print (packet)\n if len(packet) == 0:\n return\n\n chan = ''\n # Split into address and in...
[ "0.64191806", "0.6136312", "0.6040955", "0.58329314", "0.57191724", "0.56828016", "0.5450483", "0.54062784", "0.53085005", "0.52578115", "0.5247155", "0.52422374", "0.5177752", "0.51586944", "0.5096927", "0.50454915", "0.50400144", "0.5014877", "0.50111437", "0.5009018", "0.4...
0.0
-1
We use cli_url to set CLI URL and reflect this in cli_area to take it from JS.
def _get_cli_area(self): for rec in self: rec.cli_area = rec.cli_url
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_cli_area(self):\n pass", "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.67812735", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", "0.6515039", ...
0.68657756
0
STUB as I don't know yet how to extend WEB widgets and get rid of this shit.
def _set_cli_area(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_widget(self):", "def getWidget(self):", "def XPHideWidget(inWidget):\n pass", "def create_widgets(self):", "def mainWidget(self):\n raise RuntimeError('Not implemented')", "def XPShowWidget(inWidget):\n pass", "def widget(self, p_int): # real signature unknown; restored from __doc...
[ "0.7079398", "0.7067382", "0.70150965", "0.69593006", "0.68012637", "0.6722416", "0.6709623", "0.6709623", "0.6686431", "0.65496624", "0.6527676", "0.6465312", "0.64285773", "0.6391126", "0.6325712", "0.62870103", "0.6269375", "0.62110406", "0.6193662", "0.61610067", "0.61449...
0.0
-1
Apt uses for communication with its methods the text protocol similar to http. This function parses the protocol messages from stdin.
def _read_message(self): if self.__eof: return None result = {} line = sys.stdin.readline() while line == '\n': line = sys.stdin.readline() if not line: self.__eof = True return None s = line.split(" ", 1) result['_n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(self, input):\n pass", "def parse_stdin(self, data):\n return data", "def read_input(self) -> None:\n raw_input = sys.stdin.read()\n\n self.input = raw_input.split('\\n')\n self.input = self.input[0:-1]\n\n self.packets = []\n for item in self.input:\n...
[ "0.6306659", "0.62820286", "0.6222984", "0.6201341", "0.61170065", "0.5782295", "0.5776556", "0.57491636", "0.574258", "0.5739675", "0.5669993", "0.5626461", "0.55610186", "0.55353254", "0.5533662", "0.54809386", "0.5467153", "0.5466668", "0.5457796", "0.54416585", "0.5436949...
0.6077693
5
Loop through requests on stdin
def run(self): while True: message = self._read_message() logger.debug(message) if message is None: return 0 if message['_number'] == 600: try: if message['URI'].endswith('Release'): self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n while True:\n req = self._requests.get()[1]\n req.start()\n logging.info('Running request %s', req)", "def handle(self):\n req_lines = self._read_lines()\n if not req_lines:\n self.cleanup()\n for req in req_lines:\n ...
[ "0.63727874", "0.61013925", "0.6043009", "0.5817638", "0.5750711", "0.56076044", "0.55774134", "0.5559532", "0.5545996", "0.55304486", "0.5526393", "0.5513909", "0.55078477", "0.5507755", "0.5500825", "0.54575986", "0.54520863", "0.545059", "0.5434138", "0.5434013", "0.542451...
0.0
-1
For use to one hot encode the 10 possible labels. This will translate the labels from words/strings to a string of ints. Helps the CNN determine which label to apply.
def one_hot_encode(vector, values = 10): n = len(vector) out = numpy.zeros( (n, values) ) out[range(n), vector] = 1 return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def label_to_onehot(labels):\n label_dict = {'THEORETICAL': 0, 'ENGINEERING': 1, 'EMPIRICAL': 2, 'OTHERS': 3}\n onehot = [0, 0, 0, 0]\n for l in labels.split():\n onehot[label_dict[l]] = 1\n return onehot", "def encode_labels(self, y, num_labels):\n onehot = np.zeros((num_labels, y.shap...
[ "0.7619558", "0.7610005", "0.7477685", "0.7434517", "0.7328804", "0.7328804", "0.73225486", "0.7252873", "0.7234458", "0.7229771", "0.72178775", "0.7207976", "0.71952957", "0.71811646", "0.71035236", "0.7076326", "0.7062962", "0.70618916", "0.70064986", "0.7004212", "0.699154...
0.0
-1
Inserts breakpoints into code
def bp_ins(filename, start, end): with open(filename, 'r') as f: lines = f.readlines() lines.insert(start-1, "") lines.insert(end+1, "") lines.insert(0, "") lines[start-1] = 'ipdb.set_trace()\n' lines[end+1] = 'ipdb.set_trace()\n' lines[0] = "import ipdb\n" with open(f"break_{fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_breakpoint():\n raise NotImplementedError()", "def gdb_breakpoint():\n _gdb_python_call_gen('gdb_breakpoint')()", "def break_code(self, breakpoint):\n\n self.cont = False\n self.pause_reason = \"breakpoint\"\n self.scope_assign = {}\n self.scope_var_id = 0\n han...
[ "0.75142455", "0.6993647", "0.64676607", "0.63605744", "0.62337136", "0.6182318", "0.61285335", "0.6127929", "0.59779215", "0.5898219", "0.5866709", "0.58543456", "0.580009", "0.57349426", "0.56881565", "0.56861484", "0.5679313", "0.56781137", "0.5659", "0.5645631", "0.562168...
0.5888767
10
Executes provided file through the console
def debug_file_exec(filename): exec(open(f"break_{filename}").read())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_file(self, arg):\n\n try:\n self.context.mode = ExecutionMode.SCRIPT\n with open(arg) as script:\n for line in script:\n line = self.owner.precmd(line)\n self.owner.print_line(line)\n self.owner.onecmd(line)...
[ "0.75281173", "0.75058365", "0.7475906", "0.73540455", "0.7189997", "0.70718676", "0.7006774", "0.6999836", "0.69913876", "0.69372654", "0.6860996", "0.67678684", "0.67173374", "0.66768223", "0.66556096", "0.66509295", "0.664758", "0.6537949", "0.6528355", "0.6478455", "0.643...
0.5807744
62
Asks for the user to guess numbers and turns the strings to a list
def user_guess(): return list(input("What is your guess?"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_input():\n guess_num = int(input(\"please type four-digit: \"))\n guess_list = list(str(guess_num))\n return guess_list", "def convert_str_input_into_list_of_int(guess_input):\n guess = list(guess_input)\n guess = [int(x) for x in guess]\n return guess", "def get_user_list(question):...
[ "0.7755962", "0.69793016", "0.6891124", "0.6676904", "0.63334835", "0.63176185", "0.62182146", "0.60630065", "0.60263", "0.5925718", "0.58965445", "0.5883831", "0.58714354", "0.58387905", "0.5829174", "0.5744655", "0.5730842", "0.5711055", "0.5682094", "0.5649758", "0.5617869...
0.73835796
1
Generates three random numbers in a list
def code_generator(): digits = [str(num) for num in range(10)] random.shuffle(digits) return digits[:3]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_in_three():\n chance = random.randrange(0, 3)\n return chance", "def random_number() -> int:\r\n return random.randint(1, 3)", "def three_times_nums(num_list):", "def getRandomList(n):\n lyst = list()\n for count in range (n):\n lyst.append(random.randint(1, n))\n return lyst...
[ "0.7464285", "0.6918836", "0.6901644", "0.6819775", "0.6784882", "0.6728731", "0.66056776", "0.6555976", "0.6504841", "0.65035915", "0.65013784", "0.6452814", "0.64337295", "0.64287174", "0.6375383", "0.63752186", "0.6342449", "0.6314323", "0.62993443", "0.62821555", "0.62691...
0.6364137
16
It takes the code generater by the machine and the user's guess then compares the numbers in a loop and creates a list of clues according to the matching parameters
def clues_generator(code, userGuess): if userGuess == code: return "Code Cracked!" clues = [] # Compare guess to code for ind, num in enumerate(userGuess): if num == code[ind]: clues.append("Match") elif num in code: clues.append("Close") if clues ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eval_guess(self, Guess):\n\n\t\t# pulls comparison from win check and assigns peg responses \n\n\t\t# returns a list to be in hint_response\n\n\t\t# displays as part of big display in view.\n\n\t\t\"\"\"Borrow the logic from win_check to implement eval_guess. Use variables right and wrong to \n\t\tevaluate. Ri...
[ "0.65523076", "0.6467425", "0.6455887", "0.63705254", "0.6136182", "0.5947095", "0.5909345", "0.58723474", "0.5860619", "0.58369917", "0.58310723", "0.5819333", "0.5809662", "0.5804019", "0.5748134", "0.5729847", "0.5718463", "0.57156974", "0.5695532", "0.56886834", "0.567663...
0.75308436
0
Get compute plugin disabled status
def nfvi_compute_plugin_disabled(): return (_compute_plugin is None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_disabled_plugins(self):\n return self._disabled_plugins", "def getDisabledPlugin(self, *args):\n return _libsbml.SBase_getDisabledPlugin(self, *args)", "def get_disabled(self):\n return self._disabled", "def get_disabled(self):\n return self._disabled", "def getNumDisabl...
[ "0.7047027", "0.66642225", "0.6457143", "0.6457143", "0.6397048", "0.63932973", "0.63549125", "0.6290539", "0.62651056", "0.62651056", "0.61825705", "0.615268", "0.6097714", "0.6097714", "0.6058149", "0.6056175", "0.60538864", "0.6039746", "0.60189015", "0.6017175", "0.600594...
0.7179284
0
Get a list of host aggregates
def nfvi_get_host_aggregates(callback): cmd_id = _compute_plugin.invoke_plugin('get_host_aggregates', callback=callback) return cmd_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_host_aggregates(self):\n path = '/os-aggregates'\n res = self.compute.call(path, 'GET', data='', \n token=self.manager.identity.token)\n self.logger.debug('Get openstack host aggregates: %s' % truncate(res))\n return res[0]['aggregates']", "d...
[ "0.82682306", "0.65386385", "0.650028", "0.62470096", "0.6212668", "0.6188747", "0.61886394", "0.6129932", "0.6109547", "0.6059295", "0.58552474", "0.5842673", "0.5836488", "0.5821537", "0.5802988", "0.5714081", "0.57066965", "0.56985897", "0.56599617", "0.5650841", "0.565036...
0.7245975
1
Get a list of hypervisors
def nfvi_get_hypervisors(callback): cmd_id = _compute_plugin.invoke_plugin('get_hypervisors', callback=callback) return cmd_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_hypervisors(self):\n path = '/os-hypervisors/detail'\n res = self.compute.call(path, 'GET', data='', \n token=self.manager.identity.token)\n self.logger.debug('Get openstack hypervisors: %s' % truncate(res))\n return res[0]['hypervisors']", "...
[ "0.79112303", "0.751754", "0.66653055", "0.6560949", "0.5948298", "0.5851004", "0.5822611", "0.57840484", "0.57010585", "0.56908005", "0.5658302", "0.5649874", "0.56252897", "0.56251174", "0.56110847", "0.557076", "0.5563254", "0.5522532", "0.55079365", "0.5506534", "0.550181...
0.7392484
2
Get a list of instance types
def nfvi_get_instance_types(paging, callback): cmd_id = _compute_plugin.invoke_plugin('get_instance_types', paging, callback=callback) return cmd_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instance_types(self) -> Sequence[str]:\n return pulumi.get(self, \"instance_types\")", "def get_instance_classes():\n return Base_Instance.get_instance_classes()", "def instance_classes(self) -> Sequence[str]:\n return pulumi.get(self, \"instance_classes\")", "def getTypesList():\n ...
[ "0.81660527", "0.7535378", "0.7436036", "0.7412654", "0.73744756", "0.7340406", "0.7082", "0.701241", "0.70042306", "0.6944061", "0.6931257", "0.6911345", "0.69008607", "0.6876258", "0.667491", "0.6672907", "0.664245", "0.66406167", "0.66048896", "0.65750015", "0.6544737", ...
0.6962659
9
Create an instance type
def nfvi_create_instance_type(instance_type_uuid, instance_type_name, instance_type_attributes, callback): cmd_id = _compute_plugin.invoke_plugin('create_instance_type', instance_type_uuid, instance_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Instance(self) -> TypeManager:", "def __init__(self, inst, class_type):\n\t\tself.type = str(class_type)[7:]\n\t\tself.type = self.type[:-1]\n\t\tself.inst = inst\n\t\treturn", "def create_instance(c_instance):\n\treturn 0", "def create_instance(self,name):\n print \"INFO : new %s\" % name\n retu...
[ "0.70323706", "0.6804457", "0.67378426", "0.66944134", "0.66899633", "0.66505414", "0.6641462", "0.6580538", "0.65522", "0.65520185", "0.6531432", "0.650623", "0.6420706", "0.6394156", "0.63840836", "0.6373831", "0.6338971", "0.6324974", "0.6298098", "0.62654406", "0.6248032"...
0.6609128
7
Delete an instance type
def nfvi_delete_instance_type(instance_type_uuid, callback): cmd_id = _compute_plugin.invoke_plugin('delete_instance_type', instance_type_uuid, callback=callback) return cmd_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(cls, type_obj):\n DB.session.delete(type_obj)\n DB.session.commit()", "def test_instance_type_create_then_delete(self):\n name = 'Small Flavor'\n flavorid = 'flavor1'\n\n original_list = instance_types.get_all_types()\n\n # create new type and make sure values...
[ "0.75105196", "0.7219865", "0.71700513", "0.68534404", "0.6839456", "0.6828863", "0.6794721", "0.67646134", "0.6655979", "0.66524136", "0.66384214", "0.6603012", "0.65674657", "0.6551319", "0.6535387", "0.6509424", "0.6474037", "0.64697915", "0.6459448", "0.6426711", "0.64048...
0.738218
1
Get an instance type
def nfvi_get_instance_type(instance_type_uuid, callback): cmd_id = _compute_plugin.invoke_plugin('get_instance_type', instance_type_uuid, callback=callback) return cmd_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instance_type(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"instance_type\")", "def instance_type(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"instance_type\")", "def instance_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"instance_type\")",...
[ "0.7858931", "0.7858931", "0.7729616", "0.75640863", "0.74854463", "0.7416018", "0.7412319", "0.7407187", "0.7407187", "0.7407187", "0.7407187", "0.7407187", "0.7407187", "0.7407187", "0.7407187", "0.7407187", "0.7407187", "0.7407187", "0.7407187", "0.7407187", "0.7407187", ...
0.690489
49
Get a list of instance groups
def nfvi_get_instance_groups(callback): cmd_id = _compute_plugin.invoke_plugin('get_instance_groups', callback=callback) return cmd_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group(self):\n instances = self.instances\n groups = []\n for i in range(len(self.labels)):\n groups.append([instance for instance in instances if instance[-1] == self.labels[i]])\n return groups", "def groups(self):\n return []", "def getGroups():\r\n r...
[ "0.7936195", "0.7689464", "0.76814425", "0.7616023", "0.7589611", "0.75577134", "0.7503055", "0.7470981", "0.7402263", "0.73279613", "0.7312847", "0.7306534", "0.73041123", "0.72878385", "0.72878385", "0.72878385", "0.72705674", "0.7213948", "0.7133093", "0.71288484", "0.7113...
0.76402324
3
Get a list of instances
def nfvi_get_instances(paging, callback, context=None): cmd_id = _compute_plugin.invoke_plugin('get_instances', paging, context, callback=callback) return cmd_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_instances(cls):\n raise NotImplementedError", "def list_instances(self):\n # list instances\n self._list_instances()", "def instances(self):\n return self.get('instances')", "def instances(self, **query):\n return self._list(_instance.Instance, **query)", "def sho...
[ "0.84727585", "0.842499", "0.78484535", "0.77498925", "0.77399474", "0.77090836", "0.7706824", "0.76598173", "0.75492424", "0.7474748", "0.7390956", "0.7378108", "0.72367144", "0.7233143", "0.71794736", "0.71741885", "0.71656644", "0.71555954", "0.71463233", "0.71233106", "0....
0.0
-1
Live migrate an instance
def nfvi_live_migrate_instance(instance_uuid, callback, to_host_name=None, block_storage_migration='auto', context=None): if context is None: cmd_id = _compute_plugin.invoke_plugin_expediate( 'live_migrate_instance', instance_uuid, to_host_name, block_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def migrate(self):\n\tpass", "def migrate(cls)->None:\n pass", "def migration():", "def migrate(ctx):\n connecter = ScalingoInterface(ctx.obj)\n connecter.manage_py(\"migrate\")", "def migrate(cr, version):\n pass", "def migrate_database(self):\n\n self.db.migrate_database()", "d...
[ "0.75730634", "0.7123071", "0.70456356", "0.6972351", "0.6669681", "0.6351536", "0.62965226", "0.6214062", "0.6187444", "0.61660546", "0.6122363", "0.6104745", "0.6022302", "0.5954714", "0.5931229", "0.5864479", "0.5863038", "0.58564633", "0.5856224", "0.58512694", "0.5849165...
0.67845047
4
Cold migrate an instance
def nfvi_cold_migrate_instance(instance_uuid, callback, to_host_name=None, context=None): if context is None: cmd_id = _compute_plugin.invoke_plugin_expediate( 'cold_migrate_instance', instance_uuid, to_host_name, context, callback=callback) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def migrate(self):\n\tpass", "def migrate(cr, version):\n pass", "def migrate(cls)->None:\n pass", "def migration():", "def migrate(ctx):\n connecter = ScalingoInterface(ctx.obj)\n connecter.manage_py(\"migrate\")", "def post_migrations(self):", "def model_post_migrate(*args, **kwargs):...
[ "0.7329543", "0.6954517", "0.68720347", "0.6605521", "0.65372694", "0.6288195", "0.6242308", "0.623792", "0.61931604", "0.6140751", "0.61181766", "0.6097446", "0.6076026", "0.6048482", "0.59686345", "0.59640205", "0.5955205", "0.5951078", "0.59448874", "0.59367293", "0.593385...
0.61189204
10
Cold migrate confirm an instance
def nfvi_cold_migrate_confirm_instance(instance_uuid, callback, context=None): if context is None: cmd_id = _compute_plugin.invoke_plugin_expediate( 'cold_migrate_confirm_instance', instance_uuid, context, callback=callback) else: cmd_id = _compute_plugin.invoke_plugin( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirm_migration(self, migration, instance, network_info):\n raise NotImplementedError()", "def migrate(self):\n\tpass", "def migrate():\n if apply_migrations():\n click.echo(OK)\n else:\n sys.exit(1)", "def migrate(cr, version):\n pass", "def post_migrations(self):", "...
[ "0.72407913", "0.6868304", "0.6802639", "0.6643721", "0.64271414", "0.6412695", "0.63651156", "0.6314516", "0.63011813", "0.61909187", "0.6099909", "0.60377604", "0.6023261", "0.59750897", "0.5949194", "0.59245265", "0.5899963", "0.5899963", "0.58728546", "0.58728546", "0.586...
0.7104281
1
Cold migrate revert an instance
def nfvi_cold_migrate_revert_instance(instance_uuid, callback, context=None): cmd_id = _compute_plugin.invoke_plugin('cold_migrate_revert_instance', instance_uuid, context, callback=callback) return cmd_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def migrate(cr, version):\n pass", "def migrate(self):\n\tpass", "def post_revert(self):", "def pre_revert(self):", "def migration():", "def test_migration_task_rollback(self):\n server, source_host, target_host = self._create_server()\n self._disable_target_host(target_host)\n se...
[ "0.69084084", "0.6837074", "0.66857207", "0.66517055", "0.66482615", "0.6580794", "0.6542509", "0.65224993", "0.6518319", "0.65061986", "0.6489541", "0.64496523", "0.6444745", "0.6442864", "0.6369054", "0.6349502", "0.6275725", "0.62747025", "0.6249206", "0.62250805", "0.6209...
0.739316
0
Resize confirm an instance
def nfvi_resize_confirm_instance(instance_uuid, callback, context=None): cmd_id = _compute_plugin.invoke_plugin('resize_confirm_instance', instance_uuid, context, callback=callback) return cmd_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handleResize(self):\n pass", "def resizeEvent(self, event):\n self.resized.emit()\n return super(PiWndow, self).resizeEvent(event)", "def resize(self):\n pass", "def on_resize(self, width, height):\n self.gamestatemanager.peek().on_resize(width, height)", "def OnResiz...
[ "0.7517562", "0.7246645", "0.7122518", "0.70567065", "0.69365686", "0.69342285", "0.68687326", "0.68354404", "0.6823279", "0.68086725", "0.6766548", "0.6746385", "0.67006433", "0.6691146", "0.66373914", "0.6559301", "0.65417355", "0.65392864", "0.653689", "0.6516252", "0.6497...
0.6128036
47
Resize revert an instance
def nfvi_resize_revert_instance(instance_uuid, callback, context=None): cmd_id = _compute_plugin.invoke_plugin('resize_revert_instance', instance_uuid, context, callback=callback) return cmd_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resize(self, old, new):", "def resize(self):\r\n del self.win\r\n self.__create_win()", "def resize(self):\n pass", "def on_parent_resize(self, event):\n #self.resize()\n #self.resize_scaled(drag_rootx=self.resize_frame.winfo_rootx())\n self.resize_scaled(current...
[ "0.6986136", "0.68204737", "0.6661556", "0.63614696", "0.62983406", "0.6171705", "0.6011107", "0.6008451", "0.5987632", "0.5973601", "0.5963438", "0.59527135", "0.5929965", "0.59045684", "0.58809394", "0.5872158", "0.5844432", "0.5821003", "0.5806872", "0.5796652", "0.5757699...
0.56798697
23
Reject an action against an instance
def nfvi_reject_instance_action(instance_uuid, message, context): cmd_id = _compute_plugin.invoke_plugin('reject_instance_action', instance_uuid, message, context) return cmd_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reject(self):\n pass", "def reject(self, responder):\n self._apply_decision(self.Status.REJECTED, responder)", "def on_reject(self):\n self.state = REJECTED\n self._reject()", "def reject(self, message):\n boto_connection = connection.get_connection()\n boto_conn...
[ "0.7002768", "0.64793044", "0.6412309", "0.6220728", "0.6187695", "0.6176384", "0.6163549", "0.6141075", "0.61121845", "0.6057996", "0.603861", "0.598698", "0.5980348", "0.5910807", "0.5905218", "0.5896408", "0.5850485", "0.584049", "0.58146614", "0.5792201", "0.5752381", "...
0.702213
0
Register for instance state change notifications
def nfvi_register_instance_state_change_callback(callback): _compute_plugin.invoke_plugin('register_instance_state_change_callback', callback=callback)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_observers_with_gamestate(self):", "def notify_observers(self, new_gamestate) -> None:", "def notify_subscribers(self, instance, domain, state=None):\n if not self.notifier:\n return\n\n if not state:\n state = instance.state\n\n tups = domain.get_subscrib...
[ "0.69005334", "0.66444683", "0.6622507", "0.6244537", "0.6179251", "0.6133368", "0.6045187", "0.6045187", "0.59814507", "0.59618044", "0.58827865", "0.58645016", "0.5827011", "0.58014655", "0.5761547", "0.5753698", "0.56954235", "0.5668303", "0.5618803", "0.55411404", "0.5514...
0.6628282
2
Register for instance action change notifications
def nfvi_register_instance_action_change_callback(callback): _compute_plugin.invoke_plugin('register_instance_action_change_callback', callback=callback)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nfvi_register_instance_action_callback(callback):\n _compute_plugin.invoke_plugin('register_instance_action_callback',\n callback=callback)", "def on_register(cls):", "def notifyObservers(self):", "def _instance_changed_handler ( self, name, old, new ):\n arg_li...
[ "0.6161295", "0.6089405", "0.59604", "0.59021795", "0.58711416", "0.58598304", "0.5859007", "0.58397067", "0.576684", "0.56879747", "0.5651403", "0.5616433", "0.5599115", "0.5545698", "0.55440086", "0.55440086", "0.55310184", "0.552071", "0.5515812", "0.55045426", "0.5493684"...
0.6844933
0
Register for instance action callback
def nfvi_register_instance_action_callback(callback): _compute_plugin.invoke_plugin('register_instance_action_callback', callback=callback)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nfvi_register_instance_action_change_callback(callback):\n _compute_plugin.invoke_plugin('register_instance_action_change_callback',\n callback=callback)", "def on_register(cls):", "def register(self, callback):\n self.callback = callback", "def add_callback(cal...
[ "0.7074271", "0.69212306", "0.6914295", "0.6678117", "0.65792686", "0.6406543", "0.6396015", "0.6325683", "0.6325683", "0.62563324", "0.6227942", "0.62053627", "0.62053627", "0.61932707", "0.61932707", "0.61932707", "0.61629814", "0.61220556", "0.6121512", "0.6076169", "0.606...
0.7680887
0
Register for instance delete notifications
def nfvi_register_instance_delete_callback(callback): _compute_plugin.invoke_plugin('register_instance_delete_callback', callback=callback)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instance_deleted(sender, instance, **kwargs):\n try:\n if instance.is_registered and not instance.deregister(save=False):\n logger.warn(\"Could not unregister {0} on delete.\".format(\n sender\n ))\n except SNSException:\n # Avoid that invalid arn token ...
[ "0.76734793", "0.68456256", "0.68105817", "0.6704218", "0.6531352", "0.64356196", "0.64344245", "0.6396667", "0.6394052", "0.63885456", "0.6359043", "0.63569456", "0.6322837", "0.6291785", "0.6286276", "0.6241265", "0.6239672", "0.62179923", "0.6175801", "0.6137316", "0.61151...
0.6672126
4
Notify compute host is enabled
def nfvi_notify_compute_host_enabled(host_uuid, host_name, host_personality, callback): cmd_id = _compute_plugin.invoke_plugin('notify_host_enabled', host_uuid, host_name, host_personality, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nfvi_notify_compute_host_disabled(host_uuid, host_name, host_personality,\n callback):\n cmd_id = _compute_plugin.invoke_plugin('notify_host_disabled',\n host_uuid, host_name,\n host_pers...
[ "0.6910246", "0.63405925", "0.6329132", "0.6329132", "0.6197454", "0.6078591", "0.5980807", "0.5833863", "0.5802485", "0.57806736", "0.5662218", "0.5642115", "0.558865", "0.5550963", "0.5544851", "0.55175227", "0.5497251", "0.54892796", "0.5441781", "0.5439356", "0.5438972", ...
0.7718271
0
Notify compute host is disabled
def nfvi_notify_compute_host_disabled(host_uuid, host_name, host_personality, callback): cmd_id = _compute_plugin.invoke_plugin('notify_host_disabled', host_uuid, host_name, host_personality, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nfvi_notify_compute_host_enabled(host_uuid, host_name, host_personality,\n callback):\n cmd_id = _compute_plugin.invoke_plugin('notify_host_enabled',\n host_uuid, host_name,\n host_persona...
[ "0.6590806", "0.65881276", "0.6332107", "0.6331109", "0.6220316", "0.620537", "0.6117578", "0.6104185", "0.6052198", "0.6050748", "0.59577185", "0.58573514", "0.5832847", "0.5814101", "0.5814101", "0.5747102", "0.5736996", "0.57186717", "0.5702843", "0.57011414", "0.5687968",...
0.7907137
0
Disable compute host services
def nfvi_disable_compute_host_services(host_uuid, host_name, host_personality, callback): cmd_id = _compute_plugin.invoke_plugin('disable_host_services', host_uuid, host_name, host_personalit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nfvi_notify_compute_host_disabled(host_uuid, host_name, host_personality,\n callback):\n cmd_id = _compute_plugin.invoke_plugin('notify_host_disabled',\n host_uuid, host_name,\n host_pers...
[ "0.7023965", "0.6589337", "0.65053415", "0.6484101", "0.61595577", "0.6139749", "0.5918607", "0.5901828", "0.58210856", "0.5821036", "0.5794583", "0.57928306", "0.57894987", "0.5775211", "0.5763872", "0.573645", "0.5679011", "0.5662737", "0.56420565", "0.56060183", "0.5554399...
0.79389197
0
Enable compute host services
def nfvi_enable_compute_host_services(host_uuid, host_name, host_personality, callback): cmd_id = _compute_plugin.invoke_plugin('enable_host_services', host_uuid, host_name, host_personality, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nfvi_notify_compute_host_enabled(host_uuid, host_name, host_personality,\n callback):\n cmd_id = _compute_plugin.invoke_plugin('notify_host_enabled',\n host_uuid, host_name,\n host_persona...
[ "0.63588804", "0.63349974", "0.6177922", "0.6154969", "0.61493015", "0.606561", "0.6054695", "0.6049442", "0.60288525", "0.6004999", "0.59542507", "0.58375365", "0.58375365", "0.5803038", "0.57903194", "0.5772306", "0.56935096", "0.567679", "0.5676517", "0.56693524", "0.56370...
0.78876954
0
Initialize the NFVI compute package
def nfvi_compute_initialize(config, pool): global _compute_plugin if _compute_plugin is None: _compute_plugin = NFVIComputePlugin(config['namespace'], pool) if _compute_plugin.ready_to_initialize(config['config_file']): _compute_plugin.initialize(config['config_file']) return True ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(self):\n self.initialize_edges()\n self.initialize_prob()\n self.initialize_total_input_dict()\n\n self.initialize_fpmusigv_dict()", "def main():\n run_nutanix_vm_creation_module()", "def __init__(self, nvim):\n self.nvim = nvim", "def __init__(self,comput...
[ "0.6496471", "0.6278192", "0.6062997", "0.59552294", "0.59278333", "0.5924738", "0.5892015", "0.57887715", "0.5772586", "0.5722492", "0.57131547", "0.5701967", "0.56974494", "0.5684051", "0.56797975", "0.5674536", "0.56544673", "0.56248695", "0.56169355", "0.5615452", "0.5615...
0.7209175
0
Finalize the NFVI compute package
def nfvi_compute_finalize(): if _compute_plugin is not None: _compute_plugin.finalize()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def finalize(self):\n self.classifier.finalize()", "def finalize(self):\n pass\n #fftw2py.clean_fftw_solver(self.output_field.dimension)", "def finalize(self):\n self.report('Finalizing optimization procedure.')\n with self.optimizer() as opt:\n optimal_process_out...
[ "0.6502741", "0.650001", "0.62286294", "0.6211019", "0.6211019", "0.6211019", "0.61800075", "0.6171059", "0.6159695", "0.6159695", "0.61318797", "0.6069689", "0.6061937", "0.60552156", "0.6054228", "0.60331243", "0.60229737", "0.60056174", "0.60056174", "0.60056174", "0.60056...
0.8275187
0
Generate a string representation, mostly for debugging purposes
def __str__(self): return "%s (%s) - atomic number: %d, atomic weight: %g amu" \ % (self.name, self.symbol, self.atomicNumber, self.atomicWeight)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toString():", "def __str__(self):\n astr = '[\\n name: [ ' + self.name + ' ]\\n'\n astr += ' variables: [ '\n for var, init in self.variables:\n astr += '(' + var + ' := ' + init + '), '\n astr = astr[:-2] + ' ]\\n assumptions: [ '\n for assumption in self.ass...
[ "0.7799535", "0.7534602", "0.75197923", "0.74372685", "0.74313945", "0.7339175", "0.73214805", "0.7317239", "0.7267127", "0.72524047", "0.7245168", "0.7245168", "0.7243733", "0.7197564", "0.71928585", "0.7191292", "0.7177097", "0.7144848", "0.7140431", "0.7131467", "0.7127033...
0.0
-1
Testing to provide mandatory parameters only.
def test_minimal_valid(self): config = ShellConfig(script='echo "hello world"') assert_that(config.script, equal_to('echo "hello world"')) assert_that(config.title, equal_to('')) assert_that(config.model, equal_to({})) assert_that(config.env, equal_to({})) assert_that(con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __mandatory_is_not_given(self):\n\n strTestName = 'Mandatory parameter must be given (incorrect)'\n RxCSObject = _RxCSobject()\n\n RxCSObject.paramAddMan('mandatory_parameter', 'Mandatory parameter')\n\n self.__parametersCheck_error(RxCSObject, ParameterMissingError, strTestName)", ...
[ "0.7554485", "0.74413884", "0.74272037", "0.7360469", "0.7131678", "0.71256137", "0.7105869", "0.7097087", "0.70953786", "0.70849353", "0.7079268", "0.70749784", "0.7000165", "0.69736993", "0.69327056", "0.6923329", "0.6904286", "0.68939066", "0.68729466", "0.6848687", "0.682...
0.0
-1
Testing to provide mandatory and all optional parameters.
def test_individual_valid(self, kwargs): # defaults final_kwargs = {'script': 'echo "hello world"', 'title': '', 'debug': False, 'strict': False, 'dry_run': False, 'item': None, 'env': {}, 'model': {}, 'variables': {}} final_kwargs.update(kwargs) config = ShellCo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_checkParameters(self):\n self.failUnlessEqual(self.nice.opts['long'], \"Alpha\")\n self.failUnlessEqual(self.nice.opts['another'], \"Beta\")\n self.failUnlessEqual(self.nice.opts['longonly'], \"noshort\")\n self.failUnlessEqual(self.nice.opts['shortless'], \"Gamma\")", "def c...
[ "0.71258616", "0.68760175", "0.68379354", "0.6795169", "0.6731811", "0.6697062", "0.6688189", "0.6682522", "0.6640285", "0.66375905", "0.6609301", "0.6607212", "0.6594101", "0.657962", "0.6576454", "0.65662366", "0.65466017", "0.65358907", "0.6519866", "0.6510823", "0.6504746...
0.0
-1
If we have multiple projects, will loop through the projects to find the one with the given story. returns None if not found
def find_project_for_story(story_id): for project in Project.all(): story = project.load_story(story_id) if story is not None: return project #Not found print "No project found for story: #{}".format(story_id) return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_project_for_story(story_id):\r\n\r\n for project in Project.all():\r\n story = project.load_story(story_id)\r\n if story is not None:\r\n return project\r\n\r\n #Not found\r\n print \"No project found for story: #{}\".format(story_id)\r\n return None", "def get_proje...
[ "0.84241813", "0.62560344", "0.61722744", "0.60507", "0.59317017", "0.5916581", "0.59009284", "0.587145", "0.5809766", "0.57527995", "0.56877387", "0.56099844", "0.56028783", "0.56005305", "0.5553567", "0.5518918", "0.5457603", "0.53568715", "0.53509325", "0.53243184", "0.530...
0.84125274
1
returns the first label if any from labels. Used for grouping
def first_label(self): if self.labels: return self.labels[0] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first_label(self):\r\n return self.labels.split(',')[0]", "def label(tree):\n return tree[0]", "def getLabel(labels):\r\n elems = {}\r\n for l in labels:\r\n if l not in elems.keys():\r\n elems[l] = 1\r\n else:\r\n elems[l] += 1\r\n counts = sorted(ele...
[ "0.8280834", "0.68157196", "0.6787128", "0.67655355", "0.67253506", "0.6636867", "0.6554082", "0.65352005", "0.65143234", "0.6482284", "0.64466333", "0.64403844", "0.64376044", "0.64165425", "0.6404469", "0.6386726", "0.6379", "0.6357332", "0.6351127", "0.6299424", "0.6292083...
0.851758
0
instantiates a Story object from an elementTree node, build child notes and attachment lists
def from_json(cls, node): story = Story() story.story_id = _parse_int(node, 'id') story.name = _parse_text(node, 'name') story.owned_by = _parse_text(node, 'owned_by') story.story_type = _parse_text(node, 'story_type') story.state = _parse_text(node, 'current_state') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_node(cls, node):\r\n\r\n story = Story()\r\n story.story_id = _parse_text(node, 'id')\r\n story.name = _parse_text(node, 'name')\r\n story.owned_by = _parse_text(node, 'owned_by')\r\n story.story_type = _parse_text(node, 'story_type')\r\n story.state = _parse_text...
[ "0.7573793", "0.6829349", "0.58085346", "0.5662829", "0.5408246", "0.5368695", "0.53291357", "0.529218", "0.5163592", "0.5163557", "0.51551956", "0.5153943", "0.51413214", "0.51333845", "0.51263046", "0.5122783", "0.5116713", "0.5107789", "0.5105426", "0.5062073", "0.5047572"...
0.63884753
2
changes the estimate of a story
def assign_estimate(self, estimate): return self.update(estimate=estimate)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assign_estimate(self, estimate):\r\n update_story_url =\"https://www.pivotaltracker.com/services/v3/projects/{}/stories/{}?story[estimate]={}\".format(self.project_id, self.story_id, estimate)\r\n response = _perform_pivotal_put(update_story_url)", "def estimate(self, estimate):\n\n self...
[ "0.7031372", "0.6343698", "0.6181432", "0.61523265", "0.61381894", "0.61381894", "0.61381894", "0.6072239", "0.6002296", "0.59474117", "0.58674514", "0.5820868", "0.57961833", "0.579501", "0.57798946", "0.5774591", "0.5730863", "0.57292694", "0.57292694", "0.5592835", "0.5579...
0.63049126
2
changes the estimate of a story
def update(self, **payload): update_story_url ="https://www.pivotaltracker.com/services/v5/projects/{}/stories/{}".format(self.project_id, self.story_id) return _perform_pivotal_put(update_story_url, payload)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assign_estimate(self, estimate):\r\n update_story_url =\"https://www.pivotaltracker.com/services/v3/projects/{}/stories/{}?story[estimate]={}\".format(self.project_id, self.story_id, estimate)\r\n response = _perform_pivotal_put(update_story_url)", "def estimate(self, estimate):\n\n self...
[ "0.7031372", "0.6343698", "0.63049126", "0.6181432", "0.61523265", "0.61381894", "0.61381894", "0.61381894", "0.6072239", "0.6002296", "0.59474117", "0.58674514", "0.5820868", "0.57961833", "0.579501", "0.57798946", "0.5774591", "0.5730863", "0.57292694", "0.57292694", "0.559...
0.0
-1