query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
0edd19f71bf997dd91f3dc5afcb4b3d7
GET /phonetic_forms/1 GET /phonetic_forms/1.xml
[ { "docid": "76e12bf9ab1d0433c8e93a32d9a95a3f", "score": "0.7435114", "text": "def show\n @phonetic_form = PhoneticForm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @phonetic_form }\n end\n end", "title": "" } ]
[ { "docid": "312798fa69ee7bcd7be50e37da3e8505", "score": "0.666303", "text": "def retrieve_forms()\n start.uri('/api/form')\n .get()\n .go()\n end", "title": "" }, { "docid": "13aefead838a0046350eb8dfc3a85237", "score": "0.6116305", "text": "def index\n @f...
f6654695d326618da1c56db91bb9bb89
destroy session on logout
[ { "docid": "7fd7c7e971c73d0a0049718e321bf5c8", "score": "0.0", "text": "def destroy\n\t\treset_session\n\t\tredirect_to new_session_path\n\tend", "title": "" } ]
[ { "docid": "b07db6ff2fde1bb530fa87fd8ce1a43d", "score": "0.86395377", "text": "def logout\n close_session\n end", "title": "" }, { "docid": "ad145ec652e20d8212350f39e24cc987", "score": "0.8515137", "text": "def logout!\n session.clear\n end", "title": "" }, { "doc...
d33cbee43783f971465b63a5527034ac
Gets the access control policy for an backup resource. Returns an empty policy if an backup exists but does not have a policy set.
[ { "docid": "fbdb91a1e4ef80bf20085faea63d7c26", "score": "0.7263156", "text": "def get_backup_policy instance_id, cluster_id, backup_id\n tables.get_iam_policy resource: backup_path(instance_id, cluster_id, backup_id)\n end", "title": "" } ]
[ { "docid": "b23520597ef6a7a925bbc075e98eef38", "score": "0.5722904", "text": "def current_policy\n @current_policy ||= ::AccessPolicy.new(User.find(current_user.id))\n end", "title": "" }, { "docid": "e1919fe3e765633ef01c294a10a08718", "score": "0.5691375", "text": "def policy(re...
7281ccb036fd382f2c26da04e53befef
Author Tony Su 2/27 Fills in field of contact_email,check if user enter a valid osu email
[ { "docid": "44fdea2b3198554cdfe221bf4b8fdabc", "score": "0.80255103", "text": "def contact_email\n puts \"Please enter your email:\"\n email = gets.chomp!\n # check the format of the email address. The email address must be a osu email.\n until email =~ /[a-z][a-z]*\\.[1-9]\\...
[ { "docid": "1ac5e37ee0a9b904fbd29369c246d377", "score": "0.80674887", "text": "def validate_contact_fields\n (@contact[:email] =~ Authlogic::Regex.email && @contact[:name] != '' && @contact[:message] != '')\n end", "title": "" }, { "docid": "488b5333cded731fd686e64b2b33dbfa", "score"...
a3726f33b06ba7dcac4140ff08f99572
before_save :capitalize_name accepts_nested_attributes_for :category
[ { "docid": "e7430a393d890c5023d68fb3682092a3", "score": "0.60643816", "text": "def capitalize_name\n self.name = name.capitalize\n end", "title": "" } ]
[ { "docid": "02e735da0a900707a8fb93498acba3c9", "score": "0.684411", "text": "def before_validation_on_create\n self.name_normalized = name.downcase\n end", "title": "" }, { "docid": "4ca8d646bab055f80fbe8cd400cfdc9c", "score": "0.68095607", "text": "def before_validation\n self...
ff89e7d315a2477b2cf549484661f240
GET /items GET /items.xml
[ { "docid": "022517bf40f9d1ee390c7186f34f4e46", "score": "0.0", "text": "def index\n \t@page = params[:page].to_i || 0\n @item_vote = Vote.new\n \tif params[:user_id].blank?\n \t\t@items = Item.page(params[:page]).order('score desc').includes(:user, :comments)\n\t\t\t@title = \"Page #{@page}\" i...
[ { "docid": "d57502db186679bf451e04276f7c18d6", "score": "0.77949274", "text": "def items\n get_request configure_payload('/items')\n end", "title": "" }, { "docid": "5cf88c246c59a555b593493e4faf248b", "score": "0.7594115", "text": "def show\n @item = Item.get!(params[:id])...
e2bdc1d11ef2c6dbde8230a7dd42c133
Set the value of the ProgressPercentComplete input for this Choreo.
[ { "docid": "4ac830cd2968d2a5733b46c42ffec871", "score": "0.7403999", "text": "def set_ProgressPercentComplete(value)\n set_input(\"ProgressPercentComplete\", value)\n end", "title": "" } ]
[ { "docid": "c4f96c9b20ac19b766c2c6b7115b0825", "score": "0.72382534", "text": "def percent_complete=(value)\n @percent_complete = value\n end", "title": "" }, { "docid": "c4f96c9b20ac19b766c2c6b7115b0825", "score": "0.72382534", "text": "def percent_complete...
e8b42952a5490ddcd8cc1f798a74a36a
Policy for determining if the criminal has won The criminal wins provided: 1) the game has started, 2) the detectives haven't won and, 3) no detective can move
[ { "docid": "6223795090e9675ed0a5c3226336cb8e", "score": "0.76289946", "text": "def won?\n @game.started? && !detectives_won? && detectives_cannot_move?\n end", "title": "" } ]
[ { "docid": "e311609293630d0496ea36fb56a5905d", "score": "0.6762392", "text": "def is_game_over?; won_by?(:hunter) || won_by?(:prey) end", "title": "" }, { "docid": "519233c67558b00c5886e14385636649", "score": "0.67466813", "text": "def won?\n won_checker\n end", "title": "" ...
d5086cf576eead7e0fd4e05e568a27b5
GET /flowers GET /flowers.json
[ { "docid": "3c6e5f4164ce068d63e3403601941770", "score": "0.53395003", "text": "def index\n \n @users = User.all\n \n # if params[:user][:email] and params[:flower][:user_id] \n # @flowers = Flower.search(params[:flower][:user_id])\n # else\n # @flowers = Flower.all \n # end\n #...
[ { "docid": "c5f1792d3829a6450b10d3696b743253", "score": "0.7283035", "text": "def index\n @flowers = Flowers.all\n\n end", "title": "" }, { "docid": "ad07d11dd5ad96379bc4bd7aa1267f80", "score": "0.6550597", "text": "def index\n @beerflows = Beerflow.all\n end", "title": "...
70148c42b6ce56537dc848387a4012b6
Update Impression Info . Need Recalculate object.update_impression(title)
[ { "docid": "39a67fd536d901bd9d020e2130ce45c8", "score": "0.7694395", "text": "def update_impression( impression_title, impression_number = 1, is_not_hejia = false, session_id = nil )\n impression_validates( impression_title, impression_number, is_not_hejia, session_id )\n impression_co...
[ { "docid": "102f83da0ce15c4ba61a5015d7f5c8e5", "score": "0.6943105", "text": "def impression!\n self.update(visits_count: (self.visits_count || 0) + 1, last_visited_at: Time.now)\n end", "title": "" }, { "docid": "8395b951d909c4d700830919654dc81b", "score": "0.69103074", "text": ...
40b7ec770b7e634b9b0fb7b780bf9acc
Get settings for all buckets
[ { "docid": "ec5cf09a148a0319999d75e803590baa", "score": "0.7838795", "text": "def get_all_buckets(options = Options::Bucket::GetAllBuckets.new)\n @backend.bucket_get_all(options.to_backend)\n .map { |entry| extract_bucket_settings(entry) }\n end", "title": "" } ]
[ { "docid": "39eacafa268f2c26e2f06333adfc3952", "score": "0.7760924", "text": "def get_all_buckets(options = GetAllBucketsOptions.new)\n res = @backend.bucket_get_all(options.timeout)\n res.map(&method(:extract_bucket_settings))\n end", "title": "" }, { "docid": "cf364b2f4c...
a626d073b0d8cf866419244138d1aa14
DELETE resource by id
[ { "docid": "c32a900dbd48fef920e13412c5e973aa", "score": "0.0", "text": "def destroy\n uuid = params[:id]\n upload = Upload.by_user(current_user).with_hash(uuid).first\n file = upload.path\n File.delete(file) if File.exist?(file)\n upload.destroy\n flash[:notice] = \"File deleted.\"\n ...
[ { "docid": "1d5552e89b4c0924bd7433e07b945a4a", "score": "0.8538552", "text": "def destroy(id)\n handle(delete \"#{resource_path}/#{id}\")\n end", "title": "" }, { "docid": "0108b9f58eb9d3df642968dbc1ef2ace", "score": "0.84773767", "text": "def delete(resource, id)\n ...
c9f95bb6b1c271e9fe873127c83ff166
protected Access Specifier=Method is accessible only in the child class.
[ { "docid": "81a2c056acf5f593ebed8929175e5b3d", "score": "0.0", "text": "def department\n\t\tputs \"I Am In Sales Department\"\n\tend", "title": "" } ]
[ { "docid": "ff7bd9ba439857b999472c0cd10dda56", "score": "0.78312457", "text": "def access_protected\n \tc2=Child.new\n \tc2.method_c\n end", "title": "" }, { "docid": "2a5d5b46a63c804a33474e5ed4c393f2", "score": "0.73683757", "text": "def protected_method\n\tend", "title...
d592511cae6437bc1f52541c522041aa
GET /data_processings GET /data_processings.json
[ { "docid": "8ab80518a82ac58076e4193e1a670898", "score": "0.6211461", "text": "def index\n if current_user\n @data_processings = current_user.data_processings.all\n else\n redirect_to signin_path, notice: 'Please sign in first.'\n end\n end", "title": "" } ]
[ { "docid": "2bc5a4e7cc5fbda52c4405af8865df92", "score": "0.6586309", "text": "def index\n @processings = Processing.all\n end", "title": "" }, { "docid": "2bc5a4e7cc5fbda52c4405af8865df92", "score": "0.6586309", "text": "def index\n @processings = Processing.all\n end", "...
9494d3fc24ae2ff6befd7316d7341b9e
Sends a sms and return false if something goes wrong
[ { "docid": "4bc12fea1e9fcb32f68341d382a5582d", "score": "0.63451695", "text": "def deliver\n begin\n deliver!\n true\n rescue DeliverError, InvalidPhoneNumberNumeraticly, InvalidPhoneNumberLength,\n InvalidPhoneNumber, InvalidSmsPropertis => e\n false\n en...
[ { "docid": "fd1518a0abaf5979001fe84572293087", "score": "0.79500586", "text": "def sends_sms?\n false\n end", "title": "" }, { "docid": "3e256478d5b856e6466ca6ce11ce6c18", "score": "0.76739144", "text": "def deliver\n\t\tsmser = self.meta_data[:smser].constantize\n\t\tsms = smser...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "f19c11bbac86644d1e441d519006eeed", "score": "0.0", "text": "def set_graduation_semester\n @graduation_semester = GraduationSemester.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...
c61d6f2e1ba26c3757be20b8ea549617
Return the first found shortest word
[ { "docid": "98a76c1588e8394d2405f4686620b754", "score": "0.7619012", "text": "def get_the_shortest_word(str)\n str.split(\" \").sort! {|s, l| s.length <=> l.length}[0]\nend", "title": "" } ]
[ { "docid": "905248a7beb0c24c914b0c2f49fddf50", "score": "0.811125", "text": "def shortest_string(list_of_words)\n return nil if no_string?(list_of_words)\n return list_of_words[0] if one_string?(list_of_words)\n \telse\n \t\tfirst_word = list_of_words[0]\n \t\tx = 1\n \t\twhile x < list_of_words.l...
ba6b32079abf479f792c38bb7014c322
Moves the server to another region. This will cause a voice interruption of at most a second.
[ { "docid": "c454a81d7b978c4eec8802c090c99233", "score": "0.0", "text": "def region=(region)\n update_server_data(region: region.to_s)\n end", "title": "" } ]
[ { "docid": "38d73ca58c9539095f32d0259cb6dce2", "score": "0.5742579", "text": "def switch_to\n Esi::Client.current = self\n end", "title": "" }, { "docid": "872675ae5b43026acb73d4157ae32d78", "score": "0.54521227", "text": "def turn\r\n place = current_player.select_place(s...
2729d80fde151b48d59f62ebc4261180
GET /stocklevels GET /stocklevels.json
[ { "docid": "7e1ac82048d5d0ea96b29c752713c38f", "score": "0.73704666", "text": "def index\n @stocklevels = Stocklevel.all\n end", "title": "" } ]
[ { "docid": "fa7e499b5d0234255c9239e27cfd7011", "score": "0.7463142", "text": "def index\n @stock_levels = StockLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stock_levels }\n end\n end", "title": "" }, { "docid": "c5363cf...
a871fe3a918b5ecafa7941a1eedb6c07
returns the author mail if found, otherwise author itself
[ { "docid": "b515cfa8632ab1f294cae47b629fee72", "score": "0.7065403", "text": "def trac_mail(author)\n return @trac_mails_cache[author] if @trac_mails_cache.has_key?(author)\n # tries to retrieve the email from trac db\n data = @trac.sessions.select(:value).where('name = \"email\" AND sid = ?', ...
[ { "docid": "a1029dd3c808ba4c91b5b1ca0a2b512e", "score": "0.8047113", "text": "def email\n return @author_data[:email] unless @author_data == nil\n pick_first_node(@author.css('email'))\n end", "title": "" }, { "docid": "df7d029125051c8249751b2f5b54aebe", "score": "0.7959158"...
5d7f9e63d027c923de37ee6ad75866a7
delete the unwanted project
[ { "docid": "b86c72727257a888dee7a6107fdf0f51", "score": "0.6823195", "text": "def backend_deleteProject(param) \n @Projects.delete(param) if @Projects.include? param \n end", "title": "" } ]
[ { "docid": "b3b0af42cfa97aea6d01a763ee67d692", "score": "0.75012106", "text": "def purge\n @projects = []\n end", "title": "" }, { "docid": "b3b0af42cfa97aea6d01a763ee67d692", "score": "0.75012106", "text": "def purge\n @projects = []\n end", "title": "" }, { ...
cbe26316a6891ad4c3b06d047512b404
GET /drafts GET /drafts.xml
[ { "docid": "c500ee9d46fc7c312973cd7840ec28e3", "score": "0.760655", "text": "def index\n @drafts = Draft.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @drafts }\n end\n end", "title": "" } ]
[ { "docid": "bffa0dcde477ce22fb2cbaa12267e218", "score": "0.7388866", "text": "def get_published_drafts\n service_response = SandboxManagement::CmsConfigurator::GetPublishedDraft.new(params).perform\n render_api_response(service_response)\n end", "title": "" }, { "docid": "229e1e81378e...
b33e8ba043dc6a77b4423b3af67ae194
Builds the object from hash
[ { "docid": "64cc12bc97b62716d4882a58f0b6d473", "score": "0.0", "text": "def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n self.class.openapi_types.each_pair do |key, type|\n if type =~ /\\AArray<(.*)>/i\n # check to ensure the input is an array given ...
[ { "docid": "e2e77e3d4692b97a7841734d5d35a0ec", "score": "0.7569031", "text": "def from_hash(hash); end", "title": "" }, { "docid": "e2e77e3d4692b97a7841734d5d35a0ec", "score": "0.7569031", "text": "def from_hash(hash); end", "title": "" }, { "docid": "e2e77e3d4692b97a7841...
3562eca541cfb4a610e4e0fff565607c
PUT /subscriptions/1 PUT /subscriptions/1.json
[ { "docid": "df5afc2d3de86efe8ecca0a4bb9aa7f0", "score": "0.69446677", "text": "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription, notice: 'Subscrip...
[ { "docid": "14458856ea03e1d6eae93ecbabdbb7d7", "score": "0.7331192", "text": "def update\n @subscription = Subscription.get(params[:id])\n @subscription.update(params[:subscription])\n respond_with(@subscription.reload)\n end", "title": "" }, { "docid": "22587dbfce45333a597b8fd5df7...
d1c8aeec996c10b9553c5a69f8a24c3b
Enumerates through the operations specified in the API configuration (yaml configuration file found in lib/api_config/) and defines a request and a response handler for each operation.
[ { "docid": "ca29d82e8955bada990547086ca1657e", "score": "0.7931368", "text": "def define_handlers\n namespace = api_config[:namespace]\n api_config[:operations].each_pair do |method,operation|\n input_handlers[method] = InputHandler.new(namespace, operation)\n output_hand...
[ { "docid": "0c11c798d73c554144666417d5aea7da", "score": "0.630734", "text": "def define_actions(config)\n router.member do\n config.member_actions.each { |action| build_action(action) }\n end\n\n router.collection do\n config.collection_actions.each { |action| build_action(a...
0bd38b8f580a2d47b0449a5ac0c52202
row below, the maximum total from top to bottom is 23. 3 7 4 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. Find the maximum total from top to bottom of the triangle below: 75 95 64 17 47 82 18 35 87 10 20 04 82 47 65 19 01 23 75 03 34 88 02 77 73 07 63 67 99 65 04 28 06 16 70 92 41 41 26 56 83 40 80 70 33 41 48 72 33 47 3...
[ { "docid": "4f033e2a997921a234a94289368dbc5c", "score": "0.0", "text": "def read_map(filename)\n file_data = []\n\n File.open(filename, 'r') do |file|\n file.each_line do |line|\n index = 0\n line_hash = {}\n line_data = line.split(' ')\n line_data.length.times do\n line_...
[ { "docid": "45b0e24912ca4ad5d6fa95948fc090db", "score": "0.7835834", "text": "def path_sum()\n triangle = \"75\n 95 64\n 17 47 82\n 18 35 87 10\n 20 04 82 47 65\n 19 01 23 75 03 34\n 88 02 77 73 07 63 67\n 99 65 ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "12b18dbb9d38a7dd34e07c0ee2e9d851", "score": "0.0", "text": "def candidate_params\n params.require(:candidate).permit(:name, :plan, :loaction, :image)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69780594", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.678054", "text": "def strong_params\n params.requi...
86ea40f6a323412edd24065135b8783a
WAMP Client Connects to WAMP server, after connection client should receve WELCOME message from server. Client can then register prefix, call, subscribe, unsubscribe, and publish
[ { "docid": "d038dfb237f69a6220dcac9e29f1c727", "score": "0.51426", "text": "def initialize(options = {})\n @ws_server = options[:host] || \"ws://localhost:9000\"\n @protocols = options[:protocols]\n @headers = options[:headers]\n @id = nil\n @socket = nil\n @wamp_protoc...
[ { "docid": "9e250cde73a5225d1330394a70be3e06", "score": "0.6718075", "text": "def initial_message\n Kh.call(:server_connect)\n post @socket, server_name, RPL_WELCOME, @nick, \"Welcome to the Internet Relay Network #{@prefix}\"\n post @socket, server_name, RPL_YOURHOST, @nick, \"Your host is #{...
4f8affe749c9d4bd255bbd560ce148f6
["A", "B", "C", "A", "B", "C", "A", "B", "C", "A", "B", "C"]
[ { "docid": "841f5e6362e1df7f66590e983a1b26d3", "score": "0.0", "text": "def custom_multiply(array, number)\n # Return a new array with the array that's passed in\n # as an argument multiplied by the number argument\n result = []\n number.times { array.each { |elem| result << elem } }\n result\n...
[ { "docid": "4ae56c9fcf2518753163cd988b137054", "score": "0.640742", "text": "def given\n [6,5,3,1,8,7,2,3]\nend", "title": "" }, { "docid": "8e100e7d731d8509cd22d4e7bbd2badc", "score": "0.61931616", "text": "def alphabet\n Set.new(to_a.flatten!.uniq!)\n end", "title": "" }...
1dcc744290245a6becefa804768c3498
rubocop:disable Metrics/MethodLength rubocop:disable Metrics/AbcSize method to execute normal migration
[ { "docid": "01628ffea48b2e2b8aac2790ff0c7b20", "score": "0.6061395", "text": "def normal\n msg = @database_reversed ? 'Starting an abnormal migration (KAWALE CASE)' : 'Starting a normal migration'\n print_time message: msg, long_form: true\n ANCMappingMigration.new(@database, @confidence)...
[ { "docid": "4853d7c5f5d4f8ccd71178af47db6e83", "score": "0.8094061", "text": "def run_migration; end", "title": "" }, { "docid": "16bf051cc67b978a255660570dca38e8", "score": "0.71798044", "text": "def execute_migrations!\n migrations = [MakeStandardTables, FixAttachmentsPolymorphi...
6908e2d5511d53eb38c648b2c6dda7a1
set engine to be used.
[ { "docid": "f2dd3580f9dba7da7964b9e6f0509e6d", "score": "0.6823498", "text": "def engine engine = nil, ext = nil\n if engine && configurable?\n @engine = engine_supported?(engine)\n @ext = ext || guess_extension(@engine)\n end\n @setup[:engine] ||= @engine ||\n ...
[ { "docid": "f109379d140252194489b39155ba04aa", "score": "0.8583273", "text": "def engine= engine\n @engine = engine\n end", "title": "" }, { "docid": "bce51e1cf78e8aeb8d89c5c0c012edaa", "score": "0.81204355", "text": "def engine=(engine)\n @engines = [engine]\n end", ...
9756b564b83da001ab448968ddcfae28
Adds new review to db
[ { "docid": "268abc44cae432d74a0bbeac9f9148e0", "score": "0.0", "text": "def new\n @review = Review.new(batch_id: params[:batch_id])\n end", "title": "" } ]
[ { "docid": "f41c6f715ec0aa3ffdccb1256371b29f", "score": "0.7769358", "text": "def add_review(review)\n @review = review\n end", "title": "" }, { "docid": "3724b1c265de7b63cfa559bdc6606bf8", "score": "0.7560579", "text": "def add_review\n cheer_up = CheerUp.find(params[:id])\n ...
4f95dd261340afd9668b89752194d3d0
GET /questions/1/answers/new GET /questions/1/answers/new.xml
[ { "docid": "e738e8d357d9ed7f77e03f238dfb970b", "score": "0.76661587", "text": "def new\n @question = Question.find(params[:question_id])\n @answer = @question.answers.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @answer }\n end\n end",...
[ { "docid": "d14276cc678279d434ff0be31764d9ac", "score": "0.7349718", "text": "def new\n @answer = Answer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @answer }\n end\n end", "title": "" }, { "docid": "d14276cc678279d434ff0be31...
367ad797656b598dcd73d0eba51e29e8
flag indicate if EyeTv record an Program
[ { "docid": "2e3ba0fe7c540ed7afda48c8b36c2cb1", "score": "0.0", "text": "def is_recording?\n @instance.is_recording.get\n end", "title": "" } ]
[ { "docid": "a005b501c8a8d65904a06bbe7a03db48", "score": "0.5908073", "text": "def is_recording?\n eyetv_instance.is_recording?\n end", "title": "" }, { "docid": "0113252fcd265ecc58cb9dac320a1ade", "score": "0.58252954", "text": "def record_mode?\n !replay_mode?\n end", ...
ed0f799d8b7982167ea6d55bb14c2316
Merges config with default values
[ { "docid": "808eb721ed400d28c7b02a7ce7cba02b", "score": "0.0", "text": "def torrent\n @torrent_config ||= {\n 'announce' => 'udp://9.rarbg.to:2710/announce',\n 'file' => 'site.torrent',\n 'flags' => '',\n 'bin' => 'transmission-create'\n }.me...
[ { "docid": "2c18e09fd849b5bb9fcc74dbfed08a93", "score": "0.8348972", "text": "def merge_defaults!(config)\n MERGE_DEFAULT.each do |option|\n if config[option].kind_of?(Array)\n config[option] = (DEFAULTS[option] | config[option])\n end\n end\n\n config\n end", ...
3090bb0de1e617b0c011031aea5840b3
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
[ { "docid": "9936e97bebc2697cad33b8ee458448f5", "score": "0.6091408", "text": "def climb_stairs(n)\n if n == 0 || n == 1 || n == 2\n return n\n else\n return climb_stairs(n-1)+climb_stairs(n-2)\n end\nend", "title": "" } ]
[ { "docid": "b1018eadd4b10110a5dc470043edce1c", "score": "0.6833995", "text": "def climb_stairs(steps)\n return steps if steps <= 2\n cache = {}\n cache[1] = 1\n cache[2] = 2\n 3.upto(steps) do |n|\n cache[n] = cache[n - 2] + cache[n - 1]\n end\n cache[steps]\nend", "title": "" }, { ...
86db732410d2c574e4973394d5f9ddb4
Public: Creates a copy of this Queue. Returns the copy of this Queue.
[ { "docid": "e9bd29898fea12fa9f2e17e4a7ceabb3", "score": "0.0", "text": "def show\n self.dup\n end", "title": "" } ]
[ { "docid": "f55989cb3d1c4a0780a7544ba38c4b54", "score": "0.8014784", "text": "def dup\n copy = Queue.new\n copy.size = @size\n copy.elements = @elements\n copy\n end", "title": "" }, { "docid": "9eecdb3a316bea40fce461fb81b7d31d", "score": "0.68715227", "text": "def copy\...
9ad436dcee22b68e9ac11a7985062606
Sets the properties property value. Property values of the test object.
[ { "docid": "51a59f953548d1eff10532bdffdd8df9", "score": "0.762683", "text": "def properties=(value)\n @properties = value\n end", "title": "" } ]
[ { "docid": "ec2cf9748f851781405bf9687a3d1f28", "score": "0.7009998", "text": "def set_properties(properties)\n @properties = properties\n end", "title": "" }, { "docid": "ec2cf9748f851781405bf9687a3d1f28", "score": "0.7009998", "text": "def set_properties(properties)\n ...
c566fffd4082c0d98c97a8f12cf8ed59
GET /organizations/:organization_id/activity_reports GET /organizations/:organization_id/activity_reports.xml
[ { "docid": "153ad3638153d3299a756dc1b4a78c45", "score": "0.5834027", "text": "def index\n @search = params[:search] || Hash.new\n @search.each do |k,v|\n if !v.blank? && ActivityReport::SEARCHABLE.include?( k.to_sym )\n @activity_reports = @activity_reports.send k, v\n end\n en...
[ { "docid": "5287660ffc1da7d33d5de8abe3f2ebbf", "score": "0.6677111", "text": "def xml_report\n RestClient::get \"#{base}/OTHER/core/other/xmlreport/\"\n end", "title": "" }, { "docid": "a378256ce3d6338af7180ff544f22b3c", "score": "0.66589576", "text": "def xml_repor...
636b6059b2defcc608ac00657a68b996
POST /universes POST /universes.json
[ { "docid": "647517da1eea134180d57df2e4db228b", "score": "0.5372722", "text": "def create\n @universe = Universe.new(universe_params)\n\n respond_to do |format|\n if @universe.save\n format.html { redirect_to @universe, notice: 'Universe was successfully created.' }\n format.json...
[ { "docid": "bc214e2a6226f30ab90a07cb6bf6c1b0", "score": "0.60839945", "text": "def index\n @universes = Universe.all.page(params[:page]).per(25)\n respond_to do |format|\n format.html\n format.json { render json: @universes }\n end\n end", "title": "" }, { "docid": "43239...
f6a7f5adda8cc772d4e4941a7804221e
used for extend and zip
[ { "docid": "a093ba10efad76d6536c6e07264543a1", "score": "0.0", "text": "def initialize\n @head = nil\n end", "title": "" } ]
[ { "docid": "150c3c3890e5b4b6fe4cd199a732601c", "score": "0.72093374", "text": "def zip(*rest) end", "title": "" }, { "docid": "0af21fe2107d58f52354fe891346ab22", "score": "0.66465807", "text": "def custom_zip (arr1, arr2)\n final = []\n arr1.each_with_index do |item, index|\n fi...
e19124954d7a1f9c8268c6a916cc00ad
We operate on `begin` nodes, instead of using `OnMethodDef`, so that we can walk over pairs of consecutive nodes and efficiently access a node's predecessor; prev_node ends up doing a linear scan over siblings, so we don't want to call it on each def.
[ { "docid": "785e249237aece776be796824b0f109c", "score": "0.6821963", "text": "def on_begin(node)\n node.children.each_cons(2) do |prev, n|\n nodes = [prev, n]\n check_defs(nodes) if nodes.all?(&method(:def_node?))\n end\n end", "title": "" } ]
[ { "docid": "e3bdbb99f5ec17a251a55dc4b005e484", "score": "0.7259806", "text": "def visit_begin(node); end", "title": "" }, { "docid": "a6e0e1758c1b9173c7a4da2715993fe3", "score": "0.7105259", "text": "def on_begin(node); end", "title": "" }, { "docid": "4033dea1523d84e5841...
dcde9731daf2dbf973e2bd4667c5edfd
Accessor for the errors, use only if the handler is a Kharon::Handlers::Messages.
[ { "docid": "01490bece6e35aea43ee58cbc36fed6c", "score": "0.74363333", "text": "def errors\n validator.handler.respond_to?(:errors) ? validator.handler.errors : []\n end", "title": "" } ]
[ { "docid": "140840b19c920da07f558533142a9dae", "score": "0.7084517", "text": "def errors\n self.messages.select { |error| error[:type] == :error }\n end", "title": "" }, { "docid": "873560ec887d9cdbdea9077d7274c302", "score": "0.6939432", "text": "def error_messages\n...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "360174317b2e253e7a9ed1e783aada1c", "score": "0.0", "text": "def set_ems_datum\n @ems_datum = EmsDatum.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
0acdf7c8b78add2a21d7e46960b11199
GET /post35s/1 GET /post35s/1.xml
[ { "docid": "598e9990a4222ed527aba6a089b7fa15", "score": "0.6582736", "text": "def show\n @post35 = Post35.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post35 }\n end\n end", "title": "" } ]
[ { "docid": "3e63c437e723150fda53a19aa18e3c49", "score": "0.6391059", "text": "def urlposts_xml_file(url)\n fname = urlpost_fname url\n File.open fname\n end", "title": "" }, { "docid": "25a71f4e99b932e6be094421d675f7d5", "score": "0.6372818", "text": "def show\n @post185 = ...
0b802d5c6df15984500db065d93c8f61
FizzBuzz Creates a method called "fizzbuzz" and declares three variables called "num_1", "num_2", and "range".
[ { "docid": "c6f248bea3398d20dd250a8d9ec58a09", "score": "0.74709827", "text": "def fizzbuzz(num_1, num_2, range)\n# Do i for all the numbers in a range from 1 to the value that will be assigned to the variable \"range\".\n (1..range).each do |i|\n# If i divided by the value assigned to num_1 is equal t...
[ { "docid": "99a37bc8a307402d7ed5ce31f9632a09", "score": "0.8217714", "text": "def fizz_buzz number\nend", "title": "" }, { "docid": "99a37bc8a307402d7ed5ce31f9632a09", "score": "0.8217714", "text": "def fizz_buzz number\nend", "title": "" }, { "docid": "7a5f4ec82b40b6e041...
d90c0b36f1ea1edf9c2cb949fd6ae968
Find the sum of all the multiples of 3 or 5 below 1000.
[ { "docid": "49fd6eacb69e143a9af7849eb85a1ee8", "score": "0.7463829", "text": "def multiples\n (1..999).select { |x| (x % 5 == 0 || x % 3 == 0) }.reduce(:+)\nend", "title": "" } ]
[ { "docid": "f69e9cb8df44a1949b85f902e68b4d98", "score": "0.81432205", "text": "def multiples_of_3_5\n sum = 0\n 1000.times do |i|\n sum += i if i % 3 == 0 || i % 5 == 0\n end\n sum\nend", "title": "" }, { "docid": "691ecdc25455fe6b452eead234e29887", "score": "0.811875", "text"...
dc8d031e09bc9c64ccae297379d88035
replace overridden component (if any) with specified component
[ { "docid": "c1ccb46a2ac1f97f2b0b1b8ec09405c7", "score": "0.5616872", "text": "def inject_component(doc, component)\n doc.root.delete_element(\"//component[@name='#{component.attributes['name']}']\")\n doc.root.add_element component\n end", "title": "" } ]
[ { "docid": "61fe90ce6677a22c0a43281e484e1d20", "score": "0.6217935", "text": "def replace!(oth)\n if self.class != oth.class\n raise ArgumentError, \"expected #{self.class} object\"\n end\n\n component.each do |c|\n self.__send__(\"#{c}=\", oth.__send__(c))\n end\n e...
6b5686eaa66e92128397b3de7aa4b6fc
% sign : (!FIXME) > !FIXME
[ { "docid": "dc37e203356ecddd141d30588e9fe411", "score": "0.61547905", "text": "def sign(p0, p1) end", "title": "" } ]
[ { "docid": "a95a17eaa49f561f77cae8ecba47a238", "score": "0.7060887", "text": "def sign; end", "title": "" }, { "docid": "a95a17eaa49f561f77cae8ecba47a238", "score": "0.7060887", "text": "def sign; end", "title": "" }, { "docid": "2de971d9eed89401efd74f6eaa3773c1", "sc...
da504b7b9b7a238bcfd8604c5e658660
Sets the kioskAppDisplayName property value. Specifies the display text for the account shown on the signin screen which launches the app specified by SetKioskAppUserModelId. Only applies when KioskAppUserModelId is set.
[ { "docid": "0585b1e6151b5b1e5de340cdac4517cb", "score": "0.76605266", "text": "def kiosk_app_display_name=(value)\n @kiosk_app_display_name = value\n end", "title": "" } ]
[ { "docid": "aceb72437e7cb406615db6785eb88fa9", "score": "0.6731288", "text": "def app_display_name=(value)\n @app_display_name = value\n end", "title": "" }, { "docid": "aceb72437e7cb406615db6785eb88fa9", "score": "0.6731288", "text": "def app_display_name=(...
6cccef40752f314da89067b9eefe5d96
POST /manutencoes POST /manutencoes.json
[ { "docid": "83d6006b76d2269e8fae14bc6417f95a", "score": "0.67264193", "text": "def create\n @manutencao = @carro.manutencoes.new(manutencao_params)\n\n respond_to do |format|\n if @manutencao.save\n format.html { redirect_to [@unidade, @patio, @carro, @manutencao], notice: 'Manutencao ...
[ { "docid": "8c12758970d22acb477adbf23a8668a2", "score": "0.6563789", "text": "def create\n @manutencao = Manutencao.new(manutencao_params)\n\n respond_to do |format|\n if @manutencao.save\n format.html { redirect_to manutencoes_url, notice: 'Manutenção criada com sucesso.' }\n f...
8378281d5ff9553cc23796bcccb0cd7b
Find the child pages
[ { "docid": "02a2248202574ff8c6f2cd35de6ee5c8", "score": "0.77082324", "text": "def child_pages options={}\n if content_data.is_humpyard_dynamic_page?\n content_data.child_pages\n else\n if options[:single_root] and is_root_page? \n Page.where([\"parent_id = ? or parent_i...
[ { "docid": "4b8a749bc2e359e9b5f42e43f8227813", "score": "0.80698866", "text": "def child_pages\n content_data.child_pages\n end", "title": "" }, { "docid": "4d1baed93fd651ecc63da2208867cb10", "score": "0.770115", "text": "def pages\n self.children\n end", "tit...
9bfd796e28f9a95d5a60f3cb40bb7b43
Utility method; attempts to make an http/https connection to the puppetdb server. This is abstracted out into a method so that it can be called multiple times for retry attempts.
[ { "docid": "b95ec62e84cc037a4741817945c7c9da", "score": "0.7399313", "text": "def attempt_connection\n # All that we care about is that we are able to connect successfully via\n # http(s), so here we're simpling hitting a somewhat arbitrary low-impact URL\n # on the puppetdb server.\n\n if G...
[ { "docid": "5232dd79b4d09479056585b3ebd96795", "score": "0.7592185", "text": "def attempt_connection\n # All that we care about is that we are able to connect successfully via\n # http(s), so here we're simpling hitting a somewhat arbitrary low-impact URL\n # on the puppetdb server....
84dc24c3b8b777f08138a58e214e18e7
DELETE /wishlist_accounts/1 DELETE /wishlist_accounts/1.json
[ { "docid": "b7fdfc33ff05c47aa853b964baedc472", "score": "0.76240194", "text": "def destroy\n @wishlist_account.destroy\n respond_to do |format|\n format.html { redirect_to chart_of_accounts_path, notice: 'Wishlist account was successfully destroyed.' }\n format.json { head :no_content }\...
[ { "docid": "db082f8f8827c54772886cf85926109b", "score": "0.74313617", "text": "def destroy\n @wishlist.destroy\n respond_to do |format|\n format.html { redirect_to wishlists_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a5a6bfc5de6097f0...
44bd6de307121ee99efd937157e19097
PUT /huatis/1 PUT /huatis/1.json
[ { "docid": "1a5e35aeb8680552ba697e35fab092a1", "score": "0.6202066", "text": "def update\n \n\n respond_to do |format|\n if @huati.update_attributes(params[:huati])\n format.html { redirect_to @huati, notice: 'Huati was successfully updated.' }\n format.json { head :no_content }...
[ { "docid": "d37b39a795a6e081d6480942ece1c538", "score": "0.6581532", "text": "def put!\n request! :put\n end", "title": "" }, { "docid": "54f95a361000b6219275e377b8bf4555", "score": "0.649551", "text": "def update options={}\n client.put(\"/#{id}\", options)\n end", "...
fd3c8bd03ff165db4eafdbb7320b5cce
def find_the_cheese(foods) code an argument here cheese_types = ["cheddar", "gouda", "camembert"] if foods.include?("cheddar") puts "cheddar" elsif foods.include?("gouda") puts "gouda" elsif foods.include?("camembert") puts "camembert" else puts nil end end
[ { "docid": "b03a9b318715539c1c0106896b59b6f8", "score": "0.80156165", "text": "def find_the_cheese(foods)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n if (foods - cheese_types).empty? == true\n puts nil\n else\n cheese_types.find{ |c| foods.include?(c) }\n end\nend", "title":...
[ { "docid": "b907ab8325af23313203940af486e6a7", "score": "0.873067", "text": "def find_the_cheese(stuff)\n # the array below is here to help\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n\n if stuff.include?(\"cheddar\")\n return \"cheddar\"\n elsif stuff.include?(\"gouda\")\n retur...
f15ff84e9c7ea035dce01148068ecc3d
GET /juzgados/1 GET /juzgados/1.json
[ { "docid": "88c756e63a4c81a3007bdcb71513370c", "score": "0.7174362", "text": "def show\n seleccionarMenu(:juzgados)\n @juzgado = Juzgado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @juzgado }\n end\n end", "title": ""...
[ { "docid": "2795a913818efd74cf11153121f22fcc", "score": "0.7205248", "text": "def index\n seleccionarMenu(:juzgados)\n @juzgados = Juzgado.order(:ciudad_id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @juzgados }\n end\n end", "title"...
e1682186aaeab69a8ec0d88feaa72a82
Votes on a post
[ { "docid": "4f1d9d610d8ef5b47e9ab69ed850e4b1", "score": "0.6510633", "text": "def vote(id, voteup)\n db = SQLite3::Database.new(DB_PATH)\n\n if voteup\n db.execute(\"UPDATE posts SET votes=votes+1 WHERE id=?\", id)\n else\n db.execute(\"UPDATE posts SET votes=v...
[ { "docid": "3550a555374d0609a11cae6b46b7562c", "score": "0.8085356", "text": "def voted(post)\n votes.where(post_id: post.id).first\n end", "title": "" }, { "docid": "592621d7a22e66712c9a993b62b781f1", "score": "0.79424703", "text": "def voted(post) #This method takes a post o...
eb4b444cc783586bb4dc3fb30bbba850
GET /cat_prodottos GET /cat_prodottos.json
[ { "docid": "39f6d09c4566f669c65521d423d84a93", "score": "0.69903415", "text": "def index\n @cat_prodottos = CatProdotto.all\n end", "title": "" } ]
[ { "docid": "bf89c01819c5ecab0fe25714c22f3dd1", "score": "0.7168178", "text": "def charcuterie\n @produits = Produit.find_all_by_id_cat (2)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @produits }\n end\n end", "title": "" }, { "doci...
2113c69ca1996d74072e61dbae1e2a66
GET /workout_loggings/1 GET /workout_loggings/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "c5487008fc190cd187c805872bf6037e", "score": "0.76588565", "text": "def index\n @workout_loggings = WorkoutLogging.all\n end", "title": "" }, { "docid": "f84b3d39e64f68078601f0d58e2fad52", "score": "0.6825133", "text": "def set_workout_logging\n @workout_logging =...
604fba739e3bde6ca13dfdf11e6c2dda
checks first character for 1. letter, 2. consonant
[ { "docid": "7390e171fc00feb959cb3ae0d7f46992", "score": "0.7742007", "text": "def starts_with_consonant?(s)\n\ts.downcase!\n\tletter = /[a-z]/.match(s.chr) != nil\n\tconsonant = /[^aeiou]/.match(s.chr) != nil\n\treturn letter && consonant\nend", "title": "" } ]
[ { "docid": "f01d20f0dc15fe736fca577e3abf1f91", "score": "0.8271667", "text": "def starts_with_consonant? s\n if (s == nil) or (s == '')\n return false\n\tend\n\n stringeroni = s.to_s\n lowString = stringeroni.downcase\n charArray = lowString.split('') # turn it into a char array\n first = charAr...
ec4d9ddf873f15e290044a5ad281716a
=begin execs a batch_generator__ definition =end
[ { "docid": "a6bf80c2f8c6ed72414501d292b0707c", "score": "0.811263", "text": "def exec__batch_generator batch_generator\n batch_commands batch__from_batch_generator batch_generator\n end", "title": "" } ]
[ { "docid": "3ccb47625adc83b7b0a77e1b21b9e3a2", "score": "0.6992839", "text": "def generators(&blk); end", "title": "" }, { "docid": "3ccb47625adc83b7b0a77e1b21b9e3a2", "score": "0.6992839", "text": "def generators(&blk); end", "title": "" }, { "docid": "4634b3dbab2d3c1a5c...
2e95fc4327bc04b89ce35573847206fe
GET /web_slides/new GET /web_slides/new.xml
[ { "docid": "024ab0ecbe36077c862af5440eb3d947", "score": "0.76950556", "text": "def new\n @web_slide = WebSlide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @web_slide }\n end\n end", "title": "" } ]
[ { "docid": "643ad619b55f29051dc9ecbf9a0f44a7", "score": "0.73684037", "text": "def new\n @rss_slide = RssSlide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rss_slide }\n end\n end", "title": "" }, { "docid": "369a48659a7a484c...
8f38a49562f32a2fcf5cfcdef183535d
GET /topic_attributes/1 GET /topic_attributes/1.xml
[ { "docid": "22c74cccf629bb95a3a9648e2485beeb", "score": "0.7269116", "text": "def show\n @topic_attribute = TopicAttribute.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @topic_attribute }\n end\n end", "title": "" } ]
[ { "docid": "2cbb7e4b043e01a0b54a00f3333dc146", "score": "0.7190722", "text": "def index\n @topic_attributes = TopicAttribute.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @topic_attributes }\n end\n end", "title": "" }, { ...
8b87f050f67c9ad76ff042793551be99
Method to write decoded photo to swap directory
[ { "docid": "3ae81fec8d306072a2466a5227505602", "score": "0.78100127", "text": "def write_swap_file(filename, decoded_image)\n\n f = File.new \"./public/swap/#{filename}\", \"wb\"\n # f = File.new \"../public/swap/#{filename}\", \"wb\" # inline testing path\n f.write(decoded_image)\n f.close if f\n\...
[ { "docid": "3c0480959aa7b4c17d6ba30b7e3223ae", "score": "0.77819914", "text": "def write_swap_file(filename, decoded_image)\n\n f = File.new \"./public/swap/#{filename}\", \"wb\"\n f.write(decoded_image)\n f.close if f\n\n end", "title": "" }, { "docid": "8adbf582854c465504b32a74de...
623dc560b790160729bfb68ddd5f9395
Returns a skin information by name.
[ { "docid": "2355f811e0c31a19c3f4c7119a9d82cf", "score": "0.72557986", "text": "def form_skin_by_name(skin_name)\n @form_skins[skin_name.to_sym]\n end", "title": "" } ]
[ { "docid": "83b659645670ffac3c17992293a2375e", "score": "0.6506688", "text": "def skinName\n \"IM_GONNA_CUT_YOU_SO_BAD_YOU_GONNA_WISH_I_DIDNT_CUT_YOU_SO_BAD\"\n end", "title": "" }, { "docid": "df3937e508b475c5f3065024cc72f26c", "score": "0.62143695", "text": "def find_by_nam...
1707c473d4736160944ec21fa3e9330b
/ last Retourne le dernier message d'erreur
[ { "docid": "330d6e6cc8b592a6e0cf1c904a8eda1e", "score": "0.7118204", "text": "def last_error\n (@errors || []).last\n end", "title": "" } ]
[ { "docid": "0ecbee4d3c3b9f122e42ddc3a6c02c15", "score": "0.80415213", "text": "def error\n @last_error ||= \"[LaTexBook] Aucune erreur rencontrée\"\n end", "title": "" }, { "docid": "374bbfd18c714fb6460b5a8001223d05", "score": "0.77027154", "text": "def last_error\n @message...
60164a6755350c102b6fdf69b32dd82f
extract image's postfix,witch is the format of the special image
[ { "docid": "be495c59b93b7d983c528983ea6affca", "score": "0.5469138", "text": "def extract_image_format(img_url)\n format = img_url.scan(/.jpg|.gif|.png/).first if img_url\n return format || '.jpg'\n end", "title": "" } ]
[ { "docid": "f7ff47ce8cccfdd2e8e7758c83b5398f", "score": "0.63698584", "text": "def blanky_image!(input)\n input.gsub!(REGEX_IMAGE) do\n data = $LAST_MATCH_INFO\n b(:bang, data: data) + m(:alt, data: data) + b(:sep, data: data) + b(:src, data: data) + b(:eot, data: data)\n end\n end", ...
e6d3c25eaf5fb296165e96ed0081a87f
Example tags ["zagatrated","brunch","fried chicken","ice cream"]
[ { "docid": "254bca6c8643d7e38af72515be5cec8a", "score": "0.0", "text": "def filter_by_tag(tag)\n get_venues_for_filtering if @venues_to_filter.empty?\n @venues_by_tag = []\n @venues_to_filter.each do |venue|\n venue[\"tags\"].each do |venue_tag|\n if venue_tag.downcase == tag.downca...
[ { "docid": "aa1a3c317604cd6ec0cb189d075a8e9e", "score": "0.7598202", "text": "def tag_list\n #tags sie bierze z asocjacji\n tags.map { |t| t.name }.join(\",\")\n end", "title": "" }, { "docid": "a884c49b76badeb8db3e2a64574815b3", "score": "0.742346", "text": "def tag_list\n ...
530790a4d746107e6ba899ae632bf263
A method to setup Pry::Slop commands so it can parse the subcommands your command expects. If you need to set up default values, use `setup` instead.
[ { "docid": "e6c0c6714a5cc9467f69e06b40393e0c", "score": "0.591255", "text": "def subcommands(cmd); end", "title": "" } ]
[ { "docid": "98cc1c80faf85de6b512130adacf3b8f", "score": "0.63440937", "text": "def set_commands; end", "title": "" }, { "docid": "10ba9a5d2cee3371f32f066899a05de1", "score": "0.6321637", "text": "def command_setup(args)\n setup(args)\n end", "title": "" }, { "doci...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "343350a7f1f2474ccaa932004a82dd71", "score": "0.0", "text": "def delegate_params\n params.require(:delegate).permit(:state, :name_last, :name_first, :links)\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...
d89d065939ceccf5ce8d3cff5e06c49a
> PAWN PROMOTION < checks to see if a pawn is promotable.
[ { "docid": "5445ad19836a6708b19d9cc3d5179e9a", "score": "0.5875739", "text": "def promotable?(x, y)\n x\n return true if y == 7 && color == \"WHITE\" || y == 0 && color == \"BLACK\"\n false\n end", "title": "" } ]
[ { "docid": "2a649a9386d15f7d608b42c75881f1e3", "score": "0.6975111", "text": "def check_promote_pawn\n @grid[0].each do |square|\n if (square != nil && square.type == \"P \" && square.color == :white)\n return square\n end\n end\n\n @grid[7].each do |square|\n if (square !...
66c36455a8055f110bfd1d6d60a82f54
Returns a mutable options hash with symbolized keys. Optionally, returns only the keys given.
[ { "docid": "c7c652802539cb472855c971181bdf26", "score": "0.79346174", "text": "def symbolized_options(*keys) # :nodoc:\n @symbolized_options ||= begin\n opts = {}.merge(options)\n opts.merge! saved_options if saved_options?\n opts.symbolize_keys\n end\n @symbolized_op...
[ { "docid": "02b1cbab9aa370ca4f71b668e2d25874", "score": "0.7740102", "text": "def symbolize_keys\n inject({}) do |options, (key, value)|\n options[key.to_sym] = value\n options\n end\n end", "title": "" }, { "docid": "02b1cbab9aa370ca4f71b668e2d25874", "score":...
1c3c4a14e2db36918962e0f0d412c50d
Delete content of specified URL.
[ { "docid": "2d792a259658d5bad90d969a86f66043", "score": "0.0", "text": "def delete(endpoint_base, endpoint_path, headers = {})\n headers = API::DEFAULT_HEADERS.merge(headers)\n httpclient.delete(endpoint_base + endpoint_path, headers)\n end", "title": "" } ]
[ { "docid": "b872245a960e1cd6ec5de2255047b265", "score": "0.80458695", "text": "def delete(url)\n preform(url, :delete) do\n return connection.delete(url)\n end\n end", "title": "" }, { "docid": "06707afed7916d1d18d62e1bb205c172", "score": "0.80182195", "text": "de...
940f06a82c86cb4fef4beb87e1951a88
DELETE /radio_performances/1 DELETE /radio_performances/1.json
[ { "docid": "37cf049c174c210628f1c78815bacde1", "score": "0.7765664", "text": "def destroy\n @radio_performance.destroy\n respond_to do |format|\n format.html { redirect_to radio_performances_url, notice: 'Radio performance was successfully destroyed.' }\n format.json { head :no_content }...
[ { "docid": "cd25c6fccef2503d0743eff8e0e94253", "score": "0.72106135", "text": "def destroy\n @radio = Radio.find(params[:id])\n @radio.destroy\n respond_to do |format|\n format.json { render json: {}, status: :ok }\n end\nend", "title": "" }, { "docid": "b7a8bd0b638cba91b478cfda91a87...
a7d61e91a9f52c933c6b717bf0c0eda4
Retrieve the file path for the ArcLight core Traject configuration
[ { "docid": "e504370a7d47b8475366e4812eb9a6bc", "score": "0.8081728", "text": "def arclight_config_path\n pathname = Rails.root.join(\"lib\", \"pulfalight\", \"traject\", \"ead2_config.rb\")\n pathname.to_s\n end", "title": "" } ]
[ { "docid": "8cdfb5804030dfecf6935c22caf4ec5c", "score": "0.7628061", "text": "def config_file_path\n \"#{@config_path}/#{@config_file}\"\n end", "title": "" }, { "docid": "afa4f35c23cd21b5b1c53d20cfc84529", "score": "0.7569374", "text": "def path\n @config[:path]\n en...
45f1af0c6cd2f62cad001d418c4a351a
PUT /retailer_categories/1 PUT /retailer_categories/1.json
[ { "docid": "d14983d3ce82dab6221b8b4d53a753de", "score": "0.65802073", "text": "def update\n # @retailer_category = RetailerCategory.find(params[:id])\n respond_to do |format|\n if @retailer_category.update_attributes(params[:retailer_category])\n format.html { redirect_to @retailer_cat...
[ { "docid": "d042a4b8d67e19e968d8c4f929e81e33", "score": "0.72162974", "text": "def UpdateCategory params = {}\n \n APICall(path: 'categories.json',method: 'PUT',payload: params.to_json)\n \n end", "title": "" }, { "docid": "8efbadf20853ae8f07589d7714e7a347", "sc...
039b995045a0a3fbd1c9363193e65b68
A font chooser routine. html[:fontcommand] = pick_font
[ { "docid": "9e4a81c8b4ebfd433fff924b332a7f76", "score": "0.6987351", "text": "def pick_font(size, attrs)\n # puts \"FontCmd: #{size} #{attrs}\"\n [ ((attrs =~ /fixed/)? 'courier': 'charter'), \n (12 * (1.2**(size.to_f - 4.0))).to_i, \n ((attrs =~ /italic/)? 'italic': 'roman'), \n ((...
[ { "docid": "5c406ab3dcae057e439bcfdc440cddc7", "score": "0.7446383", "text": "def font(options) end", "title": "" }, { "docid": "7c2faaf7a74f1b2166305830174c9cd7", "score": "0.6683933", "text": "def process_font_name( selector, property, value )\n\t\tprocess_normal_style_attr(selecto...
1b38076990f6f550c190756a435d2a18
PATCH/PUT /disclosures/1 PATCH/PUT /disclosures/1.json
[ { "docid": "f6f14ec9bf7d363be5c71d98b165ae49", "score": "0.6939754", "text": "def update\n respond_to do |format|\n if @disclosure.update(disclosure_params)\n format.html { redirect_to @disclosure, notice: 'Disclosure was successfully updated.' }\n format.json { render :show, statu...
[ { "docid": "cfcf087e11e17dcb2256896c3b8bd49a", "score": "0.716024", "text": "def update\n @disclosure = Disclosure.find(params[:id])\n\n respond_to do |format|\n if @disclosure.update_attributes(disclosure_params)\n format.html { redirect_to disclosures_path, notice: 'Disclosure was su...
11007373710144246a3cef4e3501bf4f
GET /properties/1 GET /properties/1.json
[ { "docid": "667297f6bda7eb5d833166ec0cff274d", "score": "0.0", "text": "def show\n PropertyVisited.create(\n user_id: current_user.id,\n property_id: params[:id]\n ) if current_user\n @contact_request = ContactRequest.new\n end", "title": "" } ]
[ { "docid": "0bf5477934b357705f9f253da9b9b1fe", "score": "0.7496478", "text": "def show\n @property = Property.find(params[:id])\n\n render json: @property\n end", "title": "" }, { "docid": "45e3beeffb8bc807c13b4fe7e42983c5", "score": "0.7347074", "text": "def show\n propert...
861ac246cfb12178a9f509e63123a0c8
Just go through each method linearly and make sure it works.
[ { "docid": "94b5e6634f1b7c70efb6981d5e84914b", "score": "0.5700301", "text": "def test_each_method\n zone = mkzone(\"methodtesting\")\n dirs = %w{/usr /sbin /lib /platform}\n\n %w{/opt/csw}.each do |dir|\n dirs << dir if FileTest.exists? dir\n end\n zone[:inherit] = dirs\n\n [[:co...
[ { "docid": "d2386be050ee209a108b79d4b2b01003", "score": "0.62370086", "text": "def correct_all\n #compare iteration\n\n end", "title": "" }, { "docid": "f7ffa96cefc070fb551f7d47daf0f50c", "score": "0.6182525", "text": "def verify_stubbed_calls\n failed_stubs = []\n ...
559aeb359298ab3adf3310eac541265e
PATCH/PUT /auction1s/1 PATCH/PUT /auction1s/1.json
[ { "docid": "6baff4be22fea1c9dc13b8397e1211f4", "score": "0.0", "text": "def update\n \n respond_to do |format|\n @auction1.update(auction1_params)\n #if @auction1.update(auction1_params)\n # @mensaje= 'Subasta se acutalizo con exito'\n # format.html { redirect_to @auction1,...
[ { "docid": "ac62b52302788506add3c2c14ae1f67a", "score": "0.70635897", "text": "def update\n if @auction.update(auction_params)\n head :no_content\n else\n render json: @auction.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0109dc1853a1e004...
2b8a4469c43e883a8bd1fdea5b190e8e
DELETE /applications/1 DELETE /applications/1.json
[ { "docid": "6d12c4451d200e505e8c4e1dfc40c185", "score": "0.7420919", "text": "def destroy\n @application = Application.find(params[:id])\n @application.destroy\n\n respond_to do |format|\n format.html { redirect_to applications_url }\n format.json { head :no_content }\n end\n end"...
[ { "docid": "9d3132fa4d9f52107547a6a1974a50ab", "score": "0.8000132", "text": "def delete_app name\n try_json delete(\"/app/#{name}\")\n end", "title": "" }, { "docid": "10154da90b783be0d47c884987e275d6", "score": "0.79697895", "text": "def delete_application(application_id)\n...
fd9f519cf93097ea7c0f3043bd6c5cf2
Delete specific version, pass in version object
[ { "docid": "55333ae2df48b1b51a91331e4b375e4e", "score": "0.8455877", "text": "def delete_version(version)\n get_version(version).delete\n load_versions\n end", "title": "" } ]
[ { "docid": "48d88c2c9cb301b94051d4a19a3c27aa", "score": "0.81223404", "text": "def delete(version)\n Backlogjp.base._command \"deleteVersion\", Container.get_id(version)\n end", "title": "" }, { "docid": "b7ec5412d2d2c9a0fbbddfd786111b04", "score": "0.796534", "text": "de...
18fe79012a8a2387e3f67d5b78b0984e
Gets the existing GRE tunnel profile from which this set of GRE profile inherits its unspecified attribute values.
[ { "docid": "7d7196fe9a623cf9b55f6df324855983", "score": "0.45664713", "text": "def default_profile\n super\n end", "title": "" } ]
[ { "docid": "f6c08489cbc91587b1ec1d44b39c8c85", "score": "0.59480774", "text": "def profile\n @profile ||= GATEWAY.get_profile_details(self.profile_id) unless profile_id.nil?\n end", "title": "" }, { "docid": "095061162d8a8970bab4f2768fb16919", "score": "0.5709531", "text": "def p...
f5137ec678a3bdadd2cc9093dc3c4d42
GET /versions/1 GET /versions/1.xml
[ { "docid": "475f5cd9e32f59ca31014c303e0b5dc4", "score": "0.0", "text": "def show\n @version = Version.find(params[:id])\n authorize! :show, @version\n \n # Verify user can view this version. Must be in his product\n authorize_product!(@version.product)\n \n respond_to do |format|\n ...
[ { "docid": "0d5613077b028fac885591800ee4e229", "score": "0.74399596", "text": "def index\n @versions = @page.versions\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @versions }\n end\n end", "title": "" }, { "docid": "1e16761f6f52...
a426c93801b25c5ae019c99a9d75869b
Returns the HTML body for PyPI simple API. Basically a list of package download links for a specific package
[ { "docid": "0eb72cb0de177b42ba590ae31b18236f", "score": "0.5150415", "text": "def body\n <<-HTML\n <!DOCTYPE html>\n <html>\n <head>\n <title>Links for #{escape(name)}</title>\n </head>\n <body>\n <h1>Links for #{escape(name)}</h1>\n ...
[ { "docid": "e1b0fb648f307a15044959f89581dd29", "score": "0.62841856", "text": "def to_html\n dependencies = \"<p class='dependencies'>#{@dependencies}</p>\" if @dependencies && !@dependencies.empty?\n authors = \"<p class='authors'>☺ #{@authors}</p>\" if @authors && !@authors.empty?\n summary =...
83abd98e74b4fc7f3d20e2865ff19fe1
Query the context for the most recent copy of a message by name
[ { "docid": "2bcbd18389364587fd454503fccdfd38", "score": "0.58751684", "text": "def find_by_name( name )\n\t\t\tnamed_message = nil\n\t\t\t@messages.values.each do |message|\n\t\t\t\tif message.descriptor.name == name\n\t\t\t\t\tnamed_message = message\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn named_message\...
[ { "docid": "0ce9e3650582ae106eb21906b29cf0ff", "score": "0.6039128", "text": "def original_message\n @original_message ||= messages.order(:created_at).first\n end", "title": "" }, { "docid": "3852cc45256ae97f65dd7c2cc59fba41", "score": "0.5906281", "text": "def cached_message typ...
0e9b8439c1964578fa7267be2a279df3
PATCH/PUT /reminder_schedules/1 PATCH/PUT /reminder_schedules/1.json
[ { "docid": "7363927020f288e29aa62c52e147652c", "score": "0.7567816", "text": "def update\n respond_to do |format|\n if @reminder_schedule.update(reminder_schedule_params)\n format.html { redirect_to @reminder_schedule, notice: 'Reminder schedule was successfully updated.' }\n forma...
[ { "docid": "1d99621850878d440e3ebafb27d55e78", "score": "0.73126686", "text": "def update\n @reminder_schedule = ReminderSchedule.find(params[:id])\n\n respond_to do |format|\n if @reminder_schedule.update_attributes(params[:reminder_schedule])\n format.html { redirect_to(@reminder_sch...
fa401590ef93b815195b80c0b87241e3
Arguments: input_path path to a directory containing Blocks.txt and UnicodeData.txt output_path output directory for imported YAML files
[ { "docid": "6cbfe39e297c3cd7a83894ab8c891095", "score": "0.0", "text": "def initialize(input_path, output_path)\n @input_path = input_path\n @output_path = output_path\n end", "title": "" } ]
[ { "docid": "46311eae122420f58e0f51d7f330b786", "score": "0.5918719", "text": "def input_filename\n directory = File.dirname(Save.save_filename)\n Dir.mkdir!(directory) unless Dir.exist?(directory)\n File.join(directory, 'input.yml')\n end", "title": "" }, { "docid":...
c3871d5222723b5d7f73ef24ab11e035
Add more helper methods to be used by all tests here...
[ { "docid": "ef0b67a40ade4289e8201876375f54bb", "score": "0.0", "text": "def sign_in(test_user = :king_kong)\n visit new_user_session_path\n fill_in 'Email', with: users(test_user).email\n fill_in 'Password', with: 'password'\n click_on 'Log in'\n end", "title": "" } ]
[ { "docid": "e708ad90e8ce43e3a3a3a99c57b26047", "score": "0.7330966", "text": "def test_legacy_helpers\n assert_equal @patron.primary_phone, @patron.primary_address_phone\n assert_equal @patron.secondary_phone, @patron.secondary_address_phone\n assert_nil @patron.primary_address_mobile_phone\n ...
098ee34862b4a3926c76abb438922ce2
Formats a powershell command using the given script path and arguments. Allows for specifying powershell from a specific installed location. This method is only implemented for Windows. === Parameters shell_script_file_path(String):: shell script file path arguments(Array):: variable stringizable arguments === Returns ...
[ { "docid": "3a977ef9b3842b600dac7058e1bac4c9", "score": "0.77876127", "text": "def format_powershell_command(shell_script_file_path, *arguments)\n return format_powershell_command4(POWERSHELL_V1x0_EXECUTABLE_PATH, nil, nil, shell_script_file_path, *arguments)\n end", "title": "" } ...
[ { "docid": "ba1f1ec88f4f161edcffe091ac668053", "score": "0.74654514", "text": "def format_shell_command(shell_script_file_path, *arguments)\n # special case for powershell scripts.\n extension = File.extname(shell_script_file_path)\n if extension && 0 == POWERSHELL_V1x0_SCRIPT...
99524f0c8fccad86e2c3a82c1494fca8
Return the name for resource variable.
[ { "docid": "fa3712c59ea3b8c06faf89a8a254966a", "score": "0.0", "text": "def resource_name\n :\"@#{controller_name.singularize}\"\n end", "title": "" } ]
[ { "docid": "dfd1ed4aea2a2e7ed279fb721fb0903e", "score": "0.8364149", "text": "def variable_name(resource)\n name = controller.instance_variables.index { |var| controller.instance_variable_get(var) === resources.first }\n name = controller.instance_variables[name].to_s.gsub(/@/, '') if name...
67cc9a3e0baabf6c13bbbbe2dda63f70
Retrieve all usages for device Returns all usages for a device.
[ { "docid": "476636cb09f332ca66dd615ab052a12c", "score": "0.6337441", "text": "def find_device_usages(id, opts = {})\n data, _status_code, _headers = find_device_usages_with_http_info(id, opts)\n data\n end", "title": "" } ]
[ { "docid": "622675d0ec2b8a188a93f68fb648e7ea", "score": "0.671477", "text": "def get_all_devices\n @devices.search(\"device\")\n end", "title": "" }, { "docid": "29bbf3b2f27e76decf6b8979a58c3d96", "score": "0.6505598", "text": "def usages\n @usages\n end", "title": ""...
98511a49f2746edc209b647b7ea8a526
store a value in the Memory instance at address +address+. The value is what is returned by the yielded block, and should be an integer value, while +address+ should be between 0 and +size+
[ { "docid": "57179b8029385698f458cbfbeeb4bc9a", "score": "0.8021678", "text": "def store(address)\n check_address(address)\n value = Integer(yield(address))\n @storage[address]=value\n end", "title": "" } ]
[ { "docid": "e6d307428d906b5d62bbf7abd15b9914", "score": "0.66018087", "text": "def result=(value)\n target_address = @memory[@instruction_pointer + 3]\n @memory[target_address] = value\n end", "title": "" }, { "docid": "7b37eaad78f25959235132ca78089d67", "score": "0.6478848", ...
023017c92a8afd8929438ff380974db7
I really hope all these unassigned fibers are gc'd
[ { "docid": "e3d94e7241c842bd8c229cd180ff6728", "score": "0.0", "text": "def build_cog(&teeth)\n @cog = Fiber.new do |arg_hash|\n Fiber.yield\n loop do\n case out = teeth.call(arg_hash)\n when :reinit\n @args = @reinit_args.dup\n build_cog(&teeth)\n b...
[ { "docid": "6cac67de4ca3a4f14786db438180a6ae", "score": "0.6252751", "text": "def run_gc; end", "title": "" }, { "docid": "aed041e4c4ead52930fb72e57047ae17", "score": "0.62479013", "text": "def garbage_collect\n end", "title": "" }, { "docid": "504dda61ca0dd5ea0deb2ffe...
d2415ac1aa48ad1498f73dd46dda770e
Return a textual description of the CommandSequenceStatus instance The returned string will follow the following pattern: '':'' on '. steps
[ { "docid": "b47790125dcbd7fbdd548e24ded28642", "score": "0.6392508", "text": "def to_s\n \"'#{sequence_id}':'#{@sequence_name}' on '#{@sequence_runner}' started at #{@start_time}.#{@step_states.size} steps\"\n end", "title": "" } ]
[ { "docid": "0d01c9eef1a7ab7effc4430c19a96e59", "score": "0.7162676", "text": "def status_text\n return \"Running\" if running?\n return \"Scheduled\" if !started?\n return \"Passed\" if ended?\n end", "title": "" }, { "docid": "38c0521181069bc2c9a448a005030765", "score": "0.688...
f67bf25442253fdb2a027fc26243acde
def on_casgn(node) scope_node, name, value_node = node if !value_node.nil? node.updated(nil, [ process(scope_node), name, process(value_node) ]) else node.updated(nil, [ process(scope_node), name ]) end end
[ { "docid": "bb0ff10f280ca73dd9e65e42e3ec456c", "score": "0.0", "text": "def block_pass_in_args?(arg_nodes)\n arg_nodes.any? && arg_nodes.last.type == :block_pass\n end", "title": "" } ]
[ { "docid": "70414f0fc0e96bbd9bbb628d80856bd4", "score": "0.734721", "text": "def on_vasgn(node)\n name, value_node = *node\n\n if !value_node.nil?\n node.updated(nil, [\n name, process(value_node)\n ])\n else\n node\n end\n end", ...
c64f184bf09b0beebbabc330db0ae86d
A method to check if the dealer has busted
[ { "docid": "62b29badf13803557d954fd4fb899026", "score": "0.0", "text": "def bust?\n\t\tself.total_points > 21\n\tend", "title": "" } ]
[ { "docid": "ab83362e45d0464f9d46f2f98afa99de", "score": "0.744269", "text": "def check_biller\n true\n end", "title": "" }, { "docid": "cd6cbb8721ef876fc2d812a409f74c8d", "score": "0.73442775", "text": "def busted?\n self.hand.busted?\n end", "title": "" }, { "doc...
b0fbcf134bfb5ae369dfa9baeef9b236
Generates a progress out of current topics status
[ { "docid": "17e58746f31171c5ab0a623eeb3499fe", "score": "0.55464435", "text": "def progress\n return 100 if topics.count < 1\n return 0 if topics.count > 0 and cards.count < 1\n\n alignments = topics.where.not(:aligned_card_id => nil).count\n\n ( (alignments.to_f / topics.count) * 100 ).to_i...
[ { "docid": "c6e665114742afc008e4fd15019a0a9b", "score": "0.63040155", "text": "def progress(status)\n end", "title": "" }, { "docid": "da0f8f93f26d3d5723610a6dafd31b12", "score": "0.59560853", "text": "def progress!\n update!(status: 'In Progress')\n end", "title": "" ...