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 |
|---|---|---|---|---|---|---|
PUT /starts/1 PUT /starts/1.xml | def update
@start = Start.find(params[:id])
respond_to do |format|
if @start.update_attributes(params[:start])
flash[:notice] = 'Start was successfully updated.'
format.html { redirect_to(@start) }
format.xml { head :ok }
else
format.html { render :action => "edit" ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @start.update(start_params)\n format.html { redirect_to @start, notice: 'Start was successfully updated.' }\n format.json { render :show, status: :ok, location: @start }\n else\n format.html { render :edit }\n format.json { render js... | [
"0.60157454",
"0.57968414",
"0.57968414",
"0.5591074",
"0.5581295",
"0.5576297",
"0.55166656",
"0.55091506",
"0.5471707",
"0.53548646",
"0.5318771",
"0.5248087",
"0.5243338",
"0.52369756",
"0.51742953",
"0.51651853",
"0.5164643",
"0.5156353",
"0.51511383",
"0.5119068",
"0.507... | 0.63044065 | 0 |
DELETE /starts/1 DELETE /starts/1.xml | def destroy
@start = Start.find(params[:id])
@start.destroy
respond_to do |format|
format.html { redirect_to(starts_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @bare_start = BareStart.find(params[:id])\n @bare_start.destroy\n\n respond_to do |format|\n format.html { redirect_to(bare_starts_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
... | [
"0.6814925",
"0.63955677",
"0.62046117",
"0.60808486",
"0.59414035",
"0.5913352",
"0.59056556",
"0.5897013",
"0.58811396",
"0.58722574",
"0.5816306",
"0.5768108",
"0.57600844",
"0.5736632",
"0.5733944",
"0.5712253",
"0.570863",
"0.570863",
"0.570863",
"0.5692948",
"0.568768",... | 0.7190531 | 0 |
Convert to argument vector. If the last element in the array is a Hash then call to_argv on it and merge results. Returns [Array] | def to_argv
flags = (Hash===last ? pop : {})
flags = flags.to_argv
flags + self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_a\n multiple = to_arrays(@opts.dup)\n args = split_into_hashes(multiple)\n\n if @opts.has_key?(:arg)\n # Parse the argument string and merge in previous options from +singles+.\n args = parse_args_string(args, @opts[:arg])\n end\n\n infer_args(args)\n ... | [
"0.7206529",
"0.70512223",
"0.6792624",
"0.6694031",
"0.6352208",
"0.63203734",
"0.61345226",
"0.6126588",
"0.6123724",
"0.6055079",
"0.60275626",
"0.5991995",
"0.5961198",
"0.59558916",
"0.59085304",
"0.59067565",
"0.58852804",
"0.5819789",
"0.5805678",
"0.5797809",
"0.57764... | 0.7112686 | 1 |
Tests other object for equality with itself. Objects of type different from Like are considered nonequal. | def ==(other)
return false unless Like === other
self.person == other.person &&
self.item == other.item
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ==(other)\n super || object == other\n end",
"def ==(other); false; end",
"def ===(other); end",
"def ==(other)\n other.instance_of?(self.class) && eql?(other)\n end",
"def eql?(other)\n super\n end",
"def eql?(other)\n super\n end",
"def eql?(other)\n self.class ==... | [
"0.74236435",
"0.72976494",
"0.72500646",
"0.7207253",
"0.71239793",
"0.71239793",
"0.7116432",
"0.7116432",
"0.7116432",
"0.7116432",
"0.7085649",
"0.70821226",
"0.70751387",
"0.70626485",
"0.70593333",
"0.70430094",
"0.7040517",
"0.70400757",
"0.7023563",
"0.70182997",
"0.7... | 0.7495582 | 0 |
Render the proposal title links should render hashtags as links? extras should include extra hashtags? Returns a String. | def title(links: false, extras: true, html_escape: false)
text = proposal.title
text = decidim_html_escape(text) if html_escape
renderer = Decidim::ContentRenderers::HashtagRenderer.new(text)
renderer.render(links: links, extras: extras).html_safe
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def title(*args)\n strings = args.map do |arg|\n if arg.is_a?(Array) && arg.size >= 2\n link_to(*arg)\n else\n h(arg.to_s)\n end\n end\n content_tag('h2', strings.join(' » ').html_safe)\n end",
"def title(*args)\n strings = args.map do |arg|\n if arg.is_a?(Arra... | [
"0.67714447",
"0.66792697",
"0.66792697",
"0.66792697",
"0.6617866",
"0.646028",
"0.6449158",
"0.634038",
"0.63238055",
"0.62180865",
"0.62117654",
"0.62065005",
"0.61389005",
"0.6094815",
"0.6055985",
"0.6032177",
"0.6030588",
"0.60236335",
"0.60226417",
"0.6007417",
"0.5995... | 0.8026969 | 0 |
DELETE /lectures/1 DELETE /lectures/1.json | def destroy
@lecture = Lecture.find(params[:id])
@lecture.destroy
respond_to do |format|
format.html { redirect_to lectures_url, notice: "Lecture was successfully deleted." }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @lecture.destroy\n respond_to do |format|\n format.html { redirect_to lectures_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lecture = Lecture.find(params[:id])\n @lecture.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin... | [
"0.7806559",
"0.7482492",
"0.7447312",
"0.7447312",
"0.7447312",
"0.73570436",
"0.7242813",
"0.70201534",
"0.698674",
"0.6956975",
"0.6857415",
"0.6857044",
"0.68102247",
"0.67734396",
"0.67652667",
"0.67400724",
"0.670576",
"0.670576",
"0.6693277",
"0.663944",
"0.6598727",
... | 0.74961305 | 1 |
Systeme de recherche de la home | def homesearch
#Fonctionne avec elasticsearch classique
#@campings = Camping.custom_search((params[:q].present? ? params[:q] : '*'))
#@campings = Camping.search((params[:q].present? ? params[:q] : '*'))
# @campings = Camping.all
# @campings = Camping.search(params[:q]) unless params[:q].... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assunto\n if (params[:search].nil? || params[:search].empty?)\n render 'consultaA'\n else\n @assuntos = Assunto.find(:all, :conditions => [\"assunto like ?\", \"%\" + params[:search].to_s + \"%\"])\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @livr... | [
"0.66608506",
"0.65132576",
"0.6497434",
"0.6373023",
"0.63076246",
"0.63076246",
"0.63076246",
"0.63076246",
"0.63076246",
"0.63076246",
"0.63076246",
"0.63076246",
"0.63076246",
"0.63076246",
"0.63061005",
"0.6297096",
"0.6268957",
"0.6227966",
"0.62245286",
"0.61927205",
"... | 0.66249037 | 1 |
gets person by params[:id] or params[:padma_id] if no person with :padma_id is found it's created. | def get_person
if params[:id]
p = @scope.find(params[:id])
elsif params[:padma_id]
p = @scope.find_by_padma_id(params[:padma_id])
if p.nil?
current_user.padma.person(params[:padma_id])
p = @scope.build(:name => pp["name"], :surname => pp["surname"], :padma_id => pp["id"], :sync... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_by_padma_id(id)\n Contact.where(padma_id: id) unless id.nil?\n end",
"def create\n if params[:padma_id]\n pp = current_user.padma.person(params[:padma_id])\n # TODO email\n @person = @scope.build(:name => pp[\"name\"], :surname => pp[\"surname\"], :padma_id => pp[\"id\"])\n ... | [
"0.67970765",
"0.679057",
"0.61082304",
"0.6103504",
"0.60013735",
"0.60013735",
"0.60013735",
"0.60013735",
"0.60013735",
"0.5942643",
"0.5840603",
"0.5827013",
"0.5776042",
"0.5761294",
"0.57489616",
"0.5748495",
"0.5747064",
"0.5737753",
"0.5718984",
"0.5708791",
"0.565069... | 0.79868627 | 0 |
GET /paperstocks GET /paperstocks.json | def index
@paperstocks = Paperstock.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @product = Product.find(params[:product_id])\n @product_stocks = @product.product_stocks\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @product_stocks }\n end\n end",
"def index\n @stock_prices = StockPrice.all\n\n respond_to do... | [
"0.729578",
"0.717891",
"0.6909031",
"0.68035144",
"0.668333",
"0.6617674",
"0.6596232",
"0.6596232",
"0.6596232",
"0.6596232",
"0.6559213",
"0.6497102",
"0.6497102",
"0.6497102",
"0.6497102",
"0.649101",
"0.64905447",
"0.64899313",
"0.64864105",
"0.64585525",
"0.64429826",
... | 0.75650156 | 0 |
POST /paperstocks POST /paperstocks.json | def create
@paperstock = Paperstock.new(paperstock_params)
respond_to do |format|
if @paperstock.save
format.html { redirect_to @paperstock, notice: 'Paperstock was successfully created.' }
format.json { render :show, status: :created, location: @paperstock }
else
format.htm... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @stock = Stock.new(params[:stock])\n\n respond_to do |format|\n if @stock.save\n format.html { redirect_to stocks_url, notice: 'Stock was successfully created.' }\n format.json { render json: @stock, status: :created, location: @stock }\n else\n format.html { rende... | [
"0.66527635",
"0.6639533",
"0.6639533",
"0.6639533",
"0.6639533",
"0.6616512",
"0.6605791",
"0.65756685",
"0.65756685",
"0.65756685",
"0.65756685",
"0.65756685",
"0.65756685",
"0.6513054",
"0.64737713",
"0.64240193",
"0.6408927",
"0.64012223",
"0.64012223",
"0.6368097",
"0.63... | 0.76887935 | 0 |
PATCH/PUT /paperstocks/1 PATCH/PUT /paperstocks/1.json | def update
respond_to do |format|
if @paperstock.update(paperstock_params)
format.html { redirect_to @paperstock, notice: 'Paperstock was successfully updated.' }
format.json { render :show, status: :ok, location: @paperstock }
else
format.html { render :edit }
format.jso... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @stock = Stock.find(params[:id])\n\n respond_to do |format|\n if @stock.update_attributes(params[:stock])\n format.html { redirect_to stocks_url }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json... | [
"0.7001529",
"0.6894967",
"0.6894967",
"0.6894967",
"0.68748564",
"0.687248",
"0.68690026",
"0.68690026",
"0.6868521",
"0.6842479",
"0.6842479",
"0.6842479",
"0.6842479",
"0.6842479",
"0.6842479",
"0.6842479",
"0.6842479",
"0.6842479",
"0.6842479",
"0.6842479",
"0.67487055",
... | 0.7433246 | 0 |
DELETE /paperstocks/1 DELETE /paperstocks/1.json | def destroy
@paperstock.paperstock_items.each do |paperstock_item|
paperstock_item.destroy
end
@paperstock.destroy
respond_to do |format|
format.html { redirect_to paperstocks_url, notice: 'Paperstock was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url }\n format.json { head :no_content }\n ... | [
"0.7373461",
"0.7373461",
"0.7335633",
"0.7335633",
"0.7335633",
"0.7335633",
"0.7335633",
"0.7335633",
"0.72647125",
"0.72318864",
"0.72318864",
"0.7199162",
"0.71765876",
"0.7139669",
"0.71387005",
"0.7118509",
"0.71034414",
"0.7069134",
"0.7069134",
"0.7066196",
"0.7066196... | 0.7566787 | 0 |
Return the Tap Log Record representing an activity during which this record occurred | def current_activity
if self.entry_type == 'activity'
self
else
self.user.tap_log_records.where('timestamp < ? AND entry_type = ?', self.timestamp, 'activity').order('timestamp desc').limit(1).first
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_activity\n if self.record_category.activity?\n self\n else\n self.user.records.activities.where('timestamp < ? AND (end_timestamp IS NULL OR end_timestamp >= ?)', self.timestamp, self.timestamp).order('timestamp desc').first\n end\n end",
"def show\n @tap_log_record = current_a... | [
"0.6293105",
"0.6067512",
"0.58195025",
"0.5772878",
"0.57240605",
"0.5690594",
"0.56735986",
"0.5641759",
"0.5641759",
"0.56007147",
"0.54703695",
"0.5445019",
"0.541541",
"0.53333205",
"0.53261703",
"0.5324294",
"0.5318873",
"0.5318054",
"0.53155357",
"0.5297585",
"0.527219... | 0.713678 | 0 |
start [DIR] start a development dyno on development app APP b, buildpack use a custom buildpack e, runtimeenv use the runtime env | def index
dir = Pathname.new(File.expand_path(shift_argument || ".")).realpath.to_s
app = options[:app] || error("Must specify a development app with -a")
validate_arguments!
user = api.post_login("", Heroku::Auth.password).body["email"]
Anvil.append_agent "interface=start user=#{user} app=#{app}"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_app\nend",
"def launch_native\n if !File.exists? 'build/app'\n puts \"No native app built!\"\n exit\n end\n `( cd build && ./app )`\nend",
"def launch_native\n if !File.exist? 'build/app'\n puts \"No native app built!\"\n exit\n end\n `( cd build && ./app )`\nend",
"def build_devi... | [
"0.57848674",
"0.55945206",
"0.55882514",
"0.5581586",
"0.5552667",
"0.5521108",
"0.5477268",
"0.54388475",
"0.5436457",
"0.54176205",
"0.54141223",
"0.541292",
"0.5411114",
"0.5399228",
"0.53865653",
"0.5384672",
"0.53684807",
"0.536418",
"0.53580046",
"0.53326315",
"0.53263... | 0.6169802 | 0 |
start:console get a console into your development dyno | def console
connector = Distributor::Connector.new
console = TCPSocket.new("localhost", read_anvil_metadata(".", "console.port").to_i)
set_buffer false
connector.handle(console) do |io|
$stdout.write io.readpartial(4096)
$stdout.flush
end
connector.handle($stdin.dup) do |io|
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def console\n @console ||= set_console\n @console\n end",
"def console\n puts 'Entering debug console.'\n if RUBY_VERSION == '2.0.0'\n require 'byebug'\n byebug\n else\n require 'ruby-debug'\n Debugger.start\n debugger\n end\n puts 'Leaving... | [
"0.6971978",
"0.6872245",
"0.68698835",
"0.67546374",
"0.67367554",
"0.6707196",
"0.66796565",
"0.66796565",
"0.66611516",
"0.65535873",
"0.64637864",
"0.64203805",
"0.63786525",
"0.6304858",
"0.6291304",
"0.6179932",
"0.61454594",
"0.61397284",
"0.6123354",
"0.6122282",
"0.6... | 0.7441175 | 0 |
GET /shirt_styles GET /shirt_styles.json | def index
@shirt_styles = ShirtStyle.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def styles\n respond_to do |format|\n format.json{ render :json => helpers.get_style(params[:style_id], :json) }\n end\n end",
"def index\n @styles = Style.all\n end",
"def index\n @cooking_styles = CookingStyle.all\n end",
"def styles\n mentos(:get_all_styles)\n end",
"def get_... | [
"0.7827145",
"0.6697678",
"0.64782125",
"0.64000726",
"0.634426",
"0.632239",
"0.6283415",
"0.6232487",
"0.6220549",
"0.6219587",
"0.6193535",
"0.6187651",
"0.61771053",
"0.6159354",
"0.6158562",
"0.6149723",
"0.61413604",
"0.6117302",
"0.61162895",
"0.60998887",
"0.6081101",... | 0.72818756 | 1 |
POST /shirt_styles POST /shirt_styles.json | def create
@shirt_style = @order.shirt_styles.new(shirt_style_params)
respond_to do |format|
if @shirt_style.save
format.html { redirect_to [@store,@customer,@order], notice: 'Shirt style was successfully created.' }
format.json { render :show, status: :created, location: @shirt_style }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shirt_style_params\n params.require(:shirt_style).permit(:style_for, :style_for_fabric_picture, :style, :lapel, :vent, :pocket, :fit, :sleeve_placket, :front_cut, :related_pictures, :master_comment, :order_id)\n end",
"def create\n @cooking_style = CookingStyle.new(cooking_style_params)\n\n res... | [
"0.7046256",
"0.6656549",
"0.6602945",
"0.6506727",
"0.6363435",
"0.6359792",
"0.63236296",
"0.6301696",
"0.630154",
"0.62761617",
"0.62758434",
"0.62513226",
"0.6209644",
"0.61875415",
"0.6155946",
"0.61456466",
"0.6117691",
"0.6096373",
"0.6093535",
"0.6076135",
"0.6070049"... | 0.73644024 | 0 |
PATCH/PUT /shirt_styles/1 PATCH/PUT /shirt_styles/1.json | def update
respond_to do |format|
if @shirt_style.update(shirt_style_params)
format.html { redirect_to [@store,@customer,@order], notice: 'Shirt style was successfully updated.' }
format.json { render :show, status: :ok, location: @shirt_style }
else
format.html { render :edit }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n style = Style.find(params[:id])\n style.update(update_params)\n save_style style.stylable_id\n head :ok\n end",
"def update\n @body_style = BodyStyle.find(params[:id])\n\n respond_to do |format|\n if @body_style.update_attributes(params[:body_style])\n format.html { re... | [
"0.69987315",
"0.6687298",
"0.6618275",
"0.6433379",
"0.6429345",
"0.6422027",
"0.63912445",
"0.63855916",
"0.6368277",
"0.6357002",
"0.63563406",
"0.6326017",
"0.630973",
"0.6298726",
"0.6265372",
"0.62150055",
"0.62056184",
"0.6195574",
"0.61699617",
"0.6157443",
"0.6140882... | 0.72237307 | 0 |
DELETE /shirt_styles/1 DELETE /shirt_styles/1.json | def destroy
@shirt_style.destroy
respond_to do |format|
format.html { redirect_to shirt_styles_url, notice: 'Shirt style was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @dish_style.destroy\n respond_to do |format|\n format.html { redirect_to dish_styles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cooking_style.destroy\n respond_to do |format|\n format.html { redirect_to cooking_styles_url, notice: 'Cooking ... | [
"0.71814203",
"0.6905643",
"0.6901626",
"0.68602765",
"0.68469685",
"0.67623085",
"0.67526233",
"0.67467296",
"0.6733567",
"0.66729236",
"0.6670156",
"0.6664323",
"0.6643004",
"0.66347003",
"0.6609846",
"0.6606172",
"0.6600211",
"0.6599356",
"0.65950626",
"0.6577307",
"0.6570... | 0.73687655 | 0 |
GET /teacher_prizes GET /teacher_prizes.json | def index
@teacher_prizes = TeacherPrize.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_teacher_prize\n @teacher_prize = TeacherPrize.find(params[:id])\n end",
"def teachers\n url = drop_url_version + \"/count/teacherAssociations/#{params['edorg_id']}/teachers\"\n begin\n entities = RestClient.get(url, get_header)\n entities = JSON.parse(entities)\n rescue => e\n ... | [
"0.66048366",
"0.6121933",
"0.5882594",
"0.5853649",
"0.58349586",
"0.5753324",
"0.5658254",
"0.55754524",
"0.54137516",
"0.541133",
"0.53964216",
"0.5368238",
"0.53678876",
"0.535494",
"0.53503585",
"0.534656",
"0.5312869",
"0.5312869",
"0.5312869",
"0.5312869",
"0.5312869",... | 0.7526168 | 0 |
PATCH/PUT /teacher_prizes/1 PATCH/PUT /teacher_prizes/1.json | def update
respond_to do |format|
if @teacher_prize.update(teacher_prize_params)
format.html { redirect_to @teacher_prize, notice: 'Teacher prize was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @teacher = Teacher.find(params[:id])\n respond_to do |format|\n if @teacher.update(params.require(:teacher).permit(:name, :email, :address, :discipline, :phone))\n format.html { redirect_to @teacher, notice: 'Teacher was successfully updated.' }\n format.json { render :show, s... | [
"0.66196555",
"0.632192",
"0.6220438",
"0.6196413",
"0.6196413",
"0.6176772",
"0.6175304",
"0.61629695",
"0.61575884",
"0.61575884",
"0.61575884",
"0.61575884",
"0.612717",
"0.6049113",
"0.6040871",
"0.6020896",
"0.59836626",
"0.59270567",
"0.59140426",
"0.5878015",
"0.585676... | 0.7161566 | 0 |
DELETE /teacher_prizes/1 DELETE /teacher_prizes/1.json | def destroy
@teacher_prize.destroy
respond_to do |format|
format.html { redirect_to teacher_prizes_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n teacher.destroy\n respond_to do |format|\n format.html { redirect_to admin_teachers_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tenacity.destroy\n respond_to do |format|\n format.html { redirect_to tenacities_url }\n format.json { head... | [
"0.6901692",
"0.68123466",
"0.67798054",
"0.67170405",
"0.66979724",
"0.6696772",
"0.66812855",
"0.66812855",
"0.66812855",
"0.66804904",
"0.6679389",
"0.6671766",
"0.6658293",
"0.66513675",
"0.66415685",
"0.66259384",
"0.6624213",
"0.6621059",
"0.66192913",
"0.6614456",
"0.6... | 0.7790187 | 0 |
Merge two option values. Makes an union on array values. It also mantains the original dbtype when sqlite3 driver is available. | def merge_value(key, value1, value2)
if value1.is_a?(Array) && value2.is_a?(Array)
value1 | value2
elsif key == 'dbtype' && value1 == 'sqlite3' && value2 == 'sqlite'
value1
else
value2
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merge_select_extra\n relation.select_extra_values.concat(other.select_extra_values).uniq! \\\n if other.select_extra_values.present?\n end",
"def combined_options\n self.integer_options.all\n .concat(self.string_options)\n .concat(self.boolean_options)\n .concat(s... | [
"0.60575455",
"0.5862008",
"0.585253",
"0.5761211",
"0.56771755",
"0.56230426",
"0.5619791",
"0.5599417",
"0.55806243",
"0.55740154",
"0.55700576",
"0.556349",
"0.5542734",
"0.5451996",
"0.54415005",
"0.5435114",
"0.54323995",
"0.5432093",
"0.5432093",
"0.5432093",
"0.5398713... | 0.7418143 | 0 |
Functions for handling the LogicMonitor Collector Installer Create the installer file | def create_installer(install_file, id)
puts "Downloading install file"
File.open(install_file, "w+"){ |f|
f.write(download_install_file("logicmonitorsetup", {"id" => id.to_s, "arch" => get_arch,}))
}
puts "Download complete"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n start = Time.now\n debug 'Downloading new collector installer.'\n collector = get_agent_by_description(nil, resource[:description], 'id')\n if collector\n if resource[:architecture].include?('64')\n installation_binary = \"#{resource[:install_dir]}logicmonitorsetup#{collector['... | [
"0.7179043",
"0.6839483",
"0.6475611",
"0.62848985",
"0.62445205",
"0.6224932",
"0.6220981",
"0.61013144",
"0.61002564",
"0.590215",
"0.5853945",
"0.57811874",
"0.5779186",
"0.57093924",
"0.56871814",
"0.56543463",
"0.56543463",
"0.5644746",
"0.5626976",
"0.56258297",
"0.5615... | 0.7520149 | 0 |
Call LogicMonitor RPC to request installer binary | def download_install_file(action, args={})
company = @company
username = @user
password = @password
url = "https://#{company}.logicmonitor.com/santaba/do/#{action}?"
args.each_pair do |key, value|
url << "#{key}=#{value}&"
end
url << "c=#{company}&u=#{username}&p=#{password}"
uri = URI(url)
begin
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_installer(install_file, id)\n puts \"Downloading install file\"\n File.open(install_file, \"w+\"){ |f|\n f.write(download_install_file(\"logicmonitorsetup\", {\"id\" => id.to_s, \"arch\" => get_arch,}))\n }\n puts \"Download complete\"\nend",
"def run(identifier, install_dir)\n puts \"checking... | [
"0.6321292",
"0.5973792",
"0.5891492",
"0.56872034",
"0.5650916",
"0.55991733",
"0.553247",
"0.5516664",
"0.5495104",
"0.5495104",
"0.5445125",
"0.5445024",
"0.5445024",
"0.54307675",
"0.54103136",
"0.54103136",
"0.53996783",
"0.5399635",
"0.5398247",
"0.5393132",
"0.538389",... | 0.6053072 | 1 |
Run the LogicMonitor collector installer | def install_collector(install_dir, file_name)
puts "Installing LogicMonitor collector"
install_file = install_dir + file_name
puts install_file
File.chmod(0755, install_file)
execution = `cd #{install_dir}; .#{file_name} -y`
puts execution.to_s
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run(identifier, install_dir)\n puts \"checking collector\"\n collector = get_collector(identifier)\n if collector\n puts \"Matching collector found on server\"\n else\n puts \"No matching collectors found\"\n create_collector(identifier)\n collector = get_collector(identifier)\n end\n unless ... | [
"0.7654245",
"0.66705656",
"0.5792412",
"0.57440287",
"0.5728282",
"0.5627172",
"0.5587209",
"0.5571474",
"0.5561207",
"0.5551032",
"0.5476731",
"0.5450926",
"0.5446639",
"0.5437696",
"0.5426045",
"0.54134405",
"0.5353688",
"0.531505",
"0.5299118",
"0.5277491",
"0.5257745",
... | 0.70501256 | 1 |
Ensure that the logicmonitor collector and watchdog are running | def ensure_running
agent_status = `service logicmonitor-agent status`
if agent_status.include?("not running")
puts "LogicMonitor collector isn't running"
puts `service logicmonitor-agent start`
else
puts "LogicMonitor collector is running"
end
watchdog_status = `service logicmonitor-watchdog stat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_monitor!\n begin\n trap(\"INT\") do\n on_exit\n exit\n end\n # Daemonize only if we are not in the test environment\n run_thread_loop(:daemonize => !Application.test?) do\n add_task {PoolParty.message \"Checking cloud\"}\n add_task {lau... | [
"0.6670656",
"0.59510165",
"0.5935523",
"0.58659554",
"0.58473223",
"0.58329785",
"0.57903016",
"0.5778288",
"0.5742338",
"0.573969",
"0.5733035",
"0.57235473",
"0.5704551",
"0.56625205",
"0.5662006",
"0.5646765",
"0.5594252",
"0.55852634",
"0.55771816",
"0.5574002",
"0.55732... | 0.69260186 | 0 |
Utility functions Wrapper function for building LogicMonitor API URL's and executing the associated RPCs returns a JSON string (the response from the LogicMonitor API) or nil | def rpc(action, args={})
company = @company
username = @user
password = @password
url = "https://#{company}.logicmonitor.com/santaba/rpc/#{action}?"
args.each_pair do |key, value|
url << "#{key}=#{value}&"
end
url << "c=#{company}&u=#{username}&p=#{password}"
uri = URI(url)
begin
http = Net::... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def perform_api_request(query) \n request = Net::HTTP::Post.new( \n $url.path + ($url.query != nil ? (\"?\" + $url.query) : \"\"), \n initheader = {\"Content-Type\" => \"application/json\", \n \"X-Replicon-Security-Context\" => \"User\"}) \n request.basic_auth($companyKey + \"\\\\\" ... | [
"0.60089314",
"0.598122",
"0.5960899",
"0.585578",
"0.56950873",
"0.56850857",
"0.56834906",
"0.5625771",
"0.5624768",
"0.56124",
"0.5573592",
"0.55693114",
"0.55597657",
"0.55547243",
"0.5552081",
"0.5528565",
"0.55010366",
"0.5497208",
"0.5495298",
"0.5483318",
"0.5475066",... | 0.66028506 | 0 |
GET /particular_vacancy_requests GET /particular_vacancy_requests.json | def index
@particular_vacancy_requests = ParticularVacancyRequest.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @vacation_requests = VacationRequest.all\n end",
"def index\n @vacancy_request_statuses = VacancyRequestStatus.all\n end",
"def index\n @borrow_requests = current_user.borrow_requests.actionable\n @pending_approvals = current_user.approvals.where(\"status = 'pending'\")\n\n respond... | [
"0.65307546",
"0.65149677",
"0.6228391",
"0.61831087",
"0.60991997",
"0.60855037",
"0.6071139",
"0.6033333",
"0.5983365",
"0.5911114",
"0.58860487",
"0.58742017",
"0.58659065",
"0.5831691",
"0.5812011",
"0.5799602",
"0.57847345",
"0.57822275",
"0.5774254",
"0.5767724",
"0.576... | 0.69399476 | 0 |
POST /particular_vacancy_requests POST /particular_vacancy_requests.json | def create
@particular_vacancy_request = ParticularVacancyRequest.new(particular_vacancy_request_params)
respond_to do |format|
if @particular_vacancy_request.save
format.html { redirect_to @particular_vacancy_request, notice: 'Particular vacancy request was successfully created.' }
forma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def particular_vacancy_request_params\n params.require(:particular_vacancy_request).permit(:vacancy_master_id, :vacancy_history_id, :employee_id, :open_date, :closed_date, :fulfillment_date, :status)\n end",
"def vacancy_request_status_params\n params.require(:vacancy_request_status).permit(:vacancy... | [
"0.66416055",
"0.6199005",
"0.61262566",
"0.61142933",
"0.60255",
"0.5936224",
"0.5931693",
"0.5914368",
"0.5804929",
"0.57755405",
"0.57339466",
"0.5700311",
"0.5699982",
"0.5688197",
"0.56479526",
"0.56327057",
"0.5592907",
"0.55829954",
"0.5574316",
"0.55413604",
"0.553213... | 0.65318024 | 1 |
PATCH/PUT /particular_vacancy_requests/1 PATCH/PUT /particular_vacancy_requests/1.json | def update
respond_to do |format|
if @particular_vacancy_request.update(particular_vacancy_request_params)
format.html { redirect_to @particular_vacancy_request, notice: 'Particular vacancy request was successfully updated.' }
format.json { render :show, status: :ok, location: @particular_vaca... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @vacancy_request_status.update(vacancy_request_status_params)\n format.html { redirect_to @vacancy_request_status, notice: 'Vacancy request status was successfully updated.' }\n format.json { render :show, status: :ok, location: @vacancy_request_status... | [
"0.65082693",
"0.636226",
"0.6341262",
"0.6336886",
"0.62112135",
"0.62034696",
"0.62007356",
"0.61711967",
"0.6151878",
"0.6088192",
"0.6025228",
"0.6020401",
"0.6009375",
"0.5976807",
"0.5976807",
"0.59726",
"0.5967176",
"0.5960515",
"0.5960515",
"0.5960515",
"0.5960515",
... | 0.6873901 | 0 |
DELETE /particular_vacancy_requests/1 DELETE /particular_vacancy_requests/1.json | def destroy
@particular_vacancy_request.destroy
respond_to do |format|
format.html { redirect_to particular_vacancy_requests_url, notice: 'Particular vacancy request was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @vacancy_request_status.destroy\n respond_to do |format|\n format.html { redirect_to vacancy_request_statuses_url, notice: 'Vacancy request status was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/te... | [
"0.7082354",
"0.70644754",
"0.6969625",
"0.6922281",
"0.690967",
"0.6895687",
"0.6832896",
"0.680435",
"0.680435",
"0.680435",
"0.680435",
"0.680435",
"0.680435",
"0.6792371",
"0.67860365",
"0.6760493",
"0.6760493",
"0.6760493",
"0.67599523",
"0.6717919",
"0.6660376",
"0.66... | 0.7386469 | 0 |
FUNCTIONS calculate_ma() buffer buffer with previous samples pos position in buffer, for which we are calculating MA ma_period MA period | def calculate_ma(buffer, pos, ma_period)
ma_period_key = ma_period.to_s
# puts "(calculate_ma) #{pos} buffer.size: #{buffer.size}"
# pp buffer[pos]
# puts "(calculate_ma) nil?: #{buffer[pos].moving_averages.nil?}"
if !buffer[pos].moving_averages[ma_period_key]
if buffer[pos-1].moving_averages[ma_per... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def smoothed_moving_average(idx=nil, tail=nil)\n # Set these manually here since we need the leading SMA.\n if tail.nil?\n idx = self.size - 1 if idx.nil?\n tail = idx / 2\n tail += 1 if idx.odd?\n end\n idx, tail = idx_and_tail_or_defaults(idx, tail)\n valid_for_ma(idx, tail)\n va... | [
"0.5435779",
"0.5310712",
"0.52021134",
"0.5051866",
"0.49505392",
"0.49192634",
"0.48635483",
"0.4802826",
"0.47851416",
"0.47756433",
"0.47187462",
"0.47143376",
"0.4708379",
"0.46874598",
"0.468303",
"0.4682067",
"0.46631634",
"0.46535078",
"0.46430677",
"0.45885926",
"0.4... | 0.8571837 | 0 |
calculate_rsi() buffer buffer with previous samples pos position in buffer, from which we are calculating RSI rsi_period RSI period | def calculate_rsi(buffer, pos, rsi_period)
rsi_period_key = rsi_period.to_s
if !buffer[pos].rsis[rsi_period_key]
# calculate new RSI (slower)
gains = losses = 0
for i in pos-rsi_period+1..pos
diff = buffer[i].avg - buffer[i-1].avg
if diff > 0
gains += diff
else
losse... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_roc(buffer, pos, roc_period)\n\troc_period_key = roc_period.to_s\n\n\tbuffer[pos].rocs[roc_period_key] = (buffer[pos].close_bid - buffer[pos - roc_period].close_bid) / buffer[pos - roc_period].close_bid\nend",
"def get_rsi(sym, interval, time_period, series_type, apikey, limit=nil)\n if sym.is... | [
"0.5225531",
"0.51885617",
"0.47934228",
"0.4584064",
"0.45218828",
"0.45006472",
"0.4486314",
"0.4436552",
"0.43574843",
"0.43370807",
"0.43265963",
"0.4274778",
"0.42742905",
"0.42598847",
"0.4258235",
"0.42308706",
"0.42183286",
"0.419076",
"0.4185844",
"0.4170465",
"0.416... | 0.835756 | 0 |
calculate_roc() buffer buffer with previous samples pos position in buffer, from which we are calculating ROC roc_period ROC period | def calculate_roc(buffer, pos, roc_period)
roc_period_key = roc_period.to_s
buffer[pos].rocs[roc_period_key] = (buffer[pos].close_bid - buffer[pos - roc_period].close_bid) / buffer[pos - roc_period].close_bid
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculate_rsi(buffer, pos, rsi_period)\n rsi_period_key = rsi_period.to_s\n \n if !buffer[pos].rsis[rsi_period_key]\n # calculate new RSI (slower)\n gains = losses = 0\n for i in pos-rsi_period+1..pos\n diff = buffer[i].avg - buffer[i-1].avg\n if diff > 0\n gains += diff\n els... | [
"0.57088935",
"0.4888969",
"0.46064168",
"0.4568765",
"0.45683116",
"0.44781953",
"0.44745034",
"0.44187024",
"0.44149375",
"0.44101894",
"0.44030148",
"0.43436655",
"0.43410096",
"0.43123546",
"0.42852062",
"0.42791483",
"0.42572674",
"0.42512652",
"0.42262295",
"0.4222937",
... | 0.8307193 | 0 |
Place an order, either anonymously or as a logged in user. At least one of email and login must be passed. If both are passed, email will be ignored. Arguments: restaurant_id Ordr.in's restaurant identifier tray A tray of food to order. Should be an ordrin.data.Tray object tip The tip amount delivery_date_time Either '... | def order(restaurant_id, tray, tip, delivery_date_time, first_name, last_name, address, credit_card, email=nil, login=nil)
data = build_dict(restaurant_id, tray, tip, delivery_date_time, first_name, last_name, address, credit_card, email, login)
return call_api(:post, ['o', restaurant_id], login, data)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def order_create_user(restaurant_id, tray, tip, delivery_date_time, first_name, last_name, address, credit_card, email, password)\n data = build_dict(restaurant_id, tray, tip, delivery_date_time, first_name, last_name, address, credit_card, email)\n data['pw'] = Data::UserLogin.hash_password(password)\n ... | [
"0.7239894",
"0.5763595",
"0.57576185",
"0.56548154",
"0.5638094",
"0.54162747",
"0.53827",
"0.53775066",
"0.53772134",
"0.5372341",
"0.5362692",
"0.5334527",
"0.5333149",
"0.5302391",
"0.5297531",
"0.52972853",
"0.5280044",
"0.52743614",
"0.52741003",
"0.52637357",
"0.525021... | 0.75283265 | 0 |
Place an order and create a user account Arguments: restaurant_id Ordr.in's restaurant identifier tray A tray of food to order. Should be an ordrin.data.Tray object tip The tip amount delivery_date_time Either 'ASAP' or a datetime object in the future first_name The orderer's first name last_name The orderer's last nam... | def order_create_user(restaurant_id, tray, tip, delivery_date_time, first_name, last_name, address, credit_card, email, password)
data = build_dict(restaurant_id, tray, tip, delivery_date_time, first_name, last_name, address, credit_card, email)
data['pw'] = Data::UserLogin.hash_password(password)
ret... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def order(restaurant_id, tray, tip, delivery_date_time, first_name, last_name, address, credit_card, email=nil, login=nil)\n data = build_dict(restaurant_id, tray, tip, delivery_date_time, first_name, last_name, address, credit_card, email, login)\n return call_api(:post, ['o', restaurant_id], login, dat... | [
"0.75722855",
"0.650326",
"0.64415884",
"0.64303446",
"0.62874544",
"0.6267379",
"0.6264036",
"0.6261712",
"0.62411743",
"0.61974233",
"0.61452645",
"0.6110958",
"0.6102275",
"0.6102275",
"0.6072403",
"0.60685587",
"0.60654044",
"0.6029949",
"0.6026338",
"0.60239834",
"0.5999... | 0.845416 | 0 |
GET /location_options GET /location_options.json | def index
@location_options = LocationOption.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def locations\n get('locations')\n end",
"def get_location\n as_json(get_results('/locations.json'))\n end",
"def locations(query = {})\n get('location', query)\n end",
"def location(id, options = {})\n get \"locations/#{id}\", options\n end",
"def update\n respond_to do |for... | [
"0.70328426",
"0.68274975",
"0.63969916",
"0.63765955",
"0.6370685",
"0.6327056",
"0.62516236",
"0.62493646",
"0.6248689",
"0.6239475",
"0.6222964",
"0.6208057",
"0.6191587",
"0.6149107",
"0.6142305",
"0.61386085",
"0.6126832",
"0.6048866",
"0.6031058",
"0.6028232",
"0.601819... | 0.7298024 | 0 |
POST /location_options POST /location_options.json | def create
@location_option = LocationOption.new(location_option_params)
respond_to do |format|
if @location_option.save
format.html { redirect_to @location_option, notice: 'Location option was successfully created.' }
format.json { render :show, status: :created, location: @location_opti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def location_option_params\n params.require(:location_option).permit(:name)\n end",
"def dropoff_location_params\n params.require(:dropoff_location).permit(:location, :route_id)\n end",
"def postLocation( location_id, type, country, language, name, formal_name, resolution, population, descripti... | [
"0.70942664",
"0.6453163",
"0.6352913",
"0.6345694",
"0.6324455",
"0.6304136",
"0.6248287",
"0.6222026",
"0.62098587",
"0.6203585",
"0.6189962",
"0.61706394",
"0.6155416",
"0.61377466",
"0.6104002",
"0.60458815",
"0.60229355",
"0.60113883",
"0.60026354",
"0.5993928",
"0.59925... | 0.7188799 | 0 |
PATCH/PUT /location_options/1 PATCH/PUT /location_options/1.json | def update
respond_to do |format|
if @location_option.update(location_option_params)
format.html { redirect_to @location_option, notice: 'Location option was successfully updated.' }
format.json { render :show, status: :ok, location: @location_option }
else
format.html { render :... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n render json: Location.update(params[\"id\"], params[\"location\"])\n end",
"def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"def update\n respond_to do |format|\n ... | [
"0.6435286",
"0.6394723",
"0.6394723",
"0.638415",
"0.638415",
"0.638415",
"0.6369601",
"0.63035077",
"0.62954915",
"0.62690026",
"0.62586546",
"0.62546927",
"0.6238743",
"0.62309647",
"0.62015694",
"0.6179695",
"0.6179671",
"0.6171538",
"0.61671805",
"0.6140685",
"0.61372745... | 0.75171936 | 0 |
DELETE /location_options/1 DELETE /location_options/1.json | def destroy
@location_option.destroy
respond_to do |format|
format.html { redirect_to location_options_url, notice: 'Location option 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 @location = Location.find(params[:id])\n #@client = Client.find(@location.client_ids)\n #@contact = Contact.find(@location.contact_ids)\n \n @location.destroy\n\n respond_to do |format|\n \n format.ht... | [
"0.6846518",
"0.66909695",
"0.6664953",
"0.66390914",
"0.662508",
"0.6610068",
"0.6610068",
"0.6610068",
"0.6610068",
"0.65871227",
"0.6583354",
"0.6574534",
"0.6574534",
"0.6553377",
"0.6549654",
"0.6542746",
"0.6532719",
"0.65306276",
"0.6525655",
"0.6522537",
"0.652208",
... | 0.749293 | 0 |
callseq: numeric.as(alias_name) > a_symbol Returns the number aliased (including 'as') as the aliased name 10.as(:column1) => :"10 as column" | def as(alias_name)
"#{self} as #{alias_name}".to_sym
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_alias as\n @display.print_alias as\n end",
"def alias(name)\n Column.new(jcolumn.as(name))\n end",
"def aliased_name; end",
"def aliased_expression_sql(ae)\n \"#{literal(ae.expression)} AS #{quote_identifier(ae.aliaz)}\"\n end",
"def as(aliased_name)\n @aliased_name = a... | [
"0.61092675",
"0.60138685",
"0.5867335",
"0.58299714",
"0.57218206",
"0.5703125",
"0.5685389",
"0.5664217",
"0.5646369",
"0.5598223",
"0.5533883",
"0.5524191",
"0.5524191",
"0.5462377",
"0.54480255",
"0.54440624",
"0.5418879",
"0.53884494",
"0.528413",
"0.528321",
"0.5232302"... | 0.6826537 | 0 |
GET /idea_likes GET /idea_likes.json | def index
@idea_likes = IdeaLike.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_likes\n user = User.find(params[:user_id])\n likes = user.likes\n render json: likes\n\nend",
"def index\n @likes = Like.all\n render json: @likes, status: 200\n end",
"def likes(options = {})\n urn = options.delete(:urn)\n path = \"/socialActions/#{urn}/likes\"\n ge... | [
"0.7368622",
"0.7336672",
"0.7142892",
"0.70955974",
"0.6948674",
"0.687071",
"0.6868261",
"0.67824",
"0.6752766",
"0.67519456",
"0.6742022",
"0.6732459",
"0.67143196",
"0.6637355",
"0.6630258",
"0.6624302",
"0.66039246",
"0.66016185",
"0.6599977",
"0.6599977",
"0.65829235",
... | 0.7430544 | 0 |
POST /idea_likes POST /idea_likes.json | def create
@idea_like = IdeaLike.new(idea_like_params)
@idea_like.user = current_user
respond_to do |format|
if @idea_like.save
format.html { redirect_to @idea_like, notice: 'Idea like was successfully created.' }
format.json { render :show, status: :created, location: @idea_like }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def postlikes\n render json: @likes.length, status: 200\n end",
"def idea_like_params\n params.require(:idea_like).permit(:idea_id, :user_id, :liked)\n end",
"def create_likes\n end",
"def create_likes\n end",
"def create_likes\n end",
"def create\n @like = Like.new\n @idea = I... | [
"0.7197183",
"0.71681947",
"0.7152165",
"0.7152165",
"0.7152165",
"0.70045024",
"0.6862128",
"0.67854005",
"0.67728215",
"0.6691397",
"0.6676492",
"0.6660709",
"0.66049564",
"0.65882623",
"0.65729964",
"0.65024203",
"0.64754844",
"0.64599",
"0.64476293",
"0.64455074",
"0.6443... | 0.7285531 | 0 |
PATCH/PUT /idea_likes/1 PATCH/PUT /idea_likes/1.json | def update
respond_to do |format|
if @idea_like.update(idea_like_params)
format.html { redirect_to @idea_like, notice: 'Idea like was successfully updated.' }
format.json { render :show, status: :ok, location: @idea_like }
else
format.html { render :edit }
format.json { r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n render json: Like.update(params[\"id\"], params[\"like\"])\n end",
"def update \n @idea = @agenda.ideas.find(params[:id])\n @like = Like.find_by_sql([\"select * from likes where user_id = ? and agenda_id = ? and idea_id = ?\", current_user.id, @agenda.id, @idea.id])\n if @like.s... | [
"0.6891344",
"0.68708676",
"0.66992915",
"0.6594134",
"0.64793134",
"0.64682835",
"0.6422773",
"0.64200455",
"0.6417293",
"0.63681996",
"0.6367021",
"0.6364524",
"0.63641703",
"0.6338285",
"0.6338285",
"0.63277733",
"0.6291797",
"0.62562406",
"0.6242896",
"0.62363726",
"0.622... | 0.71365404 | 0 |
POST /user_card_charge_settings POST /user_card_charge_settings.json | def create
@user_card_charge_setting = UserCardChargeSetting.new(user_card_charge_setting_params)
respond_to do |format|
if @user_card_charge_setting.save
format.html { redirect_to user_card_charge_settings_url, notice: 'User card charge setting was successfully created.' }
else
for... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_user_card_charge_setting\n @user_card_charge_setting = UserCardChargeSetting.find(params[:id])\n end",
"def set_user_card_charge_setting\n @user_card_charge_setting = UserCardChargeSetting.find(params[:id])\n end",
"def user_card_charge_setting_params\n params.require(:user_card_ch... | [
"0.74035674",
"0.74035674",
"0.70962083",
"0.6897114",
"0.6891017",
"0.6841663",
"0.6635234",
"0.6333924",
"0.62715244",
"0.6208443",
"0.6115352",
"0.6094844",
"0.6084682",
"0.6075142",
"0.60642195",
"0.60312444",
"0.6017588",
"0.6015649",
"0.5996654",
"0.5988746",
"0.5947131... | 0.7688849 | 0 |
PATCH/PUT /user_card_charge_settings/1 PATCH/PUT /user_card_charge_settings/1.json | def update
respond_to do |format|
if @user_card_charge_setting.update(user_card_charge_setting_params)
format.html { redirect_to user_card_charge_settings_url, notice: 'User card charge setting was successfully updated.' }
else
format.html { render :edit }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @user_card_charge_setting.update(user_card_charge_setting_params)\n format.html { redirect_to @user_card_charge_setting, notice: 'User card charge setting was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_card_char... | [
"0.7661778",
"0.68361664",
"0.68361664",
"0.62385845",
"0.61533195",
"0.6062237",
"0.6062237",
"0.6033421",
"0.6015336",
"0.5984336",
"0.5956901",
"0.5917844",
"0.5908866",
"0.590732",
"0.5884987",
"0.5882865",
"0.58380955",
"0.5831282",
"0.58287615",
"0.58201146",
"0.5804718... | 0.742792 | 1 |
DELETE /user_card_charge_settings/1 DELETE /user_card_charge_settings/1.json | def destroy
@user_card_charge_setting.destroy
respond_to do |format|
format.html { redirect_to user_card_charge_settings_url, notice: 'User card charge setting was successfully destroyed.' }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @user_card_charge_setting.destroy\n respond_to do |format|\n format.html { redirect_to user_card_charge_settings_url, notice: 'User card charge setting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_tenant_circle(args = {}) \n delete(... | [
"0.75767463",
"0.68808645",
"0.6542166",
"0.6420793",
"0.6384386",
"0.63253653",
"0.6296576",
"0.62885094",
"0.6200431",
"0.61613345",
"0.6145639",
"0.6123447",
"0.6109831",
"0.61070985",
"0.6098547",
"0.60907483",
"0.60856175",
"0.6081306",
"0.60505295",
"0.60505295",
"0.605... | 0.7274275 | 1 |
GET /web/v1/web_car_galleries GET /web/v1/web_car_galleries.json | def index
@web_car_galleries = WebCarGallery.all
render json: @web_car_galleries
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n render json: @web_car_gallery\n end",
"def index\n @galleries = Gallery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @galleries }\n end\n end",
"def index\n @galleries = Gallery.all\n\n respond_to do |format|\n format.h... | [
"0.7646934",
"0.7002292",
"0.7002292",
"0.7002292",
"0.6955521",
"0.68985814",
"0.6725373",
"0.66905546",
"0.66798127",
"0.66489583",
"0.6639122",
"0.6615275",
"0.6576489",
"0.65752923",
"0.6563376",
"0.6563376",
"0.6563376",
"0.6563376",
"0.6563376",
"0.6552534",
"0.6536648"... | 0.8024732 | 0 |
GET /web/v1/web_car_galleries/1 GET /web/v1/web_car_galleries/1.json | def show
render json: @web_car_gallery
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @web_car_galleries = WebCarGallery.all\n\n render json: @web_car_galleries\n end",
"def index\n @galleries = Gallery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @galleries }\n end\n end",
"def index\n @galleries = Gallery.... | [
"0.7803527",
"0.68930775",
"0.68930775",
"0.68930775",
"0.68919027",
"0.6846719",
"0.6787",
"0.67447716",
"0.6728978",
"0.6727987",
"0.66775125",
"0.6656467",
"0.66405666",
"0.6603521",
"0.6583326",
"0.65821266",
"0.65582335",
"0.6545427",
"0.65448296",
"0.6531057",
"0.652804... | 0.7627828 | 1 |
POST /web/v1/web_car_galleries POST /web/v1/web_car_galleries.json | def create
@web_car_gallery = WebCarGallery.new(web_car_gallery_params)
if @web_car_gallery.save
render json: @web_car_gallery, status: :created, location: @web_car_gallery
else
render json: @web_car_gallery.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @web_car_galleries = WebCarGallery.all\n\n render json: @web_car_galleries\n end",
"def show\n render json: @web_car_gallery\n end",
"def create\n @galleries_gallery = @galleries_album.galleries.new(galleries_gallery_params)\n @galleries_gallery.user = current_user\n respond_to ... | [
"0.70455956",
"0.67058897",
"0.6568715",
"0.644923",
"0.64366573",
"0.6377649",
"0.6368586",
"0.6367182",
"0.6365099",
"0.6312377",
"0.62994045",
"0.62994045",
"0.62514555",
"0.6219522",
"0.61586446",
"0.6111952",
"0.60859364",
"0.60709476",
"0.6063549",
"0.6049689",
"0.60496... | 0.77457684 | 0 |
PATCH/PUT /web/v1/web_car_galleries/1 PATCH/PUT /web/v1/web_car_galleries/1.json | def update
@web_car_gallery = WebCarGallery.find(params[:id])
if @web_car_gallery.update(web_car_gallery_params)
head :no_content
else
render json: @web_car_gallery.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @electriccar.update(electriccar_params)\n if params[:images]\n @electriccar.gallery ||= Gallery.new\n params[:images].each do |image|\n @electriccar.gallery.images.create(image: image)\n end\n unless @electriccar... | [
"0.6642831",
"0.65721107",
"0.6493681",
"0.64894015",
"0.6422607",
"0.6418138",
"0.6407203",
"0.6383429",
"0.6372926",
"0.6363743",
"0.6341056",
"0.63245493",
"0.63245493",
"0.6306315",
"0.62643725",
"0.62470084",
"0.6212208",
"0.6200901",
"0.61956775",
"0.61944014",
"0.61663... | 0.7299014 | 0 |
DELETE /web/v1/web_car_galleries/1 DELETE /web/v1/web_car_galleries/1.json | def destroy
@web_car_gallery.destroy
head :no_content
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @photo = Photo.find(params[:id])\n gallery = @photo.gallery\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to gallery_path(gallery) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gallery.destroy\n respond_to do |format|\n ... | [
"0.72788537",
"0.7267374",
"0.7267374",
"0.72623456",
"0.72598857",
"0.7228095",
"0.71787816",
"0.7163467",
"0.7150265",
"0.7141989",
"0.7135728",
"0.71347296",
"0.7130314",
"0.71119654",
"0.7095892",
"0.7090528",
"0.7090528",
"0.7090528",
"0.70803857",
"0.7056705",
"0.704661... | 0.7590966 | 0 |
Switch Roles! String Sum Write a method, string_sum, that accepts a string as an argument and returns the sum of the characters of that string. ie: a > 1, b> 2 .. z > 26. Assume you have an input of only lowercase characters. You may want to definea helper method! (hint hint) | def string_sum(string)
sum = 0
alphabets = ("a".."z").to_a
string.chars.each do |ch|
sum += alphabets.index(ch) + 1
end
sum
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def string_sum(string)\n letters = ('a'..'z').to_a\n sum = 0\n string.split(\"\").each{|x| sum += letters.index(x) + 1}\n sum \nend",
"def strsum(str)\n total = 1\n str.chars.each do |c|\n total = total * c.to_i\n end\n total\nend",
"def scrabble_score(str)\n str = str.upcase.delete(\"^A-Z\")\n re... | [
"0.7474451",
"0.69284135",
"0.6606189",
"0.6482338",
"0.64428544",
"0.64409214",
"0.6423284",
"0.6407134",
"0.63918495",
"0.63838375",
"0.6352246",
"0.6349408",
"0.6282779",
"0.62740874",
"0.6261601",
"0.620875",
"0.619383",
"0.61877185",
"0.61858654",
"0.61499804",
"0.611573... | 0.75132036 | 0 |
A method that defines how to prepend command modifiers to commands. Arguments: +key+ a key identifier of a particular command modifier +command+ a command to apply command modifier on +options+ options for modifier as a Hash Returns: A value of +command+ modified with +key+ command modifier More information: See README... | def prepend(key, command, options = {})
case key
when 'env'
if options['name'] && options['value']
"#{options['name']}=#{options['value']} #{command}"
else
command
end
when 'sudo'
"sudo #{options['args']} #{command}"
when 'g... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_command(key, value)\n return unless key && value\n\n @commands ||= {}\n @commands[key] = value\n end",
"def prepend_commands(_command = '', user_pc = '', _opts = {})\n user_pc\n end",
"def add_command(command, prefix=\"purugin\")\n old_command = command_map.get_command(command.name)\n ... | [
"0.64236313",
"0.6202131",
"0.6101377",
"0.5923708",
"0.5853042",
"0.56344265",
"0.56157434",
"0.5586259",
"0.55695295",
"0.5480131",
"0.54765534",
"0.54546607",
"0.54504275",
"0.54429466",
"0.54119116",
"0.5395139",
"0.53355193",
"0.53305274",
"0.532612",
"0.5322505",
"0.532... | 0.7821295 | 0 |
Sums the distance of the given set of runs (note that the result is in meters). | def distance_sum(runs)
runs.inject(0.0) { |sum, run| sum + run[:metadata][:distance].to_f }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total_distance_driven\n distances = rides.map{ |ride| ride.distance }\n distances.reduce(:+)\n end",
"def total_distance\n distances = self.rides.map { |ride| ride.distance }\n distances.inject(:+).to_f\n end",
"def total_distance\n rides.reduce(0) {|total, ride| total + ride.distance}... | [
"0.7136321",
"0.693355",
"0.6803828",
"0.6803828",
"0.6766138",
"0.6735351",
"0.67287534",
"0.6621927",
"0.64571095",
"0.64002526",
"0.6367796",
"0.6233791",
"0.61836666",
"0.61525154",
"0.61182344",
"0.60892195",
"0.58993274",
"0.58642566",
"0.58617485",
"0.5859748",
"0.5769... | 0.8718122 | 0 |
Estimates what the annual distance total will be given all the runs in the current year. | def estimate(runs)
distance = distance_sum(current_year(runs))
in_km(distance / Time.now.yday.to_f * 365).round(1)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_AnnualDistance(value)\n set_input(\"AnnualDistance\", value)\n end",
"def total_distance_driven\n distances = rides.map{ |ride| ride.distance }\n distances.reduce(:+)\n end",
"def total_years\n all_years = artists.map do |artist|\n artist.years_active\n end\n all_years.... | [
"0.65636945",
"0.63185656",
"0.62857264",
"0.6260739",
"0.62337905",
"0.62337905",
"0.620975",
"0.6042082",
"0.602586",
"0.6010506",
"0.5987366",
"0.59865075",
"0.5978795",
"0.5933467",
"0.5922183",
"0.58936375",
"0.58726805",
"0.58726805",
"0.58425343",
"0.5791389",
"0.57779... | 0.72565067 | 0 |
Estimates what the annual distance total will be given all the runs in the current year but extrapolating using only the activity of the last 30 days. | def estimate_last_30_days(runs)
last_month = Time.now - 30 * 24 * 3600
last_30, other = current_year(runs).
partition { |run|
Time.parse(run[:metadata][:occurred_at_local]) >= last_month
}
distance_last_30 = distance_sum(last_30)
distance_other = distance_sum(other)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def estimate(runs)\n distance = distance_sum(current_year(runs))\n in_km(distance / Time.now.yday.to_f * 365).round(1)\n end",
"def total_annual_rent_collected\n units.map { |unit| unit.is_vacant ? 0 : unit.monthly_rent }.reduce(:+) * 12\n end",
"def set_AnnualDistance(value)\n set_inpu... | [
"0.68241453",
"0.60476357",
"0.59615475",
"0.5814661",
"0.5721604",
"0.5621905",
"0.56042725",
"0.5594929",
"0.556932",
"0.55463254",
"0.55463254",
"0.5499671",
"0.5471951",
"0.54676646",
"0.5455522",
"0.5420802",
"0.540593",
"0.53756016",
"0.5365279",
"0.5362563",
"0.5332675... | 0.72361094 | 0 |
PUT /system_infos/1 PUT /system_infos/1.json | def update
@system_info = SystemInfo.find(params[:id])
@system_info.updated_user = current_user.login_name
respond_to do |format|
if @system_info.update_attributes(params[:system_info])
format.html { redirect_to maint_index_path, notice: 'System info was successfully updated.' }
f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @system_information.update(system_information_params)\n format.html { redirect_to @system_information, notice: 'System information was successfully updated.' }\n format.json { render :show, status: :ok, location: @system_information }\n else\n ... | [
"0.73157704",
"0.7227099",
"0.7176059",
"0.7043396",
"0.7023237",
"0.7022568",
"0.69516826",
"0.691873",
"0.68391013",
"0.6793819",
"0.6762018",
"0.6721423",
"0.6687101",
"0.66248304",
"0.6612292",
"0.6591718",
"0.65010244",
"0.64830357",
"0.643987",
"0.6428987",
"0.636786",
... | 0.73908305 | 0 |
Action to delete a directory in HDFS | def action_delete
if (!dir_exists?(@path))
Chef::Log::info("Directory #{ @path } doesn't exist; delete action not taken")
else
converge_by("Delete #{ @new_resource }") do
@client.delete(@path)
end
new_resource.updated_by_last_action(true)
end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @hdfs_path = HdfsPath.find(params[:id])\n @hdfs_path.destroy\n\n respond_to do |format|\n format.html { redirect_to hdfs_paths_url }\n format.json { head :ok }\n end\n end",
"def delete(rmdir: false)\n # FIXME: rethink this interface... should qdel be idempotent?\n # Af... | [
"0.6841314",
"0.68124616",
"0.6811562",
"0.67804533",
"0.67335725",
"0.6731047",
"0.6612531",
"0.65864706",
"0.650954",
"0.6445801",
"0.6444055",
"0.6403355",
"0.63739115",
"0.6369281",
"0.6337897",
"0.63184494",
"0.6287191",
"0.6284634",
"0.6284356",
"0.6282767",
"0.6279309"... | 0.6990333 | 0 |
Action to change group of a directory in HDFS | def action_chgrp
if @tgroup == nil
Chef::Log::fatal "target group need to be provided to perform chgrp"
elsif (!dir_exists?(@path))
Chef::Log::info("Directory #{ @path } doesn't exist; chmod action not taken")
else
converge_by("chgrp #{ @new_resource }") do
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group=(new_group)\n if @group != new_group\n @dacl.reassign!(@group, new_group)\n @group = new_group\n end\n end",
"def change_group!\n tgt_gid = self.target_group.is_a?(Fixnum) ? self.target_group : Etc.getgrnam(self.target_group).gid\n chown_params = [nil, tgt_gid, self.target]\n... | [
"0.6348116",
"0.62837595",
"0.59827036",
"0.5967874",
"0.5925312",
"0.5802375",
"0.56975794",
"0.56959003",
"0.5673276",
"0.5623468",
"0.5612055",
"0.5578389",
"0.5555759",
"0.55164635",
"0.5514077",
"0.5452196",
"0.5446737",
"0.53937066",
"0.5375687",
"0.5353105",
"0.5351691... | 0.69556534 | 0 |
Action to rename a directory in HDFS | def action_rename
if @tpath == nil
Chef::Log.Fatal "Target path is empty and need to be set for rename action"
elsif (!dir_exists?(@path))
Chef::Log::Error("Source directory #{ @path } doesn't exist; rename action not taken")
else
converge_by("rename #{ @new_resourc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rename(to) File.rename(path, to) end",
"def rename(old_name, new_name); end",
"def rename(old_name, new_name); end",
"def rename( to ) File.rename( expand_tilde, to ) end",
"def rename_file\n\n end",
"def rename oldname, newname\n add \"mv #{oldname} #{newname}\", check_file(newname)\n end",... | [
"0.6599076",
"0.63972515",
"0.63972515",
"0.6283296",
"0.62499386",
"0.6169141",
"0.6078947",
"0.6078401",
"0.59927595",
"0.59927595",
"0.5980086",
"0.58853865",
"0.5828114",
"0.58255553",
"0.5825331",
"0.5776859",
"0.57648283",
"0.57646865",
"0.5741906",
"0.5736266",
"0.5723... | 0.697964 | 0 |
list of most recently saved completed_tasks for each task id buggy?? does this even work?? | def final_completed_tasks
self.tasks.order("created_at DESC").group_by {|t| t.id }.map { |k, v| v.first }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tasks_uncompleted\n tasks_uncompleted = assigned_tasks.uncompleted.order(\"deadline DESC\")\n tasks_uncompleted += executed_tasks.uncompleted.order(\"deadline DESC\")\n tasks_uncompleted.sort_by { |h| h[:deadline] }.reverse!\n end",
"def completed_todos\n todos.completed.order('completed_time DE... | [
"0.7266247",
"0.7094981",
"0.6980611",
"0.6940332",
"0.6928387",
"0.68575597",
"0.6804099",
"0.6759126",
"0.6705747",
"0.66928965",
"0.65859765",
"0.6583926",
"0.65803224",
"0.6576233",
"0.65747476",
"0.6560136",
"0.6553186",
"0.6464655",
"0.6456845",
"0.64493024",
"0.6433525... | 0.8235149 | 0 |
get most recently completed solution to given assignment | def assignment_solution(ass_id)
self.final_completed_assignments.select{ |a| a.assignment_id == ass_id }.first
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def final_completed_assignments \n self.all_completed_assignments.select {|a| a.current }\n end",
"def return_solution_found\n @open.select(&:goal).first\n end",
"def solution\n if @pb_list.empty? then\n return nil\n elsif @pb_list[0].complete? then\n return @pb_list... | [
"0.6569158",
"0.6380956",
"0.63616467",
"0.6288023",
"0.61958885",
"0.6192246",
"0.6172182",
"0.60039157",
"0.5993917",
"0.59644896",
"0.5951866",
"0.5943057",
"0.5818534",
"0.58174336",
"0.5795234",
"0.56346637",
"0.5557703",
"0.5552411",
"0.55394304",
"0.5529733",
"0.551127... | 0.7678159 | 0 |
List of assignments that have been completed | def assignments_completed
self.final_completed_assignments.map { |a| a.assignment }.reject { |a| a.nil? }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def final_completed_assignments \n self.all_completed_assignments.select {|a| a.current }\n end",
"def all_completed_assignments \n self.completed_assignments.order(\"created_at DESC\")\n end",
"def live_assignments\n project_assignments.future_project_assignments(Date.current)\n end",
"def assig... | [
"0.79526514",
"0.7147306",
"0.65428585",
"0.64467305",
"0.64467305",
"0.64467305",
"0.64467305",
"0.64467305",
"0.6431835",
"0.6405044",
"0.63733715",
"0.6367293",
"0.63595337",
"0.6343799",
"0.62965846",
"0.62705857",
"0.62335646",
"0.62255335",
"0.6199349",
"0.61953574",
"0... | 0.8518345 | 0 |
list of most recently submitted completed_assignment for each assignment | def final_completed_assignments
self.all_completed_assignments.select {|a| a.current }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all_completed_assignments \n self.completed_assignments.order(\"created_at DESC\")\n end",
"def assignments_completed\n self.final_completed_assignments.map { |a| a.assignment }.reject { |a| a.nil? }\n end",
"def current_assignment\n assignments.all.map{|a| a unless a.end_date != nil}.compact.fi... | [
"0.7579002",
"0.74420863",
"0.655369",
"0.65285736",
"0.6421752",
"0.63524425",
"0.6080854",
"0.59746504",
"0.5957493",
"0.59256035",
"0.59230244",
"0.58475494",
"0.5846544",
"0.57055795",
"0.5696779",
"0.564619",
"0.5638346",
"0.56365687",
"0.56254786",
"0.56246185",
"0.5624... | 0.76158684 | 0 |
Returns the most recent status (the current status) | def status
statuses.find(:first, :order => "updated_at DESC")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_status\n self.dossier_statuses.order(\"created_at DESC\").limit(1).first\n end",
"def current_status\n Status.find_by(layer_id: id, latest: true).status\n end",
"def last_status; end",
"def current_order_status\n\tmost_recent_order_statuses = order_statuses.order(:updated_at).last(2)\n\tcurr... | [
"0.79668015",
"0.75326437",
"0.75011486",
"0.7260274",
"0.7217847",
"0.70749867",
"0.68908066",
"0.6820675",
"0.67110497",
"0.6622303",
"0.66109085",
"0.6554839",
"0.65421677",
"0.6424318",
"0.6424318",
"0.6400789",
"0.632939",
"0.63278925",
"0.6327439",
"0.63022894",
"0.6301... | 0.7635554 | 1 |
Returns the organizations that have positions matched with this course. | def organizations
positions.collect{|p| p.organization}.uniq.compact
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def organizations\n teams.map do |team|\n team.organization\n end.compact.uniq\n end",
"def organizations\n self.organization_ids.map do |uid|\n MnoEnterprise::Organization.find_by(uid: uid)\n end\n end",
"def organisations\n uri = self.uri\n query = Ruta::Sparql.select.wh... | [
"0.6630533",
"0.66092706",
"0.6266677",
"0.6232782",
"0.6219729",
"0.61407024",
"0.61281157",
"0.60944414",
"0.59835994",
"0.5935034",
"0.5897592",
"0.58353806",
"0.58107626",
"0.5678952",
"0.56663036",
"0.5658221",
"0.56030756",
"0.5588441",
"0.5552198",
"0.55447024",
"0.552... | 0.7460338 | 0 |
Returns all enrollees from all courses attached to this ServiceLearningCourse, including extra enrollees | def enrollees
@course_all_enrollees ||= courses.collect{|c| c.course.all_enrollees}
@enrollees ||= (@course_all_enrollees + extra_enrollees).flatten.uniq #.sort{|x,y| x.fullname <=> y.fullname rescue -1}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def potential_service_learners\n service_learning_courses.collect(&:enrollees)\n end",
"def index\n @enrolments = Enrolment.includes(:student, course: { enrolments: :student }).all\n end",
"def index \n @course_enrollements = current_user.course_enrollements\n end",
"def show_enrolled_cours... | [
"0.67908466",
"0.6530913",
"0.64590174",
"0.63536036",
"0.63363963",
"0.62735045",
"0.62211204",
"0.6005897",
"0.58574283",
"0.57731324",
"0.57175857",
"0.56278545",
"0.5618873",
"0.5589782",
"0.5554223",
"0.5550865",
"0.5538923",
"0.5533909",
"0.5523531",
"0.54788375",
"0.54... | 0.7612592 | 0 |
Returns just the count of enrollees (aka the class_size) in this class. This includes all attached course enrollees. | def enrollee_count
count = 0
courses.each do |c|
count += c.course.all_enrollee_count
end
count += extra_enrollees.size
count
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enrollees\n @course_all_enrollees ||= courses.collect{|c| c.course.all_enrollees}\n @enrollees ||= (@course_all_enrollees + extra_enrollees).flatten.uniq #.sort{|x,y| x.fullname <=> y.fullname rescue -1}\n end",
"def get_enrolmentcount(course_id)\n query = \"select count(*) as count\n ... | [
"0.62376195",
"0.613292",
"0.57768285",
"0.5745039",
"0.5691529",
"0.56662685",
"0.5636044",
"0.5636044",
"0.5636044",
"0.5636044",
"0.5636044",
"0.5636044",
"0.5636044",
"0.5636044",
"0.5613783",
"0.5568133",
"0.5553511",
"0.5550494",
"0.5514737",
"0.5503651",
"0.5475465",
... | 0.7653422 | 0 |
A course is open ("open for registration") when registration_open_time is in the past | def open?
registration_open_time < DateTime.now rescue false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def registration_open?\n today = Date.current\n if self.registration_start_date.blank? || self.registration_end_date.blank?\n false\n end\n\n (registration_start_date..registration_end_date).cover?(today)\n end",
"def registration_open?\n today = Date.current\n if registration_dates_give... | [
"0.7196542",
"0.71756685",
"0.71720016",
"0.6964677",
"0.6945305",
"0.6875672",
"0.68534887",
"0.64797205",
"0.6440607",
"0.63733125",
"0.63348633",
"0.63348633",
"0.62717235",
"0.6204155",
"0.61515826",
"0.6150935",
"0.6133031",
"0.60889614",
"0.6080425",
"0.6040685",
"0.602... | 0.77250785 | 0 |
Toggles the +finalized+ attribute for this course. If marking this course as unfinalized and the course is currently marked as +open+, then unset the +open+ attribute as well. You can also pass a new value (true or false) as a parameter to force it to that value. | def toggle_finalized(value = nil)
if value === nil
new_value = !finalized?
else
new_value = value
end
update_attribute :finalized, new_value
update_attribute :registration_open_time, nil if open? && !finalized?
finalized?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def finalize(bool=true)\n update(:finalized => bool)\n end",
"def set_finalized\n (status == SHIPPED || status == ACCEPTED) && update(status: FINALIZED)\n end",
"def set_final(v, final = true)\n add_state(v)\n if final\n @final[v] = true\n else\n @final.delete... | [
"0.57563424",
"0.5557743",
"0.55096436",
"0.5419214",
"0.5331869",
"0.5098032",
"0.5073015",
"0.50724393",
"0.5048492",
"0.50257987",
"0.49866438",
"0.4975182",
"0.48876646",
"0.4874223",
"0.48612022",
"0.48612022",
"0.47721502",
"0.47704434",
"0.4769891",
"0.47578403",
"0.47... | 0.7839906 | 0 |
Toggles the +open+ attribute for this course by switching registration_open_time between nil and a time in the future. You can also pass a new value (true or false) as a parameter to force it to that value. | def toggle_open(value = nil)
update_attribute :finalized, true if !finalized && !open?
if value === nil
new_value = self.open? ? nil : '1900-01-01 00:00:00'
else
new_value = (value == true || value == "true") ? '1900-01-01 00:00:00' : nil
end
update_attribute :registration_open_time, new... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def open?\n registration_open_time < DateTime.now rescue false\n end",
"def open!\n self.update_attributes!({:status => Constants::TaskSubmissionStatus::OPEN, :open_at => Time.now})\n end",
"def toggle_open\n @event = Event.find(params[:id])\n @event.toggle! :is_open\n adj = @event.is_open? ? ... | [
"0.63656986",
"0.62070966",
"0.57409096",
"0.55737996",
"0.5557208",
"0.5469354",
"0.5448694",
"0.5359826",
"0.5306867",
"0.52830917",
"0.5269331",
"0.5228111",
"0.5227142",
"0.5223314",
"0.5198533",
"0.5148163",
"0.51035386",
"0.50951105",
"0.5089394",
"0.50744355",
"0.50716... | 0.80131525 | 0 |
Collects all of the ContactHistory items from each of the instructors for this course. This is useful for adding contact history logs to site notes. | def contact_histories
@contact_histories ||= instructors.collect(&:contact_histories).flatten
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def contact_histories\n @contact_histories ||= contacts.collect(&:contact_histories) + former_contacts.collect(&:contact_histories).flatten\n end",
"def contacts\n @contacts ||= @ab.people.map {|abperson| Macabee::Contact.new(abperson, :macabee => self)}\n end",
"def getContacts\n @contact_list.each... | [
"0.5795445",
"0.57870704",
"0.54788315",
"0.54686564",
"0.5447976",
"0.53897434",
"0.5336102",
"0.53190005",
"0.5303053",
"0.5293458",
"0.523315",
"0.52260774",
"0.5176781",
"0.5149363",
"0.5148604",
"0.51325595",
"0.5126933",
"0.5120511",
"0.50845283",
"0.50693864",
"0.50441... | 0.69112635 | 0 |
Sleep for a period of time, if a value is set in the config. | def sleep_if_set
config[:sleep].to_i.times do
print '.'
sleep 1
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sleep_if_set\n sleep_sec = config[:sleep].to_i\n if sleep_sec > 0\n info(\"Sleep #{config[:sleep]} seconds...\")\n sleep sleep_sec\n end\n end",
"def sleep_for\n @sleep_for ||= 5\n end",
"def sleep_until(t)\n dt = (t - Time.zone.now).ceil \n... | [
"0.8197127",
"0.7309742",
"0.7137127",
"0.7115284",
"0.6961691",
"0.6957188",
"0.6928292",
"0.6853752",
"0.6778863",
"0.673961",
"0.6714947",
"0.66563207",
"0.6567179",
"0.65557355",
"0.6528282",
"0.65243006",
"0.6513746",
"0.64916074",
"0.6472404",
"0.6446026",
"0.63578874",... | 0.7512509 | 1 |
Returns an Array of test suite filenames for the related suite currently residing on the local workstation. Any special provisionerspecific directories (such as a Chef roles/ directory) are excluded. | def local_suite_files
base = File.join(config[:test_base_path], config[:suite_name])
glob = File.join(base, '*/**/*')
Dir.glob(glob).reject do |f|
chef_data_dir?(base, f) || File.directory?(f)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def local_suite_files\n base = File.join(config[:test_base_path], config[:suite_name])\n Util.safe_glob(base, \"*/**/*\").reject do |f|\n chef_data_dir?(base, f) || File.directory?(f)\n end\n end",
"def local_suite_files\n base = File.join(config[:test_base_path], config... | [
"0.78132063",
"0.7724421",
"0.7331156",
"0.68357885",
"0.67954403",
"0.6507854",
"0.64600414",
"0.63485444",
"0.62306416",
"0.6225517",
"0.6060312",
"0.60499203",
"0.6022347",
"0.6016276",
"0.6007407",
"0.5999928",
"0.5973733",
"0.59580344",
"0.5874079",
"0.5867162",
"0.58502... | 0.7778414 | 1 |
Copies all test suite files into the suites directory in the sandbox. | def prepare_suites
base = File.join(config[:test_base_path], config[:suite_name])
debug("Creating local sandbox of all test suite files in #{base}")
local_suite_files.each do |src|
dest = File.join(sandbox_suites_dir, src.sub("#{base}/", ''))
FileUtils.mkdir_p(File.dirname(de... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prepare_suites\n base = File.join(config[:test_base_path], config[:suite_name])\n\n local_suite_files.each do |src|\n dest = File.join(sandbox_suites_dir, src.sub(\"#{base}/\", \"\"))\n FileUtils.mkdir_p(File.dirname(dest))\n FileUtils.cp(src, dest, preserve: true)\n ... | [
"0.7996524",
"0.7270486",
"0.6578292",
"0.65644443",
"0.64750075",
"0.64406824",
"0.634492",
"0.6055599",
"0.59699136",
"0.593252",
"0.59111947",
"0.5869472",
"0.5857117",
"0.5853505",
"0.5848918",
"0.5848192",
"0.57820666",
"0.57689583",
"0.571325",
"0.56107",
"0.56038487",
... | 0.8156357 | 0 |
save this account payload to database. | def save
wallet.db.save_account(self)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save\n wallet.db.save_account(self)\n save_key(0, receive_depth, derive_key(0, receive_depth)) if receive_depth.zero?\n save_key(1, change_depth, derive_key(1, change_depth)) if change_depth.zero?\n end",
"def save\n @connection.transactions.save\n end",
"def save\n s... | [
"0.65570545",
"0.6490451",
"0.6489785",
"0.64129543",
"0.63612616",
"0.6349385",
"0.63160974",
"0.6295213",
"0.628145",
"0.62490934",
"0.6202855",
"0.6188706",
"0.6182624",
"0.6181012",
"0.6179916",
"0.6179916",
"0.61690176",
"0.6149792",
"0.61090285",
"0.61063623",
"0.610196... | 0.7314271 | 0 |
get the list of derived keys for receive key. | def derived_receive_keys
receive_depth.times.map{|i|derive_key(0,i)}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def derived_receive_keys\n (receive_depth + 1).times.map{|i|derive_key(0,i)}\n end",
"def list\n @keychain.keys\n end",
"def recovery_keys\n return @recovery_keys\n end",
"def claimed_keys\n [key]\n end",
"def keys\n @ledger.keys\n e... | [
"0.7512339",
"0.64598036",
"0.64001185",
"0.63252944",
"0.62728536",
"0.6221244",
"0.62150574",
"0.61945623",
"0.61648744",
"0.61393034",
"0.61282337",
"0.61005825",
"0.60736024",
"0.6065422",
"0.6062432",
"0.6062432",
"0.60497403",
"0.6035751",
"0.60336256",
"0.60261893",
"0... | 0.74863034 | 1 |
get the list of derived keys for change key. | def derived_change_keys
change_depth.times.map{|i|derive_key(1,i)}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def derived_change_keys\n (change_depth + 1).times.map{|i|derive_key(1,i)}\n end",
"def derived_receive_keys\n (receive_depth + 1).times.map{|i|derive_key(0,i)}\n end",
"def list_keys()\n # TODO\n end",
"def list\n @keychain.keys\n end",
"def keys\n @ledger.ke... | [
"0.7791363",
"0.65116936",
"0.64646864",
"0.6463939",
"0.64396423",
"0.64187515",
"0.6317661",
"0.6283518",
"0.6227268",
"0.62185234",
"0.61957",
"0.618056",
"0.6134058",
"0.6116327",
"0.6108465",
"0.6105081",
"0.60959166",
"0.60814923",
"0.6071048",
"0.6070085",
"0.60538334"... | 0.77481335 | 1 |
p windowed_max_range_q([1, 0, 2, 5, 4, 8], 3) p windowed_max_range_q([1, 0, 2, 5, 4, 8], 2) p windowed_max_range_q([1, 0, 2, 5, 4, 8], 4) p windowed_max_range_q([1, 3, 2, 5, 4, 8], 5) FILO O(n) | def windowed_max_range_s(arr, window_size)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def windowed_max_range(array, w)\nend",
"def windowed_max_range(arr, w) # o(n^2)\n current_max_range = 0\n\n arr.each_index do |i|\n window = arr[i...i+w]\n max = window.max\n min = window.min\n if max - min > current_max_range\n current_max_range = max - min\n ... | [
"0.84691477",
"0.8351951",
"0.83311146",
"0.82900834",
"0.8242812",
"0.8238768",
"0.82349837",
"0.81255364",
"0.8115406",
"0.8114174",
"0.81130344",
"0.8093126",
"0.80804455",
"0.80737984",
"0.8065286",
"0.80608183",
"0.80585873",
"0.8040389",
"0.8037895",
"0.8036417",
"0.802... | 0.8373283 | 1 |
GET /zombies or /zombies.json | def index
@zombies = Zombie.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @zombie = Zombie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @zombie }\n end\n end",
"def index\n @enemies = Enemy.find_by(name: params[:name])\n render json: @enemies\n end",
"def index\n @heroes = Hero.all\n\... | [
"0.6102428",
"0.59455734",
"0.59280014",
"0.5878537",
"0.58366996",
"0.58311063",
"0.58255833",
"0.5824023",
"0.57854337",
"0.5721097",
"0.565715",
"0.56222695",
"0.5603027",
"0.5600307",
"0.559088",
"0.55903745",
"0.5587271",
"0.5579865",
"0.55785483",
"0.5575003",
"0.555276... | 0.6470942 | 0 |
POST /zombies or /zombies.json | def create
@zombie = Zombie.new(zombie_params)
respond_to do |format|
if @zombie.save
format.html { redirect_to @zombie, notice: "Zombie was successfully created." }
format.json { render :show, status: :created, location: @zombie }
else
format.html { render :new, status: :un... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @zombie = Zombie.new(params[:zombie])\n\n respond_to do |format|\n if @zombie.save\n format.html { redirect_to @zombie, notice: 'Zombie was successfully created.' }\n format.json { render json: @zombie, status: :created, location: @zombie }\n else\n format.html { r... | [
"0.6249944",
"0.5771144",
"0.56932646",
"0.5565891",
"0.5531412",
"0.5524862",
"0.5378499",
"0.5360887",
"0.5335001",
"0.5332873",
"0.53173447",
"0.53162575",
"0.5280445",
"0.52595896",
"0.5254839",
"0.52345955",
"0.5210052",
"0.5200307",
"0.5200307",
"0.51783407",
"0.5173734... | 0.6211072 | 1 |
DELETE /zombies/1 or /zombies/1.json | def destroy
@zombie.destroy
respond_to do |format|
format.html { redirect_to zombies_url, notice: "Zombie was successfully destroyed." }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @zombie = Zombie.find(params[:id])\n @zombie.destroy\n\n respond_to do |format|\n format.html { redirect_to zombies_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @baton = Baton.find(params[:id])\n @baton.destroy\n\n respond_to do |format|\n forma... | [
"0.7405988",
"0.6661604",
"0.65965784",
"0.659567",
"0.659567",
"0.65934795",
"0.6527057",
"0.6514347",
"0.64710736",
"0.64582914",
"0.6457194",
"0.64509815",
"0.6405798",
"0.64006156",
"0.6398097",
"0.6395634",
"0.63901067",
"0.6383579",
"0.63808167",
"0.6380282",
"0.6379004... | 0.704211 | 1 |
GET /testers/new GET /testers/new.json | def new
@tester = Tester.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @tester }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @trainer = Trainer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trainer }\n end\n end",
"def new\n @taker = Taker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @taker }\n end\n... | [
"0.6962195",
"0.69151735",
"0.6797101",
"0.6740798",
"0.67218655",
"0.66921884",
"0.66770256",
"0.66667867",
"0.66547906",
"0.66263324",
"0.6624583",
"0.6603575",
"0.66005915",
"0.65907985",
"0.659051",
"0.659051",
"0.6575085",
"0.6558192",
"0.6548493",
"0.6535393",
"0.652814... | 0.7707258 | 0 |
This makes the sign out requests manually, since it's a delete request and woudl require jquery_ujs and a JavaScript driver. This involves manually following two redirects one to HTTPS (not sure why) and the other to follow the real redirection after signing out back to the root url. This doesn't actually test the Sign... | def sign_out
# Make a delete request
page.driver.delete destroy_educator_session_path
# Follow https, make same delete request.
page.driver.delete page.driver.response.location
# Follow redirection back to root.
page.visit page.driver.response.location
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sign_out\n @logout = true\n authenticate_api_user\n @logout = false\n revoke_access if @current_user\n head :no_content\n end",
"def sign_out\n click_link 'Sign out'\n end",
"def signout\n self.oaw_signout\n redirect_to root_url\n end",
"def sign_out\n\n # mark them as s... | [
"0.7378535",
"0.72663176",
"0.72381496",
"0.7098595",
"0.70972097",
"0.6945436",
"0.6929373",
"0.6911991",
"0.68835396",
"0.6849793",
"0.68343514",
"0.6832576",
"0.68175846",
"0.6806482",
"0.67639965",
"0.67333275",
"0.67314917",
"0.67200965",
"0.67137104",
"0.66971815",
"0.6... | 0.8007933 | 0 |
GET /calevents/new GET /calevents/new.json | def new
@calevent = Calevent.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @calevent }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @create_event = CreateEvent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @create_event }\n end\n end",
"def new\n @event = Event.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event ... | [
"0.7442916",
"0.7368949",
"0.7338966",
"0.7338966",
"0.7338966",
"0.7338966",
"0.7338966",
"0.7338966",
"0.7338966",
"0.7338966",
"0.7338966",
"0.7338966",
"0.7338966",
"0.7338966",
"0.7338966",
"0.7338966",
"0.7338966",
"0.7338966",
"0.7338966",
"0.7338966",
"0.7338966",
"... | 0.77817583 | 0 |
POST /calevents POST /calevents.json | def create
@calevent = Calevent.new(params[:calevent])
respond_to do |format|
if @calevent.save
format.html { redirect_to @calevent, notice: 'Calevent was successfully created.' }
format.json { render json: @calevent, status: :created, location: @calevent }
else
format.html ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n Rails.logger.debug(\"Received event #{params[:event]}\")\n head :ok\n end",
"def create_event event, data={}\n data[:event] = event\n post '/event', data\n end",
"def create\n megam_rest.post_event(to_hash)\n end",
"def create\n @event = Event.new(params[:eve... | [
"0.70920014",
"0.68434405",
"0.6698906",
"0.6642797",
"0.6633777",
"0.6621416",
"0.65656906",
"0.6492501",
"0.64817655",
"0.6473674",
"0.6462456",
"0.64461863",
"0.64037997",
"0.6400071",
"0.6397002",
"0.63946897",
"0.63884985",
"0.6370318",
"0.6359371",
"0.6342026",
"0.63386... | 0.69153863 | 1 |
DELETE /calevents/1 DELETE /calevents/1.json | def destroy
@calevent = Calevent.find(params[:id])
@calevent.destroy
respond_to do |format|
format.html { redirect_to calevents_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format... | [
"0.67516613",
"0.67516613",
"0.67516613",
"0.6734472",
"0.6666435",
"0.66659874",
"0.6643644",
"0.6637121",
"0.6632188",
"0.6626163",
"0.66203195",
"0.66181284",
"0.6605952",
"0.6583814",
"0.65733236",
"0.6561942",
"0.656068",
"0.65571547",
"0.65540457",
"0.655252",
"0.654966... | 0.74800736 | 0 |
GET /sub_collections GET /sub_collections.json | def index
@sub_collections = SubCollection.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subcollections\n respond_to?(:collectionHasSubcollection) ? collectionHasSubcollection : []\n end",
"def member_subcollections\n verbose = true # || hyrax_collections_controller_behavior_debug_verbose\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ... | [
"0.7712317",
"0.75861424",
"0.7097717",
"0.6850106",
"0.68412006",
"0.6754995",
"0.66662145",
"0.6649722",
"0.66495883",
"0.65358025",
"0.65267384",
"0.6442815",
"0.6361733",
"0.63443774",
"0.6341646",
"0.6239634",
"0.6191265",
"0.61912525",
"0.61866266",
"0.61656845",
"0.615... | 0.78707093 | 0 |
DELETE /sub_collections/1 DELETE /sub_collections/1.json | def destroy
@sub_collection.destroy
respond_to do |format|
format.html { redirect_to sub_collections_url, notice: 'Sub collection was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @collection = Collection.find(params[:id])\n \n #destroy all child documents\n @collection.documents.each do |d|\n upload_remove(d) #Removes upload record if file is deleted\n d.destroy\n end\n \n #destroy all child collections\n @collection.collections.each do |c|\... | [
"0.76000696",
"0.7213829",
"0.71520644",
"0.6953183",
"0.68216157",
"0.6786444",
"0.67736536",
"0.6735894",
"0.6701298",
"0.6701298",
"0.6701298",
"0.6701298",
"0.6691473",
"0.6678001",
"0.6676651",
"0.66584194",
"0.66455716",
"0.6622126",
"0.6610208",
"0.6607078",
"0.6602838... | 0.78883284 | 0 |
Find all adapters for application's supported configuration files Returns the array of valid adapters found | def find_adapters_from_path
@@supported_files.each do |file|
path = File.expand_path("#{self.path}/#{file}")
if File.exists?(path)
adapter = Adapter.new(path, self)
self.adapters << adapter if adapter.valid?
end
end
self.adapters
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def configured_adapters\n # Get our adapters as above.\n adapters = ADAPTERS.dup\n\n # Get all configured custom adapters and iterate over them.\n QuirkyApi.adapters.all.each do |configured_adapter|\n # Get the index of the adapter that will be used to determine\n # pl... | [
"0.6935848",
"0.6857157",
"0.6618489",
"0.64874303",
"0.64622426",
"0.64108866",
"0.63969904",
"0.6220636",
"0.6211185",
"0.6183559",
"0.61525095",
"0.59660727",
"0.59503853",
"0.58868814",
"0.58868814",
"0.5872048",
"0.58651835",
"0.5862851",
"0.5861012",
"0.5850501",
"0.577... | 0.7488972 | 0 |
Establish connection to each of application's adapters | def connect
return if connected?
self.adapters.each{|adapter| adapter.connect }
self.connected = true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def drivers\n send :adapters\n end",
"def adapters\n @adapters ||= {}\n end",
"def establish_connections\n klass = Struct.new(:ip,:port)\n if t_servers = BackgrounDRb::BDRB_CONFIG[:client]\n connections = t_servers.split(',')\n connections.each do |conn_string|\n ... | [
"0.67336905",
"0.6634686",
"0.66214025",
"0.6573215",
"0.6462829",
"0.64196086",
"0.6245673",
"0.6210779",
"0.6183927",
"0.6143556",
"0.6133551",
"0.6095838",
"0.6069833",
"0.6062096",
"0.5996127",
"0.5965465",
"0.5924617",
"0.59167016",
"0.58743817",
"0.5854216",
"0.5852999"... | 0.6782358 | 0 |
Addition of two Box Objects | def +(other)
Box.new(@width+other.width,@height+other.height)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def +(other)\n Box.new(@width + other.width, @heigth + other.heigth)\n end",
"def +(other)\n if @x1 > other.x1 then x1 = other.x1 else x1 = @x1 end\n if @y1 > other.y1 then y1 = other.y1 else y1 = @y1 end\n if @x2 < other.x2 then x2 = other.x2 else x2 = @x2 end\n if @y2 < other.y2 then y2 = other... | [
"0.7570592",
"0.6720017",
"0.6467614",
"0.6429663",
"0.63696337",
"0.6307779",
"0.62718713",
"0.6222721",
"0.614775",
"0.6123894",
"0.61138463",
"0.61062944",
"0.61062944",
"0.61062944",
"0.60618424",
"0.6027065",
"0.60169053",
"0.5997102",
"0.5996717",
"0.5995829",
"0.599209... | 0.7519827 | 1 |
GET /fundamental/retention_mails GET /fundamental/retention_mails.json | def index
@fundamental_retention_mails = Fundamental::RetentionMail.paginate(:order => 'id', :page => params[:page], :per_page => 50)
respond_to do |format|
format.html # index.html.erb
format.json { render json: @fundamental_retention_mails }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @fundamental_retention_mail = Fundamental::RetentionMail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fundamental_retention_mail }\n end\n end",
"def destroy\n @fundamental_retention_mail = Fundamental::RetentionMail.fi... | [
"0.6456633",
"0.6372019",
"0.61892575",
"0.6027708",
"0.5978857",
"0.58478034",
"0.5543205",
"0.5529537",
"0.5518118",
"0.55083483",
"0.5393833",
"0.5390482",
"0.5390482",
"0.53852874",
"0.53737015",
"0.5350541",
"0.53391784",
"0.532894",
"0.53012747",
"0.52928734",
"0.529239... | 0.6525468 | 0 |
GET /fundamental/retention_mails/1 GET /fundamental/retention_mails/1.json | def show
@fundamental_retention_mail = Fundamental::RetentionMail.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @fundamental_retention_mail }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @fundamental_retention_mails = Fundamental::RetentionMail.paginate(:order => 'id', :page => params[:page], :per_page => 50) \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fundamental_retention_mails }\n end\n end",
"def destroy\n @fu... | [
"0.6640544",
"0.6528672",
"0.6466714",
"0.5886447",
"0.5829534",
"0.5822673",
"0.5567608",
"0.54504275",
"0.5447484",
"0.5438527",
"0.5404745",
"0.54000664",
"0.53942716",
"0.53552043",
"0.53539157",
"0.5311678",
"0.52987987",
"0.529165",
"0.5204795",
"0.5193434",
"0.5187932"... | 0.6909607 | 0 |
GET /fundamental/retention_mails/new GET /fundamental/retention_mails/new.json | def new
@fundamental_retention_mail = Fundamental::RetentionMail.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @fundamental_retention_mail }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @fundamental_retention_mail = Fundamental::RetentionMail.new(params[:fundamental_retention_mail])\n\n respond_to do |format|\n if @fundamental_retention_mail.save\n format.html { redirect_to @fundamental_retention_mail, notice: 'Retention mail was successfully created.' }\n fo... | [
"0.7026378",
"0.6233353",
"0.6213591",
"0.61481655",
"0.60877556",
"0.6084751",
"0.60028934",
"0.5996761",
"0.59950924",
"0.5970043",
"0.59314865",
"0.5927262",
"0.59123164",
"0.5910811",
"0.58604676",
"0.5849446",
"0.5848204",
"0.5848204",
"0.5848204",
"0.5848204",
"0.584650... | 0.75896686 | 0 |
POST /fundamental/retention_mails POST /fundamental/retention_mails.json | def create
@fundamental_retention_mail = Fundamental::RetentionMail.new(params[:fundamental_retention_mail])
respond_to do |format|
if @fundamental_retention_mail.save
format.html { redirect_to @fundamental_retention_mail, notice: 'Retention mail was successfully created.' }
format.json {... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @fundamental_retention_mail = Fundamental::RetentionMail.find(params[:id])\n @fundamental_retention_mail.destroy\n\n respond_to do |format|\n format.html { redirect_to fundamental_retention_mails_url }\n format.json { head :ok }\n end\n end",
"def retention_params\n para... | [
"0.616706",
"0.56887245",
"0.56470793",
"0.55028886",
"0.5371865",
"0.53371155",
"0.5265803",
"0.52365696",
"0.52365696",
"0.51953906",
"0.51536036",
"0.513025",
"0.5106394",
"0.50519526",
"0.4994663",
"0.49909845",
"0.4983734",
"0.4890997",
"0.48803517",
"0.48708966",
"0.486... | 0.65579134 | 0 |
PUT /fundamental/retention_mails/1 PUT /fundamental/retention_mails/1.json | def update
@fundamental_retention_mail = Fundamental::RetentionMail.find_by_identifier(params[:id])
respond_to do |format|
if !@fundamental_retention_mail.nil? && !@fundamental_retention_mail.redeem_credit_reward
format.html { redirect_to @fundamental_retention_mail, notice: 'Retention mail was s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @fundamental_retention_mail = Fundamental::RetentionMail.find(params[:id])\n @fundamental_retention_mail.destroy\n\n respond_to do |format|\n format.html { redirect_to fundamental_retention_mails_url }\n format.json { head :ok }\n end\n end",
"def update\n respond_to do |f... | [
"0.6348225",
"0.61036325",
"0.5924873",
"0.588579",
"0.56736976",
"0.5488617",
"0.5384395",
"0.53564525",
"0.52516675",
"0.5246302",
"0.52396816",
"0.5130699",
"0.50616837",
"0.49764302",
"0.49388972",
"0.4924884",
"0.48903587",
"0.48758355",
"0.48750365",
"0.484398",
"0.4839... | 0.61951154 | 1 |
DELETE /fundamental/retention_mails/1 DELETE /fundamental/retention_mails/1.json | def destroy
@fundamental_retention_mail = Fundamental::RetentionMail.find(params[:id])
@fundamental_retention_mail.destroy
respond_to do |format|
format.html { redirect_to fundamental_retention_mails_url }
format.json { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @dailymail.destroy\n respond_to do |format|\n format.html { redirect_to dailymails_url, notice: 'Dailymail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @retention.destroy\n respond_to do |format|\n format.html { redire... | [
"0.66651464",
"0.6589697",
"0.65295154",
"0.64419734",
"0.64155185",
"0.64080626",
"0.63827944",
"0.63100743",
"0.6309177",
"0.62958306",
"0.6288858",
"0.62704015",
"0.6261359",
"0.624426",
"0.6241057",
"0.62374157",
"0.62345475",
"0.623145",
"0.6222997",
"0.61935955",
"0.617... | 0.74815637 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.