query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
ee3ae07af558012fadae15479c83399d | GET /search_queries GET /search_queries.json | [
{
"docid": "181e316c8cadd7282e77aac259bca5c0",
"score": "0.0",
"text": "def index\n @search_queries = current_user.search_query.archive.order_by(:created_at.desc)\n end",
"title": ""
}
] | [
{
"docid": "72c47bd35d3820128debc21eda36b9d0",
"score": "0.7656751",
"text": "def Search query\n \n APICall(path: \"search.json?query=#{query}\",method: 'GET')\n \n end",
"title": ""
},
{
"docid": "801c39290024af36fa31505d95ec3003",
"score": "0.7023839",
"te... |
c54a72def1dfe6139e6234e70edc20c9 | Add a property to the schema | [
{
"docid": "33b855cb5e0440081088c387910ca2ee",
"score": "0.0",
"text": "def add(name, options); end",
"title": ""
}
] | [
{
"docid": "94179d56667b8f70357a1b162667144e",
"score": "0.8007535",
"text": "def property(name, options = {})\n schema.add(name, options)\n end",
"title": ""
},
{
"docid": "7cc5bcbfa0023b1522800e5a29fbe90e",
"score": "0.7136089",
"text": "def add_property(prop)\n ... |
239a0487d4e5c6b74356c3a7b346381b | POST /swims POST /swims.json | [
{
"docid": "fb014930a5ff919c1d88bbe9a3c519ea",
"score": "0.6456048",
"text": "def create\n @swim = Swim.new(params[:swim])\n\n respond_to do |format|\n if @swim.save\n format.html { redirect_to @swim, :notice => 'Swim was successfully created.' }\n format.json { render :json => ... | [
{
"docid": "40bef9cf3d927b72bb071eab0d1ac132",
"score": "0.63102615",
"text": "def create\n @swim = Swim.new(swim_params)\n\n respond_to do |format|\n if @swim.save\n format.html { redirect_to @swim, notice: 'Swim was successfully created.' }\n format.json { render :show, status... |
2488fa73c36c50b9cc8a99d5dfb84cf1 | ajax post to create activity action_id meanings: 0 :: checkin ; 1:: ask question ;2:: answer 3:: vote up ; 4:: vote down ; 5::follow place 6::follow question 7 :: remove place followship 8 ::remove question followship 1:: | [
{
"docid": "1623aa3bf99f502abc059792a316028a",
"score": "0.6340016",
"text": "def create \n user_id = params[:user_id]\n place_id = params[:place_id]||0\n question_id = params[:question_id]||0\n action_id = params[:action_id] \n # vote up or down\n answer_id = params[:answer... | [
{
"docid": "06e21f51c9406409f08312dfa3985454",
"score": "0.690526",
"text": "def create\n raise Request::NoRequiredFields unless params[:activities]\n Request.add( params[:org_id], current_user, \"activity\", \"add\", { :new_record => params[:activities][0..4] } )\n respond_success \"Спасибо, В... |
a18a53e26506564934ac56563c3d9ef2 | Provide a user friendly representation source://twilioruby//lib/twilioruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb292 | [
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.0",
"text": "def to_s; end",
"title": ""
}
] | [
{
"docid": "df941c85f3d2b6582f524ed3252d5aee",
"score": "0.5858891",
"text": "def inspect\n \"<Twilio.Numbers.V2.RegulatoryComplianceInstance>\"\n end",
"title": ""
},
{
"docid": "1615ef03c36faf9da25515dcd4c2cfa6",
"score": "0.5836116",
"text... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "2d3ca8ec28218e6e962dbb7b894921eb",
"score": "0.0",
"text": "def calendar_day_params\n params.require(:calendar_day).permit(:date, :notes)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6980384",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6782743",
"text": "def strong_params\n params.requi... |
c15b2fc01fb3d823e7e152fb33fef2fa | Sets the json value, as it would appear in a jCard or jCal object. The value must always be an array. | [
{
"docid": "2dd8965b501b9476f20c1b0b8e1a10cd",
"score": "0.6529438",
"text": "def json_value=(value)\n value = value.map { |v| Base64.decode64(v) }\n super(value)\n end",
"title": ""
}
] | [
{
"docid": "a63dbf6e9fae6f34b59465c0366b6d8f",
"score": "0.67427266",
"text": "def json_value=(value)\n value = value.values if value.is_a?(Hash)\n value = value.map do |item|\n item = item.values if item.is_a?(Hash)\n item.join('/').delete(':').delete('-'... |
acb743975f21bcdd7297ddec041441cd | Cleanup after a command. | [
{
"docid": "78b055786cf629faae2772843782b626",
"score": "0.0",
"text": "def cleanup_command(shell_id, command_id)\r\n # Signal the Command references to terminate (close stdout/stderr)\r\n body = { \"#{NS_WIN_SHELL}:Code\" => 'http://schemas.microsoft.com/wbem/wsman/1/windows/shell/signal/term... | [
{
"docid": "8cd42ba18d34c1a0c7b22a0459aaf181",
"score": "0.76356727",
"text": "def mina_cleanup!\n run! if commands.any?\n end",
"title": ""
},
{
"docid": "7705e08d4501ef81f30660d1f44cc5f7",
"score": "0.7408708",
"text": "def cleanup_after(cmd, text, bat)\n\t\tbegin\n\t\t\t# ... |
bcab00f6c6351bd63c48ce6f15edc662 | Return the statistics for every active Connectionon_message consumer in an Array For details on the contents of each element in the array, see: Consumeron_message_statistics | [
{
"docid": "015d5d1e0757d4439b727cdadfe25b26",
"score": "0.801893",
"text": "def on_message_statistics\n @consumers.collect { |consumer| consumer.on_message_statistics }\n end",
"title": ""
}
] | [
{
"docid": "7f89a3d5deea3698e82fc13a060f63c5",
"score": "0.705418",
"text": "def statistics\n raise \"First call MessageConsumer::on_message with :statistics=>true before calling MessageConsumer::statistics()\" unless @message_count\n duration =(@last_time || Time.now) - @start_time\n {:m... |
ef20f7020e251ab18f492bc90b1cbb4e | Starts a server thread for the client socket +sock+ that runs the given +block+. Sets the socket to the :WEBrickSocket thread local variable in the thread. If any errors occur in the block they are logged and handled. | [
{
"docid": "a91177760ea50667ab95f07701406d3a",
"score": "0.76221335",
"text": "def start_thread(sock, &block)\n Thread.start{\n begin\n Thread.current[:WEBrickSocket] = sock\n begin\n addr = sock.peeraddr\n @logger.debug \"accept: #{addr[3]}:#{addr[1]}... | [
{
"docid": "fecf27378dbecb7994f6c83ef9ea400a",
"score": "0.6902299",
"text": "def run(&block)\n loop do\n sock = @socket.accept\n server_client = ServerClient.new(self, RubySMB::Dispatcher::Socket.new(sock, read_timeout: nil))\n @connections << Connection.new(server_client, @th... |
a95a135e995c4c9f86f9c8f564a36be4 | DELETE /pops/1 or /pops/1.json | [
{
"docid": "87d8fb2fc96345e29b06e12a17aaf62a",
"score": "0.0",
"text": "def destroy\n @pop.destroy\n respond_to do |format|\n format.html { redirect_to pops_url, notice: \"Pop was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "75a785bddc2252b3dfe08070dcb44399",
"score": "0.67898244",
"text": "def delete(args)\n if args[:json]\n post(args.merge(method: :delete))\n else\n get(args.merge(method: :delete))\n end\n end",
"title": ""
},
{
"docid": "2b14a1e87ac465825acc60a1b4a872bd",
"... |
c68bd1a1679df59b19e5c64ee74f2d02 | Return the conditions for a user to be 'mostly' active. | [
{
"docid": "864756053f091ee8a0babefd1df062a3",
"score": "0.7307561",
"text": "def conditions_for_mostly_active\n [%(deactivated = ? AND \n (email_verified IS NULL OR email_verified = ?) AND\n (last_logged_in_at IS NOT NULL AND\n last_logged_in_at >= ?)),\n f... | [
{
"docid": "57a2b4c46108e81b1bde615c7225fba3",
"score": "0.7174422",
"text": "def conditions_for_mostly_active\n [%(enabled = ? AND activation_code IS NULL AND\n activated_at IS NOT NULL AND reactivation_code IS NULL AND\n (last_login_at IS NOT NULL AND last_login_at >= ?)),\n ... |
239ecbcddb70f2797580b194073e42c6 | Return the direction of the current cursor. | [
{
"docid": "231a23509074f1aa5c7a87e660a1104f",
"score": "0.5681682",
"text": "def direction(direction_arg = nil)\n return current.direction if direction_arg.nil?\n\n current.direction = direction_arg\n\n self\n end",
"title": ""
}
] | [
{
"docid": "4cc57641dcb85ed296bc693482939dc8",
"score": "0.7533862",
"text": "def get_direction\n return (@dir || @character.direction)\n end",
"title": ""
},
{
"docid": "cc9aed4eb99a5bf97ff59ef9b8fdd51e",
"score": "0.7046414",
"text": "def direction\n return @dire... |
2b563e83ec378b3f621619cd67cc0d65 | 2. Select the first letter of each element => .each or .map 3. Capitalize each letter 4. Join every letter and return as a string | [
{
"docid": "dbb1a4a76f3f379997cc54ab9ed2cd77",
"score": "0.701718",
"text": "def acronymize(sentence)\n # Solution 1: Using .each\n\n words = sentence.split\n acroynm = \"\"\n\n words.each do |word|\n acroynm << word[0].upcase\n end\n\n return acroynm\nend",
"title": ""
}
] | [
{
"docid": "70cfb8f1afc9887f6430cda27906b778",
"score": "0.77599514",
"text": "def each_first_letters\n self.split.map(&:capitalize).join(' ')\n end",
"title": ""
},
{
"docid": "7937339b2b4c839c5443fe0fcb05e749",
"score": "0.77064884",
"text": "def yeller(s)\n puts s.map(&:upca... |
1896089def7fd10d37a7ad0dbe1c6dd3 | Cleanup the tables of a specific +metric+ (symbol) removing all values against dataset names not in +ref+ (Array of string) | [
{
"docid": "56039e0f1d2b3e09e41c2133f828dd19",
"score": "0.6850325",
"text": "def cleanup_distances_by_metric!(ref, metric)\n db_type = :\"#{metric}_db\"\n db = get_result(:distances).file_path(db_type)\n return if db.nil? || !File.size?(db)\n\n sqlite_db = MiGA::SQLite.new(db)\n table = ... | [
{
"docid": "013949f7f84cbe54eaec3c6de24c02ae",
"score": "0.641365",
"text": "def cleanup_distances!\n return if get_result(:distances).nil?\n\n require 'miga/sqlite'\n ref = project.datasets.select(&:ref?).select(&:active?).map(&:name)\n %i[haai aai ani].each do |metric|\n cleanup_dista... |
81ce7fe2fa2fbc1c15f73d8175b61b67 | Apply the modifications represented by self to the underlying plan snippet in your redefinition if you do so. | [
{
"docid": "a66558358147ef02598d6eb48505fabc",
"score": "0.51767606",
"text": "def apply_modifications_to_plan\n new_mission_tasks = Set.new\n new_permanent_tasks = Set.new\n new_permanent_events = Set.new\n\n added_relations = []\n removed_re... | [
{
"docid": "d3d71ff6100f42c99f254c49b05a5d52",
"score": "0.6162407",
"text": "def apply_modifications_to_plan\n discover_tasks = ValueSet.new\n discover_events = ValueSet.new\n new_missions = ValueSet.new\n new_permanent_tasks = ValueSet.new\n ... |
2b5ea0afe7e49f42f2f7fcd696a26aa9 | Finds a consul server within the cluster based on AWS tags. Assumes it's being run on an EC2 node with a role that has the ec2:DescribeInstances permission. | [
{
"docid": "0245b1356ec1d8391e34858f1bf4a99f",
"score": "0.7389701",
"text": "def discover_via_awstags\n ident_url = 'http://169.254.169.254/latest/dynamic/' \\\n 'instance-identity/document'.freeze\n\n ident = JSON.parse(`curl #{ident_url} 2> /dev/null`).freeze\n ... | [
{
"docid": "6b9363bd941cd7ddd21604af9e43999a",
"score": "0.69678736",
"text": "def get_servers_by_tag(tags)\n return([]) unless tags.size > 0\n servers = ::Tag.search(\"ec2_instance\", tags, :match_all => @match_all)\n\n if tags.size > 0 and servers.nil? or servers.empty?\n if @ign... |
d635cf2cb2eb3486a8d5dacf3ccf6177 | Redirects the user to the feedback form | [
{
"docid": "5055302a1e5ec04220f339743635643d",
"score": "0.63293755",
"text": "def feedback\r\n\t\t@user = @current_user\r\n\r\n\t\trespond_to do |format|\r\n\t\t\tformat.html\r\n\t\tend\r\n\tend",
"title": ""
}
] | [
{
"docid": "2a5b38c0073dcee19316a21d72a6cdab",
"score": "0.7240117",
"text": "def contact\n flash[:notice] = t('blacklight.update.new_url')\n redirect_to feedback_path\n end",
"title": ""
},
{
"docid": "7fabae95a10449363f35320d7d155c61",
"score": "0.6950657",
"text": "def feed... |
beee15ec28e810b6b1f791f1988745d1 | Converts email to all lowercase. | [
{
"docid": "f77d2fdbb674dd1d58980a70d21e1909",
"score": "0.0",
"text": "def downcase_email\n self.email = email.downcase # self keyword is optional on the right hand side\n end",
"title": ""
}
] | [
{
"docid": "434a53dadeb1628ebc04d7cf7c8251af",
"score": "0.8380517",
"text": "def downcase_email\n\t email.downcase!\n\t end",
"title": ""
},
{
"docid": "61c6f9455ec34c2acd15663a017f23dc",
"score": "0.8339932",
"text": "def downcase_email\n email.downcase!\n ... |
47e4870428b434cbde27d19d138d8b35 | GET /agents/new GET /agents/new.xml | [
{
"docid": "4e89af4c16a70b7591253a68ee947f7f",
"score": "0.7672876",
"text": "def new\n @agent = Agent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @agent }\n end\n end",
"title": ""
}
] | [
{
"docid": "01671071d7f8b2d8cc19ac1d17f96f42",
"score": "0.76665545",
"text": "def new\n @agent = Agent.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @agent }\n end\n end",
"title": ""
},
{
"docid": "65c11c708d448ba8d90baa9dbac23... |
e8a9477211b48ac7c3fced407a0355eb | Create the World. This loads or creates the database depending on whether it finds it. [+return+] A handle to the World object. | [
{
"docid": "765cc16b08894f6193ff2e0a0a63d946",
"score": "0.0",
"text": "def initialize\n self.timer_list = []\n self.all_characters = []\n self.all_accounts = []\n self.admins = []\n self.builders = []\n self.msgs = {}\n @connected_characters = []\n end",
"title": ""
}
] | [
{
"docid": "b36f85fbc55961ee3c822a2f02277bcb",
"score": "0.7161141",
"text": "def newWorld(db, name)\n\tif db.hexists('sgt-worlds', name)\n\t\treturn World.new(db, db.hget('sgt-worlds', name))\n\tend\n\tnewId = newUUID(db)\n\t\n\t# Associate this name to the world id\n\tdb.hset('sgt-worlds', name, newId... |
36b49ca4cbddaead65eddb6938fae4d0 | HARD Define a method that, given an array of songs at the top of the charts, returns the songs that only stayed on the chart for a week at a time. Each element corresponds to a song at the top of the charts for one particular week. Songs CAN reappear on the chart, but if they don't appear in consecutive weeks, they're ... | [
{
"docid": "5c85f16b6feb3be56186768590768df8",
"score": "0.8217633",
"text": "def one_week_wonders(songs)\n songs.select {|song| no_repeats?(song, songs)}.uniq\nend",
"title": ""
}
] | [
{
"docid": "bbc959bf31663c457d6b7f45575fb09d",
"score": "0.8246514",
"text": "def one_week_wonders(songs)\n songs.select { |song| no_repeats?(songs, song) }.uniq\nend",
"title": ""
},
{
"docid": "b3aa8c10597714cfb8f47acfa9909b77",
"score": "0.82457125",
"text": "def one_week_wonders... |
80d9b585e7ab007648dd56a1268275a0 | PATCH/PUT /matches/1 PATCH/PUT /matches/1.json | [
{
"docid": "82262c67e5a646f4cf8050b745c0c495",
"score": "0.6593729",
"text": "def update\n respond_to do |format|\n if @match.update(match_params)\n format.html { redirect_to @match, notice: 'Match was successfully updated.' }\n format.json { render :show, status: :ok, location: @m... | [
{
"docid": "e11a34bfa1aa5e1fe07b51c0871b445d",
"score": "0.7097369",
"text": "def update\n match = Match.find_by(id: match_params[:id])\n\n match.update match_params\n if match.valid?\n render json: { match: match}, status: :created\n else\n render json:... |
0c7646f08e5d7932170fd92a00f5e868 | returns an array of all trips at this Listing | [
{
"docid": "846c99266eeb0145796ade8c75388eef",
"score": "0.7436819",
"text": "def trips \n trips_taken = Trip.all.select do |trip|\n trip.listing == self\n end\n end",
"title": ""
}
] | [
{
"docid": "1df9f159d13f25f36901fe43c0f64d37",
"score": "0.8020203",
"text": "def trips\n trips = RideShare::Trip.trips_by_rider(@id)\n if trips != nil\n return trips\n else\n return []\n end\n end",
"title": ""
},
{
"docid": "4af94e7100b8b55832acfaf553a... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "d3f298d81b1683be4f42a1ca9d5c8c38",
"score": "0.0",
"text": "def myad_params\n params.require(:myad).permit(:title, :description, :typead_id, images_attributes: [:id, :url, :_destroy])\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... |
2809bff747bec8adf241eb0f7534a436 | PUT /chapter/1 PUT /chapter/1.xml | [
{
"docid": "0b0fbb5062d0f6a91e16bc33861b8f5a",
"score": "0.6448631",
"text": "def update\n @chapter = Chapter.find(params[:id])\n\n respond_to do |format|\n if @chapter.update_attributes(params[:chapter])\n flash[:notice] = 'Chapter was successfully updated.'\n format.xml { hea... | [
{
"docid": "5e0de833ab3e21d368855be83866e8b2",
"score": "0.6676336",
"text": "def update\n @chapter = @book.chapters.find(params[:id])\n\n respond_to do |format|\n if @chapter.update_attributes(params[:chapter])\n flash[:notice] = 'Chapter was successfully updated.'\n format.htm... |
013f95bbc3c0b32263eb21d1a9de6844 | GET /questionnaires/new GET /questionnaires/new.xml | [
{
"docid": "82a6c44ad1483cc03ebbec6e578f9a5c",
"score": "0.0",
"text": "def new\n @questionnaire = Questionnaire.new\n end",
"title": ""
}
] | [
{
"docid": "7aec30a585163c2e9d14dee2fa56274f",
"score": "0.77861017",
"text": "def new\n @questionaire = Questionaire.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @questionaire }\n end\n end",
"title": ""
},
{
"docid": "09eedf... |
3bd4c409b3bcc0c9e19cec003cb3a0cb | change location in the program | [
{
"docid": "2622ade9e012166ae8f042d723df37d7",
"score": "0.0",
"text": "def p_add\n\t\t\t@interpreter.program_position += @value - 1\n\t\t\tif @interpreter.program_position < 0\n\t\t\t\t@interpreter.program_position = 0\n\t\t\tend\n\t\tend",
"title": ""
}
] | [
{
"docid": "1bf148670b69fd5daa9f8a650b24fa6f",
"score": "0.6370078",
"text": "def updated_location(global_location, local_location); end",
"title": ""
},
{
"docid": "7735b51f66aa92f7e741e618f8bfad85",
"score": "0.6257417",
"text": "def set_location\n\n end",
"title": ""
},
... |
cee917bc221358d49118dba4ec46d98a | DELETE /themes/1 DELETE /themes/1.xml | [
{
"docid": "38d0c2daacf08d1b5491e10a27b7f0fd",
"score": "0.7532438",
"text": "def destroy\n @theme.destroy\n\n respond_to do |format|\n format.html { redirect_to(themes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "7a39184114f9c1d8ac699ae830324966",
"score": "0.7311464",
"text": "def destroy\n @theme = TemplateTheme.find(params[:id])\n @theme.destroy\n\n respond_to do |format|\n format.html { redirect_to(template_themes_url) }\n format.xml { head :ok }\n end\n end",
"title":... |
d70a476a138fbaef0ca1613c938ed9fb | GET /shares GET /shares.json | [
{
"docid": "09eb356f446cd97fb25e75f074e3a06e",
"score": "0.71794665",
"text": "def index\n @shares = Share.all\n end",
"title": ""
}
] | [
{
"docid": "e6fa4939edce711b5757aebc98f4ce85",
"score": "0.77256536",
"text": "def shares id\n uri = \"#{BASE_URL}/gauges/#{id}/shares\"\n fetch uri\n end",
"title": ""
},
{
"docid": "6537d83e695d9c02b4e6cdd51ad14107",
"score": "0.73095876",
"text": "def get_share(option... |
b8551ea5d3878d28b15fdaf4075b5fb6 | POST /groups POST /groups.json | [
{
"docid": "e3297cbffd2dfeba4c88da39312ce8db",
"score": "0.0",
"text": "def create\n @group = Group.new(params[:group])\n @u = User.create(:login=>@group.name, :password=>@group.psd, :password_confirmation=>@group.psd, :email =>@group.name+'@mail.msiu.ru')\n @u.role=0\n @u.save\n respond_... | [
{
"docid": "321b074d055ce6159f3aae60044ddcf8",
"score": "0.77380043",
"text": "def CreateGroup params = {}\n \n APICall(path: 'groups.json',method: 'POST',payload: params.to_json)\n \n end",
"title": ""
},
{
"docid": "426826d527b7826dec06f7f54dbbab01",
"score": ... |
cdce89c8ece0048eef17391e1a4d9f7b | Defines a list of internal_variables accessors from a list of methods that can include method => constant_name at the end (in case method an constant name differ) | [
{
"docid": "28cb4c71b2c558e38aa6dfa8d4395bc2",
"score": "0.5778759",
"text": "def internal_variables *vars\n renamed = vars.last.is_a?(Hash) ? vars.pop : {}\n vars.each do |var|\n define_internal_variable var, var\n end\n renamed.each do |var, as|\n ... | [
{
"docid": "70c176b8142117eec987dd5ca156a0da",
"score": "0.6661117",
"text": "def define_instance_accessors(*fields)\n fields = Array(fields)\n fields.each do |field|\n ivar_name = \"@\" + field.to_s\n instance_eval <<-EndAccessors\n def #{field}\n instance_va... |
e2da3069e7450f793566c1b79c3e5da5 | Get the total kwh usage for the current week | [
{
"docid": "c940c075bed2afd8becb8149f86a187c",
"score": "0.9041973",
"text": "def current_week_kwh_usage\n total_week_kwh_usage_until(Time.now.utc.to_date).round(2)\n end",
"title": ""
}
] | [
{
"docid": "9ac256813a6e10e12cb4edc6a6217c6f",
"score": "0.8132136",
"text": "def current_day_kwh_usage\n total_day_kwh_usage_on(Time.now.utc.to_date).round(2)\n end",
"title": ""
},
{
"docid": "e48133e4069f1ff7c68efe2a8f7b0f0c",
"score": "0.7560345",
"text": "def total_week_kwh_... |
3fde2544c6a2862b78627d6ddecfde3f | FIXME Do we want to destroy the object explicitly? classes? | [
{
"docid": "348e520c97a541256e854ae7d14c4ad9",
"score": "0.0",
"text": "def close_connection(database_id)\n @@databases[database_id].destroy_classes\n @@databases.delete(database_id)\n end",
"title": ""
}
] | [
{
"docid": "a707f2cd840910af09a06216e6ad8ebd",
"score": "0.7311241",
"text": "def destroy\n destroy_obj\n end",
"title": ""
},
{
"docid": "c949eae82d363be8d7abe0829548a8c4",
"score": "0.721595",
"text": "def _destroy; end",
"title": ""
},
{
"docid": "996209821d7f27b5f... |
b9921d6d90848013575091ed410685d0 | PUT /initiatives/1 PUT /initiatives/1.xml | [
{
"docid": "148cc7daf51f5ba4174b1aa2e0d1a05d",
"score": "0.5933747",
"text": "def update\n @initiative = Initiative.find(params[:id])\n\n respond_to do |format|\n if @initiative.update_attributes(params[:initiative])\n flash[:notice] = 'Initiative was successfully updated.'\n fo... | [
{
"docid": "53cb50646d315998df55a67cccfaaf22",
"score": "0.6019628",
"text": "def set_api_v1_initiative_expense\n @api_v1_initiative_expense = Api::V1::InitiativeExpense.find(params[:id])\n end",
"title": ""
},
{
"docid": "8864e6ca0fdbf7c73dfee402735a26a4",
"score": "0.595167",
... |
3b23e412873927d300e838ecf3ff4e6f | This method should return for any key, the lower key that has the same position on an US keyboard. | [
{
"docid": "3333e408a8f7e642a5e36b55172e207a",
"score": "0.0",
"text": "def map_key(native_event)\n self._map(native_event)\n end",
"title": ""
}
] | [
{
"docid": "43c11a4a4570771e86f0d74e12aef389",
"score": "0.61732286",
"text": "def key_lookup(key_letter)\n CHROMATIC_SCALE.index(key_letter.upcase)\n end",
"title": ""
},
{
"docid": "1aafb8eca7cfd2761c3a8284cb9663ce",
"score": "0.6113514",
"text": "def key\n return SPEC... |
434e2445f8ed7a7306bb3373b05cdcfd | Update an Existing Section, Including Its Position Modifies an existing firewall section along with its relative position among other firewall sections in the system. Simultaneous update (modify) operations on same section are not allowed to prevent overwriting stale contents to firewall section. If a concurrent update... | [
{
"docid": "fdd5540c14726904fa7e6ef4eb2efe83",
"score": "0.0",
"text": "def revise_section_revise(section_id, firewall_section, opts = {})\n data, _status_code, _headers = revise_section_revise_with_http_info(section_id, firewall_section, opts)\n return data\n end",
"title": ""
}
] | [
{
"docid": "5c139e3b4299d336fba12e81736b9ff4",
"score": "0.7526235",
"text": "def update_section(section_id, firewall_section, opts = {})\n data, _status_code, _headers = update_section_with_http_info(section_id, firewall_section, opts)\n return data\n end",
"title": ""
},
{
"do... |
059448d4a130e20c2f1fb115aba6d20f | TODO: Cache based on last upvote time | [
{
"docid": "0455d585b0e15c372b7864a641158606",
"score": "0.0",
"text": "def frontpage_items\n likes = self.likes\n recent = Item.order(\"created_at DESC\")\n\n items = []\n likes.each do |like|\n like.similar(5).each do |item|\n if !item.user_voted? self\n ... | [
{
"docid": "2ee2ee842bbdc315b6e74ff58675f3c1",
"score": "0.6741757",
"text": "def up\n vote_status = $redis.hget(\"#{@instance_type}:#{@instance.id}:votes\", current_user.id).to_i\n same_vote = vote_status != 1\n \n if current_user.credit > Settings.vote_up_limit and current_user.vote_per_da... |
9e3a211bfd5772446061c0b1eec469a8 | `uninstall` action for `poise_msys2`. Ensure MSYS2 is removed. | [
{
"docid": "339cd4c7971942da737f35668453f66e",
"score": "0.52375823",
"text": "def action_uninstall\n notifying_block do\n delete_root_directory\n # TODO anything else?\n end\n end",
"title": ""
}
] | [
{
"docid": "8159de5390f450e1780bca881ecf1cc2",
"score": "0.7036914",
"text": "def uninstall_system_packages\n install_system_packages.tap do |r|\n r.action(:uninstall)\n end\n end",
"title": ""
},
{
"docid": "debe44027b88207c753c4870f7990329",
"score": "0.6401... |
de78139a02a89498d2cc2795924a1caa | Get the names of all fields that will be serialized. | [
{
"docid": "c3d3ec9c5f870c3f268c64d924205f2d",
"score": "0.7434879",
"text": "def field_names(options)\n names = (as_attributes.keys + attribute_names).uniq.sort\n\n only = Array.wrap(options[:only]).map(&:to_s)\n except = Array.wrap(options[:except]).map(&:to_s)\n except |= [self.cl... | [
{
"docid": "fd2ad2c8d1dca71cd1832c38a42d48a6",
"score": "0.84204453",
"text": "def all_field_names\n fields.keys\n end",
"title": ""
},
{
"docid": "9d7a4266f8625d0f4fbadbe363072024",
"score": "0.82359517",
"text": "def field_names\n fields.keys\n end",
"ti... |
4f4bb2ceadb7420a6f4215608dafea94 | returns a list of project where the user is managed. for each project, returns arrays of objects, each object containing a user and a is_on_leave boolean (if the user is on leave at the date given. each array indicates a nesting level, the first array containing people that manages directly the object given | [
{
"docid": "4d483864754b8ded461e486d57b50176",
"score": "0.5937911",
"text": "def managed_users_with_backup_leave(date = Date.today)\r\n rule_users = self.managed_rules.flatten.map(&:to_users)\r\n\r\n users_on_leave = LeaveRequest.are_on_leave(rule_users.map{|o| [o[:user_senders].map(&:id), o[:use... | [
{
"docid": "fe5bdf164a2b24504cfeab2f6eb32739",
"score": "0.68602526",
"text": "def get_personal_projects_for_data(date, user)\n if !User.current.admin?\n user = User.current\n end\n entries_for_date = TimeEntry.find(:all, :conditions =>[\"spent_on =? and user_id = ?\", date, user.id ])\n pr_... |
1fd1df1f2e5d388caf6201642cff8084 | Hooking one constructor into another's prototype chain. | [
{
"docid": "9aeded95afcd2c56de438c0e96d69090",
"score": "0.0",
"text": "def compile_node(o={})\n constructor = o[:scope].free_variable\n sub, sup = @sub_object.compile(o), @super_object.compile(o)\n \"#{idt}#{constructor} = function(){};\\n#{idt}\" +\n \"#{constructor}.prototype = #{... | [
{
"docid": "157753cdb7f2110f0c20582c2fe074d9",
"score": "0.6520581",
"text": "def merge(other)\n super other.map(&method(:instantiate))\n end",
"title": ""
},
{
"docid": "0dc0598e2f6a9f7ff05563023c44519a",
"score": "0.6429663",
"text": "def initialize_copy(other)\n ... |
8c43ea7db8dd3416e2457477058ac2be | FIXME: do we really need it????! we might get much more then we need :) TODO: can we selectively get only what we need? FIXME: args passing | [
{
"docid": "7d78af50a667bdf360f50b758d3ed860",
"score": "0.0",
"text": "def each(opts = {}, &block)\n start = opts.delete(:start)\n step = opts.delete(:step) || 200\n while (start = (slice = iterate(start, :count => step)).last)\n find_many(slice).each(&block)\n end\... | [
{
"docid": "3f8616b1d07a229912d449c023d6064c",
"score": "0.62047845",
"text": "def _get(_arg0); end",
"title": ""
},
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.6179217",
"text": "def desired; end",
"title": ""
},
{
"docid": "d4f0d11180f6a0c088e99d90bdbd80b... |
d7c744dc346555c1e0ad8a22bb8d6519 | Methods Makes a question inactive. Inactivated questions are still available to the user keys that have answers to them already. They will not be available to future user keys. | [
{
"docid": "0f8e5271409cfbd4fa1e9cfed9546ef6",
"score": "0.57733315",
"text": "def inactivate\n self.update_attribute(:active, false)\n end",
"title": ""
}
] | [
{
"docid": "3bb79196c5690eb976634726d66f2d4c",
"score": "0.70581824",
"text": "def inactive!\n @active.update { |_| false }\n end",
"title": ""
},
{
"docid": "0cdb7c55e3072bdecd895408ef6fe6db",
"score": "0.65746546",
"text": "def deactivate\n update(state: 'inactive')\n e... |
1acac84d7718893f80504e4e7bfca8b1 | Create objects for tables of each different price range in defined increments | [
{
"docid": "127bf972e3e6c87358f10de2b3cd8b7b",
"score": "0.5493926",
"text": "def layout_tables\n listings = @listings.sort { |a, b| a.price <=> b.price } \n increment = 200\n inc_count = 1\n\n results = [{\n price_limit: increment,\n listings: []\n }]\n\n listings.each do |l... | [
{
"docid": "553063f84f22b2330cf484a32dba1232",
"score": "0.5807997",
"text": "def create_tables\n x = 1\n table_count = (all_guests.length / table_size_limit.to_f).ceil\n while x <= table_count\n Table.create(table_number: x, table_size_limit: table_size_limit, event_id: id)\n x += 1\... |
bd1479c2d05eae6fa569f34ab3d2314b | Description: Gathers a list of all open ChangeHearingRequestTypesTasks Params: None Returns: ActiveRecord::Relation of ChangeHearingRequestTypeTasks | [
{
"docid": "1bcee1f8a50ebbb58dbab43069e828b9",
"score": "0.7927964",
"text": "def open_change_hearing_request_type_tasks\n ChangeHearingRequestTypeTask.open.includes(:legacy_appeal)\n end",
"title": ""
}
] | [
{
"docid": "125c2f3b0082510e92e5348ef05b22dd",
"score": "0.5818015",
"text": "def get_tasks_for(entity)\n tasks_for_type = []\n\n @task_objects.each do |task|\n if task.allowed_types.include?(entity.class)\n tasks_for_type << task.clone\n end\n end\n\n tasks_for_type\n end"... |
e5db1054392c3b2ebfb97b88a4af15ca | check that the params of the register_type call are key/value pairs. | [
{
"docid": "d760164ba8a0225d914fd7f21bca3f0f",
"score": "0.0",
"text": "def kv_arg_list?(params)\n params.type == :list &&\n params.children.count.positive? &&\n params.children.first.type == :list &&\n params.children.first.children.count.positive? &&\n statement.parameters.child... | [
{
"docid": "f2ed09ecd40705e70bc80598fa335edd",
"score": "0.6262962",
"text": "def check_arg_hash_type(key_type, elem_type, arg, mtd, n=0)\n check_arg_type Hash, arg, mtd, n\n arg.each_with_index do |item,i|\n check_arg_type key_type, item.first, mtd, n\n check_arg_type elem_type, item.la... |
1edce0f3df9e0914166420e30fbdd4f5 | create method for scoring word | [
{
"docid": "d3f64c47a996e32aa0945de84409e8b7",
"score": "0.7174602",
"text": "def score_word(word)\n word_letters = make_word_array(word)\n score = 0\n word_letters.each do |letter|\n score += LETTER_SCORES[letter]\n end\n score += 8 if word.length >= 7 && word.length <= 10\n return score\nend"... | [
{
"docid": "713569c983a0ca7ce691fd6fa9365c4c",
"score": "0.74669766",
"text": "def score(word)\n score = 0\n word = word.upcase.split(//)\n word.each do |letter|\n score += scorer(letter)\n end\n score\n end",
"title": ""
},
{
"docid": "7b0ad81f174b50a9660e471ff2b7ccfa",
... |
fc139bae705694d2c51cca367d9cb766 | Used to get or set ant properties. [set] property['name'] = value sets the ant property with name to given value no overwrite [get] property[matcher] gets property that is equal via case equality operator (===) | [
{
"docid": "1aea92bb75623f1f4d9807ea274acfc9",
"score": "0.6812992",
"text": "def property\n AntPropertyHelper.new(ant, ant_properties)\n end",
"title": ""
}
] | [
{
"docid": "1b2112c537c89c997a28f7f4288afd42",
"score": "0.65168077",
"text": "def property_set(name, value)\n ensure_property name\n public_send \"#{name}=\", value\n end",
"title": ""
},
{
"docid": "ea4ec22a908b0c888b492e99fa2e632d",
"score": "0.64329225",
... |
67607f707e8f92ff8ee191bc6346f68b | Get Json values from 'Appointment' model to be used for calendar | [
{
"docid": "1d958408e3a3b42577769a4887e4384e",
"score": "0.72402334",
"text": "def as_json(options = {})\n {\n :id => self.id,\n :title => self.client.name,\n :start => self.appointment_at,\n :end => self.end_time\n \n \n }\n end",
"title": ""
}
] | [
{
"docid": "e79442243806cc9cfd997bd0d24c7367",
"score": "0.7404816",
"text": "def list_appointments\n json_response(Appointment.all)\n end",
"title": ""
},
{
"docid": "2c9a43ab42350286c3ea1cd1d9ce49ab",
"score": "0.72448605",
"text": "def user_appointments\n object.appointment... |
019936ed8661a9cf3b907459747d3af6 | Create a new instance of this class | [
{
"docid": "c0f61f48372682f17454067dbfb4cedd",
"score": "0.7103503",
"text": "def new\n\t\tAwesomeObject.new(self)\n\tend",
"title": ""
}
] | [
{
"docid": "e2b31d60b2b5b380040a867c381a1b70",
"score": "0.8204378",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "e2b31d60b2b5b380040a867c381a1b70",
"score": "0.8204378",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "e2b31d60b2b5b380040a867c381a1b70... |
42e6b86861515bf9ae5ac2281af9a526 | NOT YET fully tested to be working. | [
{
"docid": "9cbee6c6c93355b31037f4bb9b221320",
"score": "0.0",
"text": "def facade_minutes\n return nil if minutes.blank?\n\n minutes % 60\n end",
"title": ""
}
] | [
{
"docid": "6ab77a9219ee157923bc58599ba6aa77",
"score": "0.65091395",
"text": "def in_use; end",
"title": ""
},
{
"docid": "6ab77a9219ee157923bc58599ba6aa77",
"score": "0.65091395",
"text": "def in_use; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
... |
ca19b7fdadc717cbd00f376cecedd647 | singular_sequencer(sequencetext) generates the sequence_singular from any sequencetext entered | [
{
"docid": "e7ef5414d8a5b9bcc55545e5130769a8",
"score": "0.8273528",
"text": "def singular_sequencer(sequencetext)\n @sequencetext = sequencetext\n @sequencetext.extend Textual\n @sequencetextualed = @sequencetext.to_textual\n @sequencetextualed.extend Textual\n\t@sequencetextdecommaed = @se... | [
{
"docid": "d56232a26feaa4b4b8a0401c8a8200a3",
"score": "0.6175483",
"text": "def text_sequencer(sequencetext)\n @sequencetext = sequencetext\n @sequencetext.extend Textual\n @text_sequence = \"\"\n #puts \"at line 20 sequencetext is tainted ? \" + sequencetext.tainted?.to_s # => :false\n ... |
d37f89e386d88349b74cb52409574185 | DELETE /exam_applications/1 DELETE /exam_applications/1.json | [
{
"docid": "cb7c636f641a2b1bb5432da1cb4f5ae7",
"score": "0.7460791",
"text": "def destroy\n @exam_application.destroy\n respond_to do |format|\n format.html { redirect_to exam_applications_url, notice: 'Exam application was successfully destroyed.' }\n format.json { head :no_content }\n ... | [
{
"docid": "ad86927f1fcde37e80086f508ce163d0",
"score": "0.73298264",
"text": "def destroy\n @exam = Exam.find(params[:id])\n @exam.delete\n respond_to do |format|\n format.html { redirect_to exams_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
... |
30674aa9d9f1c35cd7c7fd89a6180861 | Given a task in initializer, sets jn+ and jn in t | [
{
"docid": "6ebe112fe22bc3496b5d462237473823",
"score": "0.53336865",
"text": "def jn_plus\n if task.unfit_step_weight == 1\n jn_plus_for_positive_mu\n elsif task.unfit_step_weight == -1\n jn_plus_for_negative_mu\n else\n raise ArgumentError, \"Unknown mu[jk]\"\n ... | [
{
"docid": "7160d8e98070b52048a70753a7b73f50",
"score": "0.6352062",
"text": "def update(task_number, task)\n\t\t@all_tasks[task_number-1] = task\n\tend",
"title": ""
},
{
"docid": "b6f853b39d3c021186786326b54094a0",
"score": "0.6071522",
"text": "def modify_task(task_num, new_task)\... |
0c90a6f9fe79104806dca26a7c396ec5 | Converting to postfix using shunting yard algorithm | [
{
"docid": "702afd3764324815e010ad41e3b00741",
"score": "0.7024884",
"text": "def postfix\n @postfix = []\n stack = []\n @infix.each do |c|\n c = \"\" << c # Convert to string\n case c\n when \"(\"\n stack.push(c)\n # @postfix << ')'\n when /\\d|[a-z]|[... | [
{
"docid": "2d4cf16a9813b9ede5659a6f258cd650",
"score": "0.7277126",
"text": "def convert_to_postfix infix\n\t\tstack = []\n\t\tpostfix = \"\"\n\t\tinfix.split(\"\").each do |char|\n\t\t\tif /^[0-9]/ === char\t\t#if char is a number\n\t\t\t\tpostfix += char \t\t#add to postfix\t\t\n\t\t\telse\n\t\t\t\tp... |
7060e49e0131eeefdf786ba6e9269fb9 | Skip all checks if only_if is false | [
{
"docid": "017af40caed004ac068aae3231a6ae3d",
"score": "0.6629262",
"text": "def only_if(message = nil)\n return unless block_given?\n return if @__skip_only_if_eval == true\n\n @__skip_rule[:result] ||= !yield\n @__skip_rule[:message] = message\n end",
"title": ""
}
] | [
{
"docid": "d25608dab947735e29066979ffdf7894",
"score": "0.7057934",
"text": "def unless_condition; end",
"title": ""
},
{
"docid": "7199187c10b4f5a937f69da19e721d59",
"score": "0.68442",
"text": "def disable_only_if(&block)\n set_or_return(:disable_only_if, block, kind_of: Proc)\ne... |
70df26c81a411a30bc6be6183fa7d494 | GET /quests/1 GET /quests/1.xml | [
{
"docid": "591bfed4166d3482b02ecc822338cee1",
"score": "0.6995967",
"text": "def show\n @quest = Quest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @quest }\n end\n end",
"title": ""
}
] | [
{
"docid": "0dc96cc629cdc43cbfcffc8a7b26450f",
"score": "0.64549154",
"text": "def show\n @quest_entry = QuestEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @quest_entry }\n end\n end",
"title": ""
},
{
"doc... |
8f0fa2aeb0980b2c465bc28ce86c33b8 | def interleave(arr1,arr2) new_array = [] arr1.each_with_index do |item, index| new_array << item << arr2[index] end new_array end | [
{
"docid": "63c57177c37d5d129f8858b11091455b",
"score": "0.931504",
"text": "def interleave(arr1,arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
}
] | [
{
"docid": "f13753bb56d512ba0d2c0556da50a3f4",
"score": "0.9643301",
"text": "def interleave(arr1, arr2)\n new_arr = []\n arr1.each_with_index do |element, index|\n new_arr << element << arr2[index]\n end\n new_arr\nend",
"title": ""
},
{
"docid": "39dddbe92c01b5723f24d129ee9f55e3",
... |
2533177f9d973811418179244d173cc8 | Create a child object | [
{
"docid": "53a1ab4617b283dd4695f32d3925080a",
"score": "0.75947833",
"text": "def create_child(data)\n resp = create_child_request(data).execute\n child_class.new(info: resp, parent: self)\n end",
"title": ""
}
] | [
{
"docid": "924fbb6cd010c74af16538ff6a4ba4d5",
"score": "0.7637328",
"text": "def create_child_blip\n #TODO\n end",
"title": ""
},
{
"docid": "cb47c5feae986bf1c1ba23276632f7a1",
"score": "0.7198254",
"text": "def create_child\n @children << begin\n p = Val... |
cd035f198457b88b7da813dd61124d3f | Display courses belonging to a student | [
{
"docid": "696164b309db3b25d888f22d1528bd69",
"score": "0.0",
"text": "def my\n # Find all courses for a users\n all = Course.joins(:histories).where histories: {user: @auth_user}\n\n # Split into current and past courses\n @current = all.where histories: {is_current: true}\n @past = all... | [
{
"docid": "3f76ec8fc814032bb85dcb726b8daff1",
"score": "0.7777922",
"text": "def show\n @courses = @student.courses\n @groups = @student.groups\n end",
"title": ""
},
{
"docid": "8a7b09ca0c3ca335d0170dadcd93b4f2",
"score": "0.7678739",
"text": "def get_courses\n\t\tif current... |
e225df25205a0851b9957a34a3eb3877 | Find server array with the given name Args : +right_client+ > instance of RightClient +server_array_name+ > string for server_array_name returned from get_server_array_name() Returns : Resource object for server array | [
{
"docid": "aef33fd3e3b7d39dea1a49b51f797a9b",
"score": "0.7653455",
"text": "def find_server_array(args)\n right_client = args[:right_client]\n server_array_name = args[:server_array_name]\n\n server_arrays = right_client.server_arrays(:filter => [\"name==\"+server_array_name]).index\n if server_ar... | [
{
"docid": "a43b1b74a839c232fdd618d538523939",
"score": "0.6055511",
"text": "def [](server_key, name)\r\n return find(server_key, name)\r\n end",
"title": ""
},
{
"docid": "ccf810d2bbcb3ea4d70f0271b1fc982c",
"score": "0.5907506",
"text": "def get_servers_by_array(names)\n a... |
4a16c39b2a09b7c4dd7c56b4f1e286b9 | Starts a multi/handler session | [
{
"docid": "5f52de1138a7782a4dd41ab1b831d7e1",
"score": "0.0",
"text": "def create_multihand(pay_name,lhost,lport)\n\t\tprint_status(\"Starting exploit multi handler\")\n\t\tif not check_for_listner(lhost,lport)\n\t\t\t# Set options for module\n\t\t\tmul = framework.exploits.create(\"multi/handler\")\n\... | [
{
"docid": "071b583c5e29b745bada81458f18f00c",
"score": "0.7388759",
"text": "def start_session; end",
"title": ""
},
{
"docid": "071b583c5e29b745bada81458f18f00c",
"score": "0.7388759",
"text": "def start_session; end",
"title": ""
},
{
"docid": "ece099a672d034f03f6f69b2... |
09aedaa956252773092bc75f0ab4894a | Methods Required I will use [] notation over fetch | [
{
"docid": "73e20af29c38c974ffc646ecbf57d955",
"score": "0.0",
"text": "def num_points_scored(player_name)\n player = player_by_name(player_name)\n player.values[0][:points]\n end",
"title": ""
}
] | [
{
"docid": "30b24f0a92c8a7f9dd1411b860d95ef4",
"score": "0.8428636",
"text": "def fetch; end",
"title": ""
},
{
"docid": "30b24f0a92c8a7f9dd1411b860d95ef4",
"score": "0.8428636",
"text": "def fetch; end",
"title": ""
},
{
"docid": "3413a2492b6f5d7e4d638ca4f83b6f07",
"... |
48b1e33daea765258a7466011b47313f | Returns a copy of this trace suitable for forks (w/o spans.) Used for continuation of traces across forks. | [
{
"docid": "6c70600ee625a4e1852e279ef8eb17ef",
"score": "0.5904407",
"text": "def fork_clone\n self.class.new(\n agent_sample_rate: @agent_sample_rate,\n events: (@events && @events.dup),\n hostname: (@hostname && @hostname.dup),\n id: @id,\n max_lengt... | [
{
"docid": "028a45bfcb6ebaf5cf55085a32fb4eab",
"score": "0.66123116",
"text": "def fork_clone\n forked_trace = @active_trace && @active_trace.fork_clone\n self.class.new(trace: forked_trace)\n end",
"title": ""
},
{
"docid": "ddb941107bcbde9873a982ef8a47b85e",
"score":... |
d6343f9eb148dcefb8e1e06f1bac61c7 | End of test method test_WebPage_010_wait_until_count =========================================================================== Testcase method: test_WebPage_011_wait_until_text Description: Test methods: wait_until_text() The web page being validated by this test should have a select list that contains 5 selections. ... | [
{
"docid": "6bce5f5447868e8c72033362688a29f6",
"score": "0.81347597",
"text": "def test_WebPage_011_wait_until_text\r\n\r\n puts2(\"\")\r\n puts2(\"#######################\")\r\n puts2(\"Testcase: test_WebPage_011_wait_until_text\")\r\n puts2(\"#######################\")\r\n\r\n #$VERBOSE... | [
{
"docid": "04d81eb8f9b21c080ceaf5215b9366d6",
"score": "0.80801815",
"text": "def test_WebPage_010_wait_until_count\r\n\r\n puts2(\"\")\r\n puts2(\"#######################\")\r\n puts2(\"Testcase: test_WebPage_010_wait_until_count\")\r\n puts2(\"#######################\")\r\n\r\n #$VERBO... |
151b47920802be60d603011fa06c61d5 | Indica si el usuario tiene nivel de acceso 'editor' | [
{
"docid": "b64261e508f0dd9a93379be8793002ad",
"score": "0.77476037",
"text": "def is_editor?\n if current_user || current_user_api\n respond_to do |format|\n format.html{\n return current_user.nivel_acceso == 'editor'\n }\n format.json{\n return current_us... | [
{
"docid": "680ada695977ffeec544a683dde39b9c",
"score": "0.78561264",
"text": "def is_editor?\n @role && @role.match(/editor|manager/)\n end",
"title": ""
},
{
"docid": "b88c02bff8941043fdd5b18fab009cda",
"score": "0.76207364",
"text": "def require_editor\n not_found u... |
269836188275880ad2c63e05a337e118 | DELETE /hostnesses/1 DELETE /hostnesses/1.xml | [
{
"docid": "5573778c688d3821cac9015d136ec3a5",
"score": "0.6853823",
"text": "def destroy\n @hostness = Hostness.find(params[:id])\n @hostness.destroy\n\n respond_to do |format|\n format.html { redirect_to(hostnesses_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
... | [
{
"docid": "579d348c930523dc4a8be1db5b10a90c",
"score": "0.6759713",
"text": "def destroy\n @host = Host.find(params[:id])\n @host.destroy\n\n respond_to do |format|\n format.html { redirect_to(hosts_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"doc... |
d8a6c5bc8797fd086ab48129864de8b8 | return all strings accepted by FA with length <= strLen | [
{
"docid": "ef3bddd2cee91806ca135af7ecc307e4",
"score": "0.54039884",
"text": "def genStr strLen\n\tsortedAlphabet = @alphabet.sort\n resultStrs = [ ] \n testStrings = [ ]\n testStrings[0] = [] \n testStrings[0].push \"\"\n 1.upto(strLen.to_i) { |x|\n testSt... | [
{
"docid": "209456dd2c21f14ab746b19e1bb0dc84",
"score": "0.6471027",
"text": "def filter_lengths(strings, length=5)\n big_words = []\n strings.each { |ele| big_words << ele if ele.length >= length }\n return big_words\nend",
"title": ""
},
{
"docid": "1338a67d80f8d6ac6f73508746771e4... |
1fd9d17ddec7ac6943980efd7bbbd2b3 | following methods will be public | [
{
"docid": "32c9aadb52a2d79779a8565510ffa0c9",
"score": "0.0",
"text": "def has_deposits\n emp_pkgs = EmployeeBenefit.where(\"employee_package_id = ? and deposited_at IS NOT NULL\", self.id ).count\n if emp_pkgs > 0\n # there is an existing benefit for this package, deactivate self before cre... | [
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.8595526",
"text": "def private; end",
"title": ""
},
{
"docid": "1e5e53c4b9e93d9482caa25c8f435412",
"score": "0.7677173",
"text": "def methods; end",
"title": ""
},
{
"docid": "1e5e53c4b9e93d9482caa25c8f435412",
... |
6d075fef265784d712717f3c3d4450b5 | F(Password, Salt, c, i) = U1 ^ U2 ^ ... ^ Uc | [
{
"docid": "180bbd6cb239ce4b558738c988a73d46",
"score": "0.5713105",
"text": "def calculate_block(password, salt, block_num)\n # U1: PRF(password, salt + INT_32_BE(i))\n u = prf(password, salt + [block_num].pack('N'))\n return_value = u\n # U2 through Uc:\n 2.upto(iterations) do... | [
{
"docid": "da3f45f200d1b5e9c865389428501af5",
"score": "0.6708431",
"text": "def strong_password(n, pw)\n return 6 - n if n <= 3\n\n numbers = \"0123456789\"\n lower_case = \"abcdefghijklmnopqrstuvwxyz\"\n upper_case = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n special_characters = \"!@#$%^&*()-+\"\n\n cou... |
9bf9762acecd092fc40678977fb418d1 | Flying unit determines if this unit is currently in flight or not. | [
{
"docid": "089e0c689fca918a7da0f12f16828509",
"score": "0.796331",
"text": "def flying_unit\n if actor?\n #check weapons for flight flag\n for wep in weapons\n if (GTBS::WeaponCausesFlight.include?(wep.id))\n return true\n end\n end\n #check armors for flig... | [
{
"docid": "f13545540661296eefba8555b8f81c19",
"score": "0.70790845",
"text": "def flying?\n self.travel_type == 'I am flying to the event.'\n end",
"title": ""
},
{
"docid": "aa17371f47fa52ccb69bbfc03808c118",
"score": "0.6978425",
"text": "def flying?\n @flying\n end",
... |
06f17c5e79dd457f1efffc48b15da4ba | Go through everything we've scraped and update our mappings of cloud ids and bare name fields, so that resources can reference one another portably by name. | [
{
"docid": "f25d3f14fcab1ff301f1c9cefc2b50c5",
"score": "0.0",
"text": "def catalogResources\n end",
"title": ""
}
] | [
{
"docid": "0a57249e037c32d5605c659f7a6ba3d0",
"score": "0.5941875",
"text": "def update_to_new_myspace_searchnames\n \n logger.debug\"Updating Myspace Search Names\"\n myspace = \"myspace\"\n http = \"http\"\n \n @all_event_searches = EventSearch.all\n \n\t@all_event_searches.each do |aes|\n\t\n... |
a493031e489864daa304134363272d6f | Converts each cell containing nil to a cell containing a string with a single blank character, " ". | [
{
"docid": "bb276bc2d0b11f0772d5c420b153ff01",
"score": "0.7116779",
"text": "def nil_to_blank!\n sheet_range = CellRange.new(1, 1, row_count, col_count)\n sheet_range.each do |cell|\n put_cell(cell, ' ') if get_cell(cell).nil?\n end\n end",
"title": ""
}
] | [
{
"docid": "2a544ffaf737a6afac7ae9c059385c49",
"score": "0.79009145",
"text": "def nils_are_blank_strings\n alter_cells do |value, record|\n value.nil? ? \"\" : value\n end\n end",
"title": ""
},
{
"docid": "6f34412c79fe126dce4d3779a5978785",
"score": "0.711577",
... |
3feb3e96c9c20f14e9ce9655c3665581 | default limit is 50 | [
{
"docid": "283029e08aa5daf77bf717010b5bf0fa",
"score": "0.0",
"text": "def soundcloud\n @tracks = @client.get('/me/tracks', :limit => 200) + @client.get('/me/favorites', :limit => 200)\n @client.get('/me/followings', :limit => 200).each do |user|\n @tracks += @client.get(\"/users/#{user.id}/... | [
{
"docid": "e30f5ad58700b669f4df7ea570b13072",
"score": "0.832931",
"text": "def limit; end",
"title": ""
},
{
"docid": "e30f5ad58700b669f4df7ea570b13072",
"score": "0.832931",
"text": "def limit; end",
"title": ""
},
{
"docid": "e30f5ad58700b669f4df7ea570b13072",
"sc... |
87a2da70e047cc30262134cf905291f7 | GET /periodo_propuestas GET /periodo_propuestas.json | [
{
"docid": "ebdeedacb06d907dc5f0aba23ee58fec",
"score": "0.73383176",
"text": "def index\n @periodo_propuestas = PeriodoPropuesta.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @periodo_propuestas }\n end\n end",
"title": ""
}
] | [
{
"docid": "8c83cdec75afb5981338aadab1d0e5c4",
"score": "0.7284065",
"text": "def show\n @periodo_propuesta = PeriodoPropuesta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @periodo_propuesta }\n end\n end",
"title": ""... |
ec7805d525707dda2e54ac7e781d7edb | GET /intranet/arquivos_tipos/1 or /intranet/arquivos_tipos/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "73284cf6865057eea2b14e593f47a4e9",
"score": "0.6839355",
"text": "def index\n @intranet_arquivos_tipos = Intranet::ArquivosTipo.all\n end",
"title": ""
},
{
"docid": "b497c1b52d433b3484becbd2624cf58c",
"score": "0.61031747",
"text": "def show\n @torneotipo = Torneo... |
46c3eb457e71521ee687ef87d13bdfc3 | Returns the average rating in percent. The maximal score must be provided or the default value (10) will be used. | [
{
"docid": "3fba9d6fc516946a4775d5086c06bb2b",
"score": "0.84854966",
"text": "def average_rating_percent(maximum_rating = 10)\n f = 100 / maximum_rating.to_f\n average_rating * f\n end",
"title": ""
}
] | [
{
"docid": "3bf0970cd122b96e1cef255cef4168ab",
"score": "0.8802047",
"text": "def average_rating_percent\n f = 100 / max_rating.to_f\n average_rating * f\n end",
"title": ""
},
{
"docid": "7b6e48c579c7f59b9b59f07228c9943e",
"score": "0.8414357",
"text": "def ... |
e561e11bcf379ef5dc139c210017366b | Only allow a list of trusted parameters through. | [
{
"docid": "eb4e0c17260ca204685b512d49840f33",
"score": "0.0",
"text": "def shift_break_params\n params.require(:shift_break).permit(:shift_id, :break_length)\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... |
d43e29123e52e9e0d6e664dcbb016e05 | generates map for a given controller. here is where the configs like root, path_rules, canonical are used. `root' is given when namespace are mounted and is used as prefix for controller mapped here. `path_rules' is about how the method names will translated into HTTP path. `canonical' represents additional path(s) to ... | [
{
"docid": "4a08d9f45b02005403f2012acb2761de",
"score": "0.7295553",
"text": "def map slice, controller\n\n controller_roots = [slice.root + controller.http.root] +\n controller.http.canonical.map { |r| slice.root + r }\n slice.canonical.each do |r|\n controller_roots << (r + c... | [
{
"docid": "e14b057f494b62ba124231959338b54c",
"score": "0.69953036",
"text": "def map_controllers\n mapper = Presto::Mapper.new\n @controllers.select { |c| c.http.root }.uniq.each do |controller|\n controller.ctrl.map mapper.map(self, controller)\n end\n end",
"title": ""
... |
de162a4afbdb4ba4eaee452f8dc7c726 | Zacks EPS Surprises This database returns historical estimated and actual earnings, guidance, and announcement dates for 17,000+ US and Canadian listed companies. | [
{
"docid": "ab53c92f4a734ecb26594cf27b796618",
"score": "0.51168954",
"text": "def get_zacks_eps_surprises(opts = {})\n data, _status_code, _headers = get_zacks_eps_surprises_with_http_info(opts)\n return data\n end",
"title": ""
}
] | [
{
"docid": "5575444e433362d6eb6456a581b5059d",
"score": "0.5756783",
"text": "def recent_prices(resolution, num_points)\n validate_historical_price_resolution resolution\n\n url = \"prices/#{instrument.epic}/#{resolution.to_s.upcase}/#{num_points.to_i}\"\n\n HistoricalPriceResult.from @de... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "95ea31b6b764aa1dc2c5beccc9057e89",
"score": "0.0",
"text": "def set_league\n @league = League.friendly.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... |
c6f2801b6aa0399e92d7351425aacb63 | POST /education_types POST /education_types.json | [
{
"docid": "ec8bc4f5a766ddb5d1b8c35bb0f76bc0",
"score": "0.7185426",
"text": "def create\n @education_type = EducationType.new(education_type_params)\n\n respond_to do |format|\n if @education_type.save\n format.html { redirect_to education_types_url, notice: 'Education type was succes... | [
{
"docid": "e797e63d224c563da9ab07e8e03c26bc",
"score": "0.6614634",
"text": "def education_type_params\n params.require(:education_type).permit(:name, :amount)\n end",
"title": ""
},
{
"docid": "f83628941e92cdb16790db26b6e0db52",
"score": "0.6207069",
"text": "def leisure_ty... |
ac55763cc8deabd231ff7e80f026509a | Retrieves a location by ID value, or +nil+ if no matching location exists. | [
{
"docid": "852d82a34739b8cd35336bb63add0e7a",
"score": "0.0",
"text": "def [](val)\n to_ary.find { |x| x.id == val }\n end",
"title": ""
}
] | [
{
"docid": "dad4ff9dad208016741bb0db78c5f7f2",
"score": "0.7375066",
"text": "def get_location(id)\n $path2id.each do |k, v|\n return k if v == id\n end\n return id\n end",
"title": ""
},
{
"docid": "2d3b037ba7f64ad71ed7bf095094545a",
"score": "0.72769225",
"... |
46c5e659d8c9ceea224ba2f7578381f4 | Adds authentication information to the request based on the challenge from the response. | [
{
"docid": "32c81057f1fb03f9ae0cf7f0a351ef44",
"score": "0.7717408",
"text": "def respond_to_challenge(request, response)\n authenticate_header = response['www-authenticate'].downcase\n authenticate_header.sub!(/^digest /, '')\n\n @authentication_params = authenticate_header.split(\", \")... | [
{
"docid": "5d205481aba0ea57c8373cded5097ab4",
"score": "0.73826385",
"text": "def challenge(request, response)\n auth = Http::Auth::Bearer.new(\n @realm,\n request,\n response\n )\n auth.require_login\n end",
"title": ... |
9dabd9f915e1a15b637326b948d80a95 | if the society is organized with centralized model, the organizations can indicates the political power layout; in any society, that's the assumption on which this fact is being studied/evaluated. | [
{
"docid": "12eeff65b1bc224a6d33985a41af9cc9",
"score": "0.0",
"text": "def organizations_in_vercinity\n\n\tend",
"title": ""
}
] | [
{
"docid": "e4b84bef60f8e035e441e5c8d13d7f1e",
"score": "0.61020565",
"text": "def summer_olympics_sport; end",
"title": ""
},
{
"docid": "5c0ceb47090272b7cec7648e12561f12",
"score": "0.5957983",
"text": "def winter_olympics_sport; end",
"title": ""
},
{
"docid": "1ccfef4... |
e193340a161906eb4fed4c53d903ada6 | "s"ort displayed files and directories in the given order. | [
{
"docid": "f1ab5627af5a82e1a16cb61670aaf3ef",
"score": "0.0",
"text": "def s\n process_command_line preset_command: 'sort'\n end",
"title": ""
}
] | [
{
"docid": "87eef8c185408e552c0f8c4827feea7d",
"score": "0.6901442",
"text": "def sort!\n folders.each do |name, folder|\n folder.sort!\n end\n end",
"title": ""
},
{
"docid": "b9ef3bd89f292c155efc52bdb5482a31",
"score": "0.66868436",
"text": "def files\n tso... |
2389ba7cb4fda8b9eb9cad82d8d757b2 | DELETE /mt_manufacturing_main_datas/1 DELETE /mt_manufacturing_main_datas/1.xml | [
{
"docid": "88fda49151fcfd7de2242994c2ad7b56",
"score": "0.0",
"text": "def destroy\n @mt_manufacturing_main_data = MtManufacturingMainData.find(params[:id])\n @mt_manufacturing_main_data.destroy\n\n respond_to do |format|\n format.js { render :action => \"destroy_mt_manufacturing_main_da... | [
{
"docid": "df26116eb86dbadafed7137f9e3c2f9e",
"score": "0.660546",
"text": "def delete!\r\n return nil unless exists? \r\n xml = xml_at_top\r\n par = xml.instance_variable_get(:@parent) \r\n par['delete'] = 'delete'\r\n xml_on_delete( xml )\r\n rsp = write_xml_config!( xml.doc.r... |
57e8b1bb5c92bdbdf0d15a159d20c2c0 | add edges across all the board | [
{
"docid": "cd2f1303bf93985db8ffbb3675d19010",
"score": "0.5575424",
"text": "def connection \n m = @table.vertices.map do |element|\n element= posible_moves(element)\n end \n end",
"title": ""
}
] | [
{
"docid": "774cc5e758461f3420b8e39182c3ddd1",
"score": "0.81743455",
"text": "def add_edges_to_graph\n @board.each do |coordinate, cell|\n @board.each do |other_coordinate, other_cell|\n if adjacent?(@board[coordinate], @board[other_coordinate])\n add... |
6a0491e685ebf6d09251b62ceb176327 | Returns a chronological list of the given classes for the given community | [
{
"docid": "c44d998ba8b579d2d0c55d0fb7f9afb5",
"score": "0.62348527",
"text": "def chronological(klass, params, community_id)\n search = Sunspot.search(klass) do\n order_by(:created_at, :desc)\n paginate(:page => params[\"page\"].to_i + 1, :per_page => params[\"limit\"])\n ... | [
{
"docid": "9f37bc6fdb31138a38048c7428a9b939",
"score": "0.56726533",
"text": "def list_all(klass, params, community_id)\n search = Sunspot.search(klass) do\n paginate(:page => params[\"page\"].to_i + 1)\n with(:community_id, community_id)\n yield(self) if block_given?\... |
a28e478681ac9d29c5dd796aa824781d | PATCH/PUT /users/1 PATCH/PUT /users/1.json | [
{
"docid": "2c0b5e3dfe96c3aa7c94ece7d5fc955b",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n ... | [
{
"docid": "23a904e6ddd4b6b07c4b53353e78cf93",
"score": "0.72248507",
"text": "def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end",
"title": ""
},
{
"docid": "4781fa7337315133553edb54194e6202",
"score": "0.7128768",
"text": "def update\n render json:... |
3113692765898d2e973977cb8a5c57fd | [Peering]( provides a way to peer your Private Space VPC to another AWS VPC. | [
{
"docid": "e8e4455f465f161ca7584ff71e3cc347",
"score": "0.58496153",
"text": "def peering\n @peering_resource ||= Peering.new(@client)\n end",
"title": ""
}
] | [
{
"docid": "cb3fa741ae467e00fd7f88d7cbcd2028",
"score": "0.605771",
"text": "def addPeer(name, slaves, vid, pairIdx, pairNum)\n peerSnippet = <<SCRIPT\nauto %s\niface %s\n bond-slaves %s\n bond-mode 802.3ad\n bond-miimon 100\n bond-min-links 1\n bond-xmit_hash_policy layer3+4\n bond... |
2d2b9f7bd30596c18bcc2bb61fcc8207 | Retrive the views as blocks | [
{
"docid": "d0908f98e4e692ef9042ca25b0353770",
"score": "0.7695213",
"text": "def get_views_as_blocks(context)\n \n views = ContentManagerSystem::View.all\n \n views.map do |view|\n {:name => \"view_#{view.view_name}\", \n :module_name => :cms, \n :theme => T... | [
{
"docid": "29fc09ce8de11c96b77117b6e008a474",
"score": "0.7433906",
"text": "def render_views_in_this(block)\n html = ''\n block.views.each do |view|\n models_view = view.models_view(block)\n \n if view.model_name =~ /(tag)|(image)/ && !view.scope.blank?\n scope_model = view... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "5aee0ec974bfe9af5bd83d27f61c06a4",
"score": "0.0",
"text": "def update!(**args)\n @range = args[:range] if args.key?(:range)\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... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "67f317cb70c72ce74c67fc93af7ab10b",
"score": "0.0",
"text": "def set_newsletter\n @newsletter = Newsletter.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;... |
6a04b8354b5a2923568269ead532ec66 | return Array of SiteInquiryItem model records | [
{
"docid": "306e4503bca43d527a7b93954fe77b68",
"score": "0.7923661",
"text": "def inquiry_items\n @inquiry_items\n end",
"title": ""
}
] | [
{
"docid": "1a0cc599426b14b50fec74d06a72ee24",
"score": "0.6780774",
"text": "def index\n @inquiries = Inquiry.all\n end",
"title": ""
},
{
"docid": "1a0cc599426b14b50fec74d06a72ee24",
"score": "0.6780774",
"text": "def index\n @inquiries = Inquiry.all\n end",
"title": ""... |
1f74d1c4607a2fc488fc759ae5bcc264 | GET /system_files/1 GET /system_files/1.xml | [
{
"docid": "925e98878ad9bf3c65065851011222f1",
"score": "0.0",
"text": "def show\n @system_file = SystemFile.find(params[:id])\n Thread.new{system(\"C://Program Files//VideoLAN//VLC//VLC.exe #{File.expand_path(@system_file.path)}\")}\n render :nothing => true\n end",
"title": ""
}
] | [
{
"docid": "5901a3a12c1eaca443d962570fde9306",
"score": "0.6573566",
"text": "def files\n # GET /source/<project>/<package>\n xml = @project.api :get, \"/source/#{@project.name}/#{@name}\"\n xml.xpath(\"/directory/entry/@name\").each do |name|\n yield\n end\n end",
"title": ""
},... |
dec8d85e8e43c3b10187096b1b7e2e02 | Method bellow show different behavior when working with 1.8.7 so based on Hash response we know it it is: Hash => 1.9.3 + Array => 1.8.7 | [
{
"docid": "be7777d1a757ed5ed552b569ea17384e",
"score": "0.0",
"text": "def changed\n status.is_a?(Hash) ? status.changed().keys : status.changed().collect { |file| file.first }\n end",
"title": ""
}
] | [
{
"docid": "2825ff9c82fd18ff9287c301e733d857",
"score": "0.61531574",
"text": "def hash_array_check(data)\n uri_recursive_hash(data) if data.is_a?(Hash)\n uri_recursive_array(data) if data.is_a?(Array)\nend",
"title": ""
},
{
"docid": "65905a6f2703806c92d27536bb4d0cc5",
"score": "0.600... |
9061650d995b4b9cdece0ca6017dc12b | Returns a string representation of the UTC offset for the given timezone | [
{
"docid": "adf070d5e4ff31bdaa5bca83a4f6cc7c",
"score": "0.78210175",
"text": "def format_offset(timezone)\n offset = utc_offset_in_hours(timezone).to_s\n offset.insert(1, '0') if utc_offset_in_hours(timezone).abs < 10\n plus_sign = '+' unless offset.include? '-'\n [plus_sign... | [
{
"docid": "89fd31e5c29ddc2e3dda576f531c5d42",
"score": "0.7239426",
"text": "def formatted_offset\n utc_offset = Time.now.utc_offset\n \n return \"\" if utc_offset == 0\n sign = (utc_offset < 0 ? -1 : 1)\n hours = utc_offset.abs / 3600\n minutes = (utc_offset.abs % 3600) /... |
1d089be0d5a2b6212c26a0c2a6ce839f | GET Edita los productos ofrecidos por el proveedor (Se muestran en el edit_supplier_account) | [
{
"docid": "2eb0c0782aaef499817912a5b495d6ad",
"score": "0.64165235",
"text": "def edit_supplier_product \n \t@product = Product.find params[:product_id]\n \t@product.videos.build if @product.videos.blank?\n\t @supplier_account = @product.supplier_account\n\t @supplier = @product.supplier_account.s... | [
{
"docid": "213ead091dc846b4a0f270ebce85357f",
"score": "0.6799016",
"text": "def update\n @pagetitle = \"Editar Orden\"\n @action_txt = \"Update\"\n \n items = params[:items].split(\",\")\n \n @supplierpayment = SupplierPayment.find(params[:id])\n @company = @supplierpayment.compan... |