query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
69beaa3e957d1fc356539d0314d703e1
Custom attribute writer method checking allowed values (enum).
[ { "docid": "331434e3878a32abe7886f9c24daab3d", "score": "0.0", "text": "def combination_operation=(combination_operation)\n validator = EnumAttributeValidator.new('String', [\"MEAN\", \"SUM\"])\n unless validator.valid?(combination_operation)\n fail ArgumentError, \"invalid value for 'c...
[ { "docid": "8146b840a980695b919bbb80892fcc0c", "score": "0.6161179", "text": "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"GPA_CREDIT_PENDING\", \"GPA_CREDIT_PENDING_REVERSAL\", \"GPA_CREDIT_REVERSAL\", \"GPA_CREDIT\", \"GPA_DEBIT\", \"GPA_DEBIT_PENDING_REVERSAL\", \"GPA_DE...
7df9501fb19ced9b122ce090bacac8e7
define cards_in_category method to check how many cards are in each category
[ { "docid": "57681aeff3af16c30f4da438285e5755", "score": "0.68170583", "text": "def cards_in_category(category_string)\n # loop through array and return the cards that match the input category\n @cards.select do |card|\n # pluck out the cards that have matching categories to the category_str...
[ { "docid": "3f9ec41cedbb0d55a6edb47ad7f4f8a0", "score": "0.7717235", "text": "def cards_in_category(category_arg)\n\n @cards.find_all do |card|\n card.category == category_arg\n end\n\n end", "title": "" }, { "docid": "13c44b8f7f3287b7ebe11fd48bce9c78", "score": "0.77014256",...
05e613561bccf0c89b609ac5f7b5566f
GET /year_infos GET /year_infos.json
[ { "docid": "ea6a5b350caf7f53f93c8a2ed3e65e45", "score": "0.0", "text": "def index\n drop_page_title(\"基础假期管理\")\n drop_breadcrumb\n @year_infos = @year_infos.order(\"year desc,user_id asc\")#.where(\"user_id>1000\")\n respond_to do |format|\n format.html do\n @year_infos = @year_...
[ { "docid": "4291b5fc77fd5a9c314aae2e5eec398c", "score": "0.754568", "text": "def show\n year = Year.find(params[:year])\n if year.present?\n render json: year.months\n else\n render json: { message: \"Year #{params[:year]} was not found\" }, status: :not_found\n end\n end", "t...
9f10f1a7580bb06c389848bdd6fb0e41
GET /slittings/1 GET /slittings/1.xml
[ { "docid": "37ba547cc124951dc0b1ca1dd9dee1fc", "score": "0.6493906", "text": "def show\n @slitting = Slitting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @slitting }\n end\n end", "title": "" } ]
[ { "docid": "b4b04bc54fa19f79259eb8d8750c9d78", "score": "0.64083105", "text": "def show\n @setting = Setting.find(params[:id])\n pref_id = Station.search_pref(current_user)\n @pref = Setting.prefecture_index_show(pref_id)\n respond_to do |format|\n format.html # show.html.erb\n for...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "4b33b3f992a96bfd16060daae2b41dc7", "score": "0.0", "text": "def set_painter\n @painter = Painter.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;...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "26380be47d221a106a16f87701652233", "score": "0.0", "text": "def producto_ofertado_params\n params.require(:producto_ofertado).permit(:producto_id, :producto_of_id, :usuario_id, :producto_of_cantidad, :producto_of_precio_unitario, :producto_of_fecha_publicacion)\n end", "title": "...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
13ab629af8b752ea49dd4bff695a2b8f
The full command to run the package manager
[ { "docid": "4fca7e39a96cc3d8d2de86888fd665ef", "score": "0.5708117", "text": "def pkg_binary; \"apt-get\" end", "title": "" } ]
[ { "docid": "7f4a40f12e935086ab091c13e31518ab", "score": "0.7305537", "text": "def pkg_cmd; \"#{pkg_binary} -qyu\" end", "title": "" }, { "docid": "2913e52f2e9fba0498539fabc2c96e40", "score": "0.70519847", "text": "def run_package_command(command)\n shellout!(command, cwd: Config...
241c7d253a9152c4290b02360c057045
Gets the resourceNamespaces property value. The resourceNamespaces property
[ { "docid": "3eac10f17c183afc1d4297766837e1fd", "score": "0.81335104", "text": "def resource_namespaces\n return @resource_namespaces\n end", "title": "" } ]
[ { "docid": "582fbf6d7facdd4fe030094dfede00a6", "score": "0.7456535", "text": "def resource_namespaces=(value)\n @resource_namespaces = value\n end", "title": "" }, { "docid": "23c19fa3a0ba6c963fcfc85fc41580bd", "score": "0.67505497", "text": "def namespaces\...
08d4fc8ab478f59ae05f8f173848674e
Return a new array populated with our keys.
[ { "docid": "1325580f96ee859a46c979beb0bd33ee", "score": "0.0", "text": "def keys\n\t\t@table.keys\n\tend", "title": "" } ]
[ { "docid": "131a0aecca02150a61851dfaa7b08c5d", "score": "0.7898253", "text": "def keys\n return [],[]\n end", "title": "" }, { "docid": "51543793969e74ecae2ae921d5910d72", "score": "0.76158595", "text": "def keys\n keys = []\n underlying_array.each { |arr| k...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "10d3e7d8f4540e58b61cb36da3f039d6", "score": "0.0", "text": "def set_incubator\n @incubator = Incubator.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...
d089f7e8edb23c15a2f872922e222071
make new uses new and create this looks for 'new' view in project view folder
[ { "docid": "05d9cc554534eaa3bd5a4c185d27670c", "score": "0.6084188", "text": "def new\n @test = Project.new\n end", "title": "" } ]
[ { "docid": "07ba3a42b617b5c9dc1228ab1672ec4b", "score": "0.6914814", "text": "def new\n add_breadcrumb \"Nouveau\"\n @project = Project.new\n end", "title": "" }, { "docid": "5dafbdb30025e347d0cba89e56e6544c", "score": "0.67348826", "text": "def new\n # Agrega el breadcrumb...
4df705046922dda7c18c774b6e568f9d
Lints the globbed markdown files. Will fail if `proselint` cannot be installed correctly. Generates a `markdown` list of warnings for the prose in a corpus of .markdown and .md files.
[ { "docid": "003dccf21a852d606755fb5803e1d21d", "score": "0.7330343", "text": "def lint_files(files = nil)\n # Installs a prose checker if needed\n system 'pip install --user proselint' unless proselint_installed?\n\n # Check that this is in the user's PATH after installing\n raise \"...
[ { "docid": "f7768a7dc5cf9c7c295fe83d5598da18", "score": "0.6310515", "text": "def markdown\n return if changed_markdown_files.empty?\n\n output = `mdl #{changed_markdown_files.join(' ')}`\n return if output&.empty?\n\n heading('Markdown Linter', output)\n end", "title": "" }, { ...
cb4baf6d7a46e1bb47e3f07c3adef3ae
Edit calls to the function to match the memo Assumes input is of the form 0n Assumes n \leq 9 Returns a list of strings, in lexicographic order.
[ { "docid": "48785e50aa22c2a475dec1502721bb1a", "score": "0.54257417", "text": "def lexicograph(n)\n\tputs \"lexicograph(#{n})\"\n\tif n == 0\n\t\treturn [\"0\"]\n\tend\n\tresult = []\n\tprevious_ordering = lexicograph(n-1)\n\t0.upto(n) do |k|\n\t\t# puts \"k: #{k}\"\n\t\tprevious_ordering.each do |perm|...
[ { "docid": "f871a2f4eacfb4a152d707d442d8d967", "score": "0.5667507", "text": "def m(n)\n if n > 100\n puts \"M(#{n -= 10}) since #{n + 10} is greater than 100\"\n n\n else\n puts \"M(M(#{n += 11})) since #{n - 11} equal to or less than 100\"\n m(m(n))\n end\nend", ...
f055c9298fcc3a33e601addea440f9a2
Return a string representing the header
[ { "docid": "8d8bedfef61131db6d77a30540938958", "score": "0.0", "text": "def inspect\n to_ary.inspect\n end", "title": "" } ]
[ { "docid": "9d40469632b7244108560edf6ffc1030", "score": "0.8292841", "text": "def to_s\n\t\t\t@headers[0].to_s\n\t\tend", "title": "" }, { "docid": "9d40469632b7244108560edf6ffc1030", "score": "0.8292841", "text": "def to_s\n\t\t\t@headers[0].to_s\n\t\tend", "title": "" }, { ...
a3a17597675af0b9a3bd5d92e5f3d883
mainmenu(companyname,user,client_hash) Returns option selected by user
[ { "docid": "00b9511461e67a3da0c5d84c03eb29b1", "score": "0.6884344", "text": "def main_menu(companyname=\"Unknown\",username=\"Unknown\",client_hash)\n prompt = TTY::Prompt.new(symbols: {marker: \">\"})\n input = \"\"\n while input != \"Exit\"\n system('clear')\n Debug.show \"Debu...
[ { "docid": "a6721bea81a684ba0834207be6946fc9", "score": "0.6683829", "text": "def booth_main_menu\n prompt.select(\"Welcome Booth Operator, what would you like to do today?\" ) do |menu|\n menu.choice \"View Merchandise\", -> {self.user.check_merchandise}\n menu.choice \"Upd...
2e81e19e4e01b734896bec3e0df3200b
Returns true if the version is shared, otherwise false
[ { "docid": "9f320ac036c9884b3f8c076a5508a534", "score": "0.77494925", "text": "def shared?\n sharing != 'none'\n end", "title": "" } ]
[ { "docid": "a06b865f80435be8b10b4b5ab3ca6b3d", "score": "0.76786816", "text": "def is_shared? \n if self.library_entries.where(shared: true).empty?\n return false\n else \n return true\n end \n end", "title": "" }, { "docid": "a06b865f80435be8b10b4b5ab3ca6b3d", "score...
2803fd187c1f1043ac6925caf1ea1dc5
puts first_word "Poetkoe on tosi paras :D"
[ { "docid": "fd85345f890c1c829015c67960c761f8", "score": "0.0", "text": "def titleize text\n new_text = text.split\n small_words = [\"over\", \"the\", \"and\", \"of\", \"for\", \"from\"]\n\n output = new_text[0].capitalize\n\n i = 1\n while i < new_text.length do\n #word = new_text[i]\n #word....
[ { "docid": "5a2bbe20f0a75c659a0eab1a0563dc5c", "score": "0.82074934", "text": "def first_word(string)\n word = string.split(\" \")\n p(word[0])\nend", "title": "" }, { "docid": "17aacd0a6a8ca30815ec697ff832416b", "score": "0.8198831", "text": "def first_word (phrase)\n morceaux = ...
909a85d2f922e120d11a30ce637fcf9b
Resets this module's configuration. Configuration options will be set to default values if they exist; otherwise, they will be set to nil.
[ { "docid": "9de49fb36d538235b1e4198b0cdcf4c7", "score": "0.77506256", "text": "def reset\n VALID_CONFIG_OPTIONS.each { |opt| self.send(\"#{opt}=\", nil) }\n self.logger = nil\n end", "title": "" } ]
[ { "docid": "1bfafcd5bfa8335843ef138ddd671aa0", "score": "0.80597985", "text": "def reset_config\n config.reset_to_defaults\n end", "title": "" }, { "docid": "22a3209cc7d52786d21c618c5ff4e833", "score": "0.79004896", "text": "def reset\n CONFIGURATION_DEFAULTS.each { |k, ...
976b1bddd753df370d4a327ec98e5f06
Provide a user friendly representation source://twilioruby//lib/twilioruby/rest/verify/v2/service/rate_limit.rb127
[ { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.0", "text": "def to_s; end", "title": "" } ]
[ { "docid": "cfcf27587efe7dfe7f5c36e2618c81aa", "score": "0.7492387", "text": "def rate_limit_status\n JSON.parse(Typhoeus::Request.get(\n api_url('rate_limit_status'),\n :headers => {'User-Agent' => Punchr::USER_AGENT_HEADER},\n :params => {:key => Punchr.api_key}\n ).body...
a850471fa42ed3d853149362694ed82f
Return cart_item id for a user's package. 1 if cart_item does not exist for a package.
[ { "docid": "e664286699ee13df687bc2080d047825", "score": "0.8642108", "text": "def get_cart_item_id_for_package(package_id)\n cart = Cart.where(:user_id => self.id).first\n \n if cart == nil\n return -1\n else\n \n cart_item = cart.cart_items.where(:package_id => package_id).f...
[ { "docid": "ec4f39c2edf343a892b82a08f70552bc", "score": "0.63639206", "text": "def get_cart_item_id_for_quiz(quiz_id)\n cart = Cart.where(:user_id => self.id).first\n \n if cart == nil\n return -1\n else\n \n cart_item = cart.cart_items.where(:quiz_id => quiz_id).first \n ...
f6ed2b7eb854fc19a431aca2a59b3190
7 reads File, use CSV class to parse > results in an object of type CSV::Table
[ { "docid": "9acfbf2c62d99c23180d8cf0be918d00", "score": "0.6507173", "text": "def import_from_csv(file_name)\n # Implementation goes here\n csv_text = File.read(file_name)\n csv = CSV.parse(csv_text, headers: true, skip_blanks: true)\n # #8 iterate over the CSV::Table object's rows, create ...
[ { "docid": "eec5f72cadfccac3ad837f4f8804e8a8", "score": "0.73322535", "text": "def parse\n @raw_data = CSV.read(file, :col_sep => \"\\t\", :headers => false)\n end", "title": "" }, { "docid": "8d353a59aef47462ed4f34c343b3410e", "score": "0.70451826", "text": "def import_from_...
3b3defd2c2435bf87d1c460420edbd43
Find a list of `Station` matching +criterium+. Valid keys:
[ { "docid": "1df0961f13a9293dd05bd67013e87a2b", "score": "0.70540255", "text": "def find(criterium = nil)\n if criterium.is_a?(String)\n regex = /#{criterium}/i\n matching = all_stop_areas.reject { |sa| sa.name !~ regex && sa.external_code !~ regex }\n return convert_sto...
[ { "docid": "7ad289335dc64eb35c76c0ef4b73ff29", "score": "0.67459834", "text": "def find_station(input) #grab their input to find their station\n Station.find_by(stations: input)\n end", "title": "" }, { "docid": "99a7e95b49a72e72d64599720bcdd71f", "score": "0.64739025", "text": "de...
bf9489e73873136f28419dbbb2c2a94f
Methods can check if a block was given
[ { "docid": "98f16a0c3416ba1d74c7a4248af7751b", "score": "0.7921845", "text": "def i_check_if_block\n if block_given?\n yield\n else\n puts \"no block\"\n end\nend", "title": "" } ]
[ { "docid": "6d872bd129fb29067dfe00ce8bb9d5d5", "score": "0.83214164", "text": "def block_valid?(block)\n # ...\n end", "title": "" }, { "docid": "c0bda8d6ede0a02807a28a41a2ba0d5b", "score": "0.8224239", "text": "def were_we_given_a_block?\n\tif block_given?\n\t\t\"WE GOT A BLOCK\...
da33d6e34b41620b5f6b280ef05be6fa
Get human attribute name for active model object.
[ { "docid": "e4b52d3b5a1e0d36819b79168e97896c", "score": "0.8018624", "text": "def human_attribute(object, attribute)\n object.class.human_attribute_name(attribute)\n end", "title": "" } ]
[ { "docid": "561cd1f1d6f6d5efa69b103a62d02011", "score": "0.83387274", "text": "def human_name\n Base.human_attribute_name(@name)\n end", "title": "" }, { "docid": "5b703e597c5ee71790247aad3823584b", "score": "0.7812893", "text": "def human_name(attribute_name)\n self.cla...
592fec4974726fc48ace134860cfb4fe
funzione relativa al check "no cambi" della ricerca
[ { "docid": "ff8fe3f2e50e9b237554b850f48a52d2", "score": "0.0", "text": "def hide_multitrip\n if multitrip\n true\n else\n false\n end\n end", "title": "" } ]
[ { "docid": "a3941ce70fd903d9be5d281a9df2da2d", "score": "0.6275696", "text": "def debo_ir_a_carcel\n if (super)\n return !pagar_fianza\n else\n return true \n # Lo hemos hecho así, porque pensamos que si tiene carta y llama a \n # pagar fianza y tiene el saldo sufic...
cdd226684bdc5052cc6ac30069db3711
Programmatically execute the Knuth's uparrow notation, pentation. Utilized sudo code presented here
[ { "docid": "ec6f2c146428ac9e0c767acc1fdeedcb", "score": "0.0", "text": "def pentation(a,b)\n\t\t_r = 1\n\t\tfor i in 0..b-1\n\t\t\t_r = tetration(a, _r)\n\t\tend\n\t\treturn _r \n\tend", "title": "" } ]
[ { "docid": "0b66726bbc850b576bc4b7f292645f12", "score": "0.616361", "text": "def go_up\n @instruction = [:go_up]\n end", "title": "" }, { "docid": "0a27f3fb89acc0900c752fcc14faa0d6", "score": "0.57326627", "text": "def key_up(locator,keySequence)\n do_command(\"keyUp\"...
6c0b85b18d75610d262bf2a212a5c889
Gets the emailSettings property value. The emailSettings property
[ { "docid": "f25815debdb55b2f677f50ffe222c923", "score": "0.87842876", "text": "def email_settings\n return @email_settings\n end", "title": "" } ]
[ { "docid": "86498bc63e178c5a79e34ab5adaf84d2", "score": "0.7830302", "text": "def email_settings=(value)\n @email_settings = value\n end", "title": "" }, { "docid": "1ea33de069adb1397d22b2b369b58fef", "score": "0.7544416", "text": "def mailbox_settings\n ...
acc9b8c00983dcb53176f7b93e5ae5b8
Array of specimen_shippings where some or all of the specimens are not confirmed.
[ { "docid": "85d99bce92337802a1c2a85100df20ce", "score": "0.7680237", "text": "def array_of_shipped_and_not_received_specimens\n specimens_not_confirmed = Specimen.joins(:specimen_receipt => [ {:specimen_storage_container => :specimen_shipping}]).all.reject{ |sr| SpecimenReceiptConfirmation.where(:spe...
[ { "docid": "56eabde6885e24d8430beaae4a8ec557", "score": "0.6506236", "text": "def not_confirmed_friendships\n @not_confirmed_friendships ||= inverse_friendships.all.reject { |r|\n ! friendships.find_by_friend_id(r.user_id).nil?\n }\n end", "title": "" }, { "docid": "b658bb0a0271a...
884c14343dfdeb928bb41ed766ce8626
Return the correct type for this property
[ { "docid": "8c8187d023df6e2916b021466e93fba5", "score": "0.0", "text": "def property_types(property)\n if @vocabulary.properties.has_key?(property)\n @vocabulary.properties[property][:types]\n else\n @vocabulary.properties[:any][:types]\n end\n end", "title": "" } ]
[ { "docid": "02e0a36c90f4012a90f3482fb0514b19", "score": "0.7780472", "text": "def value\n send property.type_field\n end", "title": "" }, { "docid": "927f5bfa5f0a08e9b7a17c5c0f3b659e", "score": "0.76530135", "text": "def expected_type\n @property.expected_type\n end", ...
afb286da10bea22c700b15e1a01f9d5d
Read rule Read rule
[ { "docid": "c726e3ae25d71f042d2491a25c928dc4", "score": "0.0", "text": "def read_security_rule(domain_id, security_policy_id, rule_id, opts = {})\n data, _status_code, _headers = read_security_rule_with_http_info(domain_id, security_policy_id, rule_id, opts)\n data\n end", "title": "" ...
[ { "docid": "399461d6ff4040ccc741f76b5771c511", "score": "0.6955222", "text": "def read!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 18 )\n\n type = READ\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -...
f27e7b1494173e068ff4ec02772fc7fa
Defines method style accessors based on header row names.
[ { "docid": "11e19ddb58cb24f5af972c4bbbf10284", "score": "0.5408433", "text": "def initialize(*args)\n orig_initialize(*args)\n if field_row?\n headers.each do |h|\n define_singleton_method(CSV::AutoParser.convert_header_to_method_name(h)) { fetch(h) }\n end\n end\n ...
[ { "docid": "1453fbc8275312d989d55b8bda104c6f", "score": "0.74387264", "text": "def accessors_from_headers!\n raise \"Can't define accessors from headers in a table without headers\" unless @has_headers\n\n self.accessors = headers.map { |val| (val && !val.empty?) ? val.to_s.downcase.tr('^a-z0-...
fb0f201d7d028babd8632bd671fc0597
The exact kind of data of the specified type the MIME type represents
[ { "docid": "c6bdf2573e6efda3342cb5ad8685eec0", "score": "0.0", "text": "def content_subtype\n return unless content_media_type\n\n content_media_type.split('/').last\n end", "title": "" } ]
[ { "docid": "b44e17eddc48f56a0e5eb72ab0424d77", "score": "0.7720506", "text": "def content_type\n data[:content_type]\n end", "title": "" }, { "docid": "d3d536fe50fd679a059092288a610ac0", "score": "0.77164274", "text": "def type\n magic(Magic::MIME_TYPE)\n end", "title...
924b92a9b6e78c5496a7b1d184ce66f6
Checks if this data contains the given notice.
[ { "docid": "0722d81e16ddd26a65332d6fc503a2a4", "score": "0.7731588", "text": "def contains_notice?(notice)\n key = notice_key(notice)\n @notices.include?(key)\n end", "title": "" } ]
[ { "docid": "ecf26d583027a52a206322c562471d6c", "score": "0.66271895", "text": "def notice?\n severity == \"NOTICE\"\n end", "title": "" }, { "docid": "266778f4d1d5a20b6ad0a93aa6038e5c", "score": "0.64165395", "text": "def has_notice_message?(text)\n has_message?(...
70d083ce74bcd660c995d837410a1e85
Process an array of links and return a better one
[ { "docid": "78c5b4d9e6fbce191250291f1e15d236", "score": "0.6408001", "text": "def normalize_links(links)\n extensions = \"png|gif|jpg|pdf|zip\"\n beginnings = \"mailto|tel\"\n\n links_array = []\n warnings = []\n\n links.each do |link|\n link = link.attribute('href').to_s...
[ { "docid": "c7c1bc673309da74cf17e312889cd4fa", "score": "0.7377227", "text": "def link_prep(arrayoflinks)\n puts \"[\".light_green + \"*\".white + \"]\".light_green + \" Prepping links for testing....\".white\n testlinks=[]\n arrayoflinks.each do |link|\n paras = link.split('?')[1]\n if paras.n...
3aa03cd72a695efc57e0282bdeebd7bd
Retrieve a single page of ServiceInstance records from the API. Request is executed immediately.
[ { "docid": "3ec5dfddc55eeac1537e28ff1eac91e5", "score": "0.0", "text": "def page(page_token: T.unsafe(nil), page_number: T.unsafe(nil), page_size: T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "2293a7b25bfe5b9fae465e3b4ac89742", "score": "0.6326377", "text": "def instances\n get_json(instances_endpoint)\n end", "title": "" }, { "docid": "b8e566eeef3134716865c97ea0ba7653", "score": "0.6184854", "text": "def index\n # Get the records for the entity.\n ...
1f35efb32c69d155ba3becd3fa340a48
Displays a page indicating our thanks for registering
[ { "docid": "0bf1fc015b91dcb62b0976a5e49d8953", "score": "0.7377703", "text": "def registration_thanks\n end", "title": "" } ]
[ { "docid": "f1a33be01f8c5ba92214d2eaa0e9fb4a", "score": "0.71929103", "text": "def login ##function to show page for logging in to system\n flash[:info] = \"<strong>Warning!</strong> If you have not already registered, you will need to do so before you can continue\".html_safe\n ##tells the user t...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "716eccb019005282cffabb94184486eb", "score": "0.0", "text": "def set_biblical_reference\n @biblical_reference = BiblicalReference.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...
bf667cf36aa9835dc6876f34ed20ef8b
Change the file path from 'LOCAL_DIR/SOURCE_CODE_PATH' to 'WEB_VIEW_URL/SOURCE_CODE_PATH'
[ { "docid": "57d5000140acf846d071232523a77d65", "score": "0.7116618", "text": "def get_webview_url(file_path)\n file_path.gsub(%r{/#{local_source_path}}, @webview_url)\n end", "title": "" } ]
[ { "docid": "56bf19dbfd3862c9f52bb6d8d561ef2f", "score": "0.64204305", "text": "def source_path; end", "title": "" }, { "docid": "be4f0c3925a8ceba0390e56b553ae7d9", "score": "0.60954076", "text": "def src_path(path)\n app_path('src/' + path)\n end", "title": "" }...
2d17970ae75c53ad7542c509ceacbe8c
Height of the box based on total params.
[ { "docid": "ed59c8272c6d0ed6160df3a489f900c2", "score": "0.8791719", "text": "def box_height\n return line_height + 104 + line_height * (@params.size + 1)\n end", "title": "" } ]
[ { "docid": "c519b1e6b46d51cea20d6affe209853d", "score": "0.74321175", "text": "def height\n if clear_border?\n geometry.height\n\n else\n border.height\n\n end\n end", "title": "" }, { "docid": "77f3eb3c49105c38e0aabe4f2d68fcd2", "score": "0.7408782", ...
f68b80382391e22cc2adea053b32e954
Create a new DynamoDB object.
[ { "docid": "97bc7f73de9af23a712129d404c9d93a", "score": "0.6270923", "text": "def initialize(db_name, options = {})\n # :marshal serialization results in a binary format that cannot easily\n # be stored in DynamoDB. We fall back to :yaml.\n if options[:serializer] == :marshal\n opt...
[ { "docid": "d8af046e3aaa25ef79b1fa0fc2740225", "score": "0.7064255", "text": "def create_table\n\t\t\t\t# TODO verify it's not already created\n\n\t create_opts = {}\n\t create_opts[:hash_key] = hash_key\n\t create_opts[:range_key] = range_key if range_key\n\t \n\n\t ...
35f985a66d7e85387e16f7c916a276b2
Gets the isDeleted property value. Indicates whether the user is deleted. Possible values are: true, false.
[ { "docid": "3cff4d8dcf5ed8bccbd6f9a6bdd6cd03", "score": "0.7815895", "text": "def is_deleted\n return @is_deleted\n end", "title": "" } ]
[ { "docid": "3ee352206b22d5d1badd2d3ba23f7e31", "score": "0.72854865", "text": "def deleted?\n #TODO check if this introduces security error by returning a mutable value\n @deleted\n end", "title": "" }, { "docid": "1a8e78de9ecdea1e70456ffb4185c147", "score": "0.72056186", ...
322d8ab8100ab180fe4ec03f91e1215a
Public: Deregisters a check from the collection Returns the check
[ { "docid": "6092ea4ca29722c22addfb8df1701332", "score": "0.7296654", "text": "def deregister(name)\n check = collection.delete(name)\n end", "title": "" } ]
[ { "docid": "c33b37497babd94f98266d7c5131c238", "score": "0.63034976", "text": "def remove\n self.checklist.increment_checklist_counters(self, -1)\n self.destroy\n end", "title": "" }, { "docid": "f4bf1f6df0699655ab7c1e2c4de448f6", "score": "0.6261902", "text": "def clear\n ...
26a228036b85dfc1c5bb82470a32b4d0
Create a posting with attachments from params for current_user
[ { "docid": "ed1c93b6f15153aa7f6a013f137761e2", "score": "0.7768524", "text": "def create_posting(form_params,current_user)\n posting = self.postings.create(form_params)\n posting.user = current_user\n if posting.save && self.save\n posting.attachments.each(&:save) if posting.attachments\n ...
[ { "docid": "b22f8b8dbab56b1ae33f1a9697755f84", "score": "0.78803784", "text": "def create\n @post = current_user.posts.build(params[:post])\n build_attachments(@post) unless @post.save\n respond_with(@post)\n end", "title": "" }, { "docid": "61cc949f82c444d53986b9b421e76ee9", "...
a9dee0ef6ecf3df35a68f7be2f1b9036
calculates possible deaths from population, density, and state
[ { "docid": "5476e8e110edd6ae3f253c13b815808f", "score": "0.78310686", "text": "def predicted_deaths#(population_density, population, state)\n # predicted deaths is solely based on population density\n factor = case population_density\n when 0...50 then 0.05\n when 50...100 then 0.1\n when...
[ { "docid": "f24a0f0ed719e50d1ab279fdaad1dd63", "score": "0.8000814", "text": "def predicted_deaths #(population_density, population, state)\n # predicted deaths is solely based on population density\n fractions = [0.4, 0.3, 0.2, 0.1, 0.05]\n density = [200, 150, 100, 50, 0]\n \n index = 0...
e2e56d75794961e4e743f1305fc914a6
POST /season_requests POST /season_requests.json
[ { "docid": "8983353bb69c285265ac7d829e1a0cbc", "score": "0.73597544", "text": "def create\n @season_request = SeasonRequest.new(season_request_params)\n\n respond_to do |format|\n if @season_request.save\n format.html { redirect_to season_requests_path, notice: 'Season request was succ...
[ { "docid": "9ad9993b9f70fda95a60064c9d9115cf", "score": "0.67054445", "text": "def season_request_params\n params.require(:season_request).permit(\n :season_id,\n :requester_id,\n :requestee_id,\n :message\n )\n end", "title": "" }, { "docid": "ad15e0...
24af850dd7d1fac1dc1478edeea4f213
Write the given data and returns the locator and url handles to the file. If no locator is passed, a new file is created.
[ { "docid": "761ba40b97066ac8214489174275852f", "score": "0.54131806", "text": "def write(data, options = {})\n \n locator = options[:key] || options[:locator]\n s3_options = options[:s3_options] || {}\n s3_options.merge!(:acl=>:public_read)\n\n if locator.nil? or locat...
[ { "docid": "e1f79c3a7a475dbf8163de777d130828", "score": "0.5976707", "text": "def write(data, template)\n write_file format(data, template), data[:file][:url]\n end", "title": "" }, { "docid": "afad346192dd471aec59dd3e98436bea", "score": "0.57444394", "text": "def write(location,...
2e44dabf63a9a32fa7f0219333833edf
Public: Loads each available file corresponding to a given platform in order of ascending specificity, then passes the Module to the block passed. Yields each Module.
[ { "docid": "4aa2f895479c98dab35a5de0dcea46f3", "score": "0.7762842", "text": "def load_each(&block)\n platforms = map_platforms { |name| name.gsub(/[^a-zA-Z0-9]/, '_') }\n\n paths = (0...platforms.length).map { |i| platforms[(0...i)].join('/') }\n mods = (0...platforms.length).map do |i|...
[ { "docid": "ff5248b91cffa5db931a37827684784f", "score": "0.654293", "text": "def each_osdeps_file\n return enum_for(__method__) unless block_given?\n\n Dir.glob(File.join(local_dir, \"*.osdeps\")).each do |file|\n yield(file)\n end\n end", "titl...
0ac36290cd249ffe37af065e5f43f05e
Return a definition list (HTML dl element). Number of items can be defined via argument, otherwise it is a random number.
[ { "docid": "1c57bd3c2aef08341fbcf63a6c2078d2", "score": "0.7107752", "text": "def random_dl( item_num = 2 + rand(10) )\n items = (1..item_num).collect do\n \"<dt>#{texter.random_word.capitalize}</dt>\" +\n \"<dd>#{texter.random_paragraph}</dd>\"\n end\n \"<dl>\\n\" + items.join(\"\\n\...
[ { "docid": "c9e9758402cc7a0c3c29b8cb04df6342", "score": "0.5984666", "text": "def generate_list(name, count); end", "title": "" }, { "docid": "fd3b113d1407b6eeff032bddbff60815", "score": "0.58962667", "text": "def html_filter_definition_lists\n # process all unordered lists dept...
dc5f439903e00cac2e7c3fe638a4a88b
overriding devise_invitable default root redirection after sending invitation.
[ { "docid": "111d1f9e304fe0c03c731fb2ecbff938", "score": "0.6391305", "text": "def after_invite_path_for(resource)\n events_path\n end", "title": "" } ]
[ { "docid": "7fbbc2721afec8848a502a2f3544f5c7", "score": "0.7446065", "text": "def after_invite_path_for(resource)\n root_url\n end", "title": "" }, { "docid": "b61b7841e8bc91ec9c80d1cdd493424b", "score": "0.7170786", "text": "def after_invite_path_for(_user)\n invitations_path...
48e36da22fe2df56a561b79474579cea
future relase: Make fields reuired by canvas required here
[ { "docid": "644e53390785c32d3c9024310fed7d80", "score": "0.0", "text": "def initialize(opts = {})\n @name = opts[:name] if opts[:name]\n @uid = opts[:uid] if opts[:uid]\n @parent_id = opts[:parent] if opts[:parent]\n @root_id = opts[:root] if opts[:root]\n @time_zone = opts[:time_zone] if...
[ { "docid": "066bc68a3a804092882d5da1c31e7742", "score": "0.6476567", "text": "def canvas_params\n params.require(:canvas).permit!\n end", "title": "" }, { "docid": "667cecf73ecff77ecc8bf6151a38020f", "score": "0.63459826", "text": "def drawField()\n l = Length ; ...
808b38c543ca1408cdb02164ac5fc251
using the registers type, resolve the slot to an index Using the index and the register, add a SlotToReg to the instruction
[ { "docid": "32eb0ea2078cf570d1d2ddcee781e3f5", "score": "0.68386555", "text": "def resolve_and_add(slot , compiler)\n index = resolve_index(slot)\n new_left = get_new_left( slot , compiler )\n compiler.add_code Risc::SlotToReg.new( \"SlotLoad #{type}[#{slot}]\" , self ,index, new_left)\n ...
[ { "docid": "8b8ffe67d78d4dae343b9dbf476135df", "score": "0.6049383", "text": "def []( index )\n RegisterSlot.new( self , index , compiler)\n end", "title": "" }, { "docid": "9560a9fd12efcca1229596d0b9c2001b", "score": "0.59445786", "text": "def <<( reg )\n raise \"not re...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "6a0b219c206a381e26a5c410e7cca5e8", "score": "0.0", "text": "def set_sound\n @sound = Sound.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;...
143add83fd40184b9735f57cc1a549bc
Provide a user friendly representation source://twilioruby//lib/twilioruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb161
[ { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.0", "text": "def to_s; end", "title": "" } ]
[ { "docid": "6572463d9ea5ea8ba08c853c96423c12", "score": "0.56135786", "text": "def full_phone_number\n \"+#{country_code}#{phone_number}\"\n end", "title": "" }, { "docid": "69cc3a32d5a4a97142a9d7be4e9e24ed", "score": "0.55448204", "text": "def full_phone_number\n \"+#{self.ph...
ff695608fb6c9be5880deb8d564c8158
Read a &39;niatelemetry.HttpsAclContractDetails&39; resource.
[ { "docid": "6c63a37b319c2bf144b34797f66a98d8", "score": "0.6423406", "text": "def get_niatelemetry_https_acl_contract_details_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: NiatelemetryApi.get_niatelemetry_https_acl_contract_d...
[ { "docid": "7403f7de480cd845873aa5d36e912ca9", "score": "0.60364395", "text": "def get_niatelemetry_https_acl_contract_details_list(opts = {})\n data, _status_code, _headers = get_niatelemetry_https_acl_contract_details_list_with_http_info(opts)\n data\n end", "title": "" }, { "...
5255aed3415a8a4f2e87ae0d2ab9dc2c
Use Blocks to Iterate
[ { "docid": "83344f8b0be03366b64eb8e67fda916f", "score": "0.0", "text": "def do_something_with_an_arg\n\tyield(\"Hello World\") if block_given?\nend", "title": "" } ]
[ { "docid": "95ddfc0eb4861fdbc8ae0c4c738b2781", "score": "0.78866214", "text": "def each(&block)\n @blocks.each &block\n end", "title": "" }, { "docid": "95ddfc0eb4861fdbc8ae0c4c738b2781", "score": "0.78866214", "text": "def each(&block)\n @blocks.each &block\n end", ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "b7cc1a1476a36edba6219cf7315fa7eb", "score": "0.0", "text": "def quete_params\n params.require(:quete).permit(:title, :description, :unlockLevel, :rewardType, :done, :reward, :objetToFind)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
6a331ced9e605774cbbc2d71bf23f540
U ovoj metodi se ispituje da li su zadovoljeni svi uslovi kako bi se poslalo u metodu create
[ { "docid": "78b75fb8dc7d4936abbacef947219533", "score": "0.0", "text": "def article_params\n\t\tparams.require(:article).permit(:title, :description)\n\tend", "title": "" } ]
[ { "docid": "41faa708112da8b2ad80d289774cd72c", "score": "0.73953354", "text": "def create\n \t\n end", "title": "" }, { "docid": "5f14ea63c7b88e9e9da9fc48012dd0f8", "score": "0.7365771", "text": "def create\r\n\r\n\r\n end", "title": "" }, { "docid": "e6a01eaba4ab73fc5...
cff4511a8889bfc0c07f58807c394c5f
Use this method to whitelist the permissible parameters. Example: params.require(:person).permit(:name, :age) Also, you can specialize this method with peruser checking of permissible attributes.
[ { "docid": "93309adb8d14c83a389f8ec6577a7ef2", "score": "0.0", "text": "def order_params\n params.require(:order).permit(:OrderDate, :member_id,line_items_attributes: [:id, :quantity])\n end", "title": "" } ]
[ { "docid": "631f07548a1913ef9e20ecf7007800e5", "score": "0.7718267", "text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit...
b41f39cef96dcdcb3492024efe0fa9d6
Returns true if this is an HTML4::Document or HTML5::Document node
[ { "docid": "6f84904a81c9f1c1bfa9b70977be6d0c", "score": "0.79897124", "text": "def html?\n type == HTML_DOCUMENT_NODE\n end", "title": "" } ]
[ { "docid": "3df366889d7f94b9d7f4671a4f0e3b97", "score": "0.82880276", "text": "def html_doc?\r\n node_type == HTML_DOCUMENT_NODE\r\n end", "title": "" }, { "docid": "186ae735fff8dc581af7c2c2a3ac2023", "score": "0.8091322", "text": "def document?\n node_type == DOCUMENT...
5182300f119444bb928cc1f9152839c0
Returns a string containing the HTML stream. Internally, the stream is stored as an Array.
[ { "docid": "c00f8897cd0d5237db6cbe6d297cbbb0", "score": "0.56746596", "text": "def to_s\n @streams.last.to_s\n end", "title": "" } ]
[ { "docid": "58b3b1c96b6b02627e99899dc5232eae", "score": "0.6871146", "text": "def to_html(stream)\n until @strscan.eos?\n stream << generate_html\n end\n\n stream\n end", "title": "" }, { "docid": "af93814ad8b4dd1f5778965e1ca2c17b", "score": "0.68372107...
5cabf74e4b30170626d7b9ed4bd364a3
Check if this view contains a specific tag
[ { "docid": "db9cea54d1e5b18e1fbd44b2512d0e6d", "score": "0.6738516", "text": "def has_tag?(tag_name = nil)\n if tag_name\n tags.include?(tag_name)\n else\n RMQ.is_blank?(@_tags)\n end\n end", "title": "" } ]
[ { "docid": "e53b47394dc0d4989e002e6603c474c2", "score": "0.7781118", "text": "def has_tag? tag\n return false if self.tags.nil? \n self.tags.include? tag\n end", "title": "" }, { "docid": "53a33eb0e997ba6a48646cd0fe7942d3", "score": "0.772957", "text": "def has_tag?(tag)...
92da42be7c4a334760474b0eff00b18c
write a function that computes and prints to standard output (stdout) the longest period of increasing performance for the student that has these grades example [9, 7, 8, 2, 5, 5, 8, 7] outputs 4 (length of [2, 5, 5, 8])
[ { "docid": "106029272f279697347ce0b4410c79c6", "score": "0.77954316", "text": "def longest_improvement(grades)\n runs = []\n prev = 0\n run = 1\n grades.each do |g|\n if g >= prev then\n run +=1\n else\n runs << run\n run = 1\n end\n prev = g\n end\n\n puts runs.max\nend...
[ { "docid": "8076394c5dc5aca52fcfc7a63a421aba", "score": "0.63654935", "text": "def last_possible_exam_semester\n study_length * 2 - 2\n end", "title": "" }, { "docid": "2167c96aa8da5af082aa53203d0e88c6", "score": "0.6319088", "text": "def longest_sequence(num, numbers)\n\tputs \"...
39bb1fcefb6d572a54ce35d09a7baf0f
Returns true if the company has a contract with the company given as a parameter and is a provider in that contract
[ { "docid": "6611e70c441115a13cab77a47fd1c5d5", "score": "0.7235982", "text": "def provides_to?(other_company)\n contracts = contracts_as_supplier.where(:service_buyer_id => other_company.id)\n contracts.all.each do |c|\n return c unless c.void?\n end\n return nil\n end", "title": "...
[ { "docid": "4653b0634607a82cd0821cdc7766a763", "score": "0.8032342", "text": "def has_contract_with?(other_company)\n if !provides_to?(other_company)\n other_company.provides_to?(self)\n else\n true\n end\n end", "title": "" }, { "docid": "71872b98a4d16e244a891d0ad4b5736c...
33a5fe5cab627b0a485739065fba91ce
Required by the Enumerable mixin. Provides an internal iterator over the rows of the result set.
[ { "docid": "abc7181aaa3fa40e9807e1a6e9021314", "score": "0.0", "text": "def each; end", "title": "" } ]
[ { "docid": "119c62c153145fcf549d87312db56f08", "score": "0.76871467", "text": "def each\n while row=self.next\n yield row\n end\n end", "title": "" }, { "docid": "119c62c153145fcf549d87312db56f08", "score": "0.76871467", "text": "def each\n while row=self.nex...
1e0404dc7e832984aa9030b4049677a9
Get the absolute path of a directory within the repo
[ { "docid": "da3eed6cec416dba7685fa2944943a66", "score": "0.8337296", "text": "def get_repo_abs_path( dirname )\n\t\t\tif dirname == nil then\n\t\t\t\t@repo\n\t\t\telse\n\t\t\t\tFile.join( @repo, dirname )\n\t\t\tend\n\t\tend", "title": "" } ]
[ { "docid": "2c01dbf46b33bdeae22578baf8356547", "score": "0.80952734", "text": "def git_directory_path\n base = defined?(@working_dir) ? @working_dir.to_s : nil\n\n File.expand_path(execute(git_cmd('rev-parse', '--git-dir')), base)\n end", "title": "" }, { "docid": "6c7347ef710e7...
b693cec510dd7d42584b7773f008e982
Read a single line.
[ { "docid": "9f16d612c4f9213f6926c08d3f76fa5d", "score": "0.0", "text": "def readline sep_string=$/\n buffer = \"\"\n until buffer[-1..-1] == sep_string || @io.eof?\n buffer << read(1)\n end\n\n buffer\n end", "title": "" } ]
[ { "docid": "07f54fad3858681e01a3367644fbc685", "score": "0.79148567", "text": "def read_line\n @line = @file.gets\n @file.close if @line.nil?\n end", "title": "" }, { "docid": "4eb88f749fdccbebb36c7bc8df24308b", "score": "0.75391257", "text": "def readline\n @handle.get...
f20f7958dd2a573d72b5cb41e333bfb7
Keep track of which APIs are to be shown
[ { "docid": "58e11995e6d15f1db27adc821da74448", "score": "0.0", "text": "def apis=(_arg0); end", "title": "" } ]
[ { "docid": "13cfbe50a73176f08b681f3684afe561", "score": "0.6021838", "text": "def apis; end", "title": "" }, { "docid": "9b9e933bd01915d24fc6fab865a821fb", "score": "0.59215325", "text": "def display_show_in_api\n self.show_in_api ? \"Yes\" : \"No\"\n end", "title": "" }, ...
d7e8cb020426b4e5a664814eebeb8dc4
Trace a DB call
[ { "docid": "a66fa408e20366e33f6588cbfa8e6cfe", "score": "0.58832484", "text": "def db_trace(statement:, host:, adapter:, database:)\n return yield unless @tracer\n\n # skip if not allowing root spans and there is no active span\n return yield if !@allow_root_spans && !active_s...
[ { "docid": "1b6369ee597a5d3b8482c6ca60f2f1d3", "score": "0.6245848", "text": "def query(statement, *params) #Use of splat(*) parameter used with methods where you don't know how many arguements it will take \n @logger.info \"#{statement}: #{params}\" #Funtionailty for the ability to see in the local ...
3cebc0da0fe6d952718a7cf7128a1531
everytime set department you must actively set and update this to the database
[ { "docid": "fa1d8e43fabba716f6a474a73ce718de", "score": "0.0", "text": "def department\n unless @department\n @department = Department.find_by_id(@department_id)\n end\n @department\n end", "title": "" } ]
[ { "docid": "0d5eb2c3b10065c193e81ef7d8faf661", "score": "0.7337267", "text": "def set_department\n @department = Department.find(params[:department_id])\n end", "title": "" }, { "docid": "8656b05b3b75f824dd12cadcf7d8a1e7", "score": "0.7305075", "text": "def set_deptid(dept); ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "93d7bb0a76eaa8282ef0712f3c1eb916", "score": "0.0", "text": "def set_spot\n @spot = Spot.friendly.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.61637366", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60446453", "text": "def action_hoo...
ff0f444c1f53ebca7b05ee2d67414c87
Creates a DSL instance
[ { "docid": "da1e67356061453eb65e8d729d2d8fdd", "score": "0.0", "text": "def initialize(repository = nil, database = nil, &block)\n @repository = repository\n @current_database = database\n self.instance_eval(&block) unless block.nil?\n end", "title": "" } ]
[ { "docid": "4cdc6b9525a7aba46509198fe2859388", "score": "0.73103505", "text": "def new(options, &block)\n dsl = self.class.new([], @options.merge(options))\n dsl.instance_exec(&block) unless block.nil?\n dsl\n end", "title": "" }, { "docid": "b0befd0b550a922f349ba79...
2beb2e8441c8023a8e96b2a01ddd66c8
Returns a variant attribute by the key. If the variant attribute can not be found, a new attribute will be returned with a nil value.
[ { "docid": "0febb043c5025cc9b86b99d945229aac", "score": "0.8284523", "text": "def get_or_create_variant_attribute_by_key(key)\n variant_attribute = variant_attribute_by_key(key)\n if variant_attribute.nil?\n variant_attribute = variant_attributes.build(:key => key.to_s)\n end\n variant_...
[ { "docid": "0cfc7393ae274685b0a7e7253dd85603", "score": "0.8470365", "text": "def variant_attribute_by_key(key)\n variant_attributes.select { |variant_attribute| variant_attribute.key == key.to_s }.first\n end", "title": "" }, { "docid": "52fa7a3dedfce9ae0ecbd90804d3ee2d", "score": "...
b833dd902cc6270e2b7753f1b3ef2513
GET /product_families/new GET /product_families/new.xml
[ { "docid": "606b695773ebca56723dc1a0959eba4e", "score": "0.6961705", "text": "def new\n @product_family = ProductFamily.new\n @title = \"New Product Family\"\n end", "title": "" } ]
[ { "docid": "950b9ce64dbb1e07b57b648d66c19b31", "score": "0.77671", "text": "def new\n @product_family = ProductFamily.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @product_family }\n end\n end", "title": "" }, { "docid": "3e3a...
72944ce9ab3b1b48cbb9a1c441b532bb
=begin Description: Following action will list out all subscriptions of the User. From this section user can change his snacks directly and can update his subscription as well by using the "Update Subscription" option at the top. =end
[ { "docid": "23d067916acf35e5f8dfae8565f14c16", "score": "0.0", "text": "def snack_queue\n #This will fetch the undelivered orders by filtering them through state: :confirm ONLY.\n @sub_items = Spree::Order.get_line_items(current_user.id)\n params_subscription_id = params[:subscription_...
[ { "docid": "dab25b07b20f07660f35de199eb1cbbd", "score": "0.76868325", "text": "def index\n @subscriptions = current_user.subscriptions.all\n end", "title": "" }, { "docid": "e3e2cc97f47263124a06b3b9d9850f8a", "score": "0.7633935", "text": "def list_subscriptions(user)\n get(...
3ec4d316512ddb4eaeea25f9d30af75d
Initialize this Command Due to the multiple ways a Command is instantiated (via the CLI and from the Network stack) any Command initializer must support being called with zero parameters if it expects some.
[ { "docid": "9ec6e03b5441bc1ce8cc25c8578929ab", "score": "0.0", "text": "def initialize(*args)\n end", "title": "" } ]
[ { "docid": "19e8a3795fa37434c38914b114da3ba3", "score": "0.7718423", "text": "def initialize(*command_args); end", "title": "" }, { "docid": "45333faf59999aff2ee74041a9cb54c9", "score": "0.7560863", "text": "def initialize(*args)\n @initial_command = args || []\n reset\n end",...
ac715cf2efbb269d28a1eb0bdf09cb91
Find extended company information
[ { "docid": "2254e965be735b7beae359d1da29e0ca", "score": "0.0", "text": "def company(company_number)\n get(\"/company/#{company_number}\")\n end", "title": "" } ]
[ { "docid": "44b7362679902d72fb9404b1ab55153c", "score": "0.6573738", "text": "def find_people_for_company linkedin_client, company_name, location\n\n puts linkedin_client.query_people_from_company company_name, location\n\n end", "title": "" }, { "docid": "450306669cdd0fafd15db5124c22947...
13a0485cbc9b7a2e9b194145d5ec8b06
PATCH/PUT /ficha_de_equipos/1 PATCH/PUT /ficha_de_equipos/1.json
[ { "docid": "92a4a0e8ec4286603c757cd39a8209c4", "score": "0.6946825", "text": "def update\n respond_to do |format|\n if @ficha_de_equipo.update(ficha_de_equipo_params)\n format.html { redirect_to @ficha_de_equipo, notice: 'Ficha de equipo was successfully updated.' }\n format.json {...
[ { "docid": "8cf5582be869fc5b155331c1d0f7a490", "score": "0.6758454", "text": "def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to @oferta, :notice => 'Exemplo was successfully updated.' }...
8a70daf060ce2b3352b8edf668145170
GET /projects/1/edit you edit the project that you clicked on.
[ { "docid": "cc103a6eee1eb0430e3425bacfcd66fd", "score": "0.0", "text": "def edit\n end", "title": "" } ]
[ { "docid": "49e156e061a92295b8531612a6fabcb4", "score": "0.86995465", "text": "def edit\n @project = Project.find params[:id]\n end", "title": "" }, { "docid": "729440b74fe92a059ba8d4cbd2d2723a", "score": "0.8697536", "text": "def edit\n @project = Project.find(params[:i...
1db570119383e57a19d7a6de274588eb
Bedrag van de transactie in centen
[ { "docid": "5c7eadb8953c0c316dbdaedf7e8fd75a", "score": "0.0", "text": "def amount\n data[:amount]\n end", "title": "" } ]
[ { "docid": "fe894f9690ad0d5ae805320a1b39d89c", "score": "0.6395585", "text": "def langsam_vertikal_bewegen(entfernung)\n absolute_entfernung = entfernung\n if( sichtbar?) \n delta = 1\n if entfernung < 0 \n delta = -1\n absolute_entfernung = - entfernung\n end \n ...
59016b175987c06a0d260cd105a95f58
define a method _called_ only on this instance of the context that method should return the object: with_object
[ { "docid": "dd994504ec998deb7b539854dbc82fc8", "score": "0.6116387", "text": "def make_accessor(called, with_object)\n class << self\n self\n end.send(:define_method, called.to_s) do\n with_object\n end\n end", "title": "" } ]
[ { "docid": "d7e1994e287797f6fe6570bf2fc1811c", "score": "0.6509369", "text": "def call(object); end", "title": "" }, { "docid": "d471b9ac79c9914a17b660f71365d549", "score": "0.6506957", "text": "def decorated_object_behavior\n #code\n end", "title": "" }, { "docid": "...
26ddfe9aed419c1be01fa46b26336e90
u0 = 0 for each basis cell (i, j) ui + vj = cij
[ { "docid": "71ef491555504f456b3f2d3a4a4b5d4d", "score": "0.6164595", "text": "def compose_helper_matrix\n matrix = Matrix.zeros(basis.length + 1)\n\n basis.each_with_index do |cell, matr_row|\n set_u(matrix, matr_row, cell.row)\n set_v(matrix, matr_row, cell.column)\n end\n\...
[ { "docid": "b2d6d443145173ed14ea7cf9b0251029", "score": "0.70887816", "text": "def u\n Matrix.build([@column_count, @row_count].min, @column_count) do |i, j|\n if (i <= j)\n @lu[i][j]\n else\n 0\n end\n end\n end", "title": "" }, { "docid":...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "abd55e6d551c0dbf5c5c9f9d989542d7", "score": "0.0", "text": "def set_tag_relationship\n @tag_relationship = TagRelationship.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;...
c48812e707de4ac58dca49c961e493cb
POST /weekends POST /weekends.json
[ { "docid": "5782f64dc96452dcc2164e2239c64367", "score": "0.6781945", "text": "def create\n @weekend = Weekend.new(weekend_params)\n\n respond_to do |format|\n if @weekend.save\n format.html { redirect_to weekends_path, notice: 'Weekend was successfully created.' }\n format.json ...
[ { "docid": "d51ab42ca953e4e916b4f514f0a0738a", "score": "0.68838537", "text": "def create\n @weekend = Weekend.new(weekend_params)\n\n respond_to do |format|\n if @weekend.save\n format.html { redirect_to @weekend, notice: 'Weekend was successfully created.' }\n format.json { re...
e696e32009e7d35c2d616278af43cfad
Evaluates an expression query over a range of time:
[ { "docid": "9b7edb7f1629c25cfb0f3ac09724c972", "score": "0.50396633", "text": "def query_range(options)\n run_command('query_range', options)\n end", "title": "" } ]
[ { "docid": "407b66235ae0b68c35ce3e886ecf2547", "score": "0.6042229", "text": "def query_across_time(inner_query:, transaction_time: nil, effective_time: nil)\n end", "title": "" }, { "docid": "efeaf951d27eaae06ff8e586f7e81e26", "score": "0.5761384", "text": "def evaluate(t, vars...
5499a1533183ad0915fb6fade0a42222
Audience lists apis (members)
[ { "docid": "430cca88e2c4f5a7681c21e6c76e589f", "score": "0.0", "text": "def add_member_to_audience_list(list, email, options = {})\n options = {:email => email}.merge(options)\n post(\"audience_lists/#{CGI.escape(list)}/add\", options).tap{}\n end", "title": "" } ]
[ { "docid": "386b5d35846e4b1358b5694ff86c205b", "score": "0.64175224", "text": "def index\n respond_with ApidUser.all\n end", "title": "" }, { "docid": "cc483da3128bce100f591c48b14fda17", "score": "0.6379459", "text": "def index\n #@members = member.all\n #@members =...
bd7223cbddf0df7b278e511e5c717d26
returns all aliases defined on the switch including aliases created in ongoing transaction as array of Alias
[ { "docid": "b75ea4f0ec43a597636c6af6a6a829cb", "score": "0.6611861", "text": "def aliases(forced=false)\n get_configshow(true,forced)[:aliases]\n end", "title": "" } ]
[ { "docid": "0f613c5a288540731c20e747de910adf", "score": "0.75942844", "text": "def aliases\n []\n end", "title": "" }, { "docid": "5a78cf898ec6a435972ea34e32e7302e", "score": "0.75656146", "text": "def aliases\n @aliases ||= []\n end", "title": "" }, {...
d295d5e4fee7c930ffa28360ff36632e
Returns the value of attribute label. source://syntax_tree//lib/syntax_tree/mermaid.rb124
[ { "docid": "0004e3c59345c2874971c23dad695717", "score": "0.0", "text": "def label; end", "title": "" } ]
[ { "docid": "66b71dd288a124260500e3e7cc643679", "score": "0.76610905", "text": "def label\n attributes.fetch(:label)\n end", "title": "" }, { "docid": "66b71dd288a124260500e3e7cc643679", "score": "0.76610905", "text": "def label\n attributes.fetch(:label)\n ...
cbd36bef102b1ca8e9b702fa379582c4
=begin Challenge: A Pythagorean triplet is a set of three natural numbers, a n > 0, a=m^2n^2, b=2mn, c=m^2+n^2 is a Pythagorean triplet a+b+c = (m^2n^2)+2mn+(m^2+n^2) = 2m(m+n) = 1000 => m(m+n) = 1000/2 = 500 So find the largest value of m < sqrt(500) where m | 500 n = 500/m m = X/2m m abc = (m^2n^2)2mn(m^2+n^2) = 2mn(...
[ { "docid": "173d65fc5410300cca53fd8698af0de1", "score": "0.0", "text": "def find_m (val)\n current = Math.sqrt(val/2).ceil()-1\n while val/2 % current > 0 do\n current -= 1\n end\n return current\nend", "title": "" } ]
[ { "docid": "413bd37d725a4dc5c11cb9ed75b44066", "score": "0.82924455", "text": "def find_pythagorean_triplet\n number = 500\n a = 1\n b = 1\n (1..number).each do |x|\n (1..number).each do |y|\n if (x + y) + Math.sqrt(x ** 2 + y **2) == 1000 \n a = x\n b = y\n ...
0c2b31f1772ed2d1b7ed0fc3f67abe57
The User or UNIXUser middle initials.
[ { "docid": "5fea45f7f9d954952ec36467c583019d", "score": "0.53572786", "text": "def initials\n @initials\n end", "title": "" } ]
[ { "docid": "ccaa93c24ca3e4aca03abe546de32bee", "score": "0.62368643", "text": "def user_from_initials(person, number = rand(1..9999).to_s)\n part1 = self.class.umlautfix(person.firstname).gsub(/[^a-zA-Z]/,\"\").downcase\n part2 = self.class.umlautfix(person.lastname).gsub(/[^a-zA-Z]/,\"\").dow...
d7b6d54cfe43fb01af31c64c1ba0bfe2
create magical cookie params used by GA for its own nefarious purposes
[ { "docid": "9f4758455feedfe6d7608ace285defb3", "score": "0.7822675", "text": "def cookie_params(utma1 = random_id, utma2 = rand(1147483647) + 1000000000, today = Time.now)\n @utma ||= \"1.#{utma1}00145214523.#{utma2}.#{today.to_i}.#{today.to_i}.15\"\n @utmz ||= \"1.#{today.to_i}.1.1.utmcsr=(di...
[ { "docid": "432484481233b6b578f2c0fdcfb61bab", "score": "0.78601164", "text": "def cookie_params(utma1 = rand(89999999) + 10000000, utma2 = rand(1147483647) + 1000000000, today = Time.now)\n \"__utma=1.#{utma1}00145214523.#{utma2}.#{today.to_i}.#{today.to_i}.15;+__utmz=1.#{today.to_i}.1.1.utmcsr=(d...
f1eb8406d184b9031f565cecc9beb480
Retrieves a set of repositories by their IDs
[ { "docid": "0d726fa9491c699a515d57a74be4c157", "score": "0.6357312", "text": "def search_by_repository_ids(repository_ids)\n criteria = {:filters =>\n { 'id' => {'$in' => repository_ids}}\n }\n search(criteria)\n end", "title": "" } ]
[ { "docid": "8c09b2cb1250115da85a946909741fd0", "score": "0.7054506", "text": "def repositories\n client.repositories(user_repo, @options)\n end", "title": "" }, { "docid": "88c5d60ceb82231048fce91c34f46f82", "score": "0.69965976", "text": "def get_repos\n @api.list_repos...
a6527a2ee7f77ed7a93a4b65ae76ef25
Obtain an InputSet object, used to define inputs for an execution of this Choreo.
[ { "docid": "fd5c2e66bdd9634e31c5df3b3ca29401", "score": "0.0", "text": "def new_input_set()\n return GetListInputSet.new()\n end", "title": "" } ]
[ { "docid": "d8eb34cfc5a1e737977f7023d4849c46", "score": "0.67422473", "text": "def new_input_set()\n return CreateObjectInputSet.new()\n end", "title": "" }, { "docid": "7c0d7c433cd4eb8e36bdc3a383e9ec33", "score": "0.6581416", "text": "def new_input_set()\n return Ru...
a2ebe5514622bb10128ac5e45f23af30
dump information to stdout as an aid to debugging.
[ { "docid": "6f5bbfb37d660e32c70fffc233204cbc", "score": "0.71087784", "text": "def dump(data=nil)\n str = \"#{Time.now} --------------------------------------------\\n\"\n str << \"#{$!}\"\n str << \"\\n\"\n str << \"#{$@}\"\n str << \"\\n\"\n str << \"~~~~~~~~...
[ { "docid": "72f481aa994e9e06e7118f32ab9137dd", "score": "0.746248", "text": "def print_debug_info\n puts \n puts \"==== DEBUG INFORMATION ====\".cyan.bold\n puts \"Stack:\".cyan.bold\n print @stack.join(Scratch::STACK_DELIMITER.blue)\n puts\n puts \"Dict:\".cyan.bold\n ...
b766e0f0f752f668502af5a460540bb8
PUT /customer_feedbacks/1 PUT /customer_feedbacks/1.json
[ { "docid": "d26418d02f97b9d83c4afa5114e890b6", "score": "0.73947686", "text": "def update\n @customer_feedback = CustomerFeedback.find(params[:id])\n\n respond_to do |format|\n if @customer_feedback.update_attributes(params[:customer_feedback])\n format.html { redirect_to @customer_fee...
[ { "docid": "c6f0d141532aa0ab144fffb5d6d26fc3", "score": "0.6673291", "text": "def update\n respond_to do |format|\n if @feedback.update(feedback_params)\n format.html { redirect_to [@user, @service, @feedback], notice: 'Feedback was successfully updated.' }\n format.json { render :...
7599ddc923487b584f7955fd86dd9ccf
Since this is a complexType defined by a sequence, the members of that sequence can be accessed through the following getters and setters. They invoke the corresponding method on the _sequence object, so the user doesn't have to interact with the underlying _sequence at all. Gets the child annotation element. An array ...
[ { "docid": "45e9a91fe6a5ca0eaa11843c81fd9748", "score": "0.6800832", "text": "def annotation; @_sequence.annotation end", "title": "" } ]
[ { "docid": "ed7ba581c543b823a20b5d283a577884", "score": "0.6299546", "text": "def annotations\n structure[:annotations]\n end", "title": "" }, { "docid": "6a1228633021b34e9d66f3f1efa04282", "score": "0.5921613", "text": "def output_accessor_complexType_sequence(seq)\n\n puts...
2058fd405a814ad48d4abee549daef87
DELETE /gynecologic_examinations/1 DELETE /gynecologic_examinations/1.json
[ { "docid": "e744bbfde407eca82c8933ad75e5002c", "score": "0.76978403", "text": "def destroy\n @gyn_exam = GynecologicExamination.find(params[:id])\n @gyn_exam.destroy\n\n respond_to do |format|\n format.html { redirect_to gynecologic_examinations_path }\n format.json { head :no_content...
[ { "docid": "df7611170337c8ed0e85e9697b96cbbf", "score": "0.7502937", "text": "def destroy\n @examination = Examination.find(params[:id])\n @examination.destroy\n\n respond_to do |format|\n format.html { redirect_to examinations_url }\n format.json { head :ok }\n end\n end", "t...
cec1328943c8ebc06172d93ea9a0d44d
Close the logging device.
[ { "docid": "4f6cd66626f1a0cad44000055c676681", "score": "0.81379324", "text": "def close\n @logdev.close if @logdev\n end", "title": "" } ]
[ { "docid": "3f4277048ca299f29f3f4088814fa314", "score": "0.81122386", "text": "def close\n @logdev.close if @logdev\n end", "title": "" }, { "docid": "f0eab71a6576081adbe3c511aa663c93", "score": "0.7884688", "text": "def close\n @logdevs.each do |name, ld|\n ld[:dev].clos...
bc9a7ec799d92f648ee790ef9b486de4
Designed for testing. Emits a string like "7(1), 11(3), 11(4), 10(6)".
[ { "docid": "9060bc91bbdd88a3c332753dae18b364", "score": "0.0", "text": "def lessons_export_string(day_of_cycle)\n validate(day_of_cycle)\n @days[day_of_cycle - 1].lessons_export_string\n end", "title": "" } ]
[ { "docid": "033086e38e69cf5cdb342d75161ed0a6", "score": "0.6639445", "text": "def to_s\n\t\tstring = \"(\"\n\t\taux = @head\n\t\twhile(aux != nil) do\n\t\t\tstring += \"#{aux.to_s}\"\n\t\t\t@aux = @aux.next\n\t\tend\t\n\t\tstring += \")\"\n\t\treturn string\n\tend", "title": "" }, { "docid":...
e4d3d347b898083e92681848a438d1a9
jimmy data out of the cell pointer array
[ { "docid": "020430b49172972facf6692cd1d74dd4", "score": "0.0", "text": "def parse_cells(count)\n cells = []\n 1.upto(count) do |x|\n cells << @file.read(2).unpack('n')[0]\n end\n return cells\n end", "title": "" } ]
[ { "docid": "6db8a38061bcf7c405efe9426985cec0", "score": "0.6190085", "text": "def read_array x, y\n cell = [x,y]\n @read_cells.push cell\n # x and y are switched here because of how the blob array is structured\n return @blob[y][x]\n end", "title": "" }, { "docid": "386e0b3fefc0...
e6d0de4074417403b120fa74aff9eff6
GET /expensescounters GET /expensescounters.json
[ { "docid": "ac46d260c765c5e3d6fdcf984a0a4614", "score": "0.73759365", "text": "def index\n @expensescounters = Expensescounter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expensescounters }\n end\n end", "title": "" } ]
[ { "docid": "c7bd3b0d51d666c1c3bc77040cd9917d", "score": "0.64081645", "text": "def expenses\n @expenses ||= Harvest::API::Expenses.new(credentials)\n end", "title": "" }, { "docid": "9ad67b2f07257a138ea96c31a94cfda0", "score": "0.6294123", "text": "def index\n @expenses = ...