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 |
|---|---|---|---|---|---|---|
whether either of them is in the range 20..30 inclusive. | def check_range(a,b)
if (20..30).include?(a)
puts "a is in the range (20..30)."
else
puts "a is not in the range (20..30)."
end
if (20..30).include?(b)
puts "b is in the range (20..30)."
else
puts "b is not in the range (20..30)."
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def in_range(a, b)\n return ((a >= 20 && a <= 30) || (b >= 20 && b <= 30));\t\nend",
"def in_range(a, b, c)\n return ((a >= 1 && a <= 10) || (b >= 1 && b <= 10) || (c >= 1 && c <= 10));\t\nend",
"def between?(x,y) end",
"def between?(min, max)\n #This is a stub, used for indexing\n end",
"d... | [
"0.8457878",
"0.71087736",
"0.7085867",
"0.69720167",
"0.6937138",
"0.68784183",
"0.67648745",
"0.6760615",
"0.6745976",
"0.6737464",
"0.6692344",
"0.6687495",
"0.6687495",
"0.66796523",
"0.6675933",
"0.6661489",
"0.66548365",
"0.65645564",
"0.65420574",
"0.65408957",
"0.6536... | 0.74083036 | 1 |
in CustomerApi::CryptomusPaymentForm we crete cryptomus payment in USDT so we can use merchant_amount as payment amount because USDT equal to USD. webhook payload nor payment info does not contain merchant amount in USD (values that merchant received to the USD balance). | def merchant_amount_usd
payload[:merchant_amount].to_d
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pay!\n #soap_server = VendorPayment.generate_soap_server\n #token = VendorPayment.generate_usa_epay_security_token\n #custNum = observed.vendor_payment_period.store.id\n #paymentMethodID = nil\n #parameters = generate_transaction_request\n #response = soap_server.runCustomerTransaction(token,... | [
"0.60830325",
"0.6021468",
"0.59798944",
"0.5945613",
"0.5914539",
"0.5818975",
"0.57750463",
"0.5736448",
"0.5735499",
"0.57226735",
"0.57033026",
"0.56856585",
"0.5659729",
"0.56584835",
"0.564774",
"0.56334364",
"0.5630801",
"0.5628745",
"0.5589157",
"0.5585709",
"0.558570... | 0.6420269 | 0 |
This method adds a role to a user POST | def add_role
@user = User.find(params[:id])
if @user
if @user.has_role? params[:role]
render json: { :success => 'user already has this role' }
else
@user.add_role params[:role]
render json: { :success => 'successfully add role' }
end
else
render json: { error... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_roles user\n user.add_role(params[:role_name])\n end",
"def create_user_role\n if self.role.blank?\n id = Role.select{|role| role.role_type == $roles[:user]}.map(&:id)\n self.update_attributes(:role_id => id[0])\n end\n end",
"def grant_role\n @user = User.find_by_email(params[... | [
"0.78701776",
"0.75088555",
"0.74990416",
"0.74757415",
"0.7442689",
"0.7429285",
"0.7405993",
"0.73851144",
"0.7329481",
"0.72237235",
"0.71918064",
"0.71805274",
"0.7119443",
"0.7094699",
"0.70695966",
"0.70355386",
"0.6995031",
"0.69834834",
"0.697922",
"0.69636256",
"0.69... | 0.7670971 | 1 |
This method removes a role to a user POST | def remove_role
if @user.has_role? params[:role]
@user.remove_role params[:role]
render json: { :success => 'role successfully removed' }
else
render json: { :success => 'The user does not have this role' }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_user_from_role(role_id)\n # subject = Subject.find(preallowed_id)\n role = Role.find(role_id)\n\n # put :remove_subject, :id => role.id, :subject_id => @subject.id, :client_id => @subject.client.id\n res = role.put(:remove_subject, :id => role.id, :subject_id => preallowed_id, :client_id => ... | [
"0.7737616",
"0.77155983",
"0.7328504",
"0.73110783",
"0.722795",
"0.71976304",
"0.7173417",
"0.7163969",
"0.71455246",
"0.7109868",
"0.7105347",
"0.70548725",
"0.7050787",
"0.70210445",
"0.7003758",
"0.6992041",
"0.69647026",
"0.6960187",
"0.6948173",
"0.6948173",
"0.6928029... | 0.79271746 | 0 |
This method returns all the available roles for a particular user GET | def get_user_roles
@roles = @user.roles.pluck(:name)
render json: @roles
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def roles\n client.user_roles(id)\n end",
"def roles\n client.user_roles(id)\n end",
"def get_roles_list()\n\n query_parameters = {}\n query_parameters['apiKey'] = @api_key\n query_parameters['apiSecret'] = @api_secret\n\n resource_path = 'identity/v2/manage/role'\n get... | [
"0.7653802",
"0.7653802",
"0.76017773",
"0.75835866",
"0.74959886",
"0.7416834",
"0.7168094",
"0.71676326",
"0.7162152",
"0.7142657",
"0.7140822",
"0.7134522",
"0.70803547",
"0.70749664",
"0.7067334",
"0.70641094",
"0.7061962",
"0.7061962",
"0.7059848",
"0.70483184",
"0.70228... | 0.79551464 | 0 |
accept board, position (19), and token to mark board token has default value of 'X' | def move(board, position, token="X")
board[position.to_i - 1] = token
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move (board, index, token = \"X\")\n board[index] = token\nend",
"def move(position, token='X')\n @board[position] = token\n end",
"def move(board, index, token = \"X\")\n board[index] = token\n display_board(board)\nend",
"def move(index, token = 'X')\n @board[index] = token\nend",
"def move... | [
"0.708602",
"0.70858395",
"0.7077193",
"0.7049418",
"0.704749",
"0.70310044",
"0.7017038",
"0.7017038",
"0.6987552",
"0.697109",
"0.68649524",
"0.6848728",
"0.67860514",
"0.6781516",
"0.6780697",
"0.6730996",
"0.6703232",
"0.66291124",
"0.6547746",
"0.65038437",
"0.6476184",
... | 0.7357024 | 0 |
Update the flag file in an output directory. | def update_output_dir(op_dir, time)
File.open(output_flag_file(op_dir), "w") {|f| f.puts time.rfc2822 }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_output_dir(op_dir, time, last = {})\n return if @options.dry_run or not @options.update_output_dir\n unless ENV['SOURCE_DATE_EPOCH'].nil?\n time = Time.at(ENV['SOURCE_DATE_EPOCH'].to_i).gmtime\n end\n\n File.open output_flag_file(op_dir), \"w\" do |f|\n f.puts time.rfc2822\n l... | [
"0.6690549",
"0.6243799",
"0.60913014",
"0.59386307",
"0.59378684",
"0.59378684",
"0.59192544",
"0.58708453",
"0.5860144",
"0.5860144",
"0.5757453",
"0.57507306",
"0.5713641",
"0.57100475",
"0.5615636",
"0.5587975",
"0.55842894",
"0.55612826",
"0.55196005",
"0.5515739",
"0.55... | 0.7408483 | 1 |
Given a list of files and directories, create a list of all the Ruby files they contain. If +force_doc+ is true we always add the given files, if false, only add files that we guarantee we can parse. It is true when looking at files given on the command line, false when recursing through subdirectories. The effect of t... | def normalized_file_list(options, relative_files, force_doc = false,
exclude_pattern = nil)
file_list = []
relative_files.each do |rel_file_name|
next if exclude_pattern && exclude_pattern =~ rel_file_name
stat = File.stat rel_file_name rescue next
case... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normalized_file_list(options, relative_files, force_doc = false, exclude_pattern=nil)\n file_list = []\n\n relative_files.each do |rel_file_name|\n next if exclude_pattern && exclude_pattern =~ rel_file_name\n case type = File.stat(rel_file_name).ftype\n when \"file\"\n ... | [
"0.6948236",
"0.6849111",
"0.6414142",
"0.6289561",
"0.6289139",
"0.61735046",
"0.6170732",
"0.6145862",
"0.6123663",
"0.6106295",
"0.6097908",
"0.6028043",
"0.6008009",
"0.5923306",
"0.59143186",
"0.5899364",
"0.5893837",
"0.58935547",
"0.58405524",
"0.5812527",
"0.57647526"... | 0.6852115 | 1 |
GET /recipes/1 GET /recipes/1.xml | def show
@recipe = Recipe.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @recipe }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @recipe = Recipe.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @recipe }\n end\n end",
"def index\n @cooking_recipes = CookingRecipe.all\n\n respond_to do |format|\n format.html # index.html.erb\n forma... | [
"0.69728124",
"0.695428",
"0.6855637",
"0.6848008",
"0.6825015",
"0.66478723",
"0.6584821",
"0.655635",
"0.65379536",
"0.6356547",
"0.63391906",
"0.6339087",
"0.6335291",
"0.6335291",
"0.6335291",
"0.6335291",
"0.6335291",
"0.6335291",
"0.6335291",
"0.6335291",
"0.6335291",
... | 0.6961265 | 1 |
GET /recipes/new GET /recipes/new.xml | def new
@recipe = Recipe.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @recipe }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @recipe = Recipe.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @recipe }\n end\n end",
"def new\n @cooking_recipe = CookingRecipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml ... | [
"0.78007865",
"0.7426059",
"0.71947354",
"0.71947354",
"0.71947354",
"0.71947354",
"0.71947354",
"0.7123491",
"0.6970201",
"0.6860675",
"0.6853124",
"0.6845413",
"0.68432814",
"0.6834902",
"0.6834084",
"0.6731157",
"0.67204833",
"0.6696647",
"0.6686139",
"0.6680771",
"0.66775... | 0.7738597 | 1 |
USED WITH AJAX Deletes an App | def admin_delete_app
# Get Current App
app = MailfunnelsUtil.get_app
# If the User is not an admin redirect to error page
if !app.is_admin or app.is_admin === 0
response = {
success: false
}
render json: response and return
end
# Get App to be deleted
del_app ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { r... | [
"0.743533",
"0.743533",
"0.743533",
"0.74132425",
"0.74132425",
"0.7367097",
"0.7361893",
"0.73280054",
"0.7264013",
"0.72482884",
"0.7238849",
"0.7238849",
"0.7238849",
"0.7220463",
"0.7220463",
"0.7220463",
"0.7220463",
"0.71816874",
"0.71484137",
"0.7142956",
"0.7136517",
... | 0.79883045 | 0 |
GET /home_cats/1 GET /home_cats/1.json | def show
@home_cat = HomeCat.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @home_cat }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n response = HTTParty.get('http://okta-api:8080/pets/v1/cats', {headers: {\"X-Token\"=> session[:oktastate][:credentials][:token]}})\n if response.code == 200\n @cats = JSON.parse(response.body)\n else\n @cats = []\n end\n end",
"def index\n @cove... | [
"0.73366266",
"0.7182306",
"0.71761465",
"0.6870144",
"0.6848004",
"0.6785855",
"0.67276055",
"0.6709088",
"0.668055",
"0.6662573",
"0.66425014",
"0.66425014",
"0.6642351",
"0.6640286",
"0.6618384",
"0.6605651",
"0.6566611",
"0.6533491",
"0.65293604",
"0.65230834",
"0.6472785... | 0.72157717 | 1 |
POST /home_cats POST /home_cats.json | def create
@home_cat = HomeCat.new(params[:home_cat])
respond_to do |format|
if @home_cat.save
format.html { redirect_to @home_cat, notice: 'Home cat was successfully created.' }
format.json { render json: @home_cat, status: :created, location: @home_cat }
else
format.html {... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n json_create(category_params, Category)\n end",
"def create_category payload\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.post CATEGORIES, payload )\n\t\t\t\tend",
"def CreateCategory params = {}\n \n APICall(path: 'categories.json',method: 'POST',payload: params... | [
"0.6626081",
"0.66081464",
"0.65985453",
"0.6481609",
"0.6419466",
"0.6414534",
"0.6407213",
"0.6357878",
"0.63150615",
"0.6273441",
"0.6190143",
"0.61579263",
"0.6141266",
"0.6104997",
"0.61015046",
"0.6061213",
"0.6060126",
"0.6051797",
"0.60499465",
"0.6029382",
"0.6013834... | 0.67463595 | 0 |
DELETE /home_cats/1 DELETE /home_cats/1.json | def destroy
@home_cat = HomeCat.find(params[:id])
@home_cat.destroy
respond_to do |format|
format.html { redirect_to home_cats_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deleteCat()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n c = Category.find(params[:id])\n status = c.destroy\n error = \"\"\n if(c.errors.full_messages.count > 0)\n... | [
"0.6812566",
"0.6769505",
"0.6769505",
"0.6767195",
"0.6728388",
"0.6711082",
"0.66609794",
"0.6642316",
"0.66347337",
"0.6619702",
"0.6614038",
"0.65790015",
"0.65597737",
"0.6551378",
"0.65202487",
"0.65189874",
"0.6515235",
"0.6491689",
"0.6490546",
"0.64897025",
"0.648413... | 0.6881932 | 0 |
Check if a particular action is the current one args One or more action names to check Examples On Projectsnew current_action?(:new) => true current_action?(:create) => false current_action?(:new, :create) => true | def current_action?(*args)
args.any? { |v| v.to_s.downcase == action_name }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_action?(url)\n return url.split('/')[2] == action_name\n end",
"def available_action?(action_name); end",
"def current_controller_action_in?(*args)\n controller = params[\"controller\"]\n action = params[\"action\"]\n\n if args.size == 1\n if args.first.is_a?(Array)\n ... | [
"0.7178823",
"0.70774573",
"0.7046303",
"0.7022752",
"0.68702364",
"0.6869936",
"0.68429285",
"0.67817634",
"0.67690504",
"0.65591556",
"0.65443635",
"0.65312874",
"0.6410122",
"0.6347559",
"0.633968",
"0.631912",
"0.63126516",
"0.6307664",
"0.62986207",
"0.62467",
"0.6206398... | 0.8155522 | 1 |
POST /store_transactions POST /store_transactions.json | def create
@store_transaction = StoreTransaction.new(store_transaction_params)
respond_to do |format|
if @store_transaction.save
format.html { redirect_to @store_transaction, notice: 'Store transaction was successfully created.' }
format.json { render :show, status: :created, location: @s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def postTransaction(useridgiving, useridreceiving, amount)\n parameters={useridgiving: useridgiving.to_i, useridreceiving: useridreceiving.to_i, amount: amount.to_f, state: \"initial\"}\n options = {\n :body => parameters.to_json,\n :headers => {\n 'Content-Type' => 'application/js... | [
"0.69341916",
"0.67745936",
"0.667915",
"0.6552319",
"0.653909",
"0.65367275",
"0.6521789",
"0.64656353",
"0.6458262",
"0.6453349",
"0.6451459",
"0.6403568",
"0.6394129",
"0.6362064",
"0.6345689",
"0.63446456",
"0.63356316",
"0.6324035",
"0.6319456",
"0.6314742",
"0.63123584"... | 0.69454247 | 0 |
PATCH/PUT /store_transactions/1 PATCH/PUT /store_transactions/1.json | def update
respond_to do |format|
if @store_transaction.update(store_transaction_params)
format.html { redirect_to @store_transaction, notice: 'Store transaction was successfully updated.' }
format.json { render :show, status: :ok, location: @store_transaction }
else
format.html ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @transaction.update(transaction_params)\n format.html { redirect_to @transaction }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @transaction.errors, status: :unprocess... | [
"0.6254099",
"0.62267625",
"0.6210421",
"0.61956364",
"0.61901516",
"0.61883277",
"0.61878484",
"0.61745167",
"0.61484617",
"0.6143868",
"0.6084685",
"0.6083219",
"0.60682005",
"0.60682005",
"0.60682005",
"0.60321414",
"0.6024136",
"0.6024136",
"0.6024136",
"0.6024136",
"0.60... | 0.66617644 | 0 |
DELETE /store_transactions/1 DELETE /store_transactions/1.json | def destroy
@store_transaction.destroy
respond_to do |format|
format.html { redirect_to store_transactions_url, notice: 'Store transaction was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @transaction.destroy\n respond_to do |format|\n format.html { redirect_to txns_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to transactions_url }\n format.json { hea... | [
"0.7090399",
"0.7050937",
"0.7047925",
"0.7047925",
"0.7047925",
"0.7047925",
"0.7047925",
"0.7047925",
"0.7047925",
"0.70324004",
"0.70019275",
"0.69179034",
"0.69179034",
"0.69179034",
"0.69179034",
"0.69179034",
"0.69179034",
"0.69179034",
"0.69179034",
"0.6894368",
"0.688... | 0.73206955 | 0 |
Set the tags or rating for a selected track(s) or all tracks (when set from records) | def set_track_field(field, value, to_all)
sql = "UPDATE tracks SET #{field}=" +
(field == 'itags' ? field+(value < 0 ? ' & ~ ' : ' | ')+value.abs.to_s : value.to_s) +
' WHERE rtrack IN ('+self.send(to_all ? :map : :selected_map) { |iter| iter[TTV_REF].to_s }.join(',')+')'
# ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tracks=(tracks)\n reload\n @tracks = track\n @current_track_index = 0\n save\n end",
"def set_track\n # @track = Track.find(params[:id])\n end",
"def set_track\n @track = Track.find_by(id: params[:id])\n end",
"def set_tags(given_tags = {})\n @tags.merge!(given... | [
"0.6247973",
"0.58880645",
"0.58526254",
"0.58282286",
"0.5784687",
"0.57627374",
"0.57627374",
"0.57627374",
"0.57627374",
"0.57627374",
"0.57627374",
"0.57627374",
"0.57627374",
"0.57627374",
"0.57627374",
"0.57543504",
"0.57146245",
"0.56877995",
"0.56877995",
"0.56870675",
... | 0.6697202 | 0 |
Set the status of audio link to OK and update the icon if visible | def audio_link_ok(xlink)
xlink.set_audio_status(Audio::Status::OK)
xlink.setup_audio_file
if iter = find_ref(xlink.track.rtrack)
iter[TTV_PIX] = render_icon(@stocks[Audio::Status::OK], Gtk::IconSize::MENU)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def process_ok\n if current_item_enabled?\n Sound.play_ok \n Input.update\n deactivate unless @symbol.nil?\n call_ok_handler\n else\n Sound.play_buzzer\n end\n end",
"def process_ok\n if current_item_enabled?\n Input.update\n deactivate\n call_ok_handler\n ... | [
"0.5917303",
"0.58788955",
"0.58472383",
"0.57460666",
"0.5576664",
"0.5563006",
"0.55416363",
"0.552047",
"0.5476063",
"0.5357942",
"0.5353026",
"0.533569",
"0.53335136",
"0.53131086",
"0.52326244",
"0.523125",
"0.5227965",
"0.52239925",
"0.52233803",
"0.5190903",
"0.5112304... | 0.82122046 | 0 |
Returns the XIntf::Track for the currently selected track in the browser. Returns nil if no selection or multiselection. | def selected_track
return selection.count_selected_rows == 1 ? model.get_iter(selection.selected_rows[0])[TTV_XLINK] : nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_track\n return @interface.GetCurrentTrack.first\n end",
"def selected_tracks\n IITTrackCollection.new(@ole.SelectedTracks)\n end",
"def selected_tracks\n IITTrackCollection.new(@ole.SelectedTracks)\n end",
"def current_track\n IITTrack.new(@ole.CurrentTrack)\n end"... | [
"0.7268951",
"0.6106158",
"0.6106158",
"0.60176617",
"0.5703667",
"0.5575952",
"0.5550087",
"0.5513797",
"0.51288974",
"0.5113738",
"0.51112664",
"0.50872284",
"0.5069063",
"0.5048394",
"0.5035448",
"0.5035448",
"0.5035448",
"0.5035448",
"0.5013614",
"0.4970579",
"0.49610403"... | 0.7133011 | 1 |
Redraws infos line Emitted by master controller when a track has been played | def update_infos
@trklnk.to_widgets if @trklnk.valid_track_ref? && selected_track == @trklnk
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def processPartialUpdate(viewer)\n # In this demo, we just need to redraw the chart\n drawChart(viewer)\n end",
"def draw_track_info\n heading = @song[:title].titleize\n if @track_credits\n heading += \" by \" + @track_credits.first(3).join(', ')\n end\n\n text(heading, 10, 16)\... | [
"0.6345041",
"0.6070158",
"0.6057742",
"0.59972537",
"0.5993148",
"0.5983852",
"0.5963829",
"0.5884598",
"0.5857194",
"0.5802033",
"0.5801772",
"0.5795913",
"0.57764685",
"0.5760515",
"0.5726734",
"0.56790364",
"0.5614366",
"0.5602564",
"0.55947924",
"0.55625725",
"0.5558595"... | 0.67853713 | 0 |
PATCH/PUT /tourguides/1 PATCH/PUT /tourguides/1.json | def update
respond_to do |format|
if @tourguide.update(tourguide_params)
format.html { redirect_to @tourguide, notice: 'Tourguide was successfully updated.' }
format.json { render :show, status: :ok, location: @tourguide }
else
format.html { render :edit }
format.json { r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @guide_trip.update(guide_trip_params)\n format.html { redirect_to @guide_trip, notice: 'Guía turístico fue modificado satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @guide_trip }\n else\n format.html { render :e... | [
"0.6431977",
"0.63849",
"0.6307332",
"0.6307332",
"0.6293292",
"0.6293292",
"0.6293292",
"0.613793",
"0.6121476",
"0.60961574",
"0.6092829",
"0.6068161",
"0.60582596",
"0.60514396",
"0.6043623",
"0.60194635",
"0.60192376",
"0.60143757",
"0.5988173",
"0.5988173",
"0.5966579",
... | 0.6912947 | 0 |
DELETE /tourguides/1 DELETE /tourguides/1.json | def destroy
@tourguide.destroy
respond_to do |format|
format.html { redirect_to tourguides_url, notice: 'Tourguide was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @tour_guide = TourGuide.find_by_id(params[:id])\n if @tour_guide.present?\n @tour_guide.destroy\n render :json=>{:response=>\"success\"}\n\t\tend\n end",
"def delete\n @guide = Guide.find(params[:id])\n @guide.destroy\n respond_to do |format|\n format.html { redirect_... | [
"0.78891486",
"0.74696606",
"0.73855036",
"0.73855036",
"0.7296013",
"0.7265029",
"0.72457856",
"0.7236244",
"0.7223431",
"0.720905",
"0.71594065",
"0.71356785",
"0.71327835",
"0.7104436",
"0.70835656",
"0.7075304",
"0.7064085",
"0.7020861",
"0.7019954",
"0.70005834",
"0.6980... | 0.7862367 | 1 |
GET /admin/enter_urls/1 GET /admin/enter_urls/1.json | def show
@admin_enter_url = Admin::EnterUrl.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @admin_enter_url }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @admin_enter_url = Admin::EnterUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_enter_url }\n end\n end",
"def list\n @urls = Url.all\n @admin = ADMIN\n end",
"def create\n @admin_enter_url = Admin::EnterUrl.new(params[:... | [
"0.65769273",
"0.612907",
"0.60212564",
"0.58359987",
"0.57668585",
"0.5735223",
"0.56313735",
"0.559952",
"0.55885524",
"0.55755466",
"0.5560223",
"0.5548981",
"0.5532467",
"0.54895693",
"0.54848826",
"0.5482891",
"0.54605645",
"0.54605645",
"0.54477173",
"0.54419327",
"0.54... | 0.6996111 | 0 |
GET /admin/enter_urls/new GET /admin/enter_urls/new.json | def new
@admin_enter_url = Admin::EnterUrl.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @admin_enter_url }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @admin_enter_url = Admin::EnterUrl.new(params[:admin_enter_url])\n\n respond_to do |format|\n if @admin_enter_url.save\n format.html { redirect_to @admin_enter_url, notice: 'Enter url was successfully created.' }\n format.json { render json: @admin_enter_url, status: :created,... | [
"0.73559177",
"0.680929",
"0.673793",
"0.66998994",
"0.64491636",
"0.63928944",
"0.6362127",
"0.6348096",
"0.6328218",
"0.6292311",
"0.6223984",
"0.61748415",
"0.6159",
"0.6139649",
"0.6127806",
"0.6123221",
"0.6092136",
"0.60797656",
"0.6073013",
"0.606969",
"0.60549504",
... | 0.76302373 | 0 |
POST /admin/enter_urls POST /admin/enter_urls.json | def create
@admin_enter_url = Admin::EnterUrl.new(params[:admin_enter_url])
respond_to do |format|
if @admin_enter_url.save
format.html { redirect_to @admin_enter_url, notice: 'Enter url was successfully created.' }
format.json { render json: @admin_enter_url, status: :created, location: ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @admin_enter_url = Admin::EnterUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_enter_url }\n end\n end",
"def add_new_urls(urls)\n return if urls.length == 0\n @db[LINKS_COLLECTION_NAME].insert(urls.map {|u| {'_id' => has... | [
"0.579945",
"0.568786",
"0.56688887",
"0.56501096",
"0.54872274",
"0.54836535",
"0.545093",
"0.545093",
"0.5428407",
"0.5418185",
"0.5405554",
"0.53885317",
"0.53570724",
"0.53303295",
"0.5330081",
"0.5305024",
"0.52896005",
"0.5281647",
"0.52483004",
"0.5242858",
"0.52377933... | 0.6235626 | 0 |
PUT /admin/enter_urls/1 PUT /admin/enter_urls/1.json | def update
@admin_enter_url = Admin::EnterUrl.find(params[:id])
respond_to do |format|
if @admin_enter_url.update_attributes(params[:admin_enter_url])
format.html { redirect_to @admin_enter_url, notice: 'Enter url was successfully updated.' }
format.json { head :no_content }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n \n set_url_host_model\n\n respond_to do |format|\n if @url.update(url_params)\n format.html { redirect_to @url, notice: 'Url was successfully updated.' }\n format.json { render :show, status: :ok, location: @url }\n else\n format.html { render :edit }\n f... | [
"0.6257459",
"0.6097185",
"0.6097185",
"0.6097185",
"0.6097185",
"0.6097185",
"0.6097185",
"0.6097185",
"0.6097185",
"0.6097185",
"0.6097185",
"0.6097185",
"0.6097185",
"0.6097185",
"0.6097185",
"0.6097185",
"0.6096604",
"0.6090756",
"0.6073784",
"0.6073784",
"0.6073784",
"... | 0.6956808 | 0 |
DELETE /admin/enter_urls/1 DELETE /admin/enter_urls/1.json | def destroy
@admin_enter_url = Admin::EnterUrl.find(params[:id])
@admin_enter_url.destroy
respond_to do |format|
format.html { redirect_to admin_enter_urls_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n delete_from_server single_url\n end",
"def delete; rest_delete(link('self')); end",
"def delete; rest_delete(link('self')); end",
"def destroy\n @url.destroy\n respond_to do |format|\n format.html { redirect_to urls_url }\n format.json { head :no_content }\n end\n end... | [
"0.7076643",
"0.7006884",
"0.7006884",
"0.6978426",
"0.6978426",
"0.6864485",
"0.6839526",
"0.6828507",
"0.678089",
"0.67627686",
"0.6731483",
"0.672799",
"0.672799",
"0.672799",
"0.67169124",
"0.6693193",
"0.6672353",
"0.66700494",
"0.66402286",
"0.663374",
"0.6608348",
"0... | 0.7739172 | 0 |
GET /code_postal_villes/1 GET /code_postal_villes/1.xml | def show
@code_postal_ville = CodePostalVille.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @code_postal_ville }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @code_postal_ville = CodePostalVille.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @code_postal_ville }\n end\n end",
"def lookup\n @code = Code.find_by_code(params[:code])\n\n # Make a custom xml builder (since excluding \".xml\" i... | [
"0.6527983",
"0.60490173",
"0.5985225",
"0.5983931",
"0.57657576",
"0.5738058",
"0.57341695",
"0.5690106",
"0.5662633",
"0.5655247",
"0.5616846",
"0.55983627",
"0.5562316",
"0.5561156",
"0.5560616",
"0.55532694",
"0.5543927",
"0.5536683",
"0.55358446",
"0.5523844",
"0.5522092... | 0.6884639 | 0 |
GET /code_postal_villes/new GET /code_postal_villes/new.xml | def new
@code_postal_ville = CodePostalVille.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @code_postal_ville }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @pneighbour = Pneighbour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pneighbour }\n end\n end",
"def new\n @pinrequest = Pinrequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml... | [
"0.70783705",
"0.6984427",
"0.6965824",
"0.6960059",
"0.69464993",
"0.69443434",
"0.68767136",
"0.6828228",
"0.67945015",
"0.67906934",
"0.67906934",
"0.67906934",
"0.6767539",
"0.675883",
"0.67519987",
"0.67484987",
"0.67422724",
"0.67115206",
"0.670589",
"0.6700767",
"0.669... | 0.77002 | 0 |
POST /code_postal_villes POST /code_postal_villes.xml | def create
@code_postal_ville = CodePostalVille.new(params[:code_postal_ville])
respond_to do |format|
if @code_postal_ville.save
format.html { redirect_to(@code_postal_ville, :notice => 'Code postal ville was successfully created.') }
format.xml { render :xml => @code_postal_ville, :sta... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @code_postal_ville = CodePostalVille.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @code_postal_ville }\n end\n end",
"def create\n @codigo_postal = CodigoPostal.new(codigo_postal_params)\n\n respond_to do |format|\n if @codigo... | [
"0.60284233",
"0.5987923",
"0.57102615",
"0.5672789",
"0.56468886",
"0.56148446",
"0.5574692",
"0.5385219",
"0.5334207",
"0.5310269",
"0.5300727",
"0.52950066",
"0.5287959",
"0.5261392",
"0.5247794",
"0.5223596",
"0.5215151",
"0.5186949",
"0.51843303",
"0.51778394",
"0.515247... | 0.68515825 | 0 |
PUT /code_postal_villes/1 PUT /code_postal_villes/1.xml | def update
@code_postal_ville = CodePostalVille.find(params[:id])
respond_to do |format|
if @code_postal_ville.update_attributes(params[:code_postal_ville])
format.html { redirect_to(@code_postal_ville, :notice => 'Code postal ville was successfully updated.') }
format.xml { head :ok }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @codigo_postal.update(codigo_postal_params)\n format.html { redirect_to @codigo_postal, notice: 'Codigo postal was successfully updated.' }\n format.json { render :show, status: :ok, location: @codigo_postal }\n else\n format.html { render ... | [
"0.5874987",
"0.58646524",
"0.5862795",
"0.58410543",
"0.5714412",
"0.57120067",
"0.5683091",
"0.5661859",
"0.5632301",
"0.5632301",
"0.5622226",
"0.55694723",
"0.5566804",
"0.5509782",
"0.550888",
"0.55075556",
"0.5507367",
"0.54992276",
"0.54893476",
"0.54791796",
"0.547484... | 0.68239963 | 0 |
DELETE /code_postal_villes/1 DELETE /code_postal_villes/1.xml | def destroy
@code_postal_ville = CodePostalVille.find(params[:id])
@code_postal_ville.destroy
respond_to do |format|
format.html { redirect_to(code_postal_villes_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n en... | [
"0.6567497",
"0.6547694",
"0.650777",
"0.64457047",
"0.63655955",
"0.62878287",
"0.6252583",
"0.6236189",
"0.6221003",
"0.62082523",
"0.62007797",
"0.61083496",
"0.6095259",
"0.6093115",
"0.6075722",
"0.6070916",
"0.60700184",
"0.60636216",
"0.6042399",
"0.6041613",
"0.603420... | 0.70615363 | 0 |
=begin input: an array that holds integers positive nonunique (can have repeating integers) no upper limit can be empty output: an integer that represents the minimum sum that i cannot create with the given integers in the array for example: given [] empty array returns: 1 given [1, 2, 5] returns: 4 what are all the po... | def nonConstructibleChange(coins)
min_change = 0
coins.sort!
coins.each do |coin|
if coin > (min_change + 1)
return (min_change + 1)
else
min_change += coin
end
end
return (min_change + 1)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def min_change_sum(coins, total)\n totals = Array.new(total + 1, 1000000000000)\n totals[0] = 0\n\n (1..total).each do |i|\n coins.each do |coin|\n if coin <= i && (totals[i-coin] + 1 < totals[i])\n totals[i] = totals[i-coin] + 1\n end\n end\n end\n\n totals[total]\nend",
"def solutio... | [
"0.72321975",
"0.7188532",
"0.7126694",
"0.70378524",
"0.68644553",
"0.6743039",
"0.670065",
"0.66334736",
"0.6632201",
"0.6582857",
"0.6513583",
"0.648694",
"0.6474179",
"0.6440446",
"0.6438648",
"0.6437002",
"0.6376579",
"0.63760394",
"0.6373515",
"0.6366573",
"0.6366573",
... | 0.73956484 | 0 |
dance with bitext api first a POST to analyse then a GET for the result which may not be complete yet so may need to retry | def perform!
post_response = perform_post_request
if bitext_halted? || post_response.failed?
@post_failed = true
else
@get_response = perform_get_request(post_response)
if @get_response.ok?
Brain::ExternalAnalysis.create!(
s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run\n super\n\n #\n # This module currently uses the Free API (rate limited / response limited)\n # https://freeapi.robtex.com/ipquery/#{search_ip}\n #\n # Note that a paid version (free up to 10k queries / month) of the API is available at:\n # https://market.mashape.com/robtex/robtex\n ... | [
"0.6356103",
"0.60373896",
"0.5853683",
"0.5853683",
"0.5852241",
"0.5780091",
"0.5747783",
"0.5744701",
"0.5724034",
"0.5678288",
"0.56773025",
"0.5671592",
"0.56641436",
"0.5660265",
"0.56412756",
"0.5639194",
"0.5601914",
"0.55883193",
"0.55626523",
"0.55536115",
"0.555190... | 0.6527965 | 0 |
middle Your desired number, an Integer. first Your desired number, an Integer. last Your desired number, an Integer. between(7, 3, 10) => true Returns true or false, depending on if the middle number is between first and last. | def between(middle, first, last)
if first < middle and middle < last
return true
else
return false
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_middle(a,b,c)\n # 1. declare variable middle\n # 2. loop through and check if middle is greater than one and less than the other\n\n middle = a\n\n if (b > a && b < c) || (b < a && b > cc)\n middle = b\n elsif (c > a && c < b) || (c < a && c > b)\n middle = c\n end\n\n middle\n\nend",
"def ... | [
"0.7374904",
"0.6859561",
"0.68310523",
"0.6791948",
"0.67679095",
"0.67679095",
"0.672518",
"0.6694781",
"0.6525276",
"0.65194535",
"0.65020585",
"0.6394628",
"0.63704723",
"0.63547647",
"0.6344308",
"0.6336151",
"0.628091",
"0.6222681",
"0.61461794",
"0.6145478",
"0.6117805... | 0.80687016 | 0 |
Computes the value of the total distance in metres for this training row For this method, the result value does NOT include the times multiplier. Note also that this method will not consider any additional multiplier given by any training_group linked by this row. Training groups should be checked for existance and man... | def compute_distance
if exercise_rows
exercise_rows.sort_by_part_order.inject(0) do |sum, row|
actual_row_distance = row.compute_displayable_distance(distance).to_i
actual_row_distance = distance if actual_row_distance == 0
sum + actual_row_distance
end
else
distance
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def distance_calculator\n @trips.each do |trip|\n @total_distance += trip.distance.to_f\n end\n end",
"def total_distance\n distances = self.rides.map { |ride| ride.distance }\n distances.inject(:+).to_f\n end",
"def calculate_group_distance\n sum = 0.0\n @patterns.each { |pattern|\n ... | [
"0.6132788",
"0.5758798",
"0.57429725",
"0.5709101",
"0.57018834",
"0.5632082",
"0.55403334",
"0.55355155",
"0.5503712",
"0.5496502",
"0.5484971",
"0.54748285",
"0.5469825",
"0.54094535",
"0.54017866",
"0.54017866",
"0.53923047",
"0.5285906",
"0.52708566",
"0.52471095",
"0.51... | 0.61357933 | 0 |
Computes the esteemed total seconds of expected duration for this training row. For this method, the result value ALREADY includes the times multiplier. Field start_and_rest has the precedence on everything else, unless predefined exercise_row distances or start_and_rest values are specified. When the internal row dist... | def compute_total_seconds
exercise_seconds = exercise_rows.inject(0) do |sum, row|
sum + row.compute_total_seconds # (default: exclude pause from sum)
end
if exercise_seconds == 0 # Found zero esteemed duration (excluding pause) ?
if start_and_rest > 0
start_and_rest * times + (pause * t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_total_seconds(with_pause = false)\n if start_and_rest > 0\n start_and_rest\n else # Compute expected duration based on distance:\n result = ExerciseRow.esteem_time_in_seconds(distance)\n with_pause ? result + pause : result\n end\n end",
"def estimated_stop_time\n result =... | [
"0.6868191",
"0.5697926",
"0.5497394",
"0.5469851",
"0.54043853",
"0.5225562",
"0.51571256",
"0.51445305",
"0.51055855",
"0.5102905",
"0.50022835",
"0.50018406",
"0.49825615",
"0.49639732",
"0.49611646",
"0.49592197",
"0.49495268",
"0.4894675",
"0.4894105",
"0.4893825",
"0.48... | 0.6888837 | 0 |
Returns the file name of the jbuilder template. | def template_name
"#{self.class.name.split('::').last.underscore}.json.jbuilder"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def template_filename\n @template_filename ||= self.class.name.split('::').last + -'.html.erb'\n end",
"def path_to_template name\n \"#{JSPEC_ROOT}/templates/#{name}/.\"\n end",
"def template_name; end",
"def template_name; end",
"def template_file\n @template_file || \"#{path}/#{tem... | [
"0.77912915",
"0.76448965",
"0.7557321",
"0.7557321",
"0.74797326",
"0.74602723",
"0.73840344",
"0.7355598",
"0.7329581",
"0.72326523",
"0.7226759",
"0.71541595",
"0.71407574",
"0.7117972",
"0.70992005",
"0.7079908",
"0.70556825",
"0.6974794",
"0.69066215",
"0.68923056",
"0.6... | 0.78341573 | 0 |
POST /locataires POST /locataires.json | def create
@locataire = Locataire.new(locataire_params)
respond_to do |format|
if @locataire.save
format.html { redirect_to @locataire, notice: 'Locataire was successfully created.' }
format.json { render :show, status: :created, location: @locataire }
else
format.html { ren... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @locacao = Locacao.new(params[:locacao])\n\n respond_to do |format|\n if @locacao.save\n format.html { redirect_to @locacao, :notice => 'Locacao was successfully created.' }\n format.json { render :json => @locacao, :status => :created, :location => @locacao }\n else\n ... | [
"0.6669128",
"0.63536894",
"0.6344335",
"0.61385626",
"0.61106324",
"0.59548676",
"0.59183216",
"0.5896677",
"0.5839233",
"0.5831078",
"0.58299845",
"0.58069974",
"0.5793884",
"0.57921505",
"0.57836574",
"0.5776445",
"0.57705444",
"0.57422453",
"0.5736538",
"0.5736191",
"0.57... | 0.6847962 | 0 |
PATCH/PUT /locataires/1 PATCH/PUT /locataires/1.json | def update
respond_to do |format|
if @locataire.update(locataire_params)
format.html { redirect_to @locataire, notice: 'Locataire was successfully updated.' }
format.json { render :show, status: :ok, location: @locataire }
else
format.html { render :edit }
format.json { r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def update\n @locacao = Locacao.find(params[:id])\n\n respond_to do |format|\n if @locacao.update_attributes(params[:locacao])\n format.html { redirect_to @locacao, :notice => 'Locacao was successfully up... | [
"0.6555957",
"0.65293604",
"0.6435939",
"0.63883525",
"0.6354839",
"0.63020813",
"0.6270524",
"0.62290907",
"0.6169649",
"0.61516964",
"0.61137015",
"0.61137015",
"0.61074895",
"0.6070242",
"0.6035997",
"0.60116845",
"0.59973073",
"0.59867316",
"0.5954011",
"0.59430087",
"0.5... | 0.67115504 | 0 |
DELETE /locataires/1 DELETE /locataires/1.json | def destroy
@locataire.destroy
respond_to do |format|
format.html { redirect_to locataires_url, notice: 'Locataire was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n render json: Location.delete(params[\"id\"])\n end",
"def destroy\n @locacao = Locacao.find(params[:id])\n @locacao.destroy\n\n respond_to do |format|\n format.html { redirect_to locacaos_url }\n format.json { head :no_content }\n end\n end",
"def delete_json(path)\n ... | [
"0.69926697",
"0.69901687",
"0.69562536",
"0.6773432",
"0.6761241",
"0.6751841",
"0.67028123",
"0.6638399",
"0.6618178",
"0.6595379",
"0.65907264",
"0.65790063",
"0.65770215",
"0.6552799",
"0.65511394",
"0.65411526",
"0.6535478",
"0.6532908",
"0.6519891",
"0.65198004",
"0.651... | 0.7094291 | 0 |
PATCH/PUT /attendences/1 PATCH/PUT /attendences/1.json | def update
respond_to do |format|
if @attendence.update(attendence_params)
format.html { redirect_to @attendence, notice: 'Attendence was successfully updated.' }
format.json { render :show, status: :ok, location: @attendence }
else
format.html { render :edit }
format.jso... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @attendence = Attendence.find(params[:id])\n\n respond_to do |format|\n if @attendence.update_attributes(params[:attendence])\n format.html { redirect_to @attendence, notice: 'Attendence was successfully updated.' }\n format.json { head :no_content }\n else\n forma... | [
"0.69547284",
"0.6587345",
"0.6437814",
"0.64116305",
"0.6376408",
"0.6360369",
"0.63224345",
"0.631758",
"0.61693585",
"0.61252093",
"0.6094448",
"0.6029897",
"0.59814894",
"0.59610623",
"0.5959293",
"0.59412485",
"0.5932211",
"0.592706",
"0.5902705",
"0.589751",
"0.58957446... | 0.6965125 | 0 |
DELETE /attendences/1 DELETE /attendences/1.json | def destroy
@attendence.destroy
respond_to do |format|
format.html { redirect_to attendences_url, notice: 'Attendence was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @attendence = Attendence.find(params[:id])\n @attendence.destroy\n\n respond_to do |format|\n format.html { redirect_to attendences_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @attend = Attend.find(params[:id])\n @attend.destroy\n\n respond_... | [
"0.75460535",
"0.72314996",
"0.7088572",
"0.70854664",
"0.7023892",
"0.6977269",
"0.6946617",
"0.6918435",
"0.67916745",
"0.6735035",
"0.6735035",
"0.6730089",
"0.6689236",
"0.6671942",
"0.66416574",
"0.66416574",
"0.66209847",
"0.6609227",
"0.65812236",
"0.6543376",
"0.64810... | 0.73504597 | 1 |
GET user/:user_id/horses/1 GET user/:user_id/horses/1.json | def show
@user = User.find(params[:user_id])
@horse = @user.horses.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n if params.has_key?(:client_id)\n @client = Client.find(params[:client_id])\n @horses = @client.horses\n else\n \t\t@horses = Horse.all\n end\n end",
"def new\n @user = User.find(params[:user_id])\n @horse = @user.horses.new\n end",
"def show\n @horace = Horace.find(pa... | [
"0.720722",
"0.71524304",
"0.643665",
"0.633167",
"0.6225416",
"0.61256045",
"0.5965619",
"0.59496146",
"0.5945162",
"0.59440476",
"0.5883772",
"0.5883772",
"0.58793473",
"0.5848574",
"0.5788915",
"0.5778154",
"0.57375467",
"0.564995",
"0.5633047",
"0.5615278",
"0.55772513",
... | 0.77835804 | 0 |
GET user/:user_id/horses/new GET user/:user_id/horses/new.json | def new
@user = User.find(params[:user_id])
@horse = @user.horses.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @horace = Horace.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @horace }\n end\n end",
"def create\n \n @horario = Horario.new\n @horario.user_id = current_user.id if params[:new_record].present?\n @horario.update(horario_params... | [
"0.7117987",
"0.7074524",
"0.70131016",
"0.697894",
"0.6862647",
"0.6724994",
"0.669999",
"0.6614226",
"0.65724623",
"0.65595424",
"0.653023",
"0.6460772",
"0.63944703",
"0.63756984",
"0.6319657",
"0.63134855",
"0.62725526",
"0.6257802",
"0.62394494",
"0.61522275",
"0.6131059... | 0.83173496 | 0 |
POST user/:user_id/horses POST user/:user_id/horses.json | def create
@user = User.find(params[:user_id])
@horse = @user.horses.build(params[:horse])
@horse.active = false
respond_to do |format|
if @horse.save
format.html { redirect_to user_path(@user), notice: 'Horse was successfully created.' }
format.json { head :no_content }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @user = User.find(params[:user_id])\n @horse = @user.horses.new\n end",
"def create\n @client = Client.find(params[:client_id])\n @horse = @client.horses.create(horse_params)\n\n respond_to do |format|\n if @horse.save\n format.html { redirect_to client_horse_path(@client, @... | [
"0.7159089",
"0.6744941",
"0.65083027",
"0.6389807",
"0.6202332",
"0.6104943",
"0.6028099",
"0.5996222",
"0.5974382",
"0.58463424",
"0.57330143",
"0.5705834",
"0.56762356",
"0.5583076",
"0.55773836",
"0.55773836",
"0.5552183",
"0.5550099",
"0.5531631",
"0.54843587",
"0.544602... | 0.70781726 | 1 |
GET /dogparks/1 GET /dogparks/1.xml | def show
@dogpark = Dogpark.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @dogpark }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @pdig = Pdig.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pdig }\n end\n end",
"def show\n #NOT USING\n @puppy = Puppy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n forma... | [
"0.6273437",
"0.5807359",
"0.57942265",
"0.5779871",
"0.5660495",
"0.56576973",
"0.5654453",
"0.563015",
"0.563015",
"0.55889827",
"0.5577453",
"0.55541897",
"0.55436283",
"0.55298257",
"0.5522238",
"0.5513565",
"0.5501953",
"0.5471961",
"0.54650337",
"0.54615974",
"0.5457536... | 0.65623564 | 0 |
GET /dogparks/new GET /dogparks/new.xml | def new
@dogpark = Dogpark.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @dogpark }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @pdig = Pdig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pdig }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"def new\n @pet ... | [
"0.7241328",
"0.6697208",
"0.6644033",
"0.66415983",
"0.66401273",
"0.6424412",
"0.6404019",
"0.6365122",
"0.6365122",
"0.6340467",
"0.63356626",
"0.6307211",
"0.6271558",
"0.6266033",
"0.6249445",
"0.62281334",
"0.62176716",
"0.61864835",
"0.61783797",
"0.6171421",
"0.616629... | 0.71676123 | 1 |
POST /dogparks POST /dogparks.xml | def create
@dogpark = Dogpark.new(params[:dogpark])
respond_to do |format|
if @dogpark.save
format.html { redirect_to(@dogpark, :notice => 'Dogpark was successfully created.') }
format.xml { render :xml => @dogpark, :status => :created, :location => @dogpark }
else
format.h... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @pdig = Pdig.new(params[:pdig])\n\n respond_to do |format|\n if @pdig.save\n flash[:notice] = 'Pdig was successfully created.'\n format.html { redirect_to(@pdig) }\n format.xml { render :xml => @pdig, :status => :created, :location => @pdig }\n else\n forma... | [
"0.630659",
"0.5656379",
"0.54984456",
"0.549807",
"0.5490063",
"0.54368573",
"0.5431351",
"0.5385645",
"0.53516906",
"0.53087854",
"0.5305931",
"0.5305931",
"0.5305931",
"0.5299723",
"0.52912146",
"0.52790934",
"0.5261514",
"0.5261514",
"0.5261514",
"0.5261514",
"0.5261514",... | 0.6387017 | 0 |
PUT /dogparks/1 PUT /dogparks/1.xml | def update
@dogpark = Dogpark.find(params[:id])
respond_to do |format|
if @dogpark.update_attributes(params[:dogpark])
format.html { redirect_to(@dogpark, :notice => 'Dogpark was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def update(id, name=\"Updated Name\", age=\"55\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <id type='integer'>#{id}</id>\r\n ... | [
"0.61333585",
"0.60298914",
"0.59832346",
"0.5875693",
"0.58711064",
"0.57446516",
"0.57014185",
"0.57014185",
"0.57014185",
"0.5677083",
"0.5674188",
"0.5674188",
"0.5674188",
"0.5674188",
"0.5674188",
"0.5674188",
"0.5674188",
"0.5674188",
"0.5599858",
"0.5599858",
"0.55934... | 0.61059266 | 1 |
DELETE /dogparks/1 DELETE /dogparks/1.xml | def destroy
@dogpark = Dogpark.find(params[:id])
@dogpark.destroy
respond_to do |format|
format.html { redirect_to(dogparks_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @pdig = Pdig.find(params[:id])\n @pdig.destroy\n\n respond_to do |format|\n format.html { redirect_to(pdigs_url) }\n format.xml { head :ok }\n end\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or respo... | [
"0.6821461",
"0.668484",
"0.6566037",
"0.6526896",
"0.65108514",
"0.64349335",
"0.6377853",
"0.63570774",
"0.6349936",
"0.63486844",
"0.6335336",
"0.63315684",
"0.6323181",
"0.63206124",
"0.6306111",
"0.62947506",
"0.62935716",
"0.6290433",
"0.62792075",
"0.62784654",
"0.6257... | 0.6868745 | 0 |
GET /pending_months/1 GET /pending_months/1.xml | def show
@pending_month = PendingMonth.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @pending_month }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @pending_month = PendingMonth.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pending_month }\n end\n end",
"def index\n @time = Time.new\n @prev_time = @time - 1.month\n @next_time = @time + 1.month\n @months = [@prev_time, @t... | [
"0.67941666",
"0.63948196",
"0.6312492",
"0.6242757",
"0.60790694",
"0.606153",
"0.59604436",
"0.59148186",
"0.5891926",
"0.5872082",
"0.5858284",
"0.5854311",
"0.5846659",
"0.58232963",
"0.58156085",
"0.5730452",
"0.5702568",
"0.56971496",
"0.5679846",
"0.5675857",
"0.566607... | 0.72063005 | 0 |
GET /pending_months/new GET /pending_months/new.xml | def new
@pending_month = PendingMonth.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @pending_month }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @month = Month.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @month }\n end\n end",
"def create\n @pending_month = PendingMonth.new(params[:pending_month])\n\n respond_to do |format|\n if @pending_month.save\n flash[:not... | [
"0.73299456",
"0.7173324",
"0.68623424",
"0.6828205",
"0.66370565",
"0.65677",
"0.65437806",
"0.6500321",
"0.6434159",
"0.63324517",
"0.6322184",
"0.6263125",
"0.6246948",
"0.62350947",
"0.6205143",
"0.61928785",
"0.61553574",
"0.61345834",
"0.6129659",
"0.6106351",
"0.609616... | 0.7958593 | 0 |
POST /pending_months POST /pending_months.xml | def create
@pending_month = PendingMonth.new(params[:pending_month])
respond_to do |format|
if @pending_month.save
flash[:notice] = 'PendingMonth was successfully created.'
format.html { redirect_to(@pending_month) }
format.xml { render :xml => @pending_month, :status => :created... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def monthlyinvreq_params\n params.require(:monthlyinvreq).permit(:month, :start, :due, :sitetype_id)\n end",
"def month_params\n params.require(:month).permit(:month, :status)\n end",
"def new\n @pending_month = PendingMonth.new\n\n respond_to do |format|\n format.html # new.html.erb... | [
"0.6386507",
"0.63509345",
"0.6244099",
"0.61854875",
"0.60256505",
"0.59298635",
"0.5871502",
"0.57909214",
"0.5788808",
"0.5786392",
"0.5779445",
"0.577413",
"0.5766779",
"0.5737787",
"0.5713853",
"0.5708982",
"0.5700354",
"0.5646433",
"0.55870605",
"0.554781",
"0.553498",
... | 0.6806232 | 0 |
PUT /pending_months/1 PUT /pending_months/1.xml | def update
@pending_month = PendingMonth.find(params[:id])
respond_to do |format|
if @pending_month.update_attributes(params[:pending_month])
flash[:notice] = 'PendingMonth was successfully updated.'
format.html { redirect_to(@pending_month) }
format.xml { head :ok }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @month = Month.find(params[:id])\n\n respond_to do |format|\n if @month.update_attributes(params[:month])\n format.html { redirect_to([:admin, @month], :notice => 'Month was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action ... | [
"0.62494403",
"0.6132465",
"0.6099554",
"0.60565156",
"0.5945345",
"0.5848942",
"0.583396",
"0.5802033",
"0.5798157",
"0.5745545",
"0.574107",
"0.5731459",
"0.57027364",
"0.5693807",
"0.5665935",
"0.56528866",
"0.56406796",
"0.5636859",
"0.563499",
"0.5593013",
"0.55457413",
... | 0.70591426 | 0 |
DELETE /pending_months/1 DELETE /pending_months/1.xml | def destroy
@pending_month = PendingMonth.find(params[:id])
@pending_month.destroy
respond_to do |format|
format.html { redirect_to(pending_months_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @month = Month.find(params[:id])\n @month.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_months_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @m_keep_month = MKeepMonth.find(params[:id])\n @m_keep_month.destroy\n\n respond_to do... | [
"0.6779848",
"0.6245791",
"0.62301046",
"0.6157528",
"0.60899144",
"0.60773283",
"0.5989097",
"0.5987578",
"0.5905113",
"0.58994734",
"0.58989716",
"0.58825636",
"0.58715147",
"0.5864588",
"0.5847589",
"0.58449996",
"0.5829599",
"0.5824214",
"0.5802241",
"0.5801917",
"0.57949... | 0.7157578 | 0 |
GET /exchanges/1 GET /exchanges/1.json | def show
@exchange = Exchange.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @exchange }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exchange(id)\n get \"exchanges/#{id}\"\n end",
"def exchanges\n @exchanges ||= {}\n end",
"def exchanges\n @channel.exchanges\n end",
"def getAll(url)\n exchanges = []\n begin\n open(url) do |d|\n json = JSON.parse(d.read)\n json.each do |a|\n exc... | [
"0.7214432",
"0.64250326",
"0.635754",
"0.620256",
"0.61911505",
"0.6191078",
"0.6159085",
"0.61335444",
"0.6077081",
"0.60019565",
"0.5917493",
"0.58814645",
"0.58797705",
"0.5874665",
"0.5754847",
"0.57539463",
"0.5697823",
"0.56782085",
"0.56569004",
"0.56408685",
"0.56116... | 0.65450305 | 1 |
GET /exchanges/new GET /exchanges/new.json | def new
@exchange = Exchange.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @exchange }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @users_exchange = UsersExchange.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @users_exchange }\n end\n end",
"def new\n @breadcrumb = 'create'\n @currency = Currency.new\n\n respond_to do |format|\n format.html # new.... | [
"0.66969436",
"0.6417885",
"0.6407357",
"0.6280651",
"0.6241979",
"0.62133193",
"0.6195585",
"0.61541146",
"0.6128427",
"0.6121471",
"0.6091531",
"0.60473186",
"0.60349387",
"0.6025988",
"0.6018282",
"0.6015672",
"0.60144293",
"0.60068184",
"0.5982297",
"0.5965384",
"0.596538... | 0.7489816 | 0 |
POST /exchanges POST /exchanges.json | def create
@exchange = Exchange.new(params[:exchange])
respond_to do |format|
if @exchange.save
format.html { redirect_to @exchange, notice: 'Exchange was successfully created.' }
format.json { render json: @exchange, status: :created, location: @exchange }
else
format.html ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @exchange = Exchange.new(exchange_params)\n\n respond_to do |format|\n if @exchange.save\n format.html { redirect_to @exchange, notice: 'Exchange was successfully created.' }\n format.json { render :show, status: :created, location: @exchange }\n else\n format.html... | [
"0.62054443",
"0.5928103",
"0.58490944",
"0.57180804",
"0.56513256",
"0.564944",
"0.5645176",
"0.5620533",
"0.5593602",
"0.55750275",
"0.5508993",
"0.54670537",
"0.54567766",
"0.53861976",
"0.53816503",
"0.53480804",
"0.5332872",
"0.53313595",
"0.5322871",
"0.53135943",
"0.53... | 0.6292267 | 0 |
PUT /exchanges/1 PUT /exchanges/1.json | def update
@exchange = Exchange.find(params[:id])
respond_to do |format|
if @exchange.update_attributes(params[:exchange])
format.html { redirect_to @exchange, notice: 'Exchange was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @exchange.update(exchange_params)\n format.html { redirect_to @exchange, notice: 'Exchange was successfully updated.' }\n format.json { render :show, status: :ok, location: @exchange }\n else\n format.html { render :edit }\n format.j... | [
"0.6019046",
"0.5999387",
"0.5999387",
"0.59663904",
"0.58803827",
"0.5742231",
"0.5624289",
"0.5568069",
"0.55315346",
"0.5415472",
"0.5415472",
"0.5415472",
"0.5415472",
"0.5415472",
"0.5415472",
"0.54081213",
"0.53126186",
"0.5281104",
"0.5281104",
"0.5245404",
"0.5224319"... | 0.63321996 | 0 |
DELETE /exchanges/1 DELETE /exchanges/1.json | def destroy
@exchange = Exchange.find(params[:id])
@exchange.destroy
respond_to do |format|
format.html { redirect_to exchanges_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @exchange = Exchange.find(params[:id])\n @exchange.destroy\n\n respond_to do |format|\n format.html { redirect_to(exchanges_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @exchange = Exchange.find(params[:id])\n @exchange.destroy\n\n respond_to do |fo... | [
"0.71533954",
"0.71533954",
"0.7002751",
"0.6902722",
"0.67515224",
"0.65545356",
"0.6483669",
"0.63865656",
"0.6340901",
"0.6317946",
"0.62975746",
"0.62717056",
"0.6264545",
"0.6264545",
"0.6264545",
"0.6264545",
"0.6259132",
"0.6245559",
"0.62349164",
"0.62296313",
"0.6222... | 0.7466245 | 0 |
Merges two identical states (they had better be identical) | def mergeStates(state1, state2)
#p state1
#p state2
@states.each_value{ |s|
s.transitions.each{ |t|
if t.nextState == state2
t.nextState = state1
end
}
}
@states.delete state2
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merge( otherstate )\n\t\tmerged = self.dup\n\t\tmerged.merge!( otherstate )\n\t\treturn merged\n\tend",
"def merge(otherMachine)\n\t\t@states.merge!(otherMachine.states)\n\tend",
"def merge(otherMachine)\n\t\t@states.merge!(otherMachine.states)\n\tend",
"def merge!( otherstate )\n\t\t@scopes.push( @scope... | [
"0.755208",
"0.7155386",
"0.7155386",
"0.6941982",
"0.67525584",
"0.67525584",
"0.67081076",
"0.67081076",
"0.6561699",
"0.6504094",
"0.6502791",
"0.6451152",
"0.6375329",
"0.6301342",
"0.62936544",
"0.62859166",
"0.6241363",
"0.61639476",
"0.615627",
"0.61105514",
"0.6057616... | 0.77239424 | 0 |
Determines if this transition's conditions are met by machine | def match(machine)
@conditions.each_key{ |k|
unless machine.tapes[k].read == @conditions[k]
return false
end
}
return true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transition_choice?\n matching = machine.transitions[name]\n [matching[from_state], matching[ANY_STATE]].any? do |match|\n match.is_a?(Array)\n end\n end",
"def solvable?\n steps > 0\n end",
"def can_walk_to?(transition); end",
"def in_decision\n return @decision_level > ... | [
"0.64741725",
"0.63233006",
"0.6310617",
"0.6248928",
"0.6216431",
"0.61626965",
"0.6159044",
"0.61227757",
"0.6121316",
"0.6119225",
"0.6072833",
"0.60722303",
"0.6071453",
"0.60528827",
"0.6023115",
"0.60009146",
"0.59940946",
"0.59305197",
"0.59019893",
"0.589623",
"0.5764... | 0.6552854 | 0 |
Performs the actions associated with this transition, returning the next state | def do(machine)
@actions.each{ |a| a.perform machine }
return @nextState
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def execState\n findNextState\n current_state = @state_list[@state][@transition]\n\n @transition = eval \"#{@state}\"\n @history.push @state\n\n @finished = @state == :finish\n end",
"def next_action\n # puts \"Sequence#next_action\"\n reset_cur_action_repeat\n @action_index ... | [
"0.7041549",
"0.66544324",
"0.6604739",
"0.6472166",
"0.6458372",
"0.6273343",
"0.6224994",
"0.62200665",
"0.6194779",
"0.6114598",
"0.61074096",
"0.6105316",
"0.60831517",
"0.6036366",
"0.5998649",
"0.5982978",
"0.59793586",
"0.5978386",
"0.5975806",
"0.5947462",
"0.5906662"... | 0.7141578 | 0 |
There is a long standing bug that causes supervisord to always exit with return code 0. So we have to ensure a process is stopped when disabling and and enabled when starting. supervisorctl throws a silent error when starting disabled services and disabling running services | def disable
self.stop if self.status == :running
output = supervisorctl(:remove, @resource[:name])
rescue Puppet::ExecutionFailure
raise Puppet::Error, "Could not disable #{self.name}: #{output}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ensure_running\n agent_status = `service logicmonitor-agent status`\n if agent_status.include?(\"not running\")\n puts \"LogicMonitor collector isn't running\"\n puts `service logicmonitor-agent start`\n else\n puts \"LogicMonitor collector is running\"\n end\n\n watchdog_status = `service logicm... | [
"0.64105207",
"0.63812894",
"0.63247883",
"0.61618894",
"0.6054701",
"0.6037833",
"0.59838253",
"0.5977564",
"0.59435964",
"0.59373134",
"0.5929269",
"0.5927521",
"0.5924464",
"0.59175074",
"0.59041995",
"0.58569026",
"0.5853512",
"0.58431476",
"0.582511",
"0.5814773",
"0.581... | 0.6713177 | 0 |
GET /scientific_works/1 GET /scientific_works/1.json | def show
@scientific_work = ScientificWork.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @scientific_work }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @works = Work.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @works }\n end\n end",
"def index\n @works = Work.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @works }\n end\n... | [
"0.6988542",
"0.6988542",
"0.68639886",
"0.6797034",
"0.6605106",
"0.654655",
"0.65364015",
"0.65344274",
"0.65231556",
"0.651291",
"0.6491604",
"0.6465145",
"0.6446731",
"0.64330155",
"0.64330155",
"0.64302063",
"0.6426542",
"0.6387507",
"0.6387507",
"0.6335699",
"0.63096035... | 0.7330636 | 0 |
POST /scientific_works POST /scientific_works.json | def create
@scientific_work = ScientificWork.new(params[:scientific_work])
respond_to do |format|
if @scientific_work.save
format.html { redirect_to @scientific_work, notice: 'Scientific work was successfully created.' }
format.json { render json: @scientific_work, status: :created, l... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @scientific_work = ScientificWork.new(scientific_work_params)\n\n respond_to do |format|\n if @scientific_work.save\n format.html { redirect_to @scientific_work, notice: 'Scientific work was successfully created.' }\n format.json { render :show, status: :created, location: @sc... | [
"0.70823014",
"0.6517808",
"0.63280886",
"0.63039285",
"0.6150802",
"0.6150802",
"0.6126411",
"0.6126411",
"0.605082",
"0.60485965",
"0.60171586",
"0.600364",
"0.59935236",
"0.59834796",
"0.5972177",
"0.5938418",
"0.59129924",
"0.5896537",
"0.5879215",
"0.5873693",
"0.5860389... | 0.7050197 | 1 |
PUT /scientific_works/1 PUT /scientific_works/1.json | def update
@scientific_work = ScientificWork.find(params[:id])
respond_to do |format|
if @scientific_work.update_attributes(params[:scientific_work])
format.html { redirect_to @scientific_work, notice: 'Scientific work was successfully updated.' }
format.json { head :no_content }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @scientific_work.update(scientific_work_params)\n format.html { redirect_to @scientific_work, notice: 'Scientific work was successfully updated.' }\n format.json { render :show, status: :ok, location: @scientific_work }\n else\n format.html... | [
"0.687694",
"0.6026194",
"0.6000741",
"0.5987061",
"0.5977905",
"0.59708357",
"0.5950416",
"0.59344053",
"0.59344053",
"0.59344053",
"0.59344053",
"0.59305316",
"0.59280354",
"0.59185827",
"0.59063363",
"0.5901426",
"0.5898483",
"0.5883264",
"0.58765346",
"0.58765346",
"0.587... | 0.68530643 | 1 |
and replaces the unitary entity id with the airloop id. | def resolve_unitary_and_air_loops_overlap(entities)
handles_to_swap = {}
@model.getAirLoopHVACs.each do |air_loop|
air_loop.supplyComponents.each do |sc|
unitary_system = check_if_component_is_unitary(sc)
if unitary_system
if unitary_system.airLoopHVAC.is_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assign_id\n Sufia::IdService.mint if Sufia.config.enable_noids\n end",
"def add_dummy_update_id\n add_dummy_create_id\n end",
"def novelVehicleId()\n begin\n newId = (\"#{@vehicleIdPrefix}_#{@vehicleIdNumberingFormat}\" %\n @vehicleIdCounter) ;\n @vehi... | [
"0.59381706",
"0.57070965",
"0.5690164",
"0.5647962",
"0.5557552",
"0.55481714",
"0.55481714",
"0.55435604",
"0.55005026",
"0.5498813",
"0.54796404",
"0.54788",
"0.54689854",
"0.5433296",
"0.5384428",
"0.5383513",
"0.53822637",
"0.53607136",
"0.5355195",
"0.53309673",
"0.5320... | 0.5783817 | 1 |
setting the formula inputs to a defined model | def formula_inputs=(value)
unless value.nil?
self[:formula_inputs] = value.map{|formula| Calculated::Models::FormulaInput.new(formula)}
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_formula\n @formula = Formula.find(params[:id])\n end",
"def set_formula\n @formula = Formula.find(params[:id])\n end",
"def set_model_input\n @model_input = ModelInput.find(params[:id])\n end",
"def set_formula\n @formula = @form.formulas.find(params[:id])\n end",
"def m... | [
"0.6555351",
"0.65452045",
"0.6528017",
"0.65012956",
"0.64718115",
"0.64718115",
"0.64718115",
"0.64718115",
"0.6033397",
"0.6033397",
"0.59604603",
"0.58909124",
"0.5845756",
"0.58043015",
"0.5788425",
"0.5782019",
"0.56979406",
"0.56526864",
"0.5620724",
"0.5602363",
"0.55... | 0.69842166 | 0 |
PUT /modelos/1 PUT /modelos/1.xml | def update
@modelo = Modelo.find(params[:id])
respond_to do |format|
if @modelo.update_attributes(params[:modelo])
format.html { redirect_to(@modelo, :notice => 'Modelo fue actualizado satisfactoriamente') }
format.xml { head :ok }
else
format.html { render :action => "edit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rm_update path, data, msg\n\n re = rm_request path, data, 'PUT'\n puts re.body\n chk (re.code!='200'), msg + \"\\n#{re.code} #{re.msg}\\n\\n\"\n return true\n\nend",
"def update\n @title = \"EDITAR WMI NAMESPACE\"\n @wmi_namespace = WmiNamespace.find(params[:id])\n\n respond_to do |format|\n ... | [
"0.5501612",
"0.52918816",
"0.5197527",
"0.5158417",
"0.5139896",
"0.5104559",
"0.50829685",
"0.5074678",
"0.50502205",
"0.5035107",
"0.4988707",
"0.49453694",
"0.49415657",
"0.49386263",
"0.49332708",
"0.49314728",
"0.4930525",
"0.4928577",
"0.4924084",
"0.49190414",
"0.4918... | 0.5430723 | 1 |
POST /festivals POST /festivals.json | def create
@festival = Festival.new(params[:festival])
respond_to do |format|
if @festival.save
format.html { redirect_to '/admin', notice: 'Festival was successfully created.' }
else
format.html { render action: "new" }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @festival = Festival.create(festival_params)\n if @festival.valid?\n redirect_to @festival\n else\n flash[:errors] = @festival.errors.full_messages\n redirect_to new_festival_path\n end\n\n\n\n # respond_to do |format|\n # if @festival.save\n # format.html { r... | [
"0.661322",
"0.6368782",
"0.6253742",
"0.619954",
"0.6195518",
"0.61592007",
"0.6052588",
"0.59991795",
"0.5983727",
"0.5981105",
"0.5976512",
"0.5939704",
"0.59309125",
"0.5911357",
"0.59031624",
"0.589842",
"0.5894302",
"0.58752847",
"0.58668417",
"0.5838012",
"0.5837616",
... | 0.6683555 | 0 |
PUT /festivals/1 PUT /festivals/1.json | def update
@festival = Festival.find(params[:id])
respond_to do |format|
if @festival.update_attributes(params[:festival])
format.html { redirect_to @festival, notice: 'Festival was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @festival.update(festival_params)\n format.html { redirect_to @festival, notice: 'Festival was successfully updated.' }\n format.json { render :show, status: :ok, location: @festival }\n else\n format.html { render :edit }\n format.j... | [
"0.7140876",
"0.6894596",
"0.6841767",
"0.66465265",
"0.6477632",
"0.6366684",
"0.6237664",
"0.6220263",
"0.62114275",
"0.62114275",
"0.62114275",
"0.6211047",
"0.61867577",
"0.6162089",
"0.614637",
"0.614232",
"0.6111137",
"0.60902613",
"0.6089713",
"0.6086577",
"0.60813797"... | 0.72275513 | 0 |
DELETE /festivals/1 DELETE /festivals/1.json | def destroy
@festival = Festival.find(params[:id])
@festival.destroy
respond_to do |format|
format.html { redirect_to festivals_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @festival.destroy\n respond_to do |format|\n format.html { redirect_to festivals_url, notice: 'Festival was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @frat.destroy\n respond_to do |format|\n format.html { redirect_to fr... | [
"0.74480045",
"0.7024117",
"0.69478697",
"0.68706083",
"0.68706083",
"0.68482685",
"0.6847568",
"0.68170345",
"0.68143296",
"0.6794469",
"0.6782666",
"0.6779694",
"0.67744726",
"0.67744726",
"0.67744726",
"0.6772122",
"0.67716134",
"0.6727132",
"0.67070097",
"0.6703469",
"0.6... | 0.7707062 | 0 |
returns a 2D array that contains the extracted data from the pdf . 2D table is prepared by spliting the raw text using regex | def prepare_data
table=Array.new
flag=true
flag2=false
count=0
@reader.pages.each_with_index do |page,i|
break if i >= @page
#(?!([a-zA-Z\-0-9]+))
#text = page.text.gsub(/\n\s{1}+[0-9]{1}+,[0-9]\s{1}+/,' ')
rows=page.text.split(/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse\n @table = []\n rows = @doc.split(/\\r?\\n/)\n rows.each do |row|\n row_array = row.split(\"|\")\n row_array.each(&:strip!)\n @table.push(row_array)\n end\n @table.delete_at(1) if @header # strip header separator\n @table\n end",
"def build_ocr_arr\... | [
"0.61749274",
"0.6166414",
"0.6030761",
"0.5998639",
"0.58752805",
"0.58020437",
"0.5623148",
"0.5585997",
"0.5571276",
"0.55646133",
"0.5549392",
"0.5525285",
"0.549675",
"0.545217",
"0.54513514",
"0.54367745",
"0.5412953",
"0.53745705",
"0.5369849",
"0.53555167",
"0.5351034... | 0.6274006 | 0 |
returns the formated name by appending the current time stamp Used for for setting the CSV file Name | def get_name(name)
name+"_#{get_time_stamp}.xlsx"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filename\n current_time = Time.new\n formatted_current_time = current_time.strftime(\"%Y%m%d_%H%M%S\")\n formatted_current_time + \"_\" + original_filename\n end",
"def filename\n current_time = Time.new\n formatted_current_time = current_time.strftime(\"%Y%m%d_%H%M%S\")\n formatted_curren... | [
"0.738692",
"0.738692",
"0.71788293",
"0.71206975",
"0.69906825",
"0.6959951",
"0.68910915",
"0.67739266",
"0.6731013",
"0.66880345",
"0.66560686",
"0.6621465",
"0.6605309",
"0.6552227",
"0.6538917",
"0.65318114",
"0.6513192",
"0.64964116",
"0.64615494",
"0.64206916",
"0.6398... | 0.76597315 | 0 |
Saves game in yaml file in 'save_game' directory | def save_game
Dir.mkdir('saved_games') unless Dir.exist? 'saved_games'
Dir.chdir("saved_games")
data = save
File.open("save.yaml", "w") do |file|
saved_games = YAML::dump(data)
file.write(saved_games)
end
puts "Games Saved!!"
abort
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save(game)\n\t\tprint \"Name the save: \"\n\t\tsave_name = gets.chomp.downcase\n\t\tDir.mkdir \"saves\" unless Dir.exists? \"saves\"\n\t\tfile_path = File.join(\"saves\", \"#{save_name}\")\n\t\tFile.open(file_path, \"w\") { |f|\n\t\t\tf.write(YAML.dump(game))\n\t\t}\n\t\tputs \"The game has been saved!\"\n\ten... | [
"0.88493776",
"0.8787855",
"0.87282187",
"0.87070316",
"0.85822856",
"0.8564293",
"0.8462079",
"0.8439143",
"0.84383243",
"0.8325493",
"0.8321411",
"0.8255611",
"0.8247058",
"0.8196367",
"0.80966693",
"0.8072245",
"0.80273813",
"0.795382",
"0.7913827",
"0.7683845",
"0.7639106... | 0.896283 | 0 |
Subscribes the given block to the on_next action of the observable sequence. | def subscribe_on_next
obs = RX::Observer.configure do |o|
o.on_next yield
end
self.subscribe obs
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start(&block)\n loop do\n event_data = self.next\n block.(event_data)\n end\n end",
"def on_next(value)\n @target.on_next(value)\n @taken += 1\n on_complete if @taken == @count\n end",
"def subscribe(&onMessage) # block\n end",
"def generate_next\n @block.... | [
"0.5816756",
"0.5774452",
"0.5734805",
"0.5707389",
"0.56827015",
"0.5654945",
"0.563708",
"0.5571424",
"0.55558777",
"0.55396247",
"0.546901",
"0.5463704",
"0.54107386",
"0.54107386",
"0.54107386",
"0.54107386",
"0.54107386",
"0.54107386",
"0.54107386",
"0.54107386",
"0.5410... | 0.6815665 | 0 |
Compile +spec+ and interpret +argv+. Returns a tuple of a ShellOpts::Program and ShellOpts::Args object | def process(spec, argv)
compile(spec)
interpret(argv)
self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compile(spec)\n handle_exceptions {\n @oneline = spec.index(\"\\n\").nil?\n @spec = spec.sub(/^\\s*\\n/, \"\")\n @file = find_caller_file\n @tokens = Lexer.lex(name, @spec, @oneline)\n ast = Parser.parse(tokens)\n\n help_spec = (@help == true ? \"-h,help\" : @help... | [
"0.62561876",
"0.56228083",
"0.56228083",
"0.56228083",
"0.5485061",
"0.5420207",
"0.54182386",
"0.5390286",
"0.5352189",
"0.5343411",
"0.53353024",
"0.5330294",
"0.53232163",
"0.5290739",
"0.5265389",
"0.52192885",
"0.51789206",
"0.51643515",
"0.51643515",
"0.5152094",
"0.51... | 0.63950133 | 0 |
Write short usage and error message to standard error and terminate program with status 1 error is supposed to be used when the user made an error and the usage is written to help correcting the error | def error(subject = nil, message)
$stderr.puts "#{name}: #{message}"
saved = $stdout
begin
$stdout = $stderr
Formatter.usage(grammar)
exit 1
ensure
$stdout = saved
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def usage_error\n $stderr.printf(\"%s\\n\", usage)\n exit(-1)\n end",
"def print_error\n puts @error_text if @error_text\n print_usage\n end",
"def error(message) puts(message) || exit end",
"def error\n\t\tputs \"*********************\"\n\t\tputs \"<ERROR> Invalid input\"\n\t... | [
"0.7967213",
"0.7223186",
"0.72019756",
"0.7104208",
"0.70963717",
"0.70561755",
"0.70358247",
"0.7031421",
"0.6995337",
"0.69925135",
"0.69666207",
"0.6950049",
"0.6934264",
"0.69156593",
"0.6904201",
"0.6896569",
"0.68935287",
"0.6886125",
"0.68772775",
"0.6861495",
"0.6819... | 0.7424643 | 1 |
Print help for the given subject or the full documentation if +subject+ is nil. Clears the screen beforehand if :clear is true | def help(subject = nil, clear: true)
node = (subject ? @grammar[subject] : @grammar) or
raise ArgumentError, "No such command: '#{subject&.sub(".", " ")}'"
print '[H[2J' if clear
Formatter.help(node)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print\n puts @subject\n puts @text\n end",
"def show\n @subject = get_subject\n end",
"def help\r\n\tputs \"-to add new student: add student\"\r\n\tputs \"-to display all students: display students\"\r\n\tputs \"-to display all subjects: display subjects\"\r\n\tputs \"-to update a gr... | [
"0.5577179",
"0.5396457",
"0.5352516",
"0.5320244",
"0.5253893",
"0.52018297",
"0.5152108",
"0.51463675",
"0.5134308",
"0.5109166",
"0.50944114",
"0.50653064",
"0.5048635",
"0.5035353",
"0.50122654",
"0.5004405",
"0.49964342",
"0.4981555",
"0.4978565",
"0.49775842",
"0.497758... | 0.7164907 | 0 |
Converts the date to another calendar system. | def convert_to(calendar)
Date.new(calendar, self)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def alt_to_calendar(date)\n y = to_calendar(gregorian_epoch - 1 + date + 306)\n prior_days = date - to_fixed(date(y - 1, MARCH, 1))\n month = amod(quotient(5 * prior_days + 2, 153) + 3, 12)\n year = y - quotient(month + 9, 12)\n day = date - to_fixed(date(year, month, 1)) + 1\... | [
"0.6840804",
"0.66897243",
"0.6674951",
"0.6436615",
"0.6394003",
"0.5869187",
"0.5731753",
"0.55779576",
"0.5433348",
"0.543022",
"0.5361392",
"0.53567636",
"0.53486073",
"0.53486073",
"0.53349924",
"0.53344333",
"0.53128475",
"0.52995044",
"0.5271819",
"0.5264063",
"0.52628... | 0.7370333 | 0 |
Add "id" in url to match with current record | def inject_url(url, record)
url.gsub(%r{(/id/?)}, "/#{record.id}/")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lookup_url\n @config.lookup_opts[:url].sub('$:id$', @params[:id].to_s)\n end",
"def id\n @id || @url\n end",
"def url_id\n id\n end",
"def id\n object.to_param\n end",
"def to_param\n if url\n url.gsub(/[\\/\\ \\.]/,'-')+\"-\"+id.to_s\n end\n end",
"def... | [
"0.70280474",
"0.6758765",
"0.66697985",
"0.664682",
"0.66285586",
"0.6566043",
"0.64710486",
"0.6391591",
"0.63830054",
"0.6376161",
"0.63709426",
"0.63667256",
"0.63311905",
"0.63311905",
"0.63311905",
"0.6321523",
"0.63162315",
"0.63091075",
"0.6294726",
"0.6289632",
"0.62... | 0.70177346 | 1 |
True if evaluation has already occurred Always true for dumb values. Only true for callables after they are evaluated the first time. | def evaluated?
if @promise.respond_to? :call or @promise.is_a? Symbol
not @value.nil?
else
true
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def evaluated?; @__evaluated end",
"def evaluate?\n false\n end",
"def evaluate?\n false\n end",
"def evaluable?\n true\n end",
"def run_once?\n !!@run\n end",
"def be_truthful\n 42\n true # The last expression is always the one that gets returned\nend",
"de... | [
"0.724062",
"0.71368575",
"0.71368575",
"0.6864391",
"0.654071",
"0.6476958",
"0.6420826",
"0.64201194",
"0.64201194",
"0.64201194",
"0.63354707",
"0.6255241",
"0.62048244",
"0.6159649",
"0.6154635",
"0.60877126",
"0.60648465",
"0.60363114",
"0.6026319",
"0.6015806",
"0.59749... | 0.76942676 | 0 |
328. Odd Even Linked List Given a singly linked list, group all odd nodes together followed by the even nodes. | def odd_even_list
return @head if @head.nil?
odd = @head
even = odd.next
while even && even.next
head2 = odd.next
odd.next = even.next
even.next = even.next.next
odd.next.next = head2
odd = odd.next
even = even.next
end
@head
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def odd_even_list(head)\n\treturn if head == nil\n odd = head\n even = odd.next\n even_head = even\n while even != nil && even.next != nil do\n \todd.next = even.next\n \todd = odd.next\n \teven.next = odd.next\n \teven = even.next\n end\n odd.next = even_head\n head\nend",
"def ... | [
"0.79624283",
"0.7602343",
"0.75980616",
"0.71109426",
"0.68392813",
"0.6613551",
"0.64162445",
"0.62788457",
"0.6225871",
"0.61052555",
"0.6081642",
"0.60739803",
"0.59877783",
"0.59775126",
"0.59514695",
"0.5934082",
"0.5930805",
"0.58834493",
"0.5834633",
"0.58225626",
"0.... | 0.80892086 | 0 |
GET /radio_performances GET /radio_performances.json | def index
@radio_performances = RadioPerformance.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_radio_performance\n @radio_performance = RadioPerformance.find(params[:id])\n end",
"def radio_performance_params\n params.require(:radio_performance).permit(:performance_id, :radio, :time)\n end",
"def create\n @radio_performance = RadioPerformance.new(radio_performance_params)\n\n ... | [
"0.7091148",
"0.6648359",
"0.65785986",
"0.64213014",
"0.6344136",
"0.62416923",
"0.6225709",
"0.61721236",
"0.60430324",
"0.5994102",
"0.5761894",
"0.56935567",
"0.56829625",
"0.5604137",
"0.55595905",
"0.55348086",
"0.5520931",
"0.5505296",
"0.5457859",
"0.54523706",
"0.544... | 0.7611596 | 0 |
POST /radio_performances POST /radio_performances.json | def create
@radio_performance = RadioPerformance.new(radio_performance_params)
respond_to do |format|
if @radio_performance.save
format.html { redirect_to @radio_performance, notice: 'Radio performance was successfully created.' }
format.json { render :show, status: :created, location: @r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def radio_performance_params\n params.require(:radio_performance).permit(:performance_id, :radio, :time)\n end",
"def set_radio_performance\n @radio_performance = RadioPerformance.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @radio_performance.update(radio_perform... | [
"0.7403746",
"0.70377237",
"0.6419817",
"0.63453656",
"0.60307693",
"0.6012222",
"0.59881747",
"0.5969797",
"0.5858417",
"0.5834221",
"0.5669148",
"0.56427926",
"0.5609592",
"0.55843043",
"0.5459007",
"0.5436096",
"0.53938717",
"0.5374564",
"0.5372334",
"0.5351812",
"0.534945... | 0.7682231 | 0 |
PATCH/PUT /radio_performances/1 PATCH/PUT /radio_performances/1.json | def update
respond_to do |format|
if @radio_performance.update(radio_performance_params)
format.html { redirect_to @radio_performance, notice: 'Radio performance was successfully updated.' }
format.json { render :show, status: :ok, location: @radio_performance }
else
format.html ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @radio = Radio.find(params[:id])\n respond_to do |format|\n if @radio.update(radio_params)\n format.json { render json: @radio, status: :ok }\n else\n format.json { render json: @radio.errors, status: :unprocessable_entity }\n end\n end\nend",
"def set_radio_performance\n ... | [
"0.70979095",
"0.7076478",
"0.6621435",
"0.6329141",
"0.6303492",
"0.6303492",
"0.6197437",
"0.6144619",
"0.6071983",
"0.6028543",
"0.59989834",
"0.596507",
"0.5926616",
"0.5861943",
"0.58353674",
"0.57510155",
"0.5746781",
"0.5681581",
"0.56672543",
"0.5648289",
"0.5645102",... | 0.78265035 | 0 |
DELETE /radio_performances/1 DELETE /radio_performances/1.json | def destroy
@radio_performance.destroy
respond_to do |format|
format.html { redirect_to radio_performances_url, notice: 'Radio performance was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @radio = Radio.find(params[:id])\n @radio.destroy\n respond_to do |format|\n format.json { render json: {}, status: :ok }\n end\nend",
"def destroy\n @dor_variant_performance.destroy\n respond_to do |format|\n format.html { redirect_to dor_variant_performances_url }\n format... | [
"0.72106135",
"0.6872624",
"0.6818789",
"0.6818789",
"0.6776458",
"0.6762235",
"0.67315644",
"0.67315644",
"0.6679279",
"0.6673803",
"0.66524774",
"0.6641965",
"0.6631223",
"0.6584645",
"0.65566504",
"0.65385866",
"0.65145373",
"0.64941317",
"0.6477502",
"0.64373165",
"0.6422... | 0.7765664 | 0 |
The each_address method iterates over each address of the ip range | def each_address
(@addr..broadcast).each do |addr|
yield _to_string(addr)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def each_address(&blk) # :yields: url\n addresses.each(&blk)\n end",
"def each\n ipaddr = self.clone.set(@addr, @family)\n (0...(@mask_addr ^ 0xffffffff)).each do |_a|\n yield(ipaddr)\n ipaddr.addr += 1\n end\n end",
"def each(&block)\n\t\twhile (ip = next_ip)\n\t\t\tblock.call(ip)\... | [
"0.7579521",
"0.7193799",
"0.7180399",
"0.68192184",
"0.6756673",
"0.65112597",
"0.6482084",
"0.63961715",
"0.6395525",
"0.63073695",
"0.6296478",
"0.6274294",
"0.6218988",
"0.61584336",
"0.6146924",
"0.61384255",
"0.6137398",
"0.61307704",
"0.61164933",
"0.6112664",
"0.61029... | 0.7251249 | 1 |
Get the mouse position in tile | def get_mouse_tile_x
return ((@window.mouse_x - @x + (@scroll_x*@scale))/screen_tile(0)).floor
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mouse_position\n mouse_state.position\n end",
"def mouse_coords\n # For some reason, Gosu's mouse_x/mouse_y return Floats, so round it off\n [\n (mouse_x.round + @camera_x) * PIXEL_WIDTH,\n (mouse_y.round + @camera_y) * PIXEL_WIDTH\n ]\n end",
"def mouse_over_position()\n\t\tmx ... | [
"0.79802865",
"0.73912656",
"0.7374447",
"0.7163274",
"0.7163274",
"0.71467644",
"0.69328636",
"0.68666095",
"0.68567675",
"0.67990994",
"0.67604554",
"0.6719206",
"0.67058563",
"0.66202474",
"0.66173357",
"0.64873177",
"0.644446",
"0.644446",
"0.6429439",
"0.6421475",
"0.640... | 0.8278907 | 0 |
Tile "real" screen size | def screen_tile(widthheight)
return widthheight == 0 ? @window.tile_width * @scale : @window.tile_height * @scale
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def screen_tile_y\n Graphics.height / TILE_HEIGHT\n end",
"def screen_tile_x\n Graphics.width / TILE_WIDTH\n end",
"def zoom_unit\n [@native_screen_width, @native_screen_height]\n end",
"def screen_size\n compatible_call :screen_size\n end",
"def size w = DEFAULT_SCREEN_WIDTH, h = D... | [
"0.74804235",
"0.7417725",
"0.7202328",
"0.71746135",
"0.71525276",
"0.6960445",
"0.69323075",
"0.6878837",
"0.6824196",
"0.67621094",
"0.6750535",
"0.6718987",
"0.67079484",
"0.66488093",
"0.66075736",
"0.65496045",
"0.65486956",
"0.64855886",
"0.6478815",
"0.6475995",
"0.64... | 0.7824337 | 0 |
POST /dpms POST /dpms.json | def create
@dpm = Dpm.new(dpm_params)
#todo @user = User.find_by(current_user[:id])
#@user.dpms << @dpm
respond_to do |format|
if @dpm.save
format.html { render '/dpms/step1', notice: 'Dpm was successfully created.' }
format.json { render action: 'show', status: :created, location... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @mdp = Mdp.new(mdp_params)\n\n respond_to do |format|\n if @mdp.save\n format.html { redirect_to @mdp, notice: 'Mdp was successfully created.' }\n format.json { render :show, status: :created, location: @mdp }\n else\n format.html { render :new }\n format.js... | [
"0.6028746",
"0.582425",
"0.56707406",
"0.5568852",
"0.54995424",
"0.5456304",
"0.54280776",
"0.5411018",
"0.538502",
"0.5371777",
"0.5341115",
"0.53355914",
"0.52931845",
"0.5225045",
"0.52096874",
"0.51957995",
"0.51949716",
"0.5171429",
"0.51645195",
"0.51387846",
"0.51290... | 0.63293016 | 0 |
DELETE /dpms/1 DELETE /dpms/1.json | def destroy
@dpm.destroy
respond_to do |format|
format.html { redirect_to dpms_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n client.delete(\"/#{id}\")\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def delete_dm(settings, dmid)\n Net::HTTP.start('twitter.com') {|http|\n req = Net::HTTP::Post.new(\"/direct_messages/destroy/#{dmid}.json\")\n ... | [
"0.6843457",
"0.6842019",
"0.6663225",
"0.6615052",
"0.6599806",
"0.65581167",
"0.6545141",
"0.65387",
"0.65365106",
"0.65365106",
"0.65365106",
"0.65365106",
"0.6501994",
"0.64855045",
"0.6483275",
"0.6479778",
"0.6471596",
"0.6448167",
"0.64429593",
"0.64206535",
"0.640265"... | 0.71685266 | 0 |
Run a `grade` processor over current classifier state for given project (see process_using). The result for each classifier is just a grade. | def grade(*args)
process_using(*args.unshift(:grade))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run\n return if @classifiers.present?\n\n @classifiers = GRADES.each_with_object(new_classifiers) do |grade, classifiers|\n @projects[grade].each do |project|\n SECTIONS.product(PERIODS).each do |section, period|\n metrics = project.data_for(section: sec... | [
"0.6561129",
"0.6283152",
"0.56374454",
"0.5329926",
"0.5266936",
"0.52409947",
"0.51214147",
"0.49827892",
"0.4932972",
"0.4926585",
"0.49039423",
"0.4861822",
"0.4859466",
"0.48425868",
"0.48321658",
"0.48054853",
"0.4795675",
"0.47951818",
"0.4772478",
"0.4759625",
"0.4744... | 0.6384787 | 1 |
Get a checker class from its name. | def check_class_by(check_name)
Kernel.const_get(
"Ossert::Classifiers::Check::#{check_name.capitalize}"
)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_class_by_name( name )\n raise \"get_class_by_name #{name}.#{name.class}\" unless name.is_a?(Symbol)\n c = classes[name]\n #puts \"MISS, no class #{name} #{name.class}\" unless c # \" #{classes}\"\n #puts \"CLAZZ, #{name} #{c.get_type.get_length}\" if c\n c\n end",
"def get_cla... | [
"0.74843246",
"0.74018896",
"0.7105575",
"0.69743603",
"0.68377423",
"0.6813483",
"0.6608761",
"0.66025865",
"0.6559362",
"0.65136784",
"0.64276624",
"0.6401515",
"0.6390031",
"0.6387996",
"0.6351436",
"0.63423383",
"0.63305646",
"0.6328081",
"0.6287827",
"0.628103",
"0.62789... | 0.79969543 | 0 |
Calculate rating for given metrics, dataset and classifiers. Result rating is aggregated into rates object. | def rate(rates, period_metrics, dataset, classifier)
classifier.each_pair do |klass, qualified_metrics|
period_metrics.slice(*dataset.keys).each_pair do |metric, weight|
range = qualified_metrics[metric.to_s][:range]
rates[KLASS_2_GRADE[klass]] += weight / max_score if ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rating\n rating_calculator.rate(raters)\n end",
"def evaluate\n puts params[:rating].inspect.yellow\n params[:ratings].each do |tenant, report|\n participant = @game.participants.find_by(tenant: tenant)\n if participant\n participant.ratings.create!(report: report, rated_at: Ti... | [
"0.5860044",
"0.5692381",
"0.56798863",
"0.55203295",
"0.5450698",
"0.5408577",
"0.5378603",
"0.5342109",
"0.5331896",
"0.5301556",
"0.5298839",
"0.52863073",
"0.5263795",
"0.5232888",
"0.5229497",
"0.52128166",
"0.5203682",
"0.5198656",
"0.51804763",
"0.5168031",
"0.51652056... | 0.72621995 | 0 |
Returns a Subset instance for a collection of size +size+ with the rank +rank+. | def initialize(size, rank = 0)
@size, self.rank = size, rank
@last = (1 << size) - 1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def select(rank)\n return min if rank == 0\n return nil if rank >= size\n\n select_node(@root, rank)\n end",
"def rank(idx_rank)\n return self if idx_rank == left_size\n return left.rank(idx_rank) if idx_rank < left_size \n return right.rank(idx_rank - left_size - 1) \n end",
"def r... | [
"0.58729714",
"0.5291541",
"0.5186712",
"0.5055315",
"0.49787182",
"0.4832522",
"0.4823799",
"0.48077852",
"0.48022062",
"0.47527224",
"0.474038",
"0.4732759",
"0.46504322",
"0.46205503",
"0.45558167",
"0.4545393",
"0.45347553",
"0.44707417",
"0.44663495",
"0.44407067",
"0.44... | 0.5606027 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.