query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
d2e8b43e0afaaf0478416fbbb16c9399
overriding this so the `type` in the json response is the same as the record's class name
[ { "docid": "6ff0a3ab082a54262f23dcbd89fdce01", "score": "0.0", "text": "def class\n __getobj__.class\n end", "title": "" } ]
[ { "docid": "c9abb10c3481ace5940bb500a6083eac", "score": "0.6899266", "text": "def type\n record.class.name or super\n end", "title": "" }, { "docid": "fbc785e1e4b6b05ce881e31fd71abfed", "score": "0.68092823", "text": "def type\n @json['type']\n end", "title": "" ...
bfbcddcc918ef40f76e5014276919dbc
Preview this email at
[ { "docid": "0b98135d06cf3fd6a2dc5e8f0bccce5c", "score": "0.0", "text": "def forget_password\n SendEmail.forget_password\n end", "title": "" } ]
[ { "docid": "f4f01bf0c4f6341760a71d13d7b6cc72", "score": "0.7310511", "text": "def preview_email\n email = UserMailer.emailing(@emailing)\n mail_inliner = Roadie::Rails::MailInliner.new(email, Rails.application.config.roadie)\n mail = mail_inliner.execute\n\n mail.html_part.decoded.gsub /http...
c5cfa878d2c536b43d601542f3a3d17b
Use a before_save callback in the Url model to generate the short URL.
[ { "docid": "3ff7ef29558f80d439047d15be07a76c", "score": "0.65172863", "text": "def check_short_url #to generate &to check if short_url generated so ngam duplicated jor in table, rare!\n if short_url.nil? #first time, short_url is nil, so this will run\n self.short_url = random_key #generate ...
[ { "docid": "695d4b4efb09225255686e39f3142dd0", "score": "0.7546817", "text": "def create_short_url\n urlstring = SecureRandom.urlsafe_base64(4.5)\n old_url = Link.where(short_url: urlstring).last\n if old_url.present?\n self.create_short_url\n else\n self.short_url = urlstring\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ca8a67de3fcc79b02bd0f283b094d0cb", "score": "0.0", "text": "def set_incidentmanagement\n @incidentmanagement = Incidentmanagement.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;...
0737f4e569818a572abd267a50e72cd7
This renders the tag without sanitizing the ERB for our purposes. Only applies to our tags.
[ { "docid": "d4c0df09ec9e61a711424ad523d1f010", "score": "0.0", "text": "def render\n content\n end", "title": "" } ]
[ { "docid": "8656f230d55e2e2518f4baf4504f5615", "score": "0.7300517", "text": "def render\n # cleaning content from possible irb stuff. Partial and Helper tags are OK.\n if ComfortableMexicanSofa.config.disable_irb && ![CmsTag::Partial, CmsTag::Helper].member?(self.class)\n content.to_s....
536871e4041f867e8c259979b8f5fd03
Validates all profiles in the given directory
[ { "docid": "e80c8a4392a6304e5955da2686396d6e", "score": "0.7267987", "text": "def validate_correct_profiles\n profiles_dir = File.join(PROFILES_DIR, @test_dir, CORRECT_PROFILES_DIR)\n runner = self\n\n RSpec.context \"When checking correct profiles stored in #{profiles_dir},\" do\n Dir.glo...
[ { "docid": "a5f43ff4070de7352280fe78ec75835d", "score": "0.6728581", "text": "def validate\n if (self.directory == \"\")\n puts \"Directory required.\"\n exit 0\n end\n\n if (!Dir.exist?(self.directory))\n puts \"Missing directory #{self.directory}\"\n exit 0\n end\n\n ...
15c7f1b36444dddf802b8fa58c731451
When the object is initialized, copy the properties from the cocina model to the form:
[ { "docid": "e73d36f18dfe5e490c59bf3bfaae3ee3", "score": "0.0", "text": "def setup_properties!(_options)\n embargo = model.access.embargo\n return unless embargo\n\n self.release_date = embargo.releaseDate.to_date.to_fs(:default)\n setup_view_access_properties(embargo)\n end", "title": "...
[ { "docid": "c38225f703eec616c36d35bc80eecea5", "score": "0.64332527", "text": "def initialize(form_object)\n @form_object = form_object\n end", "title": "" }, { "docid": "c38225f703eec616c36d35bc80eecea5", "score": "0.64332527", "text": "def initialize(form_object)\n @form_obj...
1851f8f9f92b85e5c183f1753e8e5df6
Converts an inmemory html document. content a string containing an html document outstream an object having method 'write(data)'; if nil then the return value is a string containing the PDF.
[ { "docid": "12fcb109589a4b712906e0ce74648330", "score": "0.7405853", "text": "def convertHtml(content, outstream=nil)\n return call_api_urlencoded('/api/pdf/convert/html/', content, outstream)\n end", "title": "" } ]
[ { "docid": "d125e5a91c113e47e2f75fb89a7022a7", "score": "0.61395174", "text": "def convert_to_document() \n Nokogiri::HTML.parse(convert())\n end", "title": "" }, { "docid": "096092124a424c19a4b8a154bc092e59", "score": "0.6136054", "text": "def write_xhtml_to(io, options = T....
3297c7623d46f230503afae6f36a3366
PUT /post_foods/1 PUT /post_foods/1.xml
[ { "docid": "011201b9e97a09532e799b637e367a04", "score": "0.0", "text": "def update\n @post_food = PostFood.find(params[:id])\n @post = @post_food.post\n \n if (@post_food.update_attributes(params[:post_food]) && @post_food.post.update_attributes(params[:post]))\n sc = School.find(@post....
[ { "docid": "38979984bdedacd95706689e25f09f9e", "score": "0.6362576", "text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end", "title": "" }, { "docid": "23b5f5e4dacfb330cb1e0ffd4590ef63", "score": "0.62999535", "text": ...
5c1813c77c1cbb18f307f291ed6cee9e
long_planeteer_calls(calls_long) Test Code TEST CODE cheddar_cheese = ["banana", "cheddar", "sock"] no_cheese = ["ham", "cellphone", "computer"] cheese_types = ["cheddar", "gouda", "camembert"] ________________________________________________________
[ { "docid": "eefaa2c52e0d08693a4838e0cc0950f3", "score": "0.0", "text": "def find_the_cheese(cheddar_cheese)\n \n cheese_detected = cheddar_cheese.detect do |array_objects| \n [\"cheddar\", \"gouda\", \"camembert\"].include?(array_objects)\n end \n cheese_detected\nend", "title": "" } ]
[ { "docid": "e77735e4a0843fe5828f2718bd20a2b6", "score": "0.6718497", "text": "def long_planeteer_calls(short_words)\n short_words = [\"puff\", \"go\", \"two\"]\n assorted_words = [\"two\", \"go\", \"industrious\", \"bop\"]\nend", "title": "" }, { "docid": "da3b946dee5079e4bfa55091905d253f"...
be5df2cfd7fae1ba3d9274dee2e00310
dsl for configuring each template
[ { "docid": "a9ed009054f16611fe5114e7d9bdc905", "score": "0.6745217", "text": "def config (&block)\n template = new\n template.instance_eval &block\n validate_and_add template\n end", "title": "" } ]
[ { "docid": "015d0f413f610b48485a2e79abde118a", "score": "0.7446412", "text": "def template_setup; end", "title": "" }, { "docid": "d8a4bfc67996c6c8d43eadfaff13d782", "score": "0.7394781", "text": "def template_setup\n end", "title": "" }, { "docid": "b38268d0c7e26c00ffea...
fd3a540e8b7f50300dd7a79bf80853a5
Unregister a GUI that was notified upon events Parameters:: iGUI (_Object_): The GUI to be notified.
[ { "docid": "c568a6c47ea3f9c205a8d7928089ce2f", "score": "0.852279", "text": "def unregisterGUI(iGUI)\n lFound = false\n @RegisteredGUIs.delete_if do |iExistingGUI|\n lFound = true\n next (iExistingGUI == iGUI)\n end\n if (!lFound)\n log_bug \"Gui #{iGUI} should h...
[ { "docid": "ffeafd2b8032e2d8ad75a99b44414c1f", "score": "0.65374297", "text": "def unregister( io )\n\t\t@pending_events.delete( io )\n\t\t@handles.delete( io )\n\tend", "title": "" }, { "docid": "ffeafd2b8032e2d8ad75a99b44414c1f", "score": "0.65374297", "text": "def unregister( io )...
c23ba7df968c80949ee973a3964e78ca
Creates a sale transaction for this credit card.
[ { "docid": "27a6a1ce677fd0ee46b5b8a7eed20aaa", "score": "0.77310145", "text": "def sale(transaction_attributes)\n CreditCard.sale(self.token, transaction_attributes)\n end", "title": "" } ]
[ { "docid": "d747e4deed25350f91fd28dcdc173e04", "score": "0.7733083", "text": "def create_sale(sale)\n Cielo::API30::Request::CreateSaleRequest.new(merchant, environment).execute(sale)\n end", "title": "" }, { "docid": "d747e4deed25350f91fd28dcdc173e04", "score": "0.7733083", ...
9a08e7b4adc1a90a6e4455a07ab2e599
save the state of the object (dump state) Should return a PlainOld Ruby Object (likely Array or Hash as the outer container) (basically, something that could be trivially saved as YAML)
[ { "docid": "cab3d339488467569328c007927bad09", "score": "0.0", "text": "def serialize(save_directory)\n\t\t# [\n\t\t# \t# @live_wrapper,\n\t\t# \t@input_test,\n\t\t# ].each do |dynamic_obj|\n\t\t# \tdynamic_obj.serialize save_directory\n\t\t# end\n\tend", "title": "" } ]
[ { "docid": "88cfcec185bad7a5b151c23140a96b48", "score": "0.68992174", "text": "def serialize(object); object; end", "title": "" }, { "docid": "e12ab37cbe4878a1d301aba0d973ea1c", "score": "0.68927836", "text": "def to_yaml_object\n # not implemented because I don't use it\n ...
7e139db1877698da93345d5e2942edeb
before_action :authenticate_user! before_action :check_cart!
[ { "docid": "0037244db3aafdd6bb9ca7eb3c42aa63", "score": "0.0", "text": "def new\n @client_token = generate_client_token\n end", "title": "" } ]
[ { "docid": "651ea6daf15cff439350649bcf7a6673", "score": "0.73431176", "text": "def verify_cart\n if !@cart || (@cart && @cart.empty?)\n redirect_to advocate_account_products_path\n return false\n end\n true\n end", "title": "" }, { "docid": "aadc6fe284d254c7692088308b9a9f...
b6bced7afbf9c85993bd4f942a1c375b
STATUS RELATED METHODS Status 0 nothing, 1 Waiting, 2 Approved, 3 Refused Method that permits for the administrator to change the status of the snippet
[ { "docid": "7dcbc83a9ab1784868bab0b5c45644e3", "score": "0.0", "text": "def admin_status_update(status)\n status = status.to_i\n if status == 2\n self.update_column(:status, 2)\n return \"Accepted\"\n elsif status == 3\n self.update_column(:status, 3)\n return \"Refused\"\n ...
[ { "docid": "410ec594a0e756db23335aa7a801204d", "score": "0.6945831", "text": "def status(*) end", "title": "" }, { "docid": "410ec594a0e756db23335aa7a801204d", "score": "0.6945831", "text": "def status(*) end", "title": "" }, { "docid": "282100fcf1722fcf5894752facfdc099",...
813714919ef2f78de1030a489b636ca1
Prefetch some metadata properties for a given list of nodes. Useful for performance reasons when clients know they will need to use a lot of properties on nodes. Keep a threadsafe memory cache of it. Parameters:: nodes (Array): Nodes to read metadata for properties (Symbol or Array): Metadata properties (or single one)...
[ { "docid": "06523e7ca27e89426fdae8eb418aeaa9", "score": "0.707959", "text": "def prefetch_metadata_of(nodes, properties)\n (properties.is_a?(Symbol) ? [properties] : properties).each do |property|\n # Gather the list of nodes missing this property\n missing_nodes = nodes.select { |nod...
[ { "docid": "fb0a3e0e330638a85e053d99b6cffaeb", "score": "0.5697628", "text": "def metadata_of(node, property = nil)\n if property.nil?\n @metadata[node] || {}\n else\n prefetch_metadata_of([node], property) unless @metadata.key?(node) && @metadata[node].key?(property)\n @m...
5dd0da39fd0ef1ee9ab898796daa8514
Returns the width of the cell in its first column alone, ignoring any colspans.
[ { "docid": "2fdc7d90497285043380a8dd86d14511", "score": "0.0", "text": "def width_ignoring_span\n # We can't ||= here because the FP error accumulates on the round-trip\n # from #content_width.\n defined?(@width) && @width || (content_width + padding_left + padding_right)\n end...
[ { "docid": "33c1619c3ea92a9576e4780f697222e8", "score": "0.756654", "text": "def width\n padding = (colspan - 1) * @table.cell_spacing\n inner_width = (1..@colspan).to_a.inject(0) do |w, counter|\n w + @table.column_width(@index + counter - 1)\n end\n inner_width + p...
8c1e26e66a09c952cef0ed391fa82a28
Determines the average of a set of numerical values
[ { "docid": "8f3a4798ed0e36970211fec4c40c2b33", "score": "0.0", "text": "def process_result(value, reply)\n @result[:value] += value\n @count += 1\n end", "title": "" } ]
[ { "docid": "825dd876c18b242fa474f1d1927d2f73", "score": "0.7904754", "text": "def AVG(*values)\n values.flatten!\n values.compact!\n SUM(values) / COUNT(values)\n end", "title": "" }, { "docid": "825dd876c18b242fa474f1d1927d2f73", "score": "0.7904754", "text...
787b2bffc371166dee9b58d3f0bf450d
Write a method, most_frequent_bigram, that takes in a string and returns the two adjacent letters that appear the most in the string.
[ { "docid": "15c9cc9461f03930fdbee2caaaa9682c", "score": "0.8843646", "text": "def most_frequent_bigram(str)\n freq_counts = Hash.new(0)\n (0...str.length - 1).each do |i|\n bigram = str[i, 2]\n freq_counts[bigram] += 1\n end\n freq_counts.max_by {|k, v| v}.first\nend", "title": "" } ]
[ { "docid": "ca50c37a6f1da5bc55445aa0c339ac63", "score": "0.8957281", "text": "def most_frequent_bigram(str)\n counter = Hash.new\n bigrams = str.substrings(2)\n bigrams.max_by {|ele| bigrams.count(ele)}\nend", "title": "" }, { "docid": "dec23deac300bbff0a8e5c469292f540", "score"...
8dbf6fd11e02fb868d45bac1cde9f540
Given a SQL fragment that identifies the IDs of version records, returns a `Hash` mapping those IDs to `Version`s.
[ { "docid": "67f98b8d696cd67c6d45c33626059fa8", "score": "0.5646841", "text": "def versions_by_id(klass, version_ids)\n klass.\n paper_trail.version_class.\n where(id: version_ids).\n inject({}) { |a, e| a.merge!(e.item_id => e) }\n end", "title": "" ...
[ { "docid": "3f7804fcbd58009d09ee20e51f541ca4", "score": "0.6117137", "text": "def to_hash_with_versions schema = {}\n schema = parse_schema schema\n\n HASH_TEMPLATE.clone.tap { |ret|\n @result.getMap.each do |cf, cqmap|\n cqmap.each do |cq, tsmap|\n name = ColumnKey.new(cf, cq...
a9b4f02449cdd1304d378a0fc96f7a1d
Symbol all keys in a hash, as well as keys from embedded hashes.
[ { "docid": "4847c317d6a16eadeea67e5dac1a10f4", "score": "0.0", "text": "def recursive_symbolize(obj)\n obj.reduce({}) do |memo, (k, v)|\n if v.is_a? Hash\n memo[k.to_sym] = recursive_symbolize(v)\n else\n memo[k.to_sym] = openssl_opt_from_string(v)\n end\n memo\n ...
[ { "docid": "f491d8a8bfe37813a099416c32fde025", "score": "0.78621775", "text": "def symbolize_hash_keys(hash); end", "title": "" }, { "docid": "f8d4c6a1a9ba68db200f153aaed26eb7", "score": "0.74004304", "text": "def symbolize_keys!(hash)\n new_hash = hash.inject({}){ |memo, (k...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "bcb45841781aa2b43117feb485937f2d", "score": "0.0", "text": "def sheet_b_params\n params.fetch(:sheet_b, {})\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6980957", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6783065", "text": "def strong_params\n params.requi...
031e7738ed5ad0423be15878b8ff8966
GET /folders GET /folders.json
[ { "docid": "0ccaf1a93c5c080e964edf3bf662d91b", "score": "0.71402705", "text": "def index\n @folders = Folder.all\n end", "title": "" } ]
[ { "docid": "f263d39653207d6fa2f7ff46c6405e71", "score": "0.80284256", "text": "def list_folders\n http_get(uri: '/folders', fields: x_cookie)\n end", "title": "" }, { "docid": "7dc5753bd91cb5c69bc6be408fad2dc6", "score": "0.7778555", "text": "def account_folders\n make_r...
c8cbd7985572cffa3a75429fe3804c1a
return the full path to us, for logging and rollback; not currently used
[ { "docid": "1ef5bb802a3b6d713ee8b2f8c4a70c22", "score": "0.0", "text": "def pathbuilder\n if @resource\n return [@resource.pathbuilder, self.name]\n else\n return [self.name]\n end\n end", "title": "" } ]
[ { "docid": "d2ea627fa2bc6506531b74637e8d8004", "score": "0.7242321", "text": "def path_base\n Dir.pwd\n end", "title": "" }, { "docid": "9f282de7602e8fe236964002203ec589", "score": "0.71744096", "text": "def path\n if is_root?\n name\n else\n [parent.path,...
54ad9939191915e23c4b071abdea900b
alias for ActiveStorage attach
[ { "docid": "65c714ebd272ddd47775d24d0c7af80a", "score": "0.0", "text": "def add_thumbnail(io: nil, filename: nil)\n return if io.nil? || filename.nil?\n\n thumbnails.attach(io: io, filename: filename)\n end", "title": "" } ]
[ { "docid": "faa3e913dd6e1bdef6f453a0b1f08994", "score": "0.6412242", "text": "def attach_storage(server_uuid, storage_uuid:, type: \"disk\", address: nil)\n data = {\n \"storage_device\" => {\n \"type\" => type,\n \"storage\" => storage_uuid\n }\n }\n data[\"storage_devi...
dfa6492176488027fbeecc418e1013e5
Find the min needed FEs by finding the best district for FM and dividing the rest between FES
[ { "docid": "3ad28bfc1bf6989ba400faf722c1e622", "score": "0.83924663", "text": "def min_fes\n fm_district = lowest_fm_waste_index\n # Itterate over districts except FM's optimal\n left_over_districts = @district_scooter_count.each_with_index.reject {|_, index| index == fm_district[1]}.map { |v| ...
[ { "docid": "d00467a6938538a6698e2367d51b4717", "score": "0.75216585", "text": "def min_district_fe(required_capacity, fm_capacity)\n # How many scooters left after FM is done?\n fm_oversubscription = required_capacity - fm_capacity\n\n # (Whole) FEs needed to complete the work\n (fm_oversubs...
427f55031abd6db948c0eb89e2330227
Create a method that returns the Planet's attributes in an easy to read fashion
[ { "docid": "1bd2c3a44bd296deafed0fcb2f64d501", "score": "0.6898504", "text": "def attributes\n return \"\\nPlanet: #{@planet}, Color: #{@color}, Inhabitants: #{@inhabitants}, Distance from the sun: #{@distance_from_sun} million miles, Length in a year: #{@year_length} days, Moons: #{@moons}.\"\n end...
[ { "docid": "029ad6321e7cd460e396d43cf04fe44c", "score": "0.7670876", "text": "def get_planet_details(planet_name) #Use method to return attributes of a specific planet based on planet_name\n @planets.each do |planet|\n if planet.name == planet_name\n return planet.get_attributes\n en...
3d8c44fefe8af8057c6847f80beeb73c
Informs your asset tracker about any changes in the pool's state or members. Plugins should override this, or use before_sync_configuration / after_sync_configuration callbacks, to provide an implementation of this method.
[ { "docid": "92bf7d064152c807d031c705f6d0d9d0", "score": "0.51791734", "text": "def sync_configuration\n end", "title": "" } ]
[ { "docid": "9217ae6641a3de614b4fd3694400f5a4", "score": "0.6334928", "text": "def update_pool_info\n\t\t# make sure the pool is active and refresh its stats\n\t\tinit\n\t\t@pool.refresh\n\n\t\t# save stats to pool object\n\t\tdivide_to_gigabytes = (1024 * 1024 * 1024).to_f\n\t\tself.allocation = (@pool....
60df017c884ff186df44e665828bb0b2
Set searchd host name (string) and port (integer).
[ { "docid": "446cff7c9271286cc6e5aa1f573a4532", "score": "0.66592705", "text": "def SetServer(host, port)\n assert { host.instance_of? String }\n assert { port.instance_of? Fixnum }\n\n @host = host\n @port = port\n end", "title": "" } ]
[ { "docid": "46bc943e89873e777cda325729c7aaf9", "score": "0.73043376", "text": "def set_host(v)\n @host = v\n end", "title": "" }, { "docid": "b5366e265173955fedec04b8097fda35", "score": "0.72905", "text": "def set_host(v)\n v = \"\" if v.nil? || v == \"localhost\"\n ...
ea956f05be908b02f41e4f91f0f4dbd9
Returns the value of attribute decorator_class. source://draper//lib/draper/factory.rb36
[ { "docid": "c4c0aebd2691d66fd9ad0712fd917722", "score": "0.71925026", "text": "def decorator_class; end", "title": "" } ]
[ { "docid": "ea2de5a89d3276d64ff2270ce65a0527", "score": "0.68424183", "text": "def decorator_class\n return Frenchy::ArrayDecorator if none?\n\n \"#{first.class.name}Decorator\".constantize\n end", "title": "" }, { "docid": "121147a2e87dfaf6832ed1ea95e9b9fa", "score": "0.675...
e2fb6888e269699e2541efe6d5afd058
Test that the correct validations are enforced on Bitmap record creation.
[ { "docid": "c9b2cb3713858920313fb6f80317b03c", "score": "0.8228633", "text": "def testValidations\n numBitmaps = Bitmap.all.count\n Bitmap.create()\n assert_equal(numBitmaps, Bitmap.all.count, \"A Bitmap record without a canvas_id was incorrectly stored\")\n end", "title": "" } ]
[ { "docid": "382e5d3909c5d0d864c66e29bb2831dc", "score": "0.7259933", "text": "def validate!(bitmap, _params)\n # bitmap should be initialized\n validate_bitmap!(bitmap)\n end", "title": "" }, { "docid": "8c61ed7eadc25911df0edd8f7023e8bf", "score": "0.7120428", "tex...
328b1ecb327ac9341de61f3d4edc8a82
Constructor for the generator. Arguments: tasks A 'PACTaskCollection' of populated tasks commits A 'PACCommitCollection' list of commits. used to tally those that were referenced and those that were not
[ { "docid": "87ad7a00e913c0f728643ed2febc3025", "score": "0.8038951", "text": "def initialize(tasks = Model::PACTaskCollection.new, commits = Model::PACCommitCollection.new)\n\t\t\t@tasks = tasks\n\t\t\t@commits = commits\n\t\tend", "title": "" } ]
[ { "docid": "6d6790cc8b83e777a295dbef43e32068", "score": "0.6640956", "text": "def task_id_list(commits)\n regex_arr = []\n\n tasks = Model::PACTaskCollection.new\n\n commits.each do |c_pac|\n\n referenced = false\n #Regex ~ Eacb regex in the task system\n settings[:task_systems]....
a314a53465553ecc0d6285b35f9382c7
Ensure that only a user, at least a volunteer, who is enrolled for a particular initiative can access it
[ { "docid": "1e8655d95b2287a2320e935805e3f5f4", "score": "0.67330426", "text": "def correct_initiative_only\n unless current_user.admin?\n if current_user.service_user? || current_user.initiatives.exclude?(Initiative.find(params[:initiative_id]))\n flash[:danger] = 'You are not allowed to ...
[ { "docid": "d0adf3c03fd27bc26ab2e4c9fa5d5fcd", "score": "0.6771137", "text": "def volunteered_for?(user)\n return !self.volunteers.find_by_user_id(user.id).nil?\n end", "title": "" }, { "docid": "aac3ba3d21bd14f13c14438a3a6b73fe", "score": "0.6671856", "text": "def correct_initia...
fb51b5355265091d3fdce0cfed3924b4
rubocop:disable Metrics/LineLength We don't split error messages over multiple lines. This is to preserve greppability.
[ { "docid": "c5b9271c4e560b921ea11f3fa0149acb", "score": "0.0", "text": "def missing_required_field_death(fieldnames)\n errors = []\n fieldnames.each do |fieldname|\n error = { 'title' => 'Required field missing', 'detail' => \"The given parameters were missing the required `#{fieldname}` fiel...
[ { "docid": "75d3034b45d6063569422e90373b95bb", "score": "0.68470854", "text": "def failure_slash_error_lines\n lines = read_failed_lines\n\n failure_slash_error = ConsoleCodes.wrap(\"Failure/Error: \", :bold)\n\n if lines.count == 1\n lines[0] = failure_slas...
fb8350354522ea8eeca95b711a9abc1b
DELETE the document from CouchDB that has the given _id and _rev. If bulk is true (false by default) the deletion is recorded for bulksaving (bulkdeletion :) later. Bulk saving happens automatically when bulk_save_cache limit is exceded, or on the next non bulk save.
[ { "docid": "6631d3a245ab5ce14079f33116520554", "score": "0.8063399", "text": "def delete_doc(doc, bulk = false)\n raise ArgumentError, \"_id and _rev required for deleting\" unless doc['_id'] && doc['_rev']\n if bulk\n @bulk_save_cache << { '_id' => doc['_id'], '_rev' => doc['_rev'], :_...
[ { "docid": "8da7f24ffb2ef6d65f4c3ff85d639cc7", "score": "0.7131307", "text": "def destroy(bulk = false)\n raise ArgumentError, \"doc.database required to destroy\" unless database\n result = database.delete_doc(self, bulk)\n if result['ok']\n self['_rev'] = nil\n s...
10fe9abebf9e9832c4fd1350f5df7ea9
Real weight from fedex tracking info in KG
[ { "docid": "89ec94cf0ae59d1081027f305502eab1", "score": "0.7150432", "text": "def real_weight(tracking_number)\n begin\n tracking_info = fedex.track(tracking_number: tracking_number)\n package_weight = tracking_info.first.details[:package_weight]\n package_weight[:units] == 'LB...
[ { "docid": "12d95524c5210648a6ccc0124a827cba", "score": "0.66552204", "text": "def weight\n return data.weight\n end", "title": "" }, { "docid": "ce18c96947e90198f539bb857adf598a", "score": "0.6425935", "text": "def weight()\n\t\t@pokemon_api[\"weight\"]\n\tend", "title":...
28e22fcc4cfc742d68920dff5b61f02c
Create a new pending game conn: user connection info:
[ { "docid": "6967c7996890f790b1f6aa5bf633385b", "score": "0.72490335", "text": "def pending_game_create2(conn, info)\n num_clients = @logged_in_list.size\n @pg_list.pending_game_create2(conn, info, num_clients, conn.user_name, conn.user_id, -1)\n end", "title": "" } ]
[ { "docid": "fb85b0587ac3111423a122b532b11dfd", "score": "0.67524046", "text": "def create_game(user_name, player_count, game_type)\n server = get_open_server\n @open_game_list.push({:id => gen_game_id, :user1 => user_name, :game_type => game_type, :server => server})\n server.proxy.create_game(...
1939d8064b659cce81aa250272cd70d7
DELETE /credit_checkers/1 DELETE /credit_checkers/1.json
[ { "docid": "a0aac022de82173da823c01251dadf04", "score": "0.7492212", "text": "def destroy\n @credit_checker.destroy\n respond_to do |format|\n format.html { redirect_to credit_checkers_url, notice: 'Credit checker was successfully destroyed.' }\n format.json { head :no_content }\n end...
[ { "docid": "d0a4542c60b3b2ef7b572927cc966169", "score": "0.7128045", "text": "def destroy\n @credit = Credit.find(params[:id])\n @credit.destroy\n \n respond_to do |format|\n format.html { redirect_to credits_url }\n format.json { head :ok }\n end\nend", "title": "" }, { "docid": ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "4bb0c7bfd9eb120c86bf66e099b79336", "score": "0.0", "text": "def set_service\n @service = Service.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163443", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.604317", "text": "def action_hook; ...
ce4a6957c31ce303d8b1b1b5427b00af
Indicate whether name is a sort key and/or is part of the Solr sort.
[ { "docid": "4c4ee864ffce8074c848578dd77b93f4", "score": "0.7329532", "text": "def sort_field?(name)\n name = name.to_s\n sort_fields.any? { |k, v| (k.to_s == name) || v.sort.include?(name) }\n end", "title": "" } ]
[ { "docid": "fac9b18bbbe116a9ce9a95b519962aa5", "score": "0.66991055", "text": "def is_sorted?(request)\n @is_sorted ||= if sortable? and sorting = request.query_parameters[\"sort\"] and sorting[sort_name]\n sorting[sort_name].to_s.match(/desc/i) ? 'desc' : 'asc'\n else\n ...
3675c81830ed65e835c6d56d1908dd8b
Set Expression that should evaluate to the parameter's type
[ { "docid": "ea5c20ce9e6112578b9ad258447430f8", "score": "0.6746232", "text": "def type_expr(o)\n @init_hash['type_expr'] = o\n end", "title": "" } ]
[ { "docid": "243893b1c7984adadae250cd88893bab", "score": "0.6422001", "text": "def type_expr; end", "title": "" }, { "docid": "22942728acd6a328ae9aea58dbd33859", "score": "0.6123233", "text": "def type_expr(new_payload_type = T.unsafe(nil)); end", "title": "" }, { "docid":...
b404ecaa25b5c4d7ad5c98e1c67158d7
Pourcentage de canons (par rapport au nombre de mots total)
[ { "docid": "987c1a24d29f88ce3b7a5943c1a7e8a1", "score": "0.76457083", "text": "def pourcentage\n @pourcentage ||= (nombre.to_f / analyse.all_mots.count).pourcentage\n end", "title": "" } ]
[ { "docid": "877407ead8f790780504addfe9794514", "score": "0.7094747", "text": "def compute_fullcnpswage\n ( full_caissebase + full_process_bonuses ).ceil\n end", "title": "" }, { "docid": "d329bceca123c744b7f5b70df6895e60", "score": "0.70328695", "text": "def calcula_pago_total\n ...
64ee68d975abe91526e1932dcec8633d
Set the +value+ for an +attr+ in this attrnode.
[ { "docid": "f60c369ef9b9f9e2ba24b4f844f05a72", "score": "0.71635395", "text": "def []=(attr, value)\n @attrs[attr] = value\n end", "title": "" } ]
[ { "docid": "212093cd9f3070b2f6f22c189bc5fc92", "score": "0.6980019", "text": "def []= (attr_name, value) \n write_attribute(attr_name, value)\n end", "title": "" }, { "docid": "3faa8cdd54b2afd0c7915fc70e124fcf", "score": "0.69622284", "text": "def []=(attr_name, value)\n ...
53ef69f9acd22025611781dc51570515
Remove working directory if it exists
[ { "docid": "4c611bed6439fbd0a2df578f16223c7b", "score": "0.6390815", "text": "def clean_working_directory(payload)\n begin\n unless(payload[:message_id].to_s.empty?)\n dir_path = File.join(\n config.fetch(\n :working_directory,\n File.join('/tmp/...
[ { "docid": "5d5fabbe4aa11752cfdbb5e6aeca8160", "score": "0.8062782", "text": "def clear_working_dir\n log\n FileUtils.rmtree(WORKING) if File.exist?(WORKING)\n end", "title": "" }, { "docid": "76119cecdae89c64e5f64093032b0f23", "score": "0.802416", "text": "def clean_working_d...
d4739a33f386d6d12bd850ee467cafb7
before_filter :deny_operation, :except=>[:index, :rebate]
[ { "docid": "1da84d68803ab5fb5d19718a0815508e", "score": "0.0", "text": "def index \n #@reservations = current_user.crm_redemption_reservations\n mbr_id = current_user.mbr_id \n @reservations = CrmRedemptionReservation.find_through_id_status(mbr_id, 0)\n @product_reservations = CrmProduc...
[ { "docid": "53aac613426d293fc51d26d20d1fae79", "score": "0.76721126", "text": "def index\n prevent_non_admin\n end", "title": "" }, { "docid": "0217b138f2cc0a59404d8ee923523070", "score": "0.71693105", "text": "def ignore_request_unless_permitted\n return if permitted?\n fl...
9dc1a0455d557cf58f818c8e0caadcb2
Create a timeframe rule
[ { "docid": "45a9f5917e2c3a990dc88136ac523e9f", "score": "0.54699653", "text": "def create_timeframe_rule_with_http_info(campaign_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TimeframeRulesApi.create_timeframe_rule ...'\n end\n # v...
[ { "docid": "45d050f945e3776678ad5af7c83d1910", "score": "0.6129269", "text": "def apply_rule(rule, from_offset, to_offset, year); end", "title": "" }, { "docid": "45d050f945e3776678ad5af7c83d1910", "score": "0.6129269", "text": "def apply_rule(rule, from_offset, to_offset, year); end...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "707549ee4fed24391f466b25da458255", "score": "0.0", "text": "def prince_params\n params.require(:prince).permit(:valueNormal, :valueAbove, :datePrince)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496024", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69581187", "text": "def strong_params\n params.require(:request).permit(param_whit...
9fe1167623ceb0f89cff08ef015adba1
capture cookie len Capture and log a cookie in the request and in the response. May be used in sections : defaults | frontend | listen | backend no | yes | yes | no Arguments : is the beginning of the name of the cookie to capture. In order to match the exact name, simply suffix the name with an equal sign ('='). The f...
[ { "docid": "b96810bd451fea90f287029501efee03", "score": "0.6477185", "text": "def capture_cookie(params = nil)\n if @name_index\n @conf.insert(@name_index + @conf.length, \" \" + \"capture cookie \" + params.to_s + \"\\n\")\n else\n puts \"no #{@proxy_type} name assigned\"\n ...
[ { "docid": "c87093bc84e91740ce7d7d74a4d15793", "score": "0.56386775", "text": "def cookie_hash_length\n super\n end", "title": "" }, { "docid": "f546bd37337c5f43812a06f024eddbd2", "score": "0.5450616", "text": "def inspect\n \"#<CGI::Cookie: #{self.to_s.inspect}>\"\n ...
9f6f76d5b75229fbb2552c37f7c8f080
=== Instance Methods ===
[ { "docid": "bf14f4a440be58e2e7596bf7b7f7913e", "score": "0.0", "text": "def primary; parent.nil? end", "title": "" } ]
[ { "docid": "b5b25700e97a3ff8649acd443cb60f46", "score": "0.7502186", "text": "def instance; end", "title": "" }, { "docid": "b5b25700e97a3ff8649acd443cb60f46", "score": "0.7502186", "text": "def instance; end", "title": "" }, { "docid": "b5b25700e97a3ff8649acd443cb60f46",...
f6c7bb8914c56a9efdb490906a892f51
packageMenu = PackageMenu.where(:menu_id => menu_id) total = 0 packageMenu.each do |pack| total = total + pack.package.price MenuRecipe.where(:menu => menu_id).each do |m| total = total + m.recipe.price end end total
[ { "docid": "d80a8e0d10a136ad510c357ade6942a5", "score": "0.0", "text": "def find_my_menu_here(menu_id)\n #recipes = self.find_all_by_menu\n end", "title": "" } ]
[ { "docid": "47645cd45eece5d9fdd0890f551ee2a3", "score": "0.76403373", "text": "def tasting_menu_cost\n sum = 0\n self.menu_items.each do |item_instance|\n sum += item_instance.price \n end\n sum \n end", "title": "" }, { "docid": "64cee9338ed39ceca4125d235c8c4a17", "sco...
b73c9db9c4ff05ed4a9cbfb6746dcfe8
Delete ShippingMethod by key
[ { "docid": "3b82c485454d56fb80339a15bfc592a9", "score": "0.71438223", "text": "def delete_shipping_method_by_key(project_key, key, version, opts = {})\n data, _status_code, _headers = delete_shipping_method_by_key_with_http_info(project_key, key, version, opts)\n data\n end", "title": "...
[ { "docid": "1c1cffa76094205ecf9adc35e1b03631", "score": "0.72744393", "text": "def delete key\n run_method(:delete, key)\n end", "title": "" }, { "docid": "6b373c08a14460aaeeb54de7abc8f2a3", "score": "0.67661464", "text": "def delete(key)\n end", "title": "" }, { "...
a7dfed207d799dd3a44036676b4b21ed
GET /admin/blogs/new GET /admin/blogs/new.json
[ { "docid": "6161a9b85f9ccf5238f1d78ea61d0214", "score": "0.77257085", "text": "def new\n @admin_blog = Admin::Blog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_blog }\n end\n end", "title": "" } ]
[ { "docid": "e8dfb2ea357bb68994cf1143c4708c92", "score": "0.7632543", "text": "def new\n @blog = Blog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @blog }\n end\n end", "title": "" }, { "docid": "e8dfb2ea357bb68994cf1143c4708c92"...
2cdc500b63b5a1892313002ab762e2c1
DepthFirst Search (DFS) it explores possible vertices down each branch before backtracking this feature allows the algorithm to be implemented succinctly both in iterative and recursive forms Greedy algorithm time complexity: O(V+E) mark the current vertex visited explorce each adjacent vertex that is not included in t...
[ { "docid": "75864c1ee6b49d443e71a7623d41c96c", "score": "0.660206", "text": "def dfs(graph, start_node)\n visited = {}\n stack = [start_node]\n\n until stack.empty?\n vertex = stack.pop\n\n next if visited[vertex]\n\n visited[vertex] = 1\n\n graph.vertex(vertex).connections....
[ { "docid": "58e200a59bb651c8125360602becbb9f", "score": "0.7482862", "text": "def depth_first_search(start_vertex,visited=Hash.new(false))\n p \"Visited: \" + start_vertex.data.to_s; visited[start_vertex.object_id] = true\n start_vertex.edges.each do |edge|\n puts visited.object_id\n depth_first...
c52e36fc8cbd49d2034dc08104fb3869
GET /locationsets/1 GET /locationsets/1.xml
[ { "docid": "875456e4e52d7a42ae62bd268a423867", "score": "0.70791674", "text": "def show\n @locationset = Locationset.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @locationset }\n end\n end", "title": "" } ]
[ { "docid": "805e5b54273bb44407911c3295be9010", "score": "0.6964658", "text": "def list_locations\n headers = default_headers\n headers['Accept'] = 'text/xml'\t# JSON locations not supported\n Nokogiri.XML(get('/locations', headers))\n end", "title": "" }, { "docid": "2e37afb1cea5f1...
376ef19bceccccb8aac54f77db110909
def pwd_params params.require(:user).permit(:password, :password_confirmation) end for extra fields
[ { "docid": "426aabeb403b8e395408cad7d2261ea5", "score": "0.0", "text": "def sign_up_params\n params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation, :role_id, :country)\n end", "title": "" } ]
[ { "docid": "56df1efbdefebd442263ef8d1a1f2896", "score": "0.8870537", "text": "def password_params\n\t\t\tparams.require(:user).permit(:password, :password_confirmation)\n\t\tend", "title": "" }, { "docid": "4f660e2344683651cb3c6d32f7218b75", "score": "0.883704", "text": "def password...
5013545db368364027d33b8785536530
PATCH/PUT /api/v1/csv_files/1 PATCH/PUT /api/v1/csv_files/1.json
[ { "docid": "e78a84639bb7bd4143df51fc91e7a988", "score": "0.73330384", "text": "def update\n respond_to do |format|\n if @api_v1_csv_file.update(api_v1_csv_file_params)\n format.html { redirect_to @api_v1_csv_file, notice: 'Csv file was successfully updated.' }\n format.json { rende...
[ { "docid": "fa9168efebdf12671fab7671ad4088e0", "score": "0.683201", "text": "def set_api_v1_csv_file\n @api_v1_csv_file = Api::V1::CsvFile.find(params[:id])\n end", "title": "" }, { "docid": "170cde48fe18319b7937e254c9abb611", "score": "0.6735466", "text": "def update\n re...
4061fca689062ae5f3776b1a24d5f950
GET /pending_hours/new GET /pending_hours/new.xml
[ { "docid": "545858a7700cf79a878e1babd5218c8b", "score": "0.6852872", "text": "def new\n @pending_hour = PendingHour.new\n @role_choices = Role.choices_for_select_doer\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pending_hour }\n end\n end...
[ { "docid": "d44d61cb80158f9e832fe8c599cb4b85", "score": "0.75148785", "text": "def new\n @hours = Hours.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hours }\n end\n end", "title": "" }, { "docid": "beb05987312fcef7b065074353c...
4be7aea25f73638b2714a94adb93a030
This function uploads created XML files to the AWS watchfolder and starts the ingestor We have used netssh and netscp to move generated files to AWS watchfolder and start ingestor. After starting ingestor it will give call to do_tail method to monitor the ingestion process.
[ { "docid": "127c734b1e09ca163da64b4792693fe2", "score": "0.593276", "text": "def ssh_AWS\n scp = Net::SCP.start(\"#{ENV['Instance']}\", \"#{ENV['User']}\", :keys => [\"#{ENV['PEM']}\"])\n # link used http://stackoverflow.com/questions/14658363/proxy-tunnel-through-multiple-systems-with-ruby-netssh...
[ { "docid": "1dd3333f6e6736a565708a1fd8064702", "score": "0.6227431", "text": "def watch!\n raise 'Initialization required' if @path.nil? or @bucket.nil?\n callback = Proc.new do |modified, added, removed|\n urls = []\n (added | modified).sort.each do |file_name|\n next if file_nam...
37cb5f662fff5b36a250907358d29998
Write a method that takes two arguments: the first is the starting number, and the second is the ending number. Print out all numbers between the two numbers, except if a number is divisible by 3, print "Fizz", if a number is divisible by 5, print "Buzz", and finally if a number is divisible by 3 and 5, print "FizzBuzz...
[ { "docid": "0b554a28dc8cc069c479edee29de5bb9", "score": "0.0", "text": "def fizzbuzz(num1, num2)\n arr = []\n num1.upto(num2) do |num|\n arr << case\n when num % 15 == 0 then 'FizzBuzz'\n when num % 3 == 0 then 'Fizz'\n when num % 5 == 0 then 'Buzz'\n else nu...
[ { "docid": "e95922df83d1f137a7f401c3629e2d21", "score": "0.8228264", "text": "def fizzbuzz(num_1, num_2, range)\n#Repeats the following code for the duration of the range argument.\n (1..range).each do |i|\n#If i is divisible by both num_1 and num_2, it displays string fizzbuzz\n if i % num_1 === 0 ...
5029b509a2d655c5561c383958773cc9
used to track used namespace symbols for entity list generation
[ { "docid": "deb9616bca15edb6c741482e60060284", "score": "0.6930239", "text": "def used_namespace_symbols\r\n\t\t\treturn @from_code_namespace_symbol_usage_count.keys\r\n\t\tend", "title": "" } ]
[ { "docid": "736a21dffcd839c574f5483d3be930f3", "score": "0.63569015", "text": "def namespaces; end", "title": "" }, { "docid": "791ab9dd4c68169514d95b1225256dd4", "score": "0.62777066", "text": "def namespaces()\n #This is a stub, used for indexing\n end", ...
ccad47539b2272c01e9b2e3756ea64d1
Returns whether a set number of items MUST be purchased in order to get the sale price
[ { "docid": "1129cf0c63c61d6f15ebb0d2a9833b0d", "score": "0.6488244", "text": "def quantity_required?\n @is_quantity_required || self.quantity_for_free > 0\n end", "title": "" } ]
[ { "docid": "0c01c1b033de55b23d1c2685a7a83758", "score": "0.7767792", "text": "def can_purchase?(n)\n inventory_count - n >= 0\n end", "title": "" }, { "docid": "c59e4dc34fd9a3b8afccffca733f38f4", "score": "0.7650344", "text": "def valid_for?(items)\n return false if qty_thresh...
10377f60f748149e77ad54978bd38dc4
Notification to Inviter when their approval is declined by invitee
[ { "docid": "6df75162e0754cc2508ee8a9231821b8", "score": "0.77044564", "text": "def approval_declined(confirmation, message, url)\n setup_email( get_emails(confirmation.invitation.inviter) ) \n setup_inviter_invitee(confirmation) \n\t url = clean_url(url)\n\n\n # Email header info\n @subj...
[ { "docid": "90d89f97955c64019fb3cc70e2239003", "score": "0.73993784", "text": "def decline\n\t\tmp = MeetingParticipation.find_by(meeting_id: params[:meeting_id], user_id: params[:user_id])\n\t\tmp.response_status = 2\n\t\tmp.save\n\n\t\tDeclineInvitationJob.perform_later mp, mp.user\n\n\t\tredirect_to ...
caf0ca4adca7a5bc0a480c20a8e9a808
findPlayerInFiles('Colaprico') findPlayerInFiles('Colaprico') findPlayerInFiles('Colaprico') findPlayerInFiles('Colaprico') findPlayerInFiles('Colaprico') findPlayerInFiles('Colaprico') findPlayerInFiles('Colaprico') findPlayerInFiles('Colaprico') findPlayerInFiles('Colaprico')
[ { "docid": "af1576eef544b816a3310a002f837f6e", "score": "0.6359542", "text": "def getFiles(player)\n # Gets List of CSV to seed database with\n files = Array.new\n csv_list = Dir.glob(\"csv/*\")\n csv_list.each do |csv_filename|\n csv_text = File.read(csv_filename)\n csv = CSV....
[ { "docid": "7ee2441eadf233cf7d9096dc1ef7a91d", "score": "0.62861913", "text": "def test_find_player_in_players()\n team = SportsTeam.new(\"Belgium\", [\"Player 1\", \"Player 2\", \"Player 3\"], \"Mr Belgium\")\n assert_equal(\"Player 2\", team.find_player_in_players(\"Player 2\"))\n end", "ti...
a28bb0c7a995c26496fc956693c293ba
Create a director Create a director for a particular service and version.
[ { "docid": "aa8ca82d4c2e11ebc185adb09a836a49", "score": "0.7261752", "text": "def create_director(opts = {})\n data, _status_code, _headers = create_director_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "782074fee9648a43a658872c1ea5adb9", "score": "0.67785084", "text": "def create_director_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DirectorApi.create_director ...'\n end\n # unbox the parameters from the ha...
563d6700e6037f516db563102579839c
These two are linked
[ { "docid": "ccc96f1f559fa8398528bed672aca2ec", "score": "0.0", "text": "def new #This needs a view for typing data\n # the @post variable represents a fresh, new, empty Post object\n @post = Post.new\n end", "title": "" } ]
[ { "docid": "592c12a4b8268b968cb330b79f3d7ac7", "score": "0.67398185", "text": "def linked\n @linked\n end", "title": "" }, { "docid": "e3c3425418f5bf8d50f24f776bab404b", "score": "0.64885086", "text": "def links; end", "title": "" }, { "docid": "e3c3425418f5bf8d50...
f4901336f982cfe284aa85083955939b
pirates_say_arrrrrrrrr("are you really learning Ruby?") => "eenu" pirates_say_arrrrrrrrr("Katy Perry is on the radio!") => "rya" pirates_say_arrrrrrrrr("Pirates say arrrrrrrrr") => "arrrrrrrr"
[ { "docid": "2c96350d203a6050b34b2fa0927ca008", "score": "0.6530814", "text": "def pirates_say_arrrrrrrrr(string)\n counter = 0\n newstring = \"\"\n string.each_char do |letter|\n if counter >= 1\n newstring << letter\n end\n if (letter == \"r\") || (letter == \"R\")\n counter = 1\n...
[ { "docid": "6c6040e0e00957280dda6a769a8b2ca9", "score": "0.722695", "text": "def what_is_life\n \"What is the answer to life the universe and everything?\"\nend", "title": "" }, { "docid": "9bd78ee19a9484cccd8f24a537cbaeb1", "score": "0.71818155", "text": "def pirates_say_arrrrrrrrr...
7bfcdf0b9baace60d58eefb77d5b1672
GET /locations/:id/comments GET /locations/:id/comments.xml
[ { "docid": "74a310427cfa59da156ede5989ebf771", "score": "0.7687215", "text": "def index\n @location = Location.find(params[:location_id])\n @comments = @location.comments\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n e...
[ { "docid": "212b8cf072734b4ab39a2fd57f397ff0", "score": "0.69569254", "text": "def show\n @comment = Comment.find(params[:id])\n @location = @comment.location\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "titl...
cb92327eb1c195e41fc9133df44fa3cc
we're inserting these directly after making the API call, so yes, it's verified
[ { "docid": "2157f257b165bcc50f54ed402a586cf3", "score": "0.0", "text": "def verified?\n true\n end", "title": "" } ]
[ { "docid": "9e4a9efa7bf668853fd75519c46ca9ce", "score": "0.56510335", "text": "def store_basics_in_status_format(body)\n self.external_account.oodt_baseline_survey_complete = body['baselineSurveyComplete']\n self.external_account.oodt_baseline_survey_url = body['url']\n\n self.external_account....
37ca407327a2d866282cc471f5dd4aee
Usage example: sales_results = chart_helper(first_day_s, end_day_s,'sale',['total','total_cost']) sales = sales_results[0] array with sales per day sales_total = sales_results[1][0] sales_total_cost = sales_results[1][1]
[ { "docid": "9d3c05129a60d4388ae6000184fe2653", "score": "0.6448327", "text": "def chart_helper(start_date, end_date, model, columns, date='created_at', where_modifier = '',join_modifier='', group='')\n statement = build_statement(start_date, end_date, model, columns, date, where_modifier,join_modifie...
[ { "docid": "7070760550a7db8adb525d61c8384918", "score": "0.6590058", "text": "def chart_data\n @chart_data ||= if @action == 'gross_sales'\n gross_sales_chart_data\n else\n [].tap do |result|\n Event.where(action: @ac...
818f460a10cc683d1aa4053cad60744d
Este servicio permite editar los datos de un cliente
[ { "docid": "6f5d270ae1b02f509a594382bf64c715", "score": "0.0", "text": "def edit_customer(params: {})\n path = '/api/customer/edit'\n\n private_post(path, params)\n end", "title": "" } ]
[ { "docid": "8d2dcd0d0f9c448835b0aa704ce6f516", "score": "0.73157173", "text": "def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n format.html { redirect_to [:admin, @cliente], :notice => 'Exemplo was successf...
24db2d1965983eab20309927dd325b4c
Clears the control construct tree cache
[ { "docid": "b7918361060780e56f05a98a28c70dd3", "score": "0.65944153", "text": "def clear_cache\n ccs.each(&:clear_cache)\n end", "title": "" } ]
[ { "docid": "4d6997a529c29c576bc36f9a4a346af4", "score": "0.67096585", "text": "def clear_cache\n begin\n unless self.parent_id.nil?\n if self.parent_type == 'CcCondition'\n $redis.ping\n # puts 'Connecting to Redis...'\n # puts \"Id: #{self.id}\"\n # pu...
a449dcd0a6456dfc77ef008fd2c48ffd
calculate until when will the plastic be on the planet
[ { "docid": "27d9154479211f18ca38157fa6580f38", "score": "0.0", "text": "def biodegrate()\n sql = 'SELECT existence FROM plastics WHERE id=$1'\n values=[@id]\n results= SqlRunner.run(sql, values)\n return results.first['existence'].to_i + 2018\n #2018 hard coded at the moment, will change to use as ...
[ { "docid": "d128a342be35286f4df5f720163abd44", "score": "0.61710227", "text": "def future_planet(planet_id, turn)\n planet = self.forecast[planet_id].last.clone\n if planet.neutral?\n # No growth, battles can be 3-way\n inbound_fleets = @pw.fleets.select{|fleet| fleet.destination_planet ...
cd846f7616371ff18985a60a82a69e2a
PATCH/PUT /registry/employee_positions/1 PATCH/PUT /registry/employee_positions/1.json
[ { "docid": "318191ea7f4934719b64bd5364bbaab2", "score": "0.70251185", "text": "def update\n respond_to do |format|\n if @registry_employee_position.update(registry_employee_position_params)\n format.html { redirect_to @registry_employee_position, notice: 'Cargo fue actualizado exitosament...
[ { "docid": "df89fc83580cb32c3674bef8058eaa17", "score": "0.6903419", "text": "def update\n authorize @employee\n @employee.user = current_user\n @position = Position.new\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_back_or_default emplo...
1853c2318e7e2a5d373432e5e9ef581b
Output process data as array
[ { "docid": "19ffecaffeef1f62fcada36f0a5df74e", "score": "0.0", "text": "def to_a(fields=default_fields, formatter=Formatter::Array.new)\n output(fields, formatter)\n end", "title": "" } ]
[ { "docid": "f228d27777c14e9bc6843b4b8d2827bb", "score": "0.73465806", "text": "def output(data); end", "title": "" }, { "docid": "6d28e9c561bc3192061d744a31b921b6", "score": "0.6624242", "text": "def output\n @_data.output\n end", "title": "" }, { "docid": "f5f1aa...
00014cb431baa7d188188377e5762fad
End of genetic recombinators
[ { "docid": "05249a8b399c3d61fd20e0d1f241a701", "score": "0.0", "text": "def total_driving_distance(itin)\n itin.conses(2).inject(0) {|dist, ((x1,y1),(x2,y2))|\n dist+Math.sqrt(((y2-y1)**2)+((x2-x1)**2))}\nend", "title": "" } ]
[ { "docid": "1df65d045e0d65f9bf9b98c8cdd94356", "score": "0.6635099", "text": "def finish()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "ac2fbdd95f79403a9a4b085a8d425a42", "score": "0.64983106", "text": "def germinate\n end", "title": ...
7a55274e5241f1137c3769bb61633154
we want the user to input the time the task needs to be completed and the date we should be specific about how you input the date(month, day, year, time?) amount of time between now and the deadline new instance using Time.new = future time variable Time.now gives you the current time one method get the date & the time...
[ { "docid": "93eef7f9b7814166b9a1825fe72bb316", "score": "0.0", "text": "def to_unix_time(date)\n #new time object out of the given date and time\n info = date.split(\"T\") #creates 2 item array\n \n the_day = info[0].split(\"-\") #results in a 3 item array [yr, month, day]\n the_time = i...
[ { "docid": "16d23f17983ee5118d957a40a0966f29", "score": "0.6534241", "text": "def time_to_go(due_time)\n #return the amount of time in minutes that they have left to complete their task\n #puts Time.now\n current_time = Time.now.to_i - 3600*4 #converts current time at this moment to unix time...
e831c6518f612a759e6340de2fbb8ec5
moves mouse to first open position on the left hand side
[ { "docid": "7cd9e60bf74741ce12d0c89f2cb950ec", "score": "0.6497628", "text": "def set_left_start_point\n @leading_x = 0\n @leading_y = find_left_entry\n end", "title": "" } ]
[ { "docid": "610d8c33e05dad9ed5d8d9979a9dc04f", "score": "0.80244637", "text": "def left; move_cursor(-1); end", "title": "" }, { "docid": "610d8c33e05dad9ed5d8d9979a9dc04f", "score": "0.80244637", "text": "def left; move_cursor(-1); end", "title": "" }, { "docid": "29282e...
b61dfdba456919baa39fcdc0885b7692
REQUIRED summary: This credential type is used for two factor authentication by phone. value is a HealthVault::WCData::Auth::SimplePhoneFactorCredential
[ { "docid": "667f9e62877a3e4f4dd776925ef3f5e5", "score": "0.52356774", "text": "def simple_phone_factor=(value)\n @children['simple-phone-factor'][:value] = value\n end", "title": "" } ]
[ { "docid": "293f52c9c68fdddcdf340be7e6e557fb", "score": "0.62372357", "text": "def auth_second_factor_type=(auth_second_factor_type)\n validator = EnumAttributeValidator.new('String', ['none', 'phone_number', 'totp', 'mobile_push', 'security_key', 'fingerprint'])\n unless validator.valid?(auth...
48738ea48367859d8f9f47c49747dccf
converts nonschema errors to an ELKcompatible format (JSONserialisable hash)
[ { "docid": "5c7f1d2595a62ed1e9bf7410ac2abd45", "score": "0.0", "text": "def error_to_hash(error, backtrace: true)\n error_info = { message: error.message, repr: error.inspect }\n error_info[:backtrace] = error.backtrace.first(@backtrace_lines) if backtrace\n { canonical_name(e...
[ { "docid": "3bf128b5185fb8fbfdf340b815456f94", "score": "0.668705", "text": "def to_hash\n errors\n end", "title": "" }, { "docid": "6a33153c99b86062a264ad86bb671939", "score": "0.6612214", "text": "def to_hash_errors\n {\n general_info: general_info,\n where_to_...
06d308ce6495b6006b0266c334ca7e06
Takes a file and loads the properties in that file
[ { "docid": "44be160bea015b798b5a9a8deb67b965", "score": "0.7158013", "text": "def initialize file\n EasyTranslate.api_key = 'AIzaSyDrbD0AfKHiMZTYoite-ec4byLNlPxoX8k'\n @file = file\n @properties = []\n \n File.open(file, \"r:UTF-8\").each do |line| \n @properties << line \n end\n ...
[ { "docid": "55dfb72ff535bc74b22279e3924fe833", "score": "0.74696195", "text": "def load_properties(properties_filename)\n properties = {}\n File.open(properties_filename, 'r') do |properties_file|\n properties_file.read.each_line do |line|\n line.strip!\n if (line[0] !...
fddb70f7c8d1c8720a9a5ff09f31ebe8
show an report message
[ { "docid": "113b84b9663b05988deec6ed8e8ac01a", "score": "0.64491034", "text": "def report(message)\n @report.append(message)\n end", "title": "" } ]
[ { "docid": "8338572fd1b20d51e2fff36b896e94da", "score": "0.73850006", "text": "def report(message); end", "title": "" }, { "docid": "d9a5b61347db9fb1841a1d9981a15064", "score": "0.69816345", "text": "def msg(report)\n maxSpeed = Setting.find_by_name(\"Speed\").value.to_int\n rs...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "2ab99e5d2dd74c3864a4de2de9ff8830", "score": "0.0", "text": "def set_fighting\n @fighting = Fighting.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...
9bda9a7abd8944e2b3ebe134a761b3ef
DELETE /publication_fact_sheets/1 DELETE /publication_fact_sheets/1.json
[ { "docid": "fbc1ddf4b3965c0bf1fc94b8545551d1", "score": "0.7800506", "text": "def destroy\n @publication_fact_sheet.destroy\n respond_to do |format|\n format.html { redirect_to publication_fact_sheets_url, notice: 'Publication fact sheet was successfully destroyed.' }\n format.json { hea...
[ { "docid": "e9e099c927eaa48a0d51f007d6763e5e", "score": "0.7796096", "text": "def destroy\n @fact_sheet.destroy\n respond_to do |format|\n format.html { redirect_to fact_sheets_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "633957abfd65f...
0f9ad0977e09b64e89ea8357c580f040
end of migrate thesis version of migration that adds the content file url but does not ingest the content pdf into the thesis on megastack: rake migration_tasks:migrate_thesis_with_content_url[/home/ubuntu/testfiles/foxml/york_xxxxx.xml,/home/ubuntu/mapping_files/col_mapping.txt]
[ { "docid": "9c97b5e86e61fe5ec10bdbeb997b1ce8", "score": "0.6309182", "text": "def migrate_thesis_with_content_url(path, content_server_url, collection_mapping_doc_path, user) \r\nresult = 1 # default is fail\r\nmfset = Object::FileSet.new # FILESET. # define this at top because otherwise expects to fi...
[ { "docid": "7bbd4ddd8cf4bb52903584334442fefa", "score": "0.6982394", "text": "def migrate_bhutan_thesis_with_content_urls(collection_id, content_server_url, user) \r\n\r\nmfset = Object::FileSet.new # FILESET. # define this at top because otherwise expects to find it in CurationConcerns module . (app ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "48ced90d32c35c88ece0e9d4bb429dd5", "score": "0.0", "text": "def set_time_table\n @time_table = TimeTable.find(params[: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...
f185373343ae06253f8d132600a93991
GET /readied_item_slots GET /readied_item_slots.json
[ { "docid": "511f44350433c97a4ecb3e0099c2cb28", "score": "0.8035114", "text": "def index\n @readied_item_slots = ReadiedItemSlot.all\n end", "title": "" } ]
[ { "docid": "c3377133b03c5683c26415bc8641e2eb", "score": "0.7344478", "text": "def index\n @item_slots = ItemSlot.all\n end", "title": "" }, { "docid": "daa491d0f5633cd7953f031bfc2311c9", "score": "0.7037754", "text": "def slot\n Item.find(item_id).slot\n end", "title": ""...
29071ddb58f19d8ec3b546e9279dafff
Removes +key+ from the cache in +expiry+ seconds.
[ { "docid": "48c1fd458fea4656b145c0854b13a983", "score": "0.7285421", "text": "def delete(key, expiry = 0)\r\n raise MemCacheError, \"Update of readonly cache\" if @readonly\r\n with_server(key) do |server, cache_key|\r\n with_socket_management(server) do |socket|\r\n socket.write \"del...
[ { "docid": "a9ad6084f305949f53d697d89c9ce24e", "score": "0.7728378", "text": "def expire(key, expiry)\n redis.expire _key(key), expiry\n end", "title": "" }, { "docid": "a9ad6084f305949f53d697d89c9ce24e", "score": "0.7728098", "text": "def expire(key, expiry)\n redis.exp...
bc824809b00e00f05d60963aaddf3529
builds a new revision which layers the image on top of the old revision image.
[ { "docid": "4653c85cba32237ec9aaa4ac2c067616", "score": "0.7515999", "text": "def build_revision(image)\n if revisions.last\n comp = get_imagelist_from_url revisions.last.image.url\n else\n if !background?\n check_background\n end\n comp = get_imagelist_from_url backgrou...
[ { "docid": "546b8cac54dd8ca9122420bdf55bb18c", "score": "0.72023994", "text": "def rebuild_revision\n if !background?\n check_background\n end\n if images.length > 0\n comp = get_imagelist_from_url background.url\n for image in images\n comp.composite!( get_imagelist_from_...
07b96149e615f5365115b5644f094bb2
Set the path of the request.
[ { "docid": "78da2d35a52ca0a57ed0ae7ac88441b8", "score": "0.72872937", "text": "def path=(path)\n @uri.path = path\n @request = Net::HTTP::Get.new(@uri.request_uri, @request_headers)\n end", "title": "" } ]
[ { "docid": "8283ed0ea40f3993aa090c7d9551f1ff", "score": "0.7879653", "text": "def set_path(v)\n @path = v\n end", "title": "" }, { "docid": "6c4bb6f56c2034b13ebc00ee6f0e2e64", "score": "0.78516006", "text": "def set_path(path)\n path\n end", "title": "" }, { "...
d7d57ad5ea36073c00fdef33cf4a1c54
a string has valid spacing. The function should return either True or False. For this kata, the definition of valid spacing is one space between words, and no leading or trailing spaces. Below are some examples of what the function should return. 'Hello world' = true ' Hello world' = false 'Hello world ' = false 'Hello...
[ { "docid": "33ae98ff4285c92a2ab92dc1a45d818d", "score": "0.82763624", "text": "def valid_spacing(s)\n return s == s.strip.gsub(/\\s+/, \" \")\nend", "title": "" } ]
[ { "docid": "c6870ad368592dfad51c4e3f96575814", "score": "0.7397957", "text": "def only_whitespace?(string)\n string.match?(/\\A[[:space:]]*\\z/)\n end", "title": "" }, { "docid": "cd18a5a2bf32fee90f03ea780ffc3532", "score": "0.71996236", "text": "def check_if_spot_is_valid x\n ...
08fcee01c49b6d55c331fd29955c1a6a
GET /participants GET /participants.json
[ { "docid": "7490a190dab62986c4e42baa05475adf", "score": "0.72528446", "text": "def index\n @participants = Participant.all\n end", "title": "" } ]
[ { "docid": "575eb0523143fe35bc849fc85955cfaa", "score": "0.73988354", "text": "def list\n @participants = Participant__c.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @participants }\n end\n end", "title": "" }, { "docid": "bea...
b93417a5d3e31dd5b56c2970783ae0bd
Crear un arreglo con solo los nombres de los platos.
[ { "docid": "29428d55a61ea0dffc456290e91a2e1c", "score": "0.0", "text": "def solo_nombres(hashito)\n hashito.keys\nend", "title": "" } ]
[ { "docid": "5b2ea8f31a5992bc8a01c8a6705c8d0d", "score": "0.594745", "text": "def initialize(nombre_plato, lista_alimentos, lista_gramos)\n @nombre_plato = nombre_plato\n @lista_alimentos = lista_alimentos\n @lista_gramos = lista_gramos\n end", "tit...
eed64746fac8f2dc0a2c5d85f6888002
Test if this host has a mac address used by OpenStack, which normally starts with 02:16:3E
[ { "docid": "1b6926b570f03000c4f9be08818e90b7", "score": "0.8112354", "text": "def has_openstack_mac?\n !!(Facter.value(:macaddress) =~ %r{^02:16:3[eE]})\n end", "title": "" } ]
[ { "docid": "ca46623ec10bf043fa1dc9cd2d2f7d72", "score": "0.7811965", "text": "def has_euca_mac?\n !!(Facter.value(:macaddress) =~ %r{^[dD]0:0[dD]:})\n end", "title": "" }, { "docid": "39eed9661d2bd30dd6d5d57752a41e51", "score": "0.7381242", "text": "def has_rackspace_mac? \n...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "542025a3e4604d039e3a2b47badddb50", "score": "0.0", "text": "def horario_params\n params.require(:horario).permit(:dia, :codigo_curso, :curso_asignatura, :nombre_asignatura, :periodo_id)\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"...
70cbc1301999264f7f76820ee167c915
Loads the plugin from the specified directory, tracking all successfully loaded plugins in +Rails.plugins+
[ { "docid": "afdddb377bc98ffe59ab17ac04404548", "score": "0.71675026", "text": "def load_plugin_with_loaded_plugins(directory) #:nodoc:\n plugin = Plugin.new(directory)\n return false if Rails.plugins.include?(plugin)\n \n unless find_plugin_path(plugin.name).nil?\n # Be carefu...
[ { "docid": "4569335a2feac9328e8117de5ee14cee", "score": "0.7842905", "text": "def load_plugins\n clear_events\n\n # Base Plugins\n load_directory \"#{File.dirname(__FILE__)}/plugins\"\n\n # External plugins\n load_directory \"#{File.dirname(Servbot::Config.config)}/plugins\"\n end", ...
6835d71047c8ab4d64959faaa5bb9197
Generate form answers report Generates a new form answers report
[ { "docid": "4f679adb9efeabbfbe67ac3ba0eaab20", "score": "0.66611034", "text": "def generate_form_answers_report_with_http_info(generate_form_answers_report, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AdvancedReportsApi.generate_form_answers_r...
[ { "docid": "4c538720e29830d73dbb88a66823dfc7", "score": "0.72915417", "text": "def generate_form_answers_report(generate_form_answers_report, opts = {})\n data, _status_code, _headers = generate_form_answers_report_with_http_info(generate_form_answers_report, opts)\n data\n end", "title...
b80ab587fe661230334da86bbf8a747e
Records the ending of a user's involvement with a particular ministry
[ { "docid": "2f0205e95796efda205d49a4e4dfb60e", "score": "0.4889171", "text": "def destroy\n @person = Person.find(params[:person_id])\n if @me == @person || authorized?(:new, :people)\n @ministry_involvement = MinistryInvolvement.find(params[:id])\n @ministry_involvement.update_attribute...
[ { "docid": "a80f1e78dc8b2fdf289893fecfceb438", "score": "0.5732105", "text": "def send_phase_finish_reminders!\n PhaseFinishReminder.notify_collaborators_of_challenges(Challenge.active, ChallengeMailer)\n end", "title": "" }, { "docid": "36a49983237237df89c85bc1ea9b183e", "score": "0...
9b7bc3b8ee455c274862a193a032038d
Check if character is behind window
[ { "docid": "199e570e94a0720e842da41a2b8e26a9", "score": "0.70681334", "text": "def behind_toolbar?\n px = ($game_player.screen_x / 32)\n py = ($game_player.screen_y / 32)\n return ( ((3 - px) < 0 && px <= 17) && (10.5 - py) < 0 ) ? true : false\n end", "title": "" } ]
[ { "docid": "3f9adbb85ed189f495e160670e803189", "score": "0.6809631", "text": "def on_ground\n \tnot free?(0,1) #If character is 1 pixel or closer/against the ground\n \tend", "title": "" }, { "docid": "90193242e4abb0c3ac0f3504a304776d", "score": "0.6557376", "text": "def win_te...
87d1212000a566266e156c0593fa2262
What will the following code print? Why? Don't run it until you've attempted to answer.
[ { "docid": "ba4329bc102c9e123ed000f55801af57", "score": "0.0", "text": "def meal\n 'Dinner'\n puts 'Dinner'\nend", "title": "" } ]
[ { "docid": "c842c87b430e3e56423265b6a8c3b996", "score": "0.71919596", "text": "def asking; end", "title": "" }, { "docid": "dabd6b9dc12ac485d40b7f6c93ca7968", "score": "0.69974643", "text": "def give_me_the_answer\n\t42\nend", "title": "" }, { "docid": "bfec30904f45f25a6a...