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 |
|---|---|---|---|---|---|---|
Cancels portforwarding over an open port that was previously opened via open. | def close(port)
ensure_open!
@session_mutex.synchronize do
@session.forward.cancel_local(port)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cancel_local(port, bind_address = \"127.0.0.1\")\n socket = @local_forwarded_ports.delete([port, bind_address])\n socket.shutdown rescue nil\n socket.close rescue nil\n session.stop_listening_to(socket)\n end",
"def cancel_local(port, bind_address = T.unsafe(nil)); ... | [
"0.7112441",
"0.7064418",
"0.67585486",
"0.6501189",
"0.61969423",
"0.60669774",
"0.59421724",
"0.5924839",
"0.5902422",
"0.5875262",
"0.5856223",
"0.5785674",
"0.57850367",
"0.5779165",
"0.5775607",
"0.5671559",
"0.56358856",
"0.56114525",
"0.55889684",
"0.55532396",
"0.5510... | 0.74833685 | 0 |
Forwards a new connection to the given +host+ and opens a new Net::SSH connection to that host over the forwarded port. If a block is given, the new SSH connection will be yielded to the block, and autoclosed when the block terminates. The forwarded port will be autoclosed as well. If no block was given, the new SSH co... | def ssh(host, user, options={}, &block)
local_port = open(host, options[:port] || 22)
begin
Net::SSH.start("127.0.0.1", user, options.merge(:port => local_port), &block)
ensure
close(local_port) if block || $!
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connect(&block)\n begin\n Puppet.debug \"Trying to connect to #{host} as #{user}\"\n @ssh = Net::SSH.start(host, user, :port => port, :password => password, :timeout => timeout,\n :paranoid => Net::SSH::Verifiers::Null.new,\n :global_known_host... | [
"0.667865",
"0.6622895",
"0.6585959",
"0.65184796",
"0.65105474",
"0.6325242",
"0.63044375",
"0.6153876",
"0.61500454",
"0.5998342",
"0.59711075",
"0.59636354",
"0.592361",
"0.59157026",
"0.5911581",
"0.58591515",
"0.5851079",
"0.58098876",
"0.5755457",
"0.5739815",
"0.573837... | 0.6881019 | 0 |
Fires up the gateway session's event loop within a thread, so that it can run in the background. The loop will run for as long as the gateway remains active. | def initiate_event_loop!
@active = true
@thread = Thread.new do
while @active
@session_mutex.synchronize do
@session.process(@loop_wait)
end
Thread.pass
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initiate_event_loop!\n @active = true\n\n @thread = Thread.new do\n while @active\n @session_mutex.synchronize do\n @session.process(@loop_wait)\n end\n Thread.pass\n end\n end\n end",
"def initiate_event_loop!\n @active = true\n\n @thread = Thread.new ... | [
"0.75273687",
"0.75273687",
"0.6778597",
"0.6776726",
"0.65935516",
"0.6338257",
"0.6312367",
"0.62696093",
"0.62384677",
"0.62192553",
"0.62192553",
"0.6191421",
"0.6167673",
"0.6124374",
"0.6072367",
"0.6067272",
"0.60656357",
"0.6058388",
"0.6055593",
"0.60496515",
"0.6042... | 0.75291336 | 0 |
Grabs the next available port number and returns it. | def next_port
@port_mutex.synchronize do
port = @next_port
@next_port -= 1
@next_port = MAX_PORT if @next_port < MIN_PORT
port
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def newPort()\n \"Return the next port number to allocate.\"\n if @ports.length > 0\n return @ports.values.max + 1\n end \n return @@portBase\n end",
"def find_port(port)\n port += 1 while port_bound?('127.0.0.1', port)\n port\nend",
"def next_port(current_port)\n port_idx = $starport.i... | [
"0.78795767",
"0.7836055",
"0.76489466",
"0.72559255",
"0.69754887",
"0.69261026",
"0.68737406",
"0.6817491",
"0.6762377",
"0.67108077",
"0.6672163",
"0.6647139",
"0.65912706",
"0.65912706",
"0.65258646",
"0.648529",
"0.6475843",
"0.641776",
"0.6355213",
"0.6328826",
"0.63049... | 0.8273274 | 0 |
GET /reconocimientos/new GET /reconocimientos/new.json | def new
@reconocimiento = Reconocimiento.new
respond_to do |format|
format.html # new.html.erb
format.json { render :json => @reconocimiento }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @recurso = Recurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recurso }\n end\n end",
"def new\n @requerimiento = Requerimiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @re... | [
"0.76695406",
"0.74123406",
"0.74081475",
"0.73970854",
"0.7368043",
"0.7364398",
"0.73451656",
"0.73398584",
"0.73379713",
"0.7311203",
"0.7292536",
"0.7281994",
"0.7277353",
"0.7268832",
"0.7261227",
"0.7249047",
"0.7244958",
"0.72278595",
"0.72267944",
"0.7206878",
"0.7193... | 0.75282466 | 1 |
POST /reconocimientos POST /reconocimientos.json | def create
@reconocimiento = Reconocimiento.new(params[:reconocimiento])
respond_to do |format|
if @reconocimiento.save
format.html { redirect_to @reconocimiento, :notice => 'Reconocimiento was successfully created.' }
format.json { render :json => @reconocimiento, :status => :created, :l... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @respuesta = Respuesta.new(params[:respuesta])\n\n if @respuesta.save\n render json: @respuesta, status: :created, location: @respuesta\n else\n render json: @respuesta.errors, status: :unprocessable_entity\n end\n end",
"def troca\n @remetente = Sobrevivente.where(id: para... | [
"0.6459032",
"0.639759",
"0.63623786",
"0.6337768",
"0.6313945",
"0.6293441",
"0.62898445",
"0.62786686",
"0.6277767",
"0.6224727",
"0.6212859",
"0.61706305",
"0.61546373",
"0.61454976",
"0.613624",
"0.61257786",
"0.6115234",
"0.61062664",
"0.6101606",
"0.6067426",
"0.6057374... | 0.67462194 | 0 |
PUT /reconocimientos/1 PUT /reconocimientos/1.json | def update
@reconocimiento = Reconocimiento.find(params[:id])
respond_to do |format|
if @reconocimiento.update_attributes(params[:reconocimiento])
format.html { redirect_to @reconocimiento, :notice => 'Reconocimiento was successfully updated.' }
format.json { head :no_content }
else... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @objeto.update(caracteristica_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Caracteristica was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.htm... | [
"0.6117766",
"0.60987276",
"0.60760444",
"0.6072271",
"0.60700226",
"0.60655284",
"0.6061607",
"0.605112",
"0.6042711",
"0.60331666",
"0.6028737",
"0.60264874",
"0.60219234",
"0.6018105",
"0.60055786",
"0.6003541",
"0.5990979",
"0.59893185",
"0.59801656",
"0.59630406",
"0.595... | 0.6155434 | 0 |
DELETE /reconocimientos/1 DELETE /reconocimientos/1.json | def destroy
@reconocimiento = Reconocimiento.find(params[:id])
@reconocimiento.destroy
respond_to do |format|
format.html { redirect_to reconocimientos_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @relogio = Relogio.find(params[:id])\n @relogio.destroy\n\n respond_to do |format|\n format.html { redirect_to relogios_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @consumo = Consumo.find(params[:id])\n @consumo.destroy\n\n respond_to do |format|\n ... | [
"0.7246107",
"0.7078878",
"0.70778286",
"0.7073359",
"0.705854",
"0.70158213",
"0.7008373",
"0.70039284",
"0.6996683",
"0.6992276",
"0.6962201",
"0.6959057",
"0.69467634",
"0.6939305",
"0.6930812",
"0.6929834",
"0.6925796",
"0.69208074",
"0.6913067",
"0.69038767",
"0.68976706... | 0.73642325 | 0 |
Test 2: Flag Event Inline Comment | def test02_FlagEventComment_TC_24319
commentEventPop
sleep 4
commentPopSubmit
sleep 4
commentFlag
begin
assert $comment_flag_success.exists?
rescue => e
puts "IPS05T02: FAILED! User unable to flag comment!"
puts e
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test03_flag_repost_event_TC_24323\n\t\trepostEventPop\n\t\tsleep 2\n\t\trepost\n\t\tcommentFlag\n\t\tsleep 2\n\t\t\n\t\tbegin\n\t\tassert $browser.text.include?(\"Comment\")\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"R8_T3: FAILED! User unable to flag post.\"\n\t\tend\n\tend",
"def test04_EventOneComment_TC_... | [
"0.69264865",
"0.6816329",
"0.6815477",
"0.65609324",
"0.64940274",
"0.6475788",
"0.6464496",
"0.64520687",
"0.64334947",
"0.64009404",
"0.63418347",
"0.63418347",
"0.63418347",
"0.63418347",
"0.63418347",
"0.63418347",
"0.63418347",
"0.63418347",
"0.63418347",
"0.63418347",
... | 0.6967017 | 0 |
Test 3: Cancel Flag Note Inline Comment | def test03_CancelFlagNoteComment_TC_24319
commentNotePop
sleep 4
commentPopSubmit
sleep 4
commentCancelFlag
begin
assert $comment_flag_link.exists?
rescue => e
puts "IPS05T03: FAILED! User unable to flag comment!"
puts e
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test04_post_closed_news_CancelFlagMediaDialog\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_closed_note)\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCloseFlag\n\t\tsleep 1\n\t\t\n\t\tassert $comment_flag_link.exists?\n\tend",
"def te... | [
"0.7078219",
"0.699179",
"0.69484115",
"0.6905255",
"0.6801137",
"0.6758657",
"0.67477524",
"0.67238563",
"0.66448194",
"0.6630638",
"0.66291916",
"0.6578819",
"0.6577482",
"0.6565535",
"0.65263957",
"0.65190053",
"0.65190053",
"0.6498551",
"0.6455407",
"0.6435875",
"0.642868... | 0.7206631 | 0 |
Returns ship's health in percents | def health
(100 * @health.to_f / @max_health).round(2)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def alive_percentage\n hp.to_f / hit_points\n end",
"def damaged_percentage\n 1 - alive_percentage\n end",
"def healthstats\n\t\t@warrior.health\n\tend",
"def stat_total\n (self.health + self.hunger + self.happiness) / 3\n end",
"def getHealth()\n return @hp\n end",... | [
"0.74839133",
"0.7163465",
"0.7159121",
"0.7130516",
"0.68654823",
"0.68654823",
"0.66079533",
"0.6535039",
"0.6525092",
"0.6449167",
"0.6449086",
"0.64438295",
"0.6397189",
"0.63936144",
"0.6356843",
"0.6322953",
"0.6306317",
"0.63017607",
"0.62268364",
"0.61896825",
"0.6157... | 0.7740653 | 0 |
Render the secondary navigation if the current page isn't already rendered in the primary navigation. secondary_navigaiton :depth => 10 => => Child => => Grand child => => => Sibling => Youngest => | def secondary_navigation(options = {})
name = options.fetch('id') { 'secondary_navigation' }
cache cache_key_for_navigation(name) do
benchmark 'Rendered secondary_navigation' do
secondary_ancestors = (@page.ancestors[-2] || @page).navigable_children
nav = if secondary_ancestors.empty? || @... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render_sub_navigation(options = {})\n ActiveSupport::Deprecation.warn(\"SimpleNavigation::Helpers.render_primary_navigation has been deprected. Please use render_navigation(:level => 2) instead\")\n render_navigation(options.merge(:level => 2))\n end",
"def manageable_secondary_navigation(option... | [
"0.7287399",
"0.69127005",
"0.66791695",
"0.6549121",
"0.58665115",
"0.5860821",
"0.5849311",
"0.5822447",
"0.5745083",
"0.55936164",
"0.5416679",
"0.5401992",
"0.53926855",
"0.53220856",
"0.5270431",
"0.5238333",
"0.52303624",
"0.52017456",
"0.5201533",
"0.51813966",
"0.5174... | 0.7370805 | 0 |
Use the page structure to render nested navigation, each visible page is rendered in a +li+ element with child pages in a nested +ul+ The first +li+ in a +ul+ has the class +first+, the last +li+ in a +ul+ has the class +last+ and the current page has the class +active+. Each +li+ has a class identifier generated from ... | def navigation(options = {})
options.reverse_merge!( page: @page, depth: 1 )
page = options[:page]
children = page.home? ? page.navigable_children : page.parent.navigable_children
html = (is_home_and_shown_in_nav?(page) ? nav_link(Page.home) : '').html_safe
html << list_items(children, options[:dept... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subpage_navigation(page)\n l = \"<ul>\\n\"\n page.pages.each do |page|\n l << page_navigation_helper(page)\n end\n l << \"</ul>\"\n end",
"def documentation_navigation_tree_for(page, options = {})\n active_page_type = nil\n items = String.new.tap do |s|\n ... | [
"0.74696606",
"0.74239904",
"0.6631727",
"0.660856",
"0.64778256",
"0.6434256",
"0.63438505",
"0.6203617",
"0.6156106",
"0.61549574",
"0.61504245",
"0.6139584",
"0.61379457",
"0.60945237",
"0.60897166",
"0.6072537",
"0.60097605",
"0.59980583",
"0.5988594",
"0.59765905",
"0.59... | 0.7723436 | 0 |
Link to a +page+, using the page name as the link name. link_to Page.find_by_path('/parent') => Parent | def link_to_page(page)
link_to(page.name, page.navigation_path)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def link_to_page name, page_name, options={}\n\tlink_to name, root_url+Page.find_by_name(page_name.to_s).url, options\n rescue\n\twarning(\"no such page with ID '#{page_name}'\")\n end",
"def link_to_page(name)\n page = StaticPage.find_by_name(name)\n page = StaticPage.create!(:name => name) unle... | [
"0.74512994",
"0.73219466",
"0.67855763",
"0.66737527",
"0.6538204",
"0.6534606",
"0.6497668",
"0.6487411",
"0.6434687",
"0.64018244",
"0.6397053",
"0.63310343",
"0.63069016",
"0.62710536",
"0.62158006",
"0.62081325",
"0.6184893",
"0.61773825",
"0.60335183",
"0.60063934",
"0.... | 0.7948226 | 0 |
GET /mini_games GET /mini_games.json | def index
@mini_games = MiniGame.all
render json: @mini_games, status: :ok
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @mini_games = MiniGame.all\n end",
"def index\n @games = Game.all\n render json: @games\n end",
"def index\n @games = Game.available\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n @games ... | [
"0.75166786",
"0.7063949",
"0.7005725",
"0.69701946",
"0.6874174",
"0.6874174",
"0.6874174",
"0.6874115",
"0.6860647",
"0.67858434",
"0.67534643",
"0.67322385",
"0.6716651",
"0.66597164",
"0.6599311",
"0.6555637",
"0.6552035",
"0.64696515",
"0.6460385",
"0.6439865",
"0.642633... | 0.81727624 | 0 |
POST /mini_games POST /mini_games.json | def create
@mini_game = MiniGame.new(mini_game_params)
if @mini_game.save
render json: @mini_game, status: :ok
else
render json: @mini_game.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @mini_game = MiniGame.new(mini_game_params)\n\n respond_to do |format|\n if @mini_game.save\n format.html { redirect_to edit_mini_game_path(@mini_game), notice: 'Mini game was successfully created.' }\n format.json { render :show, status: :created, location: @mini_game }\n ... | [
"0.7351096",
"0.69202745",
"0.6781958",
"0.6643998",
"0.66066283",
"0.65944785",
"0.6474788",
"0.6356826",
"0.6283566",
"0.62288916",
"0.6143049",
"0.61211973",
"0.6101234",
"0.60962975",
"0.6085822",
"0.6063884",
"0.60441923",
"0.6040708",
"0.60139465",
"0.59815425",
"0.5957... | 0.7871318 | 0 |
PATCH/PUT /mini_games/1 PATCH/PUT /mini_games/1.json | def update
if @mini_game.update(mini_game_params)
render json: @mini_game, status: :ok
else
render json: @mini_game.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @mini_game.update(mini_game_params)\n format.html { redirect_to edit_mini_game_path(@mini_game), notice: 'Mini game was successfully updated.' }\n format.json { render :show, status: :ok, location: @mini_game }\n else\n format.html { render... | [
"0.70943475",
"0.67857337",
"0.66736203",
"0.6596299",
"0.65907156",
"0.6574725",
"0.65659374",
"0.65613735",
"0.65611714",
"0.65611714",
"0.65611714",
"0.65611714",
"0.65611714",
"0.65611714",
"0.65611714",
"0.6559543",
"0.6532806",
"0.65246767",
"0.6490287",
"0.6475725",
"0... | 0.74854505 | 0 |
DELETE /mini_games/1 DELETE /mini_games/1.json | def destroy
if @mini_game.destroy
render json: @mini_game, status: :ok
else
render json: @mini_game, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @game.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @mini_game.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Mini game was successfully destroyed.' }\n format.json { head :no_content }\n... | [
"0.73676914",
"0.7302846",
"0.72282976",
"0.7177933",
"0.7160413",
"0.7136248",
"0.7136248",
"0.7136248",
"0.7136248",
"0.7136248",
"0.7136248",
"0.7136248",
"0.7136248",
"0.7136248",
"0.7136248",
"0.7136248",
"0.7136248",
"0.7128704",
"0.7128704",
"0.71232",
"0.71232",
"0.... | 0.7631572 | 0 |
PATCH/PUT /receipts/1 PATCH/PUT /receipts/1.json | def update
@receipt = current_user.receipts.find(params[:id])
respond_to do |format|
if @receipt.update(receipt_params)
format.html { redirect_to @receipt, notice: 'Receipt was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @receipt.update(receipt_params)\n format.html { redirect_to @receipt, notice: 'Receipt was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @recei... | [
"0.6621587",
"0.6497451",
"0.64972746",
"0.6496753",
"0.6496753",
"0.64262754",
"0.64190555",
"0.63230723",
"0.6304602",
"0.6282588",
"0.6246498",
"0.6229863",
"0.62020046",
"0.6197568",
"0.6190037",
"0.61858034",
"0.6154826",
"0.6126805",
"0.61235684",
"0.604006",
"0.6015382... | 0.67454463 | 0 |
method attributes_changed? Marks the entity's attributes as clean, i.e. unchanged from the last point of reference (typically a persistence event, such as loading from or saving to a datastore). | def clean_attributes
@attribute_changes = {}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_dirty_attributes!\n @dirty_attribute_keys = []\n end",
"def clear_changed_attributes\n\t\t\t \t\t$TRACE.debug 5, \"clear_changed_attributes\"\n\t\t\t \tself.changed_attributes_aado = []\n\t\t\t \tend",
"def clean(record)\n return unless record.changed?\n attributes.each ... | [
"0.6981409",
"0.677837",
"0.67432004",
"0.66539687",
"0.65746105",
"0.65624315",
"0.6538945",
"0.6493871",
"0.6439925",
"0.64227116",
"0.6390115",
"0.6383758",
"0.6243793",
"0.61704904",
"0.6163262",
"0.61471575",
"0.6083839",
"0.6056372",
"0.60390943",
"0.60327387",
"0.60300... | 0.74283683 | 0 |
Stubs out all bussiness_support_schemes requests to return an ampty set of results. Requests stubbed with the above method will take precedence over this. | def stub_imminence_default_business_support_schemes
empty_results = {
"_response_info" => {"status" => "ok"},
"description" => "Business Support Schemes!",
"total" => 0, "startIndex" => 1, "pageSize" => 0, "currentPage" => 1, "pages" => 1,
"results" => []
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stub_responses\n Creditsafe::Api::DummyResponse.new\n end",
"def clear_backend_stubs\n unstub_backend_get_keys\n unstub_backend_utilization\n unstub_backend_referrer_filters\n\n ::BackendClient::Application.any_instance.unstub(:create_referrer_filter, :create_key)\n end",
... | [
"0.5126795",
"0.51144356",
"0.49196443",
"0.49106085",
"0.48516464",
"0.48231083",
"0.47809693",
"0.47581735",
"0.47528985",
"0.47361207",
"0.472105",
"0.4687347",
"0.4640446",
"0.46328968",
"0.46325305",
"0.46226707",
"0.46018305",
"0.45797652",
"0.45764616",
"0.4573199",
"0... | 0.74059004 | 0 |
GET /admin/zones/1 GET /admin/zones/1.json | def show
@admin_zone = Admin::Zone.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @admin_zone }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zones(id:)\n id_check(:id, id)\n\n cf_get(path: \"/organizations/#{org_id}/railguns/#{id}/zones\")\n end",
"def index\n @zones = Zone.all\n\n render json: @zones\n end",
"def show\n render json: @ozones\n end",
"def index\n @zones = Zone.all\n render json: @zones\n #@zones\n e... | [
"0.75159496",
"0.7485547",
"0.7449351",
"0.74142706",
"0.7408935",
"0.734097",
"0.7314084",
"0.72148955",
"0.72148955",
"0.7045742",
"0.7026213",
"0.701826",
"0.7015707",
"0.6918296",
"0.68873185",
"0.6772062",
"0.66215545",
"0.6587244",
"0.65614426",
"0.65541846",
"0.6546184... | 0.75062156 | 1 |
GET /admin/zones/new GET /admin/zones/new.json | def new
@admin_zones = Admin::Zone.all
@admin_zone = Admin::Zone.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @admin_zone }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @zone = Zone.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @zone }\n end\n end",
"def create\n @admin_zones = Admin::Zone.all\n @admin_zone = Admin::Zone.new(params[:admin_zone])\n\n respond_to do |format|\n if @admin_zone.sav... | [
"0.76048577",
"0.75415534",
"0.72736835",
"0.7266301",
"0.72062695",
"0.7153116",
"0.70554364",
"0.7010864",
"0.6873278",
"0.67808974",
"0.6770589",
"0.67417514",
"0.6688885",
"0.6679503",
"0.6604915",
"0.6601586",
"0.659989",
"0.65639716",
"0.656103",
"0.6552616",
"0.6539148... | 0.8090423 | 0 |
POST /admin/zones POST /admin/zones.json | def create
@admin_zones = Admin::Zone.all
@admin_zone = Admin::Zone.new(params[:admin_zone])
respond_to do |format|
if @admin_zone.save
flash[:notice] = 'Zone was successfully created.'
format.html { redirect_to admin_zones_path, notice: 'Zone was successfully created.' }
for... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @zone = Zone.new(zone_params)\n\n if @zone.save\n render json: @zone, status: :created, location: @zone\n else\n render json: @zone.errors, status: :unprocessable_entity\n end\n end",
"def create(options = {})\n response = request(:post, \"/settings/hypervisor_zones.json\... | [
"0.71260023",
"0.7023202",
"0.683567",
"0.6812237",
"0.6604418",
"0.66031075",
"0.6538716",
"0.64129275",
"0.63390094",
"0.6325246",
"0.63101065",
"0.6272085",
"0.6263406",
"0.6250394",
"0.62061787",
"0.6158369",
"0.61428106",
"0.6133961",
"0.61161906",
"0.6108923",
"0.610288... | 0.73316777 | 0 |
PUT /admin/zones/1 PUT /admin/zones/1.json | def update
@admin_zones = Admin::Zone.all
@admin_zone = Admin::Zone.find(params[:id])
respond_to do |format|
if @admin_zone.update_attributes(params[:admin_zone])
flash[:notice] = 'Zone was successfully updated.'
format.html { redirect_to admin_zones_path, notice: 'Zone was successful... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def edit(id, options = {})\n response = request(:put, \"/settings/hypervisor_zones/#{id}.json\", :query => {:pack => options})\n end",
"def update\n @zone = Zone.find(params[:id])\n\n if @zone.update(zone_params)\n head :no_content\n else\n render json: @zone.errors, status: :unprocess... | [
"0.6929019",
"0.6869809",
"0.6672874",
"0.65982974",
"0.65956265",
"0.6582807",
"0.6486738",
"0.64336985",
"0.639632",
"0.6276961",
"0.6246647",
"0.62083745",
"0.6163303",
"0.61581236",
"0.61331797",
"0.609321",
"0.6036398",
"0.6008204",
"0.6003468",
"0.59658873",
"0.5959244"... | 0.7247334 | 0 |
Override +destroy+ method and warn user when trying to remove a repository that his just collaborating. | def destroy
raise Codeplane::OwnershipError, "you can only remove your own repositories" unless mine?
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @repository.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_repositories_url, notice: \"Repository #{@repository.name} was successfully deleted.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @repo.destroy\n respond_to do |format|\... | [
"0.698556",
"0.69545007",
"0.69545007",
"0.6865099",
"0.685798",
"0.685798",
"0.685798",
"0.68139595",
"0.68130636",
"0.67346966",
"0.6717237",
"0.6687327",
"0.66532636",
"0.66144645",
"0.6611898",
"0.6587275",
"0.65640837",
"0.6529321",
"0.6527784",
"0.6518782",
"0.6514134",... | 0.81378347 | 0 |
POST /documentation/link_categories POST /documentation/link_categories.json | def create
@documentation_link_category = Documentation::LinkCategory.new(documentation_link_category_params)
@documentation_link_category.parent = Documentation::LinkCategory.find(documentation_link_category_params.link_category_id) if documentation_link_category_params.respond_to? :link_category_id
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @link_category = LinkCategory.new(link_category_params)\n\n respond_to do |format|\n if @link_category.save\n format.html { redirect_to @link_category, notice: 'Link category was successfully created.' }\n format.json { render :show, status: :created, location: @link_category ... | [
"0.67725223",
"0.6692978",
"0.6425564",
"0.6410112",
"0.6368735",
"0.63618404",
"0.635993",
"0.63550586",
"0.61501807",
"0.6091117",
"0.60458493",
"0.6045822",
"0.60060304",
"0.59749234",
"0.5952795",
"0.5948647",
"0.59262586",
"0.5913501",
"0.58968806",
"0.5860898",
"0.58564... | 0.7187395 | 0 |
DELETE /documentation/link_categories/1 DELETE /documentation/link_categories/1.json | def destroy
@documentation_link_category.destroy
respond_to do |format|
format.html { redirect_to documentation_link_categories_url, notice: 'Category was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @link_category.destroy\n respond_to do |format|\n format.html { redirect_to link_categories_url, notice: 'Link category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @link_category = LinkCategory.find(params[:id])\n @link_ca... | [
"0.7560762",
"0.7204243",
"0.70897216",
"0.7084013",
"0.7036547",
"0.6933905",
"0.69178045",
"0.69057524",
"0.688483",
"0.6884226",
"0.6823386",
"0.6812588",
"0.6802322",
"0.6791664",
"0.6789248",
"0.6789248",
"0.6789248",
"0.67851096",
"0.6767225",
"0.6764591",
"0.67606646",... | 0.8012557 | 0 |
override default to_json to include stops association with tour | def as_json(options = {})
hash = super(options)
# merge in the stops in the proper order
stops = self.stop_tours.order(:position).select{ |st| st.stop != nil }.map { |st| st.stop.attributes.merge(:position => st.position, :categories => st.stop.categories, :photos => st.stop.photos) }
hash.merge!(:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def as_json(options={})\n super(:include => :locations)\n end",
"def to_json\n # Convert Object to Hash\n hash = self.to_hash\n\n # Grab the Step objects and convert to Hashes\n steps = hash['steps']\n hashified_steps = []\n steps.each {|step| hashified_steps << step.to_hash}\n ... | [
"0.6389935",
"0.63315904",
"0.6312119",
"0.6287816",
"0.6199929",
"0.6183304",
"0.615085",
"0.6083371",
"0.6064746",
"0.6009586",
"0.6009586",
"0.5997533",
"0.59699506",
"0.5940014",
"0.5926891",
"0.59238076",
"0.59035736",
"0.5900496",
"0.5875556",
"0.5868991",
"0.58646524",... | 0.8268064 | 0 |
GET /cards/questions/1 GET /cards/questions/1.json | def show
@cards_question = Cards::Question.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @cards_question }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def questions\n self.class.get(\"/2.2/questions\", @options)\n end",
"def new\n @cards_question = Cards::Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cards_question }\n end\n end",
"def show\n @question = Question.find(params[:id]... | [
"0.7260802",
"0.69937885",
"0.68511975",
"0.68503726",
"0.68503726",
"0.68503726",
"0.6816302",
"0.6816302",
"0.6774418",
"0.6748702",
"0.6747283",
"0.6744669",
"0.6705607",
"0.6705063",
"0.6693129",
"0.6688689",
"0.6672078",
"0.66681105",
"0.6663122",
"0.6595679",
"0.6594755... | 0.7698777 | 0 |
GET /cards/questions/new GET /cards/questions/new.json | def new
@cards_question = Cards::Question.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @cards_question }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @question }\n end\n end",
"def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @question ... | [
"0.7579574",
"0.7579574",
"0.7579574",
"0.7579574",
"0.7579574",
"0.75110257",
"0.7502748",
"0.75025016",
"0.7453495",
"0.73334277",
"0.7243011",
"0.72065854",
"0.71892065",
"0.7166422",
"0.714039",
"0.713776",
"0.7134918",
"0.7120822",
"0.70937765",
"0.7088988",
"0.7078414",... | 0.7861372 | 0 |
POST /cards/questions POST /cards/questions.json | def create
@cards_question = Cards::Question.new(params[:cards_question])
respond_to do |format|
if @cards_question.save
format.html { redirect_to @cards_question, notice: 'Question was successfully created.' }
format.json { render json: @cards_question, status: :created, location: @cards... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @question = Question.new(question_params)\n\n if @question.save\n render json: @question\n else\n render status: 400, nothing: true\n end\n end",
"def new\n @cards_question = Cards::Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.j... | [
"0.6830209",
"0.6747396",
"0.66039175",
"0.65431523",
"0.6477487",
"0.64484006",
"0.63763875",
"0.637597",
"0.6364569",
"0.6362541",
"0.63604194",
"0.6342441",
"0.62936753",
"0.62936753",
"0.62936753",
"0.62936753",
"0.62936753",
"0.62936753",
"0.62936753",
"0.62936753",
"0.6... | 0.7264603 | 0 |
PUT /cards/questions/1 PUT /cards/questions/1.json | def update
@cards_question = Cards::Question.find(params[:id])
respond_to do |format|
if @cards_question.update_attributes(params[:cards_question])
format.html { redirect_to @cards_question, notice: 'Question was successfully updated.' }
format.json { head :no_content }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to api_v1_question_path(@question), notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n ... | [
"0.66287476",
"0.6621249",
"0.6571626",
"0.65103585",
"0.642804",
"0.64249855",
"0.64228076",
"0.6388365",
"0.6382883",
"0.63665503",
"0.63665503",
"0.63665503",
"0.63665503",
"0.63665503",
"0.635001",
"0.63384557",
"0.62738764",
"0.62391907",
"0.6222811",
"0.61790246",
"0.61... | 0.70804125 | 0 |
DELETE /cards/questions/1 DELETE /cards/questions/1.json | def destroy
@cards_question = Cards::Question.find(params[:id])
@cards_question.destroy
respond_to do |format|
format.html { redirect_to cards_questions_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @question = Question.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to api_v1_questions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n if @v1_question.destroy\n render json: {'message': 'Deleted questio... | [
"0.7508923",
"0.7387547",
"0.7369289",
"0.7369289",
"0.7369289",
"0.7369289",
"0.7369289",
"0.7369289",
"0.73563635",
"0.73559624",
"0.73559624",
"0.73553646",
"0.7355239",
"0.7355239",
"0.7355239",
"0.7355239",
"0.7355239",
"0.7355239",
"0.7351318",
"0.73308724",
"0.7317857"... | 0.796223 | 0 |
Render rating by IDI | def idi_rating_str(program)
render_program_row("IDI Rating", sprintf("%3.1f", program.rating)) if program.rating
# end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n set_rating\n end",
"def rating\n rating_calculator.rate(raters)\n end",
"def rating #Getter\n @rating\n end",
"def render_kijkwijzers rating_result\n result_svgs = \"<div class=\\\"kijkwijzer icons\\\">\"\n if rating_result.is_a? Kijkwijzer::Result\n rating_result ... | [
"0.66238326",
"0.65474445",
"0.6523222",
"0.64645195",
"0.64412695",
"0.6416604",
"0.63888127",
"0.6350261",
"0.633449",
"0.6290106",
"0.6224049",
"0.62023985",
"0.6181825",
"0.6125023",
"0.6095835",
"0.60939497",
"0.60679626",
"0.60679626",
"0.60679626",
"0.60423017",
"0.602... | 0.7155322 | 0 |
Handle fulltext search for image format | def fulltext_image_format(search_str)
image_formats = ImageFormat.where("lower(name) = ?", search_str.downcase)
ret = nil
if image_formats.count == 1
image_format = image_formats.first
ret = []
ret[0] = ", which is an image format."
ret[1] = "You'll get better results by searching by... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def image(size: T.unsafe(nil), search_terms: T.unsafe(nil), match_all: T.unsafe(nil)); end",
"def search_images(searchterm,params={})\n @opensearch.search_images(searchterm,params) \n end",
"def image_search(q)\n\tterm = q.gsub(/#/, '').gsub(/[\\W]/, '+')\n\topen(SEARCH + term) do |f|\n\t\treturn nil un... | [
"0.7430041",
"0.7253292",
"0.6724144",
"0.6619309",
"0.6592632",
"0.6551046",
"0.65086824",
"0.64716643",
"0.6395014",
"0.6387741",
"0.63626003",
"0.6286638",
"0.61901855",
"0.6164456",
"0.6153638",
"0.6138845",
"0.60842466",
"0.604929",
"0.6039241",
"0.6009715",
"0.5976494",... | 0.73111296 | 1 |
Handle fulltext search for feature | def fulltext_feature(search_str)
features = Feature.where("lower(value) = ?", search_str.downcase)
ret = nil
if features.count == 1
feature = features.first
ret = []
ret[0] = ", which is a feature."
ret[1] = "You'll get better results by searching by the features:<br />"
ret[1]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def full_text_search\n @attributes[:full_text_search]\n end",
"def handling_fulltext\n options = yield\n add_sort_by_relevance options if fulltext_name_filtering?\n options\n end",
"def search\n @documents = api.form(\"everything\")\n .query(%([[:d = fulltext(document, \... | [
"0.70804614",
"0.698595",
"0.6813747",
"0.68063575",
"0.6774629",
"0.67669076",
"0.67551124",
"0.67262155",
"0.66738397",
"0.6673266",
"0.6663848",
"0.66379565",
"0.6601857",
"0.6600178",
"0.65910107",
"0.65910107",
"0.65910107",
"0.65910107",
"0.65910107",
"0.65910107",
"0.6... | 0.7654501 | 0 |
This function is used to collect the correct type by mode | def find_type(type)
type_return = type.inject({}) { |k, v| k[v] = type.count(v); k }
type_return.select { |k, v| v == mode_return.values.max }.keys
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_type(type)\n\ttype_return = type.inject({}) { |k, v| k[v] = type.count(v); k }\n\ttype_return.select { |k,v| v == mode_return.values.max }.keys\nend",
"def types(types); end",
"def types; end",
"def types; end",
"def types; end",
"def types; end",
"def types; end",
"def type() end",
"def t... | [
"0.61733156",
"0.61249256",
"0.6053297",
"0.6053297",
"0.6053297",
"0.6053297",
"0.6053297",
"0.59855545",
"0.5947556",
"0.58766973",
"0.5713018",
"0.569781",
"0.5689859",
"0.56575334",
"0.5644565",
"0.56430024",
"0.5595624",
"0.5572537",
"0.5569662",
"0.5548637",
"0.552551",... | 0.61443317 | 1 |
GET /voice_parts/1 GET /voice_parts/1.json | def show
@voice_part = VoicePart.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @voice_part }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parts\n @audio_file = AudioFile.find(params[:id])\n @parts = @audio_file.parts\n\n respond_to do |format|\n format.html # parts.html.erb\n format.xml { render :xml => @parts }\n format.json { render :json => @parts }\n end\n end",
"def new\n @voice_part = VoicePart.new\n\n r... | [
"0.7280845",
"0.7093165",
"0.66382664",
"0.656993",
"0.6527267",
"0.62457687",
"0.6219157",
"0.620434",
"0.620434",
"0.61172533",
"0.6096323",
"0.60083026",
"0.6007061",
"0.59796655",
"0.597479",
"0.59464204",
"0.5917916",
"0.5865048",
"0.58256257",
"0.58151686",
"0.57709587"... | 0.7866635 | 0 |
GET /voice_parts/new GET /voice_parts/new.json | def new
@voice_part = VoicePart.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @voice_part }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @part = Part.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @part }\n end\n end",
"def new\n @part = Part.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @part }\n end\n end",
... | [
"0.7638917",
"0.7599167",
"0.7524089",
"0.7162661",
"0.6987211",
"0.6871499",
"0.68197465",
"0.6785625",
"0.67811",
"0.66720796",
"0.6655138",
"0.66537184",
"0.66105855",
"0.6576767",
"0.6567931",
"0.65070075",
"0.64904004",
"0.64904004",
"0.64904004",
"0.6480519",
"0.6438482... | 0.8211933 | 0 |
POST /voice_parts POST /voice_parts.json | def create
@voice_part = VoicePart.new(params[:voice_part])
respond_to do |format|
if @voice_part.save
format.html { redirect_to @voice_part, notice: 'Voice part was successfully created.' }
format.json { render json: @voice_part, status: :created, location: @voice_part }
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @voice_part = VoicePart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @voice_part }\n end\n end",
"def create\n @part = Part.new(params[:part])\n\n respond_to do |format|\n if @part.save\n format.html { redirect_to @part, ... | [
"0.65778434",
"0.63760257",
"0.6315891",
"0.6293789",
"0.61948407",
"0.61159045",
"0.6042242",
"0.5925083",
"0.5916544",
"0.58922255",
"0.5856127",
"0.5852716",
"0.5851393",
"0.584608",
"0.58307314",
"0.5787156",
"0.5763084",
"0.57099426",
"0.5695702",
"0.56508523",
"0.564215... | 0.7530184 | 0 |
PUT /voice_parts/1 PUT /voice_parts/1.json | def update
@voice_part = VoicePart.find(params[:id])
respond_to do |format|
if @voice_part.update_attributes(params[:voice_part])
format.html { redirect_to @voice_part, notice: 'Voice part was successfully updated.' }
format.json { head :no_content }
else
format.html { rende... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @voice_part = VoicePart.new(params[:voice_part])\n\n respond_to do |format|\n if @voice_part.save\n format.html { redirect_to @voice_part, notice: 'Voice part was successfully created.' }\n format.json { render json: @voice_part, status: :created, location: @voice_part }\n ... | [
"0.6617215",
"0.62671405",
"0.6224628",
"0.61868614",
"0.6184063",
"0.6094579",
"0.6091752",
"0.60039514",
"0.59831333",
"0.5951462",
"0.59247893",
"0.5916701",
"0.59016323",
"0.5878391",
"0.58657205",
"0.58545",
"0.58484864",
"0.581972",
"0.5810032",
"0.57999504",
"0.5790383... | 0.75567645 | 0 |
DELETE /voice_parts/1 DELETE /voice_parts/1.json | def destroy
@voice_part = VoicePart.find(params[:id])
@voice_part.destroy
respond_to do |format|
format.html { redirect_to voice_parts_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @voice.remove_voice_file!\n @voice.destroy\n respond_to do |format|\n format.html { redirect_to voices_url, notice: 'Voice was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @singlepart.destroy\n respond_to do |format|\n ... | [
"0.7268156",
"0.70575225",
"0.70414567",
"0.70346105",
"0.7015779",
"0.6873833",
"0.6873833",
"0.6840678",
"0.682483",
"0.68078566",
"0.6741881",
"0.6714201",
"0.6701894",
"0.6687714",
"0.66583437",
"0.6647895",
"0.6623399",
"0.6621646",
"0.6613631",
"0.66093063",
"0.65587986... | 0.8171056 | 0 |
tell a passed in Song instance it belongs to this Artist instance. self refers to an instance of Artist aka the artist's name | def add_song(song)
song.artist = self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_song(song)\n # We want to tell the song_name passed in that it belongs to the instance\n # of Artist for which this method is called on aka self.\n song.artist = self\n end",
"def add_song(song) #=> we found out by looking at the test that the argument is a song instance\n # the followin... | [
"0.77893984",
"0.73140043",
"0.72582936",
"0.72582936",
"0.72582936",
"0.72582936",
"0.72582936",
"0.72582936",
"0.7196861",
"0.7196861",
"0.7196861",
"0.71661234",
"0.713071",
"0.7109115",
"0.71002156",
"0.7074344",
"0.70609456",
"0.7049223",
"0.7005379",
"0.6971187",
"0.696... | 0.73515916 | 1 |
Send events This endpoint is used to send data in the form of 'events' to the log service. Events have optional metadata. | def events(events, opts = {})
data, _status_code, _headers = events_with_http_info(events, opts)
return data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def events(params={})\n return Proxy.new(connection, \"./events\",params)\n end",
"def send_requests(events)\n if events.empty?\n logger.info('Skipping sending events since buffer is empty')\n return\n end\n\n logger.info(\"Attempting to send #{events.size} request#{event... | [
"0.61776185",
"0.6133223",
"0.6073343",
"0.60527456",
"0.5987612",
"0.59762967",
"0.596691",
"0.594527",
"0.5941406",
"0.593806",
"0.5934238",
"0.5930322",
"0.59091294",
"0.58807254",
"0.58267117",
"0.5819775",
"0.58023185",
"0.57890946",
"0.5731769",
"0.5730791",
"0.5714292"... | 0.6263054 | 0 |
input = "x=495, y=2..7\ny=7, x=495..501\nx=501, y=3..7\nx=498, y=2..4\nx=506, y=1..2\nx=498, y=10..13\nx=504, y=10..13\ny=13, x=498..504" | def input_parse(input)
list_coords = []
height = 0
xMin, xMax, yMin = [500, 0, 500]
input.split("\n").each do |com_coords|
if com_coords[0]=='x'
x_raw, y_raw = com_coords.split(",")
x = x_raw.delete("^0-9").to_i
xMin, xMax = [[xMin, x].min, [xMax, x].max]
y_min, y_max = y_raw.delete(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_coordinate_data(input_string)\n # extract substrings matching ( int , int ) into an array, ignoring whitespace\n coords_string = input_string.scan(@coords_regex)\n\n #if nothing matches then return an empty array\n if coords_string == nil\n return []\n end\n\n # remove the brackets... | [
"0.626125",
"0.58690506",
"0.5549675",
"0.5512636",
"0.54380095",
"0.5399706",
"0.53567445",
"0.53255457",
"0.5286728",
"0.52814126",
"0.52595013",
"0.51612246",
"0.51584905",
"0.51491517",
"0.5128598",
"0.5091201",
"0.5016048",
"0.5009023",
"0.5001225",
"0.5001001",
"0.49735... | 0.6469773 | 0 |
POST /summits POST /summits.json | def create
@summit = Summit.new(summit_params)
@summit.currency = "$"
@summit.location_country = "USA"
@summit.deadline = create_deadline_json
@summit.admin_email = ""
respond_to do |format|
if @summit.save
format.html { redirect_to @summit, notice: 'Summit was succe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_summit\n @summit = Summit.find(params[:id])\n end",
"def create\n @admitting = Admitting.new(admitting_params)\n\n if @admitting.save\n render json: @admitting, status: :created, location: @admitting\n else\n render json: @admitting.errors, status: :unprocessable_entity\n ... | [
"0.6539853",
"0.6217431",
"0.61247146",
"0.58992255",
"0.57505786",
"0.5662849",
"0.54206496",
"0.533395",
"0.5189275",
"0.51339024",
"0.511885",
"0.51165825",
"0.51031893",
"0.5060116",
"0.5020929",
"0.5017571",
"0.50107896",
"0.498878",
"0.498699",
"0.49859276",
"0.49857304... | 0.7177841 | 0 |
PATCH/PUT /summits/1 PATCH/PUT /summits/1.json | def update
#if session[:edit_code].present? && session[:edit_code] == @summit.edit_code
#@summit.currency = "$"
#@summit.location_country = "USA"
@summit.deadline = create_deadline_json
#@summit.published = false
#@summit.attributes = summit_params
#if... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @sumit.update(sumit_params)\n format.html { redirect_to @sumit, notice: 'Sumit is successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sumit.errors, ... | [
"0.6310982",
"0.62001836",
"0.5984275",
"0.59665734",
"0.58279836",
"0.5767118",
"0.5746879",
"0.5744281",
"0.57279253",
"0.57211626",
"0.5712182",
"0.5692399",
"0.5686226",
"0.567857",
"0.56773",
"0.5668807",
"0.5648511",
"0.56480587",
"0.56425774",
"0.56329703",
"0.56290954... | 0.6300408 | 1 |
DELETE /summits/1 DELETE /summits/1.json | def destroy
@summit.destroy
respond_to do |format|
format.html { redirect_to summits_url, notice: 'Summit was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @sumit.destroy\n respond_to do |format|\n format.html { redirect_to sumits_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @access.destroy\n respond_to do |format|\n format.html { redirect_to accesses_url }\n format.json { head :no_content }... | [
"0.68343675",
"0.66180396",
"0.6541814",
"0.6523999",
"0.6506307",
"0.644137",
"0.6408654",
"0.64070183",
"0.63730294",
"0.6359908",
"0.6358749",
"0.63317454",
"0.63229966",
"0.63211304",
"0.63145465",
"0.6309413",
"0.630811",
"0.630811",
"0.6306151",
"0.62849116",
"0.6284356... | 0.7634984 | 0 |
send out an email with the edit code for the new private summit | def send_edit_code email, edit_code
@first_name = "lol"
require 'mandrill'
m = Mandrill::API.new
message = {
:subject=> "Your Summit Edit Code",
:from_name=> "Social Summit List",
:from_email=>"info@summits.social-change.net",
:to=>[
{
:email => emai... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def send_to_revision profile\n @profile = profile\n\n mail to: Rails.application.secrets.admins_emails\n end",
"def update\n\n #after the admin approve the invitation request\n #an invitation code will be generated and sent to the user\n invitation = Invitation.find(params[:id])\n invitation.g... | [
"0.6578284",
"0.6531587",
"0.64420563",
"0.64239466",
"0.6363802",
"0.6334392",
"0.62847143",
"0.62473327",
"0.6239227",
"0.623721",
"0.62219435",
"0.61770445",
"0.6167696",
"0.61430764",
"0.6141354",
"0.61235875",
"0.61177254",
"0.61112034",
"0.60818565",
"0.607379",
"0.6063... | 0.7140797 | 0 |
Average downloads per day | def get_average_downloads(data, end_date=Date.today)
if data['version_downloads_days'].nil? || data['version_downloads_days'].empty?
average_downloads = 0
else
# Assume first commit as publish date
first_publish = data['commit_history'][0]['created_at'].to_s
duration = (end_date - Date.parse(first_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def avg\n total_time = 0\n for url in self.keys\n total_time += self[url]\n end\n return total_time / self.size\n end",
"def response_by_days\n selected_files.each do |file_name|\n key = file_name[0,6]\n next if @by_day[key]\n result = [key, 0, 0, 0]\n File.readlines(fi... | [
"0.6919837",
"0.6637601",
"0.6518282",
"0.63172674",
"0.60787034",
"0.6060873",
"0.60383683",
"0.60211074",
"0.59704113",
"0.59659934",
"0.5932476",
"0.59147537",
"0.59141195",
"0.58673894",
"0.5866715",
"0.58351886",
"0.58183604",
"0.57987434",
"0.5784533",
"0.5757916",
"0.5... | 0.68114656 | 1 |
Percentage of downloads on weekday | def get_percentage_downloads_weekday(data, end_date=Date.today)
if data['version_downloads_days'].nil? || data['version_downloads_days'].empty?
weekday_downloads_percent = 0
else
downloads_aggregation = Hash.new(0)
data['version_downloads_days'].each do |version|
version['downloads_date'].each_pa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def progress_as_percentage\n\t\t\"#{real_days_progress_today.round}%\"\n\tend",
"def progress_today\n today = Date.today\n run.on(today).size.to_f / on(today).size\n end",
"def get_percentage_commits_weekday(data, end_date=Date.today)\n if data['commit_history'].nil? || data['commit_history'].len... | [
"0.6969783",
"0.6395317",
"0.6387335",
"0.6232223",
"0.6225705",
"0.6092117",
"0.60847855",
"0.5976531",
"0.5973831",
"0.5952026",
"0.5911383",
"0.5874396",
"0.5837386",
"0.58239603",
"0.5804611",
"0.5787482",
"0.5733149",
"0.5718875",
"0.5696054",
"0.5693675",
"0.5644161",
... | 0.7692008 | 0 |
Average commits per day | def get_average_commits_days(data, end_date=Date.today)
if data['commit_history'].nil? || data['commit_history'].length == 0
average_commits = ''
else
total_commits = 0
duration = (end_date - Date.parse(data['commit_history'].first['created_at'])).to_i
data['commit_history'].each do |commit|
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_average_forks(data, end_date=Date.today)\n if data['commit_history'].nil? || data['commit_history'].length == 0 || !data['forks']\n average_forks = ''\n else\n duration = (end_date - Date.parse(data['commit_history'].first['created_at'])).to_i || 1\n\n duration = 1 if duration <= 0\n\n averag... | [
"0.6868598",
"0.68011403",
"0.6780923",
"0.67806065",
"0.6527124",
"0.6275431",
"0.6259956",
"0.61134744",
"0.6021333",
"0.59663457",
"0.5958896",
"0.5953503",
"0.5934141",
"0.5879608",
"0.5876907",
"0.5762724",
"0.57626706",
"0.5755408",
"0.57038105",
"0.5669493",
"0.5656832... | 0.7422636 | 0 |
Percentage of commits on weekday | def get_percentage_commits_weekday(data, end_date=Date.today)
if data['commit_history'].nil? || data['commit_history'].length == 0
weekday_commit_percent = ''
else
commits_history_filter = data['commit_history'].select do |element|
Date.parse(element['created_at'].to_s) <= end_date
end
weekda... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def progress_as_percentage\n\t\t\"#{real_days_progress_today.round}%\"\n\tend",
"def n_commits(date)\n 30\nend",
"def percentage\n total = finish_date.at_end_of_day - start_date.at_beginning_of_day\n current = Time.now - start_date.at_beginning_of_day\n (current / total) * 100\n end",
... | [
"0.6816513",
"0.65621287",
"0.642237",
"0.63410836",
"0.6248613",
"0.62129986",
"0.618735",
"0.6002891",
"0.5796304",
"0.5794434",
"0.57539964",
"0.57236695",
"0.5700875",
"0.56639016",
"0.56571597",
"0.56468815",
"0.5623237",
"0.5623237",
"0.5608183",
"0.55972815",
"0.559611... | 0.77842927 | 0 |
Percentage of top two contributors' commits | def get_percentage_top_contributor_commits(data)
if data['contributors'].nil? || data['contributors'].length == 0 || !data['commits']
percentage_top_contributors_commits = ''
else
if data['contributors'].length > 1
top_contributors_total = 0
data['contributors'][0..1].each do |contributor|
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def contributor_percentage(before = DateTime.new(2050,01,01))\n # puts \"#{@filepath.commits}\" \n max = []\n min = []\n perc = 0.25# 0.0625 #0.05\n sep = ','\n c = 'commits'\n cf = 'commit_filepaths' \n cAuthorID = c+ '.author_id'\n cCreated... | [
"0.701114",
"0.64199185",
"0.63677675",
"0.6317367",
"0.62749445",
"0.62685883",
"0.62404764",
"0.621434",
"0.61948186",
"0.6150919",
"0.61217046",
"0.60794467",
"0.60603505",
"0.60554934",
"0.60554785",
"0.6038714",
"0.59933126",
"0.5974575",
"0.5974575",
"0.59165066",
"0.58... | 0.73319376 | 0 |
Average commits per contributor | def get_average_commits_contributors(data)
if !data['commits'] || data['contributors'].nil? || data['contributors'].length == 0
average_contributor_commits = ''
else
average_contributor_commits = data['commits'].to_f / data['contributors'].length.to_f
end
average_contributor_commits
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def contributor_percentage(before = DateTime.new(2050,01,01))\n # puts \"#{@filepath.commits}\" \n max = []\n min = []\n perc = 0.25# 0.0625 #0.05\n sep = ','\n c = 'commits'\n cf = 'commit_filepaths' \n cAuthorID = c+ '.author_id'\n cCreated... | [
"0.72200173",
"0.7017105",
"0.6663856",
"0.6650668",
"0.66242373",
"0.6512158",
"0.64480895",
"0.636306",
"0.63384116",
"0.621264",
"0.6196922",
"0.615646",
"0.6133514",
"0.60721993",
"0.60421026",
"0.5997331",
"0.5991671",
"0.5983859",
"0.5962527",
"0.5905139",
"0.5888736",
... | 0.75326604 | 0 |
Total readme word count | def get_total_readme_word_count(data)
total_word_count = 0
if data['readme_raw_text'].nil?
total_word_count = 0
else
readme_text = Base64.decode64(data['readme_raw_text']['content'])
readme_text = readme_text.gsub(/[\r\n]/, ' ')
words = readme_text.split(' ')
words.each do |word|
if word... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total_words\n self.title.to_s.count_words + self.content.to_s.count_words\n end",
"def word_count_a_file(file_path)\n File.read(file_path).split(' ').length\n # had to create the file, text taken from https://www.lipsum.com/feed/html\nend",
"def word_count_a_file(file_path)\nend",
"def mit_word_cou... | [
"0.73895025",
"0.7385628",
"0.73702586",
"0.7223494",
"0.71665365",
"0.71665365",
"0.70937645",
"0.70232916",
"0.70203215",
"0.70054764",
"0.6999201",
"0.69970244",
"0.6977565",
"0.6950541",
"0.6895375",
"0.68618643",
"0.6847173",
"0.6843618",
"0.68105394",
"0.68051654",
"0.6... | 0.8432862 | 0 |
===return String the Forwarding Entity ID | def getforwardingentityid
return getvalue(SVTags::FORWARDING_ENTITY_ID)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def entity entity_id\n raw(\"&#{entity_id};\")\n end",
"def entityID\n end",
"def entityID\n end",
"def entity_id\n match(/Entity\\sID\\s+:\\s+([A-F0-9]+)$/)\n end",
"def calculate_fstfwd_id\n # Internal id for fstfwd\n self._id\n end",
"def format_identifier\n ... | [
"0.75025165",
"0.6806227",
"0.6806227",
"0.66722214",
"0.658225",
"0.65818596",
"0.6563137",
"0.6563137",
"0.6460845",
"0.64368945",
"0.6380437",
"0.6380437",
"0.6350109",
"0.63443774",
"0.63405454",
"0.63376266",
"0.6318252",
"0.63098085",
"0.630897",
"0.6296706",
"0.6293222... | 0.80798644 | 0 |
The value for this is preassigned by QwikCilver and provided to the Caller ===param String Forwarding entity ID | def setforwardingentityid(value)
setvalue(SVTags::FORWARDING_ENTITY_ID, value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getforwardingentityid\r\n return getvalue(SVTags::FORWARDING_ENTITY_ID)\r\n end",
"def entityID\n end",
"def entityID\n end",
"def set_EntityID(value)\n set_input(\"EntityID\", value)\n end",
"def flow_object_id\n @flow_object_id ||= params[:flow_object_id]&.to_s || @company.id... | [
"0.7164339",
"0.6350167",
"0.6350167",
"0.62958866",
"0.60252595",
"0.5973019",
"0.59705186",
"0.5897016",
"0.58165216",
"0.5766822",
"0.5766822",
"0.5766822",
"0.5716587",
"0.5687843",
"0.5646779",
"0.56393474",
"0.5625519",
"0.56182176",
"0.5617449",
"0.5612656",
"0.5612656... | 0.70639986 | 1 |
===return String The ForwardingEntityPassword | def getforwardingentitypassword
return getvalue(SVTags::FORWARDING_ENTITY_PASSWORD)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def password\n @hash.to_s\n end",
"def to_s\n %[#<password safe>]\n end",
"def to_s\n %[#<password safe>]\n end",
"def password\n [@password, @security_token].join('')\n end",
"def standard_password\n \"!@Cd5678\"\n end",
"def mutate_bcrypt_password(_)\n '400$8$2d$f6ed5a4... | [
"0.7221677",
"0.6846798",
"0.6846798",
"0.6780687",
"0.67327327",
"0.6720392",
"0.66448104",
"0.65661764",
"0.65567684",
"0.6540132",
"0.65274036",
"0.6507254",
"0.6492408",
"0.6466035",
"0.6466035",
"0.6447273",
"0.64288485",
"0.6418703",
"0.6413058",
"0.6411087",
"0.6408774... | 0.83222693 | 0 |
The value for this is preassigned by QwikCilver and provided to the Caller ===param String Forwarding Entity Password | def setforwardingentitypassword(value)
setvalue(SVTags::FORWARDING_ENTITY_PASSWORD, value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getforwardingentitypassword\r\n return getvalue(SVTags::FORWARDING_ENTITY_PASSWORD)\r\n end",
"def password=(_arg0); end",
"def password=(_arg0); end",
"def password=(_arg0); end",
"def password=(_arg0); end",
"def password; end",
"def password; end",
"def password; end",
"def password; end... | [
"0.77990115",
"0.6649644",
"0.6649644",
"0.6649644",
"0.6649644",
"0.6564143",
"0.6564143",
"0.6564143",
"0.6564143",
"0.6564143",
"0.6564143",
"0.6506445",
"0.64564645",
"0.6423275",
"0.6390848",
"0.6375982",
"0.6375982",
"0.6357058",
"0.6342957",
"0.6342957",
"0.6332024",
... | 0.76429725 | 1 |
===return String the Connection Timeout | def getconnectiontimeout()
return getvalue(@@CONNECTION_TIMEOUT)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_connect_timeout\n @connect_timeout\n end",
"def connect_timeout\n @connect_timeout\n end",
"def gettransactiontimeout()\r\n return getvalue(@@TRANSACTION_TIMEOUT)\r\n end",
"def timeout\n return @timeout\n end",
"def timeout\n datastore['Timeout'... | [
"0.77787787",
"0.76840085",
"0.7145417",
"0.7130842",
"0.70902944",
"0.70696753",
"0.70696753",
"0.70632696",
"0.70442295",
"0.70398515",
"0.7000393",
"0.690326",
"0.6841372",
"0.6823944",
"0.6791069",
"0.6789775",
"0.675331",
"0.6732033",
"0.6710792",
"0.6710792",
"0.669175"... | 0.8339755 | 0 |
===return String The TransactionTimeout | def gettransactiontimeout()
return getvalue(@@TRANSACTION_TIMEOUT)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def timeout\n datastore['Timeout']\n end",
"def timeout\n return @timeout\n end",
"def getconnectiontimeout()\r\n return getvalue(@@CONNECTION_TIMEOUT)\r\n end",
"def timeout\n datastore['TIMEOUT']\n end",
"def timeout_seconds\n transport_optio... | [
"0.7024454",
"0.68012327",
"0.6789197",
"0.67542636",
"0.67051244",
"0.66720086",
"0.65776867",
"0.6571412",
"0.6464024",
"0.6437331",
"0.64149976",
"0.634211",
"0.62952334",
"0.6221039",
"0.6180668",
"0.61541295",
"0.613491",
"0.60631853",
"0.60631853",
"0.6030567",
"0.60283... | 0.84841573 | 0 |
===return string the acquirerId | def getacquirerid()
return getvalue(SVTags::ACQUIRER_ID)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setacquirerid(value)\r\n setvalue(SVTags::ACQUIRER_ID, value)\r\n end",
"def quoted_id\n id\n end",
"def getIdString\r\n\t\t\t\t\r\n\t\t\t\t\treturn @idString\r\n\t\t\t\t\t\r\n\t\t\t\tend",
"def getIdString\r\n\t\t\t\t\r\n\t\t\t\t\treturn @idString\r\n\t\t\t\t\t\r\n\t\t\t\tend",
"def code\n... | [
"0.68937546",
"0.6548974",
"0.6520417",
"0.6520417",
"0.6405503",
"0.63975126",
"0.63541216",
"0.62947327",
"0.6272264",
"0.6267178",
"0.6218403",
"0.6201217",
"0.6175755",
"0.6175755",
"0.6170437",
"0.61518174",
"0.6140508",
"0.6115859",
"0.61013436",
"0.60881925",
"0.608063... | 0.86608076 | 0 |
The value for this is preassigned by QwikCilver and provided to the Caller ===param String Acquirer Id | def setacquirerid(value)
setvalue(SVTags::ACQUIRER_ID, value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getacquirerid()\r\n return getvalue(SVTags::ACQUIRER_ID)\r\n end",
"def set_Acquisition(value)\n set_input(\"Acquisition\", value)\n end",
"def set_Acquisition(value)\n set_input(\"Acquisition\", value)\n end",
"def set_Acquisition(value)\n set_input(\"Acquisition\", va... | [
"0.73653376",
"0.6373154",
"0.6373154",
"0.6373154",
"0.5897672",
"0.55873513",
"0.5384292",
"0.5379028",
"0.5379028",
"0.53753716",
"0.53573436",
"0.53461653",
"0.5342668",
"0.5339155",
"0.5330254",
"0.5330254",
"0.5273639",
"0.5273639",
"0.5273639",
"0.5273639",
"0.5273639"... | 0.7328914 | 1 |
===return String The Terminal ID | def getterminalid()
return getvalue(SVTags::TERMINAL_ID)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setterminalid(value)\r\n setvalue(SVTags::TERMINAL_ID, value)\r\n end",
"def hex_cmd_id\n \"0x\" + @cmd_id.to_s(16)\n end",
"def getIdString\r\n\t\t\t\t\r\n\t\t\t\t\treturn @idString\r\n\t\t\t\t\t\r\n\t\t\t\tend",
"def getIdString\r\n\t\t\t\t\r\n\t\t\t\t\treturn @idString\r\n\t\t\t\t\t\r\n\t\... | [
"0.6451909",
"0.64281034",
"0.64277446",
"0.64277446",
"0.6356788",
"0.63025665",
"0.6284731",
"0.6244889",
"0.62044054",
"0.61621094",
"0.6161205",
"0.6152485",
"0.6150392",
"0.6143716",
"0.6140978",
"0.6132197",
"0.6131647",
"0.6130764",
"0.6126774",
"0.612168",
"0.61159796... | 0.8447344 | 0 |
===param String Terminal ID | def setterminalid(value)
setvalue(SVTags::TERMINAL_ID, value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def terminal_id=(terminal_id)\n if !terminal_id.nil? && terminal_id.to_s.length > 10\n fail ArgumentError, 'invalid value for \"terminal_id\", the character length must be smaller than or equal to 10.'\n end\n\n pattern = Regexp.new(/^[0-9]+$/)\n if !terminal_id.nil? && terminal_id !~ pa... | [
"0.7456219",
"0.71453506",
"0.71453506",
"0.70959806",
"0.67456",
"0.6384678",
"0.6113337",
"0.57698256",
"0.5490867",
"0.5433405",
"0.5406755",
"0.5387694",
"0.53385806",
"0.5267747",
"0.51809627",
"0.51731956",
"0.51636714",
"0.5160536",
"0.51560736",
"0.51557416",
"0.51283... | 0.74321276 | 1 |
===return String The Terminal App Version | def getterminalappversion()
return getvalue(SVTags::TERMINAL_APP_VERSION)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ver\n if v = version\n str = +\"#{program_name} #{[v].join('.')}\"\n str << \" (#{v})\" if v = release\n str\n end\n end",
"def version\n \"\\e[36mThis program is currently in version number: #{v_num}\\e[0m\"\n end",
"def application_version\n read('application_versio... | [
"0.7569706",
"0.7422411",
"0.7243806",
"0.717284",
"0.7167316",
"0.711904",
"0.711904",
"0.7117918",
"0.71130306",
"0.7059966",
"0.7057442",
"0.7041085",
"0.7041085",
"0.6961765",
"0.6953129",
"0.69105613",
"0.6906191",
"0.68993795",
"0.689237",
"0.6889309",
"0.6870758",
"0... | 0.8511543 | 0 |
===param String The Terminal App Version | def setterminalappversion(value)
setvalue(SVTags::TERMINAL_APP_VERSION, value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getterminalappversion()\r\n return getvalue(SVTags::TERMINAL_APP_VERSION)\r\n end",
"def version\n \"\\e[36mThis program is currently in version number: #{v_num}\\e[0m\"\n end",
"def version\n cmd(COMMANDS[:version], 2)\n end",
"def ver\n if v = version\n str = +\"#{program_na... | [
"0.78399974",
"0.7086954",
"0.68274295",
"0.6734262",
"0.6659542",
"0.65972984",
"0.6486567",
"0.64851683",
"0.6474196",
"0.64525205",
"0.6444221",
"0.64143467",
"0.6408286",
"0.6403885",
"0.6380982",
"0.6379776",
"0.6378158",
"0.6378158",
"0.6347798",
"0.63461685",
"0.632478... | 0.79296976 | 0 |
===return String The Merchant Outlet Name | def getmerchantoutletname()
return getvalue(SVTags::MERCHANT_OUTLET_NAME)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getmerchantname()\r\n return getvalue(SVTags::MERCHANT_NAME)\r\n end",
"def getoutletname\r\n @outletname\r\n end",
"def setmerchantoutletname(value)\r\n setvalue(SVTags::MERCHANT_OUTLET_NAME, value)\r\n end",
"def merchant_name\n\t\tm = Merchant.find_by_id(merchant_id)\n\t\treturn m.name\n\t... | [
"0.7459694",
"0.68881917",
"0.68601173",
"0.68207324",
"0.66231346",
"0.63758683",
"0.6131223",
"0.61156195",
"0.6108717",
"0.6103413",
"0.6071014",
"0.6059257",
"0.6051841",
"0.6051841",
"0.59610325",
"0.59502655",
"0.5904598",
"0.58921444",
"0.5881826",
"0.5863765",
"0.5858... | 0.84266573 | 0 |
===param String Merchant Outlet Name | def setmerchantoutletname(value)
setvalue(SVTags::MERCHANT_OUTLET_NAME, value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getmerchantoutletname()\r\n return getvalue(SVTags::MERCHANT_OUTLET_NAME)\r\n end",
"def getmerchantname()\r\n return getvalue(SVTags::MERCHANT_NAME)\r\n end",
"def getoutletname\r\n @outletname\r\n end",
"def setmerchantname(value)\r\n setvalue(SVTags::MERCHANT_NAME, value)\r\n end",
"... | [
"0.7516583",
"0.6358421",
"0.6201335",
"0.6068398",
"0.600087",
"0.5572202",
"0.5557911",
"0.5389052",
"0.5325097",
"0.51739365",
"0.5146824",
"0.5137761",
"0.5130751",
"0.5106754",
"0.5095916",
"0.5090487",
"0.5074791",
"0.5054336",
"0.5054336",
"0.50425684",
"0.5037137",
... | 0.7382406 | 1 |
===return String The Pos Name | def getposname()
return getvalue(SVTags::POS_NAME)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post_name\n POSITION[self.position.to_s]\n end",
"def post_name\n POSITION[self.position.to_s]\n end",
"def name\n I18n.t(@position, scope: :\"models.position\")\n end",
"def location_name\n pos = @state[\"position\"]\n pos ? pos.split(\"#\",2)[0] : nil\n end",
"def name() retu... | [
"0.73413885",
"0.73413885",
"0.71415883",
"0.6918948",
"0.691408",
"0.691408",
"0.67867285",
"0.6754656",
"0.6720416",
"0.6616571",
"0.6611556",
"0.6607517",
"0.6607517",
"0.6607517",
"0.6607517",
"0.6579812",
"0.6579581",
"0.65710264",
"0.65446776",
"0.65321743",
"0.65128833... | 0.80235714 | 0 |
===param String Pos Name | def setposname(value)
setvalue(SVTags::POS_NAME, value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(name, pos)\n @name = name\n @pos = pos\n\n if pos.length > 2 || !valid_position?(*self.position)\n raise 'Invalid position'\n end\n end",
"def post_name\n POSITION[self.position.to_s]\n end",
"def post_name\n POSITION[self.position.to_s]\n end",
"def getposname()\r\n ... | [
"0.6731324",
"0.66502565",
"0.66502565",
"0.6621488",
"0.65379655",
"0.64528453",
"0.64528453",
"0.64459985",
"0.63768446",
"0.63768446",
"0.63768446",
"0.63768446",
"0.6265599",
"0.6251594",
"0.6241243",
"0.61278117",
"0.61278117",
"0.61278117",
"0.61278117",
"0.61278117",
"... | 0.70517474 | 0 |
===return String The Track Data | def gettrackdata()
return getvalue(SVTags::TRACK_DATA)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_s_simple\n \"track_id = #{@metadata['track_id']} name = #{@metadata['name']}\"\n end",
"def to_s()\n \"Tracker{#{@id}, track: #{@track}}\"\n end",
"def to_s\n result = \"Track \\n\"\n result << \"\\tName: #{name}\\n\"\n result << \"\\tComment: #{comment}\\n\"\n res... | [
"0.78798485",
"0.7355753",
"0.7298773",
"0.7168903",
"0.66639954",
"0.6587054",
"0.6569399",
"0.6522958",
"0.64764476",
"0.64764476",
"0.64717716",
"0.64570606",
"0.6446428",
"0.64354736",
"0.6426704",
"0.6394009",
"0.6389173",
"0.63759935",
"0.63547915",
"0.6333508",
"0.6309... | 0.7747941 | 1 |
===param String Track Data | def settrackdata(value)
setvalue(SVTags::TRACK_DATA, value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_track_data(data)\n track = Hash.new\n key = nil\n data.children.each do |data|\n if data.name == 'key'\n key = data.text.downcase.gsub(/\\s/, '_').to_sym\n elsif data.name == 'integer'\n track[key] = data.text.to_i\n elsif data.name == 'string'\n track[key] = d... | [
"0.70948005",
"0.66605544",
"0.6456046",
"0.6252882",
"0.6242812",
"0.62258714",
"0.60809",
"0.6076566",
"0.6076566",
"0.6013229",
"0.5970424",
"0.59704053",
"0.59686196",
"0.59686196",
"0.59686196",
"0.59431404",
"0.59321916",
"0.5897609",
"0.58557856",
"0.5790392",
"0.57600... | 0.69286704 | 1 |
===return String The Current Batch Number | def getcurrentbatchnumber()
return getvalue(SVTags::CURRENT_BATCH_NUMBER)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setcurrentbatchnumber(value)\r\n setvalue(SVTags::CURRENT_BATCH_NUMBER, value)\r\n end",
"def find_batchid\n if facility.client.name.upcase == \"QUADAX\"\n method = \"get_batchid\"\n method << \"_#{@client_sym}\"\n batchid = send(method)\n return batchid\n else\n batchid_po... | [
"0.6890884",
"0.63893116",
"0.6379463",
"0.63303864",
"0.6252036",
"0.6226336",
"0.6151225",
"0.6133687",
"0.6079469",
"0.60548085",
"0.60529035",
"0.6019683",
"0.601596",
"0.60079753",
"0.5958312",
"0.5947475",
"0.59417117",
"0.59095114",
"0.5902745",
"0.5899691",
"0.5884143... | 0.838754 | 0 |
===param String Current Batch Number | def setcurrentbatchnumber(value)
setvalue(SVTags::CURRENT_BATCH_NUMBER, value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getcurrentbatchnumber()\r\n return getvalue(SVTags::CURRENT_BATCH_NUMBER)\r\n end",
"def set_batch\n @batch = Batch.find(params[:id]) unless params[:id].to_i.zero?\n @batch = Batch.find(params[:batch_id]) unless params[:batch_id].to_i.zero?\n end",
"def set_batch\n @batch = Batch.find... | [
"0.74093485",
"0.6117821",
"0.59533554",
"0.59533554",
"0.59533554",
"0.59533554",
"0.59533554",
"0.5942879",
"0.5934184",
"0.5916948",
"0.5912813",
"0.58959925",
"0.58396137",
"0.5819909",
"0.5738568",
"0.5662382",
"0.56519413",
"0.55988145",
"0.5598759",
"0.55980533",
"0.55... | 0.8080612 | 0 |
===return String The Transaction ID | def gettransactionid()
return getvalue(SVTags::TRANSACTION_ID)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def transaction_id\n read('transaction_id')\n end",
"def transaction_id\n @data[:transaction_id]\n end",
"def transaction_id\n @transaction_id ||= \"#{order.id}-#{Time.now.to_i}\"\n end",
"def transaction_id\n @gapi.statistics.transaction_info&.transaction_id\n end... | [
"0.862981",
"0.8243702",
"0.8156684",
"0.7963901",
"0.78984356",
"0.7888561",
"0.7848477",
"0.7820975",
"0.78048766",
"0.77844644",
"0.77555066",
"0.77417076",
"0.7696562",
"0.76873904",
"0.76861537",
"0.7596778",
"0.75876874",
"0.75664675",
"0.74625885",
"0.7451859",
"0.7326... | 0.8363221 | 1 |
===return String The Pos Type ID | def getpostypeid()
return getvalue(SVTags::POS_TYPE_ID)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type_id\n @type_id ||= extract_int(@content[0...TYPE_SIZE])\n end",
"def type_str\n Types.type_str(type)\n end",
"def it_doc_id\n type_name + ' ' + self.id.to_s\n end",
"def type_id(type)\n @el.expr['types'].index(type)\n end",
"def type\n @type.to_s\n ... | [
"0.762356",
"0.7065077",
"0.6933103",
"0.68211883",
"0.6781793",
"0.6738367",
"0.6642034",
"0.6632327",
"0.6616192",
"0.6616192",
"0.6613432",
"0.6613432",
"0.6613432",
"0.6613432",
"0.6613432",
"0.6613432",
"0.6613432",
"0.6613432",
"0.6613432",
"0.6613432",
"0.6613432",
"... | 0.8181588 | 0 |
===param String POS Type ID | def setpostypeid(value)
setvalue(SVTags::POS_TYPE_ID, value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getpostypeid()\r\n return getvalue(SVTags::POS_TYPE_ID)\r\n end",
"def input_id_from_type(type); end",
"def type_id\n @type_id ||= extract_int(@content[0...TYPE_SIZE])\n end",
"def set_ptype\n @ptype = Ptype.find(params[:id])\n end",
"def set_ptype\n @ptype = Ptype.find(par... | [
"0.7329671",
"0.63626164",
"0.6225551",
"0.59848803",
"0.59848803",
"0.597323",
"0.59449434",
"0.5926882",
"0.5849988",
"0.57944834",
"0.5776267",
"0.57743096",
"0.57679695",
"0.5748603",
"0.56845874",
"0.56563085",
"0.56563085",
"0.5651815",
"0.5644921",
"0.5626855",
"0.5618... | 0.73174155 | 1 |
===return String The Pos Entry Mode | def getposentrymode()
return getvalue(SVTags::POS_ENTRY_MODE)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_mode()\n end",
"def mode_name\n if mode >= 0 && mode <= 15\n MODES[mode]\n else\n \"(#{mode})\"\n end\n end",
"def name\n return mode_desc\n end",
"def mode; end",
"def mode; end",
"def mode; end",
"def mode; end",
"def mode\n \"%o\" % (self.stat(... | [
"0.7085455",
"0.69358826",
"0.68274206",
"0.67542315",
"0.67542315",
"0.67542315",
"0.67542315",
"0.6750364",
"0.6742092",
"0.67382526",
"0.67237073",
"0.657246",
"0.6529791",
"0.64467525",
"0.63949317",
"0.63949317",
"0.6387187",
"0.62053955",
"0.6203875",
"0.61975443",
"0.6... | 0.78495127 | 0 |
===param String POS Entry Mode | def setposentrymode(value)
setvalue(SVTags::POS_ENTRY_MODE, value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getposentrymode()\r\n return getvalue(SVTags::POS_ENTRY_MODE)\r\n end",
"def insert_text_mode\n attributes.fetch(:insertTextMode)\n end",
"def handle_text_insertion pos, text\n add_command InsertionCommand.new(pos, text)\n end",
"def mode; end",
"def mode; end",
"def mode;... | [
"0.6876292",
"0.512527",
"0.5011608",
"0.49862212",
"0.49862212",
"0.49862212",
"0.49862212",
"0.49738562",
"0.49738562",
"0.49738562",
"0.49738562",
"0.4966408",
"0.49527493",
"0.49393016",
"0.49349722",
"0.49233174",
"0.4907341",
"0.48702726",
"0.4843523",
"0.48364672",
"0.... | 0.72052985 | 0 |
===return String The Merchant Name | def getmerchantname()
return getvalue(SVTags::MERCHANT_NAME)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merchant_name\n\t\tm = Merchant.find_by_id(merchant_id)\n\t\treturn m.name\n\tend",
"def name\n object.merchant.name\n end",
"def get_full_name\n get_receipt_code()\n end",
"def getmerchantoutletname()\r\n return getvalue(SVTags::MERCHANT_OUTLET_NAME)\r\n end",
"def customer_name\n \"#... | [
"0.82178193",
"0.76544887",
"0.70265937",
"0.6951302",
"0.6894541",
"0.6872804",
"0.68648386",
"0.68344784",
"0.6792128",
"0.67343086",
"0.67343086",
"0.6714689",
"0.67038476",
"0.66029483",
"0.65850425",
"0.65106523",
"0.6506352",
"0.64828676",
"0.64784044",
"0.6452057",
"0.... | 0.84475714 | 0 |
===param String Merchant Name | def setmerchantname(value)
setvalue(SVTags::MERCHANT_NAME, value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getmerchantname()\r\n return getvalue(SVTags::MERCHANT_NAME)\r\n end",
"def name\n object.merchant.name\n end",
"def merchant_name\n\t\tm = Merchant.find_by_id(merchant_id)\n\t\treturn m.name\n\tend",
"def set_Merchant(value)\n set_input(\"Merchant\", value)\n end",
"def merchant_pa... | [
"0.7164604",
"0.68439794",
"0.66945237",
"0.62806064",
"0.6111294",
"0.6056576",
"0.60293597",
"0.6028982",
"0.5987193",
"0.59497994",
"0.59428287",
"0.59304243",
"0.5923851",
"0.5828649",
"0.5826869",
"0.57753205",
"0.5771701",
"0.5757572",
"0.5745258",
"0.57138044",
"0.5688... | 0.71725386 | 0 |
GET /syohins GET /syohins.json | def index
@syohins = Syohin.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_syohin\n @syohin = Syohin.find(params[:id])\n end",
"def index\n @sightings = Sighting.all\n render json: @sightings\n end",
"def show\n render json: @shelter\n end",
"def index\n @shorties = Shorty.per_user(current_user).all\n\n respond_to do |format|\n format.html # in... | [
"0.63220114",
"0.62281895",
"0.6103899",
"0.6095969",
"0.6090845",
"0.6088858",
"0.60744476",
"0.6057173",
"0.60400426",
"0.6035053",
"0.59856707",
"0.5968556",
"0.590801",
"0.5902593",
"0.5884582",
"0.58833027",
"0.58808005",
"0.58667576",
"0.58418745",
"0.5828432",
"0.58258... | 0.7157358 | 0 |
POST /syohins POST /syohins.json | def create
@syohin = Syohin.new(syohin_params)
respond_to do |format|
if @syohin.save
format.html { redirect_to @syohin, notice: 'Syohin was successfully created.' }
format.json { render :show, status: :created, location: @syohin }
else
format.html { render :new }
fo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @sinnoh = Sinnoh.new(sinnoh_params)\n\n respond_to do |format|\n if @sinnoh.save\n format.html { redirect_to @sinnoh, notice: 'Sinnoh was successfully created.' }\n format.json { render :show, status: :created, location: @sinnoh }\n else\n format.html { render :new... | [
"0.6268548",
"0.61490935",
"0.60702705",
"0.59205794",
"0.59157586",
"0.5754206",
"0.5707067",
"0.56961715",
"0.5695693",
"0.5693206",
"0.5688907",
"0.56632304",
"0.5650969",
"0.56417423",
"0.5585942",
"0.5583386",
"0.55580825",
"0.55360067",
"0.55332863",
"0.5526688",
"0.552... | 0.71162146 | 0 |
PATCH/PUT /syohins/1 PATCH/PUT /syohins/1.json | def update
respond_to do |format|
if @syohin.update(syohin_params)
format.html { redirect_to @syohin, notice: 'Syohin was successfully updated.' }
format.json { render :show, status: :ok, location: @syohin }
else
format.html { render :edit }
format.json { render json: @sy... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @sinnoh.update(sinnoh_params)\n format.html { redirect_to @sinnoh, notice: 'Sinnoh was successfully updated.' }\n format.json { render :show, status: :ok, location: @sinnoh }\n else\n format.html { render :edit }\n format.json { rend... | [
"0.6395413",
"0.6357289",
"0.6193094",
"0.616812",
"0.61657095",
"0.6152277",
"0.61199003",
"0.6117537",
"0.611412",
"0.6106433",
"0.6097262",
"0.60880715",
"0.60841715",
"0.6079204",
"0.60770684",
"0.60719556",
"0.6069922",
"0.6065281",
"0.606194",
"0.60571086",
"0.6051595",... | 0.69752705 | 0 |
DELETE /syohins/1 DELETE /syohins/1.json | def destroy
@syohin.destroy
respond_to do |format|
format.html { redirect_to syohins_url, notice: 'Syohin was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @sinh_vien = SinhVien.find(params[:id])\n @sinh_vien.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end",
"def destroy\n @sesh.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_con... | [
"0.7006754",
"0.6924206",
"0.68977374",
"0.6871625",
"0.68486047",
"0.68360305",
"0.6821161",
"0.68210226",
"0.6819397",
"0.680762",
"0.67968494",
"0.6792997",
"0.67770326",
"0.67581195",
"0.6757751",
"0.67535996",
"0.67535996",
"0.6746576",
"0.6746506",
"0.6742158",
"0.67322... | 0.72271335 | 0 |
GET /cooks GET /cooks.json | def index
@cooks = Cook.includes(:user)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index \n @cooks = Cook.all\n\n end",
"def index\n @cookbooks = Cookbook.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cookbooks }\n end\n end",
"def index\n info = Aws.get_recipes_from_db\n render :json => info\n end",
"de... | [
"0.67899907",
"0.67338145",
"0.6497611",
"0.64603055",
"0.64098775",
"0.6340171",
"0.618117",
"0.61387944",
"0.60772014",
"0.60293645",
"0.60273916",
"0.6018669",
"0.6012144",
"0.59474325",
"0.591937",
"0.59153926",
"0.58939844",
"0.58885163",
"0.58800584",
"0.58658123",
"0.5... | 0.686664 | 0 |
POST /cooks POST /cooks.json | def create
@cook = Cook.new(cook_params.merge(user_id: current_user.id))
@cook.log = cook @cook
respond_to do |format|
if @cook.save
format.html { redirect_to @cook, notice: 'Cook was successfully created.' }
format.json { render action: 'show', status: :created, location: @cook }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cook_params\n params.require(:cook).permit(:host_id, :recipe_id, :user_id, :success, :log, :memo)\n end",
"def create\n @cooky = Cookie.new(params[:cooky])\n\n respond_to do |format|\n if @cooky.save\n format.html { redirect_to @cooky, notice: 'Cookie was successfully created.' }\n ... | [
"0.6731934",
"0.65411997",
"0.6448985",
"0.6222136",
"0.6115937",
"0.6115937",
"0.6115136",
"0.5993849",
"0.589666",
"0.5838893",
"0.5822617",
"0.5815502",
"0.57828027",
"0.56794465",
"0.56538355",
"0.5649026",
"0.553675",
"0.5521225",
"0.55155164",
"0.55155164",
"0.55155164"... | 0.67237055 | 1 |
DELETE /cooks/1 DELETE /cooks/1.json | def destroy
@cook.destroy
respond_to do |format|
format.html { redirect_to cooks_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete(id)\n request(:delete, \"/recipes/#{id}.json\")\n end",
"def destroy\n @cookbook = Cookbook.find(params[:id])\n @cookbook.destroy\n\n respond_to do |format|\n format.html { redirect_to cookbooks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @... | [
"0.71402854",
"0.69481367",
"0.6932219",
"0.69252306",
"0.6910149",
"0.6909512",
"0.6763467",
"0.67545694",
"0.67187834",
"0.6717365",
"0.67067224",
"0.66935295",
"0.6650222",
"0.66489995",
"0.66480273",
"0.66416097",
"0.6606108",
"0.6606108",
"0.6606108",
"0.6606108",
"0.660... | 0.7604519 | 0 |
Creates list of Beacon / Zone for application. Returns collection of BeaconOrZone objects. ==== Parameters +app_id+ Integer, ID of application to check active flag for +q+ Hash (+ActionController::Parameters+), parameters for query, valid keys: +:name+ filters list to match given +:name+ +:sort+ sort list by +:name+ at... | def beacons_and_zones(app_id, q = {})
query_params = []
search_query, order_clause = ""
if q[:name]
search_query = " and name LIKE ? "
query_params << "%#{q[:name]}%" << "%#{q[:name]}%"
end
if q[:sort] && BeaconOrZone::SORTABLE_COLUMNS.include?(q[:sort])
direction = q[:direction] ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @beacons = Beacon.filter(params)\n end",
"def call\n return [] if chargeable_zones_data.empty?\n\n chargeable_zones_data.filter_map do |zone|\n Caz.new(zone) if zone['cleanAirZoneId'].in?(chargeable_vehicles_ids)\n end.sort_by(&:name)\n end",
"def availability_zones\n Avai... | [
"0.5543317",
"0.5255427",
"0.49827206",
"0.4810231",
"0.47701824",
"0.47509542",
"0.47129768",
"0.47063395",
"0.4649456",
"0.46135196",
"0.46130726",
"0.45948923",
"0.45656532",
"0.4547185",
"0.45316112",
"0.45213133",
"0.45160124",
"0.4471074",
"0.4465369",
"0.4459466",
"0.4... | 0.8004928 | 0 |
destroy the params given email | def destroy
@email = Email.destroy(params[:id])
redirect_to root_path
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n set_email.destroy\n flash[:notice] = \"Email Deleted!\"\n redirect_to user_emails_path(current_user.id)\n end",
"def destroy\n @email.destroy\n\n respond_to do |format|\n format.html { redirect_to(emails_url) }\n format.mobile { redirect_to profile_kontact_kontact_informat... | [
"0.7301064",
"0.72494525",
"0.71308094",
"0.7129738",
"0.71130514",
"0.71044004",
"0.704454",
"0.70342505",
"0.69771206",
"0.69761443",
"0.6954538",
"0.69276845",
"0.6907643",
"0.68859524",
"0.6873091",
"0.6859457",
"0.6830406",
"0.6818809",
"0.6813181",
"0.6775514",
"0.67670... | 0.7299637 | 1 |
Updates a invoice receipt It also allows you to create a new client and/or items in the same request. If the client name does not exist a new client is created. Regarding item taxes, if the tax name is not found, no tax will be applied to that item. If item does not exist with the given name, a new one will be created.... | def update_invoice_receipt(invoice_receipt, options={})
raise(ArgumentError, "invoice receipt has the wrong type") unless invoice_receipt.is_a?(Invoicexpress::Models::InvoiceReceipt)
if !invoice_receipt.id
raise ArgumentError, "Invoice ID is required"
end
params = { :klass => I... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n \n @invoice_item.update(@invoice_item)\n respond_with(@invoice)\n \n end",
"def update\n # too many issues trying to do strong parametesr.\n # TODO: implement strong params in the future\n params = request.parameters\n\n if !params.has_key?(:invoice_items) then\n flash[... | [
"0.6340467",
"0.62682444",
"0.6052914",
"0.5985679",
"0.59848356",
"0.5839738",
"0.5792825",
"0.578472",
"0.56876355",
"0.5670492",
"0.5657948",
"0.561303",
"0.5544571",
"0.5537864",
"0.55249804",
"0.5515979",
"0.5513464",
"0.5503797",
"0.5493713",
"0.54934585",
"0.54934585",... | 0.6482199 | 0 |
GET /topicclusters/1 GET /topicclusters/1.xml | def show
@topiccluster = Topiccluster.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @topiccluster }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @clusters = Cluster.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @clusters }\n end\n end",
"def new\n @topiccluster = Topiccluster.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xm... | [
"0.66899294",
"0.6587418",
"0.6520676",
"0.65154403",
"0.6272657",
"0.61561286",
"0.6130249",
"0.6112195",
"0.60862637",
"0.6070267",
"0.6051775",
"0.60359997",
"0.6010678",
"0.5982519",
"0.593387",
"0.59059083",
"0.59032834",
"0.5893535",
"0.5868037",
"0.58621085",
"0.583750... | 0.7434874 | 0 |
GET /topicclusters/new GET /topicclusters/new.xml | def new
@topiccluster = Topiccluster.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @topiccluster }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @topiccluster = Topiccluster.new(params[:topiccluster])\n\n respond_to do |format|\n if @topiccluster.save\n format.html { redirect_to(@topiccluster, :notice => 'Topiccluster was successfully created.') }\n format.xml { render :xml => @topiccluster, :status => :created, :loca... | [
"0.70448476",
"0.69887805",
"0.6597644",
"0.6577996",
"0.6448429",
"0.6385472",
"0.63217056",
"0.63103586",
"0.63103586",
"0.63103586",
"0.63103586",
"0.63103586",
"0.62924546",
"0.6248761",
"0.62287235",
"0.6140344",
"0.60810554",
"0.60754555",
"0.6075002",
"0.6075002",
"0.6... | 0.7781065 | 0 |
POST /topicclusters POST /topicclusters.xml | def create
@topiccluster = Topiccluster.new(params[:topiccluster])
respond_to do |format|
if @topiccluster.save
format.html { redirect_to(@topiccluster, :notice => 'Topiccluster was successfully created.') }
format.xml { render :xml => @topiccluster, :status => :created, :location => @to... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def api_v11_clusters_post(opts = {})\n api_v11_clusters_post_with_http_info(opts)\n return nil\n end",
"def create\n @cluster = Cluster.new(params[:cluster])\n\n respond_to do |format|\n if @cluster.save\n flash[:notice] = 'Cluster was successfully created.'\n format.html { ... | [
"0.61913884",
"0.6097841",
"0.60442376",
"0.5945716",
"0.583664",
"0.5720903",
"0.5613685",
"0.558976",
"0.5571413",
"0.54976475",
"0.5486913",
"0.5432081",
"0.54199135",
"0.5391187",
"0.5369313",
"0.535931",
"0.5345958",
"0.5344404",
"0.5321632",
"0.53182834",
"0.5297842",
... | 0.7077647 | 0 |
PUT /topicclusters/1 PUT /topicclusters/1.xml | def update
@topiccluster = Topiccluster.find(params[:id])
respond_to do |format|
if @topiccluster.update_attributes(params[:topiccluster])
format.html { redirect_to(@topiccluster, :notice => 'Topiccluster was successfully updated.') }
format.xml { head :ok }
else
format.htm... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @cluster = Cluster.find(params[:id])\n\n respond_to do |format|\n if @cluster.update_attributes(params[:cluster])\n flash[:notice] = 'Cluster was successfully updated.'\n format.html { redirect_to(@cluster) }\n format.xml { head :ok }\n else\n format.html {... | [
"0.6343954",
"0.62795454",
"0.6240789",
"0.5982433",
"0.5878366",
"0.5871245",
"0.5871245",
"0.5851834",
"0.581328",
"0.56916076",
"0.5663645",
"0.56614345",
"0.5651759",
"0.561947",
"0.5570184",
"0.55604684",
"0.5540535",
"0.5540493",
"0.5532485",
"0.55267555",
"0.5526555",
... | 0.71922976 | 0 |
DELETE /topicclusters/1 DELETE /topicclusters/1.xml | def destroy
@topiccluster = Topiccluster.find(params[:id])
@topiccluster.destroy
respond_to do |format|
format.html { redirect_to(topicclusters_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @cluster = Cluster.find(params[:id])\n @cluster.destroy\n\n respond_to do |format|\n format.html { redirect_to(clusters_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n if args.length != 2\n error \"Kafka name and topic required\"\n end\n name, urls... | [
"0.71707433",
"0.6970927",
"0.6854129",
"0.67834765",
"0.67834765",
"0.67641777",
"0.66668344",
"0.66668344",
"0.66668344",
"0.66668344",
"0.66668344",
"0.66668344",
"0.66668344",
"0.66644216",
"0.65976465",
"0.65859187",
"0.6546318",
"0.6538439",
"0.6534002",
"0.6521945",
"0... | 0.79069996 | 0 |
Takes a name and returns an organisation object for the organisation with that name | def organisation_by_name(name)
name = CGI::escape(name)
response = get(URI.encode("http://triplestore.bbcnewslabs.co.uk/api/concepts?product=http://www.bbc.co.uk/ontologies/bbc/NewsWeb&uri=http://dbpedia.org/resource/#{name}"))
return nil if response.body.blank? || response.code != 200
json_da... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def organization_by_name(name)\n @organizations[name]\n end",
"def get_organization_by_name(org_name)\n org = @client.organizations.find { |cc_org|\n cc_org.name == org_name\n }\n\n org\n rescue Exception => ex\n raise \"#{ex.inspect}, #{ex.backtrace}\"\n end",
"def get... | [
"0.814211",
"0.7874979",
"0.78109896",
"0.77793455",
"0.7766628",
"0.7544115",
"0.72936004",
"0.7249549",
"0.70721155",
"0.7056127",
"0.7047807",
"0.7039385",
"0.69528294",
"0.69419694",
"0.69419694",
"0.680513",
"0.6795263",
"0.67416644",
"0.6646856",
"0.6487941",
"0.6487941... | 0.8262707 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.