query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
b5fb3cd27b855625bb897bbe12fc7413
Dump the last result to the specified file (defaulting to stdout) in the specified format (defaulting to Ruby's pretty print).
[ { "docid": "9f775b8a9009d16e17f40161ef6429e6", "score": "0.5705644", "text": "def output(input:, file: $stdout, format: nil)\n\tif format = format_for(file, format)\n\t\tformat.call(file, input)\n\telse\n\t\traise \"Unable to determine output format!\"\n\tend\n\t\n\t# Allow chaining of output processing...
[ { "docid": "6274c9ade4caa807f703c0e00f4246ce", "score": "0.5831909", "text": "def report_as format\n case format\n when :json\n JSON.pretty_generate @result\n when :yml\n YAML.dump @result\n else\n raise ArgumentError, \"Unknown format: #{format}\"\n end\n ...
f439aedf6d14e77e60f39489aaeb90cb
true or false for position in index
[ { "docid": "456bf4e1b2678c7928f5733fc349e088", "score": "0.0", "text": "def position_taken?(position)\n @board[position] != \" \"\n end", "title": "" } ]
[ { "docid": "d6f9f4026ee07b4c6cc6a3c63abb3341", "score": "0.7560923", "text": "def contain?(position); end", "title": "" }, { "docid": "5f44e176209941988a3d36d91c9f76a8", "score": "0.73442626", "text": "def index_valid?(index)\n index > -1 && index != length ? true : false\n end",...
f1344da01de928fab6d3ad63ebbe30cc
Permanently deletes this channel
[ { "docid": "de9cbe65dc64a15302844b50129ceb04", "score": "0.774905", "text": "def delete\n API.delete_channel(@bot.token, @id)\n end", "title": "" } ]
[ { "docid": "d55a36131fe99b9beb4718670f1caf29", "score": "0.8084066", "text": "def destroy\n @channel.destroy\n end", "title": "" }, { "docid": "7de4214cb675daae1580a01a457e8cb1", "score": "0.7610094", "text": "def delete_channel(data)\n channel = Channel.new(data, self)\n ...
ab53fa5e52a1e10a37fee8811084ebc7
reduces inventory_count by n assumes can_purchase?(n) == true
[ { "docid": "0ecc881bf17163911d7ee15dfb39b85a", "score": "0.7807811", "text": "def purchase(n)\n self.update_columns(inventory_count: self.inventory_count - n)\n end", "title": "" } ]
[ { "docid": "79da39588f1b7db51ab3cb511e8dd1de", "score": "0.7575285", "text": "def purchase(count = 1)\n self.inventory_count -= count\n self.save!\n end", "title": "" }, { "docid": "0c01c1b033de55b23d1c2685a7a83758", "score": "0.7549272", "text": "def can_purchase?(n)\n inv...
9c9dba40abf4ad7043fff5dbd54993ae
POST /resource_allocations POST /resource_allocations.xml
[ { "docid": "4f4fbaaa9cc26bc0f710d8bcbbd6048b", "score": "0.55928296", "text": "def create\n @resource_allocation = ResourceAllocation.new(params[:resource_allocation])\n\n respond_to do |format|\n if @resource_allocation.save\n format.html { redirect_to(@resource_allocation, :notice =>...
[ { "docid": "ac96ed07e13aa4cfcf845ff87af525ff", "score": "0.5884725", "text": "def create\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to(edit_admin_resource_path(@resource), :notice => 'Resource was successfully c...
9b3ec176d7af84468d85e33a0aaaf141
GET /kotobas/1 GET /kotobas/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "40b361e8c9d5f1fcf018e23ef74606df", "score": "0.7175996", "text": "def index\n @kotobas = Kotoba.all\n end", "title": "" }, { "docid": "bda4f58eb51b218d1d1c656f54c35121", "score": "0.71366334", "text": "def index\n @keditos = Kedito.all\n\n render json: @keditos\...
f90bb0b67533559f1972b1bc677743f3
Best effort to set _NODELAY if it makes sense. Swallows errors where possible.
[ { "docid": "4277e6b9c6fc5369ad0bd4e8cc36ad5f", "score": "0.48706397", "text": "def sync=(value)\n\t\t\t\tsuper\n\t\t\t\t\n\t\t\t\tcase self.protocol\n\t\t\t\twhen 0, IPPROTO_TCP\n\t\t\t\t\tself.setsockopt(IPPROTO_TCP, TCP_NODELAY, value ? 1 : 0)\n\t\t\t\telse\n\t\t\t\t\tConsole.logger.warn(self) {\"Unsu...
[ { "docid": "5b2ee4821d74bb3c264fad9e2012d764", "score": "0.6474566", "text": "def nodelay=(flag)\n ensure_state :connected\n @socket.setsockopt(::Socket::IPPROTO_TCP, ::Socket::TCP_NODELAY, flag ? 1 : 0)\n end", "title": "" }, { "docid": "21b5f757c7093131588e88066f8576aa",...
70b3646141194c23e9f94ee622fa3aaf
I worked on this challenge [by myself, with: ]. Your Solution Below
[ { "docid": "55349690217370cabfa3626e8d36a645", "score": "0.0", "text": "def good_guess?(i)\n if (i == 42); return true\n else return false\n end\nend", "title": "" } ]
[ { "docid": "aa89b26c8848588848ff622b5d313173", "score": "0.64728683", "text": "def solution\n 31875000\nend", "title": "" }, { "docid": "b9960478999684c2b536f76e22f6fc63", "score": "0.62877476", "text": "def solution4(input)\n end", "title": "" }, { "docid": "7a007b87...
4e975350ef1c7167c264bb1ef5660514
Return true if the searched word matches the one on result page. Node is an object of Nokogiri::Node out of mind, or turn of mind, or mindnumbingly Match criterion: the queried word should equal to the result word; the result phrase should be flattened, which should equal to the queried phrase.
[ { "docid": "1c58bcbcd526fdf64e73a973551c810a", "score": "0.7007863", "text": "def matched_word?(word, node)\n li = node.css('.base')\n return false if li.empty?\n resword = li.size == 1 ? li.text : li[0].text\n if resword.include?('/') || resword.include?(';')\n resword.flatte...
[ { "docid": "f2cf5601a0f78cf294fc0391e42838e3", "score": "0.69519526", "text": "def search(word)\n node = find_node(word)\n if node\n return node.is_word\n else\n return false\n end\n end", "title": "" }, { "docid": "2888b088e0a2ef44daecb72...
32a43a0406abcb11f52b8556336624ed
Returns the public key used when accessing this object. Deprecated: please use 'authentication' instead.
[ { "docid": "efba61c7648cd0d3c2afe02b75baa1cb", "score": "0.81318295", "text": "def public_key\n return self.authentication.public_key\n end", "title": "" } ]
[ { "docid": "231004388630d095d58971d7ae2d3bf4", "score": "0.8100967", "text": "def public_key\n @public_key\n end", "title": "" }, { "docid": "5d927d37b99961cdb97bb0634584c4b3", "score": "0.80930454", "text": "def get_public_key\n @public_key\n end", "title": "" }, ...
1cefbc9ae25594c25d98891b684e90bd
GET /data/1 GET /data/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "804a3401d21e5b5b7ebcb1406cf506fa", "score": "0.6399649", "text": "def get_full_data(data)\n case @client.api_version\n when \"1.2\"\n # in this version returned id=>{...}\n result = @client.api_request(:method => \"template.get\", :params => {:filter => data, :o...
888af658264336dad31fbb912de4e33c
POST /app_roles POST /app_roles.json
[ { "docid": "8a0d8256980a54216d517b893cf14333", "score": "0.6867389", "text": "def create\n @app_role = AppRole.new(params[:app_role])\n\n respond_to do |format|\n if @app_role.save\n format.html { redirect_to @app_role, notice: 'App role was successfully created.' }\n format.jso...
[ { "docid": "2f2e2b2b62a097f39335ad9c375d641e", "score": "0.6894533", "text": "def CreateRole params = {}\n \n APICall(path: 'custom_roles.json',method: 'POST',payload: params.to_json)\n \n end", "title": "" }, { "docid": "d39c823a4ce31af6d5e3f5d2312a04c2", "scor...
54cf40d8604f00cfd30e8b4904b5002f
GET /at_strings/1 GET /at_strings/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "267d42433c81a818fe6285be04de8b0b", "score": "0.5998069", "text": "def getApiString(url,*args)\n url=\"#{url}?\"\n args.each {|arg|url += \"#{arg}&\" unless arg == \"\" }\n url = url.split(\" \").join(\"%20\")[0..-2]\n getJson(url)\nend", "title": "" }, { "docid": "ad6257b1de5...
66dc015f8ea71e4bf21933eaf6500cc0
Multiple users can be added to or removed from user's group at a time. This method is used to resolve users groups, which are then listed on web site. The form data is saved by method: saveUsersGroups Method requires authentication
[ { "docid": "e1480b2bd75318f31db55ceaf1763aab", "score": "0.70615226", "text": "def editUsersGroups\n if session[:username] and params[:user] and params[:user] !~ /[^\\w\\_\\-]/\n # get signed in user and groups owned by the user\n @user = User.find_by_username(session[:username])\n @gr...
[ { "docid": "12772ca974bda145fb6facfbb581f752", "score": "0.7544986", "text": "def saveUserGroups\n \n # Asks user's groups, and the user object\n @groups = Group.find(:all, :conditions => [\"user_id = ?\", session[:user_id]])\n @edit_user = User.find_by_id(params[:user_id])\n \n # chec...
8a057c6c1f74f1eaca7ddee404705f74
Get the Realized State of a Logical Router Return realized state information of a logical router. Any configuration update that affects the logical router can use this API to get its realized state by passing a request_id returned by the configuration change operation. e.g. Update configuration of logical router, stati...
[ { "docid": "a472660e4e95cc6a4aaf08e53a696c3b", "score": "0.5968993", "text": "def get_logical_router_state_with_http_info(logical_router_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiLogicalRoutingAndServicesLogicalRoutersA...
[ { "docid": "512e4b27aec10f5ba5a82bb0308629a4", "score": "0.58491445", "text": "def get_logical_router_state(logical_router_id, opts = {})\n data, _status_code, _headers = get_logical_router_state_with_http_info(logical_router_id, opts)\n data\n end", "title": "" }, { "docid": "7...
72cd0223071f4bcec57f6992accc882c
this takes player 2 and initializes the pieces for the black side
[ { "docid": "48c46ce33a4323e3c476cc98668709c8", "score": "0.7591312", "text": "def initializeBlackSide(x)\n x[7][1] = Pawn.new(color: @player2.color, player: @player2)\n x[7][2] = Pawn.new(color: @player2.color, player: @player2)\n x[7][3] = Pawn.new(color: @player2.color, player: @p...
[ { "docid": "9e567ecb5984d494695dc1d1a96d59cd", "score": "0.75518465", "text": "def populate_game_board\n\t\tset_up_pieces(@white_player)\n\t\tset_up_pieces(@black_player)\n\tend", "title": "" }, { "docid": "ae593d4609a68a278206059c52c14a2c", "score": "0.7148234", "text": "def initial...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "77376a54d3e55e8a3a8a34b06d9fea7e", "score": "0.0", "text": "def drugmaster_params\n params.require(:drugmaster).permit(:ndc_number, :gcn_seqno, :label_name, :labeler_id, :package_size, :additional_description, :previous_ndc_number, :new_ndc_number, :ndc_format_flag, :drug_class, :date_a...
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6981606", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6784227", "text": "def strong_params\n params.requi...
b599119a425eafcd983744615fd9c9c2
Mark all the elements in the collection as done.
[ { "docid": "a9c4a44a58b857c852a802378f81a36a", "score": "0.71662366", "text": "def done!\n @todos.each_index do |idx|\n mark_done_at(idx)\n end\n end", "title": "" } ]
[ { "docid": "e97e9f30c772f1b7e32a42e6b923fefb", "score": "0.81488067", "text": "def mark_all_done\n each(&:done!)\n end", "title": "" }, { "docid": "7c15585072dd155ba41482218023dc14", "score": "0.7932488", "text": "def mark_all_done!\n self.each { |todo| todo.done! }\n end", ...
619b0c641d375a03e4a774020c96378e
Finds the place associated with the request (if any)
[ { "docid": "6c71ec421d5da8f0380ad83f978786c5", "score": "0.7407395", "text": "def find_place\n\t\t\tif params[:country_id] && params[:state_id] && params[:city_id] && params[:place_id] && params[:place_id].length > 0\n\t\t\t\t@place = Place.find(:first, :conditions => [\"url_part = ? OR uuid = ?\", para...
[ { "docid": "c698f079912dc583142ef25d956e9b2a", "score": "0.7873119", "text": "def locate(place)\n locations, = get :q => place\n return locations.first\n end", "title": "" }, { "docid": "1ae700b2473f975a0960dfc31da37110", "score": "0.7449422", "text": "def find_place\n\t @p...
fc65ec9e51899d380ab12784b0df7df9
DELETE /prd_m_set_contents/1 DELETE /prd_m_set_contents/1.json
[ { "docid": "a989a1d73bbe102d229c60e54231d997", "score": "0.7459423", "text": "def destroy\n @prd_m_set_content.destroy\n respond_to do |format|\n format.html { redirect_to prd_m_set_contents_url, notice: 'Prd m set content was successfully destroyed.' }\n format.json { head :no_content }...
[ { "docid": "7457e719e311138e7ccd170c25bf4f3e", "score": "0.68501073", "text": "def destroy\n @content_set = ContentSet.find(params[:id])\n @content_set.destroy\n\n respond_to do |format|\n format.html { redirect_to content_sets_url }\n format.json { head :no_content }\n end\n end"...
df72c177598b0e0ec8c99cbb457cd092
Call this to run the process
[ { "docid": "d3cbe8ef885455685aa96955e48cc73a", "score": "0.0", "text": "def all\n dumps_file_names=Dir.glob DUMPS_DIR\n #Dir.chdir \"/Users/carlobifulco/Dropbox/caHUB/caHubDumps_copy/\"\n walkover dumps_file_names\nend", "title": "" } ]
[ { "docid": "07681cd6b7dfea2d834a70371fa723a3", "score": "0.8093622", "text": "def run\n process\n end", "title": "" }, { "docid": "c376309f69511ff11b1194127d783fa1", "score": "0.7630566", "text": "def run\n end", "title": "" }, { "docid": "c376309f69511ff11b1...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "b8111efd20bb0ac613dbc5e3986beaf3", "score": "0.0", "text": "def order_params\n params.require(:order).permit(:user, :product, :quantidade, :numero_pedido, :preco, :endereco)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74768823", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.71700543", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist...
5763ed5de9d9fcdd8c8e998d484a7f22
POST /doseforms POST /doseforms.json
[ { "docid": "3df87fb238d0c00fb980cf3dda4956bb", "score": "0.64785814", "text": "def create\n @doseform = DisDoseform.new(doseform_params)\n\n\n if @doseform.save\n flash[:notice] = \"Task was successfully created.\"\n respond_with(@doseform)\n else\n flash[:notice] = ...
[ { "docid": "4314783f9fe7a20aa26f71df4c3b8d1c", "score": "0.696708", "text": "def create\n @dose_form = DoseForm.new(dose_form_params)\n\n respond_to do |format|\n if @dose_form.save\n format.html { redirect_to @dose_form, notice: 'Dose form was successfully created.' }\n format....
d5e92b4f60a8542785517d1df6a3de3a
Find or create instance
[ { "docid": "e31ca59584d076ec4ef629d345e8838d", "score": "0.0", "text": "def create_test_instance instance_id, cluster_id, cluster_location\n instance = $bigtable.instance(instance_id)\n\n if instance.nil?\n p \"=> Creating instance #{instance_id} in zone #{cluster_location}.\"\n\n job = $bigtabl...
[ { "docid": "b9a364b50911ac1f1fa3f5ed78e4c762", "score": "0.79287887", "text": "def create_or_find(_context, _instance)\n raise NotImplementedError\n end", "title": "" }, { "docid": "1cf50e250fd056905b0c5a212ca165a7", "score": "0.7590444", "text": "def find_or_create(atts ...
8cde31da6a097813a490ee0ada03c52c
setting topics to nil fetches all offsets for a consumer group and that feature is only available in API version 2+
[ { "docid": "975aa776ba72028a2fbbb72ff848b2e0", "score": "0.46692306", "text": "def api_version\n @topics.nil? ? 2 : 1\n end", "title": "" } ]
[ { "docid": "55b6ea8ebf7cc1bcd293702f1e1ea081", "score": "0.591537", "text": "def topics\n respond_to?(:topic) ? topic : []\n end", "title": "" }, { "docid": "2f854b19aa262deada32a0caff4b7953", "score": "0.58539027", "text": "def log_skip_all\n kafka = get_kafka\n ...
6f9d0cb81a75356432e0f599d54ffa10
Finalize this job group. Finalization entails running all finalization jobs serially in the order they were defined.
[ { "docid": "3e9afe84b83cdc3d850c006f5681e937", "score": "0.7396589", "text": "def finalize!\n logger.debug(\"[Resque Multi-Step-Task] Attempting to finalize #{task_id}\")\n raise FinalizationAlreadyBegun unless MultiStepTask.active?(task_id)\n raise NotReadyForFinalization if !ready...
[ { "docid": "537b2ee32bbc5a393c8eaed6af8894f9", "score": "0.6830793", "text": "def finalize!\n @queue.clear\n finalize\n end", "title": "" }, { "docid": "df9716eaf287009d40a13ecec3db8f06", "score": "0.677025", "text": "def finalize\n @size.times { @queue.push :END_OF...
dc8b0696e0e3932e95d582f528e9fa4a
GET /groupb_users/1 GET /groupb_users/1.json
[ { "docid": "5d6345da85f5fcf8225b70696d88502b", "score": "0.7420812", "text": "def show\n @groupb_user = GroupbUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @groupb_user }\n end\n end", "title": "" } ]
[ { "docid": "b548d4d02ece6fd0b6a47b6ce9d8babd", "score": "0.7322825", "text": "def show\n\t\t@group = Group.find_by(id: params[:id])\n\t\tusers = []\n\t\t@group.user_groups.collect { |a| users.push(a.user) }\n\n\t\trespond_to do |format|\n\t\t\tformat.json { render :json => users}\n\t\tend\n\tend", "...
27479f86eebe03298942444db9bfe964
GET supplier/:supplier_id/products/new GET /products/new.json
[ { "docid": "d5a1604dec1b43f8a4f679a529e90f73", "score": "0.8165074", "text": "def new\n @supplier = Supplier.find(params[:supplier_id])\n @product = @supplier.products.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @product }\n end\n ...
[ { "docid": "39b67a4cacb8455d77838fa69d723267", "score": "0.77138203", "text": "def create\n @supplier = Supplier.find(params[:supplier_id])\n @product = @supplier.products.build(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @supplier, :n...
0716d99819913c36a6b5c2a61f033600
PUT /assignment_questions/1 PUT /assignment_questions/1.json
[ { "docid": "0d2129dadb77352ec575c82153241c2a", "score": "0.7281231", "text": "def update\n @assignment_question = AssignmentQuestion.find(params[:id])\n\n respond_to do |format|\n if @assignment_question.update_attributes(params[:assignment_question])\n format.html { redirect_to @assig...
[ { "docid": "08036f760b41f85b463bc1f2ad1a53eb", "score": "0.75200695", "text": "def update\n #@assignment.questions.user_id = current_user.id\n respond_to do |format|\n if @assignment.update(assignment_params)\n format.html { redirect_to @assignment, notice: 'Assignment was successfully...
ad39bb6070a5fe3f630455a0a2ee5027
Returns the raw service name
[ { "docid": "84bba83014d2bed01f04b89ee1b55ed9", "score": "0.83634585", "text": "def raw_service_name\n new_resource.service_name.split('/').last\n end", "title": "" } ]
[ { "docid": "614f88a627c9f25dd9111f01cd2919eb", "score": "0.79532695", "text": "def service_name\n (@service || self.name.split(\"::\").last).to_s\n end", "title": "" }, { "docid": "614f88a627c9f25dd9111f01cd2919eb", "score": "0.79532695", "text": "def service_name\n (@se...
568304085c8050a34e428676ab446250
GET /xiaoximobans/1 GET /xiaoximobans/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "4b96dac4a3c4f0eda55a63301b47669c", "score": "0.67282987", "text": "def index\n @aboutshelians = Aboutshelian.where(:title => \"社联章程\")\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @aboutshelian }\n end\n end", "title": "" ...
0a9129ccda620d9919b7d730ee380e06
Le menu de jeu
[ { "docid": "c189a90e050b70bb5ae00cb4af09d22f", "score": "0.0", "text": "def menu(human_player, player1, player2)\n while player1.life_points >= 0 || player2.life_points >= 0 && human_player.life_points >= 0\n puts \"Quelle action veux-tu effectuer ?\"\n puts \"a - chercher une meilleure arme\"\n ...
[ { "docid": "ae720af357ce3809866f4492d121d2a9", "score": "0.7324377", "text": "def menu\n\n end", "title": "" }, { "docid": "6f0926c92c6499d13022936a8ba48c1f", "score": "0.72472376", "text": "def menu\n puts 'Opción 1) Nombre y Promedios por alumnos'\n puts 'Opción 2) Nombres y c...
02f9491f08600b516b4aac30c161baf4
A prgbox is very similar to a programbox. This dialog box is used to display the output of a command that is specified as an argument to prgbox. After the command completes, the user can press the ENTER key so that dialog will exit and the calling shell script can continue its operation. If three parameters are given, ...
[ { "docid": "7d0eb44f7fad9768f258a142f9ecdfef", "score": "0.7163401", "text": "def prgbox(command, height=0, width=0, text='')\n cmd = \"\"\n cmd << option_string()\n cmd << \" \"\n cmd << \"--prgbox\"\n cmd << \" \"\n if text.length > 0\n cmd << \"'\"\n cmd << text\n cmd...
[ { "docid": "a298513a8ad77c456deb86ed37719d61", "score": "0.71537185", "text": "def prgbox(command, height=0, width=0, text='')\n cmd = [ option_string(), '--prgbox' ]\n cmd << text.inspect unless text.empty?\n cmd << command.inspect << height << width\n cmd = cmd.join(' ')\n run(cmd)\n e...
3a1845230c58fcb98adeda74fccf8eab
ACK08 Id: 234 Name: Product/Service ID Type: AN Min/Max: 1/48 Description: Identifying number for a product or service
[ { "docid": "5d04c0b7b4f436078bc171e5595079a1", "score": "0.0", "text": "def ACK08=(arg)", "title": "" } ]
[ { "docid": "fe88d22ee54b6d16c5be98cab7a1a258", "score": "0.5923048", "text": "def default_service_msg_number\n 1002\n end", "title": "" }, { "docid": "4087dba8ea360eea88ddc92a027b0b41", "score": "0.57499444", "text": "def default_service_msg_number\n \"0002...
5dc59e31191c9357f05337ba2c5d9050
PUT /safety_items/1 PUT /safety_items/1.json
[ { "docid": "e0ac53ddc21692495c0a4359756ac76b", "score": "0.7070025", "text": "def update\n if current_user.is_not_staff?\n flash[:error] = \"You do not have permissions to access that feature.\"\n redirect_to root_path and return\n end\n \n @safety_item = SafetyItem.find(params[:id...
[ { "docid": "efef758897ceb209480affb68d3e5a7e", "score": "0.7436797", "text": "def update\n @safety_item = SafetyItem.find(params[:id])\n\n respond_to do |format|\n if @safety_item.update_attributes(params[:safety_item])\n format.html { redirect_to @safety_item, :notice => 'Safety item ...
96a44086c9aee926bf19b2a027fd0da7
this method turns 'new_user_number' into an international phone. If it's already an international phone, return it. Otherwise (it's a local phone), assume it's from the same country as the first phone, and transform it into the international format of that country. Thus, if user1 (for whom we have an international phon...
[ { "docid": "7d8d885fe5a2cef20ec77ad9088ad07a", "score": "0.8016204", "text": "def to_international(new_number, international_number_hint)\n if is_international_phone?(new_number)\n sanitize_phone(new_number) \n else \n country_code = get_phone_country_code(international_number_hint)\n ...
[ { "docid": "b58709dca2fd0f085c1c516b06a936b2", "score": "0.73296326", "text": "def to_international(international_number_one, number_two)\n if is_international?(number_two)\n return number_two \n else \n country = get_country(international_number_one)\n international_number_two = make_interna...
fd0ac56d64a5334993847c385e90f288
If the context allows tips from multiple venues, the compact venue for this tip.
[ { "docid": "89d12cfba916880099946655b5ae3f43", "score": "0.45498395", "text": "def venue\n Foursquared::Response::Venue.new(client, response[\"venue\"]) if response[\"venue\"]\n end", "title": "" } ]
[ { "docid": "8d18147fd420e60550e6aec795b9bf05", "score": "0.5936215", "text": "def venue_tips(id, options = {})\n get(\"venues/#{id}/tips\", options).tips\n end", "title": "" }, { "docid": "513557844bce2d328a1d5883eb1d3b8e", "score": "0.5277749", "text": "def tips(venue_id...
df9cf29bf874311cfc080e1641ec4621
Looks up term and updates it based with the new update args given.
[ { "docid": "571f2ba65e2c1aeef2cb2a49fce0eb18", "score": "0.7925913", "text": "def update_term(lookup_args, update_args, custom_field_keys)\n update_term = Term.find_by(**lookup_args)\n update_args.each do |f, v|\n if custom_field_keys.include?(f)\n update_term.set_custo...
[ { "docid": "97a57322eceb22145ec5fc0934531543", "score": "0.80148065", "text": "def update!(**args)\n @query_terms = args[:query_terms] if args.key?(:query_terms)\n @replacement_term = args[:replacement_term] if args.key?(:replacement_term)\n @term = args[:term] if args.key?(:t...
0f9e7a0cc55c1c4c08316c4984e4636c
def fib(n) n < 2 ? n : fib(n1) + fib(n2) end puts fib(6) Binary Search
[ { "docid": "e11f88246bc01b6c33ddcbe1b33a7a80", "score": "0.0", "text": "def sqrt(number)\n sqrt_recursive(number, 0, number)\nend", "title": "" } ]
[ { "docid": "f110e16e95dd694a071afa32a59020c9", "score": "0.8740128", "text": "def fib(n) (n<=2) ? 1 : (fib(n-2)+fib(n-1)) end", "title": "" }, { "docid": "84287efd57298d471bfb4b52ed8349f2", "score": "0.8672838", "text": "def fib(n)\n n < 2 ? n : fib(n-1) + fib(n-2)\nend", "title...
39e9f903fd5a4cb5068ac4f7c5d42111
need to figure out about multiply renters
[ { "docid": "7d49880fa594014afe74d8bb9eee46d6", "score": "0.55585736", "text": "def renter\n\t\tp \"You will have #{price} from #{renters[0].name}\"\n\tend", "title": "" } ]
[ { "docid": "4790dcd2fb7f70df8c620e6897442e8e", "score": "0.65952057", "text": "def rename; end", "title": "" }, { "docid": "554e498fb0a45234af1d249a2c26a809", "score": "0.648318", "text": "def renamenx(old_name, new_name); end", "title": "" }, { "docid": "554e498fb0a45234...
d6e2381a9f23025989095ed251696258
Number of Periods to Calculate. END CONFIG
[ { "docid": "ee64021ea686952798a616f6718c7669", "score": "0.0", "text": "def get_timestamp()\n # INPUTS: None\n # OUTPUTS: STRING, \"normal time ::: epoch time\"\n time = Time.now.to_s\n epoch = Time.now.to_f.round(4)\n return(\"#{time} | #{epoch}\")\nend", "title": "" } ]
[ { "docid": "911b8726e5c88befdc1b0d6a80e62be2", "score": "0.7754277", "text": "def period_count\n @periods.length\n end", "title": "" }, { "docid": "a850c1a79244bf2657ece02d130638f9", "score": "0.7594977", "text": "def num_of_periods(params)\n \t\tperiods = (3..15).to_a\n \t...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "a0acec133bc099830cc28da70d6e5e02", "score": "0.0", "text": "def set_bet\n @bet = Bet.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...
318c459daa5b4d609de44d51d57bb2d4
Returns a hash keyed to the attribute name of passed options from the property definitions.
[ { "docid": "8d5ab1dc4882ef6ee8d2f2997b425495", "score": "0.60082555", "text": "def attribute_options\n if self.class_variable_defined?(:@@attribute_options)\n class_variable_get(:@@attribute_options)\n else\n class_variable_set(:@@attribute_options, {})\n ...
[ { "docid": "790c69d5d41656970a1b266af68883c5", "score": "0.7049324", "text": "def options\n options = {}\n attributes_for(self).each do |p|\n option = self.send(p.to_sym) \n options[p] = option unless option.nil?\n end\n options\n end", "title": "" }, { ...
bf47c3a83188a236e1d7fb4e4efa5647
PATCH/PUT /questions/1 or /questions/1.json updates and saves a question
[ { "docid": "0cb81d362eeae3ae15a184829471b7d6", "score": "0.0", "text": "def update\n\t\t# check if user should be able to create a new question\n\t\tif !logged_in? || (!admin? && !(current_user == @user))\n\t\tnaughty_user\n\t\telse\n\t\t\toptions=\"\"\n\t\t\tanswer=\"\"\n\t\t\tquestions = Question.whe...
[ { "docid": "f49075022f8d3c6f1c7a7e4b3244fac7", "score": "0.7770393", "text": "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to @question, notice: 'Question was successfully upd...
f7b1228c5959e3a629ac82731d6597a5
Establece el titulo de acuerdo a la seleccion
[ { "docid": "34a631e808257524f5ceb3d64f8573f8", "score": "0.66083384", "text": "def titulo_guia\n titulo = []\n\n t = Especie.find(params[:especie_id])\n a = t.adicional\n\n tipo_region = params[:tipo_region] == \"anp\" ? \"ANP \" : \"Municipio de \"\n \n if a.nombre_comun_principal.pre...
[ { "docid": "f41a0ff8eabfe4fcd4ef8b3b039ee837", "score": "0.6515681", "text": "def asignar_titulo_propiedad()\n \n end", "title": "" }, { "docid": "174b56c69d5158c9a74e29d218275689", "score": "0.62395835", "text": "def set_c_titul\n @c_titul = CTitul.find(params[:id...
7faa9ed3f822bdd82123a34863c5cde2
Generates the invitation key. instance invitation keys generated start with J.
[ { "docid": "f50236ff982d04d62f058bac8354b8f8", "score": "0.742209", "text": "def generate_invitation_key\n self.invitation_key ||= INVITATION_KEY_IDENTIFIER + SecureRandom.base64(8)\n end", "title": "" } ]
[ { "docid": "5d60c343d76c153ab6d6455592bf33bf", "score": "0.74950325", "text": "def generate_invitation_key\n self.invitation_key ||= 'I'.freeze + SecureRandom.base64(8)\n end", "title": "" }, { "docid": "5d60c343d76c153ab6d6455592bf33bf", "score": "0.74950325", "text": "def gener...
56ee7aca16d2717460e6f74a4404cc42
Smallest multiple Problem 5
[ { "docid": "98c0cc06948a692de8004ea95e5a4b19", "score": "0.70103645", "text": "def smallest_multiple(n)\n elements = (2..n).to_a\n largest_prime_count = {}\n\n elements.each do |element|\n prime_count = {}\n factorized = prime_factorization(element).to_a\n\n factorized.each do |num|\n ...
[ { "docid": "a50e641bcb0fe68368361b97b5b1a8e4", "score": "0.8004153", "text": "def smallest_multiple(num)\n ans = 0\n multiple_arr = (2..num).to_a\n candidate = num * (num-1)\n while ans == 0\n multiple_arr.each do |i|\n break if candidate % i != 0\n if candidate % i == 0\n if i ...
f993e9d2cd41208ccd7d1693012994a7
call to open library to get book info
[ { "docid": "f11abda1c26efd128f080a6dd4164b99", "score": "0.77818716", "text": "def book_info_open_library\n client = Openlibrary::Client.new\n results = client.search(params[:q])\n end", "title": "" } ]
[ { "docid": "0dc493af5c849e44987c2ad096b9e92f", "score": "0.7671175", "text": "def book_info_open_library\n client = Openlibrary::Client.new\n results = client.search(params[:q])\n rescue\n []\n end", "title": "" }, { "docid": "bb056b271f233f0c8af2bfe76f6351f9", "score": "0.719...
47080a05ba0e52efbb5e25cdeb8d14cd
I spent [] hours on this challenge. Complete each step below according to the challenge directions and include it in this file. Also make sure everything that isn't code is commented in the file. 0. Pseudocode What is the input? What is the output? (i.e. What should the code return?) What are the steps needed to solve ...
[ { "docid": "a1c330e2fc9eb875b17ab4dccdfd6c5d", "score": "0.7310275", "text": "def separate_comma(number)\n howlong = number.to_s.length\n if howlong <= 3\n number.to_s\n else\n arr = number.to_s.split('')\n place = 0\n newarr = Array.new\n arr.reverse_each do |i|\n if place == 3\n...
[ { "docid": "623504bc20815106617a006cfa2641a9", "score": "0.76074517", "text": "def separate_comma(input_num)\n input = input_num.to_s\n if input.length <= 3\n return input\nelsif\n input.length > 3\n rev_input = input.reverse\n pre_flip = rev_input.scan(/.{3}|.+/).join(\",\")\n return pre_fl...
a6935214b0404f6ea3f1363eb7451fd7
overwrite the methods that are virtual in Qt
[ { "docid": "6d12621847ef9752c1af5dcb97aa1731", "score": "0.0", "text": "def count\n @item_list.size\n end", "title": "" } ]
[ { "docid": "e6431ff47476c9014fb64198d5853e1e", "score": "0.7109491", "text": "def overrides; end", "title": "" }, { "docid": "2e498b811c1d13b03e32aed2be901419", "score": "0.67241585", "text": "def virtual; end", "title": "" }, { "docid": "172bd2432a5b585c3a1d57951dc4bb76"...
56a1be61f85bc871d2f6da599344e157
DELETE /spiels/1 DELETE /spiels/1.xml
[ { "docid": "9609d1d970807adeca7a9fcc930435df", "score": "0.7059481", "text": "def destroy\n @spiel = Spiel.find(params[:id])\n @spiel.destroy\n\n respond_to do |format|\n format.html { redirect_to(spiels_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "942aeb1cb70d80106581a8f4ef2589e5", "score": "0.67775536", "text": "def destroy\n @dossier = Dossier.find(params[:id])\n @dossier.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/\") }\n format.xml { head :ok }\n end\n end", "title": "" }, { ...
24b384f6532ac6e29dd832581dc90bd4
Renders the Prawn document to a PDF which is then read to extract details about the end result
[ { "docid": "da02a62bc33ae12c03bb21f99a4575fa", "score": "0.0", "text": "def find_objects(document)\n string = read_document(document)\n PDF::Reader::ObjectHash.new(string)\nend", "title": "" } ]
[ { "docid": "127d1651641167e93360b000cfe4f6c9", "score": "0.76198393", "text": "def finalize_document\r\n render_pdf\r\n end", "title": "" }, { "docid": "2894f1ed5a1243ae9c75c5a51ddd4169", "score": "0.7575241", "text": "def render\n generate_content\n @pdf.render\n ...
c9bc66d205c65be01683dd60b9b999a9
DELETE /advance_payments/1 DELETE /advance_payments/1.xml
[ { "docid": "bad8af47dd2eae075fbbe9670e784f10", "score": "0.7350184", "text": "def destroy\n @advance_payment = AdvancePayment.find(params[:id])\n @advance_payment.destroy\n\n respond_to do |format|\n format.html { redirect_to(advance_payments_url) }\n format.xml { head :ok }\n end...
[ { "docid": "3bbe532f009f1a184b0c02732cbe4aaf", "score": "0.70188254", "text": "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end", "title": "" }, { "docid": "69b205c158f7212cc750ed38fc878f1c", "score": "0.6736302", "text": "def delete()\n ...
e0e5813cb459c8a4cce0b94b023a5fe1
GET /providers/1 GET /providers/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "e5c73d790f06a8c0233ed19c01bbd698", "score": "0.73152184", "text": "def index\n @providers = Provider.all\n\n render json: @providers\n end", "title": "" }, { "docid": "216c7c07a78d9a2c0b1da0739a0e278e", "score": "0.7204744", "text": "def index\n @providers = Pro...
4360ec037cd01dfa6c17b54cf27e33dc
Need to keep in mind if you're adding a game you own vs want Need a way to differentiate later Let's try to do the basic for now
[ { "docid": "d7ced76a81bee41bde84edc3a82754b8", "score": "0.0", "text": "def add_game\n \tuser = current_user\n \tgame = Game.find_by_id(params[:user][:game_id])\n\n \tif user.games.include?(game)\n \t\tflash[:notice] = \"You already own this game\"\n \telse\n \t\tuser.games << game\n \t\tflash[:n...
[ { "docid": "3935a10db0c00bd86657c88a0f53312f", "score": "0.6946562", "text": "def in_game?; end", "title": "" }, { "docid": "0f09aad9c5195fa99ef0f22c6a699929", "score": "0.681725", "text": "def win_game\n\n end", "title": "" }, { "docid": "8deac32c982c066260c5a71e0a795d4...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "f28a81c8a845a1c69d332c05001bcdca", "score": "0.0", "text": "def custom_notification_params\n params.require(:custom_notification).permit(:user_id, :food_id, :days)\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...
d3242b13f2b57b216e7c64afb64e0326
Fetch IDs for objects belonging to a passed class that the user has disliked
[ { "docid": "f8e2ba9826d419c9a56bdaa1d4aaeb46", "score": "0.80709696", "text": "def disliked_ids_for(klass)\n ids = Recommendable.redis.smembers(Recommendable::Helpers::RedisKeyMapper.disliked_set_for(klass, id))\n ids.map!(&:to_i) if [:active_record, :data_mapper, :sequel].include?(Recomme...
[ { "docid": "64045267e2b75f0d52c29224a54f4c67", "score": "0.76249343", "text": "def disliked_records_for(klass)\n klassify(klass).find dislikes_for(klass).map(&:dislikeable_id)\n end", "title": "" }, { "docid": "4b0621b5ebe694a94e7129524d7be58c", "score": "0.74286044", "te...
802d5730c8b467dd7ceccd4ba7eb4eda
Verifies we're not moving out of bounds, haven't been to this location before, and the space isn't blocked
[ { "docid": "53eef858514ad6e9f455b8f72229bb78", "score": "0.0", "text": "def can_move_to(x, y, grid, visited)\n return false if visited.include?([x, y])\n return false if y >= grid.length\n return false if x >= grid[0].length\n grid[y][x] != 1\nend", "title": "" } ]
[ { "docid": "626d19a8ba0c7a782d89b5f980fed4ca", "score": "0.7332789", "text": "def valid_move?(location)\n #binding.pry\n (location.to_i - 1).between?(0,8) && !position_taken?(location.to_i - 1)\n end", "title": "" }, { "docid": "f52c9bf28a03e6f9eba9f91918ddac7b", "score": "0.73080...
96b35ffd77e5fd2990d4879db9a5e897
GET /fnfps/1 GET /fnfps/1.json
[ { "docid": "205e90bd78e6e5a11ec3443a36765f13", "score": "0.64079297", "text": "def show\n @fnfp = Fnfp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fnfp }\n end\n end", "title": "" } ]
[ { "docid": "4d60c7c691bfcb7b101942fe001edac2", "score": "0.6101421", "text": "def fps\r\n @fps_counter.fps\r\n end", "title": "" }, { "docid": "709dd513fc25f0a6ccfbf1d9f106e338", "score": "0.6072641", "text": "def show\r\n render json: Fav.find(params[:id])\r\n end", ...
0eae7841dd1a56c8e45dad188d0d767e
select_every_odd takes in an array returns a list of oddindexed items
[ { "docid": "db4c66b1b3108f26982f15305d9139b9", "score": "0.83496743", "text": "def select_every_odd(arr)\n arr.keep_if{|x| arr.index(x).odd?}\n end", "title": "" } ]
[ { "docid": "f5e3ef14674021f26a4b28203eeddfd3", "score": "0.88973296", "text": "def select_every_odd(array)\n array.select.with_index{ |item, index| item if index.odd? }\n end", "title": "" }, { "docid": "6c777f7192b6b2d04a1a72af7ec978a3", "score": "0.8866814", "text": "def select...
81ce3d872f4af859d82f0dc290dd0c63
GET /repairs GET /repairs.json
[ { "docid": "bdab42bc5077f90cbe45e99fe6d6a49e", "score": "0.58983487", "text": "def index\n @repairs = Repair.includes(:customer, :user).generate_repair_index(@organization,@customer)\n @new_path = @customer ? new_customer_repair_path(@customer) : new_repair_path\n end", "title": "" } ]
[ { "docid": "01e3309013b7b5ac618da512b5ca2145", "score": "0.70487756", "text": "def index\n @repairs = Repair.all\n end", "title": "" }, { "docid": "01e3309013b7b5ac618da512b5ca2145", "score": "0.70487756", "text": "def index\n @repairs = Repair.all\n end", "title": "" }...
ce41a5bf866d2d5daafe5993f90bf003
Easier to interpret string inspect
[ { "docid": "299bc5ec6021614d9293aeb8337730f1", "score": "0.0", "text": "def inspect\n \"#<#{self.class}:#{object_id.to_s(16)} @streaming=#{!!@streaming}>\"\n end", "title": "" } ]
[ { "docid": "8a4e90b8bc14c0daf78dd2daa904a431", "score": "0.66990495", "text": "def inspect(input); end", "title": "" }, { "docid": "cec6fa993ecfb0b76d0e684cee1097ad", "score": "0.65938056", "text": "def uninspect(str)\n return nil unless str\n str.gsub(%r!\\\\([\\\\#\"a...
6d01c112eb855e4ac87b4cd06b432c28
PREARRIVAL Refused = 1 No show = 2 Canceled = 3 POSTARRIVAL Unwilling child = 4 Unwilling parent = 5 COMPLETED Partially successful = 6 Completely successful = 7
[ { "docid": "face1ad9fcd03a3fc86ebb33b6ffbef4", "score": "0.0", "text": "def to_label\n \"#{id}\"\n end", "title": "" } ]
[ { "docid": "9d41cc40a5ee47736b14da7930383c8a", "score": "0.5697829", "text": "def child_status\n $CHILD_STATUS\n end", "title": "" }, { "docid": "9a2b76cca40a93a6d796410739b1cffe", "score": "0.5635569", "text": "def status_with_sibling\n sibling = product_test.tasks.c3_cat3_ta...
e02d986fd377d964e8241c1eddcf05a0
Clears just the previously recognized parent context.
[ { "docid": "8292329e2e1d8811e3b3eee13931b8f1", "score": "0.9119812", "text": "def clear_parent_context\n @previous_parent_context = nil\n end", "title": "" } ]
[ { "docid": "345651a3cc9e9c90c5e84b3a32378c2d", "score": "0.8979589", "text": "def clear_parent_context\n @previous_detected_parent_context_name = nil\n @previous_parent_context = nil\n end", "title": "" }, { "docid": "ba7e89ea32d657a8632d3ca992bc65fc", "score": "0.76054686", "...
0f17a725b8c56eb2036d2fa6521645e1
Fct reverse an array
[ { "docid": "0df1fea6eefbce5824abe7ea0c008f0c", "score": "0.7395788", "text": "def reverseArray(array)\n tmp_array = Array.new(array.length)\n index = array.length - 1\n\n for i in 0...array.length\n tmp_array[index] = array[i]\n index -= 1\n # puts \"#{i} = #{array[i]}\"\n end\n\n return t...
[ { "docid": "1dbcce6543881c40049b67f6dc6b5fcc", "score": "0.8542545", "text": "def reverse_array(array)\narray.reverse\nend", "title": "" }, { "docid": "1dbcce6543881c40049b67f6dc6b5fcc", "score": "0.8542545", "text": "def reverse_array(array)\narray.reverse\nend", "title": "" }...
33e747eb13a01532af8ddba3c7073893
Gets the mergeType property value. The mergeType property
[ { "docid": "58d0264e55daa56ed31f487c1720aae1", "score": "0.87623394", "text": "def merge_type\n return @merge_type\n end", "title": "" } ]
[ { "docid": "53cf7bc5cbaa79be1b0ee3be2a8261e4", "score": "0.7961714", "text": "def merge_type=(value)\n @merge_type = value\n end", "title": "" }, { "docid": "53cf7bc5cbaa79be1b0ee3be2a8261e4", "score": "0.7961714", "text": "def merge_type=(value)\n ...
3c014188cccc9ab0f2f178603d3d81f3
Checks if the state is `DELETE_REQUESTED`.
[ { "docid": "a7b5055e199f63c1b554826e524d7280", "score": "0.8836573", "text": "def delete_requested?\n return false if state.nil?\n \"DELETE_REQUESTED\".casecmp(state).zero?\n end", "title": "" } ]
[ { "docid": "91751e1be22ffff3938450eb4327b378", "score": "0.8893716", "text": "def delete_requested?\n return false if state.nil?\n \"DELETE_REQUESTED\".casecmp(state).zero?\n end", "title": "" }, { "docid": "e0fa861ccebe51f1e1dfbbda86aef31c", "score": "0.7273112", ...
0729672651468aad2eb16754974ee538
Returns an array of additional include/exclude parameters.
[ { "docid": "61d9344e6a9eeae3c8e7634f6fc0153a", "score": "0.6510915", "text": "def get_file_parameters\n project = File.basename(get_root)\n\n file_list = []\n\n # Loop through the extensions.\n ['include', 'exclude'].each do |ext|\n # Add the base include/exclude file if it ex...
[ { "docid": "933c5d1e4f513f377f18f43de36c314d", "score": "0.7087298", "text": "def include_params\n return unless params[:include]\n\n @include_params ||= params[:include].split(',')\n end", "title": "" }, { "docid": "ee93d704d8eb1ce9fb81af090f9d174d", "score": "0.7007583", "te...
b446089c78754499442ee219258c86b5
Show invalid properties with the reasons. Usually used together with valid?
[ { "docid": "b9e35bf526a6c6711c9e2486f9bbbd40", "score": "0.0", "text": "def list_invalid_properties\n invalid_properties = Array.new\n if !@coupon_type.nil? && @coupon_type.to_s.length > 65\n invalid_properties.push('invalid value for \"coupon_type\", the character length must be smalle...
[ { "docid": "9dd8493868b224474a2e829ab4c4f12a", "score": "0.76497203", "text": "def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n ...
bf8b090e8c095d0c32de413f40f821c9
loads SEO templates and format strings for SEO tags
[ { "docid": "f8e234c1202fd5b2297a908d091032ff", "score": "0.55816007", "text": "def set_seo_data(hash)\n tt = Setting::get('Title for location page')\n unless tt.blank?\n hash[:title] = self.process_seo_str tt\n end\n dt = Setting::get('Description for location page')\n unless dt.blan...
[ { "docid": "0ca0ee06a22cb42a23986517de9f8ccd", "score": "0.6205917", "text": "def seo_tags\n seo_title + seo_meta_author + seo_meta_description\n end", "title": "" }, { "docid": "05e321bb1a8d01689485391cdf18c88c", "score": "0.60901994", "text": "def seo_for_page\n PAGE_S...
0c6b03ff46ec02af196c404bb776daaf
Provides a paginated list of events for a single cash drawer shift.
[ { "docid": "e7b6c8f774fa0df612a83878f8c97aa0", "score": "0.6951188", "text": "def list_cash_drawer_shift_events(location_id:,\n shift_id:,\n limit: nil,\n cursor: nil)\n new_api_call_build...
[ { "docid": "195d64e65e0ec1a86a1d27476a2b8eb2", "score": "0.7137044", "text": "def index\n @events = Event.available.page(params[:page])\n end", "title": "" }, { "docid": "a086798dc0aed086240965563524de1e", "score": "0.70325404", "text": "def index\n @events = Event.getRecords(...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d818cad47109c0eabb312af32c707b68", "score": "0.0", "text": "def set_lista\n begin\n @lista = Lista.find(params[:id])\n @accion=params[:controller]\n rescue\n render :_error\n end\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": "41fe8fa5577ab45889a85e9261c4604e", "score": "0.0", "text": "def set_matiawase\n @matiawase = Matiawase.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.61637366", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60446453", "text": "def action_hoo...
12a24f202c4c2185d2f0e52f26b2f42b
spit a single html entry
[ { "docid": "b3e25a4ad8fff470b333af23bda584b6", "score": "0.63196784", "text": "def html_entry(entry_path)\n <<-EOS.strip\n<div class=\"post\">\n#{RDiscount.new(File.read(entry_path)).to_html}\n</div>\n EOS\n end", "title": "" } ]
[ { "docid": "82eafcbd906b656c05878b99b06a7fd1", "score": "0.61555314", "text": "def show_feed_entry\n %Q{<p>\n <a href='#{@feed_entry.url}'>#{@feed_entry.name}</a><br />\n #{@feed_entry.published_at}\n #{@feed_entry.summary}\n </p><hr>}.html_safe\n end", "title": "" }, { "...
4ecac9c1b76d2df36deaa2512c53b349
throw :break_chain to abort chain
[ { "docid": "0a5657305d143bfafeeda38f9a9a148f", "score": "0.0", "text": "def in_chain(method_name); raise NotImplementedError \"TODO: implement this\" end", "title": "" } ]
[ { "docid": "cc3e1edd36d4a35dfc83ee64772bc667", "score": "0.715296", "text": "def stop_chain\n fail StopChainException\n end", "title": "" }, { "docid": "7090c27a180d239abbacec1fcbb42cab", "score": "0.65831214", "text": "def rescue_abort\n yield\n rescue Exception ...
dc9b07bf9d54d01a700a8f5f7ecb1b9c
PATCH /simulators/:_id/update_filter redirect_to simulatorsshow
[ { "docid": "94fbde7d311a76526e5032568de442cf", "score": "0.7318548", "text": "def update_filter\n simulator = Simulator.find(params[:id])\n filter = simulator.parameter_set_filters.find(params[:filter])\n if filter.update(name: params[:filter_name], conditions: JSON.load(params[:conditions]))\n...
[ { "docid": "9a6352afc825f165632316c63783ef37", "score": "0.64561427", "text": "def update\n if @filter.update(filter_params)\n redirect_to filter_path(@filter)\n else\n render 'edit'\n end\nend", "title": "" }, { "docid": "c34a7f385883cb70f8d7578a34513a2b", "score": "0.6448067",...
f627b3fdadbbcbccf4110c78cc9328ca
Assign the local portion of the mail address. This is the
[ { "docid": "94858b8b1602f5b38f3db00074446e27", "score": "0.0", "text": "def local=(l)\n raise ArgumentError unless l.nil? || l.kind_of?(String)\n @local = l\n end", "title": "" } ]
[ { "docid": "5226c58048c256a257af96ae4c758fd9", "score": "0.70056087", "text": "def address\n if @domain.nil?\n\t@local\n else\n\t@local + '@' + @domain\n end\n end", "title": "" }, { "docid": "83a2cce99aa107dda5ab7a13936ab19d", "score": "0.6889397", "text": "def mai...
0e50976dffbaa8f6a15f00a9c71c915d
GET /households/:household_id/payments as household_payments
[ { "docid": "e86052887c9b4ff487de90a6ef05f2e7", "score": "0.6887608", "text": "def index\n @household_members = @current_household.household_members\n @payments_to_pay.sort_by{|payment| payment.amount }.reverse!\n\n\n # @payments = Payment.all\n end", "title": "" } ]
[ { "docid": "ff68771658ac9c9523a92379b0c682a7", "score": "0.72365695", "text": "def payments_paid_by(housemate)\n housemate_payments = self.payments.where(mate_id: housemate.id)\n end", "title": "" }, { "docid": "116174ac3695749019b0baea65cca913", "score": "0.6684798", "text": "de...
1a6307f7eb05883448d5f425da2ff5be
Takes an array and breaks the things down into components
[ { "docid": "8e142da6b7153db71d83956740bd3ec3", "score": "0.0", "text": "def what_are things\n things.map{|k| what_is k}.flatten\nend", "title": "" } ]
[ { "docid": "b2ef3f1362ab5588284b57de6c185102", "score": "0.6423623", "text": "def components\n arr = Arrays.new(@nb) { [] }\n (0...@component.size).each { |v| arr[@component[v]] << v }\n end", "title": "" }, { "docid": "b2ef3f1362ab5588284b57de6c185102", "score": "0.6423...
4da29b37f2e4fe27c9f6a46f8d5f7f31
DELETE /power_chips/1 DELETE /power_chips/1.json
[ { "docid": "d3c4dcb328afda87261865eaff86314e", "score": "0.7668783", "text": "def destroy\n @power_chip = DrmPowerChip.find(params[:id])\n @power_chip.destroy\n\n respond_to do |format|\n format.html { redirect_to power_chips_url }\n format.json { head :ok }\n end\n end", "tit...
[ { "docid": "5a3c899adbd9c21fbe7b47a8cf13da87", "score": "0.68940234", "text": "def destroy\n @chip.destroy\n respond_to do |format|\n format.html { redirect_to chips_url, notice: 'Chip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }...
e5ee4ebcd82cdc97969ee1e4449824b0
Returns a basic environment configuration object tied to the environment's implementation values. Will not interpolate.
[ { "docid": "150561f8794b28f6d842d815febbcc97", "score": "0.0", "text": "def get_conf(name)\n env = get(name)\n if env\n Puppet::Settings::EnvironmentConf.static_for(env, Puppet[:environment_timeout], Puppet[:static_catalogs], Puppet[:rich_data])\n else\n nil\n end\n ...
[ { "docid": "bd1d501b2cb07953ec759dab24efe265", "score": "0.6917069", "text": "def env_config; end", "title": "" }, { "docid": "bd1d501b2cb07953ec759dab24efe265", "score": "0.6917069", "text": "def env_config; end", "title": "" }, { "docid": "527db6ae635dc60dff973823548787...
e929e3efb187af9ad758a41279e6e7f9
GET /sub_items/1 GET /sub_items/1.json
[ { "docid": "7108b026b6dea990d7dbec3b56b4101f", "score": "0.0", "text": "def show\n redirect_to @kit\n end", "title": "" } ]
[ { "docid": "96514c3b8b6ff3d706a8b807a9ddb7b6", "score": "0.7733404", "text": "def item\n if @item = Item.find_by(id: params[:item])\n render :json => @item.to_json(:include => :subitem)\n else\n error_message(\"Item not found\")\n end\n end", "title": "" }, { "docid": "72...
8ac6a3dc0a155a48ba3d1db2b7328cfe
The Add method should return the input when called with a single integer number.
[ { "docid": "9952d2897ac3629d3415203b531cf9fc", "score": "0.0", "text": "def test_Add_Should_ReturnInput_When_CalledWithSingleIntegerWithCustomSeparatorDeclaration21\n # Arrange.\n @inputValue = '//-1\\n0'\n @expectedResult = 0\n\n # Act.\n @actualResult = self.act_Add(...
[ { "docid": "8922b52992b7fc4494384f8720b929f3", "score": "0.79864055", "text": "def add(number)\n \n end", "title": "" }, { "docid": "7fd3b6cccaf4bf2a6884d4758c1d2457", "score": "0.79502076", "text": "def add(num)\n \n end", "title": "" }, { "docid": "7...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0af8714459f3c67c8780429c2e05688a", "score": "0.0", "text": "def room_issue_params\n params.require(:room_issue).permit(:activityDate)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496205", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957069", "text": "def strong_params\n params.require(:request).permit(param_white...
96d5558b1eefc83fee6197aff88dc6c7
Make a request to the Fusion API token endpoint to get the access token. host the API's host path the oauth2 token path Examples bearer_token => "Bearer some_fake_access_token" Returns your access token
[ { "docid": "68afad712023b2684bce66caf00cf0ab", "score": "0.7788941", "text": "def bearer_token\n @_bearer_token ||= begin\n # Put the url together\n url = \"#{API_HOST}#{TOKEN_PATH}\"\n\n raise \"Please set your CLIENT_ID\" if @client_id.nil?\n raise \"Please set your CLIENT_SECRE...
[ { "docid": "33d93a1747374d9926986af4bf6eadfa", "score": "0.8380388", "text": "def bearer_token\n # Put the url together\n url = \"#{API_HOST}#{TOKEN_PATH}\"\n\n # Build our params hash\n params = {\n client_id: ENV['CLIENT_ID'],\n client_secret: ENV['CLIENT_SECRET'],\n grant_type: ENV['GRAN...
3befbb0ce005b9c4bdee9ecddbcb84ed
Workaround for similar issue
[ { "docid": "97cd345549b7851ea7687e0d16172ae0", "score": "0.0", "text": "def resolve_host(host)\n sleep_time = 5\n timeout_at = Time.now + 60\n msg = \"Waiting to resolve hostname '#{host}'; next attempt in #{sleep_time} seconds until #{timeout_at}\"\n resolved_host = \"\"\n wait_until(msg...
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.6989951", "text": "def private; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.5917968", "text": "def probers; end", "title": "" }, { "docid": "65ffca17e416f77c52ce148aeafbd826", ...
6ee42712b3d6808c8afedc969ba14b47
TODO: Lots of repetition here, can be refactored
[ { "docid": "b3976840bb49f80128db506c009d5a5b", "score": "0.0", "text": "def numerical_1_phrase\n return if numerical_size_1.blank?\n\n \"#{strip_trailing_zero(numerical_size_1)}#{numerical_units_1} #{numerical_description_1.to_s.titleize}\"\n end", "title": "" } ]
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.6259657", "text": "def desired; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.5782435", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", ...
d709f54383a208cb2400d43da2dd12b2
PATCH/PUT /treatment_plan_notes/1 PATCH/PUT /treatment_plan_notes/1.json
[ { "docid": "be651485aecad7dc2527c10cf070f85c", "score": "0.73514795", "text": "def update\n respond_to do |format|\n if @treatment_plan_note.update(treatment_plan_note_params)\n format.html { redirect_to patient_path(@treatment_plan_note.patient), notice: 'Treatment plan note was successf...
[ { "docid": "8990cfc7e81a1194ab1e61f14afd8cdb", "score": "0.69506824", "text": "def update\n respond_to do |format|\n if @treatment_note.update(treatment_note_params)\n format.html { redirect_to @treatment_note, notice: 'Treatment note was successfully updated.' }\n format.json { re...
b45354acba8b5d0734eb0a0f929853d7
Indicates whether there have been changes to the context that need to be persisted when the request finishes
[ { "docid": "ae11ff9a744c2c095f0964963597e918", "score": "0.6716634", "text": "def dirty?\n @dirty\n end", "title": "" } ]
[ { "docid": "83f7a0b7ac0c61e5cacdb28c26b70795", "score": "0.7001731", "text": "def dirty?\n session.dirty?\n end", "title": "" }, { "docid": "a7c6153b2ed868e57e8e7a9e6d75c2f6", "score": "0.68640167", "text": "def context_changed?(options)\n model.context_changed?(opti...
6db130f632798c77950f28a74397febb
Publish a service draft at umm_var_version 1.2
[ { "docid": "dba6a5c37bb13cd7c9c65ff55610cc4d", "score": "0.5670475", "text": "def publish_service_v1_2_draft(provider_id: 'MMT_2', native_id: nil, include_new_draft: false)\n ActiveSupport::Notifications.instrument 'mmt.performance', activity: 'Helpers::DraftHelpers#publish_service_v1_2_draft' do\n...
[ { "docid": "59d2ccaf23b2acce08a55bc3fff3ad46", "score": "0.6008313", "text": "def publish_service_draft(provider_id: 'MMT_2', native_id: nil, name: nil, long_name: nil, revision_count: 1, include_new_draft: false, number_revision_long_names: false)\n ActiveSupport::Notifications.instrument 'mmt.per...
c3a0edec099b7831f2f4699785bd6f9b
Display a given question
[ { "docid": "f839160d121206f4c9bb6b76e3eee42e", "score": "0.69251865", "text": "def show\n @question = Question.find(params[:id])\n end", "title": "" } ]
[ { "docid": "c4caaaf41a5a4541b7ac9485cb1c0fde", "score": "0.79244936", "text": "def display_question\n puts \"\"\n puts @questions[@next_question].question\n puts @questions[@next_question].options\n end", "title": "" }, { "docid": "cadcb685119d8003a7cb3cf8394e6b66", ...
4342c71a8d613d019b5c3ac871c8b15a
Capabilities specific to the `textDocument/foldingRange` request.
[ { "docid": "feae2738f3ca3380386f514c6eb6f60b", "score": "0.5900644", "text": "def folding_range; end", "title": "" } ]
[ { "docid": "3264e9fe5ca65ebf475c317da9fd3fdc", "score": "0.6531813", "text": "def folding_range\n attributes.fetch(:foldingRange)\n end", "title": "" }, { "docid": "0d43420415cab5e5351951796162d861", "score": "0.6232789", "text": "def folding_range_provider; end", ...
a95375994e4c94d07d1d0e2f623903ac
Sets the securityRequireUpToDateSecurityProviders property value. Require the device to have up to date security providers. The device will require Google Play Services to be enabled and up to date.
[ { "docid": "c8ce48532ec6539bb06300f3eb71a0d1", "score": "0.80363137", "text": "def security_require_up_to_date_security_providers=(value)\n @security_require_up_to_date_security_providers = value\n end", "title": "" } ]
[ { "docid": "64b274ee76ab87a3561b9f631ba2de33", "score": "0.7120329", "text": "def security_require_up_to_date_security_providers\n return @security_require_up_to_date_security_providers\n end", "title": "" }, { "docid": "45102fc87836e95970ff395a436fde99", "score...
96ec05dc30aa1b8d954d35f44fe974dc
returns array of upcoming games user is hosting
[ { "docid": "29c9b729c611a17352b66b90042e4e80", "score": "0.7405255", "text": "def upcoming_games_host\n self.games.all.select {|g| g.date >= Date.today}.sort\n end", "title": "" } ]
[ { "docid": "f4958b0ccd872548e85413a2368e0226", "score": "0.72350067", "text": "def upcoming_games_all\n (upcoming_games_host | upcoming_games_player).sort\n end", "title": "" }, { "docid": "6133e6ab38d70021028e2c98fa5bf5c6", "score": "0.67578405", "text": "def upcoming_games_play...
341b53d673cdd254b82ac0eed104aae9
Provide a detailed, user friendly representation source://twilioruby//lib/twilioruby/rest/flex_api/v1/configuration.rb114
[ { "docid": "473108fa97cee58671b779c2ccfec06f", "score": "0.0", "text": "def inspect; end", "title": "" } ]
[ { "docid": "e45aae6cf19159c6b724e62ea55023e7", "score": "0.7263866", "text": "def inspect\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.FlexApi.V1.ConfigurationContext #{context}>\"\n end", "title": "" }, ...
4f0e1cafc05c3fa30ed494cdd689b55c
Returns all Content with like tipe.
[ { "docid": "a68210e6b8627d974c563d283bb7dc42", "score": "0.56748813", "text": "def brothers\n Content.where(\"tipe = ?\", self.tipe).where(\"id NOT in (#{self.id})\")\n end", "title": "" } ]
[ { "docid": "9b38bfcf50dd4927fbc46998354e1cc4", "score": "0.6155501", "text": "def raw_content\n contents = objects.deref(@page_object[:Contents])\n [contents].flatten.compact.map { |obj|\n objects.deref(obj)\n }.map { |obj|\n obj.unfiltered_data\n }.join(\" ...
67fdd8baa46620302fb5149f3e02e1bd
store current uri in the session. we can return to this location by calling return_location
[ { "docid": "0426f070a0d86813f7bcf40f5ac62293", "score": "0.80812645", "text": "def store_location\n session['return-to'] = request.request_uri\n end", "title": "" } ]
[ { "docid": "2b28d7c862e76f19dba23db5b1bc319f", "score": "0.8451212", "text": "def store_location\n session[:return_to] = request.uri\n end", "title": "" }, { "docid": "2b28d7c862e76f19dba23db5b1bc319f", "score": "0.8451212", "text": "def store_location\n session[:r...
fa420d8025f07503cf94301b2b350c51
define search method to be used in Rails controller
[ { "docid": "ca3452d4af0506a01897a88fb2ede880", "score": "0.0", "text": "def search(query=nil, options={})\n\n options ||= {}\n\n # setup empty search definition\n @search_definition = {\n query: {},\n filter: {},\n facets: {},\n }\n\n # Prefill and set the f...
[ { "docid": "38e238bef783ca8e24175e4acc8c8fb5", "score": "0.8679269", "text": "def search\n\n end", "title": "" }, { "docid": "a5ae7e655eb7167a6857f4e6f969db03", "score": "0.86350936", "text": "def search\n\n end", "title": "" }, { "docid": "a5ae7e655eb7167a6857f4e6f96...
d343b030ac7c91bdacb7aa0ee4b74abd
DELETE /car_parks/1 DELETE /car_parks/1.json
[ { "docid": "136f19282ec5fbcb70364bcab1289493", "score": "0.6959785", "text": "def destroy\n @car_park.destroy\n respond_to do |format|\n format.html { redirect_to car_parks_url, notice: 'Car park was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "tit...
[ { "docid": "88ffaac4322e2d77c6ebb15d1ac6b537", "score": "0.69340646", "text": "def destroy\n @cartridge.destroy\n respond_to do |format|\n format.html { redirect_to cartridges_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bc85b3d60cdc1c...
a1917683e9fd576eca0e20ad8c351497
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.authentication_notifier.user_activation.subject
[ { "docid": "b95a61a7e3d4b5eb87b26b92c8d49c77", "score": "0.0", "text": "def start_processing(order, shop_type, host_with_port = \"https://www.swapidy.com\")\n @user = order.user\n @order = order\n @shop_type = shop_type\n subject = \"Ship your product\"\n if shop_type == \"sell\"\n @...
[ { "docid": "37252f767797f63ee95622ce99e9310c", "score": "0.70445776", "text": "def activation authentication_id, locale\n verification authentication_id, t('user_mailer.activation.subject'), locale\n end", "title": "" }, { "docid": "8928fe4f050d7ebd3e9aa992b07e320a", "score": "0.6992...