query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
84ad581315555121710b8b4b3ecf865e
DELETE /roll_calls/1 DELETE /roll_calls/1.json
[ { "docid": "187c0c4baaee3135c133f327a9f3920c", "score": "0.75007045", "text": "def destroy\n @roll_call.destroy\n respond_to do |format|\n format.html { redirect_to roll_calls_url, notice: 'Roll call was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "56eaa447fd88acbe0e3ad63f99c99a62", "score": "0.69473666", "text": "def destroy\n @request_call = RequestCall.find(params[:id])\n @request_call.destroy\n\n respond_to do |format|\n format.html { redirect_to request_calls_url }\n format.json { head :no_content }\n end\n ...
dd2a430acdc7817195664785e2509576
E.g. alias_example_to :crazy_slow, :speed => 'crazy_slow' defines crazy_slow as an example variant that has the crazy_slow speed option
[ { "docid": "7193b0e5c42a77b5a00a0d075d8df143", "score": "0.69713145", "text": "def alias_example_to(new_name, extra_options={})\n RSpec::Core::ExampleGroup.alias_example_to(new_name, extra_options)\n end", "title": "" } ]
[ { "docid": "9ebc67dad4ab497a6a518f6ffbdd563e", "score": "0.6999055", "text": "def alias_example_to(new_name, extra_options={})\n Rspec::Core::ExampleGroup.alias_example_to(new_name, extra_options)\n end", "title": "" }, { "docid": "9ae0171d634f4b121b11c92db40daf51", "score": ...
6d68f0c70240ffc793601234e2035197
POST /raw_food_product_categories POST /raw_food_product_categories.json
[ { "docid": "b003bf8edaa48a1936c5744d15d769f8", "score": "0.695936", "text": "def create\n @raw_food_product_category = RawFoodProductCategory.new(raw_food_product_category_params)\n\n respond_to do |format|\n if @raw_food_product_category.save\n format.html { redirect_to @raw_food_prod...
[ { "docid": "de1019d3d161e462915d4ceb82ed94b7", "score": "0.69357514", "text": "def create_category payload\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.post CATEGORIES, payload )\n\t\t\t\tend", "title": "" }, { "docid": "1677e4bf57ff6c6bd3966384405ce2bf", "score": "0.68...
1dc66b7ae271214a84f313f28b583cd4
TODO: is this required?!j must be provided in subclasses
[ { "docid": "5811a11aabbd69a362d75828a4fcac7e", "score": "0.0", "text": "def text(section_type: :default)\n nil\n end", "title": "" } ]
[ { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.7272362", "text": "def override; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.70291287", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a...
7066cf948ede9a8b364a7882fd642e1f
Send a Multipart HTTP POST request
[ { "docid": "8dd4f61f8a7326bf92fdc5e840130c55", "score": "0.74545264", "text": "def post_multipart(url, data={}, headers={}, http_options=@options)\n # determine the http options\n redirect_limit = http_options[:max_redirects] || max_redirects\n gateway_retries = http_options[:gatewa...
[ { "docid": "1e758d935832d0de2075b3f1096c4db5", "score": "0.78451645", "text": "def multipart_post(path, options={})\n make_http_request(path, options) do |path|\n request = Net::HTTP::Post.new(path)\n bodies = [yield(path)]\n delimiter = create_mime_delimiter\n request['...
e14fa4e7031010e7f6fa75279c80f104
Returns true if all options are truthy
[ { "docid": "ad5826fead61106086f68047b32f3e74", "score": "0.0", "text": "def init_and_validate\n # set default values\n if @gem_name\n @github_name ||= @gem_name\n @version_file ||= \"lib/#{@gem_name}/version.rb\"\n end\n\n @branch ||= 'master'\n\n @g...
[ { "docid": "ef2af509fcf7890f44ad043f39a9e893", "score": "0.776384", "text": "def all?\n !!options[:all]\n end", "title": "" }, { "docid": "ddf225b9c7e6cd93fb39ea609669dd25", "score": "0.74304265", "text": "def options?\n self.run_all_options\n end", "title": "" }, ...
81504f8a1bd797b08a69d4ac0a45ae0a
Replace a list element at a specified index with a new value
[ { "docid": "ad51354caedc54d9f00fd7654d5c15ed", "score": "0.66793776", "text": "def list_replace(column, index, value, options = {})\n updater(options) { list_replace(column, index, value) }.execute\n end", "title": "" } ]
[ { "docid": "51ea02d9e382bf76a980fcc1fe8634da", "score": "0.70441437", "text": "def update_element_from_index(array, index_number, element)\n array[index_number]=element\n\nend", "title": "" }, { "docid": "f4655a48b2367ce88d1c6c49e21af314", "score": "0.6759203", "text": "def replace_...
6ab4aeeda73c766a377f109c85b3b411
Get the status for the Logical Router of the given id Returns status for the Logical Router of the given id.
[ { "docid": "096d968e46f3ebcf8849ae025b2dcc96", "score": "0.7013611", "text": "def get_logical_router_status_with_http_info(logical_router_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LogicalRoutingAndServicesApi.get_logical_router_status ....
[ { "docid": "3204643f95cc50f7afd84327ccca32bb", "score": "0.7431187", "text": "def get_logical_router_status(logical_router_id, opts = {})\n data, _status_code, _headers = get_logical_router_status_with_http_info(logical_router_id, opts)\n data\n end", "title": "" }, { "docid": "...
87e24c43a701a57fe3354f86ff1e68c8
POST /cart_lines POST /cart_lines.json
[ { "docid": "3ef39bead72232c20731118dec3c2217", "score": "0.75400746", "text": "def create\n @cart_line = CartLine.new(cart_line_params)\n\n respond_to do |format|\n if @cart_line.save\n format.html { redirect_to @cart_line, notice: 'Cart line was successfully created.' }\n forma...
[ { "docid": "abbdc87a027164aecf8d0c66c567fa62", "score": "0.7399511", "text": "def create\n # Here we get the :product_id paramater from the request, we store it in a local\n # variable because there is no need to make it available to the view.\n product = Product.find(params[:product_id])\n ...
96cd89c4f46d8c0d43e5055cd33d08ba
name, cp, hp, favorite, and gender are entered by the user height, weight, stages, and types come from the API request
[ { "docid": "38f2be8cd16892685aebef01b605006a", "score": "0.0", "text": "def initialize(id=nil, pokedex_id=nil, name=nil, height=nil, weight=nil, gender=nil, favorite=nil, hp=nil, cp=nil, evolves=nil, type1=nil, type2=nil)\n\t\t@id = id\n\t\t@name = name\n\t\t@height = height\n\t\t@weight = weight\n\t\t@...
[ { "docid": "1a56e32524105b951ac45baff11b8bd9", "score": "0.59688824", "text": "def user_type_params\n params.require(:model).permit(:birth_date, :gender, :height, :bio,\n :weight, :ethnicity, :eye_color, :hair_color, :cup, :bust, :waist, :hips, \n ...
ff8dab6e90b179b5a5f0367ffadddd05
Deletes the edge from its graph.
[ { "docid": "71ddfcdc513a0cc7195f7613f7915bab", "score": "0.85799783", "text": "def delete!\n graph.removeEdge element\n end", "title": "" } ]
[ { "docid": "5fe76916b8e6e1cbf3d2203df9cca616", "score": "0.85338205", "text": "def delete!\n graph.remove_edge element\n end", "title": "" }, { "docid": "5fe76916b8e6e1cbf3d2203df9cca616", "score": "0.85338205", "text": "def delete!\n graph.remove_edge element\n end",...
9c74b4c4dfe0d0cca963340ef1172c83
TODO : must be private
[ { "docid": "f6c85c6e19bf93e84f0dc48254ff90b8", "score": "0.0", "text": "def initialize(context_model, strategy_parameters)\n columns = self.class.columns\n @context_model = context_model\n\n # TODO - rpc : Use the defined AccessorHash\n #@strategy_hash = const_get(\"#{name}_...
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.8036212", "text": "def private; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.67866755", "text": "def probers; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", ...
6f57f5cba1c756af3f46b338ef52d76a
Returns the value of attribute reloaders.
[ { "docid": "5fcff2ec9cdb34a3c46e3e391491e855", "score": "0.5630054", "text": "def reloaders; end", "title": "" } ]
[ { "docid": "73886ba7e7e0a3fbd421df4254479e92", "score": "0.63800097", "text": "def watchers\n attributes.fetch(:watchers)\n end", "title": "" }, { "docid": "b9b984ac25b9935aa1b98026fd290a08", "score": "0.5414111", "text": "def digesters\n @digesters\n end"...
355776ab1393f631c3e2484add93aa25
Determine whether the index with this repository's index name exists.
[ { "docid": "b9f185fcedf1f0845d0387d2d166d155", "score": "0.70393217", "text": "def index_exists?(*args)\n super\n end", "title": "" } ]
[ { "docid": "0da559b215b90424587489777628ca1e", "score": "0.8459811", "text": "def exist?\n @index_info.index_exists?\n end", "title": "" }, { "docid": "d1757eddb1886e331913fae1968eaa3b", "score": "0.82835484", "text": "def exists\n resp = create_request().get(build_index...
0952e8608d3db64d67c3108f18e4931f
grab fb_token to access Facebook for user data
[ { "docid": "e4262ab06b4cdc64010c812b5e7f94e6", "score": "0.7874801", "text": "def fb_token\n x = self.authentications.find_by(provider: 'facebook')\n return x.token unless x.nil?\n end", "title": "" } ]
[ { "docid": "b0ad20f415224536e2ca244508527998", "score": "0.80043614", "text": "def fb_token\n \tx = self.authentications.find_by(provider: 'facebook')\n \treturn x.token unless x.nil?\n end", "title": "" }, { "docid": "716c33baf45224258023cf6a0e6c129b", "score": "0.79692453", ...
b877aae7463c4e78dd237789cd984a67
GET /blacklist_domains/1/edit def edit end POST /blacklist_domains POST /blacklist_domains.json
[ { "docid": "6668bcd1953c91ddf4c149178a24d40a", "score": "0.6492263", "text": "def create\n @blacklist_domain = BlacklistDomain.new(blacklist_domain_params)\n\n respond_to do |format|\n if @blacklist_domain.save\n format.html { redirect_to admin_blacklist_domains_path, notice: 'Blacklis...
[ { "docid": "c60b632f269a479763a65dc95bec2ff0", "score": "0.7266153", "text": "def set_blacklist_domain\n @blacklist_domain = BlacklistDomain.find(params[:id])\n end", "title": "" }, { "docid": "1b6a5da1ff72a302bdb095222bef7d2c", "score": "0.65783876", "text": "def update\n ...
a6527a2ee7f77ed7a93a4b65ae76ef25
Obtain an InputSet object, used to define inputs for an execution of this Choreo.
[ { "docid": "a1c4980c3dc97756d47093d74d9ac330", "score": "0.0", "text": "def new_input_set()\n return FinalizeOAuthInputSet.new()\n end", "title": "" } ]
[ { "docid": "64c57f88a4eac6079f885b7b88602378", "score": "0.66515636", "text": "def execute(input_set = nil)\n # If the inputs are not configured, create a blank set.\n if input_set == nil\n input_set = InputSet.new()\n end\n param_map = {\"source_id\" => TembooSession.get_identifier()}\...
69212c07fb00ba79d1595a8b11551e83
An array that replaces the third character with a $
[ { "docid": "3d9ccbf7241f6fccdf376a5b3772c574", "score": "0.6763184", "text": "def kesha_maker(array)\n array.each do |character|\n character [2] = '$'\n end\n array\nend", "title": "" } ]
[ { "docid": "94f0a9fb893fffb7e9bf0949d22367fb", "score": "0.7328177", "text": "def kesha_maker(array)\n cash_money = []\n array.each { |string| cash_money << string.gsub(string[2], \"$\") }\n cash_money\nend", "title": "" }, { "docid": "b2c05ab77d46ffaf6ed18b8438a7eb3a", "score": "0.71...
953489d56e44538ae28ea06806021157
sets active status on remote server
[ { "docid": "567c463c70bb790747442db47c6daaab", "score": "0.79557425", "text": "def set_status\n #sets active status on remote server\n NereusStatsItem.delay.set_status(id)\n end", "title": "" } ]
[ { "docid": "2b30c0ac132a5ff66b4c22fdfcd198b7", "score": "0.7254213", "text": "def set_online\n\tself.status = \"online\"\nend", "title": "" }, { "docid": "fe575c5c8ba32a734f0412421fd13327", "score": "0.68207395", "text": "def status=(status); end", "title": "" }, { "docid...
15ae1850a382b99d4ecce2b1e635ad92
Each parser registers its class and the device strings that it understands by calling this method.
[ { "docid": "d3fe2c26dd7dc695cd43cf6e468f7fb0", "score": "0.0", "text": "def add(klass, string)\n if string.is_a? Regexp\n patterns[string] = klass\n else\n table[string] = klass\n end\n end", "title": "" } ]
[ { "docid": "7f7978b17a557ad434423fcbc4c30f5b", "score": "0.5954988", "text": "def register(parser)\n parsers.push parser\n end", "title": "" }, { "docid": "608eea7a6780817e4ff7de2d59a2b790", "score": "0.59235466", "text": "def register(name, klass)\n @@parsers ||...
b3ca1e109764fb5fe2082d2b4ccf6d7b
GET /probs/1 GET /probs/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "66b40c0dc68cbf72f11486881304420a", "score": "0.65475965", "text": "def show\n @prob = Prob.find(params[:id])\n @states = State.find_all_by_prob_id(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prob }\n end\n end", ...
e3bcbf0562ade5131b691e91b9c9c529
TODO: These response needed to be refactored ASAP
[ { "docid": "c33580e16657d3b7263d3fd4487c1e31", "score": "0.0", "text": "def welcome\n 'Halo, saya asisten robot ciptaan @qisthi yang bisa membantu kamu untuk mendapatkan informasi-informasi yang kamu butuhkan. Tulis BANTU untuk melihat daftar perintah yang saya ketahui :D'\n end", "title": "" ...
[ { "docid": "a3f859a7427c409d2754846c5480007d", "score": "0.64927167", "text": "def response_maps; end", "title": "" }, { "docid": "05e002c8b22b686a0b1ee64aabb3c566", "score": "0.64240533", "text": "def responses; end", "title": "" }, { "docid": "05e002c8b22b686a0b1ee64aab...
cfc94fee85ac073ea8433322461be9a6
Confirms the correct user.
[ { "docid": "c94803d0b4a63cad1e451402a41f25a6", "score": "0.0", "text": "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_url) unless current_user?(@user)\n end", "title": "" } ]
[ { "docid": "c96f27a6347be3bc55a20e8450db1ec9", "score": "0.72449994", "text": "def correct_user\n @user = User.find(params[:id])\n unless current_user == @user\n flash[:warning] = \"You are not authorized to do that.\"\n redirect_to root_path\n end\n end", "title": ""...
44602ca115123802caaec0e0b269c7d5
To prevent a browser from opening AT ALL, use this method passing .mock_watir_browser as the mock to use. Idea swiped from
[ { "docid": "c74eb1ca3328eb3afb725621628372f7", "score": "0.63380796", "text": "def mock_browser_at_creation mock_browser = nil\n puts \"MOCKING BROWSER\"\n if mock_browser.nil?\n allow_any_instance_of(AdminModule::Pages).to receive(:browser).and_return(HardBrowserMock.new)\n else\n allow_any_in...
[ { "docid": "b5256e07c7caee0d2cbe8cd47573bfa5", "score": "0.6607934", "text": "def ensure_only_one_browser_window_open\n $tracer.trace(\"PowerUpRewardsDSL : #{__method__}, Line : #{__LINE__}\")\n $tracer.report(\"Should #{__method__}.\")\n if(browser_count > 1)\n for i in (browser_count - 1...
156acaeca946a02027d4a589ffb3a653
Verify on_error is called
[ { "docid": "a27620bf72f6d9526d72e230dcb96103", "score": "0.0", "text": "def test_on_error\n handler_class = Class.new(OldMessagingHandler) do\n def initialize() super; @error = []; @unhandled = []; end\n def on_error(event) @error << event.method; end\n def on_unhandled(event) @unhandl...
[ { "docid": "7cb2b2357a6b0280dfdc5080265cfba1", "score": "0.8146723", "text": "def on_error(error); end", "title": "" }, { "docid": "7cb2b2357a6b0280dfdc5080265cfba1", "score": "0.8146723", "text": "def on_error(error); end", "title": "" }, { "docid": "a7efae74e5d32bd154f9...
90209219841aac9a6ba132aa4abf1572
Internal: Adds diagonal movements to a classes moves list. how_many Range (1..x) or Integer
[ { "docid": "709cd700d8b5b4158b52730216f7db22", "score": "0.7284233", "text": "def diagonally_in_any_direction(how_many)\n Array(how_many[:cells]).each do |n|\n @moves.push Move.new( n, n), Move.new(-n, -n),\n Move.new(-n, n), Move.new( n, -n)\n end\n ...
[ { "docid": "767f4a5bea2ae3cef89dff4e93729fe8", "score": "0.64281625", "text": "def straight_in_any_direction(how_many)\n Array(how_many[:cells]).each do |n|\n @moves.push Move.new( n, 0), Move.new(-n, 0),\n Move.new( 0, n), Move.new( 0, -n)\n end\n ...
02fda1c50562b7691afc185c30560335
Update a question (send the form)
[ { "docid": "ade6c93c35f15a51bae1f5e1331cab39", "score": "0.71990573", "text": "def update\n @question.statement = params[:question][:statement]\n unless @question.online\n @question.level = (@chapter.section.fondation? ? 0 : params[:question][:level])\n if @question.is_qcm\n if pa...
[ { "docid": "a2b3f3325f72d46ed889192381f34dd3", "score": "0.80497414", "text": "def update\n updater = QuestionUpdater.new(@_question, question_params) # TODO QuestionUpdater\n if updater.save\n flash[:success] = updater.message\n redirect_to question_path(@question)\n else\n flas...
388a4b41a818ec4eef9417376badf778
Run a loop and execute tasks in the scheduled order and at the approximate scheduled time. If no tasks remain the thread will exit gracefully so that garbage collection can occur. If there are no ready tasks it will sleep for up to 60 seconds waiting for the next scheduled task.
[ { "docid": "27ef29d4b11317a024a49f62a885913a", "score": "0.0", "text": "def process_tasks; end", "title": "" } ]
[ { "docid": "81cad692115039855288045b8e5950a6", "score": "0.7175032", "text": "def run\n @running = true\n while @running \n @scheduled.synchronize do\n timeout = nil\n if @scheduled.any?\n timeout = @scheduled.first.last.time - @wait_policy.now\n...
d2982c127b814037b32fc0e91f7a986d
DELETE /hot_masters/1 DELETE /hot_masters/1.json
[ { "docid": "e20928a10a51d6699caf90784cdfd402", "score": "0.7711471", "text": "def destroy\n @hot_master.destroy\n respond_to do |format|\n format.html { redirect_to hot_masters_url, notice: DELETE_NOTICE }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "8b7ca6b8c36c064899e5123717575079", "score": "0.6886758", "text": "def destroy\n @pharmaceutical_master.destroy\n respond_to do |format|\n format.html { redirect_to pharmaceutical_masters_url, notice: DELETE_NOTICE }\n format.json { head :no_content }\n end\n end", "ti...
520b34ed5fd27f2685dde643d7bc8099
Utility method, creates the folder browse dialog, if not present
[ { "docid": "d0b2252f0ece9ffc1eeafad5e8526ed0", "score": "0.65612525", "text": "def create_browse_form\n\t\n\t\t\t# Create child form if not present\n\t\t\tif @dir_browse_form.nil?\n\t\t\t\n\t\t\t\t# Call GUI Utility Method to handle child form creation\n\t\t\t\tresult = GuiUtils.create_child_form({\n\t\...
[ { "docid": "26c615e4c6e4781e251a9e714a2dbeb3", "score": "0.730219", "text": "def create_folder_chooser icon=Gtk::Stock::SAVE\n \n chooser = Gtk::FileChooserDialog.new(\"Choose a folder\", @glade.get_widget(\"mainWindow\"),\n Gtk::FileChooser::ACTION_CREATE_...
4cfa63c4ef51991f616cf17cdd3cd2b1
Apply Markdown header transforms to a copy of the given +str+ amd render state +rs+ and return the result.
[ { "docid": "cb6c8b7d17572fe69d8b3adfd0265f12", "score": "0.6609781", "text": "def transform_headers( str, rs )\n\t\t\t@log.debug \" Transforming headers\"\n\n\t\t\t# Setext-style headers:\n\t\t\t#\t Header 1\n\t\t\t#\t ========\n\t\t\t#\n\t\t\t#\t Header 2\n\t\t\t#\t --------\n\t\t\t#\n\n\t\t\tsecti...
[ { "docid": "b21d06f969c5b1d886cec901157c5594", "score": "0.61644787", "text": "def apply_span_transforms( str, rs )\n\t\t\t@log.debug \"Applying span transforms to:\\n %p\" % str\n\n\t\t\tstr = transform_code_spans( str, rs )\n\t\t\tstr = transform_auto_links( str, rs )\n\t\t\tstr = encode_html( str )\...
c903c53748bc7a99f885961755160da6
Profile picture image helper for senator/staff profiles
[ { "docid": "7188fdce4557bfc54a32c2f6fb9a41f9", "score": "0.7336047", "text": "def avatar_photo (person)\n if person.image.attached?\n image_tag person.image\n else\n image_tag \"static/placeholder.jpg\"\n end\n end", "title": "" } ]
[ { "docid": "14880f884a05fd415d7be88810ff4536", "score": "0.8244625", "text": "def profile_image(profile)\n url = Gravatar.new(profile.display_email || '@').image_url size: 40,\n secure: true, default: :mm\n image_tag url, alt: \"gravatar for #{profile.name}\",\n style: 'wi...
711a96dbc349e2b64e92f91d91b8847a
DELETE /notecollections/1 DELETE /notecollections/1.json
[ { "docid": "def5401abcc64709775bd2c117569dda", "score": "0.76086146", "text": "def destroy\n @notecollection.destroy\n respond_to do |format|\n format.html { redirect_to notecollections_url, notice: 'Notecollection was successfully destroyed.' }\n format.json { head :no_content }\n en...
[ { "docid": "eb177e5e27a1f10647bcf349e74a1d04", "score": "0.788674", "text": "def destroy\n @notecollection = Notecollection.find(params[:id])\n @notecollection.destroy\n\n respond_to do |format|\n format.html { redirect_to notecollections_url }\n format.json { head :no_content }\n ...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "fd28027c9d6203a1e4b44f2398eb26f6", "score": "0.0", "text": "def place_order_params\n params.permit(:group_id, :first, :second, :third, :remark)\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...
ae134b37e442c0d7a13a89b11476be2a
Returns the currently installed version hash (void)
[ { "docid": "3dd6de87422e5db58e80c67ad608159d", "score": "0.0", "text": "def _query\n slots = {}\n categories = Set.new\n\n _package_glob.each do |directory|\n %w[SLOT PF CATEGORY repository USE BUILD_TIME].each do |expected|\n raise Puppet::Error, \"The metadata file \\\"#{expected}...
[ { "docid": "5aff70259eca816aeede91a9e1d5383b", "score": "0.70652306", "text": "def installed_version\n return \"\"\n res = self.get_option(\"version_installed\")\n unless res.present? # fix for old installations\n res = self.settings[\"version\"]\n self.installed_version= res\n end...
2d0b33e72b02ce3e2dc286cd51b3b24e
tra ve so lan duoc nghi ngoi giua cac ca phong van tham so la danh sach cac ca ma sinh vien da tham gia
[ { "docid": "e919d6b1e8e6aef8a59bfb408ad0f883", "score": "0.0", "text": "def thoi_gian_nghi_ngoi a\t\n\t\t(a.size-1).times.count {|i| a[i]+1<a[i+1] || a[i]==5}\n\tend", "title": "" } ]
[ { "docid": "a6778fc2cfea5a03f986845a2e505482", "score": "0.6289129", "text": "def phonetic; end", "title": "" }, { "docid": "deffb1dc7f7ee16e9cae0c107e8bec07", "score": "0.62104815", "text": "def pigelate(word)\n if Vowels.include?(word[0]) #vowel_start?(word)\n word + \"way\...
73c26e59b221ef817c63a7edfca94d20
Returns array of columns names associated with ordered tree structure
[ { "docid": "41aeddef77bb6141288f1d4f38f8c589", "score": "0.0", "text": "def to_a\n @columns.values.flatten.compact\n end", "title": "" } ]
[ { "docid": "b541250e772299a214fc0550349d64a0", "score": "0.6787539", "text": "def column_names\n columns_in_order.map { |c| c.name }\n end", "title": "" }, { "docid": "83a83e7d5f7c6401f7dac7895fb3fbbf", "score": "0.65740114", "text": "def tree_ordered_names\n tree_order_na...
db35d7550bb40ed7ee2a00b8f3e1aa2e
Generate an ECS task definition as serialized JSON.
[ { "docid": "7c57bebd43ab268487714635d0bdc952", "score": "0.5751791", "text": "def json\n # We do not want to insert much extra whitespace, because ECS imposes\n # a maximum file-size limit based on bytes.\n JSON.generate(generate())\n end", "title": "" } ]
[ { "docid": "ca0c6d7ce15f427cff8ba88dc4667f68", "score": "0.69049025", "text": "def describe_task_definition(params={})\n request({\n 'Action' => 'DescribeTaskDefinition',\n :parser => Fog::Parsers::AWS::ECS::DescribeTaskDefinition.new\n }.merge(params))\n ...
e33d32ff328d531216fba59fd19255fe
Returns an IO object, or errors if the path is invalid. Defaults to STDIN.
[ { "docid": "e6c1114b4bfd1aaae9312f78138ad143", "score": "0.7146412", "text": "def io_target( path = nil )\n return STDIN if path.nil? \n return File.open(path) if File.exists? path\n exit_with_error \"Could not open file #{path}\"\nend", "title": "" } ]
[ { "docid": "9e5fd6dea243fe5fa0e9b83187245c61", "score": "0.62566316", "text": "def io\n @io ||= IO.new(@fd=stdin.fd) \n end", "title": "" }, { "docid": "8f152e651b3f8ddf691b9b10ad57d375", "score": "0.6038502", "text": "def io(&blk)\n if @args[:data].is_a?(StringIO)\n ...
6b2310be99b9af1519ad3249aabcd9e7
Malware Kit Returns the details for a malware kit.
[ { "docid": "000504b6ed31f25fbbe0f957fa4bf00f", "score": "0.6295899", "text": "def get_malware_kit_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VulnerabilityApi.get_malware_kit ...'\n end\n # verify the required para...
[ { "docid": "c6e677bfa0f5b5b94bab125bd2f89774", "score": "0.6756197", "text": "def get_malware_kits(opts = {})\n data, _status_code, _headers = get_malware_kits_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "f47a4e51d2a7262597c44506ed520cae", "score": "0.66699...
2463bdc512b5379fcce083c0884ffad2
Tries to find the session ID in the requests cookies.
[ { "docid": "6079c82f8ccae6e682017e4f187c88f7", "score": "0.79171956", "text": "def extract_session_id(req)\n sid = req.cookies[@key]\n # the request didn't have the session cookie so create a new session ID.\n return generate_sid if sid.nil?\n # sometimes the cookie contains ...
[ { "docid": "3015b2de483a69a56cf35d6941fb296b", "score": "0.7816233", "text": "def extract_session_id(req)\n sid = req.cookies[@key]\n # returning `nil` just causes a new ID to be generated.\n return if sid.nil?\n # sometimes the cookie contains just the session ID.\n r...
8f2727d2d463887bc7d7d4131d9d273b
=begin Push element x to the back of queue. :type x: Integer :rtype: Void =end
[ { "docid": "1b07b7473f1e35ef66d1e9d742edbd5f", "score": "0.69237596", "text": "def push(x)\n @stack1.push(x)\n end", "title": "" } ]
[ { "docid": "8e6191365262c3e80af12bbfc397a6c3", "score": "0.8444955", "text": "def push(x)\n @queue << x\n\n @size.times do\n @queue << @queue.shift\n end\n\n @size += 1\n\n return\n end", "title": "" }, { "docid": "cebcf068b5bce49cb5c42f057d0949c3", "score": "0.81188...
efb6987346f49e1e9bba3a042ca13956
++ Format the specified score with 2 precision decimals and highlights it with an image if it exceeds the specified bias.
[ { "docid": "e501127929b51412bb83949a86e268cd", "score": "0.8315983", "text": "def format_score( score, bias = 800 )\n ( (score.to_f > bias.to_f ? \"#{image_tag(\"asterisk_orange.png\")} \" : '') + sprintf(\"%02.2f\", score.to_f) ).html_safe\n end", "title": "" } ]
[ { "docid": "fd33870e8df8250bfcfe7b97f381d31b", "score": "0.6048219", "text": "def prettify_score(score)\n '%.2f' % score\n end", "title": "" }, { "docid": "7cc625fd05950a97328bd6fde2c657a3", "score": "0.5775573", "text": "def pretty_score\n \"%3.1f%\" % (@score*100)\n ...
aa3350a2b442aec5334c44807f87fabd
Returns an array of strings. Each element in the array is the name of attached files.
[ { "docid": "cbbd75a1178125b16436476ff26aa1d0", "score": "0.743057", "text": "def attachments\n names = []\n frm.ul(:class=>\"attachList indnt1\").links.each { |link| names << link.text }\n return names\n end", "title": "" } ]
[ { "docid": "770949c32f2933dd21e5662f69002fa6", "score": "0.7645426", "text": "def filenames\n files.map(&:filename)\n end", "title": "" }, { "docid": "770949c32f2933dd21e5662f69002fa6", "score": "0.7645426", "text": "def filenames\n files.map(&:filename)\n end", "...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ffb2b04f0b89b435a062b2bc225f418a", "score": "0.0", "text": "def set_alert\n @alert = Alert.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...
65911e617d1c3df75ab69348141675f7
Sets the password reset attributes.
[ { "docid": "1bd18669844cd6fde749256a6c3f5566", "score": "0.0", "text": "def create_reset_digest\n self.reset_token = User.new_token\n update_attribute(:reset_digest, User.digest(reset_token))\n update_attribute(:reset_sent_at, Time.zone.now)\n end", "title": "" } ]
[ { "docid": "58e818e594c709af66259ea48fb80ae5", "score": "0.7047396", "text": "def send_reset_password_instructions(attributes={})\n send_instructions_for(:reset_password, attributes)\n end", "title": "" }, { "docid": "25ee2d2b1be7272b7d99d5efaf63119a", "score": "0.6689904...
8bf35f271866337217142ada45944691
helper method client.search_by_category("chicago", "vehicle/car")
[ { "docid": "32c1d16a695001979f0fb65ec28b0578", "score": "0.7489994", "text": "def search_by_category(region,category, options={})\n options.merge!({:region => region}) if region\n options.merge!({:category => category}) if category\n self.listing(options)\n\n end", "title": "" } ...
[ { "docid": "04c48ffc643343e1497515728a456373", "score": "0.7461453", "text": "def search(location, categories)\n url = \"#{API_HOST}#{SEARCH_PATH}\"\n params = {\n term: \"restaurants\",\n location: location,\n categories: categories,\n limit: \"1\",\n radius_filter: \"2\",\n sort: \...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "67acfc453689b6fb73e41b6f22c0ece1", "score": "0.0", "text": "def interview_params\n params.require(:interview).permit(:startTime, :endTime, :interviewDate, :participants, :title, :resume)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69795185", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6782116", "text": "def strong_params\n params.requ...
e60a89f6426b18f4c006ea8f13df9927
GET /tipo_processos GET /tipo_processos.xml
[ { "docid": "c2b02dc1ff2bde43970b336118d8df28", "score": "0.7240728", "text": "def index\n @tipo_processos = TipoProcesso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tipo_processos }\n end\n end", "title": "" } ]
[ { "docid": "fc81a078e566a1f9bd0d1969b0c0e2cf", "score": "0.7074588", "text": "def show\n @tipo_processo = TipoProcesso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_processo }\n end\n end", "title": "" }, { ...
1c3c1f8f228f045d93262dc5d592effa
Get area code based on given hash and key
[ { "docid": "e076ddf77309364e9e8a74be466cacfd", "score": "0.77911", "text": "def get_area_code(somehash, key)\n somehash[\"#{key}\"]\nend", "title": "" } ]
[ { "docid": "61e1a1c39b7c7d261d5dc6fa0ee22419", "score": "0.83555526", "text": "def get_area_code(hash, k)\n\thash[key]\nend", "title": "" }, { "docid": "e5ec5b6ae68da67751d541bb8a8e862b", "score": "0.8276789", "text": "def get_area_code(somehash, key)\n somehash[key]\n end", ...
3f8ba30872388a8b6aba3f3125ef8e3a
reports stat total (atk + added_atk) stats symbols :hp :mp :atk :def :spd mode :add :base :bonus
[ { "docid": "468ae4969d6e036f9543ace6e9521c46", "score": "0.0", "text": "def read_stat(stat, mode=:add)\n var = @mhp + @added_stats[stat] if stat == :hp && mode == :add\n var = @mmp + @added_stats[stat] if stat == :mp && mode == :add\n var = @attack + @added_stats[stat] if stat == :atk && mode =...
[ { "docid": "bede18b230b27a5ffeab6644b0ce4fec", "score": "0.75422007", "text": "def total\n @hp + @attack + @defense + @speed + @sp_atk + @sp_def\n end", "title": "" }, { "docid": "d363aeed3cbb07422d833578a105f8dc", "score": "0.69844025", "text": "def base_sum\n hp + at...
f9af2cceb2d771f56d19d6588d8bdc4d
GET /oils/new GET /oils/new.xml
[ { "docid": "45b2f4b5c9d629109b0d49871a1b0214", "score": "0.7097871", "text": "def new\n @oil = Oil.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @oil }\n end\n end", "title": "" } ]
[ { "docid": "21a45db0041828210bf9275fe6809683", "score": "0.7023916", "text": "def new\n @omatsuri = Omatsuri.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @omatsuri }\n end\n end", "title": "" }, { "docid": "23cdde8d4b1a2be0bc3...
ba6b51f21ecbe0b1b3897475925629c3
A callback triggered when the server receives data from the client. Subclasses and/or modules should override this method to provide their own functionality.
[ { "docid": "58c2e67ea8f0acb29c28c8e57aff9c92", "score": "0.6643239", "text": "def receiving(data); end", "title": "" } ]
[ { "docid": "8ceba49a2f18c91a06d2c3e40c936402", "score": "0.73955023", "text": "def on_client_data(client)\n end", "title": "" }, { "docid": "a74e55c45bd5f218a9cde8c396d41763", "score": "0.7119863", "text": "def receive_data &block\n self.on_data_received = block\n end", ...
88478dc5a9d61361d7dc912edca653f8
return_code:: 200 Returns binary object data only. return_code:: 403 User has no access to binary object. return_code:: 404 Binary object not found. description:: Get the binary object data only.
[ { "docid": "4093c5c576d89dedc879f561c4af899f", "score": "0.5265304", "text": "def show_data\n options = { :disposition => 'inline' }\n if @bin_object.content_type\n options[:type] = @bin_object.content_type\n end\n\n if @bin_object.orig_name\n options[:filename] = @bin_object.orig_...
[ { "docid": "eb763c3631cd66ce9179d1e6f3ca02f6", "score": "0.6775208", "text": "def binREAD( dataObject )\n\t\theader = {}\n header['Accept'] = \"application/cdmi-object\"\n header['X-CDMI-Specification-Version'] = '1.0.1'\n\t\t\t\n\t\tbegin\n\t\t # FIXME: normal do...
f42be53bade1ef87c60883675d9ac856
PATCH/PUT /servers/1 PATCH/PUT /servers/1.json
[ { "docid": "062383814f33c10ead686067c39b5d42", "score": "0.55465204", "text": "def update\n respond_to do |format|\n if @gameserver.update(server_params)\n format.html { redirect_to @gameserver, notice: 'Server was successfully updated.' }\n format.json { render :show, status: :ok,...
[ { "docid": "57039a2e0ccc62e3ed084530fe7cfb50", "score": "0.6643922", "text": "def update\n @server = Server.find(params[:id])\n checkaccountobject(\"servers\",@server)\n respond_to do |format|\n if @server.update_attributes(params[:server])\n @server.send_update\n format.html...
5ddc797b0536839a3a1cf66a3463021b
FUNCTIONS : forwarded, shortlisted, rejected, hold, joined, offered, future DESCRIPTION : Hr functions which are used by the ADMIN/HR. These functions are used when HR/ADMIN wants to see all the reqmatches of specified status.
[ { "docid": "92a4f8eef009af20ff7e9f3246533c22", "score": "0.0", "text": "def forwarded\n @status = \"FORWARDED\"\n @is_req_match = 0\n @after_shortlist_page = false\n @forwards = get_hr_matches(@status) \n if params[:mine]\n @forwards = @forwards.find_all{|f| f.resume.refer...
[ { "docid": "410ec594a0e756db23335aa7a801204d", "score": "0.62151045", "text": "def status(*) end", "title": "" }, { "docid": "410ec594a0e756db23335aa7a801204d", "score": "0.62151045", "text": "def status(*) end", "title": "" }, { "docid": "0c409bbfbc9573fca4501e1d438202b4...
a5f690373d4f8e7fdb17b1d6797cab68
Provide a user friendly representation source://twilioruby//lib/twilioruby/rest/messaging/v1/service.rb187
[ { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.0", "text": "def to_s; end", "title": "" } ]
[ { "docid": "0e9f3fe874caafeeefceb3370bff04e0", "score": "0.6510667", "text": "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Messaging.V1.ServiceInstance #{values}>\"\n end", "title": "" }, { "docid": "97f1d565a4e9c187dcbe09526db...
692eb246f5768f414f01f92a1bd2ac11
These two definitions are only acceptable temporarily, because we will for now only deal with integers
[ { "docid": "e9137458d19bd192f6d99744a51098b7", "score": "0.0", "text": "def * other\n mul(other)\n end", "title": "" } ]
[ { "docid": "4c4c0d8140e06d8f74124d060c3c358e", "score": "0.72689617", "text": "def Integer(p0) end", "title": "" }, { "docid": "be60cabe7910c8860e425797914a2bb2", "score": "0.663606", "text": "def integer?() end", "title": "" }, { "docid": "ffcc6a70be73f5f63ee43f49d9a0c70...
3c0e8f183aadc2ee07f301d606695110
Creates the API with a given name using the SDK and returns the id Arguments [api_name] A String representing the name of the API Gateway Object to be created [api_description] A String representing the description of the API
[ { "docid": "22eea7d7d13590609687af6e72b66f7d", "score": "0.86051875", "text": "def setup_apigateway_create_rest_api(api_name, api_description)\r\n puts 'Creating API with name ' + api_name\r\n api = @client.create_rest_api(name: api_name, description: api_description)\r\n api.id\r\n en...
[ { "docid": "ad556be4abc97e633dc7395c24917dce", "score": "0.6575114", "text": "def to_create_request\n 'create_%s' % api_name\n end", "title": "" }, { "docid": "8f9adff7a6261c3555363c65ed9b1c21", "score": "0.65471745", "text": "def create_by_api(params = {})\n creat...
9d8a651b6fc58d0c932d9123fc2f623a
Update the info hash with information on whether the given method was called, according to the coverage information.
[ { "docid": "33433322f95ab82147dbfd4b994181e3", "score": "0.7366977", "text": "def _update_association_coverage_info(info, coverage_data, meth, key)\n type = case coverage_data[meth.to_s]\n when 0\n :unused\n when Integer\n :used\n else\n ...
[ { "docid": "b810b8b79c21a22c1b04159c13689880", "score": "0.5926149", "text": "def respond_to?(method_name, *)\n if method_name.eql? :coverage\n true\n else\n super\n end\n end", "title": "" }, { "docid": "39bb2e18cc62f374bf06c70fafa1a34f", "score": "0.5585...
ac7cfa185c9896a57ac7f926027aa8ea
Given the radius of a sphere calculate the volume
[ { "docid": "5ed88ad61b88e32769e81af5edd3a288", "score": "0.65734386", "text": "def test_volume_of_sphere()\n volume = volume_of_sphere(10)\n assert_equal(4188.79, volume)\n end", "title": "" } ]
[ { "docid": "335f7d0c986614010a8b9c960f86b397", "score": "0.9008805", "text": "def sphere_volume(radius)\n return((4.0 / 3.0) * Math::PI * radius ** 3).round(2)\nend", "title": "" }, { "docid": "c79814432f5c5d35daae47a356b72a16", "score": "0.8889943", "text": "def sphere_volume(spher...
5bc68832a1badd77609040d3751f2dae
Returns the OrderedSet instance
[ { "docid": "e6facdcfa9e14a277007a288069e51c9", "score": "0.0", "text": "def initialize(entries = nil)\n super([], {})\n\n merge(entries) if entries\n end", "title": "" } ]
[ { "docid": "828d28a8c09324288a12d3f19872081e", "score": "0.74235547", "text": "def sorted_sets\n SortedSets::SortedSets.new(self)\n end", "title": "" }, { "docid": "464d725f211b911c8f0b46e969b13e6c", "score": "0.6405221", "text": "def to_set\n return ::Set.new(to_a)\n ...
dfd69165ebbdb8fa0dda44f2353828df
Get the documents a user has access to (this is potentially expensive, as it results in multiple calls to gliffy) [username] if provided, get documents for the given username, otherwise get them for the loggedin user
[ { "docid": "a6193d980b87bfcb3fe0bbcaf181d483", "score": "0.7342967", "text": "def user_documents(username='$username')\n return user_documents_helper(username,user_folders(username))\n end", "title": "" } ]
[ { "docid": "295d48f8cbcad1f572493354e97722c7", "score": "0.70895994", "text": "def index\n if user_signed_in?\n # Get current user\n @user = current_user \n\n # Get User Documents for defined level\n @user_documents = Document.user_documents(@user)\n end\n end", "title": ...
71205bdb9ff53c268a03fa100fe73b54
Debug method implemeneted for testing and development
[ { "docid": "fd4bf6c10945c0ccae197ac7f4b84f6d", "score": "0.0", "text": "def print_neighbours_count\n @x.times{ |r|\n @y.times{|c| \n print @mat[r][c].count_neighbours.to_s + \" \"\n }\n print \"\\n\"\n }\n end", "title": "" } ]
[ { "docid": "4372fd4f69c6cbddd980211668e0d819", "score": "0.88063943", "text": "def debug; end", "title": "" }, { "docid": "4372fd4f69c6cbddd980211668e0d819", "score": "0.88063943", "text": "def debug; end", "title": "" }, { "docid": "4372fd4f69c6cbddd980211668e0d819", ...
78c0b53e5914244a139464877ad57c2d
Finds exact matches of find_string in the MPD database. find_type is limited to 'album', 'artist', and 'title'. Returns an array containing an instance of MPD::SongInfo (Struct) for every song in the current playlist. Results from MPDfind() do not have valid information for dbid or pos
[ { "docid": "029ab59b7f83e53dee3e854012e5a8e6", "score": "0.673408", "text": "def find(find_type, find_string)\n response_to_songinfo(@@re['PLAYLISTINFO'],\n socket_puts(\"find #{find_type} \\\"#{find_string}\\\"\")\n )\n end", "title": "" } ]
[ { "docid": "21bc9fbd06c0d317d11ca3319f459ffb", "score": "0.58269334", "text": "def find query, options = {}\n # Search. TODO Why is dup necessary?\n #\n results = songs.search query.dup, 100000 # \"all\" ids\n \n # Convert results.\n #\n Results.new music, results.ids,...
a2aef044011bb2f256e85ac49a8374c6
Creates a new task in the database using the specified url params and returns the task object as custom hash to the client if the action is successful. Otherwise, returns the error messages to the client.
[ { "docid": "34b6604c2141815ff04f5a100f737071", "score": "0.72419214", "text": "def create\n @task = Task.new(task_param)\n if @task.save\n render json: get_task_hash(@task)\n else\n render json: @task.errors.full_messages \n end\n end", "title": "" } ]
[ { "docid": "bbf025c84ca5d0a0374fa411c85cd01a", "score": "0.7460061", "text": "def create\n task = Task.new(task_params)\n if task.save\n render json: task, status: :created\n else\n render_errors(task)\n end\n end", "title": "" }, { "docid": "02b867e9649583b9d30ff459ba...
b7ac9c0aa68cfa78bd4b1d5f4b4c8b15
provides Returns all the tags required by source files, except for those which are provided by other files in the container (i.e. unresolved dependencies)
[ { "docid": "7a69db139522aa2094dab8f18754d1c0", "score": "0.57630324", "text": "def requires\n sort!\n sources.map {|s| s.requires }.flatten - provides\n end", "title": "" } ]
[ { "docid": "19f9433a4ed523b3ddd0499d57fb2e76", "score": "0.6755282", "text": "def dependency_tags\n dep_tags = tags.select { |t| t =~ DependencyPrefix }\n return dep_tags.map { |t| t.sub(DependencyPrefix, '') }\n end", "title": "" }, { "docid": "21413b79189d6f0a426e3636db70b40b", ...
e6f7c55fc79373d6360db25175ffc19e
max returns root if 2 nodes an 2nd node left of root
[ { "docid": "777a899a436cfa3974827a8b2ac6691b", "score": "0.70649046", "text": "def test_max_2_nodes_one_to_left\n @tree.insert(\"b\")\n @tree.insert(\"a\")\n assert_equal \"b\", @tree.max\n end", "title": "" } ]
[ { "docid": "ca0b49c3d736242f783d6037af1db982", "score": "0.84218335", "text": "def max\n return nil if empty?\n\n root = @root\n while root\n return root unless root.right\n root = root.right\n end\n\n root\n end", "title": "" }, { "docid": "30ccf716323df4895f28cb3c...
fefbd7a60eafa99d6adfd9dfc067dd5b
Usage: get_coupon_code( :device_model => , :coupon_code => '99TRIAL', :part_number => '')
[ { "docid": "a77077d6c6f5bd793251d8cfbd461971", "score": "0.738123", "text": "def coupon( options = {})\n # valid options structure with a coupon code\n if !options.blank? && options.is_a?(Hash) && !options[:coupon_code].blank?\n # AR object given?\n _model = options[:device_model] unless...
[ { "docid": "a6417481d0dac1d100b005186b337be1", "score": "0.6985671", "text": "def code\n stripe_coupon_id\n end", "title": "" }, { "docid": "20e98bc31eac72cf93debb0020a424b6", "score": "0.6923802", "text": "def coupon_code\n coupons.detect(&:discount_code?).try :discount_cod...
d1a47a625532db840a6b2033b88cc1b0
Returns true if the given headername is sat.
[ { "docid": "4e8a8aee8106d6f4816cc4620d0e2430", "score": "0.6353174", "text": "def has_header?(header)\n header_p = header.to_s.downcase.strip\n return @headers.key?(header_p) || @headers_trailing.key?(header_p)\n end", "title": "" } ]
[ { "docid": "9fb062fb35332dbc0ef6329b2d198e6b", "score": "0.69562274", "text": "def header?(name)\n end", "title": "" }, { "docid": "fae66b75569bbb86b74c35f50c838b88", "score": "0.68911713", "text": "def header?(name)\n headers.include? name\n end", "title": "" }, ...
38999b1d85d469b18ab7bf88239bcf10
PATCH/PUT /rent_posts/1 PATCH/PUT /rent_posts/1.json
[ { "docid": "76d4ee2053a43860805b2bffcb1491fc", "score": "0.0", "text": "def update\n @post_attachment = PostAttachment.where(rent_post: @rent_post.id)\n \n respond_to do |format|\n if @rent_post.update(rent_post_params)\n if params[:post_attachments]!=nil\n @post_attachment...
[ { "docid": "2a642a611c63a85b6ef6e72d09830e50", "score": "0.6933193", "text": "def update\n render json: Post.update(params[\"id\"], params[\"post\"])\n end", "title": "" }, { "docid": "a1d87f7d0118bb400fa70a85cffec9dc", "score": "0.6609144", "text": "def update\n @post = Post....
139ed5c8d1586ef04e9aeb73ee638630
Meant to be called from the handler. Read 'len' bytes from the current IO.
[ { "docid": "463ad1ca701729c3d51a64bdcfa9c730", "score": "0.78909016", "text": "def read(len)\n if @currentIoInfo\n # This is meant to be called from inside a fiber. Should add a check to confirm that here.\n @currentIoInfo.readFiberIoFacade.read(len)\n else\n raise \"React...
[ { "docid": "b24d2d101c168e4d725a1c5b97f2d661", "score": "0.79344374", "text": "def read(len = nil)\n return nil if @read >= @size\n len ||= @size - @read\n max_read = [len, @size - @read].min\n ret = @io.read(max_read)\n @read += ret.size\n ret\n end", ...
973d95cbc45b862231b2f163a8fab412
Returns a Group with the given id (it is presumed to already exist).
[ { "docid": "99f951493acca260df7348965548a2d8", "score": "0.86224145", "text": "def get_group(id)\n Group.new self, id\n end", "title": "" } ]
[ { "docid": "9d1b3acbe0b7e523ed81b18dfe664c2e", "score": "0.84763414", "text": "def get_group_by_id(id)\n require_relative 'group'\n Group.new(@api, @api.do_request(\"GET\", get_base_api_path() + \"/groups/#{id}\"))\n end", "title": "" }, { "docid": "9d1b3acbe0b7e523ed81b18df...
8ddd20643d0a3d4f6b85e9310acd778c
def bfs(target) fringe = [self] next_fringe = [] while fringe.length > 0 fringe.each do |node| return node if node.value == target next_fringe += node.children end fringe = next_fringe next_fringe = [] end return nil end
[ { "docid": "7c33ea8ddf963d9d74d4579045f2a2d2", "score": "0.0", "text": "def to_s\n \"TreeNode:\n object id: #{self.object_id}\n value: #{@value},\n parent: #{@parent.object_id},\n children: #{@children.each {|child| \"#{child.object_id} \"}}\n\n \"\n end", "title": "" } ]
[ { "docid": "41e06b2f68bfdf306f47d50329ac0139", "score": "0.91458887", "text": "def bfs(target)\n arr = [self]\n until arr.empty?\n node = arr.shift\n if node.value == target\n return node\n else\n node.children.each { |child| a...
2d15e40c1870788cd66b34301ff11cba
returns true if next rand [0,1.0) <= prob. Default behavior is pron=0.5, ie, a coin toss.
[ { "docid": "c80929ea50b1b8cc923831e1ba7c3f34", "score": "0.6398166", "text": "def chance(s, prob = 0.5)\n f, s = float(s)\n [f <= prob, s]\n end", "title": "" } ]
[ { "docid": "1438bb9700cea69ef0e40397c42cde66", "score": "0.7831107", "text": "def prob(p)\n rand < p\nend", "title": "" }, { "docid": "1472419caafc8b2c878b4793a946d7a0", "score": "0.74512935", "text": "def go?\n if @now\n @now = false\n ...
b49be8b63e6970ea8e24a143d623bc45
(Called by trigger_on_cancel & co)
[ { "docid": "83f9515381d956431703cbd4eb36c80a", "score": "0.0", "text": "def supplant_with (tree, opts)\n\n # at first, nuke self\n\n r = try_unpersist\n\n raise(\n \"failed to remove exp to supplant \"+\n \"#{Ruote.to_storage_id(h.fei)} #{tree.first}\"\n ) if r.respond_...
[ { "docid": "0a7effdd2b80d4c81379b083e24bdf3b", "score": "0.7002872", "text": "def cancelled?; end", "title": "" }, { "docid": "30f8b0220225637acd5b65159a0066b4", "score": "0.6951787", "text": "def cancel\n # TODO: That thing I'm claiming to do in the comments\n super\n end", ...
6b8db91b59c55d56c61535edb682999c
DELETE /stage_drymasses/1 DELETE /stage_drymasses/1.json
[ { "docid": "aa44b5be347fcb78c88c311972ed9f8b", "score": "0.76917833", "text": "def destroy\n @stage_drymass = StageDrymass.find(params[:id])\n @stage_drymass.destroy\n\n respond_to do |format|\n format.html { redirect_to stage_drymasses_url }\n format.json { head :no_content }\n en...
[ { "docid": "e84d7a0f65e2f803b3881625bb8b82d6", "score": "0.7049143", "text": "def destroy\n @clapme_stage.destroy\n respond_to do |format|\n format.html { redirect_to website_stages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8d850d26...
b62c01cf7fe7c4390c2f22d4cf463150
PATCH/PUT /imes/qh_bdbhs/1 PATCH/PUT /imes/qh_bdbhs/1.json
[ { "docid": "9952d2ba94d4b913bac61a5f6ed7a33f", "score": "0.63115376", "text": "def update\n respond_to do |format|\n if @imes_qh_bdbh.update(imes_qh_bdbh_params)\n format.html { redirect_to @imes_qh_bdbh, notice: 'Qh bdbh was successfully updated.' }\n format.json { render :show, s...
[ { "docid": "ae4d0aa8335fe571a4fcc90ded621164", "score": "0.65168196", "text": "def do_update_Json(data, *rest)\n obj, res = REST.put(\"#{self.class.path}/#{id}\",data)\n maybe_json_die(obj,res)\n @blob = obj\n self\n end", "title": "" }, { "docid": "ae4d0aa8335fe571a4fcc90ded621...
9538c16fc6bcd88312ccafd5e8d9c9a0
Exercise 8: Print students by cohort
[ { "docid": "221907b141bdc4ebfcc1536921dbb78c", "score": "0.6664834", "text": "def print_students_by_cohort student_arr\n sorted_by_input = {}\n student_arr.each do |x|\n selection = x[:cohort].upcase\n if sorted_by_input[selection] == nil\n sorted_by_input[selection] = []\n end\n sort...
[ { "docid": "58b2f642de3b6428d1d430debb8dc351", "score": "0.8264525", "text": "def print_by_cohort\n cohorts = []\n @students.each do |student|\n unless cohorts.include? student[:cohort]\n cohorts << student[:cohort]\n end\n end\n cohorts.each do |month|\n puts \"#{month} cohort:\"\n ...
7770aa48686a0ca46b2b858669f41af5
convert data to jpeg2moro format
[ { "docid": "4186f1346e8d984a01f45dcaaf114c7c", "score": "0.66142994", "text": "def convert(options = {})\n @convert_options = options.clone\n @convert_options[:alpha_depth] ||= DEFAULT_ALPHA_DEPTH\n\n # convert image data to jpg format\n img = Image.from_blob(@data).first\n jpeg_data = im...
[ { "docid": "7506c3ef4244ad0379ccd8319b7ae3a6", "score": "0.6943405", "text": "def jpeg\n i = Magick::Image.from_blob(data).first\n i.format = \"JPG\"\n i.to_blob\n end", "title": "" }, { "docid": "02cdc81cbeb56c05cdbe74defb4d152a", "score": "0.58624005", "text": "def optimi...
9b6c2dcdfd7308a1ab180170f48fe79c
Get the key used to define the layout of the given page number. If no specific layout is found it uses the default layout.
[ { "docid": "77480a9946457fbdd97b2e3484baa7a6", "score": "0.85840964", "text": "def layout_key_for_page(page_number)\n @layout_for.each_key do |key|\n return key if Array(key).include?(page_number)\n end\n return :all\n end", "title": "" } ]
[ { "docid": "045526cdb43841f171bda20ff60f5991", "score": "0.7733967", "text": "def layout_for_page(page_number)\n page_key = layout_key_for_page(page_number)\n @layout_for[page_key]\n end", "title": "" }, { "docid": "e2657884ce1130b723f3dd6ec17ac769", "score": "0.7011263", ...
d3c769571236bd1253488bd1fe282de2
Create a new set of timed tasks.
[ { "docid": "3eb0454705667301a524750f9916af2a", "score": "0.0", "text": "def initialize(opts = {})\n @queue = PriorityQueue.new(order: :min)\n @task_executor = OptionsParser::get_executor_from(opts) || Concurrent.configuration.global_task_pool\n @timer_executor = SingleThreadExec...
[ { "docid": "9a63dae91f13a0488706afdcc5c46a98", "score": "0.66694075", "text": "def initialize(time, title=\"\", tasks=[])\n @starts = Syctask::Times.new(time[0..1])\n @ends = Syctask::Times.new(time[2..3])\n @title = title\n @tasks = tasks\n end", "title": "" }, { "doc...
a905120e77d59a6389e2992a21dc3b39
Script to add auto_renew column to Memberships table 20140930 To run from Rails.root, ruby ./app/me_scripts/add_freeze_fields.rb
[ { "docid": "8971ea0c57cf9a4a94f7f4d0c4d61677", "score": "0.0", "text": "def confirm(msg)\n STDOUT.printf \"OK to \" + msg + \" (y/n)? \"\n input = STDIN.gets.chomp.downcase\n input == \"y\"\nend", "title": "" } ]
[ { "docid": "fe4b38ab00378ff4350c98876b9190e9", "score": "0.58501357", "text": "def moduleInstallAutograde\n UserModule.create(:name=>\"Autograde\",:course_id=>@assessment.id)\n um = UserModule.load(\"Autograde\",@assessment.id)\n um.addColumn(\"dave_key\",String)\n um.addColumn(\"dave_user\"...
5621c7751a1a20b5eacedae4358d5394
Returns +true+ if this object has an attached Writers, +false+ otherwise. This object can not be chained as the Readers of another Munge if it was any Writers attached.
[ { "docid": "cbe7918fc1ab9cf37c0223bc28b062ce", "score": "0.7559222", "text": "def has_writers?\n not @writers.empty?\n end", "title": "" } ]
[ { "docid": "214242577300e4de69871fe90de64fcb", "score": "0.6478811", "text": "def is_writer?\n self.name == \"Writer\"\n end", "title": "" }, { "docid": "e5265fc39042a0361e42c6e6104cccda", "score": "0.6374012", "text": "def joined?\n 0 < self.joiners.length\n end", ...
bf464b0af286113721df1bf46abf937d
Return an Array of all Contests for which any Team in this Grouping is the Team.
[ { "docid": "8d541bd21af1342f4857c6e4d1d50419", "score": "0.5765029", "text": "def unique_contests()\n\t\t((self.all_groupings << self).collect{|g| g.contests }).flatten.uniq\n\tend", "title": "" } ]
[ { "docid": "605595cd4047699eb59726018ef81068", "score": "0.6674338", "text": "def teams\n Team.all.select do |team| team.division_id == @id end\n end", "title": "" }, { "docid": "06d3856403f6597cc0adeae80f337ad4", "score": "0.66007626", "text": "def teams\n Team.all.sele...
ec646b7c515dbae483f4a2f408f4deff
Creates a new hash map that matches the ActiveRecord fields from the given xml
[ { "docid": "36b81145d68f8ab9faa07d23062caf08", "score": "0.71342796", "text": "def map\n xml_attrs = {}\n return xml_attrs unless valid_xml?(xml)\n\n activerecord.attributes.each_key do |key|\n if !@with_xml.binders.has_key?(key.to_sym)\n @with_xml.binders[key.to...
[ { "docid": "35242e5f88d0bfc0bef4d5c781535cfd", "score": "0.70974916", "text": "def create_records(records_xml)\n records_hash = Hash.new\n records_xml.children.each do |child|\n if child.is_a? Nokogiri::XML::Element\n records_hash[child.name.to_sym] = map_attributes_to_...
3e33f8edd4157999b392263946821a48
def save_uri session[:original_uri] = request.request_uri end
[ { "docid": "b4259f8006f04effb1495bc5b79a5853", "score": "0.0", "text": "def init_user\n @pages = Page.all\n @search = Design.search\n if session[:user_id].nil?\n if cookies[:remember_me_id].nil?\n return\n else\n session[:user_id] = cookies[:remember_me_id]...
[ { "docid": "49e67dceedf25538b90360b3f1d3e2b2", "score": "0.83938617", "text": "def req_uri_saver\n session[:prev_dest] = session[:dest]\n session[:dest] = request.env['REQUEST_URI']\n end", "title": "" }, { "docid": "aa274c4409623a83810e21636d5734be", "score": "0.8247344...
67dc250079c4645a4d2b299b6fd393a7
Updates the export destination. See [Exporting Logs With Sinks](
[ { "docid": "be952b07a08c6e44c676b333a8af0c78", "score": "0.0", "text": "def destination= destination\n @gapi[\"destination\"] = destination\n end", "title": "" } ]
[ { "docid": "c9dcbf598cdf8936a237050b5bfb5f3e", "score": "0.6631498", "text": "def update!(**args)\n @destination = args[:destination] if args.key?(:destination)\n @logs_path = args[:logs_path] if args.key?(:logs_path)\n end", "title": "" }, { "docid": "571702e5f414fc...
4996f6714857b409c8fb4f369492ba5c
This is used to execute a block iff the argument did not throw an exception. The name is from Lisp. I should probably be good and use some other name.
[ { "docid": "e5ee7855cef7f0eb2a4136189e49b67f", "score": "0.0", "text": "def prog1(retval)\n yield\n retval\n end", "title": "" } ]
[ { "docid": "caf594cc5d41d242b3695cc68ad7683e", "score": "0.72517675", "text": "def match_unless_raises(expected_exception = T.unsafe(nil), &match_block); end", "title": "" }, { "docid": "c32a7924a9f79db3895acc1ebea01310", "score": "0.71102977", "text": "def assert_not_executes(opts={...
efba3b92990394e8a29981f799dfc3a1
rubocop:enable Metrics/MethodLength rubocop:enable Metrics/AbcSize
[ { "docid": "18b333e632d5eeaebd648073f8949844", "score": "0.0", "text": "def show; end", "title": "" } ]
[ { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.6578019", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.6578019", "text": "def used; end", "title": "" }, { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "sc...
d325da67bf5da8c589ff846a7a0c428a
update the DAO links in an EAD/XML file
[ { "docid": "8d78010e2a7f7829da20de16c02f4e03", "score": "0.7251394", "text": "def update_ead(filename, resources, pdf: false)\n logger.info \"Updating DAO URLs in #{filename}\"\n ead = Nokogiri::XML(File.open(filename))\n\n resources.each do |r|\n cid = r.source_metadata_identifier...
[ { "docid": "cd81d49262799081501c2cacddef3dfd", "score": "0.66610163", "text": "def updatelinks()\n\tprint \"Looking for new links\\n\"\n\n\t#For each episode\n\t$episodesdb.to_s.scan(/(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?)\\n/) {\n\t\tserie_id = $1\n\t\tserie_title = $2\n\t\tseason_id = $3\n\t\tseaso...
a32c2b7db34992085bbbc062cd87cdff
Is the file a regular file?
[ { "docid": "0357275971f42ad25b3e0206328789ff", "score": "0.8219421", "text": "def regular_file?\n if !block_given?\n return @j_del.java_method(:isRegularFile, []).call()\n end\n raise ArgumentError, \"Invalid arguments when calling regular_file?()\"\n end", "title": "" } ]
[ { "docid": "bcc6d0a4402ba85e48cc07f7236660d1", "score": "0.81737375", "text": "def file?\n case type\n when T_REGULAR then true\n when T_UNKNOWN then nil\n else false\n end\n end", "title": "" }, { "docid": "a8505144173c562aee72bc8f706f5472", "score": "0.79188...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "15bf32618d78930ce6a36f2d666ac444", "score": "0.0", "text": "def flavor_params\n params.require(:flavor).permit(:name, :description, :availability, :flavorofweek, :image, :created_at, :instock)\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...
0b23ce1305680f28c0c9d867eaacb81f
[ [ ] [ ] [ ] [ ] ]
[ { "docid": "3e3fbd04662ac3bc403ac77cf8c47a0d", "score": "0.0", "text": "def looper\n loop do\n render\n cursor.get_input \n end\n end", "title": "" } ]
[ { "docid": "050bea5ca1589e87b5597c3bf130ba26", "score": "0.59739006", "text": "def elements; end", "title": "" }, { "docid": "050bea5ca1589e87b5597c3bf130ba26", "score": "0.59739006", "text": "def elements; end", "title": "" }, { "docid": "050bea5ca1589e87b5597c3bf130ba26...
2680998d146136ae7d53af4e7ef33ded
Get test run tags.
[ { "docid": "377f637c3c0f5f270cebd95cb783f616", "score": "0.0", "text": "def get_project_test_run_tags_using_get_with_http_info(project_id, run_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AdminApi.get_project_test_run_tags_using_get ...'\n ...
[ { "docid": "4e2a17908e3e48a158729bed450f4b48", "score": "0.7096092", "text": "def get_test_run_tags_using_get(run_id, opts = {})\n data, _status_code, _headers = get_test_run_tags_using_get_with_http_info(run_id, opts)\n data\n end", "title": "" }, { "docid": "4e2a17908e3e48a158...
58beea5c0dc24b8e299dab8e9c3a3a40
This is super useful if you want to copy files out of plugins to override. Example: bridgetown plugins cd AwesomePlugin/layouts cp r $BRIDGETOWN_SITE/src/_layouts Now all the plugin's layouts will be in the site repo directly.
[ { "docid": "d4f96e40c2611d3ee181b8fbf19b91db", "score": "0.0", "text": "def cd(arg)\n site = Bridgetown::Site.new(configuration_with_overrides(options))\n\n pm = site.plugin_manager\n\n directive = arg.split(\"/\")\n unless directive[1]\n Bridgetown.logger.warn(\"Oop...
[ { "docid": "1abb0d39f9f4bb1b911eec916ff968e1", "score": "0.65917814", "text": "def copy_layouts\n dst_dir = File.join(wiki_dir, '_layouts')\n src_dir = LIBDIR + '/templates/layouts'\n copy_dir(src_dir, dst_dir)\n\n dst_dir = File.join(wiki_dir, '_includes')\n src_dir = LIBDIR + ...
91b1245adc19f158aff40f5901e95145
Public: launches JSON file in an editor for you to edit manually. Returns nothing.
[ { "docid": "3b24f064de66dd8a58926d032414859a", "score": "0.6234317", "text": "def edit\n if storage.respond_to?(\"json_file\")\n output \"#{cyan(\"Looper!\")} #{Platform.edit(storage.json_file)}\"\n else\n output \"This storage backend does not store #{cyan(\"Looper!\")} ...
[ { "docid": "0e35066e44d499d09bc1aa809f38b41f", "score": "0.8013056", "text": "def edit(json_file)\n unless ENV['EDITOR'].nil?\n unless windows?\n system(\"`echo $EDITOR` #{json_file} &\")\n else\n system(\"start %EDITOR% #{json_file}\")\n end\n ...
c1e11754a1a4783fe1ebe2124fc92542
id_set may be a range, array, or string
[ { "docid": "e66712e868a92152e40427e9423237eb", "score": "0.0", "text": "def fetch_row_text(id_set, are_uids=false, is_update=false)\n log \"Fetch_row_text: #{id_set.inspect}\"\n if id_set.is_a?(String)\n id_set = id_set.split(',')\n end\n if id_set.to_a.empty?\n log \"-...
[ { "docid": "a8762fe03449f22474d5c9e038f48869", "score": "0.59945655", "text": "def expand_id_range(id, **opt)\n id_key = opt[:id_key]&.to_sym || id_column\n sid_key = opt[:sid_key]\n min = max = nil\n case id\n when Numeric, /^\\d+$/, '$' then min = id\n when Model ...
40d8c5b03554bcd8153014c984ef6762
a function that is used to parse Ansible (static) inventory files and return a list of the node addresses contained in the file
[ { "docid": "6b493f31903627c929218fd390165349", "score": "0.7426334", "text": "def addr_list_from_inventory_file(inventory_file, group_name)\n inventory_str = `./common-utils/inventory/static/hostsfile.py --filename #{inventory_file} --list`\n inventory_json = JSON.parse(inventory_str)\n inventory_gro...
[ { "docid": "1f223b34291adef2d9b8928afe3c84f1", "score": "0.7040412", "text": "def getnodes\n nodes = []\n\n pattern = @netip.split('.')[0..-2] * '.'\n File.open('Vagrantfile', 'r'){|f|\n f.readlines.each{|x|\n if x =~ /#{pattern}.*/\n nodes << Node.new(x[/k8snode[\\d]+/], x...
09cc2b201c27fe71ba8ccd233c630e69
threaded method to run multiple instances of watir at the same time considered experimental & buggy right now
[ { "docid": "2f3ed64ba6267c7103cb94c451698b83", "score": "0.5447853", "text": "def _test_threads\n m = Mutex.new \n threads = []\n @custom_number_of_users.times do\n threads << Thread.new do\n m.synchronize {threaded_mage_checkout}\n threaded_mage_checkout\n ...
[ { "docid": "e726aa5122f43b810643444530e08b41", "score": "0.6251077", "text": "def iterate &block\r\n threads = []\r\n @providers.each do |browser|\r\n threads << Thread.new do\r\n yield browser\r\n end\r\n end\r\n threads.each {|thread| thread.join}\r\n end"...