query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
cf5b9d79047edae144b6afeda1aac5a8
It creates a client
[ { "docid": "dcd76fb77861bbf4826c289f32758705", "score": "0.0", "text": "def create\n params[:client][:password_confirmation] = params[:client][:password]\n @client = Client.new(client_params)\n @client.create_adjusts\n if @client.save\n \t flash.now[:success] = \"Welcome to CareForMe! Plea...
[ { "docid": "7d9f0f3b9e3d17bfc6380ffa94857dc5", "score": "0.8854149", "text": "def create_client\n @networking.create_client\n end", "title": "" }, { "docid": "1fd2b5b0fb2ccf28a22f56a7636381ab", "score": "0.83746314", "text": "def create_client\n @security.create_client...
118c92f86ea293d625a1d8e6b3c21271
Validates the Offer's current status and sets the status as SENT, if possible. Creates an OfferEvent.
[ { "docid": "2d1bcbcdb34cea3340c458f730af1421", "score": "0.662895", "text": "def send(id)\n offer = Offer.find(id)\n if (offer.status.to_sym == :CREATED)\n offer = Offer.update(id, status: :SENT)\n # Creating SENT event\n OfferEvent.create(offer: offer, description: 'Offer sent', pr...
[ { "docid": "0de2b6429d5a37a038a7e7ad5d9facf1", "score": "0.662035", "text": "def accept(id)\n offer = Offer.find(id)\n if offer && [:SENT, :RESENT].include?(offer.status.to_sym)\n offer = Offer.update(id, status: :ACCEPTED)\n # Creating ACCEPTED event\n OfferEvent.create(offer: offe...
5f24e9467a5144745dbe297ff682d4e7
Send a notification to a user that a thread has started on an issue in their area
[ { "docid": "daed5278d824868f557af0c58bebaed4", "score": "0.64890534", "text": "def new_user_location_issue_thread(thread, user_location)\n @thread = thread\n @user_location = user_location\n @user = user_location.user\n @message = thread.first_message\n raise \"Thread does not have an iss...
[ { "docid": "7bbadbcb3b742400a9bf7a701070e4d0", "score": "0.65319294", "text": "def notify_thread_owner\n UserMailer.new_forum_post_notification(self.forum_thread.user, self).deliver unless is_start_post?\n end", "title": "" }, { "docid": "cbb5a7e0a5c1b2ba8a86d0360f205cb1", "score": "...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "4796decee45b9712a60f56f836a4ed2a", "score": "0.0", "text": "def set_skills_user\n @skills_user = SkillsUser.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6165422", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60457647", "text": "def action_hook...
5f939192928a1c7d14d241a1cb1bba9c
DELETE /code_gens/1 DELETE /code_gens/1.json
[ { "docid": "a84b5d4753884bf4688215143a1a971f", "score": "0.70296615", "text": "def destroy\n @code_gen.destroy\n respond_to do |format|\n format.html { redirect_to code_gens_url, notice: 'Code gen was successfully destroyed.' }\n format.json { head :no_content }\n ...
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.6793603", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "...
87f886492b867c7fbe114cab795afb9f
p product([1, 2, 4, 5]) 7. Write a function that takes in an array of numbers and returns the two smallest numbers.
[ { "docid": "1b80137079cc175bbd42c07f4bcd14fc", "score": "0.0", "text": "def two_smallest(numbers)\n smallest_index = 0\n smallest = numbers[smallest_index]\n i = 0\n while i < numbers.length\n if numbers[i] < smallest\n smallest = numbers[i]\n smallest_index = i\n end\n i += 1\n ...
[ { "docid": "52adeab2ed97f727f64a5e7af9cbb1ea", "score": "0.7509156", "text": "def lowest_product(input)\n if input.length < 4\n \"Number is too small\"\n else\n a = input.split(\"\").sort\n a.map! { |n| n.to_i }\n product = 1\n a[0..3].each { |n| product *= n }\n p pr...
576d20c936552d7dff13c3199810885b
enriched_key returns a metric key that will be unique for all metrics/methods from products and backends
[ { "docid": "1958352883e14b7338c0f9d5d76150d4", "score": "0.73484117", "text": "def enriched_key\n \"product.#{service.id}.#{id}\"\n end", "title": "" } ]
[ { "docid": "c2f696b0b5a9427eda3a279590072323", "score": "0.7172297", "text": "def enriched_key\n \"backend.#{backend.id}.#{id}\"\n end", "title": "" }, { "docid": "7600bde8d5968cb15a812733a4169b0e", "score": "0.6451561", "text": "def key\n key = self.name\n ...
e1250f2034ed77d602a1509d3dd898e6
Restores a VM to a previous saved state
[ { "docid": "b9b158aa3901dc74d29433d58bb7fd03", "score": "0.0", "text": "def restore(container, source_file)\n OpenNebula.log_debug \"Restoring container from #{source_file}\"\n\n container.restore source_file\n\n rescue RuntimeError => e\n raise OpenVzDriverError, \"Container #{contain...
[ { "docid": "ddbdac2cc0aaa51dec1b8b33509fec1d", "score": "0.7448044", "text": "def restore\n end", "title": "" }, { "docid": "94b69f232e5dc9052b629dad561f027c", "score": "0.735755", "text": "def restore\n end", "title": "" }, { "docid": "94b69f232e5dc9052b629dad561f027...
cd18ff2ab6c31a742a6b4313220303fa
intro of the game
[ { "docid": "9eda953bc925a31093ce1734ebfda3da", "score": "0.0", "text": "def preamble()\n size = board_size()\n choice = how_many_human_players()\n if choice == \"0\"\n \tno_human_players(size)\n elsif choice == \"1\"\n \thuman_player_and_ai(size)\n else\n \thuman_and_human_player...
[ { "docid": "896f2341ee61e678635f08ed459a9049", "score": "0.7915279", "text": "def intro\n\t\t@frame = @frame + 1\n\t\tif @frame == 1 or @frame == 40 \n\t\t\t@screen.fill([0, 0, 0])\n\t\telsif @frame == 10 or @frame == 60\n\t\t\t@map.updateBackground\n\t\t\t@map.sprites.each { |sprite|\n\t\t\t\tsprite.dr...
c54bd5b0666a4c7b6d7ddbffa9e3cc64
Remove callback that is called when the behavior is removed. The actor will still be available. remove do input_manager.unsubscribe_all self end
[ { "docid": "cc46fc159b3187bf67fd1c3204baf69d", "score": "0.0", "text": "def remove(&remove_block)\n @remove_block = remove_block\n end", "title": "" } ]
[ { "docid": "c604bd5bbcc29373a1b00105829a21f7", "score": "0.71047705", "text": "def on_remove\n _clear(:callbacks => false)\n end", "title": "" }, { "docid": "578a5cb0d6e98c41a224065e1dfe0ae8", "score": "0.66849756", "text": "def remove_behavior(name)\n @behaviors.delet...
a218580aa025865ad7cc85beffc9276a
PATCH/PUT /create_recipes_categories_join_tables/1 or /create_recipes_categories_join_tables/1.json
[ { "docid": "587a7c1062501577c257343defd88e72", "score": "0.69772637", "text": "def update\n respond_to do |format|\n if @create_recipes_categories_join_table.update(create_recipes_categories_join_table_params)\n format.html { redirect_to @create_recipes_categories_join_table, notice: \"Cr...
[ { "docid": "a839b051d4f4991b5673e1594539b966", "score": "0.6884407", "text": "def set_create_recipes_categories_join_table\n @create_recipes_categories_join_table = CreateRecipesCategoriesJoinTable.find(params[:id])\n end", "title": "" }, { "docid": "a14d3feed3d5b796fc27ae3c3b3e2ef1"...
8933f67c7e70d088f3f33f2a1ce1f3ca
DELETE /sps/1 DELETE /sps/1.json
[ { "docid": "7f72acc5210cc6e05ee4e84d4dfad91a", "score": "0.7400329", "text": "def destroy\n @sp.destroy\n respond_to do |format|\n format.html { redirect_to sps_url, notice: 'Sp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "2b14a1e87ac465825acc60a1b4a872bd", "score": "0.7299628", "text": "def destroy\n @sop = Sop.find(params[:id])\n @sop.destroy\n\n respond_to do |format|\n format.html { redirect_to sops_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "...
6e1df2e465dd203e161a93a96ef2c80e
This function reads a taxonomy file from NCBI (default: $SM_HOME/etc/ncbi_taxonomy.xml) and optionally forces an update.
[ { "docid": "35322cbd82f5568738a4f70e698be02e", "score": "0.76908463", "text": "def load_ncbi_info(update = false)\n\t\t\tdef _parse_ncbi_taxonomy(file)\n\t\t\t\tdoc = REXML::Document.new(file.read)\n\t\t\t\t\n\t\t\t\ttax = {}\n\t\t\t\ttax['id'] = []\n\t\t\t\ttax['code'] = []\n\t\t\t\t#id = []\n\t\t\t\t#...
[ { "docid": "71cfb741f808feb185a4fe4288797e52", "score": "0.74645054", "text": "def update_ncbi_info(file = nil)\n\t\t\tif length == 0\n\t\t\t\twarn \"WARNING: no taxons in the set [skipping]\"\n\t\t\t\treturn -1\n\t\t\tend\n\t\t\twarn \"* loading NCBI information\"\n\t\t\t\n\t\t\tBio::NCBI.default_email...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "77a4216e0c6d665b9011cb0c749d3ffa", "score": "0.0", "text": "def set_general\n\t @general = General.find(params[:id])\n\t end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163443", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.604317", "text": "def action_hook; ...
26029111ca63dfcc5513434ea13e9271
General messages for Shared Methods.
[ { "docid": "e407b1ff9f0f624ee266a6fecb8e5885", "score": "0.0", "text": "def formatted_current_round(current_round)\r\n letter = current_round.odd? ? 'A' : 'B'\r\n digit = (current_round + 1) / 2\r\n \"#{digit}-#{letter}\"\r\nend", "title": "" } ]
[ { "docid": "b93494472c640c05b12c482b4448e573", "score": "0.6451545", "text": "def messaging; end", "title": "" }, { "docid": "c93322a2b8f197eed03664c394d9525d", "score": "0.6381707", "text": "def shared_strings; end", "title": "" }, { "docid": "e645915e946fed44d3b1bec0457...
9ad50c5c7875135a1c9bb7d0a521f51d
Login to both OneView and ICsp
[ { "docid": "9536acc052a184845ab2fc51d424f2cc", "score": "0.0", "text": "def auth_tokens\n if @icsp_key.nil?\n puts ''\n Chef::Log.warn('ICSP wont be used to provisiong OS')\n else\n @icsp_key ||= login_to_icsp\n end\n @oneview_key ||= login_to_oneview\n { '...
[ { "docid": "75f2d1f8259b0fab724b7f5bbe899a49", "score": "0.7319842", "text": "def login ; end", "title": "" }, { "docid": "df5335d39d48d8f1c4455955f19733a5", "score": "0.7235494", "text": "def login\n\n end", "title": "" }, { "docid": "096656013ed38b7b1dbeeac711e44c18", ...
7c6031dc6acce0b966488ed4ead00885
To view the Figure
[ { "docid": "c1f230416f65522db7e7d0e871e20a53", "score": "0.7222203", "text": "def view\n Rubyplot::Plotspace.new(self).view!\n end", "title": "" } ]
[ { "docid": "630e663a21f22be69d24f888dca2d8ca", "score": "0.67520964", "text": "def plot; end", "title": "" }, { "docid": "8a2dadc47ee9f8c0d8d39f7934924b73", "score": "0.6703325", "text": "def t\n @figure_maker\n end", "title": "" }, { "docid": "03c15973cd0242bfc976493...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0d99c9fccade89e0245187ac07ceff74", "score": "0.0", "text": "def countrylanguage_params\n params.require(:countrylanguage).permit(:language, :countrycode, :slug, :isofficial, :percentage)\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...
e8b71247fa7ed7db9e73fff03106928e
Checks if a position is occupied by a ship
[ { "docid": "43420b6e6e190858dc4c876f1ea6fbc9", "score": "0.7935458", "text": "def occupied_by_ship?(pos)\n self[*pos] == \"s\"\n end", "title": "" } ]
[ { "docid": "84c951cf98ad12fbdaae3ffd9e642b16", "score": "0.80128056", "text": "def is_occupied?\n return @ship != nil\n end", "title": "" }, { "docid": "1dda4f2205d4615e5e27a3ca88ec7c97", "score": "0.79147154", "text": "def occupied?(position)\n not board.empty_at?(position)...
91261b4f012baa1144f7661da8803c40
Initialize Verification Flow for Browser Clients This endpoint initializes a browserbased account verification flow. Once initialized, the browser will be redirected to `selfservice.flows.verification.ui_url` with the flow ID set as the query parameter `?flow=`. This endpoint is NOT INTENDED for API clients and only wo...
[ { "docid": "c62d4e0b3ab201ee3bff00e77778e802", "score": "0.5789541", "text": "def initialize_self_service_verification_for_browsers(opts = {})\n initialize_self_service_verification_for_browsers_with_http_info(opts)\n nil\n end", "title": "" } ]
[ { "docid": "22a2941b525f69cd20f5cca7ddd0e4b3", "score": "0.68426055", "text": "def initialize_self_service_browser_verification_flow(via, opts = {})\n initialize_self_service_browser_verification_flow_with_http_info(via, opts)\n nil\n end", "title": "" }, { "docid": "de77725535f...
d225729e324ce787d05845075fdc55a2
GET /revoews GET /revoews.json
[ { "docid": "44ce6bf8d64b8fc9d5b2502547f5a578", "score": "0.72183555", "text": "def index\n @revoews = Revoew.all\n end", "title": "" } ]
[ { "docid": "3cccf0f9cd3f243500218464e39c59f0", "score": "0.6284332", "text": "def index\n @ewos = Ewo.all\n\t respond_with @ewos\n end", "title": "" }, { "docid": "26e73637b7c182d3e5c460c19f140005", "score": "0.6137207", "text": "def index\n @roofs = Roof.all\n\n respond_to...
6f76654dfd8b897dedba52a215db5066
Builds a namespaced controller name and action name string. class Admin::UsersController def show end end => "Admin::UsersControllershow"
[ { "docid": "23def18b8cbcc2ecb33c4872e7a16d57", "score": "0.68458474", "text": "def controller_action_name\n aci && \"#{aci.class.name}##{aci.action_name}\"\n end", "title": "" } ]
[ { "docid": "dba9ba644288b73301a2db534d089491", "score": "0.7475229", "text": "def controller_name\n\n [namespace.module_name, resource_name.plural.camelize + \"Controller\"].compact.join('::')\n\n end", "title": "" }, { "docid": "14fd4ee720a906de0aa886a88b07e227...
4c2da1402e87cefe85b53400a278b26d
The total number of marks for this grade entry form
[ { "docid": "363d8d9f5e150a86fa80954f3fcfbe91", "score": "0.61894685", "text": "def max_mark\n self.grade_entry_items.where(bonus: false).sum(:out_of)\n end", "title": "" } ]
[ { "docid": "5eb4697e2e5fdf8109697933286f9cb3", "score": "0.7684116", "text": "def total_marks\n return self.quiz_question_instances.sum(:grade)\n end", "title": "" }, { "docid": "9743ca41798a71274a281038dcefd882", "score": "0.72530717", "text": "def grade_entry_forms_submitted\n ...
16d6edcd6c79ef2c6945a77a34acf589
Return a cached placeholder literalizer for the given key if there is one for this dataset. If there isn't one, increment the counter for the number of calls for the key, and if the counter is at least three, then create a placeholder literalizer by yielding to the block, and cache it.
[ { "docid": "ac060eb1238570d2515048a342429412", "score": "0.8058994", "text": "def cached_placeholder_literalizer(key)\n if loader = cache_get(key)\n return loader unless loader.is_a?(Integer)\n loader += 1\n\n if loader >= 3\n loader = Sequel::Dataset::PlaceholderLiter...
[ { "docid": "967d47a68a44585eedb31635a972666e", "score": "0.6518992", "text": "def cached(*key)\n if cache?\n @cache[key] ||= yield\n else\n yield\n end\n end", "title": "" }, { "docid": "1f7a649aea755cda757c8c8267dae7db", "score": "0.6507158", "text": ...
286b7b87d38acd0397588b989f55590c
Default values for an object
[ { "docid": "4d238b63cc689cd4e62afce6fc8f01bc", "score": "0.0", "text": "def create_car( model, convertible=false)\n # ...\nend", "title": "" } ]
[ { "docid": "de19c51c3af8f2b7f87d063f19e973fb", "score": "0.7962466", "text": "def defaults; end", "title": "" }, { "docid": "de19c51c3af8f2b7f87d063f19e973fb", "score": "0.7962466", "text": "def defaults; end", "title": "" }, { "docid": "de19c51c3af8f2b7f87d063f19e973fb",...
27a893a495903759615da082cd384f52
DELETE /moedas/1 DELETE /moedas/1.json
[ { "docid": "8a65d50a68d37022826b61f150b13135", "score": "0.7099638", "text": "def destroy\n @moeda = Moeda.find(params[:id])\n @moeda.destroy\n\n respond_to do |format|\n format.html { redirect_to moedas_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.731419", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "b...
e1fea50781be90ead1dc967fc31d0f1b
Method is not available
[ { "docid": "397e91a404eebe7e650737e4154b6475", "score": "0.0", "text": "def update(*)\n unavailable_method\n end", "title": "" } ]
[ { "docid": "b22ea521ce6dc3254e1f74daf0331724", "score": "0.7875706", "text": "def method\n end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7300936", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd...
4e59b9c4b2b31ededdf5213868aa4ccb
GET /communities GET /communities.json
[ { "docid": "0817de89542079c3b11c84c8c8211da3", "score": "0.75077486", "text": "def index\n @communities = Community.all\n respond_with @communities\n end", "title": "" } ]
[ { "docid": "12cfd276a621a9f393fc67ede75e4bcc", "score": "0.7754252", "text": "def index\n @communities = Community.all\n render json: {items: @communities}\n end", "title": "" }, { "docid": "b932d842a9c5ace25bd44358dc536516", "score": "0.75398004", "text": "def index\n @com...
36e755d9f9a67c7071a9b91dbb195253
Determines who chooses and who guesses
[ { "docid": "6fe49c5f223cfb4e14a4ffea5a39fa7d", "score": "0.0", "text": "def assign_roles\n\t\tputs \"Do you want to guess? y/n\"\n\t\tansw = gets.chomp\n\t\tif answ == \"y\"\n\t\t\tplayer = Human.new\n\t\t\t@game_master = Computer.new(@colors)\n\t\telse\n\t\t\tplayer = Computer.new(@colors)\n\t\t\t@game...
[ { "docid": "c9df3b25e6bbaa3d789e4411eb267a33", "score": "0.74377644", "text": "def next_guess\n user_selection\n compare\n end", "title": "" }, { "docid": "92d1bf7b2ea0d0b25ab1f7f3b02c117f", "score": "0.69140893", "text": "def guesses_so_far\n end", "title": "" }, { ...
667de7feb72d68f66418e1977e03c85b
You are given a list of numbers in an array. Replace all the numbers with the product of all other numbers. Do this in O(n) time without using division.
[ { "docid": "c7d46882a85154ce842c2b5dbb9cc3b1", "score": "0.0", "text": "def productify(array)\n\nend", "title": "" } ]
[ { "docid": "22f14a892305287ea71a156c2bff66af", "score": "0.7641394", "text": "def calculate_products_of_all_other_elements(nums)\n product_of_other_elements = Array.new(nums.count, 1)\n\n nums.count.times do |i|\n nums.count.times do |j|\n next if i == j\n\n product_of_other_elements[i] =...
e592369d48cf7ea64161956dac446a42
_entry_2_xscrollcommand Callback to handle _entry_2 widget option xscrollcommand
[ { "docid": "9169e83f9365143363ef36d65f74adf5", "score": "0.8638109", "text": "def _entry_2_xscrollcommand(*args)\n\n end", "title": "" } ]
[ { "docid": "63879e00a3861dc78013ea069017dbc0", "score": "0.8341209", "text": "def _entry_1_xscrollcommand(*args)\n\n end", "title": "" }, { "docid": "63879e00a3861dc78013ea069017dbc0", "score": "0.8341209", "text": "def _entry_1_xscrollcommand(*args)\n\n end", "title": "" }, ...
72bed0935b15a107eea8c85701b247d0
Returns the list of recipients.
[ { "docid": "389ffc7402de9021dc297865ee1b666c", "score": "0.0", "text": "def users_id_user_recipients_get(id_user, opts = {})\n data, _status_code, _headers = users_id_user_recipients_get_with_http_info(id_user, opts)\n data\n end", "title": "" } ]
[ { "docid": "a14c93fab0fba23db4218ea127ace828", "score": "0.842495", "text": "def recipients\n return @recipients\n end", "title": "" }, { "docid": "a50ee9cce7bc085d69153da3b8b23bf8", "score": "0.8381586", "text": "def recipients\n ...
3df13e9caca0e1ea55356fecf0f04d61
Dumps a domain object
[ { "docid": "1e6aa899b0c003e34628fdc9ba4e1fcb", "score": "0.6319741", "text": "def dump(object)\n @attributes.each_with_object({}) do |attribute, attributes|\n attributes[attribute.field] = object.send(attribute.name)\n end\n end", "title": "" } ]
[ { "docid": "f8f96cf57130ba9dcf78708bcd901e56", "score": "0.76755893", "text": "def dump\n @mapper.dump(@object)\n end", "title": "" }, { "docid": "859fe4a47cfa69df11f23ebdd460d321", "score": "0.76049435", "text": "def dump(object)\n object.serialize\n ...
3d17216f92fc4fc1354e034197afb2da
DELETE /activity_categories/1 DELETE /activity_categories/1.json
[ { "docid": "f65fea570ccb7718758da8bd2cb271e3", "score": "0.7624298", "text": "def destroy\n # activity categories should be marked inactive rather than deleted\n # this method does NOT delete the activity category\n # @activity_category.destroy\n respond_to do |format|\n format.html { r...
[ { "docid": "3210cb00fd721dd7d310d530fda731cd", "score": "0.7818554", "text": "def destroy\n @activity_category.destroy\n respond_to do |format|\n format.html { redirect_to activity_categories_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid":...
bb242e58e491997654c1ff93e5d35d7a
P02 () Find the last but one element of a list. Example: (mybutlast '(a b c d)) (c)
[ { "docid": "3682e645c02dbfbc4c3dd281f23ec362", "score": "0.0", "text": "def list_plast(list)\n h, h1, *t = list\n if t.empty? then h1 && h\n else list_plast([h1] + t)\n end\nend", "title": "" } ]
[ { "docid": "5fd620a85c652fbcbc8f21f09a0096cb", "score": "0.8310242", "text": "def my_but_last( list )\n element_at list, length( list ) - 1\nend", "title": "" }, { "docid": "fec7c3fe821eedb53b9b9004976354ad", "score": "0.76372075", "text": "def last (*arg, arg_last)\n arg_last.resp...
eb25875f94a21ca8f31ec619c45f6e69
PATCH/PUT /categories/1 PATCH/PUT /categories/1.json
[ { "docid": "2dab09bb20ad6d4c3ca4332b81c8227f", "score": "0.0", "text": "def update\n if @task.update(category_params)\n head :no_content\n else\n render json: @task.errors, status: :unprocessable_entity\n end\n end", "title": "" } ]
[ { "docid": "d042a4b8d67e19e968d8c4f929e81e33", "score": "0.76931995", "text": "def UpdateCategory params = {}\n \n APICall(path: 'categories.json',method: 'PUT',payload: params.to_json)\n \n end", "title": "" }, { "docid": "64342e33d137990e24b5fa224c350bd3", "sc...
14de9b853f3f2ada1a992f9db8b68a33
Pass it a service and a page. Create an instance variable. Setting it to a hash and a nested hash. Inside the query there will be a site and a service.
[ { "docid": "72d4e244a8a84499266c1cd57a95f229", "score": "0.75988173", "text": "def initialize(service, page)\n @options = {query: {site: service}}\n end", "title": "" } ]
[ { "docid": "b301b9a350eb67ca21a65286c1694007", "score": "0.6763039", "text": "def initialize(service, page)\n @options = {body: {searchString: service, nextpage: page}}\n # @options = { query: {q: service} }\n end", "title": "" }, { "docid": "6b3ae7372e8ff4e326f80a0784b8c662", "sc...
d30834e5d064ab08a29c1d3f7a1ed80d
Set the database_type for this database to :impala.
[ { "docid": "841b57c538cb86065a9ab03b3addb3b0", "score": "0.81774086", "text": "def database_type\n :impala\n end", "title": "" } ]
[ { "docid": "260a30a7125d52c118e8d1a68d2beb39", "score": "0.62404823", "text": "def database_type\n adapter_scheme\n end", "title": "" }, { "docid": "a0c5a1a60809a4bf27fbe297cdbf1dcf", "score": "0.59021044", "text": "def database_type; end", "title": "" }, { "docid...
e70426f9f2507f878602bd2151af5985
Stop the currently running profilers.
[ { "docid": "65bc93699641c2b754292629ec507b21", "score": "0.68682885", "text": "def profiler_stop\n stop_perf_profiler\n end", "title": "" } ]
[ { "docid": "c36e3746a80c6aae2f457db1ed46a16d", "score": "0.67890006", "text": "def stop\n logger.info(\"Stopping thread pool invoker pollers and workers...\")\n @pollers.synchronize { @pollers.each { |p| p[:shutdown] = true } }\n end", "title": "" }, { "docid": "34dcd97bd8...
95223b0af903334b1a0838b7c1dcf198
DELETE /crops/1 DELETE /crops/1.json
[ { "docid": "1359f361da3980d0734b0c02dbf928e7", "score": "0.0", "text": "def destroy\n Image.find(params[:id]).destroy\n redirect_to :action => 'index' \n end", "title": "" } ]
[ { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.6835698", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "037dc2a1758a6c04c3ab3910204acff0", "score": "0.67774457", "text": "def destroy\n @crop.destroy\n respond_to do |format...
ecb96c0d8a3115da20c9f2024c4804aa
called (once) when the user logs in, insert any code your application needs to hand off from guest_user to current_user.
[ { "docid": "545c64046af09e8c9db6eb7d5a2b71d5", "score": "0.68391603", "text": "def logging_in\n guest_order_items = guest_user.order_items.all\n guest_order_items.each do |order_item|\n order_item.user_id = current_user.id\n order_item.save!\n end\n guest_orders = guest_user.orders...
[ { "docid": "85f9b8ef7b00b362315a712a80c23bc9", "score": "0.7653252", "text": "def logging_in\n logger.debug \"ApplicationController:logging_in >>> \"\n current_user.transfer_data(guest_user)\n end", "title": "" }, { "docid": "aaf7d1bd504ecebaca7a91ddcc18dcc1", "score": "0.7560253"...
464e300506e2fc7431c6e700505241f6
Each entry has a "click to reveal changes" link to display details in a popup These tables are nested and contain duplicate information, so it's difficult to target cells using anything but row and column numbers
[ { "docid": "23a4a02991de5c2d907cc01cfba8d6ca", "score": "0.64740926", "text": "def expect_hidden_details(details, table: nil, row: 0, column: 0)\n within(:css, \"table#{table}>tbody\") do\n find(:css, \"tr:nth-child(#{row}) td:nth-child(#{column}) a\").click\n within '.object-changes' do\n e...
[ { "docid": "88ae862909016f36b69bd032783387e3", "score": "0.5881691", "text": "def personal_info(table)\n table.raw.each do |row|\n case row[0].downcase\n when 'height'\n height.set row[1]\n when 'inches'\n inches.set row[1]\n ...
057221cb4dee3e015597fbed1e6ba2ee
Start watching for inotify file system events.
[ { "docid": "774f66a805735bdc54fc1f1edf6515f7", "score": "0.65949374", "text": "def watch!\n raise \"Cannot reopen an inotifier. Create a new one instead\" if self.closed?\n self.add_all_directories_in_background\n self.start_prim_event_loop_thread\n return self\n end", "title"...
[ { "docid": "99b9a307bcb1b5c8d928c82e24cbe740", "score": "0.7325182", "text": "def start_watch_files\n watched_files.each do |file|\n @notifier.watch(file, :modify) do\n Js2coffee.watch_file(file)\n end\n end\n end", "title": "" }, { "docid": "f8c8ce85b7fc5...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "fa8c5b182cfc9f0fec884dbb26016be0", "score": "0.0", "text": "def manufacturer_params\n params.require(:manufacturer).permit(:name, :category, :rate)\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...
0e9b5a0db40fac153964366b2186f51d
Enter payment method information by passing the apporpriate parameters for the payment method. === Parameters: _credit_card_type_:: value selected from the credit card type drop down list _credit_card_number_:: value entered into the credit card number text box _exp_month_:: value selected from the card expiration date...
[ { "docid": "5edebc6ae4622a3e19ce5ede02d55276", "score": "0.69029224", "text": "def enter_credit_card_info (credit_card_type, credit_card_number, exp_month, exp_year, sec_code)\n $tracer.trace(\"GameStopMobileDSL : #{__method__}, Line : #{__LINE__}\")\n chkout_credit_card_selector.value = credit_ca...
[ { "docid": "03348eefa0d0f671211002db44316442", "score": "0.6785271", "text": "def enter_credit_card_info (credit_card_type, credit_card_number, exp_month, exp_year, sec_code)\n if credit_card_type != \"PowerUp Rewards Credit Card\"\n chkout_credit_card_selector.value = credit_card_type\n ch...
f95024585293b2719615bddcde5a0cfe
Choppy cursor movement during a tactical battle
[ { "docid": "282a7466272621aa9aaebde92e4c02e7", "score": "0.79356253", "text": "def choppy_movement_tb\n @tb_grid_mv = @tb_grid_mv == 3 ? 0 : @tb_grid_mv + 1\n if TactBattleManager.tact_battle? && @tb_grid_mv == 2 \n Sound.play_cursor if Input.dir4 > 0 && @x == @real_x && @y == @real_y\n ...
[ { "docid": "01c8c8c894f0a715f7db24fdb8ed63a1", "score": "0.6934202", "text": "def update_cursor\n cursor_rect.set((@index % 2) * DELTA_X, (@index / 2) * DELTA_Y)\n $game_system.se_play($data_system.cursor_se)\n end", "title": "" }, { "docid": "c5bac8c06a6c91aba6633df1694888e4", ...
aa541d34622e2196221b771af36dcbfc
FIXME: Add into purugin API's somewhere
[ { "docid": "db683c9fd54f5fff13e8d2c83899d278", "score": "0.0", "text": "def creature_type(name)\n puts \"Looking for name #{name}\"\n org.bukkit.entity.EntityType.from_name(name.to_s)\n end", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.72458345", "text": "def private; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.6332224", "text": "def probers; end", "title": "" }, { "docid": "2d8d9f0527a44cd0febc5d6cbb3a22f2", ...
f378df9f52cede9e8a20010e220a7f26
GET /log_load_times/1 GET /log_load_times/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "a87588a9963b1fea6a7ecb6ee3a1bb4e", "score": "0.7551682", "text": "def index\n @log_load_times = LogLoadTime.all\n end", "title": "" }, { "docid": "07ab453bf3eb5d20d88c36b61aeef460", "score": "0.66421443", "text": "def log_load_time_params\n params.fetch(:log_load...
166d9ba8b5de7b7209a641c135eb6130
PATCH/PUT /usuarios/1 PATCH/PUT /usuarios/1.json
[ { "docid": "6f417da5eb0577f921c5110d27735f6b", "score": "0.65055186", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuario was successfully updated.' }\n format.json { render :show, status: :ok, loc...
[ { "docid": "9d91fe8ffe79c0ce9f854a7339dc24d6", "score": "0.7048126", "text": "def update\n #response.headers['Content-Type'] = 'application/json'\n\n if Usuario.exists?(params[:id])\n usuario = Usuario.find(params[:id])\n n_param = JSON.parse(request.body.read)\n\n #request.req...
a3ebb0b3a205f213db71327afe1f7032
adding an item to queue
[ { "docid": "d78f012f3b2effa6f71aa82fea5c7cbc", "score": "0.7972229", "text": "def add(val)\n\t\t@queue << val\n\tend", "title": "" } ]
[ { "docid": "1f129b8b963c0b490b4476480fc7358b", "score": "0.8645719", "text": "def push item\n @queue.push item\n end", "title": "" }, { "docid": "f8934fedbf1b9534642247e8ffc80048", "score": "0.8434174", "text": "def enqueue(item)\n @queue.append(item)\n end", "title": "...
596ed5536284cbef1f6a779c99452f9f
Used to invoke the command.
[ { "docid": "5d78c3be49c756559e1c0b64bb0f2d14", "score": "0.0", "text": "def execute_command(argv=ARGV)\n QuickCLI.run(self, argv)\n end", "title": "" } ]
[ { "docid": "88abbe24c823730f7785af58f4ad1208", "score": "0.8252208", "text": "def invoke_command(command, *args); end", "title": "" }, { "docid": "af44e41d345834584f1af612480b0d7a", "score": "0.81951743", "text": "def call\n @command.call\n end", "title": "" ...
9fa565d04b4e1b1a81329cc39c3d1c5e
GET /services/1 GET /services/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "eeaeaa12cf77a12f32bab1ca39002ccb", "score": "0.75270754", "text": "def index\n endpoint(get(services_url).body)\n end", "title": "" }, { "docid": "09df2be842a22a8bf2c06dda5c18923d", "score": "0.7477992", "text": "def service(id)\n request :get, \"/services/#{id...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "989394e6825a471dd333e1a002f0619f", "score": "0.0", "text": "def set_number\n @number = Number.includes(:sequence).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...
6a3f13b2807bce733d9af0c89f7ea013
The root page if one exists
[ { "docid": "2878a76570057b658761283f651f334f", "score": "0.0", "text": "def root\n where(:parent_id => nil).first\n end", "title": "" } ]
[ { "docid": "f836d5935a6964d17f0b48f420845afe", "score": "0.7535091", "text": "def root\n page.root\n end", "title": "" }, { "docid": "65832bc24dbd2291e23460759995bd10", "score": "0.7491186", "text": "def root_page?\n true if link == '/'\n end", "title": "" }, { ...
ccd9c54b451b8f5c8a3186fcaf47e8d1
override set locale to all url
[ { "docid": "c04148087da76d5f38cc01ee4219c8b5", "score": "0.0", "text": "def default_url_options(options = {})\n {locale: I18n.locale == I18n.default_locale ? nil : I18n.locale}.merge options\n end", "title": "" } ]
[ { "docid": "0dd1ce015cc939f3402402fb67a3227e", "score": "0.7688486", "text": "def url_options\n { locale: I18n.locale }.merge(super)\n end", "title": "" }, { "docid": "0dd1ce015cc939f3402402fb67a3227e", "score": "0.7688486", "text": "def url_options\n { locale: I18n.locale }.m...
47029692ac309550ad1786b0895fdb6a
PATCH/PUT /robots/1 PATCH/PUT /robots/1.json
[ { "docid": "8161d192530b5fbe14ac8f870b20f0cf", "score": "0.0", "text": "def update\n @robot = Robot.new robot_params\n @robot.ends_at = Time.now + params[:robot][:ends_at].to_i\n @service = ActivateRobot.new\n if @service.create @robot\n #redirect_to auction_path(params[:auction_id]), n...
[ { "docid": "f94a98d0fdf56adc94eadc60fddc11e9", "score": "0.62897867", "text": "def update\n respond_to do |format|\n if @api_bottle.update(api_bottle_params)\n format.html { redirect_to @api_bottle, notice: 'Bottle was successfully updated.' }\n format.json { render :show, status: ...
0c5659654ce7c8ed14a1f4ec3062c9dd
Set the value of the NumberOfDays input for this Choreo.
[ { "docid": "c1fd6fe9df2a7550efb4089e93142ae5", "score": "0.74688816", "text": "def set_NumberOfDays(value)\n set_input(\"NumberOfDays\", value)\n end", "title": "" } ]
[ { "docid": "350d737a683d11115d794728539245d5", "score": "0.7024975", "text": "def set_NumberOfDays(value)\n set_input(\"NumberOfDays\", value)\n end", "title": "" }, { "docid": "350d737a683d11115d794728539245d5", "score": "0.7024975", "text": "def set_NumberOfDays(val...
fecdb32d8b48856465de6b8a23d95a77
Set a given version to be the authoritative version for all defined stores
[ { "docid": "7b83f4c08e218e486f4ce9a45169cd0b", "score": "0.78858733", "text": "def set_all!(authoritative_version)\n versions.each do |version|\n version.store.set!(authoritative_version)\n end\n end", "title": "" } ]
[ { "docid": "ce3da8fa08511a1f0c918a2e4b7a2b46", "score": "0.6171725", "text": "def set_version; end", "title": "" }, { "docid": "2f95d253162f250b709ff7b8b72f7fe1", "score": "0.60160685", "text": "def version=(version); end", "title": "" }, { "docid": "2f95d253162f250b709ff...
f6400fcd8fcfe28d8af9dba207988d09
Function uses a process type to determine which Tracking table to access then collects all the statistics information in a nested SQL statement
[ { "docid": "ca8db109e22b42a922dd9d74758fe9b1", "score": "0.53357977", "text": "def count_requests(process_type, year, options={})\n # Select the table\n case process_type\n when \"Borrowing\"\n table = Illiad::Tracking\n when \"Lending\"\n table = Illiad::LendingTracking\n when ...
[ { "docid": "d5e604f025b71d4b4d1ce683ff64bc31", "score": "0.5921877", "text": "def capture_query_stats\n # get database names\n pg_databases = {}\n config[\"databases\"].each do |k, _|\n pg_databases[k] = with(k) { execute(\"SELECT current_database()\").first[\"current_datab...
8abbb06fba79b4e65f532da3129c652d
GET /day_bookings/1 GET /day_bookings/1.json
[ { "docid": "913241e35fc1059da3e3385c3b3ae39e", "score": "0.0", "text": "def show\n if logged_in_as_employee?\n\n @day_booking = DayBooking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @day_booking }\n end\n\n ...
[ { "docid": "a2f20826bceabb3991159e61225aa790", "score": "0.6892858", "text": "def booking(booking, options = {})\n get(\"bookings/#{booking}\", options).pop\n end", "title": "" }, { "docid": "ac8355d07e1353ac36659b08db8f2002", "score": "0.68182594", "text": "def index\n ...
717cd432a54392b331029fa5b7c0159d
Given a vector UID, returns the corresponding Frequent Item ID
[ { "docid": "b3633c3504ba29900b7b76a15072802b", "score": "0.67346203", "text": "def get_freqitem_id(vector_id)\n\n # TODO\n raise 'error' if @freq_one_itemsets.nil?\n\n @freq_one_itemsets[vector_id].first.freq_item_id \n end", "title": "" } ]
[ { "docid": "fc6e89d6a06d0b14b9fee7738bac7b68", "score": "0.55324835", "text": "def get_free_uid(search_limit = 1000)\n uid = nil\n base_uid = new_resource.system ? 200 : 501\n next_uid_guess = base_uid\n users_uids = run_dscl(\"list\", \"/Users\", \"uid\")\n ...
8c1e1a3475274781dbde3742f9b2bdeb
Returns a list of all the users and their information including Datameer version, user name, email address, active/inactive, expiration date, group(s), and role(s).
[ { "docid": "da641a97a89ca89deaca45622270ef86", "score": "0.6757678", "text": "def get_users\n self.class.get(\"#{@url}/rest/user-management/users?maxResults=1000\", basic_auth: @auth)\n end", "title": "" } ]
[ { "docid": "64a5fabad6696b9341c55818473e710c", "score": "0.75267214", "text": "def list_users\n GoodData::Domain.list_users(name)\n end", "title": "" }, { "docid": "f93472e8504d81a7437d0ec189176618", "score": "0.7498519", "text": "def get_users\n ret = @ds.retrieve_all_u...
2646caba91c290fbcf2c48b358c0e0e0
This action show all games
[ { "docid": "0672fb78d635770a7fc730748f4f631f", "score": "0.0", "text": "def index\n @games = Game.all\n respond_to do |format|\n format.html\n format.json { render :json => @games }\n format.xml { render :xml => @games }\n format.csv { render :csv => @posts }\n format.js\n...
[ { "docid": "4b235777f5bc71308738e1e9cfef3f1c", "score": "0.8380403", "text": "def index\n @games = Game.get_all_active\n end", "title": "" }, { "docid": "020f78f7aa04b20213c9f494adbac582", "score": "0.836085", "text": "def index\n\t\t@games = Game.all\n\tend", "title": "" }...
e4b440770501250033e6f7215ccae7e6
Add an ASCII alias for an emoji Used similarly to `add_shortname_alias`. Returns true if the key was added, false if it already existed.
[ { "docid": "7839efd7a269c188a2bc0036959140b1", "score": "0.7875384", "text": "def add_ascii_alias(emoji_alias, codepoints)\n return false unless map_emoji(emoji_alias, codepoints)\n @ascii_aliases << emoji_alias\n\n build_emoji_regexp if @initialized\n return true\n end"...
[ { "docid": "a59965f041bc17ad663f5b1431ba34c9", "score": "0.76070225", "text": "def add_shortname_alias(emoji_alias, codepoints)\n return false unless map_emoji(emoji_alias, codepoints)\n @shortname_aliases << emoji_alias\n\n build_emoji_regexp if @initialized\n return true\n ...
dffe0ed0ce7b2f755ba2d3754309077d
def select_category_from_projects "SELECT category FROM projects;" end Make sure each ruby method returns a string containing a valid SQL statement.
[ { "docid": "7aede1eace3e9ad412cc92d3c8d63224", "score": "0.0", "text": "def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_title\n \"SELECT projects.title, SUM(pledges.amount) \n FROM pledges\n INNER JOIN projects\n ON projects.id = pledges.project_id \n GROUP BY pr...
[ { "docid": "03c5c84d5a69ee78a061f3374b5d0ed1", "score": "0.7242144", "text": "def selects_the_category_names_and_pledge_amounts_of_all_pledges_in_the_music_category\nsql = <<-SQL\nSELECT projects.category, pledges.amount \nFROM projects \nINNER JOIN pledges\non projects.id = pledges.project_id\nWHERE pr...
5a72645c98cf6b00e81dcba84eb61f1b
PATCH/PUT /representant_locataires/1 PATCH/PUT /representant_locataires/1.json
[ { "docid": "90c05ee5796bed2d9019080a01e76e11", "score": "0.7472227", "text": "def update\n respond_to do |format|\n if @representant_locataire.update(representant_locataire_params)\n format.html { redirect_to @representant_locataire, notice: 'Representant locataire was successfully update...
[ { "docid": "a1e89d36bbf683205604397fe58c997c", "score": "0.69508636", "text": "def update\n respond_to do |format|\n if @locataire.update(locataire_params)\n format.html { redirect_to @locataire, notice: 'Locataire was successfully updated.' }\n format.json { render :show, status: ...
74a3dbf58034c4c096f3a5ce8dd37bb3
Seeing how many stops there are
[ { "docid": "be2b04335d50a2944e3cebba19c3c6b9", "score": "0.6588692", "text": "def stops(starting_line, starting_station, ending_line, ending_station)\n # get the index of the starting station\n starting_station_index = starting_line.index(starting_station)\n starting_station_index_Park = starting_lin...
[ { "docid": "e306b89cfe24542226733c1c7eab6be5", "score": "0.84822416", "text": "def stop_count\n stops.size\n end", "title": "" }, { "docid": "f967449266e98fdde3d9b378e57421f5", "score": "0.7561062", "text": "def num_of_stops = mbta.calculate_stops('Red', 'South Station', 'Gre...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "a32260d44afdbf1e2c3cbd0e1aa7031d", "score": "0.0", "text": "def checking_params\n params.require(:checking).permit(:first_name, :last_name, :email, :phone, :additional_comments)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
31dd51307f7173a6e7aacae3c0738ada
Status changes allowed: Unpaid => Pending or Rejected (To set paid you have to set paid the full statament) Pending => Unpaid or Rejected Suspicious => Unpaid or Rejected Rejected => Pending or Unpaid Paid => no change allowed, flag unpaid the full statement before
[ { "docid": "bfedc368be81d38ef3fae0ca30d4e645", "score": "0.0", "text": "def provider\n authorization.provider\n end", "title": "" } ]
[ { "docid": "681c2ce88da998ad8c4156cb5c448278", "score": "0.7250143", "text": "def only_update_status_from_pending\n\t if changed.length > 1\n\t\t errors[:base] << 'You cannot modify this invitation.'\n\t\t return\n\t\t end\n\t\t\told_status = changed_attributes['status']\n\t\t\tif old_status !...
a592f1218c827a9bc4037193c12f1b05
Visit an GreaterThan predicate
[ { "docid": "7bb37f937ed194e4b408bb319f3cb97c", "score": "0.7814118", "text": "def visit_axiom_function_predicate_greater_than(greater_than)\n binary_infix_operation_sql(GREATER_THAN, greater_than)\n end", "title": "" } ]
[ { "docid": "04804d62175e764f7e44b35c4ec9823a", "score": "0.7397928", "text": "def greater_than(value)\n gt(value)\n end", "title": "" }, { "docid": "d932662948255679209a42de5cf2eb63", "score": "0.7348216", "text": "def visit_Arel_Nodes_GreaterThan o, collector\n {\n ...
1878510d585de236204f0731f5ed7804
Returns the value of time as an integer number of seconds since epoch
[ { "docid": "2f4543c2e43354b7c6143d83e577efe4", "score": "0.7980138", "text": "def to_i\n @time.getMillis / 1000\n end", "title": "" } ]
[ { "docid": "56ed1439a57f0c4a9fd55c749b0725c6", "score": "0.8062489", "text": "def to_i\n @time / ONE_SECOND\n end", "title": "" }, { "docid": "e7afd7e7e971671c753a99380374e042", "score": "0.8028286", "text": "def to_i\n seconds_since_unix_epoch.to_i\n end", "title": "...
a29f7527aefc8e5b2979874793e3bf8e
Returns a float representing the amount of time passed since the first consecutive attempt of this state
[ { "docid": "644c0150a87532b449f2b3dd0fb377b6", "score": "0.7587735", "text": "def time_spent_attempting_state(state, options)\n states = retries_for_state(state, options)\n if states.empty?\n 0\n else\n Time.now.to_f - states.last[:transitioned_at].to_f\n en...
[ { "docid": "8761e05cb746dd9bc1fcafee1c6986ba", "score": "0.68730456", "text": "def duration_of_stay\n duration_of_stay = (@check_out - @check_in).to_i\n return duration_of_stay\n end", "title": "" }, { "docid": "b2bbbd973a3f4a33153353c8dc71a5c1", "score": "0.6837055", "t...
bceb5b162a56093ac57ea6aaf3e8a06a
Test a bug in name resolution: was failing to recognize that "Genus species (With) Author" was recognized even if "Genus species" was already in the database.
[ { "docid": "d3c28dad9b56f4569c5a86b37502ee39", "score": "0.0", "text": "def test_create_naming_fill_in_author\n params = {\n :id => observations(:coprinus_comatus_obs).id,\n :name => { :name => 'Agaricus campestris' },\n }\n login(\"dick\")\n post(:create_naming, params)\n asser...
[ { "docid": "35b5771e7d86e2f6474d99588b860555", "score": "0.69948435", "text": "def test_names_from_string\n\n # Coprinus comatus already has an author.\n result = Name.names_from_string(\"Coprinus comatus v. bogus (With) Author\")\n assert_equal 3, result.length\n assert_equal nil, result[0]...
745f03af2f3560f2056f4e05423c421d
try dynamically finding a provider based on querying the providers to see what they support
[ { "docid": "45d48560ef658c52023b56afb8ac79f1", "score": "0.6058874", "text": "def maybe_dynamic_provider_resolution(resource, action)\n Chef::Log.debug \"Providers for generic #{resource.resource_name} resource enabled on node include: #{enabled_handlers}\"\n\n # Get all the handlers in the pr...
[ { "docid": "ac0129fb207a6981055f6a9f5c48f9bf", "score": "0.7278102", "text": "def get_service_provider(provider)\n case provider.class.to_s\n when 'Fixnum' then provider_by_id(provider)\n when 'String' then (provider.to_i > 0 ? provider_by_id(provider)...
01ba3d02dd9d875a8da801eccf5cf3ae
method to get the total of all the rents
[ { "docid": "af8b8784c3d788c424137a341368ca6f", "score": "0.0", "text": "def collect_rents\n # collect an array of all the apartment prices\n # then reduce them to one number\n @apartments.collect{ |apt| apt[:apartment].price }.reduce(:+)\n end", "title": "" } ]
[ { "docid": "497986ffb1b9148209363800d55b97b6", "score": "0.7746505", "text": "def total\r\n\t\tthe_total = 0\r\n\t\titems.each do |cur_item|\r\n\t\t\tthe_total += cur_item.total\r\n\t\tend\r\n\t\tthe_total\r\n\tend", "title": "" }, { "docid": "429deb375ebc989058d55ac12dc17352", "score": ...
f9a7384930451638312da04d294afe64
Redirect to hashed URLs unless the path is excepted. Store the URL that we are redirecting to in the session. If we then have a request for the root URL we know to render this URL instead. If redirecting back to the referer, use the referer in the AjaxInfo header because it includes the hashed part of the URL. Otherwis...
[ { "docid": "a9eac135e72ae370d91a517c24075cda", "score": "0.0", "text": "def redirect_to_full_url_with_ajax(url, status)\n if !_ajax_redirect(url)\n redirect_to_full_url_without_ajax(url, status)\n end\n end", "title": "" } ]
[ { "docid": "b492e338d8135ea3e6cdd4e70c3bc7d1", "score": "0.7118625", "text": "def _ajax_redirect(url)\n return false if url.nil? || !Ajax.is_enabled?\n special_redirect = false\n original_url = url\n\n # If we have the full referrer in Ajax-Info, use that because it\n # includes...
b0668e4b9970842267de87efec2aacb5
Retrieves dimensions for image assets
[ { "docid": "0cfe85e0788dff2ef3579a6e0ba3410a", "score": "0.6948191", "text": "def extract_dimensions\n tempfile = image.queued_for_write[:original]\n unless tempfile.nil?\n geometry = Paperclip::Geometry.from_file(tempfile)\n width = geometry.width.to_i\n height = geometry.height.to...
[ { "docid": "343d7e62b84edf2d1df0f7b8ce81b618", "score": "0.83938694", "text": "def dimensions\n @dimensions ||= begin\n img = FastImage.size(asset.filename.to_s)\n\n {\n width: img.first,\n height: img.last,\n }\n end\n rescue => e\n ...
6a6a3a532fe257f772e7361cbf4b1ba7
Refresh account payment methods
[ { "docid": "a85e7bb672fb803e29829f6181af5c33", "score": "0.6838203", "text": "def refresh_payment_methods(account_id, opts = {})\n refresh_payment_methods_with_http_info(account_id, opts)\n return nil\n end", "title": "" } ]
[ { "docid": "648d8d9259eb792fce35d99f8202baf2", "score": "0.67166024", "text": "def get_payment_methods(kb_account_id, refresh_from_gateway = false, properties, context)\n options = properties_to_hash(properties)\n @payment_method_model.from_kb_account_id(kb_account_id, context.tenant_i...
459f8d06b3f7dbbed323be5098363ac2
check to see if files within object has hierarchy (i.e. paths in filenames)
[ { "docid": "795b875aac571614f432f7f0fb19ecbc", "score": "0.87781775", "text": "def object_has_hierarchy?\n filepaths.any?(/\\/+/)\n end", "title": "" } ]
[ { "docid": "eab4fbabff3ae9649e177ed436bbcad5", "score": "0.69966555", "text": "def object_files_exist?\n return false if object.object_files.empty?\n\n object.object_files.map(&:path).all? { |path| File.readable?(path) }\n end", "title": "" }, { "docid": "343fb527c5e289d1b1d150eb35c55...
e16c291b14706dae05af4345b4227409
new array where every word from the original array has an exclamation point after it. Steps create an empty array setup two temp variables to store the new strings construct the new string insert the new string into the empty array My Attempt
[ { "docid": "a0c84923ecbe98aee8eaf98d49dd3f9d", "score": "0.6471032", "text": "def yell(words)\n\twords_bang = []\n\n\ti = 0\n\twhile i < words.length\n\t\twords_temp = words[i]\n\t\twords_new = words_temp + '!'\n\n\t\twords_bang << words_new\n\n\t\ti += 1\n\tend\n\t\n\treturn words_bang\nend", "tit...
[ { "docid": "78cddfb8da80f55b301182e3c57b53e9", "score": "0.68457913", "text": "def yell(words) # DEFINE METHOD WITH ONE PARAM\n \n i = 0 # SET FIRST INDEX VALUE\n \n new_array = [] # CREATE AN EMPTY ARRAY\n \n while i < words.length # WHILE LOOP THAT CHECKS IF I IS LESS THAN THE ARRAY LENGTH\n ...
02c3acf1cf29004538b50f1212988eb2
Decide whether this is a new encounter or not. It's not really foolproof. We're doing something crude like; An encounter starts when a subtitle of a language occurs within a given window of time since the last subtitle of that language.
[ { "docid": "79c8443851ab6953e623e481eb352fec", "score": "0.7487668", "text": "def new_language_encounter?\n # Well it's *definitely* true if there's absolutely no records\n # of this language yet.\n return true unless @encounters.key? @sub[:language]\n\n # Crudely define a repeat encounter o...
[ { "docid": "dc10200260f3fa7ab1a7c8eb03a48cf6", "score": "0.596714", "text": "def in_the_past?\n race_datetime < DateTime.current\n end", "title": "" }, { "docid": "2020ba4e209bc3a385639bae6331ef92", "score": "0.588702", "text": "def is_the_game_new\n if Game.count == 1\n ...
066675d4dedb4f6f6bebce652b9d552f
Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results.
[ { "docid": "b8d3782e43728761ede725c68d7545d6", "score": "0.0", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = LookupPaymentResultSet.new(resp)\n return results\n end", "title": "" } ]
[ { "docid": "ea872306361fc864408e8279b0199bbe", "score": "0.7595022", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bf6609d69b18cbe3a5f620c672c2cbbf", "score": "0.7...
f8aef7adf551899ff18f2eec4b03eac4
Can this be a daily highlight?
[ { "docid": "3ad99df450e04a299a0fcf210c3bd1f1", "score": "0.54245025", "text": "def is_highlight?\n contexts.flag6 == 1\n end", "title": "" } ]
[ { "docid": "04fd9a9f5bef09585b3f1f72136de038", "score": "0.7279653", "text": "def highlights; end", "title": "" }, { "docid": "04fd9a9f5bef09585b3f1f72136de038", "score": "0.7279653", "text": "def highlights; end", "title": "" }, { "docid": "04fd9a9f5bef09585b3f1f72136de0...
de934dd7a56cdab19ee6ac6a9b9d11a4
PUT /design_detail_subcategory_fields/1 PUT /design_detail_subcategory_fields/1.xml
[ { "docid": "ecddba5d53b223f8d5a6d0bf0a454097", "score": "0.7527838", "text": "def update\n @design_detail_subcategory_field = DesignDetailSubcategoryField.find(params[:id])\n\n respond_to do |format|\n if @design_detail_subcategory_field.update_attributes(params[:design_detail_subcategory_fie...
[ { "docid": "ff16d9ae9ca67955c145461815ab45ec", "score": "0.6570974", "text": "def update\n @baseline_characteristic_subcategory_field = BaselineCharacteristicSubcategoryField.find(params[:id])\n\n respond_to do |format|\n if @baseline_characteristic_subcategory_field.update_attributes(params[...
3c748c960d6fd56c0b255d478e4f346f
Attempt to retrieve a cert, if we don't already have one.
[ { "docid": "e44e552b2373ea6c51542724009ad70a", "score": "0.5999674", "text": "def wait_for_cert(time)\n begin\n return if certificate\n generate\n return if certificate\n rescue StandardError => detail\n Puppet.log_exception(detail, _(\"Could not request certificate: %{message}...
[ { "docid": "d14d05e56373f1f68c82b50d00055c92", "score": "0.7529309", "text": "def get_cert_or_nil(path)\n return OpenSSL::X509::Certificate.new(File.read(path)) if File.exist?(path)\n end", "title": "" }, { "docid": "a0aeca242137211925ab89738da4f03f", "score": "0.70302975", ...
2fd3c6578e17db913762a3014f534718
sl = starting line, ss = starting stop, el = endling line, es = ending stop
[ { "docid": "e5484430ce9ccf2dc1fbd8168b718a9b", "score": "0.0", "text": "def plan_trip(sl, ss, el, es)\n#This is the case for same line travel\n if sl == el\n index_ss = $routes[sl].index(ss)\n index_es = $routes[el].index(es)\n total_stops = (index_es - index_ss).abs\n if index_ss < index_e...
[ { "docid": "4867e25c4ad2219e74f1a7a7ea4df260", "score": "0.6393435", "text": "def start_line; end", "title": "" }, { "docid": "4867e25c4ad2219e74f1a7a7ea4df260", "score": "0.6393435", "text": "def start_line; end", "title": "" }, { "docid": "4867e25c4ad2219e74f1a7a7ea4df2...
b037e8cae6963305372f2be048724548
Can't use Motion::Project::App.setup because it runs before archive:distribution sets the build mode
[ { "docid": "eb50820cbdb0ff1dca148fd024221395", "score": "0.0", "text": "def set_provisioning_profile(app)\n app.development do\n puts 'Provisioning for development'\n if ENV['IOS_APP_DEVELOPMENT_PROFILE_ID']\n app.provisioning_profile = get_provisioning_profile_for(ENV.require('IOS_APP_DEVEL...
[ { "docid": "a1446a798c04451f9f5959caaeece53d", "score": "0.6616222", "text": "def run!\n project.mode = :release\n\n # Validate paths\n validate_paths!\n\n # Extract mockup\n copy_source_path_to_build_path!\n\n validate_stack!\n\n # Run stack\n run_stack!\n\n ...
bff866c5479784777fada0c99d09d6d2
adds one to the user's current integer value and returns the updated user entity.
[ { "docid": "02a72e7aa17a4b8c81a86efd69400d16", "score": "0.7234624", "text": "def increment_integer(user_id)\n user = User.find user_id\n user.integer_value += 1\n user.save\n\n user\n end", "title": "" } ]
[ { "docid": "62efc75930fb53e420ac3940f282b188", "score": "0.6203247", "text": "def set_key\n last_key = User.find_by_sql('select max(userId) as maxid from user')[0].maxid\n self.userId = last_key.to_i + 1\n end", "title": "" }, { "docid": "1006d7b4419af748e62b40090f2b0dc3", "score"...
ea9b4ff60eca7f13f75ee525cd6596d4
GET /gclasses/new GET /gclasses/new.json
[ { "docid": "fd0f7909a8b47203e042b110bfacc603", "score": "0.80532765", "text": "def new\n @gclass = Gclass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gclass }\n end\n end", "title": "" } ]
[ { "docid": "6a3008cd367bd3219b2ece85db051425", "score": "0.75737816", "text": "def create\n @gclass = Gclass.new(params[:gclass])\n\n respond_to do |format|\n if @gclass.save\n format.html { redirect_to @gclass, notice: 'Gclass was successfully created.' }\n format.json { render...
ab03cdd32bc3da2abcbdb069b25c1590
GET /responses GET /responses.json
[ { "docid": "f775827dab658a4aa8edfdb4ca871b02", "score": "0.6590941", "text": "def index\n @responses = Response.all\n puts \"\\n\\n\\n\\nyo dude I think its working \\n\\n\\n\\n\"\n end", "title": "" } ]
[ { "docid": "8133969096a3630059fa46752740d5ff", "score": "0.7443134", "text": "def responses\n question=Question.find(params[:questionId])\n render :json=> question.response\n end", "title": "" }, { "docid": "b8e0862accab7b89d3ab1dd6752fbc12", "score": "0.72303295", "text": "de...
0ce9691504181121f333a32b71003b70
GET /webservicetolistens/new GET /webservicetolistens/new.json
[ { "docid": "ab72b62ce4229e5623bdad7c97439864", "score": "0.7655535", "text": "def new\n @webservicetolisten = Webservicetolisten.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @webservicetolisten }\n end\n end", "title": "" } ]
[ { "docid": "b6467ce1ed4df85e2597cd46521f28f7", "score": "0.6832218", "text": "def create\n @webservicetolisten = Webservicetolisten.new(params[:webservicetolisten])\n\n respond_to do |format|\n if @webservicetolisten.save\n format.html { redirect_to @webservicetolisten, notice: 'Webser...
0525d20fa4323bc0807ef1b65b341a17
Create or update DHCP static binding If binding with the bindingid is not already present, create a new DHCP static binding instance. If it already exists, replace the existing DHCP static binding instance with specified attributes.
[ { "docid": "52b8fe59243a66c0151eba78d19f621d", "score": "0.6523365", "text": "def patch_infra_segment_dhcp_static_binding_0(segment_id, binding_id, dhcp_static_binding_config, opts = {})\n patch_infra_segment_dhcp_static_binding_0_with_http_info(segment_id, binding_id, dhcp_static_binding_config, o...
[ { "docid": "6121996ceb00bae9886df86ab7f10b54", "score": "0.71091276", "text": "def update_dhcp_static_binding(server_id, binding_id, dhcp_static_binding, opts = {})\n data, _status_code, _headers = update_dhcp_static_binding_with_http_info(server_id, binding_id, dhcp_static_binding, opts)\n da...
c6fb1413de46b6d5aefd2ccb871ebd2b
Returns the code of the node with node_city
[ { "docid": "8ae8c69e494ff63339aae51854abac19", "score": "0.73729", "text": "def get_node_name(node_city)\n @nodes[node_city].name\n end", "title": "" } ]
[ { "docid": "b3e6c8135abe844521f98fdda03d40f2", "score": "0.7747722", "text": "def get_node_country(node_city)\n @nodes[node_city].country\n end", "title": "" }, { "docid": "793dc799822c962d5ce3fe96439ca6bf", "score": "0.74039847", "text": "def get_node_continent(node_city)\...
9d3284af90cfafee5577e315d86c9de4
PUT /value_sets/1 PUT /value_sets/1.json
[ { "docid": "32877ee32904672170c4fda505b75053", "score": "0.69622964", "text": "def update\r\n @value_set = ValueSet.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @value_set.update_attributes(params[:value_set])\r\n format.html { redirect_to @value_set, notice: 'Value set was ...
[ { "docid": "4f349a0891e0cf7d988694e4c98f5224", "score": "0.677557", "text": "def sync_value_sets()\n logger.debug \"Sync valuesets \"\n #get all of the versions and valuesets and map them together\n #this is cleaner and easier than getting the vs and the getting all of it's versions\n # sepa...
e1f99c86bc41599ff7a3ea28f4d0dfd1
:location, presence: true confirm if location validated here has_many :locations logic here from the "Bored? Games!" User model
[ { "docid": "36742751f2c270954d6eab5878c5b70d", "score": "0.0", "text": "def votes\n v = []\n Vote.where(snack: self).each do |vote|\n v << vote\n end\n v.count\n end", "title": "" } ]
[ { "docid": "ef48951683640700ffc89bed84e4c543", "score": "0.7144779", "text": "def validate_associations\n errors.add :location_id, :doesnt_exist if @location.nil? && self.location_id.present?\n end", "title": "" }, { "docid": "3a48c0b9567318fe9396853291301fc6", "score": "0.69221354",...
c0341fddc068407e66e4c7c1173cabc6
is there a user logged in?
[ { "docid": "3a8a93c099b1d03003fa3ae7825cfdfe", "score": "0.0", "text": "def logged_in?\n !loggedin_user.nil?\n end", "title": "" } ]
[ { "docid": "4d66ee4f19ef7a74bdda55e8eac57564", "score": "0.86242706", "text": "def user_is_logged_in()\n user = get_user()\n if user != nil\n true\n else\n false\n end\n end", "title": "" }, { "docid": "bc6d265a7a5888e058b2fa6c82c62b27", "score": "0.84441096", ...
eb4aeb0486816c216a4ba8d0e12aae59
GET /time_entries/1 GET /time_entries/1.xml
[ { "docid": "72666347ad266e04a57e90c3edba64a9", "score": "0.69243264", "text": "def show\n @time_entry = TimeEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @time_entry }\n end\n end", "title": "" } ]
[ { "docid": "4225a7d02fa86769f529491587ae8245", "score": "0.6919692", "text": "def show\n @time_entry = TimeEntry.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @time_entry }\n end\n end", "title": "" }, { "doc...
14b6c943b00fc577a38ab4e12388583d
Check for a winner. Returns true if there is a winner, false otherwise.
[ { "docid": "8cc6e4e489289cff9bcc1890c05bb9d8", "score": "0.0", "text": "def winner?\n @progress == @word\n end", "title": "" } ]
[ { "docid": "65ddadf84dc7a5989ecdd0101ec4f125", "score": "0.82917273", "text": "def winner?\n return @winner if @winner\n\n b = to_i\n @winner = @@WINNER_STATES.any? { |a| a & b == a }\n end", "title": "" }, { "docid": "a7d4f1811d1d5c450fb37a3083d5606c", "score": "0.81397414", ...
d2af196bca56e1c5f9bb0dc7e01f6253
Sends sigterm to the list of processes identifiers provided.
[ { "docid": "26c7f2954e531962093018291afbe853", "score": "0.6500689", "text": "def kill_processes(procs)\n Process.kill('SIGTERM', *procs)\n end", "title": "" } ]
[ { "docid": "5b141ac3a90474353cdd0adf0b2e43b2", "score": "0.6408803", "text": "def signal_processes( signal, *pids )\n\t\tself.log.debug \"Signalling processes: %p\" % [ pids ]\n\n\t\t# Do them one at a time, as Process.kill will abort on the first error if you\n\t\t# pass more than one pid.\n\t\tpids.ea...
8c7e991d8e25e87aa96aa0125d6ba096
This is a hack to generate the URL from code. I don't know a better way to hook into Liquid and use its registered filters. But it's short and sweet enough for now (or for... ever).
[ { "docid": "d95183208cbc6aab3cf308f27838dae0", "score": "0.0", "text": "def make_download(version, mono, host)\n\t\ttemplate = Liquid::Template.parse('{{ version | make_download: \"templates\", mono, host }}')\n\n\t\tassigns = {\n\t\t\t'version' => version,\n\t\t\t'mono' => mono,\n\t\t\t'host' => host\n...
[ { "docid": "08363c2376128381fa89cc1cb44fbf10", "score": "0.6596419", "text": "def static_url(url); \"url('#{url}')\"; end", "title": "" }, { "docid": "dc7c89e912fb1baa53ec13d71613cd02", "score": "0.6202014", "text": "def render_url(args=nil)\n querystring = \"\"\n if !args.nil?...