query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
c85860960b3ebe24626e88e980dec75e | Add one or more geospatial items in the geospatial index represented using a sorted set. | [
{
"docid": "305c525e3e945513235a69dbb6c39aeb",
"score": "0.49510792",
"text": "def geoadd(key=nil,longitude=nil,latitude=nil,member=nil)\n if key.class == String && longitude.class == Float && latitude.class == Float && member.class == String && block_given?\n @j_del.java_method(:geoadd, [Ja... | [
{
"docid": "32fe40ab1d0282ae70735181777a8372",
"score": "0.6093385",
"text": "def add_sorted_set(key, member, score)\n @kvs_instance.zadd(safe_key(key), score, member)\n end",
"title": ""
},
{
"docid": "945cd45e4ccb05260ffcfde8e056afd6",
"score": "0.6076206",
"text": "def add... |
e4b43717fb717e84988417e83783cfe8 | List a call's events | [
{
"docid": "c267a2f3ac0f69686101606f2169bf15",
"score": "0.8201279",
"text": "def list_call_events(id:)\n get(\"calls/#{id}/events\")\n end",
"title": ""
}
] | [
{
"docid": "b4ac192cbc857982b99c53fd4269bf45",
"score": "0.7083352",
"text": "def list_events()\r\n resp = @cloudtrail.lookup_events\r\n\r\n puts\r\n puts \"Found #{resp.events.count} event(s).\"\r\n puts\r\n\r\n # Uncomment the following line to display available information.\r\n # pu... |
6a22c7ba853314b3190ba839cd974948 | users Returns the user with the specified email. Returns nil if no user was found. This method is used in the login process because the id of the user is not known then. +email+:: Email of the user to be fetched | [
{
"docid": "46f0465cf654d78d6a4006ac24d6a4b1",
"score": "0.7580098",
"text": "def fetch_user_by_email(email)\n @accounts.values.detect{|account| account.respond_to?(:email) && account.email == email}\n end",
"title": ""
}
] | [
{
"docid": "58bd0bafec7e053df6d8556873236af5",
"score": "0.77875596",
"text": "def get_user_by_email(email)\n @user_manager.get_user_by(email: email)\n end",
"title": ""
},
{
"docid": "7b351f797fb18cb2ef45156b58916202",
"score": "0.77683073",
"text": "def find_by_emai... |
91c62516a58bbc9b56a33a1ddc34daab | Returns a clone of self, kind of like Objectclone. Note that unlike Object.clone this currently does not carry forward tainted/frozen state, nor can it carry forward singleton methods. Modules and internal state only. | [
{
"docid": "c1c7c3d9eb3a0a001dd0e80d2dfeacd5",
"score": "0.81019956",
"text": "def _clone_\n clone = _class_.allocate\n clone._initialize_clone_(self)\n _singleton_class_.included_modules.each {|mod| clone._extend_ mod }\n clone\n end",
"title": ""
}
] | [
{
"docid": "bc97e008c42b16677afc9b581ed0d750",
"score": "0.8278034",
"text": "def clone\n self.class.new.send(:initialize_copy, self)\n end",
"title": ""
},
{
"docid": "4fccb0c41eace048b0fe57608cad942a",
"score": "0.8200654",
"text": "def clone\n other = dup\n other.fre... |
ad5aca5a18da69966b630230c42df93c | Takes the PDF output and sends as a string. Here is how to use it in rails: def send pdf = PDF::Stamper.new("sample.pdf") pdf.text :first_name, "Jason" pdf.text :last_name, "Yates" send_data(pdf.to_s, :filename => "output.pdf", :type => "application/pdf",:disposition => "inline") end | [
{
"docid": "f85ed13b49ed739a52569e57a570a546",
"score": "0.0",
"text": "def to_s\n fill\n String.from_java_bytes(@baos.toByteArray)\n end",
"title": ""
}
] | [
{
"docid": "2d3ed73efbf625ebc2a3f7e8fd393b80",
"score": "0.7174775",
"text": "def pdf\n send_file Rails.root.join('private', 'form_16.pdf'), :type=>\"application/pdf\", :x_sendfile=>true\n end",
"title": ""
},
{
"docid": "6da18a219b051bd6e85e90f0bb1e9d2b",
"score": "0.7163346",
"... |
41d6cb57fbf4914fdd18fdf76f1ae860 | PATCH/PUT /events/1 PATCH/PUT /events/1.json | [
{
"docid": "760fbe71ff1d4794455a6d236b528dde",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }... | [
{
"docid": "dc4ff2adcbcefec9118bdd7e8716ad75",
"score": "0.73754156",
"text": "def update\n event = event.find(params[\"id\"]) \n event.update_attributes(event_params) \n respond_with event, json: event\n end",
"title": ""
},
{
"docid": "0050f781a1e526879347940817ef65b8",
"scor... |
416d12d69c24b34e26b54429290680f0 | check to see if this is a local request or coming from the web. used for custom errors | [
{
"docid": "b5e9e83599bc2b2c7abc96a49ae818a3",
"score": "0.7540794",
"text": "def local_request?\n return false\n end",
"title": ""
}
] | [
{
"docid": "c1de3554bae9746f7cf9455c45d69715",
"score": "0.76219636",
"text": "def local_request?\n true\n end",
"title": ""
},
{
"docid": "ca4728e403aeeac39ed0a039bb4a26e4",
"score": "0.75213265",
"text": "def local_request?\n false \n end",
"title": ""
},
{
... |
0ca117a5c1b6dc16ff27461db3aad80a | This is the recursive function that finds the path from origin to destination. It takes two stations as arguments, an origin station and a destination station and then, looking on the origin's line, checks if the destination station is on that line too. If it is it returns the route from station to station, if it isn't... | [
{
"docid": "2d1cfbafa6dde0157e14851c09acf339",
"score": "0.8935448",
"text": "def get_route_recurse(origin,dest) \n #establish what lines the stations belong to.\n origins_lines = get_lines_for_station(origin)\n dests_lines = get_lines_for_station(dest)\n #and check if the stations shar... | [
{
"docid": "fb279515fb0cb384c4a6036af2e531e9",
"score": "0.73558897",
"text": "def find_path(route, depart_stop, destination_stop)\n depart_stop_coordinates = [depart_stop.lan, depart_stop.lon]\n destination_stop_coordinates = [destination_stop.lan, destination_stop.lon]\n mini_distance_depart ... |
e8f7a418634c81245be272fd57272cd8 | POST /twelves POST /twelves.json | [
{
"docid": "ee61bfb5fcae915b3d0181d3cc4dac5b",
"score": "0.58131105",
"text": "def create\n @twelf = Twelve.new(twelf_params)\n\n respond_to do |format|\n if @twelf.save\n format.html { redirect_to @twelf, notice: 'Twelve was successfully created.' }\n format.json { render actio... | [
{
"docid": "660334d78c4d06bacb1c500833cdc466",
"score": "0.64068574",
"text": "def create\n @twett = current_user.twetts.build(twett_params)\n\n respond_to do |format|\n if @twett.save\n format.html { redirect_to root_path, notice: 'Twett was successfully created.' }\n format.js... |
9e48658259307bc27965910637e097a3 | Find the latest RDS snapshot taken from a given DB instance name | [
{
"docid": "5fdbbe36aadcf4fbc6be0aaca92bff46",
"score": "0.8028756",
"text": "def latest_rds_snapshot_of(db_instance_id)\n rds = AWS::RDS.new(@task.aws_config)\n candidate = nil\n rds.snapshots.each do |snap|\n next unless snap.db_instance_id == db_instance_id\n\n if candidate.nil? ||... | [
{
"docid": "656c5da0e3c1985b5525ac53dfbb8e8d",
"score": "0.74629194",
"text": "def getExistingSnapshot\n\t\t\tresp = MU.rds(@db['region']).describe_db_snapshots(db_snapshot_identifier: @db[\"identifier\"])\n\t\t\tsnapshots = resp.db_snapshots\n\t\t\tif snapshots.empty?\n\t\t\t\tlatest_snapshot = nil\n\t... |
d3a78bf990bc2fa565182288def1f91f | GET /homejoyms/1 GET /homejoyms/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "ba7637badf6025aa83ef6a480a77b910",
"score": "0.66590804",
"text": "def home\n \t#uri = URI.parse(\"http://octopart.com/api/v2/parts/search?q=CY7C2544\")\n \turi = URI.parse(\"http://octopart.com/api/v2/parts/search?q=MT49H&apikey=298ff890\")\n \t#@data = Net::HTTP.get(uri) - works\n \t#r... |
a4dcd1879f95e01e62d4d8db36755482 | Exports this keys and certificates into the returned archive stream. The returned archive stream is basically the contents of a .tgz file that contains the exported keys and certificates. | [
{
"docid": "f32f114792d4254c0c3f3e45b6aad6ef",
"score": "0.698635",
"text": "def export_to_archive_stream(opts)\n opts = check_params(opts,[:keys,:certs])\n super(opts)\n end",
"title": ""
}
] | [
{
"docid": "e18b362e1279c13ad37e68c2e8320240",
"score": "0.6545232",
"text": "def export_all_to_archive_stream\n super\n end",
"title": ""
},
{
"docid": "e63c88d4b57293a01a0ee2b12cccf550",
"score": "0.63591975",
"text": "def export_to_archive_file(opts)\n opts = check_pa... |
e0834db513a2008323f7815b55e169a0 | Retrieves all movies in the store | [
{
"docid": "f48886c720f96e38582c7c7614af279c",
"score": "0.0",
"text": "def all\n # Accessing the store requires a transaction \n @store.transaction do\n # Create an array with the values for each key \n @store.roots.map { |id| @store[id] }\n end\n end",
"title": ""
}
] | [
{
"docid": "47f76e7086051f39da260d8264bec13a",
"score": "0.7770208",
"text": "def movies\n get('Movies')\n end",
"title": ""
},
{
"docid": "39c2e40ec5e5ae9f1568fcd9aa41ddc1",
"score": "0.76359797",
"text": "def index\n @movies = Movie.all\n end",
"title": ""
},
{
... |
6af5baf6efa397bfe908c8c14d7bf5c3 | Returns the status of this user, or nil if user is not a member | [
{
"docid": "b78841e9e9edd9c8b665e9df42b1e08f",
"score": "0.6204021",
"text": "def membership_status(role)\n member = student_memberships.where(role_id: role.id).first\n member&.membership_status\n end",
"title": ""
}
] | [
{
"docid": "82da421fd474e07b4ef4297769e39e6d",
"score": "0.71984524",
"text": "def get_user_status(user_id)\n\t\treturn nil if not party_list[user_id]\n\t\treturn party_list[user_id][:status]\n\tend",
"title": ""
},
{
"docid": "7df1ae8750fc398cdf167f8e8cfd752d",
"score": "0.65857005",
... |
bdcfa802f529411d3dcec53c78d45387 | make subsitutions, from uncleaned to cleaned | [
{
"docid": "5818d5ccae9d79b71dd3dbbd76ef8641",
"score": "0.70346564",
"text": "def make_subsitutions!\n SUBSTITUTIONS.each do |uncleaned_path, cleaned_path|\n @path = @path.gsub(uncleaned_path, cleaned_path)\n end\n end",
"title": ""
}
] | [
{
"docid": "fb363b86cad43070f7168544a8537d5f",
"score": "0.5861043",
"text": "def prune_empty_submodels\n self.creators = self.creators.select{ |c| !c.name.blank? }\n self.extents = self.extents.select{ |e| !e.name.blank? }\n self.resource_dates = self.resource_dates.select{ |r| !r.year.blank? ... |
34c11ab8e739fe3a1d017ebecf13b0af | This method returns the fraction of the wall dominated by the window | [
{
"docid": "604f3a123ea40628449f500e75af760d",
"score": "0.75603205",
"text": "def get_fwr()\n get_window_area().to_f / get_area.to_f\n end",
"title": ""
}
] | [
{
"docid": "9f084fb0e08979d5938b920138fc4a41",
"score": "0.7579936",
"text": "def get_fwr()\n get_window_area().to_f / get_area.to_f\n end",
"title": ""
},
{
"docid": "46e95eca5ebaf00fa6d806530d268e0a",
"score": "0.64637446",
"text": "def window_width\n Graphics.width / 2\... |
47feb16b19fa4d745a5132d9239bef47 | % ancestors : () > Array | [
{
"docid": "da7e8eeda2c7a84ee197314e2f6151b6",
"score": "0.890385",
"text": "def ancestors() end",
"title": ""
}
] | [
{
"docid": "b799174658e94c064328a6fad9c49191",
"score": "0.9023461",
"text": "def ancestors\n []\n end",
"title": ""
},
{
"docid": "3cbc3482b5b6e8d3d9c3022a3e4fabac",
"score": "0.8986987",
"text": "def ancestors\n []\n end",
"title": ""
},
{
"docid": "8146... |
be88fec3088f2a9a69f0568f9da6d945 | Are all of the conditions for rate limiting met for this record? | [
{
"docid": "7ba24b128a0892d6f5e4aafbfc9ee3d0",
"score": "0.74289924",
"text": "def rate_limit?\n (if_condition.blank? || if_condition.call(@record)) && !unless_condition.try(:call, @record)\n end",
"title": ""
}
] | [
{
"docid": "df2af1270d9184c9a6f4edde6cad9769",
"score": "0.75680697",
"text": "def check_for_rate_limits\n future_response_count < 360\n end",
"title": ""
},
{
"docid": "4d98e8b12580bb7d8fdcb67217a0fc5f",
"score": "0.7546819",
"text": "def check_for_rate_limits\n rate_limit_re... |
84a6f75e72f420e4133a8b9d08a7e6d0 | rubocop:disable Metrics/AbcSize rubocop:disable Metrics/MethodLength | [
{
"docid": "e6d68e6997968fcaa2ddbc2eb765a28c",
"score": "0.0",
"text": "def draw\n puts \" | |\"\n puts \" #{squares[1]} | #{squares[2]} | #{squares[3]}\"\n puts \" | |\"\n puts \"-----------------\"\n puts \" | |\"\n puts \" #{squares[4]} | #{squares[5]... | [
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.65473753",
"text": "def used; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.65473753",
"text": "def used; end",
"title": ""
},
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"... |
ee795726018e2095810b65b9ef56bf4b | GET /pull_roles GET /pull_roles.json | [
{
"docid": "20296c6488e8e42c13946a8d62c083db",
"score": "0.750084",
"text": "def index\n @pull_roles = PullRole.all\n end",
"title": ""
}
] | [
{
"docid": "a1d730f58061c1c14d98141a1c22fd8b",
"score": "0.6969727",
"text": "def get_roles\n self.class.get(\"#{@url}/rest/user-management/roles\", basic_auth: @auth)\n end",
"title": ""
},
{
"docid": "338cc6846addfd5aa0e58b623156df9b",
"score": "0.6908033",
"text": "def get_rol... |
ff6f42506f28d5c21ef91b3e9f82dfb6 | DELETE /moresmallmobs/1 DELETE /moresmallmobs/1.json | [
{
"docid": "7d93d87103dee54d652e7f078045c06c",
"score": "0.75743634",
"text": "def destroy\n @moresmallmob = Moresmallmob.find(params[:id])\n @moresmallmob.destroy\n\n respond_to do |format|\n format.html { redirect_to moresmallmobs_url }\n format.json { head :no_content }\n end\n ... | [
{
"docid": "d93be88c83290f5d73abe703916aa220",
"score": "0.7285562",
"text": "def destroy\n @mall = Pro::Wmall::Mall.find(params[:id])\n @mall.destroy\n\n respond_to do |format|\n format.html { redirect_to malls_url }\n format.json { head :no_content }\n end\n end",
"title": "... |
33f6561f5e996ccf829c1a6951cc257a | number1 a integer that will be compaired. number2 a integer that will be compaired. Examples min_of_two(1, 6) => 1 Returns the smallest number. | [
{
"docid": "fdc4732ea2280b3e6bf79f32517d9c41",
"score": "0.82614434",
"text": "def min_of_two(number1, number2)\n output = number1\n if number1 > number2\n output = number2\n end\n return output\nend",
"title": ""
}
] | [
{
"docid": "79eeb830381097927e1a3fb12956459c",
"score": "0.82185864",
"text": "def min_of_two(number1, number2)\n if number1 < number2\n output = number1\n else\n output = number2\n end\n return output\nend",
"title": ""
},
{
"docid": "971f6c446256c1d4c0542d7b0b862e... |
4cd495e3e065020cbd22ccaadd3fd35d | Author: Martinique Dolce Course: Flatiron School 2020, November 9 20201, April 2021 | [
{
"docid": "d141aaa3f437780d459e338f5a756e6a",
"score": "0.0",
"text": "def first_challenge\n epic_tragedy = {\n :montague => {},\n :capulet => {}\n }\nend",
"title": ""
}
] | [
{
"docid": "65ffca17e416f77c52ce148aeafbd826",
"score": "0.61815095",
"text": "def schubert; end",
"title": ""
},
{
"docid": "ad244bd0c45d5d9274f7612fa6fee986",
"score": "0.6158545",
"text": "def suivre; end",
"title": ""
},
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
... |
62ecb4e3909eb4e01c523dfef9e52ca8 | When a card is drawn from the draw pile | [
{
"docid": "cf0d760753b696f64c92db511871ad1b",
"score": "0.6880932",
"text": "def draw\n #set variables\n game = Game.find(params[:id])\n player = game.players.first.id\n opponent = game.players.last.id\n\n #draw a random card from the draw pile and add it to player hand.\n drawn_card ... | [
{
"docid": "b40a8b113556da59a186f6ba5303876d",
"score": "0.74415994",
"text": "def draw\n @cards.pop\n end",
"title": ""
},
{
"docid": "40330e0fa9ed0691575bfb6e11b835e4",
"score": "0.7425173",
"text": "def draw_card\n self.cards.pop\n end",
"title": ""
},
{
"d... |
7dfcd779133a69a1bef624f535779cea | method to update an existing record accepts hash containing attributes the we want to update | [
{
"docid": "e4581ff35df6e4e2a8616d3e136da684",
"score": "0.0",
"text": "def update\n\t\t@post = Post.find(params[:id])\n\t\t\n\t\tif @post.update(params[:post].permit(:title, :text))\n\t\t\tredirect_to @post\n\t\t\t\n\t\telse\n\t\t\t#@post is passed back to the edit template\n\t\t\t#when it is rendered\... | [
{
"docid": "605c52e7398665ca76a2342f9cf87e74",
"score": "0.74756974",
"text": "def update_record!(record, hash, inventory_object)\n record.assign_attributes(hash.except(:id))\n if !inventory_collection.check_changed? || record.changed?\n record.save\n inventory_collection... |
249f2ca05bdcc187f4c03eb091b8a868 | GET /buildings/new GET /buildings/new.json | [
{
"docid": "de23e3b73003e53ec0bc50ee103e80c9",
"score": "0.70533186",
"text": "def new\n\n @buildings=Building.all\n @localities=Locality.all\n @building = Building.new\n @building.locations.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render jso... | [
{
"docid": "a98c03a27b2357ba97cad225d35e4c36",
"score": "0.7922918",
"text": "def new\n @building = Building.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @building }\n end\n end",
"title": ""
},
{
"docid": "6edc5252177777d5a43bd... |
a0a4e4c050549278edf38f290d3f8c39 | Make sure to attach fragment | [
{
"docid": "f098da8fc98a644a0e79d688095511d8",
"score": "0.0",
"text": "def uri\n self + \"\"\n end",
"title": ""
}
] | [
{
"docid": "3dc023a550574408ebdead92dffc0116",
"score": "0.6670275",
"text": "def fragment?; end",
"title": ""
},
{
"docid": "3dc023a550574408ebdead92dffc0116",
"score": "0.6670275",
"text": "def fragment?; end",
"title": ""
},
{
"docid": "b3ca60c10abdba7162eb4ad3067bfe25... |
aedc2a190b090c683e91a8c169d9cd6c | Jump if the zero flag is not set (from a math operation or comparing two numbers that are unequal) | [
{
"docid": "47caaf785b700ce024f8a3053e44bfee",
"score": "0.56002504",
"text": "def execute_JE(operand) # Same as the JZ instruction\n\t\tjump_conditionally_to_signed_displacement(operand, @flags.value[ZERO_FLAG] == 1) # Non-zero means set\n\tend",
"title": ""
}
] | [
{
"docid": "cd179cd70151e8822ee1f4985fb5a47d",
"score": "0.7058344",
"text": "def zero?() end",
"title": ""
},
{
"docid": "cd179cd70151e8822ee1f4985fb5a47d",
"score": "0.7058344",
"text": "def zero?() end",
"title": ""
},
{
"docid": "c087064672baf4e66ea7d26f1a538a14",
... |
d7d756b8fee72461116a71f418202bce | Sets the showFilterButton property value. Indicates whether the filter buttons are visible at the top of each column header. Setting this is only allowed if the table contains a header row. | [
{
"docid": "bf86fb15d456c408b238fe38261691e8",
"score": "0.71133274",
"text": "def show_filter_button=(value)\n @show_filter_button = value\n end",
"title": ""
}
] | [
{
"docid": "d33e033787ace1f0a65c155d683a080f",
"score": "0.6417989",
"text": "def show_filter_button\n return @show_filter_button\n end",
"title": ""
},
{
"docid": "94649bd42e38869b49a3a9e465f83487",
"score": "0.56249315",
"text": "def show_headers=(value)\n... |
503f027320fd18ed55f8e3307b11c332 | Keep AS2 classes compiled by MCC into the SWF (this could cause some classes to be present two times if also compiled with MTASC). | [
{
"docid": "2b9fdd686a8e51eeed126b7ad2591e71",
"score": "0.0",
"text": "def keep=(boolean)\n @keep = boolean\nend",
"title": ""
}
] | [
{
"docid": "843b84d76a6bd337db8fe3aedc41c8b4",
"score": "0.61584765",
"text": "def discard_classes; end",
"title": ""
},
{
"docid": "bffa167c3ab18e98d653f11be25c989d",
"score": "0.5819517",
"text": "def remove_classes_and_modules\n end",
"title": ""
},
{
"docid": "88fa... |
f7e07db184324db1af9d007eb915be9e | zeby w ogole mozna bylo sie zalogowac | [
{
"docid": "69bd67d398d0f39669e725e51e0710e0",
"score": "0.0",
"text": "def new\n end",
"title": ""
}
] | [
{
"docid": "58071cb928191298f90708594da97fc0",
"score": "0.6288652",
"text": "def zalogowany_user\n unless zalogowany?\n pamietaj_lokalizacje\n redirect_to loguj_path, notice: \"Zaloguj sie.\"\n end\n end",
"title": ""
},
{
"docid": "0d0d9e3e0d0ea5ded0f1b227eaade28... |
ea32cf6a1e38ed48520466e425fbddc6 | consolidate the same strings together lowers GC load | [
{
"docid": "09c6cdc27a8f71b87d3c7c3c5974f979",
"score": "0.5508129",
"text": "def tokenize_consolidated(str)\n tokenize(str).map { |token| @token_table[token] ||= token }\n end",
"title": ""
}
] | [
{
"docid": "0cecb7f41ab58c94ee376bb1080945fa",
"score": "0.6164697",
"text": "def compressedStr\n @strings.inject {|a,b| a + \" \" + b}\n end",
"title": ""
},
{
"docid": "a5cf59685fc5e384a1b09c5609753ee9",
"score": "0.60957056",
"text": "def all_strings(min = 0)\n GC.start\n ... |
1292e060259a395ca2ad7bbaadcbb651 | Lazyinitialize the asset_store, preferably after the Node has launched. | [
{
"docid": "040b02e73f9aee2d0d09c6136d3f9696",
"score": "0.7097027",
"text": "def asset_store\n @asset_store ||= AssetStore.new\n end",
"title": ""
}
] | [
{
"docid": "66995a3693ae779478e04952c8fc9407",
"score": "0.6067031",
"text": "def init_with(environment, coder)\n super\n\n @processed_asset = environment.find_asset(pathname, :bundle => false)\n @required_assets = @processed_asset.required_assets\n\n if @processed_asset.dependency_d... |
ea054d247582c3efbc10da9633f372de | alias reciprocal inverse Matrix exponentiation. Defined for integer powers only. Equivalent to multiplying the matrix by itself N times. Matrix[[7,6], [3,9]] 2 => 67 96 48 99 | [
{
"docid": "f8b3fc0568b367eb4e299d4cc5cb1a42",
"score": "0.52276987",
"text": "def ** (other)\n if other._isInteger\n x = self\n if other <= 0\n x = self.inverse\n return Matrix.identity(self.column_size) if other == 0\n other = -other\n end\n z = x\n n =... | [
{
"docid": "291602f554426bd880d182aa9b66cb29",
"score": "0.66889405",
"text": "def matrix_power(a, n)\n a = NArray.asarray(a)\n m,k = a.shape[-2..-1]\n unless m==k\n raise NArray::ShapeError, \"input must be a square array\"\n end\n unless Integer===n\n raise ArgumentError, \"ex... |
3070159284755078a18ac51b948aaf45 | GET /rails_posts/1 GET /rails_posts/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "915c0178f9e4347098d8a463c2cbe6b0",
"score": "0.7597354",
"text": "def show\n @posts = Post.find(params[:id])\n render json: @posts\n end",
"title": ""
},
{
"docid": "ad221611c85e1ec63d3385d6179e41a2",
"score": "0.72612166",
"text": "def show\n render json: Post.... |
ac87324bcca05e8acb3296aa03e2c412 | => "Hello, cruel world" | [
{
"docid": "4bdce2eb6ef3533dbe968091d1821880",
"score": "0.0",
"text": "def just_yield\n yield\nend",
"title": ""
}
] | [
{
"docid": "82257a5ca5cb496eb0bdfb2d4219cdb9",
"score": "0.7914997",
"text": "def say_hello\n string = \"This is me saying, hello world!\"\n return string\n end",
"title": ""
},
{
"docid": "6c6040e0e00957280dda6a769a8b2ca9",
"score": "0.73906136",
"text": "def what_is_life\n ... |
662ed428e2578073a39b9d7d9a754e64 | DELETE /counter_schedules/1 DELETE /counter_schedules/1.json | [
{
"docid": "5a1f762be9d58cfddb66fc4618a17b6e",
"score": "0.77212816",
"text": "def destroy\n @counter_schedule.destroy\n respond_to do |format|\n format.html { redirect_to counter_schedules_url, notice: 'Counter schedule was successfully destroyed.' }\n format.json { head :no_content }\n... | [
{
"docid": "e44decd8dffe0bc68046f48ec3b25ca7",
"score": "0.73387104",
"text": "def destroy\r\n @route_schedule = RouteSchedule.find(params[:id])\r\n @route_schedule.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to route_schedules_url }\r\n format.json { head :no_co... |
a066940116bf5799896b19bc0dca52f6 | This will build the Vagrantfile and insert the attributes required | [
{
"docid": "774881234be387bc5f72333a8b552c23",
"score": "0.7159699",
"text": "def createInitFile()\n\n\t\t\tscript = File.open(\"Vagrantfile\", \"w\")\n\t\t\t\n\t\t\tscript.puts \"# -*- mode: ruby -*-\n# vi: set ft=ruby :\n\nVagrant.configure(2) do |config|\n\n\tconfig.vm.box = 'cloudcenter'\n \t\n \tco... | [
{
"docid": "c2fc48cea9074bcfb68421fbb449110f",
"score": "0.7453996",
"text": "def build_vagrantfile\n file = <<-EOF\n Vagrant::Config.run do |config|\n config.vm.forward_port(22, 2222)\n config.vm.box = \"#{config[:box]}\"\n config.vm.host_name = \"#{config[:hostna... |
0da7fbc1a297da95787fc60c67c8346b | This method is invoked by Ruby when a method that is not defined in this instance is called. | [
{
"docid": "06dc458f76c2d69bbe8bbfcff7407bf9",
"score": "0.0",
"text": "def method_missing(method, *args)\n\n # We could remove this check and return nil for any non-recognized tag.\n # The problem would be that it would make tricky to debug problems with\n # typos. For instance: <>.potr ... | [
{
"docid": "ed9d410d8503fbeee04aad3888da9993",
"score": "0.79577446",
"text": "def _undefined\n raise \"Method #{__callee__} is unimplemented and needs to be overridden.\"\n end",
"title": ""
},
{
"docid": "ed9d410d8503fbeee04aad3888da9993",
"score": "0.79577446",
"text": "de... |
d5657f26aadceb33cced04dbeb61290c | Loop through password, increasing the index of each letter by 1 For each letter, advance to the next one by using str.next, or something similar Output: Print final encrypted password | [
{
"docid": "3b224e4c93b511f65271597160754fef",
"score": "0.7631737",
"text": "def encrypt()\n\tputs \"What is your password?\"\n\tinput = gets.chomp\n\tpasswordlength = input.length\n\tfor i in 0...passwordlength\n\t if input[i] == 'z'\n\t input[i] = 'a'\n\t else\n\t\tinput[i] = input[i].next\n\t\... | [
{
"docid": "ad64799f6198fd255634328597b5d49f",
"score": "0.79905045",
"text": "def encrypt(password)\n counter = 0\n result = \"\"\n while counter < password.length\n letter = password[counter]\n \n if letter == \" \"\n result << \" \"\n elsif letter == \"z\"\n result << \"a\"\n else\... |
b7003b3e7ca54dca8f5cf7d800ff968b | step 1 of registeration you select a school if you have more than no need for authentication GET Request Parameters nid id of the school to show the subjects for | [
{
"docid": "adb28e44998a3a2e7a227222e6f6393d",
"score": "0.0",
"text": "def start_registration\r\n \r\n end",
"title": ""
}
] | [
{
"docid": "e65511d4dc311c157a3db05493f5edce",
"score": "0.7166421",
"text": "def list_subjects\r\n #TODO only list subjects from my own schools \r\n #because then people can still it \r\n school = School.find(params[:nid]) rescue render_return\r\n render_return if !logge... |
413b15f49630a02b1166aa168ad051a5 | who to copy on emails | [
{
"docid": "99e154150c276fec2d8607147bcffd03",
"score": "0.5036153",
"text": "def cc\n if @to == 'president'\n 'operations@apache.org'\n else\n 'board@apache.org'\n end\n end",
"title": ""
}
] | [
{
"docid": "8c77bd56a6171060ef9cbe4fbd326d38",
"score": "0.66705513",
"text": "def copy_email(copyable, copier, user)\n @user = user\n @copier = copier\n @copyable = copyable\n mail(to: @user.email, subject: \"#{@copier.name} copied your #{app_name} #{@copyable.class} \\\"#{@copyable.name}\\... |
115943e1f3cc48eae6f675482d03858b | GET /references GET /references.json | [
{
"docid": "192c8d2e4ad246e2777ab975ff08e456",
"score": "0.7129048",
"text": "def index\n @references = Reference.all\n end",
"title": ""
}
] | [
{
"docid": "45efb11e81b36d1881ab86e275852562",
"score": "0.7553891",
"text": "def references\n references_hash.to_json\n end",
"title": ""
},
{
"docid": "0d046d8f6fb8148747c66c9ef49dedce",
"score": "0.74091256",
"text": "def index\n @references = Reference.all\n\n rende... |
fb8016635da5f69fdac26bd88b207dcd | Metodos para manejar URIs | [
{
"docid": "87f5ca60455eeb6a1cd76ac2d0848a94",
"score": "0.0",
"text": "def get_uri(rdf_uri, predicate)\n Rails.logger.debug(\"RdfQuery::get_uri(#{rdf_uri}, #{predicate})\") if @@trace_on == true\n\n vars = Hash[:uri => RDF::URI]\n statements = Array.[](\n \"<#{rdf_uri}... | [
{
"docid": "7f0a5d5a873b1b3c1901c5363f6b0dbd",
"score": "0.7133006",
"text": "def uri_normalizer; end",
"title": ""
},
{
"docid": "da5906cb3c535f56783cfde50fca3929",
"score": "0.6890685",
"text": "def uri=(_arg0); end",
"title": ""
},
{
"docid": "da5906cb3c535f56783cfde50... |
dd424794b57e885521e52fdd40801468 | POST /comments POST /comments.json | [
{
"docid": "a1d556e13a89b2501e6722b5c3a1a46b",
"score": "0.0",
"text": "def create\n\n @comment = Comment.new(comment_params, user: current_user)\n @comment.user_id = current_user.id\n #@patient = Patient.find(params[:id])\n respond_to do |format|\n if @comment.save\n format.html... | [
{
"docid": "7b0a68ee4df9cfc8f7cc619d01d2577d",
"score": "0.7545618",
"text": "def create\n @comment = @post.comments.create!(comment_params)\n json_response(@comment, :created)\n end",
"title": ""
},
{
"docid": "278b898b0e96dc8518cb54546e69f368",
"score": "0.7373569",
"t... |
1b467658bda7efcee0dd126b76d09c37 | This method checks only the customer location evidences | [
{
"docid": "b5d628275160fdefbb69ebbd70e6c00b",
"score": "0.0",
"text": "def non_conflicting_location_evidences\n return only_location_evidences if only_location_evidences.size == 1\n\n # Returns { country_code => [[evidence_label, evidence_object], ...] }\n grouped_by_country = only_locat... | [
{
"docid": "81e9ae56ec40860ce25151a41bdef8fb",
"score": "0.66526806",
"text": "def find_theaters_and_confirm_or_deny_location\n begin\n TicketSources.for_country(self.country_code).find_theaters_near(postal_code)\n theaters = Theater.near(coordinates, 15)\n if theaters.any?\n co... |
2eedf0fc3fb9d4ed475a2f28d39312b7 | Handle attribute expression `[:html, :attr, name, value]` | [
{
"docid": "da28c75be819436ced48938d54d0d2c9",
"score": "0.72419184",
"text": "def on_html_attr(name, value)\n if value[0] == :slim && value[1] == :attrvalue && !options[:merge_attrs][name]\n # We handle the attribute as a boolean attribute\n escape, code = value[2], value[3]\n ... | [
{
"docid": "78f49360266babb8fa0ebe88e176d76b",
"score": "0.7456356",
"text": "def on_html_attr(name, value)\n if value[0] == :slim && value[1] == :attrvalue\n code = value[3]\n [:code, code]\n else\n @attr = name\n super\n end\n end",
"title": ""
},
... |
5b68806daf1b7836d0b6c733beca59db | Sets the value of the `options` attribute. | [
{
"docid": "9fee6281abe45a4cf8fa2ed8c6c2cd79",
"score": "0.7154166",
"text": "def options=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = Option.new(value)\n end\n ... | [
{
"docid": "24c4a5440847d4e8e181eb9692d957d5",
"score": "0.8730352",
"text": "def options=(value)\n @@options = value\n end",
"title": ""
},
{
"docid": "24c4a5440847d4e8e181eb9692d957d5",
"score": "0.8730352",
"text": "def options=(value)\n @@options = value\n ... |
3f01f6a67c2a6e8ea22188a545f3012e | GET /buys GET /buys.xml | [
{
"docid": "69b28b70eb4d7b74bdae4e380c69a52a",
"score": "0.6901756",
"text": "def index\n @buys = Buy.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @buys }\n end\n end",
"title": ""
}
] | [
{
"docid": "b3c54e16afefdbdc08e11b027b144413",
"score": "0.65263414",
"text": "def index\n @user_budges = UserBudge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_budges }\n end\n end",
"title": ""
},
{
"docid": "da1a7f2... |
5fda154d08ede114736b4601a30bb0c8 | returns true/false based on position | [
{
"docid": "7ff2dfc1457315f2866e8204afb44292",
"score": "0.0",
"text": "def valid_move?(board, index)\n index.between?(0,8) && !position_taken?(board, index)\nend",
"title": ""
}
] | [
{
"docid": "bf2f8f48239defd12929f8dbbcfbb6a4",
"score": "0.81408024",
"text": "def position?\n false\n end",
"title": ""
},
{
"docid": "09d20e0b83ff893105f1f4608e798737",
"score": "0.7821429",
"text": "def pos?\n self > 0\n end",
"title": ""
},
{
"docid": ... |
6d2e3006b30b9d676130ae44ec675a13 | Works like a meta run method which goes through all the configured listeners. Use the Configurator.join method to prevent Ruby from exiting until each one is done. | [
{
"docid": "59b791e7bf14d192e1c64d7cfcfde95e",
"score": "0.68182534",
"text": "def run\n @listeners.each {|name,s| \n s.run \n }\n\n $mongrel_sleeper_thread = Thread.new { loop { sleep 1 } }\n end",
"title": ""
}
] | [
{
"docid": "3a4975d8719fe78f9a4c616be1372bb4",
"score": "0.74348336",
"text": "def join\n @listeners.values.each {|s| s.acceptor.join }\n end",
"title": ""
},
{
"docid": "c9e509d5df3424a1dd97aa8e4d31fa27",
"score": "0.6376583",
"text": "def do_listening\n in_dir @config.... |
ed75788b4f5da4924d837d4c8d6d8821 | Checks if the destination table will be time partitioned. See [Partitioned Tables]( | [
{
"docid": "54b9c8efba6251617b3e050ae4ecc42d",
"score": "0.68926275",
"text": "def time_partitioning?\n !@gapi.configuration.load.time_partitioning.nil?\n end",
"title": ""
}
] | [
{
"docid": "0c734ca1439b16ad2775914eedb2f1d5",
"score": "0.7044265",
"text": "def partitioned_day?(time)\n day_partitions[(time.wday) * 24, 24].include?('T')\n end",
"title": ""
},
{
"docid": "6093d8939dce15bd5e372b2f1a2bf8a4",
"score": "0.70110387",
"text": "def time_par... |
84d20c88f04d863d304bf5835b647ae6 | GET /bar55s/1 or /bar55s/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "dd341725e6fd6f6c6e4256cbf93f8364",
"score": "0.63412565",
"text": "def show\n @bar = Bar.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bar }\n end\n end",
"title": ""
},
{
"docid": "1de959baba326c045ef... |
c2350108c1b0d888db1f63034445b308 | define what happens when the measure is run | [
{
"docid": "5e92a70e2c13c50f0638c6c418203613",
"score": "0.0",
"text": "def run(model, runner, user_arguments)\n # method run from os_lib_model_generation.rb\n result = bar_from_building_type_ratios(model, runner, user_arguments)\n end",
"title": ""
}
] | [
{
"docid": "99ab945a1927e84fe17934e1440b9eb0",
"score": "0.7556993",
"text": "def measure(&block); @measure = block; end",
"title": ""
},
{
"docid": "98be183bacea0b93f865dcb476b3ac9c",
"score": "0.71152234",
"text": "def measure(&block)\n @measure = block\n end",
"title": ""
... |
ee2c5c7fbdea3e17a9de9086c77fce09 | new method with argument to pass in | [
{
"docid": "0e6205c791c5190774f66499462cbefb",
"score": "0.0",
"text": "def saying_hello(name, age)\n puts (\"Hello \" + name + \" you are \" + age.to_s)\nend",
"title": ""
}
] | [
{
"docid": "28df237333ef5558ed6b4726e26e7bea",
"score": "0.71049213",
"text": "def my_new_method(arg1, arg2, arg3)\n\t# code for method will go here\nend",
"title": ""
},
{
"docid": "bc50701b04b9669938f1d64cfdb1fa80",
"score": "0.6998403",
"text": "def new(*args); end",
"title": ... |
d50bfdced6c2696d7ca5260eac2ee5f0 | GET /page_acces/1 GET /page_acces/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "9843de7cebdea7fa4b9d98a9658ff1a4",
"score": "0.7176121",
"text": "def index\n @page_acces = PageAcce.all\n end",
"title": ""
},
{
"docid": "588083f5d5c2a675a044cd6aecc12fff",
"score": "0.68455356",
"text": "def index\n @accesses = Access.page(params[:page])\n end"... |
e64460a85f786e7317a549ad60ab656c | Convert kilometers to nautical miles. source://geocoder//lib/geocoder/calculations.rb346 | [
{
"docid": "6de3d7f416d1338121d4f0a614d26d2b",
"score": "0.81428003",
"text": "def to_nautical_miles(km); end",
"title": ""
}
] | [
{
"docid": "7540fb9fb68bf51bd4fdc82137301228",
"score": "0.8087336",
"text": "def to_miles(km); end",
"title": ""
},
{
"docid": "2aea45ce6ec37d1ad33c22be0785e3ce",
"score": "0.79312795",
"text": "def miles_to_kilometers(miles)\n miles * 1.6\nend",
"title": ""
},
{
"docid... |
480ce3386449535e2aae6bd10000290c | PATCH/PUT /stamps/1 PATCH/PUT /stamps/1.json | [
{
"docid": "fc700c00af670570992698a98abbe82c",
"score": "0.67845047",
"text": "def update\n respond_to do |format|\n if @stamp.update(edit_stamp_params)\n format.html { redirect_to @stamp, notice: 'Stamp was successfully updated.' }\n format.json { render :show, status: :ok, locati... | [
{
"docid": "ce179b0ab4ae9c103c5335b2e314e922",
"score": "0.6790452",
"text": "def update\n respond_to do |format|\n if @stamp.update(stamp_params)\n format.html { redirect_to @stamp, notice: 'Stamp was successfully updated.' }\n format.json { render :show, status: :ok, location: @s... |
a6e495d6764481940de36d10ae3e43e0 | this takes no arguments | [
{
"docid": "da2ba42b9af0b9d312bdd63eda34fa2a",
"score": "0.0",
"text": "def print_none()\r\n puts \"I got nothin'\"\r\nend",
"title": ""
}
] | [
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.7210538",
"text": "def private; end",
"title": ""
},
{
"docid": "d5b2c651ef02f091c61a5639e05783d2",
"score": "0.7039489",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899a... |
8bc188bc32f81aeabc0794d4f4d0b3f3 | Set the given task as a duplicate and log. In the list of tasks that have this same name, find all tasks that are duplicate of this one and set them as having this duplicate. | [
{
"docid": "3c11af169f1e63db02a7087b3f8ab305",
"score": "0.8834133",
"text": "def set_and_log_task_as_duplicate(duplicated_task, tasks_with_same_name)\n\n dup_filname = duplicated_task.filename\n\n # Get all of the other tasks that have this task name and set them as being a duplicate of this ... | [
{
"docid": "a5f888ad49e03d73567062feedac2b0e",
"score": "0.7131244",
"text": "def duplicate\n dup.tap do |task|\n task.parent_uuid = task.uuid\n task.uuid = nil\n task.tests = duplicate_tests\n task.files = duplicate_files\n task.model_solutions = duplicate_model_solutions\n ... |
7059cec4dd2ace95da21bd1a9d5597c4 | Get the list of ids for the secrets stored in the warehouse | [
{
"docid": "18e141d2c4d515d619daa83e5cc76ec9",
"score": "0.6887636",
"text": "def ids\n storage.keys\n end",
"title": ""
}
] | [
{
"docid": "74c57fb14c07df90aafc2204e92165bd",
"score": "0.6535082",
"text": "def list_stored_user_ids_ar\n Credential.all.map {|credential| credential.user_id}\nend",
"title": ""
},
{
"docid": "5afdcd274382e04a5482e66c150d01ec",
"score": "0.64787257",
"text": "def ids\n ... |
125b8bec8bc9fc0ff0581db12a62011f | called when 'return' key pressed. return NO to ignore. | [
{
"docid": "81e515d92684142633198065d27b3d2a",
"score": "0.6419309",
"text": "def textFieldShouldReturn(textField)\n textField.resignFirstResponder\n true\n end",
"title": ""
}
] | [
{
"docid": "233b8575313acd9dd1c3f33370b7ef8f",
"score": "0.6665056",
"text": "def on_return(&block); end",
"title": ""
},
{
"docid": "8b9f461b6f12c02d2d36c8fea440d5df",
"score": "0.61950207",
"text": "def on_return(&block)\n @on_return = block\n nil\n end",
... |
744b6b314bb7ed8aac25e5d4d9b8e6ba | || side_a < 0 || side_b < 0 || side_c < 0 | [
{
"docid": "a620c8c9cd60ba934cb83b3c89473b75",
"score": "0.6238871",
"text": "def kind\n\n if (side_c <= 0) || (side_b <= 0) || (side_a <= 0) || ((side_a + side_b) <= side_c) || ((side_b + side_c) <= side_a) || ((side_a + side_c) <= side_b)\n \n \n raise TriangleError\n\n else\n ... | [
{
"docid": "5750d6a3528ccdc22cef90d7547d098f",
"score": "0.7580037",
"text": "def valid?\n sides = [@side_1, @side_2, @side_3]\n value_test = sides.all? {|side| side >0}\n value_test && (@side_1 + @side_2 > @side_3) && (@side_2 + @side_3 > @side_1) && (@side_1 + @side_3 > @side_2)\n end",
... |
6d29e7ba328e4809cbe5be21e47ad604 | Set the value of the AspectFilters input for this Choreo. | [
{
"docid": "4525422790089527a496b9d980a7bd46",
"score": "0.8229562",
"text": "def set_AspectFilters(value)\n set_input(\"AspectFilters\", value)\n end",
"title": ""
}
] | [
{
"docid": "daa189129915b66deb6a07b197d0476c",
"score": "0.62308866",
"text": "def filters=(*filters)\n @filters = filters.flatten\n end",
"title": ""
},
{
"docid": "333af49a70527edfd993d0b20256e64e",
"score": "0.604769",
"text": "def filters=(filters)\n if filters.nil?\... |
7f1b13b94095a6fb8e51577fd9b6a837 | Deterministically mangle all selected IP packets | [
{
"docid": "a00dffb247510736e623f2904e6b7fae",
"score": "0.7385327",
"text": "def mangle_ip\n salt = (0..16).to_a.collect { rand(256).chr }.join\n selected_rows do |i, num|\n @packets[num].mangle_ip!(salt)\n @column.setItemText(i, \"#{num + 1}: #{@packets[num].inspect}\")\n end\n end... | [
{
"docid": "3f1c23e977a5ae5000ec03ca621c7521",
"score": "0.67664397",
"text": "def ip_spoofing\n base = \"table=20,in_port=#{port}\"\n pass = 'normal'\n\n ipv4s = []\n\n [:ip, :vrouter_ip].each do |key|\n ipv4s << @nic[key] if !@nic[key].nil? && !@nic[key].empty?\n... |
1c715ec5cd34881e8ed8da3da0cde7e9 | atrb can be /cdb//index[id] which contains [:parameter] and so on | [
{
"docid": "c1746daf8adfb8fbef8af5236f0110f9",
"score": "0.0",
"text": "def _new_form(id, atrb = Hashx.new)\n self[id] = context_module('Form').new(@cfg, atrb.update(id: id))\n end",
"title": ""
}
] | [
{
"docid": "a488c61d62270b45b5065c39d55753f7",
"score": "0.60409504",
"text": "def aget(index)\n end",
"title": ""
},
{
"docid": "da2070a92ed7c9b176814ee3ac6ce157",
"score": "0.60206056",
"text": "def index=(_arg0); end",
"title": ""
},
{
"docid": "c8b09b6deea60162c2d3c8... |
f8cba4068ead62099065097dcc8e908a | Returns if there is any word in the trie that starts with the given prefix. :type prefix: String :rtype: Boolean | [
{
"docid": "acfcd916063fe1827e2878a71fe657ec",
"score": "0.7791033",
"text": "def starts_with(prefix)\n if search_node(prefix) == nil\n return false\n else\n return true\n end\n end",
"title": ""
}
] | [
{
"docid": "bdaccfd418c8b563900940317311ae9a",
"score": "0.8155705",
"text": "def find_prefix(prefix)\n if @trie.children(prefix).length > 0\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "42f36f06abcb3133ea67cae99ff8e1a3",
"score": "0.79996794",
... |
d511637d1650d42d118a5e4381da6581 | if get response body, return it | [
{
"docid": "da49ff5cd6ac59201f3b7055e9d69f09",
"score": "0.6714147",
"text": "def check_response_body(results)\n results.each do |result|\n next unless result.is_a?(Net::HTTPSuccess)\n next if result.body == '[]'\n\n return result.body\n end\n\n 'unmatched parameter value'\n end... | [
{
"docid": "8a6ac4a821f5b3569a3e3a3a85d5361f",
"score": "0.773567",
"text": "def get_response_body(response)\n\t\t\tif response.code == 200\n\t\t\t\treturn response.body\n\t\t\telse\n\t\t\t\treturn nil\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "3914c04f955e87d5432b9d73b4ba7e12",
"s... |
c6e41d4b6c65e98d3309034d52a36c7e | Adds the user as a moderator in the current room. user.add_as_moderator => true | [
{
"docid": "bc43caac0bee5086fdb5fe5a0848c4a7",
"score": "0.85649127",
"text": "def add_as_moderator\n api('room.add_moderator', :roomid => room.id, :section => room.section, :target_userid => id)\n true\n end",
"title": ""
}
] | [
{
"docid": "08a63cdefde6137ebca6e4941a7333cc",
"score": "0.76247203",
"text": "def add_moderator(user)\n \n if self.users.moderators == nil || subscriber?(user) == false\n # puts \"********************\"\n # puts user\n # puts \"******\"\n # puts self.users.moderato... |
23473ac0f6ea725cf45f85b4b1bb7e14 | Find content_locale parameter in options hash | [
{
"docid": "f91d866709011c19b868f378813d52cf",
"score": "0.7730856",
"text": "def extract_content_locale(options)\n if (value = options.delete(CONTENT_LOCALE))\n api.content_locale = value\n end\n end",
"title": ""
}
] | [
{
"docid": "57d2947809c24e3e7c2a7737af1c1f63",
"score": "0.7165792",
"text": "def extract_locale_from_params\n (available_locales.include? params[:locale]) ? params[:locale] : nil\n end",
"title": ""
},
{
"docid": "a2330dbc38493e384d3eedc7568fa613",
"score": "0.71486914",
"text"... |
9536f7bf87b5251ba3c7db0abc6a4cb9 | Uploads the +io+ to the service on the +key+ for this blob. Blobs are intended to be immutable, so you shouldn't be using this method after a file has already been uploaded to fit with a blob. If you want to create a derivative blob, you should instead simply create a new blob based on the old one. Prior to uploading, ... | [
{
"docid": "47500b4a4dad2aab38e6bfa7c1a5db96",
"score": "0.6834203",
"text": "def upload(io, identify: true)\n unfurl io, identify: identify\n upload_without_unfurling io\n end",
"title": ""
}
] | [
{
"docid": "328d47250e430a7ca894a83564afd67a",
"score": "0.7713943",
"text": "def upload(key, io, checksum: nil, **)\n instrument :upload, key: key, checksum: checksum do\n data = @client.add io.path\n cid_key = data['Hash']\n\n if blob_exists?(cid_key)\n existing_blob... |
fa2d5e59eb0eb1109d9d38e52b56f5c7 | this checks 2 things that really just need to be one thing: That Randy doesn't have any coffee and he needs some | [
{
"docid": "f19bb32c51b97ae115e06e76b6d94742",
"score": "0.0",
"text": "def test_humans_can_drink_coffee\n sherri = Human.new \"Sherri\"\n tsmf = Coffee.new \"Triple Shot Mocha Frappuccino\"\n #Coffee.new creates a new object \"Coffee\", which has a type/name\n # \"Triple Sh...ino\" that can... | [
{
"docid": "c72b9b0ccd9df1c26f78f7772a5046c6",
"score": "0.67075974",
"text": "def check_for_tea_info\n self.ingredients.length > 0 && self.description.length > 0 && self.pricing.length > 0 \n end",
"title": ""
},
{
"docid": "c8b165e02b55311603a72415b17bb201",
"score": "0.66478... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "cc9363e7c6186117851835169b333ae9",
"score": "0.0",
"text": "def set_infoley\n @infoley = Infoley.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... |
911b29cf5d26252074bed6b9b7fb6790 | DELETE /salutations/1 DELETE /salutations/1.json | [
{
"docid": "c0f704957340cd1200efd5b67e1a54d7",
"score": "0.74957025",
"text": "def destroy\n @salutation.destroy\n respond_to do |format|\n format.html { redirect_to salutations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "eeb0ff11e9141fb62c78351cfd2ea6ac",
"score": "0.7409929",
"text": "def destroy\n @salutation = Salutation.find(params[:id])\n @salutation.destroy\n\n respond_to do |format|\n format.html { redirect_to salutations_url }\n format.json { head :ok }\n end\n end",
"title... |
c0be16e90745ee358e6eebae0ceefd3f | ORDER BY column1, column2, ... ASC|DESC | [
{
"docid": "37845dcc094e779423d46645b6428aa1",
"score": "0.606018",
"text": "def selects_all_bears_names_and_orders_in_alphabetical_order\n 'SELECT bears.name FROM bears ORDER BY name'\nend",
"title": ""
}
] | [
{
"docid": "4dc09219c4e3661709090b619f40f301",
"score": "0.7159771",
"text": "def sort_asc(column_name)\n results = CONNECTION.execute(\"SELECT * FROM #{table_name} ORDER BY #{column_name} ASC;\")\n results_as_objects(results)\n end",
"title": ""
},
{
"docid": "134de4287e09697df5a41a1... |
b84c7099d1ccea2725a82bd9e35f2c18 | Validates a value is less than a maximum | [
{
"docid": "c3c256573b2011494beabd0825538db8",
"score": "0.695155",
"text": "def lt(max)\n Rule.new error: [:not_lt, max], predicate: -> { _1 < max }\n end",
"title": ""
}
] | [
{
"docid": "cebda454605b65044d5ce1360595b8ff",
"score": "0.7797211",
"text": "def validate_limits(properties, value)\n # Minimum\n if properties[:min]\n min = limit_value properties, :min\n value = min if value < min\n end\n\n # Maximum\n if properties[:max]\n max = limit_v... |
0199d4ffa8498976c98dbfa4dbf145bf | Swap values from left pointer to right pointer using index | [
{
"docid": "0210abe9140f17fb3cf2a8d722edcfef",
"score": "0.7332441",
"text": "def swap_values(left_pointer, right_pointer)\n left_tmp = randomized_array[left_pointer]\n randomized_array[left_pointer] = randomized_array[right_pointer]\n randomized_array[right_pointer] = left_tmp\n end",
"ti... | [
{
"docid": "63196eaa22bffb2270cc0788daf771fc",
"score": "0.7708664",
"text": "def swap_elements_from_to(array, idx, dest_idx)\n left = array[idx]\n right = array[dest_idx]\n array[idx] = right\n array[dest_idx] = left\n array\nend",
"title": ""
},
{
"docid": "585547ad628fcc68439299f1d9... |
5126ad85d290a2adbc56ad2cc84a303a | Converts a raw list of elements into a composed tree of days and times | [
{
"docid": "02d8e95596aedffae1eeb6d4d8382b14",
"score": "0.76988256",
"text": "def compose_tree(elements)\n tree = []\n leaf = []\n\n elements.each do |element|\n case element.type\n when :day\n tree << leaf unless leaf.empty?\n leaf = [elemen... | [
{
"docid": "1d5ea54e8fcd953a20aa54ddafae7fe7",
"score": "0.52688503",
"text": "def build_elements(node, obj)\n node.elements.each do |e|\n case\n when e.name == \"names\"\n obj << (build_names(e))\n when e.name == \"date\"\n obj << (build_date(e))\n whe... |
c57cd8f010c743b452ebf95b86cd3d12 | Recursively generate all permutations of the first N chars of the alphabet | [
{
"docid": "92273a8cf5aa51b9999b66f5823c59d2",
"score": "0.7190991",
"text": "def generate_recursive(length)\n _permute(length, '')\nend",
"title": ""
}
] | [
{
"docid": "532eed4ad02f3511e54d8f1ccf66e5cd",
"score": "0.79311347",
"text": "def all_perms(alphabet)\n if alphabet.kind_of?(Integer)\n string = \"\"\n alphabet.times do |index|\n string << index.to_s\n end\n return all_perms(string)\n end\n\n length = alphabet.length\n return [alp... |
ab972a8f9a757b3cd0a10157cbe1db7d | split is allowed if, 1. player has equivalent bet amount 2. has_split is false 3. number of cards == 2 4. the 2 cards are of same value if integer and if a String, NOTE: this entire condition can be encapsulated in a single function call for cleanliness, but mfuture | [
{
"docid": "366c48fbbb0b677a834283d8b5f411db",
"score": "0.8238318",
"text": "def can_split()\n return (@has_split == false and @hands[0].cards_length() == 2 and get_bet(0) <= @amount and validate_split_cards_internal(@hands[0].get_card(0),@hands[0].get_card(1)) )\n end",
"title": ""
}
] | [
{
"docid": "9fb8196398883f569c7d27f9a851035c",
"score": "0.7970972",
"text": "def can_split(player_money)\n\t\treturn @cards.length == 2 && @cards.first.rank.value == @cards.last.rank.value && !is_blackjack && @bet <= player_money\n\tend",
"title": ""
},
{
"docid": "653c8b88811c4884c138202a2... |
9afb3d63ab6dabc0366e671276c40a5a | PUT /photos/1 PUT /photos/1.xml | [
{
"docid": "76fd673c342867d3a3357ce559e4f438",
"score": "0.0",
"text": "def update\n @photo = LandPhoto.find(params[:id])\n if @photo.update_attributes(params[:land_photo])\n redirect_to(bbs_cpanel_photo_path(@photo), :notice => 'LandPhoto was successfully updated.')\n else\n render :... | [
{
"docid": "e631b376ae2ccb776680432bf94b01cc",
"score": "0.66938066",
"text": "def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"title": ""
},
{
"docid": "0fe5947d2bd91f532... |
5155f2013e7690747cfd32045b30457e | Clean all the stack tasks | [
{
"docid": "adc19c540616904d39305ed6beee1201",
"score": "0.83493096",
"text": "def clean\n # Each the tasks\n @tasks.each do |task|\n # Clean all of them\n task.clean\n end\n end",
"title": ""
}
] | [
{
"docid": "2c51014123035769651c47453a3a7f1f",
"score": "0.7271411",
"text": "def perform(stack)\n Shipit::ApiClient.where(stack_id: stack.id).delete_all\n commits_ids = Shipit::Commit.where(stack_id: stack.id).pluck(:id)\n tasks_ids = Shipit::Task.where(stack_id: stack.id).pluck(:id)\n ... |
264093a84ede8e6cd7fd99b0589b1096 | logical device name as seen by the guest, i.e. 'vda' or 'hda' | [
{
"docid": "2d4d34777abddc9d029d8dd4463a05aa",
"score": "0.0",
"text": "def target_dev\n xpath 'target', 'dev'\n end",
"title": ""
}
] | [
{
"docid": "f9b4e345fd14f1a748c47f2c8586c580",
"score": "0.82694924",
"text": "def guest_device(name, mount_point_obj)\n \"/dev/#{guest_vg_name(name, mount_point_obj)}/#{guest_lv_name(mount_point_obj)}\"\n end",
"title": ""
},
{
"docid": "948dd63fb1afdf1bf72ecb9c7e037208",
"score": "... |
3077b7743184abb1c678b24f8f47ddc4 | Here's an example that avoids using a block | [
{
"docid": "07513cec5da5074d9c633f0c1045a74f",
"score": "0.0",
"text": "def aMethod(i)\n puts(i)\nend",
"title": ""
}
] | [
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.74325454",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.74325454",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
... |
3026aa1bc46217b9bd33af9fc528cd65 | Get project configurations from encrypted credential storage | [
{
"docid": "23e803269f8dae69a9b2d948232f5db6",
"score": "0.0",
"text": "def redcap_project_configs(mocks: true, force_reload: false)\n return @redcap_project_configs if @redcap_project_configs && !force_reload\n\n rcconf = Rails.application.credentials.redcap\n return unless rcconf\n\n ... | [
{
"docid": "2ff8c122f846d0b85ed634a0a48e99e7",
"score": "0.7335973",
"text": "def get_creds \n yml = YAML::load(File.open(ENV['TM_PROJECT_DIRECTORY'] + \"/config/settings.yaml\"))\n project_name = yml['project_name']\n username = yml['username']\n environment = yml['environme... |
a469b9bae5882d67fcf4b696df41ed48 | Handles error responses in Threads EOF processing waits until all threads are finished | [
{
"docid": "87814f88c2ff85001c33bde6658fbfd9",
"score": "0.0",
"text": "def response_error(msg_id, response_code, response)\n response_thread do\n @error_callbacks.each { |block| block.call(msg_id, response_code, response) }\n end\n end",
"title": ""
}
] | [
{
"docid": "022af3a74b0efff9ace05f3b66ae30f4",
"score": "0.6768799",
"text": "def eof_thread\n Thread.new do\n @eof_lock.synchronize do\n @eof_wait.wait(@eof_lock) if @responses_count.value > 0\n end\n\n yield\n end\n end",
"title": ""
},
{
"docid":... |
a7fd7589cccf4c5939854d0e06ae220a | Internal: Change the underlying collection to which we delegate. collection An Array. Returns the collection. | [
{
"docid": "d7a428242c3f6c853d669791a73fc89d",
"score": "0.6061176",
"text": "def __setobj__(collection)\n @__delegated_list = collection\n end",
"title": ""
}
] | [
{
"docid": "1be7e6960feedd72d22219de7171cfcf",
"score": "0.7040899",
"text": "def collection=(_arg0); end",
"title": ""
},
{
"docid": "1be7e6960feedd72d22219de7171cfcf",
"score": "0.7040899",
"text": "def collection=(_arg0); end",
"title": ""
},
{
"docid": "1be7e6960feedd... |
8321547938c51198bfd8d3611758e310 | if :param wasn't set, sets it as :name downcase and parameterized | [
{
"docid": "e342cf5feb099fb81363ec9533ee74a4",
"score": "0.7785301",
"text": "def set_param\n self.param = self.name.parameterize.downcase unless self.name.nil?\n self.version = \"0.8\"\n end",
"title": ""
}
] | [
{
"docid": "1b95fcbec4e4abf87ee4700a97e0f1fb",
"score": "0.8669061",
"text": "def set_param\n if self.param.blank?\n self.param = self.name.parameterize.downcase unless self.name.nil?\n end\n end",
"title": ""
},
{
"docid": "d1789814bb750e5c31d3176a02ed9d82",
"score": "0.7489... |
341745ba74918dc57e70f94150aac058 | Computes the union of the two sets and stores the result in `dest`. If no destination provided, computes the results in memory. | [
{
"docid": "0cb41efc8f194ec4441cbf30e9a65aed",
"score": "0.7732579",
"text": "def union(other, dest: nil)\n destination = coerce_destination(dest)\n results = if destination.nil?\n ::Set.new(self.connection.sunion(@key, other.key))\n else\n self.connection.sunionstore(destin... | [
{
"docid": "74e353e61121070996d810cded66bcdb",
"score": "0.70398116",
"text": "def sunion(*other_sets)\n self.call :sunion, *other_sets.map{|s| s.key}\n end",
"title": ""
},
{
"docid": "762bd5dc29d861b235824da6c30dc23e",
"score": "0.69732624",
"text": "def set_union(a, b)\n\t... |
6bbf691a3ef722d332f3933d1fb6c284 | If a file exists, read it, or create a file containing a hash with a key "quizzes" | [
{
"docid": "7863232e26ad3816b26bbcfd62a15538",
"score": "0.0",
"text": "def get_data()\n if File.exists?(FILENAME)\n results = JSON.parse(File.read(FILENAME))\n return results\n else\n # JSON only parses strings, so it makes things much faster to simply write the key as in a format that JS ca... | [
{
"docid": "2ef3519b1751504415deb37f08de1707",
"score": "0.5722325",
"text": "def hash_file path, hash_store\r\n\thexdigest = HASH_DIGEST.hexdigest(open(path, 'rb') { |io| io.read })\r\n\thash_store[hexdigest] << path\r\nend",
"title": ""
},
{
"docid": "01b2e125190b7e4b1708441fb0149442",
... |
d195d57c43542509a4a6be41030ab7a0 | PATCH/PUT /races/1 PATCH/PUT /races/1.json | [
{
"docid": "78d2f9d38d1f5ba36a6e7a2a6181759b",
"score": "0.60578394",
"text": "def update\n respond_to do |format|\n if @race.update(race_params)\n format.html { redirect_to @race, notice: 'Race was successfully updated.' }\n format.json { head :no_content }\n else\n fo... | [
{
"docid": "b607d72b5f503f672a25bc9dad90d23b",
"score": "0.65274394",
"text": "def update\n @racer = Racer.find(params[:id])\n\n respond_to do |format|\n if @racer.update_attributes(params[:racer])\n format.html { redirect_to @racer, notice: 'Racer was successfully updated.' }\n ... |
429fd19fbf8f25068a61fa5c81e91951 | GET /work_exps GET /work_exps.json | [
{
"docid": "2c55679e4450b9a00d01fb2c65ecc617",
"score": "0.0",
"text": "def index\n @work_exps = WorkExp.order(:year)\n end",
"title": ""
}
] | [
{
"docid": "4e63e274f41760f045f11db2cb528b9e",
"score": "0.69066846",
"text": "def get_work\n client.make_request('/get-work', 'post', params: {})\n end",
"title": ""
},
{
"docid": "b0aec7fdbfecdc66f1900b9d53430d13",
"score": "0.68733984",
"text": "def get_work_json\n cl... |
8b93d5dc72afe2d3637cc4f93d4b2d04 | PATCH/PUT /groups/1 PATCH/PUT /groups/1.json | [
{
"docid": "18b1b6834013b565f82159f59fc0bc07",
"score": "0.0",
"text": "def update\n\n\n if ( session[:user_usertype] == 1 or @group.user_id.to_i == session[:user_id].to_i )\n x=1\n else\n render plain: \"unauthorized access \"\n return\n end\n\n\n respond_to do |format|\n ... | [
{
"docid": "8ee64ed93964ca86b3715555759824c2",
"score": "0.7710417",
"text": "def patch_group(group_id, request)\n start.uri('/api/group')\n .url_segment(group_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end",
"title"... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "6c8153cbb9d7636b368905591522ecb4",
"score": "0.0",
"text": "def vote_params\n params.require(:vote).permit(:score, :cat_id)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7495027",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69566035",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "f3b1028229eabd4a1fa395e127664eb2",
"score": "0.0",
"text": "def set_form\n @form = Form.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163163",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045976",
"text": "def action_hook;... |
6dbb6a71ae330970ff1ed55e08cb08de | TODO: Add comment TODO: User HTTP PUT | [
{
"docid": "bf04ce2e7aa4ff676a5daa144d019b90",
"score": "0.0",
"text": "def machine_groups_update(id)\n url = \"#{@sal_url}/api/v2/machine_groups/#{id}/\"\n json_resp_body(url)\n end",
"title": ""
}
] | [
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.7779814",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "ea416b077fa0aa7e84ec3fe2ef9c3772",
"score": "0.7585064",
"text": "def put\n request_method('PUT')\n end"... |
780964bfdf9c2de7b43cee7ee3ad7590 | Rebuild Dependency Tracking data for an organization Asynchronous. Notification topic: v2.architect.dependencytracking.build | [
{
"docid": "f79748c7666d71dafdc3d6cbc3595391",
"score": "0.5298536",
"text": "def post_architect_dependencytracking_build(opts = {})\n post_architect_dependencytracking_build_with_http_info(opts)\n return nil\n end",
"title": ""
}
] | [
{
"docid": "cb47bbaa26702da96a30dfef738d56cd",
"score": "0.5807239",
"text": "def get_architect_dependencytracking_build_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ArchitectApi.get_architect_dependencytracking_build ...\"\n ... |
f509c3458f0c2c5d6518acabd8e8921f | PUT /admin/delivery_companies/1 PUT /admin/delivery_companies/1.xml | [
{
"docid": "71fbd1a8cf30ef52a058ea4911471385",
"score": "0.6908775",
"text": "def update\n @delivery_company = DeliveryCompany.find(params[:id])\n\n respond_to do |format|\n if @delivery_company.update_attributes(params[:delivery_company])\n format.html { redirect_to([:admin,@delivery_... | [
{
"docid": "75257bcacbc16f7963754f7d8ca9fb70",
"score": "0.71004385",
"text": "def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n \n \n format.xml \n else\n \n format.xml { render ... |
30b740fb96e774f16b1c7be0f69327da | returns the state of the simulation of round | [
{
"docid": "53480698720eaa8dd52021fa8b1fca83",
"score": "0.6985047",
"text": "def state_simulation_str\n if self.state_simulation\n return \"round.state.simulated\"\n else\n return \"round.state.not_simulated\"\n end\n end",
"title": ""
}
] | [
{
"docid": "cedc58cda7f32cd88e4e2a9f852242b7",
"score": "0.70446116",
"text": "def simulated_round?\n self.round_actual.simulated?\n end",
"title": ""
},
{
"docid": "956a81dab1b3fc9b076c06e8af4d20a2",
"score": "0.6943192",
"text": "def simulated?\n self.state_simulation\n end... |
5e71b84ff9f680e8e11c58c7048c0937 | PATCH/PUT /class_times/1 PATCH/PUT /class_times/1.json | [
{
"docid": "a7813aa0c98aa06c266017b4d41fda67",
"score": "0.7251261",
"text": "def update\n respond_to do |format|\n if @class_time.update(class_time_params)\n format.html { redirect_to @class_time, notice: 'Class time was successfully updated.' }\n format.json { head :no_content }\... | [
{
"docid": "35fea443fa76e7116fb5f5ae3a924aef",
"score": "0.7196189",
"text": "def update\n respond_to do |format|\n if @class_time.update(class_time_params)\n format.html { redirect_to @class_time, notice: 'Class time was successfully updated.' }\n format.json { render :show, statu... |