query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
402db8d4a5c10b2b3c73394d3bd3ee80
Detect if the report has a previous page.
[ { "docid": "60a90e4a67e3aa2bffaeebcf8de6d94b", "score": "0.85549223", "text": "def previous_page?\n page > 1\n end", "title": "" } ]
[ { "docid": "45a4c2bed2b99b21663bb17d5cfc5d82", "score": "0.8676143", "text": "def has_previous_page\n @agent.page.links.find { |l| l.text == \"← Previous\" } == nil ? false : true\n end", "title": "" }, { "docid": "9ff35967f2982efe8dea7381dee4db37", "score": "0.8552325", "text": ...
69c5165ca5c83af757f16fd3895ab464
% uid : () > Fixnum
[ { "docid": "99d961d5aacdf35dbafc6969285923b7", "score": "0.82507485", "text": "def uid(*) end", "title": "" } ]
[ { "docid": "f0a738337e728c54c5fcc388424e47de", "score": "0.83819824", "text": "def get_uid_int\n self.uid.to_i\n end", "title": "" }, { "docid": "dc87b6b45182f4fced0c90acd551d984", "score": "0.82721436", "text": "def uid() end", "title": "" }, { "docid": "9589a37ea6ab...
fe1313d3ad41ab31df691a61c152bb0b
Replace this with your real tests.
[ { "docid": "72fd36c52f9358823fcd80b429120869", "score": "0.0", "text": "def test_truth\n assert true\n end", "title": "" } ]
[ { "docid": "16a6d5e8eabd975007f205c109c50890", "score": "0.7377744", "text": "def testing; end", "title": "" }, { "docid": "1068832c8229c37488788b46a0871f26", "score": "0.6993729", "text": "def testing\n end", "title": "" }, { "docid": "8fbc98d9068bd9c82033a031286f0a1e",...
6d2350997714455e80b40572f5601069
validamos , porque solo los empleados y administrador pueden crear local
[ { "docid": "19b6e2a1e8994c0f510960813bbe506c", "score": "0.6753022", "text": "def validar_admin\n \n \n logger.debug \"<<<<< validar sesion en empleados #{session[:intranet].inspect}>>>>>\" \n if(session[:intranet]!=nil)\n \n @employees=session[:intranet]\n ...
[ { "docid": "29874b954fcf8539d5f0aeab12e3b407", "score": "0.6073027", "text": "def management\n @usuario = helpers.current_user\n @todosusuarios ||= Usuario.where(ativo: false)\n if @todosusuarios.blank?\n flash.now[:notice] = \"Não há nenhum usuário para ter o acesso liberado.\"\n end\n...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "6328839d6f8a4d0ecf65252e67ac5e2a", "score": "0.0", "text": "def set_baz25\n @baz25 = Baz25.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
1200919e2795d4e206e93f81374626e5
Return an image tag for the club avatar thumbnail.
[ { "docid": "665dfa413aaa139f56fb40a0ad2296bc", "score": "0.8426535", "text": "def clubthumbnail_tag(club)\n image_tag(club.clubavatar.thumbnail_url, :border => 0)\n end", "title": "" } ]
[ { "docid": "fb4bef25e39b674abfff9f5936f43c7b", "score": "0.7750083", "text": "def profile_image_thumbnail\n image_path = profile_user_image.present? ? profile_user_image.image.url(:thumbnail) :\n DEFAULT_USER_PROFILE_IMAGE_NAME\n\n h.image_tag image_p...
728550d5dcdb3878eaf375645ddb11b9
Set up signal handlers to restart/shutdown the server.
[ { "docid": "978c395a6b59ec12385864a8cc9ae8a5", "score": "0.7660169", "text": "def set_signal_handlers\n\t\tSignal.trap( :INT ) { self.shutdown(\"Caught interrupt.\") }\n\t\tSignal.trap( :TERM ) { self.shutdown(\"Terminated.\") }\n\t\tSignal.trap( :HUP ) { self.shutdown(\"Hangup.\") }\n\tend", "title...
[ { "docid": "c5e06d22612dd05be1dd47d216390b7e", "score": "0.78007245", "text": "def register_signal_handlers\n trap(\"INT\") { shutdown }\n trap(\"TERM\") { shutdown }\n trap(\"QUIT\") { shutdown }\n end", "title": "" }, { "docid": "9d2b6c2c5e22f696826110d931f2a602"...
3ec13b900be24e9d074311aab79a8353
Shortcut for a module under development
[ { "docid": "b3783264ea253ce8871e64c72e23b04c", "score": "0.6209975", "text": "def dev(name, *args)\n mod name, :path => \"#{ENV['HOME']}/src/boxen/puppet-#{name}\"\nend", "title": "" } ]
[ { "docid": "0eccea41546f849f30dd64a7f0003b7e", "score": "0.6762202", "text": "def definition\n \"module #{full_name}\"\n end", "title": "" }, { "docid": "a2129c9d44b23870e234cc712c1c4549", "score": "0.6511358", "text": "def dev(name, *args)\n mod \"puppet-#{name}\", :path => \"#...
047695c31b3ef64c2d9cdd77fb9d3877
Add another name to the list for address (which may be empty so far)
[ { "docid": "6320a3edb07c47bd89a0c14f6bec3e3b", "score": "0.7155365", "text": "def add_name(address, name)\n @hosts[address] ||= []\n @hosts[address] << name\n\n @modified = true\n end", "title": "" } ]
[ { "docid": "d0ae2f8b9fa499b35fc6bb17b5cee900", "score": "0.6876142", "text": "def add!(addr)\n @addrs.push(addr)\n @addrs.sort!\n end", "title": "" }, { "docid": "94b666c319a09bd2ed47d7eed95bc80a", "score": "0.67791367", "text": "def add_name names_list,name\n\tnames_list.push...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "84e0297393ead7b089246a418c3d2792", "score": "0.0", "text": "def interaction_object_params\n\n params.require(:interaction_object).permit(:name)\n\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
6201162075ab73f9e8424f0d7c4c492e
DELETE /items/1 DELETE /items/1.json
[ { "docid": "75f837e0fce23413ae89b516dff08ec5", "score": "0.0", "text": "def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "7ba3ffc3f842560fa1fbcad79adc92a0", "score": "0.78029406", "text": "def delete_item\n @item.destroy!\n render json: { }\n end", "title": "" }, { "docid": "c2b06c8934a1264699cd5a0e366f4cd9", "score": "0.77186036", "text": "def destroy\n # :id here represents the n...
0a9cc62e15bc9414d35d6f2934a8f997
Gets the index property value. Index of the range.
[ { "docid": "8ccc2f587a925ee15c4057b23959fca1", "score": "0.61874837", "text": "def index\n return @index\n end", "title": "" } ]
[ { "docid": "05bb8796dcf1bb61fe36276b7b0c67e2", "score": "0.7367111", "text": "def index\n self[:index]\n end", "title": "" }, { "docid": "e739b421332fffbe72afcb132ee1e0e2", "score": "0.7321665", "text": "def index\n @data[:index]\n end", "title": "" }, { ...
0b144b6571b588458ed558c1dc16beb6
store the change log info into our local database before going to the ActiveSolr save method to perform the saves and editstore updates
[ { "docid": "59e00e5fccd93a65fb83753240b52edc", "score": "0.6603315", "text": "def save(params={})\n user=params[:user] || nil # currently logged in user, needed for some updates\n add_changelog(user)\n update_item # propoage unique information to database as well when saving solr document\n ...
[ { "docid": "14af5f0ed474a3d288907395cf1272cd", "score": "0.6741636", "text": "def save_active_log\n # If there are changes to store, create the log entry. If the user opens a model and \"saves\",\n # don't store an empty change log entry.\n if !changes.empty?\n log ...
61a65286e7ef49015e3657e1c10a7041
GET /prodacts GET /prodacts.json
[ { "docid": "e19a4f6b9f237e7b4b2ec914b868eb34", "score": "0.672665", "text": "def index\n @prodacts = Prodact.all\n end", "title": "" } ]
[ { "docid": "8b24922d0583d74a755f4dee3638f0ed", "score": "0.6481701", "text": "def show\n @product = Product.find(params[:id])\n @product_cat = @product.product_cats\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "...
a21f30a545f2eee4958044025df99bf4
PUT /device_controls/1 PUT /device_controls/1.xml
[ { "docid": "73ed52cefcd7765e5cc939318f33bca8", "score": "0.63528407", "text": "def update\r\n @device_control = DeviceControl.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @device_control.update_attributes(params[:device_control])\r\n format.html { redirect_to(@device_control...
[ { "docid": "150f31cf27089b10c0ab056c96433f1c", "score": "0.62088364", "text": "def _set_control(_key, value)\n @client.session.set_device_controls @device.id, key: value\n end", "title": "" }, { "docid": "cb6e407c95e32cc14f81d19fa3e2a66d", "score": "0.6082181", "text": "def s...
78dbcf681caf0c973eac880ee16c25a9
TODO: continue implementing this test and its class so that the commented out lines would pass
[ { "docid": "0d5cb75634037209f8a3d787e3b6d87e", "score": "0.0", "text": "def test_import\n test_new\n exercise_count = Exercise.count(true)\n assert_import\n assert_equal exercise_count+1, Exercise.count(true)\n exercise = @s.exercise\n assert_equal \"https://reactrix.rmc1.xen.reactri...
[ { "docid": "ee42a5d35916b058b4abf81268dbb756", "score": "0.65710294", "text": "def comment_test5; end", "title": "" }, { "docid": "ee42a5d35916b058b4abf81268dbb756", "score": "0.65710294", "text": "def comment_test5; end", "title": "" }, { "docid": "072514f3348fe62556dcdf...
d6ca17bbd90146a1e9282910a4f8d36a
Iterative with Rangereduce, requires Ruby 1.8.7
[ { "docid": "48a49f71be50ec5e744067ee468705dd", "score": "0.0", "text": "def factorial_reduce(n)\n (2..n).reduce(1, :*)\nend", "title": "" } ]
[ { "docid": "aa54e811a59e95d1669654a665ce522e", "score": "0.59463096", "text": "def each(&block); end", "title": "" }, { "docid": "aa54e811a59e95d1669654a665ce522e", "score": "0.59463096", "text": "def each(&block); end", "title": "" }, { "docid": "aa54e811a59e95d1669654a6...
5b0dad2a3faee71b2bc08f36d0eabb97
This is how a user places a bid on an auction. It needs to be done this way to ensure normality of bid cout, time and transaction safety.
[ { "docid": "e7c73bf7c1157e2a1e4a11d2d32e0297", "score": "0.72558963", "text": "def bid_on!(auction)\n nb = nil\n nb2 = nil\n begin\n raise(BidError, \"Invalid auction: #{auction.to_s}\") unless aid = auction.to_id\n raise(BidError, \"Could not find auction: #{aid}\") unless a = Auctio...
[ { "docid": "d7cd7197abcd17fa94709d38c3d3ed91", "score": "0.76138556", "text": "def on_bid(bid)\r\n \r\n end", "title": "" }, { "docid": "4aa2092e58da457f7bc8449347c25fbd", "score": "0.74702567", "text": "def bid\n @item = Item.find(params[:id])\n setHighestPriceAndWinne...
ab974f2067d0c264311ffde25cb95b55
this method is called when a project:update command is run on an existing project. NOTE: from_version and to_version might be the same in the case we're forcing and reinstall. they could be different if moving from one version to the next
[ { "docid": "bcd8fc6edd2d4f5abdca667fd73b01f4", "score": "0.73654455", "text": "def update_project(from_version, to_version, tx)\n puts \"Updating #{MODULE_TYPE_NAME} from #{from_version} to #{to_version}\" if OPTIONS[:verbose]\n install(tx, true)\n replace_jar_eclipse(to_version,@path,tx)...
[ { "docid": "adb4f9630d1d4a14621cb4029c8ff087", "score": "0.6956399", "text": "def update_project(from_version, to_version, tx)\n puts \"Updating java from #{from_version} to #{to_version}\" if OPTIONS[:verbose]\n install(tx,true)\n\n classpath = IO.readlines(\"#{to_path}/.classpath\")\n ...
d197be4bb1e3c2bd4d34fc4f4a393c99
Ship PE tarballs to specified artifactory repo and paths
[ { "docid": "cf1fc7a1b59b61bad7f42aea9aada041", "score": "0.7276574", "text": "def ship_pe_tarballs(local_tarball_directory, target_repo, ship_paths)\n check_authorization\n ship_paths.each do |path|\n Dir.foreach(local_tarball_directory) do |pe_tarball|\n next if ['.', '..'].in...
[ { "docid": "532c082c00ee7709e143eb1658e28b8f", "score": "0.67113316", "text": "def download_final_pe_tarballs(pe_version, repo, remote_path, local_path)\n check_authorization\n artifacts = Artifactory::Resource::Artifact.search(name: pe_version, repos: repo, exact_match: false)\n artifact...
858268f2358c8d4becc07407bfcc9481
parse a list of items separated by commas, each item must either be delimited by quotes or not contain white space. There is no mechanism for quoting string delimeters within the string.
[ { "docid": "6ce6a17ab6345cb75a98afbd0bd823fe", "score": "0.0", "text": "def getList\n\n list = []\n begin\n list.push(quotedString(ANYWHERE))\n end while nextT == ',' # next is a reseved word!!!\n\n return list\n end", "title": "" } ]
[ { "docid": "c890aaa4ca8e1063b1f71bb5f161efb4", "score": "0.7496144", "text": "def parse_comma_seperated_string(s)\n list = s.split(',')\n end", "title": "" }, { "docid": "664f03755a59181066393320daa2c3a3", "score": "0.6764873", "text": "def comma_quoted_string_to_list(string)\n ...
41d6cb57fbf4914fdd18fdf76f1ae860
PATCH/PUT /events/1 PATCH/PUT /events/1.json
[ { "docid": "57a7ba442505f0a5f21616030d3a0201", "score": "0.0", "text": "def update\n respond_to do |format|\n hasppts = !event_params[\"ppts\"].blank?\n hasvideo = !event_params[\"video\"].blank?\n\n\n\n\n if @event.update(event_params)\n #Elimina el folder con las ppt para lueg...
[ { "docid": "4d95ee381a8e8f76f8d3ea23da4b3773", "score": "0.75299805", "text": "def patch_event\n user_id = params[\"user_id\"]\n group_id = params[\"group_id\"]\n event_id = params[\"event_id\"]\n\n #TODO Handle 404 if event not found\n event = Event.find(event_id)\n\n...
b705d84669d5b7f315c8feec254e5a8b
Begin working on this Job or Project by getting a message from the +jobRequests+ queue and calling +Smash::Job.build()+ with the params from the message from above and finally processing the job, whether it's valid or not Notes See +pluck_message()+ See +build()+ See +valid?()+ See +process()+ See +process_invalid()+
[ { "docid": "3eafea9496d5cada0b3b7072d3d99ed2", "score": "0.76200265", "text": "def work\n possible_job = pluck_queue_message(:job_requests) # FIX: pluck doesn't delete\n job = Job.build(@instance_id, possible_job)\n job.valid? ? process(job) : process_invalid(job)\n end", "title": ...
[ { "docid": "f94075b61642dffbaa08fd9571da097f", "score": "0.6610752", "text": "def queue\n # If a Document is associated with this ProcessingJob, determine\n # whether the Document is available to be worked on, and if it's not\n # use ActiveRecord's error system to indicate it's unavailability.\...
9fb2a6036bbdd070e0406aef2fa3610c
GET /product_orders GET /product_orders.json
[ { "docid": "b13dcfb92d1aa8e29343a00f2403e1d4", "score": "0.7306236", "text": "def index\n @product_orders = ProductOrder.all\n end", "title": "" } ]
[ { "docid": "93debe31a5dc591aac5382469f6efa28", "score": "0.7966271", "text": "def getProductOrderList\n product = ProductOrder.all.order(\"created_at asc\")\n render json: purchases, status: :ok\n end", "title": "" }, { "docid": "4519c4984f3d701c2f52f2db172695b3", "score": "0.7895...
2e13ba6c69c3650d0f35869fa08c8b17
turns a (sorted) sequence of values into a series of twoelement arrays where the first element is the start and the second is the length
[ { "docid": "019707151a73b1210ce855c644d219f3", "score": "0.0", "text": "def rangify(values)\n values\n .slice_when { |a, b| b - a > 1 }\n .map { |span| [span.first, span.length - 1] }\n end", "title": "" } ]
[ { "docid": "9f5daf0496928ee207bcce03b3b881b1", "score": "0.6445402", "text": "def make_array(startArrayValue, endArrayValue)\n\tresultArray = []\n\tfor i in startArrayValue..endArrayValue\n\t\tresultArray.push(i)\n\tend\n\treturn resultArray\nend", "title": "" }, { "docid": "eae66e9831874615...
a56c460862d912b8405dbcf815c0a00e
GET /site_visitors/1 GET /site_visitors/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "7eb8b246106ecb69a705a5684f1f1d36", "score": "0.7514059", "text": "def show\n user = User.find_by({token: env['HTTP_TOKEN']})\n render json: user.visits.find(params[:id])\n end", "title": "" }, { "docid": "cf0560c2e12ebd074381accccc282091", "score": "0.7113645", "t...
22871484fe96355ed6cda2a1a29cdfd8
GET /todos/1 GET /todos/1.json
[ { "docid": "4af4257a24245dd9a1c96ca1d2ea3f82", "score": "0.7094868", "text": "def show\n @list = List.find(params[:list_id])\n @todo = @list.todos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list }\n end\n end", "tit...
[ { "docid": "bfe8e5683d469b61b812536d897dbf8d", "score": "0.7546549", "text": "def show\n @todo = current_list.todos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @todo }\n end\n end", "title": "" }, { "docid": "95f...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0d582829429b8da85eadb9177f483917", "score": "0.0", "text": "def set_crew_blog\n @crew_blog = Crew::Blog.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60320485", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6013371", "text": "de...
eca0c4f27784fd71eb0beddd8a34b38c
Gets the next byte of the file
[ { "docid": "d7ad9cfa5310a22ef7bc96811dc1b40c", "score": "0.8292633", "text": "def next_byte(close)\n if !is_file_open?\n open_file\n end\n \n begin\n current_byte = @file_handle.getc\n \n if current_byte == nil or close\n close_file\n ...
[ { "docid": "e4bba611c5357855fec9a667b1d97e38", "score": "0.7717253", "text": "def next_byte(io)\n io.readbytes(1).unpack(\"C\")[0]\n end", "title": "" }, { "docid": "36fad534e43ce217d06db968000171f0", "score": "0.69081527", "text": "def getbyte\n read(1)\n end", "...
58d118c0781fabb3f37e91bc805ff6d6
Used to get Rackspace cloud credentials if not provided in Fog config
[ { "docid": "95868fe43c64d2a646d21969e17b502d", "score": "0.0", "text": "def get_user_input(prompt)\n print \"#{prompt}: \"\n gets.chomp\nend", "title": "" } ]
[ { "docid": "9a19e8f89c98d3aa81a3796d95854aaf", "score": "0.6890923", "text": "def fog_credentials\n Idnet.config.game_center.uploadings.cloud_credentials.to_hash.symbolize_keys\n end", "title": "" }, { "docid": "44af22d2ffa9a10c5967607f407040f3", "score": "0.68040335", "text": "d...
9a2c34e4733abc5dc01f32b4aaaa1dd9
This method can be further refined to 'chain' methods together. This creates cleaner, succinct and better understandable code
[ { "docid": "4eda6b089d97932a2f481f0fbaaf7228", "score": "0.0", "text": "def reverse_each_word(string)\n string.split.collect { |element| element.reverse }.join(\" \")\nend", "title": "" } ]
[ { "docid": "3348909c0296e7fbe2cda8729aab1d01", "score": "0.7566134", "text": "def chain; end", "title": "" }, { "docid": "3348909c0296e7fbe2cda8729aab1d01", "score": "0.7566134", "text": "def chain; end", "title": "" }, { "docid": "0b56eee9f06cd7a44fd0314772956d98", "...
450c3dfa4998ff7c37924a3c60a93b46
will only existed as nested through merchant must be merchants/:id/orders def index
[ { "docid": "2746398a45e1f739cc4efb3cb7c1bbdc", "score": "0.0", "text": "def show\n @order = Order.find_by(id: params[:order_id])\n\n if !@auth_user || @auth_user.id != params[:merchant_id].to_i\n flash[:status] = :failure\n flash[:message] = \"Cannot view order if you're not the authoriz...
[ { "docid": "ebbab474ea45161affceb28d10412aee", "score": "0.72338325", "text": "def index\n @orders = @customer.orders.all\n end", "title": "" }, { "docid": "bc2f435fe081340020f9d10abff7256f", "score": "0.715887", "text": "def index\n @vendor = Vendor.find(params[:vendor_id])\n...
7a88df729d57cd0a7c74cec82ccccb9f
Whitelist the holding request type
[ { "docid": "f02b98ff33b12877d9465f3d3035ac73", "score": "0.6069191", "text": "def whitelist_type(candidate)\n WHITELISTED_TYPES.find{ |type| type == candidate }\n end", "title": "" } ]
[ { "docid": "5f543e6937e41ef421a7e376834909b7", "score": "0.7174485", "text": "def allowed_request_type\n return if self.class::VALID_REQUEST_TYPE_CODES.include?(request_type.try(:code))\n errors.add(:request_type, 'Not an allowed request type for this request.')\n end", "title": "" }, { ...
58b8c5915f4d6200acf657c033f6e3fa
DELETE /member_commisions/1 DELETE /member_commisions/1.json
[ { "docid": "4f5a5295f12f8d626737269d1eb1bc7e", "score": "0.7758329", "text": "def destroy\n @member_commision.destroy\n respond_to do |format|\n format.html { redirect_to member_commisions_url, notice: 'Member commision was successfully destroyed.' }\n format.json { head :no_content }\n ...
[ { "docid": "ebd93fd6178729f067a4ee353186ca37", "score": "0.70123154", "text": "def destroy\n @comitemember.destroy\n respond_to do |format|\n format.html { redirect_to comitemembers_url, notice: 'Comitemember was successfully destroyed.' }\n format.json { head :no_content }\n end\n e...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "56a59f62dfa9a3372e6baa9c9154d9b1", "score": "0.0", "text": "def system_params\n params.require(:system).permit(:name, :heat, :wanted_level, :campaign_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7476923", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.71697617", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist ...
bb533fb6ab75e27e2d187d043d0f3c52
GET /prospecto_seguimientos GET /prospecto_seguimientos.json
[ { "docid": "45e3256e1835a63475ccbcddf1306424", "score": "0.71070206", "text": "def index\n @prospecto_seguimientos = ProspectoSeguimiento.all\n end", "title": "" } ]
[ { "docid": "ff979782a50c2c772bedc24504bb3699", "score": "0.72136253", "text": "def lista_prospecto\n\t\tprospectos = Prospecto.where(\"tipo = ? and estado_id = ?\", params[:tipo], 2)\n\n\t listaprospectos = prospectos.map do |prospecto|\n\t \tcontenidos = Contenido.find_by(prospecto_id: prospect...
dcc31fe133a83b7261d632213212357c
Returns the value of attribute green
[ { "docid": "4ec599fa1f7e08e4c4a9deedfa0b50e8", "score": "0.6406531", "text": "def green; end", "title": "" } ]
[ { "docid": "886cc2abb29a271677dc6e0e9e9f9e6f", "score": "0.90210843", "text": "def green\n attributes.fetch(:green)\n end", "title": "" }, { "docid": "0e9985f4bad743745372a4b7209084e1", "score": "0.8678671", "text": "def green\n hsl_to_rgb!\n @attrs[:green]\...
8b100a1f3eab0b6504c116073bc631d3
probably a better pattern for this but keep it simple
[ { "docid": "80ad80fb21c8235fcfaf12da6c26a392", "score": "0.0", "text": "def fetch(name)\n # thread-safe in MRI without mutex\n # due to how context switching works\n @mutex.synchronize do\n if @data.key?(name)\n @data[name]\n else\n @data.clear if @data.siz...
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.63306737", "text": "def desired; end", "title": "" }, { "docid": "3ae137b1a40ff3aae4f3cbb2b6082797", "score": "0.61044455", "text": "def reaper; end", "title": "" }, { "docid": "3caf4c824a6d6a4a5616c13fcab418da", ...
665ffcde20604eb8e78daf84edb5832d
Fastforward this branch to origin.
[ { "docid": "96e0be7d3321959e0609438cdf6f4136", "score": "0.53394324", "text": "def rebase\n log \"rebase origin/#{@branch}\"\n Dir.chdir @staging_dir\n `git rebase origin/#{@branch} &> /dev/null`\n status = $CHILD_STATUS.exitstatus\n update_submodules\n log \"#{@branch} is ...
[ { "docid": "71f93a94189d0396bd286c580495c61c", "score": "0.6386457", "text": "def sync_with_origin( branch_name )\n locals = @g.branches.local.map{ |b| b.to_s }\n \n @g.reset_hard\n\n if locals.include?(branch_name)\n @g.checkout(branch_name)\n else\n @g.checkout(\"origin/\" + b...
93958e9cf91a6e1e44b3bcaff89a335b
subscription handle we use call_id to present subscription handle it will increase automatically with each specific subscribe call call_id = identfier + 1 because internal counter is auto incremented
[ { "docid": "b5b963878ad4661890f08746f1498211", "score": "0.0", "text": "def identifier\n call_id\n end", "title": "" } ]
[ { "docid": "2b4d25a64cccc3117fc5f2fb36b9fcb7", "score": "0.6542869", "text": "def next_subscription\n\t\tend", "title": "" }, { "docid": "c0ffeb0e61a9a2378f9aa823286d2aa3", "score": "0.619198", "text": "def subscribe(sub)\n active_subscriptions.create(sub_id: sub.id)\n end", ...
e5fcffed6873840538b716171f1367fa
Actually perform the release
[ { "docid": "a1446a798c04451f9f5959caaeece53d", "score": "0.0", "text": "def run!\n project.mode = :release\n\n # Validate paths\n validate_paths!\n\n # Extract mockup\n copy_source_path_to_build_path!\n\n validate_stack!\n\n # Run stack\n run_stack!\n\n # Cle...
[ { "docid": "599f0f70df3cbc24b65f1ceaa224f22e", "score": "0.8604901", "text": "def release\n end", "title": "" }, { "docid": "8d796af83b84a4f562094d00ef395c1c", "score": "0.85713875", "text": "def release\n end", "title": "" }, { "docid": "8d796af83b84a4f562094d00e...
9934c1b490e48034b9abc46366b92ede
this method takes a url as argument and returns a nokogiri document object
[ { "docid": "1b3d15c5590bd5b22f1a90f45e1d300a", "score": "0.73783123", "text": "def open_from_url(url)\n Nokogiri::HTML(open(url))\n end", "title": "" } ]
[ { "docid": "66af5ccaf5ba0d8482349e69c2db7820", "score": "0.8258848", "text": "def doc(url)\n Nokogiri::HTML(open(url))\n end", "title": "" }, { "docid": "44c6ad33e16d23d0c4cdc94e7442438a", "score": "0.82545817", "text": "def get_doc\n begin\n @doc ||= Nokogiri...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "e30383233d95d737becc0ead4d1fd415", "score": "0.0", "text": "def modelagem_privacidade_params\n #params.require(:modelagem_privacidade).permit(:dimensoes, :dimensoes_id, :valor_dimensoes_id, :controle_privacidades_id, :tipo_comunicacoes_id)\n params.require(:modelagem_privacidade)....
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
6062b5a651f6a613482dd39bfd03c695
Module to get MAC
[ { "docid": "88c85e29f05086ea9e8b1786d99546e8", "score": "0.77078", "text": "def get_mac_addr\n dmac = system (\"ip addr | awk '/ether/{ print $2 }'\")\nend", "title": "" } ]
[ { "docid": "d58b5a490615b1d99da253c0a322b69e", "score": "0.8486911", "text": "def mac\n @mac\n end", "title": "" }, { "docid": "d58b5a490615b1d99da253c0a322b69e", "score": "0.8486911", "text": "def mac\n @mac\n end", "title": "" }, { "docid": "d58b5a490615...
eed99b79cb46b976623ca55c4a02d036
Historical note: We formerly had not_tied_to_any_active_judge until CASEFLOW1928, when that distinction became irrelevant because cases become genpop after 30 days anyway.
[ { "docid": "51f37aa2000aedcaf3f6ad8f6b078ef3", "score": "0.5186455", "text": "def not_tied_to_any_judge\n where(hearings: { disposition: \"held\", judge_id: nil })\n end", "title": "" } ]
[ { "docid": "e4ef60c0f895b059a0ee69fe2bd3b4cc", "score": "0.6525855", "text": "def non_genpop_for_judge(judge)\n joins(with_assigned_distribution_task_sql)\n .with_original_appeal_and_judge_task\n .where(\"distribution_task.assigned_at > ?\", Constants.DISTRIBUTION.cavc_affinity_days.d...
6f081d4be09d20b8595b83b18bb65b0c
Could this be a Hash? Can you use instance variables in a hash?
[ { "docid": "48653612788fabb0adca65c3aa575a8c", "score": "0.0", "text": "def seedList (team1,team2,team3,team4)\n @team1 = team1\n @team2 = team2\n @team3 = team3\n @team4 = team4\n end", "title": "" } ]
[ { "docid": "32a6bcd5fb44f2a5c33edf0fb74599ac", "score": "0.67581356", "text": "def hash\n instance_variables.inject( 17 ) { |m, v| 37 * m + instance_variable_get( v ).hash }\n end", "title": "" }, { "docid": "32a6bcd5fb44f2a5c33edf0fb74599ac", "score": "0.67581356", "text": "...
8f2ea0c8ff4f6a70f4a19da9464e67d2
Add image to exam
[ { "docid": "d9d57d933912b8be904a724981e0b620", "score": "0.6763706", "text": "def add_image\n @image = ExamImage.new(image_uncompressed: params[:image], exam_id: params[:exam_id])\n @image.save!\n @image.process_image_enhenced\n @image.process_image_black_and_white\n @image.process_image_...
[ { "docid": "c553861ea45696d635dd777dcea5368a", "score": "0.71792436", "text": "def add_image(options); end", "title": "" }, { "docid": "334fefac801cf81f338b067acc4d10a1", "score": "0.6364767", "text": "def add_sponsor_eligibility_image(candidate)\n filename = 'actions.png'\n sponso...
4ec4d647e917666c1d4f213e087d6471
Extracts the :device_list named option from the hash given and returns [ number of devices, an FFI:Pointer to the list of Device or nil ]
[ { "docid": "efe713e465623c0153d32e253a28e122", "score": "0.7223303", "text": "def get_device_list( options )\n devices = options[:device_list]\n devices = [devices].flatten if devices\n devices_p = nil\n num_devices = 0\n if devices and devices.size > 0 then\n num_devices...
[ { "docid": "cefdffc07653fda4e5f15de81e6aa07a", "score": "0.6982359", "text": "def get_device_list( options )\n devices = options[:device_list]\n devices = [devices].flatten if devices\n devices_p = nil\n num_devices = 0\n if devices and devices.size > 0 then\n num_devices...
b164f61c771370afee4f2032a81a1153
source def greeting puts 'Hello!' end number_of_greetings = 2 my version def greeting puts 'Hello!' end number_of_greetings = 2 while number_of_greetings == 2 greeting greeting break end this solution works but it is a shortcut and doesn't use logic LS answer:
[ { "docid": "cab8660eb00d1879076c4883509e053b", "score": "0.0", "text": "def greeting\n puts 'Hello!'\nend", "title": "" } ]
[ { "docid": "f6c80c200b65e2ba9e7a880246213b00", "score": "0.765191", "text": "def greeting(count)\n while count > 0\n puts 'Hello!'\n count -= 1\n end\nend", "title": "" }, { "docid": "c97acd61ca90c31ef24d702ae77e5839", "score": "0.72573054", "text": "def greeting(number_of_greeti...
6371f8aa0d47c14a432911474b42a377
Baseline implementation for the create_google_ads_link REST call
[ { "docid": "ffbaaf6c48e6e9c56dd7d3fbce4c451e", "score": "0.71585315", "text": "def create_google_ads_link request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_crea...
[ { "docid": "2841f5d98c6338b6e1273c07f397c464", "score": "0.6863688", "text": "def create_ad_sense_link request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_create_...
f9aa86cbd668079fcd7dc027f66c27ed
Psuedo code ask a user for two numbers do the math display results A prompt to make the console cleaner
[ { "docid": "717919860d75fbc23624f28151ce018e", "score": "0.0", "text": "def prompt(msg)\n puts \"=> #{msg}\"\nend", "title": "" } ]
[ { "docid": "660fc75c72eff7c1e38af47f850f2c6b", "score": "0.77356297", "text": "def qoutient\n print \"Give me two numbers please.\\n\"\n x = gets.chomp.to_i\n y = gets.chomp.to_i\n w = x / y\n z = x % y\n puts \"#{x} / #{y} = #{w} r #{z}\"\nend", "title": "" }, { "docid": "39550249b58b...
aae767fd78cfd4e9ea46eea05984280f
Front Envent Starting Determinant
[ { "docid": "eb4746829b6990be7321b2cc22b54b4d", "score": "0.0", "text": "def check_event_trigger_there(triggers)\n result = false\n # If event is running\n if $game_system.map_interpreter.running?\n return result\n end\n # Calculate front event coordinates\n new_x = @x + (@directio...
[ { "docid": "95f1998773e9059ea32a1092fcfe2198", "score": "0.6929239", "text": "def starting; end", "title": "" }, { "docid": "829c3dc817117b3e5f4db23da78c511d", "score": "0.67200947", "text": "def starting?; event(:start).pending? end", "title": "" }, { "docid": "261c1130b...
f93b3f016e1e7fd2181168cf54c762ab
Returns true if the given token matches the digest.
[ { "docid": "55e6d9fcb78ac48dabae2031b906012a", "score": "0.67039156", "text": "def authenticated?(token)\n digest = self.otp_digest\n return false if digest.nil?\n BCrypt::Password.new(digest).is_password?(token)\n end", "title": "" } ]
[ { "docid": "9e854261e13509b56a6bdd7480cceffa", "score": "0.78424853", "text": "def authenticated?(digest, token)\n digest = send(\"#{digest}_digest\")\n # Use metaprogramming to select the appropriate token attribute based on\n # the parameter digest.\n return false if digest.nil? # Digest d...
ca448055fb36deeb8cd4188873161b82
Resets the build statuses instance. Called after all notifications have been sent.
[ { "docid": "05af539cbeb61c3312a825007a1a5da6", "score": "0.848962", "text": "def reset_build_statuses\n @build_statuses.reset\n end", "title": "" } ]
[ { "docid": "85ba30b9a781cb424f6cbc4748821176", "score": "0.6651373", "text": "def clear_all\n @status_mutex.synchronize { @statuses = {} }\n end", "title": "" }, { "docid": "85ba30b9a781cb424f6cbc4748821176", "score": "0.6651373", "text": "def clear_all\n @status_m...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "691bb9e728f001bc20f3a29488438592", "score": "0.0", "text": "def set_gig_type\n @gig_type = GigType.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6165422", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60457647", "text": "def action_hook...
6c311503402f58dfd82497264b2af9b6
PATCH/PUT /establecimientos/1 PATCH/PUT /establecimientos/1.json
[ { "docid": "17343a4b18b106fd3f0d92dd40203f91", "score": "0.0", "text": "def update\n respond_to do |format|\n if @establecimiento.update(establecimiento_params)\n format.html { redirect_to new_establecimiento_path, notice: 'El Establecimiento fue actualizado exitosamente' }\n else\n ...
[ { "docid": "54e09616e95fac4bb701d89811657481", "score": "0.65524685", "text": "def update\n @establecimiento = Establecimiento.find(params[:id])\n\n if @establecimiento.update(establecimiento_params)\n head :no_content\n else\n render json: @establecimiento.errors, status: :unprocessa...
db5a117145ccb01bb4822f1dbde52c75
Run external command with timing information streams and logs the output of the command as well If the command fails, it is retried some number of times This defaults to 5, but can be specified with the num_retries parameter If all the retries fail, an exception is thrown Between retries it will sleep for a given perio...
[ { "docid": "3073932f23b8bf516e7c9afc1bd05a60", "score": "0.71942335", "text": "def run_cmd_with_retries(cmd, num_retries=5, sleep_seconds=2, timing_metric=nil)\n for i in 1..num_retries\n if i == num_retries then\n result = run_cmd(cmd, timing_metric)\n else\n result...
[ { "docid": "4f0bce953276d891399d683fda4bf4d2", "score": "0.7252171", "text": "def execute_with_retry(command, retryable_exit_codes = [], max_retries = 1, wait_time = 30)\n tries = 0\n begin\n tries += 1\n debug(\"Attempting to execute command - try #{tries} of #{m...
b6bca3c8e9ed649138c538b25ccccf47
DELETE /games/1 DELETE /games/1.json
[ { "docid": "45aa8e9ae01b4f6b3ab45b58900d8b33", "score": "0.0", "text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "fd4eb511cd5e957a76d59b08b0244ce9", "score": "0.7778331", "text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e556b38f3987e315b050212676687394...
3fa0c7f457c6d2464d5e8047c0a1c8bd
def books_scope(joins_table, condition) initial_scope.joins(joins_table).where(joins_table: condition) end
[ { "docid": "85028f9480322d1aab55210db514b68e", "score": "0.0", "text": "def sort_by_method(scope, method)\n scope.sort_by { |item| item.send(method) } .uniq.last(QUANTITY_INDEX)\n end", "title": "" } ]
[ { "docid": "b7d2964bf7738c7f0a6edd1440a33ca0", "score": "0.66980606", "text": "def scope\n assoc_scope = method(:association_scope)\n join_scope = method(:join_association_scope)\n\n ->(join_or_parent) {\n if join_or_parent.is_a?(ActiveRecord::Associations::JoinDependency::...
fe0af3dc548e437099ff4a8ec330a3bd
Converts a number to 2 decimal points and adds thousands delimiter + currency symbol.
[ { "docid": "923314ffda8f4fb7f4a9ae1a9107c64d", "score": "0.73501945", "text": "def toCurrency(number, symbol = '£', delimiter = ',')\n number = number.to_f\n minus = (number < 0) ? '-' : ''\n number = '%.2f' % number.abs\n number = number.to_s.reverse.gsub(%r{([0-9]{3}(?=([0-9])))}, \"\\\\1...
[ { "docid": "cc1e017fb68833ecfd723d12c7a6bb90", "score": "0.766311", "text": "def format_currency(number)\n # split integer and fractional parts\n int, frac = (\"%.2f\" % number).split('.')\n # insert the delimiters\n int.gsub!(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/, \"\\\\1,\")\n '$' + ...
129dc9bef0831bb050e821c15a56612e
GET /cores/1 GET /cores/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "96e9f7298530e61cfc3d2d270fdc23f9", "score": "0.6954949", "text": "def index\n @cores = Core.all\n end", "title": "" }, { "docid": "77541c4949f72231c405940d7d498ac6", "score": "0.69215786", "text": "def cores\n config_file = \"#{Dir.home}/.config/nci-jobs-to-cores.j...
ee873e2bba3dff8938ebdad95f5fc218
DELETE /sivic_participantecelulas/1 DELETE /sivic_participantecelulas/1.json
[ { "docid": "d56db4676e47a7cfbd9ada435b97590c", "score": "0.7798357", "text": "def destroy\r\n \r\n @sivic_participantecelula.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_participantecelulas_url }\r\n format.json { head :no_content }\r\n end\r\n end", ...
[ { "docid": "e4be1cc475305333111ceae4466161e0", "score": "0.73606557", "text": "def destroy\r\n @sivic_relatorioscelula.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_relatorioscelulas_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": ""...
e4e5411274f6589bca375d385a71e730
Creates a new tweet with type and user_id
[ { "docid": "59c026aa51368a1d256fab21045ca4ae", "score": "0.8096415", "text": "def create_new_tweet\n if params[:tweet][:type] != nil && params[:tweet][:type].gsub(/\\s+/, '') != '' # gsub-> Delete the spaces character for assert if the type really defined\n begin\n @new_tweet = Twee...
[ { "docid": "77ce6c12b43433b5394370015755aea0", "score": "0.77424634", "text": "def create \n \n @tweet = Tweet.new(tweet_params.merge(user: current_user))\n \n @tweet.user_id = current_user.id\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, noti...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "170cbc53fc2e4fc7af335cadb9c57298", "score": "0.0", "text": "def info_params\n params.require(:user).permit(:email, :fullname, :IC_number, :age, :races, :occupation, :phonenum, :aptnums, :owner, :emergency_name, :emergency_contact, :house_member, :house_member_name, :house_member_age, :h...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496729", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958585", "text": "def strong_params\n params.require(:request).permit(param_white...
0e0df32124b9f4734b93ebd009f47cc0
DELETE /posts/1 DELETE /posts/1.json
[ { "docid": "772bc5207bc4fb1f1efa33fce4ea184a", "score": "0.0", "text": "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url, notice: 'Post was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "d2967b0b04aeff2fcebfecba1d4cd0a1", "score": "0.7746168", "text": "def destroy\r\n @post.destroy\r\n\r\n render json: {}, status: :ok\r\n end", "title": "" }, { "docid": "0bb7e18bf412742726aadde12b6d1174", "score": "0.7729559", "text": "def destroy\n @post.destro...
e7d79399902c136e25a7edd64cdcd1ee
Creates a new Token
[ { "docid": "35e7bf7e6dd72f9e17094c38495bca06", "score": "0.0", "text": "def create_token_using_post_with_http_info(token_params, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TokenApi.create_token_using_post ...'\n end\n # verify the r...
[ { "docid": "e7705a4a4ef9150e7e0f2f7e3a007733", "score": "0.86166304", "text": "def new_token()\n Token.new(self)\n end", "title": "" }, { "docid": "2806e4a7d0b7e50c6e0e94924a63537c", "score": "0.8078081", "text": "def createToken\n parameters = {\n :scope ...
09f7616d29fae3e3d07d9a2b95fb4a7a
Options: since_id, max_id, count, page
[ { "docid": "aea463d7500d08f3dc912b0341c8149f", "score": "0.0", "text": "def mentions(options={})\n perform_get(\"statuses/mentions.json\", options)\n end", "title": "" } ]
[ { "docid": "dc4371a4cfe746519ea033ee04c78c4d", "score": "0.63882107", "text": "def some_posts(before_id: 0, offset: 0, max_id: nil, since_id: nil)\n options = { limit: [(@limit || 50), 50].min }\n options[:max_id] = max_id if max_id\n options[:since_id] = since_id if since_id\n o...
0a10e74a9316b76bb71a1f6ac51ef280
TODO make update_sale method
[ { "docid": "e7592093097e2392042ed2e47391d2e9", "score": "0.0", "text": "def active_sale\n on_sale? ? first_sale(sale_prices.active) : nil\n end", "title": "" } ]
[ { "docid": "ebe9a3f28ee680217a56c7ed1f8ae7d4", "score": "0.78061384", "text": "def update\n get_data\n @sale_detail = @sale.details.find(params[:id])\n @sale_detail.update_attributes(params[:sale_detail])\n get_data\n end", "title": "" }, { "docid": "2f27af585105b60094b78c4e3d46...
8f7dceaba8fa0781f67f13cbdebc2811
Replaces the search policy
[ { "docid": "4880a0ca90f515d3ecf9b0fac57d38d1", "score": "0.60862833", "text": "def searchpolicy=(val)\n if val.is_a?(String)\n eval @policy_key+\"= val\"\n else\n eval @policy_key+\"= #{val}\"\n end\n end", "title": "" } ]
[ { "docid": "343dcde2f19dcf2ac56598f5c866c5bc", "score": "0.74897414", "text": "def set_custom_searchpolicy\n self.searchpolicy = @custom\n end", "title": "" }, { "docid": "249b3cb9ca96c1a32a7d6b8a99207683", "score": "0.6028676", "text": "def searchpolicy\n eval @policy_k...
a98d2a48e73eafe0c47861d6ab201a69
GET /players GET /players.xml
[ { "docid": "2a79c03524d4aaac063fd08bbf9d3b63", "score": "0.72922504", "text": "def index\n @players = Player.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @players }\n end\n end", "title": "" } ]
[ { "docid": "9d9f56bd7e0d7c69d870df77987ca01b", "score": "0.7278636", "text": "def index\n @team = Team.find(params[:team_id])\n @players = @team.players\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @players }\n end\n end", "title": "...
fe1313d3ad41ab31df691a61c152bb0b
Replace this with your real tests.
[ { "docid": "72fd36c52f9358823fcd80b429120869", "score": "0.0", "text": "def test_truth\n assert true\n end", "title": "" } ]
[ { "docid": "35a51327dd0b5c9a884bb0e6f7155697", "score": "0.7446459", "text": "def testing\n # ...\n end", "title": "" }, { "docid": "1a6186064d8218f9aa0c8b82bcc4fdae", "score": "0.6956364", "text": "def __dummy_test__\n end", "title": "" }, { "docid": "8fbc...
dc7fa43b305594fb1971e28accbf154f
The resolved ruby style arity
[ { "docid": "e8e0f7fe0bdd01f197af0a6f6f4d7f4b", "score": "0.6785375", "text": "def arity\n max = _init_().reverse()[1]\n min = _init_().reverse()[2] \n \n if max == min\n return max\n end\n \n return min * -1\n end", "title": "" } ]
[ { "docid": "dc27474e7179bd671ea069a62c4373f1", "score": "0.86781174", "text": "def arity() end", "title": "" }, { "docid": "7737b91d9e5383d392d34a09092842e1", "score": "0.8431725", "text": "def arity; end", "title": "" }, { "docid": "7737b91d9e5383d392d34a09092842e1", ...
9008858cdf5e05708ee8b86b853f7c88
GET /admin/product_shows/1 GET /admin/product_shows/1.xml
[ { "docid": "6eef1740b1e3fcf102a5fcacaab54e20", "score": "0.7295346", "text": "def show\n @product_show = ProductShow.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @product_show }\n end\n end", "title": "" } ]
[ { "docid": "482179fa0d6f604dc70ef55f2b286081", "score": "0.7120092", "text": "def show\n @publisher = Publisher.find @product.publisher_id \n\t\t@versions = Version.find :all, :conditions => \"product_id = '#{@product.id}'\"\n respond_to do |format|\n format.yaml \n format.json \n f...
d01000640d18282f47b5e01783be24a3
Add all issues, that should be in that tag, according milestone
[ { "docid": "2b7856c0b55f06aac662104ee80f7629", "score": "0.7547451", "text": "def find_issues_to_add(all_issues, tag_name)\n all_issues.select do |issue|\n if issue[\"milestone\"].nil?\n false\n else\n # check, that this milestone in tag list:\n milestone_is...
[ { "docid": "98a79e2edf5f1dc9bdade2280494edb8", "score": "0.7533851", "text": "def find_issues_to_add(all_issues, tag_name); end", "title": "" }, { "docid": "cba6a4b946b0c1487d145da3acc438fa", "score": "0.6399069", "text": "def issues\n Issue.where(milestone_number: number)\n end"...
68d54260010246ff29e10819cb4ee116
:number is required but has a default value
[ { "docid": "1ea7e1b693c85d53b57bc5d08b370bbb", "score": "0.0", "text": "def required_fields\n [:recipe, :ingredient]\n end", "title": "" } ]
[ { "docid": "2ac59b1e14e559de4c32a9638f5a2b90", "score": "0.67523146", "text": "def number_params\n params.require(:number).permit(:value)\n end", "title": "" }, { "docid": "eb3c3aa3fa20e9462e5732dfe392cb6d", "score": "0.6732231", "text": "def number_default_value(text)\n t...
6c4e1953e2b3351c41f4489281047673
Returns true if the publication is currently pending.
[ { "docid": "7987d19eb26b7905a0eb3b1340bb4332", "score": "0.7780259", "text": "def publication_pending?\n validating? || creating? || testing?\n end", "title": "" } ]
[ { "docid": "2121d345be8107b93a179ddc28898a26", "score": "0.85346675", "text": "def pending?\n self.subscription == :pending\n end", "title": "" }, { "docid": "ab6f186787ec8c9cfcab1ac6737d326d", "score": "0.84557235", "text": "def pending?\n self.pending\n end", "t...
955a04ad09bfe59f958a034ef2295776
Provide a detailed, user friendly representation source://twilioruby//lib/twilioruby/rest/conversations/v1/service/conversation/webhook.rb439
[ { "docid": "473108fa97cee58671b779c2ccfec06f", "score": "0.0", "text": "def inspect; end", "title": "" } ]
[ { "docid": "87e29fa0537686f6c59133ff2d7d7b98", "score": "0.74088144", "text": "def inspect\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Conversations.V1.WebhookContext #{context}>\"\n end", "title": "" }, ...
ad7b0cb3f8d1049aaad003bc28d8c509
Parse the module table for any classes
[ { "docid": "75e2eb1e5d74d9b13f0d1551ff1ec347", "score": "0.5209118", "text": "def parse_table(table_rows)\n classes = Tableau::ClassArray.new\n @day = 0\n\n # delete the time header row\n table_rows.delete(table_rows.first)\n\n table_rows.each do |row|\n @time = Time.new(...
[ { "docid": "41e3ffef1a6eed6c4cd6106b0281b43e", "score": "0.63655037", "text": "def do_modules \n @content.scan(/%module\\s+(\\w+)/) do |match_data|\n module_name = match_data[0]\n @module = handle_class_module(nil, \"module\", module_name, @top_level)\n break # first %module only\n ...
f0d6c2e17d2ef151a6a2aaca2693538f
end ElegxosNomimotitas FUNCTION TO CHECK THE CORRECTNESS (='orthotita' in Greek) OF THE MOVE (i.e. a Bishop can only move in diagonals, rooks in lines and columns etc)
[ { "docid": "5e6d08a6426411003663cad329d4a6db", "score": "0.6907506", "text": "def ElegxosOrthotitas(eOSkakiera)\r\n\r\n orthotita = false;\r\n @@enpassant_occured = false;\r\n\r\n if ((@@m_WhoPlays.CompareTo(\"Human\") == 0) && (@@m_WrongColumn == false) && (@@MovingPiec...
[ { "docid": "d050ff55178c69d0f95e85903b85b3a6", "score": "0.65200484", "text": "def validate_move(move)\r\n # If square is taken\r\n return false if move == \"A1\" && $A1 != \" \"\r\n return false if move == \"B1\" && $B1 != \" \"\r\n return false if move == \"C1\" && $C1 != \...
65dbb794a4d4f03be367ae40803ffcdc
Special link that checks for current section. If it exists and it's a paged section, use link_to_page instead.
[ { "docid": "184610a9bf2d25821e28eb7c89e68643", "score": "0.57964987", "text": "def link_to_search_result(article, *args)\n if current_page_section && current_page_section[:is_paged]\n link_to_page(article, current_page_section, *args)\n else\n link_to_article(article, *args)\n end\n ...
[ { "docid": "bd7dd23edec0470e793295dbce0bbd32", "score": "0.68561953", "text": "def nav_link_to(name, options={}, html_options={})\n # options[:action] ||= 'index'\n # params[:action] ||= 'index'\n \n if options[:action].blank? && options[:controller].to_s == params[:controller].to_s\n i...
d2c7f4c995671b655aa77b0ef6d14808
PATCH/PUT /encounters/1 PATCH/PUT /encounters/1.json
[ { "docid": "c4df9813e904008aa127ff2bb3e321bd", "score": "0.0", "text": "def update\n respond_to do |format|\n @back_url = Patient.find_by(MRN: @encounter.patient_mrn)\n # Upon Editing a record that doesn't have a patient, then return to the Encounters Index\n if @back_url.nil?\n ...
[ { "docid": "94f3f46dd095b749908e72eed874fdd0", "score": "0.7024655", "text": "def update\n @counter = Counter.find(params[:id])\n\n respond_to do |format|\n if @counter.update_attributes(params[:counter])\n format.html { redirect_to @counter, notice: 'Counter was successfully updated.'...
94de09c878b34b9e71fbaf515aaa7b89
know if self is liked by model Example:
[ { "docid": "e1ee31456d73bee787132b341b293384", "score": "0.751322", "text": "def liker?(model)\n self.likers_assoc.find(:all, conditions: {like_id: model.id}).limit(1).count > 0\n end", "title": "" } ]
[ { "docid": "0cb9b47f2a78c55ae7f18ba8b04e5baf", "score": "0.8292077", "text": "def is_liked(model) \n Like.where(:likable => model ,:user_id => self.id).present?\n end", "title": "" }, { "docid": "40aed8e24d8832c3cbb27c89491bd522", "score": "0.8220304", "text": "def liked?(mode...
7e88bf57b17a634de7427c74304afdc5
POST /structure_drawings POST /structure_drawings.json
[ { "docid": "4e308d1783277e79a8f1232fbe500730", "score": "0.75717354", "text": "def create\n @structure_drawing = @sub_project.structure_drawings.build(structure_drawing_params)\n\n respond_to do |format|\n if @structure_drawing.save\n format.html { redirect_to project_sub_project_struc...
[ { "docid": "f3e0bd32d8afd1d38513c5764c83d3b5", "score": "0.66776365", "text": "def update\n respond_to do |format|\n if @structure_drawing.update(structure_drawing_params)\n format.html { redirect_to project_sub_project_structure_drawings_path(@project, @sub_project), notice: 'Structure d...
3d1bcc6e824faa4fdf45fd8318837cc6
Validation to check if the content template text or name is set/ Sets error if not set
[ { "docid": "ee3ddae840ecc7f9df586f88d1e6392c", "score": "0.78399044", "text": "def content_template_specified?\n return if content_template_text || content_template_name\n\n errors.add :content_template_name, 'or content template text must be set'\n end", "title": "" } ]
[ { "docid": "47569c36c2f08c85852c53a5c56d2b7c", "score": "0.69715387", "text": "def validate_template_name\n GlobalConstant::PepoCampaigns.supported_templates.include?(@template_name) ? success : error_with_data(\n 'e_hc_stm_1',\n 'something_went_wrong',\n GlobalConstant...
847b3d020660344a8ad1c0e8a2d11f08
Apply a "proper" case to all strings
[ { "docid": "88d573af20882b26c724e42916f412db", "score": "0.0", "text": "def namecase_names\n write_attribute(:last_name, NameCase(last_name)) if last_name && will_save_change_to_last_name?\n write_attribute(:first_name, NameCase(first_name)) if first_name && will_save_change_to_first_name?\n wr...
[ { "docid": "9a31da30ee07efd563e40d214ef58a3a", "score": "0.7903526", "text": "def weirdcase(str)\n \nend", "title": "" }, { "docid": "fd01b06efa87a107281e1ab82ac73c06", "score": "0.77899027", "text": "def proper_case(string)\n\t# split on spaces for big words to join with spaces\n...
4bb8d0d64905b5edd60ccde1e0bcd61b
get_renderer method used for rendering the erb template
[ { "docid": "65817ac32786e48fdb811a58cec53a43", "score": "0.7792065", "text": "def get_renderer(template)\n renderer = ERB.new(template, 0, '-%>')\n renderer.result(get_binding)\n end", "title": "" } ]
[ { "docid": "922da2a4295286fffb3d08225c3a3077", "score": "0.788579", "text": "def renderer; end", "title": "" }, { "docid": "01645393b96eb850f958ec2aa440e1f8", "score": "0.7824068", "text": "def view_renderer; end", "title": "" }, { "docid": "01645393b96eb850f958ec2aa440e1...
da02ecf4283b972d9614f90299404ba4
Given a String of C type +ty+, returns the corresponding Fiddle constant. +ty+ can also accept an Array of C type Strings, and will be returned in a corresponding Array. If Hash +tymap+ is provided, +ty+ is expected to be the key, and the value will be the C type to be looked up. Example: include Fiddle::CParser => Obj...
[ { "docid": "00222e20323e1810aa23f0b49616509e", "score": "0.6739901", "text": "def parse_ctype(ty, tymap=nil)\n tymap ||= {}\n case ty\n when Array\n return [parse_ctype(ty[0], tymap), ty[1]]\n when \"void\"\n return TYPE_VOID\n when \"char\"\n return TYPE_CH...
[ { "docid": "47619bd07354b12dbfa3b7f65363d2f1", "score": "0.56826043", "text": "def lookup_cpptype(t) t = @@typemap[t] and return t end", "title": "" }, { "docid": "6ad4c8a16b94333d155b33240de9614f", "score": "0.54328585", "text": "def getCSharpType( type )\n\n entry = $typeTable.s...
e7e47520bc6e081503f8cce7cd9eb603
rubocop:enable Metrics/MethodLength figure out the utility border classes to use arguments: ARRAY list (required): a list of the sides that should get borders
[ { "docid": "9a84890d66e004db72e67608767958e0", "score": "0.75376123", "text": "def border_classes(sides, class_prefix = 'border')\n if sides.is_a?(String)\n return '' if sides == 'none'\n\n return class_prefix if sides == 'all'\n\n return \"#{class_prefix}-#{sides}\"\n end\n\n si...
[ { "docid": "ae994e316303a11eb25722af872b87f3", "score": "0.76163846", "text": "def border_classes(sides, class_prefix = 'border')\n if sides.is_a?(String)\n return '' if sides == 'none'\n return class_prefix if sides == 'all'\n \"#{class_prefix}-#{sides}\"\n else\n sides.collec...
94df4823fe24bd3f7a06f099fbf9cb78
Filters the repositories in organizations that have been commited something between to dates (excluding those dates)
[ { "docid": "8b40a206ffeb3a818df8f6f11b6dd75c", "score": "0.8017561", "text": "def filter_org_repos_between(repos, start_date, end_date)\n #Filter local repos\n repos_stored = Array.new\n repos_after_start_date = Array.new\n if (!start_date.nil? && !end_date.nil?)\n ...
[ { "docid": "fa34a855bcb3a16cdd0cb6feb808f1d6", "score": "0.65173763", "text": "def repos\n #Get Name of the organization\n org_name = \"\"\n start_date = nil\n end_date = nil\n\n if !params[\"from\"].blank?\n start_date = params[\"from\"].to_date - 1.days\n end\n\n...
54d62e9ab36e5eb494a4ec973dce0d59
reorder scores and scales
[ { "docid": "2aaf6ed4c8e3e14bb55351c613f5b220", "score": "0.50716114", "text": "def index\n @scales = ScoreScale.find(:all)\n end", "title": "" } ]
[ { "docid": "9e7bbfa31a951694faee66850e8d839f", "score": "0.6419185", "text": "def reorder_data\n @data = data.select { |o| o[:score] > 1 }\n .sort_by { |o| o[:score] }\n .reverse[0, limit]\n end", "title": "" }, { "docid": "081804d67c82466d692b73ea3608696a",...
bcdeb5406b5c73a4382ee22f79fc7661
wrapper for running tests, gives speed and error report
[ { "docid": "356d0aacb156dcbeb05679dea6848176", "score": "0.7006331", "text": "def run!\n time = Time.now\n yield\n time = ((Time.now-time)*1000).round\n \n print \"\\n ---\\n\"\n \n if @@error_count == 0\n green \"All #{@@test_count} tests finished in #{time} ms with no err...
[ { "docid": "8ed4d9487da168e3023e8e171ccf922e", "score": "0.7399219", "text": "def run_tests\n _run_anything :test\n end", "title": "" }, { "docid": "8070cf01e82acc4e4d86843e06ba340a", "score": "0.7395185", "text": "def run_test\n\t\trun_test(20000)\n\tend", "title": "" ...
edb936f53ed6584408063e421b32dd25
Special case, return the right hand side's to_pig
[ { "docid": "17984524036804f90e8415e0a1f6cfa9", "score": "0.7039177", "text": "def to_pig pig_context, current_plan, current_op\n rhs.in_foreach_plan = in_foreach_plan\n rhs.nest_context = nest_context\n rhs.to_pig(pig_context, current_plan, current_op)\n end", "title": "" } ]
[ { "docid": "1c076db20b5def96128e7ded2532f181", "score": "0.66016966", "text": "def english_to_pig(english)\n print english[1..-1].to_s + english[0].to_s + \"ay\"\n #[1..-1] gives index 1 through end\nend", "title": "" }, { "docid": "5e1553c7512bc595182a580216e0ec9a", "score": "0.648206...
caa2d3fdc5a464b03575ea7beeb533ad
For Wrapper DEVS: current_realm will be checked against openid.return_to value. Read more from method complete_openid.
[ { "docid": "2b834e3324ff58b1b6872c2e2a84998e", "score": "0.5586334", "text": "def current_realm\n request.protocol + request.host_with_port + request.path\n end", "title": "" } ]
[ { "docid": "c12504b63733422881c37d436d3a4f5a", "score": "0.57697415", "text": "def advofinder_realm?\n @user ? @user.af_realm? : Project.af_realm?\n end", "title": "" }, { "docid": "e37ba08c484fe86551a900e7cf68c100", "score": "0.57559425", "text": "def realm\n self.establi...
04f631364c0f608d1a55e9ca08cf8928
check if the role returned from the oauth provider is admin. This is only for convenience, the API will enforce roles either way.
[ { "docid": "aa07c91c6002923d4b62ba4a3d380dab", "score": "0.0", "text": "def admin!\n return true if Rails.env.development?\n return unless authenticate!\n\n unless session[:user_role] == :admin\n reset_session\n render text: '', status: :unauthorized\n end\n end", "title": "" ...
[ { "docid": "53bdbeccf82ea2e64f69a4c7c6ada0a5", "score": "0.83253837", "text": "def is_admin?\n role == 'admin'\n end", "title": "" }, { "docid": "ad0b2bbb8987fbc9cfda5341e0003312", "score": "0.8287672", "text": "def admin?\n role.try(:name).eql? ROLES[:admin]\n end", ...
4d77feff599b8b7508385ed537406fd9
When comparing Metabase output, Metabase returns Date fields with a time component see So the SQL query should convert date columns to strings for comparison.
[ { "docid": "5a378c6f8dc8efd495b96de6cc1b8cb0", "score": "0.0", "text": "def files_are_same?(rb_out_file, out_file)\n FileUtils.identical?(rb_out_file, out_file)\n end", "title": "" } ]
[ { "docid": "ed06abd816a483079b5484c22c95f7d7", "score": "0.60817313", "text": "def date_column_value\n if transferred? || transferring_out?\n induction_record.end_date.to_date.to_fs(:govuk)\n elsif transferring_in?\n induction_record.start_date.to_date.to_fs(:govuk)\n ...
5ac99f95c361880f21219b7214de8c54
POST /expenses POST /expenses.json
[ { "docid": "abefcea067dda923f85d00dfa0df428a", "score": "0.0", "text": "def create\n @expense = Expense.new(params[:expense])\n # 이력 저장하는 로직 추가\n expenseHistory = ExpenseHistory.new(params[:expense])\n expenseHistory.save\n \n # existing = Expense.find_by_creditor_id_and_debtor_id(@exp...
[ { "docid": "e48a112dce56b3b297ec899ec947f184", "score": "0.77485085", "text": "def post_expense(expense)\n post '/expenses', JSON.generate(expense)\n expect(last_response.status).to eq(200)\n\n parsed = JSON.parse(last_response.body)\n expect(parsed).to include('expense_id' => a_kind...
c6348badf4d33d1e170153628118db7a
Untuk backoffice, e.g: Progress, RequestPayout, Completed
[ { "docid": "702f2df23c757709683fc2d4d416b36c", "score": "0.0", "text": "def status_backoffice(html=true)\n # Memorization, so we're not searching it again.\n if self.started?\n return (html ? \"<span class='label label-warning'>Progress</span>\".html_safe : 1)\n elsif self.closed?\n r...
[ { "docid": "45ed63968d62b9d7ec78805c75fb0b76", "score": "0.5998936", "text": "def unconfirm_submit pb\n text_reply(pb, \"Retype your response, please.\")\n end", "title": "" }, { "docid": "9c21cf3aaa1e0dd9415d852605f683ee", "score": "0.58911717", "text": "def complete!\n chang...
8fc1491444ef12da9cd243e0a6401bfe
GET /tables/1 GET /tables/1.json
[ { "docid": "07d96c1766932f52920ae2f11bc2ba5b", "score": "0.7151465", "text": "def show\n @table = Table.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @table }\n end\n end", "title": "" } ]
[ { "docid": "d07afbbebb637cac046efe7038afb1a3", "score": "0.7235843", "text": "def list(table)\n self.get(\"/#{table}\")\n end", "title": "" }, { "docid": "044cf0570e831c26d6dff8079c9bb742", "score": "0.7149468", "text": "def show\n @table = Table.find(params[:id])\n respond...
09c41cae4496306d7dad53f97d708920
return reddits base uri
[ { "docid": "092e937330d1fdbd26390b4ae1970cb1", "score": "0.8071249", "text": "def base_uri\n \"https://www.reddit.com\"\n end", "title": "" } ]
[ { "docid": "9c5fdaafbac609ec4616ef17f0f4f359", "score": "0.766591", "text": "def base_uri()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "9c5fdaafbac609ec4616ef17f0f4f359", "score": "0.766591", "text": "def base_uri()\n ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "7737ef4d388e753da46760f391def18e", "score": "0.0", "text": "def field_rent_params\n params.require(:field_rent).permit(:field_id, :service_id, :fecha, :hora, :descripcion)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...