query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
32136e9c9bf1fefdc334a9aafb92b78e | define the comparison methods for the node class | [
{
"docid": "8d9f0b7663bc70863c5e9fe277c9c5cc",
"score": "0.0",
"text": "def <=>(other)\n @value <=> other.value\n end",
"title": ""
}
] | [
{
"docid": "0a82c95f0669e991752144c94d48fc77",
"score": "0.7254313",
"text": "def compare; end",
"title": ""
},
{
"docid": "bded19af6b25b168c0a58616bb529f9e",
"score": "0.7154797",
"text": "def comparison_method?; end",
"title": ""
},
{
"docid": "bded19af6b25b168c0a58616b... |
a09879e01f5badba8472162156723061 | merge the split arrays ino order recursively | [
{
"docid": "a43390e9a6f607d81372cca26e36548c",
"score": "0.0",
"text": "def merge(left, right)\n if left.empty?\n right\n elsif right.empty?\n left\n elsif left.first < right.first\n [left.shift] + merge(left, right)\n else\n [right.shift] + merge(left, right)\n end\n ... | [
{
"docid": "6d913f78f313b1aa2e8f6cfae37097de",
"score": "0.6854416",
"text": "def merging(multi_array)\n multi_array.sort_by! { |x| x.length } # Sorting: E.g. arrays of lengths 7, 8, 9, 10: in the next step (15,9,10) we want to merge 9 and 10!\n temp = merge(multi_array[0], multi_array[1])\n 2.times ... |
c56d224818effaf4be02b586fdf45b47 | All of these print_x functions more or less just call partials, but we have functions in case we need to do anything else as well as call the partial. It just makes more sense to have this level of modularity. | [
{
"docid": "7f4835ebc913fd85982ff00ffe6beaee",
"score": "0.0",
"text": "def print_week\n\t\t\tlocals = {\n\t\t\t\t:week_number => syllabus_display.current_week,\n\t\t\t\t:content => syllabus_display.current_week_content,\n\t\t\t\t:week_title => syllabus_display.week_title\n\t\t\t}\n\t\t\t# Handle printi... | [
{
"docid": "c91af931bb6791601e2144fae0f619e1",
"score": "0.68939096",
"text": "def partial(*args)\n @out.print(*args)\n end",
"title": ""
},
{
"docid": "815781fedc91ced9d28e7bb07a38e6ef",
"score": "0.65089124",
"text": "def print_partial_name\n return \"print\"\n end",
... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "481e0b5600068ad539e56d8438238e21",
"score": "0.0",
"text": "def set_socioeduk_marca_corporal\n @socioeduk_marca_corporal = Socioeduk::MarcaCorporal.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... |
e4d75f2767339efd2cd18575f73e13a2 | reads +length+ bytes from +pos+ as atomically as possible if IO.pread is available, it'll use that (making it both multithread and multiprocesssafe). Otherwise we'll use a mutex to synchronize access (only providing protection against multiple threads, but not file descriptors shared across multiple processes). If the ... | [
{
"docid": "94a28634c6ec3899dd0ae5948cc4b74f",
"score": "0.71734893",
"text": "def atomic_read(length, pos) #:nodoc:\n if @mutex\n @mutex.synchronize { atomic_read_unguarded(length, pos) }\n else\n atomic_read_unguarded(length, pos)\n end\n end",
"title": ""
}
] | [
{
"docid": "12789ceae9b89f17a5cd47b7311f247c",
"score": "0.67333966",
"text": "def read_from_pos(position, length)\n self.old_seek(position)\n data = self.old_read(length)\n self.old_seek(position)\n\n data\n end",
"title": ""
},
{
"docid": "ada372cc8aad0a0ac49d6c2fe9b92521",
... |
318c3b312aad80ec9c099d8bc148f2fb | return the third greatest number in the array. You may assume that the array has at least three numbers in it. Difficulty: medium. if statements. so if nums[i] > greatest, third_greatest = second_greatest, second_greatest = greatest, greatest = nums[i], | [
{
"docid": "44ad4f36fc19d5b92098902cd6b4d41e",
"score": "0.8925136",
"text": "def third_greatest(nums)\n\tgreatest = 0\n\tsecond_greatest = 0\n\tthird_greatest = 0\n\ti = 0\n\n\twhile i < nums.length - 1\n\t\tif nums[i] > greatest\n\t\t\tthird_greatest = second_greatest\n\t\t\tsecond_greatest = greatest... | [
{
"docid": "3658d9cb64d3b20019ac5d958a5edcd8",
"score": "0.90177715",
"text": "def third_greatest(nums)\n\tgreatest_number = 0\n\tfor x in 0 ... nums.size\n\t\tif nums[x] > greatest_number\n\t\t\tgreatest_number = nums[x]\n\t\tend\n\tend\n\tsecond_greatest_number = 0\n\tfor x in 0 ... nums.size\n\t\tif ... |
4758142a093a190283126711ded0278c | This is a stub; since Ansible is effectively agentless, this operation doesn't have meaning. | [
{
"docid": "797517c64cbfe1ad0b4762a62b3fa7d4",
"score": "0.0",
"text": "def preClean(leave_ours = false)\n end",
"title": ""
}
] | [
{
"docid": "3c7629e18dc9dc9521ce2599d4c1c1d7",
"score": "0.6017141",
"text": "def ansible_command(base_dir, ansible_runner_method)\n \"ansible-runner #{ansible_runner_method} #{base_dir} --json -i result --hosts localhost\"\n end",
"title": ""
},
{
"docid": "8c7292fe346755591de45... |
dc20106830492253ced8009d653a5e48 | POST /subscriptions POST /subscriptions.json | [
{
"docid": "5136dd101ca95b88aa3c2b17bbc62c1e",
"score": "0.69699824",
"text": "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to root_path, notice: 'You have successfully subscribed to Pixie... | [
{
"docid": "404153c2cfe8914aa901d0edb85a0f30",
"score": "0.80127794",
"text": "def create\n @subscription = @user.subscriptions.new(subscription_params)\n if @subscription.save\n render json: @subscription\n else\n render json: { error: @subscription.errors }, status: :unpro... |
bc3615bf23a0a9b425f328add5e06d2e | GET /invites GET /invites.json | [
{
"docid": "3a44b2c2233421cfaaeedacf240d5e60",
"score": "0.7668945",
"text": "def index\n @invites = Invite.all\n end",
"title": ""
}
] | [
{
"docid": "6365e0377f02e6e8eda048d0f988b9a2",
"score": "0.7958046",
"text": "def invites\n raise 'Tried to request invites from a non-server channel' unless server\n\n invites = JSON.parse(API::Channel.invites(@bot.token, @id))\n invites.map { |invite_data| Invite.new(invite_data, @bot) ... |
753a6c4ad646648313f93ff9777f544d | GET /orders/1 GET /orders/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "23052f52af86f70778b67e0afeeea3d4",
"score": "0.7554187",
"text": "def getorders(args={})\n {\n :method=> \"GetOrders\"\n }.to_json\n end",
"title": ""
},
{
"docid": "45d40d4eb7c605b195ee60f1fcb2b6ab",
"score": "0.7488565",
"text": "def index\n @orde... |
47d08cca8799f501fdaecfb139fed9a9 | required parameters: name: snapshot_id, 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_account, type: String name: owner_id, type: Long name: resource_owner_account, type: String na... | [
{
"docid": "61e7d88920a1a13740df551f2e0d679d",
"score": "0.61348337",
"text": "def delete_snapshot(snapshot_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteSnapshot'\n\t\targs[:query]['SnapshotId'] = snapshot_id\n\t\targs[:region] = optional[:_region] if (optional... | [
{
"docid": "12eba1443ef8804d328ace6e9c6a4914",
"score": "0.6951926",
"text": "def snapshot_params\n params.require(:snapshot).permit(:origin, :data_name, :query, :content, :headers, :taken_at)\n end",
"title": ""
},
{
"docid": "b2da9b1d62d48be84514f45c420ee501",
"score": "0.6671984",... |
5f35da87b978ea480062e89e244b3ee7 | Set the given value at the given index. | [
{
"docid": "96c1d000467168b71287d9ca1296c6b8",
"score": "0.754451",
"text": "def set(index, value)\n node = self\n\n # Traverse the tree to find the right node to add or replace the value.\n idx = index\n while node\n # Once we have reached a leaf node we can insert or replace... | [
{
"docid": "6a8cc12a316f8c889ccadda7017ce4cb",
"score": "0.8285294",
"text": "def set(index, value)\n raise IndexError if index >= @n\n @data[index + @size_r] = value\n end",
"title": ""
},
{
"docid": "1df5ff5d50518a377096f1d0b3400af2",
"score": "0.81818366",
"text": "def []=(... |
9d511070ef38c05a236af1c250ac203f | URL for the user's facebook profile | [
{
"docid": "fbed31b536fd63f6b763864ec80d76ba",
"score": "0.87316763",
"text": "def fb_profile_url\n \"http://www.facebook.com/profile.php?id=#{fb_user_id}\"\n end",
"title": ""
}
] | [
{
"docid": "95837e24e5f7b24bd03745eb342e4d59",
"score": "0.7627442",
"text": "def facebookProfilePicURL\n # https://www.facebook.com/user_name\n if facebook_url\n return \"https://graph.facebook.com/[PROFILE_ID]/picture\"\n else\n None\n end\n end",
"title": ""
},
{
... |
e43179f4c3d75a480b4ba8fcfd8d0ff6 | DELETE /add_pone_to_tickets/1 DELETE /add_pone_to_tickets/1.json | [
{
"docid": "38a98e0ada0ba2565bff76d4b8e0cb3d",
"score": "0.7922339",
"text": "def destroy\n @add_pone_to_ticket = AddPoneToTicket.find(params[:id])\n @add_pone_to_ticket.destroy\n\n respond_to do |format|\n format.html { redirect_to add_pone_to_tickets_url }\n format.json { head :no_c... | [
{
"docid": "03999e7122f4215bcd49fa502a31e901",
"score": "0.76302147",
"text": "def destroy\n @add_pone2_to_ticket = AddPone2ToTicket.find(params[:id])\n @add_pone2_to_ticket.destroy\n\n respond_to do |format|\n format.html { redirect_to add_pone2_to_tickets_url }\n format.json { head ... |
72ef93afe6a8cf3b502231f9591b8047 | SPACE = " " | [
{
"docid": "e8961ac7d401661e326753c1ffe3fa25",
"score": "0.8007278",
"text": "def _SPACE\n _tmp = match_string(\" \")\n set_failed_rule :_SPACE unless _tmp\n return _tmp\n end",
"title": ""
}
] | [
{
"docid": "6568329b1348383aeed6872c74c5e3e8",
"score": "0.83237594",
"text": "def spaces; end",
"title": ""
},
{
"docid": "6568329b1348383aeed6872c74c5e3e8",
"score": "0.83237594",
"text": "def spaces; end",
"title": ""
},
{
"docid": "fe2f294e655dca86a3985d24c697ef64",
... |
701d4c4bc413d1aecb3ae64a94db97f2 | Return response from API and write to cache | [
{
"docid": "90bbf97c62fccb3995e861885bb0e820",
"score": "0.7794162",
"text": "def live_response\n if response = api_client.fetch(@api_request)\n cache.write(@api_request.cache_key, response)\n build_response(response)\n end\n end",
"title": ""
}
] | [
{
"docid": "f0c253dcd86b06a14c2af3c841a3862f",
"score": "0.7836162",
"text": "def cached_response\n response = cache.read(@api_request.cache_key)\n build_response(response) unless response.nil?\n end",
"title": ""
},
{
"docid": "34146488a51dea664cc76c8c9d42a970",
"score": "0... |
684a15413bdb63fc2fed0f1d68501c22 | Reevaluates the conditions on each page and changes the page if necessary. | [
{
"docid": "748f96084127f55d725bde35fcdf088b",
"score": "0.6477151",
"text": "def test_pages\n oldpage = @current_page\n @current_page = nil\n for i in 0...pages.size\n if test_page_conditions(i)\n @current_page = i\n if oldpage != @current_page\n # Run... | [
{
"docid": "ce4121885cffeed599aa1ba83c020f43",
"score": "0.59622526",
"text": "def assign_pages!; end",
"title": ""
},
{
"docid": "e276b1418aecc6ecdbad02461039cba6",
"score": "0.57802063",
"text": "def set_page\n if request.format.html? && params[:field] && params[:value]\n f... |
506b55e821e6f717f6e2fb6b31b336a5 | for active branches messages[:total] => total message number for all messages[branch_id] => message number for the branch | [
{
"docid": "cb7154ea9e9caf6758479490cb0d5292",
"score": "0.67703694",
"text": "def messages\n query = Stat.ivr_message_query(branch_ids, started, ended)\n # where(\"entries.is_active=1\").\n # where(\"entries.is_private=1\").\n # where([\"entries.branch_id in (?) \", branch_... | [
{
"docid": "b5b6df0b44d1e58ec1c6eb92981a311a",
"score": "0.6519706",
"text": "def message_length\n numbers=Entry.where([\"branches.id in (?)\",branch_ids]).\n where(\"entries.created_at\"=>started..ended).\n select(\"branch_id, cast(sum(length) AS SIGNED) AS total\").\n group(:branch... |
318ee058e7a33b8f9fc1c889bf41529e | GET /meetings GET /meetings.json | [
{
"docid": "21eb53070dbe3c6ee1cbe9ff94d4fec1",
"score": "0.0",
"text": "def index \n print request.env\n\n if not session[:meeting_params] \n session[:meeting_params] = {}\n end\n \n @meeting_params = session[:meeting_params]\n if params[:q]\n @first = true \n (params[:q... | [
{
"docid": "7d204db3b1a4fb78c533887322446d1a",
"score": "0.8293486",
"text": "def index\n @meetings = Meeting.all\n\n render json: @meetings\n end",
"title": ""
},
{
"docid": "02df1852dd6db37e99132d09308ab5e6",
"score": "0.81246346",
"text": "def index\n @meetings = Meeting... |
a0931627ba95da48428d4abe11f01e39 | Convert object (array, hash, object, etc) to JSON string. | [
{
"docid": "18155f4529e417d3766d7fc0f767badd",
"score": "0.0",
"text": "def object_to_http_body(model)\n return model if model.nil? || model.is_a?(String)\n local_body = nil\n if model.is_a?(Array)\n local_body = model.map { |m| object_to_hash(m) }\n else\n local_body =... | [
{
"docid": "cffe577a4fb661792848486a5b83c599",
"score": "0.8321227",
"text": "def object_to_json(obj)\n JSON(obj)\nend",
"title": ""
},
{
"docid": "efdd215c0193f9944a2590c3f037ea0c",
"score": "0.81115043",
"text": "def encode(object)\n object.to_json\n end",
"title": ""
... |
ab72e837a1a9989e7c6dc5197908832e | Returns the value of the attribute identified by attr_name after it has been typecast (for example, "20041212" in a data column is cast to a date object, like Date.new(2004, 12, 12)). | [
{
"docid": "82bb79df42f052b9b4125044d4869b1f",
"score": "0.60941535",
"text": "def read_attribute(attr_name)\n _attributes[attr_name]\n end",
"title": ""
}
] | [
{
"docid": "9e4383562b20f242aeca736b364c503e",
"score": "0.80597085",
"text": "def read_attribute_before_type_cast(attr_name)\n @attributes[attr_name.to_s].value_before_type_cast\n end",
"title": ""
},
{
"docid": "583938ecdba4a313db91fe6dbcb201dd",
"score": "0.78212214",
... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "c2b6e7d6a179bb1f3b5841e5d2c08bac",
"score": "0.0",
"text": "def set_sensor\n @sensor = Sensor.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;... |
507fe7815906c22bc06788359c40e1ba | PATCH/PUT /deliveries/1 PATCH/PUT /deliveries/1.json | [
{
"docid": "12ebef29b16f5a4cd73403ff17d59b20",
"score": "0.59416676",
"text": "def update\n respond_to do |format|\n if @delivery.update(delivery_params)\n format.html { redirect_to deliveries_path, notice: 'Record was successfully updated.' }\n format.json { render :show, status: ... | [
{
"docid": "fa22d037d66dfcd086836965049b1bc2",
"score": "0.657526",
"text": "def update\n respond_to do |format|\n if @deliver.update(deliver_params)\n format.html { redirect_to @deliver, notice: 'Deliver was successfully updated.' }\n format.json { render :show, status: :ok, locat... |
69b40ecb280ef3a0331e98dbb8f5d070 | Sum of square regression | [
{
"docid": "ca2a580fea1c36b76595d73d08761bf5",
"score": "0.0",
"text": "def ssr\n vy_mean=@vy.mean\n (0...@vx.size).inject(0) {|a,i|\n a+((y(@vx[i])-vy_mean)**2)\n }\n\n end",
"title": ""
}
] | [
{
"docid": "605df234f721c80a7b146d9dc5d46f88",
"score": "0.67863876",
"text": "def sum_of_squares; end",
"title": ""
},
{
"docid": "074b63a97e7e666ffaf4020d06bf0c27",
"score": "0.6624652",
"text": "def sum_of_squares() sum = (1..@x).to_a.inject(0) { |sum, i| sum + i**2 } end",
"t... |
b732001d32a3177ac73c5227f90d9f06 | sorts the array of total views into an ordered array based on number of views | [
{
"docid": "fc94bbc8f5ea5033db188934f748b3b2",
"score": "0.7252413",
"text": "def sorted_array\n total_views_per_file_path.sort { |a, b| b[1] <=> a[1] }\n end",
"title": ""
}
] | [
{
"docid": "3f1e22b9cf5859494ff7705b6833cbc4",
"score": "0.746833",
"text": "def sorted_array_unique_views\n total_unique_views_per_file_path.sort { |a, b| b[1] <=> a[1] }\n end",
"title": ""
},
{
"docid": "0457740ecbf731cacb38ef54bd4483a0",
"score": "0.7397948",
"text": "def dis... |
e3f3cec1faffcb08561fbd5e2a80d6bc | Because of the unique constraint on Useremail, when we receive an empty email for user (e.g. the user form that was filled out had blank spaces for the given email), blank that out. | [
{
"docid": "e9e131b15a308f7722a25d86dd565cf6",
"score": "0.6351948",
"text": "def email=(value)\n if value.present?\n super(value)\n else\n super(nil)\n end\n end",
"title": ""
}
] | [
{
"docid": "0f5157511892c82447aa43a579a5dd42",
"score": "0.7289164",
"text": "def set_email_to_nil_if_blank\n self.email = nil if email.blank?\n end",
"title": ""
},
{
"docid": "4bb4a9f5608d768e0dca11beba16c644",
"score": "0.70906544",
"text": "def unique_email\n\t\treturn if ema... |
b9a4d1d3685293051c987dfe98d4d479 | PATCH/PUT /interviews/1 PATCH/PUT /interviews/1.json | [
{
"docid": "0cc2adca27fc726cbfed2a413c33997e",
"score": "0.0",
"text": "def update\n @interview.modified_by = current_user.id\n\n interview_criteria_ids = @interview.interview_criteria.collect { |ic| ic.id }\n \n interview_criteria_hash = interview_params[:interview_criteria][0...-1]\n \n... | [
{
"docid": "f50d5995b946f2e0d0d272d5532a334b",
"score": "0.697521",
"text": "def update\n respond_to do |format|\n if @interview.update(interview_params)\n format.html { redirect_to interviews_url, notice: 'Interview was successfully updated.' }\n format.json { head :no_content }\n... |
36e5aadc9b50faf7a674ba6057789827 | Loads a single Hash. | [
{
"docid": "2cc8dbcb3db149d60f0bdab36a4c5dbd",
"score": "0.0",
"text": "def load_content_from_hash hash, row_id = nil\n row_id ||= (@row_id += 1)\n\n log_puts do \n ct = hash[:content_type]\n if @ct != ct\n @ct = ct\n \"\\n#{ct}:\"\n else\n nil\n end\n e... | [
{
"docid": "d61bfb4c808e69192e18d47e93ca3c61",
"score": "0.7794689",
"text": "def load(hash)\n Loader.load(hash)\n end",
"title": ""
},
{
"docid": "460a665240631d3232b8f289e05b8aad",
"score": "0.74474",
"text": "def load hash_id\n raise NotFoundError\n end",
"titl... |
0556be256a6c77004666fde618dd02a2 | doing this the stupid more complex imho way by iliteration | [
{
"docid": "81870d1a75691be268a136b507cdf9ea",
"score": "0.0",
"text": "def custom_max_loop(arr)\n return nil if arr.empty?\n max = arr[0]\n arr.each do |value|\n max = value if value > max\n end\n max\nend",
"title": ""
}
] | [
{
"docid": "54f970ee5768d76a8818f20a25600939",
"score": "0.6530757",
"text": "def looping",
"title": ""
},
{
"docid": "17966ac7ffda6a58d4fd24706fc4ee23",
"score": "0.6411502",
"text": "def iterations; end",
"title": ""
},
{
"docid": "3d45e3d988480e2a6905cd22f0936351",
... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "ae234a93c24600b86706e82957f02753",
"score": "0.0",
"text": "def update!(**args)\n @permissions = args[:permissions] if args.key?(:permissions)\n end",
"title": ""
}
] | [
{
"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... |
8c10b0276271084c8ec59c8ee387c27f | Return raw color code without embeding it into a string. | [
{
"docid": "8116cbeb00273b3eb1cc1a8b2cafd55d",
"score": "0.0",
"text": "def code(*colors)\n attribute = []\n colors.each do |color|\n value = ANSI::ATTRIBUTES[color] || ALIASES[color]\n if value\n attribute << value\n else\n validate(color)\n end\n... | [
{
"docid": "f4fa1688d5bb3aed499fdaafd4edf53b",
"score": "0.6812056",
"text": "def color_code_for(*color, ground)\n Color.new(*color, ground).ansi_code\n end",
"title": ""
},
{
"docid": "c3a95447a9233966d77030a7d8de48a6",
"score": "0.67876905",
"text": "def code\n case @c... |
11e0ff8345f096cf8e8fe25a0ba26628 | Sets the value of the `custom_cpu_model` attribute. | [
{
"docid": "88fbcd52d552f3e85cf7fffac7cf9ddd",
"score": "0.91510373",
"text": "def custom_cpu_model=(value)\n @custom_cpu_model = value\n end",
"title": ""
}
] | [
{
"docid": "5a9c31922d30269df08ca6608d7651b8",
"score": "0.74469596",
"text": "def custom_cpu_model\n @custom_cpu_model\n end",
"title": ""
},
{
"docid": "5a9c31922d30269df08ca6608d7651b8",
"score": "0.74469596",
"text": "def custom_cpu_model\n @custom_cpu_model\n end... |
d997fad2c1407650cbe469fd1202b89c | creates a device POST /devices | [
{
"docid": "6ca37ce9c5f5101a732586ed3131b355",
"score": "0.8075992",
"text": "def create\n @device = Device.create!(device_params)\n json_response(@device, :created)\n end",
"title": ""
}
] | [
{
"docid": "a272e8f81093f074d26e9a4b4c087c09",
"score": "0.7879629",
"text": "def create\n @device = Device.new(device_params)\n\n # write device to database\n if @device.save\n redirect_to devices_path, :notice => 'Gerät erfolgreich erstellt.'\n else\n render 'new'\n end\n end... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "81e5bbc70fcb713471fcb4c05a2ad669",
"score": "0.0",
"text": "def fourteen_params\n params.require(:fourteen).permit(:name)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.requ... |
e75471e5a1dba885d69394b166076482 | DELETE /responses/1 DELETE /responses/1.xml | [
{
"docid": "13a6a9b373a4ee6a83e134e8aa7069ed",
"score": "0.69758797",
"text": "def destroy\n @response.destroy\n\n respond_to do |format|\n format.html { redirect_to(survey_responses_url(@survey)) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "3aeabb1979818c939af201c4095cfd47",
"score": "0.7279832",
"text": "def destroy\n @response = Response.find(params[:id])\n @response.destroy\n\n respond_to do |format|\n format.html { redirect_to(responses_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
... |
197a7d1e2de9b5fb25d6e1f9b3d0f180 | Actor Command Window Setup | [
{
"docid": "a8b35193d10a22a4ec3b3687db4cc22b",
"score": "0.8060852",
"text": "def phase3_setup_command_window\n # Disable party command window\n @party_command_window.active = false\n @party_command_window.visible = false\n # Enable actor command window\n @actor_command_window.active = tr... | [
{
"docid": "aa95b85705483160aa7e593a1329b835",
"score": "0.8080425",
"text": "def phase3_setup_command_window\r\n # Disable party command window\r\n @party_command_window.active = false\r\n @party_command_window.visible = false\r\n # Enable actor command window\r\n @actor_command_window.a... |
0d2b0b0410187e15794711ca6de11064 | Takes an array of rectangles and returns the smallest rectangle that encloses them all. | [
{
"docid": "1c6397f19db77d609439c7371bf74d69",
"score": "0.5973866",
"text": "def total_bounding_rect(rects)\n\tleft, right, top, bottom = rects[0].left, rects[0].right, rects[0].top, rects[0].bottom\n\t(1...rects.length).each do |i|\n\t\trect = rects[i]\n\t\tleft = rect.left if rect.left < left\n\t\tri... | [
{
"docid": "beaed435aa6adcaea2071a1c24e97fd4",
"score": "0.68398964",
"text": "def rect_area(arr)\n x = arr.map { |e| e[0] }.uniq\n y = arr.map { |e| e[1] }.uniq\n width = x.max - x.min\n height = y.max - y.min\n (width * height).abs\nend",
"title": ""
},
{
"docid": "fea7ed4c10c2a696861... |
48c4cce120faffbf841b023dd006d123 | Converts an array of pluralization variants to a Hash that can be used with I18n pluralization. | [
{
"docid": "a64efa3c407e47361fd293d2bac16f7a",
"score": "0.8251241",
"text": "def pluralization_variants_to_hash(*variants)\n {\n :one => variants[0],\n :few => variants[1],\n :other => variants[2]\n }\n end",
"title": ""
}
] | [
{
"docid": "0eec89e5272a1a05a676998508c3622e",
"score": "0.8345056",
"text": "def pluralization_variants_to_hash(*variants)\n {\n :one => variants[0],\n :few => variants[1],\n :many => variants[2],\n :other => variants[3]\n }\n end",
"title": ""
},
{
... |
e6b0c2ad3d29db6ed3ebd3b3ec0054bb | Asks the user to confirm the deployment before proceeding. | [
{
"docid": "df1e99b83b611f774d15c76da062f258",
"score": "0.6405705",
"text": "def call( env )\n\n if env[ 'options.confirm' ] && !confirm?( env[ 'remote' ], env[ 'branch' ] )\n raise Interrupt, 'Use cancelled the deployment.'\n end\n\n @app.call env\n end",
"title": ""
}
] | [
{
"docid": "6900b974fc8e3812dc987f45f03a8a57",
"score": "0.7464743",
"text": "def confirm_production\n\tputs \"\\n\\e[0;31m ######################################################################\"\n\tputs \" #\\n # Are you REALLY sure you want to deploy to production?\"\n\tputs \" #\\n #... |
745e6c430fd1e71b95dfe9c54adbde42 | Returns the name of the OData::EntitySet the current model is related to. | [
{
"docid": "7e45dc1bfe7f65848eb4150b28d47af4",
"score": "0.8375729",
"text": "def odata_entity_set_name\n self.class.odata_entity_set_name\n end",
"title": ""
}
] | [
{
"docid": "ff8bbd223b20bd91208f0660e62809af",
"score": "0.79235226",
"text": "def odata_entity_set_name\n odata_config[:entity_set_name] ||= self.name.pluralize\n end",
"title": ""
},
{
"docid": "fb9b7e0fece4fb4fec392799c3503c26",
"score": "0.6621091",
"text": "def p... |
02bb8add933585f205fccd2f10f54cb9 | PATCH/PUT /reports/1 PATCH/PUT /reports/1.json | [
{
"docid": "ba71f1b060d12cecf9ef7381c65faa0e",
"score": "0.0",
"text": "def update\n if @report.update(report_params)\n redirect_to @report, notice: I18n.t(\"messages.reports.successfully_updated\")\n else\n render :edit\n end\n end",
"title": ""
}
] | [
{
"docid": "76947a495f8371e8e772fdb40663d3b8",
"score": "0.72116596",
"text": "def update_report_template(args = {}) \n put(\"/reports.json/template/#{args[:templateId]}\", args)\nend",
"title": ""
},
{
"docid": "2f88b02124d0f2172590086053f2e907",
"score": "0.7170811",
"text": "def u... |
e6a37150b5a6b68a09d6a6632886e65c | Strips all link tags from +html+ leaving just the link text. strip_links('') => Ruby on Rails | [
{
"docid": "d36678828be60ec8220b1e30a0e876bd",
"score": "0.89287555",
"text": "def strip_links(html); end",
"title": ""
}
] | [
{
"docid": "f279afe5632ccd8ff6aa5a46d856b0e4",
"score": "0.81914485",
"text": "def strip_links\n gsub(%r{</?a.*?>}, \"\")\n end",
"title": ""
},
{
"docid": "a1ccce8a32a491d7ecaa4b6e269e85a4",
"score": "0.76600385",
"text": "def strip_html\n gsub(HTML_TAG_PATTERN, \"\")\n end"... |
5fcf56745efe2062f299185dc2fa4f3e | Importar dados do CSV | [
{
"docid": "315b9ea6dd95810bc0de68386fe582af",
"score": "0.6622115",
"text": "def csv_import\n #n = 0\n CSV.foreach(params[:dump][:file].tempfile,:col_sep => ';', :encoding => 'ISO-8859-1') do |row|\n c = SupportRequest.new( :ano => row[0],\n ... | [
{
"docid": "750ec9167948eb3292a025dd4e314932",
"score": "0.7323997",
"text": "def importar_registros(csv_doc, campos, usuario_id, institucion, enlace)\n\n linea = 0\n\n WorkerLog.log(\"Leyendo CSV...\")\n\n #barremos lineas de documento\n csv_doc.each do |row|\n linea += 1\n Worker... |
0ece556d218c54e00f07e6388de286e6 | GET /challenges/1 GET /challenges/1.json | [
{
"docid": "577c5dc9377674b0928204c1037033a0",
"score": "0.0",
"text": "def show\n \n @sample = Challenge.all.pop\n @samples = @sample.kludgy_related_similar()\n @different_samples = sample.kludgy_related_other()\n if current_user == nil\n redirect_to home_login_url\n else\n ... | [
{
"docid": "e8d3085dddd59cd3bb09607e458da1be",
"score": "0.8153176",
"text": "def show\n @challenges = Challenge.find(params[:id])\n render json: @challenges\n end",
"title": ""
},
{
"docid": "0b7811905fcf3f2f7c648833ea4c2454",
"score": "0.76581305",
"text": "def index\n... |
06fd3806b42cc5fe2e7eea36f74239b1 | GET /homes GET /homes.json | [
{
"docid": "86a6f9d1b7a56666f495f8a410cbd8fc",
"score": "0.6140637",
"text": "def index\n @homes = @homes[0..4]\n @homes_newyork = @homes_newyork[0..4]\n @homes_barcelona = @homes_barcelona[0..4]\n @homes_paris = @homes_paris[0..4]\n @homes_super = @homes_super[0..4]\n end",
"title":... | [
{
"docid": "4647ae4659387d0b6a5fbab629456ec0",
"score": "0.7808962",
"text": "def index\n @homes = Home.all\n render :json => @homes\n \n end",
"title": ""
},
{
"docid": "be6896fee31b87d491c66110f347a804",
"score": "0.7808868",
"text": "def index\n @homes = Home.all\n\n ... |
15b67b5bae2893df1f9082aa194e2349 | Returns valid input when the user is prompted | [
{
"docid": "f949851d598425ee4a3666bc1e80e32f",
"score": "0.0",
"text": "def get_input\n input = gets.chomp\n until valid_input?(input)\n puts \"Invalid input. Please type in an EMPTY cell number from \"\\\n \"1-9, 'quit', or 'restart'.\"\n print \">> \"\n input... | [
{
"docid": "2f141e8092b260e6e2b14696d7ea3452",
"score": "0.8203719",
"text": "def get_user_input\n user_input_valid gets.chomp\n end",
"title": ""
},
{
"docid": "1565a3193045d9185a8c1b2e666cee12",
"score": "0.77402574",
"text": "def prompt_for_value( ask = \"\" )\n answer = nil... |
45be0471d8230b0afb2e550f8f84c53c | Remove a member from a Telegraf config | [
{
"docid": "28ac8f1b33c4dbdd1a3560ce37326290",
"score": "0.0",
"text": "def delete_telegrafs_id_members_id(user_id, telegraf_id, opts = {})\n delete_telegrafs_id_members_id_with_http_info(user_id, telegraf_id, opts)\n nil\n end",
"title": ""
}
] | [
{
"docid": "0be0831ddd3270d5a0aab160bee41316",
"score": "0.78428364",
"text": "def cfg_remove(cfg,member)\n obj_remove(cfg,ZoneConfiguration,member)\n end",
"title": ""
},
{
"docid": "32dcb66add51be3571977cba2fe5e9ad",
"score": "0.7004643",
"text": "def remove_member(name, me... |
6c79887d05d5569ef486d3f11fd36daf | PATCH/PUT /payment_descriptions/1 PATCH/PUT /payment_descriptions/1.json | [
{
"docid": "22d6fb28452048b14c1e0370418823b1",
"score": "0.68765825",
"text": "def update\n respond_to do |format|\n if @payment_description.update(payment_description_params)\n format.html { redirect_to @payment_description, notice: 'Payment description was successfully updated.' }\n ... | [
{
"docid": "5306e50831b75147f42e2b5071610766",
"score": "0.6531081",
"text": "def update\n respond_to do |format|\n if @payment_req.update(payment_req_params)\n format.html { redirect_to @payment_req, notice: 'Payment req was successfully updated.' }\n format.json { render :show, s... |
24f465a1ff5452d88bef18916f189ac6 | Load configuration data from the specified file | [
{
"docid": "fc2c300a6ad4f2b431734215bf15ec15",
"score": "0.0",
"text": "def parse_config()\n result = YAML.load_file( @config_file )\n if !result.nil? && !result\n load_error( \"Unable to parse #{@config_file}\" )\n end\n\n result\n end",
"title": ""
}
] | [
{
"docid": "325d48126428b9da9abcd58a1ece1930",
"score": "0.79907006",
"text": "def load_config(file)\n file = File.expand_path(file)\n open(file, \"r\") { |f| f.read } if File.exists?(file)\n end",
"title": ""
},
{
"docid": "6ca606e13e7d825489f357cc3264b7a0",
"score": "0.7982363",... |
3c05f9018746c0fc364bc40f94f7f66b | GET /tour_programs/new GET /tour_programs/new.xml | [
{
"docid": "9b2c8d9be26f9196e944fa0c3ab015e5",
"score": "0.77675754",
"text": "def new\n @tour_program = TourProgram.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tour_program }\n end\n end",
"title": ""
}
] | [
{
"docid": "8268e75b18a04c6fe7a9a73729a478aa",
"score": "0.72042966",
"text": "def new\n @program_type = ProgramType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @program_type }\n end\n end",
"title": ""
},
{
"docid": "4058e38... |
5685454e69e8df0bc7dd3f5be22e17c1 | Return paperclip object url for own model | [
{
"docid": "d964304e5a42a17116fd956a9a598bd0",
"score": "0.0",
"text": "def self_image_url_by_size(size)\n image.url(size)\n end",
"title": ""
}
] | [
{
"docid": "c6f75fe7a9812c0ef8673d1cb359df9c",
"score": "0.736003",
"text": "def image_url\n url_for(object.image)\n end",
"title": ""
},
{
"docid": "97bf642d1fc24547234c3d806cb881d0",
"score": "0.7328009",
"text": "def image_url\n rails_blob_url(object.image)\n # This help... |
14c6a4d4ec8dbe6c76de662e207497be | Index page displaying all the blogs | [
{
"docid": "57181fd9c1a7afd9aca72f7955ae9ec8",
"score": "0.8309379",
"text": "def index\n @blogs = Blog.all\n end",
"title": ""
}
] | [
{
"docid": "378e9e65b75d1612b5d8a2ecad8596e7",
"score": "0.8278999",
"text": "def index\n # create object of blog to access blog in home page\n @blogs = Blog.all\n end",
"title": ""
},
{
"docid": "0d9476f03c5ba5fefb12070d2e9a12cc",
"score": "0.8264419",
"text": "def index\n ... |
f9d11cccb40fd4537fa77a7f92089a44 | QUESTION 2 As above, but the :content hash is being used to return a :bay hash | [
{
"docid": "d1e4b138ec8c061b1c8560d125cf0e5f",
"score": "0.61482495",
"text": "def item(content)\n WAREHOUSE.detect { |item| item[:content] == content} [:bay]\nend",
"title": ""
}
] | [
{
"docid": "31f1f091ccf25b389c88dcbaa95092ed",
"score": "0.63781124",
"text": "def bay(bay_number)\n#Step 2, apply the .detect enumerable method to the WAREHOUSE array. This is used to detect the element that returns true for a collection. This is provided by the block. In the block the bay parameter is... |
c8fbde5474e9224e77acee9852a92bbe | to_query Returns a SQL query string suitable for use in ActiveRecord's query by array. | [
{
"docid": "838abacebde01ee862b97f2a63471251",
"score": "0.6075533",
"text": "def to_query(col, value, op = '=')\n return op == '=' ? \"(#{col} IS NULL)\" : \"(#{col} IS NOT NULL)\" if value.nil?\n\n case op.downcase\n when '=', '!='\n if value.is_a?(Array)\n rhs = 'IN (' + Array.ne... | [
{
"docid": "e076fa326ae1de9055d43d541767b0cd",
"score": "0.67978495",
"text": "def sql_array(array)\n Arel.sql(ActiveRecord::Base.sanitize_sql([\"ARRAY[?]\", array]))\n end",
"title": ""
},
{
"docid": "e6edcbba5dbc8bd0cf22d33a46f9e568",
"score": "0.6683605",
"text": "def to_sql\n... |
e6bf2b43035331f2766f2e2ea857efac | Process update account form | [
{
"docid": "024cab817368f584e30f0bdec97bbeb5",
"score": "0.0",
"text": "def update\n @user = User.find(current_user.id)\n if @user.update_attributes(user_params)\n redirect_to account_url, flash: { success: t(:update_user_success) }\n else\n render 'edit'\n end\n end",
"title"... | [
{
"docid": "83a9c0637a6878305b32cd0b85df4e41",
"score": "0.7441734",
"text": "def update\n \n if @account.update(account_params)\n redirect_to @account, notice: \"Account was successfully updated.\" \n else\n render :edit, status: :unprocessable_entity \n end\n \n end"... |
3ddc6385383201f08fb64306589d6234 | Returns true if the user has just been activated. | [
{
"docid": "5f9fcc15febec429ab57de00f72d4a46",
"score": "0.0",
"text": "def pending?\n @activated\n end",
"title": ""
}
] | [
{
"docid": "7c4af83de2d6e21e6fadb72045c34ff2",
"score": "0.83840567",
"text": "def user_activated?(current_user)\n current_user.activated\n end",
"title": ""
},
{
"docid": "def7469836c9b3bb398df868dfb9fde6",
"score": "0.8199124",
"text": "def activated?\n @user = User.find(id)... |
982381c59fc88f23bcfb3929ff52acb5 | Reorders a given scale so that it starts with a given note | [
{
"docid": "53034db9f9a64ea7a2670ac444cc1f14",
"score": "0.8240401",
"text": "def reorder_any_scale(scale, note)\n while scale[0] != note\n scale.insert(0, scale.pop)\n end\n return scale\n end",
"title": ""
}
] | [
{
"docid": "20149cc385846bd42870b8754452dc14",
"score": "0.5759499",
"text": "def scale_halfsteps(note, intervals)\n scale = [\"C\",\"Db\",\"D\",\"Eb\",\"E\",\"F\",\"Gb\",\"G\",\"Ab\",\"A\",\"Bb\",\"B\"]\n i = 0\n scale = reorder_any_scale(scale, note)\n array = [scale[0]]\n\n intervals.each do |nu... |
352340d1e968ca662e2af588c0310f7c | the desired result. To check your work, run this file by entering the following command in your terminal: `ruby day_4/exercises/methods.rb` Example: Write a method that when called will print your name: | [
{
"docid": "d8dde14841f57600914e804814e76e19",
"score": "0.0",
"text": "def print_name\n p \"Garrett Gerdsen\"\nend",
"title": ""
}
] | [
{
"docid": "9d74cd05baceb67467fc4747261e0160",
"score": "0.79124415",
"text": "def print_name\n puts \"Will Meighan\"\nend",
"title": ""
},
{
"docid": "3cd4b87fe1a34e9a60baa70140ae6885",
"score": "0.78779435",
"text": "def print_name(name)\nputs \"Name: #{name}\"\nend",
"title":... |
a2c858e6449e00d68c6c7536bd4fb827 | GET /aws_security_group_egresses/1 GET /aws_security_group_egresses/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "50430f0c4eaac54ec605b190c70f838c",
"score": "0.8081809",
"text": "def index\n @aws_security_group_egresses = AwsSecurityGroupEgress.all\n end",
"title": ""
},
{
"docid": "94487d9153a144ddd2df729790e9caf1",
"score": "0.7206879",
"text": "def set_aws_security_group_egre... |
87c0b91b252fc5074a8c78d3581e5a94 | hacking compatibility with composite primary keys for Hobo. Hobo tries to instantiate a new record when checking view permissions when rendering lists/show.dryml and doesn't know to use two ids. | [
{
"docid": "1fce2103a0f85d82b79675ce7e7c8b20",
"score": "0.0",
"text": "def id=(id)\n return true\n end",
"title": ""
}
] | [
{
"docid": "bf2ff6614db2a70ee32d1fd5ab87dc4c",
"score": "0.6474067",
"text": "def primary_key; end",
"title": ""
},
{
"docid": "bf2ff6614db2a70ee32d1fd5ab87dc4c",
"score": "0.6474067",
"text": "def primary_key; end",
"title": ""
},
{
"docid": "bf2ff6614db2a70ee32d1fd5ab87... |
f160955c1a7f2ba1418d617a0baf5100 | Display all the template to choose from for the current cookbook. | [
{
"docid": "1686b9d180802a60793f9a05e9e44a27",
"score": "0.6967273",
"text": "def index\n @cookbook = current_cookbook\n @current_template_id = (current_cookbook.template) ? current_cookbook.template.id : 0\n @templates = Template.order(\"position ASC\")\n end",
"title": ""
}
] | [
{
"docid": "4c3a2bbc013b2ff421bdfc7f963e03b0",
"score": "0.6749135",
"text": "def prompt_for_template(prefix = nil)\n if prefix\n collection_name = prefix.split(\"__\").map do |c_name|\n c_name.split(\"_\").map(&:capitalize).join(\" \")\n end.join(\" / \")\n ... |
bc3c95e93c67f466828743c134b3ef36 | sets value of delivered to true for specified child | [
{
"docid": "4f739b473d9b3f86f08c0d58acaa53df",
"score": "0.6168049",
"text": "def mark_delivered(search_name)\n\tChildren[\"children\"].select {|item| item[\"child_name\"] == search_name}[0][\"delivered\"] = true\n\tupdate_file('children.yaml', Children)\nend",
"title": ""
}
] | [
{
"docid": "7fab75c9e4893a0365af64a8a222467c",
"score": "0.62552714",
"text": "def redelivered=(redelivered); @message_impl.setRedelivered redelivered; end",
"title": ""
},
{
"docid": "7641d825d82a8660bb1755d0b08afd55",
"score": "0.60219246",
"text": "def deliver(*)\n true\n ... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "46cada9ebc9ec58065e1c01d4a17f98a",
"score": "0.0",
"text": "def update!(**args)\n @merchant_center_account_links = args[:merchant_center_account_links] if args.key?(:merchant_center_account_links)\n end",
"title": ""
}
] | [
{
"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... |
40afd264b7074685e315afec07f3b3af | GET /answer_pets GET /answer_pets.json | [
{
"docid": "29ff8c1035eae6f35f1afe6f065b5ab4",
"score": "0.7343609",
"text": "def index\n @answer_pets = AnswerPet.all\n end",
"title": ""
}
] | [
{
"docid": "a4f94f174fb52d32cbcc715179d3629f",
"score": "0.6862562",
"text": "def index\n @pets = Pet.get_pets(params)\n end",
"title": ""
},
{
"docid": "7dad6f5e2862593587d2c6dec9b1c054",
"score": "0.68143785",
"text": "def index\n @pets = Pet.all\n\n respond_to do |forma... |
ae31b5064257fa37c4e3330aaa18ca46 | determine whether the change set relate to this channel | [
{
"docid": "00cd23f3468012a8756c44a8b1afb0e4",
"score": "0.0",
"text": "def create_job(change_set)\n # all room types id in this change set\n room_type_ids = change_set.room_type_ids\n pool = change_set.pool\n\n room_type_ids.each do |rt_id|\n channel_mapping = RoomTypeChannelMapping.find_by... | [
{
"docid": "4a115cf826c6f758ba4810b1405f6933",
"score": "0.6893729",
"text": "def channel?\n self.channel_referent_id > 0\n end",
"title": ""
},
{
"docid": "3f894cb293cccf0e04182c345a145059",
"score": "0.6666872",
"text": "def changes_state?\n @sets\n end",
"t... |
ecbac9c483ba30ceb8d4c6611a979560 | DELETE /page_views/1 DELETE /page_views/1.json | [
{
"docid": "3a6a172b50ebfe74918b33170b776aad",
"score": "0.7283098",
"text": "def destroy\n @page_view.destroy\n respond_to do |format|\n format.html { redirect_to page_views_url, notice: 'Page view was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"... | [
{
"docid": "452cda20eff20b9b65edec7b1fb2198a",
"score": "0.7641478",
"text": "def destroy\n @page_view = PageView.find(params[:id])\n @page_view.destroy\n\n respond_to do |format|\n format.html { redirect_to page_views_url }\n format.json { head :no_content }\n end\n end",
"ti... |
007a05232143633f17dfa9e1306272ed | Log errors if a socket fails. `close` will fire after this to clean up any remaining connectons. | [
{
"docid": "346daf35202548cdb127b4215a390838",
"score": "0.4964577",
"text": "def error(event)\n Firehose.logger.error \"WS connection `#{@req.path}` error. Message: `#{event.message.inspect}`\"\n end",
"title": ""
}
] | [
{
"docid": "f1972238f5bebc3d087f3de68b462edf",
"score": "0.70908374",
"text": "def close\n super unless closed?\n rescue IOError => exception\n logger.warn \"IOError when attempting to close socket: #{exception.class}: #{exception.message}\"\n end",
"title": ""
},
{
"... |
ffaec64f0fe589fd1c3d1b7a19225360 | Delete a 'hyperflex.SysConfigPolicy' resource. | [
{
"docid": "cd9a82b7df56abbd730e83eca815a5f3",
"score": "0.72070646",
"text": "def delete_hyperflex_sys_config_policy(moid, opts = {})\n delete_hyperflex_sys_config_policy_with_http_info(moid, opts)\n nil\n end",
"title": ""
}
] | [
{
"docid": "bbf4582ff963b7affb8ca288edfd4768",
"score": "0.66038764",
"text": "def destroy\n @sys_config = SysConfig.find(params[:id])\n @sys_config.destroy\n\n respond_to do |format|\n format.html { redirect_to(sys_configs_url) }\n format.xml { head :ok }\n end\n end",
"titl... |
aae56fccc5f5062f8649e75bfc964c77 | Attributes hash used during the creation of a new row. | [
{
"docid": "c91645fcbb8a84a94d296bce0c92978e",
"score": "0.6724321",
"text": "def attributes_for_creation( attributes_hash )\n @attributes_hash = attributes_hash\n end",
"title": ""
}
] | [
{
"docid": "e09488914cf2d40fd38b57f63d7475c6",
"score": "0.7831103",
"text": "def attributes_hash\n {}\n end",
"title": ""
},
{
"docid": "e4adebe545f068846e6867fe3dc8cf62",
"score": "0.78039056",
"text": "def attributes_hash; end",
"title": ""
},
{
"docid": "5... |
7017470bbae4fea79a61cf9a1a99f6b2 | Returns object like game or graphic | [
{
"docid": "b126452fbdc1ce41dbcf75e4789b6e33",
"score": "0.53767985",
"text": "def get_stream_object(message, type)\n \n if type == \"graphic\" || type == \"graphic_publish\"\n return Graphic.find_by_id(message['graphic_id']) \n end\n\n Game.find_by_id(message['game_id'])\n end",
"... | [
{
"docid": "6c99deabf202b70c2ebbe7a5d1e4f03c",
"score": "0.6882969",
"text": "def inspect\n\t\t\"Text twist game object\"\n\tend",
"title": ""
},
{
"docid": "fff020faecf3ee774a8801ac13e323ff",
"score": "0.6481492",
"text": "def to_s\n\t\t\"Text twist game object\"\n\tend",
"title... |
6e8a50785a704bdf0f6849101fcc20e0 | Returns a description of how to use this plugin | [
{
"docid": "bd74f98e565e2166f34e26a56a3f171b",
"score": "0.0",
"text": "def usage\n \"?weather (<day>|<location> (<day>)) - get a weather report\"\n end",
"title": ""
}
] | [
{
"docid": "d0c46dc42d0e4690f70bb943deca1a05",
"score": "0.8001723",
"text": "def desc\n\t\t\"Demonstrates using framework plugins\"\n\tend",
"title": ""
},
{
"docid": "4916269b68c6537437a2025201abff1e",
"score": "0.77831924",
"text": "def description\n 'This is a reference implem... |
6f25f7e6f6870cd56c1c0d24a95e3f23 | Request to activate account using activation link | [
{
"docid": "d76d81ae66a80230aed7e01fbc703f8b",
"score": "0.0",
"text": "def show\n @user.activate!\n flash[:notice] = I18n.t('user.account.activated')\n session_activate\n redirect_to login_path( :service => cas_service_url( \"#{JWebApp}/?ga=emCyamsW&fl=1\" ), :jwa => 0, :ga => \"emCyamsW\" ... | [
{
"docid": "7e8041c0c7400e2648aa8966a69ac509",
"score": "0.7978861",
"text": "def account_activation(user)\n @user = user\n @user.activation_token\n body = {\n token: @user.activation_token,\n email: @user.email\n }\n @url = url_with_params(\"#{PROTOCOL}://#{choose_subdomain}#{D... |
c80746bc64c3c593d779eb5465bb51cc | Select all of current user's listings where the check out is before the current date | [
{
"docid": "1773d47e4056ecf26a372af35a527f8c",
"score": "0.76460826",
"text": "def past_listings\n all_listings.select do |listing|\n listing.check_out < current_time\n end\n end",
"title": ""
}
] | [
{
"docid": "a286cabf6b4d2a3868ab29ab512c1053",
"score": "0.74048966",
"text": "def active_listings\n all_listings.select do |listing|\n listing.check_in >= current_time\n end\n end",
"title": ""
},
{
"docid": "e84ccb71c5ccaf0cefd7133d94e31fd5",
"score": "0.65032417",
"tex... |
698d3e5171a66c8d672742bc1a5cda1d | Returns all public statuses. The Firehose is not a generally available resource. Few applications require this level of access. Creative use of a combination of other resources and various access levels can satisfy nearly every application use case. | [
{
"docid": "945a13e75472b13a53d8c1a538713843",
"score": "0.0",
"text": "def firehose(query_parameters = {}, &block)\n EventMachine::run { super }\n end",
"title": ""
}
] | [
{
"docid": "a8d668a2310cfd6696901c858736f633",
"score": "0.68830085",
"text": "def statuses\n Statuses\n end",
"title": ""
},
{
"docid": "f16787ef1376c8332a2e15b868b5231e",
"score": "0.68094206",
"text": "def statuses\n response = get \"statuses\"\n msg response, Logger... |
16a8e5cbc77d8dbe2ce6a0986cd2be59 | Todo: Add description for test test_date_as_optional | [
{
"docid": "b9fa474911b1d6b9da6461202e13b90b",
"score": "0.76553816",
"text": "def test_date_as_optional()\n # Parameters for the API call\n body = DateAsOptional.from_hash(APIHelper.json_deserialize(\n '{\"date\":\"1994-02-13\"}'\n ))\n\n # Perform the API call through the SDK function... | [
{
"docid": "375ea7162e2290a80dd96114cf626669",
"score": "0.6569004",
"text": "def temporarly_assignment_date\n\t\terrors.add(:expected_return_date, \" can't be blank on Temporarly Assignment\") if assignment_type == \"false\" && expected_return_date.blank?\n\tend",
"title": ""
},
{
"docid": ... |
0622a13f9ed074297f74124bd585aeab | Returns a error_handler Task by looking for that Task in an attribute and then in the contained Tasks or Tasks in outer Flows. | [
{
"docid": "f46e7397a34903481ab7811e4d805105",
"score": "0.5429461",
"text": "def error_handler()\n return @error_handler unless @error_handler.nil?\n eh = find_task(:error)\n return eh unless eh.nil?\n @env.error_handler\n end",
"title": ""
}
] | [
{
"docid": "957761faa411b92f1aa95bbddacdd68c",
"score": "0.48588407",
"text": "def on(attribute)\n return nil if errors[attribute.to_sym].nil?\n errors[attribute.to_sym].size == 1 ? errors[attribute.to_sym].first : errors[attribute.to_sym]\n end",
"title": ""
},
{
"docid": "9577... |
2377cafd15cee2395f823fb87f8186b5 | DELETE /sulabh_loan_repay_actuals/1 DELETE /sulabh_loan_repay_actuals/1.json | [
{
"docid": "bd8e20a9c44b849d3f0761491276faf6",
"score": "0.78060216",
"text": "def destroy\n @sulabh_loan_repay_actual.destroy\n respond_to do |format|\n format.html { redirect_to sulabh_loan_repay_actuals_url, notice: 'Sulabh loan repay actual was successfully destroyed.' }\n format.jso... | [
{
"docid": "8815f532f2d6db706731563b2d8daa79",
"score": "0.679457",
"text": "def destroy\n @loan_detail = LoanDetail.find(params[:id])\n @loan_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to loan_details_url }\n format.json { head :no_content }\n end\n end",
... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "c9ea97e55c7ce7605d90b3d8e5e99682",
"score": "0.0",
"text": "def set_yakushokumaster\n @yakushokumaster = Yakushokumaster.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... |
5e767d0b3ff0f3b2980d88f7ca9740f0 | PATCH/PUT /thing_to_dos/1 PATCH/PUT /thing_to_dos/1.json | [
{
"docid": "35850bdddc526474c1b3273afe030766",
"score": "0.66042435",
"text": "def update\n respond_to do |format|\n if @thing_to_do.update(thing_to_do_params)\n format.html { redirect_to @thing_to_do, notice: 'Thing to do was successfully updated.' }\n format.json { head :no_conte... | [
{
"docid": "845ae32c0e790e5adc2a8ba4f59d9e31",
"score": "0.6445584",
"text": "def update\n respond_to do |format|\n if @thing_to_do.update(thing_to_do_params)\n format.html { redirect_to @thing_to_do, notice: 'Thing to do was successfully updated.' }\n format.json { render :show, s... |
d02653f7ee1357668894d917d4133ebd | Dump all associations of a given type. dumper The Dumper object used to dump additional objects. association_type :has_one, :belongs_to, :has_many Returns nothing. | [
{
"docid": "b41d99d29e9ef79358e474012640ab1e",
"score": "0.7516202",
"text": "def dump_all_association_replicants(dumper, association_type)\n self.class.reflect_on_all_associations(association_type).each do |reflection|\n next if omitted_attributes.include?(reflection.name)\n\n ... | [
{
"docid": "852dee63ad7c8580a48edefeb93ffc35",
"score": "0.69729125",
"text": "def dump_association_replicants(dumper, association)\n if reflection = self.class.reflect_on_association(association)\n objects = __send__(reflection.name)\n dumper.dump(objects)\n if reflect... |
25fcef2dcf21b6d04120d4b6a960e6d5 | This method is invoked immediately before a fixture load starts and performs all work necessary to facilitate the load. ==== Parameters fixtures:: A collection of the fixture objects to be loaded. connection:: The database connection that the load will be performed through. | [
{
"docid": "39064d9269005e8102f64d7baaedc88f",
"score": "0.70933384",
"text": "def before_load(fixtures, connection)\n SQLite3Helper.log.debug \"SQLite3Helper.before_load called.\"\n connection.run(\"PRAGMA foreign_keys = OFF\")\n end",
"title": ""
}
] | [
{
"docid": "1f17acf8fc0488c5791965f6587cd09b",
"score": "0.720098",
"text": "def before_load(fixtures, connection)\n PostgresHelper.log.debug \"PostgresHelper.before_load called.\"\n fixtures.each do |fixture|\n begin\n connection.run(\"alter table #{fixture.table_n... |
713d1a5263c9204ff6764fa1e306618a | Used by index, everything | [
{
"docid": "4581e4b3bd98eeb5a16301008ace59eb",
"score": "0.0",
"text": "def getNewTripsAndAlbums\n unless read_fragment(:part => 'trips_and_albums')\n trip_reports = TripReport.order(\"created_at DESC\").includes(:user).includes(:route).limit(9)\n albums = Album.where(\"deleted=false\").inc... | [
{
"docid": "4d64fb161a3a2c97a670b0eaeff2569f",
"score": "0.7719061",
"text": "def indexes; end",
"title": ""
},
{
"docid": "bc2124d9d8da086f5e67f5ad5becd73a",
"score": "0.73456997",
"text": "def emit_index; end",
"title": ""
},
{
"docid": "761aa367951950ffa92a9ba71175cf5f... |
fb06ad02bace5e2fa8a0684a5d89549b | POST /products POST /products.xml | [
{
"docid": "c9eebd90b9d915ad2cf13f8effc94afb",
"score": "0.63500327",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to(@product, :notice => 'Product was successfully created.') }\n format.xml... | [
{
"docid": "9863246dd10ef5f8d9e1da35434fc3c1",
"score": "0.6789319",
"text": "def send_product(product)\n request(product, \"product\", :post, {method: \"add\"})\n end",
"title": ""
},
{
"docid": "a543c962db95f94c76ff7dfe096b5b3f",
"score": "0.6542377",
"text": "def post_to_n... |
300a5a25080c6fa2a7ab518c1755390d | Initialize a DRobyModel object with the given set of ancestors | [
{
"docid": "47a963661b2f85775bf89f8c5a60d8e1",
"score": "0.0",
"text": "def initialize(name, remote_siblings, superclass)\n @name = name\n @remote_siblings = remote_siblings\n @superclass = superclass\n end",
"title": ""
}
] | [
{
"docid": "95f4127da54a0e22eee59e37adae8120",
"score": "0.73112696",
"text": "def initialize(ancestors_base, descendants_base = ancestors_base)\n raise ArgumentError.new(\"Model of ancestors_base does not match model of descendants_base\") if ancestors_base.model != descendants_base.model\n\n ... |
badc88f709aa4595fffbeb609f6996b4 | reads a header like ' header ' | [
{
"docid": "be447a384b7a9ddeca981bd81df7e9b7",
"score": "0.7119256",
"text": "def read_header3(src)\n line = src.shift_line.strip\n al = nil\n # Check if there is an IAL\n if new_meta_data? and line =~ /^(.*?)\\{(.*?)\\}\\s*$/\n line = $1.strip\n ial = $2\n al = read_attribute... | [
{
"docid": "0b5b57d979ce6a986116a7d3188c4a23",
"score": "0.79360014",
"text": "def parse_header(raw); end",
"title": ""
},
{
"docid": "0b5b57d979ce6a986116a7d3188c4a23",
"score": "0.79360014",
"text": "def parse_header(raw); end",
"title": ""
},
{
"docid": "9dfb0d1d10ac8f... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "3b8aa397a2cc2d40aedb1cbf7dac7e85",
"score": "0.0",
"text": "def master_order_params\n params.require(:master_order).permit(:date,\n orders_attributes: [\n :id, :purchase, :supplier_id, :expire, :valu... | [
{
"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... |
05d077063b79631d5976543ded4d4fc1 | Returns the storage type name, which Dis will use for directory scoping. Defaults to the name of the database table. class Document "documents" | [
{
"docid": "d4cff3aa323a5f7e73d23e851a250ba5",
"score": "0.61528605",
"text": "def dis_type\n @dis_type ||= table_name\n end",
"title": ""
}
] | [
{
"docid": "92e0783f5cf219732e703dccc2e8fb05",
"score": "0.7149712",
"text": "def document_type\n DocumentTypes[@document_type]\n end",
"title": ""
},
{
"docid": "07965e4ed360dd533e08b6588fe2bbe4",
"score": "0.71457624",
"text": "def document_type_class_name\n @document_... |
8b7803c9fe0821f03c95461964963b4d | Initializes a Response instance | [
{
"docid": "10dae481c4fea5502318cee3f482080c",
"score": "0.0",
"text": "def initialize(response, opts={})\n @response = response\n @options = {:parse => :automatic}.merge(opts)\n end",
"title": ""
}
] | [
{
"docid": "1dcfdd0696cb995ba3d06f4652b934c6",
"score": "0.8389361",
"text": "def initialize resp\n @response = resp\n end",
"title": ""
},
{
"docid": "8c680dc28fa829bcf8c19290620f6a7c",
"score": "0.81357765",
"text": "def initialize(response)\n\t\t\tsuper\n\t\t\t@response = ... |
922a51d39dc85fc1293814518953bc81 | Convert the response to a hash to be returned as a JSON response in the controller. | [
{
"docid": "771b69847cdb86dfb0096fa81c29699e",
"score": "0.0",
"text": "def to_hash\n hash_response = Hash.new\n for label in [\"pageNumber\", \"pageSize\", \"totalItems\", \"totalPages\",\"items\"]\n hash_response[label] = self.send(label.underscore.to_sym)\n end\n return hash_response... | [
{
"docid": "5e2f9b723e1db1f4cab4fc00154a5fa1",
"score": "0.75435066",
"text": "def toHash\n raise ResponseError, \"Response body doesnot exist\" if @_responseBody.nil? || @_responseBody.empty?\n JSON.parse(@_responseBody) \n end",
"title": ""
},
{
"docid": "0ab0392c3ac581bb39b02... |
a7647acfad6780692e50d58bfae3c2ab | Specify the backend for the IO selector. Provided values will be passed directly to +NIO::Selector.new+, with the exception of +:auto+ which will let nio4r choose the backend. Check the documentation of +NIO::Selector.backends+ for the list of valid options. Note that the available options on your system will depend on... | [
{
"docid": "2ba24185d96760d07524316c7517c75c",
"score": "0.7283521",
"text": "def io_selector_backend(backend); end",
"title": ""
}
] | [
{
"docid": "53ba6e7b32babbe88519b1482f01cb7a",
"score": "0.5311086",
"text": "def initialize(backend = :ruby)\n raise ArgumentError, \"unsupported backend: #{backend}\" unless backend == :ruby\n\n @selectables = {}\n @lock = Mutex.new\n\n # Other threads can wake up a selector\n ... |
26192092bc99cde5baf969cb2697708b | Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.user_mailer.password_reset.subject | [
{
"docid": "84f778f2c1e062b278544aebf0e26c05",
"score": "0.0",
"text": "def password_reset(user)\n @user = user\n mail(to: @user.email,\n subject: '密码重置') do |format|\n format.html(content_transfer_encoding: \"7bit\") \n format.text(content_transfer_encoding: \"7bit\")\n end\n... | [
{
"docid": "ea740e704e8f1173fb87b45dfcaaf989",
"score": "0.73724806",
"text": "def subject_for(key)\n I18n.t(:subject, scope: [:mailer, key])\n end",
"title": ""
},
{
"docid": "542885bb44aabef24a05ce9d9749449c",
"score": "0.7291695",
"text": "def subject_for(key)\n I18n.t(... |
b88141b5ebd8605db511426bc512d3b5 | DELETE /vlozitpdfs/1 DELETE /vlozitpdfs/1.xml | [
{
"docid": "22d4bdacf9a563c1b0f317396605b6d9",
"score": "0.6807098",
"text": "def destroy\n @vlozitpdf = Vlozitpdf.find(params[:id])\n\n if fel_id[:user_id] != @vlozitpdf.vlozil && !is_admin\n redirect_to(@vlozitpdf, :notice => 'Nemátě oprávnění upravovat tento dokument')\n return\n e... | [
{
"docid": "4ba3042e4714b5501bc5ce9fa814170d",
"score": "0.74322903",
"text": "def destroy\n @pdfs = Pdfs.find(params[:id])\n @pdfs.destroy\n\n respond_to do |format|\n format.html { redirect_to(pdfs_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"doc... |
96e235a44e6e4d2f8364001733aa0c71 | POST /blogs/1/entries/1/comments POST /blogs/1/entries/1/comments.json | [
{
"docid": "d63653449790006d4ee650ceaa133410",
"score": "0.63590074",
"text": "def create\n @comment = Comment.new(comment_params)\n @comment.entry_id = params[:entry_id]\n @comment.status = 'unapproved'\n\n respond_to do |format|\n if @comment.save\n AdminMailer.with(comment: @c... | [
{
"docid": "668554c50d0198da5b8f3204d1da9b3b",
"score": "0.7144556",
"text": "def create\n hash = params[:comment].dup\n hash.delete('parent_id') unless hash['parent_id'].presence\n response = RestClient.post(([Share.config.endpoint, 'sources', params[:post_id], 'comments.json'].join('/') + \"?... |
37460cc3ef4e8091dbbcb3a593530aeb | set current parse mode [+m+] Mode to set it to | [
{
"docid": "4cca145c7fa396a1d10659a5ce8061ff",
"score": "0.6962344",
"text": "def set_mode(m)\n @mode = m\n end",
"title": ""
}
] | [
{
"docid": "b2a832318bf7830e895bac99988980b9",
"score": "0.6402921",
"text": "def mode=(m)\n @mode = m.to_sym\n end",
"title": ""
},
{
"docid": "edbb6e140fd40aa691224b9cc4c00d81",
"score": "0.6244548",
"text": "def set_mode(new)\n @mode = new\n end",
"title": ""
... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "910c20deeb93d277891947a952e450af",
"score": "0.0",
"text": "def order_params\n params.require(:order).permit(:id)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6980629",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.67819995",
"text": "def strong_params\n params.requ... |
82400d4da107dff17f23b3c12f35a2ef | PATCH /properties edit current teacher's properties | [
{
"docid": "40e4ede19bbafe21f3b97c37db0c8b29",
"score": "0.78495675",
"text": "def update_properties\n @teacher = current_teacher\n if @teacher.update(teacher_params)\n flash[ :success] = \"Properties update successful\"\n redirect_to profile_path\n else\n render :properties\n ... | [
{
"docid": "dea3c535332c7e320a1401eb526d6731",
"score": "0.7651922",
"text": "def updatea_properties\n if @teacher.update(edit_profile_params)\n flash[ :success] = \"Properties update successful\"\n redirect_to edit_teacher_path(@teacher)\n else\n render 'edita'\n end\n end",
... |
2a71b7e7f4a5e1ace034fcc383389b2e | Logs out the current user. | [
{
"docid": "75ccb5f24abeb1e7289f9407a442a8e6",
"score": "0.0",
"text": "def log_out\n if user_giving_test && current_user.count>0\n redirect_to users_finish_path\n elsif user_giving_test && current_user.count==0\n current_user.update_attributes(under_test: 0)\n forget(current_user)\n sessi... | [
{
"docid": "1a7d7c597a52f3b5aaec26768e34f46d",
"score": "0.85847217",
"text": "def log_out\n reset_session\n @current_user = nil\n end",
"title": ""
},
{
"docid": "3e7fb7b4f9e0d0a0929925276bda1b3d",
"score": "0.8553567",
"text": "def log_out\n session.delete(:user_id)\n... |
c3a7ad2e1d079017f6a3a603829fed09 | Write Node as XML to +io+ with +options+ doc.write_xml_to io, :encoding => 'UTF8' See Nodewrite_to for a list of options | [
{
"docid": "5a027243f72e06e2678ececce9c6e3a5",
"score": "0.85442924",
"text": "def write_xml_to(io, options = T.unsafe(nil)); end",
"title": ""
}
] | [
{
"docid": "450a3330098ccfce13a9fbd434bfaa0f",
"score": "0.8198421",
"text": "def write_xml_to(io, options = {})\n options[:save_with] ||= SaveOptions::DEFAULT_XML\n write_to io, options\n end",
"title": ""
},
{
"docid": "b4f6c5701845ce2a8d2f3e833af67659",
"score": "0.... |
9b89f402b34627235ffad1620e00f50c | Who is logged in? | [
{
"docid": "49e67dceedf25538b90360b3f1d3e2b2",
"score": "0.0",
"text": "def req_uri_saver\n session[:prev_dest] = session[:dest]\n session[:dest] = request.env['REQUEST_URI']\n end",
"title": ""
}
] | [
{
"docid": "c240919c56b7a00fd26e683e4dd968b8",
"score": "0.7644458",
"text": "def logged_in?; end",
"title": ""
},
{
"docid": "816e21e7fca797db079a594c8ac2410f",
"score": "0.7572065",
"text": "def get_logged_in_user\r\n %x[whoami].chomp\r\n end",
"title": ""
},
{
... |
bb8557b7790b40eefcfb8f97787db0af | rubocop:enable Metrics/AbcSize destroy is used to kill off a cluster | [
{
"docid": "2afd89b6137e83e18361891487f24c34",
"score": "0.69605154",
"text": "def destroy(name)\n @gke.delete_project_location_cluster(\"projects/#{@project}/locations/#{@region}/clusters/#{name}\")\n end",
"title": ""
}
] | [
{
"docid": "0512a55ef89979d5e7d57e6d389686ce",
"score": "0.7664316",
"text": "def destroy_cluster(cluster_id)\n\n # Only power off nodes that are running.\n find_active_nodes.each do |details|\n next unless details['cluster_id'] == cluster_id\n Nalloc.trace(node: details['identity'], ope... |