query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
95e05ed7eace3449cd4c11265fb4c3f1
closeMessage openUnknown A Unknown element has been started tag Tag name of unknown element attributes Unknown element attributes
[ { "docid": "fdec0e799cf102499ff55a87e311b67b", "score": "0.53244615", "text": "def openUnknown(tag, attributes)\r\n if ($DEBUG)\r\n puts \"openUnknown: #{tag}\"\r\n\r\n if(!attributes.empty?)\r\n puts \" Attr:\"\r\n attributes.each do |attr|\r\n puts \" ...
[ { "docid": "5676c0d03b55a358b5121e65134eba30", "score": "0.64037406", "text": "def closeMessage()\r\n puts \"closeMessage\" if $DEBUG\r\n if (inMsg?)\r\n @curRuleSrc += \"</Message>\"\r\n end # if inMsg\r\n end", "title": "" }, { "docid": "2e2dcda286e3d94128564cee62602a52", ...
510fbabe14d5832667c2b6b416cccddd
Identify and describe the Ruby method(s) you implemented. I used for .map! invokes the given block once for each element of self, replacing the element with the value returned by the block. Also I said if n is an interger then n + 1
[ { "docid": "096c6548c41005f8a649e3e360c79bce", "score": "0.0", "text": "def my_hash_modification_method!(my_family_pets_ages, n)\n my_family_pets_ages.each {|key, value| my_family_pets_ages[key] = value + n}\nend", "title": "" } ]
[ { "docid": "25d62389272a258c7be1ecfeb413ceef", "score": "0.6250174", "text": "def my_array_modification_method!(i_want_pets, n)\n i_want_pets.map! {|n| n.is_a?(Integer) ? n + 1 : n}\nend", "title": "" }, { "docid": "25d62389272a258c7be1ecfeb413ceef", "score": "0.6250174", "text": "d...
9b591dd940cc2b935b48bf46db7c8564
GET /denunciantes/1 GET /denunciantes/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "e9470dea650ae44f64be99b795632b46", "score": "0.71931905", "text": "def show\n @denuncia = Denuncia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @denuncia }\n end\n end", "title": "" }, { "docid": "47ae...
2f0e1d2a87a5228fcf853d6aed8b17dd
Debug current time by showing local time / delta / utc time for example: "01207(0820)"
[ { "docid": "f239651052eedbe26f6473c2911e9c4f", "score": "0.0", "text": "def to_utc_comparison_s\n\n per = @zone.period_for_utc(utc)\n off = per.utc_total_offset\n\n off = off / 3600\n off = off >= 0 ? \"+#{off}\" : off.to_s\n\n strftime('%H%M') + off + utc.strftime('(%H%M)')\n ...
[ { "docid": "7ecbc756d9ecb735d7507ea6df14d31b", "score": "0.70501286", "text": "def my_debug_time(msg)\n MorLog.my_debug(msg, true, '%Y-%m-%d %H:%M:%S')\n end", "title": "" }, { "docid": "38fbe789d796440fb5ad9f1d5c721de6", "score": "0.69689566", "text": "def inspect\n \"#{tim...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "8446497ae1637e46c09e596fa9092943", "score": "0.0", "text": "def bankaccount_params\n params.require(:bankaccount).permit(:acc_no, :ifsc, :balance, :bank)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7121987", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70541996", "text": "def expected_permitted_parameter_names; end", "title": "...
f1e3d49868e8ed4433f954cdab9b215b
helper method to call transform and validate output
[ { "docid": "cec2bd8464705d6d7a45378906d1a0bf", "score": "0.62181896", "text": "def transform_validate_records_helper(expected_output, input, selected_counters, error_msg)\n\t\t# strip Timestamp key from Transformed record\n\t\ttransformed_processor_records = @@omi_lib.transform(input.to_json, selected_c...
[ { "docid": "9beb7be53eb5305c63284a0f0a9521ea", "score": "0.7314726", "text": "def transform\n end", "title": "" }, { "docid": "b54564bf1f9a57917e9e36ba50abe060", "score": "0.72983545", "text": "def run_and_transform; end", "title": "" }, { "docid": "2c8e599b8829e8b044b...
428eb66e93d39d3ae373881c6d02832c
before_action :set_house, only:[:new, :create]
[ { "docid": "5c16393de64a1299f60131295a57970d", "score": "0.0", "text": "def new\n @reservation = Reservation.new\n end", "title": "" } ]
[ { "docid": "cd9358341a95183e816a1da89097c1e8", "score": "0.7491574", "text": "def create\n @house = House.new(house_params)\n \n if @house.save\n redirect_to @house\n else\n render 'new'\n end\n end", "title": "" }, { "docid": "db27f46841c8335a130cfc076eb4e302", "...
3572a663f32b5faf1d0f996cd51eff58
Need to do this to give the semantic upload form to use.
[ { "docid": "928f018fdde2c73cdc31a3d1ab2cdf18", "score": "0.0", "text": "def index\n @site_file = SiteFile.new\n super\n end", "title": "" } ]
[ { "docid": "ddfc9c8446713f38934f0d5c52660b4d", "score": "0.69986826", "text": "def form\n provides :html\n render :layout => :uploader\n end", "title": "" }, { "docid": "b12fd5056bf604df6cddda03642575f4", "score": "0.6947768", "text": "def upload_form\r\n\r\n render :layout...
21cee29d0a09771ea9f998d476877005
Loads and returns "other end" of the association. Must be implemented in subclasses.
[ { "docid": "846b2069824eba1b4eea1b3b23557d26", "score": "0.0", "text": "def get(resource, other_query = nil)\n raise NotImplementedError, \"#{self.class}#get not implemented\"\n end", "title": "" } ]
[ { "docid": "03a65684131f7e01c7e2656e4be79598", "score": "0.6210671", "text": "def end_of_association_chain\n parent? ? parent_association : model\n end", "title": "" }, { "docid": "ef1e8437a695856ee6a7781a9ee9bc46", "score": "0.6162938", "text": "def association\n ...
f31b7f8103cdf1da69ca69ef09b5f352
Sink steps have no output in our sense of the word; they output to some other system but not a subsqeuent step
[ { "docid": "8a3748c7767d653616e48faf68cf1c3e", "score": "0.0", "text": "def handle_output(row); nil; end", "title": "" } ]
[ { "docid": "7647c872d93fe2acf1d10486b8649bf3", "score": "0.66129106", "text": "def sink; end", "title": "" }, { "docid": "52335ba883d4ada4c0680b56fa4fe0a3", "score": "0.617344", "text": "def sink=(_); end", "title": "" }, { "docid": "d66589ca30147e26986f7000507d52d8", ...
b85eade4e88076f20e38a170532181f0
Get the time to live for a key
[ { "docid": "98186a707f6c433af4c87684f4c42e09", "score": "0.0", "text": "def ttl(key=nil)\n if key.class == String && block_given?\n @j_del.java_method(:ttl, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(key,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ...
[ { "docid": "dee9095ce388fe93a9f7c4a0f552d812", "score": "0.7484601", "text": "def ttl(key); end", "title": "" }, { "docid": "dee9095ce388fe93a9f7c4a0f552d812", "score": "0.7484601", "text": "def ttl(key); end", "title": "" }, { "docid": "9077b6871aa364797beaac2b5a611b58",...
1841a8e380e22ddf6f537cc05d96641e
GET /medium_item_equip_invs/1 GET /medium_item_equip_invs/1.json
[ { "docid": "2f7b3287637d30b5e6df0c46c3bbbe9c", "score": "0.7727146", "text": "def show\n @medium_item_equip_inv = MediumItemEquipInv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medium_item_equip_inv }\n end\n end", "tit...
[ { "docid": "b2af25ced610622cc2fea3808bc71417", "score": "0.6888069", "text": "def show\n @equipment = Equipment.find(params[:id])\n\n render json: @equipment\n end", "title": "" }, { "docid": "e5ae94d4c2a63bc7a312cbd15ce9efe9", "score": "0.6811073", "text": "def new\n @medi...
11da95cee9df2ed38117a446c736f33a
DELETE /rsvps/1 DELETE /rsvps/1.json
[ { "docid": "6d6f009f8e15acf2225ce69f8555d6aa", "score": "0.71709275", "text": "def destroy\n @rsvp = Rsvp.find(params[:id])\n @rsvp.destroy\n\n respond_to do |format|\n format.html { redirect_to rsvps_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "a6a1337be92524da5eb404fe7fc34e3c", "score": "0.72227645", "text": "def destroy\n @rsvp = Rsvp.find(params[:id])\n @rsvp.destroy\n\n respond_to do |format|\n format.html { redirect_to(rsvps_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "do...
de346bcbe4129e8a2cf2a5a9abea3f77
this is where the result gets returned
[ { "docid": "bba3e5fb37e2626460fb8a612d8c7be8", "score": "0.0", "text": "def call\n JsonWebToken.encode(user_id: user.id) if user\n end", "title": "" } ]
[ { "docid": "f08d07e5dae8099bbf64a6863af3e087", "score": "0.7683821", "text": "def result ; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.7681621", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0a55190faff70d4cbd0c6f770fb3c24b", "score": "0.0", "text": "def set_contact\n @contact = current_user.contacts.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;...
d5c18434781e02f669121dc8c59b9306
reduce 507 omitted reduce 508 omitted reduce 509 omitted
[ { "docid": "74205851c6282c9158fef350946c5608", "score": "0.0", "text": "def _reduce_510(val, _values, result)\n lexer.lex_state = EXPR_END\n result = wrap :lit, val[1]\n\n result\nend", "title": "" } ]
[ { "docid": "dd458ee5bd7f974c08686357ef463ece", "score": "0.7582035", "text": "def _reduce_608(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "0da8d4bc1271fbb8d2119d79e776a4f3", "score": "0.7532749", "text": "de...
a5f0b682cd6da0fdcc9053d98fd45b06
FIXME:(?) does anyone need a nonautovivifying writer for attributes that throws exceptions? return true or false based on if the attribute exists
[ { "docid": "849f8b5f1b85d0289190795296136491", "score": "0.0", "text": "def exist?(*path)\n path.inject(self) do |memo, key|\n return false unless valid_container?(memo, key)\n\n if memo.is_a?(Hash)\n if memo.key?(key)\n memo[key]\n else\n ...
[ { "docid": "cfdbf32d5c828047e321b3bac4852da9", "score": "0.73244125", "text": "def attributes_exist?\n\tend", "title": "" }, { "docid": "727c3467ec9314e6abfb9dbe6d9811a2", "score": "0.7252055", "text": "def attribute?\n false\n end", "title": "" }, { "do...
3b92485d00c83ad8b4c7e2bdea95d175
Create a database/schema in Imapala. Options: :if_not_exists :: Don't raise an error if the schema already exists. :location :: Set the file system location to store the data for tables in the created schema. Examples: create_schema(:s) CREATE SCHEMA `s` create_schema(:s, :if_not_exists=>true) CREATE SCHEMA IF NOT EXIS...
[ { "docid": "b566eb81b288bb89fb28e83805acab92", "score": "0.653905", "text": "def create_schema(schema, options=OPTS)\n run(create_schema_sql(schema, options))\n end", "title": "" } ]
[ { "docid": "8e72c8c6dec53351e4dba8726d7edc83", "score": "0.71753955", "text": "def create_schema\n Apartment::Database.create(self.schema) unless Storey.schema_exists?(self.schema)\n end", "title": "" }, { "docid": "88d14e74964a3c8b261faad9e1f5ba42", "score": "0.71363693", "text"...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "57cbf482863bb9019cd67d9267f1cc2f", "score": "0.0", "text": "def set_playlist\n @playlist = Playlist.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60320485", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6013371", "text": "de...
658870b1bd9b8cf31a5425b530108273
deconstruct a loop, unify handlers, and regenerate a new loop
[ { "docid": "69ea38e0c77f15a46787acec1adcf6c8", "score": "0.5534218", "text": "def rebuild_loop(code)\n handlers = {}\n code.scan(/^ when ((?:\\d+, )*\\d+)\\n((?: .*\\n|\\n)*)/) do |hclks, handler|\n hclks.split(\", \").each do |hclk|\n handlers[hclk.to_i] = indent(-...
[ { "docid": "40a85f4cccd19bdee6ef1aa8ee23a977", "score": "0.6072596", "text": "def post_loop; end", "title": "" }, { "docid": "1545de3cc25cd08251c419ccc87efa5b", "score": "0.60637385", "text": "def clear_loop\n end", "title": "" }, { "docid": "d84479646831ff08b3516737d9...
789165f990a8531cd946ba81fa859aab
Transform value +x+ according to domain and range
[ { "docid": "0dafcab27399310df0ffead0c7c89904", "score": "0.6189279", "text": "def scale(x)\n return nil if x.nil?\n x=x.to_f\n j=Rubyvis.search(@d, x)\n j=-j-2 if (j<0)\n j=[0,[@i.size-1,j].min].max\n # p @l\n # puts \"Primero #{j}: #{@f.call(x) - @l[j]}\"\n # put...
[ { "docid": "2321da82f74b78d75fbbf9434e7d9978", "score": "0.7448445", "text": "def transform_domains start_domain, end_domain, x\n perc = (x - start_domain.first) / (start_domain.last - start_domain.first).to_f\n x2 = perc * (end_domain.last - end_domain.first) + end_domain.first\n end", "titl...
d95c5b825a270e2a1b57d6c85347aa8e
POST /taxonomies_users POST /taxonomies_users.xml
[ { "docid": "4a5560cf4a0f684ab4772c2cacc93002", "score": "0.7035458", "text": "def create\n @taxonomies_user = TaxonomiesUser.new(params[:taxonomies_user])\n @user = @taxonomies_user.user\n\n respond_to do |format|\n if @taxonomies_user.save\n flash[:notice] = 'User Taxonomy was succ...
[ { "docid": "6430f2a1b24bbebd0fb3650835487264", "score": "0.6278314", "text": "def new\n @user = User.find(params[:user_id])\n @taxonomies_user = TaxonomiesUser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @taxonomies_user }\n end\n end...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "672d5100193069871287544ac95da520", "score": "0.0", "text": "def set_product\n @product = Product.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60328794", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6017492", "text": "de...
8852c5c5054feeb882118e7a5a3237ad
Emails an admin, informing him of the role request.
[ { "docid": "935d50191b514af7dc2db2b3d7e33d36", "score": "0.0", "text": "def new_role_request(request, recipient)\n @recipient = recipient\n @request = request\n\n I18n.with_locale(@recipient.locale) do\n mail(to: @recipient.email, subject: t('.subject'))\n end\n end", "title": "" ...
[ { "docid": "44ddcc3ac0ecedb46a9f39d599468bd2", "score": "0.7626206", "text": "def admin\n UserMailer.admin\n end", "title": "" }, { "docid": "bdd02f048850050b0b9ee024622484fa", "score": "0.7573019", "text": "def send_admin_mail\n admins = Admin.all\n\n admins.each do |admin...
fa3e6f28ac74d6f4cc814428096afa79
PUT /material_datas/1 PUT /material_datas/1.xml
[ { "docid": "2c19358923e8c749628436630b7ef6cb", "score": "0.6282574", "text": "def update\n @component_data = ComponentData.find(params[:id])\n\n respond_to do |format|\n if @component_data.update_attributes(params[:component_data])\n format.html { redirect_to(@component_data, :notice =...
[ { "docid": "4815615f7ded1d65826a5cd70dd3a3e6", "score": "0.68097335", "text": "def update\n @material_data = MaterialData.find(params[:id])\n\n respond_to do |format|\n if @material_data.update_attributes(params[:material_data])\n format.html { redirect_to(@material_data, :notice => 'M...
414204c9a88b299f49347e0a3ef532ce
keep code shorter with this
[ { "docid": "4abd5d3c2a9d8b784d5574687a95cfde", "score": "0.0", "text": "def initialize(resource:, file_change_list_obj:)\n @resource = resource\n @file_change_list = file_change_list_obj\n end", "title": "" } ]
[ { "docid": "3d45e3d988480e2a6905cd22f0936351", "score": "0.61215454", "text": "def for; end", "title": "" }, { "docid": "3d45e3d988480e2a6905cd22f0936351", "score": "0.61215454", "text": "def for; end", "title": "" }, { "docid": "3d45e3d988480e2a6905cd22f0936351", "sc...
9ddaa835e19199fe176b24c254bf3e9f
Store this in a file because this name gets reference in other tasks later and we want the image name to stay the same when the commands are run separate in different processes. So we store the state in a file. Only when a new docker build command gets run will the image name state be updated.
[ { "docid": "03d38c2578b30f051c162b793daf1ef1", "score": "0.6877163", "text": "def store_full_image_name\n dirname = File.dirname(docker_name_path)\n FileUtils.mkdir_p(dirname) unless File.exist?(dirname)\n full_image_name = generate_name\n IO.write(docker_name_path, full_image_name)\...
[ { "docid": "5d473feedb19b6ba955986185d858216", "score": "0.72533405", "text": "def image_name\n return generate_name if @options[:generate]\n return @@image_name if @@image_name\n return \"tongueroo/demo-kubes:kubes-12345678\" if ENV['TEST']\n\n unless File.exist?(image_state_path)\n...
f7b0233f1746c93e19523c7675a1f1af
Move the extracted package file from extracted_file to the force_install_location
[ { "docid": "5fb16a631868924bee134a0ca193a2bf", "score": "0.78466266", "text": "def install\n # Move only the content of the directory\n FileUtils.mv extracted_file, self.class.force_install_location\n end", "title": "" } ]
[ { "docid": "36e91f91887b21a67eb7838fd3cb85a1", "score": "0.6585592", "text": "def move_pkg\n FileUtils.mv(PackageCommandGenerator.pkg_path, File.expand_path(Gym.config[:output_directory]), force: true)\n pkg_path = File.expand_path(File.join(Gym.config[:output_directory], File.basename(Package...
63b59f5b84a27ef88686d7b28f339286
If this option is selected, A list of all the shelter's animals currently in Foster care is provided, sorted by foster family
[ { "docid": "c548a4b349991bbddf5a28dab4a16cdd", "score": "0.6499558", "text": "def shelters_show_list_of_foster_homes(s_id)\n clear_term\n # show all Animals at a Shelter, where some animals are with a Foster\n if Shelter.find(s_id).animals == []\n puts Rainbow('Your shelter is empty.').whi...
[ { "docid": "59699f66a6f66ca247fc5db7f8870a8c", "score": "0.6183182", "text": "def animal_list\n puts \"\\n\"\n # Find all animals\n $shelter[:animals].each_with_index do |animal, i|\n puts \"[#{i}] #{animal.name}\"\n end\n print \"Select who is being adopted: \"\n user_choice = gets.chomp\nend"...
7b550464afebca0e6f942805ab8bfac3
take a player name and return array of player's stats
[ { "docid": "ac604e11f94d98ff41fea40a469f11ac", "score": "0.72275734", "text": "def player_stats(player_name)\n #iterate through teams\n game_hash.each do |teams, info|\n #iterate through team info\n info.each do |team_info, value|\n if team_info == :players\n #iterate through players...
[ { "docid": "5dc6db57290a15703b1795606ad5ab4b", "score": "0.825857", "text": "def player_stats (player_name)\n game_hash.each do |loc, data|\n data[:players].each do |player|\n if player[:player_name] == player_name\n return player\n end\n end\n end\n end", "title": ""...
380bd4e974be65048e3b63001a558caa
class Test::Unit::TestCase class ActiveSupport::TestCase Setup all fixtures in test/fixtures/.(yml|csv) for all tests in alphabetical order. Note: You'll currently still have to declare fixtures explicitly in integration tests they do not yet inherit this setting fixtures :all Add more helper methods to be used by all ...
[ { "docid": "b04c19fa63b6630682612dcc63dc1850", "score": "0.0", "text": "def moxie_forums( fixture_name )\n id = @@fixtures['moxie_forum'][ fixture_name.to_s ][ 'id' ]\n Moxie::Forum.find( id )\nend", "title": "" } ]
[ { "docid": "762da6033338198e8db7447591f19d82", "score": "0.7472822", "text": "def setup\n #yml fixtures created with db_fixtures_dump gem\n # FIXTURES_PATH=test/fixtures rake db:fixtures:dump\n #load \"#{Rails.root}/db/seeds.rb\"\n end", "title": "" }, { "docid": "40e319a46884718f...
16e5365322888c9e999729f592f20364
GET /people/1 GET /people/1.json
[ { "docid": "d271c5141e424081ded61c22a73af55d", "score": "0.0", "text": "def show\n current_user.visit(@person)\n followed = current_user.following?(@person)\n p = PersonSerializer.new(@person, as_seen_by: current_user).as_json\n render :json => p\n end", "title": "" } ]
[ { "docid": "dc5549fa6a62fc3c865028a017d690e4", "score": "0.7643086", "text": "def show\n @people = People.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @people }\n end\n end", "title": "" }, { "docid": "89c5208...
4484c2a365e2fc94dd121ffacf2fd911
Set the parent and child index values for all children
[ { "docid": "62c955880293613b8e7f72cd8e9afce3", "score": "0.70504683", "text": "def freshen_parent_and_child_indexes\n raise NotImplementedError\n end", "title": "" } ]
[ { "docid": "2f5e40dcbeb7b4ea734c74e39d783f67", "score": "0.73706436", "text": "def index\n set_node_to_children_map(0)\n end", "title": "" }, { "docid": "4db2fa7e2625ab68fd90150cce626795", "score": "0.71241367", "text": "def index\n @parent.children.index(self)\n end", ...
9712c18ae3b6b03838115fdb899f2a36
GET /manager_stores GET /manager_stores.json
[ { "docid": "e96dc8f74328cc7c1ee357f024a4fb04", "score": "0.7687428", "text": "def index\n @manager_stores = ManagerStore.all\n end", "title": "" } ]
[ { "docid": "7a6075c5960c69a13024e35fb0023585", "score": "0.71975636", "text": "def index\n authorize! :manage, Manager\n store = Store.find(params[:store_id])\n @managers = store.managers.all\n end", "title": "" }, { "docid": "047a4fbfcf6c64f36278f678e6513b85", "score": "0.7133...
61ea356c4dc71ddc7ddcdca729d20209
POST /visits POST /visits.json
[ { "docid": "07de3ee3eabd0b24132c5d2f2f4baf59", "score": "0.6715692", "text": "def create\n @visit = Visit.new(visit_params)\n\n respond_to do |format|\n if @visit.save\n format.html { redirect_to @visit, notice: 'Visit was successfully created.' }\n format.json { render :show, s...
[ { "docid": "a6cd3ec8c1ec4ad1bc45721a8b29650d", "score": "0.6898063", "text": "def index\n # @visits = Visit.all\n render status: :ok, json: @visits\n end", "title": "" }, { "docid": "055639d60690670f6dbc7308cc21a5dd", "score": "0.6744453", "text": "def create\n ...
4fdfd5ea4ac8c077b4fcb3ae94fe097a
This is the most basic option. Given an exploit type, what to exploit (e.g. /etc/passwd) and a file type it will build an oxml xxe.
[ { "docid": "7b79060f3bafd8be8e9fae033d81d6f1", "score": "0.4845598", "text": "def build_file(params)\n # proto (required): protocol on connect back\n # hostname (required): hostname to connect to\n # file_type (required): file extension -- e.g. docx\n # hostname (required): connect back host -- this...
[ { "docid": "3520e58a8107034ff214c86dc8243b44", "score": "0.53069514", "text": "def get_xml_of_type( asdcp_type, file )\n begin\n xml = Nokogiri::XML( open file )\n rescue Exception => e\n @logger.info \"#{ file }: #{ e.message }\"\n return FALSE\n end\n unless xml.errors.empty?\n xml.err...
d2d886d8fd46d6fd96d61d4893182012
If +element+ is in the queue, remove and return it, or nil.
[ { "docid": "9c32c12b168ab22bcad5faaf1664f3ad", "score": "0.71209645", "text": "def delete(element)\n synchronize do\n @queue.delete(element)\n end\n end", "title": "" } ]
[ { "docid": "fbfee8a2ca79a1d6c33e57d91a6f7734", "score": "0.7597348", "text": "def pop\n if empty?\n nil\n else\n @queue.remove\n end\n end", "title": "" }, { "docid": "ed094ed4cccb428213a6a24b4fc7b429", "score": "0.7439992", "text": "def removeElement(element)\n ...
d815ab036f8218c497d7db44860fdd3b
Gets the average weekly number of contributions by the user.
[ { "docid": "5f6063b4c10173659b9024c533790d5c", "score": "0.74468553", "text": "def get_average_week(user)\n weekly = get_weekly(user)\n get_average(weekly)\n end", "title": "" } ]
[ { "docid": "02ea082ab20b1d26882e0cd833413489", "score": "0.66783905", "text": "def weekly_contributions(goal, user)\n value = account_balance(goal, user)\n date_today = Time.now.strftime(\"%d/%m/%Y\")\n no_weeks = num_weeks(goal.due_date)\n percentage = percentage_of_goal_amount(value, goal....
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "08c457ead6014223a931e23baf6ebde6", "score": "0.0", "text": "def set_dis_group\n @dis_group = DisGroup.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163927", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6046165", "text": "def action_hook;...
3a585f53772adec45c7aa50edcaef512
Is param using special condition: "None" ?
[ { "docid": "b851a26b2e226cc5157e40a0be4a7994", "score": "0.0", "text": "def by_no_approvals?\n includes_special_label?(IssuableFinder::Params::FILTER_NONE)\n end", "title": "" } ]
[ { "docid": "3d6c5f5a9f1ed0040ddc8eafcde06b9e", "score": "0.6938118", "text": "def checkParameter(value)\n if %W['' none false #{nil} null 0].include?(value.to_s.downcase)\n nil\n elsif value.to_s.downcase == 'default'\n block_given? ? yield : value\n else\n value\n...
71aaeaffcc43e7ad9499fce3a227160f
Controller function for showing a base given as parameter
[ { "docid": "cbda0b0b4ebf94652386d28cb51bf3ba", "score": "0.0", "text": "def show\n @base = Base.find(params[:id])\n unless @base.greenroof_id.nil?\n return\n end\n respond_to do |format|\n format.html\n format.json { render :json => {attached_plants: @base.plants} }\n end\n...
[ { "docid": "fb23bd2389f01cdd370809a231221e36", "score": "0.70153147", "text": "def base\n render :template => params[:path]\n end", "title": "" }, { "docid": "0cfd1ecd386d77060e4581e56198ea6c", "score": "0.6350592", "text": "def get_base_partial\n 'base'\n end", "title": ...
df87c5b1eb88cd86010d588257ce0bf9
type: Range type: Color
[ { "docid": "c74ff68d0f66764b1baf26d8082fdb1e", "score": "0.0", "text": "def from_h!(value)\n value = {} if value.nil?\n self.range = Range.new(value['range']) unless value['range'].nil?\n self.color = Color.new(value['color']) unless value['color'].nil?\n self\n end", "title":...
[ { "docid": "d9642fdd6afdb30014c415698bb327f2", "score": "0.71974134", "text": "def aqi_range_colors\n { 0..50 => :green,\n 51..100 => :yellow,\n 101..150 => :orange,\n 151..200 => :red,\n 201..300 => :purple,\n 301..999 => :pink }\n end", "tit...
6a8182222395013b5f83105a4c9aa7f8
Build attributes for active directory account Code 512 creates standard user account and enables it
[ { "docid": "7d017a6e955d423ba6d78b28655ca249", "score": "0.5577582", "text": "def ldap_attributes(user)\n attributes = {\n :cn => user.human_name,\n :mail => user.email,\n :objectclass => [\"top\", \"person\", \"organizationalPerson\", \"user\"],\n :userPrincipalName => us...
[ { "docid": "a10add4722a654ea91249ee05e440644", "score": "0.59509987", "text": "def create_cognito_user(client, attributes, enable_mfa)\n client.admin_create_user(**determine_user_attributes(attributes, enable_mfa))\n end", "title": "" }, { "docid": "29befc632310d374233d4b8b8f...
9f72f47fa5228a83f7c1d105db01e10f
Schedules the cronjob for fetching email via IMAP Configure the fetching in moonshine.yml. All fields default to so make sure to set something (or it will run every minute). :redmine: :receive_imap :host: 'imap.example.com' :ssl: '1' :port: '993'
[ { "docid": "232f3111ca6843f82a4c367df1a04932", "score": "0.8301327", "text": "def redmine_receive_imap\n if configuration[:redmine] && configuration[:redmine][:receive_imap]\n imap_config = configuration[:redmine][:receive_imap]\n\n host = imap_config[:host]\n ssl = imap_config...
[ { "docid": "454fbc7327ad3de06125a37d33517611", "score": "0.6307706", "text": "def redmine_receive_pop\n if configuration[:redmine] && configuration[:redmine][:receive_pop]\n pop_config = configuration[:redmine][:receive_pop]\n\n host = pop_config[:host]\n port = pop_config[:por...
112bd312625272cbc2962cf4aa81faab
custom nested params to ensure that users can edit category names properly through the budget update route or otherwise create a new category
[ { "docid": "74ed35929e392450d9799c08d02090a1", "score": "0.0", "text": "def categories_attributes=(attributes)\n attributes.each do |index, attribute|\n unless attribute[:title].blank? || self.categories.map(&:title).include?(attribute[:title])\n existing_category = self.categories[index....
[ { "docid": "939432a4e6265810af8da2345f487db8", "score": "0.742405", "text": "def category_params\n params.fetch(:category, {}).permit(:name, :parent_id)\n end", "title": "" }, { "docid": "0d1d58b37c3b9a0d2a72c44010f87b18", "score": "0.72877026", "text": "def category_...
5fedc058b75e5ed7c1ee33dbdd4669bc
Path to a zip containing Sitecore.
[ { "docid": "a7e040c315ebc5f7f3ac4f141035dd11", "score": "0.0", "text": "def source(arg = nil)\n set_or_return(:source, arg, kind_of: [String])\n end", "title": "" } ]
[ { "docid": "bd0a3f42bd9da1562a03dfd0a1dd21be", "score": "0.72677124", "text": "def zip_path\n \"/tmp/play-zips/#{zip_name}\"\n end", "title": "" }, { "docid": "5d133b2c93bbccf9397d0f375acfb845", "score": "0.6620686", "text": "def output_zipfile_path\n Pathname.new(output_f...
3c78ebda511729eaf0a41601f13496bd
=> [API] verify if content exists in cache. API key must exist in database. Parameter: access_token Agent must belong to API key user. Parameter: agent Agent must be configured in integration, with template. Returns array of template identifiers.
[ { "docid": "14a27364d2e5c375b36b53c720cf5827", "score": "0.67528397", "text": "def verify\n\t \tbegin\n\t \t\tapi_key = ApiKey.find_by_access_token(params[:access_token])\n\t \t\tunless api_key.nil? then\n\t \t\t\tuser = api_key.user\n\t \t\t\tagent = user.agents.find_by_identifier(params[:agent])\...
[ { "docid": "eb1b749cc55404e1020f6f0b0281b195", "score": "0.54202247", "text": "def agent_template_exists?(agent)\n opts = { acceptable_exit_codes: [0, 2] }\n opts[:pty] = true if target_guestshell?(agent)\n result = on agent, \"ls #{get_puppet_config(agent)}\", opts\n result.exit_code == 0\nend", ...
d04e3a1d39a617597c6ab7fc1b621ca9
If there are two or more even numbers together then the answer is yes. Consider the string "7r5gg812", the answer is yes, because 8 is even and 12 is even. If needed you could awalys make an even number. For example, in the number "237711574771" you could just select 2 and 37711574 and say that these are two adjacent e...
[ { "docid": "016158546843951198448eff19db7ee8", "score": "0.85513484", "text": "def EvenPairs(str)\n even_count_arr = str.scan(/\\d+/).map {|e| e.chars.map(&:to_i).count{|n| n.even? }}\n return even_count_arr.max >= 2 \nend", "title": "" } ]
[ { "docid": "50b3158ac8f5ab050fa03dfbddd5a2e7", "score": "0.8244914", "text": "def EvenPairs(str)\n str.scan(/\\d+/).each do |num_str|\n num_str.length.times do |idx|\n first, second = num_str[0...idx].to_i, num_str[idx..-1].to_i\n return 'true' if first.even? && second.even? && ![first, se...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0fc9eb73e71acf33c35cbf8f23e17775", "score": "0.0", "text": "def set_poll_item\n @poll_item = PollItem.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...
1482d9d419644dd3bc2fa5af2cb0bb52
Creates and initializes a new instance of the Runs class.
[ { "docid": "b716e2eab6b0cce582efd27c6177f8a8", "score": "0.0", "text": "def initialize(client)\n @client = client\n end", "title": "" } ]
[ { "docid": "898e85779ecbb4145dda9dab07dd9499", "score": "0.7727757", "text": "def initialize(run)\n @run = run\n end", "title": "" }, { "docid": "1c2f0d2915736c2f34d47b3a8508ba3e", "score": "0.7116961", "text": "def run\n Runner.new(self).run\n end", "title": "" ...
a981822023590e575d156ca8ced7ed50
has_many :blogs, :class_name => "Blog", :foreign_key => "owner_id" has_many :blog_entries, :class_name => "BlogEntry", :foreign_key => "user_id"
[ { "docid": "8f346574137c6aef77076144ec72e7f8", "score": "0.0", "text": "def cusername\n user = User.find_by_login(self.username)\n cusername = self.username\n cusername = user.firstname if user.firstname and user.firstname != ''\n cusername\n end", "title": "" } ]
[ { "docid": "1c9284233a0068776250836c4b7bc063", "score": "0.63167197", "text": "def index\n @post_blogs = PostBlog.all\n #@post_blogs = PostBlog.joins(:users)\n end", "title": "" }, { "docid": "ab7f298c9f3fbf3863d52ec5e8c0593e", "score": "0.60120183", "text": "def index\n @b...
bdba84ce9a6076c15604ecefeffc96da
GET local node bag replication data
[ { "docid": "866d50317af10ecef1f8634db0081b92", "score": "0.0", "text": "def replications\n @replications ||= begin\n replications = []\n local_client.replications(replications_query) do |response|\n replications << response.body if response.success?\n ...
[ { "docid": "01927816f98cdebf61c44bf66b34efb5", "score": "0.64049333", "text": "def replicas\n data[:replicas]\n end", "title": "" }, { "docid": "f24242f442fb9e002f4ed7112311124e", "score": "0.62624985", "text": "def server_node_data\n response = client.node(namespace...
5a8d2d7471c12c51d81b53cc775b9be6
Defines a new Class method, given one or more Procs.
[ { "docid": "c761e74d025e5cf7334bf58b72ccbcc1", "score": "0.58918434", "text": "def define_class_method( name, *blocks, &block )\n instance_class.define_instance_method( name, *blocks, &block )\n end", "title": "" } ]
[ { "docid": "cde7926adac790e119719a4cea5810f3", "score": "0.667034", "text": "def mk_method(proc)\n @@n, @@p = @method_name, proc\n class << @klass\n define_method @@n, @@p\n end\n @@n = @@p = nil\n end", "title": "" }, { "docid": "61ae7a4426f3895a0f2...
e7961aa174a0bb98560b4cf0fa5fbac1
Mock inspec context object Will be remocked in various places
[ { "docid": "a8477b12aab2863e1a35d041d08bd86f", "score": "0.60237247", "text": "def inspec\n nil\n end", "title": "" } ]
[ { "docid": "b750f792140c611f2e3774807ecb00c5", "score": "0.6980178", "text": "def get_context(*params); raise('Stub or mock required.') end", "title": "" }, { "docid": "4353a0d89cb5afe68f8d9b44cef9912a", "score": "0.67686063", "text": "def add_stack_mocks(obj)\n allow(obj).to receiv...
020676b18228fa4fa7a1b88a9d61d971
Initialize our server fact hash; we add these to each client, and they won't change while we're running, so it's safe to cache the values.
[ { "docid": "018bce73ef5b507481df2cf191eb827a", "score": "0.6744878", "text": "def set_server_facts\n @server_facts = {}\n\n # Add our server version to the fact list\n @server_facts['serverversion'] = Puppet.version.to_s\n\n # And then add the server name and IP\n { 'servername' => 'fqdn'...
[ { "docid": "a9f63498e9f178ee71f00daf832806d0", "score": "0.6812414", "text": "def set_server_facts\n @server_facts = {}\n\n # Add our server version to the fact list\n @server_facts['serverversion'] = Puppet.version.to_s\n\n # And then add the server name and IP\n { 's...
834d580678a2c19ff5a28958a46a3371
TODO: make private private
[ { "docid": "4bea4c90605970606a5e5d77501273d2", "score": "0.0", "text": "def import_media_from_bricolage(opts = {})\n # media_ids = self.extract_media_ids_from_source, force = false\n\n media_ids = opts[:media_ids] || self.extract_media_ids_from_source\n force = opts[:force] || false\n\n # Ch...
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.82390505", "text": "def private; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.6817341", "text": "def probers; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", ...
ea1dc8e05cdb66a29717f5efafdaa485
Convert the key to an OpenSSL::PKey::RSA
[ { "docid": "83cdcbb9cfec751c18d35923d77d2278", "score": "0.73794216", "text": "def to_openssl\n key = OpenSSL::PKey::RSA.new\n key.e = OpenSSL::BN.new(@exponent, 2)\n key.n = OpenSSL::BN.new(@modulus, 2)\n key.q = OpenSSL::BN.new(@pk_q, 2)\n key.p = OpenSSL::BN.new(@pk_p, 2)\n key.iqmp...
[ { "docid": "ee36e30f993107cff328343ee832c084", "score": "0.7932862", "text": "def to_rsa_keypair\n Crypto.make_rsa_keypair(nil, private_key)\n end", "title": "" }, { "docid": "9aa0c4e0919a6bc73af0a551aa8905fa", "score": "0.7754524", "text": "def make_key(key)\n key.is_a?(S...
eed0aa8f72a516ba017b47b57494adcd
DELETE /question/1 DELETE /question/1.json
[ { "docid": "f93051e64bc053de37ddb87904f89961", "score": "0.72073925", "text": "def destroy\n @question = Question.find(params[:id])\n @question.destroy\n respond_to do |format|\n format.html { redirect_to questions_url, notice: '削除しました。' }\n format.json { head :no_content }\n end\n...
[ { "docid": "d69e06567cd654f9b68cc12187690165", "score": "0.7715683", "text": "def destroy\n if @v1_question.destroy\n render json: {'message': 'Deleted question successfully'}, status: :ok\n else\n render json: get_errors, status: :unprocessable_entity\n end\n\n end", "title": ""...
da339daec1e78e349201d50d438e4936
to determine the error condition of multiple heads of household
[ { "docid": "c0d8a0b38adddb9b179aefa9b9b9e87d", "score": "0.0", "text": "def head_count\n clients.map(&:headOfHousehold?).count(true)\n end", "title": "" } ]
[ { "docid": "7d9a8c6516d8094cccc81a0bd895ea7d", "score": "0.5727659", "text": "def make_error_list\n\t\terror_list = []\n\t\t@predictions.each do |arr|\n\t\t\terror_list <<(arr[2] - arr[3]).abs\n\t\tend\n\t\terror_list\n\tend", "title": "" }, { "docid": "a825b4da340574292c2ae79336a45167", ...
c41c7acb2eb8d541ad88e2802820eda0
GET /orcids/new GET /orcids/new.json
[ { "docid": "a3d1f289bb904a41d6faf9e76c790114", "score": "0.7502265", "text": "def new\n @orcid = Orcid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @orcid }\n end\n end", "title": "" } ]
[ { "docid": "f9b60dbf2ab42e3a44f7dfea1605912c", "score": "0.7120304", "text": "def new\n @rid = Rid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rid }\n end\n end", "title": "" }, { "docid": "5859f814c346db4594e15493b9098595", ...
18272b7753d41a641b8a1f1afe9f7c13
Look for error message boxes.
[ { "docid": "340bc696d920659c94fd70c15000d479", "score": "0.6634331", "text": "def watch_for_error\n\t\tif @prompted[:for_password]\n\t\t\t@prompted[:with_error] = dialog(@@titles[:dialog]) do |d|\n\t\t\t\tif (get_dlg_item(d.handle, ErrorIcon) > 0)\n\t\t\t\t\td.click IDCANCEL \n\t\t\t\tend\n\t\t\tend\n\t...
[ { "docid": "aca200eb19108a367a69c8dc23c56686", "score": "0.64741296", "text": "def check_for_errors(errors)\n # Throw exception if errors found\n if errors.size > 0\n error_msg = \"Errors found in form configuration file #{SmerfFile.smerf_file_name(@code)}:\\n\"\n errors.each do ...
54cb84305b2b9e0f99d031ae54adc864
scheduling_type column of previous builds/bridges have not been populated, so we calculate this value on runtime when we need it.
[ { "docid": "4a01520684f76e8a43f56f052ed15c7f", "score": "0.6806139", "text": "def find_legacy_scheduling_type\n strong_memoize(:find_legacy_scheduling_type) do\n needs.exists? ? :dag : :stage\n end\n end", "title": "" } ]
[ { "docid": "9ed90e2034a3ee81ff9153a7d61ae10e", "score": "0.6001313", "text": "def scheduling_type_dag?\n scheduling_type.nil? ? find_legacy_scheduling_type == :dag : super\n end", "title": "" }, { "docid": "9cd6f9c56b2015ecac5173900b43d002", "score": "0.58790565", "text": "de...
26d74b474f93b0c0743a3e2567cf26ce
POST /weixinlogs POST /weixinlogs.json
[ { "docid": "8111e98bc5ec77da087bfa8fe81092b9", "score": "0.7183547", "text": "def create\n @weixinlog = Weixinlog.new(weixinlog_params)\n\n respond_to do |format|\n if @weixinlog.save\n format.html { redirect_to @weixinlog, notice: 'Weixinlog was successfully created.' }\n forma...
[ { "docid": "9018236b581dd5a9e4a10b92e83d4439", "score": "0.6341158", "text": "def create\n log = Log.new(app_key: params[:app_key], admin_user_id: params[:admin_user_id], activity_type_id: params[:activity_type_id])\n if log.save\n render json: {status: {code: 200, message: :ok}}\n else\n ...
2a2e97a7c20a8c1f8f8efc730e4a11dd
POST /details POST /details.json
[ { "docid": "49a3dc270d6ab7c4c19af9f7e27d0625", "score": "0.6313619", "text": "def create\n @detail = Detail.new(params[:detail])\n @detail.name = \"#{@detail.vendor.name} #{@detail.device.name}\"\n respond_to do |format|\n if @detail.save\n format.html { redirect_to @detail, notice:...
[ { "docid": "da9c368f03d967c07c6a5d651c0e622c", "score": "0.69965696", "text": "def details\n @details.to_json\n end", "title": "" }, { "docid": "17c8ef4c10bfc02ee503e3b7eac1c797", "score": "0.69432545", "text": "def submit_details(details)\n response = adyen_client.checkout....
33415ebe3436a0a9e015549862a002be
request password reset. you get here when the user entered his email in the reset password form and submitted it.
[ { "docid": "623be4ab743df64741a37f33302a0268", "score": "0.0", "text": "def create\n @momentum_cms_user = MomentumCms::User.where(email: params[:momentum_cms_user][:email]).first\n\n # This line sends an email to the user with instructions on how to reset their password (a url with a random token)...
[ { "docid": "c28bf564cabedd1991f349aad28b9286", "score": "0.816121", "text": "def password_reset\r\n if request.post? && params[:email_address]\r\n flash[:success] = \"Your password has been reset, and emailed to #{params[:email_address]}\"\r\n user = User.find_by_email_address(params[:email...
f638001554bf1100781277fc71377e86
Mostly for the ActiveAdmin interface
[ { "docid": "3fd39e5301d49c826aad4aaddf399a28", "score": "0.0", "text": "def to_s\n self.email\n end", "title": "" } ]
[ { "docid": "f5b895b91cf4cfaf5824503767927f9e", "score": "0.72027665", "text": "def admin_show; end", "title": "" }, { "docid": "73bf113c2fb0cd4fb90a51ace651b9b8", "score": "0.6860578", "text": "def admin_show\n end", "title": "" }, { "docid": "73bf113c2fb0cd4fb90a51ace65...
8aaea19371402bddc62163e1f13228e5
DELETE /subscribers/1 DELETE /subscribers/1.json
[ { "docid": "6b643c80420e9c6ed12f69a6e1b3d52d", "score": "0.7729331", "text": "def destroy\n @subscriber = Subscriber.find(params[:id])\n @subscriber.destroy\n\n respond_to do |format|\n format.html { redirect_to subscribers_url }\n format.json { head :no_content }\n end...
[ { "docid": "6b5b81902adeba7350248a384156cb7a", "score": "0.7983683", "text": "def destroy\n @subscriber = Subscriber.find(params[:id])\n @subscriber.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_subscribers_url }\n format.json { head :ok }\n end\n end", ...
f260b0743e3635ff851ba1fb8f391b00
GET /users/1 GET /users/1.json
[ { "docid": "dee59cd957a4bdb9aec50ef4166c465e", "score": "0.0", "text": "def show\n #@user = User.find(params[:id])\n\n @user = User.find(params[:id])\n @school = School.find(@user.school_id)\n @random_groups = Group.last(20) - @user.groups_as_member\n @badges = []\n @user.badges.each d...
[ { "docid": "4152fb6556ae83f7cdd6c362f17ad9bf", "score": "0.81046426", "text": "def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n ...
f97c0e05149ba3febeb65d37836e438c
Validates if a string is an ipv4 address
[ { "docid": "8966e395d3e3acc56b7ebf7e4c7e9445", "score": "0.79978937", "text": "def is_ip_addr?(part)\n ip = IPAddr.new(part)\n ip.ipv4?\n rescue IPAddr::InvalidAddressError => e\n false\n end", "title": "" } ]
[ { "docid": "e041755fc58b5ea388a53c437b493cbb", "score": "0.858127", "text": "def ipv4?(string)\n !!string.match(/(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/)\nend", "title": "" }, { "docid": "5d83593531e10cbcd77301a8b1fd8157", ...
2ff724a7e76effdc5c0928aadda0009a
POST /facebookposts POST /facebookposts.json
[ { "docid": "a911b2f259a7440e0087f0bb427050f0", "score": "0.75126725", "text": "def create\n @facebookpost = Facebookpost.new(facebookpost_params)\n current_user.facebook.put_wall_post(:body)\n respond_to do |format|\n if @facebookpost.save\n format.html { redirect_to facebookposts_p...
[ { "docid": "a79953b060093182a3a20e0bf5bc8182", "score": "0.7192679", "text": "def create\n @facebook_post = FacebookPost.new(facebook_post_params)\n\n respond_to do |format|\n if @facebook_post.save\n format.html { redirect_to @facebook_post, notice: 'Facebook post was successfully cre...
e6f5d4b689e3a1ba271515705e6a3a87
Add file names defined by glob patterns to the file list. If an array is given, add each element of the array. Example: file_list.include(".java", ".cfg") file_list.include %w( math.c lib.h .o )
[ { "docid": "77c8d0572488d5b14ec972ed08daab51", "score": "0.5732168", "text": "def include(*filenames)\n # TODO: check for pending\n filenames.each do |fn| @pending_add << fn end\n @pending = true\n self\n end", "title": "" } ]
[ { "docid": "55667339ac486500f4d40db3ee3bfd52", "score": "0.7240399", "text": "def appendGlobs(arr, patterns); patterns.each { |p| arr << Dir.glob(p) }; arr.flatten end", "title": "" }, { "docid": "0bb23b6172f546df5bdeeaf72a1b584f", "score": "0.666688", "text": "def include(*files)\n ...
094828b8b0f05092bef74f1621727cc5
takes a row or column based array and transposes values
[ { "docid": "fb914cab80116322e2adc720d048c871", "score": "0.78101593", "text": "def my_transpose(trans_arr)\n i, j = 0, 1\n array_copy = trans_arr.dup\n (i...trans_arr.length-1).each do |index_one|\n (j...trans_arr.length).each do |index_two|\n array_copy[index_one][index_two], array...
[ { "docid": "9ce89e719c23bb8a9c5a5963560247f8", "score": "0.83909464", "text": "def transpose(arr)\n columns = arr.max.length-1\n\n (0..columns).map do |column|\n (0..arr.length-1).map do |row|\n arr[row][column]\n end\n\n end\nend", "title": "" }, { "docid": "8be637d3cead57b228...
f1b81a1135f1e7194737e8e3291c247d
GET /courses/1 GET /courses/1.xml
[ { "docid": "d70a949d61de0968fe9d09ec3bac9687", "score": "0.6795803", "text": "def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @course }\n end\n end", "title": "" } ]
[ { "docid": "6a2681b90796ff49589c22206593e04c", "score": "0.75762534", "text": "def get_courses\n\n @courses = Course.all\n\n respond_to do |format|\n format.xml { render :xml => @courses }\n end\n\nend", "title": "" }, { "docid": "8fb0cbe4fa3348f64ebd6a38c69a8d39", "score": ...
5858b7fc6f0ef503c0bb7b83814af091
Given a json serialisation of a hash, return another json serialisation which includes a key "_jsign" and a value which is the Base64encoded signature of the original json. Well, nearly any internal whitespace after the last value in the original json is stripped.
[ { "docid": "0b106dc6d35631e52a78f5652884feab", "score": "0.6753805", "text": "def sign(json, key_filename)\n check_for_keyfile!(key_filename)\n\n # Remove any whitespace inside the last bracket.\n stripped_json = json.sub(/\\s+}\\Z/, \"}\")\n sig = \"\"\n # Use openssl -sha256 t...
[ { "docid": "65324a9c9b94c0064ba6e536ae04608b", "score": "0.6312313", "text": "def signature\n Base64.encode64(digest_with_key string_to_sign).strip\n end", "title": "" }, { "docid": "6d144b1f3f5a8dc03c536538aa5177d3", "score": "0.62136555", "text": "def signature\n Base6...
101aba91acb6b6d021fe8b719b48f5bf
GET /board_in_projects GET /board_in_projects.json
[ { "docid": "ea05788e03672915573892e0fd09ea34", "score": "0.76375425", "text": "def index\n @board_in_projects = BoardInProject.all\n end", "title": "" } ]
[ { "docid": "b2d778e1a6b6df24139d1f5864dedb0f", "score": "0.68132377", "text": "def list\n get 'projects'\n end", "title": "" }, { "docid": "22061414a1ab9f33347404bfb608f66c", "score": "0.6685904", "text": "def set_board_in_project\n @board_in_project = BoardInProject.find(pa...
8d585cf0af494c0a6ce3d65968352a5e
PATCH/PUT /camera_models/1 PATCH/PUT /camera_models/1.json
[ { "docid": "5b59208898a582ca91641c1f1898534f", "score": "0.6928933", "text": "def update\n respond_to do |format|\n if @camera_model.update(camera_model_params)\n format.html { redirect_to @camera_model, notice: 'Camera model was successfully updated.' }\n format.json { head :no_co...
[ { "docid": "32cd60127883afff2cf54454d0386f92", "score": "0.6417081", "text": "def update\n @camera = Camera.find(params[:id])\n\n respond_to do |format|\n if @camera.update_attributes(params[:camera])\n format.html { redirect_to @camera, notice: 'Camera was successfully updated.' }\n ...
88d03c9b1ad2b3bb7596f7dd68a5d8dd
Returns a new instance of Stream.
[ { "docid": "2a4ad343aeb19817691d006b40ebe1ef", "score": "0.0", "text": "def initialize(attributes = {}, &block)\n @attributes = defaults.merge!(attributes)\n @align = @attributes[:align]\n @text = @attributes[:text]\n @width = @attributes[:width]\n @parent = ...
[ { "docid": "3999dde6a73644ca3ca85ae8d7edca31", "score": "0.821691", "text": "def create_stream\n Stream.new(self)\n end", "title": "" }, { "docid": "9dab9bba55d8ad4316d48ff4a94b4936", "score": "0.7247177", "text": "def stream\n @__stream ||=\n Stream.new do |g|\n e...
d9c00a2cf7cc1ffc9ea760dcbba267cd
GET /tax_codes/new Displays the form used to create a new tax code.
[ { "docid": "3d45514523bbe0cbdd0183df66912a68", "score": "0.72326297", "text": "def new\n respond_with(tax_code)\n end", "title": "" } ]
[ { "docid": "b82b4610daa5d4670013ab7892c07127", "score": "0.78647655", "text": "def new\n @taxcode = Taxcode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @taxcode }\n end\n end", "title": "" }, { "docid": "fc6e55bc53a0264cd561022...
06d5373cd6986b3d853d9b3ef967d5ec
DELETE /article_types/1 DELETE /article_types/1.json
[ { "docid": "3e4c910b4fe55087f2f609b91e75d9b6", "score": "0.7779945", "text": "def destroy\n @article_type.destroy\n respond_to do |format|\n format.html { redirect_to article_types_url, notice: 'Article type was successfully destroyed.' }\n format.json { head :no_content }\n end\n en...
[ { "docid": "a67f705d88f7bafefa2ea688084f6f5b", "score": "0.80744404", "text": "def destroy\n @article_type = ArticleType.find(params[:id])\n @article_type.destroy\n\n respond_to do |format|\n format.html { redirect_to article_types_url }\n format.json { head :no_content }\n end\n ...
70c072207f0d9fcbf4fb7f5db18eac50
Returns the value of the `name` attribute.
[ { "docid": "78ef3675cda3cb80db60e9e90f806a4c", "score": "0.0", "text": "def name\n @name\n end", "title": "" } ]
[ { "docid": "616d0a47df20e9cdc78e0ab89d486a95", "score": "0.8692568", "text": "def name\n @attrs[:name]\n end", "title": "" }, { "docid": "d0d3658a5bdc9669e942d86266f65966", "score": "0.8664805", "text": "def name\n @attrs[:name]\n end", "title": "" }, { ...
ffcf8cb812700b2d0462f377d8f79af0
Clicks the 'Become a Member' link in a profile
[ { "docid": "77d117795f719a0ca107fef8ac997b60", "score": "0.8096341", "text": "def click_become_a_member\n add_new = $browser.element(@selector).link(text: 'Become a Member')\n add_new.click\n end", "title": "" } ]
[ { "docid": "fc845c17bf730e01486c41a130672f78", "score": "0.7753377", "text": "def profile\n self.profilelink.click\n end", "title": "" }, { "docid": "9c433ccd2bdf3fcbb7bf9540f8aeb4d8", "score": "0.72191757", "text": "def click_new_profile\n click_link('Create a profile')\n...
d6b7be441505b2f47eb8f1267bcf036d
RAMP letters request that Veterans respond within 60 days; elections will be accepted after this point, however, so this "due date" is soft.
[ { "docid": "a4af21180d3ac367289743a527dbd195", "score": "0.5005273", "text": "def due_date\n notice_date + RESPOND_BY_TIME if notice_date\n end", "title": "" } ]
[ { "docid": "baf48ed546c007cedc3c6df7edf243ac", "score": "0.60083807", "text": "def due_date_chaser(user)\n @user = user\n # Checks if the time difference in days is between 0 and 1.\n \n # Toggle the 0..0 range if you want to change. 0..0 is 24 hours, 0..1 is 48 hours....\n @items = Item....
d403bb4b7ff04bac1682b07876db4d55
Gets a user's by its username
[ { "docid": "018648f26e9179fa6daa017666e82236", "score": "0.70887065", "text": "def search_user(username)\n response = @api_client.get(URI::USER_SHOW_URI, { screen_name: username })\n User.new(response)\n end", "title": "" } ]
[ { "docid": "9fd40642826fa9fb16e8d0c3e75aa67d", "score": "0.78817004", "text": "def user_by_username(username)\n get(\"/v1/users/find\", username: username)\n end", "title": "" }, { "docid": "98d7c6f7a51c78569eb53b47a6139e12", "score": "0.769643", "text": "def get_user(usernam...
cb034bf289eaf08da649fe26d8c75253
when trying this test, make sure the testing file is big enough to not fit in the socket buffer anymore on my system 10mb is enough
[ { "docid": "a196b8705f6af66d8e86cbf210fc12c5", "score": "0.6199309", "text": "def test_socket_downstream_splicing_times_out\n f1 = File.open @input_file\n t = start_server 3002 # open accepting socket in different thread\n sleep 0.1 # wait for the server socket to start up\n s = TCPSocket.ne...
[ { "docid": "b30ea9eff1522c184a1e59759ad092b8", "score": "0.7362005", "text": "def test_send_large_file\n File.open( @filename, \"w\" ) {|f|\n f << (\"A\" * 1000000)\n }\n\n data = ''\n\n assert_raises(RuntimeError) {\n EM.run {\n EM.start_server \"127.0.0.1\", ...
3335ed07f8b6afcac512c8922a246ab5
expected output = "Hello There, How Are You?"
[ { "docid": "eac92abf48acbb954e4fc81432b60efb", "score": "0.0", "text": "def capitalize_words (string)\n new_arr = string.split(\" \")\n new_arr.map { |e| e.capitalize }.join(' ')\nend", "title": "" } ]
[ { "docid": "4a279a8939273dcee1ef56bdcfc7c060", "score": "0.6960817", "text": "def create_second_text_message(first_response)\n%(When I feel #{first_response}, I will also feel:\nCarefree\nPeaceful \nRelieved\nMellow\nRelaxed)\n end", "title": "" }, { "docid": "5732cd5d35a600b4cdd390c4042b...
653e82f28bf1178167b73e757784e6b5
Run the execution loop. This call normally won't return until everything is finished.
[ { "docid": "5f9d547b7f0973e08f8a0803cd8540a7", "score": "0.6326065", "text": "def run\n\n #loop forever\n loop do\n\n Server.all.each do |server|\n result = server.check()\n log(\"result for #{server.name}: #{result}\")\n end\n\n end\n\n ...
[ { "docid": "61e1acf14f8f89e050ba99eea6c78a22", "score": "0.7628239", "text": "def loop\n before_loop\n @running = true\n in_loop\n self\n rescue Exception => e\n Rib.warn(\"Error while running loop:\\n #{format_error(e)}\")\n raise\n ensure\n @running = false\n after_loop\n e...
38540316f9a134edccbee3dacdf2587c
Get action config by name
[ { "docid": "93737c7634b5e7ff70a5d64c1da78659", "score": "0.641357", "text": "def action(name)\n @action_index[name.to_sym]\n end", "title": "" } ]
[ { "docid": "87411f08fc05a4176d092b83866a1844", "score": "0.7510895", "text": "def get_cfg(action_name_str)\n cfg = class_variable_get(:@@args_cfg)\n cfg[self] ? cfg[self][action_name_str] : nil\n end", "title": "" }, { "docid": "e8bbe26b348292339930ca79e2a74474", "scor...
18c1cb56fbf1e999932876cf78e2a20f
how many resources are managed
[ { "docid": "ed8ba5f05466b3f0cda56a14779b6017", "score": "0.8614452", "text": "def managed_resources_count\n managed_resources.size\n end", "title": "" } ]
[ { "docid": "02f0f571956efe0af4c930633076abed", "score": "0.7982991", "text": "def resources_count\n self.resources_count = resources.count\n end", "title": "" }, { "docid": "b64819994fb6bb75497df9b0ff861e62", "score": "0.7911428", "text": "def getResourceCount() \n @obj...
ece0738f98d9d7052f6614cfdc0dbede
return extension of file
[ { "docid": "7b9843f0433e4a2da2d310dd9f2b825a", "score": "0.827962", "text": "def original_extension\n File.extname(original_filename)\n end", "title": "" } ]
[ { "docid": "f40838a6de9bd99808cf6f2c93caddad", "score": "0.9179649", "text": "def extension\n File.extname(file.to_s)\n end", "title": "" }, { "docid": "3951d5ff5edaa26e6d3567794e90a2ad", "score": "0.8916216", "text": "def getExtension(file)\n File.extname(file)\n end", ...
31570f8070d5552c5b2c66fb861afc79
creates a user in the database if necessary and creates the defaults directories
[ { "docid": "ae10396600941f7006144ae81377ba11", "score": "0.0", "text": "def user= user\n unless user.class == Modeles::User\n username = user.to_s\n user = Modeles::User.find_by_name username\n unless user\n @errors << \"User #{username} doesn't exists\"\n ret...
[ { "docid": "e5b17c33891468aa647d4c29b7d9419d", "score": "0.7344601", "text": "def create_user_if_none_exist\n return if User.exists?\n puts \"Creating Users...\"\n\n User.create :email => \"test@test.com\", :password => \"welcome1\", :password_confirmation => \"welcome1\"\n end", "title": ...
c1133fa4d40f0f0c3255046df7d4be51
Detect method additions to Object and remove them in the BlankSlate class.
[ { "docid": "b7c47d836b3340afcedece3c2e6c4df8", "score": "0.6436648", "text": "def method_added(name)\n hpricot_slate_method_added(name)\n return if self != Object\n Hpricot::BlankSlate.hide(name)\n end", "title": "" } ]
[ { "docid": "902ba2e134d750edf3e16d4437ea8963", "score": "0.7325186", "text": "def remove_methods_etc\n end", "title": "" }, { "docid": "09cc3cb086d9b26a795da26aa1f3b3ec", "score": "0.7190563", "text": "def remove_methods_etc\n end", "title": "" }, { "docid": "d008622e...
b6203fc7284028bae20b8bacce12a9e6
Method called by a ParseTreeVisitor to which the formatter subscribed. Notification of a visit event: the visitor completed the visit of the children of a nonterminal node.
[ { "docid": "8cb1bd68d61e6ad083050d74ff37ef70", "score": "0.0", "text": "def after_subnodes(_parent, _children)\n curr_path.pop\n ranks.pop\n end", "title": "" } ]
[ { "docid": "84d1064205800c11a2590974c62fe0da", "score": "0.66201", "text": "def end_visit_ptree(aParseTree)\n broadcast(:after_ptree, aParseTree)\n end", "title": "" }, { "docid": "b7c4ba1a725cf22d83a263123c1d4378", "score": "0.6588623", "text": "def end_visit_ptree(aParseTree)\n...
4490fa8061316656d58a14fe49d41c1d
Provide output to show target.
[ { "docid": "111381c75821c809a3148e486eb202a1", "score": "0.0", "text": "def to_target output\n @event[:to_target] = output\n @event\n end", "title": "" } ]
[ { "docid": "f23d950722daad0fc2292a6f02eda152", "score": "0.74721164", "text": "def output\n @options[:output]\n end", "title": "" }, { "docid": "a66c95cc43931e47c35f643c1b831108", "score": "0.74223673", "text": "def output\n end", "title": "" }, { "docid": "a66...
b3c2400accb522b8aee2fbd4f7797a85
List Tier1 instances Paginated list of all Tier1 instances
[ { "docid": "ff30fc8b2fc6ece15640673e05dc5482", "score": "0.5717664", "text": "def list_tier1(opts = {})\n data, _status_code, _headers = list_tier1_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "c84904bce5ffe5328d2b538f1dafe187", "score": "0.659772", "text": "def index\n @klasses = Klass.all.paginate(:page => params[:page], :per_page => 20)\n end", "title": "" }, { "docid": "a945b25d885ddda2ccedf8c302321970", "score": "0.62075", "text": "def index\n @regis...
5d16e3ae904e69a171dc27e391537b4f
This can be used to run certain test examples only if ZMQ draft API is available.
[ { "docid": "26c3b47ca19163b7a5bd56fb4386c196", "score": "0.63042444", "text": "def has_zmq_drafts?\n # NOTE: We use some function that is currently declared DRAFT. Another one\n # might be needed in future versions.\n CZTop::Poller::ZMQ.poller_destroy(FFI::Pointer::NULL)\n true\n rescue Not...
[ { "docid": "9944ae1ff7896f8ca75544dcbe08e373", "score": "0.6116401", "text": "def test_setup\n test_queue\n true\n end", "title": "" }, { "docid": "36ca51e224cabed96005a2b2476b5caa", "score": "0.61014813", "text": "def test_enqueue_message\n body = 'This is a test mes...
573279414ab883d463bb4c479750e047
Create action is used to create new items
[ { "docid": "cf9907088f5042cebfdc8d9800c915a4", "score": "0.0", "text": "def create\n @object = collection.new(safe_params)\n if @object.save!\n render :show, status: :created\n else\n render json: @object.errors.full_messages.to_sentence, status: :unprocessable_entity\n end\n end"...
[ { "docid": "8bdef1c49585ebed9de3815f8c3fcaaf", "score": "0.80562794", "text": "def item_create\n get_model\n return head(:forbidden) if @model.admin_configuration[:no_create]\n\n @item = @model.new\n if @item.update_attributes(item_params)\n redirect_to admin_collection_path(params[:mod...
c3523df055e01eb9af22259cedc38eeb
TODO no need for this if all shown messages are stored in SQLITE3 and keyed by UID.
[ { "docid": "d632055a5558d1062a995212c3f5a543", "score": "0.0", "text": "def clear_cached_message\n return unless STDIN.tty?\n log \"Clearing cached message\"\n current_message = nil\n end", "title": "" } ]
[ { "docid": "473de61dec91c1073f40c56dee034f09", "score": "0.69453746", "text": "def show_messages(uids)\n return if uids.nil? or (Array === uids and uids.empty?)\n\n fetch_data = 'BODY.PEEK[HEADER.FIELDS (DATE SUBJECT MESSAGE-ID)]'\n messages = imap.fetch uids, fetch_data\n fetch_data.sub! '....
521ae1b02dc06b165f86a5ef579815c9
Sends an API request to hardreboot (power cycle) the server. See the reboot method for more information. Returns true if the API call succeeds. >> server.reboot! => true
[ { "docid": "b5fc927236de7baea81678dfa540bf96", "score": "0.7303588", "text": "def reboot!\n self.reboot(\"HARD\")\n end", "title": "" } ]
[ { "docid": "225cd9724cf06aed6814c347c947f0ba", "score": "0.8105038", "text": "def reboot\n response = Profitbricks.request :reboot_server, \"<serverId>#{self.id}</serverId>\"\n return true if response.to_hash[:reboot_server_response][:return]\n end", "title": "" }, { "docid": "2...
2ea3dd5011ab08db3d402b1f9097d8f9
Prevents access to this set of pages unless the user is a staff of the course.
[ { "docid": "b51e4c1d081b7ab931f905071524eaee", "score": "0.0", "text": "def authorize_edit!\n authorize!(:manage_users, current_course)\n end", "title": "" } ]
[ { "docid": "5d4449249aa05ab5166f3f653eb1fc4d", "score": "0.74721", "text": "def access_control\n deny_access and return unless @current_user.present? && @current_user.staff?\n end", "title": "" }, { "docid": "93f78f01ede63e8076ccde547b91c340", "score": "0.6828087", "text": "def r...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "968c91adadf65e56be8c92dabf4d0e59", "score": "0.0", "text": "def set_mcategory(id)\n @mcategory = Mcategory.find(id)\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6165094", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60450804", "text": "def action_hook...