query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Make sure unsupported scf properties are not allowed into a QCSpec.
def test_scf_prop_validation(): with pytest.raises(QCSpecificationError): QCSpec(scf_properties=["ddec_charges"])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_001_validate_with_bad_properties(self):\n m = schematics_flexible.BaseFlexible(\n {'code': '06',\n 'properties': {\"a\": \"this is test\"}},\n store_handler=get_mock())\n try:\n m.validate()\n except schematicsValidationError:\n ...
[ "0.59834945", "0.59595454", "0.5902257", "0.5851644", "0.56773376", "0.5638241", "0.5558134", "0.5544284", "0.55137223", "0.5493592", "0.5489752", "0.5465729", "0.54608876", "0.54575515", "0.54447865", "0.54230374", "0.541588", "0.5413103", "0.5401667", "0.5390509", "0.536294...
0.6854959
0
Find the nearest positivedefinite matrix to input A Python/Numpy port of John D'Errico's `nearestSPD` MATLAB code [1], which credits [2].
def nearestPD(A): B = (A + A.T) / 2 _, s, V = np.linalg.svd(B) H = np.dot(V.T, np.dot(np.diag(s), V)) A2 = (B + H) / 2 A3 = (A2 + A2.T) / 2 if isPD(A3): return A3 spacing = np.spacing(np.linalg.norm(A)) # The above is different from [1]. It appears that MATLAB's `chol` Chol...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_nearest(a, a0):\n idx = np.abs(a - a0).argmin()\n return a.flat[idx]", "def nearest_neighbour(matrix, start=0):\n path = [start]\n while len(matrix) != len(path):\n matrix[:, start] = numpy.inf\n start = numpy.argmin(matrix[start])\n path.append(start)\n return path",...
[ "0.64279723", "0.6390816", "0.63794404", "0.6369756", "0.62929606", "0.6278435", "0.61763453", "0.6163529", "0.6116127", "0.60932505", "0.59658027", "0.59433377", "0.591896", "0.59085405", "0.5890697", "0.5849047", "0.5847796", "0.584322", "0.5802292", "0.5802292", "0.5800049...
0.66940665
0
Compose a label for i'th word of a tree, according to 'fields'. Return a string (possibly multiline).
def _label(tree, node, fields): # Form (always). label = tree.forms(node) # Lemma. if 'lemma' in fields: label += u'\n' + tree.lemmas(node) # Postags. postags = [] if 'cpostag' in fields: postags.append(tree.cpostags(node)) if 'postag' in fields: postags.append(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_label_text(field_name: str, field: dict):\n\n label = \"\"\n if \"required\" in field:\n label = \" * \" if field.get(\"required\") else \"\"\n\n # If we don't have a label defined, used the field name\n if \"label\" not in field:\n field.update({\"label\...
[ "0.65825105", "0.6076069", "0.59696615", "0.5935693", "0.5935261", "0.58478886", "0.58437353", "0.5761943", "0.564017", "0.5549377", "0.5525734", "0.5482963", "0.54392093", "0.5434365", "0.5414149", "0.5410233", "0.53963095", "0.5393825", "0.53839684", "0.53701466", "0.534880...
0.72464603
0
Return label text height. First line is in big font, other lines are in small font.
def _label_height(text): return _BIG_FONT + _SMALL_LINE * text.count(u'\n')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetLabelSize(dc, label, vertical):\r\n\r\n text_width = text_height = 0\r\n\r\n # get the text height\r\n dummy, text_height = dc.GetTextExtent(\"ABCDHgj\")\r\n # get the text width\r\n if label.strip():\r\n text_width, dummy = dc.GetTextExtent(label)\r\n\r\n if vertical:\r\n tm...
[ "0.7271216", "0.71656597", "0.6950726", "0.69150996", "0.68502", "0.68196136", "0.67779195", "0.6538287", "0.64716256", "0.6353686", "0.62325746", "0.6218229", "0.6213206", "0.60821", "0.59820193", "0.59775317", "0.5935517", "0.5899317", "0.58370006", "0.5835381", "0.58216095...
0.8867154
0
Return label text width. Width of a single glyph is considered to be equal to font size. First line is in big font, other lines are in small font.
def _label_width(text): width = 0 for lineno, line in enumerate(text.split(u'\n')): size = [_BIG_FONT, _SMALL_FONT][lineno > 0] # Cool idiom, huh? width = max(width, size * len(line)) return width
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def label_width(self):\n return self._label_width", "def label_width(self, start, end, numlabels=None, char_width=None):\n return self.formatter.estimate_width(start, end, numlabels, char_width,\n ticker=self)", "def width(self, text):\n return l...
[ "0.77487105", "0.75036937", "0.70768744", "0.7019592", "0.7008805", "0.69664294", "0.68807596", "0.679242", "0.6748034", "0.67123944", "0.66297275", "0.65036947", "0.6460371", "0.640202", "0.6389833", "0.6327039", "0.6237472", "0.6214645", "0.6123736", "0.61015725", "0.604933...
0.82819164
0
Return radius of a circular segment of an arc of a given height level.
def _arc_radius(height_in_units): return height_in_units * _ARC_HEIGHT_UNIT / (1 - math.cos(_ANGLE))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def circleCirc(radius):\n radius = float(radius)\n return 2*math.pi*radius", "def get_radius(self):\n if self.no_dist is False:\n dist = self.distance\n radius = (dist * self.ang_size / 60. *\n np.pi/180. * ct._kpc_over_pc_)/2.\n self.radius = ra...
[ "0.7022965", "0.694876", "0.6926556", "0.69203454", "0.68934387", "0.68595546", "0.6837693", "0.68078643", "0.6790736", "0.6790736", "0.67545676", "0.67370695", "0.6680574", "0.6631358", "0.6623361", "0.6594229", "0.65553945", "0.65350884", "0.64718235", "0.64544165", "0.6400...
0.81892455
0
Return minimal horizontal size for an arc of a given "flight level".
def _arc_min_length(height_in_units): return 2 * _arc_radius(height_in_units) * math.sin(_ANGLE)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def minimum_size(self):\n # Size in arcsec\n size = self.seeing.minimum_size()\n try:\n # Try using `intrinsic` as an object\n size = max(self.intrinsic.minimum_size(), size)\n except AttributeError:\n pass\n return size", "def calculate_previou...
[ "0.5729011", "0.5543878", "0.55003494", "0.54918885", "0.5427095", "0.54054224", "0.53995574", "0.5392929", "0.53288615", "0.5295742", "0.528502", "0.52563035", "0.52264947", "0.5151043", "0.51448995", "0.5134441", "0.5106881", "0.50455415", "0.49992964", "0.49982598", "0.498...
0.66271394
0
Draw a vertical "arc from the root" to the node at (x, y). Enclose elements in a .
def _draw_root_arc(file, x, y, height_in_units, deprel, css_class): height = height_in_units * _ARC_HEIGHT_UNIT # Start. file.write(u' <g class="%s">\n' % css_class) # Path. path = 'M %i %i L %i %i' % (x, y, x, y - height) file.write(u' <path d="%s" class="arc" />\n' % path) fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _draw_arc(file, start_x, end_x, y, height_in_units, deprel, css_class):\n height = height_in_units * _ARC_HEIGHT_UNIT\n radius = _arc_radius(height_in_units)\n length = _arc_min_length(height_in_units)\n\n # Start.\n file.write(u' <g class=\"%s\">\\n' % css_class)\n\n # Path.\n path =...
[ "0.64772046", "0.64068234", "0.62226677", "0.61593276", "0.6059894", "0.58969045", "0.58713514", "0.586212", "0.5840232", "0.5805969", "0.57956517", "0.56697184", "0.5667503", "0.5664292", "0.56430775", "0.5603307", "0.5598331", "0.55746675", "0.55711836", "0.55608064", "0.55...
0.7157346
0
Draw an arc from the node at (start_x, y) to the node at (end_x, y). Enclose elements in a .
def _draw_arc(file, start_x, end_x, y, height_in_units, deprel, css_class): height = height_in_units * _ARC_HEIGHT_UNIT radius = _arc_radius(height_in_units) length = _arc_min_length(height_in_units) # Start. file.write(u' <g class="%s">\n' % css_class) # Path. path = ( 'M %.2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arc_n(self, xn ,yn, rn, start, stop):\n x = round(xn * self.width)\n y = round(yn * self.height)\n r = round(rn * min(self.width, self.height))\n self.arc(x, y, r, start, stop)", "def draw_arc(ax, center, height, width, theta1=0, theta2=numpy.pi, color='k', direction='down',\n ...
[ "0.70424855", "0.69551045", "0.6952669", "0.688913", "0.6807394", "0.66460675", "0.6618592", "0.6547217", "0.65388316", "0.6534261", "0.6514192", "0.6471966", "0.64710987", "0.6460161", "0.6459329", "0.6446214", "0.64154017", "0.6335754", "0.63317806", "0.625453", "0.6236552"...
0.7387968
0
Draw an arrow with a tip at (tip_x, tip_y), "attacking" the surface at a given angle.
def _draw_arrow(file, tip_x, tip_y, angle): # Offset the tip. tip_x -= _ARROW_SIZE * 0.2 * math.cos(angle) tip_y += _ARROW_SIZE * 0.2 * math.sin(angle) # Draw the arrow. path = ( 'M %.2f %.2f' 'L %.2f %.2f' 'L %.2f %.2f' 'L %.2f %.2f' 'Z' ) % ( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_arrow(dc, fr, to, tail_angle, tail_length):\r\n end_x, end_y = to[0], to[1]\r\n vec = -(to - fr)\r\n vec = vec.normalized()\r\n tail_1 = vec.rotated(tail_angle) * tail_length\r\n tail_2 = vec.rotated(-tail_angle) * tail_length\r\n dc.DrawLine(end_x, end_y, end_x+tail_1[0], end_y+tail_1[1...
[ "0.6208793", "0.60975254", "0.60448563", "0.60122025", "0.5948734", "0.5920215", "0.5909208", "0.5828393", "0.57645756", "0.5744468", "0.5715196", "0.5706364", "0.56345356", "0.56342465", "0.5627154", "0.5548939", "0.54402685", "0.5438652", "0.53856605", "0.5363015", "0.53515...
0.7083311
0
Run task on specified `builder`.
def run(self, builder, retry): time_start = time.time() self.date_start = utils.strdate() if self.require: raise TaskDependenciesError("Task {} can't run. Requires {}"\ .format(self.tid, ', '.join(self.require))) try: self.results = getattr(builde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self, builder):\n\n # Change to the test directory\n os.chdir(builder.stage_dir)\n self.logger.debug(f\"Changing to directory {builder.stage_dir}\")\n\n run_cmd = self.cmd + [os.path.basename(builder.build_script)]\n run_cmd = \" \".join(run_cmd)\n\n # ---------- S...
[ "0.59340215", "0.59032077", "0.5841938", "0.58288544", "0.57701546", "0.56623113", "0.54032415", "0.5359394", "0.5356444", "0.53439844", "0.5296021", "0.528549", "0.52820635", "0.5263518", "0.52304286", "0.5229381", "0.5182776", "0.5178227", "0.5171122", "0.5161379", "0.51545...
0.6643704
0
Is the task runnable
def is_runnable(self): return self.state == self.STATE_INIT and not self.require
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_runnable(self):\n \n if len(target_tasks) < 1: \n return False\n # check task names?\n \n if self.run_folder is None or \\\n not os.path.exists(self.run_folder) or \\\n not os.path.exists(os.path.join(self.run_folder, self.run_id, 'SampleSh...
[ "0.73557484", "0.71910566", "0.71346843", "0.6990803", "0.6896121", "0.6896121", "0.6868695", "0.67810875", "0.6776982", "0.66866755", "0.6680824", "0.665087", "0.66431415", "0.66022867", "0.6563005", "0.6540378", "0.65363276", "0.6515555", "0.6485275", "0.6474582", "0.645360...
0.7445494
0
Update task childs When a task state changes, update childs. If the task success, remove dependencies on childs otherwise mark childs states with STATE_DEPENDENCY
def update_childs(self, _tasks): tasks = copy.deepcopy(_tasks) for child in tasks.keys(): # only process init state tasks if tasks[child].state != self.STATE_INIT: continue # if erased and none if not tasks[child].require: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, request, pk=None):\n child_task = self.get_object()\n serializer = ChildTaskSerializer(data=request.data)\n parent_task_id = serializer.data['parent_task_id']\n if serializer.is_valid():\n # Request passed validation.\n response = super(ChildTaskVi...
[ "0.66115755", "0.61238635", "0.59749055", "0.587335", "0.57489765", "0.5735887", "0.57200396", "0.5662248", "0.56386054", "0.56310064", "0.56048024", "0.5558004", "0.5553909", "0.5491969", "0.54777765", "0.5447478", "0.5438334", "0.5404273", "0.5398509", "0.5397731", "0.53831...
0.75299466
0
Helper function for querying newest predictors
def get_predictors(newest=True, **kwargs): if newest: predictor_ids = db.session.query( func.max(Predictor.id)).group_by(Predictor.name) else: predictor_ids = db.session.query(Predictor.id) if 'run_id' in kwargs: # This following JOIN can be slow predictor_ids = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status_quo_model(X):\n\n def mostrecent(x):\n x = x[x.notnull()]\n if len(x) > 0:\n return x.iloc[-1]\n else:\n return 0\n preds = X.apply(mostrecent, axis=1)\n\n return preds", "def get_latest_model():\n return get_models()[-1]", "def fetch_latest_rou...
[ "0.6160301", "0.57882196", "0.5635682", "0.54638565", "0.54508704", "0.5402498", "0.53701395", "0.5270943", "0.5247883", "0.5204437", "0.51682633", "0.5162629", "0.5126087", "0.50463015", "0.5031413", "0.5011624", "0.5008288", "0.50078815", "0.49992976", "0.4983294", "0.49757...
0.6798848
0
Decorator for multiple trial of the test case. The decorated test case is launched multiple times. The case is judged as passed at least specified number of trials. If the number of successful trials exceeds `min_success`, the remaining trials are skipped.
def repeat_with_success_at_least(times, min_success): assert times >= min_success def _repeat_with_success_at_least(f): @functools.wraps(f) def wrapper(*args, **kwargs): assert len(args) > 0 instance = args[0] assert isinstance(instance, unittest.TestCase) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test(numTrials):\n # Your Code Here\n hits = 0.0\n for i in range(numTrials):\n result = trial()\n #print result\n hits += result\n return hits / numTrials", "def main(num_trials, num_actions):\n\tfor i in xrange(int(num_trials)):\n\t\ttrial(i+1, int(num_actions))", "def th...
[ "0.61784405", "0.61314857", "0.596407", "0.59254247", "0.5910247", "0.58234215", "0.58015466", "0.5779273", "0.5725785", "0.57112896", "0.565361", "0.55590385", "0.5535777", "0.5398447", "0.53845537", "0.5376214", "0.5375111", "0.5372522", "0.5372075", "0.53648865", "0.536413...
0.7441564
0
Check field to win
def check_win(game_field): if (game_field[0] != ' ') and (game_field[0] == game_field[1] == game_field[2]): return game_field[0] elif (game_field[3] != ' ') and (game_field[3] == game_field[4] == game_field[5]): return game_field[3] elif (game_field[6] != ' ') and (game_field[6] == game_fiel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def WinCheck(field):\n for i in range(len(field)):\n if field[i] == 2048:\n return True\n return False", "def hasWin(self) :\n comparison = self.compareNumberUser()\n if (comparison == 'equal') :\n return True\n else :\n return False", "def _ch...
[ "0.6859255", "0.64502525", "0.64117455", "0.6401923", "0.6345855", "0.62657017", "0.62467015", "0.62204844", "0.62164706", "0.6021899", "0.5994172", "0.59842855", "0.59764385", "0.5944389", "0.593727", "0.5928098", "0.5926611", "0.59181637", "0.59166956", "0.58986425", "0.589...
0.6655412
1
receive user input and return move key or confirm choice
def user_input(): key = input('Move position or press y to do turn: ') if key == 'w' or 's' or 'd' or 'a' or 'y': return key elif key == 'h': print('There is no help yet') else: print('Need help? Press "h"') return user_input()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_choice():\n move = input('Where would you like to move? (Use N, S, E, W to move North, South, East or West.) \\n')\n return move.capitalize()", "def askMove(self,posibleMoves):\n print(\"Where will you move?\")\n while True:\n pos = raw_input(\"Type Colum and Row 'CR' Ex:a...
[ "0.70844096", "0.68121403", "0.6759099", "0.6759018", "0.6693364", "0.6693364", "0.6693364", "0.6686266", "0.66857535", "0.6581062", "0.652651", "0.65197897", "0.6514418", "0.64933616", "0.64899606", "0.6466338", "0.64507335", "0.64295095", "0.6406177", "0.6397167", "0.638439...
0.70637566
1
scale the input image to the specific size by using bilinear interpolation
def scale(input_img, size): width, height = size old_height, old_width = input_img.shape x_scale = float(height) / old_height y_scale = float(width) / old_width output_img = np.zeros((height, width), dtype=np.uint8) for xidx in xrange(height): old_x = float(xidx) / x_scale for y...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scale_image(self, pixels, size):\n x_min, x_max = np.amin(pixels[:,0]), np.amax(pixels[:,0])\n y_min, y_max = np.amin(pixels[:,1]), np.amax(pixels[:,1])\n z_min, z_max = np.amin(pixels[:,2]), np.amax(pixels[:,2])\n \n pixels[:,0] -= x_min \n pixels[:,1] -= y_min\n ...
[ "0.7530757", "0.7487166", "0.7231397", "0.710274", "0.6902195", "0.68922347", "0.67708784", "0.67459106", "0.6726698", "0.67057925", "0.6663453", "0.6641842", "0.65853053", "0.65753484", "0.65709734", "0.6562367", "0.65519804", "0.655139", "0.65492624", "0.64551073", "0.64065...
0.804545
0
Extract the parameters from all the base classes to support inheritance of Structures.
def get_base_info(bases): bases_params = OrderedDict() bases_required = [] base_structures = [ base for base in bases if issubclass(base, Structure) and base is not Structure ] for base in base_structures: for k, param in getattr(base, "__signature__").parameters.items(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_params(cls):\n the_classes = cls.mro()\n params = odict()\n for the_class in the_classes:\n for key, val in the_class.__dict__.items():\n if isinstance(val, Parameter):\n params[key] = val\n return params", "def _get_derived_parame...
[ "0.6480872", "0.6387825", "0.6387825", "0.6316849", "0.5984677", "0.5930033", "0.5876679", "0.58338517", "0.58183604", "0.5752015", "0.5737816", "0.5660116", "0.5644318", "0.56097096", "0.55356723", "0.5527715", "0.5501345", "0.54906714", "0.54674923", "0.54569507", "0.544304...
0.70361996
0
Parses a list of path names for path keys.
def _parse_path(p_names): gnmi_elems = [] for word in p_names: word_search = _RE_PATH_COMPONENT.search(word) if not word_search: # Invalid path specified. raise XpathError('xpath component parse error: %s' % word) if word_search.group('key') is not None: # A path key was provided. tmp_key ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ParsePath(p_names: Iterable[Text]) -> gnmi_pb2.Path:\n gnmi_elems = []\n for word in p_names:\n word_search = _RE_PATH_COMPONENT.search(word)\n if not word_search: # Invalid path specified.\n raise XpathError('xpath component parse error: %s' % word)\n if word_search.group('key') is not None: ...
[ "0.6744838", "0.643762", "0.6129683", "0.6027652", "0.5850749", "0.5803134", "0.5716737", "0.56847453", "0.56610566", "0.56403434", "0.56000715", "0.55541354", "0.5528111", "0.552703", "0.5489616", "0.5481644", "0.5437132", "0.5436902", "0.54319805", "0.542672", "0.54056877",...
0.7012274
0
All this really does is add the devices into a python list! Parses the xpath names. This takes an input string and converts it to a list of gNMI Path names. Those are later turned into a gNMI Path Class object for use in the Get/SetRequests.
def _path_names(xpath): if not xpath or xpath == '/': # A blank xpath was provided at CLI. return [] return xpath.strip().strip('/').split('/') # Remove leading and trailing '/'. For example it turns it into ['interfaces', 'interface[name=Ethernet1]', 'state', 'counters']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_path(p_names):\n gnmi_elems = []\n for word in p_names:\n word_search = _RE_PATH_COMPONENT.search(word)\n if not word_search: # Invalid path specified.\n raise XpathError('xpath component parse error: %s' % word)\n if word_search.group('key') is not None: # A path key was provided.\n ...
[ "0.60383373", "0.58014375", "0.5726008", "0.56360483", "0.55687326", "0.55472445", "0.5278853", "0.5220772", "0.5136307", "0.51119274", "0.5111663", "0.5092509", "0.5083667", "0.50776213", "0.5030007", "0.5019841", "0.4971111", "0.49702564", "0.49412", "0.49258375", "0.490256...
0.64530164
0
Creates a gNMI Stub.
def _create_stub(target, port): channel = gnmi_pb2_grpc.grpc.insecure_channel(target + ':' + port) return gnmi_pb2_grpc.gNMIStub(channel)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createRotoNodeMI():\n return gs()", "def CreateStub(creds: grpc.ssl_channel_credentials,\n target: Text,\n port: Text,\n host_override: Optional[Text] = None) -> gnmi_pb2_grpc.gNMIStub:\n if host_override:\n channel = grpc.secure_channel(target + ':' + port, c...
[ "0.61915773", "0.6070097", "0.6048654", "0.5815189", "0.5606532", "0.54397595", "0.54164815", "0.536739", "0.5323115", "0.5196695", "0.51673496", "0.51654017", "0.51477623", "0.5134972", "0.5129161", "0.50861603", "0.5079436", "0.50461864", "0.50413865", "0.5032544", "0.50237...
0.73616546
0
DTW distance of match. This value is dependent on the length of the query. Use the value property when comparing queries of different lengths.
def distance(self): return self.value * len(self.alignment.query)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(self) -> float:\n return self._dist_two_wire() # at this time we only support 2-wire meausre", "async def distance(self):\n return round(await self._rpc.distance(), 2)", "def get_distance(self) -> int:\n return self.get_measurement_data().distance", "def distance(self):\n ...
[ "0.6928184", "0.68774277", "0.6728091", "0.66035616", "0.65458184", "0.65157306", "0.64634323", "0.6341544", "0.6227368", "0.6217934", "0.6202405", "0.6184627", "0.61629593", "0.6140443", "0.6025408", "0.5916094", "0.59097636", "0.59070665", "0.59023696", "0.58621186", "0.585...
0.72271866
0
Get matrix with all warping paths. If the aligmnent was computed using a compact, the paths are first copied into a full warping paths matrix.
def warping_paths(self): return self.paths
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def OptimalWarpingPath( self, colStart=None ):\n rows = len(self.D)\n cols = len(self.D[0])\n n = rows-1\n m = cols-1\n if colStart:\n m=colStart\n path = [(n,m)]\n while n > 0 or m > 0:\n if n == 0 :\n path.insert(0,(0,m-1))\n ...
[ "0.57083774", "0.55504566", "0.5493086", "0.5358879", "0.534058", "0.5296055", "0.5175524", "0.51565313", "0.5116445", "0.5079303", "0.50442624", "0.5040348", "0.50351185", "0.5022339", "0.50113636", "0.49944746", "0.49744827", "0.49310946", "0.4899484", "0.48985958", "0.4893...
0.61657995
0
Yields the next best match. Stops at k matches (use None for all matches).
def kbest_matches(self, k=1, overlap=0): self.align() matching = np.array(self.matching) maxv = np.ceil(np.max(matching) + 1) matching[:min(len(self.query) - 1, overlap)] = maxv ki = 0 while k is None or ki < k: best_idx = np.argmin(matching) if be...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kbest_matches(self, k=1):\n self.align(k=k)\n # if k is None:\n # return [SSMatch(best_idx, self) for best_idx in range(len(self.distances))]\n # if self.keep_all_distances:\n # best_idxs = np.argpartition(self.distances, k)\n # return [SSMatch(best_idx, se...
[ "0.70543814", "0.6908173", "0.63451654", "0.6075485", "0.58968025", "0.58009946", "0.57997376", "0.5776829", "0.57495296", "0.5703111", "0.556711", "0.556711", "0.55580676", "0.55529094", "0.55048394", "0.54525316", "0.54502773", "0.5401287", "0.53894967", "0.5379987", "0.535...
0.764717
0
Index in series for end of match in matching function at idx.
def matching_function_endpoint(self, idx): if len(self.matching) == len(self.series): return idx diff = len(self.series) - len(self.matching) return idx + diff
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matching_function_startpoint(self, idx):\n real_idx = idx + 1\n path = dtw.best_path(self.paths, col=real_idx)\n start_idx = path[0][1]\n return start_idx", "def return_index(self, idx):\n return (\n self.timeseries[:, idx],\n self.ch_amount,\n ...
[ "0.6543316", "0.6367245", "0.6301939", "0.6193361", "0.6084704", "0.604178", "0.6038365", "0.59744316", "0.5873895", "0.5802779", "0.5789299", "0.57315546", "0.5716819", "0.5716819", "0.5716819", "0.5696154", "0.56579256", "0.5647888", "0.5644456", "0.5643995", "0.5639753", ...
0.76498044
0
Index in series for start of match in matching function at idx.
def matching_function_startpoint(self, idx): real_idx = idx + 1 path = dtw.best_path(self.paths, col=real_idx) start_idx = path[0][1] return start_idx
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matching_function_endpoint(self, idx):\n if len(self.matching) == len(self.series):\n return idx\n diff = len(self.series) - len(self.matching)\n return idx + diff", "def return_index(self, idx):\n return (\n self.timeseries[:, idx],\n self.ch_amou...
[ "0.73175603", "0.6497857", "0.6373355", "0.63612413", "0.6209229", "0.6074658", "0.59414655", "0.5822107", "0.58188355", "0.5815306", "0.57833564", "0.5764828", "0.5758278", "0.5715285", "0.5713959", "0.56651026", "0.5658479", "0.565782", "0.5641599", "0.56098294", "0.5585502...
0.76478
0
Indices in series for best path for match in matching function at idx.
def matching_function_bestpath(self, idx): real_idx = idx + 1 path = dtw.best_path(self.paths, col=real_idx) return path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matching_function_startpoint(self, idx):\n real_idx = idx + 1\n path = dtw.best_path(self.paths, col=real_idx)\n start_idx = path[0][1]\n return start_idx", "def matching_function_endpoint(self, idx):\n if len(self.matching) == len(self.series):\n return idx\n ...
[ "0.6690884", "0.6565373", "0.6028413", "0.5854189", "0.56420803", "0.5517227", "0.5480761", "0.5445093", "0.543877", "0.5414658", "0.540015", "0.53611726", "0.53540796", "0.5341432", "0.53364134", "0.53286445", "0.52923155", "0.52770895", "0.5264886", "0.5238736", "0.52386314...
0.68909335
0
Local concurrences, see LocalConcurrences.
def local_concurrences(series1, series2=None, gamma=1, tau=0, delta=0, delta_factor=1, estimate_settings=None, only_triu=False, penalty=None, window=None): lc = LocalConcurrences(series1, series2, gamma, tau, delta, delta_factor, only_triu=only_triu, penalty=penalty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_local_school_composition(self):\n # get the composition of the students in the neighbourhood\n\n local_composition = get_counts_util(students=self.students, model=self.model)\n\n self.local_composition = local_composition\n\n self.current_capacity = np.sum(self.local_composition...
[ "0.60490185", "0.60490185", "0.60156554", "0.565439", "0.5614832", "0.5524443", "0.53362507", "0.5183139", "0.5157542", "0.51443374", "0.51101583", "0.51035136", "0.50987923", "0.5077436", "0.5068534", "0.505619", "0.5055168", "0.5046074", "0.5033463", "0.50281024", "0.501018...
0.60815006
0
Return the ith value from the kbest values.
def get_ith_value(self, i): if self.distances is None or self.k is None: raise ValueError('Align should be called before asking for the i-th value.') if i > self.k: raise ValueError('The i-th value is not available, i={}>k={}'.format(i, self.k)) return self.kbest_distance...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Kbest(kbest_init, kbest, i, iter_number, all_iter_number=None):\n iter_number = iter_number if all_iter_number is None else all_iter_number\n d = iter_number / kbest_init\n nkbest = math.ceil(abs(kbest_init - i/d))\n return nkbest", "def get_n_best(self):\n pass", "def best_value(self):\...
[ "0.683538", "0.66753155", "0.6674319", "0.64500123", "0.63540584", "0.63536274", "0.63132733", "0.62678784", "0.6219374", "0.6204914", "0.6191994", "0.6184342", "0.6169411", "0.6162491", "0.6113362", "0.60936606", "0.6074645", "0.60177016", "0.6013775", "0.6009977", "0.600826...
0.7239786
0
Return the k best matches. It is recommended to set k to a value, and not None. If k is set to None, all comparisons are kept and returned. Also no early stopping is applied in case k is None.
def kbest_matches(self, k=1): self.align(k=k) # if k is None: # return [SSMatch(best_idx, self) for best_idx in range(len(self.distances))] # if self.keep_all_distances: # best_idxs = np.argpartition(self.distances, k) # return [SSMatch(best_idx, self) for bes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kbest_matches(self, k=1, overlap=0):\n self.align()\n matching = np.array(self.matching)\n maxv = np.ceil(np.max(matching) + 1)\n matching[:min(len(self.query) - 1, overlap)] = maxv\n ki = 0\n while k is None or ki < k:\n best_idx = np.argmin(matching)\n ...
[ "0.75734186", "0.69651777", "0.64580584", "0.62036735", "0.6153091", "0.61466444", "0.5955852", "0.5941158", "0.5936029", "0.5909154", "0.5865215", "0.58565974", "0.58123106", "0.58104837", "0.58069605", "0.5760755", "0.5758019", "0.5743457", "0.57420886", "0.57395303", "0.57...
0.74664825
1
id the location record id Returns a JSON array of records which link to the specified location
def location_links(): try: record_id = request.args[0] except: item = s3xrc.xml.json_message(False, 400, "Need to specify a record ID!") raise HTTP(400, body=item) try: # Shortcut locations = db.gis_location deleted = (locations.deleted == False) qu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_location_by_id(self, location_id):", "def get_locations_by_ids(self, id_list):", "def get_locations(self, id_):\n with self._db_connection() as connection:\n return connection.get_locations(id_)", "def get_record(self, id: uplink.Path):\n pass", "def get(self, lid=None):\n ...
[ "0.67174894", "0.6008066", "0.58011514", "0.57892656", "0.5722104", "0.57062936", "0.5673444", "0.56674194", "0.5475068", "0.53737307", "0.5360654", "0.53458697", "0.5334068", "0.5311456", "0.5299961", "0.5287552", "0.5255019", "0.525247", "0.52420944", "0.5201093", "0.520053...
0.69435656
0
Map Service Catalogue. Allows selection of which Layers are active.
def map_service_catalogue(): if deployment_settings.get_security_map() and not s3_has_role("MapAdmin"): unauthorised() subtitle = T("List Layers") # Start building the Return with the common items output = dict(subtitle=subtitle) # Hack: We control all perms from this 1 table table = d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addServices(self):\r\n self.addHendrix()\r\n\r\n if not self.options.get('global_cache') and not self.options.get('nocache'):\r\n self.addLocalCacheService()\r\n\r\n if self.is_secure:\r\n self.addSSLService()\r\n\r\n self.catalogServers(self.hendrix)", "def ...
[ "0.56927997", "0.5558211", "0.5455615", "0.5436424", "0.5423937", "0.5407362", "0.5387539", "0.53662133", "0.531283", "0.52958256", "0.5293356", "0.5290555", "0.5283825", "0.5283825", "0.5278759", "0.52735716", "0.5246372", "0.52412826", "0.5204378", "0.5197035", "0.51858264"...
0.7492633
0
Map Viewing Client. UI for a user to view the overall Maps with associated Features
def map_viewing_client(): # Read configuration settings config = gis.get_config() if config.opt_gis_layout == 1: window = True else: window = False # @ToDo Make Configurable toolbar = True map = define_map(window=window, toolbar=toolbar, config=config) response.title ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_map(self):\n self.m1.display()", "def view_map():\n print(\"\"\"\n ____________________________________Client Rooms______________________\n| |1 Locker Rooms 2| 1 | 2 | |\n| |_________ ________| | | Dance |\n| ...
[ "0.7127541", "0.67286265", "0.6691963", "0.6657234", "0.6594132", "0.6563301", "0.6557549", "0.65367615", "0.6368804", "0.6324405", "0.63240755", "0.6310753", "0.6295974", "0.6293221", "0.6289974", "0.6289065", "0.6267285", "0.62239516", "0.6221713", "0.62063324", "0.6203795"...
0.7959577
0
Call a Geocoder service
def geocode(): if "location" in request.vars: location = request.vars.location else: session.error = T("Need to specify a location to search for.") redirect(URL(r=request, f="index")) if "service" in request.vars: service = request.vars.service else: # @ToDo: se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geocoding(address, API_KEY=API_KEY, GEOCODE_API_URL=GEOCODE_API_URL):\n # define the parameters of the search\n params = {\n 'address': '{}'.format(address),\n 'key': API_KEY\n }\n\n # Do the request and get the response data\n response = requests.get(GEOCODE_API_URL, params=params)\n r...
[ "0.67605937", "0.66416836", "0.6609462", "0.64985216", "0.63995135", "0.6378873", "0.6299485", "0.62925833", "0.6129592", "0.60888636", "0.60519594", "0.6046673", "0.602397", "0.5928912", "0.59067833", "0.59050494", "0.58398014", "0.5806385", "0.5775408", "0.577366", "0.57714...
0.70826596
0
Custom View for the Potlatch2 OpenStreetMap editor
def potlatch2(): if request.args(0) == "potlatch2.html": osm_oauth_consumer_key = deployment_settings.get_osm_oauth_consumer_key() osm_oauth_consumer_secret = deployment_settings.get_osm_oauth_consumer_secret() if osm_oauth_consumer_key and osm_oauth_consumer_secret: gpx_url = N...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_map():\n print(\"\"\"\n ____________________________________Client Rooms______________________\n| |1 Locker Rooms 2| 1 | 2 | |\n| |_________ ________| | | Dance |\n| | | |__| |__| Fl...
[ "0.5956941", "0.5876095", "0.5870691", "0.5804954", "0.57842386", "0.57654804", "0.5738355", "0.5679043", "0.5668454", "0.5618465", "0.55423635", "0.55370593", "0.547862", "0.54725426", "0.54639965", "0.54085356", "0.54077595", "0.5403992", "0.5376458", "0.5351264", "0.534027...
0.6068055
0
Test new OpenLayers functionality in a RAD environment currently being used to trial using GeoJSON for internal feature layers
def test2(): # Internal Feature Layers feature_queries = [] feature_layers = db(db.gis_layer_feature.resource == "office").select() for layer in feature_layers: if layer.role_required and not auth.s3_has_role(layer.role_required): continue _layer = gis.get_feature_layer(laye...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_product():\n\n fiveconfigure.debug_mode = True\n import collective.geo.openlayers\n zcml.load_config('configuretest.zcml', collective.geo.openlayers)\n\n fiveconfigure.debug_mode = False", "def test_layer_API(self):\n\n # Exceptions\n exclude = ['get_topN', 'get_bins',\n ...
[ "0.654739", "0.6299019", "0.6127946", "0.58873796", "0.57860696", "0.5783082", "0.5711746", "0.56842566", "0.5647381", "0.56204945", "0.559212", "0.55821013", "0.5580289", "0.55746514", "0.557363", "0.5571923", "0.553894", "0.55071616", "0.5482145", "0.5464055", "0.54393184",...
0.7514468
0
Consulta el tiempo actual.
def __call__(self): if self.funciona: t = self.timeFunc() - self.t0 - self.retraso elif self.t0!=None: t = self.parada - self.t0 - self.retraso else: t = None return t
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def TempsCotxe(matricula):\n con=lite.connect('parking.db')\n cursor=con.cursor()\n try:\n cursor.execute(\"SELECT (strftime('%s',DATETIME('now'))-strftime('%s',entrada))/60 from parking where id_cotxe=?\",(matricula,))\n row=cursor.fetchone()\n if row:\n if row[0] < 60:\n ...
[ "0.591941", "0.56388557", "0.56071705", "0.556373", "0.55624765", "0.5506412", "0.5460353", "0.5383823", "0.5344067", "0.5318034", "0.52971244", "0.5287082", "0.52630705", "0.5252758", "0.5242119", "0.5242119", "0.5242119", "0.5242119", "0.5242119", "0.5241725", "0.5206754", ...
0.5652158
1
Determine if it is an atomic term (e.g. "A") or a statement/compound term (e.g. (&&,A,B,..) or (A > B)) or variable term and creates the corresponding Term.
def from_string(cls, term_string): term_string = term_string.replace(" ", "") if term_string in cls.term_dict: return cls.term_dict[term_string] if term_string[0] == NALSyntax.StatementSyntax.Start.value: """ Compound or Statement Term """ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_term(s, ctx, mctx, ops):\n s = strip_parens(s.strip())\n if re.search(\"^\\w*$\",s): # If a single word, either a variable or a constant\n if s in ops:\n return Con(ops[s], [], ctx, mctx)\n elif s in ctx:\n return Var(s, ctx, mctx)\n elif s in mctx:\n ...
[ "0.6580291", "0.61413693", "0.6123516", "0.60709804", "0.6037164", "0.59499276", "0.5909678", "0.57880825", "0.5784058", "0.5760817", "0.5713413", "0.56021833", "0.5593748", "0.556113", "0.5538992", "0.550548", "0.5455731", "0.5445209", "0.5441471", "0.54201454", "0.5406824",...
0.72168934
0
Recursively calculate the syntactic complexity of the compound term. The connector adds 1 complexity, and the subterms syntactic complexities are summed as well.
def _calculate_syntactic_complexity(self): count = 0 if self.connector is not None: count = 1 # the term connector for subterm in self.subterms: count = count + subterm._calculate_syntactic_complexity() return count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _calculate_syntactic_complexity(self):\n count = 1 # the copula\n for subterm in self.subterms:\n count = count + subterm._calculate_syntactic_complexity()\n\n return count", "def _calculate_complexity(workflow):\n complexity = estimate_complexity(workflow.type_, workflow....
[ "0.7616266", "0.5851079", "0.58404595", "0.5798227", "0.5710593", "0.5690459", "0.5667346", "0.55477387", "0.54747677", "0.5441864", "0.5319728", "0.5311709", "0.52989227", "0.5249006", "0.5198195", "0.51958025", "0.51696", "0.51376545", "0.50467896", "0.5002992", "0.4932325"...
0.79506034
0
Create a compound term from a string representing a compound term
def from_string(cls, compound_term_string): compound_term_string = compound_term_string.replace(" ", "") subterms, connector, intervals = cls.parse_toplevel_subterms_and_connector(compound_term_string) return cls(subterms, connector,intervals=intervals)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_string(cls, term_string):\n term_string = term_string.replace(\" \", \"\")\n\n if term_string in cls.term_dict:\n return cls.term_dict[term_string]\n\n if term_string[0] == NALSyntax.StatementSyntax.Start.value:\n \"\"\"\n Compound or Statement Ter...
[ "0.7619937", "0.6340459", "0.62865704", "0.622182", "0.6211368", "0.6205652", "0.6153318", "0.60456955", "0.58313286", "0.57834095", "0.5756795", "0.5701587", "0.56921804", "0.55409914", "0.5532965", "0.5528887", "0.5520905", "0.54063135", "0.54001784", "0.53797454", "0.53685...
0.75882727
1
Parse out all toplevel subterms from a string representing a compound term compound_term_string a string representing a compound term
def parse_toplevel_subterms_and_connector(cls, compound_term_string): compound_term_string = compound_term_string.replace(" ","") subterms = [] intervals = [] internal_string = compound_term_string[1:-1] # string with no outer parentheses () or set brackets [], {} # check for in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_string(cls, compound_term_string):\n compound_term_string = compound_term_string.replace(\" \", \"\")\n subterms, connector, intervals = cls.parse_toplevel_subterms_and_connector(compound_term_string)\n return cls(subterms, connector,intervals=intervals)", "def parse(self, string, r...
[ "0.7481961", "0.6179253", "0.6024916", "0.58284104", "0.58159286", "0.57567114", "0.55579245", "0.54866225", "0.54343325", "0.54079", "0.5405899", "0.53275555", "0.53219724", "0.5318563", "0.5275198", "0.5262341", "0.52378106", "0.523213", "0.5202051", "0.50821346", "0.507025...
0.8231147
0
Recursively calculate the syntactic complexity of the compound term. The connector adds 1 complexity, and the subterms syntactic complexities are summed as well.
def _calculate_syntactic_complexity(self): count = 1 # the copula for subterm in self.subterms: count = count + subterm._calculate_syntactic_complexity() return count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _calculate_syntactic_complexity(self):\n count = 0\n if self.connector is not None:\n count = 1 # the term connector\n for subterm in self.subterms:\n count = count + subterm._calculate_syntactic_complexity()\n return count", "def _calculate_complexity(workfl...
[ "0.79503584", "0.58502394", "0.5840956", "0.5799161", "0.57101554", "0.569104", "0.56670165", "0.55476683", "0.54750997", "0.544209", "0.53206456", "0.5311971", "0.5299383", "0.5250163", "0.51982045", "0.51967955", "0.51698494", "0.5137146", "0.50471324", "0.50033426", "0.493...
0.7616813
1
Returns the term's string with intervals.
def _create_formatted_string_with_interval(self): if isinstance(self.get_subject_term(),StatementTerm) or isinstance(self.get_subject_term(),CompoundTerm): string = NALSyntax.StatementSyntax.Start.value + \ self.get_subject_term().get_formatted_string_with_interval() els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n value = []\n for term in self.terms:\n value += [term.termname]\n return '<formula: %s>' % ' + '.join(value)", "def __str__(self):\n value = []\n for term in self.terms:\n value += [term.termname]\n return '<formula: %s>' % ' + ...
[ "0.63082343", "0.63082343", "0.6038259", "0.5892248", "0.57218105", "0.5709738", "0.5613051", "0.5574001", "0.5551552", "0.55436116", "0.54802537", "0.5458659", "0.5458", "0.54380184", "0.54280454", "0.5421883", "0.5411787", "0.53858435", "0.53813004", "0.53752476", "0.535993...
0.71998906
0
Simplifies a term and its subterms, using NAL Theorems.
def simplify(term): simplified_term = term if isinstance(term,StatementTerm): simplified_term = StatementTerm(subject_term=simplify(term.get_subject_term()), predicate_term=simplify(term.get_predicate_term()), copula=term.get_copula(), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simplify(self, text: str):\n # sanitise the input, remove common words and swap out similar words\n text = self.sanitise(text)\n # Decided not to use stopwords because that would take out too many and then get false positives\n common_words = [\"what\", \"i\", \"you\", \"do\", \"a\"...
[ "0.58145285", "0.57417417", "0.5672962", "0.5574244", "0.5386782", "0.52982134", "0.5281623", "0.5270715", "0.5269361", "0.524937", "0.5215512", "0.519514", "0.5169542", "0.51584274", "0.5112584", "0.5109358", "0.51056045", "0.5094979", "0.5041347", "0.5013541", "0.50019133",...
0.6677275
0
cve services doesn't accept id reservation with blank parameters
def test_post_cve_id_empty_params(reg_user_headers): res = requests.post( f'{env.AWG_BASE_URL}{CVE_ID_URL}', headers=reg_user_headers, params={ 'amount': '', 'batch_type': '', 'cve_year': '', 'short_name': '' } ) # NOTE: there i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_cve_id_empty_parameters(reg_user_headers):\n res = requests.get(\n f'{env.AWG_BASE_URL}{CVE_ID_URL}',\n headers=reg_user_headers,\n params={\n 'page': ' ',\n 'state': ' ',\n 'cve_id_year': ' ',\n 'time_reserved.lt': ' ',\n ...
[ "0.61553484", "0.58308715", "0.573636", "0.566231", "0.5647734", "0.56073105", "0.55616593", "0.5545219", "0.54743046", "0.54703945", "0.54675317", "0.5464173", "0.5453533", "0.5425584", "0.53871393", "0.53465134", "0.53299", "0.5293856", "0.52780175", "0.52433264", "0.521291...
0.583669
1
cve services rejects empty year
def test_post_cve_id_empty_year(reg_user_headers): res = requests.post( f'{env.AWG_BASE_URL}{CVE_ID_URL}', headers=reg_user_headers, params={ 'amount': '10', 'batch_type': 'sequential', 'cve_year': '', 'short_name': 'mitre' } ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_cve_id_bad_year(reg_user_headers):\n res = requests.post(\n f'{env.AWG_BASE_URL}{CVE_ID_URL}',\n headers=reg_user_headers,\n params={\n 'amount': '10',\n 'batch_type': 'sequential',\n 'cve_year': '20111',\n 'short_name': 'mitre'\n ...
[ "0.6313151", "0.6143077", "0.6127024", "0.60904646", "0.60735536", "0.58609223", "0.58071655", "0.5775344", "0.57210094", "0.5700775", "0.5646941", "0.5644524", "0.5628136", "0.5607409", "0.5587389", "0.5573917", "0.5566914", "0.55656594", "0.55643725", "0.555612", "0.5514439...
0.6794595
0
bulk download user should not be a CNA so can't reserve ids
def test_get_cve_id_bulk_download_user(bulk_download_user_headers): res = requests.post( f'{env.AWG_BASE_URL}{CVE_ID_URL}', headers=bulk_download_user_headers, params={ 'amount': '1', 'cve_year': f'{utils.CURRENT_YEAR}', 'short_name': bulk_download_user_he...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def NSK129_user_ids():\n return [\n707057500045751944,\n707057500045752170,\n707057500045752255,\n707057500045752231,\n707057500045752217,\n707057500045752194,\n707057500045752156,\n707057500045752132,\n707057500045752118,\n707057500045752088,\n707057500045752064,\n707057500045752057,\n707057500045752033,\n7070...
[ "0.58862513", "0.5735354", "0.5705536", "0.56432605", "0.5610844", "0.5497258", "0.5476385", "0.5470781", "0.54458916", "0.5398383", "0.53948796", "0.53903925", "0.53885984", "0.53872275", "0.5369535", "0.5365663", "0.53542453", "0.5341866", "0.53160834", "0.5290616", "0.5284...
0.68713385
0
cve services rejects empty amount
def test_post_cve_id_empty_amount(reg_user_headers): res = requests.post( f'{env.AWG_BASE_URL}{CVE_ID_URL}', headers=reg_user_headers, params={ 'amount': '', 'batch_type': 'sequential', 'cve_year': f'{utils.CURRENT_YEAR}', 'short_name': 'mitre'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_cve_id_bad_amount(reg_user_headers):\n res = get_reserve_cve_ids('a', utils.CURRENT_YEAR, reg_user_headers['CVE-API-USER'])\n assert res.status_code == 400\n assert res.reason == 'Bad Request'\n response_contains_json(res, 'error', 'BAD_INPUT')\n assert_contains(res, 'amount')", "def...
[ "0.653086", "0.62721187", "0.5955064", "0.59161574", "0.59132206", "0.57916385", "0.5741534", "0.5699919", "0.569672", "0.5678238", "0.5673891", "0.5644661", "0.5555724", "0.55537736", "0.5542234", "0.55271494", "0.54556924", "0.5434752", "0.5424136", "0.5397019", "0.5380233"...
0.6919644
0
cve services rejects not having a batch type
def test_post_cve_id_no_batch_type(reg_user_headers): res = requests.post( f'{env.AWG_BASE_URL}{CVE_ID_URL}', headers=reg_user_headers, params={ 'amount': '10', 'batch_type': '', 'cve_year': f'{utils.CURRENT_YEAR}', 'short_name': reg_user_heade...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_cve_id_invalid_batch_type(reg_user_headers):\n res = requests.post(\n f'{env.AWG_BASE_URL}{CVE_ID_URL}',\n headers=reg_user_headers,\n params={\n 'amount': '10',\n 'batch_type': '---',\n 'cve_year': f'{utils.CURRENT_YEAR}',\n 'short_...
[ "0.59317034", "0.54606634", "0.5347346", "0.5305016", "0.5238327", "0.5208267", "0.51238453", "0.51060337", "0.50457895", "0.50359416", "0.49542272", "0.49313167", "0.4925144", "0.49151918", "0.48936203", "0.48852006", "0.48664358", "0.48178315", "0.48169056", "0.48044324", "...
0.59035945
1
cve services rejects batch types that aren't 'sequential' or 'nonsequential'
def test_post_cve_id_invalid_batch_type(reg_user_headers): res = requests.post( f'{env.AWG_BASE_URL}{CVE_ID_URL}', headers=reg_user_headers, params={ 'amount': '10', 'batch_type': '---', 'cve_year': f'{utils.CURRENT_YEAR}', 'short_name': reg_u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_cve_id_no_batch_type(reg_user_headers):\n res = requests.post(\n f'{env.AWG_BASE_URL}{CVE_ID_URL}',\n headers=reg_user_headers,\n params={\n 'amount': '10',\n 'batch_type': '',\n 'cve_year': f'{utils.CURRENT_YEAR}',\n 'short_name': r...
[ "0.58494323", "0.5699419", "0.56590396", "0.5447683", "0.5235617", "0.51089853", "0.5033172", "0.49491057", "0.49415886", "0.49031293", "0.4901575", "0.49012297", "0.4887945", "0.48630536", "0.4860203", "0.4859041", "0.4856981", "0.4837587", "0.4836359", "0.48355365", "0.4825...
0.625506
0
api rejects nonnumeric amount when requesting IDs
def test_post_cve_id_bad_amount(reg_user_headers): res = get_reserve_cve_ids('a', utils.CURRENT_YEAR, reg_user_headers['CVE-API-USER']) assert res.status_code == 400 assert res.reason == 'Bad Request' response_contains_json(res, 'error', 'BAD_INPUT') assert_contains(res, 'amount')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_details_nonnum_id(self):\n self.check_response(\n '/attributes/xyz',\n ('Please enter an integer value for Attribute ID',))", "def test_post_cve_id_invalid_amount(reg_user_headers):\n res = requests.post(\n f'{env.AWG_BASE_URL}{CVE_ID_URL}',\n headers=reg_us...
[ "0.5972634", "0.58182454", "0.57866687", "0.57143825", "0.56861025", "0.5576269", "0.55707586", "0.5519899", "0.54803365", "0.54670215", "0.54645705", "0.54422504", "0.5417482", "0.54086465", "0.53886473", "0.53857684", "0.53546566", "0.5326676", "0.53108746", "0.5281189", "0...
0.6417517
0
cve_id_year format cannot have letters
def test_get_cve_id_year_format_with_letters(reg_user_headers): res = requests.get( f'{env.AWG_BASE_URL}{CVE_ID_URL}', headers=reg_user_headers, params={ 'cve_id_year': 'test', } ) assert res.status_code == 400 response_contains_json(res, 'error', 'BAD_INPUT')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_cve_id_year_format_with_digits(reg_user_headers):\n res = requests.get(\n f'{env.AWG_BASE_URL}{CVE_ID_URL}',\n headers=reg_user_headers,\n params={\n 'cve_id_year': '20111',\n }\n )\n assert res.status_code == 400\n response_contains_json(res, 'error'...
[ "0.7290299", "0.68064517", "0.6639915", "0.6629726", "0.65061045", "0.6400136", "0.6279429", "0.62579036", "0.6201554", "0.6189587", "0.6148076", "0.61450696", "0.6132923", "0.6132025", "0.61171603", "0.6104892", "0.6042868", "0.60263044", "0.6016714", "0.601461", "0.60107243...
0.72332454
1
cve_id_year format must be 4 digits only
def test_get_cve_id_year_format_with_digits(reg_user_headers): res = requests.get( f'{env.AWG_BASE_URL}{CVE_ID_URL}', headers=reg_user_headers, params={ 'cve_id_year': '20111', } ) assert res.status_code == 400 response_contains_json(res, 'error', 'BAD_INPUT')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_cve_id_year_format_with_letters(reg_user_headers):\n res = requests.get(\n f'{env.AWG_BASE_URL}{CVE_ID_URL}',\n headers=reg_user_headers,\n params={\n 'cve_id_year': 'test',\n }\n )\n assert res.status_code == 400\n response_contains_json(res, 'error'...
[ "0.6879809", "0.6652131", "0.6589121", "0.65639925", "0.65207195", "0.640766", "0.64061123", "0.63677484", "0.6340106", "0.6324387", "0.631996", "0.6299573", "0.6240616", "0.6234675", "0.6224217", "0.61875993", "0.61271626", "0.60666287", "0.6056316", "0.60426563", "0.6026599...
0.7553173
0
CVE ID filter endpoint does not return any IDs with state 'AVAILABLE'
def test_get_cve_id_available_state(reg_user_headers): res = requests.get( f'{env.AWG_BASE_URL}{CVE_ID_URL}', headers=reg_user_headers, params={ 'page': 1, 'state': 'PUBLISHED', 'cve_id_year': 2011 } ) assert res.status_code == 200 asse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_cve_id_empty_parameters(reg_user_headers):\n res = requests.get(\n f'{env.AWG_BASE_URL}{CVE_ID_URL}',\n headers=reg_user_headers,\n params={\n 'page': ' ',\n 'state': ' ',\n 'cve_id_year': ' ',\n 'time_reserved.lt': ' ',\n ...
[ "0.60389936", "0.5929574", "0.58426833", "0.5815951", "0.570661", "0.5682153", "0.5544171", "0.54931444", "0.5453357", "0.5426285", "0.5375902", "0.5353277", "0.53115815", "0.5262179", "0.52360713", "0.5179641", "0.51218987", "0.51197237", "0.51189655", "0.50833505", "0.50806...
0.6503651
0
Returns the capacity of the stack
def capacity(self): return self._capacity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def capacity(self):\n return self._cap", "def capacity(self):\n return self._capacity", "def size(self) -> int:\n return len(self.stack)", "def size(self):\n return len(self.stack)", "def size(self):\n return len(self.__stack)", "def size(self):\n return len(...
[ "0.7462714", "0.74571216", "0.74546", "0.7357611", "0.7292455", "0.7292455", "0.7283221", "0.72271335", "0.7219159", "0.72018915", "0.7150927", "0.70750976", "0.69642293", "0.69642293", "0.69642293", "0.69642293", "0.6958376", "0.6918588", "0.6907446", "0.6886556", "0.6886556...
0.74791604
0
Hamming weight w = 0.54 0.46cos(2pin/(N1)) where n is the element index of a total N elements. or w = 0.54 + 0.46cos(2pir/l), where r is the distance to the center of the window, and l is the total width of the filter window.
def _weight_hamming(r, l): w = 0.54 + 0.46*np.cos(2*pi*r/l) w[np.absolute(r)>l/2.]=0 return w
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def windowing(input):\n N, M = np.shape(input)\n\n window = signal.hamming(M, sym=0)\n\n window_axis = lambda sample: sample * window\n\n output = np.apply_along_axis(window_axis, 1, input)\n\n # myplot(output, 'Hamming Window')\n\n return output", "def make_hamming(N):\n return map(lambda x...
[ "0.6837442", "0.65596735", "0.6552758", "0.6512625", "0.6077814", "0.605841", "0.5993005", "0.57823837", "0.5748788", "0.5671822", "0.566978", "0.56511", "0.56271595", "0.5613923", "0.5583017", "0.55617875", "0.55501837", "0.5534077", "0.5513793", "0.54881024", "0.54877645", ...
0.71120054
0
Returns a 4 digit block nearest the right of the string title. OR Returns None. EG. Starwars (1977) year is 1997 2001 A space odyssey 1968 year is 1968 2010 NO year 1985. NO year 75 NO year
def find_year(title): # find all patterns that match the year pattern matches = year_pattern.findall(title) # if any matches if matches: # record for convienence year = matches[-1] too_short = len(title) < 8 # If the year is the title then return None if year == t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_year(string): \n return int(string[11:15])", "def findYear(str):\n return int(re.search(\"(?<=yr=)\\d*\", str)[0])", "def get_year_from_movielist_title(title):\n match = re.match(r'.*\\s+\\((\\d+)\\)', title)\n year = int(match.groups()[0])\n return year", "def search_ye...
[ "0.58915716", "0.58567333", "0.56649774", "0.56625235", "0.5659744", "0.56596863", "0.56417406", "0.5590322", "0.55717194", "0.5556086", "0.55372804", "0.55324984", "0.5495838", "0.5452335", "0.5448456", "0.5435247", "0.5400344", "0.5391075", "0.53525335", "0.530363", "0.5269...
0.72216535
0
Returns a dictionary of decades > number of movies released.
def rank_decades(movies): results = {} for movie in movies: year = find_year(movie) # If we found a release year then count it if year: # A way to map year to decade decade = "{0}0s".format(year[:3]) else: decade = "None" results[decad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mostMoviesPerDecades (movies):\n movieDecades = {}\n for (title,year) in movies:\n key = year[:3]\n movieDecades[key] = movieDecades.get(key, 0) + 1\n return sorted([ (count, decade+'0s') for (decade,count) in movieDecades.items() ], reverse=True)\n # OR:\n # decades = [ k[1][:3]+'...
[ "0.7007399", "0.6177839", "0.58240515", "0.58192813", "0.5802243", "0.5785403", "0.5764", "0.57110053", "0.5679944", "0.56325126", "0.56231296", "0.5615995", "0.5595944", "0.5464355", "0.5454769", "0.5368347", "0.5368315", "0.53631794", "0.5360716", "0.529787", "0.5292788", ...
0.7228442
0
Return the string commands to invoke the tap with the discover flag and the right configuration options
def discover_cmd(self, logger: AirbyteLogger, config_path: str) -> str: return f"{self.TAP_CMD} -c {config_path} --discover"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cmd_path():\n\n return {\n \"tariff:Tariff management\": {\n \"list:Show list of tariffs\": [],\n \"show:Show tariff info\": [\"tariff\"],\n \"add:Add tariff to system\": [\"tariff\", \"cpu\", \"disk\", \"ram\", \"io\"],\n \"disable:...
[ "0.58859074", "0.58670986", "0.5826348", "0.58100325", "0.5771427", "0.5704115", "0.5698732", "0.56129", "0.5583267", "0.5536959", "0.5536959", "0.5536959", "0.5536959", "0.55263853", "0.5525248", "0.5517902", "0.54636204", "0.54554516", "0.5440602", "0.54287976", "0.542587",...
0.7558065
0
Return the string commands to invoke the tap with the right configuration options to read data from the source
def read_cmd(self, logger: AirbyteLogger, config_path: str, catalog_path: str, state_path: str = None) -> str: config_option = f"--config {config_path}" properties_option = f"--catalog {catalog_path}" state_option = f"--state {state_path}" if state_path else "" return f"{self.TAP_CMD} {c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getCommands(self):", "def discover_cmd(self, logger: AirbyteLogger, config_path: str) -> str:\n return f\"{self.TAP_CMD} -c {config_path} --discover\"", "def read_cmd(self):\n\n parser = ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter)\n req_opts = parser.add_argument_grou...
[ "0.57491606", "0.5746505", "0.5679547", "0.5584499", "0.5541998", "0.5482936", "0.5449338", "0.5402556", "0.537918", "0.53708476", "0.5344244", "0.5337871", "0.5331325", "0.52883744", "0.52798516", "0.5266515", "0.52500254", "0.5231561", "0.5224792", "0.52229244", "0.52014023...
0.6807015
0
Helper to extract the necessary information from the source and destination arguments.
def _extract_service_info(self, source, destination): self._validate_args(source, destination) src_tags = [] dest_tags = [] src_ranges = [] dest_ranges = [] if isinstance(source, Service): src_tags.append("%s-%s" % (source.network.name, source.name)) i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_info_from_arguments(self):\r\n\r\n for sample_name in self.arguments['--sample_name']:\r\n self.list_of_samples_to_be_combined.append(sample_name)\r\n\r\n for file_path in self.arguments['--input_file']:\r\n file_object = Input_file(file_path, self.list_of_samples_to...
[ "0.6327258", "0.611357", "0.6070593", "0.6032475", "0.5898038", "0.5862193", "0.57831115", "0.5734336", "0.5718328", "0.57162285", "0.57139033", "0.5698845", "0.56835914", "0.5624857", "0.561419", "0.56104034", "0.555884", "0.5511409", "0.54986507", "0.54595613", "0.5454608",...
0.66374743
0
Add path between two services on a given port.
def add(self, source, destination, port): logger.info('Adding path from %s to %s on port %s', source, destination, port) rules = [{"IPProtocol": "tcp", "ports": [int(port)]}] src_tags, dest_tags, src_ranges, _ = self._extract_service_info( source, destination) firewall_name =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def paths_allow_service(ctx, network, destination, source, port):\n source_service = get_service_for_cli(ctx, network, source)\n destination_service = get_service_for_cli(ctx, network, destination)\n ctx.obj['CLIENT'].paths.add(source_service, destination_service, port)\n click.echo('Ad...
[ "0.72288865", "0.62011", "0.59549165", "0.5698274", "0.569521", "0.56599027", "0.5586385", "0.55849314", "0.5568475", "0.54433686", "0.53352237", "0.53007907", "0.5271029", "0.5248992", "0.5241183", "0.5220928", "0.52087563", "0.5194345", "0.5165232", "0.5164921", "0.5087458"...
0.685008
1
Remove path between two services on a given port.
def remove(self, source, destination, port): logger.info('Removing path from %s to %s on port %s', source, destination, port) firewall_name = "bu-%s-%s-%s" % (destination.network.name, destination.name, port) def remove_from_ranges(to_remove, address_ranges): lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def paths_revoke_service(ctx, network, destination, source, port):\n source_service = get_service_for_cli(ctx, network, source)\n destination_service = get_service_for_cli(ctx, network, destination)\n ctx.obj['CLIENT'].paths.remove(source_service, destination_service, port)\n click.echo...
[ "0.73585504", "0.63231486", "0.6160031", "0.6030933", "0.59920424", "0.5941496", "0.57573885", "0.5690381", "0.56471235", "0.5642937", "0.5599214", "0.55907756", "0.55659735", "0.55342007", "0.5519539", "0.5490159", "0.5467465", "0.5436124", "0.5414947", "0.54074705", "0.5395...
0.65104246
1
Returns the ManagementForm instance for this FormSet.
def management_form(self): if self.is_bound: form = AttachmentManagementForm(self.data, auto_id=self.auto_id, prefix=self.prefix) if not form.is_valid(): raise ValidationError('ManagementForm data is missing or has been tampered with') else: form = Att...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _management_form(self):\n if self.is_bound:\n form = ConcurrentManagementForm(self.data, auto_id=self.auto_id,\n prefix=self.prefix)\n if not form.is_valid():\n raise ValidationError('ManagementForm data is missing or has be...
[ "0.7361065", "0.6664403", "0.6664403", "0.6357645", "0.622903", "0.619828", "0.6129273", "0.6124485", "0.61211973", "0.6112333", "0.6099777", "0.60755575", "0.5937113", "0.58789", "0.5841554", "0.575287", "0.5716436", "0.56436545", "0.5578003", "0.555524", "0.55537564", "0....
0.7139378
1
Get all the roidbs(dict for each image) in this dataset.
def get_roidb(self): # get all the images_ids in this dataset img_ids = self._COCO.getImgIds() # sort the ids, make each time the same order img_ids.sort() # load the 'image' of the COCO dataset roidb = copy.deepcopy(self._COCO.loadImgs(img_ids)) for entry in roid...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getimgs():", "def _get_images(self):\n raw_outputs = self.interface.get_data(self.target_charge,\n self.charge_deviation,\n n_samples=self.n_samples)\n\n # apply roi to images\n roi_images = []\n ...
[ "0.63079953", "0.6234191", "0.6219616", "0.6211326", "0.61850816", "0.61710894", "0.6158927", "0.61159897", "0.6075292", "0.606353", "0.6056601", "0.5999819", "0.597429", "0.5974166", "0.5902935", "0.5876047", "0.5860083", "0.5860083", "0.58325046", "0.5830358", "0.581679", ...
0.6564253
0
Define command line flags for MNIST model.
def define_mnist_flags(): flags_core.define_base( clean=True, num_gpu=True, train_epochs=True, epochs_between_evals=True, distribution_strategy=True) flags_core.define_device() flags_core.define_distribution() # flags.DEFINE_string('data_dir', r'D:\tf2_official_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_args():\n parser = argparse.ArgumentParser(description=\"Classify and predict digits using the mnist dataset\")\n parser.add_argument('mode', help='the mode to run in: fit, model or predict')\n parser.add_argument('--algo', help='which algorithm to use: RandomForest, KNN')\n return parser.pars...
[ "0.63784486", "0.63677526", "0.6337081", "0.6322367", "0.62878275", "0.6251837", "0.62503946", "0.61637074", "0.6119836", "0.611938", "0.6100962", "0.6022951", "0.6016902", "0.59860235", "0.5975369", "0.5955694", "0.5928708", "0.5927573", "0.5901932", "0.58923614", "0.5875625...
0.7942187
0
Returns whether the scene contains an image pixmap.
def hasImage(self): return self._image is not None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hasImage(self):\n if self.getImage():\n return True\n return False", "def has_image(self):\n return hasattr(self, \"_image\") and self._image is not None", "def hasPng(self):\n\t\tif self.isPng:\n\t\t\treturn True\n\t\treturn textureFile( self.path.replace( self.extension, '...
[ "0.7148394", "0.69063604", "0.6811348", "0.6708111", "0.6708111", "0.66627085", "0.63021797", "0.6208606", "0.61569035", "0.613535", "0.6075283", "0.6071318", "0.59205896", "0.59165484", "0.5906985", "0.58777034", "0.5860418", "0.581497", "0.5773688", "0.5759203", "0.57401556...
0.7086305
1
Removes the current image pixmap from the scene if it exists.
def clearImage(self): if self.hasImage(): self.scene.removeItem(self._image) self._image = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clearImage(self):\n if self.hasImage():\n self.scene.removeItem(self._pixmapHandle)\n self._pixmapHandle = None\n self.zoom=-1\n self.scene.clear()", "def removeScene(self):\n del self.scene, self.imgPixmapItem", "def clean_all(self):\n self....
[ "0.79136795", "0.7713988", "0.67695427", "0.6741188", "0.6572793", "0.65437007", "0.64187896", "0.63136613", "0.61855835", "0.61837137", "0.61759114", "0.61759114", "0.61453015", "0.61429083", "0.6075483", "0.6035884", "0.6033798", "0.5917658", "0.59154296", "0.5910521", "0.5...
0.7800114
1
Returns the scene's current image pixmap as a QPixmap, or else None if no image exists.
def pixmap(self): if self.hasImage(): return self._image.pixmap() return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pixmap(self):\n if self.hasImage():\n return self._pixmapHandle.pixmap()\n return None", "def image(self):\n if self.hasImage():\n return self._pixmapHandle.pixmap().toImage()\n return None", "def image(self):\n if self.hasImage():\n retur...
[ "0.7835423", "0.75290245", "0.74141395", "0.67934173", "0.6428947", "0.61595285", "0.6098856", "0.58280176", "0.5742987", "0.5732158", "0.5682366", "0.56738436", "0.5643078", "0.56390196", "0.5633685", "0.5633685", "0.5633685", "0.56182927", "0.5591214", "0.5585604", "0.55093...
0.79953897
0
Returns the scene's current image pixmap as a QImage, or else None if no image exists.
def image(self): if self.hasImage(): return self._image.pixmap().toImage() return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pixmap(self):\n if self.hasImage():\n return self._image.pixmap()\n return None", "def image(self):\n if self.hasImage():\n return self._pixmapHandle.pixmap().toImage()\n return None", "def pixmap(self):\n if self.hasImage():\n return self...
[ "0.75357985", "0.7390828", "0.7325522", "0.63724256", "0.63046825", "0.60485345", "0.5909091", "0.58557355", "0.58035487", "0.5761733", "0.57425255", "0.5711291", "0.5696588", "0.5677836", "0.5676707", "0.5676707", "0.5676707", "0.5646885", "0.5624013", "0.5589218", "0.557353...
0.7408162
1
Set the scene's current image pixmap to the input QImage or QPixmap. Raises a RuntimeError if the input image has type other than QImage or QPixmap.
def setImage(self, image): if type(image) is QPixmap: pixmap = image elif type(image) is QImage: pixmap = QPixmap.fromImage(image) elif (np is not None) and (type(image) is np.ndarray): if qimage2ndarray is not None: qimage = qimage2ndarray.arr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setImage(self, image):\n if type(image) is QPixmap:\n pixmap = image\n elif type(image) is QImage:\n pixmap = QPixmap.fromImage(image)\n else:\n raise RuntimeError(\"ImageViewer.setImage: Argument must be a QImage or QPixmap.\")\n if self.hasImage():...
[ "0.7422291", "0.6897182", "0.6531623", "0.63586396", "0.62505937", "0.6145541", "0.6143544", "0.61127263", "0.6110928", "0.6067547", "0.5999988", "0.59984446", "0.59641266", "0.5930717", "0.59233356", "0.58951384", "0.58449477", "0.580186", "0.57875705", "0.5784541", "0.57468...
0.76077926
0
Show current zoom (if showing entire image, apply current aspect ratio mode).
def updateViewer(self): if not self.hasImage(): return if len(self.zoomStack): self.fitInView(self.zoomStack[-1], self.aspectRatioMode) # Show zoomed rect. else: self.fitInView(self.sceneRect(), self.aspectRatioMode) # Show entire image.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateViewer(self):\n if not self.hasImage():\n return\n if self.zoom<0:\n self.fitInView(self.sceneRect(), self.aspectRatioMode)\n self.zoom=self.size().width()/self.scene.width()\n else:\n self.setTransform(QTransform().scale(self.zoom, self.zo...
[ "0.7110633", "0.6878876", "0.67799777", "0.66970503", "0.6600747", "0.6560286", "0.648813", "0.64450556", "0.6328534", "0.63201594", "0.63057935", "0.62695974", "0.6250653", "0.6239383", "0.62117034", "0.618607", "0.6161364", "0.61387765", "0.611919", "0.6115448", "0.6115113"...
0.7233747
0
Verifies if a given expression is a DOI link.
def is_doi( expr: str ) -> bool: return "/" in expr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid_doi(doi):\n\n try:\n req = requests.get('http://dx.doi.org/%s' % doi, timeout=2.5)\n except (Timeout, RequestException) as e:\n logger.error('Can not validate doi: ' + str(e))\n raise\n else:\n return req.status_code == 200", "def test_external_link_no_optional()...
[ "0.5902243", "0.5859285", "0.58372796", "0.5793471", "0.5750182", "0.57325715", "0.5698225", "0.56601554", "0.5649386", "0.5642453", "0.5627013", "0.5585181", "0.5577459", "0.55432963", "0.55078125", "0.55066365", "0.54943603", "0.5493496", "0.5486709", "0.5483652", "0.546083...
0.6097317
0
Verifies if a given expression is a PMCID.
def is_pmc( expr: str ) -> bool: return expr.startswith("PMC")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_pmcid(val):\n return pmcid_regexp.match(val)", "def is_pmid(val):\n return pmid_regexp.match(val)", "def isValid(t_id):\n\tstr_id=str(t_id).strip()\n\treturn str_id.isdigit()", "def validate_crx_id(crx_id):\n try:\n assert isinstance(crx_id, str)\n assert crx_id.isalnum()\n ...
[ "0.7058424", "0.5879918", "0.52431554", "0.5222485", "0.5149193", "0.51324445", "0.51155275", "0.509177", "0.49949974", "0.49601135", "0.4931984", "0.49043941", "0.4885397", "0.4833352", "0.48165584", "0.48036438", "0.48029396", "0.4801181", "0.4782276", "0.478221", "0.478114...
0.6777141
1
Verifies if a given expression is not found when trying to find a PMID from a DOI or when trying to find a PMCID from a PMID.
def not_found( expr: str ) -> bool: return expr.startswith("N")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_pmc(\n expr: str\n ) -> bool:\n return expr.startswith(\"PMC\")", "def test_raises_useful_exception(self):\n exp = Expression(r'inalid (\\d]', {}, [], lambda x: x)\n with self.assertRaises(exp.InvalidPattern):\n assert not exp.pattern", "def test_fetch_nonexist_...
[ "0.5836214", "0.5558532", "0.54999846", "0.5269607", "0.52547735", "0.51899976", "0.5160352", "0.51542646", "0.50802845", "0.5080079", "0.50719815", "0.50708777", "0.5060157", "0.50567174", "0.5032003", "0.501759", "0.5013457", "0.50105387", "0.5006492", "0.5003135", "0.49980...
0.5569078
1
tell all players the message
def tell_all_players(message): print("tell_all_players - disabled") #player_obj_list = leetcoin_client.getPlayerObjList() #for player_obj in player_obj_list: # #print("player_obj key: %s" player_obj.get_key()) # print(player_obj.get_userid()) # # playerinfo = playerinfo_from_use...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def message_all(self, message):\n # We copy the _clients into a list to avoid dictionary changing\n # size during iteration.\n for character in self.players.values():\n character.message(message)", "def send_msg_to_players(players, msg=\"\"):\n for player in players:\n p...
[ "0.70819765", "0.69221133", "0.67780375", "0.644569", "0.64424276", "0.63831353", "0.63645077", "0.6316337", "0.629872", "0.6286281", "0.62688696", "0.6267403", "0.62594795", "0.62567353", "0.6223139", "0.6213465", "0.6205974", "0.6203498", "0.61870635", "0.61756897", "0.6165...
0.7917727
0
Defines a new global parameter. Global defines are part of a LSystem definition.
def addGlobalDefine(self,name,value): self.globalDefines[name] = value self.refreshGlobals() return name,value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setGlobal(name, value):", "def _register_global_params(self, params):\n\n for name,obj in self.params().items():\n global_params.add(**{name:obj})\n\n for name,val in params.items():\n global_params.params(name).default=val\n\n params.update(global_params.get_param_...
[ "0.7220049", "0.6664844", "0.63944066", "0.6321146", "0.6292508", "0.6287569", "0.6168385", "0.6102255", "0.6082242", "0.607618", "0.5988118", "0.59781164", "0.59773254", "0.59147763", "0.5875671", "0.58619636", "0.5822638", "0.57786924", "0.5713862", "0.5713862", "0.5651559"...
0.67719114
1
Adds a new empty production.
def addNewProduction(self): newProduction = ParametricProduction() newProduction.setGlobals(self.globalDefines) self.productions.append(newProduction) return newProduction
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_production(g, prod):\n prods = list(g.productions())\n prods.append(prod)\n\n return CFG(prods)", "def __add__(self, other):\n return Production(self, other)", "def add_empty ( self ):\n self.add_item( 0 )\n self.delete_item()", "def eliminate_unit_productions(self) -> \...
[ "0.6510565", "0.54904515", "0.5418957", "0.5269639", "0.5244652", "0.52325046", "0.51680905", "0.5140562", "0.51313096", "0.51223606", "0.503379", "0.49855718", "0.49611712", "0.49484378", "0.4942469", "0.4886154", "0.48101586", "0.47989944", "0.4791486", "0.47834474", "0.476...
0.6333782
1
Returns the pString that results from iterating this lsystem. Computes it, if needed.
def getResultPString(self): # TODO: WARNING!!! Make sure the resultPstring is emptied if we do some modification to the lsystem!! OR THIS WILL BEHAVE INCORRECTLY! if self.resultPString == None: self.resultPString = self.iterate() return self.resultPString
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buildString( lsys, iter ):\n\tnstring = getBase(lsys)\n\trule = getRule(lsys, 0)\n\tsymbol = rule[0]\n\treplacement = rule[1]\n\tfor i in range(iter):\n\t\tnstring = nstring.replace( symbol, replacement )\n\treturn nstring", "def get_string(self):\n return (self.loop_level+1) * ' ' + ','.join(map(str,...
[ "0.6028617", "0.59457964", "0.58593225", "0.57503265", "0.57239276", "0.5717773", "0.5690348", "0.56889313", "0.56804085", "0.56782484", "0.5660313", "0.5655957", "0.56339836", "0.5624231", "0.5619703", "0.56152797", "0.56096286", "0.5604201", "0.5588711", "0.5579955", "0.553...
0.7823306
0
Creates a fancy decorator for adding checks.
def fancy_test_decorator( lister, arguments=lambda x: x, attributes=lambda x: {"id": str(x)}, naming=lambda x: str(x), debug=False ): def for_all_stuff(check): for x in lister(): if debug: logger.info("add test %s / %s " % (check, x)) add_checker_f(check, x, argu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_check_function(check_function: Callable):\n\n def decorator(func: Callable):\n @wraps(func)\n def wrapper(*args, **kwargs):\n check_function(*args, *kwargs.values())\n return func(*args, **kwargs)\n\n return wrapper\n\n name = getattr(check_function, '__name...
[ "0.7273434", "0.6325305", "0.6310445", "0.6059395", "0.59788996", "0.59650195", "0.58667994", "0.5828741", "0.5791087", "0.5753213", "0.57451487", "0.573942", "0.5720317", "0.57140326", "0.5673965", "0.56716275", "0.5637673", "0.5629896", "0.56294024", "0.5589285", "0.5578370...
0.68729776
1
Here we apply the penalty if the reindeer haven't hit a city with a prime number after 10 stops.
def apply_penalty(self, distance): self.cities_hit += 1 # Adds to the counter of cities without visiting a prime. if self.cities_hit > 10: # If Santa has visted more than 10 cities ... penalty_distance = ( distance * 0.1) + distance # ...Applies the penalt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def problem077():\n\n cond = lambda n: num_prime_sum_ways(n) > 5000\n ans = next(filter(cond, itertools.count(2)))\n return ans", "def optimize_on_n_cops(self):\n self.optimize_on_target_profiles()\n max_revenue = -INF\n while self.get_revenue_per_hour() >= max_revenue:\n ...
[ "0.56442875", "0.55455905", "0.54904443", "0.5464032", "0.5369751", "0.53377616", "0.53199047", "0.53149813", "0.5300897", "0.5283969", "0.527871", "0.5255954", "0.52017784", "0.52017784", "0.52017784", "0.5185166", "0.51775", "0.5160633", "0.5146357", "0.5146357", "0.5138448...
0.6755605
0
A view to show all plans, including search queries
def all_plans(request): plans = Plan.objects.all() context = { 'plans': plans, } return render(request, 'plans/plans.html', context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plans(self):\n title = self.context.Title()\n return self.portal_catalog(portal_type='Plan', Subject=title)", "def plans(self):\r\n return pl.Plans(self)", "def plans():\n results = []\n if 'qry' in request.args:\n look_for = request.args['qry']\n if look_for[0] ==...
[ "0.7310067", "0.7198465", "0.7083822", "0.6990251", "0.68972915", "0.68796146", "0.6816322", "0.67738247", "0.66978693", "0.66711676", "0.6489017", "0.63918585", "0.6355578", "0.6252215", "0.613207", "0.59970254", "0.5911662", "0.58731335", "0.5862313", "0.582986", "0.5799526...
0.7688979
0
A view to show individual plan details
def plan_detail(request, plan_id): plan = get_object_or_404(Plan, pk=plan_id) context = { 'plan': plan, } return render(request, 'plans/plan_detail.html', context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show(self):\n self.parser.add_argument('plan_uuid',\n help=\"Plan uuid or name\")\n args = self.parser.parse_args()\n response = self.client.plans.find(name_or_id=args.plan_uuid)\n fields = ['uuid', 'name', 'description', 'uri']\n data = dict([...
[ "0.73478836", "0.73370415", "0.72034496", "0.7157708", "0.7024649", "0.7023542", "0.6954958", "0.68937033", "0.6892831", "0.6678772", "0.6660882", "0.6554114", "0.64640635", "0.6410193", "0.6300984", "0.62471807", "0.6220166", "0.6216608", "0.62138957", "0.61967915", "0.61773...
0.8303781
0
Generates a list of biases with changes in trend as given by "break_pt_list"
def make_bias_list_switch(lm, input_bias, break_point_list): num_actions = lm.get_num_actions() # bias() is a list: [ [action 1 losses], [actn 2 losses] ...] bias = list() # Create a list of lists trend = [[], [] ...] # trend[i] holds biases for the entire time period for action i trend = list(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_stochastic_losses(lm, break_point_list, option):\n\n num_rounds = lm.get_num_rounds()\n num_actions = lm.get_num_actions()\n input_bias = list()\n\n if option == 0:\n mu_base = 0.450\n # input_bias indicate the range of variation of bias for the particular action\n inp...
[ "0.55167365", "0.5464309", "0.53766716", "0.5337338", "0.52728546", "0.5107063", "0.50852406", "0.50195694", "0.50195694", "0.50195694", "0.50195694", "0.5011635", "0.5011635", "0.49982467", "0.4990661", "0.49348637", "0.49161673", "0.49007043", "0.48979306", "0.48661646", "0...
0.70775414
0
Check a property of a STIX Object against this casefold filter, but with a casefold operator.
def _check_property(self, stix_obj_property): # Had to keep the following code so that # If filtering on a timestamp property and the filter value is a string, # try to convert the filter value to a datetime instance. if isinstance(stix_obj_property, datetime) and isinstance(self.value, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_func(fieldname):\n if fieldname.startswith('_'):\n return False\n value = getattr(class_, fieldname)\n \n return isinstance(value, type)", "def subtest_Case_estLibre():\n _out =''\n a = tp.Case(42)\n _out = check_property(a.estLibre)\n a = tp.Case(23,...
[ "0.53179395", "0.52419406", "0.50970495", "0.49938634", "0.49797964", "0.4970947", "0.48606667", "0.47654226", "0.4718314", "0.46296453", "0.4607768", "0.45705086", "0.45391482", "0.4537164", "0.45287728", "0.45066768", "0.45066455", "0.44971266", "0.4487424", "0.44674322", "...
0.682188
0
calculates the maximization step in the EM algorithm for a GMM
def maximization(X, g): if not verify(X, g): return None, None, None n, d = X.shape k, _ = g.shape m = np.zeros((k, d)) S = np.empty((k, d, d)) pi = np.zeros((k, )) for i in range(k): Nk = np.sum(g[i]) pi[i] = Nk / n gi = g[i].reshape(1, n) m[i] = np.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def em_mog(X, k, max_iter=20):\n\n # Initialize variables\n mu = None\n sigma = [np.eye(X.shape[1]) for i in range(k)]\n phi = np.ones([k,])/k\n ll_prev = float('inf')\n start = time.time()\n\n #######################################################################\n # TODO: ...
[ "0.62958145", "0.612357", "0.61165535", "0.5972927", "0.59422433", "0.5917642", "0.59169376", "0.58822757", "0.5831473", "0.5787356", "0.5751428", "0.57348675", "0.57332474", "0.5717566", "0.56960833", "0.5687598", "0.56711745", "0.56593215", "0.5650866", "0.5630811", "0.5629...
0.6266878
1
Return the ID of the matching item. A regexp is used. If the regexp is not found, return None
def extract_item_id(url): m = re.search('/([0-9]+)\.htm', url) if m is not None: return m.group(1) else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_id(href):\n ID = idRE.search(href)\n if ID:\n return ID.group(1)", "def get_id_from_name(item_name):\n try:\n return next(item for item in mapping if item[\"name\"].lower() == item_name.lower())[\"id\"]\n except StopIteration:\n return None", "def get_id(self, item):\n...
[ "0.6506368", "0.6427352", "0.6353122", "0.63430667", "0.632683", "0.6239559", "0.6149368", "0.61301756", "0.6050991", "0.6000301", "0.59869", "0.5912312", "0.59105664", "0.5822848", "0.5814121", "0.57743317", "0.5769344", "0.57639855", "0.5721476", "0.5716667", "0.568763", ...
0.65152615
0
Get the item list and the entire items details by using several threads to speed up processing. First the list of items are retrieved by using multi threading. Then the list is processed ; a thread is processing a fixed number of items (5 by default).
def get_item_list_with_full_details_fast(self, stop_item=None, max_page=25): item_list = self.get_item_list(stop_item, max_page) q = Queue.Queue() item_per_thread = 5 logging.info("Running threads ...") x = 1 thread_list = [] for _ in item_list[::item_per_thread]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAllListPage():\n firstPage = city + '/line1'\n data = urlopen(firstPage).read().decode('gbk')\n urlList = getLineTypeList(data)\n urlList.append(firstPage)\n num = len(urlList)\n i = 0\n p = Pool(processes=4)\n pageData = p.map(readData, urlList)\n# manager = Manager()\n# pageDat...
[ "0.66107327", "0.6286475", "0.6218568", "0.62020344", "0.5968334", "0.5835191", "0.5825054", "0.57762015", "0.5757452", "0.57314986", "0.5681635", "0.5675728", "0.5591356", "0.5585768", "0.5572358", "0.5556921", "0.55254465", "0.5524028", "0.55230993", "0.5522514", "0.5517528...
0.7719556
0
Have we matched the first 'level' tiles with the answer grid
def match_level(g, level): for i in range(len(g)): for j in range(len(g[i])): level -= 1 if g[i][j] != finished_grid[i][j]: return False # Special case - when doing the last row we must put 2 tiles in place each time elif i == len(g) - 2 and g[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_room_has_tiles(self):\n self.assertEqual(self.room.tile_set.count(), self.room.grid_size ** 2)", "def tile_is_set(index, level_map):\n return level_map[index] != -1", "def new_tile(self):\r\n # replace with your code\r\n # complete search ....\r\n non_zero_count = 0;\r\n...
[ "0.6392905", "0.63439393", "0.6242026", "0.623573", "0.6123131", "0.60925686", "0.6058311", "0.60546285", "0.6011433", "0.5972334", "0.5947247", "0.58905536", "0.5882922", "0.58619165", "0.5842605", "0.5842342", "0.5827736", "0.5819716", "0.5808958", "0.57964456", "0.57834065...
0.7060842
0
Print to the console the instance's attributes. Used to conveniently check the values of each attribute. Include title, storyline, poster_image_url and trailer_youtube_url.
def debug_print(self): print self.title print self.storyline print self.poster_image_url print self.trailer_youtube_url print "------"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _print_attribute(self):\n print(vars(self))", "def print_attrs(self):\n for attribute in self.__dict__.keys():\n print(attribute)", "def print_attr(self):\n return \"name : {0}\\nprice : {1}\\ndescription : {2}\".format(\n self.name, self.price, self.description\n...
[ "0.7770835", "0.71061724", "0.6830483", "0.6676465", "0.6646499", "0.66010046", "0.65855104", "0.6482456", "0.64637995", "0.64564973", "0.64564973", "0.6446431", "0.637585", "0.6349447", "0.6332035", "0.6307484", "0.63065374", "0.62938637", "0.625839", "0.6251546", "0.6231006...
0.7889193
0
Function to generate a 1D Gaussian signal centered at mu and wid wide (FWHM).
def gaussian(mu, wid, x): return np.exp(-((x - mu) / (0.6005612 * wid))**2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeGaussian(size, fwhm, center=None):\n\n x = sp.arange(0, size, 1, float)\n y = x[:,sp.newaxis]\n\n if center is None:\n x0 = y0 = size // 2\n else:\n x0 = center[0]\n y0 = center[1]\n\n return sp.exp(-4*sp.log(2) * ((x-x0)**2 + (y-y0)**2) / fwhm**2)", "def makeGaussian(...
[ "0.71223104", "0.711397", "0.69865227", "0.69807374", "0.69807374", "0.6943345", "0.67490226", "0.66589683", "0.665439", "0.66379637", "0.66137505", "0.6592439", "0.6572652", "0.6561467", "0.65301096", "0.65105855", "0.64582235", "0.6392432", "0.63875985", "0.63683474", "0.63...
0.7511534
0
Function to generate a 1D BiGaussian signal centered at mu, wid wide (FWHM) and parameter m. Symmetrical BiGaussian is generated is m = 0.5
def bigaussian(mu, wid, x, m = 0.5): lx = x.shape[0] ix = np.where(x == mu)[0][0] y = np.ones(lx) y[0:ix] = gaussian(mu, wid * m, x[0:ix]) y[ix+1:lx] = gaussian(mu, wid * (1 - m), x[ix+1:lx]) return y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gauss_kernel(n_fwhm,sigma):\n\n x_length = int(n_fwhm * sigma + 0.5) #Add 0.5 to approximate to nearest integer\n y_length = x_length\n \n \n x, y = mgrid[-x_length:x_length+1, -y_length:y_length+1]\n g = numpy.exp(-(x**2/(2*(float(sigma)**2))+y**2/(2*(float(sigma)**2))))\n return g...
[ "0.6898881", "0.6818787", "0.67554414", "0.6599363", "0.6599363", "0.65387416", "0.64224786", "0.6395345", "0.63268816", "0.6326088", "0.62345266", "0.61686397", "0.61607105", "0.61607105", "0.6159384", "0.61421514", "0.61411417", "0.61372757", "0.61231935", "0.61114275", "0....
0.6849023
1
Function to generate a 1D Gaussian peak broadened by exponential signal. The signal is centered at mu, is wid wide (FWHM) and timeconstant t.
def expgaussian(mu, wid, timeconstant, x): # Gaussian signal broadened by an exponetial signal g = gaussian(mu, wid, x) hly = np.round( len(g) / 2.0 ) ey = np.r_[np.zeros(hly),g,np.zeros(hly)] fy = np.fft.fft(ey) a = np.exp(-(np.arange(len(fy))) / timeconstant ) fa = np.fft.fft(a) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gaussian(amp, fwhm, mean, x):\n return amp * np.exp(-4. * np.log(2) * (x-mean)**2 / fwhm**2)", "def gaussian(amp, fwhm, mean):\n return lambda x: amp * np.exp(-4. * np.log(2) * (x-mean)**2 / fwhm**2)", "def generate_gaussian():\n amp = 10 * numpy.random.chisquare(3)\n width = numpy.random.chisq...
[ "0.68232644", "0.6766749", "0.67023665", "0.66635114", "0.66003823", "0.647763", "0.63649267", "0.6330254", "0.6263207", "0.62517333", "0.6239082", "0.6226317", "0.62098634", "0.61496973", "0.6118846", "0.61174375", "0.60935134", "0.60935134", "0.6064958", "0.60388005", "0.60...
0.7727515
0
Function to generate a 1D Lorentzian peak. The peak is centered at mu and is wid wide (FWHM).
def lorentzian(mu, wid, x): return np.ones(len(x) ) / (1 + ( (x - mu) / (0.5 * wid) )**2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lorentz(self, X, xm, amp, w):\n return amp / (1 + ((X - xm) / (w / 2)) ** 2)", "def narrowIncandPeakInfoLG(self):\r\n\t\tself.narrowIncandBaseline_LG = (np.mean(self.lowGainNarrowBandIncandData[0:10]))\r\n\t\t\t\t\r\n\t\traw_narrowIncand_max_LG = np.amax(self.lowGainNarrowBandIncandData)\r\n\t\tnarrow...
[ "0.5856068", "0.57200897", "0.56143546", "0.5612396", "0.55637854", "0.5529816", "0.5487402", "0.5477099", "0.5475023", "0.5467301", "0.54670376", "0.54655933", "0.54424506", "0.5441767", "0.5420336", "0.54146683", "0.5394928", "0.5380085", "0.5374374", "0.5354449", "0.534702...
0.59923255
0
Function to generate a 1D BiLorentzian peak. The peak is centered at mu, is wid wide (FWHM) and m symmetric.
def bilorentzian(mu, wid, x, m = 0.5): lx = x.shape[0] ix = np.where(x == mu)[0][0] y = np.ones(lx) y[0:ix] = lorentzian( mu, wid * m, x[0:ix] ) y[ix+1:lx] = lorentzian( mu, wid * (1 - m), x[ix+1:lx] ) return y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_peak_def_high():\n\n high_cf_opts = np.arange(50, 90, 1)\n\n # Generate peak definitions\n while True:\n\n cur_cen = np.random.choice(high_cf_opts)\n cur_pw = np.random.choice(PW_OPTS, p=PW_PROBS)\n cur_bw = np.random.choice(BW_OPTS, p=BW_PROBS)\n\n peak = [cur_cen, cur...
[ "0.5574448", "0.5479021", "0.547757", "0.54067004", "0.5383462", "0.535629", "0.53522104", "0.5343756", "0.52861816", "0.5247609", "0.51883906", "0.51769835", "0.51520514", "0.5127397", "0.5112868", "0.5105794", "0.5073474", "0.5068874", "0.5054378", "0.5052403", "0.5043015",...
0.6107654
0
Function to generate a 1D exponential broadened BiLorentzian peak. The peak is centered at mu, is wid wide (FWHM) and exponential function time constant t.
def explorentzian(mu, wid, timeconstant, x): g = lorentzian( mu, wid, x ) hly = np.round( len(g) / 2.0 ) ey = np.r_[np.zeros(hly),g,np.zeros(hly)] fy = np.fft.fft(ey) a = np.exp(-(np.arange(len(fy))) / timeconstant ) fa = np.fft.fft(a) fy1 = fy * fa ybz = np.real(np.fft.i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Boltzmann(En,T):\n ev = 1.60218e-19\n kb = 1.380e-23\n return np.exp(-En/(kb*T/ev))", "def expgaussian(mu, wid, timeconstant, x): \n # Gaussian signal broadened by an exponetial signal\n g = gaussian(mu, wid, x)\n \n hly = np.round( len(g) / 2.0 )\n ey = np.r_[np.zeros(hly),g,np.ze...
[ "0.63273394", "0.6285095", "0.6260649", "0.62249565", "0.603619", "0.6001973", "0.583102", "0.5788435", "0.5672957", "0.56534797", "0.56413347", "0.56182504", "0.56090707", "0.5609032", "0.559953", "0.5572931", "0.5571136", "0.55703306", "0.5569565", "0.5568544", "0.55333847"...
0.6298706
1
Function to generate a lognormal peak, centered at mu with half width half maximum hw.
def lognormal(mu, hw, x): return np.exp(-( np.log(x/mu) / (0.01*hw) )**2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loglam_minmax(self):\n return np.log10(8000.0), np.log10(25700)", "def NLL(sample, params):\n mu = params[:,:,0]\n logsigma = params[:,:,1]\n \n c = normalization.to(mu.device)\n inv_sigma = torch.exp(-logsigma)\n tmp = (sample - mu) * inv_sigma\n return torch.mean(0.5 * (tmp ...
[ "0.62176317", "0.6204198", "0.6148861", "0.61259323", "0.6089201", "0.6013187", "0.59450024", "0.59383446", "0.5914955", "0.5895413", "0.5884146", "0.58821017", "0.5845826", "0.5828772", "0.581202", "0.5810054", "0.57919997", "0.57919997", "0.5774185", "0.57400894", "0.573895...
0.7159443
0
Function to generate a Pearson peak, centered at pos with width wid and shape number m.
def pearson(pos, wid, x, m = 1): return np.ones(len(x)) / (1+(( x-pos) / ((0.5**(2/m)) * 4.62 * wid ))**2)**m
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def peakMask(shape, parameters, margin):\n peak_mask = numpy.ones(shape)\n\n # Check for circular AOI.\n if parameters.hasAttr(\"x_center\"):\n assert parameters.hasAttr(\"y_center\"), \"Y center must be specified.\"\n assert parameters.hasAttr(\"aoi_radius\"), \"AOI radius must be specified...
[ "0.555559", "0.544054", "0.5413793", "0.52438694", "0.5089177", "0.50843877", "0.49853846", "0.49212518", "0.49210066", "0.4911675", "0.4910305", "0.489397", "0.48864043", "0.48736084", "0.48613608", "0.48468658", "0.48138317", "0.48133323", "0.48061478", "0.48027074", "0.479...
0.6833717
0
Make an order of a NUMBER of Flan.
def flan(number, flavor): num = fooutil.make_it_an_int(number) flan_flavor = check_flan_flavor(flavor) order_some_flan(num, flan_flavor)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_order():", "def _generate_order_number(self):\n self.order_number = ''.join((random.choice(string.ascii_lowercase + string.digits) for _ in xrange(30)))", "def create_phone_number(n):", "def Order(self) -> int:", "def getNumber():", "def numerize():\n pass", "def pointorder(sel...
[ "0.60349905", "0.599928", "0.5529731", "0.54469997", "0.53199065", "0.52824", "0.52041674", "0.51772404", "0.51703626", "0.5150046", "0.5149647", "0.5136723", "0.51287293", "0.51287293", "0.51287293", "0.5096725", "0.5081682", "0.5076551", "0.50506306", "0.504155", "0.5034067...
0.6333936
0