query
stringlengths
7
6.41k
document
stringlengths
12
28.8k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
POST /tiendas_clientes POST /tiendas_clientes.json
def create @tienda_cliente = @cliente.tiendas_clientes.build(tienda_cliente_params) respond_to do |format| if @tienda_cliente.save format.html { redirect_to @tienda_cliente, notice: 'La tienda se creó exitosamente.' } format.json { render :show, status: :created, location: @tienda_client...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n\n client = Cliente.new\n\n client.nombre = params[:nombre]\n client.cedula = params[:cedula]\n client.pagina = params[:pagina]\n\n client.dirrecion = params[:dirrecion]\n client.telefono = params[:telefono]\n \n client.sector = params[:sector]\n \n\n if client.save\n ...
[ "0.6540972", "0.6527762", "0.6494968", "0.64197373", "0.64039224", "0.6350697", "0.63330895", "0.6303754", "0.6212286", "0.617808", "0.6140775", "0.61273205", "0.6126304", "0.61060154", "0.6095872", "0.6095872", "0.6088495", "0.6042369", "0.6039275", "0.6033399", "0.60304296"...
0.6701628
0
hour specified hour minute specified minute second specified second interval how fast the second hand advances in real time.
def initialize(hour, minute, second, interval) @hour = hour @minute = minute @second = second @interval = interval end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rational_hour(seconds); end", "def end_of_hour\n change(min: 59, sec: 59.999)\n end", "def end_of_hour\n change(\n min: 59,\n sec: 59,\n usec: Rational(999999999, 1000)\n )\n end", "def setTime(hour, min, sec)\n setSec(sec) ;\n addMin(min) ;\n addHour(hour) ;\n end", ...
[ "0.6709556", "0.614363", "0.61361176", "0.6059917", "0.6019283", "0.595288", "0.5921481", "0.58988297", "0.5897865", "0.5841987", "0.58183527", "0.5814105", "0.5794004", "0.5792468", "0.5790944", "0.5736809", "0.5736809", "0.573235", "0.5711035", "0.5662243", "0.5644958", "...
0.63010275
1
Tick will now increment the second value.
def tick @second += 1 need_tock? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tick(seconds)\n\t\t@time += seconds\n\tend", "def tick\n @time = next_time(true)\n end", "def tick\n\t\tif @sec > 0\n\t\t\t@sec -= 1\n\t\telse\n\t\t\t@sec = 59\n\t\t\tif min > 0\n\t\t\t\t@min -= 1\n\t\t\telse\n\t\t\t\t@min = 59\n\t\t\t\tif @hr > 0\n\t\t\t\t\t@hr -= 1\n\t\t\t\telse\n\t\t\t\t\t@hr = ...
[ "0.74979687", "0.7196552", "0.6778341", "0.6573163", "0.6482976", "0.6482976", "0.6482976", "0.64382243", "0.64003307", "0.63891745", "0.6322627", "0.6154744", "0.613554", "0.6100395", "0.60834646", "0.6011973", "0.6006825", "0.5969938", "0.5934505", "0.5918612", "0.5851342",...
0.80126786
0
If the second value == 60, then it will commit a tock
def need_tock? if @second == 60 @second = 0 tock end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tock\n @minute += 1\n end", "def cheat\n if @score >= 60 and !@cheating and !@cheating_two\n @cheating = true\n @score -= 60\n end\n end", "def bust?; value > 21; end", "def checker\n @hash.each_pair do |key, value|\n @hash[key]=value+1\n if value>=@tresholds\n @h...
[ "0.6006742", "0.589643", "0.5762616", "0.5616108", "0.55299366", "0.54519296", "0.54220545", "0.53642106", "0.5345481", "0.5308886", "0.53062266", "0.53051746", "0.52411973", "0.5233876", "0.52265996", "0.52211547", "0.5210867", "0.5197313", "0.51950043", "0.51905304", "0.518...
0.6561541
0
If minute value == 60, then it will commit a ticktock
def need_tick_tock? if @minute == 60 @minute = 0 tick_tock end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tock\n @minute += 1\n end", "def tick_tock\n @hour += 1\n @minute = 0\n @second = 0\n end", "def need_tock?\n if @second == 60\n @second = 0\n tock\n end\n end", "def tick\n\t\tif @sec > 0\n\t\t\t@sec -= 1\n\t\telse\n\t\t\t@sec = 59\n\t\t\tif min > 0\n\t\t\t\t@min -= 1\n\t\...
[ "0.7776418", "0.7579251", "0.7324939", "0.68012846", "0.64941674", "0.6316363", "0.6301563", "0.615146", "0.615146", "0.6073975", "0.59590167", "0.5943216", "0.593197", "0.57048863", "0.56690484", "0.5656231", "0.5656231", "0.5656231", "0.565457", "0.5651588", "0.5584626", ...
0.8124774
0
5 Cases (1) First install, anything goes => OK (2) An old storage type was not set and the new_storage_type is :filesystem => OK (3) An old storage type was not set and the new_storage_type is :sql => NOT_OK (4) An old storage type was set and is not equal to the new storage type => NOT_OK (5) An old storage type was s...
def verify_storage_type_unchanged if previous_run.nil? # case (1) true else previous_value = previous_run['bookshelf']['storage_type'] current_value = (user_attrs['storage_type'] || 'filesystem').to_s if previous_value.nil? && current_value == 'filesystem' # case (2) true ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_variation_storage_type\n cid = VirtualMonkey::Toolbox::determine_cloud_id(s_one)\n if cid == 232\n @storage_type = \"ros\"\n else\n pick = rand(100000) % 2\n if pick == 1\n @storage_type = \"ros\"\n else\n @storage_type = \"volu...
[ "0.68890625", "0.6241801", "0.59194773", "0.5850532", "0.5850532", "0.5808165", "0.57523435", "0.57252544", "0.5650731", "0.5593707", "0.5557879", "0.5479037", "0.5478838", "0.5432302", "0.54239285", "0.54142946", "0.54085827", "0.5400725", "0.53981584", "0.5386897", "0.53696...
0.76222897
0
Encode the temporal expression into +codes+.
def encode(codes) encode_list(codes, @days) codes << encoding_token end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode(codes)\n encode_list(codes, @years)\n codes << encoding_token\n end", "def encode(codes)\n encode_list(codes, @weeks)\n codes << encoding_token\n end", "def encode\n @code = \"\"\n add_check_digit_and_ensure_even_digit_size\n 0.step(@encodable.size - 1, 2) do |i|\n...
[ "0.6798391", "0.67676747", "0.6424279", "0.6258846", "0.6153673", "0.6051423", "0.5778526", "0.5778526", "0.5729366", "0.5700355", "0.56043607", "0.56033397", "0.5588766", "0.5533201", "0.5488222", "0.5450914", "0.5442591", "0.5410525", "0.53952473", "0.5386026", "0.53570044"...
0.73046476
0
GET /thing_types GET /thing_types.json
def index @thing_types = ThingType.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n authorize @thing, :get_types?\n @thing_types = @thing.thing_types\n end", "def pet_types\r\n BnetApi::make_request('/wow/data/pet/types')\r\n end", "def show\n @type = Type.find(params[:id])\n @things = @type.things\n\n respond_to do |format|\n format.html # show.ht...
[ "0.77523476", "0.70706415", "0.6908508", "0.66675395", "0.6655826", "0.6577568", "0.65704393", "0.65353847", "0.6500588", "0.6479018", "0.6475635", "0.64227796", "0.6385143", "0.6375576", "0.6360951", "0.6337234", "0.6300508", "0.6299166", "0.6293892", "0.6274894", "0.626127"...
0.715947
1
POST /thing_types POST /thing_types.json
def create @thing_type = ThingType.new(thing_type_params) respond_to do |format| if @thing_type.save format.html { redirect_to @thing_type, notice: 'Thing type was successfully created.' } format.json { render :show, status: :created, location: @thing_type } else format.html...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type_params\n params.from_jsonapi.require(:type).permit(:name)\n end", "def pet_types\r\n BnetApi::make_request('/wow/data/pet/types')\r\n end", "def clothing_type_params\n params.require(:clothing_type).permit(:name)\n end", "def thing_type_params\n params.require(:thing_typ...
[ "0.6508891", "0.6320648", "0.61794466", "0.6159986", "0.6116042", "0.60842395", "0.6062709", "0.6006655", "0.59865385", "0.59825236", "0.597014", "0.595698", "0.5864639", "0.5772186", "0.576734", "0.5742168", "0.5713445", "0.56968474", "0.5688395", "0.5671396", "0.5671396", ...
0.6824022
0
PATCH/PUT /thing_types/1 PATCH/PUT /thing_types/1.json
def update respond_to do |format| if @thing_type.update(thing_type_params) format.html { redirect_to @thing_type, notice: 'Thing type was successfully updated.' } format.json { render :show, status: :ok, location: @thing_type } else format.html { render :edit } format.jso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @clothing_type.update(clothing_type_params)\n format.html { redirect_to @clothing_type, notice: 'Clothing type was successfully updated.' }\n format.json { render :show, status: :ok, location: @clothing_type }\n else\n format.html { render ...
[ "0.6670715", "0.63565385", "0.62737274", "0.62680906", "0.62027663", "0.61963594", "0.6146416", "0.6131429", "0.61234885", "0.61108285", "0.607953", "0.6012331", "0.60122883", "0.5985591", "0.5979754", "0.5979754", "0.5979754", "0.5979754", "0.5979754", "0.5979754", "0.597904...
0.7190378
0
DELETE /thing_types/1 DELETE /thing_types/1.json
def destroy @thing_type.destroy respond_to do |format| format.html { redirect_to thing_types_url, notice: 'Thing type was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @clothing_type.destroy\n respond_to do |format|\n format.html { redirect_to clothing_types_url, notice: 'Clothing type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @type = Type.find(params[:id])\n @type.destroy\n\n respo...
[ "0.7085014", "0.7023634", "0.6995377", "0.690573", "0.690573", "0.6840859", "0.68237853", "0.6813082", "0.67557", "0.67516804", "0.6749158", "0.6742377", "0.6736162", "0.6736045", "0.6734368", "0.6719228", "0.67088735", "0.6699809", "0.6693963", "0.66872084", "0.668263", "0...
0.75017405
0
add a test db.execute("INSERT INTO tasks (task, due_date, completed) VALUES ('pay bills again', '9/4/17', 'false')")
def create_task (db, task, due_date, completed) db.execute("INSERT INTO tasks (task, due_date, completed) VALUES (?, ?, ?)", [task, due_date, completed]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_task(db, task, date_needed, notes)\n db.execute(\"INSERT INTO list (task, date_needed, notes) VALUES (?, ?, ?)\", [task, date_needed, notes])\nend", "def add_task(db, table_name, name, time, importance)\n\tdb.execute(\"INSERT INTO #{table_name} (task_name, task_time, importance) VALUES (?, ?, ?)\", [n...
[ "0.86859226", "0.8082236", "0.8040265", "0.8022535", "0.71406865", "0.70912725", "0.7056773", "0.68811536", "0.6844786", "0.6838136", "0.68121916", "0.6774782", "0.6772722", "0.66671634", "0.6625227", "0.6621133", "0.6615321", "0.65995914", "0.6586554", "0.65757394", "0.65748...
0.8983653
0
check if puzzle solved.
def solved? # pour toutes les pièces (0..8).each { |i| # la case est encore vide : solved = false return false if @cases[i] == nil # sinon, est-ce que les pièces matchent entre elles. return false if not self.match?(i) } # sinon, ca match partout : le puzzle est résolu (solved) ! return t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solved?\n end", "def solved?\n @solution != nil\n end", "def solve\n\n #Loop until the puzzle is solved or until one\n #loop didn't change any values\n #--------------------------------------------------\n puzzle_check\n \n #If the puzzle wasn't solved, try one more time\n ...
[ "0.8040121", "0.7899613", "0.77969956", "0.7770005", "0.7699044", "0.76792985", "0.76619756", "0.7654912", "0.76367146", "0.754697", "0.7524984", "0.7505174", "0.73927504", "0.736069", "0.73512703", "0.73334247", "0.73215824", "0.72496474", "0.7147381", "0.71325177", "0.70878...
0.8175004
0
This method formats the TO address to include the provider.
def formatted_to "#{to}@#{Base.gateways[@provider][:sms]}" rescue raise "Invalid provider" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to\n @to ||= unquoted_address_header(:to)\n end", "def to\n address_list_fetch('to')\n end", "def stamp_to\n to = validate_to\n raise StanzaErrors::BadRequest.new(self, 'modify') unless to\n to.bare.tap do |bare|\n self['to'] = bare.to_s\n end\n end...
[ "0.6852653", "0.64515", "0.6396367", "0.61574036", "0.612608", "0.61088604", "0.6006481", "0.60062873", "0.5912349", "0.5888783", "0.5870044", "0.58464557", "0.58068854", "0.58068854", "0.5804907", "0.58012307", "0.5797022", "0.57720786", "0.5770777", "0.57604456", "0.5705903...
0.7275079
0
This method sanitizes the message body.
def sanitized_message message.to_s[0,140] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_body\n if @body && /\\b(?:html|xml)\\b/ =~ @type\n @body.scrub!\n end\n end", "def sanitize\n scrub_payload_emails\n scrub_actor_attributes\n end", "def cleanup_body(body)\n delimiters = Setting.mail_handler_body_delimiters.to_s.split(/[\\r\\n]+/).reject(&:bla...
[ "0.7031387", "0.70212257", "0.6961889", "0.6948664", "0.6917089", "0.6835991", "0.6805405", "0.6748517", "0.6724432", "0.6719474", "0.6689921", "0.6673553", "0.660771", "0.65629137", "0.6402586", "0.6368258", "0.6292628", "0.6287936", "0.62827325", "0.62174624", "0.6215756", ...
0.7102011
0
prompts player to choose from available columns
def choose_column available_cols = board.available_columns loop do puts "#{@light_turn ? LIGHT : DARK}'s turn." puts "Please choose a column from (#{available_cols.join(", ")})" col = gets.chomp.to_i return col if available_cols.include? col end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_input column, prompt_flag, prompt_text=nil, choices=nil, default=nil\n if prompt_flag == true\n prompt_flag = :freeform\n prompt_flag = :choice if choices\n end\n case prompt_flag\n when :freeform\n prompt_text ||= \"#{column.capitalize}\"\n #str = ask(prompt_text){ |q| q.d...
[ "0.65747523", "0.6495054", "0.64464766", "0.63697445", "0.6322361", "0.6216596", "0.6177974", "0.61590916", "0.61432123", "0.61092895", "0.60999936", "0.5991817", "0.5920525", "0.5810335", "0.5799087", "0.57847404", "0.5767358", "0.57584786", "0.57584786", "0.57584786", "0.57...
0.65978646
0
Populate the game board with chess pieces
def populate @board[7][0] = ChessPiece.new "w_rook_1", "\u2656" @board[7][1] = ChessPiece.new "w_knight_1", "\u2658" @board[7][2] = ChessPiece.new "w_bishop_1", "\u2657" @board[7][3] = ChessPiece.new "w_queen", "\u2655" @board[7][4] = ChessPiece.new "w_king", "\u2654" @board[7][5] = ChessPiece.n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def populate_board\n rows_of_pieces = (size - 2) / 2\n make_pieces([0, 1], 'red', rows_of_pieces, 1)\n make_pieces([size - 1, 0], 'black', rows_of_pieces, -1)\n end", "def populate_board\n back_row = [Rook, Knight, Bishop, Queen, King, Bishop, Knight, Rook]\n\n black_back_row = []\n back_row.e...
[ "0.8190161", "0.8135816", "0.79677683", "0.7955456", "0.7922005", "0.77886903", "0.77319306", "0.77269506", "0.77088875", "0.7583956", "0.75672823", "0.7553201", "0.75343597", "0.75214475", "0.7448395", "0.7402488", "0.739631", "0.73707753", "0.7357193", "0.7320941", "0.73137...
0.8264088
0
Returns a string that resembles a chess board
def format display_string = "" (0..7).each do |row| display_string += "#{row}" (0..7).each do |col| if @board[row][col].instance_of? ChessPiece display_string += "[#{@board[row][col].unicode} ]" elsif @board[row][col].is_a? String display_string += @board[row][co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def board_string\n\t\toutput_string = ''\n\t\t@game_board.each do |x|\n\t\t\tx.each do |y|\n\t\t\t\tif y == ''\n\t\t\t\t\ty = '-'\n\t\t\t\tend\n\t\t\t\toutput_string += y\n\t\t\tend\n\t\t\toutput_string += \"\\n\"\n\t\tend\n\t\toutput_string\n\tend", "def to_s\n board_2d.map do |row|\n row.map { |letter|...
[ "0.81569463", "0.79684997", "0.79651415", "0.78281605", "0.77872664", "0.7735651", "0.77242976", "0.76849085", "0.7664246", "0.76604277", "0.7641488", "0.7631391", "0.76211023", "0.7614432", "0.761214", "0.7583604", "0.7581005", "0.7573897", "0.7517187", "0.7513057", "0.75073...
0.80490744
1
GET /data_errors/1 GET /data_errors/1.json
def show @data_error = DataError.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @data_error } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_error\n dm_data.first.first == \"errors\"\n end", "def error\n @data['error']\n end", "def error\n @data['error']\n end", "def error\n data['error']\n end", "def format_errors(_data)\n _data.errors.as_json\n end", "def render_errors(errors)\n render json: errors...
[ "0.6915871", "0.6842427", "0.6842427", "0.6769913", "0.6687202", "0.6681599", "0.6664746", "0.6643704", "0.6529256", "0.6409022", "0.6373255", "0.6365299", "0.63526565", "0.6350938", "0.63375586", "0.63320255", "0.6301945", "0.6296029", "0.62238604", "0.62185663", "0.6216142"...
0.7119997
0
GET /data_errors/new GET /data_errors/new.json
def new @data_error = DataError.new respond_to do |format| format.html # new.html.erb format.json { render json: @data_error } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @information_error = InformationError.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @information_error }\n end\n end", "def new\n @thing_with_error = ThingWithError.new\n\n respond_to do |format|\n format.html # new.html.erb\n ...
[ "0.71066225", "0.7088602", "0.6927872", "0.6787473", "0.6518212", "0.64986336", "0.6448356", "0.6432634", "0.64298713", "0.6426504", "0.6412556", "0.6412556", "0.63385135", "0.63385135", "0.6337157", "0.6334755", "0.6316414", "0.628928", "0.6286267", "0.62850636", "0.62820566...
0.80718416
0
POST /data_errors POST /data_errors.json
def create @data_error = DataError.new(params[:data_error]) respond_to do |format| if @data_error.save format.html { redirect_to @data_error, notice: 'Data error was successfully created.' } format.json { render json: @data_error, status: :created, location: @data_error } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_errors(_data)\n _data.errors.as_json\n end", "def post(exception_data)\n hash = exception_data.to_hash\n hash[:session].delete(\"initialization_options\")\n hash[:session].delete(\"request\")\n call_remote(:errors, hash.to_json)\n end", "def error(data = false)\n ...
[ "0.6923201", "0.68207806", "0.6551415", "0.6448383", "0.6432634", "0.6341944", "0.6203858", "0.61404026", "0.6101696", "0.60785145", "0.60785145", "0.605449", "0.6047283", "0.5997083", "0.59899986", "0.59829164", "0.5958447", "0.595046", "0.59226465", "0.5921321", "0.59184146...
0.6906282
1
PUT /data_errors/1 PUT /data_errors/1.json
def update @data_error = DataError.find(params[:id]) respond_to do |format| if @data_error.update_attributes(params[:data_error]) format.html { redirect_to @data_error, notice: 'Data error was successfully updated.' } format.json { head :no_content } else format.html { rende...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @error.update(error_params)\n format.html { redirect_to @error, notice: \"Error was successfully updated.\" }\n format.json { render :show, status: :ok, location: @error }\n else\n format.html { render :edit, status: :unprocessable_entity }...
[ "0.6035311", "0.60297316", "0.59813106", "0.59805566", "0.5960468", "0.5960468", "0.5960468", "0.5960468", "0.5934411", "0.5898116", "0.5839487", "0.57817847", "0.5718022", "0.5716214", "0.5701169", "0.56662375", "0.5644471", "0.5628808", "0.56085217", "0.5595767", "0.5580112...
0.68804973
0
DELETE /data_errors/1 DELETE /data_errors/1.json
def destroy @data_error = DataError.find(params[:id]) @data_error.destroy respond_to do |format| format.html { redirect_to data_errors_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON....
[ "0.67463934", "0.6510026", "0.6480202", "0.6457014", "0.6455552", "0.6445516", "0.637112", "0.636466", "0.6351702", "0.634401", "0.63259536", "0.62997055", "0.6286317", "0.62835205", "0.6273738", "0.62508035", "0.62366986", "0.62332475", "0.6233235", "0.6230106", "0.6218038",...
0.7396915
0
GET /usuario_carta/1 GET /usuario_carta/1.json
def show @usuario_cartum = UsuarioCartum.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @usuario_cartum } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_cart\n render json: User.find(params[:id]).cart_products\n end", "def index\n render json: { carts: current_user.carts.select(:id, :product_id, :quantity).to_json }\n end", "def index\n if params[:usuario_producto]\n @usuario = Usuario.find(params[:usuario_id])\n render json: @usu...
[ "0.7232177", "0.6988673", "0.6977801", "0.69282895", "0.68262035", "0.6728768", "0.6706216", "0.66556543", "0.6607132", "0.65920216", "0.6537126", "0.6537126", "0.65095735", "0.64774585", "0.6470391", "0.64232874", "0.64232874", "0.6422311", "0.6374982", "0.6360945", "0.63591...
0.76665306
0
GET /usuario_carta/new GET /usuario_carta/new.json
def new @usuario_cartum = UsuarioCartum.new respond_to do |format| format.html # new.html.erb format.json { render json: @usuario_cartum } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @cartum = Cartum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cartum }\n end\n end", "def new\n if(ShoppingCart.find_by_user_id(current.user).nil?)\n @shopping_cart = ShoppingCart.new\n\n respond_to do |format|\n format.html...
[ "0.73844117", "0.73699594", "0.735934", "0.7292732", "0.72693306", "0.72693306", "0.72693306", "0.72693306", "0.72693306", "0.72693306", "0.72693306", "0.72693306", "0.7241418", "0.7185905", "0.7182895", "0.71679944", "0.7164979", "0.71499366", "0.71483904", "0.7134645", "0.7...
0.8002356
0
POST /usuario_carta POST /usuario_carta.json
def create @usuario_cartum = UsuarioCartum.new(params[:usuario_cartum]) respond_to do |format| if @usuario_cartum.save format.html { redirect_to @usuario_cartum, notice: 'Usuario cartum was successfully created.' } format.json { render json: @usuario_cartum, status: :created, location: @u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirmer_cart\n _user = current_client\n _confirmation = rand(36**10).to_s(36)\n _cart = Commande.new()\n _cart.client_id = _user.id\n if params[:addr_id] != '-1'\n _cart.adresse_id = params[:addr_id]\n else\n _cart.adresse_id = client_adresse.id \n end\n _cart.no_confirmat...
[ "0.67153966", "0.6650674", "0.6584135", "0.64670837", "0.64579016", "0.6433194", "0.63799113", "0.63520277", "0.63308144", "0.6295982", "0.6258594", "0.62575", "0.62538517", "0.6228916", "0.6225002", "0.6214997", "0.6214915", "0.62089336", "0.6197162", "0.61641103", "0.613156...
0.7366374
0
PUT /usuario_carta/1 PUT /usuario_carta/1.json
def update @usuario_cartum = UsuarioCartum.find(params[:id]) respond_to do |format| if @usuario_cartum.update_attributes(params[:usuario_cartum]) format.html { redirect_to @usuario_cartum, notice: 'Usuario cartum was successfully updated.' } format.json { head :no_content } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @catalogo_usuario.update(catalogo_usuario_params)\n format.html { redirect_to @catalogo_usuario, notice: 'Catalogo usuario was successfully updated.' }\n format.json { render :show, status: :ok, location: @catalogo_usuario }\n else\n format...
[ "0.6467914", "0.6255238", "0.6205772", "0.6157885", "0.61420465", "0.6134473", "0.6128039", "0.6117205", "0.6107925", "0.6104216", "0.6100391", "0.60754037", "0.60673416", "0.60660183", "0.60182613", "0.6012674", "0.6009118", "0.600188", "0.59716606", "0.5949145", "0.5934605"...
0.7085275
0
DELETE /usuario_carta/1 DELETE /usuario_carta/1.json
def destroy @usuario_cartum = UsuarioCartum.find(params[:id]) @usuario_cartum.destroy respond_to do |format| format.html { redirect_to usuario_carta_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @cartum = Cartum.find(params[:id])\n @cartum.destroy\n\n respond_to do |format|\n format.html { redirect_to carta_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n...
[ "0.7297382", "0.72116196", "0.7207271", "0.71159256", "0.7094339", "0.7028738", "0.70272565", "0.70239055", "0.7002976", "0.6999742", "0.6982968", "0.6980401", "0.69789207", "0.6978504", "0.6975756", "0.6969", "0.69672245", "0.69656205", "0.6963231", "0.69598836", "0.6954662"...
0.78999937
0
GET customer_quotes/1/customer_quote_lines/1 GET customer_quotes/1/customer_quote_lines/1.json
def show @customer_quote = CustomerQuote.find(params[:customer_quote_id]) @customer_quote_line = @customer_quote.customer_quote_lines.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render :json => @customer_quote_line } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def particular_customer_quotes\n offset = 0\n filter = \"%\"\n if (params[:offset].class.to_s != \"NilClass\" && params[:offset].integer?)\n offset = params[:offset].to_i\n end\n if (params[:filter].class.to_s != \"NilClass\")\n filter = \"%\" + params[:filter] + \"%\"\n end\n # lst...
[ "0.67117256", "0.65767527", "0.64757705", "0.6307343", "0.62854296", "0.6225669", "0.61302054", "0.59657013", "0.5959327", "0.5917317", "0.5826708", "0.58110654", "0.58016175", "0.5775008", "0.5769305", "0.57152903", "0.5671943", "0.5604728", "0.55968654", "0.55603665", "0.55...
0.7558311
0
GET customer_quotes/1/customer_quote_lines/new GET customer_quotes/1/customer_quote_lines/new.json
def new @customer_quote = CustomerQuote.find(params[:customer_quote_id]) @customer_quote_line = @customer_quote.customer_quote_lines.build @attachable = @customer_quote respond_to do |format| format.html # new.html.erb format.json { render :json => @customer_quote_lin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @quote = Quote.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quote }\n end\n end", "def new\n @order_line = OrderLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @order_line ...
[ "0.6336475", "0.62781185", "0.6223795", "0.61311376", "0.61071455", "0.6092834", "0.6086364", "0.6079747", "0.6079747", "0.6079747", "0.6079747", "0.6079747", "0.6079747", "0.6079747", "0.6079747", "0.6079747", "0.6079747", "0.6015527", "0.5916114", "0.58819103", "0.5871632",...
0.6634123
0
POST customer_quotes/1/customer_quote_lines POST customer_quotes/1/customer_quote_lines.json
def create @customer_quote = CustomerQuote.find(params[:customer_quote_id]) params[:customer_quote_line][:item_name_sub] = params[:alt_name_id] @customer_quote_line = @customer_quote.customer_quote_lines.build(customer_quote_line_params) @attachable = @customer_quote respond_to ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @quote_line = QuoteLine.new(quote_line_params)\n\n respond_to do |format|\n if @quote_line.save\n format.html { redirect_to @quote_line, notice: 'Quote line was successfully created.' }\n format.json { render action: 'show', status: :created, location: @quote_line }\n els...
[ "0.6673877", "0.6567689", "0.6428922", "0.6182378", "0.61731344", "0.6172129", "0.6140783", "0.6083108", "0.6056069", "0.6045152", "0.60255617", "0.59296066", "0.5821327", "0.5770799", "0.5731658", "0.57204586", "0.5689212", "0.5676273", "0.5646049", "0.56109333", "0.56006736...
0.69819164
0
PUT customer_quotes/1/customer_quote_lines/1 PUT customer_quotes/1/customer_quote_lines/1.json
def update @customer_quote = CustomerQuote.find(params[:customer_quote_id]) @customer_quote_line = @customer_quote.customer_quote_lines.find(params[:id]) @attachable = @customer_quote respond_to do |format| if @customer_quote_line.update_attributes(customer_quote_line_params) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @customer_quote = CustomerQuote.find(params[:customer_quote_id])\n @customer_quote_line = @customer_quote.customer_quote_lines.find(params[:id])\n @customer_quote_line.destroy\n\n respond_to do |format|\n format.html { redirect_to customer_quote_path(@customer_quo...
[ "0.67417216", "0.6607342", "0.6437862", "0.6269973", "0.6216328", "0.6159606", "0.6046217", "0.6024713", "0.5966548", "0.59249485", "0.5916886", "0.5860319", "0.58350927", "0.5818444", "0.57339543", "0.57330984", "0.5717281", "0.5665004", "0.5665004", "0.56541693", "0.5649172...
0.7125829
0
DELETE customer_quotes/1/customer_quote_lines/1 DELETE customer_quotes/1/customer_quote_lines/1.json
def destroy @customer_quote = CustomerQuote.find(params[:customer_quote_id]) @customer_quote_line = @customer_quote.customer_quote_lines.find(params[:id]) @customer_quote_line.destroy respond_to do |format| format.html { redirect_to customer_quote_path(@customer_quote), :notic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @quote_line.destroy\n respond_to do |format|\n format.html { redirect_to quote_lines_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @line_item = @order.line_items.find(params[:id])\n @line_item.destroy\n\n head :no_content\n end", "def destroy\...
[ "0.7204464", "0.661267", "0.65343726", "0.6467487", "0.6412911", "0.64046687", "0.63338304", "0.6333033", "0.63320935", "0.6301641", "0.6300822", "0.6296075", "0.62872", "0.6276502", "0.62640595", "0.6250997", "0.62473905", "0.6235136", "0.6220723", "0.62161064", "0.62042785"...
0.7477422
0
convert tweet url to embedding html
def embedding_tweet(content) embedded_content = content content.scan(/(https?:\/\/twitter\.com\/[a-zA-Z0-9_]+\/status\/([0-9]+)\/?)/).each do |url, id| tweet_json = open("https://api.twitter.com/1/statuses/oembed.json?id=#{id}").read tweet_html = JSON.parse(tweet_json, { :symbolize_names => true })[:html] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_tweet(t)\n URI.extract(t, %w[ http https ftp ]).each do |url|\n t.gsub!(url, \"<a href=\\\"#{url}\\\">#{url}</a>\")\n end\n \t# auto-link @usernames\n \tt = linkup_mentions_and_hashtags(t)\n end", "def twitter_format(text)\n auto_link(text.dup).html_safe\n end", "def extract_link(tw...
[ "0.710995", "0.6929726", "0.6837478", "0.6693981", "0.6689455", "0.6619641", "0.6617473", "0.6562044", "0.65238196", "0.6424935", "0.6424891", "0.6330949", "0.6195169", "0.6166195", "0.61651456", "0.6139545", "0.6068261", "0.6060905", "0.6051543", "0.6040017", "0.60272753", ...
0.7629559
1
=> Code Snippet pour une nouvelle QD
def snippet_for_qd "[QD#${1|#{list_qr_et_id(:qd).join(',')}|}]formate_qrd$0" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def snippet_for_new_qdf\n snippet_for_new_qd\n end", "def snippet_for_new_qd\n \"QD##{Objet::next_id_of_type 'QD'}: ${#{Snippet::next_tab}|h,d|}$0\"\n end", "def q\n self\n end", "def qv\n end", "def q(t)\n \n end", "def odk_code\n \"q#{id}\"\n end", "def ...
[ "0.73672616", "0.7219648", "0.652518", "0.6443565", "0.63217336", "0.61404216", "0.61404216", "0.60299826", "0.59905493", "0.59770185", "0.5864629", "0.5861694", "0.58289343", "0.58143896", "0.57835317", "0.5776795", "0.5757913", "0.5757361", "0.5740752", "0.57097214", "0.569...
0.7392762
0
=> Code Snippet pour une QDF
def snippet_for_new_qdf snippet_for_new_qd end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def snippet_for_qd\n \"[QD#${1|#{list_qr_et_id(:qd).join(',')}|}]formate_qrd$0\"\n end", "def snippet_for_new_qd\n \"QD##{Objet::next_id_of_type 'QD'}: ${#{Snippet::next_tab}|h,d|}$0\"\n end", "def qv\n end", "def to_Qdl\n gsub /\\\"/,\"'\"\n end", "def q(t)\n \n end"...
[ "0.7349451", "0.6751167", "0.6293761", "0.6153517", "0.59432757", "0.58148974", "0.5756038", "0.5756038", "0.5674801", "0.5646959", "0.56406647", "0.55962294", "0.55848527", "0.5569242", "0.5561918", "0.5547994", "0.54924875", "0.54858667", "0.54858667", "0.5419462", "0.54131...
0.71592
1
=> Code Snippet pour une RDF
def snippet_for_new_rdf snippet_for_new_rd end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rdf\n @rdf_data.join(\"\\n\")\n end", "def to_rdf()\n rdf = \"<rdf:Statement>\"\n rdf << write_subject()\n rdf << \" <rdf:predicate rdf:resource=\\\"#{@predicate}\\\"/>\"\n rdf << write_object()\n rdf << \"</rdf:Statement>\"\n return rdf \n ...
[ "0.63998115", "0.63864666", "0.6339132", "0.6199467", "0.61891854", "0.5991215", "0.5990974", "0.5989795", "0.5977827", "0.5971683", "0.5959784", "0.5950467", "0.5881883", "0.5855227", "0.5820095", "0.5818624", "0.58013326", "0.578622", "0.5785642", "0.57753694", "0.5741763",...
0.7348503
0
=> Code Snippet pour une nouvelle RD
def snippet_for_new_rd qd_id = select_qd_without_rd horloge = (Snippet::horloge nil, true) # ici pour le bon tab-stop type_reponse = select_type_reponse_rd while type_reponse.match(/\[tab_stop\]/) type_reponse.sub!(/\[tab_stop\]/, "\${#{Snippet::next_tab}:TEXTE}") end sn = ""...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def snippet_for_new_rdf\n snippet_for_new_rd\n end", "def code; end", "def code; end", "def code; end", "def code; end", "def code; end", "def code; end", "def code; end", "def main_description; end", "def docstring; end", "def docstring; end", "def description_and_code\n \"#{self....
[ "0.63468444", "0.62678313", "0.62678313", "0.62678313", "0.62678313", "0.62678313", "0.62678313", "0.62678313", "0.6130195", "0.60693324", "0.60693324", "0.6050456", "0.6000919", "0.5992267", "0.5965902", "0.5945546", "0.58924663", "0.58780944", "0.5859797", "0.5847473", "0.5...
0.69778496
0
Retourne l'identifiant de la QD choisie
def select_qd_without_rd qds = hash_qds true if qds.empty? Snippet::alert "Aucune QD n'est sans réponse dans ce fichier…", "Il faut définir une QD avant de définir sa RD." else items_string = qds.collect do |dqd| dqd[:qd].gsub!(/\"/,"\\\""); "\"#{dqd[:qd]}\"" end.join...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identifier_value\n DEFAULT_QUESTIONNAIRE_ID\n end", "def option_number\n pricing_db_hp_support_option.option_number\n end", "def choice\n @choice\n end", "def answer_id answer\n answer.id || \"V#{answer.answer.id}\"\n end", "def getIdFromString(option)\n str = option.sp...
[ "0.6541679", "0.60429424", "0.58462596", "0.5812924", "0.5802944", "0.5776858", "0.5744902", "0.5704326", "0.56972706", "0.5696809", "0.56900865", "0.5642818", "0.5625298", "0.5621794", "0.5597857", "0.55970126", "0.55760807", "0.5554164", "0.5517884", "0.5495366", "0.5490952...
0.60702175
1
VBS payload and Post Data preparation
def get_payload handler payload = generate_payload_exe @vbs_content = Msf::Util::EXE.to_exe_vbs(payload) ## determining the target directory if target.name == 'AppManager 14' tfile = "AppManager14" elsif target.name == 'AppManager 13' tfile = "AppManager13" elsif targe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_vbs(url, payload_name, stager_name)\r\n\t\tname_xmlhttp = rand_text_alpha(2)\r\n\t\tname_adodb = rand_text_alpha(2)\r\n\r\n\t\ttmp = \"#{@temp_folder}/#{stager_name}\"\r\n\r\n\t\tvbs = \"echo Set #{name_xmlhttp} = CreateObject(\\\"\\\"Microsoft.XMLHTTP\\\"\\\") \"\r\n\t\tvbs << \": #{name_xmlhttp}.ope...
[ "0.63305825", "0.5805784", "0.57444984", "0.5621189", "0.5532408", "0.5529648", "0.5508981", "0.5500931", "0.5466006", "0.5445682", "0.53997624", "0.5381502", "0.533078", "0.5298314", "0.52878666", "0.5178731", "0.5141616", "0.51032495", "0.5102343", "0.5099219", "0.50991964"...
0.6072732
1
create the splash screen
def makeSplash clearScreen splash = ConsoleSplash.new(15,70) splash.write_header("Welcome to Sokoban","Ben Cornforth","Alpha Build, November 2015",{:nameFg=>:green,:authorFg=>:green, :versionFg=>:green, :bg=>:black}) splash.write_horizontal_pattern("/*",{:fg=>:white, :bg=>:black}) splash.write_vertical_patter...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_splash\n # Clear the console\n puts \"\\e[H\\e[2J\" \n \n # Create a new splash object \n splash = ConsoleSplash.new(13, 40) # 13 lines, 40 columns\n \n # Add header to the splash console\n splash.write_header(\"Welcome to Flood-It\", \"Georgica Bors\", \"1.0\")\n \n # Add text to the splash co...
[ "0.74522036", "0.7400914", "0.73734385", "0.7195702", "0.70641184", "0.68864214", "0.6719047", "0.66990846", "0.66406673", "0.6425671", "0.62789845", "0.6159664", "0.6134156", "0.6069183", "0.60490006", "0.5876578", "0.57983047", "0.5781068", "0.5745225", "0.5740454", "0.5727...
0.7615542
0
this code will run when the user wants to select a level
def selectLevel puts "Choose a level from 1 - 90:" input = gets.chomp() tempLevelNo = input.to_i if (input == tempLevelNo.to_s) if 1 > tempLevelNo || tempLevelNo > 90 puts "Level does not exist, please choose a level from 1-90" puts "Do you wish to continue choosing? y/n" case(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_level\n @level = Level.find(params[:id])\n end", "def set_level\n @level = Level.find(params[:id])\n end", "def charPressedInMenu\n char = pressKey\n case (char)\n when \"p\"\n #load level of choice\n loadArray\n #displayArray\n displayArray\n when \"q\"\n ...
[ "0.6719394", "0.6719394", "0.6717201", "0.6695112", "0.6690989", "0.66903657", "0.6636764", "0.649158", "0.6483316", "0.64689684", "0.6352674", "0.63503146", "0.63448644", "0.63448644", "0.63321406", "0.6331029", "0.6325102", "0.6307368", "0.6304731", "0.6297926", "0.6294848"...
0.6919729
0
creating an array for locateMan, where the 0th element is x across, and the 1st element is y down
def locateMan yDown=0 @levelArr.each do |y| xCount=1 y.each do |x| if x == '@' return xCount,yDown end xCount+=1 end yDown+=1 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def location\n [@posX, @posY, @facing]\n end", "def cal_pos\n x, y = map_location(@grid_x, @grid_y)\n x += @tile_size/2\n y += @tile_size/2\n [x,y]\n end", "def get_cell_at_xy(input_array)\n input_array.map do |coord|\n x = coord[0]\n y = coord[1]\n at_coord...
[ "0.6381427", "0.6282143", "0.62155336", "0.6201006", "0.6173462", "0.6138358", "0.6096959", "0.6088362", "0.6043062", "0.60320646", "0.5939095", "0.5936157", "0.5900313", "0.5886333", "0.58730876", "0.58582896", "0.585681", "0.5854415", "0.58192456", "0.58101594", "0.5802714"...
0.6663756
0
GET /traces/1 GET /traces/1.xml
def show @trace = Trace.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @trace } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @traces = Trace.all\n\n render json: @traces\n end", "def test_post_then_get\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n id = last_response.body\n\n get \"/traces/#{id}\"\n ...
[ "0.6214823", "0.6100431", "0.6033639", "0.56212276", "0.55663943", "0.55239695", "0.5498872", "0.54892373", "0.54737365", "0.5434124", "0.5434124", "0.5401129", "0.53968227", "0.53658843", "0.5344298", "0.5342842", "0.53344697", "0.53060704", "0.5285319", "0.52768576", "0.526...
0.6564382
0
GET /traces/new GET /traces/new.xml
def new @trace = Trace.new(params[:trace]) respond_to do |format| format.html # new.html.erb format.xml { render :xml => @trace } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @trace = Trace.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @trace }\n end\n end", "def create\n @trace = Trace.new(params[:trace])\n\n respond_to do |format|\n if @trace.save\n format.html { redirect_to(@trace, :notice...
[ "0.733107", "0.6416524", "0.6407681", "0.62683946", "0.6206989", "0.6154043", "0.6154043", "0.61399186", "0.6129796", "0.6114777", "0.6091656", "0.60756296", "0.60152227", "0.60088545", "0.60088545", "0.6006569", "0.5967345", "0.5965664", "0.59655195", "0.59530616", "0.595298...
0.727908
1
PUT /traces/1 PUT /traces/1.xml
def update @trace = Trace.find(params[:id]) respond_to do |format| if @trace.update_attributes(params[:trace]) format.html { redirect_to(@trace, :notice => 'Trace was successfully updated.') } format.xml { head :ok } else format.html { render :action => "edit" } for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_put\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n contents = last_response.body\n contents_id = contents['_id']\n\n data = File.read 'sample-traces/1.json'\n put(\"/traces/#{conte...
[ "0.6835423", "0.60055846", "0.5863916", "0.55920285", "0.558591", "0.55336314", "0.55016124", "0.54899234", "0.54840225", "0.53827286", "0.5276518", "0.52729386", "0.52646047", "0.51118666", "0.5062133", "0.50550354", "0.5046644", "0.5031522", "0.5015565", "0.49722326", "0.49...
0.61566895
1
DELETE /traces/1 DELETE /traces/1.xml
def destroy @trace = Trace.find(params[:id]) @trace.destroy respond_to do |format| format.html { redirect_to(traces_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON....
[ "0.70515364", "0.63895845", "0.60920775", "0.60506153", "0.60361624", "0.60091126", "0.59992844", "0.59912455", "0.5844168", "0.58360606", "0.57954866", "0.5791484", "0.57795537", "0.57717574", "0.5738916", "0.57241696", "0.57216364", "0.5721081", "0.5709976", "0.56974405", "...
0.71903116
1
GET /studenttests GET /studenttests.json
def index @studenttests = Studenttest.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @student_test = StudentTest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student_test }\n end\n end", "def my_students(query={})\n self.simple_client.get(\"/api/v1/students?#{query.to_query}\")\n end", "def index\n ...
[ "0.7342745", "0.6774699", "0.6741088", "0.67029816", "0.66744035", "0.66239357", "0.65891767", "0.6573441", "0.65558666", "0.6547281", "0.64935964", "0.64917266", "0.64917266", "0.64890325", "0.64645094", "0.64582145", "0.6453144", "0.634893", "0.632752", "0.6314565", "0.6306...
0.7141873
1
POST /studenttests POST /studenttests.json
def create @studenttest = Studenttest.new(studenttest_params) respond_to do |format| if @studenttest.save format.html { redirect_to @studenttest, notice: 'Studenttest was successfully created.' } format.json { render :show, status: :created, location: @studenttest } else for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @student_test = StudentTest.new(params[:student_test])\n\n respond_to do |format|\n if @student_test.save\n format.html { redirect_to @student_test, notice: 'Student test was successfully created.' }\n format.json { render json: @student_test, status: :created, location: @stud...
[ "0.7313287", "0.65778613", "0.64818156", "0.6481537", "0.637193", "0.6324752", "0.63236153", "0.6302043", "0.61968744", "0.618197", "0.6168903", "0.6164026", "0.61461747", "0.61207753", "0.6107524", "0.6096397", "0.6054729", "0.603553", "0.6033991", "0.6025285", "0.6025285", ...
0.7105652
1
PATCH/PUT /studenttests/1 PATCH/PUT /studenttests/1.json
def update respond_to do |format| if @studenttest.update(studenttest_params) format.html { redirect_to @studenttest, notice: 'Studenttest was successfully updated.' } format.json { render :show, status: :ok, location: @studenttest } else format.html { render :edit } forma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @student_test = StudentTest.find(params[:id])\n\n respond_to do |format|\n if @student_test.update_attributes(params[:student_test])\n format.html { redirect_to @student_test, notice: 'Student test was successfully updated.' }\n format.json { head :ok }\n else\n fo...
[ "0.72673965", "0.6570896", "0.65522385", "0.64222735", "0.6384512", "0.63650024", "0.63650024", "0.63650024", "0.63650024", "0.63650024", "0.63650024", "0.63650024", "0.6357426", "0.63539463", "0.6352404", "0.63210696", "0.63210696", "0.63161266", "0.631607", "0.630436", "0.6...
0.6956709
1
DELETE /studenttests/1 DELETE /studenttests/1.json
def destroy @studenttest.destroy respond_to do |format| format.html { redirect_to studenttests_url, notice: 'Studenttest was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @student_test = StudentTest.find(params[:id])\n @student_test.destroy\n\n respond_to do |format|\n format.html { redirect_to student_tests_url }\n format.json { head :ok }\n end\n end", "def destroy\n @test = Test.find(params[:id])\n @test.destroy\n\n respond_to do |...
[ "0.79265225", "0.7243113", "0.72413415", "0.7187567", "0.7187567", "0.70800036", "0.7045642", "0.7038258", "0.70323914", "0.70323914", "0.70323914", "0.70323914", "0.7028767", "0.7025695", "0.7012168", "0.6995361", "0.6992316", "0.6985116", "0.69729567", "0.69553304", "0.6955...
0.75891656
1
add some books into inventory
def purchase_books(newbooks) newbooks.each {|book, number| inventory[book] = number} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addBook(book)\n\t\tinventories.create(book_id: book.id)\n\tend", "def add_book(book)\n current_item = line_items.find_by(book_id: book.id)\n if current_item\n current_item.quantity +=1\n else\n current_item = line_items.build(book_id: book.id)\n end\n ...
[ "0.7751378", "0.75770247", "0.7140081", "0.71239245", "0.70976305", "0.70146227", "0.70124143", "0.6956679", "0.69466984", "0.69409853", "0.6938078", "0.6936585", "0.6927334", "0.6874041", "0.68431854", "0.6842158", "0.6809074", "0.67954046", "0.67708445", "0.67566246", "0.67...
0.7760547
0
Create a new record for current transaction One record is created for one book. Every user can only borrow a book for 60 days.
def add_a_record(user, book) now = DateTime.now.to_date borrow_days = 60 due = now + borrow_days @records << Record.new(user.id, book.isbn, now, due) puts "Successfully lend <#{book.title}> to #{user.name}. Due:#{due}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n book_id = params[:book_id]\n book_title = params[:book_title]\n borrowerid = params[:borrowerid]\n borrowdate = params[:borrow_date]\n returndate = params[:return_date]\n @borrowtable = Borrowtable.new(:bookid => book_id, :bookname => book_title, :borrowerid => borrowerid,\n ...
[ "0.69769645", "0.69267875", "0.6913721", "0.65632766", "0.6509955", "0.6485653", "0.64737046", "0.64623195", "0.6437323", "0.6433015", "0.6413216", "0.6384438", "0.63746494", "0.6355107", "0.6324764", "0.6317695", "0.6309435", "0.63090104", "0.6304816", "0.63032097", "0.62798...
0.71910864
0
Check records of a user.
def check_records(user) @records.select{|record| !record.has_return && record.user_id == user.id}.each do |record| @inventory.each do |book,value| if book.isbn == record.book_isbn then puts "=> Warning! \n" puts "#{user.name} borrowed <#{book.title}> on #{record.borrow_date}, #{user.name} has to retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_check(resource)\n return true unless self[:name] == \"user\"\n return true unless self[:unless_system_user]\n\n resource[:audit] = :uid\n\n return false if system_users.include?(resource[:name])\n\n current_values = resource.retrieve_resource\n current_values[resource.property(:uid)] > s...
[ "0.63647467", "0.63553554", "0.6290373", "0.61673236", "0.615817", "0.6141064", "0.61370826", "0.611401", "0.6047428", "0.6017651", "0.6003659", "0.6002102", "0.599394", "0.59900594", "0.5970619", "0.5958268", "0.59244865", "0.5921791", "0.5911777", "0.59102124", "0.58602285"...
0.6952754
0
GET /admin/funcionarios/1 GET /admin/funcionarios/1.json
def show @funcionario = Funcionario.find(params[:id]) respond_with @funcionario, :location => admin_funcionario_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @funcionario = Funcionario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @funcionario }\n end\n end", "def index\n @funcionarios = Funcionario.all\n end", "def index\n @funcionarios = Funcionario.all\n end", "def...
[ "0.7249679", "0.70558417", "0.70558417", "0.70295674", "0.6838803", "0.68160063", "0.6718118", "0.66828966", "0.6593217", "0.6485803", "0.645231", "0.6447877", "0.63661695", "0.62970614", "0.6265304", "0.623989", "0.6210647", "0.6198975", "0.6187996", "0.6182959", "0.6152777"...
0.7101302
1
GET /admin/funcionarios/new GET /admin/funcionarios/new.json
def new @funcionario = Funcionario.new @funcionario.contato_telefones.build respond_with @funcionario, :location => new_admin_funcionario_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @funcionario = Funcionario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @funcionario }\n end\n end", "def create\n @tipo_funcionario = TipoFuncionario.new(tipo_funcionario_params)\n\n respond_to do |format|\n if @tipo_funcionari...
[ "0.79055303", "0.7298924", "0.72745794", "0.7200279", "0.7192419", "0.7169684", "0.71055186", "0.6987913", "0.696834", "0.69390494", "0.68903315", "0.68157226", "0.6777903", "0.67569673", "0.6734827", "0.6729333", "0.67257786", "0.67065614", "0.6702373", "0.66999155", "0.6692...
0.7700561
1
PUT /admin/funcionarios/1 PUT /admin/funcionarios/1.json
def update @funcionario = Funcionario.find(params[:id]) respond_to do |format| if @funcionario.update_attributes(params[:funcionario]) format.html { redirect_to [:admin, @funcionario], notice: 'Funcionario Atualizado com sucesso.' } format.json { head :no_content } else form...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @funcao.update(funcao_params)\n format.html { redirect_to @funcao, notice: 'Funcao was successfully updated.' }\n format.json { render :show, status: :ok, location: @funcao }\n else\n format.html { render :edit }\n format.json { rend...
[ "0.7178259", "0.7031", "0.6980899", "0.69224733", "0.69187415", "0.6802858", "0.65889907", "0.65432143", "0.649853", "0.6391254", "0.6331525", "0.61915946", "0.6183542", "0.6161192", "0.6077309", "0.60569197", "0.60550284", "0.60549605", "0.60524046", "0.6028754", "0.6028754"...
0.72757894
0
DELETE /admin/funcionarios/1 DELETE /admin/funcionarios/1.json
def destroy @funcionario = Funcionario.find(params[:id]) @funcionario.destroy respond_to do |format| format.html { redirect_to admin_funcionarios_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @funcionario = Funcionario.find(params[:id])\n @funcionario.destroy\n\n respond_to do |format|\n format.html { redirect_to funcionarios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @funcionario.destroy\n respond_to do |format|\n format.html...
[ "0.7615027", "0.75380266", "0.75115776", "0.7438658", "0.72932506", "0.72602683", "0.71821505", "0.7181262", "0.71102595", "0.7028232", "0.70054305", "0.69871664", "0.6977697", "0.6964186", "0.6955146", "0.6945944", "0.6925926", "0.6918656", "0.6911894", "0.6911062", "0.69109...
0.7802818
0
Returns the square of the sum of the first +n+ natural numbers
def square_of_sums return (@n * (@n + 1) / 2)**2 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def square_of_sum(n)\n sum = 0\n (1..n).each {|i| sum = sum + i}\n sum * sum\n end", "def sum_of_squares(n)\n sum = 0\n (1..n).each {|i| sum = sum + (i*i)}\n sum\n end", "def square_of_sum\n\t\t@n**2*(@n+1)**2/4\n\tend", "def sum_up_to_squared n=100\r\n (2 * n + 1) * (n +...
[ "0.8386006", "0.7973424", "0.79434913", "0.7864936", "0.78023165", "0.765812", "0.76429236", "0.7633945", "0.7561177", "0.75412804", "0.75055015", "0.74811", "0.7475553", "0.7463038", "0.74529445", "0.74393106", "0.74113595", "0.73868793", "0.73721236", "0.73595667", "0.73349...
0.83127034
1
GET /ways GET /ways.json
def index @ways = Way.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_ways_using_node(id)\n api_call(id, \"node/#{id}/ways\")\n end", "def index\n @ways_of_admissions = WaysOfAdmission.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ways_of_admissions }\n end\n end", "def show\n @ways...
[ "0.69018334", "0.66725165", "0.664601", "0.6622051", "0.65638196", "0.63588375", "0.63127786", "0.6286787", "0.6250313", "0.6243861", "0.6131232", "0.61146474", "0.6103763", "0.6084988", "0.60843223", "0.60350144", "0.6010627", "0.598401", "0.59624785", "0.5940741", "0.584865...
0.71732
0
POST /ways POST /ways.json
def create @way = Way.new(way_params) respond_to do |format| if @way.save format.html { redirect_to @way, notice: 'Way was successfully created.' } format.json { render :show, status: :created, location: @way } else format.html { render :new } format.json { render js...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @order_way = OrderWay.new(order_way_params)\n\n respond_to do |format|\n if @order_way.save\n format.html { redirect_to @order_way, notice: 'Order way was successfully created.' }\n format.json { render :show, status: :created, location: @order_way }\n else\n forma...
[ "0.67839986", "0.6742594", "0.6700332", "0.66208863", "0.6590533", "0.6566288", "0.63995945", "0.6309827", "0.6180557", "0.60790014", "0.5970307", "0.5951881", "0.59408665", "0.59136873", "0.58563167", "0.58475304", "0.58260286", "0.58092076", "0.5804434", "0.5792486", "0.577...
0.7276052
0
PATCH/PUT /ways/1 PATCH/PUT /ways/1.json
def update respond_to do |format| if @way.update(way_params) format.html { redirect_to @way, notice: 'Way was successfully updated.' } format.json { render :show, status: :ok, location: @way } else format.html { render :edit } format.json { render json: @way.errors, statu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @subway = Subway.find(params[:id])\n\n respond_to do |format|\n if @subway.update_attributes(params[:subway])\n format.html { redirect_to @subway, notice: 'Subway was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\"...
[ "0.6564012", "0.65603477", "0.6373927", "0.6373873", "0.632334", "0.6319039", "0.62574214", "0.6180161", "0.6136139", "0.60556453", "0.60521275", "0.6022372", "0.60013413", "0.59669256", "0.5899495", "0.58886904", "0.5870361", "0.58481485", "0.5842066", "0.58115643", "0.57975...
0.6766084
0
Return an array of addresses from 1 or more aliases that match either IPv4 or IPv6
def resolve_alias(addresses, ipvers) addresses = [addresses] unless addresses.is_a?(Array) result = [] addresses.each do |address| if address =~ /^([\w\-]+)$/ if aliases[address] result += select_ipvers(aliases[address], ipvers) else raise "Alias is not defined: #{a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getaddresses(name)\n return [name] if ADDRESS_REGEX.match(name)\n @resolvers.each do |resolver|\n addresses = []\n resolver.each_address(name) { |address| addresses << address }\n return addresses unless addresses.empty?\n end\n []\n end", "def extract_addresses(address_list)\n a...
[ "0.65996414", "0.64940137", "0.64407414", "0.6321463", "0.6306254", "0.62178785", "0.6201579", "0.6173752", "0.61470044", "0.6053043", "0.60380906", "0.5973963", "0.5969093", "0.59667933", "0.59415346", "0.5933625", "0.5881579", "0.5879615", "0.58582234", "0.58507216", "0.581...
0.70776016
0
This endpoint allows to recommend a new member to airlines.
def create_recommend_a_new_member(body) # Prepare query url. _path_url = '/v1/airline/members/' _query_builder = Configuration.get_base_uri _query_builder << _path_url _query_url = APIHelper.clean_url _query_builder # Prepare headers. _headers = { 'accept' => 'a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @member = Member.new(params[:member])\n\n respond_to do |format|\n if @member.save\n add_plan_to_user_if_specified!\n \n format.html { redirect_to(@member, :notice => 'Member was successfully created.') }\n format.json { render :json => @member, :status => :crea...
[ "0.5646906", "0.5532538", "0.54985344", "0.5403972", "0.5386378", "0.53768337", "0.53394663", "0.533649", "0.530887", "0.5281685", "0.52663296", "0.5258725", "0.52580065", "0.52475876", "0.5243645", "0.52206445", "0.520511", "0.51992065", "0.5196027", "0.5191123", "0.51868737...
0.70048314
0
This endpoint allows to search a member on the airline system.
def create_member_search(body) # Prepare query url. _path_url = '/v1/airline/members/actions/search' _query_builder = Configuration.get_base_uri _query_builder << _path_url _query_url = APIHelper.clean_url _query_builder # Prepare headers. _headers = { 'accept' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search\n @members = Member.search_by params[:category], params[:keywords], params[:is_active]\n\n render :template => '/api/members/index'\n end", "def search_members(query, options = {})\n get search_path(\"members\"), options.merge(query: query)\n end", "def index\n @search = Member...
[ "0.67855644", "0.6548864", "0.6258896", "0.6216999", "0.6200944", "0.61297095", "0.60450435", "0.6024119", "0.6001982", "0.60001326", "0.594357", "0.592639", "0.59210527", "0.5875939", "0.5861792", "0.5850032", "0.5848564", "0.5846454", "0.5837113", "0.5830175", "0.58282036",...
0.6971287
0
sets the genre to the genre of the specified name
def genre_name=(name) self.genre = Genre.find_or_create_by(name: name) self.genre = genre end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def genre_name=(name)\n self.genre = Genre.find_or_create_by(name: name)\n end", "def genre_name=(name)\n self.genre = Genre.find_or_create_by(name: name)\n end", "def genre_name=(name)\n self.genre = Genre.find_or_create_by(name: name)\n end", "def genre_name=(name)\n self.genre = Genre...
[ "0.8453164", "0.831982", "0.831982", "0.831982", "0.79601127", "0.7695125", "0.76474917", "0.76370174", "0.7627474", "0.7627474", "0.7572217", "0.74475527", "0.74475527", "0.73975426", "0.7343262", "0.73291606", "0.7328257", "0.7328257", "0.7308729", "0.7294673", "0.7277976",...
0.85104114
0
then, the method will print: "a", "b", "c", "ab", "bc", "abc" if the input string is "abcd", then, the method will print: "a", "b", "c", "d", "ab", "bc", "cd", "abc", "bcd", "abcd"
def print_combinations(str) return if !str || str.length == 0 str_length = str.length char_count = 1 while char_count <= str_length start_index = 0 print_current(start_index, char_count, str, str_length) char_count += 1 end return end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def StringReduction(str)\n until str.split(\"\").uniq.length == 1\n str = str.sub(/ab|ba/, \"c\").\n sub(/ac|ca/, \"b\").\n sub(/cb|bc/, \"a\")\n end\n str.size \nend", "def find_all_combos(str=[\"\"],arr={})\n if str.length == 1\n return str\n end\n i = 0\n #ite...
[ "0.65881073", "0.639427", "0.6373545", "0.635229", "0.62963796", "0.6280881", "0.62718064", "0.62551165", "0.6203235", "0.6180908", "0.61791754", "0.61758715", "0.61511016", "0.6150229", "0.61201406", "0.6106661", "0.6102503", "0.6101571", "0.61008465", "0.61001694", "0.60783...
0.6488588
1
Process argument, return register code if arg is like R0,R1 or AX,FLAG. Else if arg is a defined label, then returns it's address. If it is a integer, just read and parse to the caller. Otherwise it must be a undefined lebel, feel free to return nil. process_argument("123h") porcess_argument("R0") process_argument("sta...
def process_argument(arg) return REG[arg] if REG.has_key?(arg) return EREG[arg] if EREG.has_key?(arg) return SREG[arg] if SREG.has_key?(arg) return @labels[arg] if @labels.has_key?(arg) return arg.to_i(16) if arg =~ /^\d*[Hh]$/ return arg.to_i(10) if arg =~ /^\d*[Dd]+$/ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_argument(arg)\n case arg\n when *@mapping[:http_request] then set_mode(:http_request)\n when *@mapping[:source] then set_mode(:source)\n when *@mapping[:http_status] then set_mode(:http_status)\n when *@mapping[:timestamp] then set_mode(:timestamp) \n wh...
[ "0.65264785", "0.64714813", "0.646577", "0.6157773", "0.57950747", "0.57208675", "0.5696529", "0.55878943", "0.5484339", "0.5467529", "0.5372045", "0.5369584", "0.53099304", "0.52562016", "0.5234169", "0.5228411", "0.5122328", "0.51144767", "0.51029444", "0.5077223", "0.50710...
0.78632027
0
Generate the required signature as specified by unionpay official document it returns the signature string
def generate_signature sha1x16 = Digest::SHA1.hexdigest(signed_string) .tap { |s| logger.debug "sha1x16 #{s}" } enc = case form_fields['signMethod'] when '01' # 01 means RSA merchant_private_key.sign(OpenSSL::Digest::SHA1.new, sha1x16) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_signature(string_to_sign)\n digest = OpenSSL::Digest.new('sha256')\n OpenSSL::HMAC.hexdigest(digest, @api_secret, string_to_sign)\n end", "def generate_signature\n digest = OpenSSL::Digest.new('sha256')\n string_to_sign = \"#{@url_path}?#{sorted_parameters_query}\"\n ...
[ "0.72814804", "0.72706914", "0.7163797", "0.7154344", "0.7073618", "0.70271796", "0.6941081", "0.6893011", "0.6892118", "0.687593", "0.68695897", "0.6845367", "0.6824029", "0.68158877", "0.6784177", "0.6784177", "0.6780259", "0.6761523", "0.67099506", "0.6697454", "0.6692018"...
0.80659693
0
Generate the string to sign on from all in from_fields. Currently Unionpay doc specifies that the fields are arranged alphabetically
def signed_string signed_data_only = form_fields.reject { |s| FIELDS_NOT_TO_BE_SIGNED.include?(s) } signed_data_only.sort.collect { |s| "#{s[0]}=#{s[1]}" }.join('&') .tap { |ss| logger.debug "signed string is #{ss}" } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def signed_field_names\n @signed_fields.join(',')\n end", "def build_form_string(fields)\n return nil if fields.nil?\n tmp = []\n fields.each{|k,v|\n tmp << \"#{k.to_s}=#{v.to_s}\"\n }\n tmp.join(\"&\")\n end", "def build_order_string(fields, mode=\"ASC\...
[ "0.5991405", "0.5496816", "0.54908687", "0.54765916", "0.5473576", "0.54252845", "0.54252845", "0.54045486", "0.53803265", "0.5350425", "0.528696", "0.5247209", "0.52301115", "0.5228437", "0.51992196", "0.51936996", "0.516909", "0.5140548", "0.51370764", "0.5126734", "0.50654...
0.5750741
1
Inject inprocess correlations into the supplied carrier.
def inject(carrier, context, &setter) return carrier unless (correlations = context[ContextKeys.correlation_context_key]) && !correlations.empty? setter ||= default_setter setter.call(carrier, @correlation_context_key, encode(correlations)) carrier end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inject(carrier, context = Context.current, &setter)\n @injectors.inject(carrier) do |memo, injector|\n injector.inject(memo, context, &setter)\n rescue => e # rubocop:disable Style/RescueStandardError\n OpenTelemetry.logger.warn \"Error in CompositePropagator#inject #{e....
[ "0.7050875", "0.6734479", "0.65621763", "0.63016534", "0.5946533", "0.5832985", "0.57912904", "0.57182926", "0.5652006", "0.56405365", "0.5390068", "0.5379433", "0.52942514", "0.52912015", "0.5278401", "0.52620333", "0.52503556", "0.5047367", "0.5037935", "0.49455997", "0.492...
0.7411865
0
Returns true if the target_modules == :all, or contains the module_name in the collection.
def can_use(module_name) target_is_all? or target_includes? module_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def includes_modules?\n @includes_modules\n end", "def has_modules?\n m = @context.modules.find{|m| m.document_self}\n m ? true : false\n end", "def matchRequirement?(modules)\n modules.nil? or modules.all? {|mod| has_key?(mod)}\n end", "def has_all?\n @privileges.fetch(@tar...
[ "0.6894316", "0.67173016", "0.64719355", "0.6443027", "0.61643624", "0.6153314", "0.61509633", "0.6099001", "0.60466856", "0.6044615", "0.6032038", "0.59916", "0.5949316", "0.581328", "0.5784757", "0.5727358", "0.56976223", "0.569", "0.56809425", "0.5649306", "0.5649306", "...
0.7839998
0
display_board Should accept a board as an argument and print out the current state of the board for the user.
def display_board(board) puts " #{board[0]} | #{board[1]} | #{board[2]} " puts "-----------" puts " #{board[3]} | #{board[4]} | #{board[5]} " puts "-----------" puts " #{board[6]} | #{board[7]} | #{board[8]} " end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"---+----+----\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"---+----+----\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\n end", "def display_board\n puts \" #{@board[0]} | #{@boa...
[ "0.8053142", "0.7945663", "0.7925305", "0.7919637", "0.7912888", "0.7889378", "0.7876681", "0.78522366", "0.78499115", "0.7849138", "0.7849138", "0.78220224", "0.78220034", "0.7816811", "0.78103936", "0.780819", "0.780819", "0.780819", "0.780819", "0.780819", "0.780819", "0...
0.80963767
1
A collection of Drip objects associated with a given `Caffeinate::Dripper`
def drips drip_collection.values end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dripper\n ::Caffeinate.dripper_collection.resolve(self)\n end", "def trips\n RideShare::Trip.find_all_for_rider(@id)\n end", "def rider_trip_instances\n rider_trips = RideShare::Trip.all_rider_trip_instances(@rider_id)\n return rider_trips\n end", "def trips\n Trip.fi...
[ "0.66506803", "0.62345374", "0.6022168", "0.5945111", "0.5814769", "0.57565314", "0.5748462", "0.5720995", "0.5689172", "0.5657983", "0.56344426", "0.56202114", "0.55891573", "0.5557003", "0.55509233", "0.5521626", "0.5521104", "0.55117655", "0.5487773", "0.54855525", "0.5485...
0.6384552
1
Method to determine if a flowcell can be cleaned or not. For a flowcell to be cleaned, all of the following conditions must be true : 1) Marker file ".rsync_finished" must be present 2) It must have been modified 20 days ago (i.e. 1728000 seconds earlier) 3) The flowcell must not have been cleaned earlier (i.e., it mus...
def isAvailableForCleaning(fcName) markerName = fcName + "/.rsync_finished" if File::exist?(markerName) modTime = File::mtime(markerName) timeDiff = (Time.now- modTime) intensityLaneDir = fcName + "/Data/Intensities/L00*" intensityLaneDir = Dir[fcName + "/Data/Intensities/L00*"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fcReady?(fcName)\n if File::exist?(@instrDir + \"/\" + fcName + \"/.rsync_finished\")\n return true\n end\n \n if fcName.match(/SN601/) || fcName.match(/SN166/) \n puts \"Flowcell \" + fcName + \" is not configured for automatic analysis\"\n return false\n end\n\n # If the mar...
[ "0.6459014", "0.61789834", "0.6173833", "0.57643414", "0.5756706", "0.56445915", "0.5590954", "0.554623", "0.5523257", "0.55117345", "0.5488111", "0.54705775", "0.54400265", "0.5393438", "0.53783447", "0.5327384", "0.5319959", "0.5294783", "0.5291879", "0.52897424", "0.528745...
0.77530825
0
Returns wheter the neuron is self connected
def selfconnected? !selfconnection.weight.zero? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connected?\n @neighbors.count.nonzero?\n end", "def connected?\n !!@connected_to\n end", "def connected?\n\t\treturn self.connected ? true : false\n\tend", "def connected?\n return @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def ...
[ "0.78612447", "0.7776261", "0.7687298", "0.7642318", "0.7621607", "0.7621607", "0.7621607", "0.7621607", "0.7621607", "0.7621607", "0.76180816", "0.75662637", "0.75356555", "0.75356555", "0.75356555", "0.75356555", "0.75356555", "0.7524124", "0.75167465", "0.7482601", "0.7387...
0.81044173
0
Takes configuration and an arg that is expected to be key=value format. If c is empty, creates one and returns it
def add_to_configuration(c, arg) kv = arg.split('=') kv.length == 2 || (raise "Expected parameter #{kv} in key=value format") c = org.apache.hadoop.hbase.HBaseConfiguration.create if c.nil? c.set(kv[0], kv[1]) c end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def takes_hash(opts = {})\n c = opts[:c]\nend", "def create_key(arg = nil)\n set_or_return(\n :create_key,\n arg,\n kind_of: [ TrueClass, FalseClass ]\n )\n end", "def method_missing(name, *args, &block)\n if name.to_s[-1] == '='\n config[name[0..-2].to_s.upcase] ...
[ "0.58913434", "0.52278763", "0.51599497", "0.5076399", "0.5073432", "0.5073087", "0.5072594", "0.5065129", "0.5061468", "0.5061468", "0.5046907", "0.5040518", "0.50259733", "0.49905154", "0.49905154", "0.49905154", "0.49905154", "0.49905154", "0.4989487", "0.49871948", "0.498...
0.67047644
0
Usage: git alias The second parameter is optional, if so, it will show the current value of the alias.
def git_alias(args) # check if the alias exists right now system("git config --global alias.#{args[0]} #{args[1]}") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def git_alias(name,action)\n system 'git', 'config', '--global', '--replace-all', \"alias.#{name}\", action\n end", "def aliases\n\t\t\twith_dir do\n\t\t\t\t%x/git config --get-regexp 'alias.*'/.each_line.map do |l|\n\t\t\t\t\tputs l.sub(/^alias\\./,\"\").sub(/ /,\" = \")\n\t\t\t\tend\n\t\t\tend\n\t\tend...
[ "0.78487843", "0.66856784", "0.65222716", "0.6034868", "0.59449106", "0.5941758", "0.59098595", "0.5900271", "0.5846719", "0.57826656", "0.5763688", "0.57502395", "0.5745002", "0.571841", "0.56848145", "0.56157255", "0.5571074", "0.55693054", "0.5543564", "0.5538096", "0.5512...
0.8415596
0
POST /animalcontrols POST /animalcontrols.json
def create @animalcontrol = Animalcontrol.new(animalcontrol_params) respond_to do |format| if @animalcontrol.save format.html { redirect_to @animalcontrol, notice: 'Animal Control Call-Out was successfully created.' } format.json { render :show, status: :created, location: @animalcontrol ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_animalcontrol\n @animalcontrol = Animalcontrol.find(params[:id])\n end", "def animalcontrol_params\n params.require(:animalcontrol).permit(:address, :name, :callback, :unitassigned, :problem, :comment)\n end", "def create\n @adotando_animal = AdotandoAnimal.new(params[:adotando_anima...
[ "0.63756686", "0.6221957", "0.57594293", "0.5747882", "0.5731585", "0.5700276", "0.5699038", "0.56507075", "0.56490535", "0.56368953", "0.5573037", "0.5549986", "0.55350286", "0.551721", "0.5497559", "0.5481593", "0.5481144", "0.54607636", "0.5445256", "0.5441208", "0.5437344...
0.69665813
0
PATCH/PUT /animalcontrols/1 PATCH/PUT /animalcontrols/1.json
def update respond_to do |format| if @animalcontrol.update(animalcontrol_params) format.html { redirect_to @animalcontrol, notice: 'Animal Control Call-Out was successfully updated.' } format.json { render :show, status: :ok, location: @animalcontrol } else format.html { render :...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n animal = Animal.find(params[:id])\n\n if validate_params(animal_params)\n animal.update(animal_params)\n render json: animal, status: 200, location: [:api, animal]\n else\n render json: { errors: animal.errors }, status: 422\n end\n end", "def update\n animal = Ani...
[ "0.63176674", "0.6111031", "0.605045", "0.60483855", "0.6027697", "0.6010622", "0.5949315", "0.59429234", "0.59429234", "0.5921245", "0.5908152", "0.5879107", "0.58735347", "0.5870569", "0.5870569", "0.5829867", "0.5817469", "0.58036274", "0.5711903", "0.57088935", "0.5676198...
0.66352135
0
DELETE /animalcontrols/1 DELETE /animalcontrols/1.json
def destroy @animalcontrol.destroy respond_to do |format| format.html { redirect_to animalcontrols_url, notice: 'Animal Control Call-Out was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n animal = Animal.find(params[:id])\n animal.destroy\n head 204\n end", "def destroy\n @adocao_animal = AdocaoAnimal.find(params[:id])\n @adocao_animal.destroy\n\n respond_to do |format|\n format.html { redirect_to adocao_animals_url }\n format.json { head :no_content }\n...
[ "0.7078735", "0.70098305", "0.6943995", "0.6936795", "0.6925268", "0.68725455", "0.6822406", "0.6812868", "0.6735869", "0.67289764", "0.66958636", "0.66896856", "0.6671468", "0.6654652", "0.6633417", "0.6613773", "0.657441", "0.657441", "0.65690225", "0.65690225", "0.6568411"...
0.7201724
0
Get the full set of configuration options for the specified backup
def full_options(backup_name) backup_options = {} # Get backup defaults backup_options.merge!(@options[:backup_defaults].dup_contents_1_level) # Get the specific backup definition unless @options[:backups].has_key?(backup_name.to_sym) @logger.fatal("The backup name specified '#{bac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def backup_configuration\n settings[\"backup_configuration\"]\n end", "def get_backup_config(opts = {})\n data, _status_code, _headers = get_backup_config_with_http_info(opts)\n return data\n end", "def all_options\n Config::Options.all\n end", "def get_backup_config_with_htt...
[ "0.6871624", "0.67159015", "0.6055941", "0.6008119", "0.59407794", "0.591406", "0.5899428", "0.58764654", "0.57891995", "0.57613283", "0.56316054", "0.55814433", "0.55628467", "0.55529535", "0.55327094", "0.55311596", "0.55297494", "0.55154544", "0.55077904", "0.55060583", "0...
0.75578475
0
Create a deep copy of a hash This is useful for copying a hash that will be mutated
def deep_copy_hash hash require_that(hash.is_a?(Hash), "deep_copy_hash requires a hash be specified, got #{hash.class}") Marshal.load Marshal.dump(hash) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deep_copy(hash)\n Marshal.load(Marshal.dump(hash))\n end", "def deep_copy\n copy = dup\n copy.values = {}\n @values.each { |k, v| copy.values[k] = v.clone }\n copy\n end", "def copy &alter\n Rumor.new(hash).tap &alter\n end", "def initialize_clon...
[ "0.8200839", "0.747171", "0.73471075", "0.73406154", "0.7339316", "0.7339316", "0.7270076", "0.7235719", "0.7235692", "0.72133195", "0.7176458", "0.716959", "0.70139116", "0.701154", "0.69308716", "0.6858759", "0.6856367", "0.68277925", "0.67780924", "0.6746879", "0.6659827",...
0.8403944
0
Require that a guard condition passes Simply checks that the guard is truthy, and throws an error otherwise
def require_that guard, message, return_guard = false if not guard then raise ExpectationFailedError.new(message) end if return_guard == true then guard elsif return_guard != false then return_guard end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert cond\n fail! unless cond\n end", "def guard; end", "def assert(cond)\n failure unless cond\n end", "def deny(condition, msg=\"\")\n assert !condition, msg\n end", "def deny(condition)\n # a simple transformation to increase readability IMO\n assert !condition\n end", "de...
[ "0.7233741", "0.6811358", "0.6462656", "0.63291764", "0.6272759", "0.6272759", "0.6272533", "0.6163501", "0.61149216", "0.6078253", "0.6055291", "0.6043552", "0.60076654", "0.60076654", "0.60076654", "0.5986781", "0.5926237", "0.59229416", "0.5859819", "0.58287674", "0.582183...
0.7565209
0
PATCH/PUT /user_work_skills/1 PATCH/PUT /user_work_skills/1.json
def update respond_to do |format| if @user_work_skill.update(user_work_skill_params) format.html { redirect_to action:"index",:user_work_experience_role_id=>@user_work_skill.user_work_experience_role_id } format.json { render :show, status: :ok, location: @user_work_skill } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @user_skill = UserSkill.find(params[:id])\n\n respond_to do |format|\n if @user_skill.update_attributes(params[:user_skill])\n format.html { redirect_to @user_skill, notice: 'User skill was successfully updated.' }\n format.json { head :no_content }\n else\n format...
[ "0.73432004", "0.7312003", "0.7224675", "0.721832", "0.7188362", "0.71461034", "0.70388323", "0.6989368", "0.69759834", "0.69737285", "0.6963536", "0.6942745", "0.6942745", "0.6894826", "0.6891755", "0.6876254", "0.6868217", "0.6856555", "0.6851883", "0.68247133", "0.67911756...
0.73636067
0
GET /controlpltkts GET /controlpltkts.json
def index @controlpltkts = Controlpltkt.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_controlpltkt\n @controlpltkt = Controlpltkt.find(params[:id])\n end", "def index\n @controltltkts = Controltltkt.all\n end", "def index\n @controltnytts = Controltnytt.all\n end", "def create\n @controlpltkt = Controlpltkt.new(controlpltkt_params)\n\n respond_to do |format|\n ...
[ "0.67161757", "0.65112853", "0.62452555", "0.61688733", "0.61178905", "0.603198", "0.6029375", "0.5960648", "0.58432084", "0.58032733", "0.58014846", "0.56973445", "0.5612154", "0.55961776", "0.5566658", "0.5547444", "0.5513052", "0.5481493", "0.5434418", "0.53877026", "0.534...
0.7468065
0
POST /controlpltkts POST /controlpltkts.json
def create @controlpltkt = Controlpltkt.new(controlpltkt_params) respond_to do |format| if @controlpltkt.save format.html { redirect_to @controlpltkt, notice: 'Controlpltkt was successfully created.' } format.json { render :show, status: :created, location: @controlpltkt } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def controlpltkt_params\n params.require(:controlpltkt).permit(:n1, :n2, :siglas, :limite, :vendida)\n end", "def set_controlpltkt\n @controlpltkt = Controlpltkt.find(params[:id])\n end", "def create\n @tnpsc = Tnpsc.new(tnpsc_params)\n\n respond_to do |format|\n if @tnpsc.save\n ...
[ "0.6564666", "0.64664435", "0.62317586", "0.6172066", "0.6170496", "0.6067384", "0.605376", "0.59029263", "0.5852787", "0.5839412", "0.5767802", "0.5723936", "0.5675327", "0.55736446", "0.54343426", "0.5364062", "0.5357854", "0.53383005", "0.53369534", "0.52882266", "0.528447...
0.72422993
0
PATCH/PUT /controlpltkts/1 PATCH/PUT /controlpltkts/1.json
def update respond_to do |format| if @controlpltkt.update(controlpltkt_params) format.html { redirect_to @controlpltkt, notice: 'Controlpltkt was successfully updated.' } format.json { render :show, status: :ok, location: @controlpltkt } else format.html { render :edit } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @controltltkt.update(controltltkt_params)\n format.html { redirect_to @controltltkt, notice: 'Controltltkt was successfully updated.' }\n format.json { render :show, status: :ok, location: @controltltkt }\n else\n format.html { render :edit...
[ "0.6532852", "0.6509571", "0.6395982", "0.6198386", "0.61478835", "0.613765", "0.6071614", "0.60679764", "0.6034653", "0.59630775", "0.59617704", "0.5924026", "0.58550006", "0.58530194", "0.5848847", "0.5816572", "0.58021027", "0.579757", "0.57883656", "0.5745402", "0.5745032...
0.7192734
0
DELETE /controlpltkts/1 DELETE /controlpltkts/1.json
def destroy @controlpltkt.destroy respond_to do |format| format.html { redirect_to controlpltkts_url, notice: 'Controlpltkt was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @controltltkt.destroy\n respond_to do |format|\n format.html { redirect_to controltltkts_url, notice: 'Controltltkt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circle...
[ "0.6941498", "0.68738836", "0.6850847", "0.672702", "0.6712603", "0.67033225", "0.6682263", "0.667959", "0.666711", "0.6617167", "0.6615948", "0.6608726", "0.6579389", "0.6556748", "0.65337735", "0.6502583", "0.64983404", "0.64923036", "0.64913964", "0.64684", "0.6462727", ...
0.72975755
0
Init with exception message and response object if one is available
def initialize(httpMsg, responseObj = nil) @response = responseObj super("An error occurred executing the HTTP request: #{httpMsg}") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(*args, **opt)\n @http_response = @http_status = @cause = nil\n args.map! do |arg|\n case arg\n when Integer then (@http_status = arg) and next\n when Exception then @cause = arg\n when Faraday::Response then faraday_response(arg)\n else ...
[ "0.7069889", "0.6628665", "0.65540856", "0.65407354", "0.6517642", "0.6460289", "0.64318734", "0.6425355", "0.6399185", "0.6388257", "0.6331553", "0.628075", "0.6268058", "0.6266657", "0.6239877", "0.6239677", "0.6235888", "0.6196421", "0.61874914", "0.61860734", "0.6182955",...
0.71237963
0
Equality. All false instances are equal each other, plus a FalseClass instance is also equal to this.
def == other case other when FalseClass, self.class true else false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ==(other); [TrueClass,FalseClass]; end", "def not_equal (other)\n (self == other).to_bool ? False : True\n end", "def ===(other); end", "def ==(other); false; end", "def ===(other)\n return false unless (self == other)\n end", "def eql?(other)\n other.is_a?(self.class) && !self.cla...
[ "0.72368556", "0.6925946", "0.6732788", "0.6704121", "0.66679466", "0.66410625", "0.6603368", "0.65989083", "0.6587162", "0.65594", "0.65432835", "0.6522678", "0.65223044", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165",...
0.7469688
0
attempts to set the number showing to number and returns if cheat was successful
def cheat number if number > 0 && number < 7 @numberShowing = number return true end return false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cheat\n puts 'What number do you want to roll?'\n\tnumber = gets.chomp.to_i\n\tif number >= 1 && number <= 6\n\t @number_showing = number\n\telse\n\t puts 'Cheater!!!'\n end\n @number_showing\t\n end", "def exercise_119 (number)\n end", "def tricky_number\n if true\n number = 17\n els...
[ "0.7084534", "0.6498242", "0.63801116", "0.63492996", "0.63155574", "0.6196656", "0.61731446", "0.6157264", "0.614858", "0.614858", "0.614858", "0.614858", "0.614858", "0.614858", "0.614858", "0.614858", "0.614858", "0.61007816", "0.60525936", "0.60385585", "0.6005804", "0....
0.7521906
0
returns the number showing
def showing return @numberShowing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showing \n @numberShowing\n end", "def display_number\n self['display_number'] ||= self.class.mask(number)\n self['display_number']\n end", "def display_number\n self.class.mask(number)\n end", "def display_number\n self.class.mask(number)\n end", "def display...
[ "0.76895446", "0.75263774", "0.73904663", "0.73502016", "0.7256698", "0.69704247", "0.6843486", "0.68390197", "0.6705172", "0.6705172", "0.66914254", "0.66914254", "0.66657346", "0.6662729", "0.6578317", "0.6570832", "0.65338814", "0.6527316", "0.64803106", "0.64112204", "0.6...
0.79139525
0
Changes the value of the given name stored in the S3Object's metadata: object = bucket.object['myobject'] object.metadata['purpose'] = 'research' object.metadata['purpose'] => 'research'
def []= name, value raise "cannot change the metadata of an object version; "+ "use S3Object#write to create a new version with different metadata" if @version_id metadata = to_h.dup metadata[name.to_s] = value object.copy_from(object.key, :me...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_metadata\n s3_obj.metadata[\"filename\"] = file_name\n s3_obj.metadata[\"bindery-pid\"] = persistent_id\n end", "def object_uploaded_with_metadata?(\r\n s3_client,\r\n bucket_name,\r\n object_key,\r\n metadata\r\n)\r\n response = s3_client.put_object(\r\n bucket: bucket_name,\r\n body: ...
[ "0.72068065", "0.6297951", "0.6294349", "0.62638694", "0.61404026", "0.61331016", "0.59943455", "0.5990066", "0.5969343", "0.59573895", "0.5951588", "0.59445983", "0.59445983", "0.59445983", "0.59445983", "0.59445983", "0.59445983", "0.59445983", "0.59445983", "0.59445983", "...
0.73467493
0
GET /testreplyposts GET /testreplyposts.json
def index @testreplyposts = Testreplypost.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @replies = Reply.all\n\n render json: @replies\n end", "def index\n @replies = Reply.all\n\n render json: @replies\n end", "def index\n @post_replies = PostReply.all\n end", "def index\n @replies = Reply.all\n\n respond_to do |format|\n format.html # index.html.erb\n ...
[ "0.6933231", "0.6933231", "0.6866066", "0.6685794", "0.64412427", "0.6249165", "0.6249165", "0.6249165", "0.6249165", "0.6245159", "0.62433976", "0.6109161", "0.61003816", "0.6083092", "0.6075278", "0.6071272", "0.6064191", "0.6064191", "0.6043861", "0.6036293", "0.6035207", ...
0.72688186
0
POST /testreplyposts POST /testreplyposts.json
def create @testreplypost = Testreplypost.new(testreplypost_params) respond_to do |format| if @testreplypost.save format.html { redirect_to @testreplypost, notice: 'Testreplypost was successfully created.' } format.json { render :show, status: :created, location: @testreplypost } el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testreplypost_params\n params.require(:testreplypost).permit(:text, :testpost_id)\n end", "def reply_to_post\n puts params[:reply]\n @post = Post.find(params[:reply][:post_id])\n @reply = @post.replies.build(params[:reply])\n @reply.user_id = current_user.id\n\n respond_to do |format|\...
[ "0.66744643", "0.656458", "0.6517219", "0.649634", "0.6437977", "0.6415763", "0.6371864", "0.62719953", "0.62571985", "0.62467", "0.61737525", "0.6069886", "0.6069743", "0.60460824", "0.60460824", "0.60304666", "0.601452", "0.5977733", "0.59768456", "0.5963004", "0.59563494",...
0.71013653
0
DELETE /testreplyposts/1 DELETE /testreplyposts/1.json
def destroy @testreplypost.destroy respond_to do |format| format.html { redirect_to testreplyposts_url, notice: 'Testreplypost was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @reply = Reply.find(params[:id])\n @reply.destroy\n @post = @reply.post\n\n respond_to do |format|\n format.html { redirect_to @post }\n format.json { head :ok }\n end\n end", "def destroy\n @reply = Reply.find(params[:id])\n @reply.destroy\n\n head :no_content\n ...
[ "0.7447253", "0.71885616", "0.71482754", "0.7132503", "0.7129506", "0.7111269", "0.70858586", "0.7062502", "0.70077604", "0.69489765", "0.69489765", "0.69489765", "0.69489765", "0.69489765", "0.6944151", "0.69347095", "0.690423", "0.690423", "0.6890433", "0.68859076", "0.6880...
0.7330937
1
GET /commodities/1 GET /commodities/1.json
def show @commodity = Commodity.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @commodity } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @commodities = Commodity.all\n if params[:search].present?\n @commodities = @commodities.query(params[:search].to_s)\n end\n @commodities = @commodities.page(params[:page])\n respond_to do |format|\n format.html\n format.js {} \n format.json { \n render json: ...
[ "0.71551454", "0.69652677", "0.689434", "0.6624344", "0.6624344", "0.6546328", "0.6453164", "0.62858075", "0.62366587", "0.61024487", "0.6100771", "0.6013886", "0.5983782", "0.5970167", "0.5938198", "0.5938198", "0.5905315", "0.58970386", "0.5895779", "0.5863152", "0.5861469"...
0.7433827
1
GET /commodities/new GET /commodities/new.json
def new @commodity = Commodity.new respond_to do |format| format.html # new.html.erb format.json { render json: @commodity } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @commodity = Commodity.new(commodity_params)\n\n respond_to do |format|\n if @commodity.save\n format.html { redirect_to commodities_url, notice: 'Commodity was successfully created.' }\n format.json { render json: @commodity, status: :created, location: @commodity }\n el...
[ "0.7340427", "0.7268655", "0.72582453", "0.71029323", "0.68209285", "0.6761093", "0.67424864", "0.6718772", "0.67086834", "0.670618", "0.6700866", "0.6700866", "0.6700866", "0.6700866", "0.6700866", "0.6700866", "0.6700866", "0.6700866", "0.6700866", "0.6700866", "0.66807693"...
0.78646743
1
POST /commodities POST /commodities.json
def create @commodity = Commodity.new(commodity_params) respond_to do |format| if @commodity.save format.html { redirect_to commodities_url, notice: 'Commodity was successfully created.' } format.json { render json: @commodity, status: :created, location: @commodity } else f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @commodity = Commodity.new(params[:commodity])\n\n respond_to do |format|\n if @commodity.save\n format.html { redirect_to @commodity, notice: 'Commodity was successfully created.' }\n format.json { render json: @commodity, status: :created, location: @commodity }\n else\...
[ "0.70077825", "0.6577053", "0.64613676", "0.6373147", "0.6214883", "0.6214883", "0.6092892", "0.6036907", "0.5939506", "0.58917487", "0.58812815", "0.5603079", "0.5579009", "0.5560071", "0.55228204", "0.5505408", "0.54937017", "0.54700327", "0.54653186", "0.5463377", "0.54466...
0.7094458
0