query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
eb09d57b5ad69fa56e3ec7a47f1e41d3
Delegator to Aeon::Clientprompt Prompt with +str+ or the default prompt "PlayerName> "
[ { "docid": "a6b7a717a7933fe2322b1351af88bdc3", "score": "0.8145589", "text": "def prompt(str=\"#{@name}> \")\n @client.prompt(str)\n end", "title": "" } ]
[ { "docid": "7642bf5d9cc64d0574c37401b3f2f4a1", "score": "0.70706034", "text": "def set_prompt(string)\n @prompt = string\n end", "title": "" }, { "docid": "301a55532c9ce3d67d91fadff6833b47", "score": "0.70236194", "text": "def prompt(str)\n puts \"=> #{str}\"\nend", "title":...
a9543237ae7d51c8aa8f45b48cc374e3
Given: an array of capitalized codons Return: a string of spacedelimited Amino acids Translation doesn't start until the START_CODON is reached Translation stops when one of the STOP_CODONs is reached Translation stops when one of the STOP_CODONs is reached, but only after translation started We are not handling any st...
[ { "docid": "fa21342acef97a2667d66ccae193b31a", "score": "0.74629664", "text": "def translate(codons)\n st = String::new\n if codons.size == 0\n return st\n end\n i = codons.index(START_CODON)\n stop = 0\n codons[i..codons.size].each do |x|\n STOP_CODONS.each do |y|\n ...
[ { "docid": "0777b9e2da5f6da28a388aa373f244d5", "score": "0.61759996", "text": "def amino_acid_sequence\n arr = translation.chars\n amino_sequence = ''\n #codon = arr[0,3].join\n codon = arr.first(3).join\n while codon != start_codon do\n arr.shift\n codon = arr.first(3).join\n ...
b9792365500643af1eaefcb7656b65b9
DELETE /weather_logs/1 DELETE /weather_logs/1.json
[ { "docid": "b66aa41b225e2065c950af9338be55b1", "score": "0.73543555", "text": "def destroy\n @weather_log.destroy\n respond_to do |format|\n format.html { redirect_to weather_logs_url, notice: 'Weather log was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"...
[ { "docid": "124a87ea3b8a1248bf1c232690ac8bb1", "score": "0.689883", "text": "def destroy\n @foodlog = Foodlog.find(params[:id])\n @foodlog.destroy\n\n respond_to do |format|\n format.html { redirect_to foodlogs_url }\n format.json { head :ok }\n end\n end", "title": "" }, ...
1bcfbb0eedf7441d8153c575a3c7d25e
TODO: Rename format attr rubocop:disable Style/FormatString
[ { "docid": "83ee5e409ef9c93819e62e8f606ddba1", "score": "0.0", "text": "def calculate(meters, date)\n numerator = meters[@numerator] ? (meters[@numerator][date] || 0) : 0\n denominator = meters[@denominator] ? (meters[@denominator][date] || 0) : 0\n\n value = denominator.zero? ? 0.0 : (nu...
[ { "docid": "43f0dd8ef7a8eac6d29500de95da0282", "score": "0.7056266", "text": "def formatted; end", "title": "" }, { "docid": "43f0dd8ef7a8eac6d29500de95da0282", "score": "0.7056266", "text": "def formatted; end", "title": "" }, { "docid": "f244e48fd992fe4104bbc3586672a7a0...
ed7a28bf9eb3e92d12d416577d18b828
outputs min of the first 1 to n letters of the word
[ { "docid": "3ba76ca3abaae2795cfa4b200529fb9e", "score": "0.6676482", "text": "def start_of_word (str, n = 0)\n x = str\n x[0..(n-1)]\nend", "title": "" } ]
[ { "docid": "0f31849d1c254ee371e0d91f2d3e2b55", "score": "0.73981476", "text": "def find_short(s)\r\n p s.split.map(&:length).min\r\n # .split: turn string into an array of words\r\n # .map(&:length): convert each word into its character ...
570ae20eb9660c2a90e126172c6e2ca3
POST /shows POST /shows.json
[ { "docid": "08a65bf35730e30887fbb0447636d9af", "score": "0.0", "text": "def create\n @show = @user.shows.build(params[:show])\n @show.build_host(:email => params[:host][:email])\n @show.build_location(:address => params[:location][:address])\n web_string = (0...8).map{65.+(rand(25)).chr}.joi...
[ { "docid": "16f0ec470660bebe9bd4fe3ca878552c", "score": "0.7241718", "text": "def create\n @show = @auditorium.shows.new(params[:show])\n\n respond_to do |format|\n if @show.save\n format.html { redirect_to [:admin, @auditorium, @show], notice: 'Show was successfully created.' }\n ...
5443318bd3c24d02c00220f1c18e21c8
`extract_scale` and `extract_precision` are the same as in the Rails abstract base class, except this permits a space after the comma
[ { "docid": "795913be79c9aca9dd190f02625e291b", "score": "0.56595194", "text": "def extract_scale(sql_type)\n case sql_type\n when /\\((\\d+)\\)/ then 0\n when /\\((\\d+)(,\\s?(\\d+))\\)/ then $3.to_i\n end\n end", "title": "" } ]
[ { "docid": "117438a9638b899da285566a2d2c0937", "score": "0.56698865", "text": "def extract_precision(sql_type)\n # Actual code is defined dynamically in PostgreSQLAdapter.connect\n # depending on the server specifics\n super\n end", "title": "" }, { "docid":...
d4de9343b093004fd4761101fcf3f97c
Sets the current organization in context of grafana
[ { "docid": "85beb5a254df9f338f5b381a05df3f2f", "score": "0.6139337", "text": "def select_org(organization, grafana_options)\n grafana_options[:method] = 'Post'\n grafana_options[:success_msg] = 'Organization selected'\n grafana_options[:unknown_code_msg] = 'OrganizationApi::select_org unc...
[ { "docid": "dc54a71bb4ec8db012fe29499d133565", "score": "0.75142217", "text": "def set_organization\n if current_user\n current_organization = Organization.find(current_user.organization_id)\n set_current_tenant(current_organization)\n end\n end", "title": "" }, { "docid": "...
2350960d1ea00072e8fd37d85ce7cb63
Determines whether the specified path is a directory
[ { "docid": "da32aaa4ffe74193c1756a0d3f42779a", "score": "0.8864432", "text": "def is_dir?(path)\n File.directory? path\n end", "title": "" } ]
[ { "docid": "2935455fe1febe848072e7bdce11b037", "score": "0.88798934", "text": "def dir?(path)\n begin\n ftype(path) == 'directory'\n rescue\n false\n end\n end", "title": "" }, { "docid": "84b4d2bf94c980c4e991272435b62371", "score": "0.8540231", "text": "def is_di...
1b17c26f03c48c4794b087ca0db93dbf
GET /adjustments/1 GET /adjustments/1.json
[ { "docid": "18b333e632d5eeaebd648073f8949844", "score": "0.0", "text": "def show; end", "title": "" } ]
[ { "docid": "e9bb424b91ff225cdbf442b43cc54518", "score": "0.6709497", "text": "def update_adjustments\n self.adjustments.reload.each(&:update!)\n end", "title": "" }, { "docid": "9450b0aeec90c34ca0aa2670fdc9d67c", "score": "0.66892475", "text": "def retrieve_inventory_adjustme...
b70acfd4121b1642b4a7a163ad0d97c1
invalidates all the dirty keys and marks them as clean
[ { "docid": "9d1000029ff6431957bb7fe958baaefd", "score": "0.7852613", "text": "def invalidate_dirty_keys\n\t\tif @cf_distribution_id.nil?\n\t puts \"WARNING: cf_distribution_id is nil. (you can include it with :cf_distribution_id => 'id')\\n--> skipping cf invalidations...\"\n\t return\n\t end\n\n...
[ { "docid": "305691ac0d908601f6ce89ca8e289ada", "score": "0.74476427", "text": "def clean\n the_keys = keys( false )\n\n unset *the_keys unless the_keys.empty?\n end", "title": "" }, { "docid": "bf80c9db0314d0edebe1757e23ecdf0a", "score": "0.72534585", "text": "def clean\...
3abda6ea8cf527155eb3e874f0a43e9d
pokud a je 0
[ { "docid": "2e524a96dc8d418eae1ccc9422de8973", "score": "0.0", "text": "def test_Aeq0\n assert_equal( [-5/2.to_f], Equation.solve_quadratic(0, 2, 5) )\n end", "title": "" } ]
[ { "docid": "d7482b5955bffcc3a922977c47af336b", "score": "0.7228511", "text": "def nonzero?; end", "title": "" }, { "docid": "7216c9d065596e74b3b59021330834e9", "score": "0.71362585", "text": "def seuil()\n\t\treturn 0\n\tend", "title": "" }, { "docid": "cd179cd70151e8822e...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ebab7da94300596d4807cafe864491d9", "score": "0.0", "text": "def set_trip\n @trip = Trip.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...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "23306d107f59202eda67362bfab9ed74", "score": "0.0", "text": "def set_user\n @user = User.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;...
bdd8ef6402dc5d153b8a6c404072a4f5
creates new booking for given table
[ { "docid": "d5111982bf28c798ee07669936a63dcd", "score": "0.8694362", "text": "def create_booking(table)\n booking = Booking.new(table_id: table.id,\n start_time: @start_date,\n end_time: @end_date,\n length: params[:hours],\n ...
[ { "docid": "3a5ec84bd49c7ab15ff279a92666265f", "score": "0.73173624", "text": "def create\n @tablebooking = Tablebooking.new(tablebooking_params)\n\n respond_to do |format|\n if @tablebooking.save\n format.html { redirect_to @tablebooking, notice: 'Tablebooking was successfully created...
d5608a879498ac845d9a78ced1b865bc
validate rights of person
[ { "docid": "4cefb580cbf96ef083e33c4de616c93b", "score": "0.55950826", "text": "def validate_person\n if session[:person] != @person\n flash[:notice] = 'Sie sind leider nicht berechtigt!'\n redirect_to :back\n end\n end", "title": "" } ]
[ { "docid": "851d1bf21433314cdd97eb9216273afd", "score": "0.6445252", "text": "def verify_rights\n access_allowed?(params.slice(:controller, :action)) || permission_denied\n end", "title": "" }, { "docid": "c588ad6f126ffe9061bb9be75985a1a0", "score": "0.6333398", "text": "def ...
b8023ff956d0f02b1a0ec5707e567335
this provdes additional security by only allowing the permitted variables to be accessed and changed.
[ { "docid": "fc9d917995322237064d323080d5e1f1", "score": "0.0", "text": "def subscriber_params\n params.require(:subscriber).permit(:id, :fname, :lname, :email, :password, :city, :state)\n end", "title": "" } ]
[ { "docid": "53ea71cdfa44d79d61ea8e4adf72306b", "score": "0.6781664", "text": "def forbid\n @forbidden = true\n end", "title": "" }, { "docid": "0a310ed82f7e1f3a0292f9825e070cf4", "score": "0.66754806", "text": "def permitted=(_arg0); end", "title": "" }, { "docid"...
3a3c5f4e3ece483a00e05c573a356070
Set the page description
[ { "docid": "81c71eccd8bce48f320e03ca430fd18f", "score": "0.0", "text": "def page_description\n if content_for?(:description)\n \"#{yield_content(:description)}\"\n else\n \"We are Ollie & Kat, and this is our blog about moving to Canada and documenting our travels and experiences.\"\...
[ { "docid": "37c861ee5849a4297367760e73f4c975", "score": "0.7750188", "text": "def set_page_description(*values)\n opt = { sanitize: false } # Sanitization occurs in #emit_meta_tag.\n replace_page_meta_tags(description: normalized_list(values, **opt))\n end", "title": "" }, { "docid": ...
61c89fe86fa279e1cc341a74a40b358d
Deserializes the data based on type
[ { "docid": "0d9c0cccd0d4d63a3de32caea20039a1", "score": "0.0", "text": "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n ...
[ { "docid": "36a7ecd8f09e91284f3ff814815f745d", "score": "0.8231654", "text": "def deserialize(data, type = nil)\n serializer(type).deserialize(data)\n end", "title": "" }, { "docid": "36a7ecd8f09e91284f3ff814815f745d", "score": "0.8231654", "text": "def deserialize(data, type = n...
794fb194b2fa90a8db1dfb87bf8774e2
Sadly you can't just add a class using the id
[ { "docid": "90474a052ebf75c0b404bb6bb2828b24", "score": "0.0", "text": "def add_to_cart(signup_link)\n agent.get(signup_link)\n end", "title": "" } ]
[ { "docid": "3446206538dd83802fe15f00c2b357ad", "score": "0.6926916", "text": "def css_id\n \"#{self.class}-#{self.id}\"\n end", "title": "" }, { "docid": "bc865f1cd9a1bebf6b579502547abc1b", "score": "0.6607955", "text": "def add_class_to_elem(page, css_selector, classname)\n elems...
8e25982bcbc3f829a6be0172f715ccc6
Validates track_list whilst also converting the track_list into the individual tracks associated with this album for later saving. If track_list is not in this format then this validation will error.
[ { "docid": "d7c90dbf152cb1c657d0d65afa6441cc", "score": "0.7352412", "text": "def track_list_format\n return unless @track_list\n\n @track_list.split(\"\\r\\n\").each.with_index(1) do |track, index|\n Track.parse_form_track(track, index, tracks, errors)\n end\n end", "title": "" } ]
[ { "docid": "0e1d0b280c7f2aa001d6de0534c8a334", "score": "0.58036643", "text": "def valid_track\n return unless track&.program && program\n\n errors.add(:track, 'is invalid') unless track.confirmed? && track.program == program\n end", "title": "" }, { "docid": "0a20740a8d2778d0c51f3cb0...
06b2565ffe98b64d42a5994ba395e5bf
get upload playlist from channel
[ { "docid": "cd21307adc8ce108117c5c7fe3dada62", "score": "0.7403152", "text": "def get_uploads_playlist_items(playlist_id)\n playlists = HTTParty.get(\"https://www.googleapis.com/youtube/v3/channels?part=id%2C+contentDetails&id=#{playlist_id}&key=#{@key}\")\n @playlist_items = playlists['items'].fi...
[ { "docid": "171ef8f54ce4149426428a1f39b024b7", "score": "0.708863", "text": "def playlist\n player.playlist\n end", "title": "" }, { "docid": "a942434754d816c0310b7b91376f6af5", "score": "0.7088077", "text": "def get_upload_channel_id(username)\n upload_channel = nil\n\n...
0104a72612f0a5778f2a7354ffb3350e
Arguments : Include_canceled , Include_completed. Returns : collection of l3s Objects. Description : It selects l3s Objetcs based upon parameters.
[ { "docid": "0a0851d9356fe99595a048ab4dd41566", "score": "0.822449", "text": "def get_l3s_objects(include_canceled, include_completed)\n\n if include_canceled =='include_canceled' and include_completed == 'include_completed'\n return self.l3s.order(:name)\n elsif include_canceled =='include_ca...
[ { "docid": "ad3525985d3e00cc703a45fae5d9621c", "score": "0.6460679", "text": "def get_all_objects(options = {})\n s3 = Aws::S3::Resource.new\n bucket = s3.bucket(@bucket)\n\n # remove ACL file from the list\n objects = bucket.objects.reject { |o| o.key == \"acl.txt\" }\n\n return objects ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "63f0460fb53fcfcc3954932048895c52", "score": "0.0", "text": "def set_datasift_subscription\n @datasift_subscription = DatasiftSubscription.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...
3db5442f38d8344eac95c63277f42002
Generate two notes, one at the current start time that is only a 32nd note long. The next follows immediately, and is for the +to+ square. Its length is the remaining time.
[ { "docid": "6bb84291861a63178dda2f92dff126ea", "score": "0.6342178", "text": "def generate_notes(track, channel, total_delta, piece, from, to)\n # First note is quickly followed by the second note\n note = RANK_TO_NOTE[piece.color][from.rank]\n e = NoteOnEvent.new(channel, note, 127)\n e.tim...
[ { "docid": "eb3f3f5a15f38a0138853c4fa964faad", "score": "0.6378688", "text": "def pair_notes\r\n last_off_time = -1 # used to look for rests\r\n \r\n i = 0\r\n while i < @notes.length\r\n notes_to_skip = 1 # normally advance one note each time through loop, but more if chord\r\n \r\n if @...
8896c71d9b1234fa9b85bf857b4f871c
untested we do not have a histogram so far
[ { "docid": "8f8db3005ac3ab363f2ef12c21deae88", "score": "0.6297588", "text": "def report_histograms histograms\n histograms.each do |name, values|\n puts name, histogram.inspect\n %w{count max min mean stddev p50 p75 p95 p99 p999}.each do |name, value|\n report(\n :service =...
[ { "docid": "23a82dac18fe93ca8ea9e44a747e58c0", "score": "0.8794166", "text": "def histogram; end", "title": "" }, { "docid": "23a82dac18fe93ca8ea9e44a747e58c0", "score": "0.8794166", "text": "def histogram; end", "title": "" }, { "docid": "23a82dac18fe93ca8ea9e44a747e58c0...
cc883570d58f243411d7523c729d7dda
Creates a new user and handles validation issues OPTIMIZE: use build in validations instead of by hand
[ { "docid": "ead50e9495e82ff04ae34e6ebd7b0cdf", "score": "0.0", "text": "def create\n @user = User.new(user_params)\n\n # Ensure the email addres is not a duplicate\n # If blank? returns true, then there is no user in the\n # database that has the same email as the user being created\n if ...
[ { "docid": "a80debea1e3e43d82eb9c485b7e910e7", "score": "0.8206802", "text": "def create\n @user = User.new(user_attributes)\n if @user.save\n created(@user)\n else\n validation_errors(@user)\n end\n end", "title": "" }, { "docid": "b9153c4a5c454d148a46ad...
9f8c2ab085ce70cd932898c8482a3d74
Returns all unprocessed manifests within this dropbox
[ { "docid": "04cbd426a608b5d88d62096be28cc4b5", "score": "0.5933116", "text": "def manifests\n # TODO: handle s3 case, and use URI for source_location (need to change across batch ingest gem as well)\n Dir[File.join(base_directory, \"**/*.{#{MANIFEST_EXTENSIONS.join(',')}}\")]\n end", "t...
[ { "docid": "f999e2777826d43c504bbddba663889e", "score": "0.68774253", "text": "def empty_manifests\n bfs = bag_files\n manifested_files.reject { |f| bfs.member? File.join(bag_dir, f) }\n end", "title": "" }, { "docid": "f999e2777826d43c504bbddba663889e", "score": "0.68774253...
bc0d22c71c4d0bb4d9402b8bf7969252
GET /compliments/new GET /compliments/new.json
[ { "docid": "a80accd479712cc25747370240f443a3", "score": "0.7745151", "text": "def new\n @compliment = Compliment.new\n if @compliment.save\n redirect_to compliment_show_path\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @compliment ...
[ { "docid": "b7479ff9a8be010eca4695c85a16ae1f", "score": "0.7601179", "text": "def new\n @comp_info = CompInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comp_info }\n end\n end", "title": "" }, { "docid": "cd18725f51f0da3353e...
778c08a0813cdda5e75180a9d4ccb3fb
Calculate the current load factor
[ { "docid": "a6f63ed8326090445d35670107a8991c", "score": "0.77805996", "text": "def load_factor\n @count.fdiv(size)\n end", "title": "" } ]
[ { "docid": "bb0c2061d43ece1bf10780dbde7db4b2", "score": "0.8291456", "text": "def load_factor\n puts \"Load Factor: #{new_load_factor = @item_count / @size.to_f}\"\n return new_load_factor\n end", "title": "" }, { "docid": "44f3ee169745b99db66fe749f4465268", "score": "0.80895066",...
9af618aa6de48fd376ee448b97cc0a39
Most record types require the master to be set when persisted. External identifiers allow a nil for master_id initially, until assigned to a master record. This method may be overridden in subclasses
[ { "docid": "09c5b0c5c6fba1294e80bb1827441a86", "score": "0.6272201", "text": "def allows_nil_master?\n false\n end", "title": "" } ]
[ { "docid": "b8fb5a372c1967a2b59b53e438ac0640", "score": "0.73620117", "text": "def master_id()\n @master_id ||= \"\"\n end", "title": "" }, { "docid": "b80669974a0e9f134d9e32d0157e0f7d", "score": "0.6816747", "text": "def set_master\n @master = Master.find(params[:id])\n...
4fbdfc66a3e236507e24a0d5dd64de4d
Write file to service === Returns [Boolean] true on success or raises error
[ { "docid": "36e0847aa87721c89cf5a9f77bf1002f", "score": "0.0", "text": "def store(new_file)\n if new_file.is_a?(self.class)\n new_file.copy_to(path)\n else\n fog_file = new_file.to_file\n @content_type ||= new_file.content_type\n @file = dire...
[ { "docid": "1f7ab3ef8ec6689e67630f5e4c4d37c5", "score": "0.7264447", "text": "def write_file(path, data)\r\n false\r\n end", "title": "" }, { "docid": "ac752c81616cf0f61a945e92718c9554", "score": "0.71087754", "text": "def written?\n File.exists? file_path\n end", "ti...
3dedcb601fa06d247c0fe4667dfb5281
GET /pelitos/1 GET /pelitos/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "a48a033a788fdebb2a77104f36901d8c", "score": "0.70607835", "text": "def index\n @pessoas = Pessoa.all\n render json: @pessoas\n end", "title": "" }, { "docid": "51ea57fcafe28ace1ac99853d21ecc72", "score": "0.69222045", "text": "def show\n render json: @pessoa\n ...
1aad275d895b069b76e742568119dea3
def profile_photo=(profile_photo) self.profile_photo_data = profile_photo.read self.profile_photo_filename = profile_photo.original_filename self.profile_photo_mime_type = profile_photo.content_type end
[ { "docid": "546cd28c9e9e7ae7a480ed070bc13c5c", "score": "0.0", "text": "def send_mail\n User.send_welcome_email(self.id)\n end", "title": "" } ]
[ { "docid": "81b4026123730a58b20b97c76a7cfd13", "score": "0.7945598", "text": "def profile_image=(file_data)\n @file_data = file_data\n end", "title": "" }, { "docid": "1b4bc16e624b33f59c28c3428e04bd44", "score": "0.78756887", "text": "def set_profile_photo\n @profile_photo =...
590a43183ad84d6da17c523fea3dcad9
Merges all ancestor accessors into self
[ { "docid": "9bb36e71f16c81d6325885819a2b3ce8", "score": "0.0", "text": "def merge!(config)\n self.compiled = false\n self.resource_class ||= config.resource_class\n transforms_from.merge! config.transforms_from\n transforms_to.merge! config.transforms_to\n custom...
[ { "docid": "53cdd0dba395d1a0b042bd7a0bbcacb4", "score": "0.6141564", "text": "def all_fields\n superclass.all_fields.merge(own_fields)\n rescue NoMethodError\n own_fields\n end", "title": "" }, { "docid": "c41f621c496112806922d237203b86bb", "score": "0.6010188", "text...
c7e657261542e0077053030575409da6
GET /sequoia_exams GET /sequoia_exams.json
[ { "docid": "57acecc6d693212717ef5f9853810f87", "score": "0.0", "text": "def index\n @sequoia_exams = SequoiaExam.all\n @sequoia_exams = SequoiaExam.order(:date_c => :desc).first(25)\n @sequoia_exams_all = SequoiaExam.all\n\n # @total = []\n\n @total_records = SequoiaExam.count(:uid)\n ...
[ { "docid": "48a3b1d15872e07b95a2aee6a3e07193", "score": "0.7707949", "text": "def my_exams\n @exams = User.find_by(id: params[\"id\"]).exams\n\n render json: @exams.to_json(include: :subject), status: :ok\n end", "title": "" }, { "docid": "c8cde2c1b17d3a3e5ef49381447e8686", "score...
b3fbf16d465f10bf7e036890685425f4
Returns a hash of player's overall statistics
[ { "docid": "ca0d6bf1954651a92a33d0de70693787", "score": "0.62296665", "text": "def overall_stats\n { kd: overall_KDR, wl: overall_WLR }\n end", "title": "" } ]
[ { "docid": "8911bafd10ec8a91c344f6de514de3a4", "score": "0.6941145", "text": "def player_stats(player_name)\n stats = {}\n player_data.each do |player|\n if player_name == player[:player_name]\n stats[:number] = player[:number]\n stats[:shoe] = player[:shoe]\n stats[:points] = player...
a81a6e48118593389e25f2cda6f7db75
Returns true or nil if the current user can or cannot do something
[ { "docid": "d65f78892ba81846ce1748050aaf57a5", "score": "0.8348383", "text": "def can?\n current_user\n end", "title": "" } ]
[ { "docid": "b1e5d2dabb651303e9f2c07b74d4dde6", "score": "0.7999646", "text": "def is_potential_user?\n\t\ttrue\n\tend", "title": "" }, { "docid": "0dc07aa91a86b279ae7ec0a06d1a3c78", "score": "0.7941302", "text": "def allow_access\n !@current_user.nil?\n end", "title": "" ...
f7e75d3e9c5892f7d4dafe56a6551dfc
POST /accesses POST /accesses.json
[ { "docid": "6909123e24f87eb289996de9c530d9ab", "score": "0.5218392", "text": "def create\n @access = Access.new(access_params)\n\n respond_to do |format|\n if @access.save\n format.html { redirect_to @access, notice: 'Access was successfully created.' }\n format.json { render ac...
[ { "docid": "7a925c835cbb013f5e69b016b9a4949e", "score": "0.69955766", "text": "def create_accesses_cookie\n cookies[:accesses] = {}.to_json\n end", "title": "" }, { "docid": "282b6a6436056157871f1c42406c3874", "score": "0.63775146", "text": "def index\n @accesses = Access....
5c0b1d1d6890bce903875f427fd3534d
if page 2 empty results fails don't use this with a too small search!
[ { "docid": "e08f76406ac6b7a9476a20a0b166f6bf", "score": "0.0", "text": "def visit_page(page)\n return if page == 1\n\n # While \"clicking\" on page 2, url changes in the way we can substitue \"page=x\"\n click_on_page(2)\n return if page == 2\n\n url = @session.current...
[ { "docid": "6cb6c99f83adb83d5e41f3ddb8627257", "score": "0.6916672", "text": "def empty?\n @page_count < 2\n end", "title": "" }, { "docid": "3c4c4a141bfed0290d10ae06d76141b5", "score": "0.6889981", "text": "def excessive_paging?\n page = blacklight_params[:page].to_i || 0\n ...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "fce5faadc5802feb918e13e981f735ab", "score": "0.0", "text": "def perusal_params\n params.require(:perusal).permit(:title, :content)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
46efde78a32fa77f23f458d9bc0309c4
Authenticate with Plaid Auth and list the user's accounts Fetch the user's accounts from the Plaid Auth service. Authenticate with Plaid Auth and list the user's accounts.Use the provided public_token from Plaid Link to authenticate. The accounts are reformatted to the Qwil account format, so that they are usable to cr...
[ { "docid": "b3f23af87fd122689839e52e6eb06e0f", "score": "0.5106058", "text": "def plaid_accounts_post(user_pk, public_token, opts = {})\n data, _status_code, _headers = plaid_accounts_post_with_http_info(user_pk, public_token, opts)\n return data\n end", "title": "" } ]
[ { "docid": "ea117af1cef33eb6b14d2f7f3c2eeec7", "score": "0.6223859", "text": "def get_access_token \n \n token = request.headers[\"Authentication\"].split(\" \")[1]\n user = User.find(decode(token)[\"user_id\"])\n if user\n link_token_response = @@client.item.publi...
995c0b76ce3c8bb4dbd695ab6c6ab888
callbacks from Liqpay server
[ { "docid": "f9b8c2333e1462f3bd2e0c19302534e9", "score": "0.0", "text": "def update\n @payment_method = PaymentMethod.find params[:payment_method_id]\n data = JSON.parse Base64.strict_decode64 params[:data]\n render text: \"Bad signature\\n\", status: 401 and return unless @payment_method....
[ { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.73529315", "text": "def callbacks; end", "title": "" }, { "docid": "bce3e1d1089bf6d6722900bd3cac0f36", "score": "0.7235129", "text": "def callback\n end", "title": "" }, { "docid": "0f0df8828d29d38b86967b897de598...
f69a5315698370eedb34f09b3d1d2f95
preorder traversal just takes a node
[ { "docid": "11894752f6bb1177c8b59749a7b477e2", "score": "0.70477134", "text": "def preorder(n)\n print n.to_s, \", \" # Print self\n if !n.left.nil? # Print left subtree\n preorder(n.left)\n end\n if !n.right.nil?\n preorder(n.right) # Print right subtree\n end\nend", "title": "" } ]
[ { "docid": "e0611a0ca5d58c1369fd9cbda8a26ac5", "score": "0.8310782", "text": "def pre_order_traversal(node=@root)\n return if (node == nil)\n puts node.value.to_s\n pre_order_traversal(node.left)\n pre_order_traversal(node.right)\n end", "title": "" }, { "docid": "da2a5f23999368...
bee9ef86c1b0278cbde5f741c5345f4f
PATCH/PUT /messagestoadministrators/1 PATCH/PUT /messagestoadministrators/1.json
[ { "docid": "e1a98b75f57f911ba0b1de89f5f6a0e9", "score": "0.621935", "text": "def update\n respond_to do |format|\n if @messagestoadministrator.update(messagestoadministrator_params)\n format.html { redirect_to @messagestoadministrator, notice: 'Messagestoadministrator was successfully upd...
[ { "docid": "f6a244435ec76fe6e13a3a9e5777f709", "score": "0.6162626", "text": "def update\n respond_to do |format|\n if @adminstrator.update(adminstrator_params)\n flash[:success] = 'Adminstrator was successfully updated.'\n format.html { redirect_to modify_admin_path }\n for...
f8f1e0103834972ef2fac4b58f462017
( virtual attribute )
[ { "docid": "b9808691cc8b7e5fe71017c2aaf50131", "score": "0.0", "text": "def rating=(new_rating)\n #review = Review.where(video: video, user: user).first \n #review.update_attributes(rating: new_rating) if review\n #review.update!(rating: new_rating) if review\n if review\n review.up...
[ { "docid": "2e498b811c1d13b03e32aed2be901419", "score": "0.7949849", "text": "def virtual; end", "title": "" }, { "docid": "639512c2ab926defd80a9c8f2f8c5d31", "score": "0.7417485", "text": "def attribute; end", "title": "" }, { "docid": "639512c2ab926defd80a9c8f2f8c5d31",...
caa6c2f67fd8b9f6dee04a2906353f95
multiplies previous random number to the current random number note: random number must be between 500 5000
[ { "docid": "15b497fa4f9c2931480942828f84d7b1", "score": "0.0", "text": "def main\n\n\tnum_mult\n\nend", "title": "" } ]
[ { "docid": "87f63e5af92a0ae977d0d706178ae4d8", "score": "0.7095443", "text": "def multply(number)\n result = 2\n\n for i in 1..number\n result *= rand(2..999)\n end\nend", "title": "" }, { "docid": "08935bf84b3e97dc20e5fa88e8d89a9f", "score": "0.6598641", "text": "def...
0094a99f679006d310e193cf9afbd649
The publishing format for the dataset.
[ { "docid": "7607bf9f49d8977bc54697a65eff58ed", "score": "0.7118941", "text": "def publishing_format\n :ckan\n end", "title": "" } ]
[ { "docid": "2c44eac19d2ea40fa66222c66263442b", "score": "0.7680969", "text": "def publishing_format\n :datapackage\n end", "title": "" }, { "docid": "2c44eac19d2ea40fa66222c66263442b", "score": "0.7680969", "text": "def publishing_format\n :datapackage\n end",...
294353c8b42e77880cb4f2f1e61c416a
PATCH/PUT /golongan_darahs/1 PATCH/PUT /golongan_darahs/1.json
[ { "docid": "98c009d25cf0798c99affe053bf186bf", "score": "0.61594176", "text": "def update\n respond_to do |format|\n if @golongan_darah.update(golongan_darah_params)\n format.html { redirect_to @golongan_darah, notice: 'Golongan darah was successfully updated.' }\n format.json { re...
[ { "docid": "e8cfdce5b0eeeba4fc38e063721573ed", "score": "0.6748714", "text": "def update\n @jogo = Jogo.find(params[:id])\n \n respond_to do |format|\n if (@jogo.update_attributes(params[:jogo]))\n \n # format.json { render :json => { :success => true, :jogo_id => @jogo.id, :p...
0cfe59fed00113827efcdb2f49cae923
Returns the name to use when this object is used as an event source
[ { "docid": "cd6ab213f07e2f10a992428f49545a7d", "score": "0.8939124", "text": "def event_source_name\n name\n end", "title": "" } ]
[ { "docid": "332372f9b530ade6e02146437e12ea44", "score": "0.7978814", "text": "def name\n \"#{self.object}::#{self.event}\"\n end", "title": "" }, { "docid": "9094077fb6ef1373f61c65af77f5b09b", "score": "0.78252304", "text": "def source_name\n source.name if source\n ...
a06e6fcf7d45bc8031ecd5f4a12306e2
GET /chronologies/1 GET /chronologies/1.xml
[ { "docid": "d670ea9902efbbad0bcdb79cd6223c04", "score": "0.65574247", "text": "def show\n @chronology = Chronology.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @chronology }\n end\n end", "title": "" } ]
[ { "docid": "8e73a476c88f4911daac2fb0d7e8bf01", "score": "0.7618378", "text": "def index\n @chronologies = Chronology.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @chronologies }\n end\n end", "title": "" }, { "docid":...
8945698103c5bbd3529edd80f6f4be56
POST /lcb_user_rewards POST /lcb_user_rewards.json
[ { "docid": "4468ab6a0ca3fb62bbf2cd31f914241a", "score": "0.66462743", "text": "def create\n @lcb_user_reward = LcbUserReward.new(lcb_user_reward_params)\n\n respond_to do |format|\n if @lcb_user_reward.save\n format.html { redirect_to @lcb_user_reward, notice: 'Lcb user reward was succ...
[ { "docid": "7f2a827fdd616e671f693d541dc5c2a6", "score": "0.7136093", "text": "def grant_reward(user)\n score = user.score # get user score\n # for each category, get the value, if not nil, calculate new value for category\n attributes_to_update = {}\n [:stamina, :strength, :mind, :vitality,...
154364994e93a1ec2a0ad03d3e30cae7
DELETE /detallefacturas/1 DELETE /detallefacturas/1.json
[ { "docid": "3edfb95695e18001ac48bc0b15b4f79b", "score": "0.7574501", "text": "def destroy\n @detallefactura = Detallefactura.find(params[:id])\n @detallefactura.destroy\n\n respond_to do |format|\n format.html { redirect_to detallefacturas_url }\n format.json { head :no_content }\n ...
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.7342679", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "...
6310d20e54f8e83a928fd7ece3528cdd
Get the address of the primary host.
[ { "docid": "3747ce86dbbaf9cca100af8bd2e0f851", "score": "0.71749705", "text": "def primary_host\n config[PRIMARY_HOST] && config[PRIMARY_HOST].downcase\n end", "title": "" } ]
[ { "docid": "55d449fed9557daab46bbae529ec3330", "score": "0.763925", "text": "def primary_host\n hostnames.first\n end", "title": "" }, { "docid": "a3ec71a7232634ff17ed64a96fd83b4f", "score": "0.75786847", "text": "def hostaddr()\n #This is a stub, used for indexing\n ...
3e14b8ed46659c05f61872377a91f4f1
Write an action using puts To debug: STDERR.puts "Debug messages..." puts "PAT" Autogenerated code below aims at helping you parse the standard input according to the problem statement.
[ { "docid": "3d2c85a91541ebf47980bd4d586e2899", "score": "0.0", "text": "def dual(cards1,cards2,stock1,stock2,round)\r\n \r\n ####\r\n STDERR.puts \"CARD1:\"+cards1.join(\",\")\r\n STDERR.puts \"CARD2:\"+cards2.join(\",\")\r\n STDERR.puts \"STOCK1:\"+stock1.join(\",\")\r\n STDERR.puts \...
[ { "docid": "3ed6379e40616603eee42320392666e1", "score": "0.6455674", "text": "def puts(*strs); $stdout.puts(*strs) if ENV['DEBUG'] end", "title": "" }, { "docid": "54cedf58c5200e1bbcc572f1bd0a0357", "score": "0.645027", "text": "def println!\n # -> uncomment the next line to man...
35485e510e741705f2954874e43ac932
heaven = Resource.new(:name => "heaven") earth = Resource.new def created(what) p what end
[ { "docid": "98c9ac3bc75ee9a19cd96ab743713295", "score": "0.0", "text": "def without(what)\n God.knows \"without #{what}\"\n what = What.is(what)\n what.reject = true\n what\nend", "title": "" } ]
[ { "docid": "3d4e0c94710e6b85807d075e46c7d0c8", "score": "0.6913419", "text": "def create; end", "title": "" }, { "docid": "3d4e0c94710e6b85807d075e46c7d0c8", "score": "0.6913419", "text": "def create; end", "title": "" }, { "docid": "3d4e0c94710e6b85807d075e46c7d0c8", ...
77cd68afc432558bfcc1543135e1c4a1
GET /books GET /books.json
[ { "docid": "ab5e00d42926740abfdd881b0a7c82f8", "score": "0.7625367", "text": "def index\n @books = Book.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end", "title": "" } ]
[ { "docid": "a613f6e6f0318023e97fa4ad7cee0b91", "score": "0.7913361", "text": "def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KEY'] \n googleurl = base_url + and_key + key\n\n response = RestClient.get(go...
faf56f1130c62236ed83eaac5a5869f4
Returns +true+ if the change log exists in the specified database. database: either :+left+ or :+right+
[ { "docid": "3f04e9b53412566a44553b1384e26857", "score": "0.7874905", "text": "def change_log_exists?(database)\n session.send(database).tables.include? \"#{options[:rep_prefix]}_pending_changes\"\n end", "title": "" } ]
[ { "docid": "9a68f52b2d9b60f03bc16a1d97533ce9", "score": "0.6581728", "text": "def has_changes?\n @has_changed_the_db\n end", "title": "" }, { "docid": "b229948479a57e6eeca389fb3d86ab3b", "score": "0.6303941", "text": "def ensure_change_logs\n [:left, :right].each do |databas...
1bfca17facf24928717251365bde5bb4
Uploads the screenshot to minio
[ { "docid": "31c05efba347e3ba8354463d4c50583c", "score": "0.58072543", "text": "def upload_file_to_minio(destination)\n filename = destination.split(\"/\").last\n content_type = \"video/MP2T\"\n folder = \"video\"\n\n if File.extname(destination) == \".jpg\"\n content_type = \"...
[ { "docid": "e920c1cbbaf2ccdda3a4c39acfa0fdc6", "score": "0.69596773", "text": "def upload_to_imgur(screenshot)\n log \"uploading #{screenshot}\"\n\n Measurer.measure do\n response = HTTP.auth(\"Client-ID #{ENV[\"IMGUR_CLIENT_ID\"]}\")\n .post(ENV[\"IMGUR_API_URL\"],...
a23eb5610a1ef9f7342a00cbece6e959
Exercise 5 Garage sale 2
[ { "docid": "5b12125c436d4a0cdf7d85e732df1bf2", "score": "0.0", "text": "def garage_sale_2\n garage_items = [\"computer\", \"couch\", \"black backpack\", \"rolling desk chair\", \"table\", \"blender\"]\n \n sorted_garage_items = garage_items.sort\n puts \"Sorted garage items: \"\n puts sorted_garage...
[ { "docid": "c7d35a9638078e670c0fcd66199acdbd", "score": "0.619031", "text": "def sale\r\nshirts = [\"Iron Man\", \"Thor\", \"Hulk\", \"Captain America\"]\r\n\r\nend", "title": "" }, { "docid": "a2c45eead8a52607e4ed13c1d01af764", "score": "0.6112587", "text": "def Grass\n \...
837575b1ee7fc5632d408e3d0a540761
We can respond to any method except :call. The call method is reserved for Procs and lambdas, and it is used internally by loquacious for lazy evaluation of configuration parameters.
[ { "docid": "e9af80dfdc0e26d5dbc5a146284599a7", "score": "0.5787182", "text": "def respond_to_missing?( id, priv = false ) id != :call; end", "title": "" } ]
[ { "docid": "1721e033b47e741968ca3e0a6af0ad54", "score": "0.6537038", "text": "def method_missing method, *args, &block\n temp = @@config_options.send method\n if temp.is_a?(Proc)\n temp.call *args\n else\n temp\n end\n end", "title": "" }, { "docid": "014...
79d5eb11af067fe005f23336c1921436
PATCH/PUT /stories/1 PATCH/PUT /stories/1.json
[ { "docid": "cbc6488e93be12b33b2dde6adba3e4ff", "score": "0.6916157", "text": "def update\n respond_to do |format|\n if @story.update(story_params)\n format.html { redirect_to @story, notice: 'Story was successfully updated.' }\n format.json { head :no_content }\n else\n ...
[ { "docid": "c6ce24cd7374834fd9b3ce79eaef08e4", "score": "0.73188186", "text": "def update\n if @story.update(update_params)\n render json: @story\n else\n render json: @story.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "aa00ffd521d6e9f1de...
6527010c08d868584e0b425b730cc0f3
PUT /post37s/1 PUT /post37s/1.xml
[ { "docid": "c33279111bb3d9f2da92cc534022a024", "score": "0.5984428", "text": "def update\n @post37 = Post37.find(params[:id])\n\n respond_to do |format|\n if @post37.update_attributes(params[:post37])\n format.html { redirect_to(@post37, :notice => 'Post37 was successfully updated.') }...
[ { "docid": "38979984bdedacd95706689e25f09f9e", "score": "0.66466135", "text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end", "title": "" }, { "docid": "23b5f5e4dacfb330cb1e0ffd4590ef63", "score": "0.6272035", "text": ...
b85927b84336ed96d744168c047e0951
DELETE /ratings/1 DELETE /ratings/1.xml
[ { "docid": "cc4e2424b3efc1c0306035b1066b8ae2", "score": "0.73386645", "text": "def destroy\n @rating = current_user.ratings.find(params[:id])\n @rating.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_ratings_path(current_user)) }\n format.xml { head :ok }\n end...
[ { "docid": "63f1849a8a566236c37607605aefb507", "score": "0.7381641", "text": "def destroy\n @rating = Rating.find(params[:id])\n @rating.destroy\n\n respond_to do |format|\n format.html { redirect_to(ratings_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { ...
fcef50be10d3f1c028517bf921693ff1
A funktion which use the attributes from the class own funktion new to create a new object
[ { "docid": "44d62ee880149b0141f381d9a84f0580", "score": "0.0", "text": "def initialize(hour24, min, sec)\n @hour24 = hour24\n @min = min\n @sec = sec\n end", "title": "" } ]
[ { "docid": "cfa08c71c616cdc11ac3715b69147db0", "score": "0.74084914", "text": "def new\n \n end", "title": "" }, { "docid": "e2b31d60b2b5b380040a867c381a1b70", "score": "0.7340711", "text": "def new\n \n end", "title": "" }, { "docid": "e2b31d60b2b5b380040a867...
d17c72ed9e870c069cd834ea8d4eba21
Allows overriding user agent with the given string.
[ { "docid": "375b58a014617a2e3e3d2425732a1238", "score": "0.7385037", "text": "def set_user_agent_override(user_agent:, accept_language: nil, platform: nil)\n {\n method: \"Emulation.setUserAgentOverride\",\n params: { userAgent: user_agent, acceptLanguage: accept_language, platf...
[ { "docid": "d1c9ad6d1ae80dc2c978b8feebda6e19", "score": "0.74363035", "text": "def user_agent(string)\n string = string.to_s\n return nil if string.empty?\n UserAgent.new(string)\n end", "title": "" }, { "docid": "4c092ef925f4569318ec3f15b0e9f79e", "score": "0.7394914", "te...
e48092e2e33ae90bf2b99ce0c82a5ad7
DELETE /zombie_sightings/1 DELETE /zombie_sightings/1.json
[ { "docid": "528b0252274e5a9718c85540823866b1", "score": "0.76768106", "text": "def destroy\n @zombie_sighting = ZombieSighting.find(params[:id])\n @zombie_sighting.destroy\n\n respond_to do |format|\n format.html { redirect_to zombie_sightings_url }\n format.json { head :ok }\n end...
[ { "docid": "70de2120d84cf4a85dc1ecb486fcd3d5", "score": "0.73776984", "text": "def destroy\n @zombie = Zombie.find(params[:id])\n @zombie.destroy\n\n respond_to do |format|\n format.html { redirect_to zombies_url }\n format.json { head :ok }\n end\n end", "title": "" }, { ...
f2d7bd6070bab802aaa802265565656d
Create a new rake namespace and use it for evaluating the given block. Returns a NameSpace object that can be used to lookup tasks defined in the namespace. It also creates a parent level task to execute all tasks defined in this namespace. Example:
[ { "docid": "cc6b5e924e188d0839e190d6d83bd59f", "score": "0.5339374", "text": "def namespace_group(name=nil, options={}, &block)\n if options.is_a?(Symbol) or options.is_a?(Array)\n options = { :arguments => options }\n end\n\n options[:arguments] ||= []\n options[:all] ||= fal...
[ { "docid": "a53f2ad230dc0d1e74edb9c4eb120421", "score": "0.64484364", "text": "def namespace(name=nil, &block)\n Rake.application.in_namespace(name, &block)\nend", "title": "" }, { "docid": "a53f2ad230dc0d1e74edb9c4eb120421", "score": "0.6448106", "text": "def namespace(name=nil, &b...
c9156181282d0bbf18d202de96f33f91
DELETE /companies/1 DELETE /companies/1.json
[ { "docid": "a71fcbca2d41e0fea5d5285b14393f4d", "score": "0.0", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to admin_companies_url }\n end\n end", "title": "" } ]
[ { "docid": "aa51d8cb38229526b42f92291cbe23c6", "score": "0.7965364", "text": "def destroy\n @company = Company.find(params[:id])\n @company.destroy\n \n render json: @company, status: :ok \n end", "title": "" }, { "docid": "5ff96663ef4eea6c4a06d9ce0fe8bad1", "score": "0.7863...
6705e9541973ccaf4b1c43ae998f4c88
Public: Delete the organization in capsule Examples organization.destroy Return the CapsuleCRM::Organization
[ { "docid": "e638ea25a9ce58a52672beff1394b6a0", "score": "0.0", "text": "def destroy\n self.id = nil if CapsuleCRM::Connection.delete(\"/api/party/#{id}\")\n self\n end", "title": "" } ]
[ { "docid": "bd126d955f8619204b35336be615c5bc", "score": "0.8409841", "text": "def destroy\n @organization.destroy\n end", "title": "" }, { "docid": "2a349fcdd6b76b9eaef8e18348a91b4b", "score": "0.8128145", "text": "def destroy\n @organization.destroy!\n end", "title":...
c54c58d1d4bb39f38425a1daeef8c930
========================================================================== Local test utilities. If any of these utilities are needed in other tescases they should be moved to TestUp's utility library.
[ { "docid": "f71b07aa7948c0d27bf646e88bb49f98", "score": "0.0", "text": "def create_test_edge_shared_by_two_faces\n entities = Sketchup.active_model.active_entities\n face = entities.add_face([0,0,0], [100,0,0], [100,100,0], [0,100,0])\n face.reverse!\n edge = face.edges.first\n face.pushp...
[ { "docid": "8d3e2f6695659386a9f5d95e1daf8385", "score": "0.68716496", "text": "def utilities\n end", "title": "" }, { "docid": "8d3e2f6695659386a9f5d95e1daf8385", "score": "0.68716496", "text": "def utilities\n end", "title": "" }, { "docid": "8d3e2f6695659386a9f5d95e1d...
af1257331023529a507abe85a9193b89
Check for ananagrams in the dictionary Return:: Array with the words that are ananagrams
[ { "docid": "5cd0129f7514b57fe49874a9a4d9037e", "score": "0.82045823", "text": "def check_for_ananagrams\n \n # Group array\n grouped_dictionary = group_array\n \n # Select the anagrams words\n ananagram = grouped_dictionary.select { |k| k.size == 1 }\n end", "title": ""...
[ { "docid": "2c536b7c34278860dae26d99b0d155c5", "score": "0.841428", "text": "def anagrams_for(dictionary)\n\t\tputs \"What word would you like to check for anagrams today?\"\n\t\tword1 = gets.chomp\n\t\tnew_array = []\n\t\tdictionary.each {|word2|\n\t\t\tif is_anagram?(word1, word2)\n\t\t\t\tnew_array <...
88f46f814159afeb6e77133965ce1d87
HOW NOT TO DO THINGS. THIS MUST BE FIXED AT ALL COSTS.
[ { "docid": "aff8d8ba53f14c853202005493097275", "score": "0.0", "text": "def professor_overall\n avg = @professor_difficulty = @professor_teaching = 0.0\n @professor_mood = @professor_exam = @professor_helpfulness = 0.0\n\n count = professor_reviews.count\n count = 1 if count.zero?\n profe...
[ { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6895491", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6895491", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",...
8e14eac9dc425e3664f88b6891d6c43b
Return the names and parent files of nonexisting files
[ { "docid": "4df90ae84451296be55036be65214892", "score": "0.73577565", "text": "def find_non_existing_files\n files = traverse([:name, :status, :parent])\n files.flatten.reject{|f| f[:status] != FileData::STATUS_NOT_FOUND}.map{|f| f.delete(:status); f}\n end", "title": "" } ]
[ { "docid": "a86a3ca12776b9a011896e0e56dd6a90", "score": "0.7073355", "text": "def files\n children(:no_dirs => true)\n end", "title": "" }, { "docid": "f2b2d38ecf824687c28e65dfffece284", "score": "0.654884", "text": "def missing_original_dirs\n @files.select { |tf| tf.file...
27fd4240f6ef0a9646c3e0a9a3d86de0
custom setter & getter setter method is called whenever an Expense is initialized with a category_name field
[ { "docid": "36d739d84d9208d80897659f97b04993", "score": "0.62073827", "text": "def category_name=(name)\n self.category = Category.find_or_create_by(name: name)\n end", "title": "" } ]
[ { "docid": "69520fa126b20b83f5c92ab37d844378", "score": "0.6854235", "text": "def set_category\n @expense_category = ExpenseCategory.find(params[:id])\n end", "title": "" }, { "docid": "e85233a6cae1803a6ae363991bc702fc", "score": "0.6789856", "text": "def set_expense_category...
788803e5ac1aef8b2ee0264b69ddf913
Return whether the nonce is valid
[ { "docid": "ed55a1adcecdaf19e5a335676b4499cb", "score": "0.6076352", "text": "def use_nonce(server_url, timestamp, salt)\n return false if (timestamp - Time.now.to_i).abs > Nonce.skew\n\n if server_url and !server_url.empty?\n proto, rest = server_url.split('://',2)\n else\...
[ { "docid": "13910ec58a79b9a4cb4344e7ed77a4b3", "score": "0.8533686", "text": "def valid_nonce?\n !request.check_nonce(response.basic).zero?\n end", "title": "" }, { "docid": "fa5f8b0b9cba16ba86d75f56d662dfbc", "score": "0.81602484", "text": "def has_nonce?\n nonce && !...
2cc87e238025ee7a7c7b83ba7426a7e1
POST /projects/:project_id/scripts/:id/submit submit the job
[ { "docid": "e465eb1af44de69295e5ddb52ac84014", "score": "0.81764597", "text": "def submit\n opts = submit_script_params[:script].to_h.symbolize_keys\n\n if (job_id = @script.submit(opts))\n redirect_to(project_path(params[:project_id]), notice: I18n.t('dashboard.jobs_scripts_submitted', job_i...
[ { "docid": "5dd26248c2bb5fe158ea67bd9e244f18", "score": "0.7202947", "text": "def submit\n unless @dry_run\n @script.log_path.dirname.mkpath unless @script.log_path.dirname.exist?\n @script.uri = start_tuplespace\n end\n\n @script.build\n\n if @dry_run\n puts @sc...
786eab57f4b92707280aa5baadd99452
_max_ is default length for creating random string
[ { "docid": "064da6f20ecd6ec49d62ff8428efe05b", "score": "0.0", "text": "def initialize(max = 10)\r\n @max = max\r\n @regch = {\r\n \"\\\\\" => method(:regch_slash),\r\n '.' => method(:regch_dot),\r\n '[' => method(:regch_bracket),\r\n '*' => method(:regch_asterisk),\r\n ...
[ { "docid": "7276cb794ec22e2623238b2640d4d44e", "score": "0.7643448", "text": "def max_length; end", "title": "" }, { "docid": "7276cb794ec22e2623238b2640d4d44e", "score": "0.7643448", "text": "def max_length; end", "title": "" }, { "docid": "7276cb794ec22e2623238b2640d4d4...
ab82740f27bc896c0aed3e37b4bb2256
PUT /promotion_boxes/1 PUT /promotion_boxes/1.xml
[ { "docid": "a1572f187422c9f32b4a77debe9bd542", "score": "0.73995715", "text": "def update\n @promotion_box = PromotionBox.find(params[:id])\n\n respond_to do |format|\n if @promotion_box.update_attributes(params[:promotion_box])\n flash[:notice] = 'PromotionBox was successfully updated...
[ { "docid": "7058488ca46cd61eefebfb4a8838077c", "score": "0.647534", "text": "def create\n @promotion_box = PromotionBox.new(params[:promotion_box])\n\n respond_to do |format|\n if @promotion_box.save\n flash[:notice] = 'PromotionBox was successfully created.'\n format.html { red...
3cb80c83c0117b03d1b3e43e47673bf1
TODO: Make this into something useful
[ { "docid": "f8d4d6794f7af95875ca300c36116480", "score": "0.0", "text": "def clump(filepath=nil)\n out = instances.to_json\n ::File.open(filepath, \"w\") {|f| f << out } if filepath\n out\n end", "title": "" } ]
[ { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.62273955", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.62273955", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3...
612fdfd697d9c8fd9028a4664a53d487
Find the Manhattan Distance between any 2 points
[ { "docid": "6fbd3d1c5f9700055338326a3c66dec4", "score": "0.86355966", "text": "def manhattan_distance(x1, y1, x2, y2)\n\t\tx_abs = (x1 - x2).abs\n\t\ty_abs = (y1 - y2).abs\n\t\tx_abs + y_abs\n\tend", "title": "" } ]
[ { "docid": "e5f31c58941dab311a44e0bb9929df1e", "score": "0.88770014", "text": "def manhattan_distance(x1, y1, x2, y2)\r\n (x1 - x2).abs + (y1 - y2).abs\r\n end", "title": "" }, { "docid": "45388fb190dcab81d9bf705b354962c1", "score": "0.8793429", "text": "def manhattan_distance(x1...
7627ae80319e73176066af7a87907164
index page for special user
[ { "docid": "d6b76a54ec9113238db218d9e0d3ef9f", "score": "0.0", "text": "def index_show\n @permissions = DocumentPermission.document(@document)\n .user(@user)\n end", "title": "" } ]
[ { "docid": "b20e7eca3a6b59f0bbd7d94a9a3e1170", "score": "0.80632186", "text": "def index\n \t@user = current_user\n \trender :index\n end", "title": "" }, { "docid": "ceec846eadbdfb4cbed70a87760c8af3", "score": "0.803912", "text": "def index\n if current_user\n redirect_to...
2dc1e1626fe19adedc51648530c78e50
case 2 existing group found as subgroup?
[ { "docid": "6834fd59025d05669c08470a19b0d171", "score": "0.0", "text": "def _setup_set_group_case2(dependencies, attrs_done, attr_name, group, objs)\n attr_subgroups = []\n level = nil\n attrs_done.each do |k, v|\n group_to_check = v.rh_get(:group, :objs)\n next if objs - [v...
[ { "docid": "bde63f5544a4de905fbf2de3a26383a3", "score": "0.673151", "text": "def group?(g)\n group == g\n end", "title": "" }, { "docid": "be46d4445120f5c0ca8f9eab36e47c59", "score": "0.64706016", "text": "def in_group?(group)\n groups.include?(group)\n end", "tit...
9930178e12211503766b420c2bbe8996
Drops (deletes) the Cloud Spanner database.
[ { "docid": "78d7aed2b4c03a81c3ff9c732e8c8c46", "score": "0.7379674", "text": "def drop\n ensure_service!\n service.drop_database instance_id, database_id\n true\n end", "title": "" } ]
[ { "docid": "97bc4f8eacc9da297324739923682aae", "score": "0.73871934", "text": "def drop_db\n Mongoid.purge!\n end", "title": "" }, { "docid": "4c8c6b5f4a1b98a56e7aaec2b83ebd71", "score": "0.726451", "text": "def delete_database\n FileUtils.rm_rf(@db_dir)\n end", ...
2b7a1bf362f2ea58d7ffc7a45cee8b2f
GET /admin/reform_surveys/1 GET /admin/reform_surveys/1.json
[ { "docid": "69397d11a6b85fb66d8bf0841d4b7640", "score": "0.0", "text": "def show\n @reform = Reform.active.with_color.friendly.find(@reform_survey.reform_id)\n\n @methodology_government = PageContent.find_by(name: 'methodology_government')\n @methodology_stakeholder = PageContent.find_by(name: ...
[ { "docid": "ad0f71c40fb53fdc180d026035224c09", "score": "0.7170622", "text": "def index\n @reform_surveys = ReformSurvey.all\n end", "title": "" }, { "docid": "cfefb4f387c9fa6fdf3f0524c0736d2c", "score": "0.70972365", "text": "def surveys\n person_id = params[:person_id]\n ...
9bf55b13b00a74f305cad7c5cf050e4a
Determines if a tar file contains jsons from the target window and if so, either copies the whole tar file, or extracts the jsons from it to copy the relevant ones to the output_dir
[ { "docid": "4d27a5a2e9efbc492ca8bd7be34b4df5", "score": "0.6607975", "text": "def consider_tarfile_contents_for_inclusion(file_path, service)\n filename = File.basename(file_path)\n return unless tarfile_from_target_window?(filename, service)\n\n # this is only here because without it the...
[ { "docid": "6d9bbc3f5ff837b8d78c0296935166e5", "score": "0.60005534", "text": "def stage_jsons_from_tarfile(file_path, jsons_to_stage, service)\n zip_reader = Zlib::GzipReader.new(File.open(file_path, \"rb\"))\n service_staging_dir = \"#{@staging_dir}/#{service}\"\n FileUtils.mkdir(servic...
f710654c0328639ed1fbd1e7a93f1c7a
% to_f : () > Float
[ { "docid": "d038b2cb13cb5369d856adc9951a932c", "score": "0.78513634", "text": "def to_f() end", "title": "" } ]
[ { "docid": "d7fe52d632795d5b14a0b46c3633bf1e", "score": "0.78433764", "text": "def to_f\n case @kind\n when :float_lit, :float_exp_lit,\n :integer_lit, :integer_exp_lit,\n :single_string_lit, :double_string_lit\n @value.to_f\n else\n self.to_i.to_f\n end\n end", ...
c63ab0e198cfe076233d9f23af830c77
GET /intakeoutputs/1 GET /intakeoutputs/1.json
[ { "docid": "e453845b5ce5a9075584606105398f99", "score": "0.6957775", "text": "def show\n render json: @intakeoutput\n end", "title": "" } ]
[ { "docid": "0b0d250409db29474a366300e7a1b8cc", "score": "0.742149", "text": "def index\n @intakeoutputs = Intakeoutput.all\n render json: @intakeoutputs\n end", "title": "" }, { "docid": "e7e69eff490e2a7d0f644265258a98e2", "score": "0.6958789", "text": "def create\n @intake...
bbca68da218e80b3c20f7f3c67aeb179
a readable list of brief versions of the provided model instances
[ { "docid": "06505772177283193ff66ad7f9e79a33", "score": "0.61018485", "text": "def list(*instances)\n return '' if instances.blank?\n instances.flatten.collect {|i| brief(i) }.join(\", \")\n end", "title": "" } ]
[ { "docid": "a7b86ab94e19e2310e3711fd0b2cefeb", "score": "0.6629968", "text": "def version_for_record(obj)\n ver = \"version: #{obj.version}\" if obj.respond_to?('version')\n date = \"updated: #{format_date(obj.updated_at)}\" if obj.respond_to?('updated_at')\n who = \"by: #{obj.updated_by}\"if...
ca2460e16253bb09ea985e2e0ec7bd94
Keeps a reference to the given socket, and remembers its event mask.
[ { "docid": "b74674d00dbdb8893d762dbc043f481d", "score": "0.7490611", "text": "def remember_socket(socket, events)\n @sockets[ptr_for_socket(socket).to_i] = socket\n @events[socket] = events\n end", "title": "" } ]
[ { "docid": "0ecd921e4a6d6bfb272a9a31786303e2", "score": "0.7485811", "text": "def remember_socket(socket, events)\n @sockets[ptr_for_socket(socket).to_i] = socket\n @events[socket] = events\n end", "title": "" }, { "docid": "9f68dd2fb6dcd6c938bc1eb92f0ef7da...
1c1dcfec3703342c695f6442db504c08
GET /abcs GET /abcs.json
[ { "docid": "7373408fe0516ffaad2f8ea595ed48a4", "score": "0.6451503", "text": "def index\n @abcs = Abc.all\n end", "title": "" } ]
[ { "docid": "b95717e1030da9aef71ba77412c312fc", "score": "0.6926084", "text": "def index\n @acs = Ac.all\n\n render json: @acs\n end", "title": "" }, { "docid": "c6e6c91f14d14b5fa19e85aff9ec57f8", "score": "0.6473203", "text": "def index\n @cap_bacs = CapBac.all\n end", ...
3d546fa25a65688d3782333375e9a7d1
An empty array accessible to all methods
[ { "docid": "dc1748c55975640c9076bc4fce38d4e7", "score": "0.0", "text": "def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n # Create an empty array\n students = []\n # get the first name\n name = STDIN.gets.chomp\n # While the name is...
[ { "docid": "5ce8381bb8c21395e1a80fdba9a3cedf", "score": "0.76771426", "text": "def create_an_empty_array\n []\nend", "title": "" }, { "docid": "5ce8381bb8c21395e1a80fdba9a3cedf", "score": "0.76771426", "text": "def create_an_empty_array\n []\nend", "title": "" }, { "doc...
f4713c9ff7935fc0633d7b51c282509b
Apply dynamic fields and properties to this instance
[ { "docid": "ddbdfdf12667c177dfc78b0f86ec6c30", "score": "0.543932", "text": "def apply_context\n return unless self._context\n\n self._context.each do |field_name, uri|\n next if fields[field_name]\n next unless RDF::Vocabulary.find_term(uri)\n\n create_accessors...
[ { "docid": "6e05e6a5abdece245ed241e01b7b1822", "score": "0.62834936", "text": "def apply\n scalar_attrs.each { |m| applicator(m) { |r| send(m, r) } }\n list_attrs.each { |m| applicator(m) { |r| send(m, *r) } }\n hash_attrs.each { |m| applicator(m) { |r| send(m).merge!(r...
597bcd79a692cae7363abfef67ce44d6
DELETE /inits/1 DELETE /inits/1.json
[ { "docid": "3249e5101647904dbd5cbb8a802ab35a", "score": "0.70961994", "text": "def destroy\n @init.destroy\n respond_to do |format|\n format.html { redirect_to inits_url, notice: 'Init was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }...
[ { "docid": "1bf2b6c78b994404ba3efbc83c10d474", "score": "0.6633859", "text": "def destroy\n @initialization = Initialization.find(params[:id])\n @initialization.destroy\n\n respond_to do |format|\n format.html { redirect_to initializations_url }\n format.json { head :no_content }\n ...
3e38d46fa31626281923a88fbfed54e6
returns a search for a character called name name String of the name to search for returns an Array of all restuls matching that name
[ { "docid": "774d7319ef676f0e2fb541484d8763de", "score": "0.66968364", "text": "def character_search(name)\n name_marvel = client.characters(:name => name)\n #puts client.characters(:limit => 10, :offset => 400, :orderBy => 'name')\n array_of_results = name_marvel[:data][:results]\n\n # if ar...
[ { "docid": "fda43e8b633f0d18bf5c8b64619d2cff", "score": "0.72232205", "text": "def find_by_name(entry)\n names = []\n self.all.each do |item|\n if item.name.downcase.include? entry\n names << item \n end\n end\n names\n end", "title": "" }, { "doci...
d980ac76127eeff4e2ef29d4508f3633
Function: registerUser Registers a user and returns user_id
[ { "docid": "be791767a76217bee1be45900505d1ff", "score": "0.7570325", "text": "def registerUser (client_id = nil)\n if(client_id.nil?)\n client_id = @client_id + \"-\" + @client_tag\n end\n \n if not @user_id.nil?\n p \"user already registered. No need to register again\"\n ret...
[ { "docid": "98a1dcb2e1b1dc2e13512658eadc3948", "score": "0.7541759", "text": "def register(user_id, request)\n start.uri('/api/user/registration')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end", "...
2074f6951e9d810bdd74937dce4e5a7e
output witness in raw binary format
[ { "docid": "16aa5888ed61ed40667164ed4daca178", "score": "0.56873363", "text": "def to_payload\n payload = \"\"\n @tx_in_wit.each{|w|payload << w.to_payload}\n payload\n end", "title": "" } ]
[ { "docid": "f465c46805c62fc50ffe035eb9409665", "score": "0.7488206", "text": "def to_witness_payload\n pin = \"\"\n @in.each{|input| pin << input.to_payload }\n pout = \"\"\n @out.each{|output| pout << output.to_payload }\n [@ver].pack(\"V\") << [0].pack(\"c\") << [1]....
b9f9e5950ae74eea805acc71ff9e0ef6
Returns a sorted array based on user preference in HTTP_ACCEPT_LANGUAGE. Browsers send this HTTP header, so don't think this is holy. Example: request.user_preferred_languages => [ 'nlNL', 'nlBE', 'nl', 'enUS', 'en' ]
[ { "docid": "cafbc6ade889045e81fc878a1badc14b", "score": "0.8178652", "text": "def user_preferred_languages\n @user_preferred_languages ||= header.gsub(/\\s+/, '').split(/,/).collect do |l|\n l += ';q=1.0' unless l =~ /;q=\\d+\\.\\d+$/\n l.split(';q=')\n end.sort do |x,y|\n ...
[ { "docid": "cac8b1eb78f3d99d9b2ea4db03cd9b9c", "score": "0.82012635", "text": "def get_sorted_langs_from_accept_header\n accept_langs = (request.env['HTTP_ACCEPT_LANGUAGE'] || \"en-us,en;q=0.5\").split(/,/) rescue nil\n return nil unless accept_langs\n\n # Extract langs and sort by weight\n ...
e7946b4e53871e477879a91243e07276
this does not encrypt, but does encode the api_key in the database to make it a little more obscure FIXME: Securing an api_key requires encryption and a second token or certificate, not this simple obscuration but the standard has not been settled in time for this release
[ { "docid": "1478a7fd1ee3f3b4ac7ba9b4414141a4", "score": "0.7497608", "text": "def encode_api_key(unencoded_api_key)\n Base64.encode64(unencoded_api_key + API_SALT)\n end", "title": "" } ]
[ { "docid": "0ec7cb9d8f761f43bff2287f6acd11ce", "score": "0.7495893", "text": "def api_key; \"055a1100-a84d-4064-84d7-bce46f7b80c8\"; end", "title": "" }, { "docid": "a03b07149a32e3049ff2407a95e1932d", "score": "0.74216986", "text": "def encode(api_key)\n Base64.strict_encode64([...
7bc639f3d7243d439500a75a118accd6
Returns the pid of policy object (is_governed_by) for the specified object Assumes that the policy object is associated by an is_governed_by relationship (which is stored as "is_governed_by_ssim" in object's solr document) Returns nil if no policy associated with the object
[ { "docid": "5d75bf8e8a7e77697f1c7fa4d538eabd", "score": "0.67222536", "text": "def policy_pid_for(object_pid)\n policy_pid = policy_pid_cache[object_pid]\n return policy_pid if policy_pid\n solr_result = ActiveFedora::Base.find_with_conditions({id: object_pid}, fl: governed_by_solr_field)\n ...
[ { "docid": "cc501ac94636fcdf712840740171c459", "score": "0.7818539", "text": "def policy_pid_for(object_pid)\n policy_pid = policy_pid_cache[object_pid]\n return policy_pid if policy_pid\n solr_result = ActiveFedora::Base.find_with_conditions({:id=>object_pid}, :fl=>ActiveFedora::SolrService.so...