query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
ad4a86a078eb662f7cfa328648441272
Members of this struct
[ { "docid": "9cb5cafe12fd521e7e44cbd49d64bdc5", "score": "0.0", "text": "def attributes\n @attributes.dup\n end", "title": "" } ]
[ { "docid": "7f78f282e87cfc6eb06c16b266e4ce19", "score": "0.71677136", "text": "def _fields; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.7096669", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "52e2e7204623c468af6df99606a66448", "score": "0.0", "text": "def set_post\n @post = Post.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...
6bd48d278b62e0c9dcf5347276031e60
GET /resis GET /resis.json
[ { "docid": "7c5259db73fbaae08faf343612487eb9", "score": "0.6659604", "text": "def index\n @resis = Resi.all\n end", "title": "" } ]
[ { "docid": "ef8eab9b9ae0d77934927b19bc1bed76", "score": "0.6469998", "text": "def getOrden \n \t@orden = Orden.where(:rest => params[:id_res])\n \trender json: @orden\n end", "title": "" }, { "docid": "8f09a750ec732afa86beebeb91a86def", "score": "0.6389563", "text": "def index\n ...
aaf0215868d17ce24f093647b4401bd3
Returns the third line containing the state, post code and country
[ { "docid": "6468237b51b26c284b1716f0d3a5de04", "score": "0.7694812", "text": "def third_line\n \"#{self.state} #{self.postal_code} #{self.country_short_name}\".squeeze(\" \").strip\n end", "title": "" } ]
[ { "docid": "67ab2b6628d65fdb4fc3a0b5d41f36ba", "score": "0.7030977", "text": "def lines\n address = format.apply(formatting_values)\n lines = address.split(\"\\n\").reject {|line| line.strip.empty? }\n lines << country_name.upcase\n end", "title": "" }, { "docid": "8c6d277cea73eaee...
b6582339a60a657cc620b77ef6a0a4a0
Pop an element of the stack
[ { "docid": "a743f35a52d5ce00c35ac4f741efa630", "score": "0.87418664", "text": "def pop\n stack.pop\n end", "title": "" } ]
[ { "docid": "60737e3743032d529196676eaa0b0da0", "score": "0.88770425", "text": "def pop()\n @stack.pop\n end", "title": "" }, { "docid": "c5940ff5ac80363c6c89f1297a683627", "score": "0.88659966", "text": "def pop()\n @stack.pop ...
3e81cdbc097b8362b9b5b7f21721404d
Parse the fenced codeblock at the current location. source://kramdown//lib/kramdown/parser/kramdown/codeblock.rb37
[ { "docid": "c3da1a59c7503155a1ca2d106da81df6", "score": "0.83670837", "text": "def parse_codeblock_fenced; end", "title": "" } ]
[ { "docid": "94e725c2743954383dee0b900c518187", "score": "0.8096643", "text": "def parse_codeblock_fenced\n if @src.check(self.class::FENCED_CODEBLOCK_MATCH)\n start_line_number = @src.current_line_number\n @src.pos += @src.matched_size\n el = new_block_el(:codeblock, @s...
2387836669dd74971955abeb94b38b8b
Setting a URL will extract values for host, namespace, and name. This should not overwrite values for those attributes that were set in the same session.
[ { "docid": "4388c0e9291c70766bffb5243dc29195", "score": "0.6707336", "text": "def url=(value)\n # this column is deprecated; eventually url will just be a virtual attribute\n write_attribute(:url, value)\n\n return unless RemoteServer.parseable_url?(value)\n\n attrs_from_remote_server = Remo...
[ { "docid": "aaf666c4419bbdf74be44ed6167c326c", "score": "0.69540364", "text": "def set_url\n @url = Url.find_by_key(url_param)\n end", "title": "" }, { "docid": "abd312686ab7be7b2ff4d2f45ace7351", "score": "0.688899", "text": "def url=(value)\n\t\t\turi = URI.parse(value)\n\t\t\t...
d6a2bc098c40d450a9f0e3d84c4b3660
PATCH/PUT /students/1 PATCH/PUT /students/1.json
[ { "docid": "b8864fe7f35e3d3bd28e8149c6b315b0", "score": "0.0", "text": "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice:\"已成功更新学生账户:#{@student.name}. \" }\n format.json { render :show, status: :ok, location: @st...
[ { "docid": "d12824464ab9274e821c6bf1325a652d", "score": "0.71582144", "text": "def update\n student_respond @student.update(student_params), :edit\n end", "title": "" }, { "docid": "f7dd009aa3a56228261521891ead230a", "score": "0.7111601", "text": "def update\n @student = Stude...
2da69c9d21706f2e82e1b64288e116d6
Gets a Translation for a String Implementation Example: WebTranslateIt::Connection.new('secret_api_token') do string = WebTranslateIt::String.find(1234) puts string.translation_for("fr") => A Translation object end
[ { "docid": "a7dce5684037e8206e57dea7844fb953", "score": "0.6732501", "text": "def translation_for(locale)\n success = true\n tries ||= 3\n translation = self.translations.detect{ |t| t.locale == locale }\n return translation if translation\n return nil if self.new_record\n ...
[ { "docid": "39a449da2a4d24e33db3477d75535941", "score": "0.69150776", "text": "def sticker_translate(string)\n params = {:s => string}\n result = request'stickers/translate', params\n Responses::Translate.new(result)\n end", "title": "" }, { "docid": "554b48ccda910a64c4e33a...
5fe9babb74eb25eb5304e065be0dfb0a
Source: under the first section for prawn.
[ { "docid": "1e2796f5024f494497a1cf4a0ef24d1b", "score": "0.0", "text": "def header\n image \"#{Rails.root}/app/assets/images/giftgardensmall.jpg\", \n width: 40, height: 40\n move_up 30\n text \" Report\", size: 24, style: :bold, :align => :center\n end", "title": "" } ]
[ { "docid": "f2703cf5fb8818dd9734fe8bc6cf576d", "score": "0.70062983", "text": "def source; end", "title": "" }, { "docid": "f2703cf5fb8818dd9734fe8bc6cf576d", "score": "0.70062983", "text": "def source; end", "title": "" }, { "docid": "f2703cf5fb8818dd9734fe8bc6cf576d", ...
b561c59b8833b0ade3229b7895932cb6
p exponent_recursive(1,12) p exponent_recursive(2,1) p exponent_recursive(1,0) p exponent_recursive(100,3) p exponent_recursive(10,100)
[ { "docid": "a704ebe7ea2c4385b1b79aee8bbe4db0", "score": "0.0", "text": "def exponent2(base, number)\n return 1 if number == 0\n return base if number == 1\n if number.even?\n p base\n half_exponent = exponent2(base, number/2)\n half_exponent * half_exponent\n else\n p base\n half_odd ...
[ { "docid": "197ab0b1afe59b7c3d24e6acd01bd290", "score": "0.8571521", "text": "def exponent_recursive(base, number)\n return 1 if number == 0\n base * exponent_recursive(base, number -1)\n p base\nend", "title": "" }, { "docid": "5c86feaae43a05271533b127ee240c12", "score": "0.80159473"...
d4a1edaae4d92d004632cf64501ce2e7
DELETE /users/1 DELETE /users/1.json
[ { "docid": "338a2b2d017e308643b29468838e1641", "score": "0.0", "text": "def destroy\n @user.destroy\n respond_with @user, location: users_path\n end", "title": "" } ]
[ { "docid": "8e69eb3ff3374e0db6fa9eb17958df65", "score": "0.78736883", "text": "def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end", "title": "" }, { "docid": "6f74a32c6fdb67babd4a903e37b5baa4", "score": "0.7750104", "text": ...
7b92ed5d2a0172cbe40e028402852a37
Returns membership logs in order of the date they were created
[ { "docid": "709630956a0a69bfa327b9ab4922edb9", "score": "0.6964486", "text": "def membership_logs(org = nil)\n @membership_logs ||= {}\n key = org.nil? ? :all : org.id\n \n params = {:account_id => self.id}\n params = params.merge({:org_id => org.id}) if org\n \n @memb...
[ { "docid": "871839b74e964801a1c86cffa0945c5e", "score": "0.65299195", "text": "def read_logs_all()\n #logs = Log.find(:all, :order => 'created_at asc')\n logs = Log.all.order('created_at asc')\n end", "title": "" }, { "docid": "df96fc77543b7d291af2e32a95f5eb6f", "score": "0.629547...
bb211fccc418f2bd102b4c1b8eaed5be
Set full position for every change.
[ { "docid": "9f1ef095d64ed3a9d4cd2637bad4d268", "score": "0.6144224", "text": "def x=(x) set_position( x,@y,@z); end", "title": "" } ]
[ { "docid": "4babee9a3f54a5612c5229e31d18f24b", "score": "0.7104689", "text": "def update_position\n end", "title": "" }, { "docid": "4babee9a3f54a5612c5229e31d18f24b", "score": "0.7104689", "text": "def update_position\n end", "title": "" }, { "docid": "4babee9a...
17d1ed95084e7298689afb2c0afff15f
POST /api/v1/my_products POST /api/v1/my_products.json
[ { "docid": "1093ff941072c399e65d6dbf7d000842", "score": "0.686062", "text": "def create\n @my_product = current_user.products.new(my_product_params)\n\n if @my_product.save\n render :show, status: :created\n else\n render json: @my_product.errors, status: :unprocessable_entity\n en...
[ { "docid": "6e6e22738994035234ed86fee8433fa8", "score": "0.7112911", "text": "def create\n @product = Product.new(product_args)\n\n if @product.save\n render json: Product.all, status: :created\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end", ...
f3173a34ed8688e447e4bc3b42d64576
Add the newly created app to the network specified in the constuctor's `apps_network_id`
[ { "docid": "e11bff8c702cb9f4948a00873f297c77", "score": "0.7933112", "text": "def add_to_apps_network\n visit \"#{TestChamber.target_url}/dashboard/tools/apps_network_association/#{apps_network_id}\"\n fill_in('app_ids', :with => id)\n click_button('Add')\n end", "title": "...
[ { "docid": "33fba6135ce0aa5d240cae224c349362", "score": "0.81426", "text": "def add_to_apps_network\n raise \"This method can only be called if apps_network_id is set\" unless apps_network_id\n visit \"#{TestChamber.target_url}/dashboard/tools/apps_network_association/#{apps_network_id}\"\...
eee3fc043d50433af2c7dd3563e55ec7
Process an outgoing packet.
[ { "docid": "c3dcf8d5acb2be5d297b687b5cc8f68f", "score": "0.6351515", "text": "def packet_out(packet)\n packet.from_mac = @mac_address\n Log.puts \"#{@host.name}/#{@name} sending #{packet}\" if @trace\n @out_chan << packet if @out_chan\n end", "title": "" } ]
[ { "docid": "12c4990f9ab2fba9fb2037ba919f5d1d", "score": "0.69710106", "text": "def packet_out(datapath_id, message, port_no)\n action = SendOutPort.new(port_number: port_no)\n send_packet_out(\n datapath_id,\n packet_in: message,\n actions: [action]\n )\n end", "title": "" ...
8b06beba6ec79d3c336fa03598eda410
But for a change lets do that for each and every word of the given String. Your task is to capitalize very word that has length greater than 2, leaving smaller words as they are. should work also on Leading and Trailing Spaces and caps. drop_cap('apple') => "Apple" drop_cap('apple of banana'); => "Apple of Banana" drop...
[ { "docid": "b839ad73bb283c55fca148c574755498", "score": "0.8392394", "text": "def drop_cap(str)\n word = str.split(/\\b/).map { |word| word.length > 2? word.capitalize : word}*''\nend", "title": "" } ]
[ { "docid": "40dcf3273defe4095c7166badadfa8ec", "score": "0.8652585", "text": "def drop_cap(str)\n # Split string on word bounderies to account for trailing, leading and\n # multiple spaces. Then map the array and capitalize words longer than\n # 3 characters, then join them into a string again.\n st...
30aae59081d035ab71d058dd7260d731
NEW API BASED SHARED METHODS NOTE ENCRYPTION AUTHENTICATION UI DROPDOWN OPTION NONE OPEN None/Open WPA2 DOT1X WPA2/802.1x WPA_BOTH DOT1X WPA & WPA2/802.1x WPA DOT1X WPA/802.1x WEP OPEN WEP/Open NONE RADIOS_MAC None/RADIOS MAC DOT1X values are > EAP, PSK, AD
[ { "docid": "217ea8d1b0dde8014b53ba367d29190c", "score": "0.0", "text": "def update_encryption(args = {})\n args = XMS.api_based_default_ssid_encryption.merge(args)\n\n profile_config = _get_profile_config()\n\n profile_config[\"ssids\"].each { |pc| pc.merge!(args) if pc[\"ssidName\"] == args[\"ssidNa...
[ { "docid": "322dc6006dae2c7bdc6a1e38385e7637", "score": "0.65278983", "text": "def change_encryption(auth_option, args = {})\n # puts \"starting change_encryption...\"\n configure_previous = false\n valid_options = [\"None/Open\", \"WPA2/802.1x\", \"WPA & WPA2...
9433e20aea5d7af87d686f18943e9d3e
Parses the configuration supplied on Endpoint construction
[ { "docid": "c94e386fa7424d7869eae63e13ba8637", "score": "0.75449526", "text": "def parse_config\n config = Oj.load(File.read('assets/config/endpoint.json'))\n @id = config['ID'].to_i || Druuid.gen\n @host = config['HOST'] || 'localhost'\n @port = config['PORT'].to_i || 43594\n end...
[ { "docid": "590903815082741b07f773b74b86ec30", "score": "0.7231884", "text": "def parse_config\n end", "title": "" }, { "docid": "cd50f181513006ff70777567c79e0e64", "score": "0.64907044", "text": "def parse\n if @config.nil?\n actual_parse\n end\n @conf...
c378b64c22bde1af850f0fbc4ad1cea6
Value of the configured id attribute of the group object
[ { "docid": "538ed9106e991b2fcb345657aba71652", "score": "0.0", "text": "def app_id\n object.send(:try, Innsights.group_id)\n end", "title": "" } ]
[ { "docid": "d0bb365751d6f39fb14b62b8f01172c1", "score": "0.8204157", "text": "def group_id\n @attributes[:group_id]\n end", "title": "" }, { "docid": "d0bb365751d6f39fb14b62b8f01172c1", "score": "0.8204157", "text": "def group_id\n @attributes[:group_id]\n end", "...
d12d670bfab676576fb75864ea2485cf
Convert a integer number to binary array.
[ { "docid": "cf78f5f438c409dd003d9035185f4953", "score": "0.62199134", "text": "def int_to_bin(gene)\n gene.to_s(2).split(\"\").map { |s| s.to_i }\nend", "title": "" } ]
[ { "docid": "c87eac43b28c0420819e85a73ffbe639", "score": "0.7782512", "text": "def to_bit_array\n BitMapping.number_to_bit_array(number)\n end", "title": "" }, { "docid": "7aa641751eb331489f0546a4f5f08982", "score": "0.7393675", "text": "def to_bin(number)\n number = Integer(n...
403c3dcca1a8873a126ed80a9b851db7
PUT /administration/news/1 PUT /administration/news/1.json
[ { "docid": "1b4f3137254454eabba627a1c17575e1", "score": "0.6974938", "text": "def update\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(params[:news])\n format.html { redirect_to :action => 'index', notice: 'News was successfully updated.' }\n ...
[ { "docid": "11e75f755fee3dc527cb82fb281b6779", "score": "0.7033706", "text": "def update\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(params[:news])\n format.html { redirect_to news_index_url, notice: 'News was successfully updated.' }\n ...
e4a1bae6664b8870153de0b21d0fc98f
PATCH/PUT /kit_items/1 PATCH/PUT /kit_items/1.json
[ { "docid": "12e46ea78d3e0928916feeadf6bafc10", "score": "0.6461339", "text": "def update\n\n fullImage = params[:kit_item][:image_url].split('/')\n params[:kit_item][:image_url] = fullImage[fullImage.length-1]\n\n respond_to do |format|\n if @kit_item.update(kit_item_params)\n flash...
[ { "docid": "ab7b511e7fdb14f278ada05c46659bfc", "score": "0.7053882", "text": "def _update_item(http, headers, path, body, name)\n resp = retry_request(http, \"PATCH\", path, body, headers)\n if resp.is_a?(Net::HTTPOK)\n Chef::Log.info(\"Updated keystone item '#{name}'\")\n else\n _raise_error(r...
8e43bf117f0f258f83405ac6873873ba
Preferred by a Rubyist
[ { "docid": "d9d0823b4e3602f135cae1528dbbced2", "score": "0.0", "text": "def all_numbers_even?(nums)\n nums.all { |num| num.even? }\n end", "title": "" } ]
[ { "docid": "94a9f9cebb96ca3b29ccb5ba3cfcdd94", "score": "0.59584385", "text": "def alternatives; end", "title": "" }, { "docid": "eb111f1fb32bc31204771f35c9524a9d", "score": "0.57510364", "text": "def most_interesting_man_in_the_world; end", "title": "" }, { "docid": "d2b...
69f6a48edc30cd2e742cedbeb5eca27f
GET /customers GET /customers.json
[ { "docid": "86a141407a29f570a83db833ee533060", "score": "0.0", "text": "def index\n if params[:from_date] && params[:to_date]\n @customers = Kaminari.paginate_array(Customer.order(\"created_at DESC\").where(:created_at => Date.parse(params[:from_date]).midnight..Date.parse(params[:to_date]).midn...
[ { "docid": "44d5c99d89ab374d2baf04ebcdda12b5", "score": "0.81344914", "text": "def getcustsjson\n render :json => @customers\n end", "title": "" }, { "docid": "e9c7651d1891953067719cb341ff5ccb", "score": "0.80062556", "text": "def index\n @customers = Customer.all\n\n rende...
54538878e1a3a5ca61c7fe771237857c
Build 1C Query instance with param and TempTablesManager
[ { "docid": "a1e2f1d41a5ec3cf93852ba11fc47534", "score": "0.6056043", "text": "def query_get(text, tempt_manager = nil, **params, &block)\n result = newObject('Query', text) do |q|\n q.TempTablesManager = tempt_manager ||\\\n newObject('TempTablesManager')\n\n ...
[ { "docid": "1bdba72a303570c95eb341bcab90c98e", "score": "0.66092587", "text": "def query(text, temp_tables_manager_ = nil, **params)\n q = newObject('Query', text)\n q.TempTablesManager = temp_tables_manager_ || temp_tables_manager\n params.each do |k, v|\n q.SetPar...
176289defc2586b7cb851643874660db
DELETE /products/1 DELETE /products/1.json
[ { "docid": "17b1b084808853ff73a25c2733bcab53", "score": "0.0", "text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url, notice: 'Product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "2fa0a3656e86962ca1a10fa31aede189", "score": "0.7657799", "text": "def destroy\n @productos_json.destroy\n respond_to do |format|\n format.html { redirect_to productos_jsons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "65950...
fcb98468d78de1a311d0148971dd37b8
Returns the first value that was removed from the list and shifts all items down by 1
[ { "docid": "3e2526829d31ddde86f3f0628048f6d7", "score": "0.0", "text": "def shift\n if @length == 0\n return nil\n elsif @length == 1\n node = @head\n @head = node\n @length -= 1\n return node.value\n else\n node = @head\n @tail = node.previous\n @length ...
[ { "docid": "d3a98187e8bb4b75f336ef3b285dc784", "score": "0.75392914", "text": "def remove\n return @exact.shift unless @exact.empty?\n @list.shift\n end", "title": "" }, { "docid": "40e2a9e9f076ae3e8994a7382b3b6ca7", "score": "0.7324125", "text": "def remove_first\n rai...
57017eaeb74d8919176877c8ffff2018
GET /course_fees/1 GET /course_fees/1.json
[ { "docid": "efc9d5897a21bfa8ef574d795d6bb3b7", "score": "0.71220285", "text": "def show\n #@course_fee = CourseFee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course_fee }\n end\n end", "title": "" } ]
[ { "docid": "521123b84552fdf09a853dfe3428e32a", "score": "0.73026025", "text": "def index\n #@course_fees = CourseFee.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @course_fees }\n end\n end", "title": "" }, { "docid": "3acfdb53...
ef41b31890bc36f45cd525aaea290742
One of the following policy types: `TargetTrackingScaling` `StepScaling` `SimpleScaling` (default) `PredictiveScaling` For more information, see [Target tracking scaling policies][1] and [Step and simple scaling policies][2] in the Amazon EC2 Auto Scaling User Guide. [1]: [2]:
[ { "docid": "d8b39c85aa885da0f038a983b00d6387", "score": "0.5706624", "text": "def policy_type\n data[:policy_type]\n end", "title": "" } ]
[ { "docid": "af91bcec704bdd3b03034688dfd75cfe", "score": "0.5959786", "text": "def put_scaling_policy(policy_name: policy, scaling_adjustment:,\n cooldown:, **unused_values)\n\n self.client.put_scaling_policy(policy_name: policy_name,\n auto_scaling_group_name: Tapjoy::...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "e3077fbe5096391da58a13d4cb0c7594", "score": "0.0", "text": "def coletor_params\n params.require(:coletor).permit(:nome, :endereco, :cpf)\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...
c3e9f41ea1ff51e7f8749fb3abcd2eca
tells us who the current player is, X or O
[ { "docid": "d5e5a50a69ce9accd33848a1ebf9312e", "score": "0.0", "text": "def current_player(board)\n if turn_count(board) % 2 == 0\n return \"X\"\n else\n return \"O\"\n end\nend", "title": "" } ]
[ { "docid": "0f23468cd396f0666ef1180e56ff7009", "score": "0.7820279", "text": "def current_player\n (turn % 2 == 0) ? 'X' : 'O'\n end", "title": "" }, { "docid": "61f1c1263037b35cd9d1bfe660eebd4d", "score": "0.77361524", "text": "def current_player\n turn_count%2 == 1? \"O\":\"...
d25b9da79d5ceba61b67152e08a23bd7
Each square object should have it's own reference New board is initialized with
[ { "docid": "162099017a158e9b25441c778f4cdcc9", "score": "0.7519586", "text": "def initialize pieces=nil\n @squares = []\n for i in 0...64 do\n @squares[i] = Square.new \n end\n\n @pieces = pieces\n @pieces ||= createPieceHash\n @rules = ChessRules.new\n end", "title": "" }...
[ { "docid": "5e657a433b19851c4bd166ff1c466b4b", "score": "0.78990877", "text": "def initialize board\n @board = board\n end", "title": "" }, { "docid": "914c764f36b30d02e3fd3730e3d510a8", "score": "0.78129554", "text": "def initialize\n @board = @@the_board.clone\n end", ...
df5f3d9d6a831759fb034987a5d4a898
Attempts to resolve the latest version of the component available in the configured repositories
[ { "docid": "6877e6b28a961f14ac1484710faef20d", "score": "0.0", "text": "def get_repository_meta_component_with_http_info(purl, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: RepositoryApi.get_repository_meta_component ...'\n end\n # ver...
[ { "docid": "e4016e6d9cb14e0d6309b1915f6b9700", "score": "0.63235813", "text": "def rest__resolve_pull_from_remote\n rest_ok_response resolve_pull_from_remote(:component_module)\n end", "title": "" }, { "docid": "10c787cb815f426a3c08a8f543f5be58", "score": "0.61864626", "text"...
88398ee7353fb15c9e0edeafc9a2565d
load_and_authorize_resource GET /game_judges GET /game_judges.json
[ { "docid": "aa87ad50482082cc1169eb90cdf9fc29", "score": "0.6712563", "text": "def index\n @game_judges = GameJudge.all\n end", "title": "" } ]
[ { "docid": "01fe95832a4308bb3a133c47762eded8", "score": "0.6565849", "text": "def badges\n get(\"user/#{user_id}/badges.json\")\n end", "title": "" }, { "docid": "d194268155b60605c4da5301902e28f0", "score": "0.6479262", "text": "def index\n authorize Judge\n @judges = J...
fedd4b664e2c9aa5a7594c8a496d28e6
A class method is 'dangerous' if it is already (re)defined by Active Record, but not by any ancestors. (So 'puts' is not dangerous but 'new' is.)
[ { "docid": "acc5b57ec92c4b68f879bb3a2abec2c8", "score": "0.0", "text": "def dangerous_class_method?(method_name)\n return true if RESTRICTED_CLASS_METHODS.include?(method_name.to_s)\n\n if Base.respond_to?(method_name, true)\n if Object.respond_to?(method_name, true)\n ...
[ { "docid": "e8c433c96df7f770bfad43f3a2db7b1b", "score": "0.5993298", "text": "def prerecord(klass, method_name)\n end", "title": "" }, { "docid": "3f0c0e4a6542028b358e2b54d9db7ad7", "score": "0.5892897", "text": "def class_method\n puts self\n end", "title": "" }, ...
233e55fbcb64ab419cdd435ea0049807
Loops through environment variables for the remotesyslog plugin
[ { "docid": "182f6a313c51aac55802ec3f17ab642f", "score": "0.6789249", "text": "def init_environment_vars()\n prefix = 'REMOTE_SYSLOG_'\n group = prefix + \"HOST\"\n\n ENV.each_key.to_a.select { |s| s.start_with? group }.uniq.each do |k|\n # [0] = environment variable name\n # [1] = syslog plugi...
[ { "docid": "33c2e9024735ad2de5b0a7412fabcc4c", "score": "0.6290039", "text": "def refresh_envs\n command = \"/usr/bin/sudo -S /usr/sbin/puppetd -o --server puppeteer --tags host-puppetmaster::site_modules host-puppetmaster::modules\"\n system \"#{command} >> /tmp/gwlog 2>&1\"\n return tru...
1ca42f57e2353fb6bffc316a38a09f88
Copies subtitle_marker csv files to content for subtitle import. Also renames files like so: 590125_0547.markers.txt => eng590125_0547.subtitle_markers.csv
[ { "docid": "813791bdad352f5bcc99ace653eafd17", "score": "0.82193756", "text": "def copy_subtitle_marker_csv_files_to_content(options)\n input_file_spec = options['input'] || 'subtitle_tagging_import_dir/txt_files'\n input_base_dir_name, input_file_pattern_name = input_file_spec.split(\n ...
[ { "docid": "67f341bfd6f613342b86bcce8082910c", "score": "0.8506518", "text": "def copy_subtitle_marker_csv_files_to_subtitle_export(options)\n input_file_spec = options['input'] || 'content_dir/csv_files'\n input_base_dir_name, input_file_pattern_name = input_file_spec.split(\n Re...
c9e4b4efc08e8d15e2b90d669b2c3105
Retrieves all `Shooting`s that occurred within a date range.
[ { "docid": "aed88e68ff22a35c7c73ef672eecbe5b", "score": "0.52396405", "text": "def in_date_range(date_range)\n pages_in_date_range(date_range).\n map(&method(:page)).\n flat_map(&:to_a).\n select { |shooting| date_range.cover? shooting.date }\n end", "title": "...
[ { "docid": "9cb60c5a18b562f9596dd89266dcee1a", "score": "0.6298835", "text": "def index\n @shootings = Shooting.all\n end", "title": "" }, { "docid": "d4c786d28ff8d7949bd2638b414fbe70", "score": "0.5660435", "text": "def shots(options={})\n paginated_list(self.class.fetch(\"...
4f8835224939b4fc52db49d26b0ce141
Take the good amount of money from the player and some other things
[ { "docid": "8511eba00faafe44d147530fefbb6d7e", "score": "0.0", "text": "def money_checkout(nb)\n display_message(parse_text(11, 29))\n $pokemon_party.lose_money(nb * @list_item[@index][:price])\n pokemon = PFM::Pokemon.generate_from_hash(@list_item[@index])\n test = pokemon.shiny\n ...
[ { "docid": "4ffe66248118e616e3fb33e8fb8c8c1b", "score": "0.74591166", "text": "def money\n return $game_party.gold\n end", "title": "" }, { "docid": "65f274b495eaf8f1c0a2417e7923ebb3", "score": "0.7358002", "text": "def myMoney\r\n return getMoney @playerData\r\n end", ...
046f56a9af26cd52099ef4c30c95ac39
GET /activities/1 GET /activities/1.json
[ { "docid": "723b1d858c636866491d826e8193bb42", "score": "0.0", "text": "def show\n #finds the activity with the id\n @activity = @company.activities.find(params[:id])\n #finds the associated user\n @user = User.find(@company.user_id)\n end", "title": "" } ]
[ { "docid": "63b3a970941149325bce66e9eaded074", "score": "0.8244081", "text": "def activity(id)\n get(\"/api/activities/#{id}\")\n end", "title": "" }, { "docid": "c32d53800e092963661f3d972719383e", "score": "0.8112914", "text": "def activity(activity_id)\n get(\"activiti...
3cdbbf3abf7c95668f046dda39a3fd5e
test an incorrect guess against a card's answer
[ { "docid": "2490fc564cfe2bfe63f41ca4f36cbd14", "score": "0.8045139", "text": "def test_guess_is_incorrect\n card = Card.new(\"Which planet is closest to the sun?\", \"Mercury\", :STEM)\n turn = Turn.new(\"Saturn\", card)\n\n refute turn.correct?\n end", "title": "" } ]
[ { "docid": "08e9d3822786f96481e125017cc7edbd", "score": "0.8113806", "text": "def guess_incorrect?\n card = Card.new(\"Queen\", \"Clubs\")\n guess = Guess.new(\"2 of Diamonds\", card)\n assert_equal false, guess.correct?\n assert_equal \"Incorrect.\", guess.feedback\n end", "title": "" ...
dfdb06630d1553f0222bcc2271726df5
DELETE /races/1 DELETE /races/1.json
[ { "docid": "0e803af277abdf1bb6f998217c0f947c", "score": "0.0", "text": "def destroy\n end", "title": "" } ]
[ { "docid": "38afd51c0ef2d782664164f643017301", "score": "0.7052423", "text": "def destroy\n @racer = Racer.find(params[:id])\n @racer.destroy\n\n respond_to do |format|\n format.html { redirect_to racers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, ...
21b774bbe0528afcae0bfb8b4a10e95f
Base path for the REST call
[ { "docid": "9504d512a4221b0188a2a4f93be2f6fc", "score": "0.0", "text": "def url\n resource.url + '/keys'\n end", "title": "" } ]
[ { "docid": "3b5fdd4040f5862619b032b0e18925e5", "score": "0.822766", "text": "def base_path (method_url)\n \"/rest/#{method_url}\"\n end", "title": "" }, { "docid": "40b2550f66795081f3d2b8a5d755ab61", "score": "0.7893885", "text": "def base\n Pathname.new(\"http://api.s...
d2fc831d41845f771f7852267c6044c9
POST /templates POST /templates.json
[ { "docid": "687b8d9b2a6f59b6e33e528d6f4dc7d4", "score": "0.61139023", "text": "def create\n @count = @count + 1\n @template = Template.new(template_params)\n\n respond_to do |format|\n if @template.save\n format.html { redirect_to session.delete(:referer), notice: 'Template criado c...
[ { "docid": "b32a250913f75e776dd17d784f013440", "score": "0.7065376", "text": "def create(data)\n client = Client.new({\n 'method': Client::METHOD_POST,\n 'url': Base.config.api_url('templates'),\n 'params...
03a0a44c49832c7e1f23d34b34b4e1be
POST /rgs POST /rgs.json
[ { "docid": "2793d6f81008580c756981e866603014", "score": "0.0", "text": "def create\n output = \"\"\n #load the file \n if (params[:file])\n uploaded_io = params[:file]\n filename = save_file(uploaded_io)\n up_filename = filename[0,filename.rindex('.')] + '.csv'\n system('ssc...
[ { "docid": "204d896e61933806be5afadf93a1e5d4", "score": "0.5818982", "text": "def create\n @srg = Srg.new(srg_params)\n respond_to do |format|\n if @srg.save\n format.html { redirect_to @srg, notice: 'Srg was successfully created.' }\n format.json { render :show, status: :create...
0940d4163068ec46d68dcdb70d7cd9de
create a hotel search with the same parameters for a given hotel
[ { "docid": "80bcf14ebacaf034555132db361b4b53", "score": "0.7208193", "text": "def hotel_search(result_or_hotel_id)\n hotel_id = result_or_hotel_id.is_a?(Fixnum) ? result_or_hotel_id : result_or_hotel_id.hotel_id\n params = parameters\n params.delete(:city_id)\n params...
[ { "docid": "e4a9f9ddc92eb8739f632c93959dc76e", "score": "0.6747231", "text": "def index\n @hotels = if params[:term]\n Hotel.where(\"name LIKE (?) OR address LIKE (?)\", \"%#{params[:term]}%\", \"%#{params[:term]}%\").paginate(page: params[:page], per_page: 5)\n else\n Hotel.paginate(pag...
a6c276e7f431e333429544346911c1c9
Create action will submit form and open new user session.
[ { "docid": "b8a6ea2a5a0f1573589b2ff516f9b685", "score": "0.68278784", "text": "def create\n\t\t#render 'new'\n\t\tuser = User.find_by(email: params[:session][:email].downcase)\n\t\tif user && user.authenticate(params[:session][:password])\n\t\t\tsession[:user_id] = user.id\n\t\t\tflash[:success] = \"You...
[ { "docid": "1d17edb70910feea99b3aceb03b72cba", "score": "0.75129104", "text": "def create\n @user = User.new(user_params) #new used for get/create used for post\n if @user.save\n create_session\n redirect_to user_path(@user) #/user/user.id\n else\n render :n...
b3ea3ba60a39a85dc5a9d3ea9c33a6f3
initializes this CisTermsOfService with a json hash
[ { "docid": "ee58897533c3232234dfa0284d7381f1", "score": "0.0", "text": "def init_jaxb_json_hash(_o)\n if !_o['frequency'].nil?\n _oa = _o['frequency']\n if(_oa.is_a? Hash)\n @frequency = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n ...
[ { "docid": "b3cd6ae50dc434db83f1ba0f5ae076cb", "score": "0.6869277", "text": "def initialize json_hash\n @json = json_hash\n super\n end", "title": "" }, { "docid": "f797731ad7edbe9684acff29c3de9fb6", "score": "0.65993506", "text": "def initialize(hash = {})\n s...
61f657f2dce457a149bbdb9d682ef5e8
Add atributes from another struct
[ { "docid": "ea4d5e37c1419f6986bc075669fc75d2", "score": "0.0", "text": "def attributes_from(struct)\n extracted_schema = struct.schema.keys.map { |key|\n if key.required?\n [key.name, key.type]\n else\n [:\"#{key.name}?\", key.type]\n end\n ...
[ { "docid": "370e9e5ab4ca49606c4f8443289b4c2d", "score": "0.65117043", "text": "def attribute(*attributes)\n self.attributes += attributes\n end", "title": "" }, { "docid": "eaacfdd6ba277ff93ddb2772666b5a55", "score": "0.6485864", "text": "def merge_struct(struct, attributes)\...
0a4d7cd00e2b6e52bc8fcfee3b2b308f
Create a new promocode for an event
[ { "docid": "9cab1403e73db5a975fbac983c296e32", "score": "0.73765415", "text": "def add_promocode(event_id, promocode)\n Services::EventSpotService.add_promocode(event_id, promocode)\n end", "title": "" } ]
[ { "docid": "414ce1ee0ced595176fed5930ded1bb1", "score": "0.7751477", "text": "def add_promocode(event_id, promocode)\n url = Util::Config.get('endpoints.base_url') +\n sprintf(Util::Config.get('endpoints.event_promocodes'), event_id)\n url = build_url(url)\n pay...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "ddca38ebb269bf9d37e0da08bfbbc112", "score": "0.0", "text": "def comment_params\n params.require(:comment).permit(:content,:name,:email, :publication_id)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.69497335", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6812623", "text": "def strong_params\n params.require(:listing_member).permi...
e98a7faf52a794be3ea84cb4ecdcc9de
O(nlog(n)) p third_anagram?("gizmo", "sally") p third_anagram?("elvis", "lives")
[ { "docid": "3608bbb56b0643fffcd0b4680d63a871", "score": "0.0", "text": "def fourth_anagram?(str1,str2)\n str1.chars.inject(Hash.new(0)) {|a,e| a[e] +=1 ; a } == str2.chars.inject(Hash.new(0)) {|a,e| a[e] +=1 ; a }\nend", "title": "" } ]
[ { "docid": "d428117d7025867f37f6ddb95d700917", "score": "0.87034386", "text": "def third_anagram?(anagram, margana) # O(n * log(n)) dominates linear growth\n anagram.chars.sort == margana.chars.sort # linear according to stackoverflow\nend", "title": "" }, { "docid": "c9b50b2473afa12685b63f...
7e1c442ee4c20e496261d78211f119cc
DELETE /movies/1 DELETE /movies/1.json
[ { "docid": "a2ce49c03130a526915f573dde54d5e8", "score": "0.74925786", "text": "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "0bdfa36f360663a01097aefd15fb3846", "score": "0.7561519", "text": "def destroy\n @movie = Movie.find(params[:id])\n @movie.destroy\n\n respond_to do |format|\n format.html { redirect_to movies_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "...
da526dafe914010b33c4478d80530c7f
Returns the current Tour object
[ { "docid": "e956934f895e71104eef6072de74247e", "score": "0.7204293", "text": "def get_tour()\n Kamelopard::DocumentHolder.instance.current_document.tour\n end", "title": "" } ]
[ { "docid": "98b1606d86dfc3a1398c2b2942505616", "score": "0.6757532", "text": "def get_assigned_tour\n order_tour = OrderTour.find_by_order_id(self.id)\n if order_tour.blank?\n return nil\n else\n order_tour.tour\n end\n end", "title": "" }, { "docid": "4844af20ae33287d...
e22bdd1842139e9158777a392a0a6d5c
Example tags ["trendy","zagatrated","david chang","pork","steamed buns"]
[ { "docid": "6cf43dca554fe9731ba6cf72e2fb4a16", "score": "0.0", "text": "def filter_by_tag(tag)\n get_venues_for_filtering\n @venues_to_filter.each do |venue|\n venue[\"tags\"].each do |venue_tag|\n if venue_tag.downcase == tag.downcase\n @venues_by_tag << venue[\"name\"]\n ...
[ { "docid": "864defd8cf1ff707d367bc5bbcc5c716", "score": "0.75259066", "text": "def tag_list\n tags.join(\", \")\n end", "title": "" }, { "docid": "3b0deb76a4f5676e62531da2a4561a14", "score": "0.7518393", "text": "def tags(*tag_names); end", "title": "" }, { "docid": "...
41d6cb57fbf4914fdd18fdf76f1ae860
PATCH/PUT /events/1 PATCH/PUT /events/1.json
[ { "docid": "98d47b6db474730d2d259931843541c5", "score": "0.73731446", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { head :no_content }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\...
[ { "docid": "4d95ee381a8e8f76f8d3ea23da4b3773", "score": "0.75301635", "text": "def patch_event\n user_id = params[\"user_id\"]\n group_id = params[\"group_id\"]\n event_id = params[\"event_id\"]\n\n #TODO Handle 404 if event not found\n event = Event.find(event_id)\n\n...
eabf8cb6d5d85ea9fdf3a4a6f001458a
Show replcated tables/column families, and their ReplicationType
[ { "docid": "582e1ad089ec152db2684bf08de8d16f", "score": "0.5101914", "text": "def list_replicated_tables(regex = '.*')\n pattern = java.util.regex.Pattern.compile(regex)\n list = @admin.listReplicatedTableCFs\n list.select { |t| pattern.match(t.getTable.getNameAsString) }\n end", "...
[ { "docid": "c015f4d4118700dd26aede6ddcee7ea1", "score": "0.6679066", "text": "def list_replicated_tables\n @replication_admin.listReplicated()\n end", "title": "" }, { "docid": "c015f4d4118700dd26aede6ddcee7ea1", "score": "0.6679066", "text": "def list_replicated_tables\n ...
14e58e35d3c7b17b63930e183624a6f4
Gets the hash of a cube
[ { "docid": "007a7471553652c67a33a8d828b85fdb", "score": "0.60620254", "text": "def hash\n @vbits.hash\n end", "title": "" } ]
[ { "docid": "23cdf6a080837fbe407633be0799ea0e", "score": "0.68614614", "text": "def hash() end", "title": "" }, { "docid": "23cdf6a080837fbe407633be0799ea0e", "score": "0.68614614", "text": "def hash() end", "title": "" }, { "docid": "23cdf6a080837fbe407633be0799ea0e", ...
088bf16abe2bd578146b950bde83077c
GET /homes or /homes.json
[ { "docid": "50dd8ecd933ff80f24cd8e9ad24b5c2d", "score": "0.0", "text": "def index\n @sites = Site.all\n @siteworkers = Siteworker.all\n @sites.load\n @siteworkers.load\n end", "title": "" } ]
[ { "docid": "be6896fee31b87d491c66110f347a804", "score": "0.7108875", "text": "def index\n @homes = Home.all\n\n respond_to do |format|\n format.html { render :index }\n format.json { render json: { \"homes\" => @homes } }\n end\n end", "title": "" }, { "docid": "4647ae465...
2b487ea37476389ec48f8798a8165e0c
PATCH/PUT /data_forms/1 PATCH/PUT /data_forms/1.json
[ { "docid": "535c7a9b1940562fcbc05f726a4a33a4", "score": "0.6575272", "text": "def update\n respond_to do |format|\n if @data_form.update(data_form_params)\n format.html { redirect_to @data_form, notice: 'Data form was successfully updated.' }\n format.json { render :show, status: :...
[ { "docid": "42e4d81ce0f91ce996dcbc347df2958d", "score": "0.6878671", "text": "def update\n @response = self.class.put(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\", :body => \"{'resource_form_name':#{JSON.generate(@opts)}}\")\n end", "title": "" }, { "docid": "7d1ede0705e6b6a2b0f61...
b7a56d2ab91f8474c5c18c07262f0c9c
converts the entire contents of the linked list to a string.
[ { "docid": "add6219e7258a5bb8eed2cc894455fd8", "score": "0.7280945", "text": "def to_s\n if @first_node.nil?\n '| |'\n else\n @list = @first_node.payload\n x = @first_node\n while x.last? == false\n @list += \", #{x.next_list_item.payload}\"\n x = x.next_list_item...
[ { "docid": "c1a9cbf8266e27869e59c9afd0883559", "score": "0.77938986", "text": "def to_string\n node = @head\n if node.next_node == nil\n node.data\n else\n node.data + \" \" + node.next_node.data\n end\n end", "title": "" }, { "docid": "53240a35416faef243f97296205e5460...
5e036404844493f48a6042f9afadddf2
Run rake task if exists on commandline. Used to run rake tasks in subdirectories.
[ { "docid": "480ed9298f9e16a02d07c94d7c4c929a", "score": "0.7339857", "text": "def run_task_if_exists task_name, params = \"\"\n if `bundle exec rake --tasks #{task_name}` =~ /#{task_name}[^:]/\n sh \"bundle exec rake #{task_name}[#{params}]\"\n end\nend", "title": "" } ]
[ { "docid": "8cc95e551eca8ba05e4e02cf0b9e3fe9", "score": "0.7793651", "text": "def run_rake(task)\n run \"cd #{current_path} && rake #{task} RAILS_ENV=#{environment}\"\nend", "title": "" }, { "docid": "8cc95e551eca8ba05e4e02cf0b9e3fe9", "score": "0.7793651", "text": "def run_rake(tas...
8e6369dbf9f3b528e17689ded1a8dd71
POST /ambulances POST /ambulances.xml
[ { "docid": "4c574b75af695465b91841a8e5355dff", "score": "0.6644335", "text": "def create\r\n @ambulance = Ambulance.new(params[:ambulance])\r\n\r\n respond_to do |format|\r\n if @ambulance.save\r\n flash[:notice] = 'Ambulance was successfully created.'\r\n format.html { redirect...
[ { "docid": "7cd0f17e81391cacfac318ecf8e7c122", "score": "0.62765974", "text": "def create\n @ambulance = Ambulance.new(params[:ambulance])\n\n respond_to do |format|\n if @ambulance.save\n format.html { redirect_to @ambulance, notice: 'Ambulance was successfully created.' }\n fo...
680289870a232ced9d198a71d99a6329
Repeating an existing trip that is in the past User wants to repeat a trip
[ { "docid": "98e4d43da5e387a604217f07b75a740d", "score": "0.6850122", "text": "def repeat\n # set the @traveler variable\n get_traveler\n # set the @trip variable\n get_trip\n\n # create a new trip_proxy from the current trip\n @trip_proxy = create_trip_proxy(@trip)\n # set the flag ...
[ { "docid": "cc14be877864b81a88301172684ff366", "score": "0.6112314", "text": "def set_trip\n @trip = current_user.trips.find(params[:id])\n end", "title": "" }, { "docid": "3aaa7f2c1ff88bfab48a59327afd240c", "score": "0.6055906", "text": "def increment\n @trip = Trip.find(para...
53ec64deba83c047021457b901a76d3f
Called at the end of processing just before the response gets sent to the middleware. This gets run outside of the main exception handling block of the agent so you should handle any exceptions you could raise yourself. The reason it is outside of the block is so you'll have access to even status codes set by the excep...
[ { "docid": "b2a9eb45e6c3faf816f70d59d15681ce", "score": "0.0", "text": "def after_processing_hook; end", "title": "" } ]
[ { "docid": "90b687a648b005a2fc1f02adf4895d87", "score": "0.65600973", "text": "def after_exception(e)\n logger.error \"Error processing request\", e.message, e\n after(500)\n end", "title": "" }, { "docid": "cc345c91b451a08a6facb47bf58b76b4", "score": "0.64952004", "text": "de...
1347c7a468844d7bafb7c726b152180f
DELETE /create_events/1 DELETE /create_events/1.json
[ { "docid": "bae1ecd6caf803915219e611868cb184", "score": "0.763136", "text": "def destroy\n @create_event = CreateEvent.find(params[:id])\n @create_event.destroy\n\n respond_to do |format|\n format.html { redirect_to create_events_url }\n format.json { head :no_content }\n end\n en...
[ { "docid": "7d4aa1b95a62c00729623f3530314a4e", "score": "0.7498849", "text": "def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7d4aa1b95a62c00729623f3530314a4e", "score": "0.7498849", "tex...
8086a66676c6908ee8dc02297fce9b92
POST /students POST /students.json
[ { "docid": "4dc262e1fc05a2d16efa395d9de2d22d", "score": "0.7110361", "text": "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, :notice => 'Student was successfully created.' }\n format.json ...
[ { "docid": "2befafcc6f076a73b42fca9ccbe2e9dc", "score": "0.7812407", "text": "def create\n require 'net/http'\n require 'json'\n\n student = Student.new(student_params)\n\n uri = URI('http://localhost:3000/students.json')\n\n request = Net::HTTP::Post.new uri, { 'Content-Type' => 'applica...
14d00f291f1c9e6217bf941eb5e12e3d
Gets the resetRedemption property value. Reset the user's redemption status and reinvite a user while retaining their user identifier, group memberships, and app assignments. This property allows you to enable a user to signin using a different email address from the one in the previous invitation. For more information...
[ { "docid": "3f079aaa3c72ca2cf59d84e99b4f99a5", "score": "0.7481671", "text": "def reset_redemption\n return @reset_redemption\n end", "title": "" } ]
[ { "docid": "101561f2febf5fa7bee0d0f76b476089", "score": "0.74572057", "text": "def reset_redemption=(value)\n @reset_redemption = value\n end", "title": "" }, { "docid": "6578c19f5af4e66bf2c9278b190bae5b", "score": "0.6363491", "text": "def password_reset\n ...
6caac54574dc9c68ec63fe35739bcebd
POST /trips or /trips.json
[ { "docid": "9d24aa8e13e7f0a08e79dc7dea69dd67", "score": "0.0", "text": "def create\n @itinerary = Itinerary.new(itinerary_params)\n @itinerary.user_id = current_user.id\n \n respond_to do |format|\n if @itinerary.save\n format.html { redirect_to @itinerary, notice: \"Itin...
[ { "docid": "32d9b4f125a0b7d4790f1dcc567cceca", "score": "0.6968034", "text": "def trips\n get '/gtfs/trips'\n end", "title": "" }, { "docid": "001c46616d4ed17803cf11cd302328a5", "score": "0.69003", "text": "def create\n trip = current_user.trips.new(trip_params)\n if tr...
fcdbc2de53e4990773291f52fffae39a
Parses the hResume .skill and .skills elements
[ { "docid": "495f5a8a6545ab54d1b2bef500e4d93a", "score": "0.80428314", "text": "def parse_skills(hresume)\n skills=[]\n (hresume/\".skill\").each do |el|\n skills << el.inner_text.strip\n end\n (hresume/\".skills\").each do |el|\n el.inner_text.strip.split(/\\r\\n|\\r|\\n|,/).each d...
[ { "docid": "8c1cb5b9e907eb10a8a04e3104b68e2e", "score": "0.67827874", "text": "def skills\n @page.css('ol#skills-list li a').collect {|a| a.inner_text.gsub(/\\n/,'').strip }\n end", "title": "" }, { "docid": "25f0f7d915befd849afe0cf3a69e4dc9", "score": "0.6608281", "text"...
75cb8e9132abf3e5fac4546acc49043e
MachineCodeX86Test testing /r reg/reg
[ { "docid": "50852443ba45603ad084ea5e4d757f06", "score": "0.0", "text": "def test_mov_eax_ebx\n asm.eax.mov asm.ebx\n assert_equal [0x89, 0b11011000], stream\n end", "title": "" } ]
[ { "docid": "8cc0b69638fc1edbbe0a13f4bf31ea13", "score": "0.6174659", "text": "def reg64?(reg)\n register?(reg) && reg.start_with?('x')\n end", "title": "" }, { "docid": "206cf0ab0d61177e28dc1aacf2e581d1", "score": "0.6112077", "text": "def registers\r\n send_break ...
33781e8fb4ab22ab974232a70a3d09ae
GET /pages/1 GET /pages/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "64e61b39be3e009082a46bd86ef7f8cc", "score": "0.77813053", "text": "def index\n @pages = Page.page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end", "title": "" }, { "docid": "0e06be4547a...
351ca50a9347ddeeaa0495ff9ffa3ee9
tar bort en tag
[ { "docid": "ea8825d5ffe529a4d461cdd90e722894", "score": "0.0", "text": "def destroy\n tag = Tag.find(params[:id])\n tag.destroy\n render json: 'The tag has been deleted'\n\n rescue ActiveRecord::RecordNotFound\n @error = ErrorMessage.new(\"The tag was not found!\", \"Could not find resource...
[ { "docid": "0af57f482a5d8bd3dabd66d9af6aa374", "score": "0.7324083", "text": "def tar\n @tarwriter\n end", "title": "" }, { "docid": "77198b03bed33a863c688509dacd30a7", "score": "0.73113203", "text": "def tar\n @tarwriter\n end", "title": "" }, { "...
d825170324452dc93dd533a359e3c98c
Returns whether Y Returns reads or not (1 / 0)
[ { "docid": "efeff596283d2e65f45575d8c3bda35e", "score": "0.59969985", "text": "def y_reads; @bits[24]; end", "title": "" } ]
[ { "docid": "55b721d4893da941bd725d54a98d8350", "score": "0.614646", "text": "def truthy? = @data.nonzero?", "title": "" }, { "docid": "64b3804d6a257a360385f1b25c2cbbc7", "score": "0.61273545", "text": "def restrictY?\r\n return @ry\r\n end", "title": "" }, { "doci...
9211e3ee12230e6a77dc8491c76f7c30
Validate test run configuration.
[ { "docid": "5cbcc73e426360a70c56a552b30e3728", "score": "0.6437698", "text": "def validate_test_run_config_using_post(configuration, opts = {})\n data, _status_code, _headers = validate_test_run_config_using_post_with_http_info(configuration, opts)\n data\n end", "title": "" } ]
[ { "docid": "78b66f2e481b4b05b698264646a07515", "score": "0.7230949", "text": "def validate_config\n config.validate_configuration!\n end", "title": "" }, { "docid": "8f8f54c3035517afaf56d96f922160ab", "score": "0.7147354", "text": "def validate_configuration\n return...
56cfbc90a2397e9f5bda03796ee92c9e
Preprocess a stylesheet (String or IO).
[ { "docid": "f1a69408e54f219a181bc1a02c9eaf18", "score": "0.57343423", "text": "def preprocess(script, options = {})\n script = script.read if script.respond_to?(:read)\n\n Source.context.call(\"preprocess\", script, options)\n end", "title": "" } ]
[ { "docid": "0d2070e468f612000c41f9dc4ff5adb2", "score": "0.6166451", "text": "def url_to_stylesheet(source, options = T.unsafe(nil)); end", "title": "" }, { "docid": "d43bb6ed240c817cd413351a1928b1f5", "score": "0.61301184", "text": "def stylesheet_preload_tag( stylesheet, options = ...
eeb5d28e0886be2777c24f8993857527
Returns sender user email
[ { "docid": "8c6e9274f29e723116c4d3b49596d113", "score": "0.8127102", "text": "def sender_email\n @message['sender']\n end", "title": "" } ]
[ { "docid": "6d3d33fcb736fcddac2133d96b8ef239", "score": "0.8170723", "text": "def sender_email\n if self.sender\n self.sender.email\n else\n @sender_email\n end\n end", "title": "" }, { "docid": "7241e6d6cdfbd592f55e9f1521dd8f46", "score": "0.78771853", "text": "d...
8ff49fd6fdbe35496bb75118312aa7dc
See Prius.get for documentation.
[ { "docid": "77ada786c9ade0f0f986d19cc6cd4086", "score": "0.0", "text": "def get(name)\n @registry.fetch(name)\n rescue KeyError\n raise UndeclaredNameError, \"config value '#{name}' never loaded\"\n end", "title": "" } ]
[ { "docid": "1fd669a638293fd8fd6c51cd8485b47a", "score": "0.6762782", "text": "def get()\n \n end", "title": "" }, { "docid": "9d4a27a7b2ed4d844162111f1a1729a5", "score": "0.67618835", "text": "def get; end", "title": "" }, { "docid": "cb04214597cbfc6d78d2c966d0a...
620abb108d17d6956a876f7e42e21888
sorts an array using the merge sort algorithm
[ { "docid": "7b75c791c4e12c40fcf423206a077367", "score": "0.0", "text": "def merge_sort(arr1)\n len = arr1.length\n if len > 1\n arr2, arr3 = merge_sort(arr1[0...(len/2)]), merge_sort(arr1[(len/2)...len])\n merge(arr2, arr3)\n else\n return arr1\n end\nend", "title": "" } ]
[ { "docid": "159bc4d733fabfb3e2a4030d1a47a913", "score": "0.88274986", "text": "def merge_sort array\nend", "title": "" }, { "docid": "b4cfc7e651465c8c64d2dc6c7a9f8663", "score": "0.8724159", "text": "def merge_sort(array)\nend", "title": "" }, { "docid": "b4cfc7e651465c8c...
5b30f1e1fddf5af096c24efb29a75541
Use the collection method To make the returnvalue the answer you want instead of "=> nil"
[ { "docid": "9c10304b481c26aafaac114281e6cdc6", "score": "0.0", "text": "def new_method\n\nend", "title": "" } ]
[ { "docid": "b3105442988746f532db49238a0e11fe", "score": "0.7147965", "text": "def collection?; end", "title": "" }, { "docid": "cbbb338282bb18d89e0430f854201229", "score": "0.6908154", "text": "def collection\n nil\n end", "title": "" }, { "docid": "f127ec29ac...
364ba09853fe0f28486ae03f75ae9c75
Executes the sim4 program. Perform mRNAgenome alignment between given sequences. seq1 and seq2 should be Bio::Sequence objects. Returns a Bio::Sim4::Report object.
[ { "docid": "1ac4959eb7cb9a303db11f0f8d80a488", "score": "0.6171311", "text": "def query_pairwise(seq1, seq2)\n tf = Tempfile.open('sim4')\n tf.print seq1.to_fasta('seq1', 70)\n tf.close(false)\n tf2 = Tempfile.open('seq2')\n tf2.print seq1.to_fasta('seq2', 70)\n tf2.close(f...
[ { "docid": "8bd59c650945b3e6a25c544be44c2f39", "score": "0.5993038", "text": "def run_align_assess\n filename = self.generate_fasta_alignment_file_for_all\n string = \"./lib/AlignAssess_wShorterID #{filename} P\"\n seq_array = Array.new\n if system(string)\n seq_id_array = self.sequence...
f8a263d6268ebd28032ef6aeca5456f1
Time complexity: O(n) Space complexity: O(n)
[ { "docid": "3eaff9189d4c22ad95c7b90d29e5ca89", "score": "0.0", "text": "def search(array, value, i = 0)\n\n return true if array[i] == value\n return false if i == array.length\n search(array, value, i + 1)\n\nend", "title": "" } ]
[ { "docid": "5944c445a0d5d1383cd670cc84d3fc3b", "score": "0.69327533", "text": "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "title": "" }, { "docid": "2481cbf165330db256eee896a32c82e4", "score": "...
f0a19bc02d108cbbd10851f76c80f012
PUT /recipes/1 PUT /recipes/1.xml
[ { "docid": "9d6fc2cbc7fcbbb4002f14b0481d5ed8", "score": "0.0", "text": "def update\n @user=User.find(session[:user])\n params[:recipe][:user_id]=session[:user]\n params[:recipe][:user_name]=@user.name\n @recipe = Recipe.find(params[:id])\n\n respond_to do |format|\n if @recipe.update...
[ { "docid": "fa4c1560a9c3cec2334b9e549b81747a", "score": "0.6475649", "text": "def edit(id, options = {})\n optional = [:label,\n :description,\n :compatible_with,\n :script_type\n ]\n params.accepts(optional).validate! options\n requ...
af43ba3211e882dd09652646f6824102
This is a template method that is used to escape results values (returned in execute) that would cause the XML to be invalid. This method is not necessary if values do not contain character that have special meaning in XML (&, ", ), however it is a good practice to use it for all return variable results in case the val...
[ { "docid": "9924368ca2def54b5d463405898949da", "score": "0.0", "text": "def escape(string)\n # Globally replace characters based on the ESCAPE_CHARACTERS constant\n string.to_s.gsub(/[&\"><]/) { |special| ESCAPE_CHARACTERS[special] } if string\n end", "title": "" } ]
[ { "docid": "8bac79ec1cf079b85a6a8276aa1f36d0", "score": "0.64417523", "text": "def escape_value(value)\n value = escape_not_value(value)\n value = escape_sign_value(value)\n value = escape_quotation_value(value)\n value = escape_sql_value(value)\n return value\n e...
3dcd9428dbf8acbf419c448f65f098d0
Function that implements the polymorphic association for more info see controllers section
[ { "docid": "862a3c425490d64bc887e93623145998", "score": "0.0", "text": "def context\n if params[:research_group_id]\n id = params[:research_group_id]\n ResearchGroup.find(params[:research_group_id])\n elsif params[:research_seedbed_id]\n id = params[:research_seedbed_id]\n...
[ { "docid": "39ea962bc2698dcbdef8bca6dfee16c5", "score": "0.7102212", "text": "def resolve_polymorphic\n end", "title": "" }, { "docid": "02e41ff0dea12775c1a0fab413aa95c9", "score": "0.67602926", "text": "def associated\n end", "title": "" }, { "docid": "d31539103785eb0a...
7f200e4c31b5a7218f4b01fa6b0d84a4
Processes a job for aggregate data. Job will only be processed if the id is unique.
[ { "docid": "63c8f6499cf2a2850d1ee85455c87478", "score": "0.636225", "text": "def process_job(job)\n return false unless new_job?(job)\n\n @redis.pipelined do\n JobAggregates.attribute_names.each do |field|\n @redis.hincrby(\"github_job_counters_#{field}\", job.send(field), 1)\n en...
[ { "docid": "54c195a60213820f95045712141909e3", "score": "0.70215917", "text": "def process_job\n process_batch(size: 1)\n end", "title": "" }, { "docid": "68e6307c76c6c50f7202cfee66591e67", "score": "0.65216976", "text": "def job(job_id)\n handle(@queue.get(\"jobs/#{jo...
54a25a7a056ff53e49dcf10cf4083425
Helper method to get the style index for a column
[ { "docid": "1456a10f5dbc6a85c9904239af3cb769", "score": "0.8339601", "text": "def get_col_style(column_index)\n range = cols.locate_range(column_index)\n (range && range.style_index) || 0\n end", "title": "" } ]
[ { "docid": "141c6fb0e57928a6d9a4aa144f7fc2f1", "score": "0.84076685", "text": "def get_col_style(column_index)\n range = cols.locate_range(column_index)\n (range && range.style_index) || 0\n end", "title": "" }, { "docid": "a18597fb9f851b04909f597fb95cf700", "score": "0.74073434",...
fc96926c279e9ea827bdc612cc35d340
return financial account for user
[ { "docid": "e53662b8c476e5bce5c198c5b6d03493", "score": "0.7686203", "text": "def financial_account\n FinancialAccount.find_account(self)\n end", "title": "" } ]
[ { "docid": "06019efeeaac352c7b5ce0ba9f7426d8", "score": "0.7181688", "text": "def account_by_id_for_user(id_for_user)\n Account.find(:first, :include => :financial_inst,\n :conditions => [\"account_key = ? AND id_for_user = ?\", account_key, id_for_user])\n end", "title": "" }, { "d...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "850d5dbe05ed57e269f54e4aa47eba18", "score": "0.0", "text": "def employeeinfo_params\n params.require(:employeeinfo).permit(:name, :email, :age, :salary, :department_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7497801", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957249", "text": "def strong_params\n params.require(:request).permit(param_white...
4e473f15217bf848781e3960c417013d
This method should be overridden in derived classes
[ { "docid": "372566f7beba55adb0d5f7f440bcb517", "score": "0.0", "text": "def endpoint\n raise StandardError, 'Please implement this method.'\n end", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.78674483", "text": "def private; end", "title": "" }, { "docid": "e6431ff47476c9014fb64198d5853e1e", "score": "0.68720645", "text": "def overrides; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd...
46d0773ecb3ee2f87be45e03813ef7ad
Stringify the subtree as a Qtree, but also return depthrelated metadata for optimizing head movement.
[ { "docid": "71a58bd85eaebb683e2d34b440ca97d1", "score": "0.5910382", "text": "def stringify(depth, lstr, ddata)\n # Replace underscores with '.\n s = @token.gsub('_', \"$'$\")\n\n # Stringify leaves.\n if @type == :leaf\n # Handle traces, light verbs, inflectional heads, and nulls.\n ...
[ { "docid": "9a78555eed60dc8f4cb330443cc7b110", "score": "0.6153397", "text": "def print_tree\n self.tree\n end", "title": "" }, { "docid": "e14db60af0520aff6bf9afb0e9236b3d", "score": "0.601016", "text": "def to_tree(level = 0)\n indent(level) + \"<#{descr}>\\n\"\n en...
7fcca5e4fedfc6ccb6588efd10876ab8
Reset password request from the user
[ { "docid": "710bdaed24904ec000ee5cd56ad3f1ed", "score": "0.0", "text": "def reset_password\n self.update(:reset_digest => self.generate_token(:reset_digest))\n\n template = {\n :template => File.join('accounts', 'reset_password'),\n :locals => {\n :reset_digest => self.r...
[ { "docid": "4bf82e61c7d514146678ce22b13153e9", "score": "0.85053587", "text": "def request_password_reset\n end", "title": "" }, { "docid": "95feeb9318385de35d3625eb73c70edf", "score": "0.8428371", "text": "def request_reset_password\n end", "title": "" }, { "docid": "e...
852a6c7693d6d9b1338b6fe40d55c930
Returns the value of attribute disable_profiling. source://rackminiprofiler//lib/mini_profiler/client_settings.rb13
[ { "docid": "7bc3fde88bdb147cc5feb5e68cc303be", "score": "0.6572681", "text": "def disable_profiling; end", "title": "" } ]
[ { "docid": "7b9bd5748db9514f7d649e78e9c005b3", "score": "0.63302296", "text": "def disable_profiling=(_arg0); end", "title": "" }, { "docid": "66fc622e82687f292657659b3198c242", "score": "0.6181946", "text": "def disabled_warnings\n Dynamic[:disabled_warnings]\n end", "ti...
65388e914a26cdae65292ad81835c277
returns true if there are any 'open' cells on the board; otherwise returns false
[ { "docid": "7a9e96f6ec69a841d92a6bf990a4ee23", "score": "0.0", "text": "def moves_left?\n status = false\n for item in @cells do\n if item == \" \"\n status = true\n break\n end\n end\n status\n end", "title": "" } ]
[ { "docid": "5c235c0ce97cc8f368e0fc9409b54de1", "score": "0.7883707", "text": "def is_open?(row, col)\n @grid[row][col].is_open?\n end", "title": "" }, { "docid": "5764c6dc2d98dc4d5e333f70c98f5817", "score": "0.7676061", "text": "def full_board?\n @cells.all? do |row|\n ...
7999ba0ad3a7e29b239b3e9a5eb1ddb1
def shake_params params.permit(:lng, :lat, :exclusions, :lockedcategory, :lockedprice) end
[ { "docid": "488b242a2601fe13455758b211862dec", "score": "0.0", "text": "def return_random_restaurant\n return_near_restaurant_list\n return_different_restaurant_list\n return_rated_restaurant_list\n return_category_restaurant_list\n return_price_restaurant_list\n @restaurants = @restau...
[ { "docid": "d94fcf95b6fb88dca33f0aad3d464d1b", "score": "0.7560964", "text": "def choice_params\n params.permit(:my_lat, :my_long)\n end", "title": "" }, { "docid": "33833aff56d88465e28d9c651350901b", "score": "0.7416817", "text": "def safetypin_params\n params.require(:...
27ebed0884d5e696f0f3c7fb64699d79
show graph of monthly saldo, expenses, income development
[ { "docid": "b9a33f389beed4dc68e40bf1b12282f7", "score": "0.54304504", "text": "def course\n @include_graph_scripts = true\n Account.all.each do |account|\n Monthreport.find_or_create(account, Time.now)\n end\n \n if !@account\n @items = Item.without_transfers\n @expenses = ...
[ { "docid": "75c96ce0b7fe50c6cb3b8b1d84ee5f99", "score": "0.7237169", "text": "def graph_for_update_monthly_report\n start_date = (params[:start_date]).to_date\n end_date = (params[:end_date]).to_date\n\n expenses = Hash[params.select {|x,y| x.match /ECATEGORY(.)*/ }]\n incomes = Hash[params....
d8e657fc03776bc4815f08a672fd92f2
Cleans up resources used by the node.
[ { "docid": "e7a9fe3d76dd0bd8cff6086c496bb337", "score": "0.0", "text": "def cleanup\n @session_id = nil\n end", "title": "" } ]
[ { "docid": "f2aa224c173ae8631d065a2c78228e0f", "score": "0.76511306", "text": "def cleanup\n end", "title": "" }, { "docid": "f2aa224c173ae8631d065a2c78228e0f", "score": "0.76511306", "text": "def cleanup\n end", "title": "" }, { "docid": "8277d2bcb74c930552b795...
dcc38c731ccf888686637da88bb06b22
Get close price of indicated bar. symbol : The symbol of data. bar : The number of bar. If you want to use current bar, it's 0.
[ { "docid": "3e70bd36b9ce52eda9fe96c23cb9a7ad", "score": "0.791992", "text": "def close(symbol, bar)\n get_chart_data(symbol, :close, bar)\n end", "title": "" } ]
[ { "docid": "1de8c907c86421a99ee7f0807d4b7fb9", "score": "0.605676", "text": "def get_buy_price(symbol)\n @yr.ask_price(symbol)\n end", "title": "" }, { "docid": "df4eae9c927294d057e10feb559a5f34", "score": "0.59879017", "text": "def get_sell_price(symbol)\n @yr.bid_price(symbo...