query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
ba0492aeee5f2fc78257426f4f98b072 | POST /components/categories/kinds POST /components/categories/kinds.json | [
{
"docid": "fa787af6c71a4ac467096e98e1c52a52",
"score": "0.7049655",
"text": "def create\n @components_categories_kind = Components::Categories::Kind.new(params[:components_categories_kind])\n index\n respond_to do |format|\n if @components_categories_kind.save\n format.js { @notic... | [
{
"docid": "ed01224c0942c1d1be93c366a5417b85",
"score": "0.66905487",
"text": "def create\n @kind = Kind.new(kind_params)\n respond_to do |format|\n if @kind.save\n format.html { redirect_to manager_kinds_path, notice: 'Kind was successfully created.' }\n format.json { render :s... |
c83dce20decad806524f5b1d90f068be | Write the result of a command to the document tree (see build_command) | [
{
"docid": "82710c36c384304b56e07459c717e288",
"score": "0.0",
"text": "def write_command(id, *args, &block)\n ret = build_command(id, *args)\n stack.last.push ret\n end",
"title": ""
}
] | [
{
"docid": "1613f4cc89908758ab1fce05926b8e7f",
"score": "0.6304096",
"text": "def write output, target\n print @hello\n print output\n print '\\n'\n print target\n args = ['pandoc', '-f', 'docbook', '-t', 'docx', '-o', target]\n output = IO.popen(args, \"w\") do |io|\n io.writ... |
a4d7c66105b5d2ac566e71fdb327411b | Given a vertex, checks to see if it exists within the vertex list; if not found, adds to list INEFFICIENT MODIFY LATER | [
{
"docid": "7dbba1214ae45aeb00668501fb3bbcb2",
"score": "0.7213901",
"text": "def checkAndAddConsistency(v)\n\t\tif !@vertexList.include?(v)\n\t\t\t@vertexList << v\n\t\tend\n\tend",
"title": ""
}
] | [
{
"docid": "2a35caa43d4fa789a67873a6ce655815",
"score": "0.7407955",
"text": "def add_vertex!(vertex)\n return false if @vertices[vertex]\n\n end",
"title": ""
},
{
"docid": "1b71e8c9be9ff5d18a0b93eb6f4778bd",
"score": "0.718634",
"text": "def add_vertex!(vertex)\n vertices[ve... |
2d3f2f6291224ca401594a24c4ec21ba | GET /projects GET /projects.json | [
{
"docid": "f03e8f13b93f3dae8100ac96f4983ecb",
"score": "0.0",
"text": "def index\n\t if params[:title] || params[:description] || params[:procategory_id]\n\t\t @projects = Project.search(params[:title], params[:description], params[:procategory_id]).joins(:procategory).all\n\t else\n\t\t @projects = ... | [
{
"docid": "dc8505687156cb859adc07f1e0435407",
"score": "0.8865399",
"text": "def projects\n return get(\"/projects/list\")\n end",
"title": ""
},
{
"docid": "e5cff083faf736771900db26645e7ffe",
"score": "0.87301385",
"text": "def get_projects\n self.class.get(\"/projects.jso... |
922b4f653918ee347b86f8f36667d3b9 | => one line => followed by another line | [
{
"docid": "4a8780284b5834e7b6ec29f1b0954056",
"score": "0.0",
"text": "def feedback (some_param)\n some_param = [1,2,3] if some_param.nil?\n \"The parameter is #{some_param}\" \nend",
"title": ""
}
] | [
{
"docid": "084ec684fb4f71b16a5e6fa3993202aa",
"score": "0.7112083",
"text": "def put_to_end_of_line\n\tend",
"title": ""
},
{
"docid": "7a57901c5d0601359a897951b5595559",
"score": "0.69025123",
"text": "def pairs_on_same_line?; end",
"title": ""
},
{
"docid": "7a57901c5d... |
63a5785adc41d49500d415969b2b7dfb | Gets the allowedToCreateApps property value. Indicates whether the default user role can create applications. This setting corresponds to the Users can register applications setting in the User settings menu in the Azure portal. | [
{
"docid": "a27f9e2b870f43d7aada73b8cd7413f7",
"score": "0.7812953",
"text": "def allowed_to_create_apps\n return @allowed_to_create_apps\n end",
"title": ""
}
] | [
{
"docid": "88946b2140a932d5d0e6e7eae2f88d9f",
"score": "0.7577892",
"text": "def allowed_to_create_apps=(value)\n @allowed_to_create_apps = value\n end",
"title": ""
},
{
"docid": "e596eee55c7f362e59ce35158bff883f",
"score": "0.60197294",
"text": "def apps_... |
7eb7086fa05b0f969597629ce9401288 | Delete an existing portfolio item Deletes the portfolio item based on portfolio item ID passed | [
{
"docid": "0e41cbf16278c4c5b754463bb0f34206",
"score": "0.0",
"text": "def destroy_portfolio_item(id, opts = {})\n data, _status_code, _headers = destroy_portfolio_item_with_http_info(id, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "25cbafa3eac55b06efeb5cb23a6542bf",
"score": "0.80259365",
"text": "def destroy\n @portfolio_item = PortfolioItem.find(params[:id])\n @portfolio_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(portfolio_items_url) }\n format.xml { head :ok }\n end\n ... |
4cee9eaad5ba4f423ab65f5404f46993 | Process method decides what to do based on user input | [
{
"docid": "c7a6629fc3e3949c31b5d33996a53c53",
"score": "0.62412524",
"text": "def process(selection)\n case selection\n when \"1\"\n input_students\n when \"2\"\n show_students\n when \"3\"\n save_students\n when \"4\"\n load_students\n when \"9\"\n exit\n el... | [
{
"docid": "10dd9918e6a87ab90d95e7a72decb4a8",
"score": "0.72463",
"text": "def process\n end",
"title": ""
},
{
"docid": "2f500dbaccad77b9a9d23b2cbec9b080",
"score": "0.724548",
"text": "def process\n end",
"title": ""
},
{
"docid": "d5f333e4fac884079775cd53f... |
a5cf8cff8e2762990126470bd93964f5 | We only would like to push to a list of branches only | [
{
"docid": "cbb8846c6db3418f6e7b50c336363569",
"score": "0.0",
"text": "def valid_target? to\n get_target_branches.include?(to)\n end",
"title": ""
}
] | [
{
"docid": "163ada0a618cb2c305d29d3572676b32",
"score": "0.6731136",
"text": "def pushToGitRemotes(branch = 'develop', force = 0)\n if force\n force = \"-f\"\n else\n force = \"\"\n end\n remotes = `git remote`.split(\"\\n\")\n remotes.each do |remote|\n remote.chomp!\n UI.important(\"P... |
5c6b406d3df6bbfe59901ec797239564 | Places the character in the desired position | [
{
"docid": "3aa6aea4ac66a55b654aa2cb74f0546d",
"score": "0.0",
"text": "def move(board, index, token)\n board[index] = token\n return board[index]\nend",
"title": ""
}
] | [
{
"docid": "a6e35d2633606030af401454c356f076",
"score": "0.7854298",
"text": "def adjust_character_position(x, y); @char_x, @char_y = x, y; end",
"title": ""
},
{
"docid": "bf3d3e0e8ba28a43d08b364d887321c1",
"score": "0.7762365",
"text": "def move_toward_char(char)\n move_toward_x... |
6383158ee732a9c26a6c7d40ef02f571 | Handle form data, JSON body, or a blank value rubocop:disable Metrics/MethodLength | [
{
"docid": "18029d5e88047932251ebef91b56186a",
"score": "0.0",
"text": "def ensure_hash(ambiguous_param)\n case ambiguous_param\n when String\n if ambiguous_param.present?\n ensure_hash(JSON.parse(ambiguous_param))\n else\n {}\n end\n when Hash, ActionController::Pa... | [
{
"docid": "7f4062295ce1779b92f25a3123e93f85",
"score": "0.7053176",
"text": "def form_data?; end",
"title": ""
},
{
"docid": "71d8efefa24c20d7179da53ba27f4a2b",
"score": "0.6105918",
"text": "def body\n json? ? handle_json : handle_raw\n end",
"title": ""
},
{
"d... |
cf685dab2e5dba5029083d93d4aa23fb | validates :name, uniqueness: true | [
{
"docid": "8047fd6a5e3456102ae7019959067d1d",
"score": "0.0",
"text": "def productprice\n event_quantity * client_price\n end",
"title": ""
}
] | [
{
"docid": "339b2f018bf613b92522e5b18c831cb1",
"score": "0.8907431",
"text": "def validates_name_uniqueness?\n true\n end",
"title": ""
},
{
"docid": "339b2f018bf613b92522e5b18c831cb1",
"score": "0.8907431",
"text": "def validates_name_uniqueness?\n true\n end",
"... |
2d4c13a1aff1f2a3d197dc34a73deefb | breaks it into single letter array create another method that will take the array and move .next for vowel and consonants make sure that the ! goes back to space to know when to separate the user first and last name | [
{
"docid": "eed77d2ee8d48891c36580e05578cdd0",
"score": "0.68834186",
"text": "def take_word(word)\n letters = []\n consonants_array = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"x\", \"y\", \"z\", \" \"]\n vowels_array = [... | [
{
"docid": "3deb5bd0587061ac62b1301c9a6c50c0",
"score": "0.7575928",
"text": "def fake_name (letters)\n \n #The position of the first and last letter are swapped\n letters[0], letters[-1] = letters[-1], letters[0]\n\n #Creating list of vowls and consonants\n vowels = ['a', 'e', 'i', 'o', 'u']\n ... |
e2c444b5aca8fdaff4a4937513c83415 | Reset the configuration to the default values. | [
{
"docid": "380303fe56a0b3b1d59095cedd5d0691",
"score": "0.8000192",
"text": "def reset!\n # Vedeu::Log.logger.debug('Resetting configuration.')\n\n instance.reset!\n end",
"title": ""
}
] | [
{
"docid": "1bed64c10e5e5c675a156876e4d3a105",
"score": "0.88972425",
"text": "def reset_configuration!\n set_default_configuration\n end",
"title": ""
},
{
"docid": "2a2b00deae5ad9273027747c09118584",
"score": "0.8770585",
"text": "def reset!\n DEFAULTS_CONFIGS.each {... |
4546d1dbb0dd1cf9a74efe9cf8591956 | Custom ActionView::Baserender wrapper which silences all the log printings. Helps to keep the Rails logs clean during errors. | [
{
"docid": "0a50b1a18609b6351571f1791c344d64",
"score": "0.70496356",
"text": "def render(*)\n if (logger = WebConsole.logger) && logger.respond_to?(:silence)\n WebConsole.logger.silence { super }\n else\n super\n end\n end",
"title": ""
}
] | [
{
"docid": "d94f54e508521a2b6bc349e3d25017d6",
"score": "0.70419306",
"text": "def silence_logging\n Rails.logger.silence do\n yield\n end\n end",
"title": ""
},
{
"docid": "0d9d1c863eddcf2db76543310f097830",
"score": "0.6380216",
"text": "def silence\n old_logger_le... |
fdf988c3e3dfd866162c3ba16d83e754 | By default, resources are visible to everybody | [
{
"docid": "ae02327bef12cda7f457c516f1df7417",
"score": "0.0",
"text": "def index?\n true\n end",
"title": ""
}
] | [
{
"docid": "06a985dd7831c4d326a48d457e752e14",
"score": "0.7339479",
"text": "def resources; end",
"title": ""
},
{
"docid": "80fe8a5babce9e27ecc86e5ed0716a67",
"score": "0.67179275",
"text": "def resources\n Content::CommandHandler.call(\n Content::Commands::RetrieveAv... |
02720409dba73f0819cd890f486ea5f9 | Yields or returns an adapter's configured connection. Depends on build_connection being defined on this adapter. | [
{
"docid": "24006f110aa689d8047feba33e9d12d4",
"score": "0.0",
"text": "def connection(env); end",
"title": ""
}
] | [
{
"docid": "cedb0c21008a8b5b7e04bd3a4a3ebcb7",
"score": "0.7069988",
"text": "def connection\n yield @conn if block_given?\n @conn\n end",
"title": ""
},
{
"docid": "48842ee088d0f8c66a31e832743d06bd",
"score": "0.6744",
"text": "def connection\n @adapter || establis... |
8d9256b59c6775ef6092dbf7d8f14821 | Upgrades the Omnibus installation of Chef on a specific node(s) to a specific version. | [
{
"docid": "ca6edb3aee166f769ee116e66fcd5944",
"score": "0.78828055",
"text": "def upgrade_omnibus(job, version, nodes, options = {})\n futures = Array.new\n options = options.merge(chef_version: version)\n\n hostnames = nodes.collect(&:public_hostname)\n job.report_running(\"Upgradi... | [
{
"docid": "fc2c3b54a41065783e744d935d00d5b9",
"score": "0.708074",
"text": "def upgrade_repo!\n include_recipe \"yum-chef::#{new_resource.channel}\"\n package('chefdk') { action :upgrade }\n end",
"title": ""
},
{
"docid": "aa50407c1793dd53b221430f23a2d5c3",
"sc... |
3142234c0bc0ad684fcce68910bb81ce | initializes this JsonArray with a json hash | [
{
"docid": "71a7697a260fd474c4087c5947b650e6",
"score": "0.0",
"text": "def init_jaxb_json_hash(_o)\n super _o\n end",
"title": ""
}
] | [
{
"docid": "bafdd4d32a6c897ba25fb51681822ac3",
"score": "0.7695326",
"text": "def initialize(json)\n @json = json\n @json.each do |key,value|\n if value.class == Hash\n @json[key] = JSONHash.new(value)\n elsif value.class == Array\n values = value.collect { |v| v.class == H... |
0956bde28d897ae8948476528774731d | Set the value of the Video input for this Choreo. | [
{
"docid": "13d056beda5cecd72b84c1f2d0b9be18",
"score": "0.7845272",
"text": "def set_Video(value)\n set_input(\"Video\", value)\n end",
"title": ""
}
] | [
{
"docid": "4081cddd5adb6310060d22a0b412fea7",
"score": "0.7655079",
"text": "def video=(value)\n @video = value\n end",
"title": ""
},
{
"docid": "4081cddd5adb6310060d22a0b412fea7",
"score": "0.7655079",
"text": "def video=(value)\n @video = ... |
144ba94a94bb17ff6fdd5f59ab2481b6 | Removes a specific password entry | [
{
"docid": "7380f32d70cd368c15fe4213d37ef768",
"score": "0.0",
"text": "def rename(old_key, new_key)\n if !@data[old_key]\n pa %[No password found for #{old_key}!], :red\n return false\n elsif @data[new_key]\n pa %[There is already a password stored for #{new_key}. You need to remov... | [
{
"docid": "64470b399186f171c3007852eff8131b",
"score": "0.7251401",
"text": "def remove(key)\n if @pw_data.delete key\n write_safe\n pa %[The password for #{key} has been removed], :green\n return true\n else\n pa %[No password found for #{key}!], :red\n return false\n ... |
f24662aa3980adf18f926df0b3c9451b | Encrypts a message with a key derived from the master key and channel name | [
{
"docid": "8f140e64376938ce257d5ed95c5f2a21",
"score": "0.747395",
"text": "def encrypt(channel_name, encoded_data)\n raise ConfigurationError, :encryption_master_key unless @encryption_master_key\n\n # Only now load rbnacl, so that people that aren't using it don't need to\n # install l... | [
{
"docid": "e52f2a7360cc91e271c030df4aeee170",
"score": "0.79224056",
"text": "def encrypt_message plaintext\n key_pair.encrypt plaintext\n end",
"title": ""
},
{
"docid": "4cd1b81bf648bb57df0087dae09fe6fc",
"score": "0.73675525",
"text": "def encrypt(message)\n ... |
b943061605a021509b5c62c6634c083d | Returns the index of the `in` branch within the `case` statement. | [
{
"docid": "3b7de2c4a12353444053bd78f713ac30",
"score": "0.0",
"text": "def branch_index; end",
"title": ""
}
] | [
{
"docid": "352c399285f5e4a22ba3c3b375a98bfa",
"score": "0.64397544",
"text": "def _ops_case(expr, token, ix)\n # ignored expr for now\n # ignored token\n ix += 1\n end",
"title": ""
},
{
"docid": "5902e0dd9662391e6ed5bb939e048f0f",
"score": "0.59417063",
"text": "d... |
9df5813de4eb786c9fac1863240e6d2e | Delete a configuration setting explicitly set for a Course Version Clears the specified setting from the course version. This causes the setting to inherit a value from a higher level (e.g. application). If the configuration setting was not set at the course level it will continue to persist and will require deletion f... | [
{
"docid": "56a92833085fdeb47a45f7cc0b36ca8e",
"score": "0.6883557",
"text": "def delete_course_version_configuration_setting(course_id, version_id, setting_id, opts = {})\n delete_course_version_configuration_setting_with_http_info(course_id, version_id, setting_id, opts)\n nil\n end",
... | [
{
"docid": "ae9bb69b5f66b22c284bfa5919b91666",
"score": "0.6828771",
"text": "def delete_course_version_configuration_setting_with_http_info(course_id, version_id, setting_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CourseApi.delete_course... |
7cef2b3fb72a11124e5e3731dd79d97d | Get full details of the tracks of a playlist owned by user | [
{
"docid": "12a3863950e3ac2a780a8f30b00b9964",
"score": "0.7471932",
"text": "def tracks(params={})\n tracks = { 'items' => [] }\n path = \"/v1/users/#{user_id}/playlists/#{id}/tracks\"\n\n while path\n response = client.run(:get, path, [200], params)\n tracks['items'].conca... | [
{
"docid": "3342b4304a1f80a2459f87a6f445c47d",
"score": "0.78029335",
"text": "def user_playlist_tracks(user_playlists)\n \t@playlist_tracks = []\n \t request_data = {:params=>{'access_token' => Setting.access_token }}\n\n \tuser_playlists.each do |playlist|\n \t\turl = \"playlist/#{p... |
c072b31dc879c6fddd50042c96107d98 | GET /skills if user goes to api/skills > id provied = specific id skill, user_id provided = a users skill returned, name provided = all skills with provided name returned | [
{
"docid": "a9c7ca16c653cd271143c283b15c1a32",
"score": "0.7664491",
"text": "def index\n if params[:id]\n @skills = Skill.where(id:params[:id])\n elsif params[:user_id]\n @skills = Skill.where(user_id:params[:user_id])\n elsif params[:name]\n @skills = Skill.where(name:params[:n... | [
{
"docid": "13cac97a25b5d2e3af151236cf03fdaa",
"score": "0.78766304",
"text": "def find_skills\n @user = User.find(params[:id])\n @user_skill = UserSkill.where(\"user_id = @user.id\")\n end",
"title": ""
},
{
"docid": "47bc587ad09586ab0ee959f33f01f51a",
"score": "0.77256185"... |
6abf5a9116b96353bb4012f46077a1e7 | POST /member_details POST /member_details.xml | [
{
"docid": "1319265aad489a66fb8a9756dc7833e9",
"score": "0.66549295",
"text": "def create\n\t\t@member_detail = MemberDetail.new(member_detail_params)\n\t\t\n\t\tunless user_can_visit?(:member_details, :new)\n\t\t\t@member_detail.user = current_user\n\t\tend\n\n\t\tif @member_detail.user.member_detail !... | [
{
"docid": "be0f96683fd41250db498a48c12b9382",
"score": "0.67568743",
"text": "def create\n @memberinfo = Memberinfo.new(params[:memberinfo])\n\n respond_to do |format|\n if @memberinfo.save\n format.html { redirect_to(@memberinfo, :notice => 'Memberinfo was successfully created.') }\n... |
1f9011159ebc48ea264904c2f2c4285d | Get Payee by Id Get Payee by Id | [
{
"docid": "11713f4a6c344621cbc7b9af0afe78e5",
"score": "0.5916266",
"text": "def get_payee_by_id_v4(payee_id, opts = {})\n data, _status_code, _headers = get_payee_by_id_v4_with_http_info(payee_id, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "984f6f363758aaf308592b5315c84536",
"score": "0.72176516",
"text": "def set_payee\n @payee = Payee.find(params[:id])\n end",
"title": ""
},
{
"docid": "984f6f363758aaf308592b5315c84536",
"score": "0.72176516",
"text": "def set_payee\n @payee = Payee.find(params[:id]... |
0a24a422c8a76d490af0017c45db9207 | Push the current variable scope to the stack. | [
{
"docid": "c8adc53436f866f90ae4c05bd7dd4281",
"score": "0.7138715",
"text": "def push_scope(scope)\n @current_scope << scope unless scope.nil?\n end",
"title": ""
}
] | [
{
"docid": "8f1d1fcb221ae4a7d8550a9870a10e12",
"score": "0.74202687",
"text": "def increase_scope()\n $current_scope += 1\n $variables << {}\nend",
"title": ""
},
{
"docid": "882e339332263a61d328e1c382457a3b",
"score": "0.73708934",
"text": "def push(scope)\n # TODO: symbol... |
f9542973e2581e02e3085f15425c5a83 | Validates if the second throw is not needed. Fails validation if it's not the tenth frame and a strike. | [
{
"docid": "06f215a6a7ff4faec2fd04687f4809d4",
"score": "0.8367649",
"text": "def check_second_throw_not_needed\n if number != 10 && strike?\n errors.add(:second_throw, \"added but not needed.\") if second_throw\n end\n end",
"title": ""
}
] | [
{
"docid": "cb7b1082a503b6967b36c9d4b1005c30",
"score": "0.73828304",
"text": "def check_third_throw_not_needed\n if number != 10 || !(strike? || spare?)\n errors.add(:third_throw, \"added but not needed.\") if third_throw\n end\n end",
"title": ""
},
{
"docid": "2ff05badaea69373... |
a2176e660fac1a6d20f379e35ba6024d | Checks if list is linked at the end with other list. | [
{
"docid": "612a4ed971309d95f30c0387657ffedc",
"score": "0.6400668",
"text": "def zip?(other)\n tail.equal? other.tail \n end",
"title": ""
}
] | [
{
"docid": "594ca387e415dbc5cf67c23d2338a75e",
"score": "0.684048",
"text": "def last?\n return false unless in_list?\n bottom_pos = bottom_position_in_list\n my_position == bottom_pos\n end",
"title": ""
},
{
"docid": "594ca387e415dbc5cf67c23d2338a75e",
"score"... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "bb48903218aefead6e0b1b88f1ba046a",
"score": "0.0",
"text": "def set_admin_ruby_name_method\n @admin_ruby_name_method = Admin::RubyNameMethod.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163927",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6046165",
"text": "def action_hook;... |
f9aeb871bb1efff3e9eeee6586123034 | POST /events POST /events.json | [
{
"docid": "982e301934da93698c3b72e55c00c1bd",
"score": "0.0",
"text": "def create\n @event = @member.events.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: '创建成功' }\n format.json { render :show, status: :created, locatio... | [
{
"docid": "d70601f4de46b4b99300c06b1751c4f2",
"score": "0.7712453",
"text": "def create_event event, data={}\n data[:event] = event\n post '/event', data\n end",
"title": ""
},
{
"docid": "4371023c2407f959006c288fddb278ad",
"score": "0.76103187",
"text": "def crea... |
6ec0a422266569d30ab890c0f11cba72 | Test for open port by opening a socket on the ip and closing the socket | [
{
"docid": "c0f79fc7e2c96859ec7cad20b3bd5f96",
"score": "0.809161",
"text": "def is_port_open?(ip, port, opts={})\n timeout = opts[:timeout] || 1\n begin\n Timeout::timeout(timeout) do\n begin\n s = TCPSocket.new(ip, port)\n s.close\n ... | [
{
"docid": "eb4b01bbb2cdc9f3346f32ed68c17814",
"score": "0.84284806",
"text": "def is_port_open?(ip, port)\n return false if ip==\"\"\n begin\n Timeout::timeout(1) do\n begin\n s = TCPSocket.new(ip, port)\n s.close\n return true\n rescue Errno::ECONNREFUSED, Errno::EH... |
7cd69c8a2042fdc4cb1797a66be88bb2 | Override blacklight in order to customize facet paging behavior. This allows a separately configurable limit for the full list of facets | [
{
"docid": "ce43ecba6a2d863618cc978634305018",
"score": "0.79329485",
"text": "def add_facet_paging_to_solr(solr_params)\n return if facet.blank?\n\n super\n\n facet_config = blacklight_config.facet_fields[facet]\n\n if facet_config.more_limit\n limit = if scope.respond_to?(:facet_list_... | [
{
"docid": "1afb596a52fdf0176e10da856ea485f1",
"score": "0.80600035",
"text": "def facet_list_limit\n 20\n end",
"title": ""
},
{
"docid": "86705a77d30a68d1d49fd48bce493e39",
"score": "0.792144",
"text": "def add_facet_paging_to_solr(solr_params)\n return unless facet.present?... |
ee9ecc815f3edd6dd38680fb714a5863 | Returns the path used for packaging. Convenience method for those that need to write a package hook. | [
{
"docid": "29a9cc98d2691aa59f8f9af5e11af7c7",
"score": "0.6848494",
"text": "def pkg_path\n \"pkg/#{spec.full_name}\"\n end",
"title": ""
}
] | [
{
"docid": "34aa82a3a6e7153e03ece158466243e4",
"score": "0.77420217",
"text": "def package_dir_path\n \"#{package_dir}/#{package_name}\"\n end",
"title": ""
},
{
"docid": "4fa3e60b7dccd8d88625bd822f0dc2b5",
"score": "0.7570176",
"text": "def package_path(extension='.gem')\n ... |
c3e259721fa91bc2b183c4eee207c908 | DELETE /exames/1 DELETE /exames/1.xml | [
{
"docid": "a8b284ec79fe86f39d690cef0f1a0225",
"score": "0.6372113",
"text": "def destroy\n @exame.destroy\n respond_to do |format|\n format.html { redirect_to exames_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "4111a22d07c48eeea99ff233f02b7a90",
"score": "0.70385695",
"text": "def destroy\n @exame = Exame.find(params[:id])\n @exame.destroy\n\n respond_to do |format|\n format.html { redirect_to(exames_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
... |
a55e44da4505a8a9aa07ea84cbe8bedc | Spread the rumor to all applicable channels. conditions some conditions on the spreading (Hash). :only The channels to spread to (and none other). :except The channels not to spread to. :async Whether to spread asynchronously (default: true). Returns nothing. | [
{
"docid": "5417b561d263df01fb9ac80ce78eda87",
"score": "0.6463895",
"text": "def spread conditions = {}\n @time = Time.now.utc\n @only = conditions.delete :only\n @except = conditions.delete :except\n ::Rumor.spread self, conditions\n end",
"title": ""
}
] | [
{
"docid": "4f7bef5646c57b3e430bd37a29af0418",
"score": "0.46550882",
"text": "def loop( &block )\n block ||= proc do \n channels = @channel_map.reject {|k,v| v.type == 'auth-agent@openssh.com' }\n not channels.empty?\n end\n process while block.call\n ... |
3884e6863aa7cb6d798f5193d10cb58d | Resolved a relative uri | [
{
"docid": "2df6310f47b59e6452b64c57315c93fc",
"score": "0.6638346",
"text": "def file_resolve(uri, exists=false)\n require 'uri'\n real_uri = URI::parse(uri)\n if real_uri.absolute?\n raise WLang::Error, \"Unable to resolve #{uri}, absolute uri are not supported\"\n elsif rea... | [
{
"docid": "456cecf1c872cb2b98fb0c01c5fa41f1",
"score": "0.7612229",
"text": "def resolve_uri\n return uri if uri.absolute?\n parent.resolved_uri + uri if parent && parent.resolved_uri\n end",
"title": ""
},
{
"docid": "4b52a0fd1b35cc211f5ca15edd665145",
"score": "0.74783057... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "82ded42362b10925aa109205f76f330b",
"score": "0.0",
"text": "def set_a_user\n @a_user = User.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... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "32798baafb92c6ddbcaceea537477fc5",
"score": "0.0",
"text": "def frontend_exploration_params\n params[:frontend_exploration]\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7496729",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6958585",
"text": "def strong_params\n params.require(:request).permit(param_white... |
eea5dbe2c5486cfae32016b576f17da7 | expect(adele.songs.last.name).to eq("Rolling in the Deep") expect(adele.songs.last.artist).to eq(adele) | [
{
"docid": "81551ba5ab5a132fd60344499da726c4",
"score": "0.0",
"text": "def add_song_by_name(song_name)\n #creating a variable to store a new song object/instance of the song class\n song_name = Song.new(song_name)\n #we need the argument b/c when we defined song class, we said during initializ... | [
{
"docid": "241aefa0961f5a22b5ce9f772d0eab59",
"score": "0.7364958",
"text": "def test_song_has_name\n assert_equal(\"I should be lucky\", @song1.name)\n end",
"title": ""
},
{
"docid": "03106b23477b8c5e894fb31d0e0c8862",
"score": "0.7147153",
"text": "def test_can_find_song_by_a... |
32f599e3dc9d86b6ef4412444348892f | Import SEPA XML file (return, rejections) | [
{
"docid": "828e690249a4d64b7cadcf00798ad46a",
"score": "0.0",
"text": "def bank_from_return\n # Set active_tab to use in view filters\n session[:active_tab] = \"banks-tab\"\n\n file_to_process = params[:bank_from_return][:file_to_process]\n file_content = params[:bank_from_return][:... | [
{
"docid": "83dff11a46a7b1cc638fefabfee3e032",
"score": "0.679301",
"text": "def import_nessus_xml_file(args={})\n\t\tfilename = args[:filename]\n\t\twspace = args[:wspace] || workspace\n\n\t\tf = File.open(filename, 'rb')\n\t\tdata = f.read(f.stat.size)\n\n\t\tif data.index(\"NessusClientData_v2\")\n\t... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "daf605d7eaf585c63660b9fefa684e3e",
"score": "0.0",
"text": "def set_video_sub_category\n @video_sub_category = VideoSubCategory.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.6031952",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6015048",
"text": "def... |
11c3f4e002fa483307eb5de8a09efdad | Write a method that takes a positive integer, n, as an argument, and displays a right triangle whose sides each have n stars. The hypotenuse of the triangle (the diagonal side in the images below) should have one end at the lowerleft of the triangle, and the other end at the upperright. | [
{
"docid": "c597767ded05ea47a19e4a69d5f9bc36",
"score": "0.7464919",
"text": "def triangle(num)\n (0..num).each do |stars|\n puts ' ' * (num - stars) + '*' * stars\n end\nend",
"title": ""
}
] | [
{
"docid": "7cc60b1e5f63374967b1dd528b9f09a8",
"score": "0.82254434",
"text": "def triangle(n)\n (1..n).each { |stars| puts ('*' * stars).rjust(n) }\nend",
"title": ""
},
{
"docid": "49dc27bce8c37fd2f76d502d911ae38c",
"score": "0.80898327",
"text": "def triangle(n)\n stars = 1\n n... |
70ab46eaafb714e753bd0553be557acc | =begin :rtype: Integer =end | [
{
"docid": "e255b6964ad064f0b5f70b15813f2f1f",
"score": "0.0",
"text": "def get_min()\n @min \n end",
"title": ""
}
] | [
{
"docid": "f7da97af017d9c9fe5892ce4ca476682",
"score": "0.68839365",
"text": "def range; end",
"title": ""
},
{
"docid": "f7da97af017d9c9fe5892ce4ca476682",
"score": "0.68839365",
"text": "def range; end",
"title": ""
},
{
"docid": "f7da97af017d9c9fe5892ce4ca476682",
... |
2ff3c7149659bf5c2da4547a8095cbc0 | reserve method is used to freeze funds on payment account, without actually charging them. This method calls validate_reservation_response to make sure that it is being called by actual Amazon FPS service as a callback. Also payment reservation requires that payment.state should be :created. If params are valid FPS res... | [
{
"docid": "691a8e03600406fa3b7e1e7a7fef5fc7",
"score": "0.8263162",
"text": "def reserve(params)\n AmazonProcessor.validate_reservation_response params\n raise PreconditionsError, 'Payment state should be :created' unless payment.created?\n r_amount = Remit::RequestTypes::Amount.new ({value: p... | [
{
"docid": "d7529cb8d9d9e42de07e91c482312298",
"score": "0.6561684",
"text": "def create\n @event = Event.find(params[:event_id])\n @user = current_user\n\n if params[:waiting_list]\n # add user to waiting_list\n @reservation = Reservation.new(reservation_params)\n @reservation.s... |
b6751b467c6a04471841eb92e7db2a53 | PATCH/PUT /fale_conoscos/1 PATCH/PUT /fale_conoscos/1.json | [
{
"docid": "2aceca7f734984aea825ad2794fd5aac",
"score": "0.69875544",
"text": "def update\n respond_to do |format|\n if @fale_conosco.update(fale_conosco_params)\n format.html { redirect_to @fale_conosco, notice: 'Fale conosco was successfully updated.' }\n format.json { render :sh... | [
{
"docid": "89dd52c322f8d15d49640912238f7373",
"score": "0.6422704",
"text": "def update\n respond_to do |format|\n if @conexao.update(conexao_params)\n format.html { redirect_to @conexao, notice: 'Conexao was successfully updated.' }\n format.json { head :no_content }\n else\... |
3f52973818698070d105a2c20fdb77a5 | Serializes information the current object | [
{
"docid": "8e0b4a0449b2d9bb77400585ed077784",
"score": "0.0",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"isRemovable\", @is_removable)\n writer.write_bool... | [
{
"docid": "d162e297d0f84ca205afa381c3f6a428",
"score": "0.7831311",
"text": "def serialize\n Marshal.dump(self)\n end",
"title": ""
},
{
"docid": "762bca0e2db3ff19d91cc4521bb1e1d9",
"score": "0.7646634",
"text": "def serialize(object) end",
"title": ""
},
{
"docid": ... |
43464fee474888d265ed35934690735c | DELETE /tags/1 DELETE /tags/1.json | [
{
"docid": "7fda41e80c78ca4b717502af6acc385c",
"score": "0.71371734",
"text": "def destroy\n @tag.destroy\n respond_to do |format|\n format.html {\n flash[:success] = \"Tag was successfully deleted.\"\n redirect_to( tags_url )\n }\n format.json { head :no_content }\n ... | [
{
"docid": "d67c29208071bc07677edfe1b1e5ef52",
"score": "0.81822556",
"text": "def tagDelete(tag)\n http, req = initReq(\"tags/#{tag}\", \"DELETE\")\n http.request(req).body\nend",
"title": ""
},
{
"docid": "d67c29208071bc07677edfe1b1e5ef52",
"score": "0.81822556",
"text": "def tag... |
9f494b79f7f5e86d03ad2e721e3d8a88 | Sets the format of the assembler's output. Any old output will be discarded | [
{
"docid": "d6aab9eec1419574f3e4335494db052f",
"score": "0.0",
"text": "def format=(form)\n if form.respond_to? :new\n @format = form.new\n else\n formclass = self.class.format_for(form)\n raise \"Unknown format #{form}!\" unless formclass\n @format = formclass.new()\n end\n... | [
{
"docid": "83aa76e529805e81bdee3cbaba8ae74c",
"score": "0.76373315",
"text": "def set_outputformat( format = 'yaml' )\n format.nil? ? format = 'yaml' : ''\n Pdfmdmethods.log('debug',\"Output format set to '#{format}'.\")\n @@outputformat = format\n end",
"title": ""
},
{
"docid": ... |
4fa2e3b64972fd27372f2b4a535a3938 | GET /planned_orders/1 GET /planned_orders/1.json | [
{
"docid": "9ee8ad4924d226d1ecb2d2a3cf6b3550",
"score": "0.7533433",
"text": "def show\n @planned_order = PlannedOrder.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @planned_order }\n end\n end",
"title": ""
}
] | [
{
"docid": "c4b00c58df483f0722fbcfa31cb31f82",
"score": "0.7559174",
"text": "def index\n @planned_orders = PlannedOrder.where(:user => current_user.email).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @planned_orders }\n end\n end",
... |
1327cca6dd811af1f57275d6734e29f2 | check to see if either player has run out of cards | [
{
"docid": "05d90e12e35ddff2a9e98717ea95bb51",
"score": "0.75098854",
"text": "def over? \n\t\t@player_one.empty? || @player_two.empty?\n\tend",
"title": ""
}
] | [
{
"docid": "ed69ba7ae1211191d58a5a99a099541a",
"score": "0.79622394",
"text": "def game_over?\n @player1.out_of_cards? || @player2.out_of_cards?\n end",
"title": ""
},
{
"docid": "564f3200bdff47192b3681cd2439cad7",
"score": "0.78925824",
"text": "def game_over?\n return true if... |
bf630a04f7b3dd31ec85bb042aaa5740 | GET /mongotests/new GET /mongotests/new.json | [
{
"docid": "baf442ed728a847b711b6070aa276e36",
"score": "0.7658348",
"text": "def new\n @mongotest = Mongotest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mongotest }\n end\n end",
"title": ""
}
] | [
{
"docid": "d461bcd1af98706e9daf18739fde8513",
"score": "0.72047794",
"text": "def new\n uri = URI.parse(ENV['MONGOHQ_URL'] || \"mongodb://localhost/rails2-skeleton-app\")\n conn = Mongo::Connection.new(uri.host, uri.port)\n db = conn.db(uri.path.gsub(/^\\//, ''))\n db.authenticate(uri.user,... |
2d7f71275190bf6a05cdde7443e9944f | PUT /paperworks/1 PUT /paperworks/1.json | [
{
"docid": "a201af75153bbad1decc803feb2b5e3e",
"score": "0.69979405",
"text": "def update\n @paperwork = Paperwork.find(params[:id])\n\n respond_to do |format|\n if @paperwork.update_attributes(params[:paperwork])\n format.html { redirect_to @paperwork, notice: 'Paperwork was successfu... | [
{
"docid": "250caf365551df12c0ca8d02e449c374",
"score": "0.6494777",
"text": "def update\n @paper = Paper.find(params[:id])\n\n respond_to do |format|\n if @paper.update_attributes(params[:paper])\n format.html { redirect_to @paper, :notice => 'Paper was successfully updated.' }\n ... |
bce8abacee61ed7c9f421d5e7b744fda | I think you meant for one if sleeping IS false | [
{
"docid": "89ed8999cf534dedabc34ca6453cd7eb",
"score": "0.7506065",
"text": "def meow_awake\n\t\t\"MEOW\" unless self.sleeping\n\tend",
"title": ""
}
] | [
{
"docid": "8a9b01046dc181a0a22dcec588d8f02d",
"score": "0.81872475",
"text": "def meow_asleep\n\t\t\"MEOW\" unless !@sleeping\n\tend",
"title": ""
},
{
"docid": "912e292c4b86a78bbfff7fc6a33a3eed",
"score": "0.8005635",
"text": "def sleeping\n end",
"title": ""
},
{
"doc... |
896be2f12ee988171e25ace816c2e3f4 | Helper that renders a field as an int | [
{
"docid": "4827bd8d606dd2595792940a52ad4875",
"score": "0.75735533",
"text": "def get_int_field(field, default = 0)\n as_int(get_field(field), default)\n end",
"title": ""
}
] | [
{
"docid": "c67c4f66fb57b9ab99ac65d683116d5b",
"score": "0.75398695",
"text": "def integer_field(attr, html_options = {})\n number_field(attr, html_options)\n end",
"title": ""
},
{
"docid": "6a58cec089ea3c0b1d4ea3667a8ddc15",
"score": "0.7467611",
"text": "def render_integer(inp... |
a1d8291c0e82aba740104dd8dd5cea0d | PATCH/PUT /entry2s/1 or /entry2s/1.json | [
{
"docid": "ba21069323594a89b84497f0f087ce44",
"score": "0.7118581",
"text": "def update\n respond_to do |format|\n if @entry2.update(entry2_params)\n format.html { redirect_to @entry2, notice: \"Entry2 was successfully updated.\" }\n format.json { render :show, status: :ok, locati... | [
{
"docid": "ebc3738ec8b644e6710e8a2837fe334e",
"score": "0.6399973",
"text": "def set_entry2\n @entry2 = Entry2.find(params[:id])\n end",
"title": ""
},
{
"docid": "a2068c59eafc14ae627fe8635323abb8",
"score": "0.6196337",
"text": "def update\n @entry = Entry.find(params[:i... |
20f66d4d74722a80ac1a3752e1aefb43 | Delete a plugin rule | [
{
"docid": "52cebe3a8cb000e9a01f8d1e1959176d",
"score": "0.8365584",
"text": "def plugin_rule_delete(rule_id)\n nessus_rest_delete(\"plugin-rules/#{rule_id}\")\n end",
"title": ""
}
] | [
{
"docid": "8016db20d958efc263455e5ca92582bb",
"score": "0.7206497",
"text": "def remove(plugin); end",
"title": ""
},
{
"docid": "639c79333057e66761272733a530be2d",
"score": "0.65221703",
"text": "def delete!\n # -> uncomment the next line to manually enable rule tracing\n ... |
a43f9947bd665e09515769f57a9d795f | Gather VS Packets Outbound | [
{
"docid": "4450d0b4c48215008fd357baf4a25228",
"score": "0.5502587",
"text": "def get_packets_out(snmp = nil)\n @packet_out_rate ||= { }\n report = { }\n snmp = @snmp_manager unless snmp\n\n get_names(snmp) if @names.empty?\n res = gather_snmp... | [
{
"docid": "885ad9a53a6b35d7a75135feefcf7b6d",
"score": "0.6240786",
"text": "def packets; end",
"title": ""
},
{
"docid": "ec35961ceea23128b4b6bd508e612194",
"score": "0.5889477",
"text": "def gather\n\t\t\t@conn.sit\n\t\t\tself\n\t\tend",
"title": ""
},
{
"docid": "7359... |
ca441437a37f00bf36a75c717811753f | Dispatch the conversion of the element +el+ to a +convert_TYPE+ method using the +type+ of the element. | [
{
"docid": "b69c6daa2b061b69ef704b5370260ba3",
"score": "0.75453234",
"text": "def convert(el, opts = {})\n send(\"convert_#{el.type}\", el, opts)\n end",
"title": ""
}
] | [
{
"docid": "60c7b1b1e78b57c36284909a471f95b6",
"score": "0.71218234",
"text": "def convert(el, indent = -@indent)\n send(@dispatcher[el.type], el, indent)\n end",
"title": ""
},
{
"docid": "f7bad3e2d49cdd3ea3a479f2d262ec98",
"score": "0.6887964",
"text": "def convert(el, ... |
4ec9b4ee5d9dfbfaaa29678b852f9071 | GET /projects/id GET /projects?id=id&as= | [
{
"docid": "9e911ac180d70db5b2de4bb7be52aa1c",
"score": "0.0",
"text": "def show(id)\n case request['as']\n when 'preview'\n response.headers['Content-Type'] = 'text/plain'\n data.read(type, id)\n \n when 'download'\n unless path = data.find(type, i... | [
{
"docid": "a5c28e2268a42e0d9d3ea08ef15eb4f1",
"score": "0.7134512",
"text": "def project(id)\n get(\"/projects/#{id}\")\n end",
"title": ""
},
{
"docid": "64e56eb926bb94a91f01de19dfba56d4",
"score": "0.7102582",
"text": "def project id\n get_request \"projects/#{id}\"\n... |
54b45aac9cefa90ba63f466ead23397c | Increment current value and set start_at at current time (if not set yet) | [
{
"docid": "e2de7ba2ac5a5067a25f14ba4c5db91b",
"score": "0.69911313",
"text": "def inc(value=1) \n if valid?\n #raise CustomError::InvalidBar unless valid?\n _set(:start_at, Time.now.to_f) unless _get(:start_at)\n _set(:current_at, Time.now.to_f)\n inc_value = _inc(:curr... | [
{
"docid": "604c0a9eb7072b1c414ceeca4cfb27be",
"score": "0.70604414",
"text": "def started_at=(started_at)\n self[:started_at]=(started_at)\n update_finish_at\n end",
"title": ""
},
{
"docid": "fe18bc05539a924d47588fe33d422328",
"score": "0.6654831",
"text": "def setup_start_a... |
7c714d4f997a5c15d326f2d104cd0764 | Delete a system user&39;s Public SSH Keys This endpoint will delete a specific System User&39;s SSH Key. | [
{
"docid": "7446d59e5857f074fd857963e0d6a37a",
"score": "0.58641267",
"text": "def sshkey_delete_with_http_info(id, content_type, accept, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SystemusersApi.sshkey_delete ...\"\n end\n # verif... | [
{
"docid": "6dfeb7511d70cac5daa0456ebe58467b",
"score": "0.6948353",
"text": "def delete_ssh_key(id, options = {})\n user_id = options.delete :user_id\n if user_id.to_i.zero?\n delete(\"/user/keys/#{id}\")\n else\n delete(\"/users/#{user_id}/keys/#{id}\")\n end\n end... |
c4202452799b8fd7a6f144c4c1133d4b | The function that handles how an Fighter behaves after losing a battle. Subclasses must override this function. | [
{
"docid": "04a388278ea7789220445d1d1a29c92a",
"score": "0.0",
"text": "def die\n raise(NotImplementedError, 'A Fighter must know how to die.')\n end",
"title": ""
}
] | [
{
"docid": "d081395f52ad82effefd5a0d4cb26db8",
"score": "0.70315224",
"text": "def fight\n return nil\n end",
"title": ""
},
{
"docid": "4a4526a36327f8c2aa36d66f49a464d8",
"score": "0.69689953",
"text": "def lost_fight\n @@fight.player_won = 0\n @@fight.save\n ... |
880ae00f24f897cba62bfb0193b1301e | GET the welcome message | [
{
"docid": "3a0d30bba21ab7eb1337f94acab20c3a",
"score": "0.0",
"text": "def info\n CouchDB.get \"#{uri}/\"\n end",
"title": ""
}
] | [
{
"docid": "c33580e16657d3b7263d3fd4487c1e31",
"score": "0.7250246",
"text": "def welcome\n 'Halo, saya asisten robot ciptaan @qisthi yang bisa membantu kamu untuk mendapatkan informasi-informasi yang kamu butuhkan. Tulis BANTU untuk melihat daftar perintah yang saya ketahui :D'\n end",
"title":... |
130629849d7b388fd3ac42814e407f3a | Returns current expiry address. | [
{
"docid": "ed22d55cffdf63b00b9838dc45e93b87",
"score": "0.809668",
"text": "def expiry_address\n with_queue_control do |control|\n control.expiry_address\n end\n end",
"title": ""
}
] | [
{
"docid": "c3e72abec6a838b54614b925fe19ea85",
"score": "0.6607569",
"text": "def current_email_address\n last_email_address\n end",
"title": ""
},
{
"docid": "6ae87ad99d91d86697f849b60c5011e2",
"score": "0.6603763",
"text": "def expiry\n invalid_at.to_f.to_s\n end",
... |
fdface54b8acb6099c11c59cfac0915d | Sets the context is being tokenized (expression) argument: expression to tokenize (string) | [
{
"docid": "7800f3a126dbbec3491422c604ab9a44",
"score": "0.58104116",
"text": "def context=(exp)\n @context = exp.chomp\n end",
"title": ""
}
] | [
{
"docid": "609d7db2a83985f4cc29783c1b3f5c09",
"score": "0.59239584",
"text": "def tokenize\n end",
"title": ""
},
{
"docid": "d9ee28b764d80cef4d293786d00ae484",
"score": "0.58185214",
"text": "def tokenize\n \n end",
"title": ""
},
{
"docid": "023d334d88891d86... |
ac97a94b933401fab3faf203992f4be7 | returns true if account is open and balance is >0 | [
{
"docid": "3ad61ff384a19a00b76ad2b091ab7727",
"score": "0.79965085",
"text": "def valid?\n @balance > 0 && @status == \"open\"\n end",
"title": ""
}
] | [
{
"docid": "7da16beb9f49d752bf925fb892d7fec5",
"score": "0.80293787",
"text": "def valid?\n status == 'open' && balance > 0 ? true : false\n end",
"title": ""
},
{
"docid": "057bbe4cb7fcc45d2292901d52c25f3d",
"score": "0.8016359",
"text": "def valid?\n return self.status == ... |
2ef038ffb235fe7be4f07f2f0fcde7bc | GET /employee_skills GET /employee_skills.json | [
{
"docid": "695edef1dbfe77bf1af71e7bfdde41ac",
"score": "0.7300124",
"text": "def index\n @employee_skills = EmployeeSkill.all\n end",
"title": ""
}
] | [
{
"docid": "6e95416af60aa091ad67aa01c75f6bf7",
"score": "0.7092058",
"text": "def index\n @user_skills = UserSkill.all\n render json: @user_skills\n end",
"title": ""
},
{
"docid": "cb4014baa0ca4edb771bf1c6a0fcbdef",
"score": "0.7062034",
"text": "def index\n @skills = Skil... |
8fa41eaf469e36202a8dd7f73fd64571 | GET /modeltypes/1 GET /modeltypes/1.xml | [
{
"docid": "82e15069dd362f25fe6bc4b158d919af",
"score": "0.6875909",
"text": "def show\n @modeltype = Modeltype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @modeltype }\n format.csv { render :csv => @modeltype }\n f... | [
{
"docid": "60f36c2a5441b1f2c35d7ce540e13e61",
"score": "0.7332586",
"text": "def show\n @model_type = ModelType.find(params[:id])\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @model_type.to_xml }\n end\n end",
"title": ""
},
{
"docid... |
45324b6ace60e71a98fe7dd7a751e19b | Let the service know that the user made a donation. | [
{
"docid": "56457030d4e6580da86a12dff2b07fce",
"score": "0.6953634",
"text": "def donate(d)\n\t\treturn unless donate?\n\t\t\n\t\tbegin\n\t\t\tcase provider\n\t\t\twhen \"facebook\"\n\t\t\t\tshow_donation_on_facebook(d)\n\t\t\t\t\n\t\t\twhen \"twitter\"\n\t\t\t\tshow_donation_on_twitter(d)\n\t\t\tend\n\... | [
{
"docid": "33f37ef4083609e0bb36a0540d674e58",
"score": "0.70905554",
"text": "def make_donation\n # try to see if the donor is already in the database\n @user = User.find_by_email(params[:user_email])\n if !@user # if not, then create the user\n @user = User.new({\n name: params[:u... |
ff8d24b1732592fa48b7bb6bdb22b2ff | Returns a list of nodes, starting node as root until last node | [
{
"docid": "5e436d664a3d5a4436a94a5baae023dd",
"score": "0.0",
"text": "def nodes(options={})\n configuration = {}\n configuration.update(options) if options.is_a? Hash\n\n node, nodes = self, []\n \n nodes += ([node.left] + node.left.nodes) if node.left && configuration[:side] ... | [
{
"docid": "cba8768b11c80f629d89111bc5b18df8",
"score": "0.752832",
"text": "def nodes\n nodes = []\n each { |node| nodes << node }\n nodes\n end",
"title": ""
},
{
"docid": "7d46a74246b1a609cfbe34f67f3c6e31",
"score": "0.7360956",
"text": "def nodes\n @root.no... |
add94505ba4747ef4cc0baa2bdefa165 | PUT /ingredients/1 PUT /ingredients/1.xml | [
{
"docid": "cfc8cc4b19a4d31999e67f0e6677808d",
"score": "0.5885588",
"text": "def update\n @ingredient = Ingredient.find(params[:id])\n\n respond_to do |format|\n if @ingredient.update_attributes(params[:ingredient])\n flash[:notice] = 'Ingredient was successfully updated.'\n fo... | [
{
"docid": "e6949efa307aac8a51b22df67b29a21a",
"score": "0.66193044",
"text": "def update\n @ingredient = Ingredient.find(params[:id])\n\n respond_to do |format|\n if @ingredient.update_attributes(params[:ingredient])\n format.html { redirect_to(@ingredient, :notice => 'Ingredient was ... |
f628bf912f496b2f7fba6faae83f2b85 | DELETE /doctor_details/1 DELETE /doctor_details/1.json | [
{
"docid": "f9cf6266d4471b0b432fd6e61cb71259",
"score": "0.7996924",
"text": "def destroy\n @doctor_detail = DoctorDetail.find(params[:id])\n @doctor_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to doctor_details_url }\n format.json { head :no_content }\n end\... | [
{
"docid": "1ec892025f8788b7c176d392154fd2a3",
"score": "0.78984946",
"text": "def destroy\n @doctor.destroy\n respond_to do |format|\n format.json { head :no_content}\n end\n end",
"title": ""
},
{
"docid": "eab4c34af7146b8409807c0c29f18a1d",
"score": "0.77059627",
"t... |
178701c7464286b1f1292beaa4c0bb1f | GET /questions/new GET /questions/new.json | [
{
"docid": "26b44cd92c69e4173940144a8f0c1549",
"score": "0.0",
"text": "def new\n @question = Question.new\n end",
"title": ""
}
] | [
{
"docid": "542d57628c96eb20ef891051d77449e9",
"score": "0.7919707",
"text": "def new\n @question = Question.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @question }\n end\n end",
"title": ""
},
{
"docid": "2376be4e7cea93d522bdd04... |
ff1921b1a3ea2fcc359b4da08d593e6f | Define collection object reader & writer methods from attributes | [
{
"docid": "e5c3df2ef345dc0f201807bcaaf7059b",
"score": "0.59113806",
"text": "def collection_object_attr_accessor(klass, key, *key_path)\n collection_object_attr_reader(klass, key, *key_path)\n\n define_method(\"#{key}=\") do |values|\n @attrs.deep_reverse_merge! keypath_ha... | [
{
"docid": "1d63fbd4f9880ab152e0704549ad66e2",
"score": "0.7167949",
"text": "def collection_attr_reader(klass, *attrs)\n attrs.each do |attr|\n define_collection_method(attr, klass)\n define_predicate_method(attr)\n end\n end",
"title": ""
},
{
"docid": ... |
a484127042ebd834a4c54fda7df78857 | Copies all public directories to the new release directory | [
{
"docid": "80903d8d04b0b61e4bfa06be8626baa5",
"score": "0.7716323",
"text": "def copy_public_directories\n Bones.public_directories.each do |src|\n FileUtils.copy_entry Bones.root / 'public' / src, destination / src\n end\n end",
"title": ""
}
] | [
{
"docid": "f4c1c924abd1270feda731ef7558e1f0",
"score": "0.7170507",
"text": "def copy_public_folder\n\t\t\t\tFileUtils.mkdir(@dst) unless Dir.exist? @dst\n\t\t\t\tfile_list = get_file_list 'public'\n\t\t\t\tfile_list.each do |filename|\n\t\t\t\t\tdirname = File.join(@dst, File.dirname(filename))\n\t\t... |
3e738ace09e71d3e883b069b456ce3db | DELETE /imports/1 DELETE /imports/1.json | [
{
"docid": "cdcbab473d068fbeb1fa56b871919c17",
"score": "0.6918513",
"text": "def destroy\n @import.destroy\n respond_to do |format|\n format.html { redirect_to imports_url, notice: 'Import was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
... | [
{
"docid": "3747083a83372bc7cebb0c362c59d8c2",
"score": "0.7312163",
"text": "def destroy\n puts \"IMPORT DESTROY \"+@import.id\n @import.destroy\n respond_to do |format|\n format.html { redirect_to imports_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}... |
04fcc73c2e08d217de04b3ea37e990a7 | ricorda l'individuo con la migliore fitness Confronta i migliori delle ultime due generazioni e ne determina il vincente | [
{
"docid": "943cb759396ee09d8ed255540c928e53",
"score": "0.0",
"text": "def remember_fittest\n new_best = fittests(1).first\n @best = new_best \n end",
"title": ""
}
] | [
{
"docid": "7c933377c4adbbc260aa83917dc1d0db",
"score": "0.6812253",
"text": "def vypocti_fitness(jedinec)\n poc_splnenych_k = 0\n soucet_vah = 0\n fitness = 0.0\n \n # pocet splnenych klauzuli\n poc_splnenych_k = dej_pocet_splnenych_klauzuli(jedinec, @instance.klauzule)\n \n # s... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "9519ec83fa5a1c3ddba10f235329b8c4",
"score": "0.0",
"text": "def set_gear_guide\n @gear_guide = GearGuide.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60320485",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6013371",
"text": "de... |
8ee72932ef69df11e88b53564d853e59 | Returns the object in the form of hash | [
{
"docid": "b6fcc9ba9f0a46841d70dfe10cc12b0e",
"score": "0.0",
"text": "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !... | [
{
"docid": "027facb8b195665ceeb78f2c171e2881",
"score": "0.8270299",
"text": "def to_hash\n object\n end",
"title": ""
},
{
"docid": "d730a9ea60df6695b2c6a153d7d3a8b7",
"score": "0.794916",
"text": "def hash\n as_hash.hash\n end",
"title": ""
},
{
"docid":... |
311f1c0c6290a8c5bc7e95d4bba44198 | Never trust the parameters from the Internet | [
{
"docid": "3d655de109388effaf8b9004233a5aba",
"score": "0.0",
"text": "def user_params\n params.permit(\n :name,\n :number,\n :age,\n :email,\n :specialization,\n :role\n )\n end",
"title": ""
}
] | [
{
"docid": "090c2e27cf8f27053936b62f38cbdf43",
"score": "0.61066824",
"text": "def get(params, url=\"https://baconipsum.com/api?\")\n if params[\"paras\"] && params[\"sentences\"]\n puts \"Just a warning that sentences override paras...\"\n end\n endpoint = url + URI.encode_www_form(params)\n pri... |
69db807cde1f11aa104f61c12155db29 | Quite easy, slowly borg in the other points, always sucking in the lowest link. From reading the solutions, I implemented what is called the Prim Algorithm. I had also considered what is called Kruskal Algorithm but decided to go with the borg approch. | [
{
"docid": "9f5b4fc90e63a64688b5f7f0eadfaccc",
"score": "0.6630603",
"text": "def problem_107\n if false\n net = [ \"-,16,12,21,-,-,-\", \"16,-,-,17,20,-,-\", \"12,-,-,28,-,31,-\",\n \"21,17,28,-,18,19,23\", \"-,20,-,18,-,-,11\", \"-,-,31,19,-,-,27\",\n \"-,-,-,23,11,27,-\" ]\n net.map!... | [
{
"docid": "d70d0c436a55446e607885e359b38433",
"score": "0.6502584",
"text": "def a_star pitch, start, goal\n\t\t# The set of nodes already evaluated.\n\t\tclosedset = []\n\t\t# The set of tentative nodes to be evaluated.\n\t\topenset = []\n\t\t# Visited nodes\n\t\tfrontier = []\n\t\topenset << start\... |
f565e9c7af809561a15d9a518c9603d1 | Language and autotranslation related stuff Maybe refactor Why obj.split(' ').length == 1 ?? raises error in case of oneworddescription (no error handling) | [
{
"docid": "28d8ab45c6db285ab6ec7f4d12177ada",
"score": "0.0",
"text": "def emptyish?(obj)\n obj.nil? || obj.empty? || obj.split(' ').length == 1\n end",
"title": ""
}
] | [
{
"docid": "761372c9f20e234160532a8df87541b1",
"score": "0.5908934",
"text": "def check_model_word_count\n @trim = @model.split[1] if @model.split.length == 2\n @model = @model.split[0] if @model.split.length == 2\n end",
"title": ""
},
{
"docid": "997f1a1f0db33485dd1515ca4fe8e934",
... |
58f34b10ce3981d8a6b627c08d40b17c | Testing a campaign Sends a test email of a draft campaign to a list of email addresses you specify for previewing. | [
{
"docid": "4abd8af2474fa258ab15c88cd37d25b8",
"score": "0.0",
"text": "def testing_a_campaign_with_http_info(format, apikey, campaign_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CampaignsApi.testing_a_campaign ...\"\n end\n ... | [
{
"docid": "3050302d9f6a8d02d3d3c4813b4b62ce",
"score": "0.7216726",
"text": "def send_email_campaign_test(access_token, campaign, test_send)\n campaign_id = get_argument_id(campaign, 'Campaign')\n Services::CampaignScheduleService.send_test(access_token, campaign_id, test_send)\n end",
... |
906724020379df12547b4d4ae807bd4e | helper method to generate elasticsearch url for this object type | [
{
"docid": "b7ebad8754068f97199aa864d1fd3e66",
"score": "0.0",
"text": "def index_mapping_path(action = nil)\n ElasticSearchable.request_path [index_type, action].compact.join('/')\n end",
"title": ""
}
] | [
{
"docid": "97bf074d554e923ee31a17d4a50cc369",
"score": "0.6717011",
"text": "def url\n \"/#{Taxonomy.get(taxonomy_type)['entry_type']}/#{taxonomy_type}/#{slug}\"\n end",
"title": ""
},
{
"docid": "437e62b685e8f84b2d31ed325c8bbc2f",
"score": "0.66400886",
"text": "def type_url(in... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "f7c669424b9039b1df3f0e1249d39f91",
"score": "0.0",
"text": "def set_institucion\n @institucion = Institucion.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... |
30373643ecfe8619912d5b1be80159a2 | MemoryProfiler.report do ten_topics_select end.pretty_print exit | [
{
"docid": "534006d5080ae1575b8319d7719d0189",
"score": "0.0",
"text": "def fast_mode(v)\n return if $fast_mode == v\n if !v\n ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements.switch_exec_query :orig\n $fast_mode = false\n else\n ActiveRecord::ConnectionAdapters::PostgreSQL::... | [
{
"docid": "461408790621fe447f2b978856028579",
"score": "0.5884124",
"text": "def print_topics(**kwargs)\n print_table(kwargs)\n end",
"title": ""
},
{
"docid": "7e170ece5ced32576ec73d72acfdb700",
"score": "0.5403939",
"text": "def profiler; end",
"title": ""
},
{... |
3eebadcbbb332685c415a09b52f5c930 | Working with list of droplets. | [
{
"docid": "232800e84424c7b61af225d95b49bc2f",
"score": "0.6436944",
"text": "def work_with_droplets\n load_droplets\n dispatch_droplets\n logger.debug 'Working with list of DigitalOcean droplets'\n thread_chain\n end",
"title": ""
}
] | [
{
"docid": "c10a00a9d49b6cf76f8fb41eb43dc7f8",
"score": "0.7287807",
"text": "def dispatch_droplets\n droplets.each do |droplet|\n id = droplet.id.to_s\n next if exclude.include? id\n next unless only.empty? || only.include?(id)\n\n prepare_droplet id, droplet.name\n ... |
fc5c9c40cc2b8723ae26b56af09709cf | Yields a querybuffer and flushes at the end of the block given. | [
{
"docid": "7dddf0c8457716d2b3241a04d8987276",
"score": "0.60864824",
"text": "def q_buffer(&block)\r\n Knj::Db::Query_buffer.new(:db => self, &block)\r\n end",
"title": ""
}
] | [
{
"docid": "b9ebdc8eac569c0ce6c438786c7c5fa5",
"score": "0.67247885",
"text": "def flush\n return nil if @queries.empty?\n \n @args[:db].transaction do\n @queries.shift(1000).each do |str|\n STDOUT.print \"Executing via buffer: #{str}\\n\" if @debug\n @args[:db].q(str)\n ... |
476f314a66306577089dae8f5f9d3ac4 | POST /insertions or /insertions.json | [
{
"docid": "681319a1b37abe0ae383875e263bfd7c",
"score": "0.6554432",
"text": "def create\n @insertion = Insertion.new(insertion_params)\n @insertion.user = current_user\n\n respond_to do |format|\n if @insertion.save\n format.html { redirect_to @insertion, notice: \"Insertion was su... | [
{
"docid": "73faa3545132454acf1e2b7ee8e49126",
"score": "0.7483805",
"text": "def insert(params)\n with_options(request_method: :post, params: params).response\n end",
"title": ""
},
{
"docid": "86de1289af2032f12c4cc069d03f2bdf",
"score": "0.7472663",
"text": "def insert(... |
578a1f506a86b63faa8c046501a1890c | Register a new success (good) way. Requires a block. | [
{
"docid": "7d1fd3de606092d02bfa96e7bf3d430c",
"score": "0.5581215",
"text": "def good(&block)\n @good_proc = block\n end",
"title": ""
}
] | [
{
"docid": "0cea9b1c85ce2d2c44ca4627f7fd3ec8",
"score": "0.7232992",
"text": "def on_success(&block)\n @success = block if block\n end",
"title": ""
},
{
"docid": "dc55fc4dd483b426a0cfab70ce840158",
"score": "0.71326506",
"text": "def success(&block)\n @on_success = bl... |
1dd46fa3627d71976456e48cec4b6737 | Generate namespaces paths recursively over each outer namespace | [
{
"docid": "aa0c9130a8b2e293cfa931d3ffc56103",
"score": "0.62240237",
"text": "def namespace_path\n local_namespace, outer_namespace =\n self.name.reverse.split('::', 2).map(&:reverse)\n\n outer_constant = Kernel.const_get outer_namespace\n outer_path = outer_consta... | [
{
"docid": "176319b65d0667bad543edbad1561c72",
"score": "0.64625317",
"text": "def namespace_dirs; end",
"title": ""
},
{
"docid": "ffd4fc768a007580504a2a73d866fefd",
"score": "0.6326319",
"text": "def ruby_path namespaces\n namespaces = namespaces.split \".\" if namespaces.is_a? ... |
634b577861dfa3c3c9873e7fb9379502 | Yields block on each child of this node | [
{
"docid": "83d6ac3aaed4e3e7e0ff2485d233205e",
"score": "0.78045994",
"text": "def each\n return nil unless block_given?\n @children.each {|child| yield child}\n end",
"title": ""
}
] | [
{
"docid": "7f7e32b039c28a101a7a96d5ffa95875",
"score": "0.8276251",
"text": "def each_child(&block); end",
"title": ""
},
{
"docid": "704d1ff8c8dc58418de399059d9bb31f",
"score": "0.81672525",
"text": "def each &block # :yields: node\n yield self\n children { |c... |
3621bca84b00470393a70ad51376fa73 | DELETE /athletes/1 DELETE /athletes/1.xml | [
{
"docid": "6ae05c89cd828f3bbd898229e01bd5ab",
"score": "0.0",
"text": "def destroy\n \n @athlete = Athlete.find(params[:id])\n\n if (params[:prompt_reply].nil?) then\n @athlete.errors.add(:base, \"Missing secret key\")\n @athletes = Athlete.find(:all, :order => 'name')\n render ... | [
{
"docid": "822ddea2e45bf78350003645efcbdb54",
"score": "0.67089164",
"text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end",
"title": ""
},
{
"docid": "df26116eb86dbadafed7137f9e3c2f9e",
"score": "0.66453767",
"text": "def delete!\r\n return nil unless e... |
bb98daec45a26905cb9a270326f74c6d | DELETE /exams/1 DELETE /exams/1.json | [
{
"docid": "508091edc30a1eaaff835bb34a0224f0",
"score": "0.70567095",
"text": "def destroy\n @exam.destroy\n respond_to do |format|\n format.html { redirect_to exams_url, notice: 'Exam was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}... | [
{
"docid": "ad86927f1fcde37e80086f508ce163d0",
"score": "0.7685275",
"text": "def destroy\n @exam = Exam.find(params[:id])\n @exam.delete\n respond_to do |format|\n format.html { redirect_to exams_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
... |
a1d053e28c130e26724a2835e7f030a8 | updates the task with the data from the form | [
{
"docid": "d185011981b2a3d59180dcaf04083471",
"score": "0.6760988",
"text": "def update\n @task = Task.find_by(id: params[:id])\n if @task.nil?\n redirect_to tasks_path\n elsif @task.update(\n name: params[:task][:name],\n description: params[:task][:description],\n c... | [
{
"docid": "791515f3a5d8167fb6a23c186a40a213",
"score": "0.7563197",
"text": "def update\n @task.update(task_params)\n end",
"title": ""
},
{
"docid": "b2f1758bd608f8966eaf998bcd411fd9",
"score": "0.736598",
"text": "def update\n if @task.update(task_params)\n success_tas... |
41630fd36802d297c03d93b48c469230 | takes a snapshot of particular currency | [
{
"docid": "f5dec339cfa6274d9d5e999d67dd9861",
"score": "0.64461607",
"text": "def capture\n if @currency = Currency.find_by_code(params[:code])\n CurrencySnapshot.get(currency_code: @currency.code)\n redirect_back(fallback_location: currencies_path)\n else\n flash[:error] = \"Could... | [
{
"docid": "df4d10119b8c0867535ca979e9f1760c",
"score": "0.6835819",
"text": "def with_currency(new_currency); end",
"title": ""
},
{
"docid": "c5b95bfaefdaca507e564754da70112a",
"score": "0.6570514",
"text": "def currency; end",
"title": ""
},
{
"docid": "c5b95bfaefdaca5... |
0585c3d2735f495022204088115311b2 | POST /courses POST /courses.json | [
{
"docid": "a74a4973d11e6e34ae598c6f96c671d0",
"score": "0.0",
"text": "def create\n @course = Course.new(course_params)\n\n if @course.save\n #log_in @user\n flash[:success] = \"Course created\"\n redirect_to course_url(@course) #could have put redirect_to @user but wanted to be ex... | [
{
"docid": "16ee815215044ae60ed7fb0ac14b1d68",
"score": "0.76898974",
"text": "def create\n # render plain: params[:courses].inspect\n @courses = Courses.new(courses_params)\n\n respond_to do |format|\n if @courses.save\n format.html { redirect_to @courses, notice: 'Course was succe... |