query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
cf6a3cfb4ee94a88bf2c4cdca4f71806
Check if the request has been opened.
[ { "docid": "7d54ed86aecf681c5a08f2876bf16b16", "score": "0.6735558", "text": "def opened?\n @opened\n end", "title": "" } ]
[ { "docid": "61e29a0a27e0bf754dc3d6459b5a16e4", "score": "0.72075236", "text": "def open?\n @session && @session.started?\n end", "title": "" }, { "docid": "c92b56dbafcdc29a0700ec8aadc0557c", "score": "0.72056943", "text": "def is_open?\n\t\treturn !!@open\n\tend", "title"...
f1b103e25fe1916f6ece7bbbd2b8c102
DELETE /cards/1 DELETE /cards/1.json
[ { "docid": "30a846fe5f165691afdcf55a394a15fd", "score": "0.75265527", "text": "def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url, notice: 'You destroyed this card.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "27f165312ca9d32a7ac8257d8bb8504e", "score": "0.79726166", "text": "def delete_cards\n params[:_json].each do |card|\n if card[:id].nil?\n Card.destroy(card[:id])\n end\n end\n end", "title": "" }, { "docid": "695a0de9f48ae263a2919c5e71175064", ...
2a46fb556b008f0fb1140003733a2b62
GET /test/rand_exams GET /test/rand_exams.json
[ { "docid": "2d8c464347fb5fb96317f15b88c86411", "score": "0.7019012", "text": "def index\n @rand_exams = Xmt::Test::RandExam.all\n end", "title": "" } ]
[ { "docid": "2f7d8db2b81a5052cd2a4620adcfb369", "score": "0.66420954", "text": "def index\n @random_exams = RandomExam.all\n end", "title": "" }, { "docid": "a211885b21ef9daf446415c3569271b8", "score": "0.6468057", "text": "def index\n @my_exams = MyExam.all\n\n respond_to d...
58d1aeab17a8d4d339ac63254c3e4db8
validate :oo validate :identificacions
[ { "docid": "2e2e5b74988dc10bee95016dbfdd1ebd", "score": "0.0", "text": "def in_usemail?\n self.procedencia.to_s != \"OTRO\"\n end", "title": "" } ]
[ { "docid": "08fbb86a9d20c02cfe1c20f64aa1f205", "score": "0.63910663", "text": "def validate_type\n validate @intname => Symbol,\n @id => Integer\n validate_array @strong_against => [Symbol, Integer],\n @resistant_to => [Symbol, Integer],\n @immune_to => [Symbol, Integer]\n ...
e356170da9605aa6db5877afeb87865f
DELETE /stacks/1 DELETE /stacks/1.json
[ { "docid": "94f74252d91fbfcecb4b758adc510448", "score": "0.7645695", "text": "def destroy\n @stack.destroy\n respond_to do |format|\n format.html { redirect_to stacks_url, notice: 'Stack was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "94fafd6bf811a6efd11707aa9ecfa468", "score": "0.7978722", "text": "def destroy\n @stack = Stack.find(params[:id])\n @stack.destroy\n\n respond_to do |format|\n format.html { redirect_to stacks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, ...
9a8567211164c3c309af4d2f1a2b6a3e
Regexp~ ~ rxp => integer or nil MatchMatches _rxp_ against the contents of +$_+. Equivalent to +_rxp_ =~ $_+. $_ = "input data" ~ /at/ => 7
[ { "docid": "4916583a1cb10aa2b87df737450a12a6", "score": "0.0", "text": "def ~\n end", "title": "" } ]
[ { "docid": "57ab74291cf857a41fb52bbf45a8a093", "score": "0.63038105", "text": "def p(i); rex(nil, i, /P/); end", "title": "" }, { "docid": "863a427ee8fd741cdbcd8767d5353122", "score": "0.5878652", "text": "def to_rx\n @rx ||=\n (x = patterns).empty? ? REGEXP_ANY :\n ...
fa34f289b5891470bcb5d16231ac530a
Gets the gamingBlockGameCenterFriends property value. Indicates whether or not to block the user from having friends in Game Center. Requires a supervised device for iOS 13 and later.
[ { "docid": "55a55ed21d39da446acf27b016a08e07", "score": "0.8237316", "text": "def gaming_block_game_center_friends\n return @gaming_block_game_center_friends\n end", "title": "" } ]
[ { "docid": "0170d0a35a96654f806a648c3ed932a1", "score": "0.7637593", "text": "def gaming_block_game_center_friends=(value)\n @gaming_block_game_center_friends = value\n end", "title": "" }, { "docid": "027c4bd84b8d098795c0825cd0b186dd", "score": "0.6670579", ...
e23bedb7240c367949a8ac2c7f57b8c7
Create or replace label Create label if not exists, otherwise replaces the existing label. If label already exists then type attribute cannot be changed.
[ { "docid": "b9085d0a348852f4236af9f7146ad296", "score": "0.0", "text": "def create_or_replace_policy_label_for_infra(label_id, policy_label, opts = {})\n data, _status_code, _headers = create_or_replace_policy_label_for_infra_with_http_info(label_id, policy_label, opts)\n data\n end", "...
[ { "docid": "d770f0e21880876dbd66495a07aef98f", "score": "0.72290176", "text": "def define_label(r, label, element, type)\n err = @name_space_checker.check_for_label_type_mismatch(r, label, type)\n if (err)\n return\n end\n r.define_label(label, element, type)\n end", "t...
cd09ebf71531dc3e35d9a3f719f83691
tests ability of your peer to send a correct WHOHAS request
[ { "docid": "0f54c0bcc6d74571bfd7693004bcd8d6", "score": "0.0", "text": "def test1\n\n cp_pid = fork do\n exec(\"./cp1_tester -p nodes.map -c A.chunks -f C.chunks -m 4 -i 1 -t 1 -d 15\")\n end\n\n\tparent_to_child_read, parent_to_child_write = IO.pipe\n\tpeer_pid = fork do\n\t ...
[ { "docid": "a021e5e50a94acb52d9aa934dd9aab21", "score": "0.5905715", "text": "def verify()\n send_bridge_request()\n begin\n line = gets()\n match = line.match(%r{^HTTP/1\\.[01] ([0-9]{3,3}) (.*)$})\n if (!match)\n raise \"HTTP BRIDGE error: bridge server sent inc...
1028763d5e4ba642687627e2d57b6972
This is an instance method. It can be invoked just from an instance of the object
[ { "docid": "435cd25f4380cf647f5bc245c7a1bcfa", "score": "0.0", "text": "def walk\n @speed = 2\n end", "title": "" } ]
[ { "docid": "b5b25700e97a3ff8649acd443cb60f46", "score": "0.7570911", "text": "def instance; end", "title": "" }, { "docid": "b5b25700e97a3ff8649acd443cb60f46", "score": "0.7570911", "text": "def instance; end", "title": "" }, { "docid": "b5b25700e97a3ff8649acd443cb60f46",...
ad841126c1bf3a70f558f271aa91eaa6
The serialize method is called during xml writing. It should use the writer argument to encode this object into XML. Important note: it is not needed to create the parent element. The parent element is already created, and we only have to worry about attributes, child elements and text (if any). Important note 2: If yo...
[ { "docid": "a19a23fe8bc3e5793f4936d39a070dc7", "score": "0.0", "text": "def xml_serialize(writer)\n @locks.each do |lock|\n writer.start_element('{DAV:}activelock')\n\n writer.start_element('{DAV:}lockscope')\n if lock.scope == Locks::LockInfo::SHARED\n ...
[ { "docid": "5ed71a5f65fa60015dd417def093b908", "score": "0.6974818", "text": "def WriteXml writer\n raise \"NotImplemented\"\n end", "title": "" }, { "docid": "a11d2863320694910bc7d1915658a430", "score": "0.6872443", "text": "def serialize(writer)\n raise S...
6e1ebd1f186279b6327ea0e45bc405e4
MonetDB does not support using DISTINCT withing COUNT by default
[ { "docid": "c8a116cc0718e3e5d02964deac736a71", "score": "0.701542", "text": "def supports_count_distinct?\n false\n end", "title": "" } ]
[ { "docid": "27617f0af2ed41c71e8a893204059183", "score": "0.74781436", "text": "def supports_count_distinct?\n true\n end", "title": "" }, { "docid": "550482d803b632eab100489ce8ccf333", "score": "0.73598576", "text": "def supports_count_distinct?\n true\n end", ...
2f89a5dc77dfd9ed79f2165ee048b8b0
GET /transformations/1 GET /transformations/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "3f7759675ff39124315cd166cf7edaca", "score": "0.6734525", "text": "def index\n @transformations = Transformation.all\n end", "title": "" }, { "docid": "bd9616552769f14766b7cdcb9c23a7aa", "score": "0.66215557", "text": "def index\n respond_with(transformations)\n en...
3631b9a6706dc305b77ed3eaf3bba52b
Greed is a dice game where you roll up to five dice to accumulate points. The following "score" function will be used to calculate the score of a single roll of the dice. A greed roll is scored as follows: A set of three ones is 1000 points A set of three numbers (other than ones) is worth 100 times the number. (e.g. t...
[ { "docid": "78fc8fca843c7315cbb4d47b37f2ddbc", "score": "0.755068", "text": "def score(dice)\n # You need to write this method\n @score = 0\n\n ones = dice.count(1)\n two = dice.count(2)\n three = dice.count(3)\n four = dice.count(4)\n five = dice.count(5)\n six = dice.count(6)\n seven = dice.c...
[ { "docid": "832f4656402f550d2f8dfb3577d99276", "score": "0.7828042", "text": "def score( dice )\n\npoints = 0\n# when there is less then three 5's or 1's\nif dice.count(5) <=2 && dice.count(1) <=2\n if dice.count(2) >= 3\n points += 200\n elsif dice.count(3) >= 3\n points += 300\n elsif dice.co...
0c5507180339d20d3b7d815b73e383ae
Close frame can occur at any time, except if the session isn't open yet. Also, if the buffer is already closed, let's fail: I believe this is a more transparent behaviour.
[ { "docid": "741da5049cb99f75be2b614ca00e72bd", "score": "0.5635628", "text": "def close(status, message)\n # Beware of discarding messages with primitive transports.\n #\n # For instance:\n # session.send(\"I love SockJS!\")\n # session.close(1212, \"I'm a bit bored now.\")\...
[ { "docid": "8d0df9416af10e8421779a013d646f42", "score": "0.6454698", "text": "def close_buffer; end", "title": "" }, { "docid": "26ebc1087e36bc9f77f4ea1ffe6ca983", "score": "0.6161242", "text": "def close?; opcode == TYPES[:close]; end", "title": "" }, { "docid": "14a31...
6abe4dedffacbe21e587c6d6984fb01e
Get all webhooks Returns data about all webhooks of a company.
[ { "docid": "64e8c004289d2cd5cf92d7d6b3bfa184", "score": "0.5541609", "text": "def webhooks_get(opts = {})\n webhooks_get_with_http_info(opts)\n end", "title": "" } ]
[ { "docid": "15844ee119a130c7275678b84d5508b5", "score": "0.75497663", "text": "def all_webhooks(**args)\n params = parameters(args) do\n optional_params\n end\n request(:get, 'webhooks', params)\n end", "title": "" }, { "docid": "99daefde95c93d956b543801d9e...
41d303e8cc48b3a948ddf3056de6e426
Manage the WebSocket's connection being closed.
[ { "docid": "300236aaed405cbc3230c622d9a152a7", "score": "0.0", "text": "def on_shutdown\n @pinger.cancel if @pinger\n super\n end", "title": "" } ]
[ { "docid": "d627c53d1ee3ee32b15c8cdfa7807bd5", "score": "0.76425934", "text": "def connection_closed\n self.connection = nil\n end", "title": "" }, { "docid": "918e7adad7dc504e76af48c7b0e5aca7", "score": "0.7539709", "text": "def on_connection_closing(event)\n end", "t...
c7defcf9fbbf8e64187e82b64c679f54
GET /comments/1 GET /comments/1.json
[ { "docid": "6ecbe69fa88335fbf03b8d6255dfadf7", "score": "0.0", "text": "def show\n @testimonial = Testimonial.find(params[:testimonial_id])\n @comment = @testimonial.comments.find(params[:id])\n end", "title": "" } ]
[ { "docid": "db20166192f49f573bb8746e971d1bf0", "score": "0.82821167", "text": "def comments\n client.get(\"/#{id}/comments\")\n end", "title": "" }, { "docid": "2d7ceb879edc63d117e7ddc1136c4c54", "score": "0.74428797", "text": "def comments\n @list.client.get(\"#{url}/co...
7ad5a384053b54072cf8832e2e4cd514
the json hash for this NormalizedPlace
[ { "docid": "bb53c1f6958f9343e0a7265e10c4a0f4", "score": "0.0", "text": "def to_jaxb_json_hash\n _h = {}\n _h['id'] = id.to_jaxb_json_hash unless id.nil?\n _h['version'] = version.to_jaxb_json_hash unless version.nil?\n _h['value'] = value.to_jaxb_json_hash unless value.nil?\n re...
[ { "docid": "872f71fa2d28cef9d3b3c1463eeaabcd", "score": "0.6829436", "text": "def to_json(*a)\n place_hash = {\n 'id' => self.id,\n 'name' => self.name.to_s,\n 'created_at' => @attributes[:created_at],\n 'updated_at' => @attributes[:updated_at],\n ...
61ffcd4e3415c5c129c5b454b76f9f01
x = [1, [2, 3, [56]], [7, 8]] y = dd_inject(x) y[2] << "hello" p x p y Beware map! The ultimate oneliner.
[ { "docid": "2ea0f735bbdd82c2d4210a361630b6d7", "score": "0.5198195", "text": "def dd_map(arr)\n\n end", "title": "" } ]
[ { "docid": "4265a062afbc0c00fb981bd6d71ef9c1", "score": "0.6222013", "text": "def dd_inject(arr)\n arr.inject([]) {|new_array, element| new_array << (element.is_a?(Array) ? dd_inject(element) : element) }\n end", "title": "" }, { "docid": "948e9842887a15b18a98d992489ffd00", "score": ...
0cec56f87442e627753f9d06161d3332
we're running this check only on the index page
[ { "docid": "6d20c4ebb1040c142b86c35179cef9aa", "score": "0.0", "text": "def index\n @affiliates = Affiliate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @affiliate }\n end\n end", "title": "" } ]
[ { "docid": "edba20f2c26f251472e35eebf79a7131", "score": "0.68851364", "text": "def check?\n index?\n end", "title": "" }, { "docid": "16e4578cce8fe0b3fefd1d65521cbe85", "score": "0.65717274", "text": "def check\n if index\n report_template(:ok)\n else\n ...
e86e49ad4a7da1a78479a5e00e090907
Makes a error message
[ { "docid": "2b3c1a011be169e6cf700210a16f7124", "score": "0.0", "text": "def error_message(response_body, opts = {})\n message = []\n\n opts[:error_description] && message << opts[:error_description]\n\n error_message = if opts[:error_description] && opts[:error_description].respond_to?(:e...
[ { "docid": "8f25f58c0470d19321aadd411ececaf1", "score": "0.8145084", "text": "def error(message); end", "title": "" }, { "docid": "40a8144526db2ab7c9d99dbed7f74cd2", "score": "0.7877027", "text": "def error(what)\r\n\t\t\tmessage 'ERROR: ' + what.to_s, :error\r\n\t\tend", "title"...
c3a0a6885cbd98cb67d72bd844ae7abc
Returns the value of attribute initial_query. source://graphiqlrails//lib/graphiql/rails/config.rb10
[ { "docid": "9882ea9ba74a42b8b844624af369face", "score": "0.66513836", "text": "def initial_query; end", "title": "" } ]
[ { "docid": "a9e71e2da97db85c50726fff9bf77ac0", "score": "0.63176763", "text": "def initial_query=(_arg0); end", "title": "" }, { "docid": "4d018eb16f1d3ae7ade6b02e0eee0d93", "score": "0.62145215", "text": "def query\n @options[:query].presence\n end", "title": "" ...
dd615a70b8e6d51d396ad935665e6d8e
After a hand is done, allows player to start another hand if they have chips left
[ { "docid": "b0b8757879035abe75ca3058f72e7bcc", "score": "0.6818304", "text": "def handle_hand_over\r\n user = @players.select { |player| player.is_a?(User) }.first # Get user\r\n # If user has no chips, their game is over; end game\r\n if user.chips <= 0\r\n return print \"\\n\\n%38s\\n\" ...
[ { "docid": "4d31238af367457edf7f131fe91df0fd", "score": "0.745141", "text": "def hand_finished\n\t\tend", "title": "" }, { "docid": "2467e37e6e99bc13a0c8f97fca583ffc", "score": "0.7242824", "text": "def hand_started\n\t\tend", "title": "" }, { "docid": "c06761b8a6ee2d68e4...
eeff9143e4ecd482ab597a53f758dd82
Write a method print_triangle which takes at its input an integer representing the number of rows to print, and prints out a right triangle consisting of characters, one line per row. For example, print_triangle(5) should print out: And print_triangle(2) should print out: If we pass in 0 it should print nothing (not ev...
[ { "docid": "d987b4f378920212b5748912a3f05196", "score": "0.0", "text": "def print_triangle(rows)\n star = \"*\"\n rows.times do\n puts star\n star += \"*\"\n end\nend", "title": "" } ]
[ { "docid": "f68433b22b0438a686601726faafbee4", "score": "0.8183941", "text": "def print_triangle(rows)\n if rows <= 0\n raise ArgumentError.new(\"Only non-negative numbers are allowed\")\n else\n rows.times {|x| puts \"*\" * (x+1)}\n end\nend", "title": "" }, { "docid": "350cb7c0cab...
5f415da65a87faa69d68c2ee2bb2305f
Write string to io
[ { "docid": "13b6b4c9f77f0dbf2e8d9dc2b9cf349b", "score": "0.0", "text": "def puts(string=\"\\n\")\n io.puts(string)\n end", "title": "" } ]
[ { "docid": "02d9aaa01a0267e91eade8f05808cf46", "score": "0.82476336", "text": "def write(io)\n each { |str|\n io << str\n }\n end", "title": "" }, { "docid": "64a1e5451416d6e8b6dd1674888761a1", "score": "0.8161296", "text": "def write(string); end", "title": "...
0168351a43703178a3effcc830d1294b
CONFIG_PRIVMSG_ONLY = %[ host localhost channel morischan privmsg_message out_ikachan: %s [%s] %s privmsg_out_keys tag,time,msg time_key time time_format %Y/%m/%d %H:%M:%S tag_key tag ]
[ { "docid": "cf7c1dc079581ed48ce9dae84f083047", "score": "0.6813644", "text": "def test_privmsg_only\n d = create_driver(CONFIG_PRIVMSG_ONLY)\n time = event_time\n ts = Time.at(time.to_r).strftime(d.instance.time_format)\n d.run(default_tag: 'test') do\n d.feed({'msg' => \"privmsg messag...
[ { "docid": "8ebf2137af7d1d16a4dfd33e60c9496f", "score": "0.59950465", "text": "def privmsg! receivers, text\n $bot.send_line \"PRIVMSG #{receivers.join ','} :#{text}\"\nend", "title": "" }, { "docid": "9e5ed586d616ec66f3664adb5d496097", "score": "0.5892956", "text": "def privmsg ( t...
4dab2ef32c68fcd1bd6c969de6260d6a
Date=== ===(other) The relationship operator for Date. Compares dates by Julian Day Number. When comparing two DateTime instances, or a DateTime with a Date, the instances will be regarded as equivalent if they fall on the same date in local time.
[ { "docid": "804cd97c32454a4c0010e500b61a68a8", "score": "0.0", "text": "def ===(arg0)\n end", "title": "" } ]
[ { "docid": "a810354a04a229d315db16105ca29a9b", "score": "0.80591106", "text": "def ===(other)\n case other\n when Date\n @days.include? Date.jd(other.jd) #in case it's a DateTime\n when Time\n @days.include? Date.civil(other.year, other.month, other.day)\n else\n super\n en...
e50ccfa9326b8bf20dd4eb9a8910e385
This API is for sending a new fax in any fax numbers anywhere in the world
[ { "docid": "b4592dfaee57f7b426472dfa505136aa", "score": "0.5423548", "text": "def fax_post_with_http_info(fax_number, document_id, api_key, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FaxSendingApi.fax_post ...'\n end\n # verify the ...
[ { "docid": "87f3243ff8be489e6ff36ef621759f5a", "score": "0.7093415", "text": "def send_to_fax(fax_number)\n raise \"Can't fax Asset: #{self.inspect} is not faxable\" unless faxable?\n Dropio::Client.instance.send_to_fax(self, fax_number)\n nil\n end", "title": "" }, { "docid": "1d8...
30149f0d560af67b112c436edc5c71e6
Private: Call the low level cgroups deletion
[ { "docid": "d875d4f6fd8670c6334212dfcfeb5ea8", "score": "0.65485495", "text": "def cgdelete\n force_stop = false\n cgroup_paths.each do |subsys, path|\n while File.exist?(path)\n begin\n Dir.rmdir(path)\n rescue Errno::EBU...
[ { "docid": "047d2532f2da378d22693480cd95fb1d", "score": "0.7626731", "text": "def delete\n with_cgroups_lock do\n update_cgconfig(nil)\n update_cgrules(false)\n cgdelete\n end\n end", "title": "" }, { "docid": "ec1d9b0bd8f...
1dc15ddb10374418504d85267ef99c0e
post params = device_id, auth_key, profile_url
[ { "docid": "481cc5e62fd9a402f7df8d8f79fc5fcb", "score": "0.7267032", "text": "def newprofile\n result = {}\n result[:status] = \"failed\"\n if params[\"auth_key\"] != nil and params[\"device_id\"] != nil and params[\"profile_url\"] != nil and device = Device.where(:id => params[\"device_id\"], ...
[ { "docid": "9c44e1f0d7a8c615f5dd7e740cc5cc94", "score": "0.7254974", "text": "def device_params\n params.require(:device).permit(:auth_key, :parse_token, :profile_url)\n end", "title": "" }, { "docid": "87ca2fc7a0775952ec733e9f60140aff", "score": "0.6336062", "text": "def cre...
8853c0d8296cab50443565cb3c4834c4
Converts camel case clientOptions, as used in spec tests, to Ruby driver underscore options.
[ { "docid": "605d9cc01bbf0de668d0193f35654ec6", "score": "0.7452978", "text": "def convert_client_options(spec_test_options)\n mapper = Mongo::URI::OptionsMapper.new\n spec_test_options.each_with_object({}) do |(name, value), opts|\n if name == 'autoEncryptOpts'\n auto_encryption_option...
[ { "docid": "64c37932ab6b6ad5e5f253d81d3b3dd0", "score": "0.71098536", "text": "def camelize_options(options)\n options.dup.each do |k,v|\n options[k.to_s.split('_').inject([]){|c,word| c.push(c.empty? ? word : word.capitalize)}.join] = v\n end\n end", "title": "" }, { "do...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "3357d98a61ff1734c88733e08182e2dd", "score": "0.0", "text": "def set_calendar\n @calendar = Calendar.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;...
b3e2566036aed05be60627556ff03326
Attempts to match against the given controller.
[ { "docid": "c19fbf1be7a016c134a74b779d0aa2ce", "score": "0.6650185", "text": "def matches?(controller)\n if not controller?\n true\n elsif not action?\n @controller_name == controller.controller_name\n else\n @controller_name == controller.controller_name ...
[ { "docid": "35ec1212165790690fe59424b59eb78a", "score": "0.7351268", "text": "def check_controller!(controller)\n if (pattern = controller.settings.route_pattern)\n return unless pattern === request.path_info\n end\n catch(:pass) { controller.new(self).cal...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "f0bf8345ce0baa3ed114557e8e04fa8b", "score": "0.0", "text": "def apartment_option_params\n params.require(:apartment_option).permit(:name)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7497917", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69572496", "text": "def strong_params\n params.require(:request).permit(param_whit...
d3b0bb250b86bfdb32655760a853e892
This is run inside .all, after all of the records have been loaded via .each, but before any block passed to all is called. It is called with a single argument, an array of all returned records.
[ { "docid": "3d38a1391f6a3b42d71d22a349356a8e", "score": "0.6901912", "text": "def post_load(all_records)\n end", "title": "" } ]
[ { "docid": "6c8c5e125aa8e24f807f29adf0b70996", "score": "0.6670357", "text": "def each(&block)\n @all.each(&block)\n end", "title": "" }, { "docid": "6ab5b70fdbf87cdcd24212840fe88cfa", "score": "0.6532107", "text": "def each(&block)\n @records.each(&block)\n e...
21d6f53aff3fec7b31f3d12ef71ce260
assert_partial good, as is
[ { "docid": "2c8abbc24e302c1f300ae6a67d403486", "score": "0.77506834", "text": "def assert_partial(*args)\n p=c=nil\n [args].flatten.each do |e|\n p=e if e.kind_of? String\n c=e if e.kind_of? Integer\n end\n p=@partial if p.blank?\n c=1 if c.blank?\n #...
[ { "docid": "ae4784c1f930f5a567b7a1666f274121", "score": "0.67569935", "text": "def test_partial_only\n get :partial_only\n assert_equal \"only partial\", @response.body\n end", "title": "" }, { "docid": "17b3ba5ba7ff261337f36d5183d7ab9f", "score": "0.63106585", "text": "def te...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "5968ebad7414723d15d595a128f3a427", "score": "0.0", "text": "def set_outmail\n @outmail = Outmail.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;...
c998b96eba4749a75891d0303fcbd800
Choose the layout to use. See
[ { "docid": "c784584436062bd6ac8594d3f63bca9e", "score": "0.0", "text": "def choose_layout\n oauth_url = url_for(:controller => :oauth, :action => :oauthorize, :only_path => true)\n\n if [ 'api_details' ].include? action_name\n nil\n elsif params[:referer] and URI.parse(params[:referer]).pa...
[ { "docid": "3283f75cc8b71586caf86f4af762ccc7", "score": "0.79980445", "text": "def choose_layout\n layout_name unless request.xml_http_request? || ! params[:no_layout].blank?\n end", "title": "" }, { "docid": "583a06709f913b44f75d62eed80e7ff1", "score": "0.798305", "text": "d...
8faaaec0e9afbc38a79c63d1e2ac5afe
=begin def share_icon "view marked:'Share.png'" end def print_queue "view marked:'Print Queue' index:0" end =end
[ { "docid": "6e22fb3e9f1ffe4b4770f96b4b2fd76f", "score": "0.0", "text": "def navigate\n unless current_page?\n preview_screen = go_to(InstagramPreviewScreen)\n sleep(WAIT_SCREENLOAD)\n #wait_for_elements_exist(preview_screen.share, :timeout => MAX_TIMEOUT)\n #touch preview_...
[ { "docid": "e655dade82c625c8c0b80a8049b23f36", "score": "0.6234103", "text": "def info_display\n @queue << \"i d\"\n end", "title": "" }, { "docid": "e1218b7d80aced1d8fdad05ba5b7c51e", "score": "0.61553115", "text": "def display_resource_icon(document)\n\n #Set the queue_na...
9fdcc399d909dee8b792d3d4e52d31cf
Wait for result and returns the value
[ { "docid": "7ad75bca3f37ebc4da50768a8fa9dc8a", "score": "0.7533018", "text": "def result\n manager&.wait_for(execution_order)\n nil\n end", "title": "" } ]
[ { "docid": "34f9fcc6df06bd226d4b348685550d1c", "score": "0.80620563", "text": "def result\n wait_for :all\n end", "title": "" }, { "docid": "8133f1022b1c0f41507c65a72fb1dc3c", "score": "0.7887989", "text": "def wait\n result = @internal_future.get\n result_transform...
bf4539d98535ed90373bae64ca8d8710
=> "Hello, Bill!" use & to go proc to block as well
[ { "docid": "5a053b91915373753354541930b7780f", "score": "0.0", "text": "def another_method(greeting)\n \"#{greeting}, #{yield}!\"\nend", "title": "" } ]
[ { "docid": "65483abd38b767fbbee75c859e63cd45", "score": "0.7541769", "text": "def say_hello(&block)\n puts \"Hello, world\"\n name = block.call\n puts \"You entered #{name} as your name\"\nend", "title": "" }, { "docid": "87cbc7a341e107a0527eac6e160c1631", "score": "0.71303177", "...
e1c3a7f46786f63cef25898369b6c9a6
DELETE /patients/1 DELETE /patients/1.json
[ { "docid": "3ae3d3608b92264e11ed53011361de33", "score": "0.0", "text": "def destroy\n @email = current_user.email\n @patient = Patient.find(params[:id])\n \n if params[:doctor_id] && (current_user.doctor || current_user.admin)\n @doctor = Doctor.find(params[:doctor_id])\n @patient ...
[ { "docid": "c77f2ae848e9dc4375e05fe68defe689", "score": "0.7820352", "text": "def destroy\n @patient = Patient.find(params[:id])\n @patient.destroy\n\n respond_to do |format|\n format.html { redirect_to patients_url }\n format.json { head :ok }\n end\n end", "title": "" }, ...
4fa510f5927f8e195c411f997fbf5ad0
GET /message_logs/1 GET /message_logs/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "b4ac4911ae0537ccf9e4ba0c7faa0748", "score": "0.70226055", "text": "def logs\n response = @client.get '/logs?json=true'\n JSON.parse response.body\n end", "title": "" }, { "docid": "95d3f6adc5508a02c3be9147010e811e", "score": "0.68813336", "text": "def read_lo...
f498b590f434779f733477f0bf5164b6
List of typed_strings that form the argument list. This is only used to resolve nil when the receiver of the arguments accepts nil values.
[ { "docid": "8eb1231893a33b06e040c552da19b438", "score": "0.0", "text": "def list\n @list ||= self.empty? ? [] : [self]\n end", "title": "" } ]
[ { "docid": "832dbbceb31f615f654dd9fac6e822ce", "score": "0.6784221", "text": "def getTypedArgsWithoutValue\n # Add a comma to cascade other initializer arguments\n @typedArgSetWithoutDefault.empty? ? \"\" : \", #{@typedArgSetWithoutDefault}\"\n end", "title": "" }, { "docid": "f...
e0c9b57a4cf447cce8bac6d57ad93406
Queries SportsData's event info API
[ { "docid": "1a669c215d8c44bd661c7f82dd81a31c", "score": "0.0", "text": "def event_info(event_uuid)\n get(\"event/#{event_uuid}.xml\").body\n end", "title": "" } ]
[ { "docid": "f8d3df64d0b23c0d0e6940601dd8f1a4", "score": "0.66295433", "text": "def query\n #expand: \"ticket_availability\" to get info whether sold out\n #limit to live only events, most recent first\n EventbriteSDK::Organization.new(id: @org_id).events.retrieve(api_token: @eventbrite_ap...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "973d6cd711d7b03ddfa04974f202b04a", "score": "0.0", "text": "def sys_user_params\n params.require(:sys_user).permit(:username, :password, :gender, :birthday, :department_id, :role_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
adac2dbfa2e14997406414d673d3f671
Returns the Restful resource class for the designated model (or +nil+).
[ { "docid": "258a597a8dfbd735f676b347fcb728bd", "score": "0.7219905", "text": "def class_for_model(model)\r\n classes.find { |resource| resource.model == model }\r\n end", "title": "" } ]
[ { "docid": "68deb63840cf681c480b66cae935e68a", "score": "0.7876097", "text": "def resource_class\n model_name = name.split('#', 2).first\n begin\n model_name.pluralize.classify.constantize\n rescue\n model_name.to_sym\n end\n end", "title": "" }, { "docid...
56a8510a5965c0823a53caee1d8f850b
GET /crud_tramites GET /crud_tramites.json
[ { "docid": "356896dc083a6fac9afd026e91e6074a", "score": "0.72279596", "text": "def index\n @crud_tramites = CrudTramite.all\n end", "title": "" } ]
[ { "docid": "bc50d69065e832bc380475b9b8c2549f", "score": "0.6927776", "text": "def index\n @tramites = Tramite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tramites }\n end\n end", "title": "" }, { "docid": "05d09302be982f21a6...
525fb286a8f8847c5e61390ee2bfac43
DELETE /chamados/1 DELETE /chamados/1.json
[ { "docid": "965bf83f63d9971814ad178b4e83d7e2", "score": "0.7007619", "text": "def destroy\n @chamado.destroy\n respond_to do |format|\n format.html { redirect_to chamados_url, notice: \"Chamado #{t('messages.destroyed')}\" }\n format.json { head :no_content }\n end\n end", "title...
[ { "docid": "f8ec51d1d5d828ec0c2e2d9eebeb6a17", "score": "0.73038644", "text": "def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7994cd34350c65161ea797f91a3f5dbd", "score": "0.7216035", ...
4709c7c31c99b96a7ee6600d579c2262
Two rules are equal if they have the same list of landmarks and the same direction
[ { "docid": "ab7af1f44bba5c80f4fa0e776b6c1bcd", "score": "0.69573116", "text": "def ==(rule)\n return ((self.landmarks == rule.landmarks) && self.direction==rule.direction)\n end", "title": "" } ]
[ { "docid": "ff1f7f34baab35456c7ab8c52a07b9f5", "score": "0.6876725", "text": "def same_land?(other)\n land == other.land\n end", "title": "" }, { "docid": "8735066c790244fc5b30be610db76c00", "score": "0.55693287", "text": "def samedirection?(vector2)\n end", "title": "" },...
09abd53ff33f486b053a183d737b6440
When was this build started? This returns a timestamp (a Time object) that's created in the constructor of this object.
[ { "docid": "0e1567adbfa81e4b60c9bcbe05341416", "score": "0.78239626", "text": "def build_timestamp\n @build_timestamp\n end", "title": "" } ]
[ { "docid": "e019338e8982841a64271328b7d8a531", "score": "0.73947585", "text": "def launch_date_time\n return @launch_date_time\n end", "title": "" }, { "docid": "1847f8a9f561daea6a5eae5fec4d338c", "score": "0.73869604", "text": "def get_start_time()\n r...
066675d4dedb4f6f6bebce652b9d552f
Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results.
[ { "docid": "8b05c4ff0160e86313119c8ac31e5e41", "score": "0.0", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RefundChargeResultSet.new(resp)\n return results\n end", "title": "" } ]
[ { "docid": "c4ca32683e8ce75eb6a187d63df8fa77", "score": "0.76639634", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = DoneResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "6f7a7d9be674ad4cf17d6743eb1f7836", "scor...
2e519ed1e1c2ddf15d0415cd39c18353
host & path as is needed below ...
[ { "docid": "753841834178618523876f6beeceef07", "score": "0.66895694", "text": "def host\n local_file? ? \"file://\" : split_url[1]\n end", "title": "" } ]
[ { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.72316796", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.72316796", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "...
03211d7046101f8a00e1357aa3eb2360
POST /sales_invoices POST /sales_invoices.json
[ { "docid": "3c78d541e72ec1f999c9fe059ccb7bea", "score": "0.6772914", "text": "def create\n @stampeds = Stamped.all\n @sales_invoice = SalesInvoice.new(sales_invoice_params)\n @sales_invoice.sales_invoices_items.each do |f|\n f.sub_total = f.price * f.quantity\n f.iva = f.sub_total / 1...
[ { "docid": "9e2fca76928de8e51da3da4e457255c4", "score": "0.7878657", "text": "def create_sales_invoice(data, _options = {})\n lines = data.delete(:line_items)\n\n if lines\n data[:line_items_attributes] = {}\n lines.each_with_index do |value, index|\n data[:lin...
1190db1fabdf72a9b8575c17fea01c45
GET /varnish_servers/1 GET /varnish_servers/1.json
[ { "docid": "959aa15ebb9f4a9f9cd9d7919b3b3e62", "score": "0.7785327", "text": "def show\n @varnish_server = VarnishServer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @varnish_server }\n end\n end", "title": "" } ]
[ { "docid": "6705ce58e3a30164615451aa94030fb8", "score": "0.7750075", "text": "def index\n @varnish_servers = VarnishServer.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @varnish_servers }\n end\n end", "title": "" }, ...
603e1245c823574b2ea8468420644768
hook method for subclass to override
[ { "docid": "a34547a7c3b6f546ba49161af9d00e95", "score": "0.0", "text": "def local_spares\n {}\n end", "title": "" } ]
[ { "docid": "c4f7dd6eeb37ed335dff85a815b8f034", "score": "0.7657025", "text": "def process_hook\n fail 'child class to implement'\n end", "title": "" }, { "docid": "e6431ff47476c9014fb64198d5853e1e", "score": "0.76062876", "text": "def overrides; end", "title": "" },...
ec9715bd34ab2bf8facf68e5c65469e6
check if file exists and raise exception
[ { "docid": "e86de7e2818c1942f1566e97688c260e", "score": "0.7165516", "text": "def fail_script_unless_file_exists(path)\n fail_script_unless path != nil && (File.directory?(path) || File.exists?(path)), \"File doesn't exist: '#{path}'\"\n end", "title": "" } ]
[ { "docid": "3d9cd87130331ff7b8093e759de9af63", "score": "0.8580532", "text": "def check_exists\n raise GlusterFS::Error, \"File does not exist: #{@path}\" unless exists?\n end", "title": "" }, { "docid": "ce723e035b5284034f41a911e7675c43", "score": "0.8331296", "text": "def check...
951c58d712e694f2ca28243707701e63
prints a prompt to specify it is the users turn, gets users turn from input
[ { "docid": "8e1408523de1205b501cefb8d40a4696", "score": "0.0", "text": "def turn(board)\n puts \"Please enter 1-9:\"\n input = gets.strip\n index = input_to_index(input)\n if valid_move?(board, index)\n move(board, index)\n else \n turn(board)\n end\n display_board(board)\nend", "title"...
[ { "docid": "00b6d956a3f1a5b87f47832613f7d894", "score": "0.7967047", "text": "def decide_turn\n print 'Who will be starting? [x : o]'\n user_input = gets.chomp\n\n @state.assign_turn(user_input)\n end", "title": "" }, { "docid": "40c57e9b6789fd8ff03f7e08b219bfe6", "score": "0.7...
3b2d1ec80a1a8dc2b9e05eb2554addef
Sum up only numbers in an array
[ { "docid": "3c78952e80ed35dd7b0d58287d284083", "score": "0.7963893", "text": "def sum_up_numbers(arr)\n\tarr.select { |x| x.is_a? Integer }.inject(0, :+)\nend", "title": "" } ]
[ { "docid": "d5ac60c42d5d86855e239b2d17fef2d4", "score": "0.8488601", "text": "def sum_only_numbers(an_array)\n\n sum = 0\n\n an_array.each { |y| sum+=y if y.is_a?Numeric }\n\n return sum\n end", "title": "" }, { "docid": "683d26e8893e8d3a1c68c8a71443e688", "score": "0.8478373",...
1c422ec9932e8474fdef1df6c71a9d95
Add a new message This is used when result is being prepared
[ { "docid": "3f7a723820c529c366354377f54b8c45", "score": "0.7002798", "text": "def add(message)\n @empty = nil\n source_messages << message\n messages << message\n self\n end", "title": "" } ]
[ { "docid": "57ae2ce7c44bd53e75515356c3b2a81b", "score": "0.72659504", "text": "def add_message(message)\n @messages[message.id] = message unless message.nil?\n end", "title": "" }, { "docid": "b4e39ce441360889614c6db6972ab8e3", "score": "0.72521025", "text": "def add_...
7db424f288def2eb96726fa1e31aca22
Returns the string indicating SSL version
[ { "docid": "c56104c970a0985ad58a2306257ef869", "score": "0.8002869", "text": "def ssl_version\n datastore['SSLVersion']\n end", "title": "" } ]
[ { "docid": "801118cadf271b179ca857132597d7ac", "score": "0.859307", "text": "def ssl_version\n if to_text =~ %r{^\\s+Version: (\\d+)}m\n $1.to_i\n end\n end", "title": "" }, { "docid": "e4961ec67ac8f47993f9011a747f9786", "score": "0.84947443", "text": "def ssl_version; en...
0f0f46ec837361f90b2b17423dfcb98f
The hash of nestings of other resources
[ { "docid": "7c48d9ff281b5bde9f3dbf0098289066", "score": "0.0", "text": "def nestings\n @nestings ||= {}\n end", "title": "" } ]
[ { "docid": "6b1f29632490e7c866109449295d6525", "score": "0.67841357", "text": "def hash\n\t\t\t@path.hash\n\t\tend", "title": "" }, { "docid": "2995f14406c97b37355769ea977a3cb5", "score": "0.6751553", "text": "def hash\n [_hash, name, owner].hash\n end", "title": "" }, ...
a3261a233b595beabaffa4df47a64fbd
PATCH/PUT /gce_servers/1 PATCH/PUT /gce_servers/1.json
[ { "docid": "a52c26c4d3ce3625a6ab04b92a79f535", "score": "0.7096727", "text": "def update\n respond_to do |format|\n if @gce_server.update(gce_server_params)\n format.html { redirect_to @gce_server, notice: 'Gce server was successfully updated.' }\n format.json { render :show, statu...
[ { "docid": "cb51ec78da0453254f835e7edf96d027", "score": "0.68892777", "text": "def update\n @server = compute.get_server(params[:id]).update(:name=>params[:name])\n respond_to do |format|\n format.html { redirect_to servers_path, :notice => 'Server was successfully updated.' }\n form...
8dd6a804102efad595126ed3a8dcf30e
Checks if any relative page urls is exists
[ { "docid": "fe9f2ba00d82e1be0045ddd6605cc474", "score": "0.0", "text": "def any?()\n not_implemented() \n end", "title": "" } ]
[ { "docid": "5ab9df0c03dfae7aeecc260ff5cf409d", "score": "0.6848535", "text": "def contains_links?\n !@url.nil?\n end", "title": "" }, { "docid": "7556359d2a756567501f3bd5e1f0bc33", "score": "0.6674139", "text": "def dir_has_index?(relative_path)\n relative_path << \"/\" ...
a6cf5fe03d9f38f8a80253316b38363c
returns full name with type
[ { "docid": "452b7e6b60df7d9099e0f302ffe03e17", "score": "0.74606687", "text": "def full_name\n @full_name ||= \"%s %s\" % [type, label]\n end", "title": "" } ]
[ { "docid": "c2ab28b4aa76c1db5e1d08a2b99f7851", "score": "0.846514", "text": "def type_name(type); end", "title": "" }, { "docid": "304570f0ca04fd96bbe5f5d7fefaa49e", "score": "0.81190515", "text": "def type_name\n Name.new(type.to_s)\n end", "title": "" }, { "doci...
3fb24f4f9c60812536b0cae632de90ac
Table name: gtfs_stop_times id :integer not null, primary key arrival_time :integer not null departure_time :integer not null stop_sequence :integer not null stop_headsign :string pickup_type :integer drop_off_type :integer shape_dist_traveled :float timepoint :integer interpolated :integer default(0), not null created...
[ { "docid": "26f9cfec5a68fa62bb9614bd9a2861ad", "score": "0.5630161", "text": "def display_trip(stop_times)\n stop_times.each do |st|\n puts \"stop_sequence #{st.stop_sequence} stop_id #{st.stop_id} #{st.stop.stop_name} arrival_time #{st.arrival_time} departure_time #{st.departure_time}\"\n end\nend...
[ { "docid": "919546e315d2575d2f6b84a72d6fccaa", "score": "0.64251643", "text": "def stop_times\n @trip_id = self.trip_id\n @stop_times = StopTime.where(trip_id: @trip_id)\n end", "title": "" }, { "docid": "d9c4fd5d87c8362934370ce4a1a67c75", "score": "0.6376668", "text": "def st...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "6c5685d622e33dbdff9bda52936cb9a5", "score": "0.0", "text": "def time_value_params\n params.require(:time_value).permit(:work_time, :break_time, :schedule_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.79428834", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.6957111", "text": "def permitted_params\n params.permit!\n end", "title"...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "daf875328070186148a03a4293907d02", "score": "0.0", "text": "def set_cobrador\n @cobrador = Cobrador.find(params[:id] || params[:cobrador_id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "1324bf55aa2391ab9c2286903f095674", "score": "0.0", "text": "def set_collectable\n @collectable = Collectable.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6031952", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015048", "text": "def...
6a35d2dd76f00d69cd53067446742a7e
Gets a list of matches for the given team and event.
[ { "docid": "60b6b66300f34591173fc32a8b272654", "score": "0.6335171", "text": "def get_team_event_matches_with_http_info(team_key, event_key, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: MatchApi.get_team_event_matches ...'\n end\n # v...
[ { "docid": "035b393723664358c8ac224a1df2894e", "score": "0.8102816", "text": "def get_team_event_matches ( team_key, event_key )\n get_api_resource \"#{@@api_base_url}team/#{team_key}/event/#{event_key}/matches\"\n end", "title": "" }, { "docid": "a996b8b8fc425da4ec662de540c0752c", "...
163bdbbf9d19fcf516be4630382812ca
GET /notifications GET /notifications.json
[ { "docid": "c3cc62e9448c96acb24bf6d6254eb1bb", "score": "0.6301699", "text": "def index\n @notifications = Notification.all.order(:id)\n end", "title": "" } ]
[ { "docid": "c54b3657ccc31be3ef4663b28cbf2e0b", "score": "0.8339561", "text": "def notifications\n query_api_object Notification, \"/rest/notifications\", nil, \"GET\", \"notifications\"\n end", "title": "" }, { "docid": "b65ed565a82f4b421fcb6432bbf22357", "score": "0.8280543", ...
64765011b37fa76091d1e66c8bac771b
Parse chart data into hash for results
[ { "docid": "d303299420a16b3a2f5b8e7c7544040c", "score": "0.67225564", "text": "def parse_chart\n # Break into major sections\n content = File.read(self.png_input_path).split(/\\n\\n\\n/).map(&:strip)\n rna_content = File.read(self.png_input_rna_path).gsub(/\\r/, \"\\n\").split(/\\n\\n\\n/).map(...
[ { "docid": "d213a6f387b883605280ddaa528979c2", "score": "0.6993133", "text": "def chart_processing(data)\n ActiveRecord::Base.connection.execute(\"SET temp_buffers = '4GB';\")\n case data['x_data']['type']\n when 'datetime'\n hash = date_chart_processing(data)\n\n when '...
0cca5ea0fa52ff5f7311627775baaaa1
POST /vestimentas POST /vestimentas.xml
[ { "docid": "1284d9ecf5481f013e2622d24ada12e0", "score": "0.56883925", "text": "def create\n @vestimenta = Vestimenta.new(params[:vestimenta])\n \n respond_to do |format|\n if @vestimenta.save\n flash[:notice] = 'Vestimenta creada correctamente.'\n format.html { params[:oper]...
[ { "docid": "d939dbe51500b0f0a44cc5176b95a028", "score": "0.6231981", "text": "def create\n @vestimentum = Vestimentum.new(vestimentum_params)\n\n respond_to do |format|\n if @vestimentum.save\n format.html { redirect_to @vestimentum, notice: 'Vestimentum was successfully created.' }\n ...
80fcd7e33b8c5a0c839881460d4d1558
Helper to define a generic single resource field
[ { "docid": "f9891167cbafadd43ef253cd9ee42db4", "score": "0.71839076", "text": "def singular_resource_field(name, type_class, options = {})\n field(name, type_class,\n null: false,\n description: \"For fetching a single #{name.to_s.humanize.downcase} (#{options[:descripti...
[ { "docid": "95b8ea4e64b0d26bd493d7d55197d572", "score": "0.6395125", "text": "def has_one(resource, *args)\n field \"#{resource.to_s}_id\".to_sym, Fixnum\n end", "title": "" }, { "docid": "11df50ce0efc79e3491a0b7bf5dc47bf", "score": "0.639051", "text": "def resource_type\n ...
87e0757d4ba76d24b3ea7b7bbedd2b79
Remove a source from the workspace. The source will not be removed if its file exists and the workspace is configured to include it.
[ { "docid": "d322b50f3b64bfb5ec1dcd8c53705c2f", "score": "0.56731725", "text": "def remove filename\n return false unless source_hash.key?(filename)\n source_hash.delete filename\n true\n end", "title": "" } ]
[ { "docid": "39207031d462fded04d5039c2aaa78ef", "score": "0.6925373", "text": "def remove_source(*source)\n unless source.blank?\n what.query[:sources] && what.query[:sources] >> source.flatten\n changed\n end\n end", "title": "" }, { "docid": "919c942a2cf...
eb58fb3446a99faf0089afcf35f74ec6
Initializes authorization for the provided user.
[ { "docid": "3600ded7ed4d007c238490b46c8bdc81", "score": "0.6602254", "text": "def initialize(user)\n if user&.admin?\n admin\n elsif user&.viewer?\n viewer\n else\n # If a user was not provided or has no defined role,\n # then the user should not be able to access anything.\...
[ { "docid": "22ae247e685cf4bdbb46aa5daa59f7e4", "score": "0.75078326", "text": "def initialize(user)\n authorize_guest(user)\n return if user.nil?\n\n authorize_admin(user)\n end", "title": "" }, { "docid": "7a21e7ebf559fcfda5aae532086fc3a4", "score": "0.7419441", "text": "d...
6bb3f00e4b84959e4a4878a96a81e968
required parameters: name: internet_charge_type, type: String optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: owner_id, type: Long name: resource_owner_account, type: String name: resource_owner_id, ty...
[ { "docid": "2ff2f7c1e6043aa769cdcdd8c4d2757b", "score": "0.63115615", "text": "def open_cdn_service(internet_charge_type, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'OpenCdnService'\n\t\targs[:query]['InternetChargeType'] = internet_charge_type\n\t\targs[:region] = opti...
[ { "docid": "8eba19b97bd64fdaf89e8f2515c810ff", "score": "0.6517199", "text": "def modify_cdn_service(internet_charge_type, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyCdnService'\n\t\targs[:query]['InternetChargeType'] = internet_charge_type\n\t\targs[:region] = o...
8b37cb3575e0a9e06522575fab8a7837
method to serve up XML OpenSearch description and JSON autocomplete response
[ { "docid": "67b5b20861a3d43f67fc23aa894b66df", "score": "0.6930433", "text": "def opensearch\n respond_to do |format|\n format.xml do\n render :layout => false\n end\n format.json do\n render :json => search_service.opensearch_response\n end\n end\n end", "ti...
[ { "docid": "0a702de1b596cb6fa3235e7213135665", "score": "0.67457527", "text": "def opensearch\n respond_to do |format|\n format.xml { render layout: false }\n format.json { render json: get_opensearch_response }\n end\n end", "title": "" }, { "docid": "13a5839a3ec83eee026...
24272f695ab0ae182d945319e6ec948a
GET /camera_catalogues/new GET /camera_catalogues/new.json
[ { "docid": "470eb1f1fa30a93cf178feaf6201aad0", "score": "0.82481074", "text": "def new\n @camera_catalogue = CameraCatalogue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @camera_catalogue }\n end\n end", "title": "" } ]
[ { "docid": "c1648cc02368d24c8504bdbee837d8cd", "score": "0.7664515", "text": "def create\n @camera_catalogue = CameraCatalogue.new(params[:camera_catalogue])\n\n respond_to do |format|\n if @camera_catalogue.save\n format.html { redirect_to @camera_catalogue, notice: 'Camera catalogue ...
a6a809764e28cafd3a3f7fe53236aa8a
This method should traverse a keypath and return an object for use in future calls to traverse of contextualize.
[ { "docid": "35919f075edc1c6d94a35145f4ade8cf", "score": "0.59331584", "text": "def traverse(keypath, parent = @base, include_endpoint = false)\n raise NotImplementedError, \"Subclasses must implement public method traverse\"\n end", "title": "" } ]
[ { "docid": "346f1d9d009812737631d42dd72ac4ba", "score": "0.6772537", "text": "def ref(key_path)\n object = self\n key_path.each do |key|\n object = object.is_a?(Hash) ? object[key] : nil\n end\n object\n end", "title": "" }, { "docid": "dbbfc91da901639098c0f346da1b897c", ...
0cd30471a3e2cc5306418b55b11acc18
POST /studenthousinginfos POST /studenthousinginfos.json
[ { "docid": "be969e00261f9cdcc892d238fffec200", "score": "0.70872056", "text": "def create\n @studenthousinginfo = Studenthousinginfo.new(studenthousinginfo_params)\n @studenthousinginfo.status = 'Waiting for Approval'\n\n respond_to do |format|\n if @studenthousinginfo.save\n format...
[ { "docid": "fb2a11533626537ecfdee22835cb2016", "score": "0.69477296", "text": "def create\n @studentinfo = Studentinfo.new(studentinfo_params)\n\n respond_to do |format|\n if @studentinfo.save\n format.html { redirect_to @studentinfo, notice: 'Studentinfo was successfully created.' }\n...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "5b6792027955f7fa2188795ad6113019", "score": "0.0", "text": "def set_partida\n @partida = Partida.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.603186", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015241", "text": "def ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "2bae1ea151420286af76f293cdab38fc", "score": "0.0", "text": "def weapon_status_params\n params.require(:weapon_status).permit(:name, :description)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74954116", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6956924", "text": "def strong_params\n params.require(:request).permit(param_whit...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "f0355057c4ed07a424b5e59f5f316295", "score": "0.0", "text": "def set_roadtrip\n @roadtrip = Roadtrip.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
aae2118975bc676760674b7589c41916
GET /copies/1 GET /copies/1.json
[ { "docid": "29efe6e0d39212981533f658e7c75437", "score": "0.7186081", "text": "def show\n @copy = Copy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @copy }\n end\n end", "title": "" } ]
[ { "docid": "43900698ebf543a6f129e6899ff58944", "score": "0.69531", "text": "def index\n @copies = @picture.copies\n end", "title": "" }, { "docid": "bf2f47ef6bf8a5f9a25286a88ce4b3a7", "score": "0.6628719", "text": "def show\n @attached_copy = AttachedCopy.find(params[:id])\n\n...
a6527a2ee7f77ed7a93a4b65ae76ef25
Obtain an InputSet object, used to define inputs for an execution of this Choreo.
[ { "docid": "2d2df01f319e28bc5efc2ab8bb522af2", "score": "0.0", "text": "def new_input_set()\n return GetLocationInformationInputSet.new()\n end", "title": "" } ]
[ { "docid": "d8eb34cfc5a1e737977f7023d4849c46", "score": "0.67405313", "text": "def new_input_set()\n return CreateObjectInputSet.new()\n end", "title": "" }, { "docid": "7c0d7c433cd4eb8e36bdc3a383e9ec33", "score": "0.65799934", "text": "def new_input_set()\n return R...
b9abe3ac69374bbe0485a3c26008c252
Records a screen view (for a mobile app)
[ { "docid": "5a4495984094e2c2493c07031e1e7f4b", "score": "0.5226133", "text": "def screen(attrs)\n symbolize_keys! attrs\n enqueue(FieldParser.parse_for_screen(attrs))\n end", "title": "" } ]
[ { "docid": "29bb76a88390f8828103a16077a20ef3", "score": "0.67590714", "text": "def track_screen_view(name=nil, id=nil, context=nil, tstamp=nil)\n screen_view_properties = {}\n unless name.nil? \n screen_view_properties['name'] = name\n end\n unless id.nil? \n screen_vie...
53a7f67d2bfdfad82f2f0c81e9320b92
METHOD Take age and return year of birth
[ { "docid": "801cc550972ad7c8fbeff3374e0b6e03", "score": "0.88611084", "text": "def year_of_birth(current_year, age)\n\tcurrent_year - age\n\tend", "title": "" } ]
[ { "docid": "f586590b6d5cedd365792ea196bf2f70", "score": "0.8870236", "text": "def birth_year\n @current_year - @age\n end", "title": "" }, { "docid": "6a1a073ff751b269637dbb4655a013be", "score": "0.85942656", "text": "def age\n Date.today.year - birthdate[/\\d+$/].to_i...
6441de67e5806bdc5a7f0c2340ad5fb0
Convert Params from Hash To URI Query
[ { "docid": "e5fe7ff9a35d88678ff7fc7124ceb2cb", "score": "0.0", "text": "def build_params\n self._format('json') unless @params[:_fmt]\n self._rt('b') unless @params[:_rt]\n URI.encode_www_form(@params)\n end", "title": "" } ]
[ { "docid": "f1796eabc321d2d01b85f3a0a26ba610", "score": "0.791427", "text": "def hash_to_query(params)\n params_str = ''\n return params_str if params.nil?\n\n params.each do |k, v|\n params_str += \"#{k}=#{v}&\"\n end\n params_str.chomp('&')\n end", "title": "" ...
86bdccc58fa021670b0c89e57757597b
PATCH/PUT /calendars/1 or /calendars/1.json
[ { "docid": "cd88a3594832f9305f99dda87b2e55fd", "score": "0.7312924", "text": "def update\n respond_to do |format|\n if @calendar.update(calendar_params)\n format.html { redirect_to @calendar, notice: \"Calendar was successfully updated.\" }\n format.json { render :show, status: :ok...
[ { "docid": "4f53da6dc9784a3f6b04d81ebab28881", "score": "0.75777334", "text": "def update\n\n respond_to do |format|\n if @calendar.update(calendar_params)\n format.html { redirect_to calendars_calendars_url, notice: t('calendar.update') }\n format.json { render :show, stat...
2a9e0feb5ffb8e02f38458da7f64b3d3
Check if a product is already sold
[ { "docid": "5a4b7abd8022f4b3cc45029089595aa9", "score": "0.7863113", "text": "def sold?(product)\n product.status == 'Sold'\n end", "title": "" } ]
[ { "docid": "53912226dfa399ee97cd2de198c3aa83", "score": "0.7652715", "text": "def purchased?(product)\n purchase_items.exists?(product_id: product.id)\n end", "title": "" }, { "docid": "d9ec9beb972f2c1eed227959faa13a2f", "score": "0.7165838", "text": "def check_for_product(...
e9e96620e51dda798c07203a670fe0f4
Put it all together !
[ { "docid": "ab152d4837845d3ccf99bec2301ae579", "score": "0.0", "text": "def execute!(site, email_recipient)\n if self.start_time.blank? # guard against executing the job multiple times\n \n # initialize\n ShopifyAPI::Product.superclass.site = site # this is for DJ, it can't seem to find ...
[ { "docid": "7ec57c3874853e50086febdbdd3221bf", "score": "0.65279335", "text": "def wedding; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6489731", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",...
673800cf68f9c19f0c149dcdce42fe3f
Remove all access grants for a specific collection id
[ { "docid": "b3ba0317a2b7e5a5e0f1c446b1e6bf4b", "score": "0.7589486", "text": "def remove_access(collection_id:)\n templates = Hyrax::PermissionTemplate.where(source_id: collection_id)\n return unless templates.present?\n templates.each { |template| template.destroy! }\nend", "title": "" } ]
[ { "docid": "c007f4de286534d407b0a1fe0d5b4907", "score": "0.6504094", "text": "def remove_revoked_grant revoke\n Array(revoke.roles).each do |role|\n Array(revoke.members).each do |member|\n requested.delete [ role.roleid, member.roleid ]\n requested_with_adm...
7c6b334b4b72871d5c15f2f9ebbb3758
rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity, Metrics/MethodLength The CanCan DSL requires a complex initialization method
[ { "docid": "d5d69e4354a2bcd5da77260d065b4b25", "score": "0.65888613", "text": "def initialize(user, token = nil)\n user ||= User.new\n\n # Claering CanCan's default aliased actions\n # because we don't want to alias new to create\n # CanCan's defaults are\n # alias_action :index, :show, t...
[ { "docid": "808d886891215d384109e289199796f5", "score": "0.6819044", "text": "def __initialize_canable_role\n return if @_canable_initialized == true \n @_canable_intialize == true\n role_constant = self.__get_role_constant\n if role_constant == nil\n default_role = self.class...
675708f6e9c7d495d472a8762a0bd9a1
None of these methods should touch anything on the session other than one particular key that this class owns, so this is for testing that.
[ { "docid": "562b9620c7bfc1f36ea1be887cf1e526", "score": "0.5892037", "text": "def create_session\n {\n 'some_other_devise_key_that_should_not_be_touched' => 'foo'\n }\n end", "title": "" } ]
[ { "docid": "08bbb097a5f7506f6543142138d304b8", "score": "0.6755823", "text": "def update_session_key(new_session_key)\n if session_key != new_session_key\n update_attribute(:session_key, new_session_key)\n end\n end", "title": "" }, { "docid": "37c2dd6502246705ebf58e7b88dc5140", ...
1b165d9ca4f3c5987b88a962f0a9dd86
Get the number of tables that this MySQL session has locked.
[ { "docid": "63ae92037a7572e13b997fc461d75591", "score": "0.7646997", "text": "def get_number_locked_tables(mysql2_client)\n mysql2_client.query('SHOW OPEN TABLES WHERE IN_USE > 0').count\nend", "title": "" } ]
[ { "docid": "7aa1a437a7798136a7e66f21ab702177", "score": "0.6269178", "text": "def cti_table_count\n result = connection.execute(\"SELECT COUNT(*) FROM #{DBViewCTI::Names.table_name(self)};\")\n result[0]['count'].to_i\n end", "title": "" }, { "docid": "b789648210f1d5...
52ccc0ca6cd778443d78b252ace904d7
Parse a time string to an integer in seconds
[ { "docid": "1b5540dd9d5b247a2feb90a0fe049a10", "score": "0.72853637", "text": "def parse_time(string)\n return nil if string.empty?\n TIME_REGEXPS.each do |regex|\n if match = regex.match(string)\n hours = Integer(match.names.include?('hours') && match[:hours] || 0)\n ...
[ { "docid": "e90d6dfe93d41ae6f3e4df54e60a045b", "score": "0.7990601", "text": "def convert_plain_time_to_seconds(string)\n if !(string =~ /(.+)s/).nil?\n return $1.to_f.round(2)\n end\n return 0\n end", "title": "" }, { "docid": "d075ea402c5eb4034fd9883d3cf856e3", "score": ...
e342644a21e73ee60c9237cf657a491f
Adds a list of services to a cluster
[ { "docid": "3e6afe06fc622a56366452f759a715b6", "score": "0.7998959", "text": "def add_services(services_list)\n # Update spec\n services_list.each do |service|\n @spec.add_service(service)\n end\n\n postdata = @spec.coopr_post_data\n postdata['services'] = *se...
[ { "docid": "4088658bd8fdfeb45caa0fd9952abe86", "score": "0.7547987", "text": "def add_services(services)\n services.each { |s| add_service(s) }\n end", "title": "" }, { "docid": "2131947881f7cfb7d8b79ee5bce27390", "score": "0.6812461", "text": "def add_service(serv)...
a71c5a70ceebc7d47a500f60cabdda3d
Returns the name of the device being used by this SoundRecorder
[ { "docid": "e7270864c51fa1bbc4976b780b506ed7", "score": "0.64480776", "text": "def get_device\n end", "title": "" } ]
[ { "docid": "7739df6bd1a9eb7a08d0336710320210", "score": "0.8143095", "text": "def device_name\n return @device_name\n end", "title": "" }, { "docid": "7739df6bd1a9eb7a08d0336710320210", "score": "0.8142764", "text": "def device_name\n return @...