query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
f1ccbd3b76531dc102094f14b709365f
Waits for the server to stop
[ { "docid": "449d2ec18dcd68fa2d0d51efecb4541b", "score": "0.0", "text": "def join(timeout: nil)\n if timeout\n if !@server_thread.join(timeout)\n raise Timeout, \"timed out while waiting for the server to stop\"\n ...
[ { "docid": "4ae08ec050a8b8713d6b92858a4597f7", "score": "0.76607394", "text": "def stop\n wait\n stop!\n end", "title": "" }, { "docid": "7bee2dbc80e2ddd789ef223eb1c4805f", "score": "0.76438844", "text": "def stop! timeout = nil\n stop\n wait! timeout\n ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "1699b02bd4ad77bf4bcce3845a2a3a44", "score": "0.0", "text": "def production_order_params\n params.require(:production_order).permit(:number, :description, :quantity, :pending_quantity, :release_date,\n :due_date, :isCompleted, :article_id, :c...
[ { "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...
443375699b188bd2547a5896d4fc63d4
Get current user from context
[ { "docid": "9ba2aa8f30f0a38773517c887695a8f4", "score": "0.8522057", "text": "def current_user\n @context[:user]\n end", "title": "" } ]
[ { "docid": "b8e16cfa1a8feb7c9cc0cce5f92ce80b", "score": "0.8706471", "text": "def current_user\n context[:current_user]\n end", "title": "" }, { "docid": "79b582eeac040a3be0acc8a1aec225fa", "score": "0.8657504", "text": "def current_user\n context[:current_user]\n ...
6880ec8f30dcecc0e64201d0cbaa14cf
Convenience method. Display "TBD" for nil.
[ { "docid": "cccd67144006c1f7cc7089668eda20b1", "score": "0.0", "text": "def venue_name\n\t self.venue_id ? self.venue.name : 'TBD'\n\tend", "title": "" } ]
[ { "docid": "b00f89103c42a2947c908610f79397bb", "score": "0.6537203", "text": "def description(desc = T.unsafe(nil)); end", "title": "" }, { "docid": "b00f89103c42a2947c908610f79397bb", "score": "0.6537203", "text": "def description(desc = T.unsafe(nil)); end", "title": "" }, ...
f33313a3c86b3ce18a2baba3ca6ddf70
def verify_signin if !signed_in? redirect_to '/Signin' end end 125713683635
[ { "docid": "e661195329ac66677efc3d219ab4cc4d", "score": "0.0", "text": "def index_verify\n\n id_passed = params[:id]\n \n # Rails.logger.info('in users id_passed = ' + id_passed.to_s)\n # Rails.logger.info('id_passed not nil')\n \n # b_id_exists = IssuedGenId.exists?(:gen_id => id_pass...
[ { "docid": "bdba91ac6a893a2196e1537c2d11ae0f", "score": "0.85187286", "text": "def verfier_signin_status\n unless user_signed_in? && is_verifier?\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "db7381343b150f2fae9344c29b1f6841", "score": "0.8148167", "text...
340b67624eae80c49ad8e346821f3c71
=begin Write a method stock_picker which takes an array of stock prices (prices on days 0, 1, ...) and outputs the most profitable pair of days on which to first buy the stock and then sell the stock. =end
[ { "docid": "14745e069d6a668fcba45822eacec6f5", "score": "0.7792535", "text": "def stock_picker(array)\n result = 0\n largest = 0\n# count is the value of the array to check against the arrays proceeding values, which are represented by step\n count = 0\n step = 1\n while count < array.length - 1\n ...
[ { "docid": "bb59c4dbfad820b582bb5bf0bdedebfe", "score": "0.8620827", "text": "def stock_picker(prices)\n combinations = prices.combination(2).to_a\n profits = combinations.map { |days| days[1] - days[0] }\n (0...prices.size).to_a.combination(2).to_a[profits.index(profits.max)]\nend", "title": "" ...
392b8e3fadd0b1ce8b1bf60aa310a9fe
register an adapter to handle one extension
[ { "docid": "e77ee71831a944789cd916039991dfa7", "score": "0.7992362", "text": "def register(extension, handler)\n @adapters.merge!(extension.to_sym => handler)\n end", "title": "" } ]
[ { "docid": "ef7a09c5ad505eb2b8bfe5526ff43c34", "score": "0.75894755", "text": "def register_adapter(driver, adapter)\n adapters[driver] = adapter\n end", "title": "" }, { "docid": "5b3ad0eb72ffe367a89f8248261df81c", "score": "0.7502369", "text": "def add_adapter(adapter)\n ...
92380a6e3bb7501f5ca3faf1035a69c9
GET /doacoes/1 GET /doacoes/1.json
[ { "docid": "1b8f48b9e439803a707e64278378d75a", "score": "0.71314704", "text": "def show\n @doacao = Doacao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @doacao }\n end\n end", "title": "" } ]
[ { "docid": "39400dc029c1a6dbd878f065d90b9dbe", "score": "0.7257889", "text": "def index\n @doctores = Doctores.all\n\n render json: @doctores\n end", "title": "" }, { "docid": "f23ca27eb69f43814ac7b8b921c72d70", "score": "0.6985754", "text": "def index\n @dioceses = Diocese...
cc0bbb897248bb698447643757e80f10
GET /debate_votes/1 GET /debate_votes/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "9ba722e79a826849b743b3bfe76c15f9", "score": "0.72128695", "text": "def votes(options = {})\n get('/votes', options)\n end", "title": "" }, { "docid": "b14f44b3058f8981c9eda6cf8bf6ac73", "score": "0.71655", "text": "def index\n @debate_votes = DebateVote.all\n ...
6834857aefe5d76378af62541bed4318
Enable connection source This will make it so the specified source will be able to be synchronized.
[ { "docid": "d430d922e943004948d002788df6908f", "score": "0.0", "text": "def users_id_user_connections_id_connection_sources_id_source_put_with_http_info(id_user, id_connection, id_source, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: Connections...
[ { "docid": "c136e5b1b2f686094639929457cc53d0", "score": "0.6218745", "text": "def lock_source(source)\n @source_info ||= source\n self\n end", "title": "" }, { "docid": "fe41ba1a5fe2b7fcbd859543821282fe", "score": "0.5904874", "text": "def set_source\n @source = Sou...
4b1e12e33668f3a8e41f614275748106
PUT /tasks/1 PUT /tasks/1.json
[ { "docid": "2051015cefa629de4414e7e893bacb0a", "score": "0.0", "text": "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to (params[:return_to] || @task), notice: 'Task was successfully updated.'...
[ { "docid": "cac9c96d9b119273d80222fef2554029", "score": "0.761173", "text": "def update\n @task.update!(task_params)\n json_response(@task)\n end", "title": "" }, { "docid": "099e7266a80d49d1d0e30816e04aff39", "score": "0.759024", "text": "def update\n task = Task.find(para...
0851bfca138443652583f27c9e13f1bc
DELETE /board_columns/1 DELETE /board_columns/1.json
[ { "docid": "c230369b512b6f164f308878badeee39", "score": "0.711546", "text": "def destroy\n @board_column.destroy\n respond_to do |format|\n format.html { redirect_to board_columns_url, notice: 'Board column was successfully destroyed.' }\n format.json { head :no_content }\n format.j...
[ { "docid": "c31799dc866a694d72aeacaa4056fc47", "score": "0.746257", "text": "def destroy\n @default_board_column.destroy\n respond_to do |format|\n format.html { redirect_to default_board_columns_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "doc...
27149f7a7f69ad841a759b46b5a6cb76
Write a method that will take an array of numbers, and return their sum. Example: sum_numbers([1,1,1]) should return 3 sum_numbers([5,2,100,0,10]) should return 117 Check your solution by running the tests: ruby tests/04_sum_numbers_test.rb
[ { "docid": "313d469b66c61f7e1aaf3b97728544f4", "score": "0.0", "text": "def sum_numbers (numbers)\r\n##INJECT METHOD\r\n # numbers.each do |thing|\r\n # thing \r\n # this is where you put the thing to check for strings/not numbers\r\n # end \r\n numbers.inject(:+)\r\n# ##ACCUMULATOR METHOD\r\n#...
[ { "docid": "8558294e2a1abc743581b4a1caa0c66d", "score": "0.8372821", "text": "def total(array_of_numbers)\n sum = 0\n array_of_numbers.each do |num|\n sum += num\n end\n return sum\nend", "title": "" }, { "docid": "7dd239861579223583a778dea5a63d4d", "score": "0.82926416", "tex...
ff8a1fe4ddc3fb343749065bff83495d
Returns array ( [] ) of all relatie page urls
[ { "docid": "121d9f804d46b6c9fb6ae88719e5fd55", "score": "0.0", "text": "def all()\n not_implemented()\n end", "title": "" } ]
[ { "docid": "e2c1fecb4ab828d142799611a343e714", "score": "0.79298055", "text": "def urls\n @urls ||= @pages.map { |p| p.path }\n end", "title": "" }, { "docid": "004541c1cdaca824755639c038e83537", "score": "0.76698565", "text": "def urls\n links.map { |link| to_absolute(l...
00931b335d6c4e651c1337b675416ed7
Delete an existing user from the data store
[ { "docid": "6636f87c27a7e16e617db7f4cfdfb42c", "score": "0.75600636", "text": "def delete_user(username)\n\t\t\t\t@session['datastore'][username] = nil\n\t\t\tend", "title": "" } ]
[ { "docid": "336a0487d3e9be05d1726b7c9c98bbad", "score": "0.80578065", "text": "def delete_user\n client.delete(user)\n end", "title": "" }, { "docid": "62bf0016034c3b6fdf0b1f9fd457ba12", "score": "0.80257547", "text": "def delete_user(id)\n @user = User.destroy(id)...
ff7f9ed8b16e497565590bd9f62049eb
GET /vas_responses GET /vas_responses.json
[ { "docid": "c6a4ac04e017b887752ef49357e4bcf7", "score": "0.773878", "text": "def index\n @vas_responses = VasResponse.all\n end", "title": "" } ]
[ { "docid": "b8e0862accab7b89d3ab1dd6752fbc12", "score": "0.69365704", "text": "def index\n \t @responses = Response.all\n end", "title": "" }, { "docid": "e646084025de84bb1feb3911786cb914", "score": "0.6828073", "text": "def index\n @responses = Response.all\n end", "title"...
ce86eed889efd605f9f1d3ee4a5d480c
GET /items/1 GET /items/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "54748291efc0ecbbc050090a2600e1b8", "score": "0.7736765", "text": "def show\n @items = Item.find(params[:id])\n render json: @items\n end", "title": "" }, { "docid": "196801831a75757e64bd58ddbfa8c969", "score": "0.75480884", "text": "def get_item( item )\n @ses...
085d0f79052176bad05237affee8d9fe
In Ruby, Def Leppard means: define method Leppard
[ { "docid": "f58ccd2db5e7c9018dbbedc77adb1f7d", "score": "0.0", "text": "def tame( number_of_shrews )\n number_of_shrews.times {\n puts \"Tamed a shrew\"\n }\nend", "title": "" } ]
[ { "docid": "11731a5a3243408f29627ae9ed59e1ed", "score": "0.5967488", "text": "def paradox\n end", "title": "" }, { "docid": "c66f3477911241684923f50f19928246", "score": "0.5864579", "text": "def d(*) end", "title": "" }, { "docid": "f0134e6c165e2749490c8c9d1f1f48a2", ...
bca01eb0e48dd71a5511995f0a28e2d9
Returns the namespace in which the class is defined.
[ { "docid": "cf23f252632c4e9bceacfb437de650d1", "score": "0.7078076", "text": "def namespace_module()\n unless defined?(@namespace_module)\n if marker = self.name.rindex(\"::\") then\n namespace_name = self.name[0..(marker-1)]\n @namespace_module = eval(name...
[ { "docid": "d84bad1283763f582fb5392dc4f37cb0", "score": "0.8634604", "text": "def namespace\n self.class.namespace || self.class.name.split('::').join('_').downcase\n end", "title": "" }, { "docid": "629464b8d568d5f9e5120c6d557eb916", "score": "0.8345367", "text": "def na...
cbb696c4e09dfd7a846b95bf799fc689
Return the specified number +number+ as an array of number phrases.
[ { "docid": "33a7d654135ab7502c3b4f1108fc74ea", "score": "0.6303337", "text": "def number_to_words( number, config )\n\t\treturn [config[:zero]] if number.to_i.zero?\n\n\t\tif config[:group].nonzero? then\n\t\t\treturn number_to_custom_word_groups( number, config[:group], config[:zero] )\n\t\telse\n\t\t\...
[ { "docid": "56769f955c4a83e733ff537b5e725909", "score": "0.70205253", "text": "def numbers(number)\n str = ''\n # splits a number into an array\n @arr = num_to_array(number)\n\n (0..8).step(3) do |i|\n\n str << hundreds(@arr[i], i) << ' ' # hundreds\n # add translation\n str <...
543c80f879eb263b2b5dd03c1e222213
GET /analytics_predict_samples GET /analytics_predict_samples.json
[ { "docid": "42520744b9ef5865e898610673cf6398", "score": "0.783113", "text": "def index\n @analytics_predict_samples = AnalyticsPredictSample.all\n end", "title": "" } ]
[ { "docid": "a2ed4ec019e09464cbbc4bbdbb14b20f", "score": "0.69402784", "text": "def set_analytics_predict_sample\n @analytics_predict_sample = AnalyticsPredictSample.find(params[:id])\n end", "title": "" }, { "docid": "374888fc6a92abfd2355449775dfbc2c", "score": "0.68791044", ...
1e456f12baacf77e1e1423f7a32458f1
Defines settings from the provided hash. source://image_processing//lib/image_processing/mini_magick.rb141
[ { "docid": "41beb7e054c4c0437616f8bf0a777673", "score": "0.0", "text": "def define(options); end", "title": "" } ]
[ { "docid": "15aa7d08dc935a5772429ab388d6a1a8", "score": "0.62964153", "text": "def wms_settings=(hash)\n\t\t\thash[:min_sin_y] = Math::asinh(Math::tan(hash[:bbox][0][0] / 180.0 * Math::PI)) * 6378137.0\n\t\t\thash[:max_sin_y] = Math::asinh(Math::tan(hash[:bbox][1][0] / 180.0 * Math::PI)) * 6378137.0\n\t...
07c388a3f67224e08fbb09723e2cad62
Check if the current user can upload documents to the specified category
[ { "docid": "d02126b1aaf10686272240dc57401524", "score": "0.6947686", "text": "def upload_permitted_categories\n # Return all categories the current user can upload to\n return nil if User.current.nil?\n permitted_categories = Category.all if User.current.admin?\n permitted_categories ||= Use...
[ { "docid": "ff83562ce2d06ab7aeda8fe92dee1096", "score": "0.9076254", "text": "def can_upload_documents(category)\n if !User.current.nil?\n if category.nil?\n # User will specify category upon uploading\n return true\n elsif category.is_writable or User.current.member_of(catego...
38fe5fec337d567cb59a884a09863892
Attempts to start an Amazon Elastic Compute Cloud (Amazon EC2) instance. Prerequisites: The Amazon EC2 instance.
[ { "docid": "d26bbb1ff0bd04c7cc5600e727389df5", "score": "0.5888221", "text": "def instance_started?(ec2_client, instance_id)\n response = ec2_client.describe_instance_status(instance_ids: [instance_id])\n\n if response.instance_statuses.count.positive?\n state = response.instance_statuses[0].instan...
[ { "docid": "37be87686f66b1cbb1e679ebba760b8b", "score": "0.7076894", "text": "def start(action = :default)\n unless ec2_instance.exists?\n raise Cloud::Cycler::TaskFailure.new(\"EC2 instance '#{@instance_id}' does not exist\")\n end\n\n if status == :stopped\n @task.unsafe(\"Starting ...
2ddfebce4b9fdc3e15aca205102c3734
Action generates a simple script that makes the main model spin for 45 seconds. This allows for scenes without any userprovided scripts at all.
[ { "docid": "0c13160b1d1e84123262d03db4ae7f85", "score": "0.74797606", "text": "def simple_script\n\t\tscript_text = \"load #{scene_file_data_url(@scene, @scene.main_model.filename)}\\n\" +\n\t\t\t\t\t\t\t\t\t\"spin on\\ndelay 45\\nmessage 'MP_DONE';\"\n\t\tsend_data(script_text, filename: 'simple.spt') ...
[ { "docid": "339e675aed56bfa0d41375acbaaf1358", "score": "0.62238294", "text": "def simulate_computer_thinking\n spinner = TTY::Spinner.new(\"[:spinner] Computer Thinking ...\", format: :pulse_2)\n spinner.auto_spin # Automatic animation with default interval\n sleep(2) # Perform task\n spinn...
27aa2c09f826fef9771b98c4d82dfe48
1. Input the students arguments
[ { "docid": "8135196002cedb55d9791d36d2f8fd5b", "score": "0.6383667", "text": "def input_students\n puts \"------------- Student List Form -------------\".center(60)\n puts \"Add a student profile to the list. What's his/her name?\".center(72)\n\n name = gets.chomp.downcase.capitalize\n\n while !na...
[ { "docid": "3d62efcacdbeafd686689271b8221237", "score": "0.69449985", "text": "def student_input(students)\n\tputs \"Please enter the name of the first student and press RETURN\"\n\tputs \"or press RETURN to exit\"\n\tname = gets.chomp.capitalize\n\t\twhile !name.empty?\n\t\t\tputs \"Please enter the co...
95df726a64387620f1840539e1026819
Public: Create a saved query in SlicingDice API query(Hash) A Hash to send in request Returns a hash with saved query created and SUCCESS status
[ { "docid": "00f50aa9b6bfc8d9d948aad378de86c6", "score": "0.69624805", "text": "def create_saved_query(query)\n url = @base_url + METHODS[:query_saved]\n saved_query_wrapper url, query\n end", "title": "" } ]
[ { "docid": "0c17e97f86c2203641e8fff01a86b5a1", "score": "0.6686239", "text": "def create\n @query = SavedQuery.new(saved_query_params.except(:query_field_ids, :query_filters))\n @query.organization_list = @organization_list\n @query.created_by_user = current_user\n filter_data = saved_query_...
e7a24668957e2f19149ec43bd0267fed
:nodoc: convert empty strings to nil
[ { "docid": "d2b7ea931e2a786fbfbfb2d8b8d32043", "score": "0.0", "text": "def reason=(new_reason)\n new_reason = nil if new_reason.blank?\n super new_reason\n end", "title": "" } ]
[ { "docid": "a043e860b03cc058eebfe8872ea78340", "score": "0.83553785", "text": "def transform_empty_to_nil stringVal\n stringVal = nil unless stringVal.nil? || stringVal.length > 0\n stringVal\n end", "title": "" }, { "docid": "688b177ff25fbdfd8c16827a257313fe", "score": "0.8053146...
091dcdc8a2f89347411a5da65e017e64
Execute a block of code within a given scope. If `locator` begins with `/` or `./`, then it's assumed to be an XPath selector; otherwise, it's assumed to be a CSS selector.
[ { "docid": "78b4814eb0ccb10ca55bb8a84ee33a31", "score": "0.68454784", "text": "def scope_within(locator)\n if locator\n # Use the selector_for method if it's defined. This may be provided\n # by features/support/selectors.rb, generated by cucumber-rails.\n if defined? selector_...
[ { "docid": "9f9b300d1bd3a0f498f8bf141732eeb4", "score": "0.6109628", "text": "def within(locator, &block)\n old_body = response.parsed_body.dup\n elements = response.parsed_body.search(locator)\n if elements.size > 1\n raise Futile::SearchIsFutile.new(\"Multiple elements found for scope '%...
6e8d30cb1c493ed656e65ddd0dfd5e0d
Task: Given an input string, reverse the string word by word. A word is defined as a sequence of nonspace characters. The input string does not contain leading or trailing spaces and the words are always separated by a single space. For example, Given s = "the sky is blue", return "blue is sky the". Could you do it inp...
[ { "docid": "fa6ffebfa0cd192aa67c9ff46538a040", "score": "0.0", "text": "def reverse(string, first = 0, last = string.size - 1)\n while first < last\n string[first], string[last] = string[last], string[first]\n first += 1\n last -= 1\n end\n string\nend", "title": "" } ]
[ { "docid": "f093fb217df010d8679bac25a32d77ee", "score": "0.8386096", "text": "def word_reverse_2(string)\n # string.split(' ').reverse.join(' ')\n word_array = string.split\n i = 0\n while i < word_array.length/2\n tmp = word_array[i]\n word_array[i] = word_array[word_array.length-...
a338967804983d97f6c1ef8e71a50880
PATCH/PUT /company_users/1 PATCH/PUT /company_users/1.json
[ { "docid": "7264913b833ee2c55faeb600f16c04e7", "score": "0.75836265", "text": "def update \n if @company_user.update(company_user_params)\n render json: @company_user\n # 'company was successfully updated.'\n else\n render json: @company_user.errors, status: :unprocessable_entity...
[ { "docid": "dfa32f1bad858bfa48bc1f7929e03144", "score": "0.77240986", "text": "def update\n @user = current_api_v1_user\n begin\n if params[:company]\n if @user.company.present?\n # binding.pry\n\n @user.company.update_attributes!(company_params)\n else\n ...
6c9d880399a64876f32fd94e558135fe
Convenience method to reduce boilerplate.
[ { "docid": "cab4c61b2d6715a368004ab5bd420801", "score": "0.0", "text": "def unescape_if(text, condition)\n if condition\n unescape(text)\n else\n text\n end\n end", "title": "" } ]
[ { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.587713", "text": "def wrapped; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.587713", "text": "def wrapped; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", ...
e76670387df49bc1f825c5bb0e7c16ec
Generates created_at and updated_at fields for insert clause if model has either created_at or updated_at column.
[ { "docid": "9fc942b49122ab01b161bd4de84e5327", "score": "0.6938778", "text": "def insert_timestamps\n timestamps = {}\n if model_class.columns.include?(:created_at)\n timestamps[:created_at] = Sequel.function(:NOW)\n end\n if model_class.columns.include?(:updated_at)\n timestamps[:...
[ { "docid": "d28a44a9e8e3c5c47de169bbf5a2eab0", "score": "0.69404423", "text": "def created_at\n with_type!(Fixnum) { attribute_from_model(:created_at) || attribute_from_model(:created) }\n end", "title": "" }, { "docid": "d2ab735fcf8f963fe4a4d3174950adb5", "score": "0.67159545", ...
e0fe08a0fccd45891d90f5976b1b3098
Factors a Builder instance ready for loading a yaml schema file
[ { "docid": "f3a7c01e7309740ee53a362c10a3c2f9", "score": "0.77109754", "text": "def yaml_builder(schema = Schema.new)\n DbAgile::Core::Schema::Builder.new(schema)\n end", "title": "" } ]
[ { "docid": "831bba093b913df339927e706f48a71d", "score": "0.6921577", "text": "def from_yaml(filename); end", "title": "" }, { "docid": "ee8c5e82e9745ec789bbbcbc989546a3", "score": "0.6818498", "text": "def load_yaml_schema(filename)\n schema = YAML::load_file(filename)\n schema = a...
e4e6ac3f8a9f6af8e7486282dd90e522
param string name Zone name
[ { "docid": "862191f2341aa4f1b10ddf0b2eb14fb7", "score": "0.61496335", "text": "def zonegroups_add name: \n call_adglare_api 'zonegroups_add', { name: name }\n end", "title": "" } ]
[ { "docid": "d7e0fd7fd7d7c56ba971594116bc99e6", "score": "0.7659243", "text": "def by_name name\n begin\n self.get_zone( :id => \n list_zones.find { |z| z[:name] == name }[:id]\n )\n rescue NoMethodError\n puts '='*80 + \"\\n Failed to f...
a9fefe174b42e95134924fd05fd05be7
Method to update the quantity of an item input: hash, item and quantity steps: 1. use hash, item, quantity as parameters 2. locate item in hash as key 3. set new value for item output: return updated list
[ { "docid": "0291471b1b53a915a6a02bb2c3f4bda1", "score": "0.0", "text": "def update_item(list, item, quantity)\n add_item(list, item, quantity)\nend", "title": "" } ]
[ { "docid": "5265bed4f58c8f58733f9a0372c70b7a", "score": "0.86478794", "text": "def change_qty(list, item, qty)# input: Hash, Item to be updated, number to change the quantity to\r\n list[item] = qty # steps: Identify input with element in hash and update quantity\r\n #print_list(list)#for testing\r\n ...
934125e079402fb36d5db49ee860b19d
Returns the identified Role The role parameter can either be a Role or a Role identifier.
[ { "docid": "ba11886a7a207c0e42da9bb813dd65df", "score": "0.73745924", "text": "def get!(role)\n raise Exception, \"Role 'role_id' not found\" unless has?(role)\n role_id = (role.class <= Rend::Acl::Role) ? role.id : role.to_s\n roles[role_id][:instance]\n end", "tit...
[ { "docid": "59242dcc60525fd45f57a02b1d282338", "score": "0.77306837", "text": "def get_role(role_name)\n self.class.get_role(role_name)\n end", "title": "" }, { "docid": "565147b04ffe7ab0c4a2645c0ddd34f4", "score": "0.75554323", "text": "def role\n @role\n end", "titl...
d16bce6becd60598936a282c9591edc3
GET /songs/1 GET /songs/1.json
[ { "docid": "ab711ed66dde1ff29f978b359b3418df", "score": "0.70515215", "text": "def show\n @song = Song.find(params[:id])\n @yt_id = YoutubeSearch.search(\"#{@song.name} #{@song.artist.name}\").first['video_id']\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { r...
[ { "docid": "380a713e8490ce81d40763857453fc01", "score": "0.7938354", "text": "def show\n @song = Song.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @song }\n end\n end", "title": "" }, { "docid": "a1204526d85b23dec0039e42ad8af384", "score": "0.7...
380c73a5cb3c83209edb5660ef60f014
Clears the current cache
[ { "docid": "f3bfc5df8b3d8836bee13211dbb150e0", "score": "0.8815942", "text": "def clear_cache\n\t\t@cache.clear\n\tend", "title": "" } ]
[ { "docid": "7102fca3d9b1ca81ecb5f28d7946c6e5", "score": "0.9098571", "text": "def cache_clear\n clear\n end", "title": "" }, { "docid": "06299326358430f14b18730c311914e8", "score": "0.8949957", "text": "def clear\n cache.clear\n end", "title": "" }, { ...
beb5a6ca5961975af70e1b5dc232dc9b
Add user to a group.
[ { "docid": "8dc38944ff479d00a7dda0531cc3b319", "score": "0.6974545", "text": "def add_to_group(group_path, group_name)\n group = RubyAem::Resources::Group.new(@client, group_path, group_name)\n group.add_member(@call_params[:name])\n end", "title": "" } ]
[ { "docid": "92865b2deba4da39174f2b9da74f1905", "score": "0.8662208", "text": "def add_user_to_group(user, group)\n\t\t\tend", "title": "" }, { "docid": "2269e909e96ed865a74e96c02975561e", "score": "0.8322128", "text": "def add_to_group(group)\n raise 'InvalidGroup' unless group....
fe7fea65310aa7648cd16bb53fc142fd
Uses method missing to call device actions
[ { "docid": "fb5ef0b6699f906e69c6a070b1a36dfd", "score": "0.0", "text": "def method_missing(method_name, *arguments, &block)\n neurosky.send(method_name, *arguments, &block)\n end", "title": "" } ]
[ { "docid": "ff4e89ae772c225676d99334d269e1da", "score": "0.6678652", "text": "def method_missing(method_name, *arguments, &block)\n device.send(method_name, *arguments, &block)\n end", "title": "" }, { "docid": "ff4e89ae772c225676d99334d269e1da", "score": "0.6678652", "te...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "bd09f9caf0b3f3ffddf6deb0fc2e5f90", "score": "0.0", "text": "def set_email_setup\n @email_setup = EmailSetup.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
a0816edc489bf3c0463bf0d2c91934d2
DELETE /urls/1 DELETE /urls/1.json
[ { "docid": "864242d412d36f3ceadc401ecda3ce95", "score": "0.0", "text": "def destroy\n @url.destroy\n respond_to do |format|\n if @url.entity == 'course'\n @course = Course.find(@url.entity_id)\n format.html { redirect_to @course, notice: 'Url was successfully destroyed.' }\...
[ { "docid": "1931e5d24dc4c014efbd5c50db6ad044", "score": "0.73736393", "text": "def destroy\n @url.destroy\n respond_to do |format|\n format.html { redirect_to urls_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1931e5d24dc4c014efbd5c50db...
6991181127b84bbd4cbf612d2b16f5c0
pops up a list, taking a single key and returning if it is in range of 33 and 126 This is a specialized method and overrides textpads keys and behavior
[ { "docid": "3d8b9fc72477f305cc88ecddbc1b345c", "score": "0.0", "text": "def ri_full_indexed_list list, config={}, &block\n config[:row] ||= 0\n config[:col] ||= 0\n config[:width] ||= FFI::NCurses.COLS - config[:col]\n width = config[:width]\n if config[:title]\n width = config[:titl...
[ { "docid": "9aff1182ef39ebca60f839703f216ecd", "score": "0.60476583", "text": "def key_pressed(key)\n begin\n string = \n if key == 32\n \"<space>\"\n elsif key == 13\n \"<enter>\"\n else\n key.chr\n end\n \n puts string\n rescue RangeErr...
fcad3c6b92e2dff9e95a8d5738c6f119
GET /stores/1 GET /stores/1.json
[ { "docid": "624c31fde1f2aaf172c5bf8cb8f01ed8", "score": "0.0", "text": "def show\n @store = Store.find(params[:id]);\n @store_menus = StoreMenu.where(store_id: params[:id]);\n @store_options = StoreOption.where(store_id: params[:id])\n @near_stores = @store.near_stores\n end", "title": ...
[ { "docid": "ab8b36e0e8eedd1067d8b58772370d6f", "score": "0.7733386", "text": "def index\n @stores = Store.all\n\n render json: @stores\n end", "title": "" }, { "docid": "c9713145c8f4bca7b1098334489929e3", "score": "0.76797426", "text": "def index\n @api_v1_stores = Store.al...
cab6384fe00790170ee40e5fffd545de
scan all node recursively
[ { "docid": "9fffab0abc8d2f1a21bbbabfda0a1497", "score": "0.0", "text": "def parse_xml(body, &block)\n xml = REXML::Document.new(body.to_s)\n _parse_xml(xml, &block)\n end", "title": "" } ]
[ { "docid": "da444750ea94e57255da5b28d1b3d560", "score": "0.7141197", "text": "def visitAll( &block )\n \n# Visit this node.\n \nvisit( &block );\n \n# Visit all of this node's children.\n \nchildNodes.each{ |c| c.visitAll( &block ); }\n \nend", "title": "" }, { "docid": "6447ca94f3120bc858af...
0d176dc8114f955fc603419b5c16c24f
GET /mutation_consequences/1 GET /mutation_consequences/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "b2b4f9fa772cc17e0b3ef68bf820d7c5", "score": "0.73566705", "text": "def index\n @mutation_consequences = MutationConsequence.all\n end", "title": "" }, { "docid": "f2b149d4fcdd0e956efeefc64112302c", "score": "0.68956655", "text": "def set_mutation_consequence\n @m...
91bc057ed698085392f43208d0a1e407
Consume the entire stream and put the contents into an array Oldest Style for backward compatibility
[ { "docid": "034cae30b7361f39125a5f2e18a8a12a", "score": "0.0", "text": "def consume(column_names = nil, column_types = nil)\n result = []\n\n if column_names\n set_columns(column_types, column_names) \n else\n read_columns\n end\n\n while true\n begin\n ...
[ { "docid": "d45502c40fdca8aaf205fc3df39e15dd", "score": "0.64344496", "text": "def read!\n objects = []\n last_terminator_index = @data.rindex(terminator)\n if last_terminator_index\n last_terminator_index += 1 # include the following \\n\n objects = consume!(last_...
9220242bad6d54c9a5731ffa0e3703c1
links to the lights_switch function inside car
[ { "docid": "0bd70516fcdcd6de941c24e27eb2d86b", "score": "0.0", "text": "def lights_switch\n @car = YAML.load(cookies[:car])\n # runs the function inside the class car\n @car.lights_switch\n cookies[:car] = @car.to_yaml\n render 'create.html.erb'\n end", "title": "" } ]
[ { "docid": "6f1d068695e911b3ec6f634272fe5258", "score": "0.8009825", "text": "def light_switch\n if (@lights == \"On\")\n @lights = \"Off\"\n else @lights = \"On\"\n end\n end", "title": "" }, { "docid": "f7caf5cc4be0d91c40585707e32436f7", "score": "0.7701584", "text":...
d8442c7758c5ea45b5b042984e38419b
PUT /embeddable_video_players/1 PUT /embeddable_video_players/1.xml
[ { "docid": "6f8371e8da3e39134117759796db4ce1", "score": "0.6579425", "text": "def update\n cancel = params[:commit] == \"Cancel\"\n @video_player = Embeddable::VideoPlayer.find(params[:id])\n if request.xhr?\n if cancel || @video_player.update_attributes(params[:embeddable_video_player])\n...
[ { "docid": "ef00884d71661d235010c7a44b88c3b3", "score": "0.6703532", "text": "def update\n @player.update(player_params)\n render json: @player, status: 200\n end", "title": "" }, { "docid": "92c20b592e1e0ddf29626e5d1b0b5dd0", "score": "0.6577861", "text": "def update\n res...
cbc3b73952ec18961ec0f36a2f408927
Return true if user types "y" or "yes". Case insensitive.
[ { "docid": "995ad1fcc4965543544e8a732bbdc852", "score": "0.8160946", "text": "def user_agree?\n return gets.chomp =~ /^(y|yes)$/i\n end", "title": "" } ]
[ { "docid": "be3bb9b25c91d81d75a9e8c1f121be47", "score": "0.7973271", "text": "def yes?(answer)\n answer.downcase[0] == 'y' ? true : false\n end", "title": "" }, { "docid": "daaf9447bb9d1a2c1919d04fed9aaa1f", "score": "0.7950041", "text": "def get_true_or_false\n\t\tprint \"'y' or...
3caa5e418a1fc47c009abff1bf730189
symbol for column used as id, needed?
[ { "docid": "ae9ac674594cf5820d543e7e4baabeb7", "score": "0.819456", "text": "def id_col\n :id\n end", "title": "" } ]
[ { "docid": "8049bd8ef32e4134809d3b48ffde8f17", "score": "0.82312465", "text": "def col_id; end", "title": "" }, { "docid": "d76f9141b8d39cb3e0059ba3d1389555", "score": "0.7556477", "text": "def id_column\n raise \"Abstract! Overwrite this method in your subclass\"\n end", ...
b3f16d6f7e1e4d70ae991fd10ade47ac
GET /cadres/1 GET /cadres/1.json
[ { "docid": "8c5909721fe8b208984f9f0fcbf22b6c", "score": "0.0", "text": "def show\n session[:cadre_id] = @cadre.id\n @classroom = Classroom.find(session[:classroom_id])\n end", "title": "" } ]
[ { "docid": "4e6cbffd90f5b4aa338fba33c6b530b4", "score": "0.7108377", "text": "def show\n @cadena = Cadena.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cadena }\n end\n end", "title": "" }, { "docid": "a8d7c79a680...
fb8f5cfe5a8493b288609842f2318fc5
POST /products POST /products.json
[ { "docid": "4b4e60d9cc3cabd05f2e055cf31ed1d1", "score": "0.0", "text": "def create\n @product = Product.new(product_params)\n @product.user_id = params[:user_id]\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully cre...
[ { "docid": "407bb6093aa234f76822a55ce5f56b4c", "score": "0.76166385", "text": "def create\n Product.create!(product_params)\n json_response(product_params, :created)\n end", "title": "" }, { "docid": "3ddcbf5081b4581931f5cffb5d1126c4", "score": "0.7605046", "text": "def create...
12b77cd97b40cc22dde26150e67e1cb1
check the status of authentication for a given context
[ { "docid": "a93b0f977a4ac1ac6e153820dd0c71f3", "score": "0.6682895", "text": "def authenticated?(ctx)\n ctx[:server][:authenticated] && !ctx[:server][:authenticated].to_s.empty?\n end", "title": "" } ]
[ { "docid": "eb4c0a397cd632252886d3611e10654d", "score": "0.70343554", "text": "def check_authentication\n authenticate_user\n end", "title": "" }, { "docid": "c9d48afeb35c95d82f3170207b118ce7", "score": "0.69810647", "text": "def authentication_successful?\n current_user.pre...
1470e8b8702b7e0991ec9c38539dc2d9
get user type value
[ { "docid": "b31f5947cf025d3fcc44b2528a7e48f6", "score": "0.67071813", "text": "def user_type(t_obj, value)\n t_obj.receiver_type = \"Student\" if value.downcase == \"s\"\n t_obj.receiver_type = \"Employee\" if value.downcase == \"e\"\n end", "title": "" } ]
[ { "docid": "afc791148fc435c9995c3c13ad56d836", "score": "0.804248", "text": "def user_type; end", "title": "" }, { "docid": "4b5ffddea14ccbfa24751e20ae5ffc41", "score": "0.7765565", "text": "def user_type\n # The user type can't be handled by the method_missing magic\n # fr...
7b2fd062708847bcba179331dcc52a10
To delete a record Intuit requires we provide Id and SyncToken fields
[ { "docid": "f648bfab3d4d26182e6a39f8ed4494cd", "score": "0.0", "text": "def valid_for_deletion?\n return false if(id.nil? || sync_token.nil?)\n id.to_i > 0 && !sync_token.to_s.empty? && sync_token.to_i >= 0\n end", "title": "" } ]
[ { "docid": "7fd70428740c70438e41ee46874b7099", "score": "0.6372859", "text": "def delete_record *rid\n db.delete_record rid\n end", "title": "" }, { "docid": "69b0b6ed6479fa8871db0778eb6d0392", "score": "0.61988354", "text": "def delete(oid)\n end", "title": "" }, { ...
44c67e8528a084699f39fc7ebffc1b2f
checks the string characters for errors if it isn't valid, choosing which valid digit the error digit is salvagble to (if any)
[ { "docid": "a2b86fa6f77f83f3b5e29e0d408363fa", "score": "0.6503361", "text": "def check_for_errors\n if !valid\n errors = {}\n\n DIGIT_DATA.each do |valid_digit_index,valid_digit_data|\n errors[valid_digit_index] = count_comparison_errors(valid_digit_data['string'])\n end\n\n ...
[ { "docid": "75f272591fd3c13caf36f971185d5339", "score": "0.69482195", "text": "def printer_error(s)\n # your code\n errs = 0\n possibles = s.length\n arr = s.split('')\n\n arr.each do |i|\n if i.ord > 109\n errs += 1\n end\n end\n\n \"#{errs}/#{possibles}\"\nend", "title": "" }, ...
7dc2db4ca0b5ab29c1188de5b431930f
First page ID to compare.
[ { "docid": "58748069b16caaff991056e5e39c5c23", "score": "0.0", "text": "def fromid(value)\n merge(fromid: value.to_s)\n end", "title": "" } ]
[ { "docid": "3400322957b0265f1e38fcab285a0212", "score": "0.7814059", "text": "def first_page\n if (!empty?)\n items.first.doc_hash['id']\n else\n parent_id\n end\n end", "title": "" }, { "docid": "e15d267709adfd58031ff6933a0bf731", "score": "0.752664", "text": "de...
25c6145e71a28c2fbb2ac48649cf1a44
GET /articles/1 GET /articles/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "d695cde7c2c0621e81aae9eb9677e9bf", "score": "0.7746076", "text": "def show\n @article = Article.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @articles }\n end\n end", "title": "" }, { "docid": ...
1d14f823214f6568219ecfb15e44953d
creates a new Text. _wiki_ is the Wiki the revision belongs to, all other parameters correspond to the fields in the corresponding database table.
[ { "docid": "ba4dbfd43d3e5adb6f364f627888647b", "score": "0.62806165", "text": "def initialize(wiki, tid, text, flags, keeptext=true)\n @wiki = wiki\n @tid = tid\n @text = text\n @flags = flags\n\n @internal_links = []\n\n parse_text\n\n @text = DeletedText unless keept...
[ { "docid": "199fd4bca2723727dbab6cf4c70c5415", "score": "0.7319481", "text": "def create_text(text)\n new_text = Text.new(title: text[\"title\"], paragraphs: text[\"paragraphs\"], reference: text[\"reference\"])\n\n return new_text\n end", "title": "" }, { "docid": "a279f6...
0b4b83b5ab99ae2cd2b28826311291bd
GET /paxes GET /paxes.json
[ { "docid": "8ab56c5cfddf81a542f93edbda45d9ad", "score": "0.7178551", "text": "def index\n @paxes = Pax.all\n end", "title": "" } ]
[ { "docid": "5a27706b906e1ca43114b7362648eb49", "score": "0.6867322", "text": "def index\n\n\n respond_to do |format|\n\n format.html { @axes = Axis.where(:user_id => current_user.id).all }\n format.json { render json: Axis.all }\n end\n end", "title": "" }, { "docid": "d7c29...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "2ddee08a407cd1a401d6c0020633a9df", "score": "0.0", "text": "def set_sbook\n @sbook = Sbook.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...
295e431091c1afe9a5a0d1c8188b83aa
Use callbacks to share common setup or constraints between actions. Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "c3c070216276d07d438363e1d43280b3", "score": "0.0", "text": "def donation_params\n params.permit(:all)\n end", "title": "" } ]
[ { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6089007", "text": "def action_hook; end", "title": "" }, { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6079685", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n ...
0480fe23fb5f6c76de316b8c2c58f77e
Perform a selftest to ensure the selected provider is working source://ed25519//lib/ed25519.rb48
[ { "docid": "b4151c446130d8bada93b3f12a97c3e7", "score": "0.5505649", "text": "def self_test; end", "title": "" } ]
[ { "docid": "d8188008f73d6b576022d92253b97aa0", "score": "0.5727378", "text": "def test_bogus_raise\n\t\tbogus_key = \"Oh hey I'm a key. Ok, not really.\"\n\t\tassert_raise OpenSSL::PKey::PKeyError do \n\t\t\tNet::SSH::Utils::Key.fingerprint(:data => bogus_key)\n\t\tend\n\tend", "title": "" }, { ...
6c216351c5392cb4d866e8cb8d5374cf
Returns `true` if the template was loaded from a file and the file's mtime is after the time the template was created.
[ { "docid": "64789477a67e01613aeb6411602b2a18", "score": "0.63974303", "text": "def changed?\n\t\treturn false unless file = self.source_file\n\t\tnow = Time.now\n\n\t\tif now > ( @last_checked + self.options[ :stat_delay ].to_i )\n\t\t\tif file.mtime > @last_checked\n\t\t\t\t@last_checked = now\n\t\t\t\...
[ { "docid": "001189706e88c4ea468c4b09419440aa", "score": "0.7594938", "text": "def template_changed_since?(file_name, compile_time)\n lstat = File.lstat(file_name)\n compile_time < lstat.mtime || \n (lstat.symlink? && compile_time < File.stat(file_name).mtime)\n end", "tit...
0f379e49d63cba2932ae8a865283507a
DELETE /meals/1 DELETE /meals/1.json
[ { "docid": "e46da2bfb7d99a17f28e2e83e509a300", "score": "0.72304004", "text": "def destroy\n @meal.destroy\n respond_to do |format|\n format.html { redirect_to meals_url, notice: 'Le repas a bien été supprimé.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "916b3061ea9efabebee360a738abd2c0", "score": "0.7660611", "text": "def destroy\n @meal = Meal.find(params[:id])\n @meal.destroy\n\n respond_to do |format|\n format.html { redirect_to meals_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "doci...
005e001a0ef73c3b4286d0548b366145
Set the optimization level that this context will use. This is sometimes necessary in Rhino, if the bytecode size of the compiled javascript exceeds the 64KB limit. By using the 1 optimization level, you tell Rhino to run in interpretative mode, taking a hit to performance but escaping the Java bytecode limit.
[ { "docid": "98d4e548c8ba85b2fa369f692d74bc36", "score": "0.7851381", "text": "def optimization_level=(level)\n @native.setOptimizationLevel(level)\n end", "title": "" } ]
[ { "docid": "fe22fd0e97946210610caa78ea943b67", "score": "0.7839762", "text": "def optimization_level=(level)\n if JS::Context.isValidOptimizationLevel(level)\n @native.setOptimizationLevel(level)\n level\n else\n @native.setOptimizationLevel(0)\n nil\n end\n ...
97deda5f2330bb4155318a7e9bae2a1d
THE MAIN Search Evaluator
[ { "docid": "3cb4757c9fcd8cb44297afa63fbadbfb", "score": "0.0", "text": "def evaluate\n distinct? ? distinct_relation : relation\n end", "title": "" } ]
[ { "docid": "61bd97fa9eddad78e4d7ea28316bba77", "score": "0.73933583", "text": "def search; end", "title": "" }, { "docid": "feba29f400ad66663200b8f63e6ce9f8", "score": "0.699098", "text": "def find(search_string)\n result_array = []\n search_words = search_string.split(/\\s+/)\...
90f8184e3a80e83b61325413b2199fd9
Start a match tiebreak. A match tiebreak can be created after each player has won an equal number of sets.
[ { "docid": "c0ed69922948739383453e1e1d3a54bf", "score": "0.62318957", "text": "def start_match_tiebreak?\n start.match_tiebreak?\n end", "title": "" } ]
[ { "docid": "73f99666bb993518788202b99935003e", "score": "0.65194535", "text": "def start_set_game\n # Starting set also starts first game\n match.play_match! :start_set\n end", "title": "" }, { "docid": "b70c63ab74dc5ee82e54be594dbd2e4c", "score": "0.64966", "text": "def start...
8f32157b92296c6d62897474468429cd
GET /tables GET /tables.json
[ { "docid": "b5b7fa2345b737fe231fee2d57ed8aac", "score": "0.6544595", "text": "def index\n @tables = Table.all\n end", "title": "" } ]
[ { "docid": "7b66142d8617536cfec1fc6eee904d68", "score": "0.78429395", "text": "def get_table_json\n url = @driver.current_url\n table_id = url.split('/').last\n response = @client.table(table_id)[\"table\"]\n end", "title": "" }, { "docid": "617e5e82bf84a1948ca7397a5876441c...
0e36a2d0304328f4f224dbb66aa2348a
Generates a new Lita handler.
[ { "docid": "be6f6db6b843968b1fe62c5a57a30925", "score": "0.5831032", "text": "def handler(name)\n config = generate_config(name, \"handler\")\n generate_templates(config)\n post_messages(config)\n end", "title": "" } ]
[ { "docid": "e4205925c701789470b52d195fbe37d2", "score": "0.6423592", "text": "def handler_generator\n @handler_generator ||= Derailleur::HandlerGenerator\n end", "title": "" }, { "docid": "b2eea8d50c1d32f061a2888c80ad64ca", "score": "0.57141066", "text": "def make_handler...
33fdd9dbeb9bb62313cfa8ce4dd0644f
Give an user join permission
[ { "docid": "b15c9f2f620f13020468d9187eaf9a96", "score": "0.0", "text": "def permit\n user = User.find(params[:user_id])\n group = Group.find(params[:id])\n membership = Membership.find_by(user: user, group: group)\n if membership\n membership.update_column(:active, true)\n membersh...
[ { "docid": "57ce1eaaf8b49e7bdf936b1851edb28b", "score": "0.70761776", "text": "def join\n @room = OnlineMeetingRoom.find_by_id(params[:id])\n role = @room.user_role(current_user)\n unless role == :denied\n join_internal(current_user.full_name, role, :join)\n else\n flash[:notice] =...
b423054f045045b523ca572c2e3532cc
Checks whether the method is a nonmutating Array method.
[ { "docid": "1a57e73f4f6294ca6a2134caaa5c2deb", "score": "0.7953881", "text": "def nonmutating_array_method?; end", "title": "" } ]
[ { "docid": "c0d1251609b5d1112be7a2a598c43824", "score": "0.87054294", "text": "def nonmutating_array_method?\n NONMUTATING_ARRAY_METHODS.include?(method_name)\n end", "title": "" }, { "docid": "4a3f362de43495b70173a62f75ee42b5", "score": "0.68878716", "text": "def nonmuta...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ddb15b97ec3613065aabc376ea15597f", "score": "0.0", "text": "def set_message\n @message = Message.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
fa5a048c9867f1e6349ed37a2b346191
Add a Citation Returns the index of the Nomenclator added. TODO: Test/Validate
[ { "docid": "f9c7c92e60529b5e6576afd408b8c963", "score": "0.6653825", "text": "def add_citation(name, ref, nomenclator_index, properties)\n if @citations[name.id]\n return false if @citations[name.id].collect{|i| [i[0],i[1]] }.include?([ref.id, nomenclator_index])\n @citations[na...
[ { "docid": "04d52bca63765933a4c898a0f14dc21f", "score": "0.58548725", "text": "def add_doi\n return unless cocina_object.dro? && cocina_object.identification.doi\n\n identifier = doc.create_element(\"identifier\", xmlns: MODS_NS)\n identifier.content = \"https://doi.org/#{cocina_object.identifi...
0ceb9c03b592c91df6a4449d5e56c851
For MazeRunner use only, call the registered precomplete blocks
[ { "docid": "6d021484f5b4f3c1226cb3f71f910913", "score": "0.5584335", "text": "def call_pre_complete(scenario)\n @pre_complete.each { |block| block.call(scenario) }\n end", "title": "" } ]
[ { "docid": "591604f4a9394ce648cba5d4e7764782", "score": "0.6889351", "text": "def pre_complete(&block)\n @pre_complete << block\n end", "title": "" }, { "docid": "d2675666bd5702b1b330ca5df760b59e", "score": "0.5893577", "text": "def post_process(possible_completions)\n ...
92a51bee861968bd00952f61ebc8deab
Repair a rogue installation using the backup files. Useful for testing. Probably you don't want to repair on real pwnage... :)
[ { "docid": "0a356bfc95a14786cce34782f2e9583f", "score": "0.7183307", "text": "def do_repair()\r\n puts \"++ Repairing (moving back-ups to original path)\"\r\n puts \"++ #{File.basename(BOMARCHIVE_PATH)}\"\r\n FileUtils.rm_f BOMARCHIVE_PATH\r\n FileUtils.cp File.join(\"/tmp\", File.basename(BOMARCHIV...
[ { "docid": "df0b0df7dd5ce71040d59a21faef718b", "score": "0.6341154", "text": "def cleanup\n if ::File.exist?(chef_backup_dir) # rubocop:disable Style/GuardClause\n converge_by(\"removing #{chef_backup_dir}\") do\n FileUtils.rm_rf chef_backup_dir\n end\n end\nend", "title": "" }, { ...
9655298ab9e83442c00ebe9b74702835
A11 Header report. File 1 of 2
[ { "docid": "8318f0571512b8496b0612003a7bcf91", "score": "0.0", "text": "def export_a11_header\n start_date = params[:start_date] ? Date.parse(params[:start_date]).to_date : Time.zone.now.beginning_of_quarter\n end_date = params[:end_date] ? Date.parse(params[:end_date]).to_date : Time.zone.now...
[ { "docid": "9bf8ed04f18098ec55e5c05da3a90b55", "score": "0.7239137", "text": "def brands_header\n $report_file.puts \"\n ______ _ \n | ___ \\ | | \n | |_/ /_ __ __ _ _ __ __| |___ \n | ___ \\ '__/ _` | '_ \\ / _` / __|...
a277d7f5d305142d58eba246fa3be916
Send stdout and stderr to log files for the child process
[ { "docid": "aee77d5e0e710a51ccc12b584f7220dd", "score": "0.0", "text": "def try_redirect\n $stdin.reopen(Rack::App::Utils.devnull_path)\n $stdout.reopen(Rack::App::Worker::Environment.stdout)\n $stderr.reopen(Rack::App::Worker::Environment.stderr)\n $stdout.sync = $stderr.sync = true\n resc...
[ { "docid": "7d0c68142367299e5cd220a5cd0bde9f", "score": "0.59129524", "text": "def log_to_stdout\n log_to STDOUT\n end", "title": "" }, { "docid": "01a173c073d658448ee9ae4c238e16a3", "score": "0.5854069", "text": "def write_pid_file\n\t\texit(1) if File.exists?(\"#{RAILS_ROO...
5812118776c095692df0f818eced1685
the beginning of the original string. The return value should be arranged in order from shortest to longest substring.
[ { "docid": "f3e64b3a004f5888ed1524b5fcb19eaa", "score": "0.6693351", "text": "def leading_substrings(string)\n result = []\n 0.upto(string.size - 1) do |index|\n result << string[0..index]\n end\n result\nend", "title": "" } ]
[ { "docid": "6fbf9c77e41fdfc19a5fb880bbe8bb7a", "score": "0.71224236", "text": "def substring_before(s, sub)\n s.scan(sub).present? ? s.split(sub, 2)[0] : ''\n end", "title": "" }, { "docid": "b30ae6585fc46133a526bf92a396caf2", "score": "0.7121992", "text": "def leading_substr...
91e06c56522d1464cb0d2dc19e68ca75
List all Notification Setting List all Notification Setting.
[ { "docid": "be33fa6d354d7f741662f23261426bce", "score": "0.580551", "text": "def get_notification_setting_all_using_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UtilsApi.get_notification_setting_all_using_get ...'\n end\...
[ { "docid": "db16dde5a4ea3c29eda385aa0d35ccab", "score": "0.79158753", "text": "def index\n @notification_settings = NotificationSetting.all\n end", "title": "" }, { "docid": "22c389d1edb9b0d02ebf604ff84c229e", "score": "0.74333024", "text": "def notification_settings\n @notifi...
fb06ad02bace5e2fa8a0684a5d89549b
POST /products POST /products.xml
[ { "docid": "aaecce1cd43bd057a63c423487191392", "score": "0.61414295", "text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to(@product, :notice => 'El producto se ha creado con &eacute;xito') }\n fo...
[ { "docid": "2e645fb55ecab46c6f3e0c5eda18a29b", "score": "0.6835504", "text": "def create(product_params)\n @client.post(\"/#{@model}\", product_params)\n end", "title": "" }, { "docid": "ae3e1063ed4375744dfba26798450908", "score": "0.6786078", "text": "def create\n @produc...
6954015e9fce511b28977208ce99a1b7
Produces a sea from One Piece.
[ { "docid": "c9162333e458c7116593d877efd1716d", "score": "0.6426997", "text": "def sea; end", "title": "" } ]
[ { "docid": "aab86f8ad2e2509ef2a59fd4b4ce24cd", "score": "0.54770535", "text": "def yeast; end", "title": "" }, { "docid": "801475b11e8fc0d1eac2627fcdcfc792", "score": "0.543295", "text": "def to_Earth() \r\n Celes.nut06a(@ajd, 0)[ 1 ] + Celes.obl06(@ajd, 0) \r\n end", "...
f66cee232b49bd07d18128ce41dcafbc
all public methods in here will be run in order
[ { "docid": "52afcfc53f76de29fba0a38229b75928", "score": "0.0", "text": "def create_plugin\n template \"plugin.coffee\", \"app/assets/javascripts/plugins/#{folder_path}tbg-#{file_name.underscore}.js.coffee\"\n end", "title": "" } ]
[ { "docid": "9b632aa1829227dfc5a873c0d05ccbee", "score": "0.73415", "text": "def execution_order; end", "title": "" }, { "docid": "a29ccf5104a36e90daf739a9e5586ddf", "score": "0.70878327", "text": "def invoke_all; end", "title": "" }, { "docid": "481d6a09df98f124f8dfd3d151...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "dd504283f5c4268d8ebf6b3e3992dd2e", "score": "0.0", "text": "def set_alarm_action\n @alarm_action = AlarmAction.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
f82d921829384350661a6730c41d8383
todo: geo bounding box filter
[ { "docid": "921fd32a1ae591de07ac7d2223ca169e", "score": "0.0", "text": "def geo_distance(field, options={})\n query = {lat: options.delete(:lat), lon: options.delete(:lon)} if options.is_a?(Hash) && options[:lat] && options[:lon]\n query = options if options.is_a?(String)\n\n @value...
[ { "docid": "c685d47eb71a07ee57c7d236d213b764", "score": "0.74865276", "text": "def bounding_box\r\n max_x, min_x, max_y, min_y = -Float::MAX, Float::MAX, -Float::MAX, Float::MAX\r\n if(with_z)\r\n max_z, min_z = -Float::MAX,Float::MAX\r\n each do |point|\r\n ma...
d795375d8b45c4a49f53b50abaffee0d
render pure collection wrapped by "working_div" "working_div" division is for working place to show detail, committing, or confirmation pages. options are ... :working_div : div_id of working space for such as detail, history, altering form and the confirmation and options for "render_pure_collection"
[ { "docid": "74dd09de8b09fdb5910aa68c566c2e46", "score": "0.7792255", "text": "def render_collection_only(collection = nil, options = nil)\n collection ||= @collection\n options ||= {}\n @collection_options and options.merge! @collection_options\n content_tag :div, :id => (options[:working_di...
[ { "docid": "04d4d205fe759c659084b1f07d610a13", "score": "0.6255285", "text": "def list_again(options = {})\n catch :flash_now do find_collection(@background_params) end\n div_id = options[:div_id] || \"collection\"\n template = options.delete(:collection_template) || @response_tem...
139559f36b20cf619fdac81201d0c761
GET /rooms/1 GET /rooms/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "659eb1d3e19f64ad9ca2ddb968b34802", "score": "0.789608", "text": "def rooms\n get('rooms')\n end", "title": "" }, { "docid": "ce9a3422687cf39839bd7679c42c4228", "score": "0.78398705", "text": "def get_rooms\n JSON.parse(RESTful.get(URL_MICROSERVICE_ROOMS))\n en...
3851f1da266ee6db1ac2dbe386deec4e
get the text for the link with id
[ { "docid": "21a2fc085fbb72b7f3c076077e40e924", "score": "0.8541569", "text": "def link_by_id_get_text(link_id)\n return link_by_id(link_id).text\nend", "title": "" } ]
[ { "docid": "ca44eb04dfce1decf494586f207b3190", "score": "0.71050566", "text": "def link_by_href_get_text(link_href)\n return link_by_href(link_href).text\nend", "title": "" }, { "docid": "f36896fda4eec70080b4f11da0dc205a", "score": "0.7063016", "text": "def find_Text(page, id_name)\...
93cfff07ca37a3546c55d62492f4e477
Retrieve the object. Return it as a series of bytes, no matter the type. The id refers to the object's id. The most recent object is 0, the second is 1, etc.
[ { "docid": "5b8203b25ffa547c849e447b18883f0b", "score": "0.0", "text": "def get(s, id)\n out = [MESSAGE_GET, id].pack(\"II\")\n s.write(out)\n\n # Type (don't care)\n get_int(s)\n\n # Length\n len = get_int(s)\n\n #puts(\"Retrieving #{len} bytes\")\n data = s.recv(len)\n\n # It should end with ...
[ { "docid": "3820dcd0139cfaa61d0ca2ac21133579", "score": "0.69251746", "text": "def get_object(id)\n path = object_path(id)\n\n if File.exists?(path)\n buf = open(path, \"rb\") { |f| f.read }\n\n raise \"not a loose object: #{id}\" if not legacy_loose_object?(buf)\n\n header, content...
1b79c22d2a928a7a40777a356a4e1dad
Creates a new web app or modifies an existing web app.
[ { "docid": "b56c3efa364ba205f6aab0ddcd716ad5", "score": "0.0", "text": "def create_or_update_site(resource_group_name, name, site_envelope, skip_dns_registration = nil, skip_custom_domain_verification = nil, force_dns_registration = nil, ttl_in_seconds = nil, custom_headers = nil)\n # Send request\...
[ { "docid": "752d11ee25b03ef0b401bea4b1099b48", "score": "0.6982492", "text": "def create_app\n post_app('name' => app_name)\n end", "title": "" }, { "docid": "dc63c47c9835f06dd53b73c93a2ea050", "score": "0.68564814", "text": "def create\n @web_app = WebApp.new(web_app_para...
a06f373751d9386218ed3af436db368e
GET /client_intakes/1 GET /client_intakes/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "09819d740ad87e95568b4b32794ef27a", "score": "0.62970585", "text": "def show\n @client = Client.find(params[:id])\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end", "title": "" }, { "docid": "7aa9...
a8386e8e0a042c49351b9ac5f151b857
Calculates the full URL for a specified message
[ { "docid": "4474b0856560a167783c7aa4321b0b4d", "score": "0.6809397", "text": "def full_url_for(message) \n url_for :controller => 'messages', :action => 'show', :id => message.id, :only_path => false\n end", "title": "" } ]
[ { "docid": "f46c09cb8b76e8c06780ae147357a1ad", "score": "0.69314647", "text": "def incoming_message_url(incoming_message)\n return request_url(incoming_message.info_request)+\"#incoming-\"+incoming_message.id.to_s\n end", "title": "" }, { "docid": "14392cafa865a35b91ca989281bcd94d"...
7c606f5b801635a02772ce197370baa2
403 Permission denied when acknowledge_abuse: false
[ { "docid": "2d47250332e52da8f71b71287dfe0aef", "score": "0.0", "text": "def initialize(file)\n @file = file\n end", "title": "" } ]
[ { "docid": "56539e74665c00f7f89acdf660c8ff6f", "score": "0.7152921", "text": "def log_permission_denied\n end", "title": "" }, { "docid": "dd858b375b764d3dd56581b0561cb6d9", "score": "0.70553875", "text": "def denied\r\n handle_permission_denied\r\n end", "title": "" }, ...
7724bb17d8402ed03b36ef785fdce098
I N S T A N C E M E T H O D S Create a new 'substring' item filter component that will match the specified +pattern+ against the given +attribute+.
[ { "docid": "fa74e4751c2322bcf40f4be6d81e6316", "score": "0.537873", "text": "def initialize( attribute, pattern, options=nil )\n\t\t\t@attribute = attribute\n\t\t\t@pattern = pattern\n\t\t\t@options = options\n\n\t\t\tsuper()\n\t\tend", "title": "" } ]
[ { "docid": "5635ca7dcc33aa857ab0df92f4934eba", "score": "0.54106045", "text": "def searchable_string(attribute)\n searchable do\n string attribute\n text attribute\n end\n end", "title": "" }, { "docid": "f7bb8f86498ca25d506e0b26b58fc9a8", "score": "0.5215107",...
b6b4bfe7620107fdcd75de4fad80386a
POST /item_packs POST /item_packs.json
[ { "docid": "e3fe09aa7906a4aa41181b0c4aba3cb6", "score": "0.7545647", "text": "def create\n @item_pack = ItemPack.new(item_pack_params.merge(item_id: @item.id))\n\n respond_to do |format|\n if @item_pack.save\n format.html { redirect_to @item_pack.item, notice: 'Item pack was successful...
[ { "docid": "1f50e19a09846f52cb260f9fe9701746", "score": "0.7883095", "text": "def create\n @pack = @item.packs.build(pack_params)\n\n respond_to do |format|\n if @pack.save\n format.html { redirect_to item_packs_path(@item), notice: \"Pack was successfully created.\" }\n format....
f586d0c62e06f1071e2ff75680ddca7d
Create a new model (end phase)
[ { "docid": "4003399bb0df3fcf22e30220d74509ba", "score": "0.0", "text": "def create_end(fbe_begin)\n fbe_end = buffer.size\n fbe_full_size = fbe_end - fbe_begin\n write_uint32(@_model.fbe_offset - 4, fbe_full_size)\n fbe_full_size\n end", "title": "" } ]
[ { "docid": "f6a54cdf6443bbb5cb76f7e1bdbea2cd", "score": "0.7414681", "text": "def new_model\n unless @model\n @model = create_model\n attach_model\n end\n @model\n end", "title": "" }, { "docid": "8ae0516e8ca8614365b609bc8...
766cac36e16a028d1c4a0f45a3d17d4b
GET /rh21_threads GET /rh21_threads.json def index
[ { "docid": "fb660d099ae63dd2a63a61deca849133", "score": "0.6822149", "text": "def index\n if current_user.handle.blank?\n url = root_url(only_path: false)\n SignupMailer.signup_email(current_user, url).deliver_now\n session[:set_handle_from_chat] = true\n redirect_to edit_user_pat...
[ { "docid": "102772a67dfce568e1a2dfe84f18ee62", "score": "0.7695103", "text": "def index\n @threads = Threads.all\n end", "title": "" }, { "docid": "5bb73c324141e4c6fde69df5b0163e21", "score": "0.703963", "text": "def index\n @thread_objs = ThreadObj.all\n end", "title": "...
04dc89ae532ed5b2acae9c7ae98e477f
Returns a key to determine the group to which the transaction belongs
[ { "docid": "c3bd35357c40f2f6031cd08dbb9fb139", "score": "0.6226639", "text": "def transaction_group(transaction)\n transaction\n end", "title": "" } ]
[ { "docid": "ffdc2aed89e88c6278e12c0f6e9d63fe", "score": "0.7707841", "text": "def group_key\n strong_memoize(:group_key) do\n PrometheusMetricEnums\n .group_details\n .find { |_, details| details[:group_title] == group }\n .first\n .to_s\n ...