query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
2538bd9d8a55909691cc46846ca8bca7
Returns a PlatformList object based on the platform string given at creation.
[ { "docid": "276bb9bf8126995c23a28f7c6c05f0c1", "score": "0.7431448", "text": "def platform_list\n if platform.blank?\n list = Msf::Module::PlatformList.new\n else\n begin\n list = ::Msf::Module::PlatformList.transform(platform)\n rescue\n list = Msf::Modu...
[ { "docid": "9782a8ab5030126a4790dabe1b7539b8", "score": "0.61395556", "text": "def platforms\n @platforms ||= Endpoint::Platforms.new(name, args)\n end", "title": "" }, { "docid": "1465755ad0c45f8d3cf6a477a706358a", "score": "0.6044564", "text": "def create_platform\n Pl...
910eeab788ba3d3061e4288443a75cbd
s = "rail safety", t = "fairy tales" result = true
[ { "docid": "234164f11b92b4ba15d1e762dd9316c7", "score": "0.55051357", "text": "def test_fairy_tales\n assert_true(@target.is_anagram(\"rail safety\", \"fairy tales\"))\n end", "title": "" } ]
[ { "docid": "d28f34978a185ec875302f3f5815211c", "score": "0.6833546", "text": "def s_true(s)\n s = s.strip.downcase\n \n return true if s == \"t\" || s == \"true\"\n false\nend", "title": "" }, { "docid": "f193f10a071c2558013c1cd0f5d8b74a", "score": "0.65737534", "text": "def tera...
32c81509ba626beda8babfd10b19c49f
rubocop:enable Lint/UnderscorePrefixedVariableName rubocop:enable Metrics/MethodLength Set the given key / value tag pair at the tracer level. These tags will be appended to each span created by the tracer. Keys and values must be strings.
[ { "docid": "c945ee9aa55acbaefa76e4f78c162fae", "score": "0.6272195", "text": "def set_tags(tags)\n string_tags = tags.collect { |k, v| [k.to_s, v] }.to_h\n @tags = @tags.merge(string_tags)\n end", "title": "" } ]
[ { "docid": "e9f8ea8b30a4e17b8dd27f3e2fbca77a", "score": "0.71512634", "text": "def set_tag(key, value)\n if ![Symbol, String].include?(key.class)\n key = key.to_s\n end\n\n # If <value> is not a Symbol, String, Array, Hash or Numeric - convert to string\n if ![Symbol, String, ...
04df4ab77776d633f42d57467704569d
Returns whether or not a subscription process has been run. Uses the current server time (day resolution) as the default date to check for, optionally a dateString can be supplied for a specific date to check for.
[ { "docid": "48a2b7b489a1e5e077e4f2d7f64616ba", "score": "0.0", "text": "def get_word_of_the_day_list_subscription_process_status(*args)\n http_method = :get\n path = '/words/wordOfTheDayLists/subscriptionProcess'\n\n # Ruby turns all key-value arguments at the end into a single hash\n # e.g....
[ { "docid": "eb9cd3a7c77bd103d4a440ae23d7f573", "score": "0.62457293", "text": "def subscribed?\n preminum? ? true : false\n# if active_trial? \n# return false\n# else\n# total_month = subscriptions.where('transaction_id > 0').sum(:month)\n# ...
96a400dec103722d5851026690896abe
This command will execute each command passed in order they were added
[ { "docid": "e689217d4ed98ccf3163f9cde6185dca", "score": "0.70909035", "text": "def execute\n if(@commandIndex < commands.length)\n for index in @commandIndex..commands.length - 1\n puts @commandIndex\n @commands[@commandIndex].execute\n @com...
[ { "docid": "c069af879dba0ddfd79e3a3ca77207ee", "score": "0.7601748", "text": "def execute\n @contained_commands.each do |c|\n c.execute\n end\n end", "title": "" }, { "docid": "aed4fff494a5174fa9c4fd626631d84a", "score": "0.7402954", "text": "def execute\n...
4254e8a11d72f191d595eda17ae3affc
PUT /offcuts/1 PUT /offcuts/1.json
[ { "docid": "4f4b1926cb3f9b5f25e39c65ae1a8b15", "score": "0.7404355", "text": "def update\n @offcut = Offcut.find(params[:id])\n\n respond_to do |format|\n if @offcut.update_attributes(params[:offcut])\n format.html { redirect_to @offcut, notice: 'Offcut was successfully updated.' }\n ...
[ { "docid": "5ff3c77eb5030e7b9c31650a192f77ff", "score": "0.6729837", "text": "def update\n @cutoff = Cutoff.find(params[:id])\n\n respond_to do |format|\n if @cutoff.update_attributes(params[:cutoff])\n format.html { redirect_to @cutoff, notice: 'Cutoff was successfully updated.' }\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d0b3512ab2b2b9f652621a723c7631fb", "score": "0.0", "text": "def set_benefit\n @benefit = Benefit.find_by(id: 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...
7681a427bf0e95f7fdc0ea09fad140ae
Tabby cats need 10 cups per week, minus 1 cup per year of age, to a minimum of 1 cup. So a 0year old (newborn) Tabby needs 10 cups, a 5year old needs 5 cups, and a 15year old needs 1 cup.
[ { "docid": "502463aa717124c40bdd534aa8f21bf4", "score": "0.63310647", "text": "def food_per_week\n cups_of_food = 10\n cups_of_food -= @age\n cups_of_food > 0 ? cups_of_food : 1\n end", "title": "" } ]
[ { "docid": "4267073c5c7585ed99d11da39f634ab7", "score": "0.5762292", "text": "def food_per_week\n cups_of_food = 1\n cups_of_food + @age\n end", "title": "" }, { "docid": "2afefd4901724c23ddc31c93d4dd6910", "score": "0.56486887", "text": "def fruits(week_grown_in)\n week_gr...
066675d4dedb4f6f6bebce652b9d552f
Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results.
[ { "docid": "d12be7fcefe2e39925987a4c040d91ba", "score": "0.0", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = DeletePlaceResultSet.new(resp)\n return results\n end", "title": "" } ]
[ { "docid": "c4ca32683e8ce75eb6a187d63df8fa77", "score": "0.7663971", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = DoneResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "6f7a7d9be674ad4cf17d6743eb1f7836", "score...
07cc78374c76b238c0eb187a69a6eb86
Format the match into an array for Round table insertion
[ { "docid": "bf49a03281877fbbcfda3691f2d91a90", "score": "0.5279899", "text": "def round_row\n [\n \"($#{home_squad_odds}) #{home_squad_name} \",\n status == 'scheduled' ? '' : \"#{home_score} - #{away_score}\",\n \"#{away_squad_name} ($#{away_squad_odds})\",\n venue_name...
[ { "docid": "bf3bc4727120791fa89ad9a9ce027491", "score": "0.574335", "text": "def solve_book_matching_info(book_td_labels)\n reds = []\n book_td_labels.each_index do |index|\n if(index % 8 != 0 && index % 8 != 1) \n td = book_td_labels[index]\n td = td.match('>.+<').to_s\n ...
428b1fc87afb4058f81b4375bcd49518
GET /shipfleets/1 GET /shipfleets/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "06cbf913be21e7f870c617d13c2b66d8", "score": "0.7360149", "text": "def index\n @shipfleets = Shipfleet.all\n end", "title": "" }, { "docid": "aac1dd06dee995d1540ad5467fc482b2", "score": "0.6820168", "text": "def show\n @fleet = Fleet.find(params[:id])\n\n respond...
69fdc4e6f66f4eddf09e4c8915e8964a
As each xobject is drawn on the canvas, record if it's Group XObject with transparency
[ { "docid": "fcdac0c70cdd8c916205de9a5985f342", "score": "0.44990954", "text": "def detect_transparent_form(form)\n xobject = form.xobject\n group = deref(xobject.hash[:Group])\n stype = deref(group[:S]) if group\n\n if stype == :Transparency\n bbox = x...
[ { "docid": "85805219849dff0cdf6050d4def8eca8", "score": "0.5629922", "text": "def test_opacity\n [@window, @sprite, @bitmap].each{|container|\n uc = UCCharacterGraphic.new(container, Rect.new(200, 0, 40, 40), $data_actors[1], 0, 200)\n uc.draw()\n }\n return true\n end", "title":...
ba746a2b0b5e8f07cdc4a8ac3ee2a2c1
get array of states
[ { "docid": "ff54641b1b381941eae492c68db1d898", "score": "0.7845294", "text": "def get_state\n@state.keys\nend", "title": "" } ]
[ { "docid": "53c0ac9352578da7ad246b13ad5cb5e0", "score": "0.84695566", "text": "def states\n []\n end", "title": "" }, { "docid": "53c0ac9352578da7ad246b13ad5cb5e0", "score": "0.84695566", "text": "def states\n []\n end", "title": "" }, { "docid": "7e2e291a9f3dccc0...
306af7b13c8425aebe3069e9aa360a0e
Returns true when this timeframe is equal to the other timeframe
[ { "docid": "bca5775d1def16b525935ba1f912d5ca", "score": "0.8152349", "text": "def ==(other)\n # puts \"checking to see if #{self} is equal to #{other}\" if Emitter::DEBUG\n return false unless other.is_a?(Timeframe)\n start_date == other.start_date and end_date == other.end_date\n end", "t...
[ { "docid": "d534dd3a1eee5c54e359bdebff9036a9", "score": "0.8083279", "text": "def ==(other)\n # puts \"checking to see if #{self} is equal to #{other}\" if Emitter::DEBUG\n return false unless other.is_a?(Timeframe)\n from == other.from and to == other.to\n end", "title": "" }, { "...
fddb1aebfb414dc234121198f0e7d785
Get permits for the required params
[ { "docid": "2dd54147d646d12297833a37ecee3884", "score": "0.0", "text": "def group_params\n params.require(:group).permit(:name, :desc)\n end", "title": "" } ]
[ { "docid": "221ca888e97da120e928f0544bd193b7", "score": "0.7854665", "text": "def permits\n @permits\n end", "title": "" }, { "docid": "221ca888e97da120e928f0544bd193b7", "score": "0.78535974", "text": "def permits\n @permits\n end", "title": "" }, { "doci...
a2e5854b9ee0c292ed1d9548010e6726
produces a sitemap for the domain name/tenant listing the released datasets TODO: change page to display all that are embargoed or published, not merritt status and cache the doc so it's not too heavy
[ { "docid": "890111dde5afd85c14bc779b4f0eecb4", "score": "0.55178607", "text": "def sitemap\n respond_to do |format|\n format.xml do\n sm = SiteMap.new\n if params[:page].nil?\n render xml: sm.sitemap_index, layout: false\n else\n render xml: s...
[ { "docid": "63413b36d0bff09413d279ce8e0d0d85", "score": "0.71142864", "text": "def sitemap\n\n builder = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|\n\n xml.urlset('xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9') {\n\n #\n # Add default top level pa...
ad7d2d08eaf6b1f22fbe47257810281d
GET /package_relationships/new GET /package_relationships/new.xml
[ { "docid": "eebc6f83b755c02c445fc7877ee4d661", "score": "0.7799892", "text": "def new\n @package_relationship = PackageRelationship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @package_relationship }\n end\n end", "title": "" } ]
[ { "docid": "1ec6029ec0f9a0c0e616cdf6b57c3116", "score": "0.6972462", "text": "def create\n @package_relationship = PackageRelationship.new(params[:package_relationship])\n\n respond_to do |format|\n if @package_relationship.save\n format.html do\n redirect_to(@package_relation...
36fecf6e386d1284807e974691d28167
When you do check start deploy live we setup the POST with the list data
[ { "docid": "41fd0d9707c8798bf6dfb90e4fbcb225", "score": "0.0", "text": "def test_live_flag_triggers_live_mode\n #stub setup\n Excon.stub({:method => :post, :body => {\n emails: nil,\n list: List.new(home + '/personal/groceries').to_h\n }.to_json}, {:status => 200,:body => '\"DEADBEE...
[ { "docid": "806f06196f725d7e7dd90b0f04c1e52a", "score": "0.6346664", "text": "def list(list)\n response = form_response(list, true)[1]\n if Net::HTTPSuccess === response\n i = 1\n page = JSON.parse(response.body)\n puts \"\"\n page.each do |task|\n ...
fc6c5c9745d70093b24fbb9c7473e1e8
validate method if possible
[ { "docid": "7c3eb611c00c4f4d05d296614fbbebbd", "score": "0.0", "text": "def per_page\n if params[:per_page].to_i.positive?\n params[:per_page].to_i\n else\n 20\n end\n end", "title": "" } ]
[ { "docid": "5b6d6ef79ae2c83d4a0af5959baca27c", "score": "0.8483364", "text": "def validate?; end", "title": "" }, { "docid": "6b045ce4860f3e02870498792c74a0b9", "score": "0.829992", "text": "def validate; end", "title": "" }, { "docid": "6b045ce4860f3e02870498792c74a0b9",...
56596b77eccb96cdd1cd8283a6fb6974
TODO: paginate resources TODO: replace it with plain json request for speed & memory improvements
[ { "docid": "757a5dd19b40840a8db9d707fde1cee8", "score": "0.0", "text": "def shopify_request(resources_kind)\n request_wrapper do\n \"ShopifyAPI::#{resources_kind}\".constantize.find(:all, params: { limit: 250 })\n end\n end", "title": "" } ]
[ { "docid": "2464ec9a88fe466cdb9c3562a64551be", "score": "0.7357796", "text": "def index\n resources = @resourceables.map do |resourceable|\n resourceable.resources.search(params)\n end\n\n render :json => paginate(resources.flatten.uniq),\n :meta => @meta,\n ...
1dcc9eebe2fb0c2a21266c490ab98313
Adds multiple inventory units to this package.
[ { "docid": "579f6e10d813c6acf2a3c95331576a6c", "score": "0.76722145", "text": "def add_multiple(inventory_units, state = :on_hand)\n inventory_units.each { |inventory_unit| add(inventory_unit, state) }\n end", "title": "" } ]
[ { "docid": "c88e075447b687315973d1a3ff59e7d6", "score": "0.74057597", "text": "def add_inventory(items)\n items.each {|item| \n @inventory << item\n puts \"#{item.name} added to inventory\"\n }\n end", "title": "" }, { "docid": "bffb...
426399ec7ecc677c32dea2c2a9491fe2
Absolute value (aka modulus): distance from the zero point on the complex plane.
[ { "docid": "466ec9dc32575da1e24152e6415fe2b9", "score": "0.7108693", "text": "def abs\n Math.hypot(@real, @imag)\n end", "title": "" } ]
[ { "docid": "5d8e0901f2013ac6be0a95ea9d861b52", "score": "0.784124", "text": "def abs\n dist(0, 0, real, imag)\n end", "title": "" }, { "docid": "075b84a155094e3eb7e2f98e55144ed6", "score": "0.6303816", "text": "def Complex_absolute(real,comp)\n r=real ** 2\n c=comp ** 2\n retu...
36ea077a27bf6626611d57af94da9be2
This assumes the ImageName features the git ref as the last part of a string delimited by dots. See spec/support/ecs_metadata.json as well as
[ { "docid": "79c93d886ce43e5665a85b08282c5acb", "score": "0.68255115", "text": "def latest_ref_from_ecs_metadata\n return if ECS_CONTAINER_METADATA_FILE.nil?\n return unless !ECS_CONTAINER_METADATA_FILE.strip.empty? && File.readable?(ECS_CONTAINER_METADATA_FILE)\n\n begin\n JSON.par...
[ { "docid": "0ef25f143b39f921c6dcd78d95e151d8", "score": "0.69650775", "text": "def git_image_name\n @@git_image_name ||=\n \"#{image_name}:#{ENV['GIT_COMMIT'] ||\n `git rev-parse HEAD`.strip}\"\n end", "title": "" }, { "docid": "f0d711061d6d603f93a98cbd8e431811"...
b91706a310cd548c4c790522390c4c8c
used by state guard, effectively pais an caches authorized reward
[ { "docid": "78d7be36a4a4f49f4e9d19ad0554987e", "score": "0.0", "text": "def can_cash?\n self.capture_and_cash\n end", "title": "" } ]
[ { "docid": "67bea1622065e533f3615d04dff93118", "score": "0.5930544", "text": "def reward\n @reward ||= 0\n end", "title": "" }, { "docid": "2a30938c7fec4eb8e93675e24e3c69f2", "score": "0.5898118", "text": "def claim_reward_balance!(permlink); claim_reward_balance(permlink).broadc...
3566da4c9881408d7eeb394239ade545
DELETE /stories/1 DELETE /stories/1.json
[ { "docid": "562c06dcb3b63ccc93cf9a64d6ff4839", "score": "0.7931967", "text": "def destroy\n @story = Story.find(params[:id])\n @story.destroy\n\n respond_to do |format|\n format.html { redirect_to stories_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "210e77eb7c5ebb929fc1975063bee43a", "score": "0.79391855", "text": "def destroy\n @story = Story.find(params[:id])\n @story.destroy\n\n respond_to do |format|\n format.html { redirect_to stories_url }\n format.json { head :ok }\n end\n end", "title": "" }, { ...
46291407d24af187fdadca1e81234fe4
Sets the current location (iOS Simulator only).
[ { "docid": "cd06923aab0fbda8334b4537dcf429db", "score": "0.6269993", "text": "def location=(coordinates)\n set_location(coordinates)\n end", "title": "" } ]
[ { "docid": "caa00a12823fbb03a46cc7ca2b1a8f2a", "score": "0.71989226", "text": "def current_location=(location)\n @current_location = location\n end", "title": "" }, { "docid": "ad2a9b4557a6e8405f55d6b5b9ecbefa", "score": "0.7070163", "text": "def update_location new_location\n\t\...
8ff92675b9e6132650afef54dad934e0
The word that the cursor is on and the character it starts on. For example 01234567890 hello world ^ would return ["world", 6..10]
[ { "docid": "3267e7cf85e1b3ad7e41c891412b83fc", "score": "0.78288686", "text": "def current_word_and_range_and_index\n iterated_chars = 0\n this_is_the_word = false\n words.each.with_index do |word, index|\n word_started_on = iterated_chars\n word.each_char do |char...
[ { "docid": "a2c0758f05434a027d77e28e055f4491", "score": "0.7461884", "text": "def word_at_cursor\n get_text(*word_bounds).strip\n end", "title": "" }, { "docid": "4d7fce44f00e309f564dffe6c78fde86", "score": "0.68174964", "text": "def part_of_word\n\t\t@str[@first_letter..@last_le...
0c2c80a9f255d0b0b13b9bdba552e624
Fields used for updating monitoree state
[ { "docid": "b0858696946b0035b6759f53f23af76f", "score": "0.0", "text": "def status_fields\n %i[\n monitoring\n monitoring_reason\n monitoring_plan\n exposure_risk_assessment\n public_health_action\n isolation\n pause_notifications\n symptom_onset\n severe_...
[ { "docid": "6dd3eaf1c17188a3c084bf841c863d62", "score": "0.6603729", "text": "def updatestate\n @attributes.fetch('updatestate', 0)\n end", "title": "" }, { "docid": "ef1d8de1edccec3a664454458fd41227", "score": "0.64154506", "text": "def extra_state; end", "title"...
30a32cc0bca0ea49dd05468d700a8f9c
Generate a random string to populate the call center value (destid in racc platform)
[ { "docid": "5936c66144dec4810293f759489ce08c", "score": "0.7530319", "text": "def generate_call_center\n self.call_center = rand(Time.now.to_i)\n end", "title": "" } ]
[ { "docid": "8497f3d2bd9e137fadc6c2933429ea4a", "score": "0.7195476", "text": "def gen_phone_num\n \"#{rand(900) + 100}-#{rand(900) + 100}-#{rand(1000) + 1000}\"\nend", "title": "" }, { "docid": "8720c72bf1008e92b14f2b03547eb4ce", "score": "0.71632457", "text": "def rand_phone option...
70a30872640c6c01d953233e247c5d9d
Generates a URI for an accessReviewHistoryInstance object the status for which is done. Each URI can be used to retrieve the instance's review history data. Each URI is valid for 24 hours and can be retrieved by fetching the downloadUri property from the accessReviewHistoryInstance object.
[ { "docid": "7d9ba030e22d7550220dbf7fbd1a2fb6", "score": "0.0", "text": "def post(request_configuration=nil)\n request_info = self.to_post_request_information(\n request_configuration\n ...
[ { "docid": "c06857bc68dde779e14c4e40380d0afa", "score": "0.50571245", "text": "def oer_url\n if date\n historical_url\n else\n latest_url\n end\n end", "title": "" }, { "docid": "35ba757c8ddb540772effc081862a109", "score": "0.50531095", "te...
a629a31732f12f3c11452dd092b27b98
DELETE /daylights/1 DELETE /daylights/1.json
[ { "docid": "fa0d5c57c466d2c3e058aa9781874dcf", "score": "0.76170313", "text": "def destroy\n @daylight = Daylight.find(params[:id])\n @daylight.destroy\n\n respond_to do |format|\n format.html { redirect_to daylights_url }\n format.json { head :no_content }\n end\n end", "titl...
[ { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.70699334", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "a296d7776d60faa93a4d815ee0b653f2", "score": "0.6999218", "text": "def destroy\n @daytime = Daytime.find(params[:id])\n ...
e27e2026002b97b99c292b98b49c9762
Define a method that returns the thirdlargest element in an array. Assume the argument has at least three elements. third_greatest([5, 9, 3, 7, 7, 2, 10]) == 7
[ { "docid": "49f7e9801f2b75e966893c58a41c73b6", "score": "0.82880616", "text": "def third_largest(arr)\n arr = arr.sort\n arr[-3]\nend", "title": "" } ]
[ { "docid": "8685b3e82c1b30d90599f3edd82a3a71", "score": "0.8620063", "text": "def third_greatest(array)\n array.sort[-3]\nend", "title": "" }, { "docid": "802bf418abebe9169da3f8e7254a1add", "score": "0.8482807", "text": "def third_greatest(array)\nend", "title": "" }, { ...
aa74f16069a25219b86aaf0c63f147ed
Add for create method and permit more params
[ { "docid": "90829177f2ad022a71d6d946057c8112", "score": "0.0", "text": "def participant_params\n params.require(:participant).permit(:first_name, :last_name, :designer_type, :location_state, :location_city, :twitter, :instagram, :linkedin, :email, :website)\n end", "title": "" } ]
[ { "docid": "74d35be06cbbb26cfc4203b34f69b583", "score": "0.7872212", "text": "def create_params\n end", "title": "" }, { "docid": "0c563801debcd7737a45d2ff2d513b99", "score": "0.7412188", "text": "def permitted_create_params\n fail NotImplementedError\n end", "title": ""...
730db98c3ce94f7b12d8f0450c2715b9
update_bet pushes bet object to bet array updates pool total for bet type
[ { "docid": "c035081ad233075f670c532070655c97", "score": "0.81699884", "text": "def update_bet(bet)\n @race.update_bet( bet )\n @race.update_pool( bet.type, bet.amount )\n end", "title": "" } ]
[ { "docid": "04794bd6829a7ea279dda877cc9047bb", "score": "0.79104686", "text": "def update_bet(bet)\n if @bets[bet.type][bet.pick].nil?\n @bets[bet.type][bet.pick] = []\n end\n\n @bets[bet.type][bet.pick] << bet\n end", "title": "" }, { "docid": "e872035b10de9b332cf675606c0b42b...
4fd76b6533cc653dbb956a7f4e312a4b
> Equivalence of LSs is attributed to their 'ES_pairs'
[ { "docid": "1af0d53d8d6727cf089d72e054727fb6", "score": "0.6984863", "text": "def ==(ls_d)\n\t\tself.es_pairs == ls_d.es_pairs\n\tend", "title": "" } ]
[ { "docid": "b7323c7306142a21669e119d17d4e46e", "score": "0.5945647", "text": "def dup\n\t\tLS.new(@es_pairs.dup)\n\tend", "title": "" }, { "docid": "bd75afce1bcb6697d3d8f308dc8a9890", "score": "0.5945215", "text": "def equivalent_states!(s1, s2, equivalences)\n return \"#{s1.i...
fbfae4ea21687fe7942902fc66eafb8f
Public: Initializes a Deploy app_name A String naming the Heroku application to be interacted with. options The Hash options is used to provide additional functionality. :screen_notifier Object used for outputting to screen (optional). :notifiers Array of objects interested in being notified of steps in deployment proc...
[ { "docid": "8cd4c41398a0eafc014889838d37709e", "score": "0.7018207", "text": "def initialize(app_name, options = {}, &block)\n @app_name = app_name\n @screen_notifier = options[:screen_notifier] || Notifiers::ScreenNotifier.new\n @notifiers = options[:notifiers] || [@screen_n...
[ { "docid": "05b694f5cbf859fc5f0aa09647dbc171", "score": "0.6796034", "text": "def deploy_heroku(name, app_url)\n deploy_loader = loader(\"Deploying and running installation of app...\", nil)\n branch_name = \"#{name}#{Time.now.strftime(\"%d-%m-%Y-%H-%M\")}\"\n url = get_stripped_url(app_url, false)\n...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "f1a5de6d0ed6739a73418d0d3d3ea300", "score": "0.0", "text": "def link_params\n params.require(:link).permit(:in_url, :out_url, :uuid)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7497801", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957249", "text": "def strong_params\n params.require(:request).permit(param_white...
c4bd751dedbd3d8a578bf4a0a1ed2487
GET /destacados/1 GET /destacados/1.json
[ { "docid": "9e58957dd3a561cf23687a0a869ada3a", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "1795dea83b74c65f27e581c40135e893", "score": "0.7072404", "text": "def index\n @destaques = Destaque.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @destaques }\n end\n end", ...
f399cf9986b1bea1044344c144630343
PUT /assuntos/1 PUT /assuntos/1.xml
[ { "docid": "2b65212052092101de39318b2e729f7a", "score": "0.5876678", "text": "def update\n @assunto = Assunto.find(params[:id])\n\n respond_to do |format|\n if @assunto.update_attributes(params[:assunto])\n flash[:notice] = 'CADASTRADO COM SUCESSO.'\n format.html { redirect_to(@...
[ { "docid": "23b5f5e4dacfb330cb1e0ffd4590ef63", "score": "0.69195527", "text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end", "title": "" }, { "docid": "fbd7c46b15ae2792fd842ba0d764b7d...
6542e0bd313cefb8e2f1908cbfb06350
POST /instruments POST /instruments.json
[ { "docid": "4ef18088dc58226be898f9792b262527", "score": "0.5823998", "text": "def create\n @instrument = Instrument.new(instrument_params)\n @instrument.image_url = upload\n @instrument.user_id = User.find_by!(\"utype = '1'\").id\t# 默认新发布的仪器都是这个提供方的\n \n set_available_time\n\n respond_...
[ { "docid": "9a8ad6d71c7fcfc414880ea4508712ff", "score": "0.6937109", "text": "def create\n p \"*******INST CREATE*********\"\n user = User.find_by(id: session[:user_id])\n instrument = user.instruments.build(instrument_params)\n if instrument.save\n render json: instrument, status: :cre...
44c3f07883e8b350a34b1081101c875b
remove all empty assets
[ { "docid": "a3c1aa50b5b26bf42a2f6270c39827e5", "score": "0.72600794", "text": "def reject_blank_assets\n #self.company_assets.each {|a| self.company_assets.delete(a) if a.file.url.to_s =~ /missing.png/ || a.file.blank?}\n end", "title": "" } ]
[ { "docid": "c19b076252f2ac30a4cce208ab70afcf", "score": "0.73099095", "text": "def clean_remote\n to_delete = remote_assets - local_compiled_assets\n to_delete.each do |f|\n delete_remote_asset(bucket.files.get(f))\n end\n end", "title": "" }, { "docid": "b63c993856b...
4c6824a004d89e35a9c0797f3190eba0
push to the collection
[ { "docid": "40568b2dd71bc0fa9691d9eaa9094de9", "score": "0.7039774", "text": "def push(*args)\n check_classes(allowed_class, *args)\n @collection.push(*args)\n end", "title": "" } ]
[ { "docid": "b48234a4e22b368ea5a44c2cc25a35aa", "score": "0.78765", "text": "def push( item )\n @collection.insert_one item\n self\n end", "title": "" }, { "docid": "fdef3606a4055f8ea2219a803dc647ae", "score": "0.75178224", "text": "def push( item )\n @store.transaction do\n...
6a8ff83965d582bdcaa9efc14b2553ac
getting the controller class from the controller string
[ { "docid": "445b8657f37956c25c55528dccf6ac88", "score": "0.78270906", "text": "def controller_class(controller)\n controller_naming(\"#{controller}_controller\").constantize\n end", "title": "" } ]
[ { "docid": "09500e603b687fdbb4973c44505730ec", "score": "0.82013685", "text": "def get_class\n params[:controller].singularize.camelize.constantize\n end", "title": "" }, { "docid": "307664e378fbd683624f4813616cd213", "score": "0.8081567", "text": "def controller_class(controller...
aa29b3a0d340775f2f2d2d84755a6ceb
aur's search rpc url for the given search term.
[ { "docid": "034b746f11cc83f19461830f92263aef", "score": "0.8889686", "text": "def url_for_search(term)\n require 'cgi'\n\n 'http://aur.archlinux.org/rpc.php' +\n '?type=search&arg=' + CGI::escape(term)\n end", "title": "" } ]
[ { "docid": "e418ab93348f4bbf92cc4a7ac8b7dcd9", "score": "0.77891946", "text": "def search_url(term='')\n param = URI.encode_www_form('term' => term)\n \"http://api.urbandictionary.com/v0/define?#{param}\"\n end", "title": "" }, { "docid": "6f8d3dc28880425e3e07dca3875a2596", ...
86c9794e436572dff2d2e764e93c040b
Helper for search endpoints
[ { "docid": "69d9559c3be718a9b30941a4c534da89", "score": "0.0", "text": "def search(key)\n trocla_search(key)\n end", "title": "" } ]
[ { "docid": "59a0ea5c92ff24944ac7de82ae51462b", "score": "0.76218784", "text": "def search\n case request.method_symbol\n when :get\n search_get\n when :post\n search_post\n end\n end", "title": "" }, { "docid": "7a056b944430c7958c59d377ebaddc09", "score": "...
e8ca9f9c3b3509c8827e0e7be5ba813b
DELETE /smileys/1 DELETE /smileys/1.xml
[ { "docid": "0655e8760622cc2457290314a202eb1d", "score": "0.7089618", "text": "def destroy\n @smiley = Smiley.find(params[:id])\n @smiley.destroy\n\n respond_to do |format|\n format.html { redirect_to(smileys_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n...
[ { "docid": "9285e53c2ffd52042f53228d888c462a", "score": "0.7526238", "text": "def destroy1\n @smile = Smile.find(params[:id])\n @smile.destroy\n\n respond_to do |format|\n format.html { redirect_to(smiles_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { ...
4b8905d92f5352ea196ae6c20f4f58ab
balance has no arguments, so it is valid for everything while there are transactions
[ { "docid": "ca31b9f437cb7a440bedd0b967b0672f", "score": "0.0", "text": "def acct_number\n hidden_length = @acct_number.length - 4\n @acct_number.sub(Regexp.new(\"^.{#{hidden_length}}\"), \"*\" * hidden_length)\n end", "title": "" } ]
[ { "docid": "6613361f4747d9e2753c15c4cf6e5890", "score": "0.7414898", "text": "def balance\n exception = Exception.new(\"Invalid call\")\n\n Rollbar.error(exception, user: self)\n raise exception\n end", "title": "" }, { "docid": "e2631dd44c9250431f263f25faf6a25c", ...
81c13984fb83c40be1c67f9e68e7b1af
str1 = "abc" str2 = "abc" p first_anagram?(str1, str2) time complexity == O(n!) Phase 2
[ { "docid": "ad9591457f6b3d50da88f2671de462bd", "score": "0.0", "text": "def second_anagram?(str1, str2)\n # iterate over str1\n\n str1.each_char.with_index do |char, i|\n # # for each char, find index of char in str2 using #find_index\n found_index = str2.index(char)\n # # delete str2[@ found...
[ { "docid": "b6d18c4085e2adb4cd0153a445c2ccb8", "score": "0.90916526", "text": "def first_anagram?(str_1, str_2) # O(n^3)\n arr = str_1.split(\"\") # 1\n arr = arr.permutation.to_a # n\n arr.map! { |word| word.join } # n\n arr.include?(str_2) # n\n # (0...
7fdb03d2babd043bdb6fb39cc2c87f10
you forgot to fetch the
[ { "docid": "c5a9fb4c1e9d983db74452a0ab86cd57", "score": "0.0", "text": "def get_name\n\t\treturn @name\n\tend", "title": "" } ]
[ { "docid": "a9ca0c3587153526d0763bba7427bf99", "score": "0.77590996", "text": "def fetch\r\n end", "title": "" }, { "docid": "3413a2492b6f5d7e4d638ca4f83b6f07", "score": "0.759602", "text": "def fetch\n end", "title": "" }, { "docid": "eae37117c6d22f08ecf89029793e...
fcedb99aaf3e9092f2463845aa782730
Compute the minhash given the current data. The number of permutations will be, obviously, the number of hashes per user. This also computes the LSH. TODO: add logic to compute minhash incrementally. pf permute fuction (integer) ux index permuted ux bijective mapping (we hope!)
[ { "docid": "b4dec374d012a5afa57065478187181c", "score": "0.8469516", "text": "def compute_minhash\n clear_minhash\n permute { |pf, ux, permuted|\n puts \"[pf #{pf} ux #{ux} perm #{permuted}]\"\n history.each{|user, hist|\n if hist.member? universe[permuted]\n minhash[user...
[ { "docid": "84d270ec00f215b10e1d15a1ff605583", "score": "0.69950885", "text": "def min_hash_strategy\n # Precalculate and store min_hashes\n # This should be recalculated every time user likes a product\n $users.each { |u| u.min_hash = min_hash(u.products_liked) }\n\n set = Set.new\n # Al...
c9d4674cb353eaa6ebc3e7432c041444
All of the upcoming timeslots for the events, but as our wrapper objects
[ { "docid": "8e6fb743cb5f69c2ddfd38e5f08cfde6", "score": "0.6799676", "text": "def timeslots\n data['timeslots'].map { |ts|\n Timeslot.new(\n Time.at(ts['start_date']),\n Time.at(ts['end_date'] || ts['start_date']),\n data['timezone']\n )\n }.reject(&:finished?).sort_...
[ { "docid": "1d4484531ef244752f85fbb2bf992a21", "score": "0.69422513", "text": "def all_timeslots\n unless @all_timeslots.present?\n @all_timeslots = (1..5).map do |day_id|\n Timeslot.new(self, day_id, @day_start_minute, @day_end_minute)\n end\n end\n\n @all_timeslot...
914a0f3fa1437ea4d60b0e485c38d3ce
Install the given app onto the device. Each options can be snakecase or camelcase. Snakecases will be converted to camelcase as options value.
[ { "docid": "b9a7790db1d1db06788b120281089053", "score": "0.74399406", "text": "def install_app(path, **options)\n options = options.transform_keys { |key| key.to_s.gsub(/_./) { |v| v[1].upcase } } unless options.nil?\n @bridge.install_app(path, options)\n end", "title": "" ...
[ { "docid": "2ab3d751341e76b12b5ccae58e806d90", "score": "0.71176124", "text": "def app_install()\n @options[:tall] = 'tall'\n @options[:retina] = 'retina'\n @options[:sdk] = '7.1'\n @options[:device] = 'simulator'\n build_parser = OptionParser.new d...
ce0b25ee25f4d8e21c06177251ca295c
Parse the commandline args into the params hash. 'happy_flag' produces :happy_flag => true in the params hash 'foo=foo_val' produces :foo => 'foo_val' in the params hash. '' Stop parsing; all remaining args are piled into :rest self.rest contains all arguments that don't start with a '' and all args following the '' se...
[ { "docid": "efe083823341b336b46b88e8c9d37261", "score": "0.0", "text": "def process_argv!\n super\n if raw_script_name =~ /(\\w+)-([\\w\\-]+)/\n self.command = $2\n else\n self.command = rest.shift\n end\n end", "title": "" } ]
[ { "docid": "9c855301dea23e6ff19a7fd61bd90562", "score": "0.7277826", "text": "def process_argv!\n args = ARGV.dup\n self.rest = []\n until args.empty? do\n arg = args.shift\n case\n when arg == '--'\n self.rest += args\n break\n when arg =~ /\...
0de3df2521d654b9e8d091950686eba8
PATCH/PUT /proyectos/1 PATCH/PUT /proyectos/1.json
[ { "docid": "3feb332e8b28c8f3ec06255d55146bb0", "score": "0.0", "text": "def update\n respond_to do |format|\n if @proyecto.update(proyecto_params)\n\n cc = []\n if params[:proyecto][:caracteristicas]\n params[:proyecto][:caracteristicas].each do |key,value|\n ...
[ { "docid": "06c9489fed5a81c05d9eee2dacb5b8ee", "score": "0.67118937", "text": "def update\n if @propietario.update(propietario_params)\n render json: @propietario\n else\n render json: @propietario.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "doci...
7d4578ad4096d54585b50c7f9b4fdc2a
PATCH/PUT /operators/1 PATCH/PUT /operators/1.json
[ { "docid": "522acbf4e7649b8711154c4cb6e112d7", "score": "0.6518453", "text": "def update\n if @operator.update operator_params\n flash[:notice] = 'Operator was successfully updated.'\n respond_with @operator, status: :updated\n else\n respond_with @operator, status: :unprocessable_e...
[ { "docid": "f7da9fdcc37d3458fe6e831f30f2c8e6", "score": "0.68861824", "text": "def update\n respond_to do |format|\n if @operator.update(operator_params)\n format.html { redirect_to @operator, notice: t(:updated_ok) }\n format.json { head :no_content }\n else\n format.h...
5209c6ce9661a476b51d29eb11426931
Returns the value of the `to` attribute.
[ { "docid": "d2252bc8eb44f22e31fef1b9e7813c31", "score": "0.80279946", "text": "def to\n @to\n end", "title": "" } ]
[ { "docid": "c1e35586fe39880803d1e0a28adf18cc", "score": "0.84546936", "text": "def to\n attributes.fetch(:to)\n end", "title": "" }, { "docid": "0fe159dd394bea37cc15fbf4fcea43de", "score": "0.8346853", "text": "def to\n return @to\n end", ...
c8440bffd04765c3081aaf3e99c6707a
Method to add a new record based on a hash
[ { "docid": "2233708a202a171a0a788bc2fd0cf6b0", "score": "0.0", "text": "def create_record(r, defaults)\n rec = Record.new(defaults.merge(r))\n rec.save\n puts notice(rec)\nend", "title": "" } ]
[ { "docid": "e42b6d0ea1c20494aab250ee255834bd", "score": "0.78460455", "text": "def add_hash(hash)\n\t# add hash to the DB\nend", "title": "" }, { "docid": "e2addb6c2894669c6b402474b1d3efce", "score": "0.76518106", "text": "def add(hash); end", "title": "" }, { "docid": "e...
5df9b5c7c9278c0a4fe8a41acd9cf7e0
used to turn references to threads into hyperlinks examples for threads: thread 1051 thread no 1051 thread no. 1051 thread number 1051 thread 1051 examples for issues: issue 1051 issue no 1051 issue no. 1051 issue number 1051 issue 1051
[ { "docid": "b6cf3ee9f617caac1461a909d35d0c5e", "score": "0.5624131", "text": "def message_linkify(message)\n body = message.body.dup\n\n THREAD_FORMAT_MAP.each do |_key, value|\n threads_found = body.scan(value)\n\n threads_found.each do |t|\n thread_id = t.match(/\\d+/)[0]\n ...
[ { "docid": "a56c7a0bfdadf0441ad21efbf53390f5", "score": "0.6273656", "text": "def thread_for(id)\n \"http://projecteuler.net/thread=#{id}\"\n end", "title": "" }, { "docid": "30c59c4365b98aa9afd45993f3334dca", "score": "0.5884915", "text": "def tweeter_links\n links = ...
2a3c465096cb494316499f19c485f330
Sets the attackSimulation property value. The attackSimulation property
[ { "docid": "12d1d2bbe73b0892fc756abb24f9472b", "score": "0.85259914", "text": "def attack_simulation=(value)\n @attack_simulation = value\n end", "title": "" } ]
[ { "docid": "0b11efa40298aaf95cdb43817a4c4ff1", "score": "0.6145267", "text": "def attack_simulation\n return @attack_simulation\n end", "title": "" }, { "docid": "85e1f7ac208c5272a3ee5504ffb27e66", "score": "0.6009747", "text": "def set_simulation\n @si...
f13e5aeab87e1e54ef934792adaa2910
GET /product_caches GET /product_caches.json
[ { "docid": "29de345ceb96fe3526f2fcbe53eaf707", "score": "0.6798113", "text": "def index\n @jid = ProductCacheUpdater.perform_async(current_shop.id)\n params[:page] = 1 if params[:page] == \"\"\n current_shop.product_caches.page params[:page]\n end", "title": "" } ]
[ { "docid": "83267c75ffb3663008e8ee4bbd67d48c", "score": "0.70814556", "text": "def index\n @caches = Cache.all\n render json: @caches\n end", "title": "" }, { "docid": "a85c066dc6b70bfb8d21aa6e66dbd164", "score": "0.66197455", "text": "def show\n render json: @cache\n end"...
10d8d4619c4afc681cfe2c3c36c64bb3
CG Add ability to return HTML 404 code if broadcast cannot be found (e.g after deleting a broadcast)
[ { "docid": "10542542cd19772d91badf85f79dff95", "score": "0.6985105", "text": "def show_record_not_found(exception)\n\n respond_to do |format|\n format.html {\n redirect_to(broadcasts_url)\n }\n format.json {\n render json: {:errors => [\"#{I18n.t('broadcasts.b...
[ { "docid": "cd79c0378f81ad5b984e2ed17b8b8c62", "score": "0.73489124", "text": "def send_404\n I3.server.send_error(\n :status => \"404 Not Found\",\n :title => \"Permission Not Found\",\n :message => \"The specified object could not be found.\")\n end", "title": "" }, ...
6a273fc681713a216e89fa1f96a54ce7
Customized reader and writer for phone_number
[ { "docid": "8f4ff056538bd16b691fac6ac5c2bb6c", "score": "0.6794857", "text": "def phone_number\n if self[:phone_number] == nil\n return nil\n end\n phone_number = self[:phone_number]\n return PhoneNumberHandler.format_phone_number(phone_number)\n end", "title": "" } ]
[ { "docid": "f318b1c8a7af2ea0bb73102c730bdcfa", "score": "0.7170417", "text": "def shape_phone_number\n self.phone_number = twilio_format phone_number\n end", "title": "" }, { "docid": "0284e44f209dfd1415e244bebba25899", "score": "0.7150301", "text": "def phone_number; end", "...
d5c47ca093648deca8855391a94cde17
Get survey collectors Get a list of collectors for a given survey
[ { "docid": "4df87655c0c308e8c68f6b8fe4c69093", "score": "0.67056644", "text": "def get_survey_collectors_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CollectorsAndInviteMessagesApi.get_survey_collectors ...'\n end\n # r...
[ { "docid": "c09df724af0aaa4f231c5b1e5222dcc5", "score": "0.72346514", "text": "def get_survey_collectors(opts = {})\n get_survey_collectors_with_http_info(opts)\n nil\n end", "title": "" }, { "docid": "9ed5b6f4f58badb949bb24be38fb70a6", "score": "0.59930444", "text": "de...
0ce84e50790fb9cdaceac4b5c6468249
Get the current number of offense in the latest revision of the default branch If the branch has never been scanned it will return unavailable.
[ { "docid": "640db1a09427cd1dd1f6d804ee79b046", "score": "0.74446946", "text": "def offense_count\n default_branch.offense_count\n end", "title": "" } ]
[ { "docid": "451ea899ab45958f8b40a0b758bfeac1", "score": "0.5847076", "text": "def latest_version\n @latest_version ||= begin\n # Versions before 70 do not have a LATEST_RELEASE file\n return normalize_version('2.41') if release_version < normalize_version('70')\n\n late...
49da1f866ad149ad8015b219e795e3d7
Custom attribute writer method with validation
[ { "docid": "3e83aaf83dd8f150097a93199a4d7ab4", "score": "0.0", "text": "def org_id=(org_id)\n if org_id.nil?\n fail ArgumentError, 'invalid value for \"org_id\", org_id cannot be nil.'\n end\n if org_id > 2147483647\n fail ArgumentError, 'invalid value for \"org_id\", must b...
[ { "docid": "5a0bcdaca95c21b13aacca36f9fad742", "score": "0.6952908", "text": "def _write_attribute(attr_name, value); end", "title": "" }, { "docid": "5812dd7a37c0eccc3d9481c23d74c649", "score": "0.69251597", "text": "def write_attribute(attr_name, value); end", "title": "" }, ...
c32054e99d23c34524c83e7af52d76cc
Logs out from the current session if previously logged in. Always returns true
[ { "docid": "3d9eb37bc6c1a7de3e0cda6e743df8b3", "score": "0.0", "text": "def logout\n return true unless logged_in?\n self.call(\"atheme.logout\", @cookie, @user, @ip)\n @cookie, @user, @ip = '.', '.', DEFAULT_IP\n true\n end", "title": "" } ]
[ { "docid": "0249375e60b5c0bd64483c54ccff7181", "score": "0.81120753", "text": "def logged_out\r\n # If a session is set\r\n if session[:user_id]\r\n \t # Return false because they are logged in\r\n return false\r\n # Else\r\n else\r\n \t # No one is logged in so ret...
49da1f866ad149ad8015b219e795e3d7
Custom attribute writer method with validation
[ { "docid": "9e74dd93552444dba15ac9402fd7e397", "score": "0.0", "text": "def target=(target)\n if target.nil?\n fail ArgumentError, 'invalid value for \"target\", target cannot be nil.'\n end\n @target = target\n end", "title": "" } ]
[ { "docid": "5a0bcdaca95c21b13aacca36f9fad742", "score": "0.69554085", "text": "def _write_attribute(attr_name, value); end", "title": "" }, { "docid": "5812dd7a37c0eccc3d9481c23d74c649", "score": "0.6927327", "text": "def write_attribute(attr_name, value); end", "title": "" }, ...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "6faac26305671b7767b408ac9ff113ec", "score": "0.0", "text": "def update!(**args)\n @info_type = args[:info_type] if args.key?(:info_type)\n @max_findings = args[:max_findings] if args.key?(:max_findings)\n end", "title": "" } ]
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
f7647f05fa0d54aeb133dd423689c9aa
Add a new password to the list
[ { "docid": "6b1e2d8e53d4cc1e35cf3350c600124f", "score": "0.78871095", "text": "def add\n print \"Enter new password: \"\n pw = STDIN.gets.chomp\n @pw_list.push(pw) unless @pw_list.include?(pw)\n end", "title": "" } ]
[ { "docid": "a7b01c26d2ea6b23c242383e033e3212", "score": "0.73897207", "text": "def add_password(password)\n @password = password\n end", "title": "" }, { "docid": "c8f334e5edc6ee2ecba1c14be3727e9f", "score": "0.7222524", "text": "def change_passwords\n pw_list = Password_List....
3a5fe436ccc3f3e808e668bdcdd8bb38
Grab ibmadmin password from Doctor
[ { "docid": "c0927913426cb63b970993be0bfe4d77", "score": "0.0", "text": "def ibmadmin environment\n\nend", "title": "" } ]
[ { "docid": "b1b5c26833abd7ae0c08c2ee193d9c54", "score": "0.73450404", "text": "def ipa_directory_service_password\n 'd1r3ct0ry=P@ssw0r!'\n end", "title": "" }, { "docid": "d0f6f36a0b4e94601d73c3e247a30781", "score": "0.7258734", "text": "def getpassword()\r\n return ge...
174bb8a14b55ce93878bd8b49e4b1a99
The methods identified by +sym+ is not found in the TExp namespace. Try calling it in the containing namespace.
[ { "docid": "14b76a10ec4696858d2ee046d52459b5", "score": "0.0", "text": "def method_missing(sym, *args, &block)\n @container.send(sym, *args, &block)\n end", "title": "" } ]
[ { "docid": "dd86b5d2ac050de026b486b6175ba6c7", "score": "0.6230282", "text": "def method sym\n return super if methods.include? sym\n component = @_compound_parts && \n @_compound_parts.detect { |obj| obj.respond_to? sym }\n component ? component.method(sym) :\n ra...
9f99a505645c76a09d3ee146ebc0f3e5
Activate the given backend and set interactive to true. This method is based on IPython.core.pylabtools.activate_matplotlib function.
[ { "docid": "3a9208e969414aedac6f9187879bd020", "score": "0.86758506", "text": "def activate_matplotlib(backend)\n require 'matplotlib'\n Matplotlib.interactive(true)\n\n backend = backend.to_s\n Matplotlib.rcParams['backend'] = backend\n\n require 'matplotlib/pyplot'\n...
[ { "docid": "44e3235df0a996449bd5f57088521070", "score": "0.7340273", "text": "def enable_matplotlib(gui=nil)\n gui, backend = find_gui_and_backend(gui, @gui_select)\n\n if gui != :inline\n if @gui_select.nil?\n @gui_select = gui\n elsif gui != @gui_select\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "5bcfbed13fba9db2da1e6c0936ecc001", "score": "0.0", "text": "def set_summary\n @summary = Summary.where(post_id: params[:post_id])\n # @summary = Summary.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...
7bca7d07cc9caa8ebbcdc1338e59b144
Public: Returns a boolean indicating whether the RowSet was initialized with by groups.
[ { "docid": "837c1eb24e41dedb64da59289f794563", "score": "0.77080315", "text": "def has_by_groups?\n @has_by_groups ||= @by_groups.length > 0\n end", "title": "" } ]
[ { "docid": "428ca8bb922b74986a3cae88f2a08398", "score": "0.72865444", "text": "def group_rows?\n false\n end", "title": "" }, { "docid": "81f576eb6e54f141a2d7d4b2eb62e677", "score": "0.7220785", "text": "def grouped?\n\t\tgrouped\n\tend", "title": "" }, { "docid": "93...
de670b5e459c0d23ad04ad539f85662c
Changes the nick name.
[ { "docid": "d911f30105e67f3ec0b66ad5af74dc09", "score": "0.85653734", "text": "def change_nick(context, nick)\n raise ClientError.new(\"Can't change nick name. The connection is not yet registered.\")\n end", "title": "" } ]
[ { "docid": "1c2c369b2d78cd47baae8fcb753ba405", "score": "0.8806747", "text": "def set_nick(nick)\n @name = nick\n end", "title": "" }, { "docid": "1c2c369b2d78cd47baae8fcb753ba405", "score": "0.8806747", "text": "def set_nick(nick)\n @name = nick\n end", "title": ...
62d58b480518fe57fd70c157a486d391
the sql layer supports DROP TABLE IF EXISTS
[ { "docid": "dbca0c8739c07e4bed44f846d737fe76", "score": "0.7899555", "text": "def supports_drop_table_if_exists?\n true\n end", "title": "" } ]
[ { "docid": "bfdc6cb99ca34a31ce52142676ae0608", "score": "0.76820403", "text": "def test_drop_table_if_exists\n connection.create_table(:testings)\n assert connection.table_exists?(:testings)\n connection.drop_table(:testings, if_exists: true)\n assert_not connection.t...
9261fff9ea663a0d3e88e82c5fd54fbc
POST /source_apis POST /source_apis.json
[ { "docid": "4c4febe26f09c29398f0f717b2c34727", "score": "0.7671974", "text": "def create\n @source_api = SourceApi.new(source_api_params)\n\n respond_to do |format|\n if @source_api.save\n format.html { redirect_to @source_api, notice: 'Source api was successfully created.' }\n ...
[ { "docid": "719b0756a46896d8a62d370759157d01", "score": "0.7119058", "text": "def create\n @source = Source.new(source_params)\n\n if @source.save\n render json: @source, status: :created, location: api_source_url(@source)\n else\n render json: @source.errors, status: :unprocessable_e...
151db79f9661fcbc5392a88251628ec1
rubocop:enable Metrics/MethodLength, Metrics/AbcSize, Metrics/BlockLength
[ { "docid": "e7cba62a36b5e1d1899d4d6193326e2c", "score": "0.0", "text": "def build_client(voice_config)\n credentials = AwsCredentialBuilder.new(voice_config).call\n return if credentials.nil?\n\n Aws::PinpointSMSVoice::Client.new(\n region: voice_config.region,\n r...
[ { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.62498456", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.62498456", "text": "def used; end", "title": "" }, { "docid": "deff3f23898b48652dab638135db6e3f", "...
f648580b72428be602273efd2599d2c0
Build a new edge
[ { "docid": "2cc09a4cae3b12fa9a01c22a58c2066c", "score": "0.8158468", "text": "def build_edge(*args)\n edge_class.new(*args)\n end", "title": "" } ]
[ { "docid": "eebd86fdc639730a5dd98b4ce9546984", "score": "0.7999206", "text": "def new_edge(*args)\n add_edge(build_edge(*args))\n end", "title": "" }, { "docid": "c65ea1fabeb7a0cc8accf6345df89273", "score": "0.7405701", "text": "def new_edge\n\t\t\traise NotImplementedError.n...
1afcce139910344de90afd9e7f0a4a6f
PATCH/PUT /store_areas/1 PATCH/PUT /store_areas/1.json
[ { "docid": "7b560f98f84751ea502a651fc2cafb44", "score": "0.5649201", "text": "def update\n @store_area.modify_user_id = session[:user_id]\n if @store_area.update(store_area_params)\n flash[:notice] = \"庫位-更新成功!\"\n redirect_to action: \"index\"\n else\n render action: 'edit'\n ...
[ { "docid": "512451398ea95dc464c98f26e9cf8aab", "score": "0.6695002", "text": "def update\n respond_to do |format|\n @area.skus = params[:area][:skus]\n if @area.update area_params\n format.html { redirect_to admin_areas_path, notice: 'Area was successfully updated.' }\n format...
ae36abfaeba47fe6beb037fc79a055a8
CGI.unescapeHTML(string) > string Returns HTMLunescaped string.
[ { "docid": "1d1af439f0f745643280ecfe158828dc", "score": "0.8375991", "text": "def unescapeHTML(string)\n #This is a stub, used for indexing\n end", "title": "" } ]
[ { "docid": "3cf32aee66f43f30daf1420b7d956037", "score": "0.92110187", "text": "def unescapeHTML(string)\n CGI.unescapeHTML(string)\n end", "title": "" }, { "docid": "6e0bc2e28441c660b7c3a473c9f7ef07", "score": "0.8501002", "text": "def unescapeHTML(string)\n str = string.dup...
6fc4490260c9d472be578f018f816ce6
GET /leccions/new def new
[ { "docid": "36f1611fac5b4061743ab37c7b9036b0", "score": "0.0", "text": "def create\n @leccion = Leccion.new(leccion_params)\n\n respond_to do |format|\n if @leccion.save\n format.html { redirect_to @leccion, notice: 'Leccion was successfully created.' }\n format.json { render :s...
[ { "docid": "28734c9960aeb580d816e80f0188bd23", "score": "0.76027197", "text": "def new\n @lessee = Lessee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lessee }\n end\n end", "title": "" }, { "docid": "ceee4ba6910af2cfdd5af07ef2...
f3023dd13b345a25fe32bb0162526ac1
PATCH/PUT /indiastates/1 PATCH/PUT /indiastates/1.json
[ { "docid": "d9c2baa36350f1166cfc1063982747b7", "score": "0.5994156", "text": "def update\n respond_to do |format|\n if @indiastate.update(indiastate_params)\n format.html { redirect_to @indiastate, notice: 'Combination dose was successfully updated.' }\n format.json { render :show,...
[ { "docid": "7c78b69c5887af4ceed52865a44159a1", "score": "0.64325106", "text": "def update\n respond_to do |format|\n if @innapropiate.update(innapropiate_params)\n format.html { redirect_to @innapropiate, notice: 'Innapropiate was successfully updated.' }\n format.json { render :sh...
67ab2516b2b25e75d89889bdc20c9418
Autogenerate "safe" inventory file based on Vagrantfile, unless inventory_path is explicitly provided
[ { "docid": "475c23301f32d31c4d2c97cb75041c92", "score": "0.7290965", "text": "def setup_inventory_file\n return config.inventory_path if config.inventory_path\n\n # Managed machines\n inventory_machines = {}\n\n generated_inventory_dir = @machine.env.local_data_path.join(File...
[ { "docid": "7bc7526739cdf3480df72bef536b4b7f", "score": "0.7614897", "text": "def setup_inventory_file\n return config.inventory_path if config.inventory_path\n\n # Managed machines\n inventory_machines = {}\n\n generated_inventory_dir = @machine.env.local_data_path.join(\n ...
8129f7efe648aabb60a81c3e038cc845
GET /verses GET /verses.json
[ { "docid": "8077e2cd65785507ae2a319335a78a26", "score": "0.74458957", "text": "def index\n #@verses = Verse.all\n @verses = Verse.paginate(page: params[:page]) \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @verses }\n end\n end", "title"...
[ { "docid": "04c46ade488615b8d006154046afd9e0", "score": "0.6590186", "text": "def show\n @verse = Verse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @verse }\n end\n end", "title": "" }, { "docid": "04c46ade488615...
c874b2ea5026de30568e41ed302c5712
:internal: Basic version used in kernel code. Creates a copy of current method and stores it under the new name. The two are independent. Redefined in kernel/common/module.rb.
[ { "docid": "f36a83a3f426d9ddcbaf0bf334fc1fd6", "score": "0.6693538", "text": "def alias_method(new_name, current_name)\n # If we're aliasing a method we contain, just reference it directly, no\n # need for the alias wrapper\n if entry = @method_table.lookup(current_name)\n @method_table.st...
[ { "docid": "5f2900907ea87d99ceb1d532b25b2425", "score": "0.7255889", "text": "def make_independent\n self.method = method.dup\n end", "title": "" }, { "docid": "1adb8fab0065a803f956448ecb555cef", "score": "0.6867604", "text": "def __add_method__(name, obj)\n s = MethodContext....
3d4a8ca2a644bdc0d633923a67383214
set all inputs as instance variables
[ { "docid": "0aea1ff6270ed24ee8d362f8d72bccff", "score": "0.0", "text": "def virus_effects\n predicted_deaths\n speed_of_spread\n end", "title": "" } ]
[ { "docid": "35468956b5275e41ad948b16c00cc141", "score": "0.6583292", "text": "def initialize\n reset_instance_variables\n end", "title": "" }, { "docid": "66a36a6edc7e2bb58e8f9f4cdb1bb236", "score": "0.65150666", "text": "def _transfer_vars(x)\n x.instance_variables.each d...
5596cceedbe3bc795f9851a9d3f57d9b
Return actions context hash for model class.
[ { "docid": "5d84a135a9193e9fab52e2c3b1b475d9", "score": "0.5692062", "text": "def actions\n @actions ||= {}\n end", "title": "" } ]
[ { "docid": "3eab4b537bc435f3cb5a60ba5a85d632", "score": "0.6833596", "text": "def hash\n super +\n @action.hash +\n @model.hash\n end", "title": "" }, { "docid": "78ca39ec6d3ade11de6f6d0a893c40f7", "score": "0.6583696", "text": "def context action\n hash = ...
dbee47cdb4a8d390b188f26687995833
My first answer using recursion Verifed as 5/5 on coderbyte
[ { "docid": "eb03fe6fe1fc7274238c20673db0e900", "score": "0.0", "text": "def ElementMerger1(arr)\n return arr.shift if arr.size == 1\n merged = 1.upto(arr.size-1).each_with_object([]) { |i, a| a << (arr[i] - arr [i-1]).abs }\n return ElementMerger(merged)\nend", "title": "" } ]
[ { "docid": "08de766c3aa9ce01608aa15f9aa2c871", "score": "0.7634492", "text": "def recursive; end", "title": "" }, { "docid": "08de766c3aa9ce01608aa15f9aa2c871", "score": "0.7634492", "text": "def recursive; end", "title": "" }, { "docid": "115f0358715636a4e7b59a4d1f6a4784...
a752e9dc3eef42ebd66a72119cd467d9
DELETE /newseries/1 DELETE /newseries/1.json
[ { "docid": "db97208e282e66774b924cf19e8b0821", "score": "0.75482506", "text": "def destroy\n @newseries.destroy\n respond_to do |format|\n format.html { redirect_to newseries_index_url, notice: 'Newseries was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",...
[ { "docid": "dc23ed54a5fcedd73bef7fdfee8364ac", "score": "0.75680417", "text": "def destroy\n @series.destroy\n respond_to do |format|\n format.html { redirect_to series_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "913feb88d94b319326682...
4640338d51bb53095aa6b37baa33c771
breadthfirst search for ancestors of a given commit. ignores commits already seen
[ { "docid": "ebfdd3f4d9d15737ac976840447b35a4", "score": "0.7907786", "text": "def ancestors(commit, seen)\n worklist = [commit]\n worklist.each do |cm|\n if not seen.include?(cm.sha)\n seen.add(cm.sha)\n print $headnm, \": \", cm, \" --> \", seen.length(), \"\\n\" if DEBUG\n cm.paren...
[ { "docid": "83b8930e3c020c06294344efe06b52e9", "score": "0.6538833", "text": "def find_first_non_merge_parent(ref)\n each_commit_starting_at(ref).with_index do |prev_rev, idx|\n next if idx == 0\n break prev_rev if prev_rev.getParentCount <= 1\n end\n end", "titl...
7502f3d00ec3cf6efd732973dcdbc52f
GET /blood_types/1 GET /blood_types/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "73053c0735f7f0c2d82d965c37567823", "score": "0.7771016", "text": "def index\n @blood_types = BloodType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @blood_types }\n end\n end", "title": "" }, { "docid": "7261d51...
fe4ca25701cdbec2809099293de54842
Recursively acquire all depends for this schema. Return them sorted by name
[ { "docid": "9808c051f7ee31d55fe72df3ffa78b0d", "score": "0.7618774", "text": "def all_depends\n result = @depends\n # Fetch all from children\n @depends.each do |nested_type|\n # Yes, converting back to set here does some duplicate sorting.\n # But here, ...
[ { "docid": "7677dc6aaf7d51fb2af8e87c1de7094b", "score": "0.72956556", "text": "def get_dependencies\n sql = %Q{\n select *\n from all_dependencies dep\n where referenced_name = '#{@table}'\n }\n\n begin\n cursor = @connection.exec(sql)\n ...
60cd1c49be6f30b06d73d0f8d5d6caed
Pages with state 'published_being_edited' but also an active_revision should be returned
[ { "docid": "47d8dc59ab57902d5772577a9687f129", "score": "0.69284177", "text": "def test_page_with_state_published_being_edited_and_active_revision\n revision = FactoryBot.create(:revision)\n FactoryBot.create(:page, site: test_site, state: 'published_being_edited', active_revision: revision)\n ...
[ { "docid": "deab52a5ccd8d00d0a7e5c1f2e22265c", "score": "0.6532803", "text": "def can_be_edited?\n published? or unpublished?\n end", "title": "" }, { "docid": "ed2fdcfde809fd25385cc29fbeb0f090", "score": "0.6402939", "text": "def authorized_pages\r\n pages.select {|page| page...
9f066932a424dae1f92605e5f33dd6aa
the Higher Education General Information Survey taxonomic code used by the National Center for Education Statistics
[ { "docid": "811bcbbac49d6fab9fd720c3e322ff20", "score": "0.6097225", "text": "def hegis_code\n @data['hegisCode']\n end", "title": "" } ]
[ { "docid": "3ef62527d73b3aa990d48359d7d252b3", "score": "0.6791681", "text": "def tax_code\n @fields[15]\n end", "title": "" }, { "docid": "039460ae627defbf6a1b3823dc7cf8c3", "score": "0.6338743", "text": "def tax_code_example\n Utility.tax_example_in_words(self.country_co...
46e09bf8f3a0ff79d8cef6ff8e589c51
Validate the consistency of the given data. Diagnostics will be emitted to the DiagnosticProducer that was set when this checker was created
[ { "docid": "ab5fcac64de572abd76e656cada2c16e", "score": "0.57154363", "text": "def validate(data, config_file)\n if data.is_a?(Hash)\n # If the version is missing, it is not meaningful to continue\n return unless check_version(data['version'], config_file)\n check_hierarchy(dat...
[ { "docid": "e46a7b9815ddbe5fa6d08648e70fdd72", "score": "0.6377996", "text": "def validate_data\n inputs = Set.new(node.in_slots.map(&:carrier))\n effs = Set.new(node.output[carrier].keys)\n\n unless inputs.subset?(effs)\n # One or more efficiencies are missing.\n ...
1ea2d57aa451eac4ad1a10c418f2c414
GET /projectors/1 GET /projectors/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "d2c30c5a3206924b518650b441b40c0d", "score": "0.7235033", "text": "def index\n @projectors = Projector.all\n end", "title": "" }, { "docid": "7b0dc546f7e3eaf3d8880694a7d62483", "score": "0.69521457", "text": "def index\n @user = User.find_by(id: params[:user_id])\n ...
81bf36aee77f797bdef59dbfa99be04b
Shared method from TOP's Discord
[ { "docid": "8dd567446c8b96f64b54fd9f64513a8c", "score": "0.0", "text": "def pretty_print(node = @root, prefix = '', is_left = true)\n pretty_print(node.right_child, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right_child\n puts \"#{prefix}#{is_left ? '└── ' : '┌── '}#{node.value}...
[ { "docid": "4a0a34bdd22f97cae506f5810afb6f99", "score": "0.6328519", "text": "def my_bot\n Discordrb::Bot.new token: @token, application_id: @app_id\n end", "title": "" }, { "docid": "2c45cf38d945bb2fe217f5bf0bc97957", "score": "0.6040481", "text": "def message(handler)\n if...
f86d7eebb894eebdd3dbb70c57b65fc7
PUT /messages/1 PUT /messages/1.xml
[ { "docid": "e1633d00917553086c0dc074f5807dae", "score": "0.6258576", "text": "def update\r\n @message = Message.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @message.update_attributes(params[:message])\r\n format.html { redirect_to(@message, :notice => 'Message was successfu...
[ { "docid": "73afef19411843e596bc1b4b20678610", "score": "0.63687754", "text": "def update\n @msg = Msg.find(params[:id])\n\n respond_to do |format|\n if @msg.update_attributes(params[:msg])\n format.html { redirect_to(@msg, :notice => 'Msg was successfully updated.') }\n format....
bf02ed78c7e9c536349c83e114571c82
PATCH/PUT /non_political_expenditures/1 PATCH/PUT /non_political_expenditures/1.json
[ { "docid": "d3c95df9dfbef613ea57fa634108b542", "score": "0.67868173", "text": "def update\n respond_to do |format|\n if @non_political_expenditure.update(non_political_expenditure_params)\n format.html { redirect_to @non_political_expenditure, notice: 'Non political expenditure was succes...
[ { "docid": "cfa47e5cbae908f54e04ac105618ffbd", "score": "0.61082315", "text": "def update\n respond_to do |format|\n if @politically_exposed_person.update(politically_exposed_person_params)\n format.html { redirect_to politically_exposed_people_url,\n notice: 'Politic...