query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
815296a70289e10e41a80146f036c506
RSpec.configure do |config| end
[ { "docid": "5d3c9b126f51658852cba70cbb339c63", "score": "0.0", "text": "def silence_warnings\r\n old_verbose, $VERBOSE = $VERBOSE, nil\r\n yield\r\nensure\r\n $VERBOSE = old_verbose\r\nend", "title": "" } ]
[ { "docid": "6482752da7ac019a38b529000830e221", "score": "0.76853144", "text": "def configure_rspec_metadata!; end", "title": "" }, { "docid": "adbfdc9f43bde6e2d37ba07928b011d4", "score": "0.6821439", "text": "def before_each_test\nend", "title": "" }, { "docid": "9204aa04...
1ee26e05259e1f5455c52c7c59af0e49
Returns the most common class value in the dataset.
[ { "docid": "1acbc99d044b7da6d5f0878abd3d294e", "score": "0.8611467", "text": "def most_common_value\n class_var = @tree.class_var\n class_values = @tree.dataset.column_values(class_var)\n count = class_values.each.with_object({}) do |val, o|\n o[val] = 0\n ...
[ { "docid": "e70453fb02199ac492cf32964df4ecfb", "score": "0.6508759", "text": "def determine_highest_single(array)\n return if array.blank?\n value = -1\n highest = ''\n array.each do |cl|\n if CLASSIFICATIONS.index(cl) > value\n value = CLASSIFICATIONS.index(cl)\n ...
b88916e11116bcbda07b8b9ea150fe61
Only render the table if the user has VIEW_RETURNS
[ { "docid": "0a5116ba9063279b2a5155e1505d4a19", "score": "0.6424064", "text": "def render?\n return true if can?(RS::AuthorisationHelper::VIEW_RETURNS)\n\n false\n end", "title": "" } ]
[ { "docid": "fb8b0563d9b715999afe547f10bf5fa2", "score": "0.5875767", "text": "def control_table\n @paying_date = ScholarshipMonth.current.starts_on\n @indices = Index.find_with_scholarship(@user)\n @show_table_message = 1\n @bad_indices = @indices.select(&:bad_index?)\n render(:action => ...
e6437889974e9c9727beff23a7c6bc97
Below method sorts by last name, descending
[ { "docid": "6920a0ba43a19039408fef74d3d354ee", "score": "0.73240674", "text": "def sort_by_last_name\n sorted = final_array.sort_by {|k,v| k[:last_name] }\n hash_values = sorted.map {|element| element.values}.reverse\n with_line_breaks = add_line_breaks(hash_values)\n with_line_breaks.unshift(\"Outp...
[ { "docid": "8643aade42b884e8bb1684d6af9351f6", "score": "0.74077016", "text": "def sort_reindeer reindeer_names\n reindeer_names.sort_by{|string| string.split(\" \").last}\nend", "title": "" }, { "docid": "587c6961100882b16a05d253014c3c1a", "score": "0.72289515", "text": "def sort_n...
e46719300102d9807161b93542dfd1b2
CNK having trouble getting the CanCan permissions working authorize_resource :ride, :through => :event GET /events/1/rides GET /events/1/rides.json
[ { "docid": "36579ee99ea07bb4afe9ce564a30b0d0", "score": "0.5640044", "text": "def index\n @rides = @event.rides\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rides }\n end\n end", "title": "" } ]
[ { "docid": "358f693a4621f01101116fde93b56bfd", "score": "0.70795536", "text": "def find_ride\n @ride = @car.rides.find(params[:id])\n authorize @ride\n end", "title": "" }, { "docid": "75a2561e145217d58580ef87ff06ccd8", "score": "0.6688438", "text": "def show\n authorize! :...
fcb9951158f976f2b4aa66a91ba81e86
Get all values for a particular variable
[ { "docid": "0f544d76c3462af8407d56eef657e8df", "score": "0.6040801", "text": "def get_variable(variable)\n\n survey_name = Survey.find(variable.survey_id).original_filename\n values_array = Array.new\n #open the dataset\n csvfile = FCSV.open( 'filestore/datasets/' + survey_name, :headers => ...
[ { "docid": "acaba55a8ab0d265f6be9b85dcfd7767", "score": "0.7128833", "text": "def get_variables\n result = @assigns.each_value.reduce([]) do |ar,tree|\n ar.concat(tree.get_variables)\n end\n result.uniq!.sort!\n return result\n end", ...
b03106c3cd40b575b3ef701c23851ec7
load the permissions for the current user so that UI can be manipulated
[ { "docid": "7e8d12edbc4490e559fa3455c1a8ae88", "score": "0.7957082", "text": "def load_permissions\n @current_permissions = current_user.role.permissions.collect{|i| [i.subject_class, i.action]}\n end", "title": "" } ]
[ { "docid": "2485a9f5630b90eb908f80aecc2c36aa", "score": "0.80362076", "text": "def load_permissions\n @current_permissions = current_user.role.permissions.collect{|i| [i.subject_class, i.action]} unless current_user.nil?\n end", "title": "" }, { "docid": "dcf9a85567c621f1876fc822e66edc11...
135fcc5e4a0f9a1df4b84b4b422067fb
Clears the list of RSpec specs in this project.
[ { "docid": "422d0feceb5891abdbf640ca2caa4c2d", "score": "0.8480308", "text": "def clear\n @rspec_specs = nil\n end", "title": "" } ]
[ { "docid": "018df6fd5e29ca656e0ef5bfe9d6431d", "score": "0.73667425", "text": "def clear()\n Project.projects.each do |project|\n project.test.send :clear\n end\n end", "title": "" }, { "docid": "76f4b1b96d2c7e56760e69705e282052", "score": "0.6696908", "te...
dd158dea94d45ac54316b85bb572b66e
Add the foreign keys
[ { "docid": "f7e83ac4684bb4b01326a89f8d00a126", "score": "0.0", "text": "def around(env)\n original_options = env.options\n env.options = original_options.dup\n\n is_reference = (env.type == :reference)\n is_polymorphic = is_reference && env.options[:polymorphic]\n\n ...
[ { "docid": "ddc80cc1f1462792e876428cc5878cc3", "score": "0.8239735", "text": "def foreign_key_adds; end", "title": "" }, { "docid": "5ed986aa2b12d4d8610533c025d819b6", "score": "0.7307963", "text": "def foreign_keys\n @foreign_keys ||= connection.foreign_keys(table_name, \"#...
53ca93b36e8c0b07e5a52ad0587185c6
inputs [String] pool_name : Name of the pool [String] vm_name : Name of the VM to check if it exists returns [Boolean] : true if it exists, false if not
[ { "docid": "4578c191e3f06392e6527bf970e7c3e9", "score": "0.85572714", "text": "def vm_exists?(pool_name, vm_name)\n !get_vm(pool_name, vm_name).nil?\n end", "title": "" } ]
[ { "docid": "370cb51c481cf9e07447d0516cdbf2f9", "score": "0.7472033", "text": "def vm_exists?(uuid)\n end", "title": "" }, { "docid": "b9bef0a0421a92d8804635972770d4db", "score": "0.7206127", "text": "def check_parallels_vm_exists(options)\n set_vmrun_bin(options)\n exists =...
9fe6ac9c9a2404faa2749983342adc01
POST /rss_items POST /rss_items.json
[ { "docid": "242eafe267ab5ea5d9813d59f9f6fa33", "score": "0.70746505", "text": "def create\n @rss_item = RssItem.new(params[:rss_item])\n\n respond_to do |format|\n if @rss_item.save\n format.html { redirect_to @rss_item, notice: 'Rss feed was successfully created.' }\n format.js...
[ { "docid": "b6347be7c4d4c4be6cf0fac5d899f667", "score": "0.7462258", "text": "def create\n @rss_feed = RssFeed.new(rss_feed_params)\n\n if @rss_feed.wrong_raw_items\n\n render json: @rss_feed.errors, status: :unprocessable_entity\n else\n rss_items = @rss_feed.raw_items\n rss_ite...
620430ceca11cc320872181319a31af9
Process the template. The +context+ hash will be available in the template.
[ { "docid": "27334fd60cef7a6bb0440f1c6ac47616", "score": "0.0", "text": "def render_to_string(context, properties = {})\n render(context, properties).string\n end", "title": "" } ]
[ { "docid": "70fbbc0f075b03e59fee8f7323f7af97", "score": "0.66783935", "text": "def process_template(template, context={})\n begin\n markup = open(template_path(template)).read\n partial_function = lambda {|*a| t, h = *a; process_template(\"_#{t}\", h || {}) }\n context = contex...
e0fe3e9470336d78499eb6e69c357c98
Iterate over each section and yield to block.
[ { "docid": "e4c75c95f392b82a43a44d3d57b6c66a", "score": "0.82378", "text": "def each(&block)\n @sections.each(&block)\n end", "title": "" } ]
[ { "docid": "6df753b6ab8891488752d3fe57ba49a5", "score": "0.7957714", "text": "def each(&block)\r\n\t@sections.each(&block)\r\n end", "title": "" }, { "docid": "525160889316ddd0bb805aceaebeaac4", "score": "0.79456764", "text": "def each_section\n [@answer, @authority, @additio...
cfc550b92271b01fcae0cedaf9e2c738
GET /space_reservations GET /space_reservations.json
[ { "docid": "97d6cda8bb4229d13835b974286a8ff2", "score": "0.7630608", "text": "def index\n @space_reservations = SpaceReservation.all\n end", "title": "" } ]
[ { "docid": "15aba820a67960cca8fe4ac5e21c1111", "score": "0.71492344", "text": "def index\n render json: reservations\n end", "title": "" }, { "docid": "fac6ad8038c08a2a5d6599197fe91956", "score": "0.7122695", "text": "def reservations\n @reservations ||= flight.reservations\...
3fe70d1e3f9abaf7066b874d5b4c824c
return existing db object or create new db object
[ { "docid": "5edbb85ebad7a6552803e78d096b0fec", "score": "0.0", "text": "def get_db name\n if db_pool[name].nil?\n db_conf = file[name]\n if db_conf['proxy'].nil?\n db = connect_database db_conf\n else\n db = connect_database_by_proxy db_conf\n end\n ...
[ { "docid": "5530c0e94ca2caee0d06aeb54153af4e", "score": "0.6841931", "text": "def db\n @db ||= model.db\n end", "title": "" }, { "docid": "5530c0e94ca2caee0d06aeb54153af4e", "score": "0.6841931", "text": "def db\n @db ||= model.db\n end", "title": "" }, { ...
20623bcec8614dab3f1a4e12b51163d1
Stores references to systems that should be triggered when this component is added to an enitity. Do not edit this array as it is managed by FelFlame automatically.
[ { "docid": "7e17586520f72badf94a492631ae3d77", "score": "0.5036071", "text": "def addition_triggers\n @addition_triggers ||= []\n end", "title": "" } ]
[ { "docid": "a4736ec636092100e51bbc9690717f5e", "score": "0.7285908", "text": "def systems\n @systems ||= []\n end", "title": "" }, { "docid": "bcb347a74f6e36ba002830f499ebbc27", "score": "0.6484356", "text": "def add_system(system)\n @systems[system.class] = system\n ...
594433ccdea298dd5c5019831db4a932
Run deliver command, and write output to log
[ { "docid": "8ee4b91e8b6a9db1af87aa7f40f26f23", "score": "0.6849344", "text": "def run_deliver_command(dest_dir, cmd, log_file)\n cmds = []\n cmds << CommandTools.unlock_keychain_cmd\n cmds << cmd\n result = true\n output_string = ''\n Rails.logger.debug(dest_dir)\n Rails.logger.debu...
[ { "docid": "4f94942c0d7ce0368967c34f56a53658", "score": "0.7198798", "text": "def deliver!\n capistrano.run(delivery_command)\n end", "title": "" }, { "docid": "f4ddf4e6ad758d8eee184444dc1b39af", "score": "0.6996813", "text": "def deliver!\n message = []\n\n ...
e94c925737d4c9f08e341c3af1291903
Check parameters to ensure only whitelisted ones are able to be passed through.
[ { "docid": "08286d82b9a2be010da17d9189fc3f5a", "score": "0.0", "text": "def mentorship_request_params\n params.require(:mentorship_request).permit(:user_id, :mentor_id, :title, :status, :urgency, :description, :screenshot, tech:[])\n end", "title": "" } ]
[ { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.7470448", "text": "def check_params; true; end", "title": "" }, { "docid": "5ee931ad3419145387a2dc5a284c6fb6", "score": "0.71198857", "text": "def check_params\n true\n end", "title": "" }, { "docid": "7a24fee...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "8e890728415698d282110babe361a2d0", "score": "0.0", "text": "def container_params\n\n params.require(:container).permit(:config_uri, :name)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
5c0d14c73ad964e3be9d61996e7c03cf
Get a nonpaged array of objects
[ { "docid": "661f76b1a8c06d14460563ff59fded19", "score": "0.0", "text": "def objects\n bucket_obj = Aws::S3::Bucket.new(name: bucket, client: s3_client)\n bucket_obj.objects( prefix: prefix)\n end", "title": "" } ]
[ { "docid": "e3e3164a1b6a1a2e9242a34f789cba10", "score": "0.68505484", "text": "def get_objects\n return self.pageobjects\n end", "title": "" }, { "docid": "28ddec87f26ea8f7d9963f7d780c8183", "score": "0.64428824", "text": "def get_all_objects(class_name, count)\n per_page = ...
a8376b998ba6ca35edaf9a9804aac1c2
product_name Returns the ProductName for the current target
[ { "docid": "1cb14b4da0ed27bb5c43c58954c17e8d", "score": "0.7748315", "text": "def product_name\n options = extensions[:Middlemac].options\n options.Targets[options.Target][:ProductName]\n end", "title": "" } ]
[ { "docid": "7f5ecc62cd73293789b92676e86e38bf", "score": "0.8074998", "text": "def product_name\n return @product_name\n end", "title": "" }, { "docid": "46d023ecc12380f7f953cf0e506e4964", "score": "0.7777068", "text": "def product_name; end", "title": ""...
0b10645659e7de5e5da3779063a3a5dd
(2 n) (1 n) => 2n 1n => n^2 Phase 2
[ { "docid": "1f26f0e986d493418768645c08c1d530", "score": "0.0", "text": "def my_min(array) \n min = array.first # O(1)\n array.each do |ele| #O(n)\n if ele < min #O(1)\n min = ele #O(1)\n end\n end\n min #O(1) \nend", "title": "" } ]
[ { "docid": "f1ea915443e7f1f582cf180daf9cb9ad", "score": "0.69738436", "text": "def s2\n (n2 - 1).divide(2)\n end", "title": "" }, { "docid": "4e33edcb1dc6d90cf446b84fa88ba1c2", "score": "0.68703544", "text": "def t2\n odd?(n2) ? s2 : s2 + 1\n end", "title": "" }...
687e269ea05a6a957652a86d0fecfecf
For formatting the text a bit nicer...
[ { "docid": "70d516f14c60873d570f710e62b66a48", "score": "0.0", "text": "def print_header(string)\n puts '*'.white * 80\n puts string.center(80)\n puts '*'.white * 80\nend", "title": "" } ]
[ { "docid": "1f5862fbb164498888e1396bfb283011", "score": "0.7692105", "text": "def format(text); end", "title": "" }, { "docid": "e537182215a7caf487217cdb13786f5c", "score": "0.7305607", "text": "def simple_format(text)\n text.gsub!(/ +/, \" \")\n text.gsub!(/\\r\\n?/, \"\\n...
82d7386e934c817027f10a1f46a3e1f4
Obtain x value given y value x=(ya)/b
[ { "docid": "b043e4dde46e1acd71996c06adf804b3", "score": "0.77482194", "text": "def x(val_y)\n (val_y-@a) / @b.to_f\n end", "title": "" } ]
[ { "docid": "13b12fd7f48e97db6ae72bed42a9e089", "score": "0.6990334", "text": "def f(x, y); (1.0 + y * y) / (1.0 + x * x); end", "title": "" }, { "docid": "544dcef96a0f5bd681c91fa8c3ca0b02", "score": "0.6785078", "text": "def pt a,b\n\tx=-b/a\n\treturn x\nend", "title": "" }, ...
c21f7c482f13708ab73461f787417a46
DELETE /armor/1 DELETE /armor/1.json
[ { "docid": "1c5b363eedf596cf9d384f51debefb2a", "score": "0.73255175", "text": "def destroy\n @armor.destroy\n respond_to do |format|\n format.html { redirect_to armor_index_url, notice: 'Armor was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title"...
[ { "docid": "00030b9bfa985463030a72be5644ff26", "score": "0.7582757", "text": "def destroy\n @armor.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "941dd5e8e646bc25f51d1c2a52c963e8", "score": "0.7351474", "text": "def destroy\n @armor = Armor.destroy(params[:...
4e61e41f7361002348274958ea4a635f
returns a random farewell as specified in the bot's data file.
[ { "docid": "df1cec50007feca34535c06c63a13a74", "score": "0.7001268", "text": "def farewell\n\t\trandom_response(:farewell)\n\tend", "title": "" } ]
[ { "docid": "d813b723036d46242322b307a377a5b2", "score": "0.7089897", "text": "def farewell\n random_response(:farewell)\n end", "title": "" }, { "docid": "169e214fb32852a23cfdfbdcaaf36f91", "score": "0.6499682", "text": "def farewell\n\t\trandom_response :farewell\n\tend", "t...
8a03054d049b6d6db56e89e85bd88374
DELETE /order_items/1 DELETE /order_items/1.json
[ { "docid": "49c504cecb3256e6439ae1c9396dc417", "score": "0.7386758", "text": "def destroy\n @order = current_order\n @order_item = @order.order_items.find(params[:id])\n @order_item.destroy\n @order_items = @order.order_items\n end", "title": "" } ]
[ { "docid": "a2ee841c093b6873595230ab15402c26", "score": "0.76614136", "text": "def destroy\n @item_order = ItemOrder.find(params[:id])\n @order = Order.where(:id => @item_order.item_id)\n @item_order.destroy\n\n respond_to do |format|\n format.html { redirect_to order_url(@order) }\n ...
df3bfea7e02214c4505bdfa59e9a0ec8
Returns only the attached_files that are declared with 'contains'
[ { "docid": "a3a189889f9e4def6eb9b194c3940251", "score": "0.5061204", "text": "def declared_attached_files\n attached_files.reflections.keys.each_with_object({}) do |k, h|\n h[k] = attached_files[k]\n end\n end", "title": "" } ]
[ { "docid": "d706baacc7cc058aa70dc9984b6bf634", "score": "0.6358303", "text": "def load_attached_files\n return if reflections[:contains] && reflections[:contains].macro == :is_a_container\n contains_assertions.each do |file_uri|\n path = file_uri.to_s.sub(uri + '/', '')\n next if...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "609f83e65e04d23184273246cc58040c", "score": "0.0", "text": "def message_params\n params.require(:message).permit(:title, :body, :sender_id, :urgency, :parent_id)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69811666", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6782836", "text": "def strong_params\n params.requ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ed625399fdb5e31d0e06d532d17475f5", "score": "0.0", "text": "def set_project\n @project = Project.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...
54387c3b3df45332275ed7185a7f0657
parser rule constructor (in Compilador.g) 246:1: constructor : K_DEF K_INITIALIZE LPAR ( parametros_tipos )? RPAR LLAIZQ bodyexp LLADER ;
[ { "docid": "d289adbabedd651c7d9e9371572df2da", "score": "0.7085345", "text": "def constructor\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 54 )\n\n\n return_value = ConstructorReturnValue.new\n\n # $rule.start = the first token seen before ...
[ { "docid": "f4c810e6dbca3e5a69b025b1a8f62d14", "score": "0.61995196", "text": "def k_initialize!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 65 )\n\n\n\n type = K_INITIALIZE\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initiali...
1caa2a28b007f83c34b17836c08ff33f
Sets the attribute attribute_name
[ { "docid": "eafc3fa2b0dd6acb3d59403a272830a8", "score": "0.7474986", "text": "def attribute_name=(_arg0); end", "title": "" } ]
[ { "docid": "d508f29eea085d040ff4c00efa72b4ff", "score": "0.79736173", "text": "def set_attribute(name, value); end", "title": "" }, { "docid": "2683255a813dd40cda66c68f3ed5b102", "score": "0.79583615", "text": "def set_attribute(name, value)\n @attributes[name] = value\n ...
c0bfc7f1271bdd66c2470d13895601e6
emits userreadable output to check
[ { "docid": "0dedafa0941633995129eccf20eae0b4", "score": "0.0", "text": "def debug_emit(fname = \"output\")\n file = File.new(fname+\".debug\", \"w+\")\n @instr.each{|i|\n file.puts \"#{i.to_s}\"\n }\n file.close \n end", "title": "" } ]
[ { "docid": "a6142521f73c376476df18cb22eaf3d9", "score": "0.6516951", "text": "def output; end", "title": "" }, { "docid": "a6142521f73c376476df18cb22eaf3d9", "score": "0.6516951", "text": "def output; end", "title": "" }, { "docid": "a6142521f73c376476df18cb22eaf3d9", ...
09764be69094d7ddec45cb28272b8fa4
before_action :is_authorised, only: [:accept, :reject]
[ { "docid": "93cd7cf73e293f8bf469302f002a0ccc", "score": "0.0", "text": "def create\n off = Offer.find(booking_params[:offer_id])\n\n @booking = current_user.bookings.build(booking_params)\n\n\n # if off && off.trade_id == current_user.id\n if off && off.trade_id == 100\n redirect_to req...
[ { "docid": "782e660e50b8d9191f4ab7a646ed9a0f", "score": "0.7167376", "text": "def authorize\n\tend", "title": "" }, { "docid": "53c5b220c74a56c85b384ac7632c0802", "score": "0.7164133", "text": "def before_call\n authorize\n end", "title": "" }, { "docid": "c88364f80c7...
cc7726e74a7f89ff2da4557d360ed1a2
Execute params with a query
[ { "docid": "13eb0bb7bb29db184f7eb7120beafdd7", "score": "0.7668923", "text": "def execute_params(params = nil)\n load_params(params)\n adapter.execute\n end", "title": "" } ]
[ { "docid": "02cd62a08f9b49419632bb14bba866b6", "score": "0.82210356", "text": "def exec_params(query, params, conn = nil)\n stat_query query\n conn ||= handler\n conn.exec_params query, params\n end", "title": "" }, { "docid": "9eb234af9f71dbc62399fe497baf7750", "score"...
5e0c13fc8bc00a90534cec1a3e94108c
Set info in session Save information to a session.
[ { "docid": "f82d7c97ca511185f1d3d18302592d38", "score": "0.741495", "text": "def set_info_in_session id, key, val\r\n return nil unless session_exists? id\r\n @sessions[id][key] = val\r\n end", "title": "" } ]
[ { "docid": "5bb94568c3712115c6e0a8361b2f33cb", "score": "0.7590497", "text": "def save\n @session[SESSION_KEY] = @data\n end", "title": "" }, { "docid": "8996dd0a89c17905867843fa5ad401f0", "score": "0.754381", "text": "def set_session_info\n Thread.current[:current_saison_id] ...
9a976c1a20d3e28e78ec1dcdd6e1c31a
Returns the URL param representation of the filter.
[ { "docid": "dfd17531d0fea836de2c4191b9ee2a00", "score": "0.7760989", "text": "def to_param\n \"filter[#{name}]=#{value}\"\n end", "title": "" } ]
[ { "docid": "13df2c921049f1e21be6f7b9f427eeaa", "score": "0.7208337", "text": "def to_s\n @filter.to_a.map {|name, value|\n '%s=%s' % [URI.escape(name.to_s), URI.escape(value.to_s)]\n }.join('&')\n end", "title": "" }, { "docid": "efe3efcdf06db8e4fddd0b3c0ee52bf3",...
04c1ecb1c1bf5715a2487ab42eb346e3
GET /pessoas/new GET /pessoas/new.xml
[ { "docid": "79c766a084106c29dbfa85b40cdc77c5", "score": "0.79594773", "text": "def new\n @pessoa = Pessoa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pessoa }\n end\n end", "title": "" } ]
[ { "docid": "2d9039d372596c1e44ef71e38ddc52e2", "score": "0.7671087", "text": "def new\n @peca = Peca.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @peca }\n end\n end", "title": "" }, { "docid": "db085179b0b14b9d49a9bc653e7825a...
8593f905c2634486c501782a723c04fc
PUT /hidden_website_categories/1 PUT /hidden_website_categories/1.xml
[ { "docid": "9d92c40520dd0f0f4f66f902a7165b64", "score": "0.6606357", "text": "def update\n @hidden_website_category = HiddenWebsiteCategory.find(params[:id])\n\n respond_to do |format|\n if @hidden_website_category.update_attributes(params[:hidden_website_category])\n format.html { red...
[ { "docid": "8efbadf20853ae8f07589d7714e7a347", "score": "0.60222757", "text": "def update_categories(categories, options = {} )\n options.merge!(:docid => self.docid, :categories => categories)\n resp = @conn.put do |req|\n req.url \"categories\"\n req.body = options.to_j...
83797987d9af1af558b27abc3ee0a1fa
Create a new data splitter for random permutation cross validation.
[ { "docid": "db0f2075a99b16baa447852fc7648a66", "score": "0.5035584", "text": "def initialize(n_splits: 3, test_size: 0.1, train_size: nil, random_seed: nil)\n @n_splits = n_splits\n @test_size = test_size\n @train_size = train_size\n @random_seed = random_seed\n @rando...
[ { "docid": "aae8caff600648fa846538705d04cd81", "score": "0.62150216", "text": "def split_data(data, test_data, training_data)\n size = data.count\n train_size = (size * 0.70).round\n test_size = size - train_size\n data = data.shuffle\n counter = 0\n data.each do |item|\n counter += 1\n if c...
88df84ca21748531c83d9e5e7160e942
Add new team member
[ { "docid": "fb7b7d5e6dd9ff84a02cd629096ce00f", "score": "0.6891634", "text": "def add\n added = TeamService.add params[:id], @organisation.ids, params[:username], current_user\n if added == true\n flash[:success] = \"#{params[:username]} was added to the team.\"\n else\n flash[:error]...
[ { "docid": "0b1d02f0ef9651a3bf0cdc959cc7b41d", "score": "0.8346917", "text": "def do_add_team_member(a_team_member)\n @team_member = a_team_member\n end", "title": "" }, { "docid": "f0c6b10b3e5fb7661ea2461d9fa54961", "score": "0.8241892", "text": "def add_member_to_team(opts)\n ...
a1098e132a140e4733e10696a38ab961
Get protein name from fasta file
[ { "docid": "e7e9041768466d687ca6cc7f56188e8f", "score": "0.73809373", "text": "def get_genename(fasta_file)\n geneid1 = \"\"\n file = Bio::FastaFormat.open(fasta_file)\n file.each do |entry|\n geneid1 = entry.entry_id\n end\n geneid1\nend", "title": "" } ]
[ { "docid": "4b2f20fcf41d4d68c083427016d0b559", "score": "0.64610106", "text": "def read_fasta(fasta_file)\r\n fasta_name = \"\"\r\n fasta_seqs = {}\r\n seq = \"\"\r\n File.open(fasta_file).each do |line|\r\n if !(line.nil?)\r\n if line.start_with? \">\"\r\n s...
e3973210d163daad4d64cbc1cea24e9f
Return the number of sites.
[ { "docid": "e4aaaa7f9af4bf7295f941ee94628fff", "score": "0.67967707", "text": "def size\n return site_tags.length\n end", "title": "" } ]
[ { "docid": "bd5f1a9e435ceed44e1ea91e4e9461c3", "score": "0.84649074", "text": "def num_sites\n if permission.value.positive?\n 'All sites'\n elsif connections.count.zero?\n 'No sites'\n elsif connections.count == 1\n '1 site'\n else\n \"#{connections.count} sites\"\n e...
08811ffb5c9f69825c661ebd53e146e9
This function verifying is Freelancer description displayed
[ { "docid": "5c2a6eb285a9c152295672d726b81e44", "score": "0.7505479", "text": "def is_freelancer_description_displayed\n @driver.find_element(:xpath, FREELANCER_DESCRIPTION).displayed?\n end", "title": "" } ]
[ { "docid": "a43f684ec8ca37126c84dbcf97a96c3f", "score": "0.69349825", "text": "def has_description?\n true\n end", "title": "" }, { "docid": "bd2acf9e4784c79e8aa758ed5620cb0f", "score": "0.678449", "text": "def compare_description?(freelancer_descr, profile_descr)...
0227633ddb2f4d0626171a4fbf6a3983
Builds a list of Module instances for modules from the JSON API
[ { "docid": "a0879550701a5d807c57ee6571413ff3", "score": "0.63421124", "text": "def init_json_modules(mods, factory)\n return unless mods\n self.modules = mods.map { |m| Module.new(m['uri'], factory, json: m) }\n end", "title": "" } ]
[ { "docid": "9e230c5517e4ae662076c1b971d37240", "score": "0.65672535", "text": "def rest__list\n diff = ret_request_params(:diff)\n project = get_default_project()\n datatype = :module\n namespace = ret_request_params(:module_namespace)\n remot...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "bd9e9d5627a41fc2190bd13c02c66495", "score": "0.0", "text": "def event_schema_params\n params.require(:event_schema).permit(:title, :description, :start_date, :end_date, :is_all_day, :is_recurring, :recurrence, :duration, :location, :calendar_id, :color, :startDate, :endDate, :group_ids,...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
333239d0577071e07bdaf253cac737d7
Prints first card in dealer's hand
[ { "docid": "72ddd821f36f1d6a581bf2961fe8caa4", "score": "0.70248514", "text": "def print_top\n card = @hand[0]\n puts\n puts \"Dealer top card:\"\n printf(\" %8s\", \"-----------\")\n puts\n printf(\" + | %8s |\", card.rank.to_s)\n puts\n ...
[ { "docid": "65b0910fa67804f953183e4efd53af00", "score": "0.8824648", "text": "def printDealerFirstCard \n @dealerHand.getCardAtIndex(0).printCard()\n end", "title": "" }, { "docid": "cf24c585995d32ac9e814e062f7656bd", "score": "0.83542556", "text": "def display_dealer_card\n car...
5aac8609eca80ec2f1c482732c042a73
Returns the Action relating to the verb parameter.
[ { "docid": "08f6cfe95ec1883dea608ee3cd4b21de", "score": "0.71989864", "text": "def [](verb)\n return (@actions ||= []).find { |x| x.verb == verb.to_sym }\n end", "title": "" } ]
[ { "docid": "0244ea4a971dda8648daf6672d5c117c", "score": "0.7436922", "text": "def verb\n verb_path[0] if verb_path\n end", "title": "" }, { "docid": "b0e412f46951ea7ece0dc481ed33a996", "score": "0.70467836", "text": "def action\n @params['action'] || @param...
c3a86ccd7e9d2f6ec61bd7b91cb2fd56
Retrieves containers deployed to this server, optionally filtered by group, artifact, version or status
[ { "docid": "1f52c032e2baf7c0bc328fb5ad2fd744", "score": "0.0", "text": "def list_containers(opts = {})\n data, _status_code, _headers = list_containers_with_http_info(opts)\n return data\n end", "title": "" } ]
[ { "docid": "15844cb186c32f7235dae41b783e7b3d", "score": "0.69540286", "text": "def running_containers\n request do\n get(path: '/containers/json')\n end\n end", "title": "" }, { "docid": "0b77200fcfff0fd0cc6125020b421e91", "score": "0.6798423", "text": "def get_co...
cea815b63b878d2d2ac5df4b58a14dcd
returns the category of season
[ { "docid": "3d72865fa22f74d6a6349311a42ba460", "score": "0.59727514", "text": "def category\n self.league.category\n end", "title": "" } ]
[ { "docid": "2b06d6fa17752e96a67bd7dcd3ea361d", "score": "0.73302466", "text": "def get_category_type_for_season(season_id)\n season_id ? CategoryType.get_category_from(season_id, year_of_birth) : nil\n end", "title": "" }, { "docid": "1eeb8c6dbb6e905c27c89839b3c0e0eb", "score": "0.71...
01393acf7116b9204cf2d202b964758d
Defined method when called puts statement taking an argument
[ { "docid": "5cfe84c2d20c6a7a2955f6534f953e76", "score": "0.0", "text": "def eat_milk_and_cookies(cookie)\n\t\tputs \"That was a good #{cookie}\"\n\t\tx\n\tend", "title": "" } ]
[ { "docid": "131c4852089df97ba250b7e55a41b88e", "score": "0.8520621", "text": "def puts(*args) end", "title": "" }, { "docid": "e9bd281271d14e3e280a18bda32bcf55", "score": "0.8277087", "text": "def puts *args; STDOUT.puts *args; end", "title": "" }, { "docid": "8bdcfc4008c...
cae515dc3dd9143846326143de0e824c
provided to make feed quack like a feedzirra feed
[ { "docid": "2e8f9f436a04260deea283d956ed03eb", "score": "0.6183165", "text": "def feed_url\n uri\n end", "title": "" } ]
[ { "docid": "3ace1a1cf27e849c4c5065d9cf92091e", "score": "0.690678", "text": "def feed; end", "title": "" }, { "docid": "50a197b74bd090e2510deb69895e4b2b", "score": "0.6793788", "text": "def feeds; end", "title": "" }, { "docid": "3bc083d777269afa9bcbe937de8ad725", "sc...
1e02cdd9064e8bf6b20569c083f7dc4f
Gets the lastModifiedBy property value. Identity information for the entity that last modified the request.
[ { "docid": "3d1202e229a1fc8a78b4cc218b97ac4c", "score": "0.78371435", "text": "def last_modified_by\n return @last_modified_by\n end", "title": "" } ]
[ { "docid": "9cc1fde5eccbfa9f0511b6ff0cb11423", "score": "0.74475783", "text": "def last_modified_by; User.get(self.last_modified_by_id); end", "title": "" }, { "docid": "9cc1fde5eccbfa9f0511b6ff0cb11423", "score": "0.74475783", "text": "def last_modified_by; User.get(self.last_modifi...
783b7e5377ef27e306443ec33534126c
Let the user go to the intended destination after successful login.
[ { "docid": "94641704c8ee042e754de89e3ee33b02", "score": "0.0", "text": "def remember_destination\n if params[:destination].nil?\n if params[:controller] == 'users' && params[:action] == 'login'\n session[:destination] = nil\n elsif request.get?\n session[:destination] = reques...
[ { "docid": "c1f6b7ff1c8a929c970a550f00d21f7d", "score": "0.7709126", "text": "def redirect_after_login\n \tif current_user.kind_of? Volunteer\n \tredir_target = session[:return_to] || volunteer_path(current_user)\n else\n \tredir_target = session[:return_to] || organization_path(current_user)\...
8f6be07cf1426b624b53a2242528f52e
We tolerate blank entries, entries with dollar signs, entries with commas, and entries with decimal points (which we destroy) This should be kept in sync with new.js.
[ { "docid": "9075651ac37227cf3a89f50013560a0a", "score": "0.60050046", "text": "def clean_funding_values(levels)\n normed_list = []\n levels.each do |level|\n if level == \"\"\n next\n end\n level = level.gsub(\"$\", \"\")\n level = level.gsub(\",\", \"\")\n normed_l...
[ { "docid": "df84ef73a8117ad9501c67628a1c927b", "score": "0.6297762", "text": "def strip_formatting_from_numbers \t# to remove commas added to web form for readability\n\t\tif self.income.include? \",\"\n\t\t\tself.income = self.income.to_s.gsub!(/\\D+/, '').to_i\n\t\tend\n\t\tif self.debt.include? \",\"...
c730246b95f871a8ad6d6c4812c09c21
PATCH/PUT /rentals/1 PATCH/PUT /rentals/1.json
[ { "docid": "51f7dd91964b6177586936c7dfcda20e", "score": "0.0", "text": "def update\n @rental = Rental.find(params[\"id\"])\n @rental.isReturned = 1\n @rental.dateReturned = Date.current\n\n respond_to do |format|\n if @rental.save\n @book = Book.find_by isbn: params[\"isbn\"]\n ...
[ { "docid": "6192355a387b39617503443dbff05e8d", "score": "0.72694844", "text": "def update\n @rental = Rental.find(params[:id])\n\n respond_to do |format|\n if @rental.update_attributes(params[:rental])\n format.html { redirect_to @rental, notice: 'Rental was successfully updated.' }\n ...
7e0aa2e5126c36daa0961ba8e4144ad4
CREATE A STATUS POST /status_posts.json
[ { "docid": "50e1d8e3080e341e97f8d31a2d84a51b", "score": "0.7040525", "text": "def test_should_create_status_post_via_API_JSON\r\n get \"/logout\"\r\n post \"/status_posts.json\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n asse...
[ { "docid": "981b7360678bb44bea71f5632e6464a8", "score": "0.69605494", "text": "def create\n json_data = params[:status]\n if json_data && json_data[:content]\n @status = Status.new(content: json_data[:content])\n if json_data[:topics]\n json_data[:topics].each do |topic|\n ...
f1fcab5eab69095de03803527d22bbfa
Get array of tokens with arguments of a puppetfunction
[ { "docid": "51d0b389b221a8a1ff628251f5ad316e", "score": "0.6918911", "text": "def get_argument_token_for_function(tokens,function)\n lparen=tokens.find do |token|\n token.type == :LPAREN and\n token.prev_code_token.type == :NAME and\n token.prev_code_token.value == function\n en...
[ { "docid": "5737a2843a02b50ed006b95726dd2b11", "score": "0.6707918", "text": "def gen_arg_token_lists\n STRING_ARG_TOKENS.map do |each|\n re_str_list = convert_tokens_to_regexpstr(each)\n [re_str_list.join('\\s+'), each.length]\n end\n end", "title": "" }, { "docid...
6a1db7c0e10f634cf9db10fdff0b1d75
PATCH/PUT /scenes/1 or /scenes/1.json
[ { "docid": "e659e6443e7ef960d74ad34e79ea90d5", "score": "0.7022072", "text": "def update\n respond_to do |format|\n if @scene.update(scene_params)\n format.html { redirect_to scenario_scenes_path(@scenario), notice: \"Scene was successfully updated.\" }\n format.json { render :show...
[ { "docid": "93bccb5d97b9400d082b78ca376bd512", "score": "0.7074818", "text": "def update\n\n respond_to do |format|\n if @scene.update_attributes(params[:scene])\n format.html { redirect_to edit_project_scene_path(@scene.project, @scene) }\n format.json { head :no_content }\n ...
445f08d3e4cf0a3e68634f5db9b09692
GET /wdi_facts/1 GET /wdi_facts/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "b88ce765030f5edd29bec078f570ae54", "score": "0.71784943", "text": "def index\n @wdi_facts = WdiFact.all\n end", "title": "" }, { "docid": "658b9a9e49f7b040ed5d6bd9763abad0", "score": "0.694792", "text": "def cat_fact\n document_received = JSON.load(open(FACT_URL))\...
e368e7b089ee161722498ed325f0a0ef
Jupiter longitudes (IERS 2003)
[ { "docid": "ba7631cdb3be2bad3c4ba24526d6e632", "score": "0.0", "text": "def calc_ju_iers2003(t)\n return (0.599546497 + 52.9690962641 * t) % PI2\n rescue => e\n raise\n end", "title": "" } ]
[ { "docid": "1d70e2d3c2ef7d10f78f110a536db362", "score": "0.8005613", "text": "def longitude #λ₀\n (n + ec + εg) % 360\n end", "title": "" }, { "docid": "1904ae4940016d1fbe939982994498ee", "score": "0.7513364", "text": "def longitude\n longitude_times_1000000.nil? ? nil : longi...
af703afdd952b44eb713e338b62948d1
Get a list of trip purposes for a customer
[ { "docid": "ec4bbbf7ee1258ae2b9e99e84e89b0ac", "score": "0.6905181", "text": "def get_trip_purposes \n purposes = []\n purposes_hash = []\n customer_information = fetch_customer_information(funding=true)\n arrayify(customer_information[\"customer\"][\"funding\"][\"funding_source\"]).each do ...
[ { "docid": "3298705623d8dc8572ef40174a1dc6b5", "score": "0.5916201", "text": "def list_customers(options={})\n customers = []\n list_customers_each(options) { |c| customers << c }\n customers\n end", "title": "" }, { "docid": "2324da87656c02b7441f87bd95f2bb7e", "score":...
fe288f566d58c1ae198585c33c73e7c4
Percentage free memory cluster wide.
[ { "docid": "827b8452913045ca807bf4b68f15eb49", "score": "0.6891868", "text": "def memory_per_cluster(cfg)\n cluster = cfg['cluster']\n query = @client.percent_query_free(\n \"sum(node_memory_MemTotal{job=\\\"#{cluster}\\\"})\",\n \"sum(node_memory_MemAvailable{job...
[ { "docid": "1207f1fd79faa637246ea49cce0dbdb8", "score": "0.7356275", "text": "def percent_available\n\t\t\t\treturn nil unless meminfo?\n\t\t\t\tmemory = IO.foreach('/proc/meminfo').first(3)\n\t\t\t\tmemory[2].split[1].to_i.*(100).fdiv(memory[0].split[1].to_i).round(2)\n\t\t\tend", "title": "" }, ...
06ed942657d2ecb3635de643f0e0241c
wrapper around post that preps for api call if expect_ok is set we also return the response in json form
[ { "docid": "283b210ebf5fb8dc3aa8d7a0c9c5b78d", "score": "0.6077015", "text": "def zz_api_post(path, body, expect_code = 200, secure = false)\n body = body.nil? ? nil : zz_api_body(body)\n zz_api_log \"zz_api_post: #{path}\\n#{body}\"\n post build_full_path_if_needed(path, secure), body, zz_api_header...
[ { "docid": "c2ea317f171c7785bcd9bd729f241439", "score": "0.71884876", "text": "def make_ok_return(data)\n content_type :json\n status 200\n data.to_json\n end", "title": "" }, { "docid": "562c900432dee85b7833a09da107b867", "score": "0.6879866", "text": "def jsonResponse(ok:...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "35e05e1027ab6a7bd814316fca4d3b87", "score": "0.0", "text": "def set_client_setting\n @client_setting = ClientSetting.first\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310465", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60152966", "text": "d...
ba37460e9bcfdfdfc959007b56447cb9
Method: send_collection Sends a collection of all the folders with name `path`. Parameters: path the folder name to search in each folder
[ { "docid": "a2d51102b9acd76be04c1e60c45865bb", "score": "0.70768315", "text": "def send_collection(path)\n response = self.create_section_response\n Dir.glob(\"#{DocumentFile::DOC_FILE_PATH}/*#{path}\").each do |collection_path|\n section_path = collection_path.sub(DocumentFile::DOC_FIL...
[ { "docid": "8f332d8e5a7a0b7826ca3dfe4d18acb2", "score": "0.6014932", "text": "def send_folder(path)\n response = self.create_section_response\n section = DocumentSection.from_path(path)\n Dir.chdir(DocumentFile::DOC_FILE_PATH + path) do |dir|\n if (readmes = Dir.glob(\"read*me.{htm...
e78b6f2675aa13f31acdf8e55f149022
Asset Group Tag Adds a tag to an asset group.
[ { "docid": "8ae8fd2573ae9a7f8b2235a30bfe5d9c", "score": "0.662849", "text": "def add_asset_group_tag_with_http_info(id, tag_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AssetGroupApi.add_asset_group_tag ...'\n end\n # verify the r...
[ { "docid": "5949b8c0948e35d2ae178d8086235e19", "score": "0.70684505", "text": "def group_tag=(value)\n @group_tag = value\n end", "title": "" }, { "docid": "8e5d25d2f36289a5dd6d1d7e9465493a", "score": "0.68833226", "text": "def add_asset_group_tag(id, tag_id...
3e6e9223a5349d24ee363be2a628d2dd
PATCH/PUT /pins/1 PATCH/PUT /pins/1.json
[ { "docid": "ea0f3aa9dd1eafd900072e485a321cac", "score": "0.0", "text": "def update\n\t respond_to do |format|\n\t if @comment.update(comment_params)\n\t format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n\t format.json { head :no_content }\n\t e...
[ { "docid": "ff2825fac17d3476987a5a72532be89f", "score": "0.7232012", "text": "def update\n @pin = current_user.pins.find(params[:id])\n\n respond_to do |format|\n if @pin.update_attributes(params[:pin])\n format.html { redirect_to @pin, notice: 'Pin was successfully updated.' }\n ...
7cf502c673df3752f55d8174628c8c9d
TODO real plane, not just from first 3 vertices
[ { "docid": "fb7f9749848b6f169da88bdc3710daf3", "score": "0.8140615", "text": "def plane\n return nil if @vertices.length < 3\n Plane.three_points(*@vertices[0..2])\n end", "title": "" } ]
[ { "docid": "86aba19e8bf4b4bdff284a2b99cb06a4", "score": "0.6777645", "text": "def project_to_plane\n end", "title": "" }, { "docid": "9ebaf05b1cef695790a86d64f7e8c89a", "score": "0.6764761", "text": "def vertices\n [\n @origin,\n { x: x_max, y: y_min, z: z_min },\n ...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "5a9ff842ef0feec13771f9a7b78ca1a1", "score": "0.0", "text": "def update!(**args)\n @aws_s3_data_source = args[:aws_s3_data_source] if args.key?(:aws_s3_data_source)\n @azure_blob_storage_data_source = args[:azure_blob_storage_data_source] if args.key?(:azure_blob_storage_dat...
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.7309485", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.7264897", "text": "def update(p...
f132dbc6da3ee9dfae62c1f7015aba39
Weed out older docs (same ide, smaller rev). This could all have been done via SQL, but those inconsistencies are rare, the cost of the pumped SQL is not constant :(
[ { "docid": "4358bf21e24f401dfbb2f9a3d0094676", "score": "0.0", "text": "def select_last_revs(docs)\n\n docs.each_with_object([]) { |doc, a|\n a << doc if a.last.nil? || doc[:ide] != a.last[:ide]\n }\n end", "title": "" } ]
[ { "docid": "ac21bda441eb5a0a7a8655ae4477501a", "score": "0.5705272", "text": "def sqls; end", "title": "" }, { "docid": "ae2d2dc2f46e21debf7e413f20d103f4", "score": "0.56137687", "text": "def qd(query, opts={})\n qr(query,{:include_docs => true}.merge(opts)).inject([]) do |acc,row...
aca875f1851d90a3c528d8b88ce84ee7
Pseudocode: remember: i is the index of the first element bigger than the pivot j is the index of the first element that is unpartitioned (indices less than j are partitioned) partitioned means it's divided into two parts: one part where all elements are less than the pivot, and one part where all elements are greater ...
[ { "docid": "6032b4cbc8f48501310ea6277b0d9557", "score": "0.75780845", "text": "def Partition(array, left, right, comparisons)\n\n puts \"partitioning #{array.to_s}... #{comparisons} comparisons done already.\"\n \n pivot = array[left]\n #puts \"choosing pivot of #{pivot} for array starting with #{ar...
[ { "docid": "77a613a367e4300431d6a79c6fac5d71", "score": "0.81472963", "text": "def partition (array, from, to)\n\t#set pivot to end of array\n\tpivot = array[to]\n\t#set pIndex to beginning of array\n\tpIndex = from\n\t#loop through from the beginning of array\n\tfor i in from..to-1\n\t\t#if element at ...
e44d212f48d1ba99cdb7e37f8ad897d5
Displays the bacula config that is generated from the client's host
[ { "docid": "68f7214fed3b43f49c5d769eb4ddd7af", "score": "0.7696137", "text": "def bacula_config\n return unless host\n host.baculize_config.join(\"\\n\")\n end", "title": "" } ]
[ { "docid": "08d0462151a4c654f9e8e8a1d5ecde1a", "score": "0.6658887", "text": "def show_config\n puts \"Building with configuration:\"\n puts \"========================================================================\"\n puts\n puts configuration_summary\n end", "title": "" }, { ...
750ee588e448f76b1ea71280a4fdc95e
Returns a list of all assemblies
[ { "docid": "ec55a990814b2de5ccaedfb5d3cc546d", "score": "0.72493285", "text": "def list(params = {})\n _do_request(\"/assemblies\", params)\n end", "title": "" } ]
[ { "docid": "7d078252aa32c7f6edf1184dd82e32c2", "score": "0.70479065", "text": "def get_assemblies\n get_objs_helper(:assemblies, :component)\n end", "title": "" }, { "docid": "9ed3965977bdec55e27b8db04024c71d", "score": "0.6797541", "text": "def dependent_assemblies\n [sel...
948d7c02e76123ee178199e5cad464cb
(private) Convert an attachment from GroupMe's format to Peribot's format. For now, we only convert images (not mentions or other attachments).
[ { "docid": "0e492a6d5f274f9c87db037e7b720cc1", "score": "0.66159207", "text": "def convert_attachment(attachment)\n return nil unless attachment['type'] == 'image'\n\n {\n kind: :image,\n image: attachment['url']\n }\n end", "title": "" } ]
[ { "docid": "3db7351d795ebe7c168b2d841e6e8de1", "score": "0.6698391", "text": "def groupme_to_peribot(message)\n {\n service: :groupme,\n group: \"groupme/#{message['group_id']}\",\n text: message['text'] || '',\n user_name: message['name'],\n ...
846e07557ff2f23545f5466dfe01203d
Baseline implementation for the set_tags REST call
[ { "docid": "77248596ee75b8652e6a8267dae2b63e", "score": "0.64900607", "text": "def set_tags request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_set_tags_request r...
[ { "docid": "fc55fa7cb0c9e0cf248f107083941016", "score": "0.69075584", "text": "def set_tags(given_tags = {})\n @tags.merge!(given_tags)\n end", "title": "" }, { "docid": "82b1d788632ac08beadf12273699e1b4", "score": "0.68524504", "text": "def tags=(_arg0); end", "title": "...
3f7f286d8c3411df63855bf09a37b828
Can be set from outside to express decision between ties for first place. Expressed as tallies, not candidates (historical reasons). Probably should have just one element.
[ { "docid": "098dffbe93ce5ec1146168334fe15388", "score": "0.0", "text": "def real_ballots=(them)\n # Receive them as the real ballots on which to base my work.\n # Internally, our ballots can also include artificial ballots for\n # the \"better quorum\" scheme http://rangevoting.org/BetterQuorum...
[ { "docid": "8c00544563d4b100222930f40159a6fb", "score": "0.60436153", "text": "def ties\n placings.select { |s| s.participated? && !s.disqualified? }\n .group_by { |s| [s.tier, s.score, s.tiebreaker_place] }\n .values\n .reject { |g| g.size == 1 }\n end", "title"...
5bb22abab96b9e9ad03c1e1b57696f7b
TODO: This should be moved into view layer
[ { "docid": "feb6ed17eb13bcdf78516421c53a1abc", "score": "0.0", "text": "def icon(browser)\n icons = {\n \"chrome\" => \"img-firefox.png\",\n \"safari\" => \"img-safari.png\",\n \"googlechrome\" => \"img-chrome.png\",\n \"iexplore8\" => \"img-ie8.png\",\n \"iexplore7\" => \"im...
[ { "docid": "9cfdec68842e7833bd917a18f24f0ae8", "score": "0.63235366", "text": "def rendered\n end", "title": "" }, { "docid": "74a63bfd550d41654fb51e2c0543037c", "score": "0.6296679", "text": "def _layout; end", "title": "" }, { "docid": "c5d23a1d8161e7d7adcc240789013bd6...
eafa98d63c76d90b6ce656e7d777bd5d
get updated pkgs except contrib
[ { "docid": "1b0c65273ff41594c4dd62b798211da5", "score": "0.7319428", "text": "def get_update_pkgs\n get_update_dirs\n delete_contrib\n return @update_pkgs\n end", "title": "" } ]
[ { "docid": "470cf8e294a86e59f8d45723314d5782", "score": "0.59470487", "text": "def supported_pkgs\n {\"rpm\"=>1, \"deb\"=>1}\nend", "title": "" }, { "docid": "90ce8c1f9fb4be37a6f82abf69000b2c", "score": "0.5805456", "text": "def reprepro_registered_files(debian_pkg_name, release_nam...
6a70ce43283d4754480cd197193ba042
Json export <= TODO: update
[ { "docid": "a3eb3311f56b1769490e02f2ebbe6bc2", "score": "0.0", "text": "def to_json(*a)\n {\n \"json_class\" => self.class.name,\n \"data\" => {\n \"domain\" => @domain,\n \"type\" => @type,\n # Code Location\n \"filename\" => @filename,\n...
[ { "docid": "67c7590a8756f1e58ac2eeea5ca3ef4a", "score": "0.7504453", "text": "def export_as_ndjson\n JSON.fast_generate(JSON.parse(export_as_ir))\n end", "title": "" }, { "docid": "5144e8a4ebbbce7fcca2672a0190f76b", "score": "0.7390433", "text": "def to_json; end", "title": "...
faa7cd1172f08510c1f7adee04a8ad5d
TODO: Add Stylesheets TODO: Convert nested navigation TODO: Refactoring to DRY with spine_to_html
[ { "docid": "373f5e9df1d0dbaf6220a2967ea9b04c", "score": "0.0", "text": "def ncx_to_html\n html = <<EOF\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<html xmlns=\"http://www.w3.org/1999/xhtml\" profile=\"http://www.idpf.org/epub/30/profile/content/\">\n <head>\n <meta http-equiv=\"content-ty...
[ { "docid": "af05c87fbc785bb54e5237a45a477a52", "score": "0.6204664", "text": "def subpage_navigation(page)\n l = \"<ul>\\n\"\n page.pages.each do |page|\n l << page_navigation_helper(page)\n end\n l << \"</ul>\"\n end", "title": "" }, { "docid": "30e...
a49011d5f6b53a61997dec2b6fca3667
POST /employees POST /employees.json
[ { "docid": "1ca7524240abd3ce018d8c9b812bb700", "score": "0.68501806", "text": "def create\n @employee = Employee.new(employee_params)\n\n respond_to do |format|\n if @employee.save\n format.html { redirect_to @employee, notice: 'Employee was successfully created.' }\n format.jso...
[ { "docid": "c3ca308d3816fd81fe0e2e8e4283cabf", "score": "0.7005552", "text": "def create\n @employee = Employee.new(params[:employee])\n\n respond_to do |format|\n if @employee.save\n format.html { redirect_to @employee, notice: 'Employee was successfully created.' }\n format.js...
47e3891a6deef33f38dfcd6e8a5b3980
PUT /contents/1 PUT /contents/1.json
[ { "docid": "353bf055cfd6eb66976a29ea8afbb5fe", "score": "0.60822284", "text": "def update\n @content = Content.find(params[:id])\n\n respond_to do |format|\n if @content.update_attributes(params[:content])\n format.html { redirect_to contents_path, notice: 'Content was successfully upd...
[ { "docid": "0b2f66700726819883851819129547ae", "score": "0.65915227", "text": "def update!(**args)\n @contents = args[:contents] if args.key?(:contents)\n end", "title": "" }, { "docid": "0b2f66700726819883851819129547ae", "score": "0.65915227", "text": "def update!(*...
36aaa58bc21d362214e7694717be24f3
very strange comparision, sort all characters and compare, so we don't have order issues.
[ { "docid": "a431046b3a6fd851eb6439cdd69a634a", "score": "0.0", "text": "def assert(expected, output)\n left = expected.to_s.gsub(/\\s+/, ' ').gsub(/>\\s+</, '><').strip\n right = output.to_s.gsub(/\\s+/, ' ').gsub(/>\\s+</, '><').strip\n left.scan(/./).sort.should == right.scan(/./).sort\n#\n# ...
[ { "docid": "47c6a084eb96e428e03fce840b556b77", "score": "0.74664754", "text": "def third_ana(str1, str2)\n sorted1 = str1.chars.sort\n sorted2 = str2.chars.sort\n sorted1 == sorted2\nend", "title": "" }, { "docid": "2cf1db252ea447892c4b80a5699fe6f1", "score": "0.73347825", "text":...
0229ba5c3fff200f3720090fa21ed9a9
This method is what the job is set up to actually do.
[ { "docid": "6dd07f451974e7cdca349006856e97d3", "score": "0.0", "text": "def job_action\n period = Rails.configuration.x.scheduled_jobs.delete_temp_files_job_run_every\n delete_stored_files(period)\n end", "title": "" } ]
[ { "docid": "c5d8c358d4c839ff37ba8e533ce78e80", "score": "0.7337815", "text": "def job?; end", "title": "" }, { "docid": "974fe434d02e4e0d7362f359a7a4ef5e", "score": "0.7109194", "text": "def perform\n # put your job code here\n end", "title": "" }, { "docid": "669...
f49a17e97f9fc5cfb0427285d74cd237
write a function that takes an array of strings and returns the string with the longest char langth longest_string
[ { "docid": "4b9c58dd0c6e7e27f4e053e63042da55", "score": "0.80730486", "text": "def longest_string string1\n\n\t# string_array = string1\n\tstring1.max_by(&:length)\n\nend", "title": "" } ]
[ { "docid": "b822e0a5326826753dcb9afece81a43e", "score": "0.861223", "text": "def longest_string array\n\tarray.max_by{|x| x.length}\nend", "title": "" }, { "docid": "4254b28b8e3742a25e3dcbe6c7ed2332", "score": "0.86000514", "text": "def longest_string(array)\n array.max_by do |i|\n ...
dddd35c2365c45299cb8bc560c990a25
Install bundler in the system ruby
[ { "docid": "d58b125ea6f8cbcef5c3f696aff6d969", "score": "0.77326274", "text": "def install_bundler_gem\n egrep_escaped_version = bundler_version.gsub(/\\./, '\\.')\n # the grep \"bundler \" is so that gems like bundler08 don't get\n # their versions considered too\n #...
[ { "docid": "e7521be72953bdb37c293da1fad49dfa", "score": "0.78673536", "text": "def install_bundler\n\t# What we really need to do is check the result of the normaldo and then do a wrapped sudo.\n\t# That should be good on different platforms as long as Ruby's present.\n\tsudo \"#{self.omnibus_path}\\\\e...
012ce9a4f7554adc1c474c6c86a3d160
PATCH/PUT /video_sets/1 PATCH/PUT /video_sets/1.json
[ { "docid": "131cbeb9353ff588ff45194fc23604ea", "score": "0.7289204", "text": "def update\n respond_to do |format|\n if @video_set.update(video_set_params)\n format.html { redirect_to @video_set, notice: 'Video set was successfully updated.' }\n format.json { render :show, status: :...
[ { "docid": "a57140a009f46378277f5c773bda2be0", "score": "0.65805495", "text": "def update\n respond_to do |format|\n if @vset.update(vset_params)\n format.html { redirect_to @vset, notice: 'Vset was successfully updated.' }\n format.json { render :show, status: :ok, location: @vset...
54c68f41ecc990faba28b888eb789cd4
Delete Email Opened By Id
[ { "docid": "7923bc0816eacb76901425706a6b84be", "score": "0.62216216", "text": "def marketing_campaigns_id_emails_opened_email_opened_id_delete(id, email_opened_id, opts = {})\n marketing_campaigns_id_emails_opened_email_opened_id_delete_with_http_info(id, email_opened_id, opts)\n return nil\n ...
[ { "docid": "055b79ef24ed80836e6093a03d541c37", "score": "0.7611976", "text": "def delete()\n\n Email.destroy(self.id)\n end", "title": "" }, { "docid": "7c88be89d6a970a97bfd39240c9976d3", "score": "0.72849447", "text": "def destroy\n @email = Email.destroy(params[:id])\n re...
c46b8a66439cc82c75f96e9369a7f55f
Turns on italic style for this text (not well supported by terminal emulators).
[ { "docid": "0c562417459cd092da978d7fbf483358", "score": "0.7983828", "text": "def italic\n wrap_with_sgr(TERM_EFFECTS[:italic])\n end", "title": "" } ]
[ { "docid": "2e3e142f002027c6519f927241b862f2", "score": "0.81754214", "text": "def italic\n return self unless self.class.color_enabled\n\n \"\\e[3m#{self}\\e[23m\"\n end", "title": "" }, { "docid": "13c0544234d98ce5133e82b33ffe9950", "score": "0.81415665", "text": "def italic...
dd287317ee70dffd14fa56a1614bb705
GET /needs GET /needs.json
[ { "docid": "74f4f5879d384f275a2bff1b6e805a5d", "score": "0.6661646", "text": "def index\n @needs = Need.where(user: current_user).all\n end", "title": "" } ]
[ { "docid": "d35c079aa603b0e5af34329251f17f59", "score": "0.71158797", "text": "def all_needs\n needs_generic_data(request(\"needs/all.xml\", :auth => true))\n end", "title": "" }, { "docid": "e8ac6c735aac71a4a590bd5078639539", "score": "0.6884134", "text": "def index\n @ne...
18e57e8fb3b0a6a915737bfff6469df4
Get roles required by framework.
[ { "docid": "87a247a84184603d2f36d20f7397002e", "score": "0.0", "text": "def get_framework_roles_using_get_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AdminApi.get_framework_roles_using_get ...'\n end\n # verify the...
[ { "docid": "980ff6cbd29feb8a9142227486831eed", "score": "0.79123956", "text": "def roles\n @roles ||= api_client.get_roles\n end", "title": "" }, { "docid": "49ebb4505dcb866dc768cba9d663758d", "score": "0.77169675", "text": "def get_roles\n return @client.raw(\"get\", \"/c...
4712148d349761f69b3f6c08e96476b6
We overwrite this method so namespace is show shelly backup restore FILENAME
[ { "docid": "c8d5f500235e6c82492674c7258a1301", "score": "0.0", "text": "def handle_argument_error(task, error)\n raise InvocationError, \"#{task.name.inspect} was called incorrectly. Call as #{self.banner(task, nil, self.to_s != 'Shelly::CLI::Main').inspect}.\"\n end", "title": "" } ]
[ { "docid": "280dfd2299deeba391b1bfa29dcfae2f", "score": "0.65123475", "text": "def restore_snapshot(name)\n end", "title": "" }, { "docid": "af9d984af25af754fbb62f70b015d3e4", "score": "0.63551694", "text": "def restore(backup_name, dir)\n end", "title": "" }, { ...
ed8b8b9963e235eb98875c0e9a96484c
DELETE /mercs/1 DELETE /mercs/1.json
[ { "docid": "ef555daf22e3818dba86f3dd3e6309b5", "score": "0.6894912", "text": "def destroy\n @merc.destroy\n respond_to do |format|\n format.html { redirect_to mercs_url, notice: 'Merc was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ...
[ { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.7086062", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "87b262ee465d00a0e0b94c8f07556c80", "score": "0.68743527", "text": "def destroy\n @mercadorium.destroy\n respond_to do ...
6bf5cbd82b40a0d909c6d6841101efd3
GET /promotional_rules/1 GET /promotional_rules/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "f09195d41c3015c8b8b67fa142cce2d9", "score": "0.74016434", "text": "def index\n @promotional_rules = PromotionalRule.all\n end", "title": "" }, { "docid": "bea40e1b2c133b0a35541dee9fd92084", "score": "0.6580618", "text": "def create\n @promotional_rule = Promotional...
f260b0743e3635ff851ba1fb8f391b00
GET /users/1 GET /users/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "9f7c735ace683c5c2b12c914cc9ad8a8", "score": "0.771752", "text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end", "title": "" }, { "docid": "a95dfe28d6b386aafc5fb53749e84258", "score": "0.75107867", "text": "def user\n...
0f907a3ff0f642ef95e2771b4ce396e4
Internal: The toggle to use to enable/disable this gate.
[ { "docid": "0d1ae23a2664b731500f91457f0b6242", "score": "0.75067455", "text": "def toggle\n @toggle ||= toggle_class.new(self)\n end", "title": "" } ]
[ { "docid": "30dba818c364ae11a565b64a36abe87e", "score": "0.7604848", "text": "def toggle\n set_switch(!self.switch) if @switch\n end", "title": "" }, { "docid": "b21b4e7dfe1a48b91abf27aa78d06504", "score": "0.74591887", "text": "def toggle\n if on?\n off\n else\n...
a9282471fb3bfa937329325c16b9af0c
Truncate the default_value column if greater than the specified length.
[ { "docid": "db8595a119588c363ec98b26aae92425", "score": "0.7197405", "text": "def default_value_column(record)\n if (record.value.to_s.length > 47)\n h(record.value.to_s[0,47]) + \"...\"\n else\n h(record.value.to_s)\n end\n end", "title": "" } ]
[ { "docid": "580d55825fb9deed8e6b39674b687955", "score": "0.6081481", "text": "def truncate(max)\n length = Math.min(max, length)\n self\n end", "title": "" }, { "docid": "85ae381b5402d32ab3e80eb58bef4cba", "score": "0.60670125", "text": "def maximal_length\n if !self.value....
34580d6055330614104051771d027420
Instance method delegates to class method for convenience
[ { "docid": "6a6e7fed2a79ff3f88ecd2f7a9a4dfb5", "score": "0.0", "text": "def scan_timeout_adjustment_multiplier\n self.class.scan_timeout_adjustment_multiplier\n end", "title": "" } ]
[ { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.68764377", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.68764377", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", ...
b38cdb26786810697cfa4e33436d547a
DELETE /Developers/1 DELETE /Developers/1.json
[ { "docid": "5dddc1a93dcc8ed207b2d3091922e64d", "score": "0.72032815", "text": "def destroy\n @developer.destroy\n respond_to do |format|\n format.html { redirect_to developers_url, notice: 'Developer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "5636471ae0da32ebf652f93a736f2a3e", "score": "0.75167733", "text": "def destroy\n @developer = Developer.find(params[:id])\n @developer.destroy\n\n respond_to do |format|\n format.html { redirect_to developers_url }\n format.json { head :no_content }\n end\n end", "...