query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
A configured instance of MixerDLL
def get_mixer_dll(path_to_dll): mixerdll = ctypes.CDLL(path_to_dll) #version mixerdll.version.restype = ctypes.c_char_p mixerdll.version.argtypes = None #initAudio mixerdll.initAudio.restype = None mixerdll.initAudio.argtypes = None #exitAudio mixerdll.exitAudio.restype = None mixerdll.exitAudio.argtypes = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self):\n try:\n print(\"Initializing driver\")\n pcms = alsaaudio.pcms()\n mixers = alsaaudio.mixers()\n print(f'Available PCMs: {pcms}')\n print(f'Available Mixers: {mixers}')\n self._device = alsaaudio.PCM(device=self._dev_name)\n...
[ "0.6390626", "0.6217115", "0.6020321", "0.58581", "0.58581", "0.5800524", "0.57745516", "0.57735896", "0.57705903", "0.57476455", "0.5725594", "0.56652147", "0.5661055", "0.5636666", "0.56116253", "0.5510369", "0.54754674", "0.545603", "0.543793", "0.5436496", "0.54292643", ...
0.5987934
3
Updates the learning rate given the learning rate decay. The routine has been implemented according to the original Lua SGD optimizer
def adjust_learning_rate(cfg, optimizer): for idx, group in enumerate(optimizer.param_groups): init_lr = cfg.TRAINING.LR if 'step' not in group: group['step'] = 0. else: group['step'] += 1. group['lr'] = init_lr * ( 1.0 - float(group['step']) * fl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_learning_rate(self) -> None:\n self.epsilon = self.initial_epsilon / (1. + self.rate_decay * self.n_it)\n return", "def update_learning_rate(self) -> None:\n self.epsilon = self.initial_epsilon / (1. + self.rate_decay * self.n_it)\n return", "def adjust_learning_rate(epoc...
[ "0.7998674", "0.7998674", "0.7924784", "0.78758246", "0.7808031", "0.78061086", "0.77633625", "0.7747445", "0.77214557", "0.7702527", "0.7682688", "0.76518416", "0.7618969", "0.76176", "0.7549213", "0.75402725", "0.7535187", "0.7533339", "0.75329775", "0.7531624", "0.7524894"...
0.7274595
63
opset version >= 7 without constant, supports multidirectional broadcasting
def test_add_00(): a_shape = (1, 1, 3, 4) b_shape = (1, 2, 3, 1) out_shape = (1, 2, 3, 4) class AddTester(Base): def create_onnx(self) -> onnx.ModelProto: node = make_node("Add", inputs=["A", "B"], outputs=["C"]) inputs = [ info("A", TensorProto.FLOAT, a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_broadcastable_flag_assignment_mixed_otheraxes(self):\r\n rng = numpy.random.RandomState(seed=utt.fetch_seed())\r\n a_val = rng.rand(1, 4, 1).astype(self.floatX)\r\n b_val = rng.rand(1, 3, 1).astype(self.floatX)\r\n\r\n a = self.shared(a_val, broadcastable=(False, False, True))\...
[ "0.6839294", "0.6629676", "0.6356896", "0.60827565", "0.5985856", "0.59603703", "0.58353823", "0.58211887", "0.5768522", "0.5743439", "0.56976795", "0.56452334", "0.55598474", "0.5537719", "0.54908377", "0.54591477", "0.5439411", "0.5410281", "0.5410027", "0.5380933", "0.5378...
0.0
-1
opset version >= 7 with one constant, unidirectional broadcasting (from constant to variable)
def test_add_01(): a_shape = (1, 2, 3, 4) b_shape = (1, 1, 3, 1) out_shape = (1, 2, 3, 4) class AddTester(Base): def create_onnx(self) -> onnx.ModelProto: node = make_node("Add", inputs=["A", "B"], outputs=["C"]) inputs = [info("A", TensorProto.FLOAT, a_shape)] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_constant_merge(self):\r\n x = tensor.constant([0, 0])\r\n y = x[1:]\r\n x1 = x - tensor.join(0, y, y)\r\n x1.eval()", "def test_broadcastable_flag_assignment_mixed_otheraxes(self):\r\n rng = numpy.random.RandomState(seed=utt.fetch_seed())\r\n a_val = rng.rand(1,...
[ "0.6793098", "0.6374684", "0.6218704", "0.5922786", "0.59150815", "0.58355796", "0.58200294", "0.57699984", "0.5615132", "0.55471385", "0.5541711", "0.5529277", "0.5517939", "0.5499847", "0.5453383", "0.5414", "0.5378767", "0.53565", "0.53030837", "0.52280957", "0.52184755", ...
0.0
-1
opset version >= 7 with one constant, support multidirectional broadcasting
def test_add_02(): a_shape = (1, 1, 3, 4) b_shape = (1, 2, 3, 1) out_shape = (1, 2, 3, 4) class AddTester(Base): def create_onnx(self) -> onnx.ModelProto: node = make_node("Add", inputs=["A", "B"], outputs=["C"]) inputs = [info("A", TensorProto.FLOAT, a_shape)] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_broadcastable_flag_assignment_mixed_otheraxes(self):\r\n rng = numpy.random.RandomState(seed=utt.fetch_seed())\r\n a_val = rng.rand(1, 4, 1).astype(self.floatX)\r\n b_val = rng.rand(1, 3, 1).astype(self.floatX)\r\n\r\n a = self.shared(a_val, broadcastable=(False, False, True))\...
[ "0.6812493", "0.66146225", "0.61402386", "0.61263394", "0.6123149", "0.60364264", "0.5765646", "0.5745924", "0.5641482", "0.5619613", "0.559679", "0.554742", "0.55110455", "0.54270613", "0.54255366", "0.54191077", "0.5353185", "0.5352743", "0.5335017", "0.5330273", "0.5327996...
0.0
-1
opset version >= 7 with one constant, different shape length
def test_add_03(): a_shape = (1, 2, 3, 4) b_shape = (3, 4) out_shape = (1, 2, 3, 4) class AddTester(Base): def create_onnx(self) -> onnx.ModelProto: node = make_node("Add", inputs=["A", "B"], outputs=["C"]) inputs = [info("A", TensorProto.FLOAT, a_shape)] ou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shape(self):", "def shape(self):", "def set_shape(self, shape):\n self._shape = self._shape.merge_with(shape)", "def _create_constantOfShape(cls, onnx_node, inputs, opset_version):\n value = onnx_node.getattr(\"value\", 0)\n if isinstance(value, onnx.TensorProto):\n value = nu...
[ "0.61253786", "0.61253786", "0.58548445", "0.5691355", "0.5662918", "0.5662918", "0.5662918", "0.56028473", "0.55419725", "0.5537185", "0.5467695", "0.5451015", "0.5424744", "0.5399343", "0.5350812", "0.530797", "0.52868277", "0.5272347", "0.5266632", "0.5253986", "0.5251285"...
0.0
-1
Adds a piece to the board
def add_piece(self, piece, to): if self.nodes[to].piece != None: raise ValueError('A piece is already on %d' % to) piece.position = to self.nodes[to].piece = piece self.nodes[to].piece.set_active(to)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_piece(self, pos, piece):\n self._board[self.ind(pos)[0]][self.ind(pos)[1]] = piece", "def addPiece(self, piece):\r\n \r\n self.pieces[(piece.x, piece.y)] = piece", "def add_piece(self, piece: Model):\n new_piece_coordinates = piece.get_block_positions()\n for coordina...
[ "0.86562353", "0.8255723", "0.801781", "0.7840451", "0.77984595", "0.76705074", "0.7596147", "0.75771093", "0.75207424", "0.7477025", "0.7434337", "0.7304883", "0.72651815", "0.7262187", "0.7255899", "0.72035354", "0.72035354", "0.715528", "0.7088152", "0.7035828", "0.6807681...
0.77396965
5
Removes a piece from the board
def remove_piece(self, at): if self.nodes[at].piece == None: raise ValueError('There is no piece on %d' % at) piece = self.nodes[at].piece piece.position = 0 self.nodes[at].piece = None return piece
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_piece(self) -> None:\r\n if self.has_piece():\r\n self.piece.square = None\r\n self.piece = None", "def remove_piece(self, piece):\n\n self._active_pieces[piece.get_color()].remove(piece)", "def remove_piece(self, piece):\n if piece.color not in (PieceColor...
[ "0.82775944", "0.80571663", "0.777415", "0.73373204", "0.71168053", "0.7092531", "0.6984404", "0.69489413", "0.6819277", "0.68046093", "0.67357", "0.6716254", "0.66812146", "0.6656152", "0.66402316", "0.6612892", "0.6570663", "0.64808935", "0.6480726", "0.6442365", "0.6374603...
0.748622
3
Get piece from a specific spot on the board
def get_piece(self, at): return self.nodes[at].piece
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_piece(self, position):\n return self.board[position[0]][position[1]]", "def piece_at(self, row, col):\n return self.board[row + PADDING][col + PADDING]", "def get_piece(self, x, y):\n if self.in_bounds(x, y) and self.piece_at(x, y):\n return self.__board[(x, y)]\n ...
[ "0.80113655", "0.80002975", "0.79005766", "0.79001164", "0.78558433", "0.78558433", "0.7683801", "0.7669871", "0.7669871", "0.71842057", "0.71254873", "0.7050126", "0.703427", "0.70129466", "0.6963438", "0.6932408", "0.6923292", "0.69111806", "0.6737257", "0.6735563", "0.6671...
0.7284652
9
Query multiple pieces from the board
def get_pieces(self, at): ret = [] for pos in at: ret.append(self.nodes[pos].piece) return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query3() :", "def get_all_pieces(self, player):\n pieces = []\n for row in range(constant.BOARD_DIMENSION):\n for col in range(constant.BOARD_DIMENSION):\n piece = self.get_piece((row, col))\n if piece is not None and piece.get_player() is player:\n ...
[ "0.6084906", "0.60058707", "0.56499594", "0.56436837", "0.5614087", "0.55858004", "0.54936635", "0.54693866", "0.54228354", "0.54124844", "0.53970665", "0.5369936", "0.5368547", "0.53533435", "0.5331866", "0.52727354", "0.5243431", "0.52299166", "0.5229304", "0.52110046", "0....
0.48796064
64
Fetch available nodes to add pieces to
def open_spots(self): ret = [] for i in range(1,25): if self.nodes[i].piece == None: ret.append(i) return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collect_nodes(self):\n free_nodes = Node.query.filter_by(project_id=None).all()\n return free_nodes", "def get_nodes(self):\n try:\n for node in Linode.search(status=Linode.STATUS_RUNNING):\n self.add_node(node)\n except chube_api.linode_api.ApiError, e:\...
[ "0.6081736", "0.5898886", "0.5657423", "0.55999583", "0.55570346", "0.5542981", "0.55416477", "0.55407", "0.55383253", "0.5496597", "0.54894286", "0.54810447", "0.5477685", "0.5467673", "0.5419162", "0.53585625", "0.5351017", "0.53359133", "0.53199905", "0.5301875", "0.529070...
0.0
-1
Add node to board, ideally this should be in a graph class
def add_node(self, name, edges): self.nodes[name] = Node(edges)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_node(self, node):", "def add_node (self, node):\n self.network.add_node(node.id)\n self.network.node[node.id] = node", "def _add_node(self, node: int) -> None:\r\n self.nodes.add(node)", "def add_node(self, new_node: 'GraphNode'):\n self.operator.add_node(new_node)", "def add_no...
[ "0.75750375", "0.7429405", "0.7128161", "0.7119874", "0.7117403", "0.7116701", "0.71152544", "0.7024839", "0.699839", "0.6989343", "0.6966593", "0.69443744", "0.69167686", "0.6860622", "0.68605787", "0.6819962", "0.6815522", "0.6780451", "0.6749152", "0.67252934", "0.67252934...
0.6288906
55
Print out the board
def draw(self): ui.clear() ui.draw_board(self) ui.output_buffer()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_board(self):\n print('Board:')\n print('\\n'.join([''.join(['{:4}'.format(item) for item in row]) for row in self.board]))", "def printBoard(self):", "def print_board(self):\n print_sp = functools.partial(print, end=' ')\n print_sp(' ')\n for i in range(BOARD_SIZE)...
[ "0.89779043", "0.8947598", "0.88588274", "0.8844566", "0.8823392", "0.88215196", "0.88180214", "0.8811988", "0.87717533", "0.876771", "0.87462115", "0.8708502", "0.8678545", "0.8675921", "0.8675921", "0.8675462", "0.8656629", "0.8637947", "0.8619705", "0.86120975", "0.8606764...
0.0
-1
Validate that the username is alphanumeric and is not already in use.
def clean_username(self): existing = UserModel().objects.filter(username__iexact=self.cleaned_data['username']) if existing.exists(): raise forms.ValidationError(_("A user with that username already exists.")) else: return self.cleaned_data['username']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invalid_username(username):\n word_letters = re.sub('[^a-zA-Z-0-9]+', '', str(username))\n if any(item.isalpha() for item in word_letters):\n return False\n return True", "def is_valid_username(self, username):\n rex = \"^[a-zA-Z]{3,}$\"\n return re.match(rex, us...
[ "0.83527476", "0.8211548", "0.814784", "0.8135848", "0.80751944", "0.805189", "0.8022534", "0.7915178", "0.7838989", "0.7788622", "0.77661186", "0.7763223", "0.77551514", "0.7739912", "0.7730911", "0.76976854", "0.76933587", "0.7691296", "0.76390404", "0.76375985", "0.7623782...
0.71930707
48
Verifiy that the values entered into the two password fields match. Note that an error here will end up in ``non_field_errors()`` because it doesn't apply to a single field.
def clean(self): if 'password1' in self.cleaned_data and 'password2' in self.cleaned_data: if self.cleaned_data['password1'] != self.cleaned_data['password2']: raise forms.ValidationError(_("The two password fields didn't match.")) return self.cleaned_data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_password(self):\n password1 = self.cleaned_data.get('password1')\n password2 = self.cleaned_data.get('password2')\n if password1 and password2 and password1 != password2:\n raise forms.ValidationError('Passwords do not match')\n return password2", "def clean(self)...
[ "0.79393995", "0.78751373", "0.7869208", "0.7735661", "0.7653578", "0.76377136", "0.76262844", "0.7619865", "0.76103294", "0.75963074", "0.7589395", "0.7565969", "0.75650203", "0.75650203", "0.756335", "0.7547981", "0.7527759", "0.74647665", "0.7378254", "0.7376154", "0.73637...
0.7840083
4
RawDataSettingsV1 a model defined in Swagger
def __init__(self, data_aggregation_setting=None, raw_data_setting=None, units_setting=None, work_hours_setting=None): # noqa: E501 # noqa: E501 self._data_aggregation_setting = None self._raw_data_setting = None self._units_setting = None self._work_hours_setting = None self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def settings(self):\r\n return SettingResource(self)", "def __init__(self):\n self.swagger_types = {\n 'id_conta': 'int',\n 'id_pessoa': 'int',\n 'id_cartao': 'int',\n 'id_bandeira': 'int',\n 'id_tipo_cartao': 'int',\n 'numero_cartao...
[ "0.5676389", "0.54149365", "0.5402188", "0.5402188", "0.5402188", "0.5402188", "0.53956246", "0.52993757", "0.52934015", "0.5281497", "0.5281497", "0.5281497", "0.5281497", "0.5281497", "0.52318376", "0.51716846", "0.5169025", "0.5159348", "0.51388633", "0.5103993", "0.510148...
0.0
-1
Sets the data_aggregation_setting of this RawDataSettingsV1.
def data_aggregation_setting(self, data_aggregation_setting): self._data_aggregation_setting = data_aggregation_setting
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aggregate(self, aggregation):\n self._data = self._data.aggregate(**aggregation)", "def query_aggregation(self, query_aggregation: ConfigNodePropertyBoolean):\n\n self._query_aggregation = query_aggregation", "def raw_data_setting(self, raw_data_setting):\n\n self._raw_data_setting = r...
[ "0.618007", "0.5699229", "0.5593449", "0.5534642", "0.5492791", "0.5159963", "0.51563", "0.5152062", "0.51290625", "0.48896068", "0.48860914", "0.4833387", "0.47638878", "0.47190312", "0.47081825", "0.465748", "0.4626875", "0.46223742", "0.46195033", "0.4480558", "0.44752845"...
0.8585378
0
Sets the raw_data_setting of this RawDataSettingsV1.
def raw_data_setting(self, raw_data_setting): self._raw_data_setting = raw_data_setting
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def raw(self, raw):\n\n self._raw = raw", "def setOnIRRawDataHandler(self, IRRawDataHandler):\r\n if IRRawDataHandler == None:\r\n self.__IRRawDataDelegate = None\r\n self.__onIRRawDataHandler = None\r\n else:\r\n self.__IRRawDataDelegate = IRRawDataHandler\r...
[ "0.55611116", "0.5153382", "0.5131934", "0.509038", "0.508902", "0.5088541", "0.5048942", "0.50320804", "0.49918416", "0.4986974", "0.49691084", "0.49691084", "0.49691084", "0.49582824", "0.4947286", "0.49458918", "0.49458918", "0.49162272", "0.49108624", "0.48483956", "0.480...
0.8099918
0
Sets the units_setting of this RawDataSettingsV1.
def units_setting(self, units_setting): self._units_setting = units_setting
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_units(self, units):\n self.units = units", "def units(self, units):\n\n self._units = units", "def units(self, units):\n\n self._units = units", "def units(self, units):\n\n self._units = units", "def setUnits(self, *args):\n return _libsbml.Parameter_setUnits(sel...
[ "0.73392993", "0.69501215", "0.69501215", "0.69501215", "0.6416668", "0.64136463", "0.6368304", "0.62724364", "0.62644994", "0.6144763", "0.61432904", "0.6136528", "0.6065689", "0.59879696", "0.5953695", "0.5952562", "0.59308696", "0.583724", "0.5836631", "0.5828655", "0.5815...
0.81460136
0
Sets the work_hours_setting of this RawDataSettingsV1.
def work_hours_setting(self, work_hours_setting): self._work_hours_setting = work_hours_setting
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def work_hours(self, work_hours):\n if work_hours is not None and len(work_hours) > 1024:\n raise ValueError(\"Invalid value for `work_hours`, length must be less than or equal to `1024`\") # noqa: E501\n\n self._work_hours = work_hours", "def engine_hours(self, engine_hours):\n\n ...
[ "0.7084544", "0.62833107", "0.61234754", "0.5710867", "0.53572357", "0.53548336", "0.5301712", "0.5130025", "0.50256395", "0.49284708", "0.49263301", "0.49175677", "0.4872653", "0.48705786", "0.4800906", "0.47688413", "0.47624823", "0.475025", "0.47354597", "0.4734547", "0.47...
0.8516128
0
Returns the model properties as a dict
def to_dict(self): result = {} for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dict(self):\n return self.properties", "def to_dict(self):\n return self.properties", "def get_properties(self):\n return self.properties", "def asdict(self):\n return self._prop_dict", "def json(self):\n rv = {\n prop: getattr(self, prop)\n f...
[ "0.7751993", "0.7751993", "0.73391134", "0.7334895", "0.7297356", "0.727818", "0.7159078", "0.71578115", "0.71494967", "0.71494967", "0.71283495", "0.71275014", "0.7122587", "0.71079814", "0.7060394", "0.7043251", "0.7034103", "0.70233124", "0.69635814", "0.69586295", "0.6900...
0.0
-1
Returns the string representation of the model
def to_str(self): return pprint.pformat(self.to_dict())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self) -> str:\n # noinspection PyUnresolvedReferences\n opts = self._meta\n if self.name_field:\n result = str(opts.get_field(self.name_field).value_from_object(self))\n else:\n ...
[ "0.8585678", "0.7814723", "0.77902746", "0.7750817", "0.7750817", "0.7713574", "0.7699132", "0.7670784", "0.76510423", "0.7600937", "0.7582941", "0.7570682", "0.75406617", "0.75233835", "0.75168735", "0.75013274", "0.74877244", "0.74877244", "0.74700385", "0.7451798", "0.7446...
0.0
-1
For `print` and `pprint`
def __repr__(self): return self.to_str()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pprint(*args, **kwargs):\n if PRINTING:\n print(*args, **kwargs)", "def print_out():\n pass", "def custom_print(*objects):\n print(*objects, sep=OFS, end=ORS)", "def _print(self, *args):\n return _ida_hexrays.vd_printer_t__print(self, *args)", "def _printable(self):\n ...
[ "0.75577617", "0.73375154", "0.6986672", "0.698475", "0.6944995", "0.692333", "0.6899106", "0.6898902", "0.68146646", "0.6806209", "0.6753795", "0.67497987", "0.6744008", "0.6700308", "0.6691256", "0.6674591", "0.6658083", "0.66091245", "0.6606931", "0.6601862", "0.6563738", ...
0.0
-1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, RawDataSettingsV1): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
generates the header for assignment output
def printinfo(assign, question): print("Last Name: Bell") print ("First Name: Daniel") print("Student ID: 282911") print("Course: CPSC 231") print("Tutorial Section: T02") print("Assignment: %d" %assign) print("Question: %s" %question) print("")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _write_header(self):\n # The last line here must not have a trailing \\n\n self.buffer.write_line(\"def template(self, __io, model=None):\")\n self.buffer.scope_line(\"view = self\")", "def get_export_header(self):\n\n name = self.get_name()\n\n if (self.name == \"input::no...
[ "0.72413003", "0.7237497", "0.7199962", "0.7104819", "0.70822805", "0.7021721", "0.70035905", "0.6988374", "0.69747543", "0.69422114", "0.6918034", "0.68923366", "0.688566", "0.68846303", "0.68395203", "0.68201035", "0.68120456", "0.6800301", "0.6791257", "0.67902493", "0.675...
0.0
-1
inits the object, with values of 0 to protect against no value errors in other methods
def __init__(self): self.numList=[]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n super().__init__()\n self._value = 0", "def __init__(self,value = 0):\n\n self.value = value", "def __init__(self, number=0):\n pass", "def zero(self):\n raise NotImplementedError(\"Not implemented yet.\")", "def zero_val(self):\r\n self.piDD ...
[ "0.800719", "0.7946615", "0.7367123", "0.73323214", "0.7261704", "0.71752465", "0.7130411", "0.71284276", "0.7083874", "0.697472", "0.6929415", "0.6891028", "0.6869955", "0.68258363", "0.6821319", "0.6815354", "0.6778108", "0.67717993", "0.674683", "0.6744222", "0.6740247", ...
0.0
-1
opens a file and takes the numbers and generates a list with one integer per list location
def getInput(self): numbersFile = open("transactions.txt", "r") for line in numbersFile: delimLocStart=0 delimLocEnd=0 nextInt=0 while delimLocEnd>-1: delimLocEnd=line.find(' ',delimLocStart) self.numList.append(float(line...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_file_into_ints(filename):\n lines = read_file_into_list(filename)\n list_of_lists = []\n for line in lines:\n list_of_lists.append(read_lines_of_ints))\n return list_of_lists", "def create_from_file(self, file):\n self.value = []\n with open(file, \"r\") as f:\n ...
[ "0.7508075", "0.7258362", "0.7023892", "0.7009818", "0.6923921", "0.69237477", "0.69066566", "0.68623686", "0.68020916", "0.6796499", "0.6658064", "0.65772575", "0.656117", "0.655933", "0.65519243", "0.65110296", "0.64853346", "0.64551485", "0.644206", "0.64388824", "0.643213...
0.0
-1
computes the closing balance, reports the invalid transactions and displays the closing balance as well as the account status
def balance(self): #a couple of assumptions not clear in assignment #1) there is always an invalid transaction #2) there is only 1 invalid transaction closeBalance=0 invalidTrans=0 withdrawCount=0 depositCount=0 # print(self.numList) for i in range(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def displayBalance(self):\n orders = self.trader.tradeData.get(\n 'openOrders',\n 'Failed to read orderCount')\n# uncomment 3 lines below for orderType debug printing\n## ordertype = type(orders)\n# print'DEBUG: helper.displayBalance orders TYPE is',ordertype\n# print'DEBUG: hel...
[ "0.6902592", "0.6551523", "0.6535679", "0.64133596", "0.6371079", "0.6279522", "0.6243903", "0.62162966", "0.6196909", "0.61803025", "0.6129244", "0.60479075", "0.60446423", "0.6038427", "0.60363066", "0.6032662", "0.5967132", "0.5929868", "0.5929786", "0.59251976", "0.590185...
0.74515235
0
Override this if the irc server's auth mechanism differs
def _authenticate(self): from getpass import getpass password = getpass() self.msg('nickserv', 'identify %s' % password)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _authenticate(self):\n auth = self.settings.get(\"auth\")\n if auth:\n if auth == Auth.PLAIN:\n self._authenticate_plain()\n elif auth == Auth.SHA256_MEMORY:\n self._authenticate_sha256_memory()\n elif auth == Auth.MYSQL41:\n ...
[ "0.68123597", "0.6726195", "0.6478659", "0.6468025", "0.6464394", "0.6427196", "0.64128363", "0.64128363", "0.63928753", "0.6375842", "0.6355322", "0.62452173", "0.61833316", "0.61575353", "0.6104545", "0.60920966", "0.6082032", "0.6053571", "0.6002294", "0.5984946", "0.59610...
0.6674549
2
extract pages from different years
def gettotal(self, response): url = 'http://www.ppdai.com/blacklist/' years = xrange(2008,2016) urls = [url+str(year) for year in years] for url in urls: # print url, "year url" yield Request(url, callback=self.extract, dont_filter=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_year_with_links():\n response = get_response(MAIN_PAGE)\n if response.ok:\n soup = BeautifulSoup(response.text, 'html.parser')\n years_li = soup.find_all(\n 'md-card-footer'\n )\n years_dict = {}\n # Not including the last <a> tag because that is not rele...
[ "0.6831878", "0.64018196", "0.639483", "0.6349675", "0.6259942", "0.62433875", "0.62387437", "0.62323767", "0.6202659", "0.6133455", "0.61117053", "0.61112595", "0.60211354", "0.6009105", "0.59391546", "0.59389365", "0.5921771", "0.588895", "0.58809245", "0.584313", "0.579021...
0.5684676
26
extract pages and then Request those pages sequecely
def extract(self, response): # print response.url,"extract response url" sel = response.selector pages = [] try: # print "pages work" pages = sel.xpath("//div[contains(@class,'fen_ye_nav')]//td/text()").re(u"共([\d]{1,3})页") # print pages except...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identify_and_parse_page(self, response):\n if self.initial_page_filter(response):\n if self.is_index_page(url=response.url, response=response):\n self.process_index_page(response)\n elif self.is_captcha_page(response.url, response):\n self.process_capt...
[ "0.68995947", "0.67791885", "0.65988064", "0.65479517", "0.6542743", "0.64892554", "0.6487471", "0.64674", "0.6452624", "0.64335346", "0.64018846", "0.63740575", "0.63678265", "0.63652563", "0.6361725", "0.6356936", "0.6353673", "0.63518137", "0.63436663", "0.6335191", "0.632...
0.74264663
0
get user name from xtml
def getUserName(self, response): sel = response.selector blackTr = sel.xpath(u"//table[contains(@class,'black_table')]/tr[position()>1]//p[contains(text(),'真实姓名')]/a/@href").extract() url = 'http://www.ppdai.com' urls = [url+i for i in blackTr] redis_key = 'ppai_blacklist_redis_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"user_name\")", "def user():\n\treturn request.authorization.username if zk.get_http_login() else zk.get_username()", "def user_name(self) -> str:\n return pulumi.get(self, \"user_name\")", "def get_userid(node_name):\n ur...
[ "0.65883946", "0.65677917", "0.6559476", "0.65406376", "0.6502262", "0.6502262", "0.6502262", "0.64922655", "0.6462299", "0.6449763", "0.63533145", "0.63533145", "0.634153", "0.62913275", "0.6287054", "0.6287054", "0.6285421", "0.6243921", "0.6200501", "0.61888397", "0.616778...
0.0
-1
prepare a named wrapper function. Just register and return the orginal function
def __call__(self, path): def wrapper(application): self.register(path, application) return application return wrapper
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dummy_wrapper(func):\n return func", "def hook(self, name):\r\n def wrapper(func):\r\n self.hooks.add(name, func)\r\n return func\r\n return wrapper", "def __wrap_function(self, wrapper, funcname):\n try:\n function = getattr(wrapper, funcname)\n ...
[ "0.77037454", "0.7134496", "0.70296323", "0.70287156", "0.6987295", "0.6979319", "0.69488204", "0.6916175", "0.6914122", "0.6914122", "0.6894224", "0.6788724", "0.67552793", "0.6736525", "0.6627344", "0.6593548", "0.6577233", "0.65622544", "0.6560702", "0.65248144", "0.652086...
0.0
-1
check whether the input is in self.app_path
def check_path(self, path): if path in self.app_path: return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_study_app_request(context):\n # NOTE: This assumes 'scopes' was overwritten by get_context_data.\n scopes = [x[0] for x in context['scopes']]\n\n try:\n scopes.remove('read')\n scopes.remove('write')\n except ValueError:\n return False\n\n ...
[ "0.70307356", "0.65499437", "0.65499437", "0.65025043", "0.63630617", "0.63465846", "0.63110805", "0.6154497", "0.6062121", "0.604911", "0.59717196", "0.5928342", "0.5911152", "0.5910593", "0.5897845", "0.5871106", "0.58121234", "0.57989126", "0.5795736", "0.5753665", "0.5745...
0.8126205
0
convert "a b k=v i input ok" into
def _arg2kw(self, mixed_args): def insert(dict_, k, v): if k in dict_: print "duplicated args : %s " % kv[0] raise ArgParseError dict_[k] = v opts = [] args = {} n = len(mixed_args) i = 0 while i < n: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_input(x):\n return '_'.join([x.split('_')[0], 'Input'])", "def input_assignment(in_dict):\n\n # define initialization & assignment strings\n init_str= \"\"\n assign_str= \"\"\n\n # loop through elements\n for key,value in in_dict.items():\n # Check if type is a boolean\n if...
[ "0.59333664", "0.56514996", "0.5502732", "0.5442471", "0.53903466", "0.5385327", "0.5385023", "0.5351632", "0.5200851", "0.5185996", "0.5135325", "0.50989395", "0.5060792", "0.5000765", "0.49917033", "0.49798575", "0.4973992", "0.49601236", "0.49458593", "0.49335364", "0.4908...
0.0
-1
print the help of certain path
def print_path_help(self, path): (app, type) = self.app_path[path] if type == "func": print " %s [%s] --> %s" % (path, type, Job.get_func_help(app)) for line in _decode(app.__doc__).split("\n"): print " " + line print Job.get_func_config(app, prefi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printhelp():", "def help():", "def print_help():\n\tprint(\"Help text\")", "def printHelp(self,):\n print man\n return 0", "def print_help():\n print \"\\n# File Operations:\"\n print \" put [lpath] [spath] - upload file from lpath to spath\"\n print \" get [spath] [lpath] - ...
[ "0.8231136", "0.79619616", "0.7843273", "0.7803809", "0.7705823", "0.76932484", "0.7634154", "0.76058567", "0.7587188", "0.7532899", "0.7528087", "0.75192934", "0.7501078", "0.74836916", "0.74617296", "0.74469227", "0.74133873", "0.73650616", "0.73557925", "0.73522794", "0.73...
0.7813238
3
entrance for Router object.
def main(self): cmd, path, args = self._parse_args() if cmd == "shell": print "You are now in ubs shell." print "Use \"python %s help\" to see other choice." % sys.argv[0] self.shell() elif cmd == "help": self.print_path_help(path) sys....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, router):\n self._router = router", "def __init__(self, router):\n\n self.router = router", "def mvcRouter(self, router):\n pass", "def __call__(self, req):\n return self._router", "def route(self):\n pass", "def route(self) -> APIRouter:\n ...
[ "0.8090666", "0.8070023", "0.7809845", "0.7749968", "0.7702932", "0.75024384", "0.71514255", "0.71069914", "0.6826849", "0.68007636", "0.6719178", "0.6681395", "0.66336304", "0.65575904", "0.65477514", "0.64902806", "0.6480443", "0.6478184", "0.64539284", "0.64265925", "0.641...
0.0
-1
list all jobs. similar to print_paths in Router._parse_args.
def do_ls(self, pattern=""): if pattern: print "The available jobs with substring %s are:" % pattern else: print "The available jobs are:" app_order = self.router.app_order app_path = self.router.app_path n = len(self.router.app_order) j =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list(self):\n return self.rpc.call(MsfRpcMethod.JobList)", "def list_jobs(exproot, **kwargs):\n for jobname, args, results in load_all(exproot):\n print jobname, args, results", "def list(self):\n self.background_scheduler.print_jobs()", "def jobs():\n result = []\n out = su...
[ "0.7427727", "0.72480106", "0.70828485", "0.6848848", "0.6786086", "0.67394936", "0.67394936", "0.6674714", "0.6565417", "0.65318954", "0.652477", "0.6522808", "0.6501198", "0.6461134", "0.64586973", "0.6453166", "0.6449643", "0.6425356", "0.64079046", "0.63801163", "0.634079...
0.68294346
4
run job with args
def _do_run(self, path, args): try: self.router.route(path, args) except TypeError, e: # To catch the follow errors # TypeError: xxxx got an unexpected keyword argument 'k' # TypeError: 'print_my_good() takes at least 1 argument (0 given)' pri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self, args: argparse.Namespace) -> None:\n pass", "def run(self, args):\n pass", "def run(self, args):\n\n return", "def exec_from_args(args):\n outfolder = args.folder + '/normal/'\n check(outfolder, 'm')\n\n makeconfig(str(args.gene_names), str(args.sequences), str(arg...
[ "0.7170381", "0.71216786", "0.7066303", "0.6941941", "0.69396836", "0.67077863", "0.6650455", "0.6639066", "0.65791756", "0.65340745", "0.6516193", "0.651259", "0.6485397", "0.6460591", "0.64583904", "0.6366622", "0.6366622", "0.63628244", "0.6344635", "0.63270414", "0.632426...
0.66718894
6
invoke hadoop dfs commands
def do_dfs(self, line): args = filter(None, line.strip().split()) if not args: self.help_dfs() else: cmds = ["dfs"]+args (retcode, stdout) = hadoop_cmd(cmds, MJob.hadoop_home) if retcode is False: pass # Popen failed els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hadoop(self, command, *args, **kwargs):\n hadoop_cmd = \"-{}\".format(re.sub(\"^-*\", \"\", command))\n return self.exec(\"hadoop fs\", hadoop_cmd, *args, **kwargs)", "def run_cmd(cmd):\n command = cmd.split(\" \")[0]\n if command == \"ls\":\n r = requests.get(url.format(cmd.split(...
[ "0.7834996", "0.69288254", "0.68616354", "0.67395175", "0.65236706", "0.62854147", "0.61580133", "0.60025924", "0.5775269", "0.5685871", "0.5550844", "0.5356002", "0.53527516", "0.5334417", "0.5288347", "0.52522856", "0.5249708", "0.52452034", "0.5217709", "0.5211675", "0.519...
0.78665143
0
print help for each job.
def do_info(self, line): args = filter(None, line.strip().split()) if len(args) != 1 or args[0] not in self.router.app_order: self.help_info() else: self.router.print_path_help(args[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printHelp():\n print(\"amqWorkApiMass.py -n <msgcnt> -b <body> -m <headers> -s <path/to/bodyandheaders>\")", "def printhelp():", "def print_help(self):\n print self.get_help()", "def help(self):\n self._log.info('### Help for the class %s ###',\n self.__class__)\n ...
[ "0.76781464", "0.7593428", "0.7345702", "0.71013474", "0.70232344", "0.6999698", "0.6964544", "0.695542", "0.6933385", "0.69311017", "0.68908525", "0.6882957", "0.6871331", "0.68548465", "0.68440026", "0.6832554", "0.68101287", "0.6774656", "0.6766763", "0.6762168", "0.673569...
0.0
-1
print cmd string with config args
def do_string(self, line): args = filter(None, line.strip().split()) if not args or args[0] not in self.router.app_order: self.help_string() else: app, type = self.router.app_path[args[0]] if hasattr(app, "to_formatted_string"): try...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_config_option(args, run):\n print_config(run)\n print(\"-\" * 79)", "def show_config(config, args):\n pprint.pprint(config)", "def cmdPrint( self, *args):\n return self.cmd( *args, **{ 'verbose': True } )", "def main():\n\tparser = setup_argument_parser()\n\targuments = parser.parse...
[ "0.7261646", "0.67978716", "0.6693429", "0.6688669", "0.66267985", "0.6588785", "0.6533029", "0.6514909", "0.6493375", "0.6493375", "0.6488346", "0.6457207", "0.63778806", "0.633908", "0.633908", "0.633908", "0.633908", "0.633908", "0.633908", "0.633908", "0.633908", "0.633...
0.6363203
13
set the status variable
def do_set(self, line): vs = filter(None, line.strip().split()) if len(vs) == 2 : if vs[0] == 'remove' : if vs[1] in ("True", "T", "False", 'F'): if vs[1].startswith("T"): self.v_remove = True print ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetStatus(self, status):\r\n self.status = status", "def setstatus(self, status):\n with self.lock:\n self.status = status", "def status(self, status):\n self._status = status", "def status(self, status):\n self._status = status", "def status(self, status):\n s...
[ "0.8019738", "0.79827607", "0.79072666", "0.79072666", "0.79072666", "0.79072666", "0.79072666", "0.79072666", "0.79072666", "0.7894867", "0.7894867", "0.7894867", "0.7892326", "0.7877445", "0.78544396", "0.7818992", "0.76583314", "0.76583314", "0.76583314", "0.76583314", "0....
0.0
-1
The default emptyline function is to repeat last command, which will cause trouble. So overide it here.
def emptyline(self): self.do_ls("")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def emptyline(self):", "def emptyline(self):\n pass", "def emptyline(self):\n pass", "def emptyline(self):\n pass", "def emptyline(self):\n pass", "def emptyline(self):\n pass", "def emptyline(self):\n pass", "def emptyline(self):\n pass", "def empty...
[ "0.8541223", "0.8402256", "0.8402256", "0.8402256", "0.8402256", "0.8402256", "0.8402256", "0.8402256", "0.8402256", "0.8402256", "0.8402256", "0.8402256", "0.8402256", "0.8402256", "0.8402256", "0.8402256", "0.8402256", "0.8402256", "0.8126019", "0.8126019", "0.7686502", "...
0.8191993
18
Configure logger & establish connections to cache and datastore
def __init__(self): super(GithubCollector, self).__init__() config_file = ('collectors.cfg') log_file = self.config['Github']['log_file'] logging.config.fileConfig(config_file, defaults={'GithubCollector': log_file} ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _configure_logging(self):\n pass", "def setUp(self):\n self.logger = logging.getLogger(\"dbs test logger\")", "def setup_logging():\n log.setup('keystone')", "def setup_log(self):\n self.logger, _ = get_logger(\"datatransform\")", "def _initialize_logging(self):\n LOG_CFG...
[ "0.70791715", "0.70269555", "0.69414663", "0.680182", "0.67275405", "0.66742843", "0.66312176", "0.6614516", "0.656493", "0.6555881", "0.6544711", "0.64502525", "0.6445092", "0.6435275", "0.6430008", "0.6428797", "0.6425268", "0.63958174", "0.63820404", "0.63766557", "0.63721...
0.64725924
11
Defines the representation of the object when repr() is called
def __repr__(self): return 'GithubCollector()'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repr_(object_):\n return repr(object_)", "def __str__(self):\r\n return repr(self)", "def __str__(self):\n return repr(self)", "def __repr__(self):\n # this is a good default __repr__\n # Q: using the docs, can you figure out what this is doing?\n return f\"<{type(se...
[ "0.82272667", "0.7986017", "0.7953821", "0.7876725", "0.78491163", "0.7835722", "0.7831219", "0.7751952", "0.77349144", "0.7719723", "0.7719723", "0.7719723", "0.7719723", "0.7719723", "0.7701351", "0.76914734", "0.7631809", "0.7618589", "0.7618589", "0.7618589", "0.7618223",...
0.0
-1
Defines a less formal string representation for when str() is called on the object
def __str__(self): return 'A Github Data Collector'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def str_(object_):\n return str(object_)", "def __str__(self):\n raise NotImplementedError(\"__str__ not implemented for \"+str(type(self)))", "def __str__(self):\n return str(self.__s)", "def toString():", "def __str__(self):\r\n return repr(self)", "def __str__(self) -> str:", "de...
[ "0.83492774", "0.79554856", "0.793819", "0.7878389", "0.7877721", "0.7832299", "0.7832299", "0.7832299", "0.7832299", "0.7778626", "0.7763886", "0.77505666", "0.774716", "0.77039945", "0.7682694", "0.7679121", "0.7679121", "0.7679121", "0.7665273", "0.7654266", "0.7654266", ...
0.0
-1
Internal function that generates the filenames for json query results
def _generate_filename(doc_type, login, *args): filename = [] filename.append(doc_type) filename.append(login) for item in args: filename.append(item) filename.append(datetime.datetime.now().isoformat(timespec='microseconds')) filename = '_'.join(filen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resultFilepath(result):\n basePath = RESULTS_PATH+'/'+result['type']+'/'\n if result['type'] == 'artist':\n return basePath + result['name']['ids']['nameId']+'.json'\n else:\n print '__ERR : type de reponse non pris en charge'", "def results_filename(self): # FIXME: was called output_name in util\n...
[ "0.66211367", "0.6415069", "0.6334346", "0.62909114", "0.6206911", "0.5950879", "0.59498477", "0.59303254", "0.59273475", "0.58641165", "0.5835143", "0.58233386", "0.5821864", "0.5768262", "0.5766913", "0.57183534", "0.5698807", "0.5691755", "0.5665035", "0.5657826", "0.56571...
0.62047344
5
Used internally by all save queries to save the json responses to a file.
def _save_file(json_response, path, filename): if path is not None: if path[-1] != "/": path = path+"/" filepath = os.path.join(path, filename) if not os.path.exists(path): os.makedirs(path) with open(filepath+'.jso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _save(self):\n with open(self.file_path, 'w') as fid:\n json.dump(self.data, fid, indent=4, sort_keys=True)", "def save_data_file(self):\n with open(self.files['data'], 'w') as outfile:\n outfile.write(self.to_json())\n outfile.close()", "def save(self):\n\n ...
[ "0.7562435", "0.72366554", "0.7203025", "0.71439284", "0.7133526", "0.7059534", "0.7048523", "0.7038663", "0.700495", "0.70047414", "0.69964486", "0.6995348", "0.6982634", "0.68995", "0.68728", "0.687263", "0.68486494", "0.6822441", "0.680252", "0.67825866", "0.67530805", "...
0.716196
3
Used internally by all save queries to save the json responses directly to an elasticsearch node.
def _save_elasticsearch(self, json_response, index, doc_type): try: _ = self._ensure_es_index(index) data = self.elasticsearch.index(index=index, doc_type=doc_type, body=json.dumps(json_response)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize(self, value):\n # (Any) -> json\n # this is called when writing to elasticsearch", "def backup_es(esdoc_class, outfile=None):\n data = esdoc_class._index.get()\n idx_name = list(data)[0]\n data[idx_name][\"docs\"] = list(\n dict(_id=hit.meta.id, **hit.to_dict()) for hi...
[ "0.6234668", "0.6036308", "0.60285056", "0.57445127", "0.571755", "0.56642663", "0.56466454", "0.55992895", "0.55825806", "0.55509573", "0.5518996", "0.55122334", "0.5505802", "0.5483249", "0.5466571", "0.545259", "0.5443516", "0.54149437", "0.5413945", "0.53993225", "0.53986...
0.724785
0
Used internally when writing to elasticsearch to ensure a given index exists.
def _ensure_es_index(self, index): if not self.elasticsearch.indices.exists(index): try: self.elasticsearch.indices.create(index=index) except TransportError as error_msg: self.logger.error(str(error_msg.error)) return False sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_exists(self, index: str) -> bool:\n\n if self.es.indices.exists(index=index):\n return True\n return False", "def index_exists(self, index: str) -> bool:\n return self.__client__.indices.exists(index)", "def index_exists(self, index):\n req = requests.head(\n ...
[ "0.8182904", "0.76497215", "0.73477477", "0.7327194", "0.7218652", "0.7159125", "0.7102047", "0.69194615", "0.6916148", "0.6838917", "0.6767421", "0.6728982", "0.6684531", "0.6592431", "0.6525627", "0.6522849", "0.6518431", "0.6451222", "0.6449229", "0.6417483", "0.63714355",...
0.8055633
1
Internal function that checks for errors in the response payload of a query.
def _errors_exist(self, doc_type, login, response_payload): if "errors" in response_payload: for _, error in enumerate(response_payload["errors"]): message = ':'.join([doc_type, login, str(error)]) self.logger.error(message) return True return Fals...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_errors(self, json_loaded):\n\n content = json_loaded\n try:\n m = content[u'error'][u'message']\n c = content[u'error'][u'code']\n out= \"API Error code: {}\\nError message: {}\".format(c, m)\n raise InvalidQueryException(self.name, out)\n ...
[ "0.7422387", "0.71968293", "0.6642945", "0.6587353", "0.65683573", "0.6534608", "0.645114", "0.64146554", "0.6362711", "0.6357953", "0.63213056", "0.6299993", "0.61933005", "0.61858106", "0.6169288", "0.6158053", "0.6154138", "0.6147876", "0.61224186", "0.61172634", "0.610936...
0.6848484
2
Writes to either the filesystem or elasticsearch depending on the configuration settings.
def _write_to_datastore(self, index, doc_type, document, login, path): if self.config['Github']['datastore'] == 'filesystem': filename = self._generate_filename(doc_type, login) self._save_file(json.dumps(document), path, filename) elif self.config['Github']['datastore'] == 'elas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _save_elasticsearch(self, json_response, index, doc_type):\n try:\n _ = self._ensure_es_index(index)\n data = self.elasticsearch.index(index=index,\n doc_type=doc_type,\n body=json.dumps(json_resp...
[ "0.5568147", "0.553713", "0.53876334", "0.5316416", "0.52936685", "0.5262763", "0.5184505", "0.51619303", "0.51611596", "0.5145693", "0.50859374", "0.508506", "0.5059363", "0.50341135", "0.50315386", "0.49795464", "0.4977128", "0.49740523", "0.49292436", "0.49255317", "0.4922...
0.6313111
0
Saves user account information to disk by querying Github GraphQL v4 API.
def save_user(self, user, path=None): # Check if this user already exists in elasticsearch index = ''.join(['gh_user-', self.timestamp]) self._write_to_datastore(index=index, doc_type='GithubUser', document=user.response, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_accounts(account):\n account.save_account()", "def save_accounts(account):\n account.save_account()", "def save_users(user):\n user.save_user()", "async def github_user_info(self, ctx: commands.Context, username: str) -> None:\n async with ctx.typing():\n user_data = await...
[ "0.5895206", "0.5895206", "0.5842903", "0.5794815", "0.5791631", "0.5766027", "0.5755653", "0.5744066", "0.57106656", "0.57064176", "0.5683181", "0.56528974", "0.5606123", "0.55971473", "0.5578096", "0.55295384", "0.5487997", "0.54804254", "0.5474375", "0.5470711", "0.5453501...
0.61525184
0
Saves a list of commit comments made by this user.
def save_commit_comments(self, user, path=None): # Redis has an end_cursor if we've collected this data before end_cursor = self.redis.get(''.join(['gh:', user.login, ':commitComments:endCursor'])) if end_cursor: end_cursor = end_cursor.decode('utf-8') end_cursor = ''.joi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_comment(data):\n data['comment_id'] = len(commentslist) + 1\n data['date_created'] = datetime.datetime.now()\n # save to list\n commentslist.append(data)", "def save_comment(data):\n data['comment_id'] = len(commentslist) + 1\n data['message'] =\"message\"\n data['author'] = \"autho...
[ "0.63125753", "0.6055158", "0.57577026", "0.55333656", "0.5506833", "0.5483902", "0.5372578", "0.5357004", "0.5353247", "0.5295684", "0.529495", "0.5247602", "0.5233638", "0.5223587", "0.5222193", "0.5211724", "0.51945955", "0.5191858", "0.51756215", "0.51756215", "0.51756215...
0.65404683
0
Saves a list of users the given user is following.
def save_followers(self, user, path=None): # Redis has an end_cursor if we've collected this data before end_cursor = self.redis.get(''.join(['gh:', user.login, ':followers:endCursor'])) if end_cursor: end_cursor = end_cursor.decode('utf-8') end_cursor = ''.join(['"', end...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def follow(request, usertofollow):\n to_follow = Member.objects.get(user__username=usertofollow)\n user = Member.objects.get(user=request.user)\n user.following.add(to_follow)\n user.save()\n return redirect(request.META['HTTP_REFERER'])", "def user_follow():\n data = request.get_json(force=Tru...
[ "0.69355816", "0.67688566", "0.6658564", "0.6651736", "0.6648157", "0.65733564", "0.65351796", "0.6518383", "0.64550596", "0.6443208", "0.6435712", "0.63731456", "0.6302861", "0.6240195", "0.61509293", "0.6150184", "0.61276907", "0.6119643", "0.6114478", "0.6114478", "0.60812...
0.57590747
44
Saves a list of users the given user is followed by.
def save_following(self, user, path=None): # Redis has an end_cursor if we've collected this data before end_cursor = self.redis.get(''.join(['gh:', user.login, ':following:endCursor'])) if end_cursor: end_cursor = end_cursor.decode('utf-8') end_cursor = ''.join(['"', end...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_users(user):\n user.save_user()", "def user_follow():\n data = request.get_json(force=True)\n follower = User.query.get(data['follower'])\n following = User.query.get(data['following'])\n follower.followcheck.append(following)\n db.session.commit()\n return {'followed': True}", "d...
[ "0.6936854", "0.6849393", "0.6786146", "0.6598721", "0.65499127", "0.65400404", "0.6506863", "0.6477985", "0.6436378", "0.6383864", "0.6383864", "0.63777626", "0.62957805", "0.62954414", "0.6252979", "0.6220018", "0.6209032", "0.61851865", "0.61826056", "0.6167711", "0.616441...
0.5877941
38
Saves a list of gist comments made by this user.
def save_gist_comments(self, user, path=None): # Redis has an end_cursor if we've collected this data before end_cursor = self.redis.get(''.join(['gh:', user.login, ':gistComments:endCursor'])) if end_cursor: end_cursor = end_cursor.decode('utf-8') end_cursor = ''.join(['...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_comment(data):\n data['comment_id'] = len(commentslist) + 1\n data['date_created'] = datetime.datetime.now()\n # save to list\n commentslist.append(data)", "def save_comment(data):\n data['comment_id'] = len(commentslist) + 1\n data['message'] =\"message\"\n data['author'] = \"autho...
[ "0.6658145", "0.6442756", "0.5789015", "0.5736194", "0.5645761", "0.55168533", "0.5502217", "0.54077274", "0.5404561", "0.5373963", "0.5331853", "0.52870333", "0.5219599", "0.5178907", "0.5175677", "0.5168752", "0.5137833", "0.5137833", "0.5137833", "0.5137833", "0.51184213",...
0.646073
1
Saves a list of Gists the user has created.
def save_gists(self, user, path=None): # Redis has an end_cursor if we've collected this data before end_cursor = self.redis.get(''.join(['gh:', user.login, ':gists:endCursor'])) if end_cursor: end_cursor = end_cursor.decode('utf-8') end_cursor = ''.join(['"', end_cursor,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(self, gist_data):\n\n _data = json.dumps(Utils.merge_objects(self.__defaults, gist_data))\n\n response = requests.post(\n self.BASE_URL + '/gists',\n data = _data,\n headers = self.__headers\n )\n\n if response.status_code == 201:\n return response.json()\n\n raise Gis...
[ "0.60818684", "0.57005566", "0.5474985", "0.5431386", "0.53533036", "0.5352984", "0.53463316", "0.5342834", "0.52751255", "0.52674055", "0.5221041", "0.5169331", "0.5146974", "0.50621134", "0.50617534", "0.50604665", "0.5020252", "0.50186867", "0.50097346", "0.50028855", "0.5...
0.6503054
0
Saves a list of issue comments made by this user.
def save_issue_comments(self, user, path=None): # Redis has an end_cursor if we've collected this data before end_cursor = self.redis.get(''.join(['gh:', user.login, ':issueComments:endCursor'])) if end_cursor: end_cursor = end_cursor.decode('utf-8') end_cursor = ''.join(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_comment(data):\n data['comment_id'] = len(commentslist) + 1\n data['date_created'] = datetime.datetime.now()\n # save to list\n commentslist.append(data)", "def save_comments():\n potential_deal_id = int(request.form.get(\"id\"))\n action = request.form.get(\"action\")\n if action.l...
[ "0.5847415", "0.56875473", "0.55866", "0.55214906", "0.5442948", "0.53258395", "0.53073525", "0.5284097", "0.5237606", "0.5235629", "0.522124", "0.5177813", "0.5167031", "0.51373035", "0.5129606", "0.5121784", "0.51109034", "0.51038647", "0.51038647", "0.5060211", "0.50482506...
0.6056529
0
Saves a list of issues associated with this user.
def save_issues(self, user, path=None): # Redis has an end_cursor if we've collected this data before last_run = self.redis.get('ghc_last_run').decode('utf-8') if last_run is None: last_run = '2004-01-01' # pull everything end_cursor = self.redis.get(''.join(['gh:', user.log...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def issues(db):\n db.session.query(Issue).delete()\n\n issues = [\n {\n 'label': 'login',\n 'email': 'admin@localhost.com',\n 'question': '42.',\n 'status': 'unread'\n },\n {\n 'label': 'login',\n 'email': 'admin@localhost...
[ "0.58301854", "0.54856616", "0.51859164", "0.5134195", "0.509845", "0.50796527", "0.5029606", "0.49997592", "0.49965605", "0.49530712", "0.49469295", "0.49469295", "0.49100602", "0.48562244", "0.48497698", "0.4818374", "0.48037708", "0.47605178", "0.47588396", "0.47507063", "...
0.58010536
1
Saves a list of organizations the user belongs to.
def save_organizations(self, user, path=None): # Redis has an end_cursor if we've collected this data before end_cursor = self.redis.get(''.join(['gh:', user.login, ':organizations:endCursor'])) if end_cursor: end_cursor = end_cursor.decode('utf-8') end_cursor = ''.join([...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_put_list_replace(self):\n for org in Organization.objects.all():\n OrganizationMembership.objects.create(\n user=self.user, organization=org)\n self.user.save()\n self.story.organizations.add(*list(Organization.objects.filter(organizationtranslation__name...
[ "0.59265953", "0.58648086", "0.56789476", "0.56515485", "0.54156107", "0.5396966", "0.53800625", "0.53793323", "0.5349588", "0.53471106", "0.5318676", "0.5316024", "0.5313007", "0.5301353", "0.52717745", "0.52717745", "0.51998657", "0.51996726", "0.5185852", "0.51782054", "0....
0.60336745
0
Saves a list of repositories this user has pinned to their profile.
def save_pinned_repositories(self, user, path=None): # Redis has an end_cursor if we've collected this data before end_cursor = self.redis.get(''.join(['gh:', user.login, ':pinnedRepositories:endCursor'])) if end_cursor: end_cursor = end_cursor.decode('utf-8') end_cursor ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sync():\n _ownered_project = []\n _tmp_project_list = get_user_repo_list(current_user.username)\n if _tmp_project_list:\n for project in _tmp_project_list:\n _ownered_project.append((project, project))\n # Add upperstream_repo\n upperstream_repo = get_upperstrea...
[ "0.5855746", "0.580509", "0.5551184", "0.5105534", "0.49644792", "0.4959064", "0.49568492", "0.4902213", "0.48758385", "0.4837906", "0.4787995", "0.47868484", "0.47789016", "0.4749357", "0.47052976", "0.4705086", "0.46817786", "0.46698788", "0.4640423", "0.4619886", "0.460596...
0.66172725
0
Saves a list of public keys associated with this user.
def save_public_keys(self, user, path=None): # Redis has an end_cursor if we've collected this data before end_cursor = self.redis.get(''.join(['gh:', user.login, ':publicKeys:endCursor'])) if end_cursor: end_cursor = end_cursor.decode('utf-8') end_cursor = ''.join(['"', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_keys(self, save_path=DEFAULT_KEY_PATH):\n try:\n with open(f'{save_path}/id_elgamal', 'w') as f:\n f.write(self.keys['private'])\n with open(f'{save_path}/id_elgamal.pub', 'w') as f:\n f.write(self.keys['public']['p'] + '\\n')\n f.w...
[ "0.6537619", "0.6313641", "0.5977645", "0.57419777", "0.5697117", "0.56217366", "0.55947566", "0.55806047", "0.55734", "0.55458343", "0.5535723", "0.5477158", "0.5443913", "0.5440483", "0.5410733", "0.54072666", "0.5363117", "0.535979", "0.535871", "0.5317353", "0.52932185", ...
0.6494126
1
Saves a list of pull requests associated with this user.
def save_pull_requests(self, user, path=None): # Redis has an end_cursor if we've collected this data before end_cursor = self.redis.get(''.join(['gh:', user.login, ':pullRequests:endCursor'])) if end_cursor: end_cursor = end_cursor.decode('utf-8') end_cursor = ''.join(['...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(self):\n resp = yield self.client.request(\n self.repo.base_path + \"/pulls\", params={\n \"title\": self.title,\n \"head\": self.head,\n \"base\": self.base,\n \"body\": self.body,\n \"maintainer_can_modify\": ...
[ "0.550293", "0.54397523", "0.5235431", "0.5223959", "0.5181559", "0.512005", "0.51147157", "0.50955063", "0.50473064", "0.48162797", "0.48110226", "0.4776085", "0.47734773", "0.47709897", "0.4756326", "0.47487405", "0.47319442", "0.47248226", "0.46943775", "0.46660092", "0.46...
0.62108105
0
Saves a list of repositories that the user owns.
def save_repositories(self, user, path=None): # Redis has an end_cursor if we've collected this data before end_cursor = self.redis.get(''.join(['gh:', user.login, ':repositories:endCursor'])) if end_cursor: end_cursor = end_cursor.decode('utf-8') end_cursor = ''.join(['"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sync():\n _ownered_project = []\n _tmp_project_list = get_user_repo_list(current_user.username)\n if _tmp_project_list:\n for project in _tmp_project_list:\n _ownered_project.append((project, project))\n # Add upperstream_repo\n upperstream_repo = get_upperstrea...
[ "0.6054562", "0.5576589", "0.5434746", "0.53765297", "0.5325816", "0.5315701", "0.528101", "0.5267747", "0.5260667", "0.5243365", "0.52378726", "0.52375865", "0.5204801", "0.51619995", "0.51211464", "0.51200926", "0.510265", "0.50712204", "0.50696415", "0.5054528", "0.4969991...
0.6030274
1
Saves a list of repositories that the user recently contributed to other than their own.
def save_repositories_contributed_to(self, user, path=None): # Redis has an end_cursor if we've collected this data before end_cursor = self.redis.get(''.join(['gh:', user.login, ':repositoriesContributedTo:endCursor'])) if end_cursor: end_cursor = end_cursor.decode('utf-8') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_repositories(self, user, path=None):\n # Redis has an end_cursor if we've collected this data before\n end_cursor = self.redis.get(''.join(['gh:', user.login, ':repositories:endCursor']))\n if end_cursor:\n end_cursor = end_cursor.decode('utf-8')\n end_cursor = '...
[ "0.5901712", "0.5878179", "0.5528805", "0.5410074", "0.5305616", "0.5223621", "0.520857", "0.51607317", "0.51521593", "0.51481813", "0.5140866", "0.51395434", "0.5116052", "0.5105078", "0.50949955", "0.5020492", "0.5018968", "0.5012153", "0.49822968", "0.49732697", "0.4966626...
0.60250443
0
Saves a list of repositories that the user has starred.
def save_starred_repositories(self, user, path=None): # Redis has an end_cursor if we've collected this data before end_cursor = self.redis.get(''.join(['gh:', user.login, ':starredRepositories:endCursor'])) if end_cursor: end_cursor = end_cursor.decode('utf-8') end_curso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def star(request):\n account = models.Account.current_user_account\n account.user_has_selected_nickname() # This will preserve account.fresh.\n if account.stars is None:\n account.stars = []\n keyid = request.issue.key.id()\n if keyid not in account.stars:\n account.stars.append(keyid)\n account.put...
[ "0.6128304", "0.5736715", "0.5736715", "0.5705222", "0.5658904", "0.5468062", "0.5434972", "0.5356213", "0.5105929", "0.50867456", "0.49527746", "0.49316972", "0.49227825", "0.49065986", "0.4899718", "0.48933232", "0.4852997", "0.482119", "0.47673383", "0.47423387", "0.473145...
0.63887346
0
Saves a list of repositories that the given user is watching.
def save_watching(self, user, path=None): # Redis has an end_cursor if we've collected this data before end_cursor = self.redis.get(''.join(['gh:', user.login, ':watching:endCursor'])) if end_cursor: end_cursor = end_cursor.decode('utf-8') end_cursor = ''.join(['"', end_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_repositories(self, user, path=None):\n # Redis has an end_cursor if we've collected this data before\n end_cursor = self.redis.get(''.join(['gh:', user.login, ':repositories:endCursor']))\n if end_cursor:\n end_cursor = end_cursor.decode('utf-8')\n end_cursor = '...
[ "0.6362322", "0.611658", "0.5774161", "0.575149", "0.5738804", "0.5638736", "0.56332004", "0.5519709", "0.5493186", "0.54426396", "0.5413708", "0.5377704", "0.5338723", "0.52624387", "0.5256086", "0.5187917", "0.51381063", "0.5114896", "0.504018", "0.5022567", "0.4997006", ...
0.57178056
5
Verify the api credentials are valid
def verify(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ApiWillAuthenticate_ValidCredentials_Successfully(self):\n api = Api(self.userId, self.testToken)\n self.assertTrue(api.connected())", "def check_auth():", "def test_validate_credentials(self):\n pass", "def test_ApiWillAuthenticate_InvalidCredentials_Unsuccessfully(self):\n ...
[ "0.752243", "0.73757213", "0.73656166", "0.73277277", "0.716696", "0.7086535", "0.7008686", "0.7003753", "0.6985569", "0.697429", "0.6912606", "0.68985164", "0.6890999", "0.6875577", "0.6853049", "0.6749226", "0.6749226", "0.6741252", "0.673626", "0.6728212", "0.6721801", "...
0.0
-1
Find the given endpoint for the given domain. Only scan html element matching all criteria in look_in. optionally the content to be scanned can be given as an argument.
def discoverEndpoint(domain, endpoint, content=None, look_in={'name': 'link'}, test_urls=True, validateCerts=True): if test_urls: ronkyuu.URLValidator(message='invalid domain URL')(domain) if content: result = {'status': requests.codes.ok, 'headers': None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def discoverTokenEndpoints(domain, content=None, look_in={'name': 'link'}, test_urls=True, validateCerts=True):\n return discoverEndpoint(domain, ('token_endpoint',), content, look_in, test_urls, validateCerts)", "def search(url, domain_list):\n resp = requests.get(url)\n if not resp.json().get('hits', ...
[ "0.568334", "0.54719615", "0.54551363", "0.54303116", "0.52735686", "0.50578773", "0.50293565", "0.49629194", "0.49056768", "0.48959708", "0.4888849", "0.48617947", "0.4861624", "0.48373106", "0.4803633", "0.47973126", "0.47466186", "0.46863022", "0.46846643", "0.46615353", "...
0.6853434
0
Find the micropub for the given domain. Only scan html element matching all criteria in look_in. optionally the content to be scanned can be given as an argument.
def discoverMicropubEndpoints(domain, content=None, look_in={'name': 'link'}, test_urls=True, validateCerts=True): return discoverEndpoint(domain, ('micropub',), content, look_in, test_urls, validateCerts)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search(wiki, pattern):\n wiki.search_tags(pattern)", "def search(self, phrase, content=False, username=None, ct=10, page=0):\r\n page = int(page) + 1\r\n\r\n with WIX.searcher() as search:\r\n fields = ['description', 'extended', 'tags']\r\n\r\n if content:\r\n ...
[ "0.5157872", "0.48303917", "0.47415784", "0.47138998", "0.4580432", "0.45471004", "0.45214573", "0.45160756", "0.44645557", "0.44120982", "0.44019017", "0.43961054", "0.4391695", "0.43534493", "0.43461645", "0.4341786", "0.43401173", "0.4313143", "0.42990834", "0.42850435", "...
0.6394313
0
Find the token for the given domain. Only scan html element matching all criteria in look_in. optionally the content to be scanned can be given as an argument.
def discoverTokenEndpoints(domain, content=None, look_in={'name': 'link'}, test_urls=True, validateCerts=True): return discoverEndpoint(domain, ('token_endpoint',), content, look_in, test_urls, validateCerts)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search(wiki, pattern):\n wiki.search_tags(pattern)", "def search(url, domain_list):\n resp = requests.get(url)\n if not resp.json().get('hits', '').get('hits', []):\n return\n for hit in resp.json()[\"hits\"][\"hits\"]:\n domain = hit.get(\"_source\", {}).get(\"domain\", \"\")\n ...
[ "0.521796", "0.50288016", "0.49580178", "0.4880799", "0.47114867", "0.4708841", "0.46950248", "0.46874154", "0.46816665", "0.4663791", "0.46451175", "0.46395028", "0.46025386", "0.4575456", "0.45328408", "0.45127285", "0.44772387", "0.44075775", "0.43700045", "0.43473896", "0...
0.5688619
0
Dummy function, this is needed so that the framework is recognized as a module.
def create_instance(c_instance): return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_module(self):\n pass", "def dummy(self):\n pass", "def test_dummy():", "def dummy_fn(self):\n\t\tpass", "def example_function_in_example_module():\n pass", "def util():\n pass", "def util():\n pass", "def setup_function(self):\r\n raise AppModule.Unimplemented()", ...
[ "0.7602624", "0.6829276", "0.67178965", "0.66946745", "0.66570234", "0.66426414", "0.66426414", "0.6621138", "0.65590435", "0.65590435", "0.6534276", "0.65261215", "0.6514577", "0.65033436", "0.65033203", "0.6499536", "0.6429504", "0.6402631", "0.6377799", "0.637065", "0.6328...
0.0
-1
Create and enqueue future enqueue (args, resolve) > source_id resolve (source, resolve_args) > None
def source_create (self, resolve, cancel, enqueue, args = None): future, source = FutureSourcePair () def resolve_internal (*resolve_args): self.sources.discard (source) resolve (source, *resolve_args) return False # remove from event loop if cancel: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def async(self, *args, **kwargs):\n uid = str(uuid.uuid4())\n message = {\n 'uid': uid,\n 'name': self.name,\n 'args': self.serializer.serialize(args),\n 'kwargs': self.serializer.serialize(kwargs),\n }\n Model = get_queue_model(self.queue_nam...
[ "0.65122193", "0.60749143", "0.5991675", "0.5934187", "0.5817398", "0.5680583", "0.56742793", "0.56742793", "0.5626921", "0.56141484", "0.5594981", "0.5588243", "0.5585966", "0.5519959", "0.5494343", "0.5458945", "0.54240227", "0.53948534", "0.5388359", "0.5381443", "0.532670...
0.6898187
0
Reads a .tab file into a 2D array. Separates meta info from data.
def readTab(file_name): data = [] meta = [] l=0 for line in open(file_name): if l<3: meta.append(line.strip("\n").split("\t")) else: if len(line.strip("\n").split("\t")) == len(meta[0]): data.append(line.strip("\n").split("\t")) l += 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def storeTabDelimitedFile(inputFile):\n\n\n list0 = []\n with open(inputFile, 'r') as f:\n newlist = f.readlines()\n #print(newlist)\n for i in range(len(newlist)):\n #newlist[i] = newlist[i].strip('\\t')\n newlist[i] = newlist[i].strip('\\n') # this makes the matri...
[ "0.6211566", "0.60512006", "0.5980201", "0.595952", "0.59593946", "0.5899865", "0.58882284", "0.58542913", "0.58366424", "0.5757578", "0.5756274", "0.57214826", "0.5718835", "0.5707263", "0.56501734", "0.5639782", "0.5633153", "0.5614347", "0.5608434", "0.5604423", "0.5581115...
0.75938237
0
This shows the distribution of LM preservations/deletions depending on i) what the previous segment is, and ii) what th following segment is. This should already be included in the multifactor .tab file, so you can just put previous segment info in a .tab file and run the program, then put following segment info in a ....
def segmental_context(save_path=conv07_outpath, data=conv07_data): save_path = os.path.join(save_path, "segmental_context") for phone in ["phone1", "phone2"]: attributes_names = filter(lambda x: x.startswith(phone), all_attributes) + ["outcome"] tree_file_name = phone + "-all.dot" #will also sa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def minfo():\n model = np.loadtxt('cumul_depths.tmp',dtype={'names': ('H'),'formats': \\\n ('f4')}, usecols=[0])\n d = model['H']\n model = np.loadtxt('start_model.dat',dtype={'names': (\"S\"),'formats': \\\n ('f4')}, skiprows=1,usecols=[2])\n vs = model['S']\n\n ...
[ "0.5569806", "0.55335796", "0.5497172", "0.5373131", "0.53395045", "0.5327896", "0.52804506", "0.52630305", "0.5186118", "0.5151245", "0.4993687", "0.49327683", "0.4913579", "0.48704094", "0.48549342", "0.4846885", "0.48184326", "0.4816883", "0.47759447", "0.47663677", "0.476...
0.0
-1
check if elem is a county name
def isCountyName(elem): return (elem.attrib['k'] == "tiger:county")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_in_county(p):\n try:\n float(p[0:1])\n return True\n except ValueError:\n return False", "def identifyCounty(line):\n matches = re.findall('[a-zA-Z]', line)\n if len(matches) > 0 and ''.join(matches) != \"Total\":\n return True", "def is_cuisine(elem):\n return elem.attrib['k'...
[ "0.6464266", "0.6227803", "0.6202538", "0.61037445", "0.60834086", "0.6082506", "0.59991944", "0.5927276", "0.5760006", "0.5758046", "0.56099755", "0.55842495", "0.55784076", "0.55266464", "0.5466257", "0.54466796", "0.5416121", "0.53680265", "0.53628933", "0.52790076", "0.52...
0.8547739
0
Function to get the training data locally or from google cloud bucket
def get_data(path): df = pd.read_csv(path) return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_training_data() -> GraphDataset:\n _load_data_if_needed()\n return training_data", "def get_data_train(self):\n return self.get_data(self.file_train, self.batch)", "def Train(auth, datafile):\n\n url = ('https://www.googleapis.com/prediction/v1.1/training?data='\n '%s' % urllib.qu...
[ "0.6460177", "0.6344582", "0.62682194", "0.61251295", "0.608771", "0.6065597", "0.60457027", "0.60036296", "0.5978714", "0.59743315", "0.59743315", "0.5960799", "0.5932857", "0.5904669", "0.5904587", "0.5850004", "0.58385885", "0.5837765", "0.5829175", "0.577518", "0.5758794"...
0.0
-1
If value is not specified, initializes an empty list. Otherwise initializes a single integer equal to value.
def __init__(self, value=None): if isinstance(value, Iterable): self.value = [NestedInteger(v) for v in value] elif isinstance(value, NestedInteger): self.value = value.value else: self.value = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, value=None):\n self._value = value\n self._list = []\n self._is_int = True if value is not None else False", "def setList(value):\n if value is None:\n return []\n else:\n return value", "def for_value(cls, value):\n self = cls([])\n id = self._acro...
[ "0.76026237", "0.70382255", "0.6548046", "0.6328661", "0.6099708", "0.605718", "0.5858195", "0.5780023", "0.5777714", "0.5744867", "0.57423985", "0.56016743", "0.5584586", "0.55755", "0.5569124", "0.5557585", "0.5550035", "0.55119324", "0.54890865", "0.54241866", "0.54010177"...
0.6962135
2
True if this NestedInteger holds a single integer, rather than a nested list.
def isInteger(self): return isinstance(self.value, int)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isInteger(self):\n pass", "def isInteger(self):\n return self._is_int", "def isInteger(self):\n return _libsbml.ASTNode_isInteger(self)", "def isInteger(self):", "def isInteger(self):", "def isinteger(self):\n return self.den == 1", "def is_int(self):\n return sel...
[ "0.68816566", "0.68761814", "0.68001324", "0.6668329", "0.6668329", "0.6667199", "0.65634376", "0.653184", "0.63604957", "0.63311446", "0.6296856", "0.61985886", "0.6147023", "0.6113862", "0.6112268", "0.6085722", "0.60296875", "0.5978817", "0.59638053", "0.5953098", "0.59422...
0.7202063
0
Set this NestedInteger to hold a nested list and adds a nested integer elem to it.
def add(self, elem: 'NestedInteger'): if self.value is None: self.value = [elem] elif self.isInteger(): self.value = [NestedInteger(self.value), elem] else: self.value = [*self.value, elem]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, elem):\n assert self._is_int is False\n self._list.append(elem)", "def __init__(self, value=None):\n if isinstance(value, Iterable):\n self.value = [NestedInteger(v) for v in value]\n elif isinstance(value, NestedInteger):\n self.value = value.value...
[ "0.63542014", "0.6237883", "0.60864973", "0.60203195", "0.59469235", "0.580032", "0.576964", "0.5499853", "0.5478583", "0.5472345", "0.53685707", "0.52807355", "0.522851", "0.5194707", "0.5173737", "0.512586", "0.511907", "0.5111081", "0.5087188", "0.5053078", "0.50245285", ...
0.7977217
0
Set this NestedInteger to hold a single integer equal to value.
def setInteger(self, value: int): self.value = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setInteger(self, value):\n assert self._is_int is True\n self._value = value", "def setInteger(self, value):", "def setInteger(self, value):", "def x(self, value=None):\n if isinstance(value, (int, float)):\n self[0] = value\n else:\n if value is not None...
[ "0.675394", "0.6561978", "0.6561978", "0.63029945", "0.61325914", "0.59337676", "0.59266293", "0.5895697", "0.589371", "0.58535343", "0.57826245", "0.5781725", "0.5777232", "0.5777232", "0.5777232", "0.5777232", "0.5777232", "0.5777232", "0.5767548", "0.5767548", "0.57450086"...
0.6733747
1
the single integer that this NestedInteger holds, if it holds a single integer Return None if this NestedInteger holds a nested list
def getInteger(self): return self.value if self.isInteger() else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get(self) -> int:\n while self.stack: \n data, i = self.stack.pop()\n if i+1 < len(data): self.stack.append((data, i+1)) #backtracking point \n if data[i].isInteger(): return data[i].getInteger()\n if not data[i].getList(): continue #empty list \n ...
[ "0.6750461", "0.58068335", "0.5793719", "0.5776481", "0.5714846", "0.5592736", "0.55416214", "0.5507665", "0.5507665", "0.5411828", "0.538694", "0.5385691", "0.53667647", "0.53541833", "0.53436327", "0.53330284", "0.53313774", "0.5331091", "0.53203326", "0.53196067", "0.53037...
0.64898604
1
the nested list that this NestedInteger holds, if it holds a nested list Return None if this NestedInteger holds a single integer
def getList(self): return self.value if not self.isInteger() else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get(self) -> int:\n while self.stack: \n data, i = self.stack.pop()\n if i+1 < len(data): self.stack.append((data, i+1)) #backtracking point \n if data[i].isInteger(): return data[i].getInteger()\n if not data[i].getList(): continue #empty list \n ...
[ "0.69028354", "0.62758094", "0.58172405", "0.55986816", "0.5480824", "0.5474453", "0.5436319", "0.5422447", "0.5390378", "0.5235933", "0.51452607", "0.5142659", "0.5120265", "0.5072609", "0.50632876", "0.50073016", "0.49925464", "0.49601611", "0.495557", "0.49379557", "0.4937...
0.63026613
1
To prevent a recursive nightmare, only move position if the user is doing it.
def on_progress_slider_value_changed(self): if self.progress_slider_pressed is True and self.playlist.current is not None: self.playlist.current.move2position_bytes(self.view.progress_bar.value())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_to_position2(self):", "def move_to_position1(self):", "def move(self) -> bool:\n pass", "def move(self):\n pass", "def force_move():\n if ZERO_BASE_PLYR_POS in range(0, 10):\n # we cant go up, so go down\n move_player(\"south\")\n else:\n move_player(\"nort...
[ "0.7271645", "0.72654533", "0.72492343", "0.72212386", "0.71265984", "0.7111794", "0.7045851", "0.69710904", "0.6947198", "0.6940707", "0.69233596", "0.6914597", "0.69006103", "0.68958926", "0.68155944", "0.6759035", "0.6753992", "0.6728929", "0.67257273", "0.67194307", "0.67...
0.0
-1
Do activation scale calibration on the given light_graph
def main(light_graph, calibration_data, hw_specs, sw_config, sim_params, nodes_to_calibrate): with graph_collection.GraphCollection() as graph_coll: # Create calibration graph hist_coll = graph_coll.histogram_collection() convert_to_calib_graph = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _RunCalibration(self, graph_key, gdef, input_data, config):\n return self._RunGraph(graph_key, gdef, input_data, config, 30)", "def late_gradient_fusion():\n pass", "def apply_calibration(self, cal):\n\n n_edges = len(self.channels) + 1\n channel_edges = np.linspace(-0.5, self.channels[...
[ "0.5870315", "0.5327208", "0.5292108", "0.5278136", "0.51503456", "0.5125558", "0.5125329", "0.5116323", "0.50977707", "0.5058684", "0.504306", "0.5031749", "0.4979374", "0.49528605", "0.49525857", "0.49299765", "0.4891175", "0.48627597", "0.48579732", "0.4849806", "0.4846908...
0.73384583
0
Method to send message to asset_index websocket channel. Asset Index (request) Retrieve a list of all available underlyings and the corresponding contract types and duration boundaries. If the user is logged in, only the assets available for that user's landing company will be returned.
def __call__(self, landing_company: Optional[str] = None, passthrough: Optional[Any] = None, req_id: Optional[int] = None): data = { "asset_index": int(1) } if landing_company: data['landing_company'] = str(landing_company) return self.send_websocket_request(se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_asset_list():\n return jsonify(app.bank.to_list()), 200", "def _asset_index(request, course_key):\r\n course_module = modulestore().get_course(course_key)\r\n\r\n return render_to_response('asset_index.html', {\r\n 'context_course': course_module,\r\n 'asset_callback_url': reverse_...
[ "0.5347752", "0.5298236", "0.52792937", "0.5228874", "0.52224773", "0.5209268", "0.51474935", "0.5125685", "0.5113717", "0.50968444", "0.5081047", "0.5077979", "0.5067293", "0.50664", "0.5046824", "0.50325316", "0.5027318", "0.49806237", "0.49736387", "0.49670604", "0.4949830...
0.6206942
0
Test ability to create a empty page
def test_create_page(self): self.assertEqual(self.client.get(reverse('home')).status_code, 404) page = Page.objects.create(**_page_data) self.assertEqual(page.title, _page_data['title']) self.assertEqual(page.page_type, _page_data['page_type']) response = self.client.get(rever...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_page_list_unauthorised(self):\n user = self.get_superuser()\n title_1 = 'page'\n title_2 = 'inner'\n title_3 = 'page 3'\n page = create_page(title_1, 'page.html', 'en', published=True)\n page_2 = create_page(title_2, 'page.html', 'en', published=True, parent=page)...
[ "0.7020648", "0.69859916", "0.6949012", "0.68393856", "0.68185186", "0.6812438", "0.6794315", "0.6736821", "0.67351717", "0.6716539", "0.66805714", "0.6664649", "0.66362906", "0.6611464", "0.6551422", "0.6523061", "0.6522048", "0.65214545", "0.6510145", "0.65027374", "0.64813...
0.7788985
0
Test ability to create a page with full header
def test_create_page_with_header(self): link_1 = PageHeadDropMenu.objects.create\ (internal_link='home', **_head_link_data) link_2 = PageHeadDropMenu.objects.create( external_link=_external_link, **_head_link_data) link_3 = PageHeadDropMenu.objects.create(**_head_link_da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_header(self):\n sel = self.selenium\n # Load the Create Shelter page\n sel.open(\"/eden/cr/shelter/create\")\n # Check that the location is currently blank\n self.check_blank()", "def create_page(self):", "def test_homepage(self):\n\n with self.client as cli...
[ "0.71193373", "0.69215447", "0.67508227", "0.6622254", "0.65518856", "0.6475695", "0.642205", "0.6361855", "0.63545746", "0.63482505", "0.63463175", "0.6337883", "0.63279295", "0.6293536", "0.62900555", "0.62784123", "0.6273762", "0.6235984", "0.6225211", "0.62113404", "0.618...
0.77367085
0
Test ability to create a page with help box
def test_create_page_with_help_box(self): button = PageButton.objects.create(**_button_data) help_block = PageHelpBoxBlock.objects.create( button=button, **_help_box_data) page = Page.objects.create(help_box_block=help_block, **_page_data) response = self.client.get(reverse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_help_menu(run):\n out, _err = run(dork.cli.help_menu)\n assert 'Help' in out, 'Help wasnt found'", "def test_createExplicitHelp(self):\n self.assertSuccessStatus(self._makeConfig(None), [\"create\", \"--help\"])\n self.assertSpacelessEqual(self._createHelpText, sys.stdout.getvalue())...
[ "0.6690504", "0.6667255", "0.664372", "0.6599873", "0.6584894", "0.65563786", "0.652604", "0.6522679", "0.6467151", "0.6451444", "0.64280933", "0.6410487", "0.64081675", "0.63884115", "0.63809764", "0.63509667", "0.63509667", "0.6337427", "0.6329947", "0.6302536", "0.6284349"...
0.79399395
0
Test ability to create a page with main box
def test_create_page_with_main_box(self): main_block = PageMainBlock.objects.create(**_main_block_data) Page.objects.create(main_block=main_block, **_page_data) response = self.client.get(reverse('home')) self.assertEqual(response.status_code, 200) self.assertIn('text', respons...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_page(self):", "def test_create_page_with_help_box(self):\n\n button = PageButton.objects.create(**_button_data)\n help_block = PageHelpBoxBlock.objects.create(\n button=button, **_help_box_data)\n page = Page.objects.create(help_box_block=help_block, **_page_data)\n\n ...
[ "0.6924539", "0.6889655", "0.68546546", "0.67670345", "0.67154676", "0.6582398", "0.6547919", "0.64649904", "0.6284628", "0.62567896", "0.62402797", "0.62172043", "0.62079114", "0.61982745", "0.61932427", "0.61767715", "0.6131917", "0.61279565", "0.61247087", "0.6123573", "0....
0.78971374
0
Test ability to create a page with main footer
def test_create_page_with_footer(self): footer_block = PageFooterBlock.objects.create(**_footer_block_data) link_1 = PageHeadDropMenu.objects.create\ (internal_link='home', **_head_link_data) link_2 = PageHeadDropMenu.objects.create( external_link=_external_link, **_head...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_00_footer(self):\r\n url = '/'\r\n # As Anonymou user\r\n res = self.app.get(url, follow_redirects=True)\r\n dom = BeautifulSoup(res.data)\r\n err_msg = \"Footer links should not be shown to anonymous users\"\r\n assert dom.find(id='footer_links') is None, err_msg...
[ "0.73257196", "0.72786623", "0.65961885", "0.65096605", "0.6436854", "0.62778157", "0.6275215", "0.6275215", "0.6235414", "0.621966", "0.60667896", "0.606618", "0.60153687", "0.6010727", "0.6007516", "0.5964707", "0.5950918", "0.59390473", "0.589547", "0.58854747", "0.5876067...
0.8047665
0
Test ability to create a page with main what you need block
def test_create_page_with_whatyouneed_block(self): what_you_need_block = PageWhatYouNeedBlock.objects.create( **_whatyouneed_block_data) Page.objects.create(what_you_need_block=what_you_need_block, **_page_data) response = self.client.get(reverse('home')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_page_with_main_box(self):\n\n main_block = PageMainBlock.objects.create(**_main_block_data)\n Page.objects.create(main_block=main_block, **_page_data)\n response = self.client.get(reverse('home'))\n self.assertEqual(response.status_code, 200)\n\n self.assertIn('te...
[ "0.7925535", "0.71040845", "0.70405143", "0.6776286", "0.67402023", "0.6727634", "0.6711986", "0.6697805", "0.6588746", "0.65794003", "0.65505695", "0.6517028", "0.6492822", "0.6410374", "0.6395514", "0.6354633", "0.63398767", "0.6336393", "0.630439", "0.62780046", "0.6267378...
0.74322563
1
Try create referenced document.
def get_fake(self, document, faker, depth): res = create_fake( self.reference_document_class, __db__=document.__db__, __faker__=faker, __depth__=depth) if res is AttributeNotSet and self.smart_null: return None else: return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_doc(c, d):\n try:\n c.insert_one(d)\n return True\n except:\n return False", "def create_document(obj):\n index = obj.get_index_name()\n doc_type = obj.get_document_type()\n body = obj.get_document_body()\n exists = ES.exists(index=index, doc_type=doc_type, id=ob...
[ "0.70877796", "0.70819736", "0.7063738", "0.6920661", "0.6846037", "0.65755975", "0.6434568", "0.6402101", "0.625848", "0.62414014", "0.6241228", "0.6188969", "0.6155739", "0.611589", "0.60952127", "0.6091857", "0.60266167", "0.60102654", "0.59845", "0.5982334", "0.5963011", ...
0.52907705
80
Copy properties from application object into DxApplication
def create_application(self, application_name): self.__obj = GenericModel({ x:None for x in self.swagger_map.values()}, self.swagger_types, self.swagger_map) self.application_name = application_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map_from_app(self, app):\n build_infos = app.get('build_infos', {})\n self.ssh_username.data = build_infos.get('ssh_username', '')\n self.source_ami.data = build_infos.get('source_ami', '')\n self.container.data = build_infos.get('source_container_image', '')\n self.subnet_id...
[ "0.6111818", "0.5990018", "0.5805959", "0.57959306", "0.56683475", "0.5637161", "0.55734026", "0.5554139", "0.55494267", "0.55458575", "0.5510121", "0.5436736", "0.5290545", "0.5288586", "0.52614087", "0.5236655", "0.52122086", "0.5211327", "0.5206249", "0.52046764", "0.51944...
0.5418423
12
Assign a SDK object to __obj
def from_obj(self, obj): self.__obj = obj self.__obj.swagger_types = self.swagger_types self.__obj.swagger_map = self.swagger_map
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put(self, obj):\n\n if obj is None:\n return\n\n return obj", "def __set__(self, obj, value):\r\n pass", "def put(cls, obj):\n pass", "def __set__(self, obj, value):\n\n return setattr(obj, '_' + self.name, value)", "def set(self, obj, value):\n pass...
[ "0.70875674", "0.7002896", "0.69696474", "0.69501126", "0.68890095", "0.6782637", "0.6605087", "0.65995103", "0.65795624", "0.65695894", "0.6498459", "0.6424319", "0.642039", "0.6420148", "0.6402863", "0.6393511", "0.6375269", "0.633941", "0.6316106", "0.6315533", "0.63111776...
0.6730987
6
Add application to Masking engine and print status message return a None if non error return 1 in case of error
def add(self): if (self.application_name is None): print_error("Application name is required") self.__logger.error("Application name is required") return 1 api_instance = self.__api(self.__engine.api_client) try: self.__logger.debug("create appl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def startapp():", "def found_app(kind):\n echo(\"-----> {} app detected.\".format(kind), fg='green')\n return True", "def run(self, name, image, entrypoint, command):\n return 0, ''", "def main():\n print(\"def main\")\n return APP.run()", "def determine_exit_code(self) -> int:", "def ...
[ "0.54492164", "0.5386052", "0.5303044", "0.5286507", "0.52367944", "0.5234159", "0.52110916", "0.51982003", "0.5197887", "0.51828873", "0.5152658", "0.5054692", "0.50236875", "0.49977648", "0.49880496", "0.4978004", "0.49592644", "0.4958121", "0.49532983", "0.4931006", "0.493...
0.53354955
2
Initializes reponse variables. Show the search bar which enables the user to search for music, artists, albums and records. On clicking the search tab, the user will be redirected to search action. This page also displays featured artists, albums, music.
def index(): form = FORM('', INPUT(_name='search_term', requires = IS_NOT_EMPTY(), _class='input-large search-query', _placeholder='Search for music', _autocomplete="off"), INPUT(_type='submit', _class='btn', _value='Search'), _class='form-search') if form.process().accepted: redirect(URL('search', va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search(self):\n query = self.get_request_arg(\"query\")\n if query:\n album = self.ctrl.library.search(query)\n return self.resp_from_data(album)\n return self.resp_from_data(\n {\"message\": \"No query parameters specified\"}, 400)", "def search():\n\tif...
[ "0.6755951", "0.6579157", "0.6443261", "0.62769073", "0.61957806", "0.6096788", "0.60955894", "0.608414", "0.60322183", "0.6029282", "0.6024123", "0.60239744", "0.6011979", "0.60080314", "0.60046566", "0.5987673", "0.5979473", "0.597237", "0.5964821", "0.59382766", "0.5936937...
0.6446085
2