query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
6037f605e604853762efad4b07728f2e | The path to the `split` program. | [
{
"docid": "f4cb663ee20867f2f033c67bee3baf31",
"score": "0.6196292",
"text": "def split_program\n settings[:split_program]\n end",
"title": ""
}
] | [
{
"docid": "9b739464c957a312d40c66ad2508401f",
"score": "0.6500362",
"text": "def split ; ::File.split(path) ; end",
"title": ""
},
{
"docid": "c2badee9edb5bd8fa7f7e93982c43b3e",
"score": "0.638765",
"text": "def program\n (/(\\/|\\\\)/ =~ $0) ? F... |
b7659bac56958877cb409f10e71e6d91 | Most common method to use when querying a class. This takes a hash of constraints and conditions and returns the results. | [
{
"docid": "5a062283ed04d728718b1c94f4118843",
"score": "0.0",
"text": "def all(constraints = {})\n constraints = {limit: :max}.merge(constraints)\n prepared_query = query(constraints)\n return prepared_query.results(&Proc.new) if block_given?\n prepared_query.results\n ... | [
{
"docid": "aa95c2def828b70bc04cc886cd5db1b0",
"score": "0.6628584",
"text": "def find_all(conditions)\n if conditions.keys.first == :id\n klass.get(conditions.values.first)\n else\n klass.send(\"by_#{conditions.keys.first}\", {:key => conditions.values.first}).al... |
257922850a10b53b5dc895a2d595cf97 | POST /consultations POST /consultations.xml | [
{
"docid": "332c113f59dcb76b7f10bd2921681f38",
"score": "0.68906724",
"text": "def create\n @consultation = @user.build_consultation(params[:consultation])\n\n respond_to do |format|\n if @consultation.save\n flash[:notice] = 'Consultation was successfully created.'\n format.htm... | [
{
"docid": "22c2a5ccc5933c29138d44f4a812d0e5",
"score": "0.6755083",
"text": "def create\n @consultation = Consultation.new(params[:consultation])\n\n respond_to do |format|\n if @consultation.save\n format.html { redirect_to @consultation, notice: 'Consultation was successfully create... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "0000beb4efb49a5175a0eab0c0fc8418",
"score": "0.0",
"text": "def set_dieta\n @dieta = Dieta.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.6032574",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6015663",
"text": "def... |
cd3dd91e7ab6d839ab0ecaad063137db | Contacts the Beams service to remove all the devices of the given user. | [
{
"docid": "336a0487d3e9be05d1726b7c9c98bbad",
"score": "0.65916985",
"text": "def delete_user\n client.delete(user)\n end",
"title": ""
}
] | [
{
"docid": "c44e237b8ab46d0ee2c444340a26c9c5",
"score": "0.75483745",
"text": "def delete(user)\n @@contact_list.delete(user)\n end",
"title": ""
},
{
"docid": "ff6cb99a2e39d75b880cfebb0474dad9",
"score": "0.6494067",
"text": "def delete_all_appointment(user)\n Appointment... |
2ad9121fd60e5f1d51072eb34653f16d | Return the preferred domain. First if none explicitly set. | [
{
"docid": "7109898f3acb12b38219aef80c7118e9",
"score": "0.9010969",
"text": "def preferred_domain; domain || domains.first; end",
"title": ""
}
] | [
{
"docid": "f0b5093487fc9620c65960b5ad57c2cd",
"score": "0.77406543",
"text": "def best_domain\n alternate_domain || twipl_domain\n end",
"title": ""
},
{
"docid": "599e30c65833f86af9a1e8b476489ab4",
"score": "0.7063267",
"text": "def domain\n @domain ||= get_domain\n end",
... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "735478f8cf201a43d7bc61f5615d8e93",
"score": "0.0",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6980957",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6783065",
"text": "def strong_params\n params.requi... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "4d1b4002e2fa93e4b8b37dbe6cb088f9",
"score": "0.0",
"text": "def apiv1_location_params\n params.fetch(:apiv1_location, {})\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7496716",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6956598",
"text": "def strong_params\n params.require(:request).permit(param_white... |
b88b969a6dbd71920396381cb847b86b | print section print due_date def print_books_array | [
{
"docid": "b5424281d9b9e6ac723f178f43e6e7da",
"score": "0.0",
"text": "def get_due_date #returns date book due integer\n loan_days = 7\n takeout_day = nil\n lines = File.readlines('libraryday.txt')\n lines.each{| line | takeout_day = line}\n takeout_day.chomp\n due_date = takeout_day.... | [
{
"docid": "0efb70c294b9e4b13cb4a793c0e79b60",
"score": "0.69979227",
"text": "def book_due_dates\n borrowed_books.each { |book| puts \"#{book.title} checked out by #{book.borrower.first.name}. Due date: #{book.due_date.strftime(\"%B %d, %Y\")}.\"}\n end",
"title": ""
},
{
"docid": "e1aa... |
bc3bbd885e83aae4301031345355cade | DELETE /sale_details/1 DELETE /sale_details/1.json | [
{
"docid": "d04eac68fe9cf4abcbea10421ac8fba7",
"score": "0.7932701",
"text": "def destroy\n @sale_detail = SaleDetail.find(params[:id])\n @sale_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to sale_details_url }\n format.json { head :no_content }\n end\n end",... | [
{
"docid": "7326fe804fd21bf9a840b20c169fcbc4",
"score": "0.7651265",
"text": "def destroy\n @sale.destroy!\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5761ebeef302a280c8b1dabec04536bd",
"score": "0.76288575",
"te... |
067cfcb15152fa8fff19a9e078314199 | Initializes a new sketch document with the given plain text information input the plain text diagram which should be rendered options the additional options to set or override Returns a new document | [
{
"docid": "e87fd7221f47b08636476e1f289f50a0",
"score": "0.0",
"text": "def initialize(input, options = {})\n @options = Options::DEFAULTS.merge(options).freeze\n @input = input\n\n @grid = Textgrid.new(input, @options)\n @parser = GridParser.new(@grid, @options)\n @figures = @p... | [
{
"docid": "aceb4d1bcceffebeef21ea41fc3ad932",
"score": "0.6407875",
"text": "def initialize(text, options = {})\n super options\n @text = text\n end",
"title": ""
},
{
"docid": "78cd39e2d12780d08a769b8719a7d602",
"score": "0.6318272",
"text": "def initialize(text, optio... |
e561e11bcf379ef5dc139c210017366b | Only allow a list of trusted parameters through. | [
{
"docid": "d47bd37110662258277b958e2db7bd9f",
"score": "0.0",
"text": "def book_detail_params\n params.require(:book_detail).permit(:title, :year_published, :price)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74768823",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.71700543",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist... |
9c62a1c9a2ea5fc005a06e46f0702d7b | Returns url with domain for calls to get this driver. | [
{
"docid": "bdc9adfa594bedc0f20b4f6bb1c609ed",
"score": "0.5817907",
"text": "def base_url\n 'https://selenium-release.storage.googleapis.com/'\n end",
"title": ""
}
] | [
{
"docid": "1cf7fabc38d93ae82144392c86a7061e",
"score": "0.73179954",
"text": "def _url\n URI.join(domain, path_gen.for_uri)\n end",
"title": ""
},
{
"docid": "b0c47d920373002af249397d312462ef",
"score": "0.7092057",
"text": "def url\n @driver.current_url\n end",
... |
97210e53c051267167893b79d283be71 | }}} Recursively checks if another model is a base model of this model, either directly (foreign key is in own table) or via inheritance (foreign key is in joined table). | [
{
"docid": "586bfb8c473896588b2dccabca84c607",
"score": "0.79783815",
"text": "def has_base_model?(model)\n # {{{\n @base_klasses.each_pair { |table,map|\n aggr_model = map.first\n if aggr_model == model || \n aggr_model.__associations__.has_base_model?(model) then\n ... | [
{
"docid": "3015e642719887c9dabb5962e864e593",
"score": "0.7137662",
"text": "def has_joined_model?(model)\n has_base_model?(model) || has_aggregated_model?(model)\n end",
"title": ""
},
{
"docid": "86f8b83ac9310e02e22e2a8f9315733f",
"score": "0.6942302",
"text": "def descend... |
ba1b3d1faac57e7b655a10e03f76f58c | convert self in ASCII8BIT | [
{
"docid": "6a3347f51dc2188e06b548288dbd1e05",
"score": "0.7016851",
"text": "def to_ascii!; self.replace(self.to_ascii); end",
"title": ""
}
] | [
{
"docid": "3f1a0ab56b92068f196e7bab7428fa08",
"score": "0.83020633",
"text": "def to_ascii; convert_format(UTF8, ASCII8BIT);end",
"title": ""
},
{
"docid": "6976cc89fcb6249de174dd147415df3f",
"score": "0.81778955",
"text": "def to_utf8; convert_format(ASCII8BIT, UTF8); end",
"ti... |
fcf9af76a6bea3eedd8d88937916da8c | no of days for leave automatically calculated, excluding weekends and holidays | [
{
"docid": "94685fff36e07a71c98ca75f91876c38",
"score": "0.8161026",
"text": "def no_of_days_for_leave\n @govt_holiday = Holiday.where([\"date between ? and ? \",\n start_date, end_date]).count\n\n business_days = connection.select_all(\"select uGetBussinessDays('... | [
{
"docid": "e466daea516151cac403f203c700b6a4",
"score": "0.81683993",
"text": "def no_of_days_for_leave\n @govt_holiday = Holiday.where([\"date between ? and ? \", start_date, end_date]).count\n\n business_days = connection.select_all(\"select uGetBussinessDays('#{start_date}','#{end_date}') as bd... |
d5679f9a97e6eccc9b2044916c347f5c | Searches for number of elements | [
{
"docid": "85c2bebef880306ee6545a5c1fb64310",
"score": "0.6567838",
"text": "def count\n\t\t@input_ary.each_with_index { |line,i|\n\t\t\tif line =~ /^COUNT=([0-9]*)\\s*/\n\t\t\t\t@fileinfo[:count] = $1.to_i \n\t\t\t\tat = i+1\n\t\t\tend\n\t\t}\n\t\traise DTA_ReaderErr, \"Cannot define number of element... | [
{
"docid": "ae6deb239306700b10c90864f26bf1f9",
"score": "0.73598796",
"text": "def count_elements\nend",
"title": ""
},
{
"docid": "82a26e08767c7fa678bd4d0dcc0f5e5d",
"score": "0.71566266",
"text": "def count\n elements.count\n end",
"title": ""
},
{
"docid": "9352d5f... |
70869d3dc4eb1e41e1dd26b36f51802e | Q: Write a test that will fail if 'xyz' is one of the elements in the Array `list`: | [
{
"docid": "61a48e404e7a175378aafa177b5d071c",
"score": "0.0",
"text": "def test_not_included\n refute_includes(list, 'xyz')\nend",
"title": ""
}
] | [
{
"docid": "11d02d9a47ba93f64552b664b13b385d",
"score": "0.7270184",
"text": "def test_xyz_not_in_arr\n refute_includes(list, 'ttt')\n end",
"title": ""
},
{
"docid": "1c72c396e80b8d0094603abea481354b",
"score": "0.72399265",
"text": "def assert_array_element(array_list, expected... |
993d30333c6a5a3d851fe723f694dd15 | Discovers the imagemagick version based on mogrify's output. === Returns The imagemagick version | [
{
"docid": "b3cfbd8500eb199c23d8e6678982540b",
"score": "0.8131971",
"text": "def image_magick_version\n @@version ||= Gem::Version.create(`mogrify --version`.split(' ')[2].split('-').first)\n end",
"title": ""
}
] | [
{
"docid": "63a3335538507c3dc9758b8de92759c6",
"score": "0.6637482",
"text": "def imagemagick7?; end",
"title": ""
},
{
"docid": "98cb07e6691f1707d356a84e5f93c289",
"score": "0.65219146",
"text": "def valid_version_installed?\n image_magick_version >= minimum_image_magick_versio... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "fbcd46f75ba44c2e0b1fb597cbb65286",
"score": "0.0",
"text": "def set_c_clip\n @c_clip = CClip.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;... |
d4292a6d7815e2d6623f98283d6dc26a | Begin a block tag. | [
{
"docid": "6dec3e9de8aac22c93eb42a376f809dd",
"score": "0.56724334",
"text": "def tag(name, attributes = {}, &block)\n\t\t\tfull_tag(name, attributes, @indent, @indent, &block)\n\t\tend",
"title": ""
}
] | [
{
"docid": "a4727132c96541e82c912b0ad68258a5",
"score": "0.68589115",
"text": "def BlockNode(opening, block_var, bodystmt); end",
"title": ""
},
{
"docid": "9fb95b45f2495ab4fa6b26baf59f0cbe",
"score": "0.6799487",
"text": "def BEGINBlock(lbrace, statements); end",
"title": ""
}... |
7a5a8703d5df4e39b2a1244af7e53fea | method to ensure users are not following themselves | [
{
"docid": "244b5631dd6de3acb5e06af524c16207",
"score": "0.0",
"text": "def friend_is_self\n if user_id == friend_id\n errors.add(:user, \"Why would you want to follow yourself?\")\n end\n end",
"title": ""
}
] | [
{
"docid": "1376c3776987ea2b4c5a5740ff7a3d32",
"score": "0.70969045",
"text": "def can_follow?(user)\n self.id != user.id && !following?(user)\n end",
"title": ""
},
{
"docid": "2efea05c8b3522e3bacbe24574c9a7e5",
"score": "0.7025639",
"text": "def prevent_self_retweet\n errors.a... |
fe1313d3ad41ab31df691a61c152bb0b | Replace this with your real tests. | [
{
"docid": "72fd36c52f9358823fcd80b429120869",
"score": "0.0",
"text": "def test_truth\n assert true\n end",
"title": ""
}
] | [
{
"docid": "35a51327dd0b5c9a884bb0e6f7155697",
"score": "0.7446459",
"text": "def testing\n # ...\n end",
"title": ""
},
{
"docid": "1a6186064d8218f9aa0c8b82bcc4fdae",
"score": "0.6956364",
"text": "def __dummy_test__\n end",
"title": ""
},
{
"docid": "8fbc... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "b23f0f926c5e5f92b31b28b11690f702",
"score": "0.0",
"text": "def user_params\n params.require(:user).permit(:user_name, :phone)\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... |
75ff35a56180607faaa0c5e9a136b9ce | POST /receptionists POST /receptionists.json | [
{
"docid": "43267823fbcd39584a56212ca5c8c616",
"score": "0.6410636",
"text": "def create\n @receptionist = Receptionist.new(receptionist_params)\n\n respond_to do |format|\n if @receptionist.save\n log_in_receptionist @receptionist\n format.html { redirect_to @receptionist, noti... | [
{
"docid": "fdf8dfe21bd8a3a55b67e62b226cf74c",
"score": "0.67730606",
"text": "def create\n @receptionist = Receptionist.new(params[:receptionist])\n\n respond_to do |format|\n if @receptionist.save\n format.html { redirect_to @receptionist, notice: 'Receptionist was successfully creat... |
909e2aedbb38d7cfaf7e12d5d01a799b | For methods that have a database column, take a best guess as to what the input method should be. In most cases, it will just return the column type (eg :string), but for special cases it will simplify (like the case of :integer, :float & :decimal to :number), or do something different (like :password and :select). If ... | [
{
"docid": "a97c9ea4a5e9c0bdc5588d7aacde4533",
"score": "0.76599574",
"text": "def default_input_type(method, options = {}) #:nodoc:\n if column = column_for(method)\n # Special cases where the column type doesn't map to an input method.\n case column.type\n when :strin... | [
{
"docid": "b79cddb83eefe8fd6008702fcc3bb1c6",
"score": "0.7794508",
"text": "def default_input_type(method, options = {}) #:nodoc:\n if column = self.column_for(method)\n # Special cases where the column type doesn't map to an input method.\n case column.type\n when :s... |
076ce3c027de5151b4504e9a94599aa9 | returns the best price for a given item list | [
{
"docid": "549827e78f55377be22d2c05fac9bdee",
"score": "0.81754744",
"text": "def best_price_for_items(item_list)\n left_items = item_list\n price = 0.0\n items[:combo].each do |item, menu_item|\n break if left_items.empty?\n intersection = left_items & item\n if !intersection.e... | [
{
"docid": "643ec23cdd87e58c0c37f41be91f8707",
"score": "0.76991963",
"text": "def best_price\n store_prices.order('price_cents').first\n end",
"title": ""
},
{
"docid": "e688cc256bf1aa1b5436d553abe96152",
"score": "0.766356",
"text": "def price\r\n stored_items.max { |item_a,... |
04b025e794b6146518d86404abfd3e10 | Patients this user can view through their jurisdiction access | [
{
"docid": "3516c8896e45876a28f9631115fed41c",
"score": "0.6884419",
"text": "def viewable_patients\n jurisdiction.all_patients_excluding_purged\n end",
"title": ""
}
] | [
{
"docid": "05da302402ade994fce4dd550f1bc5e7",
"score": "0.7255448",
"text": "def accessible_patients\n # If there is a current resource owner (end user) that has api access enabled\n if @user_workflow\n # This will access all patients that the role has access to, if any\n current_resour... |
a5862a2679561e1b2ed51dc8b3e2ddf0 | Team Health (static number right now. CHANGE) | [
{
"docid": "4cfa1dc3eb739a037112982485cc4847",
"score": "0.8172703",
"text": "def team_health\n 75\n end",
"title": ""
}
] | [
{
"docid": "d9b363b9802c0ccf5ed9725bc6e00ea0",
"score": "0.71317154",
"text": "def winner_health \r\n [100 - @bots[winner]['damage_taken'], 0].max\r\n end",
"title": ""
},
{
"docid": "503f50caf9e1d600de93d05e12e24b53",
"score": "0.69970745",
"text": "def health\n @@health[((in... |
84b96b1935d764da318b6c3fb2852128 | REVISADO: Guarda el redis del pez aprovechando el metodo empaquetado de especie | [
{
"docid": "f78583d23fb9908077945e85c762fd65",
"score": "0.8040167",
"text": "def guarda_redis\n especie.guarda_redis(loader: 'peces', foto_principal: imagen)\n end",
"title": ""
}
] | [
{
"docid": "e4f68b47ae0955b068c32f04f18023bc",
"score": "0.71890163",
"text": "def actualiza_o_crea_nom_com_en_redis\n return unless especie\n\n fecha = Time.now.strftime(\"%Y%m%d%H%M%S\")\n ruta_com = Rails.root.join('tmp','redis',\"#{fecha}_#{id}-#{especie_id}_com.json\").to_s\n ruta_cien ... |
254efcee39d07be6a159c73d62ec41a1 | DELETE /strategic_goals/1 DELETE /strategic_goals/1.json | [
{
"docid": "c068fbed29a6d9663901188633fb83aa",
"score": "0.7824667",
"text": "def destroy\n @strategic_goal.destroy\n respond_to do |format|\n format.html { redirect_to strategic_goals_url, notice: 'Strategic goal was successfully destroyed.' }\n format.json { head :no_content }\n end... | [
{
"docid": "7115691780a30d726d21900cbaa529d7",
"score": "0.7532327",
"text": "def destroy\n @goal = Goal.find(params[:id])\n @goal.destroy\n\n respond_to do |format|\n format.html { redirect_to list_goals_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},... |
8ca0f3d79e1a95561f580347a824ad9a | This is temporal. Currently we limit DeployToken to a single project, later we're going to extend that to be for multiple projects and namespaces. | [
{
"docid": "e1b1c9a8f0291f64008b4e845a076ad7",
"score": "0.0",
"text": "def project\n strong_memoize(:project) do\n projects.first\n end\n end",
"title": ""
}
] | [
{
"docid": "058d33891b0600914791659fbcef4ec5",
"score": "0.6199652",
"text": "def check_token_deployment\n\n if @token.blank? || @token[:status] == GlobalConstant::ClientToken.not_deployed\n\n @go_to = GlobalConstant::GoTo.token_setup\n\n elsif @token[:status] == GlobalConstant::ClientToken.d... |
30eb295ecf08ae7417427142723fd001 | GET /schedules/1 GET /schedules/1.xml | [
{
"docid": "2a068387552c52c54569b52f42e00f21",
"score": "0.7230664",
"text": "def show\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @schedule }\n end\n end",
"title": ""
}
] | [
{
"docid": "796140ee1215d76a3765656386f79a34",
"score": "0.8333408",
"text": "def live_schedule\n get('sports/en/schedules/live/schedule.xml')\n end",
"title": ""
},
{
"docid": "58e2efe08d2cc5ee9cde299b560c5736",
"score": "0.77478105",
"text": "def schedules(schedule_date = n... |
016f13e4c7851efa77f988165cabe1a5 | Defines instance methods and singleton methods to read/write a given key in Thread.current | [
{
"docid": "df67cb102bc2acf0b7414374f22a922b",
"score": "0.670209",
"text": "def thread_accessor(method, thread_key, **options)\n thread_reader(method, thread_key, **options)\n thread_writer(method, thread_key, **options)\n end",
"title": ""
}
] | [
{
"docid": "2a5793f2cb26ddab8b53636f8188087d",
"score": "0.69746405",
"text": "def get(id_key)\n Thread.current[id_key]\n end",
"title": ""
},
{
"docid": "56168032bf248ae119bee9175dcb9aa3",
"score": "0.6772791",
"text": "def get(key)\n (Thread.current[(@_chache_nam... |
1227bb71983b8ee193d6c52d2e1852f9 | Override in order to use DB logger | [
{
"docid": "7a40ec955e583bea07b5f380aa507fe7",
"score": "0.0",
"text": "def handle_error(error)\n if error.is_a?(Net::SSH::AuthenticationFailed)\n logger.important \"authentication failed for `#{error.message}'\"\n else\n logger.important CGI::escapeHTML(error.message)\n l... | [
{
"docid": "b948b506079c403039da84c0d7c5d6a3",
"score": "0.80606896",
"text": "def db_logger\n self.class.database_logger\n end",
"title": ""
},
{
"docid": "8dd0956236ef20ac19635f30d2f51d84",
"score": "0.747791",
"text": "def setup_database_logger\n ActiveRecord:... |
7f4cec7f072b18e4f3ec52c4161b0c29 | Invoked for all view types before visit, may cancel visit by returning false. | [
{
"docid": "6c7f21f3a6c53b34343612cde0430693",
"score": "0.7540354",
"text": "def pre_visit(_view, context: nil)\n true\n end",
"title": ""
}
] | [
{
"docid": "56231c074abd418a1b236f06abc8eccd",
"score": "0.619796",
"text": "def post_visit(_view, context: nil); end",
"title": ""
},
{
"docid": "82207a3fa398d9dd19ece189c4e63ef5",
"score": "0.5973835",
"text": "def visitable?; false; end",
"title": ""
},
{
"docid": "396... |
25321af11d46f1ce9f974ff9a75891b1 | Usage: GITHUB_TOKEN=yourtoken hissuegram owner/repo | [
{
"docid": "12f1c6923993c068ed9b754e8722feed",
"score": "0.83538955",
"text": "def usage\n \"GITHUB_TOKEN=yourtoken hissuegram owner/repo\"\nend",
"title": ""
}
] | [
{
"docid": "154b0744339b81f93a317bcf667be9fb",
"score": "0.75065166",
"text": "def fetch_github_token; end",
"title": ""
},
{
"docid": "a4927495ff7e1d50241923c03261df12",
"score": "0.72516143",
"text": "def gh_personal_token\n `git config github.token`.strip\n end",
"title": ... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "d29b4889b2f3ca1550638b05ec3208dc",
"score": "0.0",
"text": "def product_params\n params.require(:product).permit(:title, :description)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.79427844",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.6957069",
"text": "def permitted_params\n params.permit!\n end",
"title"... |
4c56e288003c632f4b1258dcbf969dd0 | GET /legalissues GET /legalissues.json | [
{
"docid": "843755d323cd65eeaf8621611356e538",
"score": "0.7637797",
"text": "def index\n @legalissues = Legalissue.all\n end",
"title": ""
}
] | [
{
"docid": "73d8e98a54ed9686e63eb931ab1b58c0",
"score": "0.67881715",
"text": "def gather_issues\n url = \"#{URL}/projects/foreman/issues.json?status_id=1&limit=100&release_id=#{@current_release_id}\"\n puts url\n uri = URI(URI.escape(url))\n response = Net::HTTP.get(uri)\n JSON.parse(response)\nen... |
e36c8d434e5899114fccfd5e4f5c3f64 | Loads the form for editing details of an existing hospital record. GET /hospitals/1/edit | [
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.0",
"text": "def edit\n end",
"title": ""
}
] | [
{
"docid": "cf1f42c59e02519e99210d3eba9b6dd5",
"score": "0.7360054",
"text": "def edit\r\n\t\t@phr = Phr.find(params[:phr_id])\r\n\t\t@ailment = Ailment.find(params[:id])\r\n\tend",
"title": ""
},
{
"docid": "47e924db2a3af5c1f7e11db1c774439c",
"score": "0.7223942",
"text": "def updat... |
1294855284a4d4dd2baf925989802f9b | PATCH/PUT /faqcats/1 PATCH/PUT /faqcats/1.json | [
{
"docid": "c2ce754915daedc33b972cda3b1dafe5",
"score": "0.5602731",
"text": "def update\n respond_to do |format|\n if @faqcat.update(faqcat_params)\n format.html { redirect_to root_url, notice: 'Category updated successfully.' }\n #format.html { redirect_to @faqcat, notice: 'Categ... | [
{
"docid": "8c0bc7be457ac0959966804a13deac2f",
"score": "0.6339787",
"text": "def update\n @faq.update(faqs_params)\n json_response(@faq)\n end",
"title": ""
},
{
"docid": "4e0e59715d19dce2a47fccc2c67326dd",
"score": "0.6134541",
"text": "def patch!\n request! :patch\... |
0d0a69e8dad999be27412a8f1c99b998 | GET /processos/1 GET /processos/1.json | [
{
"docid": "f0c3104a447d18fea32678a36611615c",
"score": "0.66096324",
"text": "def show\n #@processo = Processo.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @processo }\n end\n end",
"title": ""
}
] | [
{
"docid": "96b70a5075161d40b91fe725c227bab9",
"score": "0.72068435",
"text": "def index\n @processos = Processo.all\n\n render json: @processos\n end",
"title": ""
},
{
"docid": "767c7ff3d753112f630669b048225b2d",
"score": "0.6706613",
"text": "def show\n render json: @pro... |
82347b74ee3b1a59dc1d5df0a89a6ea7 | Enrich locallyheld transaction data The &x60;/transactions/enrich&x60; endpoint enriches raw transaction data generated by your own banking products or retrieved from other nonPlaid sources. | [
{
"docid": "89a627dea4fce2ffd683f65c8754264a",
"score": "0.6001023",
"text": "def transactions_enrich_with_http_info(transactions_enrich_get_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PlaidApi.transactions_enrich ...'\n end\n ... | [
{
"docid": "ddb965a87149729cabe11629a15d7502",
"score": "0.61274254",
"text": "def transactions_enrich(transactions_enrich_get_request, opts = {})\n data, _status_code, _headers = transactions_enrich_with_http_info(transactions_enrich_get_request, opts)\n data\n end",
"title": ""
},
... |
f341602672fca5f9ba37f822b5519829 | buildrelated queries: default to latest one... | [
{
"docid": "faecc9970e9f0a4dc2b9b20cab165be2",
"score": "0.0",
"text": "def build_number\n @build_number ||= history['builds'].first['build_number'].to_s\n end",
"title": ""
}
] | [
{
"docid": "34d19d968df3ba3211c9a97694bb62dc",
"score": "0.62019145",
"text": "def newest(constraints = {})\n constraints.merge!(order: :created_at.desc)\n _q = query(constraints)\n _q.define_singleton_method(:method_missing) { |m, *args, &block| self.results.send(m, *args, &block) ... |
bfd7e9aaeb24433f285f867fa4904aa9 | load the conntent of the slot that self descibes into a a new register. the register is created, and the slot_to_reg instruction added to the | [
{
"docid": "de7a19c0f2bf6ae1b6a28e31e7736fe4",
"score": "0.592616",
"text": "def to_reg()\n source = \"reduce #{@register.symbol}[#{@index}]\"\n slot_to_reg = Risc.slot_to_reg(source , register, index)\n if compiler\n compiler.add_code(slot_to_reg)\n slot_to_reg.register.set... | [
{
"docid": "eb65230f64c7f0c49a8ce884fe9a5429",
"score": "0.602441",
"text": "def to_register(compiler, source)\n type = known_object.get_type\n raise \"not sym for #{known_object}\" if type.is_a?(String)\n right = compiler.use_reg( type )\n const = Risc.load_constant(source, known_ob... |
7bc895743c3151bade721f839e8398f8 | Add items from other that are common and not already added | [
{
"docid": "056b1933ae640001908e6c97549da893",
"score": "0.5888547",
"text": "def b(memo, other)\n other.keys.each do |sort|\n if keys.include?(sort) && !memo.keys.include?(sort)\n memo << other.assoc(sort)\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "867d6f34f7a76d18861c08d94d3e8dd6",
"score": "0.68867636",
"text": "def shared(a, b)\n union = Hash.new\n shared_items = Array.new\n a.each do |element|\n union[element] = [true, nil]\n\n if b.include? element\n union[element][1] = true\n shared_items << element\n b.de... |
dd12e8439099a256ff36344184414fcf | Show the user the basic syntax of this command | [
{
"docid": "473772bdbf2e106def318077ffa6d1cc",
"score": "0.0",
"text": "def usage\n \"store list_vols\"\n end",
"title": ""
}
] | [
{
"docid": "ffd389582822b71c20a169e1fcea18aa",
"score": "0.7380743",
"text": "def showUsage\r\n if @usage.nil?\r\n @usage = <<USAGE\r\n\r\n Enter a command from the list of available commands.\r\n The list of commands may change after each command.\r\n Type TABs, commas, or spaces between par... |
6dc5c000e7e107e94317deab2046b8cb | Parse the command output. | [
{
"docid": "8d3eed120f7c04d228c15f3d8d482356",
"score": "0.0",
"text": "def parse(data)\n data = YAML.load(data.to_s)\n\n data[\"Bluetooth\"][\"Devices (Paired, Configured, etc.)\"].collect do |name, attributes|\n Device.new(\n name: name,\n battery: attribute... | [
{
"docid": "a8cc98d497d847ad8df423c58baa0f4f",
"score": "0.7361944",
"text": "def parse_output(cmd)\n cmd = cmd.split(\"\\n\")\n result = Hash.new \n if cmd[0] == \"Enter data: \"\n result[\"num_processors\"] = cmd[1]\n result[\"num_... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "2a92ebc2aca912e6bc29f8b2828fb635",
"score": "0.0",
"text": "def set_contact\n @contact = Contact.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60322535",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6012846",
"text": "de... |
a6a48efcedcebe2be15c8de66b32e1d8 | GET /sub_issues GET /sub_issues.json | [
{
"docid": "0442e9cf4b6493e9f658b648b8119a61",
"score": "0.8003021",
"text": "def index\n @sub_issues = SubIssue.all\n end",
"title": ""
}
] | [
{
"docid": "bf8b06da45b9259cbcb76b1ae2636985",
"score": "0.7418513",
"text": "def sub_issues\n MatterIssue.all(:conditions => [\"parent_id = ?\", self.id])\n end",
"title": ""
},
{
"docid": "73d8e98a54ed9686e63eb931ab1b58c0",
"score": "0.688629",
"text": "def gather_issues\n url... |
984f745e84a8997d89140e43a7aecd50 | before_action :playlist_access, only: [:show] This is a little hacky for now. If you hit the index and have a user account it redirects you to your playlist, otherwise it sends you to the sample "communal" playlist until I can flesh things out a bit more. | [
{
"docid": "413e3b8ef83d21bc7adf9a9e92f68305",
"score": "0.75991684",
"text": "def index\n if session[:user_id]\n user = User.find_by(id: session[:user_id])\n redirect_to playlist_path(user.playlist)\n else\n redirect_to '/playlists/1'\n end\n end",
"title": ""
}
] | [
{
"docid": "1a97c605615d194f5f2ac8a5417a8e23",
"score": "0.72410136",
"text": "def index\n if params[:admin].present?\n cookies[:admin] = params[:admin]\n end\n @current = decide_song\n @songs_in_playlist = Song.all\n end",
"title": ""
},
{
"docid": "47b4e71cf7ad55039303f83... |
10a7be47eb0ee15abb1bb006aec0316d | Private Methods Initialises all characters information from lodestone | [
{
"docid": "a12303c02466329c2cff40b8e6997205",
"score": "0.0",
"text": "def initialise_profile(page)\r\n @profile[:name] = Helper.get_name(page)\r\n @profile[:server] = Helper.get_server(page)\r\n @profile[:introduction] = Helper.get_introduction(page)\r\n @profile[:title] = Helper.g... | [
{
"docid": "40036e55b768238cc48b7522f5638db1",
"score": "0.6217542",
"text": "def initialize(append_characters)\n super(FIRST_CHARACTER, append_characters)\n end",
"title": ""
},
{
"docid": "845491666552688f57953a2339b162ab",
"score": "0.6196731",
"text": "def characters; end",
... |
a53bc9823fa10cafdc344b4083a2987d | not actually forums, but a hash of forum ids and access | [
{
"docid": "53986faf860a490df080b108acd046e5",
"score": "0.7230207",
"text": "def forums\n self.special ||= {}\n self.special[:forums] ||= {}\n special[:forums]\n end",
"title": ""
}
] | [
{
"docid": "20020f8ff7fdf54d693a5874a0c157d0",
"score": "0.7099038",
"text": "def forums\n # go through all links on the forum index page looking for forum links\n @agent.get(@urls[:forums]).filtered_links('viewForumSummary').inject({}) do |hash, link|\n hash[link.text.strip] = link.href; has... |
e561e11bcf379ef5dc139c210017366b | Only allow a list of trusted parameters through. | [
{
"docid": "f338187c5c42138ce5b4bb2bb53f9763",
"score": "0.0",
"text": "def award_params\n params.require(:award).permit(:ein, :name, :address, :city, :state, :zip, :amount, :purpose, :filename)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74768823",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.71700543",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist... |
eeb917865aa9f8273d2025378b40b8a3 | Iterates over all (recursive) descendent files of the directory indicated by the Pathname. Iterated Pathnames are prefixed by the original Pathname, and are in depthfirst order. If a block is given, each descendent Pathname is yielded, and this method returns the original Pathname. Otherwise, an Enumerator is returned. | [
{
"docid": "98bdd414bc728ad8e9f22f5ac4ef644a",
"score": "0.0",
"text": "def find_files\n return to_enum(__method__) unless block_given?\n\n self.find do |path|\n yield path if path.file?\n end\n\n self\n end",
"title": ""
}
] | [
{
"docid": "822da68ba9cd9484c9108d73eabb801f",
"score": "0.6790235",
"text": "def each_path(recurse=true)\n raise \"Path does not point to a directory (#{self})\" if !directory?\n \n currentPath = self.absolute\n \n dir = [currentPath.to_dir()]\n \n while !dir.empty? do\n entry... |
bd75b88f6bd5040b636bbc64de6b803c | GET /pontos GET /pontos.json | [
{
"docid": "89d30a3998007833f072f73c893a424f",
"score": "0.65137774",
"text": "def index\n @pontos = Ponto.all\n end",
"title": ""
}
] | [
{
"docid": "3b8fad7995dd5d57e48b6e03c0e0cad7",
"score": "0.69877213",
"text": "def index\n @pomodoros = Pomodoro.all\n\n render json: @pomodoros\n end",
"title": ""
},
{
"docid": "3b8fad7995dd5d57e48b6e03c0e0cad7",
"score": "0.69877213",
"text": "def index\n @pomodoros = Po... |
a5cf844876da8a225e02c459ecbe7412 | Create or update Session Timer Profile Binding Map for Tier0 Logical Router API will create or update Session Timer profile binding map for Tier0 Logical Router. | [
{
"docid": "95465e9cdc57ae7da0e9209e18af3389",
"score": "0.6599436",
"text": "def update_tier0_session_timer_profile_binding_with_http_info(tier0_id, session_timer_profile_binding_id, session_timer_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.... | [
{
"docid": "acdddc6f772b7ab4dffb220d4465bf16",
"score": "0.67205733",
"text": "def patch_tier0_session_timer_profile_binding_map_0(tier0_id, session_timer_profile_binding_id, session_timer_profile_binding_map, opts = {})\n patch_tier0_session_timer_profile_binding_map_0_with_http_info(tier0_id, ses... |
ab2054450b3d927e0fd25ad789aef57c | Select random elements from an array | [
{
"docid": "16c52bab04917b1505434572ec9c6295",
"score": "0.73209107",
"text": "def random_select(array, n)\n n.times do\n puts array[rand(array.length-1)]\n end\nend",
"title": ""
}
] | [
{
"docid": "cfbc5d49e1f43c047d6daef79f9eec1e",
"score": "0.8238756",
"text": "def pick(array)\n array[rand(array.size)]\nend",
"title": ""
},
{
"docid": "cfbc5d49e1f43c047d6daef79f9eec1e",
"score": "0.8238756",
"text": "def pick(array)\n array[rand(array.size)]\nend",
"title": ... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "144867b2bf9e749e8e80d9f1883fa53d",
"score": "0.0",
"text": "def update!(**args)\n @description = args[:description] if args.key?(:description)\n @entity_id = args[:entity_id] if args.key?(:entity_id)\n @score = args[:score] if args.key?(:score)\n end",
"... | [
{
"docid": "184b1b1ed771473d3eb9f338c0734c38",
"score": "0.73066413",
"text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end",
"title": ""
},
{
"docid": "5076c5a88404ae72986f958710f5687a",
"score": "0.72631145",
"text": "def update... |
c1667f598d9765a74f9c1eae90d11626 | GET /forecast_days/1 GET /forecast_days/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "60de02df9dd6de40f15f9e0514f1a244",
"score": "0.7371991",
"text": "def index\n @forecast_days = ForecastDay.all\n end",
"title": ""
},
{
"docid": "95f90f350f46e7f1c541f0f80166e265",
"score": "0.6898408",
"text": "def set_forecast_day\n @forecast_day = ForecastDay.... |
eae3b41fafe3107076ae059460f66f25 | Put all of the [k, v] pairs to Kinesis in as few requests as possible. All of the ks and vs must be strings. Each request sends at most `:send_size` records. By default this is the Kinesis API limit of 500 records. | [
{
"docid": "0beafed00a5f6c44db907da258c94493",
"score": "0.57919353",
"text": "def put_all(items)\n items.each_slice(@send_size).flat_map do |batch|\n @client.put_records(@stream, batch)\n end\n end",
"title": ""
}
] | [
{
"docid": "187be4ac518823ab4ed6a01cea411f83",
"score": "0.5634218",
"text": "def parallel_put(requests, options = {})\n base_parallel_call(:put, requests, options)\n end",
"title": ""
},
{
"docid": "f57446f4b1c338b5f665823d841d7e31",
"score": "0.5619127",
"text": "def flush_reco... |
bd9716826c5f2eca6d48fe06948ae66d | TODO def test_with_filters assert_understands "SELECT Id FROM UserProfileFeed WITH UserId='005D0000001AamR' ORDER BY CreatedDate DESC, Id DESC LIMIT 20" end def test_with_data_category_filters assert_understands "SELECT Title FROM KnowledgeArticleVersion WHERE PublishStatus='online' WITH DATA CATEGORY Geography__c ABOV... | [
{
"docid": "49251c65fca40ef963013ca45c0e7ffa",
"score": "0.59242404",
"text": "def test_soql_queries\n assert_understands 'SELECT Name, Account.Name, toLabel(StageName), CloseDate, Amount, Fiscal, Id, RecordTypeId, CreatedDate, LastModifiedDate, SystemModstamp FROM Opportunity USING SCOPE mine WHERE ... | [
{
"docid": "4f70505156c1ae239215e97d520ab187",
"score": "0.627159",
"text": "def test_filter_creation\n md_report = @twitter_reporter.reports.create(:text => 'here in #21108')\n assert_equal 5, (md_report.filters & %w(annapolis baltimore maryland northamerica unitedstates).map { |c| Filter.find_by... |
fc12707958de3b8d99a7878d5e597684 | DELETE /tbl_forms/1 DELETE /tbl_forms/1.json | [
{
"docid": "ac3011b332f33bdcc39e31893a55e9e1",
"score": "0.70692766",
"text": "def destroy\n @tbl_form.destroy\n respond_to do |format|\n format.html { redirect_to tbl_forms_url, notice: 'Tbl form was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"ti... | [
{
"docid": "64c2c3e3f9835cefe0f2b7d789b62265",
"score": "0.71599275",
"text": "def delete\n item = Form.last\n id = item[:id]\n item.destroy\n render json: {id: id}\n end",
"title": ""
},
{
"docid": "8cdb740ae390c59ec2855e3a0cea4a97",
"score": "0.69467676",
"text": "def ... |
2f2e33e78bf035a37248a8024281b4e7 | method to create remember token | [
{
"docid": "2c2d945262c9553c8bbaeccdfd93ef7d",
"score": "0.854758",
"text": "def create_remember_token\n \n # Create secure urlsafe_base64 token and assign it to \n # remember_token attribute.\n self.remember_token = SecureRandom.urlsafe_base64\n end",
"title": ""
}
] | [
{
"docid": "ea3317438d5fd1e653900a4a95209188",
"score": "0.85474813",
"text": "def create_remember_token\n\n # Create the token.\n self.remember_token = SecureRandom.urlsafe_base64\n\n end",
"title": ""
},
{
"docid": "7185497ed077b5c4c609078157174be3",
"score": "0.8488701",
"t... |
de86c38d85ca4e94f24d5d5603eb7d2a | DELETE /tournament_admins/:id Destroys the specified administrator relationship | [
{
"docid": "ec50b4c8449ba6868a88c4e9fe3a6126",
"score": "0.7878892",
"text": "def destroy\n\t\trelation = TournamentAdmin.find(params[:id])\n\t\ttournament = relation.tournament\n\t\tauthorize! :update, tournament\n\n\t\tif tournament.admins.count == 1\n\t\t\tredirect_params = { alert: t('tournament_adm... | [
{
"docid": "7dbd3a5e64dfbb45165bbdc142335584",
"score": "0.73676986",
"text": "def destroy\n unless current_user.admin?\n redirect_to @tournament, flash: {error: 'Only administrators can delete tournaments.'}\n return\n end\n if @tournament.destroy\n redirect_to :tournaments, fla... |
1e30e0fd0bde79b398a03f77c48c9b7d | Returns the value of attribute data. source://redisactivesupport//lib/active_support/cache/redis_store.rb22 | [
{
"docid": "80d71d02dda08753c5269edd63ae3acf",
"score": "0.0",
"text": "def data; end",
"title": ""
}
] | [
{
"docid": "3e32c61ade5c5d84a6542ccdc5ed6481",
"score": "0.7113661",
"text": "def get_value (key)\r\n @redis.get key\r\n end",
"title": ""
},
{
"docid": "df3168a2149f6df139f7c9dadad01def",
"score": "0.69839925",
"text": "def get\n @cached_value ||= RedisModel::Base.connect... |
eaa2a5bb0fc78ba62095afc9b511c941 | Creates string classes. The specified classes must not already exist. | [
{
"docid": "ff80df5a4b06e0ea65a89a808e124ecb",
"score": "0.74197567",
"text": "def create_string_class(opts)\n opts = check_params(opts,[:classes])\n super(opts)\n end",
"title": ""
}
] | [
{
"docid": "8bbfd0705c7218509120c5ed40c2b7ad",
"score": "0.6527066",
"text": "def build_class_list(classes)\n class_list = \"class='\"\n classes.each do |cls|\n class_list << \"#{cls} \"\n end\n class_list.strip!\n class_list << \"' \"\n class_list\n end",
"title": ""
},
... |
e7bd1bbcf5fd51011d9dbabb2c5a1cf3 | Get various information about a Bucket or Object | [
{
"docid": "b23bb1b982a41c87eb2349c35883bc82",
"score": "0.7564943",
"text": "def info(bucket) # s3://BUCKET[/OBJECT]\n send_command \"info\", bucket\n end",
"title": ""
}
] | [
{
"docid": "80575de09be6e7a4c854e9f6733e605c",
"score": "0.74059385",
"text": "def bucket_meta_objects(bucket_name, *args)\n options = {\n :delimeter => nil,\n :marker => nil,\n :max_keys => nil,\n :prefix => nil\n }\n options.merge!(args.pop) if args.last.is_... |
19676c5f8955b00959b1c3c9b4aa88ee | Is the provided type of callback executable by this document? | [
{
"docid": "f90c91fe11cb16a4ddfab6c56f700a01",
"score": "0.8127822",
"text": "def callback_executable?(kind)\n respond_to?(\"_#{kind}_callbacks\")\n end",
"title": ""
}
] | [
{
"docid": "abe3a18cc155e312252ad8ed7a28c395",
"score": "0.69514084",
"text": "def callback?(name)\n self.class.callbacks[name].any?\n end",
"title": ""
},
{
"docid": "df11bb4739450059b5a315a3b254e7a0",
"score": "0.6943275",
"text": "def has_callback? \n !collected[:call... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "40672c347ee64644d69d1a237e41960e",
"score": "0.0",
"text": "def set_zone\n @zone = Zone.find_by(identifier: params[:identifier])\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... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "ec491f2446f921bf6e09b9727e4207f5",
"score": "0.0",
"text": "def set_house\n @house = House.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;... |
1c322a9c641552f5c723f038fec979d2 | PATCH/PUT /playlists/1 PATCH/PUT /playlists/1.json | [
{
"docid": "1ba4aa87e573a0adc1e81579b094c951",
"score": "0.66027904",
"text": "def update\n respond_to do |format|\n if @playlist.update(playlist_params)\n format.html { redirect_to @playlist, notice: 'Playlist was successfully updated.' }\n format.json { render :show, status: :ok,... | [
{
"docid": "6ff44240e779348ca693e21408856ae1",
"score": "0.7192405",
"text": "def update\n @playlist = current_user.playlists.find(params[:id])\n\n respond_to do |format|\n if @playlist.update_attributes(params[:playlist])\n format.html { redirect_to @playlist, notice: 'Playlist was su... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "86defe282f9f465af981612d22ce0d4a",
"score": "0.0",
"text": "def set_elevator\n @elevator = Elevator.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60310596",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6014974",
"text": "de... |
f0c26bd3894578c864c6d60710822121 | A callable method by which presenter constants can be looked up from their human name. In future, it might be worth unifying this method with `find_by_class` to reduce total surface. | [
{
"docid": "99aaa044961ceb92bdeeae5258799be1",
"score": "0.7374443",
"text": "def presenter_constant_lookup_method\n @presenter_constant_lookup_method ||= Brainstem.presenter_collection.presenters.method(:fetch)\n end",
"title": ""
}
] | [
{
"docid": "d23075106a54480b47ffce4d779981f8",
"score": "0.5838168",
"text": "def target_class_to_const(target_class)\n presenter_constant_lookup_method.call(target_class.to_s)\n end",
"title": ""
},
{
"docid": "6bed4b644d76ee62e145026e9feb48ea",
"score": "0.5699916",
"te... |
399612b7bf92b9279cb4ce79153a20eb | PUT /teachers/1 PUT /teachers/1.json | [
{
"docid": "b2bc3fd953f7a507a8300cf9838f3fc7",
"score": "0.5684868",
"text": "def update\n #params = parse_parametrs(params)\n @teacher = Teacher.find(params[:id])\n\n respond_to do |format|\n if @teacher.update_attributes(params[:teacher]) &&\n @teacher.user.update_attributes({:na... | [
{
"docid": "5d99a958f620c4f692428782c43588aa",
"score": "0.6550305",
"text": "def update\n @teach = Teach.find(params[:id])\n\n respond_to do |format|\n if @teach.update_attributes(params[:teach])\n format.html { redirect_to @teach, notice: 'Teach was successfully updated.' }\n ... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "f1e513334075f53eb0cbc0007aafff40",
"score": "0.0",
"text": "def patient_params\n params.require(:patient).permit(:niid_id, :lab_id, :affiliation, :hosp_id, :gender, :nationarity, :date_of_birth, :date_diagnosed, :edu_background, :occupation, :marital_status, :risk, :operator_id)\n en... | [
{
"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... |
fdeba18cc6c640a3d65f8b9f43d49b25 | GET /labtech_times/1 GET /labtech_times/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "bc6396373d127995956c65cc78e05840",
"score": "0.72006327",
"text": "def show\n @lab_timing = LabTiming.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lab_timing }\n end\n end",
"title": ""
},
{
"docid": ... |
4f2f9df879955c102c5ca07c65747a55 | Required method to display the provision workflow in UI. | [
{
"docid": "cd47ebad427733a51888c89cfcc7e85f",
"score": "0.0",
"text": "def dialog_name_from_automate(message = 'get_dialog_name')\n super(message, {'platform' => 'ibm_vpc'})\n end",
"title": ""
}
] | [
{
"docid": "d15fd05dbaad03205b32726062322be4",
"score": "0.67564017",
"text": "def provision\n end",
"title": ""
},
{
"docid": "0bfce15e8b36bc148861ec0994b7f1a8",
"score": "0.64050907",
"text": "def provisional; end",
"title": ""
},
{
"docid": "c812c5d9eda0179060a4... |
6f95ba1abec7f2dba99a2ce30d628072 | In order for this to work, your firewall must allow incoming connections to Cypress | [
{
"docid": "df13001f63b713fa5876aa4d8a7b9c3c",
"score": "0.0",
"text": "def system!(*args)\n system(*args) || abort(\"\\n== Command #{args} failed ==\")\nend",
"title": ""
}
] | [
{
"docid": "56bb639a925a45c793669d92bf470bd1",
"score": "0.60121447",
"text": "def allow_net_connect; end",
"title": ""
},
{
"docid": "56bb639a925a45c793669d92bf470bd1",
"score": "0.60120827",
"text": "def allow_net_connect; end",
"title": ""
},
{
"docid": "53ce54de0c0790... |
ead6b46ad3b421cbac35b1f23a352387 | Find the node that matches the item_type The result has a parent reference instead of a child reference. | [
{
"docid": "1f39d5af62469eef844fc5be65cbb5e0",
"score": "0.59426033",
"text": "def search_hierarchy(item_type, source: send(:source), parent: nil)\n parent_without_children = (parent || source).except(:children)\n return [source.except(:children).merge(parent: parent_without_children)] if ... | [
{
"docid": "b0cb390246eb686b944e4b3ed36de681",
"score": "0.75201994",
"text": "def get_matching_node(item)\n return get_matching_class(item, @nodes)\n end",
"title": ""
},
{
"docid": "b0cb390246eb686b944e4b3ed36de681",
"score": "0.75201994",
"text": "def get_matching_node(ite... |
49334ff6f0598bac391fd7daf1cbc1a6 | Read a &39;storage.NetAppExportPolicy&39; resource. | [
{
"docid": "fd6920bfeaf083faaa2440d981187638",
"score": "0.582011",
"text": "def get_storage_net_app_export_policy_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: StorageApi.get_storage_net_app_export_policy_list ...'\n en... | [
{
"docid": "3b692bccfd55e12a395954f267647220",
"score": "0.5899221",
"text": "def get_storage_net_app_export_policy_by_moid(moid, opts = {})\n data, _status_code, _headers = get_storage_net_app_export_policy_by_moid_with_http_info(moid, opts)\n data\n end",
"title": ""
},
{
"doc... |
22cf77ebfb1ccb85995866b28480725d | Writer for options (Hash syntax). | [
{
"docid": "ea45014a6ca4e481100a31ef62c19ab5",
"score": "0.0",
"text": "def []=(name, value)\r\n Tidylib.opt_parse_value(@doc, name, value)\r\n end",
"title": ""
}
] | [
{
"docid": "bf79947782e9904296714911cefc4d79",
"score": "0.70174116",
"text": "def options=(hash={})\n hash.each { |key,value| write_option(key, value) }\n end",
"title": ""
},
{
"docid": "b347a7ea7fc55ad5efdf8fe00fd082c7",
"score": "0.68729216",
"text": "def write_option... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "b387aba32e16cd8c02d059ebeab15083",
"score": "0.0",
"text": "def set_statisticmanage\n @statisticmanage = Statisticmanage.all\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... |
4fb00db4cc16ca44a8e33050df492e6c | Assists with the creation of an observer for the :onchange option of the record_select_field method. Currently only supports building an Ajax.Request based on the id of the selected record. options[:url] should be a hash with all the necessary options except :id. that parameter will be provided based on the selected re... | [
{
"docid": "a25fd19856a96c62d7c7c8bef7e72f8c",
"score": "0.78076583",
"text": "def record_select_observer(options = {})\n fn = \"\"\n fn << \"function(id, value) {\"\n #Replaces :id: but in url encoded format.\n fn << \"var url = #{url_for(options[:url].merge(:id => \":id:\")).to_json}.rep... | [
{
"docid": "f8d14baf2d0131234545a20af87b2f01",
"score": "0.585513",
"text": "def remote_select(object,method,options,controller,action,selected_value=nil, record = nil)\n option_tags = \"<option value=''></option>\"\n options.each do |option|\n if selected_value.to_s == option[1].to_s || (!re... |
9958d72fe8745201532a565ddc805fc3 | define how files are to be renamed. | [
{
"docid": "b712796356e3db4f19a81498d5f58b01",
"score": "0.72451186",
"text": "def name_switch(old_name, new_name)\r\n\r\n\tFile.rename(old_name, new_name)\r\n\t\r\nend",
"title": ""
}
] | [
{
"docid": "4790dcd2fb7f70df8c620e6897442e8e",
"score": "0.7919739",
"text": "def rename; end",
"title": ""
},
{
"docid": "5c99373cbe7611dfbf52a198afffad24",
"score": "0.7295735",
"text": "def do_renaming\n surround_with_entry_points(:batch_renaming) do\n conf[:files]... |
44c1d20d307d2c6527004b49a13b7deb | Returns the life state of the given unit. ==== Description Can be one of: "ALIVE" "UNCONSCIOUS" "DEAD" Since Arma 3 Alpha it can be one of: "HEALTHY" "INJURED" "DEAD" When "INJURED", "Treat XXXX" action menu and icon appear for the player or a 3rd party who is close with medkit or FAK ==== Syntax lifeState unit ==== Pa... | [
{
"docid": "cf74b8daba3ec680fd5863ad98cc1934",
"score": "0.56608",
"text": "def lifeState _args\n \"lifeState _args;\" \n end",
"title": ""
}
] | [
{
"docid": "3a7e5ed522b0527a99b170ff1a304640",
"score": "0.49998918",
"text": "def show_state\n return \"#{@name} a #{life_points} points de vie et une amre de niveau #{weapon_level}\"\n end",
"title": ""
},
{
"docid": "d98f6c5004a5e4cf4e721cb42201d83a",
"score": "0.49649498",
... |
00abf4cf74d7743d2a9f4a2b2ad2c631 | GET /subscriptions/1 GET /subscriptions/1.json | [
{
"docid": "76e90d3b34050ded0ac36e18b7b564ff",
"score": "0.0",
"text": "def show\r\n end",
"title": ""
}
] | [
{
"docid": "dc4b430ed038339ec1451d864d71b48a",
"score": "0.7921825",
"text": "def get_subscription(subscription_id)\n request :get,\n \"/v3/subscriptions/#{subscription_id}.json\"\n end",
"title": ""
},
{
"docid": "5c00e186d4e2351fe4e1ad3758a2c93f",
"score": "0.77965534",
... |
33eead336fc38ed33deb64fdee272ddd | Sets the velocity limit of a stepper, in (micro)steps per second, or raises an error. | [
{
"docid": "23e82ee94e5780c6e418250678cf8d06",
"score": "0.72637236",
"text": "def velocity_limit=(new_velocity_limit)\n Klass.setVelocityLimit(@handle, @index, new_velocity_limit.to_f)\n\t new_velocity_limit\n end",
"title": ""
}
] | [
{
"docid": "a360759f882791c8af221aa70782c0d0",
"score": "0.7112307",
"text": "def velocity_limit=(new_velocity_limit)\n Klass.setVelocityLimit(@handle, @index, new_velocity_limit.to_f)\n new_velocity_limit\n end",
"title": ""
},
{
"docid": "6badf40710802ba1d54da046bf6ff3ff",
... |
51baf5b134dfd96cb99114209f6745d4 | Builds a MongoDB compatible string for the additional options specified by the user | [
{
"docid": "316650a8158b5d5774f10e76e3338b63",
"score": "0.0",
"text": "def additional_options\n @additional_options.join(\"\\s\")\n end",
"title": ""
}
] | [
{
"docid": "f6594fe6476864aa2573e9782c1ac11d",
"score": "0.71969754",
"text": "def mongodump_options\n options = String.new\n options += \" --username='#{user}' \" unless user.blank?\n options += \" --password='#{password}' \" unless password.blank?\n options += \... |
50f21184c4c427cdd79c19a35864e049 | a special method that we can call from jqGrid to spit back html of a select element needed for form editing of biomes types | [
{
"docid": "896e29dd3e3fb310eadf301093275332",
"score": "0.66701734",
"text": "def htmlselect_jqgrid\n @biomes=Biome.return_tree(:levels=>2)\n render :layout=>false\n end",
"title": ""
}
] | [
{
"docid": "8775d9d32dbf698427637c08b00d9c6d",
"score": "0.69920933",
"text": "def wiz_select_type\n \n end",
"title": ""
},
{
"docid": "f15682a1b4f41e38a1c7d3548deb365f",
"score": "0.6568176",
"text": "def type\n if tag_name == 'SELECT'\n attr(:multiple) == 'multip... |
06f1195be5312cd9bc495d9817123c1a | Link points to the next and previous point in the polygon; this property is otherwise not stored in the heap itself, but is necessary to efficiently recalculate areas when points are removed | [
{
"docid": "7c9a731301a87c6f7c1fbb6ce352850c",
"score": "0.61767775",
"text": "def link(point, next_point, prev_point)\n item = @lookup[point]\n item.next_link = @lookup[next_point]\n item.prev_link = @lookup[prev_point]\n end",
"title": ""
}
] | [
{
"docid": "470b8ef850b679f13f5e603aa131581d",
"score": "0.5919189",
"text": "def pop\n @insert_point -= 1\n if (@insert_point < 0)\n return nil\n end\n rc = @items[0]\n new_head = @items[@insert_point]\n new_head.index = 0\n @items[0] = new_head\n @items[@insert_point] = ni... |
d4d2a8ddc7e5097022a156a7c64fe380 | Returns the Edge of a poly that intersects a given line. Nil if no intersection exists | [
{
"docid": "11a5a50d73c2a9170a21d54d660f222f",
"score": "0.80327994",
"text": "def find_edge_intersecting_with_line(poly_verts, line_start, line_end)\n count = poly_verts.count\n\n poly_verts.each_with_index do |face_start, i|\n face_end = poly_verts[(i+1) % count]\n\n co... | [
{
"docid": "eff847f2e9a29e6c71199998e72d20b2",
"score": "0.6515004",
"text": "def find_intersecting_point_with_line(line)\n if (intersect? line)\n eq1 = LinearEquation.new(vector.x, -line.vector.x, point.x - line.point.x)\n eq2 = LinearEquation.new(vector.y, -line.vector.y, point.y - line.p... |
2a62f824f1e305f531a766d4e0561d6e | Method that judges if a common player should become a cultist player. | [
{
"docid": "b081c835b6127f34a8c8e697bbbf98b8",
"score": "0.0",
"text": "def shouldConvert\n Dice.instance.nextNumber == 6\n end",
"title": ""
}
] | [
{
"docid": "801f5bc423effdcc2c8be08df690d5c7",
"score": "0.60975623",
"text": "def can_promote?(user)\n (!eql? user) && (team.team_captain.eql? self)\n end",
"title": ""
},
{
"docid": "04e2e129264722bab3629f41d199bbb7",
"score": "0.60531765",
"text": "def change_player(player)\n\... |
75c9e6f4efede28737a39d6d934cdbc3 | Add an existing network (from Org) to vApp | [
{
"docid": "bbf9f9705ebab3956554d71b5edeb373",
"score": "0.7985701",
"text": "def add_org_network_to_vapp(vAppId, network, config)\n network_section = generate_network_section(vAppId, network, config, :external)\n add_network_to_vapp(vAppId, network_section)\n end",
"title": ""
}
] | [
{
"docid": "0100e61763a3dcb1e8a6571d2fce0217",
"score": "0.6870431",
"text": "def add_internal_network_to_vapp(vAppId, network, config)\n network_section = generate_network_section(vAppId, network, config, :internal)\n add_network_to_vapp(vAppId, network_section)\n end",
"title": ""
}... |
20f9dcf278e162848904e105440a993e | GET /story_tags GET /story_tags.json | [
{
"docid": "96b6cd8a91074c8f0d3186a9d7967d0d",
"score": "0.73948085",
"text": "def index\n @story_tags = StoryTag.all\n end",
"title": ""
}
] | [
{
"docid": "ba4a7fc3c0fee7f96c80dd4adbbf64a1",
"score": "0.7357425",
"text": "def index\n @stories = if params[:tag]\n Story.all.tagged_with(params[:tag])\n else\n Story.all\n end\n end",
"title": ""
},
{
"docid": "79e05cda9771f37ae259324a97df3ea3",
"score": "0.723744... |
bba1c4cbaab7563b0578e3fc359ee2c7 | CONSTRUCTOR Creates OpenNebula section if not exists | [
{
"docid": "99607663911563811029f6b866a74479",
"score": "0.0",
"text": "def initialize(nsx_client)\n super(nsx_client)\n # Construct base URLs\n @base_url = NSXConstants::NSXT_DFW_BASE\n @url_sections = @base_url + \\\n NSXConstants:... | [
{
"docid": "5d18b1d0ce9e9679a966161f5f5e76fa",
"score": "0.6728407",
"text": "def section_new\n @section = Section.new\n @section_count = Section.count + 1\n @section_position = @section_count\n end",
"title": ""
},
{
"docid": "67cf33117c429bb8ccdb863fad424b78",
"score": "0.66... |
1bfe72fc62e772af115aa105cbd4d838 | Instantiates a new meetingParticipants and sets the default values. | [
{
"docid": "7ef81c87eb67a10f03b6ac27e68651f1",
"score": "0.0",
"text": "def initialize()\n @additional_data = Hash.new\n end",
"title": ""
}
] | [
{
"docid": "0ee2ef3e3c8f35d885e5cea4c3deb809",
"score": "0.63895285",
"text": "def new\n\t\tunless @meeting\n\t\t\t@meeting = Meeting.new\n\t\tend\n\t\t@users = User.all\n\t\t@user_selected = ''\n\t\t@user_names = %w[a b]\n\tend",
"title": ""
},
{
"docid": "e5e48b140066e850aea2c5df999f9563",... |
1459752e1c2ef02d83115634203a4181 | make sure setup variables are valid | [
{
"docid": "7d51401c9bc7ea4f7c803706b62b2bf0",
"score": "0.0",
"text": "def test_test_valid_unit_should_be_valid\n assert @valid_unit.valid?\n end",
"title": ""
}
] | [
{
"docid": "32dbbb40cc1672b3605754267e259265",
"score": "0.72796345",
"text": "def check_setup\n \n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.6676334",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title... |
611a346e4c3a13d1731e89534873391c | What is an instance variable in Ruby? Try to find the answer via Google and explain it in your own words. Instance variables are tied to a particular instance of a class, that is, they are tied to particular objects. They are accessible and visible outside the method where they are defined. We can see and access instan... | [
{
"docid": "7f38cea2aaf947b295876bd862948004",
"score": "0.0",
"text": "def sum(entry)\n\ta = 1 # Here we defined a local variable a within the sum method. It can only be accessed within sum.\n\tputs(entry + 1)\nend",
"title": ""
}
] | [
{
"docid": "0e43460b86888b977ff8f8d86310c00e",
"score": "0.6966577",
"text": "def initialize\n @instance_variable = 20\n end",
"title": ""
},
{
"docid": "2cd07136d73974c03d37d1632a27a572",
"score": "0.68442446",
"text": "def foo\n puts @instance_variable\n end",
"title"... |
325830ecc76927b0b7eecda4624db3c0 | Belts and braces: Always run check to see if Device is included and registarable is set, since that will leave you wide open to anybody registering as admin | [
{
"docid": "f447d1f4cc45a33e42b12e4e4e7b07d8",
"score": "0.774094",
"text": "def device_auth_check\n registerable_found = run 'grep registerable app/models/*.rb'\n if registerable_found\n say ' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!... | [
{
"docid": "4f2fcbedc77a0348756884857aeba031",
"score": "0.6653847",
"text": "def device?\n !user?\n end",
"title": ""
},
{
"docid": "cc089905acf999b490e7056496c6dc36",
"score": "0.64990896",
"text": "def can_be_registered?\n !!!(self.product_status.not_supported?) && !!(self.... |