query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
try to update the user, redirecting if successful
def try_to_update(user, attribute) if user.update_attributes(params[:user]) flash[:notice] = "User #{attribute} updated." redirect_to :action=>"index" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n current_user.update_attributes! user_params\n redirect_back fallback_location: root_url\n end", "def update\n current_user.update_attributes! user_params\n redirect_back fallback_location: root_url\n end", "def update\n check_user\n if @user.update(user_params)\n redirect_...
[ "0.8057226", "0.8057226", "0.80278844", "0.7902238", "0.78598166", "0.7829959", "0.78132933", "0.7808571", "0.780773", "0.7797154", "0.7753445", "0.7736682", "0.7711505", "0.7708029", "0.77074486", "0.7693378", "0.76803994", "0.7679213", "0.76762956", "0.7671831", "0.76693064...
0.0
-1
Create a new Order node with the given expression and direction
def initialize(expr, direction = 1) raise ArgumentError, "Direction #{direction} is not valid. Must be -1 or 1." unless [-1,1].include? direction @expr, @direction = expr, direction end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_order(order)\n build_persisted_order(\n post('/market/orders', order.symbolize_keys.merge(side: SIDES_MAP.fetch(order.fetch(:side))))\n )\n end", "def generate_order\n clean_order!\n\n attrs = attributes(:json).reject do |key, _|\n [:adjustments, :sta...
[ "0.589672", "0.58639276", "0.5664327", "0.5617476", "0.5607593", "0.5583212", "0.55487806", "0.55449986", "0.5535133", "0.55030465", "0.546999", "0.54179645", "0.5403608", "0.53672606", "0.53645855", "0.5336495", "0.53213114", "0.5313542", "0.5293407", "0.5283653", "0.526621"...
0.61226815
0
Set this node's direction to ascending
def asc @direction = 1 self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ascending?\n @direction == 1\n end", "def ascending?\n direction == :asc\n end", "def direction\n @direction ||= (@head - @root)\n end", "def inverse\n OrderBy.new(@field, @dir == :asc ? :desc : :asc)\n end", "def reverse!\n @direction = - @direction\n ...
[ "0.67426205", "0.65062904", "0.62740594", "0.6177138", "0.60557276", "0.6042595", "0.5951373", "0.58254945", "0.5812798", "0.5798588", "0.5788597", "0.5783979", "0.5685012", "0.56781304", "0.56776404", "0.56589746", "0.56452996", "0.56413597", "0.56381696", "0.5633558", "0.56...
0.7560496
0
Set this node's direction to descending
def desc @direction = -1 self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reverse!\n @direction = - @direction\n self\n end", "def reverse_direction node\n case node\n when :up\n :down\n when :down\n :up\n when :left\n :right\n when :right\n :left\n else\n nil\n end\n end", "def descendin...
[ "0.7481721", "0.7207749", "0.67125314", "0.65978384", "0.645977", "0.6304682", "0.6197803", "0.6182956", "0.6167863", "0.6148603", "0.61288863", "0.61189777", "0.60698926", "0.6018604", "0.6007291", "0.5983919", "0.5950052", "0.5931862", "0.59137017", "0.590836", "0.5905796",...
0.68455106
2
Whether or not this node represents an ascending order
def ascending? @direction == 1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ascending?\n direction == :asc\n end", "def is_ordered?\n # TODO Stubbed to always return false until ordered lists are implemented\n return false\n end", "def is_ordered?\n # TODO Stubbed - Requires definition and implementation\n end", "def ordered?\n @or...
[ "0.7997854", "0.7158303", "0.71501464", "0.68669933", "0.64983344", "0.63605136", "0.6357699", "0.63473254", "0.63353604", "0.63192874", "0.63018197", "0.62739027", "0.6264173", "0.62060654", "0.6151813", "0.6119652", "0.60959893", "0.60951257", "0.6093612", "0.6092921", "0.6...
0.7912448
1
Whether or not this node represents a descending order
def descending? @direction == -1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ascending?\n direction == :asc\n end", "def ascending?\n @direction == 1\n end", "def visit_Squeel_Nodes_Order(o, parent)\n visit(o.expr, parent).send(o.descending? ? :desc : :asc)\n end", "def rev?\r\n return @rev\r\n end", "def opposite_sort_order\n ...
[ "0.68565446", "0.67429084", "0.643309", "0.6337501", "0.6264834", "0.6255998", "0.6255998", "0.6157208", "0.61564374", "0.6126966", "0.60922724", "0.6050367", "0.59974587", "0.59296685", "0.59228015", "0.59214836", "0.5907515", "0.5905854", "0.58803064", "0.5878974", "0.58617...
0.7877563
0
Reverse the node's direction
def reverse! @direction = - @direction self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reverse_direction node\n case node\n when :up\n :down\n when :down\n :up\n when :left\n :right\n when :right\n :left\n else\n nil\n end\n end", "def reverse() end", "def reverse() end", "def backward\n direction(:backward)\n end...
[ "0.8839068", "0.706592", "0.706592", "0.70629317", "0.69859296", "0.69539577", "0.6952337", "0.691799", "0.68770015", "0.6868267", "0.6864776", "0.6863335", "0.6842506", "0.68245625", "0.6813533", "0.6808952", "0.6807086", "0.68013585", "0.68013585", "0.68000907", "0.675855",...
0.7793323
1
A switch for toggling a text area
def reply_switch post if(@reply_area) render partial: 'posts/reply_area', locals: {post: post} else render partial: 'posts/reply_button', locals: {post: post} end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toggle\n set_switch(!self.switch) if @switch\n end", "def toggle_editmode\n\t\t@editmode = true\n\t\t$screen.write_message(\"Edit mode\")\n\tend", "def on_toggle_help\n @help_window.toggle_text\n end", "def on_toggle_help\n @help_window.toggle_text\n end", "def toggle_help\n @help_window...
[ "0.6484563", "0.6366774", "0.6329415", "0.6329415", "0.6272151", "0.6094835", "0.6038116", "0.599233", "0.5982844", "0.5943854", "0.5755316", "0.5753661", "0.57071376", "0.56691253", "0.56654674", "0.5660089", "0.5615048", "0.5595672", "0.5568435", "0.5554083", "0.5540091", ...
0.0
-1
Rack response handling methods
def initialize_request_and_response(env) @request = Rack::Request.new env @response = Rack::Response.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def raw_response; end", "def handle_response(response); end", "def handle_response(response); end", "def valid_response\n Rack::Response.new('OK').finish\nend", "def call(env)\n # catch(:halt) do\n # r = @_request\n # r.block_result(instance_exec(r, &block))\n # @...
[ "0.7351572", "0.7309417", "0.7309417", "0.71299475", "0.700495", "0.69064033", "0.68828946", "0.6733333", "0.6733333", "0.6733333", "0.6733333", "0.6733333", "0.6733333", "0.6733333", "0.6733333", "0.6733333", "0.6733333", "0.6733333", "0.6733333", "0.6733333", "0.672488", ...
0.0
-1
GET /timers GET /timers.json
def index @timers = Timer.all @load_push = true @write_right = userCould :timer respond_to do |format| format.html # index.html.erb format.json { render json: @timers } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @timers = Timer.all\n\n render json: @timers\n end", "def timers\n @client.fetch(:timers)\n end", "def timers\n @timers\n end", "def show\n @timer = Timer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { rend...
[ "0.78788584", "0.7521452", "0.7149898", "0.6673208", "0.6655325", "0.66040057", "0.6343586", "0.5916314", "0.5916185", "0.5844631", "0.5811202", "0.58076036", "0.57430667", "0.57430667", "0.5702501", "0.5697466", "0.56974524", "0.5642985", "0.56212425", "0.56156164", "0.56149...
0.73370725
2
GET /timers/1 GET /timers/1.json
def show @timer = Timer.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @timer } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @timers = Timer.all\n\n render json: @timers\n end", "def index\n @timers = Timer.all\n @load_push = true\n\n @write_right = userCould :timer\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @timers }\n end\n end", "def timers\n...
[ "0.7486892", "0.7085545", "0.704471", "0.67800885", "0.6554494", "0.6221531", "0.6215174", "0.59344286", "0.58886755", "0.5888051", "0.5888051", "0.58106726", "0.5794257", "0.5793636", "0.5787482", "0.57726943", "0.57493424", "0.57280374", "0.57040435", "0.5703253", "0.569956...
0.6977584
3
GET /timers/new GET /timers/new.json
def new return false if !userCan :timer @timer = Timer.new respond_to do |format| format.html # new.html.erb format.json { render json: @timer } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @timer = Timer.new(timer_params)\n\n if @timer.save\n render json: @timer, status: :created, location: @timer\n else\n render json: @timer.errors, status: :unprocessable_entity\n end\n end", "def index\n @timers = Timer.all\n\n render json: @timers\n end", "def create...
[ "0.7093517", "0.6773392", "0.6644939", "0.64438397", "0.64323676", "0.6400815", "0.6368178", "0.63613147", "0.63565165", "0.63349915", "0.6320983", "0.63142806", "0.6313116", "0.630541", "0.6279927", "0.62605315", "0.6251959", "0.62512964", "0.62422603", "0.62223727", "0.6221...
0.7289236
0
POST /timers POST /timers.json
def create return false if !userCan :timer @timer = Timer.new(params[:timer]) respond_to do |format| if @timer.save format.html { redirect_to @timer, notice: 'Timer was successfully created.' } format.json { render json: @timer, status: :created, location: @timer } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @timer = Timer.new(timer_params)\n\n if @timer.save\n render json: @timer, status: :created, location: @timer\n else\n render json: @timer.errors, status: :unprocessable_entity\n end\n end", "def index\n @timers = Timer.all\n\n render json: @timers\n end", "def index\...
[ "0.7111646", "0.6855625", "0.66483676", "0.63716817", "0.62309855", "0.61544794", "0.61028177", "0.595603", "0.595603", "0.5920722", "0.585735", "0.5850511", "0.5803083", "0.58014405", "0.5759059", "0.5743959", "0.5737463", "0.5732263", "0.57237875", "0.5692483", "0.55513793"...
0.6430769
3
PUT /timers/1 PUT /timers/1.json
def update return false if !userCan :timer @timer = Timer.find(params[:id]) respond_to do |format| if @timer.update_attributes(params[:timer]) format.html { redirect_to @timer, notice: 'Timer was successfully updated.' } format.json { head :no_content } else format.html...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @timer = Timer.find(params[:id])\n\n if @timer.update(timer_params)\n head :no_content\n else\n render json: @timer.errors, status: :unprocessable_entity\n end\n end", "def update\n @timer = Timer.find(params[:id])\n\n respond_to do |format|\n if @timer.update_attri...
[ "0.70908844", "0.6790149", "0.6315853", "0.6185533", "0.6027161", "0.59697944", "0.59233886", "0.59089744", "0.5825311", "0.5800927", "0.5762887", "0.5762887", "0.57591146", "0.5740035", "0.56094444", "0.56009907", "0.55934125", "0.5575533", "0.55538297", "0.5542189", "0.5516...
0.6495759
2
DELETE /timers/1 DELETE /timers/1.json
def destroy return false if !userCan :timer @timer = Timer.find(params[:id]) @timer.destroy respond_to do |format| format.html { redirect_to timers_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @timer = Timer.find(params[:id])\n @timer.destroy\n render json: { message: 'Timer successfully deleted.' }\n end", "def destroy\n @timer = Timer.find(params[:id])\n @timer.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_path }\n fo...
[ "0.7415159", "0.72599125", "0.6959669", "0.68132025", "0.66510296", "0.65728", "0.6569106", "0.6494686", "0.6482053", "0.64616656", "0.6461484", "0.64530516", "0.6411937", "0.64067143", "0.63953364", "0.6393504", "0.6373252", "0.63675386", "0.63573176", "0.63573176", "0.63566...
0.7182023
2
Array of arrays (see result of format_seats)
def floor_seat_map(floor) floor_seats(floor) .group_by(&:row) .sort_by(&:first) .map do |row, row_seats| # TODO: reverse order? row_seats.sort_by(&:col) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lifts_array\n array2 = []\n self.lifts.each do |lift|\n array2 << lift.chart_info_for_lift\n end\n array2\n end", "def seat_point_chart\n hold=[]\n availableSeats.to_a.each do |i| \n row=i[1][\"row\"]\n row_num=row_to_num(row)\n col=i[1][\"colu...
[ "0.62734413", "0.5987961", "0.5890818", "0.57844347", "0.5669883", "0.5643959", "0.56322175", "0.55665463", "0.5542082", "0.5527037", "0.5525251", "0.55248046", "0.55203384", "0.5515786", "0.54693", "0.54649514", "0.5463325", "0.5426", "0.5408106", "0.5380449", "0.53689224", ...
0.0
-1
def test_on_new_with_name_already_exits_should_catch_the_error assert_difference "User.count", 0 do
def test_named_scope_has_paid users = User.has_paid( events(:event1).id ) assert_equal( 2, users.size ) assert( users.include?( users(:user1 ) ) ) assert( users.include?( users(:user_everything_paid ) ) ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_add_user_with_exist_name\r\n user = User.new\r\n user.name = 'student1'\r\n user.clear_password = \"testStudent1\"\r\n user.clear_password_confirmation = \"testStudent1\"\r\n user.fullname = \"student1_fullname\",\r\n user.role_id = \"3\"\r\n assert !user.save\r\n assert_equal I18n...
[ "0.7529069", "0.74692106", "0.7278447", "0.7172396", "0.7070826", "0.7054633", "0.7054633", "0.701402", "0.7013544", "0.7002972", "0.7002286", "0.697896", "0.6972127", "0.69652665", "0.6926045", "0.6923345", "0.6881271", "0.68479514", "0.6820947", "0.68151844", "0.67986083", ...
0.0
-1
GET /manage_glows GET /manage_glows.json
def index @manage_glows = ManageGlow.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_manage_glow\n @manage_glow = ManageGlow.find_by_slug(params[:id])\n end", "def create\n @manage_glow = ManageGlow.new(manage_glow_params)\n\n respond_to do |format|\n if @manage_glow.save\n format.html { redirect_to @manage_glow, notice: 'Manage glow was successfully created.' }...
[ "0.7384238", "0.7201688", "0.6635257", "0.6586653", "0.62779504", "0.56942123", "0.55690974", "0.5500529", "0.5500529", "0.5385788", "0.53814226", "0.5381286", "0.533371", "0.53314596", "0.53305334", "0.5323348", "0.529985", "0.5297234", "0.5283039", "0.52733743", "0.5245385"...
0.7729854
0
GET /manage_glows/1 GET /manage_glows/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @manage_glows = ManageGlow.all\n end", "def set_manage_glow\n @manage_glow = ManageGlow.find_by_slug(params[:id])\n end", "def create\n @manage_glow = ManageGlow.new(manage_glow_params)\n\n respond_to do |format|\n if @manage_glow.save\n format.html { redirect_to @mana...
[ "0.76292896", "0.7453434", "0.7203534", "0.6669577", "0.664112", "0.6190951", "0.599446", "0.562996", "0.5611372", "0.5515394", "0.55133", "0.54869276", "0.54768634", "0.54768634", "0.5470905", "0.546252", "0.5433816", "0.54257184", "0.542208", "0.5408185", "0.5407773", "0....
0.0
-1
POST /manage_glows POST /manage_glows.json
def create @manage_glow = ManageGlow.new(manage_glow_params) respond_to do |format| if @manage_glow.save format.html { redirect_to @manage_glow, notice: 'Manage glow was successfully created.' } format.json { render action: 'show', status: :created, location: @manage_glow } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_manage_glow\n @manage_glow = ManageGlow.find_by_slug(params[:id])\n end", "def index\n @manage_glows = ManageGlow.all\n end", "def manage_glow_params\n params.require(:manage_glow).permit(:title, :sub_category, :image, :created_by, :desc)\n end", "def update\n respond_to do |fo...
[ "0.7038635", "0.6863512", "0.68602693", "0.6591755", "0.64460206", "0.5765302", "0.5740262", "0.5635172", "0.55479246", "0.5538376", "0.55238694", "0.54809797", "0.54807246", "0.54659927", "0.5382743", "0.5334268", "0.53126955", "0.5295932", "0.5292094", "0.5287729", "0.52589...
0.7914169
0
PATCH/PUT /manage_glows/1 PATCH/PUT /manage_glows/1.json
def update respond_to do |format| if @manage_glow.update(manage_glow_params) format.html { redirect_to @manage_glow, notice: 'Manage glow was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @glass = Glass.find(params[:id])\n\n respond_to do |format|\n if @glass.update_attributes(params[:glass])\n format.html { redirect_to @glass, notice: 'Glass was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit...
[ "0.63022685", "0.6260651", "0.61754745", "0.61378634", "0.6102722", "0.605048", "0.5991958", "0.59335417", "0.5928938", "0.5868614", "0.5826373", "0.58260894", "0.58047235", "0.58027387", "0.57871747", "0.57767314", "0.5765237", "0.575896", "0.57481027", "0.574145", "0.571404...
0.7735735
0
DELETE /manage_glows/1 DELETE /manage_glows/1.json
def destroy @manage_glow.destroy respond_to do |format| format.html { redirect_to manage_glows_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @green = Green.find(params[:id])\n @green.destroy\n\n respond_to do |format|\n format.html { redirect_to scaffold_greens_url }\n format.json { head :ok }\n end\n end", "def destroy\n @manage_heal.destroy\n respond_to do |format|\n format.html { redirect_to manage_h...
[ "0.71553516", "0.6901293", "0.67598337", "0.67357635", "0.6715287", "0.6714858", "0.6694371", "0.66845834", "0.66816604", "0.6651554", "0.66382456", "0.6628174", "0.66230726", "0.66194475", "0.6615259", "0.65813047", "0.65761685", "0.65702903", "0.65702903", "0.65697503", "0....
0.8268143
0
Use callbacks to share common setup or constraints between actions.
def set_manage_glow @manage_glow = ManageGlow.find_by_slug(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def manage_glow_params params.require(:manage_glow).permit(:title, :sub_category, :image, :created_by, :desc) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.6981269", "0.6783559", "0.6746007", "0.67423046", "0.6735905", "0.6593568", "0.6504213", "0.649792", "0.6482664", "0.6478558", "0.64566684", "0.64392304", "0.6380194", "0.6376366", "0.636562", "0.63208145", "0.63006365", "0.63001287", "0.6292953", "0.62927175", "0.62911004...
0.0
-1
State transition tables end reduce 0 omitted reduce 1 omitted
def _reduce_2(val, _values, result) result = new_compstmt val[0] result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_unreachable_states\n queue = [starting_state].to_set\n transitions = self.each_transition.to_a.dup\n\n done_something = true\n while done_something\n done_something = false\n transi...
[ "0.61532664", "0.61157733", "0.6079665", "0.59659433", "0.58787626", "0.58256954", "0.56528294", "0.56514734", "0.5647997", "0.5644975", "0.5626823", "0.562325", "0.56059897", "0.5522287", "0.5508329", "0.54583", "0.54407173", "0.54306906", "0.5401888", "0.540162", "0.5394439...
0.0
-1
reduce 28 omitted reduce 29 omitted
def _reduce_30(val, _values, result) result = s(:op_asgn2, val[0], op_to_setter(val[2]), value(val[3]).to_sym, val[4]) result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_28(val, _values, result); end", "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_608(val, _values, result)\n yyerrok\n \n result\nend", "def _reduce_228(val, _values, result)\n ...
[ "0.714377", "0.7010373", "0.69409585", "0.6871318", "0.6871318", "0.68609774", "0.68579775", "0.68440264", "0.68127507", "0.67843986", "0.67843986", "0.67646223", "0.67646223", "0.6760912", "0.67524767", "0.67524767", "0.6746166", "0.6741635", "0.67363447", "0.6731736", "0.67...
0.0
-1
reduce 31 omitted reduce 32 omitted reduce 33 omitted
def _reduce_34(val, _values, result) result = new_assign val[0], val[1], s(:svalue, val[2]) result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_239(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_603(val, _values, result)\n result = nil\n ...
[ "0.7194484", "0.7191266", "0.7138523", "0.7130165", "0.7130165", "0.712999", "0.7114055", "0.7071547", "0.7061578", "0.7039782", "0.70324224", "0.7024953", "0.7010888", "0.70081264", "0.6996243", "0.6990278", "0.69860667", "0.69835037", "0.6958205", "0.6946525", "0.6945437", ...
0.0
-1
reduce 37 omitted reduce 38 omitted
def _reduce_39(val, _values, result) result = s(:and, val[0], val[2]) result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_37(val, _values, result); end", "def _reduce_37(val, _values, result); end", "def _reduce_263(val, _values, result); end", "def _reduce_263(val, _values, result); end", "def _reduce_385(val, _values, result); end", "def _reduce_608(val, _values, result)\n result = nil\n ...
[ "0.7211322", "0.7211322", "0.7085603", "0.7085603", "0.70637584", "0.7052618", "0.7028068", "0.70188457", "0.7013738", "0.70124286", "0.70124286", "0.699015", "0.6978345", "0.6978025", "0.69749105", "0.69657147", "0.69657147", "0.6957632", "0.69546574", "0.69546574", "0.69276...
0.0
-1
reduce 43 omitted reduce 44 omitted reduce 45 omitted reduce 46 omitted
def _reduce_47(val, _values, result) result = new_return(val[0], val[1]) result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_603(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_712(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_724(val, _values, result)\n yyerrok\n \...
[ "0.7117138", "0.7100678", "0.7098315", "0.7090436", "0.7080955", "0.70594925", "0.70564425", "0.7051253", "0.7041977", "0.7038313", "0.70187324", "0.70187324", "0.7017999", "0.701382", "0.69987214", "0.6994281", "0.6987999", "0.6987999", "0.69817615", "0.69676924", "0.6965532...
0.0
-1
reduce 50 omitted reduce 51 omitted reduce 52 omitted reduce 53 omitted reduce 54 omitted
def _reduce_55(val, _values, result) result = new_call(nil, val[0], val[1]) result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_50(val, _values, result); end", "def _reduce_50(val, _values, result); end", "def _reduce_498(val, _values, result)\n result = nil\n\n result\nend", "def _reduce_576(val, _values, result)\n _, margs, _ = val\n\n result = margs\n\n ...
[ "0.72731656", "0.72731656", "0.7166882", "0.7128344", "0.7128344", "0.7122099", "0.7122099", "0.70732784", "0.7059606", "0.7059606", "0.7053183", "0.7047366", "0.7043967", "0.70353127", "0.70169693", "0.70165974", "0.7005806", "0.69930506", "0.6991747", "0.6991083", "0.698841...
0.0
-1
reduce 82 omitted reduce 83 omitted
def _reduce_84(val, _values, result) result = new_assignable val[0] result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_608(val, _values, result)\n yyerrok\n \n result\nend", "def _reduce_591(val, _values, result)\n yyerrok\n \n result\nend", "def _reduce_603(val, _values, result)\n result = nil\n \n ...
[ "0.7315698", "0.72190756", "0.71935415", "0.71885806", "0.71860003", "0.71771497", "0.71556723", "0.71361476", "0.7131966", "0.7113577", "0.7092071", "0.7092071", "0.7088412", "0.70880723", "0.708807", "0.7087251", "0.7086042", "0.70857185", "0.70857185", "0.7069619", "0.7069...
0.0
-1
reduce 87 omitted reduce 88 omitted reduce 89 omitted reduce 90 omitted reduce 91 omitted
def _reduce_92(val, _values, result) result = new_assignable val[0] result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_712(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_608(val, _values, result)\n yyerrok\n \...
[ "0.7180544", "0.7142316", "0.7123449", "0.71169466", "0.71169466", "0.71137935", "0.7101324", "0.706293", "0.7060537", "0.70449245", "0.70449245", "0.70428294", "0.7033961", "0.7028791", "0.70280707", "0.70251215", "0.7000059", "0.6996317", "0.6996317", "0.6993481", "0.699348...
0.0
-1
reduce 100 omitted reduce 101 omitted
def _reduce_102(val, _values, result) result = new_colon3(val[0], val[1]) result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_600(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_600(val, _values, result)\n result = nil\n\n result\nend", "def _reduce_498(val, _values, result)\n result = nil\n\n result\nend", "def _re...
[ "0.6984036", "0.6978169", "0.69278044", "0.6904134", "0.68499655", "0.68499655", "0.684708", "0.68467265", "0.68467265", "0.6833762", "0.68330765", "0.6799658", "0.6793496", "0.6791777", "0.6791777", "0.67871183", "0.67519975", "0.67519975", "0.6734749", "0.6734749", "0.67215...
0.0
-1
reduce 105 omitted reduce 106 omitted reduce 107 omitted
def _reduce_108(val, _values, result) lexer.lex_state = :expr_end result = val[0] result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_603(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_605(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_608(val, _values, result)\n result = nil\n ...
[ "0.72588634", "0.72263044", "0.72262836", "0.72182447", "0.72182447", "0.7198231", "0.7169053", "0.7169053", "0.7153354", "0.7153354", "0.71511465", "0.71511465", "0.7149347", "0.71440446", "0.7117675", "0.7116927", "0.711447", "0.7113399", "0.70988065", "0.7098361", "0.70915...
0.0
-1
reduce 114 omitted reduce 115 omitted reduce 116 omitted reduce 117 omitted reduce 118 omitted reduce 119 omitted reduce 120 omitted reduce 121 omitted reduce 122 omitted reduce 123 omitted reduce 124 omitted reduce 125 omitted reduce 126 omitted reduce 127 omitted reduce 128 omitted reduce 129 omitted reduce 130 omitt...
def _reduce_188(val, _values, result) result = new_assign(val[0], val[1], val[2]) result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_608(val, _values, result)\n yyerrok\n \n result\nend", "def _reduce_596(val, _values, result)\n yyerrok\n \n result\nend", "def _reduce_596(val, _values, result)\n yyerrok\n\n result\nend", "def _r...
[ "0.67530864", "0.6744055", "0.6649072", "0.6636061", "0.6632086", "0.66233516", "0.65625924", "0.65503186", "0.6537549", "0.6525929", "0.6508378", "0.6496834", "0.64711297", "0.64652705", "0.64652705", "0.64519227", "0.6434619", "0.6423537", "0.6423537", "0.6423537", "0.64235...
0.0
-1
reduce 194 omitted reduce 195 omitted reduce 196 omitted reduce 197 omitted reduce 198 omitted
def _reduce_199(val, _values, result) result = new_irange(val[0], val[1], val[2]) result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_263(val, _values, result); end", "def _reduce_263(val, _values, result); end", "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_608(val, _values, result)\n yyerrok\n \n result\nend",...
[ "0.7215874", "0.7215874", "0.72126603", "0.7169983", "0.71695596", "0.714954", "0.714954", "0.7120412", "0.7120412", "0.711", "0.7098055", "0.70798403", "0.7069474", "0.70623374", "0.70623374", "0.70618385", "0.7042248", "0.7042075", "0.70363873", "0.7035199", "0.70342195", ...
0.0
-1
reduce 232 omitted reduce 233 omitted
def _reduce_234(val, _values, result) result = nil result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_239(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_608(val, _values, result)\n yyerrok\n \n result\nend", "def _reduce_591(val, _values, result)\n yyerrok\n \n...
[ "0.74898547", "0.7474258", "0.74619627", "0.743225", "0.74252766", "0.7425194", "0.7425194", "0.7423476", "0.7421387", "0.7421387", "0.7408406", "0.74045813", "0.73913306", "0.73845446", "0.7381408", "0.7381408", "0.7376896", "0.7376761", "0.7376761", "0.7366351", "0.73627424...
0.73505396
22
reduce 253 omitted reduce 254 omitted
def _reduce_255(val, _values, result) lexer.cmdarg_push 1 result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_127(val, _values, result); end", "def _reduce_127(val, _values, result); end", "def _reduce_416(val, _values, result)\n result = @builder.string_compose(nil, val[0], nil)\n \n result\nend", "def _reduce_253(val, _values, result)\n re...
[ "0.6461507", "0.6461507", "0.64132124", "0.6353453", "0.6322444", "0.6322444", "0.62476367", "0.62476367", "0.61962223", "0.6189138", "0.61794144", "0.6171192", "0.6140973", "0.6140973", "0.6113431", "0.6087911", "0.60842246", "0.6083563", "0.6083563", "0.6071527", "0.6071527...
0.63423383
4
reduce 270 omitted reduce 271 omitted reduce 272 omitted reduce 273 omitted reduce 274 omitted reduce 275 omitted reduce 276 omitted reduce 277 omitted reduce 278 omitted
def _reduce_279(val, _values, result) result = lexer.line result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_496(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_727(val, _values, result)\n result = nil\n ...
[ "0.66948324", "0.6674237", "0.6620129", "0.6614579", "0.660355", "0.65761065", "0.656583", "0.656583", "0.65641546", "0.6541787", "0.6527252", "0.652014", "0.6514162", "0.6503526", "0.6503526", "0.6491852", "0.64792824", "0.64743847", "0.645988", "0.645988", "0.64569324", "...
0.0
-1
reduce 330 omitted reduce 331 omitted reduce 332 omitted reduce 333 omitted reduce 334 omitted reduce 335 omitted reduce 336 omitted reduce 337 omitted reduce 338 omitted
def _reduce_339(val, _values, result) result = new_call nil, [:lambda, []], [] result << new_iter(val[0], val[1]) result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_603(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_712(val, _values, result)\n result = nil\n ...
[ "0.7371364", "0.734084", "0.7306564", "0.72981083", "0.72905576", "0.72565824", "0.725431", "0.7234608", "0.72313946", "0.72313946", "0.7230586", "0.7228666", "0.72084653", "0.71959364", "0.7195679", "0.71956503", "0.71900976", "0.7175485", "0.7164002", "0.71498066", "0.71498...
0.0
-1
reduce 342 omitted reduce 343 omitted
def _reduce_344(val, _values, result) result = val[1] result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_603(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_605(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_263(val, _values, result); end", "def _reduce_263(val, _values, result); ...
[ "0.75811553", "0.7456761", "0.74486417", "0.74486417", "0.74471396", "0.7441736", "0.7440288", "0.74355716", "0.7420966", "0.74206555", "0.74204904", "0.74139345", "0.7409127", "0.740848", "0.74004483", "0.73992354", "0.73992354", "0.7392163", "0.7391858", "0.7391858", "0.738...
0.0
-1
reduce 372 omitted reduce 373 omitted reduce 374 omitted
def _reduce_375(val, _values, result) result = new_call(nil, val[0], val[1]) result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_712(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_603(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_496(val, _values, result)\n result = nil\n ...
[ "0.7247412", "0.72461486", "0.72105414", "0.7193465", "0.7193465", "0.7177281", "0.7173235", "0.71491605", "0.71221083", "0.71221083", "0.7113556", "0.7113556", "0.7096895", "0.70962137", "0.7092831", "0.707358", "0.7071951", "0.70715517", "0.7068842", "0.70523494", "0.704753...
0.0
-1
reduce 394 omitted reduce 395 omitted
def _reduce_396(val, _values, result) result = val[1] result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_263(val, _values, result); end", "def _reduce_263(val, _values, result); end", "def _reduce_496(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_608(val, _values, result)\n yyerrok\n \n result\ne...
[ "0.7596249", "0.7596249", "0.75847036", "0.7571668", "0.7563415", "0.7557318", "0.7534889", "0.753187", "0.751866", "0.7506874", "0.74994546", "0.74953675", "0.749462", "0.749462", "0.7476319", "0.7470926", "0.7468925", "0.74671817", "0.74671817", "0.7459541", "0.7447379", ...
0.0
-1
reduce 399 omitted reduce 400 omitted reduce 401 omitted reduce 402 omitted
def _reduce_403(val, _values, result) result = new_str val[0] result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_400(val, _values, result); end", "def _reduce_599(val, _values, result)\n yyerrok\n \n result\nend", "def _reduce_409(val, _values, result); end", "def _reduce_402(val, _values, result); end", "def _reduce_502(val, _values, result); end", "def _reduce_50...
[ "0.6873671", "0.6397552", "0.63593024", "0.629935", "0.60618836", "0.60618836", "0.591642", "0.5913133", "0.5888609", "0.58753514", "0.58571106", "0.5825517", "0.5825517", "0.57807255", "0.5745196", "0.5745196", "0.56947094", "0.5689002", "0.5675884", "0.5665057", "0.5643665"...
0.5560761
30
reduce 435 omitted reduce 436 omitted reduce 437 omitted reduce 438 omitted
def _reduce_439(val, _values, result) result = new_dsym val[1] result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_496(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_605(val, _values, result)\n result = nil\n ...
[ "0.73242867", "0.73162514", "0.72626984", "0.72626096", "0.7255005", "0.72479457", "0.7225392", "0.72191805", "0.7211454", "0.7210698", "0.7210698", "0.72082555", "0.7193258", "0.71790004", "0.71734565", "0.71634173", "0.71549946", "0.7154361", "0.7152313", "0.7150154", "0.71...
0.0
-1
reduce 466 omitted reduce 467 omitted
def _reduce_468(val, _values, result) result = new_kwrestarg(val[1]) result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_496(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_603(val, _values, result)\n result = nil\n ...
[ "0.7636693", "0.76221967", "0.7608013", "0.75959724", "0.75920445", "0.75906837", "0.7538627", "0.7533962", "0.75230956", "0.75111514", "0.75111514", "0.75080085", "0.7504032", "0.7503868", "0.749782", "0.749782", "0.7477729", "0.74675953", "0.7463476", "0.74609196", "0.74553...
0.0
-1
reduce 498 omitted reduce 499 omitted
def _reduce_500(val, _values, result) result = s(:lasgn, val[0]) result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_263(val, _values, result); end", "def _reduce_263(val, _values, result); end", "def _reduce_496(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_464(val, _values, result); end", "def _reduce_603(val, _values, result)\n ...
[ "0.77024984", "0.77024984", "0.76980126", "0.7653045", "0.76084", "0.76045847", "0.76045847", "0.76026994", "0.75746775", "0.7574211", "0.7571919", "0.7568196", "0.75671303", "0.7565095", "0.75484973", "0.75484973", "0.75418395", "0.75414735", "0.75288236", "0.7527201", "0.75...
0.0
-1
reduce 504 omitted reduce 505 omitted reduce 506 omitted reduce 507 omitted reduce 508 omitted
def _reduce_509(val, _values, result) result = [val[0]] result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_603(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_605(val, _values, result)\n result = nil\n ...
[ "0.742301", "0.7372009", "0.73652774", "0.7345923", "0.73407125", "0.7307723", "0.729491", "0.7294502", "0.7274059", "0.7264563", "0.72641265", "0.72344816", "0.72298807", "0.72263926", "0.72212815", "0.72179127", "0.7214949", "0.7214949", "0.72112024", "0.7211057", "0.719970...
0.0
-1
reduce 514 omitted reduce 515 omitted
def _reduce_516(val, _values, result) result = "*#{value(val[1])}".to_sym result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_605(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_608(val, _values, result)\n yyerrok\n \...
[ "0.7484277", "0.748161", "0.74648184", "0.741584", "0.74145997", "0.74117416", "0.74055153", "0.7403788", "0.73942167", "0.7387248", "0.7387248", "0.73770094", "0.73734087", "0.73695433", "0.7367808", "0.73632467", "0.73632467", "0.73419875", "0.7340706", "0.73265094", "0.732...
0.0
-1
reduce 518 omitted reduce 519 omitted
def _reduce_520(val, _values, result) result = "&#{value(val[1])}".to_sym result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_605(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_608(val, _values, result)\n yyerrok\n \...
[ "0.7527432", "0.752555", "0.7523596", "0.74977356", "0.74507254", "0.74412155", "0.74412155", "0.74358505", "0.7429767", "0.7408591", "0.7408591", "0.74073744", "0.7400935", "0.7381816", "0.73647785", "0.73636806", "0.73629856", "0.73626715", "0.7351762", "0.73513854", "0.735...
0.0
-1
reduce 531 omitted reduce 532 omitted reduce 533 omitted reduce 534 omitted reduce 535 omitted reduce 536 omitted reduce 537 omitted reduce 538 omitted reduce 539 omitted reduce 540 omitted reduce 541 omitted reduce 542 omitted reduce 543 omitted reduce 544 omitted reduce 545 omitted reduce 546 omitted reduce 547 omitt...
def _reduce_554(val, _values, result) result = nil result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_608(val, _values, result)\n yyerrok\n \n result\nend", "def _reduce_600(val, _values, result)\n result = nil\n \n result\nend", "def _reduce_551(val, _values, result)\n yyerrok\n \n ...
[ "0.7270115", "0.723437", "0.7201504", "0.7185456", "0.71829456", "0.7149919", "0.712719", "0.7121645", "0.71121466", "0.7108412", "0.7102369", "0.710079", "0.70930755", "0.7085577", "0.7085577", "0.7085143", "0.7078588", "0.7065734", "0.70615107", "0.70517683", "0.7046491", ...
0.6815059
82
store each array item in the hash as key, with a value of 1 set default quantity (included in store print the list to the console [can you use one of your other methods here?] output: a hash Method to add an item to a list
def additem(list, item, number = 1) # input: hash, item name and optional quantity # steps: push an item into the hash list.store(item, number) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_item(hash_list, new_item, quantity = 1)\n hash_list[new_item] = quantity\n p hash_list\nend", "def list_add(hash_items, item_name, quantity = 1)\n hash_items [item_name] = quantity\n return hash_items\nend", "def add_item(list, item, quantity)\n #list = item.push\n list[item] = quantity.to_i\n ...
[ "0.806567", "0.784893", "0.7772836", "0.77148664", "0.77069193", "0.7682971", "0.7667668", "0.7624874", "0.7601533", "0.7596989", "0.7595467", "0.75914526", "0.7567334", "0.75606495", "0.7554624", "0.7537537", "0.7537175", "0.75354046", "0.7531317", "0.7512311", "0.7498048", ...
0.746114
27
Method to remove an item from the list
def delitem(list, item) # input: list and key list.delete(item) # steps: delete a given key item end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_item (list, item)\n list.delete(item)\nend", "def remove_item(list, item)\r\n list.delete(item)\r\n list\r\nend", "def remove_item (list, item)\n list.delete(item)\nend", "def remove_item(list, item)\n list.delete(item)\nend", "def remove_item(list, item_remove)\n list.delete(item_remove)...
[ "0.8524102", "0.84413624", "0.8433353", "0.84321725", "0.8422145", "0.8420478", "0.84085757", "0.84085757", "0.84061605", "0.8401494", "0.8401182", "0.83946323", "0.83890706", "0.83812606", "0.8373345", "0.8373345", "0.8365139", "0.8361524", "0.83531153", "0.83531153", "0.835...
0.0
-1
Method to update the quantity of an item input:list, key and new value
def change_quant(list, item, new_num) list[item] = new_num list end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_quantity(list,item,item_count)\n\tlist[item] = item_count\nend", "def update_quantity(list, item_name, quantity)\n\tlist[item_name] = quantity.to_i\n\tlist\nend", "def update_quantity(list, item, quantity)\n\tlist[item] = quantity\n\tlist\nend", "def update_quantity_of_items(list, item, quantity)\...
[ "0.86734587", "0.8672245", "0.86598426", "0.8644241", "0.86080384", "0.85950273", "0.8588171", "0.8578507", "0.85730237", "0.85730237", "0.8542207", "0.85318094", "0.85309446", "0.8529167", "0.8528249", "0.85154456", "0.8513211", "0.85075617", "0.84998554", "0.84959286", "0.8...
0.0
-1
output:updated ourlist Method to print a list and make it look pretty
def print_list(list) # input:list # steps: iterate through the list list.each do |item, number| puts "we have #{number} #{item}" end puts "in our grocery list" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_list; end", "def pretty_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"There are #{quantity} #{item} on the grocery list.\"\n\tend\nend", "def pretty_list(list)\r\n\tlist.each { |item, quantity| puts \"Item: #{item.capitalize} - Amount: #{quantity}\" }\r\nend", "def format_list(items); end...
[ "0.81467104", "0.7861642", "0.7697002", "0.7663824", "0.7601589", "0.7568494", "0.7562633", "0.7553889", "0.7553889", "0.75531876", "0.75422394", "0.75388205", "0.7517397", "0.74725246", "0.74725246", "0.7468711", "0.74390376", "0.74386704", "0.7424154", "0.74169767", "0.7416...
0.0
-1
builds self.root to include all names
def insert_data(data) self.root = insert(data) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_root\n self.class.build_root.join(name)\n end", "def set_root() = self.destination_root = name", "def root_dir=(_arg0); end", "def build_root\n Pathname.new(ENV[\"OBJDIR\"] || \"build\")\n end", "def name\n @root\n end", "def name\n @root_name\n end", "def root(nam...
[ "0.8156399", "0.6814674", "0.65412265", "0.6476894", "0.6449932", "0.6403088", "0.62774557", "0.62723404", "0.62719", "0.6260979", "0.62041825", "0.61526287", "0.6064352", "0.60533345", "0.60533345", "0.60533345", "0.60533345", "0.60533345", "0.60533345", "0.60533345", "0.605...
0.0
-1
Returns a table name
def table_name respond_to?(:first_source_alias) ? first_source_alias : super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def table_name\n @table_name ||= self.class.const_get(class_name).table_name\n end", "def table_name\n @table_name ||= begin\n schema = self.class.schema_name\n table = self.sqltablename.blank? ? \"PS_#{self.recname}\" : self.sqltablename\n [schema, table].compact.join(\".\")\n ...
[ "0.8284904", "0.814726", "0.80354345", "0.80074817", "0.79782873", "0.79676753", "0.7938009", "0.7919119", "0.78495634", "0.78271675", "0.77142835", "0.7699588", "0.7697351", "0.76520175", "0.76467323", "0.76376873", "0.76344806", "0.76043266", "0.75871676", "0.75599", "0.755...
0.0
-1
Exchange column value to usd
def in_usd(*opts) exchange_to("USD", *opts) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def col1=(col1)\n self[:col1] = col1.to_s.gsub(\",\", \".\").to_f\n end", "def unaltered(value)\n value\n end", "def unaltered(value)\n value\n end", "def column=(_); end", "def update_column(name, value)\n update_columns(name => value)\n end", "def update_column(name, value)\...
[ "0.5891341", "0.5533316", "0.5533316", "0.5410217", "0.53508174", "0.53508174", "0.53508174", "0.5318038", "0.5318038", "0.53174853", "0.5239049", "0.5219881", "0.51874304", "0.5178704", "0.51748765", "0.51214284", "0.51135427", "0.50917727", "0.5056415", "0.50508875", "0.503...
0.0
-1
GET /edetails/1 GET /edetails/1.json
def show @edetail = Edetail.find_by(id: params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @exp_detail = ExpDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exp_detail }\n end\n end", "def show\n @edu_detail = EduDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n ...
[ "0.71157414", "0.6947183", "0.6838462", "0.67036206", "0.6659212", "0.66581213", "0.6583955", "0.6573662", "0.6573662", "0.6573476", "0.65504783", "0.65469486", "0.6530402", "0.65022075", "0.6494029", "0.6483899", "0.6455634", "0.64507157", "0.6444689", "0.6428512", "0.642656...
0.74865645
0
def salary_calculate end GET /edetails/new
def new @edetail = Edetail.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @edetail = Edetail.new(edetail_params)\n \n \n if @edetail.save\n @edetail.salary_calculation\n redirect_to @edetail\n else\n render 'new'\n end\n end", "def update\n @edetail = Edetail.find_by(id: params[:id])\n if @edetail.update(edetail_params)\n @edetail...
[ "0.7889784", "0.6912879", "0.6664674", "0.6497816", "0.63127685", "0.62699854", "0.6264386", "0.624954", "0.6249087", "0.6228105", "0.62263596", "0.6205379", "0.62036103", "0.6171115", "0.613388", "0.6115739", "0.6008575", "0.60044473", "0.60027146", "0.60001373", "0.5992612"...
0.0
-1
POST /edetails POST /edetails.json
def create @edetail = Edetail.new(edetail_params) if @edetail.save @edetail.salary_calculation redirect_to @edetail else render 'new' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @edetail = Edetail.new\n end", "def create\n @exp_detail = ExpDetail.new(params[:exp_detail])\n\n respond_to do |format|\n if @exp_detail.save\n format.html { redirect_to @exp_detail, notice: 'Exp detail was successfully created.' }\n format.json { render json: @exp_detail,...
[ "0.6422712", "0.6419408", "0.6406904", "0.6150029", "0.609003", "0.6070573", "0.5920753", "0.5916053", "0.5902157", "0.5882022", "0.5864074", "0.58508605", "0.58478713", "0.5835232", "0.5830765", "0.5785733", "0.5785445", "0.5776522", "0.5769205", "0.57597643", "0.5728966", ...
0.0
-1
PATCH/PUT /edetails/1 PATCH/PUT /edetails/1.json
def update @edetail = Edetail.find_by(id: params[:id]) if @edetail.update(edetail_params) @edetail.salary_calculation redirect_to @edetail else render "edit" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @detail = Detail.find(params[:id])\n\n respond_to do |format|\n if @detail.update_attributes(params[:detail])\n format.html { redirect_to @detail, :notice => 'Detail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :acti...
[ "0.6506075", "0.64811456", "0.64557105", "0.64154595", "0.6410061", "0.62775433", "0.6235059", "0.62016183", "0.61864007", "0.616066", "0.6159266", "0.61511225", "0.614529", "0.6090133", "0.60884714", "0.6085959", "0.6079002", "0.60578173", "0.6055672", "0.60481125", "0.60288...
0.0
-1
DELETE /edetails/1 DELETE /edetails/1.json
def destroy @edetail = Edetail.find_by(id: params[:id]) @edetail.destroy respond_to do |format| format.html { redirect_to edetails_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @exp_detail = ExpDetail.find(params[:id])\n @exp_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to exp_details_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @detail = Detail.find(params[:id])\n @detail.destroy\n\n respond_t...
[ "0.71852106", "0.70493144", "0.7016844", "0.6984417", "0.69798064", "0.6957426", "0.69476014", "0.68237674", "0.682197", "0.68104047", "0.6725292", "0.6708174", "0.6698569", "0.6697609", "0.6671418", "0.6653419", "0.6650072", "0.66477084", "0.662165", "0.6609091", "0.6603396"...
0.7726831
0
Use callbacks to share common setup or constraints between actions. def set_edetail
def edetail_params params.require(:edetail).permit(:ename, :age, :gender, :basic_pay, :pf_deduction ,:net_pay,:hra) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit\n #SET_CHEF method will be called form BEFORE_ACTION\n end", "def fetch_setup_details\n\n super\n\n end", "def set_show_detail\n @show_detail = true\n end", "def additional_details\n\n end", "def detail_item= item\n @detail_item = item\n configure_view\n end", "de...
[ "0.5875363", "0.56892926", "0.56792843", "0.56758165", "0.56423527", "0.56378764", "0.5592304", "0.55909187", "0.55853415", "0.55592763", "0.555356", "0.55491716", "0.55491716", "0.55489063", "0.5543316", "0.55367416", "0.55343264", "0.5522861", "0.5502601", "0.54972166", "0....
0.0
-1
GET /proffesions/1 GET /proffesions/1.xml
def show @proffesion = Proffesion.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @proffesion } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @progre = Progre.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @progre }\n end\n end", "def show\n @profesor = Profesor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xm...
[ "0.66661894", "0.6576433", "0.6431395", "0.63921314", "0.6359734", "0.6346708", "0.6305356", "0.6283132", "0.62803", "0.6257698", "0.6256339", "0.6227337", "0.62265116", "0.62157243", "0.6164434", "0.61640143", "0.6128138", "0.6122776", "0.6122056", "0.6121003", "0.6110348", ...
0.7170477
0
GET /proffesions/new GET /proffesions/new.xml
def new @proffesion = Proffesion.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @proffesion } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @progre = Progre.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @progre }\n end\n end", "def create\n @proffesion = Proffesion.new(params[:proffesion])\n\n respond_to do |format|\n if @proffesion.save\n flash[:notice] = '...
[ "0.7331178", "0.7307955", "0.722856", "0.7216229", "0.7216229", "0.7216229", "0.7028381", "0.70206964", "0.69878715", "0.6974507", "0.6959698", "0.69587857", "0.6948044", "0.6946765", "0.6945196", "0.69365853", "0.69365853", "0.693428", "0.6933253", "0.693138", "0.68958247", ...
0.7754809
0
POST /proffesions POST /proffesions.xml
def create @proffesion = Proffesion.new(params[:proffesion]) respond_to do |format| if @proffesion.save flash[:notice] = 'Proffesion was successfully created.' format.html { redirect_to(@proffesion) } format.xml { render :xml => @proffesion, :status => :created, :location => @pro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @proposta = Propostum.new(propostum_params)\n\n respond_to do |format|\n if @proposta.save\n format.html { redirect_to @proposta, notice: 'Propostum was successfully created.' }\n format.json { render :show, status: :created, location: @proposta }\n else\n format.h...
[ "0.6161763", "0.6148623", "0.59800524", "0.5909549", "0.5861366", "0.58488274", "0.5841264", "0.5814236", "0.57522833", "0.57522833", "0.5744652", "0.56836015", "0.56727093", "0.5672327", "0.56527823", "0.5627525", "0.56247", "0.5611136", "0.5608086", "0.5604445", "0.559525",...
0.6697774
0
PUT /proffesions/1 PUT /proffesions/1.xml
def update @proffesion = Proffesion.find(params[:id]) respond_to do |format| if @proffesion.update_attributes(params[:proffesion]) flash[:notice] = 'Proffesion was successfully updated.' format.html { redirect_to(@proffesion) } format.xml { head :ok } else format.ht...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @promos = Promos.find(params[:id])\n\n respond_to do |format|\n if @promos.update_attributes(params[:promos])\n flash[:notice] = 'Promos was successfully updated.'\n format.html { redirect_to(@promos) }\n format.xml { head :ok }\n else\n format.html { rende...
[ "0.6299645", "0.6268997", "0.62638867", "0.60745746", "0.60248315", "0.60014063", "0.5993517", "0.59911704", "0.5953899", "0.592854", "0.592854", "0.5914824", "0.59101695", "0.59086406", "0.58916444", "0.589063", "0.5884212", "0.5866694", "0.58372", "0.58284897", "0.581805", ...
0.6935146
0
DELETE /proffesions/1 DELETE /proffesions/1.xml
def destroy @proffesion = Proffesion.find(params[:id]) @proffesion.destroy respond_to do |format| format.html { redirect_to(proffesions_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @progre = Progre.find(params[:id])\n @progre.destroy\n\n respond_to do |format|\n format.html { redirect_to(progres_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @prop = Prop.find(params[:id])\n @prop.destroy\n\n respond_to do |format|\n format....
[ "0.67241454", "0.6620266", "0.6485908", "0.64769834", "0.64730084", "0.64233595", "0.6394233", "0.63714147", "0.6343365", "0.6341095", "0.63347864", "0.6322928", "0.63192314", "0.6298082", "0.6298082", "0.62814796", "0.62583846", "0.6255486", "0.6247644", "0.62447244", "0.621...
0.7125005
0
GET /abonent_payments/1 GET /abonent_payments/1.json
def show @abonent_payment = AbonentPayment.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @abonent_payment } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @payments = Payment.find(params[:id]) \n render json: @payments\n end", "def show\n find_payment\n render json: @payment\n end", "def payments_json_response\n {\n key: 'payments',\n type: 'async',\n html: render_to_string(formats: ['html'], layout: false)\n }\n en...
[ "0.74477875", "0.7148039", "0.6973343", "0.69567126", "0.693995", "0.693995", "0.6871724", "0.6844527", "0.6819689", "0.6732062", "0.6640677", "0.6640677", "0.6640677", "0.6640677", "0.6640677", "0.6640677", "0.6640677", "0.6640677", "0.6619152", "0.65996647", "0.65996647", ...
0.712074
2
GET /abonent_payments/new GET /abonent_payments/new.json
def new @page_header = "Пополнение абонентского номера" @corporations = current_user.admin? ? Corporation.all : current_user.corporations @abonent_payment = AbonentPayment.new respond_to do |format| format.html # new.html.erb format.json { render json: @abonent_payment } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @payment = Payment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @payment }\n end\n end", "def new\n @payment = Payment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @payment }\n ...
[ "0.7916074", "0.7916074", "0.7916074", "0.7878875", "0.777411", "0.77379453", "0.7689435", "0.7639542", "0.7581265", "0.75538564", "0.74811983", "0.74477667", "0.74315155", "0.74280626", "0.74018943", "0.72733736", "0.72733736", "0.72374195", "0.72181886", "0.72181237", "0.72...
0.7251156
17
POST /abonent_payments POST /abonent_payments.json PUT /abonent_payments/1 PUT /abonent_payments/1.json
def inback # if current_user.admin? platika_id = params[:platika_id] phone = params[:phone] amount = params[:amount] corporation_phone = params[:corporation_phone] if !AbonentPayment.where(:platika_id => platika_id).first.nil? @abonent_payment = AbonentPayment.where(:platika_id => plati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @profile = current_user.profile\n @payment = Payment.new(payment_params)\n @payment.profile = current_user.profile\n if @payment.save\n uri = URI('http://acm.ut.ac.ir/epayment/payments')\n parameters = {\n 'merchant' => \"4452A141\",\n 'amount' => @payment.amoun...
[ "0.6867097", "0.67517954", "0.67124563", "0.6558527", "0.6523825", "0.6461786", "0.6429953", "0.64283204", "0.6427483", "0.63588023", "0.63466513", "0.63396466", "0.63301754", "0.6317269", "0.62947214", "0.6273621", "0.62200356", "0.620285", "0.617467", "0.61682194", "0.61324...
0.0
-1
Add a few fog helpers
def dnsName(connection:, instanceId:) connection.describe_instances('instance-id' =>[instanceId])[:body]['reservationSet'][0]['instancesSet'][0]['dnsName'] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fog \n \"fog\" \n end", "def fog_options\n options = { \n :provider => provider, \n :aws_access_key_id => aws_access_key_id, \n :aws_secret_access_key => aws_secret_access_key, \n :region => region \n }\n end",...
[ "0.71989685", "0.67585576", "0.6584326", "0.6520162", "0.64077663", "0.6355432", "0.63067746", "0.60953516", "0.5975064", "0.5908283", "0.57895863", "0.5738675", "0.57213575", "0.5673137", "0.5580166", "0.5529882", "0.5510134", "0.54940647", "0.547441", "0.5465641", "0.544546...
0.0
-1
how to return a boolean?
def starts_with_a_vowel?(word) word.match? (/\b[aeiou]/i) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def result?\n false\n end", "def result?\n true\n end", "def truth?\n truth\n end", "def to_bool() true end", "def success?()\n result != false\n end", "def ok? \n @funct == nil ? (return false) : (return true)\n end", "def success?() end", "def to_bool() f...
[ "0.77566826", "0.77337486", "0.7690822", "0.7614425", "0.75237066", "0.7494381", "0.74672246", "0.74369484", "0.7391723", "0.73700064", "0.73270804", "0.7314247", "0.7314247", "0.72893727", "0.7289118", "0.72791284", "0.72598183", "0.72411615", "0.71921164", "0.71886945", "0....
0.0
-1
how to return an array of words? .scan
def words_starting_with_un_and_ending_with_ing(text) result = text.scan(/\bun\w+/) + text.scan(/ing\b\w+/) result.uniq end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def words\n self.scan(WORD_PATTERN)\n end", "def words\n scan(/\\S+/)\n end", "def words\n scan(/\\w[\\w'\\-]*/)\n end", "def words\n @words_array = @phrase.split(' ')\n end", "def words\n\t\tscan(/\\w[\\w\\'\\-]*/)\n\tend", "def to_array(string)\n word_array=[]\n string.sc...
[ "0.8084781", "0.8053504", "0.73794174", "0.7342563", "0.72963285", "0.7286541", "0.7253532", "0.7253532", "0.7253532", "0.7063455", "0.69005215", "0.6843528", "0.6737781", "0.6699167", "0.6699167", "0.6672293", "0.6645634", "0.6630114", "0.6619594", "0.65695363", "0.6557697",...
0.0
-1
number = ["2438894546", "(718)8911313", "234 435 9978", "(800)4261134"] how to iterate over an array => array with Regex .grep or .scan w/ .split Check if each phone number in the array is valid return true or false for each in an array 1. Iterate through phone array 2.Check if element has 10 numbers
def valid_phone_number?(phone) # phone.each do |number| # number. if phone.match(/([0-9] ?){10}/) || phone.match(/(\([0-9]{3}\)([0-9]{3}-[0-9]{4})\b)/) || phone.match(/\b([0-9]{7})\b/) true else false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_numbers?\n numbers.each do |phone_number|\n return false unless phone_number =~ /\\A^[\\d\\-]+\\z/\n end\n true\n end", "def valid_phone_number?(phone)\n if phone.scan(/[0-9]/).count == 10\n true\n else false\n end\nend", "def validate_phones(*phones)\n phones.flatten!\n ...
[ "0.68643373", "0.6600907", "0.65311164", "0.6428036", "0.63766676", "0.6262405", "0.6112154", "0.60562897", "0.6031293", "0.6026644", "0.600142", "0.6001232", "0.59867674", "0.59863496", "0.58741266", "0.5837738", "0.5832607", "0.5812505", "0.58092725", "0.578453", "0.5758568...
0.69792056
0
Every method that is declared below will be automatically executed when the generator is run
def create_migration_file migration_file = File.join(File.dirname(__FILE__), 'templates', 'migration.rb') migration_template migration_file, 'db/migrate/create_webhooks_table.rb' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generators; end", "def generators; end", "def generate!\n generator.invoke_all\n end", "def generate; end", "def generate; end", "def generators(&blk); end", "def generators(&blk); end", "def generate\n end", "def yield; end", "def generate\n end", "def regenerator; end", ...
[ "0.7830334", "0.7830334", "0.7811698", "0.740982", "0.740982", "0.7323718", "0.7323718", "0.72109187", "0.72103524", "0.70998824", "0.7075338", "0.7068689", "0.70462435", "0.69894344", "0.69354856", "0.6917551", "0.69136435", "0.6913135", "0.69089323", "0.6857949", "0.6845999...
0.0
-1
Returns a topic instance if it already exists in PubSub service, otherwise throw exception. If +block+ is provided, also subscribe to this topic
def get(topic_name, &onMessage) # string, block => Topic; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def temporary_topic(&block)\n t = create_temporary_topic\n if block\n begin\n block.call(t)\n ensure\n # Delete Temporary topic on completion of block\n t.delete if t\n t = nil\n end\n end\n t\n end", "def with_exchange(&block)\n setup_to_publish do | cl...
[ "0.6576964", "0.64085823", "0.62573946", "0.6170376", "0.5957604", "0.5915017", "0.5850419", "0.5843378", "0.56770337", "0.5676215", "0.56402403", "0.5636221", "0.56358767", "0.56316686", "0.56270385", "0.55486095", "0.54655176", "0.54391134", "0.5436271", "0.5405158", "0.539...
0.55243593
16
Subscribe to +topic+ and process any incoming message with +block+.
def subscribe(&onMessage) # block end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def consume(topic=nil, &block)\n @internal.consume(topic, &block)\n end", "def subscribe(channel, &block)\n faye.subscribe \"/topic/#{channel}\", &block\n end", "def listen\n @queue.subscribe(block: true) do |delivery_info, properties, body|\n puts(body)\n end\n end", "def...
[ "0.7622423", "0.6811736", "0.6772559", "0.6762211", "0.67252606", "0.6595665", "0.6532625", "0.6458711", "0.6433691", "0.6420618", "0.6418054", "0.63282305", "0.6251731", "0.6177364", "0.6162407", "0.6157508", "0.61438113", "0.61395705", "0.6136557", "0.61348164", "0.6096038"...
0.66285944
5
Unsubscribe from this +topic+
def unsubscribe() end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unsubscribe_from(topic)\n subscriptions.find_by_topic_id(topic.id).try(:destroy)\n end", "def unsubscribe_from_topic(tokens, topic)\n make_topic_mgmt_request(tokens, topic, \"batchRemove\")\n end", "def unsubscribe!\n self.type = :unsubscribe\n reply_if_needed!\n end"...
[ "0.8513609", "0.79048526", "0.77987105", "0.77824026", "0.77678406", "0.77140325", "0.7688508", "0.76874715", "0.7607387", "0.7479229", "0.7454693", "0.74428165", "0.74393487", "0.7426538", "0.74248517", "0.7421774", "0.7401217", "0.7385155", "0.73779356", "0.7367303", "0.733...
0.73750335
19
Call +block+ for any error occuring in the execution of any of the above commands
def on_error(onError) # block end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def safely(&block)\r\n begin\r\n yield\r\n rescue Exception => e\r\n if e.message =~ /connection was aborted/\r\n puts \" [yp searcher] Error: #{e} #{e.message}. Continuing.\"\r\n end\r\n end\r\n end", "def error(&block)\n @runner.set_error(@current_platform, block)\n end"...
[ "0.6902293", "0.6777186", "0.6705798", "0.6685431", "0.6636016", "0.6556304", "0.6505093", "0.6468934", "0.64538026", "0.6432825", "0.6432638", "0.6416337", "0.64056826", "0.64004266", "0.64004266", "0.64004266", "0.6389631", "0.6387498", "0.63761663", "0.6363143", "0.6350971...
0.0
-1
Inputs id (string, required): the dxid of the app to run name (string, required): the name of the job inputs (hash, required): the inputs instance_type (string, optional): override of the default instance type Outputs id (string): the dxid of the resulting job Run scoring app, create corresponding job and submission re...
def run_job_create_submission(opts, input_info = nil) # Parameter 'id' should be of type String # Get challenge @challenge = Challenge.find_by(id: opts["challenge_id"]) raise "No associated challenge found" unless @challenge submission = opts["submission"] raise "No submission info found" unles...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run\n # rubocop:disable Style/SignalException\n # Parameter 'id' should be of type String\n\n id = unsafe_params[:id]\n fail \"App ID is not a string\" unless id.is_a?(String) && id != \"\"\n\n # Name should be a nonempty string\n name = unsafe_params[:name]\n fail \"Name should be a non-e...
[ "0.63947576", "0.6311464", "0.60767674", "0.60767674", "0.5732254", "0.57081383", "0.57021797", "0.5669658", "0.56339973", "0.5612435", "0.5585994", "0.5571655", "0.5536461", "0.5532724", "0.55231106", "0.5507055", "0.547721", "0.5418759", "0.5408829", "0.53946084", "0.537144...
0.7232061
0
Clones user's submission files into challenge space.
def clone_inputs_to_space files = UserFile.accessible_by(@context).where(uid: @inputs.values) return if files.empty? api = DIContainer.resolve("api.user") api.project_invite( @context.user.private_files_project, "user-#{CHALLENGE_BOT_DX_USER}", DNAnexusAPI::PROJECT_ACCESS_VIEW, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_submission\n \tfile_extensions = { 'c++' => '.cpp', 'java' => '.java', 'python' => '.py', 'c' => '.cc' }\n \tsubmission_id = self[:_id]\n \tuser = self.user\n \temail = user[:email]\n \tproblem = self.problem\n \tpcode = problem[:pcode]\n \tcontest = problem.contest\n \tccode = contest[:ccode]\n ...
[ "0.5601894", "0.5572805", "0.5497886", "0.54001683", "0.5358935", "0.5343305", "0.52883446", "0.52581763", "0.5220035", "0.5218037", "0.5212636", "0.5206825", "0.5118411", "0.5061896", "0.505505", "0.5019985", "0.5013979", "0.4993666", "0.49904415", "0.49675378", "0.49578393"...
0.72731227
0
before_action :validate_current_user, only: %i[edit update destroy]
def index if params[:search] unless params[:search][:start_date].blank? && params[:search][:end_date].blank? && params[:search][:query].blank? && params[:search][:capacity].blank? @reservation = Reservation.new(start_date: params[:search][:start_date], end_date: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_current_user\n end", "def edit\n require_user\n end", "def edit_user\n redirect_to(root_url) unless current_user.edit?\n end", "def edit\n # Listing 9.14: Finding the correct user is now handled by the correct_user before_action.\n end", "def edit\n if @user != current_user\n ...
[ "0.7599519", "0.7222596", "0.7088214", "0.7034748", "0.69897974", "0.6937047", "0.6933776", "0.6899289", "0.6846464", "0.6840036", "0.6834134", "0.68172437", "0.68102604", "0.680496", "0.67990816", "0.67990816", "0.67833966", "0.67823493", "0.6757114", "0.67377734", "0.670619...
0.0
-1
Get the server count, returns an int.
def servercount url = "https://discordbots.org/api/bots/#{@id}" JSON.parse(RestClient.get(url))['server_count'].to_i end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def server_count\n @obj['server_count'].to_i\n end", "def server_count\n @data['server_count'].to_i\n end", "def server_count(id = '__default__')\n @server_counts[id]\n end", "def get_server_count\n @redis.scard(\"servers\") do |count|\n yield count.to_i\n end\n en...
[ "0.8515637", "0.8027463", "0.79593104", "0.7887555", "0.74622345", "0.74410474", "0.70511883", "0.69856375", "0.6946262", "0.6836392", "0.68297756", "0.682016", "0.6800888", "0.6718996", "0.6681172", "0.65994436", "0.6599024", "0.6598993", "0.655841", "0.6489532", "0.6489532"...
0.82805705
1
Update the bot's server count.
def updateservercount(count) url = "https://discordbots.org/api/bots/#{@id}/stats" json = '{"server_count":' + count.to_s + '}' RestClient.post(url, json, :Authorization => @api, :'Content-Type' => :json) "Successfully set the server count to #{count}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def servercount\n url = \"https://discordbots.org/api/bots/#{@id}\"\n JSON.parse(RestClient.get(url))['server_count'].to_i\n end", "def update_stats\n @request_count += 1\n discover_server_periodically if(time_to_discover? && !@disconnected_connections.empty?)\n end", "def server_count\n ...
[ "0.7390052", "0.6911513", "0.6779753", "0.6565079", "0.64300764", "0.6241906", "0.6190918", "0.613333", "0.6091703", "0.606274", "0.60442305", "0.6013219", "0.59574807", "0.59503543", "0.59503543", "0.5906437", "0.5862434", "0.5844858", "0.5829128", "0.5815579", "0.5775203", ...
0.8389939
0
GET /payouts GET /payouts.json
def index @payouts = Payout.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_payout(payout_id:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::GET,\n '/v2/payouts/{payout_id}',\n 'default')\n .template_param(new_parameter(payout_id, key: 'payout_id')\n ...
[ "0.6904115", "0.68451875", "0.6425632", "0.63295406", "0.61211467", "0.608123", "0.60487", "0.59930104", "0.5986641", "0.5948564", "0.5944023", "0.59402394", "0.59233737", "0.59233737", "0.5917559", "0.58587396", "0.58435273", "0.5841715", "0.58354753", "0.5832442", "0.583075...
0.73746043
1
GET /payouts/1 GET /payouts/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_payout(payout_id:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::GET,\n '/v2/payouts/{payout_id}',\n 'default')\n .template_param(new_parameter(payout_id, key: 'payout_id')\n ...
[ "0.7271905", "0.71922845", "0.71922845", "0.65908784", "0.64505595", "0.6269602", "0.6253943", "0.6253943", "0.61896694", "0.6156131", "0.61493057", "0.61493057", "0.6124368", "0.60512966", "0.60250217", "0.60062355", "0.600272", "0.59907955", "0.5973077", "0.5963212", "0.592...
0.0
-1
POST /payouts POST /payouts.json
def create @payout = Payout.new(price: current_user.credit, user_id: current_user.id) ti_ids = TaskInstance.where('status = ? AND user_id = ?', :finished, current_user.id).select(:id) ti_ids.each do |ti| ti.update(status: :paid) end @payout.task_instances = ti_ids respond_to do |format| ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @payout = Payout.new(payout_params)\n\n respond_to do |format|\n if @payout.save\n format.html { redirect_to @payout, notice: 'Payout was successfully created.' }\n format.json { render :show, status: :created, location: @payout }\n else\n format.html { render :new...
[ "0.7100758", "0.6554504", "0.64314467", "0.6291822", "0.62220865", "0.62220865", "0.59778947", "0.59778947", "0.58755106", "0.5827118", "0.58264", "0.58264", "0.58136123", "0.57722145", "0.5753165", "0.57530236", "0.57425123", "0.5711313", "0.5702722", "0.5696596", "0.5693704...
0.62857395
4
PATCH/PUT /payouts/1 PATCH/PUT /payouts/1.json
def update respond_to do |format| if @payout.update(payout_params) format.html { redirect_to @payout, notice: 'Payout was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @payout.errors, status...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @payout.update(payout_params)\n format.html { redirect_to @payout, notice: 'Payout was successfully updated.' }\n format.json { render :show, status: :ok, location: @payout }\n else\n format.html { render :edit }\n format.json { rend...
[ "0.68633986", "0.6463191", "0.6418628", "0.6389872", "0.63155466", "0.6157171", "0.6121686", "0.61154956", "0.61154956", "0.6101869", "0.60840505", "0.6073785", "0.60518765", "0.6036998", "0.6022647", "0.60113317", "0.5996817", "0.5993505", "0.59787333", "0.59569573", "0.5954...
0.6935498
0
DELETE /payouts/1 DELETE /payouts/1.json
def destroy @payout.destroy respond_to do |format| format.html { redirect_to payouts_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @payout.destroy\n respond_to do |format|\n format.html { redirect_to payouts_url, notice: 'Payout was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @pay = Pay.find(params[:id])\n @pay.destroy\n\n respond_to do |format|\n ...
[ "0.7472211", "0.74095005", "0.71579784", "0.7041408", "0.7023012", "0.7002634", "0.6959196", "0.6958714", "0.69508946", "0.69508946", "0.68612057", "0.68524176", "0.68258685", "0.6809828", "0.6770179", "0.6761857", "0.6747345", "0.6700108", "0.6696072", "0.66613114", "0.66613...
0.7750236
0
Use callbacks to share common setup or constraints between actions.
def set_payout @payout = Payout.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def payout_params params.require(:payout).permit(:status) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
Removed destroy action for now... even if interview cancels, applications should be processed as a nonhire, instead of a destroying of an interview object... GET /interviews/manage
def manage @managed_orgs = managed_orgs(current_user) if (@managed_orgs.present?) @managed_jobs = Job.where(:organization_id => @managed_orgs.ids) @interviewing_postings = JobPosting.where(:job_id => @managed_jobs.ids, :status => "interviewing").order("deadline").paginate(:page => params[:page], :pe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @interview = Interview.find(params[:id])\n @interview.deactivify\n @interview.destroy\n\n if @interview.application != nil\n @interview.application.reject\n end\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :ok }\n end\n end",...
[ "0.81996876", "0.7686253", "0.7644555", "0.7609694", "0.7609694", "0.7591554", "0.74862427", "0.7419182", "0.73029894", "0.7276735", "0.72733474", "0.72587246", "0.70636994", "0.7040082", "0.70196897", "0.70126754", "0.6972348", "0.6940808", "0.6910464", "0.68944025", "0.6876...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_interview @interview = Interview.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def interview_params params.require(:interview).permit(:job_application_id, :start_time, :end_time) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.6981269", "0.6783559", "0.6746007", "0.67423046", "0.6735905", "0.6593568", "0.6504213", "0.649792", "0.6482664", "0.6478558", "0.64566684", "0.64392304", "0.6380194", "0.6376366", "0.636562", "0.63208145", "0.63006365", "0.63001287", "0.6292953", "0.62927175", "0.62911004...
0.0
-1
Create a client for acccessing Github. For different users, may need to change access token.
def create_client token = File.open(GITHUB_TOKEN_FILE).read Octokit::Client.new(access_token: token) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def github_client\n Octokit::Client.new(:login => username, :oauth_token => token)\n end", "def github_client\n Octokit::Client.new access_token: self.setting.user_with_token.client_token\n end", "def client\n @client ||= Github::ApiProxy.new(@options[:access_token])\n end", "def github_c...
[ "0.8094649", "0.80812347", "0.7972784", "0.79642576", "0.7830586", "0.78172874", "0.7791396", "0.7608315", "0.7428538", "0.7407353", "0.7402268", "0.71072006", "0.7074456", "0.7074456", "0.70472795", "0.7043395", "0.70420444", "0.70396847", "0.6990803", "0.66881555", "0.65867...
0.787827
4
Takes the methods represented in [+ meths +], and generates and returns a hash that has all the data we want (types, source code, documentation, etc.).
def get_yard_meths(meths, files = []) ## TODO: handle YARD options tags ## filter out meths without types meths.keep_if { |m| (!m.tags(:param).empty? && m.tags(:param).any? { |t| !t.types.nil? }) || (!m.tags(:return).empty? && m.tags(:return).any? { |t| !t.types.nil? }) } ## these methods have types automatic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def emit_methods_arrays\n @symbol_table.map do |cname, chash|\n if chash.has_key? :functions_def\n id2fun_records = chash[:functions_def].map do |fname,farray|\n fdef = farray.first\n args_number = fdef[2].rest.length\n if fdef[0] == :stdlib_defn\n # Method defi...
[ "0.6702553", "0.6576708", "0.65638345", "0.64519924", "0.6382997", "0.63425285", "0.62438875", "0.6233371", "0.6176482", "0.6112461", "0.6091528", "0.6071337", "0.59826916", "0.5921248", "0.5895307", "0.5875322", "0.5864362", "0.5860854", "0.5856518", "0.58381075", "0.5837345...
0.686207
0
Ensure a file exists on Google Drive that has the name GOOGLE_DRIVE_TYPE_FOLDER.
def ensure_google_type_folder(session) session.folders.each { |f| return f if f.name == GOOGLE_DRIVE_TYPE_FOLDER } return session.create_folder(GOOGLE_DRIVE_TYPE_FOLDER) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkforGoogleFolder(googlefolder)\n session = GoogleDrive::Session.from_config(\"config.json\")\n folder = session.collection_by_title(googlefolder)\n if folder.nil?\n session.root_collection.create_subcollection(googlefolder)\n end\nend", "def ensure_drive_document(type, name)\n return nil unless...
[ "0.74389386", "0.70625573", "0.5990133", "0.5973637", "0.57913417", "0.5717882", "0.5674437", "0.5632845", "0.5629003", "0.56174135", "0.56063217", "0.5583093", "0.5559707", "0.55164415", "0.55133224", "0.5509388", "0.54841745", "0.54543245", "0.5449574", "0.54275656", "0.539...
0.78275913
0
Compress [+ dirname +], upload it to [+ google_folder +].
def compress_and_upload(google_folder, dirname) puts "Compressing and uploading #{dirname} to Google Drive..." compressed_name = "#{dirname}.tar.gz" system "tar -czf #{compressed_name} #{dirname}" google_folder.upload_from_file(compressed_name) File.delete(compressed_name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tgz___( directory, filename )\r\n raise StandardError, \"Under investigation\" \r\n got = @ndev.rpc.file_archive( :destination => filename, :source => directory, :compress => true )\r\n end", "def compress(src_path, archive_path)\n src_dir = File.dirname( File.expand_path( src_path ) )\n s...
[ "0.6495346", "0.6473766", "0.6370856", "0.6304641", "0.62913275", "0.6280554", "0.60836667", "0.60765505", "0.6075212", "0.6067199", "0.60048217", "0.59727293", "0.5964164", "0.5961613", "0.5947126", "0.5935733", "0.5914155", "0.58987725", "0.58165294", "0.5793906", "0.576461...
0.81818557
0