query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
e5f8aa025860e7730ab789b66381a783
Adiciona o Candidato ao array de candidatos
[ { "docid": "bda7841500cf85812b7f82f7ea1cb472", "score": "0.8040915", "text": "def adicionar_candidato(candidato)\n @candidatos << candidato \n end", "title": "" } ]
[ { "docid": "45485ffc5b29da159c1cb281d3b66020", "score": "0.65290064", "text": "def mostrar_candidatos\n puts \"QUANT. DE VOTOS POR CANDIDATO\"\n # Procura cada candidato em seu array\n for candidato in @candidatos\n candidato.mostrar_dados # mostra os dados do candidato\n...
dca2f5494d85ef7d6b0fc10af78eb934
Presenters for methods that can be generated in REST clients.
[ { "docid": "167b432c4317edfa705185cc8e61d5b0", "score": "0.55567205", "text": "def methods\n main_service.methods.select(&:can_generate_rest?)\n end", "title": "" } ]
[ { "docid": "df0c17b594109cecba056e89a404d172", "score": "0.6444181", "text": "def presenters\n raise NotImplementedError\n end", "title": "" }, { "docid": "0226941e311ead1afe6ffb878039debe", "score": "0.63072103", "text": "def presenter\n self\n end", "tit...
288b6e093645c211828f111d47dada9c
PATCH/PUT /catering_companies/1 PATCH/PUT /catering_companies/1.json
[ { "docid": "cbb19c24dee12847872ce19f4468d257", "score": "0.0", "text": "def update\n respond_to do |format|\n if @catering_company.update(catering_company_params)\n format.html { redirect_to :controller => 'dashboard', :action => 'manager_admin', :notice=>'Updated succesfully' }\n ...
[ { "docid": "1c35f89f4e93251128bbf53c08021b3d", "score": "0.7541755", "text": "def update\n @company_id = company_params[:company_id]\n @reponse = HTTParty.put(\"https://rails-api-ipo.herokuapp.com/api/v1/companies/#{@company_id}.json\",\n :body => {:company_name => company_params[:company_name]...
990583d396c0355dfa12615d7a88f0b4
no_valid_url? should accept an array of urls as an arg should use Arraynone? when none of the urls end in '.com', '.net', '.io', or '.org' should return true when at least one of the urls end in '.com', '.net', '.io', or '.org' should return false
[ { "docid": "f24b3c4cc3f76f3c74230d9a4b449535", "score": "0.8801572", "text": "def no_valid_url?(urls)\n valid = ['.com', '.net', '.io', '.org']\n urls.none? do\n |url|\n valid.any?{|ending| url.end_with?(ending)}\n end\nend", "title": "" } ]
[ { "docid": "e56b8c9801f2013720f82f6fc108fb67", "score": "0.8804447", "text": "def no_valid_url?(array)\n array.none? do |url|\n url.end_with?(\".com\",\".net\",\".io\",\".org\")\n end\nend", "title": "" }, { "docid": "e7e5ad628c60ecfddd8dfce55f8d1780", "score": "0.8764467", ...
ed3f4798589bdcba4d2b971349f979d3
GET /service_order_details GET /service_order_details.json
[ { "docid": "6a4efaa1d84e0ac91bf3a7064d4277d6", "score": "0.75234413", "text": "def index\n @service_order_details = ServiceOrderDetail.all\n end", "title": "" } ]
[ { "docid": "3503c92ffcc8e8acae74c46ef4bf757e", "score": "0.7235662", "text": "def get_order_summary\n authenticate_request!\n order = Order.find(params[:order_id])\n\n json_response(order)\n end", "title": "" }, { "docid": "4740f7df12faa70807dde68afafd7478", "score": "0.7087828...
1f0fd218c8c4a6c10583989187a6b766
DELETE /index_reports/1 DELETE /index_reports/1.json
[ { "docid": "e492a4aee0a1c048fdf926eaa3fbeeda", "score": "0.7635654", "text": "def destroy\n authorize! :destroy, @index_report\n\n @index_report.destroy\n respond_to do |format|\n format.html { redirect_to index_reports_url, notice: 'Index report was successfully destroyed.' }\n forma...
[ { "docid": "6317e1107a485e075aff03ea382bbefd", "score": "0.72182494", "text": "def destroy\n @api_report = Report.find(params[:id])\n @api_report.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "24baea03ff833df7cecbe881ca62b3ea", "score": "0.72158515", "text"...
12ea123f9ea3e297a3f5262bfce887f2
Helper for the short array
[ { "docid": "fc47963db40b48737cbcd59171a19341", "score": "0.5285756", "text": "def shortArray(age)\n i = ageray.index(age.to_i)\n puts \"i === #{age}\"\n range = i < 6 ? (ageray[0]..ageray[10]).to_a : (i-5..i+5).to_a\n end", "title": "" } ]
[ { "docid": "75e16b046d5e35686bee51a875999d4c", "score": "0.64514625", "text": "def short; end", "title": "" }, { "docid": "75e16b046d5e35686bee51a875999d4c", "score": "0.64514625", "text": "def short; end", "title": "" }, { "docid": "75e16b046d5e35686bee51a875999d4c", ...
3d149d23e7aea5160ddcaa1114a2326b
Convenience method to get/set the max_gears capability
[ { "docid": "fa7884523ebf96242d05d7494f033734", "score": "0.8608843", "text": "def max_gears\n get_capabilities[\"max_gears\"]\n end", "title": "" } ]
[ { "docid": "2c1ac0f7bba97d7433a766df0cf2102d", "score": "0.62193656", "text": "def max_rating\n configuration.max_rating\n end", "title": "" }, { "docid": "6ffb5479702789b15ce5a84ba0f31c59", "score": "0.6209401", "text": "def capability\n object.geo.capability\n ...
fa84733761b3d153a04b30d8a71ff33e
Enter your 'old_enough_to_vote?' method below
[ { "docid": "aa10ea70f239a8c47e52d5650f543cca", "score": "0.6392254", "text": "def old_enough_to_vote?(year_born)\n if year_born <= 1998\n \"Yes\"\n else\n \"No\"\n end\nend", "title": "" } ]
[ { "docid": "66cf58c60d6a306619aabbde9d397cda", "score": "0.6895644", "text": "def vote\n puts \"-----------------------------------------------\nSorry, voting system is currently not working\"\n \nend", "title": "" }, { "docid": "a2724cf9c9f80945715eaf8df11d9cc8", "score": "0.67812216"...
360c9d91e26d5cb6ff9de01fbcab15f4
The start_index of a given page. page_num the requested page. Example coll = Collection.new(query: Query.new.paginate(page_size:6) ) coll.page_start_for(2) => 7 Returns the index of the requested page.
[ { "docid": "f6fffa3d6e6b429af163829f63fdb23e", "score": "0.7802538", "text": "def page_start_for(page_num)\n page_size * (page_num - 1) + 1\n end", "title": "" } ]
[ { "docid": "4d9d7dba5418918e33cc1e1198e4ecda", "score": "0.681463", "text": "def start_index(page)\n (page - 1) * @count + 1\n end", "title": "" }, { "docid": "45c21173e222e48045e4df0a623992b6", "score": "0.6530989", "text": "def current_start_index\n @current_page * @entries_...
c29c017c9129fe56dd1ef9f19fa6ac32
Publish event to registered handlers
[ { "docid": "7fdc57a2059939b882f845c783275982", "score": "0.7542248", "text": "def publish(event)\n @router.handlers_for(event).each do |handler|\n handler.execute(event)\n end\n end", "title": "" } ]
[ { "docid": "bafe3456d461fc6174f9fbc9e47b6d6f", "score": "0.7607896", "text": "def publish(event, *args)\n event_listeners.listeners_for(event).each do |listener|\n listener.handle(*args)\n end\n end", "title": "" }, { "docid": "bc6612fa917c62f141b7b0dd2ad3bea0", ...
0f87539d76dafc4084eaf1df83f7cc54
POST /feverdecorators POST /feverdecorators.json
[ { "docid": "bfd693ec39d2587465ae9366ae26eb56", "score": "0.6284883", "text": "def create\n\n @feverdecorator = Feverdecorator.new()\n @feverdecorator.name = params[:feverdecorator][:name]\n @feverdecorator.temperature = params[:feverdecorator][:temperature]\n\n oFever = BasicFever.ne...
[ { "docid": "0f8379f7d7f4b61416533c7752030a43", "score": "0.6855264", "text": "def index\n @feverdecorators = Feverdecorator.all\n end", "title": "" }, { "docid": "a3a2f6e59c15abcdc65f7c0d3cabca13", "score": "0.6566946", "text": "def feverdecorator_params\n params.require(:fe...
39f880f58fe93f4f0b6f9d6827f509f0
Updates row in database using hash map Returns number of affected rows
[ { "docid": "d039e536e1da5fd6eb6537c865acba5e", "score": "0.56340367", "text": "def update(table, options)\r\n return 5\r\n end", "title": "" } ]
[ { "docid": "db80dc9cd23b3a49b04cbc09f8197988", "score": "0.7188146", "text": "def update(map)\n sql_bind_str = ar_klazz.build_bind_sql_with(map.size, '(? => ?)', ' ||')\n\n sql =<<-SQL\nUPDATE #{table_name}\nSET #{hstore_column} = #{sql_bind_str}\nWHERE id = #{ar_instance.id}\nSQL\n\n # map.fla...
fcca4781d646f8e75032d3b99110b79c
TODO: Rework this whole file. Stop this stupid string juggling. TODO: Kill all these modulespecific things. We need events or something to handle script load/unload/reload in modules. The code for that already exists in the eventing system, we just need to tie it all together. Initialize a new ScriptManager object.
[ { "docid": "2f58c03ca52b3b28ddf86f952786b260", "score": "0.53419435", "text": "def initialize\n @scripts, @script_info = {}, []\n\n unless Dir.exist? 'scripts'\n # XXX - raise a better exception here\n raise 'Scripts directory does not exist.'\n end\n end", "title": "...
[ { "docid": "e7843db660900bced9869e56e793b762", "score": "0.58673483", "text": "def load_scripts\n $log.info('ScriptManager.initilize') { 'Loading scripts.' }\n\n noload = Bot::Conf[:core][:noload]\n\n Dir.glob(\"#{SCRIPTS_PATH}/*.rb\").each do |file|\n\n unless noload == nil\n ...
49b60c8ade2b15b507d3444de1567744
rewrite to conform to template data reqs nasdaq to nasdaq_1D, sp500_3M...
[ { "docid": "2f6c0a35f36c5ccf0a54da62e09d0dce", "score": "0.0", "text": "def indexes\n keys = Ticker::INDEX.keys\n\n keys.each_with_object({}) do |index, hash|\n Ticker.send(index).full_performance.each do |key, value|\n hash[\"#{index}_#{key}\"] = value.to_s + '%'\n end\n end\n...
[ { "docid": "fd078440813ca7ebbf7003e55060321c", "score": "0.5777975", "text": "def transformation_into_dsnf\n negated_sentence_in_apnf = self.negated.transformation_into_apnf\n initial = [Sentence.new(generate_new_symbol)]\n first_element = Sentence.generate_implication_between(Sentence.new(init...
134f0fbf04991ecb87d767c9bfc4c899
return a vector of IdfObject's to request EnergyPlus objects needed by the run method Warning: Do not change the name of this method to be snake_case. The method must be lowerCamelCase.
[ { "docid": "07ec3ca75d074b5e265944fa31a994f8", "score": "0.6318877", "text": "def energyPlusOutputRequests(runner, user_arguments)\n super(runner, user_arguments)\n\n # use the built-in error checking\n if !runner.validateUserArguments(arguments, user_arguments)\n return result\n end\n\...
[ { "docid": "a95a116817c751239bae033f6acdd4c0", "score": "0.6308563", "text": "def energyPlusOutputRequests(runner, user_arguments)\n super(runner, user_arguments)\n\n result = OpenStudio::IdfObjectVector.new\n\n # use the built-in error checking\n if !runner.validateUserArguments(arguments, ...
5268395f647363b66af9fff70bb1d451
Returns the IP address of client as a +String+. source://actionpack//lib/action_dispatch/http/request.rb282
[ { "docid": "b8137feb76a3fa6b8d524cbf7dca31e5", "score": "0.0", "text": "def ip; end", "title": "" } ]
[ { "docid": "cad8baaf5e99bdfda88db0744ccac957", "score": "0.7963686", "text": "def client_ip\n @client_ip ||= IPAddr.new(request.remote_ip)\n end", "title": "" }, { "docid": "c76aca3bd052b70c772cdb353cffb4dc", "score": "0.78994566", "text": "def ip_address\n\n # China:\n # r...
da7d077f5f9ebe177349c756526d2705
DELETE /months/1 DELETE /months/1.json
[ { "docid": "cb3f5abf6daab0e747ddb6f3fbc7b4ba", "score": "0.7646123", "text": "def destroy\n @month = Month.find(params[:id])\n @month.destroy\n\n respond_to do |format|\n format.html { redirect_to months_url }\n format.json { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "a27be74bc2300e23bbc4ed6a0d0fc481", "score": "0.7439406", "text": "def destroy\n @monthly = Monthly.find(params[:id])\n @monthly.destroy\n\n respond_to do |format|\n format.html { redirect_to monthlies_url }\n format.json { head :no_content }\n end\n end", "title": ...
6ee2b3fac4958233ff0d9717e1203395
Returns the value of attribute active.
[ { "docid": "ca097545995bba092374cf5ab88c48b3", "score": "0.0", "text": "def active?; end", "title": "" } ]
[ { "docid": "312f47169558472bd8b91f18f78351ff", "score": "0.8222713", "text": "def is_active\n attributes[:isActive]\n end", "title": "" }, { "docid": "318a8c1a6c7b83db7b968637bdc0eaac", "score": "0.811041", "text": "def active\n @attributes.fetch('active', false)\n ...
5619c2081ccfcb35cb5e143765c6a8d7
Checks if character is a number
[ { "docid": "4fbdd48b8538f8d03aab7fde420354eb", "score": "0.79851747", "text": "def number?(char)\n char =~ /[[:digit:]]/\nend", "title": "" } ]
[ { "docid": "8a024b40a418728b7bb95cd301ee8295", "score": "0.8263628", "text": "def isnum(char)\r\n\treturn char[0] >= 48 && char[0] <= 57\r\nend", "title": "" }, { "docid": "325c5c735179aff556123cb7568742fa", "score": "0.8202471", "text": "def is_num?(char)\n value = char.ord - ASCII...
c017963fc27407ff6af29d50261e9232
aggiorna l'handler per Ok e Esc noinspection RubyUnnecessaryReturnStatement
[ { "docid": "8c77338b775c97f7acca39cb784bbf39", "score": "0.0", "text": "def process_handling\n return unless open?\n return process_ok if ok_enabled? && Input.trigger?(:C)\n return process_cancel if cancel_enabled? && Input.trigger?(:B)\n end", "title": "" } ]
[ { "docid": "26eb63d6532360a78a75d656a2a52b48", "score": "0.6790624", "text": "def call_ok_handler; call_handler(:ok); end", "title": "" }, { "docid": "f5c305caa9c303ae50c5b149d8015bcf", "score": "0.63736236", "text": "def ok_enabled?; handle?(:ok); end", "title": "" }, { ...
3dd7c34e68458f9b67357b927baa0644
quick check to see if this looks like a dotmation config file
[ { "docid": "a70ac80d3ef672e138ccf81a2e8e43a4", "score": "0.7345876", "text": "def is_config?(data)\n data.match(/dot|xdg/)\n end", "title": "" } ]
[ { "docid": "79bdf267134753fdfa69d940a99f4129", "score": "0.73369086", "text": "def valid_config_filename\n \"path to a valid config file\"\n end", "title": "" }, { "docid": "f47184d4be8778f30334be0938ce7459", "score": "0.70864165", "text": "def check_config_format(config_path...
b7f52ef08df7ecfae90aaf8d046fafee
Count of records available.
[ { "docid": "38a20b4d6cf8b6b2a00faf12045b44a4", "score": "0.0", "text": "def count(params = {})\n record_count :person, params\n end", "title": "" } ]
[ { "docid": "668f3e8bff8f377cd295b8b2c3f0eb5d", "score": "0.8258209", "text": "def record_count\r\n @records.size\r\n end", "title": "" }, { "docid": "975809b42f5010c9c7325a1c89fc0345", "score": "0.8228107", "text": "def record_count\n @records.size\n end", "title": "" }...
b81f251161ace769079f58c0909803fa
should reget a position on the board
[ { "docid": "6548cc3ab172c6e0c3ba64889d3631de", "score": "0.0", "text": "def off_board_error\n pos = [99, 99]\n until valid_move?(*pos)\n puts \"Please select valid location on the board.\"\n print \"New row: \" \n row = gets.chomp.to_i\n print \"New column: \"\n column = g...
[ { "docid": "a0885275c7c6fa1a6089ce557e8121a2", "score": "0.72107446", "text": "def board_update(board, position, marker)\r\n\t# puts the marker into the board position.\r\n\tboard[position] = marker\r\n\t# restates the board.\r\n\tboard \r\nend", "title": "" }, { "docid": "c4b2a6cc046abc2826...
0607d7cfdc83343b386fe72bef5c0eaa
method to create default custom fields for company at the time of company registration
[ { "docid": "7af20f9f99caebb4ca2b5bc36e06e6a0", "score": "0.5623982", "text": "def create_default_record(company_id)\n titles = [\"Invoice\", \"Tax Invoice\"]\n titles.each do |title|\n voucher_title = VoucherTitle.new\n voucher_title.company_id = company_id\n voucher_title.voucher_title = t...
[ { "docid": "8b2270fdd4d2459e772106a1fdc80ad0", "score": "0.7459561", "text": "def create_default_record(company_id)\n voucher_type_names = [\"Invoice\", \"StockIssueVoucher\",\"StockReceiptVoucher\", \"StockWastageVoucher\",\"Estimate\",\"Purchase\"]\n voucher_type_names.each do |name|\n custom_f...
bfb78b397c2dd3782933bf26b2262a4b
Caches the given file. Calls process! to trigger any process callbacks. By default, cache!() uses copy_to(), which operates by copying the file to the cache, then deleting the original file. If move_to_cache() is overridden to return true, then cache!() uses move_to(), which simply moves the file to the cache. Useful f...
[ { "docid": "34163a208a31fef312f0978b1a4b4e37", "score": "0.8093546", "text": "def cache!(new_file = file)\n new_file = CarrierWave::SanitizedFile.new(new_file)\n return if new_file.empty?\n\n raise CarrierWave::FormNotMultipart if new_file.is_path? && ensure_multipart_form\n\n ...
[ { "docid": "3b452db21b603a37ee1f9624a1f7c122", "score": "0.79837096", "text": "def cache!(new_file)\n new_file = CarrierWave::SanitizedFile.new(new_file)\n raise CarrierWave::FormNotMultipart if new_file.is_path?\n\n unless new_file.empty?\n with_callbacks(:cache, new_file)...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "5d41117415e2faaedaee0f0c67c04eab", "score": "0.0", "text": "def dimension_params\n params.require(:dimension).permit(:size, :serve)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7498391", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958937", "text": "def strong_params\n params.require(:request).permit(param_white...
443154e6d4ba18580980111a1b12e0e0
Sets the mute of iTunes (true/false).
[ { "docid": "7d80199ee3c54ac83910bf23c98fb368", "score": "0.7956581", "text": "def mute= (new_mute_value)\n if @_itunes_api == :appscript\n @_itunes.mute.set new_mute_value\n @_itunes.mute.get\n else\n @_itunes.mute = new_mute_value\n end\n end", "title": "" }...
[ { "docid": "849a5709021fa2ba9ebffb66789a058e", "score": "0.8230832", "text": "def mute\n if @_itunes_api == :rbosa\n @_itunes.mute?\n elsif @_itunes_api == :appscript\n @_itunes.mute.get\n else\n @_itunes.mute\n end\n end", "title": "" }, { "docid"...
a64e72e629da266753f0070c3778e5d2
Get revisions for a single workflow
[ { "docid": "bea4563cddd13acde3b93dfe81d7748b", "score": "0.70718867", "text": "def revisions_data\n @revisions = @workflow.workflow_series.\n accessible_revisions(@context).\n select(:title, :id, :uid, :dxid, :revision)\n end", "title": "" } ]
[ { "docid": "e3ff4fb551158bc29d465279e73e0e72", "score": "0.70968634", "text": "def revisions\n @revisions ||= find_revisions\n end", "title": "" }, { "docid": "4fa9cd7e17aef058a29891431fab979b", "score": "0.69574624", "text": "def revisions\n request = @database.http(\"#{U...
bd7975270868e8306ce960d6f1eae22a
French adjective endings based on the person's gender.
[ { "docid": "f7c6f652bdbb71a0324d96bc2f2b91eb", "score": "0.70652544", "text": "def adj_ending\n gender == 'M' ? \"é\" : \"ée\"\n end", "title": "" } ]
[ { "docid": "9582440185a9f9efd766491dda2a5e93", "score": "0.6624109", "text": "def gender_pronoun\n if gender\n return 'She' if gender.name == 'Female'\n return 'He' if gender.name == 'Male'\n end\n 'They'\n end", "title": "" }, { "docid...
322cbfe7ab22f0e8728c3aef3d2def6b
create a DateTime object of midnight, today adjust the DateTime object based on the minutes passed in retrieve the hours and minutes from the adjusted DateTime object format("%02d:%02d", hours, minutes)
[ { "docid": "f0f15838f72aefb1fde8a0b91cc77a57", "score": "0.5342691", "text": "def time_of_day(mins)\n date = DateTime.new(2017, 11, 26, 0, 0, 0)\n case mins <=> 0\n when -1 then date = date - (mins.abs/1440.0)\n when +1 then date = date + (mins/1440.0)\n end\n\n hours = date.hour\n minutes = date...
[ { "docid": "cd16d028926cf2bcf3457b372981ed63", "score": "0.66307914", "text": "def after_midnight(time_str)\n time = DateTime.parse(time_str)\n minutes, hours = time.minute, time.hour\n minutes + hours * MINUTES_PER_HOUR \nend", "title": "" }, { "docid": "8f7d83b49e89eec51eff700da469e9a5"...
d707fdbc9100c93041dd05c95277763c
this action is to show a form prepopulated with the question's data URL: /questions/:id/edit METHOD: GET
[ { "docid": "13d9d82b05c59c1d7d22387e67a6f80a", "score": "0.0", "text": "def edit\n end", "title": "" } ]
[ { "docid": "e88ed5b99524f91322d02d72d027c78f", "score": "0.80820614", "text": "def edit\n\t\t@question = Question.find_by_id(params[:id])\n\tend", "title": "" }, { "docid": "deb96c92c2465e66ffb099fa2ef599a1", "score": "0.8044645", "text": "def edit\n @question = Question.f...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "6e545b7431db42d0a05d41a0645cf37c", "score": "0.0", "text": "def set_option_choice\n @option_choice = OptionChoice.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...
f2a4cbd3e2f10deaf213b1421224cac2
Generate a filepath for a music file
[ { "docid": "6d712e165d79a4438001d830c6ae2bd5", "score": "0.83617556", "text": "def generate_filepath_music\n data = get_fat32_compliant_data\n\n path = []\n path << root_dir\n path << \"music\"\n path << artist_first_letter(data['artist'])\n path << data['artist']\n path << \"#{data...
[ { "docid": "529743d60cb64be4ca81dc9c6b22cdb4", "score": "0.7528378", "text": "def audio_path(ext)\n \"songs/#{basename}.#{ext}\"\n end", "title": "" }, { "docid": "d4884289ecdd76a71c2954f4c7688fc5", "score": "0.7425561", "text": "def mp3_path\n filename(\"mp3\")\n end", "...
597bc103f823de7e8c407e105c3a1931
Lists all films a customer has booked to see.
[ { "docid": "86947a7173f78cd937664f355ad4a859", "score": "0.6624402", "text": "def booked_films()\n sql = \"SELECT films.* FROM films\n INNER JOIN screenings\n\t ON films.id = screenings.film_id\n INNER JOIN tickets\n ON screenings.id = tickets.screening_id\n ...
[ { "docid": "1cc23aa0a75dec981314cfc8c47f62ef", "score": "0.73537326", "text": "def booked_films()\n # sql\n sql = \"SELECT films.* FROM films INNER JOIN tickets ON films.id = tickets.film_id WHERE customer_id = $1;\"\n # values\n values = [@id]\n # sql runner\n results = SqlRunner.run(...
8a68f1416bae349df727365d544e642f
Search should do one of two things. If it can find results inside a "PAGE_SIZE" (or number of files to query), return those results. Then let the end client request another page. Otherwise, keep searching until it finds something. Get the results and return them to the user with a page number so that the client knows w...
[ { "docid": "62ee5eb8bf5a9c20db6f115640bfb38a", "score": "0.623911", "text": "def search(text, hours_ago, p)\n data = []\n file_and_range = calculate_files_and_range(hours_ago, p)\n return unless file_and_range\n files = file_and_range[:files]\n range_start = file_and_range[:range_start]\n...
[ { "docid": "4e9563cf91cf1f621d8f3438e32c8c21", "score": "0.66006917", "text": "def next_search_result_page(params = {}, opts = {})\n return self.class.empty_search_result(opts) unless has_more\n\n params = filters.merge(page: next_page).merge(params)\n\n _search(url, params, opts)\n en...
aa82b67824d915649c91aa63930a401c
touch file create file or set timestamp to reference file
[ { "docid": "89b8ac9489c4df525c179ac83f39dd21", "score": "0.74747396", "text": "def touch(file, reference = nil)\n unless reference\n command = \"touch #{file}\"\n return cmd_exec(command)\n end\n #############\n # ctime\n # needs root\...
[ { "docid": "fa4ec66b0b35299648b59e426fdd5383", "score": "0.75637174", "text": "def create_file (file_path)\n \"touch '#{file_path}'\"\n end", "title": "" }, { "docid": "43518023af863e5b3b3c717cb87f7a0c", "score": "0.74740714", "text": "def touch(filename)\n File.open(filename,...
0ef8b6664aa272be144a2913c2e3289b
Waits for the process to terminate and returns its exit value. May return nil, in which case someone else already reaped the process.
[ { "docid": "f8932d9b2cbdbd48ffd7be572892e288", "score": "0.6487286", "text": "def wait\n ::Process.wait(@pid)\n rescue Errno::ECHILD\n end", "title": "" } ]
[ { "docid": "ad20b0cd407f3d87cce369a9cfa2aa19", "score": "0.72765785", "text": "def wait_on_process(kwds={})\n timeout = kwds.fetch(:timeout, EXIT_TIMEOUT)\n fail_on_error = kwds.fetch(:fail_on_error, true)\n\n exit_code = @process.poll_for_exit(timeout)\n if fail_on_error\n check_exit_c...
0480fb83c42c49b14bc435863d0a4a22
Returns the last updated datetime
[ { "docid": "e9c8a5de17ff318fffbd6de7782be274", "score": "0.0", "text": "def lastUpdate\n query_root_node(\"gdacs:lastUpdate/text()\", @@NAMESPACES)\n end", "title": "" } ]
[ { "docid": "24c1c43e17cb22511016100c507be23e", "score": "0.8923293", "text": "def last_updated\n self.dig_for_datetime(\"lastUpdateOn\")\n end", "title": "" }, { "docid": "24c1c43e17cb22511016100c507be23e", "score": "0.8923293", "text": "def last_updated\n self.dig_for_datetim...
ec9f3863a9409460ad2d01efbe2183e2
You can override lower standing methods in your own renderer class
[ { "docid": "a54c3d47894db86dda08085f8846b67c", "score": "0.0", "text": "def view(p)\n p.period? || p.today? || (p.select? && !p.current_period?) ? p.title_view : p.date_view\n end", "title": "" } ]
[ { "docid": "922da2a4295286fffb3d08225c3a3077", "score": "0.800355", "text": "def renderer; end", "title": "" }, { "docid": "922da2a4295286fffb3d08225c3a3077", "score": "0.800355", "text": "def renderer; end", "title": "" }, { "docid": "17442aee49a74a80aa3993bec2c27a2d", ...
410f5e0b8412549ab21f502138640837
End of Role Management of Unit
[ { "docid": "4af6dd29205b0df34b7757e1c4fafb86", "score": "0.0", "text": "def unit\n\t\t\t@setting_nav_id = 'unit'\n\t\t\t@units = Unit.all\n\t\tend", "title": "" } ]
[ { "docid": "adb5bf69a63ca2390900295b8beb6824", "score": "0.67555183", "text": "def ending(agent)\n end", "title": "" }, { "docid": "7b526b9dba5b54b91362943d1f61372a", "score": "0.6558837", "text": "def terminatereseller\n \n end", "title": "" }, { "docid": "b4f...
4b517bc0a57031b65ec24e047d7350d4
Creates a hash that is used for css classes in the frontend
[ { "docid": "349f9dad4c5f7c8f1ef1c91efc6d6a21", "score": "0.0", "text": "def display_data(component: nil, variant: nil)\n {}.tap do |hash|\n hash[:component] = component if component\n hash[:variant] = variant if variant\n end\n end", "title": "" } ]
[ { "docid": "3f6d4de84df62c5b99d5f324e7bea556", "score": "0.63632846", "text": "def classes_hash\n @classes\n end", "title": "" }, { "docid": "3f6d4de84df62c5b99d5f324e7bea556", "score": "0.63632846", "text": "def classes_hash\n @classes\n end", "title": "" }, { "d...
43dd235e6766001b2c26bb6c489c7a3a
/stories/topic/topic_name/upcoming list of upcoming stories inside a topic
[ { "docid": "e7cecd27ac9d1b04b5d3108f70396d70", "score": "0.61552805", "text": "def test_stories_find_upcoming_by_topic\n assert_not_nil @rdigg.stories.find_upcoming_by_topic(\"apple\")\n end", "title": "" } ]
[ { "docid": "a60437350bd8abf4af2cdcfc40c99768", "score": "0.65025496", "text": "def upcoming\n unless @profile.teachings.empty?\n teach_coming = @profile.teachings.collect{|e| e if !e.open && !e.has_happened}\n end\n unless @profile.subscriptions.empty?\n learn_coming = @profile.subscr...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "092fc82b8689f569ce6450ce76e7f3f4", "score": "0.0", "text": "def set_user\n @user = params[:user_id] ? User.find(params[:user_id]) : current_user\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...
8157c7e7c545d478938e27ec5ebdb443
add if statement to produce a noise depending on it's species
[ { "docid": "4090c818515c94ec9363a10a47c7c863", "score": "0.5821136", "text": "def pet_says\n \n if @species == \"Ferret\"\n return \"squeeeeee\"\n elsif @species == \"Chincilla\"\n return \"eeeep\"\n elsif @species == \"Parrot\"\n return \"chirp\"...
[ { "docid": "0d90c0f4d0513834be0ce2b5d7577bc6", "score": "0.68651474", "text": "def make_noise\n \"Muuu!\"\n end", "title": "" }, { "docid": "f9614a2a7264bab2d86304790263d654", "score": "0.66404444", "text": "def noise\n @noise\n end", "title": "" }, { "docid...
89752d9dfcabb869d6957f665c6a166e
DELETE /cameras/1 DELETE /cameras/1.json
[ { "docid": "a02f78c76aecd8b229f84d9434a7da50", "score": "0.77767414", "text": "def destroy\n @camera = Camera.find(params[:id])\n @camera.destroy\n\n respond_to do |format|\n format.html { redirect_to cameras_url }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "89736d14586236d89d9d03fae100b6d6", "score": "0.750211", "text": "def destroy\n @camera.destroy\n respond_to do |format|\n format.html { redirect_to cameras_url, notice: 'Camera was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": ""...
caa5a2f9d1738762c70fa4e63a1fbe3a
Clicks on object and waits for page to load or refresh
[ { "docid": "e2773e662e4cd66d76015730373b4e18", "score": "0.70453995", "text": "def click\n\tbegin\n\t @selenium.click(@locator)\n\trescue => e\n\t sleep(3)\n\t @selenium.click(@locator)\n\tend\n\n\tbegin\n\t @selenium.wait_for_page_to_load\n\trescue => e\n\t sleep(2)\n\t @selenium.wait...
[ { "docid": "edf1447c34c5456e861a812ac4bd6918", "score": "0.745121", "text": "def click\n @_node.click\n @_node.getPage.getWebClient.waitForBackgroundJavaScriptStartingBefore(3000)\n end", "title": "" }, { "docid": "7747a2e3e1572be0d4293686abe3ebf4", "score": "0.7169315", ...
2b9319e328fe6a71d553776d43951616
GET /lookup/units?q=xx (default: json)
[ { "docid": "92ad51451b7e19af505a11f53a8fe14b", "score": "0.67222565", "text": "def units\n @units = Item.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).map(&:unit)\n @units += Detail.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).ma...
[ { "docid": "fc7c68e5bca78316e4acf7a60b0eb56f", "score": "0.726927", "text": "def foods_units\n get('/foods/units.json')\n end", "title": "" }, { "docid": "f448dfc0e72a21f57dfff5de669db342", "score": "0.6669451", "text": "def unit_of_measurement_find_with_http_info(opts = {})\...
017d89ff607fd4a37eb35db828f43800
find_region_by_ip TODO this method only for postgresql database
[ { "docid": "5388fd1e6bb349dc160411cac2eb06ca", "score": "0.8059974", "text": "def find_region_by_ip( user_ip )\n raise ArgumentError, \"Must have a valid IPv4 or IPv6 addres\" unless !!((user_ip =~ Resolv::IPv4::Regex) || (user_ip =~ Resolv::IPv6::Regex))\n long = ip2long( user_ip )\n Ipgeobase...
[ { "docid": "02e4234356f11ae1a1b43d351348431b", "score": "0.77098244", "text": "def guess_region\n Geocoder.search(ip_address).first.region\n end", "title": "" }, { "docid": "f47c0124b08d7f5c7bc5bf83cd012bfb", "score": "0.68722516", "text": "def find_by_ip(ip)\n find(:address...
dcc3d74029d8ff645e4f7cd0d1195451
GET /toques GET /toques.xml
[ { "docid": "72d06ef8d27a103e5d319bf0a4f9a101", "score": "0.6529605", "text": "def index\n @toques = Toque.find(:all, :order=>\"cuando DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @toques }\n end\n end", "title": "" } ]
[ { "docid": "4159dec1fcfba12b50c1143c634653fc", "score": "0.6467279", "text": "def show\n @toque = Toque.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @toque }\n end\n end", "title": "" }, { "docid": "2b21fb71bf9f...
77144c3015290665690ecd3b91f2eaac
Normalize the data. data The String data to be normalized. Returns the normalized data String.
[ { "docid": "c86676064015dd0a20d340037ef9b88b", "score": "0.6944603", "text": "def normalize(data)\n data.gsub(/\\r/, '')\n end", "title": "" } ]
[ { "docid": "cc17b1ed09d0424c8aaf7fb58bc37864", "score": "0.65259564", "text": "def normalize(data)\n self.normalizeField(:\"#{self.name}\",data)\n end", "title": "" }, { "docid": "dfcfe5eb542cdb5285847e097af3f91c", "score": "0.6413202", "text": "def normalize_data(data)\n # no...
5e3c5351a1cc9ec72a57e95181b196a1
end wait_for_stack_to_complete Generate the stack Policy we will use to create/update TODO: manage overriding the policy on update
[ { "docid": "93c75212fb3c7aae0cfc2f4c0ddff682", "score": "0.7051897", "text": "def generate_update_stack_policy(manifest, cf_client)\n\n\treturn nil if ! Options[:allow_update]\n\n\t# puts \"Stack Policy Override Still not implemented correctly\"\n\t# return nil\n\tputs \"Overriding Stack Policy protecti...
[ { "docid": "5dbdee0d04fd8d11c49b3b5fc5779892", "score": "0.6935612", "text": "def save_stack_policy(p_stack)\n valid_logical_ids = p_stack.resources.reload.all.map(&:logical_id)\n stack_policy = @policies.fetch(p_stack.id,\n @policies.fetch(p_stack.dat...
75dce6a1a35cf682ef649e5257d56c8f
GET /feeds/1 GET /feeds/1.json
[ { "docid": "4be1b023975ca54b407ea3f8ccf982a1", "score": "0.0", "text": "def show\n @feed_members = FeedMember.where({feed: @feed})\n @users = User.all.select do |hash|\n hash[:id] != current_user.id\n end\n @users = @users.map do |user|\n {\n \"name\": user.name,\n ...
[ { "docid": "b3d510a24aa62a476241e4f58d6b786d", "score": "0.73232484", "text": "def index\n feed_urls = Feed.all.collect(&:feed_url)\n @feeds = fetch_all_feeds(feed_urls)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @feeds }\n end\n end", ...
35c84a7645e6bd11365547ba60708d2f
Validating this way feels funky... meh
[ { "docid": "bec8744389ad88fe9c831d4088aee0a2", "score": "0.0", "text": "def content_length\n if !content.nil? and content.length > max_size\n errors.add :base, 'Content is too big.'\n end\n end", "title": "" } ]
[ { "docid": "cc9bbb1febdcea79441cb4523fce006d", "score": "0.74424046", "text": "def valid?; end", "title": "" }, { "docid": "cc9bbb1febdcea79441cb4523fce006d", "score": "0.74424046", "text": "def valid?; end", "title": "" }, { "docid": "cc9bbb1febdcea79441cb4523fce006d", ...
185707cd198b73d64130b5a963d193e0
GET /one_reg_institutions/new GET /one_reg_institutions/new.json
[ { "docid": "7decc48af0cb9f7dad24f960300fdd74", "score": "0.7434163", "text": "def new\n @one_reg_institution.institution_id = @institution\n @one_reg_institution = OneRegInstitution.new\n 1.times {@one_reg_institution.document_by_institutions.build }\n\n respond_to do |format|\n format....
[ { "docid": "b45389a061ca5e64e8d1042195ec2a2c", "score": "0.7633953", "text": "def new\n @institution = Institution.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @institution }\n end\n end", "title": "" }, { "docid": "7c3b23bae92f...
2932be7a4e4b083cc6787fd25a3f9550
Returns primary email for the contact
[ { "docid": "040013e0648567c82dbbabde7febc0de", "score": "0.83573914", "text": "def primary_email\n if self[\"gd$email\"]\n _email = self[\"gd$email\"].find { |e| e.primary == \"true\" }\n _email ? _email.address : nil\n else\n nil # no emails at all\n end\n end", ...
[ { "docid": "809b5910aef75073fdb6c652eb30d3e2", "score": "0.8453066", "text": "def email\n c = self.head.primary_contact \n c ? c.email_1 : nil\n end", "title": "" }, { "docid": "ff5fff1e86110bafc3a6b7fb2e13f039", "score": "0.8187635", "text": "def primary_email\n\t\tEmail.find...
49018a925b083f3fd762d04f1c473561
Validate (This is used to validate the OTP entered by the user)
[ { "docid": "90220b8f88827521f191e558394b3f6f", "score": "0.0", "text": "def validate(options = {})\n @options = options\n\n request_params = {\n otp: encrypt(:otp),\n transactionreference: encrypt(:transactionreference),\n bvn: encrypt(:bvn),\n merchantid: client.me...
[ { "docid": "ae73546785eb6e4cf98965a085639ca3", "score": "0.72575235", "text": "def check_otp_errors\n\t\t\n\tend", "title": "" }, { "docid": "ab36c08498dcdd79873e6459fa13e900", "score": "0.7177355", "text": "def verify_sms_otp(otp)\n\t\t\n\tend", "title": "" }, { "docid":...
1b16b6dd8058da82bc0c9991cb0fef4f
Method returning a list of release paths which may be removed
[ { "docid": "f401b9bd646b7c017367d5068f5c70f4", "score": "0.7824328", "text": "def expired_release_paths\n chop = -1 - keep_releases\n current_release = ::File.realpath(current_path) if ::File.exist?(current_path)\n current_release_paths[0..chop].delete_if do |release|\n [current_release, release_p...
[ { "docid": "eef44dc11cf446f7d8d5207ba5c5819c", "score": "0.6969384", "text": "def current_release_paths\n paths_array = Array.new\n paths_array.push(::File.realpath(current_path)) if ::File.exists?(current_path)\n paths_array.push(::Dir.glob(::File.join(deploy_to, '/releases/*')).sort).flatten.compac...
f68dc0bb053cd9a1ad65b6c246976413
Returns if billet is pending
[ { "docid": "9bf774a4b0d0d44839222d50ce333a49", "score": "0.7849939", "text": "def pending?\n status == 'pending'\n end", "title": "" } ]
[ { "docid": "8584ceeb59d4b7d2eed331d99d7cd03a", "score": "0.7887239", "text": "def pending?\n status == :pending\n end", "title": "" }, { "docid": "3305993cb759ca3d0669850d13a80106", "score": "0.7849172", "text": "def pending?\n self.pending\n end", "title"...
c90fe3079426178cb3f12939aee4de9b
space = " "
[ { "docid": "f248e1322afb2d75b5d4ff670217d6f8", "score": "0.78073865", "text": "def _space\n _tmp = match_string(\" \")\n set_failed_rule :_space unless _tmp\n return _tmp\n end", "title": "" } ]
[ { "docid": "25a57fb6c0460859cd48121770c51862", "score": "0.8714801", "text": "def space; end", "title": "" }, { "docid": "ca20afb05ee25c80cdfff26f34168c2b", "score": "0.8574467", "text": "def space\n text \" \"\n end", "title": "" }, { "docid": "3fc4f0126165f788db...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "486b714dd0dbabf4c4ca62ece1a0265c", "score": "0.0", "text": "def update!(**args)\n @postback = args[:postback] if args.key?(:postback)\n @text = args[:text] if args.key?(:text)\n end", "title": "" } ]
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
28d50482347b6f3c643bc4ccb43ffe28
validates :purchase_order_number, :presence => true
[ { "docid": "c2b5106537236b4ca2ab13bb583af743", "score": "0.0", "text": "def to_csv\n\t\tCSV.generate(headers: true) do |csv|\n\t\t\tcsv << [self.name]\n\t\t\tcsv << [self.description]\n\t\t\tcsv << [self.bom_category.name]\n\t\t\tcsv << [self.created_at.to_date]\n\t\t\tcsv << []\n\t\t\t# puts \">>>>>>>>...
[ { "docid": "eed36d06194579b30bdd8a9209f80bed", "score": "0.7143149", "text": "def invoice_number_presence\n unless number\n rescue_invoice_number\n errors.add(:invoice_number, \"can't be blank\")\n end\n end", "title": "" }, { "docid": "2895745331d72891f22b62123242125a", ...
9b662a3a2086500bcb7d28e0253ea436
Public: Build exclusions list from generic and targeted exclusions definitions per CPE. cpe CPE object to use in generating the default exclusions list. Returns a String containing the exclusions list generated.
[ { "docid": "322f068bad68cee6727eca2224e9ac23", "score": "0.63866943", "text": "def build_default_exclusions(cpe)\n exclude = \"\"\n exclude << File.open(\"#{DATA_LOCATION}/exceptions/base.txt\", \"r\").read\n vendor = cpe.vendor.downcase\n version = cpe.version.to_s.downcase\n path = \"#{...
[ { "docid": "2844b44d92089bfec2f278186b3145f7", "score": "0.718285", "text": "def build_exclusions(cpe)\n exclusions = Exclusions.new(cpe)\n edit = UI.prompt_yn('Edit exclusions list? (Y/N)', default_answer: 'N')\n exclusions = edit_exclusions(exclusions) if edit\n\n exclusions.to_s\n...
87f29bea3a94f0b796ecfe6358e97609
Baseline implementation for the update_product_set REST call
[ { "docid": "dc6f774e266957a0d82d90afbd694a21", "score": "0.71534514", "text": "def update_product_set 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_update_p...
[ { "docid": "e02741683e35fad09a34757d78415e6b", "score": "0.72969836", "text": "def update\n @product_set = ProductSet.find(params[:id])\n\n respond_to do |format|\n if @product_set.update_attributes(params[:product_set])\n format.html { redirect_to @product_set, :notice => 'Product set...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "794796cb6d241954d7b808fae3ec2ca8", "score": "0.0", "text": "def project_params\n if action_name != 'create'\n params.require(:project).permit(policy(@project).permitted_attributes)\n else\n params.require(:project).permit(*ProjectPolicy::FULL_PARAMS)\n end\n end", "ti...
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69811666", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6782836", "text": "def strong_params\n params.requ...
e63a095285c88e507aa20f04df9faf63
skip_confirmation on the users primary email
[ { "docid": "a8f5dc42b0ee870a5aa5f8d4d53959bb", "score": "0.91362554", "text": "def skip_confirmation!\n primary_email_record.skip_confirmation!\n end", "title": "" } ]
[ { "docid": "40589f8a3a7ea0248691afa6235c81e8", "score": "0.7885049", "text": "def skip_confirmation!\n self.confirmed_at = Time.now\n @skip_confirmation = true\n end", "title": "" }, { "docid": "7c1a31146b12d074cbd3e8ed33ac4f5e", "score": "0.7783702", "text": "def...
bb23df27ae92efb47756d03a2528c616
Returns the twocharacter abbreviation of a character's alignment
[ { "docid": "225c16b290905abc96ec79bf38e1c286", "score": "0.8586472", "text": "def alignment_abbreviation\n alignment.split(\" \").map(&:chr).join\n end", "title": "" } ]
[ { "docid": "af44618942d5796bdaa95632b58abc8d", "score": "0.68469834", "text": "def abbrev_and_name\n abbreviation_name\n end", "title": "" }, { "docid": "af44618942d5796bdaa95632b58abc8d", "score": "0.68469834", "text": "def abbrev_and_name\n abbreviation_name\n end", "ti...
41a15e26c254aaab2225dad82b292d1b
Method to run final calculations based on choices
[ { "docid": "7f7ff7f6094feb2fe99a549b844ec98c", "score": "0.5878952", "text": "def calc(op_type, num_1, num_2)\n # Conditional to run calulations based on operator choice\n case op_type\n when \"+\", \"ADD\"\n return num_1 + num_2\n when \"-\", \"MINUS\"\n return num_1 - num_2\n when...
[ { "docid": "641875b4c7632eaa22a2c174dbe1242a", "score": "0.69036627", "text": "def method_calc(selected)\n case selected\n when \"approximately\"\n Proc.new do |labs, gone, subject|\n say(\"#{subject} - #{gone} из #{labs.size}\")\n end\n when \...
74ea5bcf439514f7540a7b8c0aa26fa7
A oneliner solution for ActiveRecord::Baseto_param
[ { "docid": "5021666564633dffd6d065e65d0ab43d", "score": "0.5177744", "text": "def to_param(args)\n case args\n when String\n define_method \"to_param\" do\n args.gsub(/:(\\w+)/) {|method| send(method[1..-1]).to_s.parameterize }\n end\n\n if args.empty?...
[ { "docid": "a4a50332896dd93a4529350c8453ce13", "score": "0.62478167", "text": "def parameterize(value); end", "title": "" }, { "docid": "a4a7edaad7eccc57d7426f7b1d1f010c", "score": "0.617708", "text": "def to_param; end", "title": "" }, { "docid": "8ed7d88add0fde774ec9875...
85cd98fd9a04d18b6b4529147be1565e
Check whether review, metareview, etc.. is allowed The permissions of TopicDueDate is the same as AssignmentDueDate. Here, column is usually something like 'review_allowed_id'
[ { "docid": "7e59c69b779b6a3c1af8ec36ef776eaf", "score": "0.0", "text": "def check_condition(column, topic_id = nil)\n next_due_date = DueDate.get_next_due_date(id, topic_id)\n return false if next_due_date.nil?\n\n right_id = next_due_date.send column\n right = DeadlineRight.find(right_id)\n...
[ { "docid": "b071ba50ec4dc0d868fad743ef1c3426", "score": "0.7127509", "text": "def review_allowed(topic_id=nil)\n return (check_condition(\"review_allowed_id\",topic_id) or check_condition(\"rereview_allowed_id\",topic_id))\n end", "title": "" }, { "docid": "d8541cd82fc532e40c6943b054f7bf...
270ccec05b5306ec25a69f9bb705cb78
Get your transactional email activity aggregated over a period of time This endpoint will show the aggregated stats for past 90 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days
[ { "docid": "01aed0c4f4f4ec04a207ad178439cf9c", "score": "0.0", "text": "def get_aggregated_smtp_report(opts = {})\n data, _status_code, _headers = get_aggregated_smtp_report_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "303e725dcf704e1c9182c0fbd0cc4c2c", "score": "0.61971164", "text": "def get_aggregated_smtp_report_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.get_aggregated_smtp_report ...'\n end\n #...
012d605e5742fa6f4152c5f1fbccef10
method print out the first N prime number
[ { "docid": "0f7f35051b0ea49399c64df093c06d12", "score": "0.78184", "text": "def print_prime (n)\n\tcount = 0 \n\tnum = 2 \n\twhile count < n do\n\t\tif check_prime(num)\n\t\t\tputs num \n\t\t\tcount+=1\n\t\tend\n\t\tnum+=1 \n\tend\nend", "title": "" } ]
[ { "docid": "62a8522ffa4388a4926a671c36960ac0", "score": "0.7667021", "text": "def print_prime (n)\n for i in (2..(n-1))\n if check_prime(i)\n puts i\n end\n end\nend", "title": "" }, { "docid": "d061483180171c101b9f198ec4d451a1", "score": "0.7569056", "...
82e126fb9055f65a058c04ad7aafd061
Ensures that a location is valid for a number in all 3 ways, row, column, and block.
[ { "docid": "3182fdc6a2bb0aee4cf9c5b1cba15ace", "score": "0.6696013", "text": "def validate_position(board, position, number)\n position_row = position[0]\n position_col = position[1]\n # Checks the row to ensure there's no duplicate while also checking the column to ensure there's no duplicate....
[ { "docid": "dc757c01b7e0fb040c75d06344b72d95", "score": "0.680965", "text": "def invalid_place_numbers?\n unless arguments[:x].nil?\n @arguments[:x] = nil if arguments[:x] < 0\n end\n unless arguments[:y].nil?\n @arguments[:y] = nil if arguments[:y] < 0\n end\n [ar...
1e73413fded0a49413617405ff82d0cc
POST /tour_bookings POST /tour_bookings.json
[ { "docid": "9b1ff7fbbf211be10068ed1cd5c0b7ae", "score": "0.6868514", "text": "def create\n @tour_booking = TourBooking.new(tour_booking_params)\n\n respond_to do |format|\n if @tour_booking.save\n format.html { redirect_to @tour_booking, notice: 'Tour booking was successfully created.'...
[ { "docid": "c140a981953c39afa9f2012e64aafd65", "score": "0.71295977", "text": "def create\n\t\tbooking = Booking.new(booking_params)\n\n\t if booking.save\n\t \tPeekBooker.use_a_boat(booking.size, booking.timeslot_id)\n\t \tPeekBooker.delete_overlap_assignments(booking.timeslot_id)\n\t \tPee...
cf55d8cb61d3b7f96c9b9b5e1965e81d
DELETE /vendedores_rankings/1 DELETE /vendedores_rankings/1.xml
[ { "docid": "12ebb2dfd9df52b969f31cadd633f42b", "score": "0.7267997", "text": "def destroy\n @vendedores_ranking = VendedoresRanking.find(params[:id])\n @vendedores_ranking.destroy\n\n respond_to do |format|\n format.html { redirect_to(vendedores_rankings_url) }\n format.xml { head :o...
[ { "docid": "4e7a291113d0b2531040c0d2a765357c", "score": "0.6846005", "text": "def destroy\n @rank_vote = RankVote.find(params[:id])\n @rank_vote.destroy\n\n respond_to do |format|\n format.html { redirect_to(rank_votes_url) }\n format.xml { head :ok }\n end\n end", "title": "...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "507f9d8addf1e6cc5459c912fa6d289e", "score": "0.0", "text": "def ni_params\n params.permit(:text, :from, :to, :id)\n end", "title": "" } ]
[ { "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...
b1a43e8efbe0adf0543adb6765096198
Handles registrar operations at a multithreaded level
[ { "docid": "6516e921735cad620b75c1c9f63e8013", "score": "0.59803253", "text": "def run\n loop do # Servers run forever\n Thread.start(@registrar.accept) do |client|\n @registrar_thread = RegistrarThread.new(client)\n @registrar_thread.run\n end\n end\n end", "title": "...
[ { "docid": "af81c3354a7777d3dcc02af74b87df0e", "score": "0.74260426", "text": "def registered; end", "title": "" }, { "docid": "af81c3354a7777d3dcc02af74b87df0e", "score": "0.74260426", "text": "def registered; end", "title": "" }, { "docid": "706ce5b01190c0b1a7ec0680575e...
9f7e2bce49a030811add97d0c2a519e5
Devuelve el mes de la fecha de inicio del evento.
[ { "docid": "add77e36279b199b0bb295c0ef8da42a", "score": "0.50003475", "text": "def month\n @month || self.starts_at.month\n end", "title": "" } ]
[ { "docid": "f0b4f74f8a384672e57e3a7bb6b72cc1", "score": "0.6356744", "text": "def hora_inicio\n if !read_attribute(:hora_inicio).nil?\n Time.parse(read_attribute(:hora_inicio).to_s[11..17].to_s).strftime(\"%I:%M %p\")\n end\n end", "title": "" }, { "docid": "496a4c742b2b9e5c343f7...
5c35bd001465f3c0d164665dff64dbf9
Reconstruct a datetime object from datetime_select helper form params
[ { "docid": "9514fedad0a57233b0e36b46c45dc9a2", "score": "0.6315847", "text": "def build_datetime_from_params(field_name, params)\n DateTime.new(params[\"#{field_name.to_s}(1i)\"].to_i,\n params[\"#{field_name.to_s}(2i)\"].to_i,\n params[\"#{field_name.to_s}(3i)\"].to_i,\n ...
[ { "docid": "ce5600d09c0492d64ef46f1ea7c9c76c", "score": "0.69797444", "text": "def datetime_params\n @datetime_params ||= {}\n end", "title": "" }, { "docid": "533c6323baab2329b252a0081adb439d", "score": "0.6911903", "text": "def convert_datetimepicker_dates \n if params[:o...
bf8d974a2fd5db76565e7ae32b47f99f
display user who created comment
[ { "docid": "2e6306770688d7d40827a12119d7772d", "score": "0.78838867", "text": "def commenter\n self.user.name\n end", "title": "" } ]
[ { "docid": "8cce5a0255e5aa708941442623fa759d", "score": "0.8036615", "text": "def commenter\n \tobject.user.name\n end", "title": "" }, { "docid": "acfd21d638474f285e5b3ff983340197", "score": "0.73465943", "text": "def show\n @comment = Comment.new\n @comment.auther = current...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "06d0a948fa721cea9f1c4df5bf44f092", "score": "0.0", "text": "def set_pet\n @pet = Pet.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;...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b21d2fa5c15852d17fae5c2fd8189767", "score": "0.0", "text": "def set_good\n @good = Good.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...
40a5c73f5d9b586c37e115ebfb5a9558
Upgrade the upgrade coordinator. Upgrade the upgrade coordinator.
[ { "docid": "dbf90d2ab7d431ee9a1ef2a8c1d3e3cf", "score": "0.0", "text": "def trigger_uc_upgrade_upgrade_uc(opts = {})\n trigger_uc_upgrade_upgrade_uc_with_http_info(opts)\n return nil\n end", "title": "" } ]
[ { "docid": "ba58daa3380a790067bc7479a702612c", "score": "0.67916876", "text": "def action_upgrade\n run_package_action(:upgrade)\n end", "title": "" }, { "docid": "e5c1b72071664f768bab1111636c204b", "score": "0.6476554", "text": "def action_upgrade\n install_requ...
52bbaf48457f79729e0d6d6f41edaf1f
adds a sequence to the set
[ { "docid": "70a51b1bf0a4824bbfc815141e243376", "score": "0.7076663", "text": "def add(seq)\n begin\n @seqs.push(seq.seq)\n rescue\n @seqs.push(seq) # if seq only String not Sequence\n end\nend", "title": "" } ]
[ { "docid": "2bb016f037191d19e69a1c5e31e0aeea", "score": "0.75743276", "text": "def add_sequence(seq)\n @sequences << seq\n end", "title": "" }, { "docid": "dc249109a3f7422ecc69245c3b93b517", "score": "0.7216934", "text": "def addSequence\n\n end", "title": "" }, { ...
21f84d60125a8fb42fdc74de27660d25
Update placement related to battler
[ { "docid": "906a0ef0d79a892dc6fdd002a88347b5", "score": "0.74941987", "text": "def update_placement\n self.x = battler.screen_x + @dummy.screen_x\n self.y = battler.screen_y + @dummy.screen_y\n self.z = battler.screen_z + (@above_char ? 1 : -1)\n sprset = get_spriteset\n self.opacity = sp...
[ { "docid": "49b94280cba7c88f71c9e5cfbb86a034", "score": "0.72297287", "text": "def update_placement\n set_x_placement\n set_y_placement\n end", "title": "" }, { "docid": "1b57d83757d84818de837e22dbfaec0d", "score": "0.6759635", "text": "def place_update\n @spriteset.update\...
4e76e6a5867fa3a85b40a1a8112918e8
get method for new user form (sign up form)
[ { "docid": "1bce91031f347d1adb6fd70c13c8e8c3", "score": "0.0", "text": "def new\n @current_user = User.new\n respond_to do |format|\n format.js { render 'new' }\n format.html \n end \n end", "title": "" } ]
[ { "docid": "d43a1d5fa2390f93fe2fe727c01704b2", "score": "0.81687653", "text": "def new\n \t@user = User.new #to get signup form working\n end", "title": "" }, { "docid": "3c9f504a04d6f359f32aa815212150d6", "score": "0.8085798", "text": "def new\n #Signup Form\n @user = Us...
101ffb50067d775e3b5e694506ee9988
GET /resource/cancel Forces the session data which is usually expired after sign in to be expired now. This is useful if the user wants to cancel oauth signing in/up in the middle of the process, removing all OAuth session data. def cancel super end protected If you have extra params to permit, append them to the sanit...
[ { "docid": "c12a653dae4c1a79faaafe7e62d6f9e5", "score": "0.0", "text": "def destroy\n if @admin.destroy\n redirect_to all_admins_path\n flash[:delete] = \"El Administrador se elimino con\"\n \n end\n end", "title": "" } ]
[ { "docid": "4ac94a220a636bd185fdaec6b50ca6d5", "score": "0.8224544", "text": "def cancel\n expire_session_data_after_sign_in!\n redirect_to new_registration_path(resource_name)\n end", "title": "" }, { "docid": "4ac94a220a636bd185fdaec6b50ca6d5", "score": "0.8224544", "text": ...
408fd907b4e2ff8b15f7f2b1527aa69a
Method to create a list input: string of items separated by spaces (example: "carrots apples cereal pizza") steps: splitting the string to have array of strings set default quantity iterate through the array to form the hash print the list to the console [can you use one of your other methods here?] output: hash list
[ { "docid": "11a420de7debfca9cfcc1b824b93604b", "score": "0.0", "text": "def create_list(items)\n hash = Hash.new(0)\n items.split(\" \").each do |item|\n hash[item] += 1\n end\n p hash\nend", "title": "" } ]
[ { "docid": "46e248e84aa527b9b35c199974e72993", "score": "0.85477006", "text": "def create_list(string_of_items)\n# input: string of items separated by spaces (example: \"carrots apples cereal pizza\")\n# steps: \n # split string into separate items\n items_in_array = string_of_items.split(\" \")\n # ...
4bd1904ae8ff0b5fe77ab5775ad021f8
def folders Public accessor
[ { "docid": "65d100921b6df48202827d6a59a7c07b", "score": "0.0", "text": "def foldersByMor(selSpec = nil)\n f = nil\n @cacheLock.synchronize(:SH) do\n if selSpec.nil?\n f = dupObj(foldersByMor_locked)\n else\n f = applySelector(foldersByMor_locked, selSpec)\n end\n en...
[ { "docid": "734ea3e99d6721de422231f6c16acadc", "score": "0.81047106", "text": "def folders\n @folders ||= {}\n end", "title": "" }, { "docid": "376207df33cf1fa34715ccaaf5d8ed07", "score": "0.7813602", "text": "def folder?; end", "title": "" }, { "docid": "...
28f088a01312a38814ce67ad8b8d7358
check replica set state
[ { "docid": "321be82f4abfecfed1a2c38cb7c4de68", "score": "0.65963703", "text": "def check_rs_cluster(w = nil, c = nil, i)\n if replica_set?\n primary = 0\n arbiter = 0\n secondary = 0\n rsstats['members'].each do |m|\n case m['state']\n when 1\n primary += 1\...
[ { "docid": "9bb5559c33c273bcf2102fa553687651", "score": "0.7757107", "text": "def replica_set?; false; end", "title": "" }, { "docid": "9bb5559c33c273bcf2102fa553687651", "score": "0.7757107", "text": "def replica_set?; false; end", "title": "" }, { "docid": "9e5c881976bc...
da0c0fd4fe0f5df1f9226cd7bea4504a
Provide alternative name for a prompt, which can be used from the listprompts and changeprompt commands.
[ { "docid": "79106604e11f0cfe052a2ae7fd475721", "score": "0.727638", "text": "def alias_prompt(prompt_name, aliased_prompt)\n prompt_name = prompt_name.to_s\n prompt = self[prompt_name]\n if not prompt\n raise AliasError, \"prompt '#{prompt}' cannot be aliased because it doesn't exist\"\n ...
[ { "docid": "f4ad660008f0c870329f7a13c1897b8f", "score": "0.7150427", "text": "def with_named_prompt(name)\n raise Error::UndefinedMatch, \"unknown named_prompt #{name}\" unless named_prompts[name]\n\n with_prompt(named_prompts[name]) do\n yield\n end\n end", "title...
ad72d3c02ed0d4d7068a51429ba6ed73
Adds the loads and associated schedules for each space type as defined in the OpenStudio_Standards_space_types.json file. This includes lights, plug loads, occupants, ventilation rate requirements, infiltration, gas equipment (for kitchens, etc.) and typical schedules for each. Some loads are governed by the standard, ...
[ { "docid": "c50d4fe897bd3977752bce8f1d315144", "score": "0.663112", "text": "def add_loads(building_vintage, climate_zone)\n\n OpenStudio::logFree(OpenStudio::Info, 'openstudio.model.Model', 'Started applying space types (loads)')\n\n # Loop through all the space types currently in the model,\n ...
[ { "docid": "1c448524a2742c5432a67e73ded9b39f", "score": "0.620086", "text": "def add_space_type(template, clim, building_type, spc_type)\n #OpenStudio::logFree(OpenStudio::Info, 'openstudio.standards.Model', \"Adding space type: #{template}-#{clim}-#{building_type}-#{spc_type}\")\n\n # Get the spa...
7ddba449353475b99ceeb234f8c136e5
Converts the URI to one compatible with SSH.
[ { "docid": "2b0952e3eeb4b85c9e5f47dac0db6141", "score": "0.7386018", "text": "def ssh_uri\n new_uri = @uri.host\n new_uri = \"#{@uri.user}@#{new_uri}\" if @uri.user\n\n return new_uri\n end", "title": "" } ]
[ { "docid": "ff3ce1c7de75e8d00ee7eb61ff582f14", "score": "0.7585489", "text": "def ssh_uri\n unless @uri.host\n raise(InvalidConfig,\"URI does not have a host: #{@uri}\",caller)\n end\n\n new_uri = @uri.host\n new_uri = \"#{@uri.user}@#{new_uri}\" if @uri.user\n\n return n...
9f5de3a5a9a41980ccc906fca323d19f
POST /landlords POST /landlords.xml
[ { "docid": "f1cd9966d95d092fa254936172c3d31e", "score": "0.59759635", "text": "def create\n\n @landlord = Landlord.new(params[:landlord])\n\n respond_to do |format|\n if @landlord.save\n flash[:notice] = 'Landlord registration successful.'\n format.html { redirect_to signin_url ...
[ { "docid": "e02c623ab910aaab2cbbc711dc80e98e", "score": "0.5592524", "text": "def create\n @waypoint = Waypoint.new(params[:waypoint])\n\n respond_to do |format|\n if @waypoint.save\n flash[:notice] = 'Waypoint was successfully created.'\n format.html { redirect_to(@waypoint) }\...
fe395ab564e659dedc913f2e5229de7f
This is our team generating function given an array of names and the number of people per team, it returns a two dimensional array of teams
[ { "docid": "2076356544285527c354ceea75eb9b0d", "score": "0.86574507", "text": "def create_teams(names_array, num_people_per_team)\n @newArray = []\n while names_array.length > 0\n @newArray << random(names_array)\n end\n @twoArray =[]\n\n (0...@newArray.length).step(num_people_per_team).each do ...
[ { "docid": "eb0bf9aaadd19931938a4821eda9b666", "score": "0.79095596", "text": "def method_people(names, number)\n names_array = names.shuffle.map\n teams = (names.length.to_f / number).ceil\n new_array = Array.new(teams) { Array.new }\n count = 0\n names_array.map do |name|\n new_arr...
19b3532b42700c587b12e245acd8a61e
CancellationHistoryRequest (CHR100)This request type lists all the cancellations that have occurred between two dates.
[ { "docid": "1cbfaf1e150cc3f6afcdc28fbde04d13", "score": "0.7380947", "text": "def send_cancellation_history_request(attrs={})\n request = CancellationHistoryRequest.new(attrs.merge({:http_biz_id=>@http_biz_id, :udi_auth_token=>@udi_auth_token}))\n response = get(request.to_xml.to_s)\n ret...
[ { "docid": "2f66c84696378ee3fb1b31e31d1ba2c2", "score": "0.5945889", "text": "def cancelled_requests\n @cancelled_requests ||= []\n end", "title": "" }, { "docid": "c340379b1c333478e44898b49f11a84c", "score": "0.57693815", "text": "def cancel_report_requests(params = ...
36de9364e554020eaf915302506236cd
why isn't it set automatically?
[ { "docid": "b6f520ef3e649fcef823687facb31392", "score": "0.0", "text": "def show\n set_services\n user = @users_service.find_user(params)\n init_presenter\n render 'show', locals: { view_data: @users_presenter.show_data(user, current_user) }\n end", "title": "" } ]
[ { "docid": "b58f928782a7bb0b3aa27cd568c5dfcc", "score": "0.7428081", "text": "def set?; end", "title": "" }, { "docid": "b58f928782a7bb0b3aa27cd568c5dfcc", "score": "0.7428081", "text": "def set?; end", "title": "" }, { "docid": "7dc3cc55a07234c10af7164a206bdb0c", "sc...
3b9de8f68ea3c04099bff2a3edf271e1
Not addressed yet, doesn't appear in coffescript/js
[ { "docid": "c325d7d48ce4b0c9e1f336f4f0251d5d", "score": "0.0", "text": "def set_view_draft_status\n rel_id = params[\"rel_id\"]\n status_flag = params[\"status_flag\"] == \"true\"\n contact_flag = params[\"contact_flag\"] == \"true\"\n emails_flag = params[\"emails_flag\"] == \"true\...
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.5824857", "text": "def desired; end", "title": "" }, { "docid": "a9dd648a5d0d2e7d56223e7c753f5e2e", "score": "0.58096224", "text": "def telegraphical()\n end", "title": "" }, { "docid": "792be6eadacebdee265be97...
7cbf9ca6f2827516db537f5816258c45
Remembers a charity in a persistent session.
[ { "docid": "081d9a6ad19b47a3d068f5b4f8479456", "score": "0.6586486", "text": "def charity_remember(charity)\n charity.remember\n cookies.permanent.signed[:charity_id] = charity.id\n cookies.permanent[:remember_token] = charity.remember_token\n end", "title": "" } ]
[ { "docid": "0528438d081971e7945d94236af0d81f", "score": "0.64680284", "text": "def update\n\t\tsession[:character] = @character.id\n\tend", "title": "" }, { "docid": "79a4f7d36f026f1f6465680dabaf6f62", "score": "0.6106546", "text": "def regenerate\n \t new_sid = Merb::SessionMixin...
58bc4a32a85af5eb70e1b42687cda966
Finds either a specific button, item, textH1 element. If the element is unknown, it is ignored.
[ { "docid": "b9cbfddc9e10d88079da012e182d1a4e", "score": "0.74217176", "text": "def find_elem\n begin\n $results.log_action(\"#{@action}(#{@params.join(' ')})\")\n $session.success = false\n case @params[0]\n when 'button'\n button = Button.new(@driver, @params)\n $se...
[ { "docid": "41953ddb31f4d441b0e9a0446ded56c6", "score": "0.6781396", "text": "def button_exact text\n find_ele_by_text :button, text\n end", "title": "" }, { "docid": "bbd77f73d5739bcc3bd513e64c97943d", "score": "0.65683246", "text": "def locate\n # element.all(by.partialB...