query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
49de20f7de2c88afc93ff14c8f673694 | Public user can execute public actions, but when they try executing an administrator action they are redirected to login. | [
{
"docid": "6bf83fff84616b90a214f2e395668aff",
"score": "0.0",
"text": "def test_action_security\n # A public action\n get '/goldberg/auth/login'\n assert_response :success\n # An administrator action\n get '/goldberg/users/list'\n assert_redirected_to_login\n\n form_login('admin', ... | [
{
"docid": "5400d7d28ae670768098ecce72eada96",
"score": "0.75311565",
"text": "def authorized\n\t unless admin?\n\t redirect_to root_path\n\t end\n end",
"title": ""
},
{
"docid": "5237ff9ca9b39ac4c058470b5fef93b6",
"score": "0.75057834",
"text": "def restrict_access\n red... |
daca6d799f89da4dd2902aa0d481fd38 | Convert :collapse > Markdown (not implemented) | [
{
"docid": "25284e4a02658147bf7b0676307f926c",
"score": "0.5854654",
"text": "def convert_collapse(_el, _opts)\n raise NotImplementedError\n end",
"title": ""
}
] | [
{
"docid": "7306c3e50b4711fd3e0a472c84318716",
"score": "0.7448909",
"text": "def convert_collapse(el, _indent)\n RPF::Plugin::Kramdown.convert_collapse_to_html(el.value)\n end",
"title": ""
},
{
"docid": "9e2aaa8f0d3c3b3f9d0791cb91d9d49d",
"score": "0.73795056",
"text": ... |
c2d37c64c7f3facfa4d7d663407f3f5d | Output the VSphere file header | [
{
"docid": "64bf33a5a8d1826f7ddbe8ee657c439f",
"score": "0.79567236",
"text": "def output_vs_header(options,output_file)\n if options['verbose'] == true\n handle_output(options,\"Information:\\tCreating vSphere file #{output_file}\")\n end\n dir_name = File.dirname(output_file)\n top_dir = dir_n... | [
{
"docid": "2b0bd7e05d8230322ba99d6e74e20304",
"score": "0.8010301",
"text": "def output_vs_header(output_file)\n if $verbose_mode == 1\n puts \"Creating:\\tVSphere file \"+output_file\n end\n file=File.open(output_file, 'w')\n $q_order.each do |key|\n if $q_struct[key].type == \"output\"\n ... |
4b2e6cfa5b3993d6cc65bcf923a8d7f1 | POST /fthreads POST /fthreads.xml | [
{
"docid": "ad92dc72628203c3d4282f1259c5c61e",
"score": "0.53906924",
"text": "def create\n @subforum=Subforum.find(params[:subforum_id])\n #@fthread = Fthread.new(params[:fthread])\n @fthread= @subforum.fthreads.create(params[:fthread])\n\n redirect_to subforum_path(@subforum)\n\n #respo... | [
{
"docid": "2c6ba882ed9e74fd621d0072e01addac",
"score": "0.57447815",
"text": "def thread\n api.request(:get, \"#{resource_url}/thread\")\n end",
"title": ""
},
{
"docid": "1eff6ec2daf4d521308ac95879c71ae6",
"score": "0.558531",
"text": "def fthread_params\n params.requi... |
f308637613dae2361497778840bd6f2b | Remove User from session. There is no link to this action, yet. | [
{
"docid": "a08f464c6b1bfd211e31ddd58d6f45f9",
"score": "0.0",
"text": "def logout\n session[:user] = nil\n redirect_to '/'\n end",
"title": ""
}
] | [
{
"docid": "cafc38316122f86e05f98e95f3711885",
"score": "0.81594616",
"text": "def destroy\n session.delete(:user)\n end",
"title": ""
},
{
"docid": "91ffe0ddafda8408f14ac4cfeec2bae8",
"score": "0.8147526",
"text": "def destroy\n\t\tuser = current_user\n\n\t\tsession.delete(:user... |
6502f9cae6c903ddf2f850d7e8341c0c | just a wrapper for evaluating a block after a certain time | [
{
"docid": "381be41a555d82cb3070bb9fc8dab6c9",
"score": "0.7097077",
"text": "def after_timeout\n Scheduler.in WaitTime do\n yield\n end\nend",
"title": ""
}
] | [
{
"docid": "e2c5e227b40eeec42f3248b913fb2105",
"score": "0.74816054",
"text": "def run_at(time, &block)\r\n seconds_until = time - Time.now\r\n t = Timer(seconds_until, shots: 1 , &block)\r\n t.start\r\n return t\r\n end",
"title": ""
},
{
"docid": "8689... |
310566d7e7af39a25877ce8c805be6e0 | POST /experience_sharings POST /experience_sharings.json | [
{
"docid": "8dc47deac636d9b7113c6f001ca6bc94",
"score": "0.60491157",
"text": "def create\n @experience_sharing = ExperienceSharing.new(params[:experience_sharing]) # <=this is views experience_sharing\n\n respond_to do |format|\n if @experience_sharing.save\n format.html { redirect_to... | [
{
"docid": "701d2e951e5079891660fcd7a0fb9e82",
"score": "0.61028236",
"text": "def create\n @harvesting = Harvesting.new(params[:harvesting])\n\n respond_to do |format|\n if @harvesting.save\n format.html { redirect_to @harvesting, notice: 'Harvesting was successfully created.' }\n ... |
ac51caea6733abaeadac11743b5d4b20 | Doesn't quite work Look at each link on the page and decide if it needs to be visited | [
{
"docid": "4a8af4675a71a28f02e5a614d61ff691",
"score": "0.6545482",
"text": "def visit_all_pages\n url = @ip_addr.CanonicalUrl\n urlsVisited = Array.new; urlsToVisit = Array.new( 1, url )\n # Start accessing pages\n while urlsToVisit.length > 0 && urlsVisited.length < MAX_NO_PAGES\n\n ... | [
{
"docid": "85a0dccd4eb92aa81995e6be5aabf4b3",
"score": "0.7363126",
"text": "def visit_link?(link)\n not @pages.has_key?(link) and not skip_link?(link)\n end",
"title": ""
},
{
"docid": "ab2559cf81ca3a98ab8101724c10a62f",
"score": "0.72421163",
"text": "def links?\n\n n... |
06fedbad9fdef0ec97cc238b1a95586a | POST /admin/decp_modules POST /admin/decp_modules.json | [
{
"docid": "6a7272aa34be9ecfd75fa0abf70cd4c4",
"score": "0.7102895",
"text": "def create\r\n @admin_decp_module = Admin::DecpModule.new(params[:admin_decp_module])\r\n\r\n @data_types = %w[boolean date datetime decimal integer string time]\r\n\r\n respond_to do |format|\r\n format.html { r... | [
{
"docid": "c73c36c1d07d754fcf0ca672e3440563",
"score": "0.67357606",
"text": "def new\r\n @admin_decp_module = Admin::DecpModule.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @admin_decp_module }\r\n end\r\n end",
"title": ""
... |
a6527a2ee7f77ed7a93a4b65ae76ef25 | Obtain an InputSet object, used to define inputs for an execution of this Choreo. | [
{
"docid": "c91af0f2cc3fcb2f48c8b1710d9ebdda",
"score": "0.0",
"text": "def new_input_set()\n return GetBase64EncodedPhotoInputSet.new()\n end",
"title": ""
}
] | [
{
"docid": "64c57f88a4eac6079f885b7b88602378",
"score": "0.66510034",
"text": "def execute(input_set = nil)\n # If the inputs are not configured, create a blank set.\n if input_set == nil\n input_set = InputSet.new()\n end\n param_map = {\"source_id\" => TembooSession.get_identifier()}\... |
ef54561af58a30f9f5e61b68753b5688 | POST /user_locations POST /user_locations.json | [
{
"docid": "4acefd9673a44baf0ecdcee904373247",
"score": "0.6924676",
"text": "def create\n @user_location = UserLocation.new(user_location_params)\n\n respond_to do |format|\n if @user_location.save\n format.html {redirect_to @user_location, notice: 'User location was successfully crea... | [
{
"docid": "10269bfa7f8e0d3d71fb510595d03d15",
"score": "0.73552275",
"text": "def create\n\n if request.xhr?\n @location = Location.new\n @location.lat = params['lat'].to_f\n @location.lng = params['lng'].to_f\n @location.name = params['name']\n @location.address = params['a... |
7e77d25d03a9d664f628dfac5905569b | regexp helper for asserting cli output on 'wt finish' | [
{
"docid": "db8b0459bf0b86d8b538a1faa5b4f7a3",
"score": "0.6444509",
"text": "def finish_msg_regexp\n Regexp.new(WorkingTimes::FINISH_MSG.map { |msg| msg + '|' }.join[0..-2])\nend",
"title": ""
}
] | [
{
"docid": "e449cc991761bda7c76518ed34a110e2",
"score": "0.68656915",
"text": "def test_format_output\n out, err = capture_io do\n begin\n Commandeer.parse!('')\n rescue SystemExit\n end\n end\n\n assert_match(out, /^.*Usage:.*\\n\\n\\tcommand_one*\\n\\tcommand_two\\n.*$/)... |
b9efd254e9b1a6b20a8485e5b95065e5 | Start the API for the +database+. Options: +resource_serializer+ serializer used for resources +metadata_serializer+ serializer used for metadata +web_options+ are passed to Sinatra run! method. | [
{
"docid": "bd7701fa18a967b73177586903268c8c",
"score": "0.758273",
"text": "def start_with_database(database,options={},web_options={})\n build_metadata_api(database.metadata,serializer: options[:metadata_serializer])\n database.send(:classes).each do |resource|\n next if d... | [
{
"docid": "e1adcda06c9e275efad09fc864e4cbd2",
"score": "0.61297673",
"text": "def run\n self.setup_lock.synchronize do\n unless self.start_complete\n # Start the API Umbrella process to test against.\n self.api_umbrella_process = ApiUmbrellaTestHelpers::Process.instance\n ... |
6bd9feec7abea477d3b216b0a45c86b8 | returns list of instance attribute values | [
{
"docid": "43170e8c376b0d9bcfd2010e5461b8d3",
"score": "0.81681055",
"text": "def attribute_values\n attributes.values\n end",
"title": ""
}
] | [
{
"docid": "96326d8aebfecae3c168cba7e8972cc0",
"score": "0.86824584",
"text": "def attribute_values\n self.class.attributes.map{ |attr| self.send(attr) }\n end",
"title": ""
},
{
"docid": "082ccf0670962627a0ea3d664c1bfa66",
"score": "0.8158365",
"text": "def attributes\n ins... |
b505a218fe3d4383526725362e1fbebb | Checks the Cassandra system tables to see if a column exists on a column family | [
{
"docid": "c1fd34f4f36dec02b042fd7bfafeee75",
"score": "0.8349014",
"text": "def column_exists?(cf, col)\n klass = OpenStruct.new(column_family: 'system.schema_columns', default_consistency: 'QUORUM')\n cql = DatastaxRails::Cql::ColumnFamily.new(klass)\n results = cql.select('count... | [
{
"docid": "ed16adfe0a72d9a10179d0d76e6ef940",
"score": "0.81807363",
"text": "def exists?\n @executor.call({\n command: :column_families,\n arguments: {\n keyspace_name: @keyspace.name,\n },\n transformer_arguments: {\n keyspace: @keyspace,\n }\... |
0cce474d371122790a0eed70b0496586 | All platforms that have supported pattern compilers (returns Array) | [
{
"docid": "45d30ec2f54bb742bd87c542b50ede98",
"score": "0.7354511",
"text": "def pattern_compiler_platforms\n PLATFORMS.keys.sort\n end",
"title": ""
}
] | [
{
"docid": "a96da2404b0385e94de62ae52d53364d",
"score": "0.6594357",
"text": "def pattern_compiler_instances(p = platform)\n # Check if nil which means no tester is defined so ask user to supply it\n fail \"No tester platform defined so supply one of the following as an argument: #{PLATFORMS.j... |
490b6150d8c14e5431fd4f918d01cf10 | DELETE /workflow_transitions/1 DELETE /workflow_transitions/1.json | [
{
"docid": "227a6c5698c0bc7a128eb0d0dedd6a44",
"score": "0.7459197",
"text": "def destroy\n @workflow_transition.destroy\n respond_to do |format|\n flash_message(:success, \"Workflow transition was successfully deleted.\")\n format.html { redirect_to workflow_transitions_url, notice: 'Wo... | [
{
"docid": "5561230ca37d6bea8c54194f5280696a",
"score": "0.7390747",
"text": "def destroy\n @workflow.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7193b09b4683a0a6d2d3f9615adf6e4b",
"score": "0.73045194",
... |
0f8db74a65dce138291773ea5aed66b9 | Fetch all of the dashboards. | [
{
"docid": "10a39c70a7f145a022b554a44c7a7869",
"score": "0.82646966",
"text": "def get_dashboards\n @dash_service.get_dashboards\n end",
"title": ""
}
] | [
{
"docid": "f115b3629b2b5cf54bfc36cbb3be75c1",
"score": "0.7515505",
"text": "def index\n @dashboards = Dashboard.all\n end",
"title": ""
},
{
"docid": "f115b3629b2b5cf54bfc36cbb3be75c1",
"score": "0.7515505",
"text": "def index\n @dashboards = Dashboard.all\n end",
"titl... |
4dc0741452860978353cebc53647671b | :nocov: Override in your resource to filter the updatable keys | [
{
"docid": "98ef9793e75e131e77e9c6b7696a3566",
"score": "0.0",
"text": "def updatable_fields(context = nil)\n _updatable_associations | _attributes.keys - [:id]\n end",
"title": ""
}
] | [
{
"docid": "d74a1ff95a0526f4539a253a96ded0bb",
"score": "0.67212796",
"text": "def unupdatable_keys(resource)\n if resource.respond_to?(:unupdatable_keys)\n # TODO: deprecation warning about Resource#unupdatable_keys\n resource.unupdatable_keys\n else\n resource.... |
a2d1eee6ca060eb56d7d045e03f42da9 | Mark this row as consistent with the underlying database as of now | [
{
"docid": "12ad3d9b632513184995c43226687faf",
"score": "0.0",
"text": "def mark_fresh\n @expired_after = Util::timestamp\n end",
"title": ""
}
] | [
{
"docid": "73a353097c19c68f6ebd1bc976f1c1c4",
"score": "0.7109918",
"text": "def mark_dirty\n self.class.dirtied[@row_id] = Util::timestamp\n end",
"title": ""
},
{
"docid": "85806f058198201c520512f9b7369f03",
"score": "0.64000344",
"text": "def locking_column; end",
"ti... |
c8d732e39af6a39469e95a3315a6e9a3 | List check suites for a specific ref | [
{
"docid": "fa92f632bd1b80aa2ad4dc8937188197",
"score": "0.7212296",
"text": "def check_suites_for_ref(repo, ref, options = T.unsafe(nil)); end",
"title": ""
}
] | [
{
"docid": "02babdfde55464b89819aebac86eddb3",
"score": "0.85448503",
"text": "def list_check_suites_for_ref(repo, ref, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "ee0cd4eae6a306ff52d429321b1263aa",
"score": "0.8005417",
"text": "def check_suites_for_ref(repo, ref, opt... |
43dd61ed246c3bc91dbc11a0cd33c25f | Helper method to get the names of the switches connected to a specific cluster. | [
{
"docid": "e54735db816b175cad55f61d0cfa92d8",
"score": "0.5663229",
"text": "def get_clustered_nodes(cluster_name)\n cluster_name.strip!\n cluster_nodes = []\n nodes_list = cli('--quiet', 'cluster-show', 'name', cluster_name, 'format',\n 'cluster-node-1,cluster-node-2', 'no-show-headers... | [
{
"docid": "f2bb38bbfb87e520c2f22b728f1990ea",
"score": "0.6467166",
"text": "def switches\n servers.map(&:related_switches).flatten.uniq\n end",
"title": ""
},
{
"docid": "74a56b44e6933574f3cbd45de2ea154c",
"score": "0.62528265",
"text": "def related_clusters\n relate... |
4d12440726857ed63541721d63aeff1c | Returns a hash of the coordinates of this cell | [
{
"docid": "5d05bd3504bea6ff67327d88d2fce860",
"score": "0.6751305",
"text": "def coordinates\n\t\t{c: @col.to_i, r: @row.to_i}\n\tend",
"title": ""
}
] | [
{
"docid": "88c0aa910d3fc9ca29a990c80fefffa4",
"score": "0.7449326",
"text": "def hash_for_coordinates(x, y, board)\n board[(x.to_s + y.to_s).to_i]\n end",
"title": ""
},
{
"docid": "8407f9168fc0df23919dc604f7abfbf1",
"score": "0.7372027",
"text": "def hash_pos\n return (@x * ... |
69dfe3a227481865ab0e28ae24880766 | def factorial(n) if n == 0 1 else n factorial(n1) end end def factorial(number) return 1 if number == 0 number factorial(number 1) end def factorial(number) total = 1 if number == 0 1 else number.downto(2) do |n| total = total n end total end end | [
{
"docid": "1a4abca01c0f52fabd24708e19b92290",
"score": "0.8980428",
"text": "def factorial(number)\n\ttotal = 1\n\treturn 1 if number == 0\n\tnumber.downto(2) do |n|\n\t\ttotal = total * n\n\tend\n\ttotal\nend",
"title": ""
}
] | [
{
"docid": "ee87644df1c35897b24de0a5fc885289",
"score": "0.90982515",
"text": "def factorial(number)\n if number == 0\n return 1\n else\n number*factorial(number-1)\n end\n\nend",
"title": ""
},
{
"docid": "77ecca731664b8969043edc09268ce7f",
"score": "0.9074063",
"text": "def f... |
828c7b126520522b642df69088780a30 | Returns valid final_score (float) | [
{
"docid": "28fe2412b823efe2024abde38b58306f",
"score": "0.0",
"text": "def final_score_opts!(options = {})\n include_unreleased_opt = { include_unreleased: options[:include_unreleased] }\n\n score = raw_score include_unreleased_opt\n score = apply_late_penalty(score, include_unreleased_opt)\n ... | [
{
"docid": "ec3f731e24dce8db876b93ef8547bc14",
"score": "0.7192704",
"text": "def cursame_final_score\n self.course_average_old * (self.members_in_course_criteria.inject(100) { |score, criteria| score - criteria.evaluation_criterium.evaluation_percentage } / 100.0)\n end",
"title": ""
},
{
... |
5cd3b25cd67038d847ab9551d63940eb | Render the config as a YAML string | [
{
"docid": "25807598bda011a8861162aa26f45400",
"score": "0.80837613",
"text": "def render\n config = @dex_config.deep_transform_keys!(&:to_s)\n config.to_yaml\n end",
"title": ""
}
] | [
{
"docid": "91317962a8c23fd70af214dc31ac0e8f",
"score": "0.79662967",
"text": "def yaml\n @config.to_yaml\n end",
"title": ""
},
{
"docid": "a6300c1f2aa9903d2daf6e8f693cc473",
"score": "0.79439384",
"text": "def yaml\n @config.to_yaml\n end",
"title": ""
},
... |
1a9d5b6517abc2776b34b4dfa0a0614b | Make a CD image. | [
{
"docid": "6d1bdee6a5332a38e4498502d76b0511",
"score": "0.7465392",
"text": "def make_cd number\n # Create a directory of files to place on the CD.\n heading \"Gathering files for CD #{number}\"\n cd_dir = \"#{build_dir}/cd#{number}\"\n mkdir_p cd_dir\n @release_infos.each do |info|\n ... | [
{
"docid": "993bcaed90092a41340e7218f740d938",
"score": "0.7114713",
"text": "def make\n puts \"Generating image file #{@img_filename} from path #{@volume}\"\n\n if not @exclude_dirs.nil?\n puts \"WARNING: Excluding directories operation is not supported.\"\n puts... |
35f858e94b81077e42741f2c9a1a003d | Verifies that a point is inside the interval | [
{
"docid": "5727351d37ddd6db94cc8f721dae1828",
"score": "0.0",
"text": "def include?(x)\n inf <= x && x <= sup\n end",
"title": ""
}
] | [
{
"docid": "274c01009f144d20f182b399675f21b8",
"score": "0.7003796",
"text": "def falls_within?(x, y)\n x >= 0 && x < x_dimension && y >= 0 && y < y_dimension\n end",
"title": ""
},
{
"docid": "c85dfe8560e622fa9170dd5117338da9",
"score": "0.6942886",
"text": "def has_point(x, y)\... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "ac58bfc50d1dc6b2833287dc566fe97e",
"score": "0.0",
"text": "def customer_params\n params.require(:customer).permit(:l_name, :f_name, :email, :address, :city, :country, :password, :password_confirmation, :admin, :latitude, :longitude)\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... |
fb50df19f9aa13a1674390b56348c525 | GET /payments GET /payments.json | [
{
"docid": "3bf712963793715a0cb682b90d134391",
"score": "0.6215625",
"text": "def index\n if logged_in?\n @payments = Payment.all\n else\n redirect_to home_path\n end\n end",
"title": ""
}
] | [
{
"docid": "6f187e28a2876c752a34ad85a38c8a50",
"score": "0.7790198",
"text": "def show\n @payments = Payment.find(params[:id]) \n render json: @payments\n end",
"title": ""
},
{
"docid": "ec96767393645acdb451a56d9424f8e8",
"score": "0.74451065",
"text": "def index\n @paymen... |
736e78e1d4dc55e3de3f1db325323896 | Delete a relay proxy configuration by ID. | [
{
"docid": "88a1a4ef1a2d665d431fe42e6ed8fc2f",
"score": "0.72846746",
"text": "def delete_relay_proxy_config_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: RelayProxyConfigurationsApi.delete_relay_proxy_config ...'\n end\n... | [
{
"docid": "f513a04d60e7b9d27ad7c8f5f2896a1f",
"score": "0.80953765",
"text": "def delete_relay_proxy_config(id, opts = {})\n delete_relay_proxy_config_with_http_info(id, opts)\n nil\n end",
"title": ""
},
{
"docid": "8ed967bb906fe86406a56019722d896a",
"score": "0.66880476",... |
158fd9fb3af4a35b3e780c077c30418c | Creates a new RDoc::Markup::Formatter. If a formatter is given with f, use it. If we're outputting to a pager, use bs, otherwise ansi. | [
{
"docid": "1058ea5476d343b55206efdf002a9b38",
"score": "0.5540414",
"text": "def formatter(io)\n RDoc::Markup::ToRdoc.new\n end",
"title": ""
}
] | [
{
"docid": "a9acaaf903750d8e18db67cbdbeff2f9",
"score": "0.63627493",
"text": "def formatter(io)\n if @formatter_klass then\n @formatter_klass.new\n elsif paging? or !io.tty? then\n RDoc::Markup::ToBs.new\n else\n RDoc::Markup::ToAnsi.new\n end\n end",
"title": ""
},
... |
e8f44afc7691d86353895da191b7ed8d | Generates the install command variables for PowerShellbased platforms. | [
{
"docid": "4fe6ff383968fdee8eddd7b6fbc7547e",
"score": "0.7220114",
"text": "def install_command_vars_for_powershell\n d_flag = install_flags.nil? ? nil : install_flags.match(/-download_directory (\\S+)/)\n download_directory = d_flag.nil? ? \"$env:TEMP\" : d_flag[1]\n [\n ... | [
{
"docid": "b220fc911a9c41e65892a59b9afaa978",
"score": "0.6791954",
"text": "def install_command_vars_for_bourne\n flags = %w{latest true nightlies}.include?(version) ? \"\" : \"-v #{CGI.escape(version)}\"\n flags << \" \" << \"-n\" if nightlies\n flags << \" \" << \"-p\" if prerel... |
3fbb460db2b23cd0d0f043c6129f1172 | The below deals with filebased property storage. First we deal with the occurrences of individual properties. | [
{
"docid": "c626604bd4fc4807fb7644358ba7a680",
"score": "0.0",
"text": "def default_file_name\n # Avoid relative directory paths\n File.dirname(__FILE__) + \"/../../\" + \"db/properties/\" + name.file_name\n end",
"title": ""
}
] | [
{
"docid": "58ec285b5d58de7bd1aeab20daadb383",
"score": "0.63354015",
"text": "def get_properties\r\n #Assumes PropertyName=PropertyString with or without whitespace around =\r\n properties = Hash.new\r\n File.open(@filename).each_line do |s| \r\n m = REGEX.match(s)\r\n\t if m != nil\r\n\... |
a1b0f5cbbaed7820ed80a6fade8b8dbd | GET /ic_types GET /ic_types.json | [
{
"docid": "e944c27ef12cb9d05b72f9b1ac312739",
"score": "0.69631296",
"text": "def index\n @ic_types = IcType.all.order(\"name\")\n end",
"title": ""
}
] | [
{
"docid": "d83c08f38d3e155a8797fdcb78c561cb",
"score": "0.7724713",
"text": "def types\n if !@api_key.nil? and @api_key.api_type == \"muni\"\n params[:c] = \"forager\"\n end\n\n if params[:c].blank?\n cat_mask = array_to_mask([\"forager\",\"freegan\"],Type::Categories)\n else\n ... |
81aa39527c7ffefcc332b3fc97751eeb | List of valid commands this application respond to | [
{
"docid": "48fa9ffa2a414e795d33102770871523",
"score": "0.7689233",
"text": "def valid_commands\n methods.grep(/_command$/).map{|c| c.to_s.gsub(\"_command\", \"\")}\n end",
"title": ""
}
] | [
{
"docid": "c84f493901469dee6df556962fa48f52",
"score": "0.7971716",
"text": "def supported_commands\n []\n end",
"title": ""
},
{
"docid": "b6771d79448c346bd19eaec4bc3b546f",
"score": "0.77529055",
"text": "def commands\n []\n end",
"title": ""
},
{
"... |
d4685b5e212abc74aabe2632318dec4e | MES Returns the HTML to display pictures for the plan, but does NOT use a cache. It WILL update the cache if it's stale. | [
{
"docid": "1cfa9b23261da950dca147b33e8d10b0",
"score": "0.771057",
"text": "def pictures_nocache\r\n plan_id = params[:id]\r\n str = pictures_helper(plan_id)\r\n\r\n #MES- Is there a cache entry?\r\n cache_entry = @@pictures_cache[plan_id]\r\n if !cache_entry.nil?\r\n #MES- Is it st... | [
{
"docid": "7612865bbd7e2a8f97750acd21bd394b",
"score": "0.75422513",
"text": "def pictures_cached\r\n plan_id = params[:id]\r\n #MES- Can we find the pictures sidebar text in the cache?\r\n cache_entry = @@pictures_cache[plan_id]\r\n str = ''\r\n if cache_entry.nil?\r\n #MES- The pi... |
33235c75a995935bc72316310b824a39 | Set hint fields to use and return +self+. hint may be a single field name, array of field names, or a hash (preferably an OrderedHash). May be +nil+. | [
{
"docid": "e4ff4f7cbd70cbd4ba242af10d9c8f5c",
"score": "0.7551779",
"text": "def hint=(hint)\n @hint = normalize_hint_fields(hint)\n self\n end",
"title": ""
}
] | [
{
"docid": "1bcfbca8124d0766dbbbd1ea9ae94149",
"score": "0.7052713",
"text": "def hint=(hint=nil)\n @hint = prep_hint(hint)\n self\n end",
"title": ""
},
{
"docid": "7d1a3a071386176695019135ec150f26",
"score": "0.64105606",
"text": "def hint(hint)\n upgrade_to_advan... |
84a129370ca164aa8ef70e7d55f1dcef | GET /medicines/new GET /medicines/new.json | [
{
"docid": "211b0fe04270a710fbf0737d16e7fd90",
"score": "0.7301923",
"text": "def new\n @medicine = Medicine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @medicine }\n end\n end",
"title": ""
}
] | [
{
"docid": "8788f2ebc4bc6b3874187cc810fc1447",
"score": "0.7288324",
"text": "def new\n @title = \"New Medic\"\n @medic = Medic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @medic }\n end\n end",
"title": ""
},
{
"docid": "43... |
e97c6fdbb45ad1580adc0a3a86cc754b | Set the priority of the task. ==== Parameters priority:: Priority of the task. | [
{
"docid": "99eab383f085d1a39009f6be2b80d4b9",
"score": "0.80833274",
"text": "def setPriority(priority)\r\n\t\t\t\t\t@priority = priority\r\n\t\t\t\tend",
"title": ""
}
] | [
{
"docid": "87e894a9d84982a66050081926b4d588",
"score": "0.8145334",
"text": "def set_priority(priority)\n @priority = priority\n end",
"title": ""
},
{
"docid": "a21b65f79657320814c3b177a24d0e21",
"score": "0.8102282",
"text": "def priority= priority\n\t\t\t\tsend_priority(prior... |
8d578c8b91985abb688fb50355ba8986 | GET /questionary_results/1 GET /questionary_results/1.json | [
{
"docid": "bf9035a888cda810f81877b6d0e0c9a8",
"score": "0.67722416",
"text": "def show\n\t\t@questionary = Questionary.find params[:id]\n\t\t@questionary_results = QuestionaryResult.where('questionary_id = ?',params[:id])\n\tend",
"title": ""
}
] | [
{
"docid": "05b41fc23bf2ed20b300091132c12ab9",
"score": "0.69498307",
"text": "def index\n\t\tquestionId = params[:questionId];\n\n\t\tanswers = ParseManager.getAnswersForQuestion(questionId);\n\t\tresults_array = answers['results']\n\n\t\t# make the answers into integers if that is what they are\n\t\tb... |
145b5f268c0efe0720c0573209d13f2c | say bye to everybody | [
{
"docid": "5296b7e76446f45459133cabc0a2eb7d",
"score": "0.6279717",
"text": "def say_bye\n if @names.nil?\n puts \"...\"\n elsif @names.respond_to?(\"join\")\n puts \"Goodbye #{@names.join(\", \")}. Come back soon!\"\n else\n puts \"Goodbye #{@names... | [
{
"docid": "570234103192f29f2f4656ac36353fcb",
"score": "0.7776529",
"text": "def bye_message\n message = \"Panacea's work is done, enjoy!\"\n say \"\\n\\n\\e[34m#{message}\\e[0m\"\n end",
"title": ""
},
{
"docid": "a504e8aacd25af5a698d6972ed3b8d2f",
"score": "0.761695... |
b3d94459eab9994252469afa5a9fb528 | Update the NSX Manager's Network Interface Updates the specified interface properties. You cannot change the properties ip_configuration, ip_addresses, or plane. NSX Manager must have a static IP address. You must use NSX CLI to configure a controller or an edge node. | [
{
"docid": "e7bdb39ca985e9eae7d311047fd1bcc4",
"score": "0.6746803",
"text": "def update_node_interface(interface_id, node_network_interface_properties, opts = {})\n data, _status_code, _headers = update_node_interface_with_http_info(interface_id, node_network_interface_properties, opts)\n ret... | [
{
"docid": "0544417f1d08d92545de69340ba176e1",
"score": "0.70491415",
"text": "def update!(**args)\n @network_interfaces = args[:network_interfaces] if args.key?(:network_interfaces)\n end",
"title": ""
},
{
"docid": "b8756d04edc0da2fd3842577bb89c36e",
"score": "0.6853702... |
2cda51b36859df2d63a98abc95df7e07 | Convert the ITMS XML to a ruby hash | [
{
"docid": "c07d5de54b02afd022aba0e24a51237c",
"score": "0.65890235",
"text": "def to_hash\n\t\t\treturn @result unless @result.nil?\n\t\t\troot = @doc.at(@path)\n\t\t\t@result = {}\n\t\t\tparse_node(root, @result)\n\t\t\treturn @result\n\t\tend",
"title": ""
}
] | [
{
"docid": "79854bdeca677188f73f5750f179e00b",
"score": "0.81192327",
"text": "def to_hash\n Hash.from_xml(xml)\n end",
"title": ""
},
{
"docid": "08f8d18a8f608916364352f5f8ca9df5",
"score": "0.7976187",
"text": "def to_hash\n Utils.xml_to_hash xml\n end",
"ti... |
28e9f5a9d0c939e2c7664ae3cda382e5 | Returns the number data will be divided by to fit within encoding limits. | [
{
"docid": "91000015838a5c1ed55a4b9774102228",
"score": "0.58039075",
"text": "def divisor\n spread / @max_granularity.to_f\n end",
"title": ""
}
] | [
{
"docid": "fa30f055ba30538412ff4185947e57ce",
"score": "0.6439664",
"text": "def parse_data(data)\n data = Integer(data) rescue 0\n data = [0, data].max\n data = [data, 100].min\n\n (data * 655.35).to_i\nend",
"title": ""
},
{
"docid": "d49ef5972122590ed75387f3ff273426",
"score": "0... |
96a03da855b5bb340b63300fe1d03b55 | Run the block passed on initialization | [
{
"docid": "bffb3c9ac1fe967216584c8e531993a2",
"score": "0.0",
"text": "def run(context = nil)\n @backtrace = ''\n @context = context\n @error = ''\n @output = ''\n begin\n t1 = Time.now\n Dir.chdir(@working_directory) do\n @cmd.call(self)\n @stat... | [
{
"docid": "0c36d86df9802547c7686fc3bbe0de3d",
"score": "0.79954845",
"text": "def run(&block)\n return unless block_given?\n instance_eval(&block)\n setup\n end",
"title": ""
},
{
"docid": "0ad50dc708955339d0329296cc82fde0",
"score": "0.7950989",
"text": "def run_i... |
0b3fb5cf83e508795d220776a6c62660 | Returns the number of anniversaries that have passed Counts current week as anniversary passing | [
{
"docid": "8b394293066ea3d052790f8eba78ebd4",
"score": "0.5771471",
"text": "def count\n @count ||= Date.current.year - @release_date.year\n end",
"title": ""
}
] | [
{
"docid": "7ee655ea143a628e1c62d14e399b6901",
"score": "0.6739838",
"text": "def calculate_timeline_week_count\n ((@course.timeline_end.to_date - @beginning_of_first_week).to_f / 7).ceil\n end",
"title": ""
},
{
"docid": "d76d5deae2e12a9e9e3789452b31352b",
"score": "0.67338145",
... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "bfdad0f61d07e5954046a4cc513d443e",
"score": "0.0",
"text": "def deliverer_params\n params.permit(:name, :phone, :blocked)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7496205",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6957069",
"text": "def strong_params\n params.require(:request).permit(param_white... |
ef5bf5dc6ff1a6f71bb8a8934c13249b | before_action :current_user, only: [:create, :destroy] | [
{
"docid": "ea8e3671c6ba1a9daeb4f9844a1f79a2",
"score": "0.0",
"text": "def new\n @user = User.new\nend",
"title": ""
}
] | [
{
"docid": "0b044c7b0b5351466feb2ff0502f713f",
"score": "0.7421452",
"text": "def before_set_user\n end",
"title": ""
},
{
"docid": "a6e234d60e7b5c66d7f90aa63d2f2695",
"score": "0.70690763",
"text": "def current_user\n end",
"title": ""
},
{
"docid": "649bb1b82e21cf42... |
21b810858a510d923205e1ff9bcfa6b5 | GET /bookings GET /bookings.json | [
{
"docid": "35dc173f2d72dea1d5395ba16719f068",
"score": "0.0",
"text": "def index\n @bookings = Booking.all\n if params[:search]\n @bookings = Booking.search(params[:search]).order(\"created_at DESC\")\n else\n @bookings = Booking.all.order('created_at DESC')\n end\n end",
"ti... | [
{
"docid": "ac8355d07e1353ac36659b08db8f2002",
"score": "0.8231102",
"text": "def index\n @bookings = Booking.all\n\n render json: @bookings\n end",
"title": ""
},
{
"docid": "d65ce9f0532219b10f9792ac07754e3b",
"score": "0.80220497",
"text": "def index\n @bookings = Booking... |
56aa26920688624109dea9bc0944a6c2 | Takes in a column or array of column names, and returns a proc ready to be used by this class. Columns can contain either symbols, strings, or directly an Arel::Node, allowing you to reference joined tables as well. | [
{
"docid": "58a4a6f648f11f964e15476283696bfa",
"score": "0.0",
"text": "def resources_filter_matches(columns)\n return lambda do |v|\n conditions = Array.wrap(columns).reduce(nil) do |acc, column|\n column = arel_table[column] unless column.is_a?(Arel::Attributes::Attribute)\n... | [
{
"docid": "fe5e86a71bd30b8c2e70e8b70097b20c",
"score": "0.5595898",
"text": "def assoc_and_assoc_method_for_column(c)\n assoc_name, assoc_method = c[:name].split('__')\n assoc = data_class.reflect_on_association(assoc_name.to_sym) if assoc_method\n [assoc, assoc_method]\n end"... |
9319cf4ee4ecf2abb7f0be94033cb1ed | Returns the number of bytes equivalent to the petabytes provided. 2.petabytes => 2_251_799_813_685_248 source://activesupport//lib/active_support/core_ext/numeric/bytes.rb54 | [
{
"docid": "6980af180368519363e7312f3b904002",
"score": "0.73932177",
"text": "def petabytes; end",
"title": ""
}
] | [
{
"docid": "54f40877bd5323f230bb1028c0310ed3",
"score": "0.7476932",
"text": "def petabytes\n\t\t\t\treturn self * 1024.terabytes\n\t\t\tend",
"title": ""
},
{
"docid": "54f40877bd5323f230bb1028c0310ed3",
"score": "0.7476932",
"text": "def petabytes\n\t\t\t\treturn self * 1024.teraby... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "ed5d015684f1d8c90f7b09cc768f473e",
"score": "0.0",
"text": "def artshow_artwork_params\n params.require(:artshow_artwork).permit(:artshow_id, :artwork_id)\n end",
"title": ""
}
] | [
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.7121987",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.70541996",
"text": "def expected_permitted_parameter_names; end",
"title": "... |
2219b18fad1f7d21758adf64adcbfd09 | calculate events for current month based on past numbers | [
{
"docid": "bb0681954926b31a3b2a5034ef135878",
"score": "0.6911032",
"text": "def get_events_current_month\n row = get_events_previous_month\n\n { year: today.year,\n month: today.month,\n pdf: pdf - row.fetch(:pdf),\n html: html - row.fetch(:html),\n readers: readers - row.fet... | [
{
"docid": "d303d432b1a5aa76f1f184a88c688260",
"score": "0.6442188",
"text": "def events_including_surrounding_months(year, month)\n events = all_events\n\n # Handle the previous month being in a previous year\n prev_month = month - 1\n prev_year = year\n if prev_month == 0\n prev_month = 12\n ... |
b88b71163581ec0a17b3453575ce5df1 | R Read Methods GET /artwork | [
{
"docid": "33e75613bef3f98e3e9b25c6c3961040",
"score": "0.0",
"text": "def index\n @images = Artwork.paginate(page: params[:page], per_page: 12)\n end",
"title": ""
}
] | [
{
"docid": "4eff549c2e70c3a15a56b4136585be62",
"score": "0.6695093",
"text": "def show\n render json: @artwork\n end",
"title": ""
},
{
"docid": "c779bfe18e24ccdab4102b37c89e778f",
"score": "0.6542919",
"text": "def show\n respond_to do |format|\n format.html # show.html.... |
81827ccf5ff7c67e87cb2ca004e2a9db | Unsubscribe for a category | [
{
"docid": "8fac8aa3541a864e69a4c40fb1bac836",
"score": "0.87275445",
"text": "def unsubscribe_from_category category\n delete(\"/categories/#{category}\", code: 204)\n end",
"title": ""
}
] | [
{
"docid": "cdb14567173f665d6be4d40bb38459e3",
"score": "0.7197974",
"text": "def unsubscribe\n end",
"title": ""
},
{
"docid": "c3f641c848b190cbc8e3ac04ae4e42fa",
"score": "0.7106765",
"text": "def unsubscribe; end",
"title": ""
},
{
"docid": "9659341d5b9b799e9292c2... |
2fcaa88c3983652fde00f02721805e86 | aPosition is the position of the token in the input stream. | [
{
"docid": "12e24d37627692b84fb623d6c9ba5e64",
"score": "0.61802924",
"text": "def initialize(aToken, aPosition)\n range = { low: aPosition, high: aPosition + 1 }\n super(range)\n @token = aToken\n end",
"title": ""
}
] | [
{
"docid": "48d2d04867fc5bee7cc11384a97166c0",
"score": "0.6635104",
"text": "def token_pos byte_offset # :nodoc:\n [byte_offset - @line_pos, @line]\n end",
"title": ""
},
{
"docid": "0d504a8775ab1848939deacce251ae2c",
"score": "0.6439664",
"text": "def token_at\n tokens[@pos]... |
485bc81d6e8ecb4fcb92f61012c6aae6 | Adds a cellperrowoffset filter instance to skip the first N cells. Skips the first N cells of each row, matching all subsequent cells. If duplicate cells are present, as is possible when using an Interleave, each copy of the cell is counted separately. | [
{
"docid": "2a4396c02d496b26f4a81d0898d74025",
"score": "0.6865967",
"text": "def cells_per_row_offset offset\n add RowFilter.cells_per_row_offset(offset)\n end",
"title": ""
}
] | [
{
"docid": "3d4bbd126d6eb79390000c70f1d14e4b",
"score": "0.5390951",
"text": "def apply(row, offset)\n row.hidden = @filter.apply(row.cells[offset + col_id.to_i])\n end",
"title": ""
},
{
"docid": "8298db51e9e21d11106dd64cdeb1aeb4",
"score": "0.538401",
"text": "def skip(n, &... |
7a8566a80e82300b5a3a13d3a79def86 | Ratings, Stars, Trustometers to be used in place of fullgranularity trustometer in widgets & emails and anywhere else where our CSS tricks are liable not to work. Options: :size in [:small, :large] :color in [:green] | [
{
"docid": "b52f5cc9a40996405e0f66a6a037687d",
"score": "0.6092317",
"text": "def static_trustometer_img(rating, options={})\n img_path = [(options[:absolute_path] ? home_url : \"\")]\n img_path << \"images/trustometer\"\n img_path << (options[:size] || :small).to_s\n img_path << options[:co... | [
{
"docid": "2f5988f7b55efd077c223874bfaadcac",
"score": "0.67328274",
"text": "def get_rating_class wFlg=true\r\n wFlg ? 'tiny-black' : 'tiny-white'\r\n end",
"title": ""
},
{
"docid": "50040c99f60b6e295f2f9766596b3d37",
"score": "0.6664324",
"text": "def add_ratings\r\n add_r... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "c523df4ecf02ecdc70e5ce5cf4b147b3",
"score": "0.0",
"text": "def project_params\n params.require(:project).permit(:approvedpropose, :status, :name, :description, :end, :subcategory_id, :category_id, :dependency_id, :has_dependency, :industry_id, :visibility, :mincost, :maxcost, proposes_... | [
{
"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... |
828cee8895eb03f0c61a8ee201f2e511 | this is represented as an array of integers where each integer represents an individual sock large pile of socks that need to be matched, think laundry day.. ugghg that sucks ok....fine, I'll pair the sucks the result should be a count of how many pairs of matching socks there are. each sock is unique and can only be u... | [
{
"docid": "cea81175f5c9401fbed175d0ff46e67b",
"score": "0.7902284",
"text": "def sockMerchant(n, ar)\n pair_value = 2\n\n unless (n.between?(1, 100))\n puts 'number of socks must be between 1 and 100'\n return 0\n end\n\n color_counts = {}\n pairs_count = 0\n\n ar.each do |color|\n if (c... | [
{
"docid": "6690008f53cb58d60b55e7629a5b5746",
"score": "0.8192401",
"text": "def sockMerchant(n, ar)\n group_by_color = Hash.new(0)\n for i in 0...n do\n group_by_color[ar[i]] += 1\n end\n matching_pairs = 0\n\n group_by_color.each do |sock_color, quantity|\n if quantity.even?\n matchi... |
f49cb4eb911774e37763771adb1c5342 | Runner method Pass an array of projectsids to run the script | [
{
"docid": "f1b4babf708c14801d0e87504edb788a",
"score": "0.7476442",
"text": "def runner(project_ids)\n\tproject_ids.each do |project|\n\t\tcolumns = get_columns(project)\n\t\ttasks_cf_values = get_tasks_with_cf_values(project)\n\t\tmove_tasks_to_correct_column(project, columns, tasks_cf_values)\n\tend\... | [
{
"docid": "cab74c2ff44ba7bb425c5b3f583ec9f2",
"score": "0.64151406",
"text": "def projects(project_ids)\n project_ids.map do |project_id|\n Project.new(@db, project_id)\n end\n end",
"title": ""
},
{
"docid": "62623fc11af4fdd7ff28bec95ebbe0fb",
"score": "0.6041503",
"tex... |
1d3fda71cbc7bd82af990d87c29fdcb4 | Arguments passed to the docker command when attempting to run domain Useful for setting environment variables etc. | [
{
"docid": "244b966f8f71cf771dcf1cd6c2bc1dff",
"score": "0.6789972",
"text": "def docker_run_args\n @docker_run_args ||= []\n end",
"title": ""
}
] | [
{
"docid": "4d1dc1194969e8d68ebc21e7c0eff524",
"score": "0.6881252",
"text": "def docker_run_args(args)\n @platform.docker_run_args = Array(args)\n end",
"title": ""
},
{
"docid": "9660099c3e4d7b5129860ba41761c8a1",
"score": "0.6655338",
"text": "def fill_cmd_with_docker_... |
198918a4c6596423acc015060569d8ce | make sure that we have a rspecconformant dir structure | [
{
"docid": "4140793650f62bd970cd1d605abb3be8",
"score": "0.73717946",
"text": "def ensure_directory_structure\n ensure_directory @target_dir\n ensure_directory File.join(@target_dir, 'spec')\n ensure_directory File.join(@target_dir, 'spec', 'localhost')\n end",
"title": ""
}
] | [
{
"docid": "11872953eb335ead3054e609fe1c3f63",
"score": "0.7102052",
"text": "def falls_in_test_dir?; end",
"title": ""
},
{
"docid": "679df783bf08e32a59ef5f3b523f60f7",
"score": "0.70937794",
"text": "def spec_dirs; end",
"title": ""
},
{
"docid": "b966faf8aaa0e74f72f237... |
893c343d7409dc8e52926e85bc07f310 | DELETE /tags/1 DELETE /tags/1.xml | [
{
"docid": "5e7253ddb95181db60572d53d3d3cc62",
"score": "0.6845405",
"text": "def destroy\n @asset = Asset.find(params[:asset_id])\n @tag = @asset.tags.find(params[:id])\n @tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(asset_manager_asset_tags_path(@asset)) }\n ... | [
{
"docid": "f3556d6972f6f78f70303c500860537f",
"score": "0.7707949",
"text": "def delete_tag tag\n delete \"tag/#{tag}\"\n end",
"title": ""
},
{
"docid": "1d0f454d6a55395a395c0811635a7247",
"score": "0.75072724",
"text": "def delete\n @tag = Tag.find(params[:id])\n @tag.de... |
444c0c0ec9860d073789d5fdaaaa85b5 | given an XML.parse output from the peptide block, extract peptide sequence | [
{
"docid": "78986be1ed9a0886e240677a10be373c",
"score": "0.7540874",
"text": "def get_peptide_sequence(pnode)\n plst = pnode.xpath('.//PeptideSequence')\n id = pnode['id']\n seq = plst[0].content\n end",
"title": ""
}
] | [
{
"docid": "48bae543a49fd60a50218f10992edf67",
"score": "0.5842885",
"text": "def get_peptide_coordinates_from_transcript_info(prot_seq,pep_seq,protein_info,gene_seq)\n # if ( peptide_is_in_sixframe(pep_seq,gene_seq))\n # Peptide is in 6-frame but on a predicted transcript\n # return nil\n # els... |
30bb5460285b45439d08ee0392f5071e | Provide fixture path as same way as rspecrails | [
{
"docid": "81ff22dccab8896fed3fd116ab5fe59e",
"score": "0.8702197",
"text": "def fixture_path\n FIXTURE_PATH\n end",
"title": ""
}
] | [
{
"docid": "062a61315672e19c9544226b55deb5c0",
"score": "0.8798399",
"text": "def fixture_path\n File.expand_path('fixtures', 'spec')\n end",
"title": ""
},
{
"docid": "0f31dca09170b5fac6dab318588937a7",
"score": "0.860299",
"text": "def fixture_path\n File.join File.dirname(_... |
a76d6cf9cd21828f8eab6b8d46f8e2f7 | loop through data structure until values match | [
{
"docid": "b15c7f2b6186ba50ddcf64e30f67083f",
"score": "0.0",
"text": "def list_contains?(value)\n 1.upto(@nodes - 2) do |index|\n return true if node_at_index(index).value == value\n end\n false\n end",
"title": ""
}
] | [
{
"docid": "51857d84628f828cffd1cb8fc94d4d94",
"score": "0.587629",
"text": "def validate_each(list, data)\n current = list.head\n i = 0\n expected_data = true\n while current\n expected_data &= current.data == data[i]\n current = current.next\n i += 1\n end\n expected_d... |
4e04eac9295dceb21925effdcd108018 | creates staff members based on the specified roles and required staff members | [
{
"docid": "c99597f73fa779549a72510682279288",
"score": "0.77642983",
"text": "def create_staff_for_education_organization(roles, required)\n members = []\n if !required.nil? and required.size > 0\n required[\"staff\"].each do |member|\n # skip this entry if its an Educator --> handled... | [
{
"docid": "6aaa406616b5fefd7321c0cd8f546208",
"score": "0.67973566",
"text": "def create\n @user = User.new(user_params)\n\n if roles = params[:user][:roles]\n roles.map { |r| r.downcase }.each do |role|\n unless role.empty?\n @user.roles << Role.new(type: role)\n\n ... |
a28e478681ac9d29c5dd796aa824781d | PATCH/PUT /users/1 PATCH/PUT /users/1.json | [
{
"docid": "ef45a01cd082aa9f58a7cd85bd6f8937",
"score": "0.0",
"text": "def update\n @user.update(user_params)\n respond_with( [ :admin, @user] )\n end",
"title": ""
}
] | [
{
"docid": "23a904e6ddd4b6b07c4b53353e78cf93",
"score": "0.7225568",
"text": "def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end",
"title": ""
},
{
"docid": "4781fa7337315133553edb54194e6202",
"score": "0.7129473",
"text": "def update\n render json: ... |
8e2d02f5b1aa8ca133bab8d6a2096bc6 | Updates the moving to database. | [
{
"docid": "f662ea949c9d99eb18b5b29cefb10609",
"score": "0.0",
"text": "def update\n if @moving.update(moving_params)\n unless @moving.save_rooms(params[:moving][:rooms])\n flash[:warning] = \"Couldn't save rooms\"\n end\n flash[:success] = \"Moving updated\"\n redirect_to ... | [
{
"docid": "2ae830abc42b817a7ef7e9b013b102b8",
"score": "0.64260346",
"text": "def update\n push_to_db\n end",
"title": ""
},
{
"docid": "2ae830abc42b817a7ef7e9b013b102b8",
"score": "0.64260346",
"text": "def update\n push_to_db\n end",
"title": ""
},
{
"docid": "... |
c78207460073c07ef1878b4ee5fd76f3 | This method can be used for adding options to the URL string, such as geocoding coordinate system options, response language, result count etc. | [
{
"docid": "74f9300e56aba62bf1c1c1eae05b4072",
"score": "0.0",
"text": "def capacity_remaining\n query = {'request' =>'stats'}\n perform_query(query)\n end",
"title": ""
}
] | [
{
"docid": "6a1421fc770cd5ed5f93164e52e6c283",
"score": "0.6753078",
"text": "def query_string(options); end",
"title": ""
},
{
"docid": "45b5ceb4003c81ab05f14dafae572649",
"score": "0.6600454",
"text": "def url_options; end",
"title": ""
},
{
"docid": "febfd616dc5d4f810c... |
8feaa084a9e77ef1781ec21ea9e6ac48 | DELETE /product_details/1 DELETE /product_details/1.json | [
{
"docid": "d9a307993339594513a452e76a70eac7",
"score": "0.77303135",
"text": "def destroy\n @product_detail = ProductDetail.find(params[:id])\n @product_detail.destroy\n\n respond_to do |format|\n format.html { head :ok }\n format.json { head :ok }\n end\n end",
"title": ""
... | [
{
"docid": "1e245299a5d4ade88a8857336ef1fcbc",
"score": "0.7722026",
"text": "def destroy\n @product_detail = ProductDetail.find(params[:id])\n @product_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to product_details_url }\n format.json { head :ok }\n end\n e... |
888976274adff607049349e0fdbfc171 | DELETE /revisions/1 DELETE /revisions/1.json | [
{
"docid": "462ea9b3b30450bc1ba63319f7b7f7c3",
"score": "0.7649946",
"text": "def destroy\n @revision = Revision.find(params[:id])\n @revision.destroy\n\n respond_to do |format|\n format.html { redirect_to @revision.page }\n format.json { head :no_content }\n end\n end",
"titl... | [
{
"docid": "55db1baa5a5888626497de948a2a9669",
"score": "0.76263416",
"text": "def destroy\n @revision = Revision.find(params[:id])\n @revision.destroy\n\n respond_to do |format|\n format.html { redirect_to(revisions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
... |
1443c264f19257c3b955031b4fe50531 | Convert an image of text into a binary (light and dark) view with ML Perform an advanced adaptive, Deep Learningbased binarization algorithm on the input image to prepare it for further OCR operations. Provides enhanced accuracy than adaptive binarization. Image will be upsampled to 300 DPI if it has a DPI below 300. | [
{
"docid": "076daeb6a76c94cb4003296012b68460",
"score": "0.5202608",
"text": "def preprocessing_binarize_advanced(image_file, opts = {})\n data, _status_code, _headers = preprocessing_binarize_advanced_with_http_info(image_file, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "031219e95533a1a744302293e0959052",
"score": "0.625005",
"text": "def recognize(image)\n # quantize to two-color\n image = quantize_image(image)\n\n # the binary string we expect to see from the output nodes\n assign_inputs image\n\n calculate_hidden_outputs\n ca... |
c2cf38fc1517b04f7ad627f4d95ffaf8 | Play all notes in the pattern in order, opening and closing the MIDI connection around the actual playback. | [
{
"docid": "4d5d9f9643655a24c9c9137861cc695d",
"score": "0.6825658",
"text": "def play\n puts \"Playing pattern #{name} at #{bpm}\"\n open! && play! && close!\n end",
"title": ""
}
] | [
{
"docid": "15ae4c7dffa75d75fa9a8b0df2ee1903",
"score": "0.6905937",
"text": "def play\n puts \"Playing sequence #{name} at #{bpm}\"\n threads = _patterns.map do |pattern|\n Thread.new do\n pattern.play\n end\n end\n threads.all?(&:join)\n end",
"title":... |
de483aa4dc0e9bc6be375680652c0c66 | see how often this word appears before punctuation (period, question mark, exclamation point) | [
{
"docid": "85cb0b1f871360bd7a0f43120c94f667",
"score": "0.6500737",
"text": "def punctuation\n punctuation_factor = Wordnik.get(\"/word.json/#{URI.escape(self.wordstring)}/punctuationFactor\", {:headers => self.client.api_headers})\n return punctuation_factor\n end",
"title": ""
}
] | [
{
"docid": "30c856fe215d7bd2ac797ae9c779d3da",
"score": "0.7142675",
"text": "def count_sentences\n chars = self.chars\n punct = ['.','?','!']\n count = 0\n last_char_was_punct = false\n print self\n chars.each{|char|\n print char\n #use intersection to see if punctuation exi... |
992d936e43a41b66c44ac82d0272beda | Returns a list of patients who visited the ART clinic on given day. | [
{
"docid": "322a23ba69c18236763de60c5ec674e8",
"score": "0.6866215",
"text": "def find_visiting_patients(date)\n day_start, day_end = TimeUtils.day_bounds(date)\n query = <<~SQL\n SELECT patient.* FROM patient INNER JOIN encounter USING (patient_id)\n WHERE encounter.encounter_datetime ... | [
{
"docid": "1f754325adaaf10d2aa9ad39954cc6d9",
"score": "0.6817285",
"text": "def find_visiting_patients(date)\n day_start, day_end = TimeUtils.day_bounds(date)\n Patient.find_by_sql(\n [\n 'SELECT patient.* FROM patient INNER JOIN encounter USING (patient_id)\n WHERE encounter... |
dd189b5a1953a9d008176b06d3595e6f | Sets the hyperlink_base property of your app.xml file | [
{
"docid": "f5db7ecfe8ff25946770507d4990f25d",
"score": "0.6623652",
"text": "def hyperlink_base=(v) Axlsx.validate_string v; @hyperlink_base = v; end",
"title": ""
}
] | [
{
"docid": "5b81ea1eb472636655da12b517cf05fe",
"score": "0.75419074",
"text": "def hyperlink_base=(v)\n Axlsx.validate_string v\n @hyperlink_base = v\n end",
"title": ""
},
{
"docid": "9bd210659bda2fdfafaac42bd3531abd",
"score": "0.66636974",
"text": "def set_base_url\n ... |
098a617285b9dbce9719ac17ea673803 | PUT /ins_co_offices/1 PUT /ins_co_offices/1.xml | [
{
"docid": "e90380ac4d1b5ea2a6cd84b3d1abe1c7",
"score": "0.64627606",
"text": "def update\n @ins_co_office = InsCoOffice.find(params[:id])\n\n respond_to do |format|\n if @ins_co_office.update_attributes(params[:ins_co_office])\n format.html { redirect_to(@ins_co_office, :notice => 'Of... | [
{
"docid": "b2109af222bc2e1b338fedf7fe0d5c96",
"score": "0.61209834",
"text": "def update\n @office.update(office_params)\n head :no_content\n end",
"title": ""
},
{
"docid": "774767c58835ea8105482d79594197a6",
"score": "0.58853495",
"text": "def update\n @office = Office.f... |
97c506cc5f3c2b1b3a30a9135ab5b6a0 | PUT /vehicles/1 PUT /vehicles/1.json | [
{
"docid": "becbbd7ebb3a92fe126bb62ff3e7f7fb",
"score": "0.68643814",
"text": "def update\n @vehicle = vehicle_type.find(params[:id])\n\n respond_to do |format|\n if @vehicle.update_attributes(params[:vehicle])\n format.html { redirect_to @vehicle, notice: 'Vehicle was successfully upd... | [
{
"docid": "1966a5c6f74935953d81611828d84e12",
"score": "0.77409285",
"text": "def update\n update_resource @vehicle, vehicle_params\n end",
"title": ""
},
{
"docid": "14fe57908f6a9ed77867e4615c29e813",
"score": "0.7529792",
"text": "def update\n if @vehicle.update(vehicle_par... |
a19bf5a34ed34739f2aac5ee8abdfe56 | provide a string representation | [
{
"docid": "3095b143538aa061097b1e0790a3ac83",
"score": "0.0",
"text": "def to_s\n \"A #{@price.to_f} #{@model} weighing #{@weight.to_f} #{@weightscale}\"\n end",
"title": ""
}
] | [
{
"docid": "261e99bc26f16e3740139586062394ef",
"score": "0.80312616",
"text": "def to_s() end",
"title": ""
},
{
"docid": "8b1fb58f6afe0db985d2335dcf091a8f",
"score": "0.79176575",
"text": "def to_s(*) end",
"title": ""
},
{
"docid": "8b1fb58f6afe0db985d2335dcf091a8f",
... |
2f86e4185963f79dcbdb3c95c1655698 | Helper method for has_many collection editing | [
{
"docid": "75a1ec172b99405d60102edefb95308b",
"score": "0.0",
"text": "def update_has_many_collection(model, many_collection, ids_to_keep_or_add = [])\n many_klass = Object.const_get(many_collection.singularize.classify)\n elements_to_add = []\n elements_to_remove = []\n existing_element... | [
{
"docid": "8799dd0d00311e7d6db9e5bf2e1e32f2",
"score": "0.7013129",
"text": "def edit\n @previously_associated_collections = get_all_collection_associations\n\n add_breadcrumb 'Edit', send(\"edit_#{lower_resource_name}_collection_association_path\", resource_id)\n\n super\n end",
"title":... |
f171718e73a259db93caf21e69e1b038 | Sets the attribute method_name | [
{
"docid": "10becba3364b881dd72b1f26c66b4cdc",
"score": "0.6857567",
"text": "def method_name=(_); end",
"title": ""
}
] | [
{
"docid": "ce5ee0a76e421278b01096c93fecf547",
"score": "0.7594925",
"text": "def []=(method,value)\n @attributes[method] = value\n end",
"title": ""
},
{
"docid": "08bd7ec606c9a70c18df4110b1cf4dc2",
"score": "0.7563377",
"text": "def attribute_set(method,value)\n @attri... |
2c346b2562a97046fe07ef7b02acaa49 | POST /accounts POST /accounts.json | [
{
"docid": "1f650022c9985c20f3541eb8fc1e3cd5",
"score": "0.0",
"text": "def create\n @account = Account.new(account_params)\n @atm_no = params[:atm_no] \n respond_to do |format|\n if @account.save\n format.html { redirect_to atm_mach_path(session[:atm_no])}\n format.json { re... | [
{
"docid": "bd14ea4cc268f9280dc031bb071699b7",
"score": "0.77059096",
"text": "def create\n megam_rest.post_accounts(to_hash)\n end",
"title": ""
},
{
"docid": "537f9e258a43e3d1eb8a90185aa4861e",
"score": "0.74428105",
"text": "def post_accounts(json_hash)\n @options = {... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "838bb988e99537a838c6176b22dd980c",
"score": "0.0",
"text": "def update!(**args)\n @discovery_version = args[:discovery_version] unless args[:discovery_version].nil?\n @items = args[:items] unless args[:items].nil?\n @kind = args[:kind] unless args[:kind].nil?\n ... | [
{
"docid": "184b1b1ed771473d3eb9f338c0734c38",
"score": "0.730762",
"text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end",
"title": ""
},
{
"docid": "5076c5a88404ae72986f958710f5687a",
"score": "0.7263234",
"text": "def update(pr... |
f9e333fb4844acdfa27142fbb96bd0b4 | POST /agent_schedules POST /agent_schedules.json | [
{
"docid": "75a12ac56d269b71352e0bc4ce21fa23",
"score": "0.7404929",
"text": "def create\n @agent_schedule = AgentSchedule.new(agent_schedule_params)\n\n respond_to do |format|\n if @agent_schedule.save\n format.html { redirect_to @agent_schedule, notice: 'Agent schedule was successful... | [
{
"docid": "0f58f81267c169f24c31f9f0c4f60b2b",
"score": "0.6933773",
"text": "def schedule\n POST \"https://www.googleapis.com/calendar/v3/calendars/#{calendar_id}/events\"\n render \"schedule\"\n end",
"title": ""
},
{
"docid": "99e2aae847c84061b0ec8596f9476989",
"score": "0.6865... |
280d8275cdb6f344c0158f997a1e2b46 | GET /elections GET /elections.json | [
{
"docid": "836681029704f24ba655ed336824ec2c",
"score": "0.7779885",
"text": "def index\n @elections = Election.all\n end",
"title": ""
}
] | [
{
"docid": "a55f5779db7376e3fc401655a520482c",
"score": "0.83303815",
"text": "def elections(options={})\n get(\"elections\", options)\n end",
"title": ""
},
{
"docid": "8b629a9dfa024ea63a7056ed18ae4f4d",
"score": "0.8183232",
"text": "def index\n\t @elections = Election.all... |
42206cf0d07d9fae99089af81ad116ef | Stops execution of the function and returns a specific ResultObject, aggregate functions will most likely override this but this is the simplest case so we might as well default to that | [
{
"docid": "26b78d9579f0cc45fbaaba41af06d5b9",
"score": "0.0",
"text": "def summarize\n raise \"Result type is not set while trying to summarize aggregate function results\" unless @result[:type]\n\n result_class(@result[:type]).new(@result, @aggregate_format, @action)\n end",
"ti... | [
{
"docid": "ffaa7849ed6480c51d9a7d85c676e4d0",
"score": "0.67502844",
"text": "def abandon_results!()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "deb6f7b0e3dbe7c651a41232c64393a0",
"score": "0.6674413",
"text": "def discard_results\n\t\t\... |
fb8cc3f31a672dad9b6680feaa98fad5 | Indicates whether the renderer handles animations or not. false indicates that slides should not be repeated. | [
{
"docid": "e028c812094b47955ee0743d5490e5b7",
"score": "0.81166065",
"text": "def handles_animation?\n false\n end",
"title": ""
}
] | [
{
"docid": "3c713edab9190988643f116244f580d1",
"score": "0.8098107",
"text": "def handles_animation?\n true\n end",
"title": ""
},
{
"docid": "71945685275975e97b25bf974dadc68b",
"score": "0.7613172",
"text": "def animated?\n !@animation.nil?\n end",
"title": ""
... |
819d3120df12620031e07a75af3817c4 | Returns if the user is signed in | [
{
"docid": "cce0389a656adb06007cc0be0bcea1c6",
"score": "0.0",
"text": "def signed_in?\n !current_user.nil?\n end",
"title": ""
}
] | [
{
"docid": "b68f01b7f77e7dc83959e811d0b9d2ec",
"score": "0.88366055",
"text": "def user_signed_in?\n session[:logged_in].eql?(true) ? true : false\n end",
"title": ""
},
{
"docid": "0549459726a283daa290f47bcf2d41b9",
"score": "0.87586844",
"text": "def user_signed_in?\n\t\t... |
4c03395f8e65e20b5c2108cf69f2b771 | PATCH/PUT /appissues/1 PATCH/PUT /appissues/1.json | [
{
"docid": "e29b1f1273f7d3e0f9ef244c89e8c57a",
"score": "0.7068831",
"text": "def update\n respond_to do |format|\n if @appissue.update(appissue_params)\n format.html { redirect_to @appissue, notice: 'Appissue was successfully updated.' }\n format.json { render :show, status: :ok, ... | [
{
"docid": "dba90e0f1b27bffd486f82b8fca9df4d",
"score": "0.6476491",
"text": "def update!(**args)\n @issues = args[:issues] if args.key?(:issues)\n end",
"title": ""
},
{
"docid": "3a85b2709afa93136f366b7e9b4f59d1",
"score": "0.647034",
"text": "def update\n respon... |
fababea1c3f75b9973295f6ea3792896 | POST /productquantities POST /productquantities.json | [
{
"docid": "e40ea755bcd637ed8d36e635ee134859",
"score": "0.59102243",
"text": "def create\n @productquantity = Productquantity.new(params[:productquantity])\n\n respond_to do |format|\n if @productquantity.save\n format.html { redirect_to @productquantity, notice: 'Productquantity was ... | [
{
"docid": "605613471bbeaa11baa251d11671677b",
"score": "0.64156216",
"text": "def set_product_quantities(quantities)\n quantities.each_pair do |product_id, quantity|\n quantity = quantity.to_i\n if quantity < 1\n BasketItem.where(basket_id: id, product_id: product_id).destroy_all\n ... |
92b9a23aa78ba949c43b15bd3fbf3150 | Gets or sets the listener action. When this changes, does not update alreadycreated listeners' actions. | [
{
"docid": "5a67bde7b357eefbcecd1509841aa581",
"score": "0.64922816",
"text": "def action(&replacement_action)\n if replacement_action\n @action = replacement_action\n else\n @action\n end\n end",
"title": ""
}
] | [
{
"docid": "bb9bef6aedaae38b9d69c908eebe692c",
"score": "0.651497",
"text": "def setAction(action)\n @action = action\n end",
"title": ""
},
{
"docid": "555b864012300f0f1632b8e2ca0c9c96",
"score": "0.6433214",
"text": "def set_action(action)\n @action = action\n end",
"ti... |
cb45d1a73dc885a64e52694d2ebbab40 | Get last event id for a given event types. | [
{
"docid": "5e7338d514c8356b10b1eb92f16dbce7",
"score": "0.8526253",
"text": "def latest_event_id(event_types: nil)\n latest_event = events_table\n latest_event = latest_event.where(type: event_types) if event_types\n latest_event = latest_event.order(:id).last\n if latest_ev... | [
{
"docid": "92debebe066453d01e5de3d7faed69ee",
"score": "0.6865631",
"text": "def get_event_type_id\n event_type ? event_type.id : 0\n end",
"title": ""
},
{
"docid": "f7feadb226d9a222211dc0a3260786f6",
"score": "0.62210387",
"text": "def next_event_index event_type\n\n es =... |
7be0e2235630873f395ca3e7b2d6e1e0 | Initializes an instance of an auxiliary module that uses LLMNR | [
{
"docid": "a931a81c7b59d381a6b863507925c378",
"score": "0.0",
"text": "def initialize(info = {})\n super\n register_options(\n [\n OptAddressRange.new('RHOSTS', [true, 'The multicast address or CIDR range of targets to query', '224.0.0.252']),\n Opt::RPORT(5355),\n ... | [
{
"docid": "3fd5b269fa9ba7e44a8f34dfeeeab9c4",
"score": "0.65378404",
"text": "def mpt_init; end",
"title": ""
},
{
"docid": "9dbdba1cc82af00980f2478d92a8e0bd",
"score": "0.6422654",
"text": "def mpt_init=(_arg0); end",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af... |
72e2d66dfed1122f84512f3a47c8dbcb | installs a SAPNW::RFC::FunctionDescriptor object, and optionally associates this with a particular SysId. | [
{
"docid": "0ff89fbf375bb77f4b9d3406c7a9fbcd",
"score": "0.8374303",
"text": "def installFunction(*args)\n\t\t\t args = args.first if args.class == Array and args.first.class == Hash\n\t\t\t\tcase args\n\t\t\t\t when Hash\n\t\t\t\t raise \"Must pass an instance of SAPNW::RFC::FunctionDescriptor to ... | [
{
"docid": "a4cb552100d9190a4086513121b3fdbf",
"score": "0.5293182",
"text": "def install_chef_gem(nr)\n # let chef_gem install the gem for us\n at_compile_time do\n chef_gem nr.gem_name do\n %w(options version source).each do |attr|\n value = new_resource.... |
5a7e1b1aa89e97d06650dfcdb55ca1c3 | Create or Update communication map Create or Update the communication map for a domain. This is a full replace. All the CommunicationEntries are replaced. This API is deprecated. Please use the following API instead. PUT /infra/domains/domainid/securitypolicies/securitypolicyid | [
{
"docid": "98caba3767b412119c025c6058d8162e",
"score": "0.562007",
"text": "def update_communication_map_for_domain_0_with_http_info(domain_id, communication_map_id, communication_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurit... | [
{
"docid": "0fa1b6c8fa31ad8c6861486e9a8b16e7",
"score": "0.58587813",
"text": "def patch_security_policy_for_domain(domain_id, security_policy_id, security_policy, opts = {})\n patch_security_policy_for_domain_with_http_info(domain_id, security_policy_id, security_policy, opts)\n nil\n end"... |
23b856718ac05b440ef295879e8969fa | POST /favorite_quotes POST /favorite_quotes.json | [
{
"docid": "d7fb665225c0f114676e0716a530b5ea",
"score": "0.760315",
"text": "def create\n @favorite_quotes = FavoriteQuotes.new(favorite_quote_params)\n\n respond_to do |format|\n if @favorite_quotes.save\n format.html { redirect_to @favorite_quote, notice: 'Favorite quote was successf... | [
{
"docid": "f710efa7b3e3863649c03fa4150c86b9",
"score": "0.6770589",
"text": "def favorite_quote_params\n params.require(:favorite_quote).permit(:quote_id, :user_id)\n end",
"title": ""
},
{
"docid": "901734ec56d0a3932b9cf9c9b7acdcd3",
"score": "0.674791",
"text": "def create... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "6721ee8c8fc7c68d7db5fd0ca8a5f826",
"score": "0.0",
"text": "def set_product\n @product = Product.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;... |