query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
1948427652473749dc8303e0aba5b5a8
Analize SDC data remove unexpected line (Tcl sentence) operate separating each attribute
[ { "docid": "050ef676f2e691d0372b54201e8ba5c5", "score": "0.49336335", "text": "def analize\n \n printf(\"@I:analize sdc file\\n\")\n @SDC_DATA.each{|line|\n\n next if line == nil\n const_each = ConstEach.new\n line = line.strip\n if /^if/ =~ line || /^\\} else/ =~ line |...
[ { "docid": "f79dbd6295b4d272d12b689afe6f3548", "score": "0.59053147", "text": "def tidy(data); end", "title": "" }, { "docid": "cb2612dee6ea12d5c7f5d51c0f9b34e1", "score": "0.5865112", "text": "def compare_scr\n line = Array.new\n @attribute_all.each_value{|const|\n const[...
3501fb22a0290b29ab8169bb87c6ee6b
Generates an array of strings that represent possible I18n.translate invocations
[ { "docid": "5c4727529da2ccf9e9f5619c28f0cc54", "score": "0.5365949", "text": "def t_call_variations(key, options=nil)\n invocations = ['I18n.t', 'I18n::t', 't', 'I18n.translate', 'I18n::translate', 'translate']\n parentheses = [['(',')'], [' ','']]\n quotes = [['\"', '\"'], ['\\'', '\\''], ['%{...
[ { "docid": "335961c358398912a0fb0cb91e9b31b1", "score": "0.66763806", "text": "def translations; end", "title": "" }, { "docid": "21c651249a2c1c6fe0288c4870e44b02", "score": "0.65324104", "text": "def translations_for route\n available_locales.map do |locale|\n transl...
d1e6566cf30ab02cf7731fc5b838dfbc
PATCH/PUT /suenos/1 PATCH/PUT /suenos/1.json
[ { "docid": "6694a0223aa319fd127f206e2010c1ba", "score": "0.5933054", "text": "def update\n respond_to do |format|\n if @sueno.update(sueno_params)\n format.html { redirect_to @sueno, notice: 'Sueno was successfully updated.' }\n format.json { render :show, status: :ok, location: @s...
[ { "docid": "882c8317370987b86425c0adbf5bfe8c", "score": "0.63799053", "text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "ea416b077fa0aa7e84ec3fe2ef9c3772", "score": "0.6315499", "text": "def put\n ...
9dc4ebe93ced2abde9ae0f3caa4a26a2
DELETE /users/1 or /users/1.json
[ { "docid": "355b272de30d1bbb2b812bef2ffa5de3", "score": "0.0", "text": "def destroy\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url, notice: \"User was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "8e69eb3ff3374e0db6fa9eb17958df65", "score": "0.7684552", "text": "def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end", "title": "" }, { "docid": "95f7909f2d660a9b4f3be6031cc3886e", "score": "0.7499508", "text": "...
e9d4257984846fb0b0ab47251e427dc1
POST /image_types POST /image_types.json
[ { "docid": "bbfb801c2dd89ad74a3459eb5858ad4e", "score": "0.67892957", "text": "def create\n @image_type = ImageType.new(params[:image_type])\n \n respond_to do |format|\n if @image_type.save\n format.html { redirect_to @image_type, notice: 'Image type was successfully created....
[ { "docid": "2bac395d2093721073771b94444c049e", "score": "0.6695854", "text": "def create\n @image_type = ImageType.new(image_type_params)\n\n respond_to do |format|\n if @image_type.save\n format.html { redirect_to @image_type, notice: 'Image type was successfully created.' }\n ...
db0b18f926b76a1dcf00d25405af5eb1
Launch at a specific datetime. Use a ruby Datetime object here
[ { "docid": "c858047812463cb447fabc335b930916", "score": "0.0", "text": "def execute\n raise ::GDO::Core::Exception.new(t(:err_cronjob_stub_method))\n end", "title": "" } ]
[ { "docid": "885f370103ae3e2b331d00e26c63d4a9", "score": "0.62596697", "text": "def start_at=(time)\n super(time.to_date)\n end", "title": "" }, { "docid": "ab0930746c25a68f7c996200a2d4c87a", "score": "0.61853015", "text": "def at_midnight; end", "title": "" }, { "doci...
7fe04c9794f66f83a60e58f529197a31
PUT /event_posts/1 PUT /event_posts/1.json
[ { "docid": "58be208b2830eaaff395d7c76295f0f3", "score": "0.61114264", "text": "def update\n @event_post = @event.event_posts.find(params[:id])\n\n respond_to do |format|\n if @event_post.update_attributes(params[:event_post])\n \n if @event_post.home_flag\n if !@event_p...
[ { "docid": "e5460b656a1d4534f93100e444b24240", "score": "0.6905179", "text": "def update\n event = current_user.events.find(params[:id])\n if event.update(post_params)\n render json: event\n else\n render json: {error: 'could not update'}, status: 401\n ...
5f622f3a5f3faf2beba07bf722b0cff0
QUOTING ================================================== Override to return the quoted table name if the database needs it
[ { "docid": "dce6ab3f7ee5dae25c468877069042ff", "score": "0.7748096", "text": "def quote_table_name(name)\n name\n end", "title": "" } ]
[ { "docid": "4bc4004946e6880ea11da5a8f5148785", "score": "0.8266345", "text": "def quoted_table_name\n @quoted_table_name ||= \"`#{table_name}`\"\n end", "title": "" }, { "docid": "1feb6f1ccc9025ce4c8b25c024e3af68", "score": "0.8034182", "text": "def quoted_table_name\n ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "9d2c53d51adb2f1bfc2e50bddac43a03", "score": "0.0", "text": "def digital_product_params\n params.require(:digital_product).permit(:product_id, :image)\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...
e0ac92721f69dca0e66b4ebf91e5a4b0
matches image name with game board value and returns that image name for display purposes
[ { "docid": "a880765a9f087e9fc7f27d449cf68624", "score": "0.6707001", "text": "def return_image(tictactoe, num)\n return \"blank.jpg\" if tictactoe.squares[num].value == \"\" || tictactoe.squares[num].value == nil\n return \"x.jpg\" if tictactoe.squares[num].value == \"X\"\n return \"o.jpg\" if ...
[ { "docid": "4f5795f18f720fbbbe928727915fe20a", "score": "0.680581", "text": "def image_filename_for_match(match)\n sane_name(match.image_filename)\n end", "title": "" }, { "docid": "78ad7e26d7bf941871c1e1e05da58afd", "score": "0.65978014", "text": "def image( name )\n @image...
40336a0a760be2a5346b33fcb6f9a563
apps:create [NAME] create a new app addons ADDONS a commadelimited list of addons to install b, buildpack BUILDPACK a buildpack url to use for this app n, noremote don't create a git remote r, remote REMOTE the git remote to create, default "pebbles" sshgit Use SSH git protocol httpgit HIDDEN: Use HTTP git protocol Exa...
[ { "docid": "1b370177ccc7edf288cca841f06f0564", "score": "0.778766", "text": "def create\n name = shift_argument || options[:app] || ENV['PEBBLES_APP']\n validate_arguments!\n\n params = {\n \"name\" => name,\n }\n\n info = api.post_app(params).body\n\n begin\n action(\"Cre...
[ { "docid": "777a5542c43819f8ef2b8603be802e4d", "score": "0.7444335", "text": "def create\n remote = extract_option('--remote', 'heroku')\n stack = extract_option('--stack', 'aspen-mri-1.8.6')\n timeout = extract_option('--timeout', 30).to_i\n name = shift_argument\n validate_argumen...
0f0591d67e0ff2551b44c4b8f62c1407
Parse and run the given Brainfuck code.
[ { "docid": "b4e1a20305a6be811c689b02cf48ce18", "score": "0.6125772", "text": "def run(code, options={})\n parse(code).run(options)\n end", "title": "" } ]
[ { "docid": "3498a30233ea5d78f43aeb631f4ef617", "score": "0.7306875", "text": "def run(code)\n\t\t\t@code += code.delete \"^[]<>.,+-\"\n\t\t\tif check_for_matching_braces\n\t\t\t\tcatch :quit do\n\t\t\t\t\tevaluate_code\n\t\t\t\tend\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "90a73e0e617...
b176f7d0fb20360fae4d919b7906f69c
Features (part of gene: CDS, mRNA, misc_RNA, precursor_RNA, ncRNA, tRNA, rRNA)
[ { "docid": "b6a7e590a0d2d0eaa4c4f362df309f49", "score": "0.63212633", "text": "def parse_features\n features = @features.select {|x| x.feature != \"gene\" }\n\n features.each do |feat|\n feature_id = new_uuid\n hash = feat.to_hash\n\n feature = feat.feature\n @feature_count[fea...
[ { "docid": "88fcea362cbf4b690a3294e285aa104a", "score": "0.7073551", "text": "def features; end", "title": "" }, { "docid": "88fcea362cbf4b690a3294e285aa104a", "score": "0.7073551", "text": "def features; end", "title": "" }, { "docid": "0cc7621c219288c0ce73117797fa974c",...
13d9f53673102746808376db657ab045
Set the value of the ShareTypes input for this Choreo.
[ { "docid": "de118b7148cf34556e9048da93b8fdf8", "score": "0.775425", "text": "def set_ShareTypes(value)\n set_input(\"ShareTypes\", value)\n end", "title": "" } ]
[ { "docid": "d779da033959dad0d2b553b507590dc4", "score": "0.58845305", "text": "def sharing_type=(value)\n @sharing_type = value\n end", "title": "" }, { "docid": "421781b2d122dc2cdf86a63991701603", "score": "0.54736173", "text": "def set_types(*_types)\n ...
f48d9e87ed0ced4f0f873d3eeb305047
Makes thumbnails if ImageMagick is available and we have local storage
[ { "docid": "c7b4b46fd029b9db2062b4fe602b2fc5", "score": "0.85688114", "text": "def make_thumbnails\n return true unless defined?(IMAGEMAGICK_CONVERT) && is_local?\n system(\"#{IMAGEMAGICK_CONVERT} -resize #{THUMBNAIL_SIZE} #{filename} #{filename('s')}\")\n true\n end", "title": "" } ]
[ { "docid": "2cf0fafcba508c75e7d8093ddd4fcac8", "score": "0.73397434", "text": "def resize\n if size.max > 1024\n res = %x( #{magick_bin_name(\"convert\")} -auto-orient -resize 1024x768 #{Shellwords.shellescape path} #{Shellwords.shellescape path})\n Rails.logger.info res\n end\n ...
7a9578b1ab838515c9b6d05a725ceb15
Create a resource object, associate it with a client, and set its properties.
[ { "docid": "f772e71f03e1785d64eab791f78220cd", "score": "0.0", "text": "def initialize(client, params = {}, api_ver = nil)\n super\n # Default values:\n @data['enclosureType'] ||= 'C7000'\n @data['state'] ||= 'Active'\n @data['uplinkSets'] ||= []\n @data['type'] ||= 'logica...
[ { "docid": "0f1a423666b4eb00dd66665cc0f10e38", "score": "0.7475301", "text": "def create\n @_resource = Client.new(client_params)\n resource.save\n respond_with resource\n end", "title": "" }, { "docid": "15fbdfdaa0a422e85e89ce76ff5a5fa9", "score": "0.7200885", "text": "def...
25598873327eb3ee3637d751323f82d5
filter that responds with :not_acceptable if request rdf for non rdf capable resource
[ { "docid": "1a0ed56c28ac3110cb3648c46cea9232", "score": "0.65941924", "text": "def rdf_enabled?\n return unless request.format.rdf?\n unless Seek::Util.rdf_capable_types.include?(controller_model)\n respond_to do |format|\n format.rdf { render plain: 'This resource does not support RDF...
[ { "docid": "85d485c79c6440ec390d4f91a9da7230", "score": "0.636041", "text": "def rdf_supported?\n false\n end", "title": "" }, { "docid": "4de4fb6442be8ae4bd526b8c1530610a", "score": "0.59026444", "text": "def status_not_acceptable\n respond_to do |format|\n format.any { ...
a791dba914b7ebc96a09096b3044dbef
Appends the specified float to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written. Returns a reference to this so multiple operations can be appended together.
[ { "docid": "53e95de61c4564b7612ac6269e97cfb1", "score": "0.75912696", "text": "def append_float(f=nil)\n if f.class == Float && !block_given?\n @j_del.java_method(:appendFloat, [Java::float.java_class]).call(::Vertx::Util::Utils.to_float(f))\n return self\n end\n raise Argum...
[ { "docid": "ceec9bfff92cb28c613bd32382af6f66", "score": "0.640298", "text": "def add_item value\n\n @queue << value.to_f\n @queue.shift if @buffer.size > @period\n\n @buffer << @queue.sum / @queue.size # @queue.sum is always a float. \n\n current # return the last buffe...
c6e4781703bb9474bffb52b66bb63cde
Returns the history of the status changes for a specific task id, or for a specific device id in that task. Returns the history of the status changes for a specific task id, or for a specific device id in that task.
[ { "docid": "5194dad897ae744ddd0b7d4a0b1c07a6", "score": "0.66803366", "text": "def get_statuses_history_with_http_info(tid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DevicesManagementApi.get_statuses_history ...\"\n end\n # verify...
[ { "docid": "19c89f527250e40fb8805261fdb8eda8", "score": "0.65547264", "text": "def audit_history\n return [] if id.blank?\n return Audit.where( work_id: id ).order( created_at: :desc )\n end", "title": "" }, { "docid": "e0139120c8dc26573f4459d7c4064dd5", "score": "0.60994345", ...
d4c406fbdac4b002472ce3becbb70290
Publish a message and don't wait for a response. Is not threadsafe; you need to synchronize with the lock before calling.
[ { "docid": "400b3f1d057f943753f00bfa658cf232", "score": "0.5786685", "text": "def publish(msg)\n #@indents ||= []\n #puts \"#{@indents.join(\"\")}#{Process.pid} publish(#{msg.inspect})\"\n msg.from(@address)\n @connections[msg.to].write(Yaram.encoder.dump(msg) + \"]]>]]>\")\n end"...
[ { "docid": "28c0adcf7cc39962c5c0e3fa897579a9", "score": "0.6794996", "text": "def publish(message)\n @broker.publish message\n end", "title": "" }, { "docid": "f0c8f0b6132be7d7a3f1e3005f1d1737", "score": "0.6767667", "text": "def send_request(message)\n @response_wait_...
9000627eded68bfce93b661d910486b8
create jekyll post file
[ { "docid": "46389560a376e211743fd88068602d72", "score": "0.6516329", "text": "def build_file(filepath, title, link, timestamp)\n File.open(filepath, 'w') do |f|\n f << \"---\\n\"\n f << \"layout: post\\n\"\n f << \"title: \\\"#{title}\\\"\\n\"\n f << \"date: #{timestamp || Time.now.strftime...
[ { "docid": "0384dd894b3ee7df787ea9c51d81106d", "score": "0.7570096", "text": "def create_new_post(params) \n post_title = params['post']['title']\n post_date = (Time.now).strftime(\"%Y-%m-%d\")\n\n content = yaml_data(post_title).to_yaml + \"---\\n\" + params[:post][:content]\n ...
6dadb66e3b8db9c95766fb823c915701
Runs the callback as long as the transition context matches the branch requirements configured for this callback. If a block is provided, it will be called when the last method has run. If a terminator has been configured and it matches the result from the evaluated method, then the callback chain should be halted.
[ { "docid": "c62823cc7b350efc2ea12274986c157c", "score": "0.5311536", "text": "def call(object, context = {}, *args, &block)\n if @branch.matches?(object, context)\n run_methods(object, context, 0, *args, &block)\n true\n else\n false\n end\n end", "title": "" ...
[ { "docid": "18139399fa05832c4403b4a5512fa536", "score": "0.5782362", "text": "def callback(&blk)\n @blk=blk\n end", "title": "" }, { "docid": "652e83ae488cce38082048fcce8b10ea", "score": "0.5596699", "text": "def condition &block\n return unless block\n\n case @defe...
8086a66676c6908ee8dc02297fce9b92
POST /students POST /students.json
[ { "docid": "1f17dae11e04b96eed58a94509398857", "score": "0.7030532", "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 { r...
[ { "docid": "b9fc48e0487439541cd53042b4f0ea70", "score": "0.7277433", "text": "def create\n @student = Student.new(student_params)\n\n if @student.save\n render json: @student, status: :created\n else\n render json: @student.errors, status: :unprocessable_entity\n end\n end", ...
6d18357a2cbd2b705132b4b545d43ff1
O(n 2) == time O(1) == space
[ { "docid": "61b6582951fe194de8769bbe70b95da3", "score": "0.0", "text": "def okay_two_sum?(array, target)\n array = array.sort\n i = 0\n j = array.length - 1\n while i < j\n if ((array[i] + array[j]) <=> target) == 0\n return true\n elsif ((array[i] + array[j]) <=> target) == -1\n i +...
[ { "docid": "27f29666484272c0d973e8400c4c357c", "score": "0.669435", "text": "def hash_two_sum?(arr, num)\n hash = Hash.new(0) #O(1) work\n arr.each do |ele| # N times\n return true if hash.has_key?(num - ele) # O(1) work\n hash[ele]+= 1 # O(1) work\n end\n false\nend", "tit...
271ae659de851fd5e3baba798e3a194f
Returns whether this is a DIME response.
[ { "docid": "6bd57f1a8feb52124bef763bfda1485a", "score": "0.8265461", "text": "def dime_response?\n headers[\"Content-Type\"] == \"application/dime\"\n end", "title": "" } ]
[ { "docid": "9fa79b3d790339e097b82412099fa8d5", "score": "0.74531645", "text": "def response?\n (self.type == PACKET_TYPE_RESPONSE || self.type == PACKET_TYPE_PLAIN_RESPONSE)\n end", "title": "" }, { "docid": "0a9ccab19118e9e8e43815624483b3d2", "score": "0.7396534", "text": "def r...
febc6bf2b04a9d3e6b2be012d3aa6a03
update vault with unilevel bonus and investment plans
[ { "docid": "a3124c5101f77032a70b15019607b61b", "score": "0.639212", "text": "def update_unilevel_investments_rewards\n @users = User.all\n @users.each do |user|\n rewards = user.rewards.where(reward_status_id: 11).where.not(reward_type_id: 13)\n vault = user.vault\n rewards.each d...
[ { "docid": "f5e35b53420dc79e42e980b3e2d117b9", "score": "0.6551702", "text": "def update_invested\n self.invested_amount = self.investments.map(&:amount).sum\n self.goal_investment = 0 unless self.goal_investment\n self.equity_offered = 0 unless self.equity_offered\n self.save\n end", "...
b6ad3d00ab18a50cf64bf3c44d78bd27
POST /users POST /users.json
[ { "docid": "392b8b286088db3b3975d8028d5cd4c2", "score": "0.0", "text": "def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n session[:user_id] = @user.id\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n f...
[ { "docid": "24c5e44d772da89269600975eeebdfda", "score": "0.719235", "text": "def create\n @user = User.new(user_params)\n @user.save\n json_response(@user, :created)\n end", "title": "" }, { "docid": "6e1490da4a56756e02c8de2a503a156e", "score": "0.7186101", "text": "def cre...
90718738e1473408313b37bf4781931c
Extracts and parses the YAML from the header of the fixture.
[ { "docid": "da9fab8600bb3d619af559bd83f2821e", "score": "0.5526693", "text": "def yaml\n @yaml ||= has_yaml? ? YAML.load(@content) : {}\n end", "title": "" } ]
[ { "docid": "f5ae4acd28eb90c56e6e8a7821ac8ea7", "score": "0.6384315", "text": "def take_yaml(yml)\n @data = YAML.load(yml)\n end", "title": "" }, { "docid": "f5ae4acd28eb90c56e6e8a7821ac8ea7", "score": "0.6384315", "text": "def take_yaml(yml)\n @data = YAML.load(yml)\n end", ...
c4cd8effbaa262fbf5fa685ab65538b7
Button to dismiss a modal
[ { "docid": "79de5156a42231a0dcb8a68a04b6312b", "score": "0.71144587", "text": "def modal_close_button\n content_tag :button, type: 'button', class: 'close',\n data: {dismiss: 'modal'} do\n icon('close')\n end\n end", "title": "" } ]
[ { "docid": "d7fdf5c3c7bdeb7b454aac321966e12b", "score": "0.8108383", "text": "def dismiss_modal(type, **options, &blk); end", "title": "" }, { "docid": "ac8b2c149d1ada723325323c14b36689", "score": "0.7458072", "text": "def close\n @show = false\n # remove(\n # selector: \"...
63686c3ee8d446a64dde684992a39810
METODO TO_S para convertir a string.
[ { "docid": "dfffb2a0c5a8283968ff5cbe1c849aa1", "score": "0.0", "text": "def to_s\n\t\taux = \"[\"\n\t\tfor i in(0..@alt)\n\t\t\taux += \"[\"\n\t\t\tfor j in(0..@anc)\n\t\t\t\tif (j!=@anc)\n\t\t\t\t\taux += \"#{@M[i][j]},\"\n\t\t\t\telse\n\t\t\t\t\taux += \"#{@M[i][j]}\"\n\t\t\t\tend\n\t\t\tend\n\t\t\tau...
[ { "docid": "79963995f875db9afe89476fa57ae4d4", "score": "0.8159772", "text": "def convert_string string\n string\n end", "title": "" }, { "docid": "bd1a0dfe1aeb1fdd7dfeeb2e7287d1a3", "score": "0.76852864", "text": "def to(str)\n @to_conv.conv(str)\n end", "title": "" },...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "ef040df782f6b59ad13b4162bd86cc1c", "score": "0.0", "text": "def import_params\n params.permit(:import_file)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74768823", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.71700543", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist...
ade4d84d14efbec99534886be663b4d3
GET /displasia/1 GET /displasia/1.json
[ { "docid": "3750bf70df619d737784259cc39dabdb", "score": "0.74843407", "text": "def show\n @displasium = Displasium.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @displasium }\n end\n end", "title": "" } ]
[ { "docid": "ffa31a1454d49ec86aad823f0719370f", "score": "0.7705326", "text": "def show\n @dispo = Dispo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dispo }\n end\n end", "title": "" }, { "docid": "ffa31a1454d49e...
55185b2ae9c6dde9badd49b1fe3554a5
returns a hash of the total weights of each child's sumtree
[ { "docid": "7d17e942a6a284d9554448ec7980849c", "score": "0.83444864", "text": "def children_sumtrees\n children.each_with_object({}) do |child, sum|\n sum[child.name] = child.total_weight\n end\n end", "title": "" } ]
[ { "docid": "8067e9fa1d9f95446349f07e454d8335", "score": "0.75384915", "text": "def find_weights(node_name,node_hash)\n node = node_hash[node_name]\n if(node[\"children\"])\n node[\"total_weight\"] = node[\"weight\"] + node[\"children\"].map{|c| find_weights(c,node_hash)}.inject(:+)\n else\n nod...
5ee6c56ab5d9f632d6a09a620137257b
DELETE /trips/1 DELETE /trips/1.json
[ { "docid": "626c8b4bf4f2a92524676ed8fa2f7118", "score": "0.6761795", "text": "def destroy\n @trip.destroy\n redirect_to trips_path\n end", "title": "" } ]
[ { "docid": "8d7974daec8f84834884a9982cfda923", "score": "0.76655746", "text": "def destroy\n @trip.destroy\n\n respond_to do |format|\n format.any(:trips_json, :json) do\n head :no_content\n end\n end\n end", "title": "" }, { "docid": "450279cf721c70c...
5d88697b1ddc748b9181bc6f36018268
send a PWM (pulse width modulation) signal to the pin
[ { "docid": "9857e1e628cd710f05f44c7b4a090f5c", "score": "0.73575497", "text": "def pwm(value)\n GPIO.write \"gpio#{@number}/value\", value\n end", "title": "" } ]
[ { "docid": "63d9cdf92f447abfb91610d4fd16909e", "score": "0.72344285", "text": "def send_pulse\n puts 'DEBUG: send_pulse'\n set_intensity :high\n sleep 0.4\n set_intensity :off\n end", "title": "" }, { "docid": "522a9a3bcb88f0e1fef70d43ee53cdbb", "score": "0.72196805", "t...
d53869f37fc153344c74752a3d2d7625
Returns all user contacts.
[ { "docid": "309cfedd5f04a176ca2bed9dba16aad5", "score": "0.0", "text": "def get_contacts\n broadcast('@type' => 'getContacts')\n end", "title": "" } ]
[ { "docid": "eca03107539927f2c59979d1028aad9f", "score": "0.8077975", "text": "def get_user_contacts(options={})\n response = get(\"get_user_contacts/\", options)\n end", "title": "" }, { "docid": "9b7261396c5ab1428691d36610a1112e", "score": "0.79924214", "text": "def contacts...
edd216a463b7e82876a555362c8a349b
GET /shops/1 GET /shops/1.json
[ { "docid": "b953512e7b8f5768562798a29f9763fc", "score": "0.0", "text": "def show\n @shop = Shop.find(params[:id])\n @ave_review = Review.where(shop_id: @shop.id).average(:rate)\n end", "title": "" } ]
[ { "docid": "2d4dc1c76cb1689bfdd1076ddbfc025c", "score": "0.7023943", "text": "def index\n @shop = Shop.find(1)\n render :json => @shop\n return\n end", "title": "" }, { "docid": "b743ab232382c0a1ebd288c8b980a002", "score": "0.6906654", "text": "def index\n @workshops = W...
415c4ff96c90a980ea536b4c5399977e
Start / Create a machine
[ { "docid": "2ae037d1691cdd92fa994bcfaf943477", "score": "0.70942104", "text": "def start\n create_machine :config_id => self.setting, :cluster_number => 1\n end", "title": "" } ]
[ { "docid": "530e5c19aceddd2f4bb3ae91287e65c4", "score": "0.7519377", "text": "def new_machine\n self.start\n end", "title": "" }, { "docid": "d73de6c6bf0a3f21df68606e9f332d83", "score": "0.66087484", "text": "def start(inode)\n logger.info(\"machine.start\")\n raise Excepti...
4f73c4496ae2dc1e94c318f92a037e66
Returns a query solution constructed by binding any variables in this pattern with the corresponding terms in the given `statement`.
[ { "docid": "3af5a1e01737e278ee805e6ce7037a92", "score": "0.7420194", "text": "def solution(statement)\n RDF::Query::Solution.new do |solution|\n solution[subject.to_sym] = statement.subject if subject.variable?\n solution[predicate.to_sym] = statement.predicate if predicate.variab...
[ { "docid": "585bf109d7bc9c76d9fa3a506c0dff99", "score": "0.5713085", "text": "def with_substitutions(assignment_hash)\n return self unless assignment_hash\n statement_hash = to_hash\n [:subject, :object, :predicate].each { |place_in_statement|\n bound_variables, variable = assignme...
91b50f219155d7a8c5420eb403d1a13d
Internal: Adds a message to the logger. level The level of the message. context The context of the message. message The unformatted message. Returns nothing.
[ { "docid": "762026091f291058037544556bfcf741", "score": "0.8081975", "text": "def add(level, context, message)\n @logger.send level, @formatter.format(level, context, message)\n rescue => e\n STDERR.puts \"Failed to log message for #{context} with appender #{self} - #{level} - #{message}\\n...
[ { "docid": "97381eafeb2ad93e3cdbb2270df03dc0", "score": "0.64307076", "text": "def add(level, message)\n asl_log(@aslclient, @aslmsg, level, message)\n end", "title": "" }, { "docid": "dc775cfdbbee6ca5e999a81a709f6d3d", "score": "0.64144945", "text": "def log(context, msg...
653ae66ff3902dd8eedd06515b41031a
PUT /usercases/1 PUT /usercases/1.xml
[ { "docid": "9bb10b1789f8e1c1dac98563b58309e1", "score": "0.6516272", "text": "def update\n @usercase = Usercase.find(params[:id])\n\n respond_to do |format|\n if @usercase.update_attributes(params[:usercase])\n flash[:notice] = 'Usercase was successfully updated.'\n format.html ...
[ { "docid": "9ddf960eb3f437e62b9b99d34992bc0f", "score": "0.6394639", "text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_resp...
877c325f5b9a4bd6bd172e0c6a7f4272
Convert the any or all status to && or ||, for the search query.
[ { "docid": "0907934738949c39af529bb64ea4cc0b", "score": "0.609596", "text": "def operation_as_join\n @operation == :all && ' && ' || ' || '\n end", "title": "" } ]
[ { "docid": "be0dcff61f037df1b9048057fb0a0d03", "score": "0.619144", "text": "def status_condition\n value = '|'\n value << 'p' if statuses.include?('prospect')\n value << 's' if statuses.include?('student')\n value << 'f' if statuses.include?('former_student')\n value << '|'\n value\n ...
66e21a458b23cce0f48c359b9d8b7d7d
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
[ { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.0", "text": "def context; end", "title": "" } ]
[ { "docid": "d1758edd04b6374162470ca44c3f1250", "score": "0.6871894", "text": "def context\n unless @instance_context\n @instance_context = AuthTokenPromotionContext.new(@version )\n end\n @instance_context\n ...
9bb8362d535395fcbf05f825a5316bd8
numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... Let us list the factors of the first seven triangle numbers: 1: 1 3: 1,3 6: 1,2,3,6 10: 1,2,5,10 15: 1,3,5,15 21: 1,3,7,21 28: 1,2,4,7,14,28 We can see that 28 is the first...
[ { "docid": "bafddcd4ef93b618b64e36c956c082dc", "score": "0.0", "text": "def count_divisors(num)\n return 1 if num == 1\n cap = Math.sqrt(num)\n divisors = 0\n\n (1..cap).each do |i|\n if num % i == 0\n divisors += 2\n end\n end\n\n divisors += 1 if cap == cap.floor\n\n divisors\nend", ...
[ { "docid": "57820fcb9e14bdee89e97999280a1938", "score": "0.79713845", "text": "def triangle_divisors8(max)\n sum = 1\n n = 2\n factors = 0\n\n until factors > max\n factors = 0\n sum += n\n divisor = 1\n square_root = Math.sqrt(sum)\n while divisor <= square_root\n if sum % divis...
ff9e4d6deafb5c3f62c2f48dc1bdc19e
returns true if the two cuboids intersect each other. False otherwise.
[ { "docid": "0f2991089e36df3260d91f41e83c9fb3", "score": "0.725815", "text": "def intersects?(other)\n raise \"NOT A CUBOID\" unless other.is_a? Cuboid \n self_range = range_finder\n other_range = other.range_finder\n\n self_range.each do |k,_|\n return false unless overlap?(self_range[k...
[ { "docid": "51bece58c24a848f3ad66b622b2e459f", "score": "0.78990805", "text": "def intersects?(other_cuboid)\n\t\toverlaps_along_x_with?(other_cuboid) && overlaps_along_y_with?(other_cuboid) && overlaps_along_z_with?(other_cuboid)\n\tend", "title": "" }, { "docid": "84ad31575cc8b86c4cb5b465f...
c2fa3473fc2cb0986dd034793b3ae3c5
Returns the value of the `enabled_features` attribute.
[ { "docid": "65dc012624582b8f1b7a083c9db67cfe", "score": "0.84536767", "text": "def enabled_features\n @enabled_features\n end", "title": "" } ]
[ { "docid": "50b2d7fc154149d17ca6b4ba6f8dc365", "score": "0.74542683", "text": "def feature_enabled?(feature)\n @features[feature.to_sym] || false\n end", "title": "" }, { "docid": "85f007714851cba0f22bdb4c8fbbd6eb", "score": "0.7386152", "text": "def disabled_features\n ...
4d9444c72290e8acdb1ea6a99e61cc36
Retorna las llaves de acceso del hash
[ { "docid": "554ea4879d8e6f79a93a0dc1eecba2b7", "score": "0.0", "text": "def keys\n @vector.keys\n end", "title": "" } ]
[ { "docid": "f6d9bc9bb7108b3087c36761273d0d74", "score": "0.5848885", "text": "def hash\n [dns, download, first_byte, handshake, redirect, ssl, tcp, total, wait].hash\n end", "title": "" }, { "docid": "e27da4acff8b4d32e8d54ec49d1c347b", "score": "0.5702002", "text": "def keys\...
9eb298630afb719950f6bdfbaff2a886
Destroy this object with the might of 60 jotun!
[ { "docid": "24eec449213076cdae14d924678e6f73", "score": "0.0", "text": "def destroy\n self.class.destroy(id)\n end", "title": "" } ]
[ { "docid": "0fcdec9fe564ad17fd16909d11a7b43a", "score": "0.66773343", "text": "def destroy!\n (rand(3) + 5).times { Explosion.new(@x + rand(BoomOffset * 2) - BoomOffset, @y + rand(BoomOffset * 2) - BoomOffset) }\n kill!\n end", "title": "" }, { "docid": "0fcdec9fe564ad17fd16909d11a7b4...
8afb9d7a31b611869cf68ad4e1f3f660
GET /knack_categories/1 GET /knack_categories/1.json
[ { "docid": "16fbca7b632045d1e04d02a1c05815e3", "score": "0.7012085", "text": "def show\n @knack_category = KnackCategory.find(params[:id])\n @knacks = @knack_category.knacks.order( \"status desc, date desc\" )\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { re...
[ { "docid": "3cba43678b445865af5afd71d9719de9", "score": "0.7976802", "text": "def get_categories()\n response = RestClient.get @host + \"/categories\", { :accept => :json }\n return JSON.parse(response.body)\n end", "title": "" }, { "docid": "efcb5e10780279c84a4be599091f0268", "sc...
5662cfabc17d1efa82095cf2a85b51d2
Singleton access to mx_l7_application_categories controller.
[ { "docid": "19898fce1c73bdecdc0280493a16f03c", "score": "0.86693144", "text": "def mx_l7_application_categories\r\n MXL7ApplicationCategoriesController.instance\r\n end", "title": "" } ]
[ { "docid": "1a67de5a276a6fd5d7a956907ab2caea", "score": "0.6607561", "text": "def mobile_app_categories\n return @mobile_app_categories\n end", "title": "" }, { "docid": "b30dbfacaa41a117badfad7abed142e4", "score": "0.65852183", "text": "def index\n @sys_...
93ff33e82a08d71a5469626eaf55f7ff
Scaffold methods called from within template
[ { "docid": "9ec1bfe3b9d1953869c9cfae4f8daa04", "score": "0.0", "text": "def policy_class_name\n \"#{model.name.as_constant}Policy\"\n end", "title": "" } ]
[ { "docid": "5819c9e5aab37b53887735937b6434c4", "score": "0.76325464", "text": "def scaffold\n end", "title": "" }, { "docid": "18362da27fb3966ac2a80ac45e32ec42", "score": "0.69444275", "text": "def views; end", "title": "" }, { "docid": "18362da27fb3966ac2a80ac45e32ec42"...
af647e3431f01468b52df6150e598ab4
Player class should be instantiated with a hash that has :name and :mark keys and will raise exceptoin if the required keys are missing
[ { "docid": "c67f047b7c588a739cc9b0030913954a", "score": "0.54311067", "text": "def initialize(input)\n @mark = input.fetch(:mark)\n @name = input.fetch(:name)\n end", "title": "" } ]
[ { "docid": "b1cca7c978d601a475eb172aaea2e31e", "score": "0.6507434", "text": "def initialize(name = \"Player\" , marker) \n @name = name\n @marker = marker\n end", "title": "" }, { "docid": "6ba6484cdd1b3ab92553210300a685d9", "score": "0.6056753", "text": "def initia...
a1d4c4032b5d7c0f21d844747162f3d9
Returns a new ChangeNotify object and places a monitor on +path+. The +path+ argument may be a file or a directory. If +recursive is true and +path+ is a directory, then the monitor applies to all subdirectories of +path+. The +filter+ tells the monitor what to watch for, such as file changes, attribute changes, etc. I...
[ { "docid": "2f802486392dfc32b1663616053f7bd9", "score": "0.54693514", "text": "def initialize(path, recursive, filter, event=nil)\n @path = path\n @recursive = recursive\n @filter = filter\n @overlap = 0.chr * 20 # OVERLAPPED struct\n\n # Because Win32AP...
[ { "docid": "539bdc5cfa490d84aafbb49015dce573", "score": "0.5044757", "text": "def run(&block)\n watch_recursive @project_dir\n\n while true\n if IO.select([@notifier.to_io], [], [], @frequency)\n @notifier.process\n elsif @events.size > 0\n if block_given?\n yield ...
1cf7eede9fec0d321ff54033b0a9c8d8
DELETE /invitaciones/1 DELETE /invitaciones/1.xml
[ { "docid": "43005f09ba60b6ed132c2d4ec0e6e345", "score": "0.7436802", "text": "def destroy\n @invitacion = Invitacion.find(params[:id])\n @invitacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(invitaciones_url) }\n format.xml { head :ok }\n end\n end", "tit...
[ { "docid": "c705ad045ef7cc340bf9b48842b46d03", "score": "0.69644105", "text": "def destroy\n invoice_id = params[:invoice_id]\n Invoiceitem.destroy_all(:invoice_id => invoice_id)\n @invoice = Invoice.find(invoice_id)\n respond_to do |format|\n format.html { redirect_to(invoice_path(@inv...
3a85073c2526ebb42f54d7c8f7b72ee5
Number of completed steps or nil if list is not open
[ { "docid": "3d38e04d90208e7e341081032b1df6dc", "score": "0.7156773", "text": "def completed\n completed_steps && completed_steps.length\n end", "title": "" } ]
[ { "docid": "c4f3e3e78a9907f284d581dad16ba632", "score": "0.6818392", "text": "def completed_quest_number; completed_quests.size; end", "title": "" }, { "docid": "43dbe87e9a5d3d0af9f09f68b1a0e92e", "score": "0.6786424", "text": "def nofDoneInCycle()\n return @doneInCycleList.size...
e8663c365859fa8f5e63e38059a2c806
Check if outputing to shell
[ { "docid": "7b11d2609bde79517726d5474d707044", "score": "0.6815939", "text": "def tty?\n stdout.tty?\n end", "title": "" } ]
[ { "docid": "205452c33874e39873f8819ea080bcc4", "score": "0.77594894", "text": "def shell_ok?(command)\n # Using Open3 instead of `` or system(\"cmd\") in order to hide stderr output\n sout, status = Open3.capture2e command\n return status.to_i == 0\n rescue\n return false\n end...
5c4e7a77a1842c1f13be337acc338fc6
Returns a collection of Site admins, challenge evaluators and challenge admins
[ { "docid": "3d6c4e4b2da84e40a0845a0925460a96", "score": "0.59945494", "text": "def guest_lead_dxusers\n User.site_admins.\n or(User.challenge_admins).\n or(User.challenge_evaluators).\n order(:dxuser).distinct.pluck(:dxuser)\n end", "title": "" } ]
[ { "docid": "3dd7ca0e0040d7d8e9fac5af9a8570cc", "score": "0.71780044", "text": "def index\n @site_admins = SiteAdmin.all\n end", "title": "" }, { "docid": "c427476835e6c54a739dd03ef9a56456", "score": "0.7064868", "text": "def admins\n app_users.select(&:admin?)\n end", ...
48b1f023e557be828c168ad258984703
Used in discuss only.
[ { "docid": "7b03479ada43ff87d83eb34fea7e6a0f", "score": "0.0", "text": "def search_content\n space = Space.find(unsafe_params[:id])\n results = space.search_content(unsafe_params[:content_type], unsafe_params[:query])\n render json: results\n end", "title": "" } ]
[ { "docid": "b7567a2a68cade31f2360723a4c42dc7", "score": "0.6994874", "text": "def used_by; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.6851591", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", ...
bd8711c84e60bc8fea9978c9a617678b
TODO Any reason not to change this to last name, first name?
[ { "docid": "21035a7b222b436d23788aaf76035f56", "score": "0.0", "text": "def <=>(other)\n if other\n id <=> other.id\n else\n -1\n end\n end", "title": "" } ]
[ { "docid": "c5999cd094fe3af2b42a803c3d262ee9", "score": "0.8155301", "text": "def first_and_last_name\n \"#{self.lName} \" \" #{self.fName} \" \" #{self.patronymic}\"\n end", "title": "" }, { "docid": "cfbab808ad528e3a8aa89e8a0d82fd27", "score": "0.8082844", "text": "def firstnam...
58673ec821708a98726b042f4b89dd4a
haal de probabiliteitsdistributie voor groepen van
[ { "docid": "fc86231922285dd884e0f4b416f5082f", "score": "0.0", "text": "def initialize(stap=5,aantal=34)\n @stap = stap\n @monte_carlos = []\n aantal.times do |x|\n van = x*stap\n tot = (x+1)*stap-1\n @monte_carlos[tot] = MonteCarlo.from_db(van,tot)\n end\n end", "title":...
[ { "docid": "a109d40e61eddab77a4cd8ccc5e2b041", "score": "0.66280544", "text": "def crearProbabilidad\n @probabilidad.clear\n sumaFitness = @fitness.inject {|sum,x| sum+=x }\n @fitness.each do |fitnes|\n @probabilidad << fitnes / sumaFitness\n end\n index=1\n @qsubm.c...
bc36726a995065e77e0270626789f1e9
DELETE /setbreaks/1 DELETE /setbreaks/1.json
[ { "docid": "3428f0668aa3a67daf6a58fada6dd085", "score": "0.5931671", "text": "def destroy\n @setbreak.destroy\n respond_to do |format|\n format.html { redirect_to controller: :playlist, action: :index }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "2211ade05bb1f35e4860ee364ae3e5fa", "score": "0.6407492", "text": "def destroy\n @req_breakdown = ReqBreakdown.find(params[:id])\n @req_breakdown.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_req_breakdowns_url) }\n format.xml { head :ok }\n end\n...
96880759bd53d6897f81e98682c903f0
'dock' used to store a bike
[ { "docid": "ecd6227017ced9f33c8be464db0ca9f5", "score": "0.6556323", "text": "def dock(bike)\n @bike = bike\n end", "title": "" } ]
[ { "docid": "adb869a6dfc4cabea3881f6bee4d3791", "score": "0.67328364", "text": "def dock(bike)\n raise \"Docking station full\" if full?\n\n \t# creates an instance variable that stores the variable bike (instance of bike)\n \tstored_bikes << bike\n end", "title": "" }, { "docid": "fbbf...
04ff8b9cd1469a33d5c380dac689bf6a
POST /teams/1/add_jersey_to_player possible params: player_id jersey
[ { "docid": "9c2ba55209d3a0860b694ffc04e78393", "score": "0.81566787", "text": "def add_jersey_to_player\n @team.assign_jersey(@player, @jersey)\n\n redirect_to team_path(@team)\n end", "title": "" } ]
[ { "docid": "c56d658cdb1a64f2172c5fe7b4d56ace", "score": "0.82497174", "text": "def add_player\n @team.add_player(@player, @jersey)\n\n redirect_to team_path(@team)\n end", "title": "" }, { "docid": "2e2e9e31825e4251b5ad076d00e89bdf", "score": "0.68806356", "text": "def create\...
cea62f032a202dd749cbd25334840ec7
DELETE /over_tags/1 DELETE /over_tags/1.json
[ { "docid": "f6b5d99f5aafe3f927137ec56b5c85a3", "score": "0.7299258", "text": "def destroy\n @over_tag.destroy\n respond_to do |format|\n format.html { redirect_to over_tags_url, notice: 'Over tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "tit...
[ { "docid": "d67c29208071bc07677edfe1b1e5ef52", "score": "0.7634441", "text": "def tagDelete(tag)\n http, req = initReq(\"tags/#{tag}\", \"DELETE\")\n http.request(req).body\nend", "title": "" }, { "docid": "d67c29208071bc07677edfe1b1e5ef52", "score": "0.7634441", "text": "def tagDe...
530252fe54d0656b7ade7a80fe95aed0
Calculate number of full nodes (nodes with all cores free) available that contain one or more GPUs available
[ { "docid": "359ad863474b3b489bb460a311837d8b", "score": "0.8255435", "text": "def calc_full_nodes_avail\n @full_nodes_available = 0\n #if @cluster_title.eql?(\"Ruby\")\n # # See line 62\n #@full_nodes_available = nodes_info.lines(\"\\n\\n\").select { |node| node.include?(\"dedicated_threads...
[ { "docid": "07e2e8eb9573e76c1caa8ec7d9298575", "score": "0.79324883", "text": "def calc_total_gpus\n @total_gpus = 0\n #if @cluster_title.eql?(\"Ruby\")\n # # For the Ruby cluster, pbsnodes takes into account two debug nodes with two GPUs along with the other Ruby GPU nodes. The debug nodes w...
04a90b04bb1bb66c0aad7ae5605caae9
POST /escalation_levels POST /escalation_levels.json
[ { "docid": "9295cad18e120b91459321062b504b34", "score": "0.6876609", "text": "def create\n @escalation_level = EscalationLevel.new(escalation_level_params)\n authorize! :create, @escalation_level\n \n respond_to do |format|\n if @escalation_level.save\n format.html { redi...
[ { "docid": "1cea7ec16a8726aab3ff13d9b857789a", "score": "0.6815601", "text": "def escalation_level_params\n params.require(:escalation_level).permit(:name)\n end", "title": "" }, { "docid": "8d78a71e02f4fb2595dbbbe770e2d32b", "score": "0.61455643", "text": "def set_escalation...
a4f6ab0d2e1f048fa6ebab557d213d37
Renders the date and time in a given format for the current user's time zone. The default time zone is whatever is set in the environment.rb (i.e. UTC) when the current user cannot be determined. See /config/initializers/date_time.rb for predefined formats. ==== Parameters +date_time+ The datetime object to be formatte...
[ { "docid": "777522ba03a830a2877397df08220fa0", "score": "0.7497362", "text": "def render_current_user_date_time date_time, format = :default\n date_time.in_time_zone(current_user.time_zone).to_s(format) if date_time && current_user\n end", "title": "" } ]
[ { "docid": "0b0a4140fb9cfbecc941154dd4253865", "score": "0.69951826", "text": "def current_user_date_time(date_time)\n return unless date_time\n\n Formatter::TimeWithZone.format date_time, nil, current_user: current_user\n end", "title": "" }, { "docid": "f1ce2893e32e9486fa874d9affe87...
d41e7133d73ffcc77fc6ff7316de1e3b
TODO: more thorough checking?
[ { "docid": "ddf74c0c5c8e92b29b39f78933da812a", "score": "0.0", "text": "def ensure_datetime(date)\n return date if date.is_a? DateTime\n\n # rubocop:disable Style/GuardClause, Style/DateTime\n if date.is_a? String\n month, day, year = date.split(%r{[/-]}).map(&:to_i)\n DateTime.new(ye...
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.661194", "text": "def desired; end", "title": "" }, { "docid": "5928f8efe9c6c2d408ea21a4cdce83ad", "score": "0.6505642", "text": "def preliminary?; end", "title": "" }, { "docid": "58e2e07d11b107b6864a328f2187e248...
b160093055d511cbe573fc0be4a2eb4d
DELETE /monkeys/1 DELETE /monkeys/1.json
[ { "docid": "6e64badbc9fbf06fa98a95d54e94e41a", "score": "0.6560608", "text": "def destroy\n @monkey = Monkey.find(params[:id])\n @monkey.destroy\n\n respond_to do |format|\n format.html { redirect_to monkeys_url }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.64879316", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "b99047274b288eda2713d05d2c1732a1", "score": "0.64389086", "text": "def delete(key)\n timeout_retry(3, 3){\n write \...
54bae55bbe44723e306a5092db80b473
Converts the first character in the string to lowercase. downcase_first('If they enjoyed The Matrix') => "if they enjoyed The Matrix" downcase_first('I') => "i" downcase_first('') => ""
[ { "docid": "719a5162625ed02aef15348e1f13a0be", "score": "0.8347486", "text": "def downcase_first(string)\n string.length > 0 ? string[0].downcase.concat(string[1..-1]) : \"\"\n end", "title": "" } ]
[ { "docid": "21e12c4f06dcf43a5da6475c2ddd5d90", "score": "0.83119154", "text": "def downcase_first\n letters = split('')\n letters.first.downcase!\n letters.join\n end", "title": "" }, { "docid": "4da8d401ded75e0b856c357f21fc2846", "score": "0.8091105", "text":...
64632528207ba7236945f3b3833ac364
SQL to start a new savepoint
[ { "docid": "3a7ec0c3ec52b707263ac7d2dc95125c", "score": "0.5975011", "text": "def begin_savepoint_sql(depth)\n SQL_SAVEPOINT % depth\n end", "title": "" } ]
[ { "docid": "94369f11007f1179e5e2d22ddf8e9fd8", "score": "0.769998", "text": "def create_savepoint\n @connection.save\n execute(\"SAVEPOINT #{current_savepoint_name}\")\n end", "title": "" }, { "docid": "df38919ed09a5d0376d6729b2509c431", "score": "0.7202299", "text...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0fe7c19ac44eae94361e9be7de96623a", "score": "0.0", "text": "def vote_params\n params.require(:vote).permit(:hold_date, :presenter, :score, :comment)\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...
1952d6df3049495c0d834d2386348560
POST /calendars or /calendars.json
[ { "docid": "529da68f1426bffb61b0415d25b09a3e", "score": "0.70419997", "text": "def create\n @calendar = Calendar.new(calendar_params)\n\n respond_to do |format|\n if @calendar.save\n format.html { redirect_to @calendar, notice: 'Calendar was successfully created.' }\n format.jso...
[ { "docid": "378d72d8962a99e5c9d7bc7d9b33722f", "score": "0.74203604", "text": "def create\n @calendar = Calendar.new(calendar_params)\n\n respond_to do |format|\n if @calendar.save\n format.json { head :created }\n else\n format.json { head :unprocessable_entity }\n en...
5a0a2745a64fd1ab15fa6c7e7a7fa688
My old convention was '1' for true, "" for false; the new form helpers send '1' for true and '0' for false.
[ { "docid": "1d4c222cf1cf5213dd9768c9f0ec8928", "score": "0.0", "text": "def mybool(value) #:nodoc:\n return false if value.blank?\n return false if value.is_a?(String) and value == \"0\"\n return false if value.is_a?(Numeric) and value == 0\n return true\n end", "title": "" } ]
[ { "docid": "32c06d446900590564ab4173992542a3", "score": "0.7211712", "text": "def form_to_boolean(value)\n return value == '1' if value.is_a? String\n !!value\n end", "title": "" }, { "docid": "8e7ad04a158df6b52df72618f115bb76", "score": "0.7145758", "text": "def human_b...
2681c81245ae0325cfa0fd8b19b27f51
GET /manage/payments GET /manage/payments.json
[ { "docid": "c74874e0245f547fff193c2173ef9bef", "score": "0.0", "text": "def index\n if current_user.role?(:admin) && params[:admin] == \"true\"\n @title = \"平台提现管理\"\n @payments = Payment.order(\"updated_at DESC\").page(params[:page])\n else\n @title = \"提现明细\"\n @payments = cu...
[ { "docid": "64465651022d07dfe82005c89d193e8c", "score": "0.7582585", "text": "def get_payments\n response = self.class.get('/payments', headers: authorization_header)\n response.parsed_response['payments']\n end", "title": "" }, { "docid": "481c9fcb4cd29ebd951992aa1c6d11ed", ...
c3ade6723ca35f196262e0c4cd5fca41
Returns an array of installed rubies.
[ { "docid": "96dea7415ae35835b0c5f49bda2c3313", "score": "0.5944517", "text": "def rubies\n @parent.list_strings\n end", "title": "" } ]
[ { "docid": "b0080655f1ec0a19bf017214f136baa8", "score": "0.65145177", "text": "def supported_rubies\n @supported_rubies ||= supported_mri_rubies + jrubies\n end", "title": "" }, { "docid": "f19fa747343a3d99b474a4b7beb900fe", "score": "0.6458473", "text": "def recent_rubies\n @...
47d853165f96ddc84d7e8acd228444c0
Retrieves the Transition based on the Issue Key and Transition ID [Arguments] :key (required) issue key :id (required) transition id
[ { "docid": "877ea9f9ae0915e386d6b58859bb0433", "score": "0.7736116", "text": "def find_by_key_and_id(key, id)\n issueKey_test(key)\n response = fetch({:parent => parent_name, :parent_key => key, :body => {\"transitionId\" => id}, :body_to_params => true })\n response.parsed_re...
[ { "docid": "5475c896b7fdddbb81d14aadc10ee956", "score": "0.81235963", "text": "def get(key)\n Jiralicious::Issue::Transitions.find(key)\n end", "title": "" }, { "docid": "45a6737fe00786434348d3f0c2e03026", "score": "0.7636984", "text": "def transitionsFor(key)\n ...
576509eb3fad91524bfca7b3cf33888e
POST /commodities POST /commodities.json
[ { "docid": "fc3ca020a2a3f74613ea7a03e52df72f", "score": "0.61792195", "text": "def create\n @commodity = Commodity.new(commodity_params) \n @commodity.created_by = current_user.id\n respond_to do |format|\n if @commodity.save\n format.html { redirect_to @commodity, notice: 'Commo...
[ { "docid": "bb8ddac5640cd520694f5a65880045bf", "score": "0.6726653", "text": "def commodity_params\n params.require(:commodity).permit(:title, :user_id, :status, :commodity_number, :orders_count, :comments_count)\n end", "title": "" }, { "docid": "53cab50c767ecf46085db813783b11c3", ...
025eda1b2fdc7c4690f2fb9dd34dc1c5
DELETE /drawer_conteiner_incomes/1 DELETE /drawer_conteiner_incomes/1.json
[ { "docid": "d57ce717103c274b5a17aeb4d4738c9d", "score": "0.7943514", "text": "def destroy\n @drawer_conteiner_income.destroy\n respond_to do |format|\n format.html { redirect_to drawer_conteiner_incomes_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "4db31711dcc6d7983c9ba5a070d33098", "score": "0.71942604", "text": "def destroy\n @income = Income.find(params[:id])\n @income.destroy\n\n respond_to do |format|\n format.html { redirect_to incomes_url }\n format.json { head :no_content }\n end\n end", "title": "" ...
fe31bc6640f0054f2d3e9e48aa392da5
Checks whether this case statement has an `else` branch.
[ { "docid": "2b897d634556ce740234f0aa12c2ac4f", "score": "0.72817385", "text": "def else?\n !loc.else.nil?\n end", "title": "" } ]
[ { "docid": "2572a5c22fae23e7c29ea1c60c74c81e", "score": "0.7920566", "text": "def else_branch?\n !node.else.kind_of?(Rubinius::AST::NilLiteral)\n end", "title": "" }, { "docid": "c7c9099e9ec2e56176abae787ee7bec7", "score": "0.7403805", "text": "def empty_case_statement?(n...
630f7f0b8ff472c7369c2fc0b3b23c0e
level 2 alert profiles
[ { "docid": "21b12fbf0cbe2348fcbaed78480dd234", "score": "0.0", "text": "def x_get_tree_custom_kids(parent, count_only, options)\n assert_type(options[:type], :alert_profile)\n\n objects = MiqAlertSet.where(:mode => parent[:id].split('-'))\n\n count_only_or_objects(count_only, objects, :descript...
[ { "docid": "588fc4c6b7b7a05fbd92ef17a0a3c68c", "score": "0.60120994", "text": "def alert_profile_get_info(alert_profile)\n @record = @alert_profile = alert_profile\n aa = @alert_profile.get_assigned_tos\n @alert_profile_tag = Classification.find(aa[:tags].first.first.parent_id) unless aa[:tags]...
c677e2ccb36ab955c74a7bce3764b9f6
POST /people POST /people.json
[ { "docid": "d530f6d60f147f8ccce399f9f99f8503", "score": "0.0", "text": "def create\n @person = Person.new(person_params)\n @agreement = Agreement.last\n @person.skip_validation = false\n respond_to do |format|\n if @person.save\n @person.agreements << Agreement.last\n if c...
[ { "docid": "b15085b8ebe0f929720fc799ccb1766b", "score": "0.67881876", "text": "def create\n @person = current_user.created_people.new(person_params_with_school)\n if @person.save\n render :show, status: :created, location: api_v1_person_url(@person)\n else\n render json: @person.error...
153c3de7c5920a14b42db956db82af11
Create a new ReleaseData object with a semver (XSemVer::SemVer instance) and a list of artifacts
[ { "docid": "e978c0ad95aa78d1e9a4a7d17433fc7d", "score": "0.74240464", "text": "def initialize semver, artifacts\n raise ArgumentError, 'missing \"semver\" argument' unless semver\n raise ArgumentError, 'missing \"artifacts\" argument' unless artifacts\n raise ArgumentError, '\"artif...
[ { "docid": "f2a3e1e5318a26a5a26e231f7e4b6728", "score": "0.61579275", "text": "def initialize(release_name,\n data_dir: nil,\n spec_file: nil,\n spec_data: nil,\n arch: nil,\n ws: Autoproj.workspace)\n @rele...
0c11669b07fca9d9fd8a2a63ab44ef5a
DELETE /item_sp_resource_invs/1 DELETE /item_sp_resource_invs/1.json
[ { "docid": "dcd408f0f4899b20f560f555b2a54852", "score": "0.7976812", "text": "def destroy\n @item_sp_resource_inv = ItemSpResourceInv.find(params[:id])\n @item_sp_resource_inv.destroy\n\n respond_to do |format|\n format.html { redirect_to item_sp_resource_invs_url }\n format.json { he...
[ { "docid": "ac15c32c1fa6a910c298192a2135b9a5", "score": "0.7369601", "text": "def destroy\n @resource_item = ResourceItem.find(params[:id])\n @resource_item.destroy\n\n respond_to do |format|\n format.html { redirect_to resource_items_url }\n format.json { head :no_content }\n end\...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "a2711dc32468f164ab0b270ef4623ae2", "score": "0.0", "text": "def redeemed_voucher_params\n params.require(:redeemed_voucher).permit(:user_id, :voucher_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
d60f07ffebe1d997cc5bacc13d3bea99
GET /medicine_histories/1 GET /medicine_histories/1.json
[ { "docid": "793d0570fc6a0492e9ec7bbe4afb4b89", "score": "0.72066313", "text": "def show\n @medicine_history = MedicineHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medicine_history }\n end\n end", "title": "" } ...
[ { "docid": "8781c9b3121b0cae67ff5efeb9964bc1", "score": "0.7299959", "text": "def index\n @medicalhistories = Medicalhistory.all\n end", "title": "" }, { "docid": "ebfc1ad2b9685a5e395934374c38668a", "score": "0.7080224", "text": "def index\n\t\t@medical_histories = MedicalHistory...
3f3ad490a13bcd7d0a88453d32caf6ec
gets the most popular trends by occurrence
[ { "docid": "31f159b0c22daf9191bb6352a8ba24d9", "score": "0.6595628", "text": "def get_top_trends\n trend_info = TrendDatum.find_by_sql(\n [\n 'select locations.name as city, locations.country as country,\n trends.name as name, count(trend_data.trend_id) as value_occurrence from tre...
[ { "docid": "dad46e0ae0c7442ba0d35e537f139f99", "score": "0.6087611", "text": "def find_most_popular(dimension = nil)\n all.sort_by { |o| o.rate_average(true, dimension) }.last\n end", "title": "" }, { "docid": "e57fc2923337603c720f0c614fdbd251", "score": "0.60317075", "text":...
310002149d271343b5ae7b3a4fd5d56a
===================== Complex validations: =====================
[ { "docid": "717c7fd7c88a807bbd4e56451149c3a1", "score": "0.0", "text": "def validate \n#\tfirst check whether combo fields have been selected\n\t is_valid = true\n\t if is_valid\n\t\t is_valid = ModelHelper::Validations.validate_combos([{:standard_size_count_value => self.standard_size_count_value}],sel...
[ { "docid": "dfc1c45c91fbba6f8ead648d3a33315a", "score": "0.74459374", "text": "def validate\n validate_value(self.value)\n validate_mandatory\n validate_unique\n\n errors.empty?\n end", "title": "" }, { "docid": "9868c6a73b0c5ca8c2b7d230d58eb204", "score": "0.7388451", "...
fb88ee6b57defd6b0ffa8d5c14b47478
Watch and reload files.
[ { "docid": "c8835c2ef894cafe16a14f4b29ceba7c", "score": "0.6529157", "text": "def watch *paths\n paths.each{|path| watcher.paths << path unless watcher.paths.include? path}\n watcher.start\n end", "title": "" } ]
[ { "docid": "99b9a307bcb1b5c8d928c82e24cbe740", "score": "0.7868133", "text": "def start_watch_files\n watched_files.each do |file|\n @notifier.watch(file, :modify) do\n Js2coffee.watch_file(file)\n end\n end\n end", "title": "" }, { "docid": "5c328310aca77...
eb27fd75892ca9bcf91983c3bf92db5b
If we are doing discovery based on a central tuplespace
[ { "docid": "ef245b9ef72735644bb903e64ab97586", "score": "0.80496293", "text": "def central_discovery?; !!@discovery_tuplespace end", "title": "" } ]
[ { "docid": "81025efc10fd7495a2d80b11f1f1ba20", "score": "0.56644845", "text": "def check_for_tuple(tuple)\n if @sourcce\n # should check if +tuple+ has the same size as description\n if @result_map\n # need to expand\n unless @expand_map\n @expand_map = @s...
e3d316a1a69e3ffa60e5240cc97af8d2
Find the entity attributes by name.
[ { "docid": "6da2bdab3783ed2dc03f3ddca0848104", "score": "0.0", "text": "def find(name)\n storage.fetch(name) { not_found(name) }\n end", "title": "" } ]
[ { "docid": "f90652970ef1173a87ac30e749b77dc9", "score": "0.7571359", "text": "def find_attribute_named(name)\n @attributes.find { |m| m.name == name }\n end", "title": "" }, { "docid": "37ff88e49aba9f5bc1a3c4013c598446", "score": "0.6999628", "text": "def with(name)\r\n ...
36e9731d094e0acb0ceb5175b737ca7c
Transmit the quote to registered listeners.
[ { "docid": "41662abe56430b3598ff4aed64de680b", "score": "0.6076859", "text": "def transmitQuote(sym, ob)\n transmit(:quote, sym.to_sym, ob)\n end", "title": "" } ]
[ { "docid": "9f66b330d4632b7d3f98c0a7791fc3c7", "score": "0.6196423", "text": "def quote_received(quote)\n @quote = quote\n\n mail to: quote.email, :subject => \"Your Quote Received\"\n end", "title": "" }, { "docid": "e6d23cb292cc9fc2a52439f676111a6e", "score": "0.6081592", "t...
974d283a826ac1ca127999076f0b2697
Returns a deep copy of the given options object.
[ { "docid": "d61bff04c7581975a4002f8e1b62ee32", "score": "0.0", "text": "def dup_opts map\n newmap = map.dup\n for key, elem in newmap\n newmap[key] = elem.dup\n end\n return newmap\n end", "title": "" } ]
[ { "docid": "2fd1432ccb7a9b804e5510e2422f7fb4", "score": "0.8204661", "text": "def clone_options\n dup\n end", "title": "" }, { "docid": "5b39967f2f5c971a4c4f1f8adbd656a6", "score": "0.78909737", "text": "def options\n @options.dup\n end", "title": "" }, { ...
5f1149fdac3bc886dbb10975f0cfa2cb
GET /businesses/1 GET /businesses/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "8c43d3faa277b2f216892828997a347a", "score": "0.7620147", "text": "def index\n @businesses = Business.all\n render json: @businesses\n end", "title": "" }, { "docid": "a7627a831205add50fbdd8ab2a57efa9", "score": "0.74124056", "text": "def index\n @businesses = Bu...
9f2d2126216577af1aaa11ae26b3820d
metodo que adiciona um caso de teste, recebe um parametro do usuario, e colcoa no array
[ { "docid": "4e50acd0b651fbf95a895ce97fbcefea", "score": "0.0", "text": "def adiciona_ct\n system('clear')\n puts 'Informe um cenário de teste:'\n nome = STDIN.gets\n @cts.push(nome)\nend", "title": "" } ]
[ { "docid": "7a0f8dd278be398df1045dc267e92429", "score": "0.6288612", "text": "def teste_sets_e_gets_user\n\t\tuser = Usuario.new(1,\"09309261960\",\"Carlos Eduardo Cuzik\")\n\t\tuser.cpf = \"09209361970\"\n\t\tuser.nome = \"Carlos E. Cuzik\"\n\t\tassert_equal(\"09209361970\",user.cpf)\n\t\tassert_equal(...
65e2ea2f9a7a353573e760974ee33567
TODO Active and upcoming reviews
[ { "docid": "9d94b15236789515731f1d7e6e774295", "score": "0.6411878", "text": "def list\n @reviews = current_user.organization.reviews\n end", "title": "" } ]
[ { "docid": "346bced07b4e691edf83f4ebac356016", "score": "0.7176862", "text": "def get_initial_reviews\n\n\t\t# return api call for just one review\n\tend", "title": "" }, { "docid": "a50cab5351863d3cda1f4f41d5672671", "score": "0.714941", "text": "def review\n end", "title": "" ...
47f55e957b6b50bb3a0663b669017f47
Sorting behavior for studies
[ { "docid": "ecbab82736a7bf1eb0d1b57f37e0f301", "score": "0.700002", "text": "def order\n order = sortable_column_order do |column, direction|\n case column\n when \"name\"\n \"LOWER(studies.name) #{direction}\"\n when \"active\", \"public\", \"promoted\"\n \"studi...
[ { "docid": "3a19ceba7cdcb752bb2cba11e625d9c2", "score": "0.7074818", "text": "def sort_by\n end", "title": "" }, { "docid": "77f7d0e9c0de6dc934c0adc52864a665", "score": "0.704429", "text": "def secondary_sort\n # This function is empty as it's a placeholder for custom code...\n ...
edc08f5f4d9217f22a0fc38f57df4480
GET /destinies/1 GET /destinies/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "c2cfae39aeffde72d2dae8f9fb1e633d", "score": "0.6759688", "text": "def index\n @destinies = Destiny.all\n end", "title": "" }, { "docid": "b18a6f50cde8014128df56d75fac9a48", "score": "0.64029735", "text": "def index\n @destinations = Destination.all\n render json...
e7006eb6cf16c8e2cf0a9433ffa0f20e
GET /ncaa_players GET /ncaa_players.xml
[ { "docid": "1fb69505c74f12a87083e4709da39255", "score": "0.65547407", "text": "def index\n @ncaa_players = NcaaPlayer.joins('join ncaa_teams nt on nt.id = ncaa_players.ncaa_team_id').order('nt.school asc, ncaa_players.position desc') \n \n respond_to do |format|\n \tformat.html # index.ht...
[ { "docid": "a3f62fc49fa4dbb7cffe6b5539eb79d9", "score": "0.7176937", "text": "def show\n @ncaa_player = NcaaPlayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ncaa_player }\n end\n end", "title": "" }, { "doci...
b6c8e6078b8084a395a278b69e8c9be6
Returns the currently logged in admin or nil if there isn't one
[ { "docid": "c4b04f45b338432706d0329534a2c739", "score": "0.8499397", "text": "def current_admin\n return unless session[:admin_id]\n @current_admin ||= AdminLogin.find_by_id(session[:adminr_id]) \n end", "title": "" } ]
[ { "docid": "c95fd2044907c82e3e333cc05d32b944", "score": "0.85741174", "text": "def current_admin\n @current_admin ||= Admin.where(id: session[:login_id]).first if session[:login_id]\n end", "title": "" }, { "docid": "31149002066b22b71af30494ff64b097", "score": "0.8461552", "t...