query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
a7cfb409e79de5390797b4820b9e59ff
Renvoie le coup de l'IA
[ { "docid": "81765e74a201aaf10ff83961686f58e5", "score": "0.0", "text": "def play( g )\n minMove = {\"x\" => 0, \"y\" => 0}\n minNote = 10000\n for x in (0 .. 2) do\n for y in (0 .. 2) do\n ...
[ { "docid": "00213cbe56e0b3ff866af82b54dd7fba", "score": "0.66452175", "text": "def get_cout_ha\n self.dosage * self.produit.get_prix_unitaire\n end", "title": "" }, { "docid": "c25cc0d861e2906e12c191015fb5070d", "score": "0.64078707", "text": "def cicloInactiva\n productoA...
a7de7cbc176fe7981c99c0ceaaf02366
GET /factory_input_prices/1 GET /factory_input_prices/1.xml
[ { "docid": "92dc1f3625a632b687a01e8705ed58b0", "score": "0.7038948", "text": "def show\n @factory_input_price = FactoryInputPrice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @factory_input_price }\n end\n end", "title"...
[ { "docid": "482b3a0546bf073799f88ef94604989b", "score": "0.6942686", "text": "def new\n @factory_input_price = FactoryInputPrice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @factory_input_price }\n end\n end", "title": "" }, { ...
184b3d40b09d623cefa8beec2faa757a
DELETE /enquiries/1 DELETE /enquiries/1.json
[ { "docid": "42d5f154774ef69d7698c893c5aee050", "score": "0.68037486", "text": "def destroy\n @enquiry.destroy\n respond_to do |format|\n format.html { redirect_to enquiries_url, notice: 'Enquiry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "titl...
[ { "docid": "29658a91d3988d8346ed6f6e2d1f1ad9", "score": "0.73576105", "text": "def destroy\n @enquiry = Enquiry.find(params[:id])\n @enquiry.destroy\n\n respond_to do |format|\n format.html { redirect_to enquiries_url }\n format.json { head :no_content }\n end\n end", "title":...
5e84221e963afd178a1365f4b0a6a087
Getting rule_set(s) for the role
[ { "docid": "856a435c1fa083d1936f7d71df932bde", "score": "0.77860314", "text": "def rule_set\n self.class.roles_n_privileges_hash[\"role_#{@role_name}\".to_sym]\n end", "title": "" } ]
[ { "docid": "cc4fe0b649c62749cb3031757e14615c", "score": "0.7249135", "text": "def rulesets\n system.rulesets\n end", "title": "" }, { "docid": "4b98a36da9403be64853e3cf01e9972f", "score": "0.6714195", "text": "def list_rulesets(inspector)\n inspector.describe_rules_packages(...
c22d76ee5ced280195c10e7febdac9dd
if calling loop separately better to call this, since it will shut off ncurses and print error on screen. UNUSED
[ { "docid": "c0853c86244fca3f2cb228aceadc10a4", "score": "0.6146199", "text": "def safe_loop &block\n begin\n loop &block\n rescue => ex\n $log.debug( \"APP.rb rescue reached \")\n $log.debug( ex) if ex\n $log.debug(ex.backtrace.join(\"\\n\")) if ex\n ensure\n ...
[ { "docid": "13feb8bbc99412d8208ee86d91c577ec", "score": "0.7480541", "text": "def stop_ncurses\n Ncurses.echo\n Ncurses.nocbreak\n Ncurses.nl\n Ncurses.endwin\n $ncurses_started = false\n puts \"ncurses stopped\"\n ensure\n return unless error = @last_error\n log = Config[:logfi...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "785fec7ad7bcfc4930706bda504130dc", "score": "0.0", "text": "def set_goal\n @goal = Goal.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;...
b46072e0450a92c8b958fe9c7e1285f5
my solution is not recursive
[ { "docid": "af397122890c63f4827d30deb5cef231", "score": "0.0", "text": "def insert(value)\n new_node = BSTNode.new(value)\n return @root = new_node if @root.nil?\n current = @root\n until ((value > current.value && current.right.nil?) || \n (value < current.value && current.left.nil...
[ { "docid": "08de766c3aa9ce01608aa15f9aa2c871", "score": "0.7990716", "text": "def recursive; end", "title": "" }, { "docid": "08de766c3aa9ce01608aa15f9aa2c871", "score": "0.7990716", "text": "def recursive; end", "title": "" }, { "docid": "115f0358715636a4e7b59a4d1f6a4784...
6ac2d9ed61842b660a781ea0b30cc72e
Used only by ack module at the moment
[ { "docid": "28b17e8940da94b36c46d941c175c9ff", "score": "0.0", "text": "def get_content_search_paths()\n r = @file_content_search_paths.clone\n p = find_project_dir_of_cur_buffer()\n if p.nil?\n p = vma.buffers.last_dir\n end\n\n if p and !@file_content_search_paths.include?(p)\n ...
[ { "docid": "dc2a55d1115a0dd499e8603c6d188e8b", "score": "0.7056936", "text": "def ack(msg_info)\n end", "title": "" }, { "docid": "1b16d964fba53362f48d939eb7b05657", "score": "0.6973185", "text": "def acked?; all_status?(:ack); end", "title": "" }, { "docid": "7e5964e9...
81342c2a5eed52373c72d52c2b846601
Creates the duplicants for the given field instance
[ { "docid": "fe1cb4e0682dd9aa81093ed20d0a030c", "score": "0.80383945", "text": "def create_duplicates!(instance)\n\t\t\tset_duplicants_values!(instance,true) # true for creating duplicates\n\t\t\t@duplicated_fieldlets.each{|f| f.save}\n\t\tend", "title": "" } ]
[ { "docid": "83e519e6d1ee168ea4ba7c2791ea2ad4", "score": "0.7186975", "text": "def set_duplicants_values!(instance_id, force_create = false)\n\t\t\t@duplicated_fieldlets = []\n\t\t\t\n\t\t\tfieldlets = self.all_fieldlets\n\t\t\ttarget_fieldlet_ids = self.duplicants_fieldlet_ids\n\n\t\t\tif target_fieldle...
d6a45043be159531ea2afc0215726980
Do not generate a session or session ID cookie See
[ { "docid": "7a15e8cf9a6a6dd109d426a3c545ad6b", "score": "0.73231524", "text": "def do_not_set_cookie\n request.session_options[:skip] = true\n end", "title": "" } ]
[ { "docid": "f4c39a62cc358cdb2fea2c4a9f2dd61c", "score": "0.73443776", "text": "def regenerate \n \t @session_id = Merb::SessionMixin::rand_uuid \n \t self.needs_new_cookie=true \n \tend", "title": "" }, { "docid": "186332ae80734f5bc1826f9500562b34", "score": "0.7208265", "tex...
214bc76309abd2df7a7d7c0deaa9d944
Finds which noun and verb will produce given output with given memory state
[ { "docid": "ede7f9485bfac0f17f90a58116a16474", "score": "0.66534835", "text": "def find_input(memory, output)\n success = false\n new_memory = []\n\n 100.times do |noun|\n 100.times do |verb|\n new_memory = memory.dup\n new_memory[1] = noun\n new_memory[2] = verb\n\n success = ...
[ { "docid": "01d5fa387f15e7de459b90354beaf069", "score": "0.62643737", "text": "def find_answer(noun, verb, state)\n data = @intcode.dup\n data[1] = noun\n data[2] = verb\n data = parse_intcode(data, 0)\n if data[0] == 19690720\n noun = noun\n verb = verb\n return 100 * noun...
9845ef66fa818990c3eb370018777de5
Called after an individual handler has run
[ { "docid": "b08da84628cfe5da0322541f89263059", "score": "0.76865137", "text": "def handler_executed(handler); end", "title": "" } ]
[ { "docid": "7fda7b38130ce684396ffd86e7839bc8", "score": "0.7578737", "text": "def handler_executed(handler)\n end", "title": "" }, { "docid": "1acf7ba0d422e1b033870d9f7e1510d4", "score": "0.75074893", "text": "def handlers_completed; end", "title": "" }, { "docid": "...
ef1d7d8097b746f3a6ae3e817ffbd666
Returns all rolles. Returns empty array if no roles exist.
[ { "docid": "c7b8a632cf8523000927669e6e73bc8c", "score": "0.68123215", "text": "def roles\n system_roles | rolez.map{ |role| role.name }\n end", "title": "" } ]
[ { "docid": "dfab255d99499ec4df74592d553f134e", "score": "0.7985167", "text": "def get_all_roles\n _get('roles', ApiRole, true)\n end", "title": "" }, { "docid": "b1488076b55bdd6671861bc6a152d4f2", "score": "0.7550588", "text": "def get_roles\n @roles = Rol.order(:n...
4bf829d8f683940b31310dca2ef3ec6f
Automatically download from the source if it's a URL.
[ { "docid": "cfb63e2d398899afca77bf9bab0a11ba", "score": "0.60495293", "text": "def download_source\n self.source = \"\" if source.nil?\n \n return if source !~ /^http:\\/\\// || !file_ext.blank?\n\n ##################################################################\n # below are t...
[ { "docid": "7ecfec2ba03202ee4764c73dd5a190ae", "score": "0.7362041", "text": "def download!(source)\n result = download(source)\n raise DownloadFailure, result.message if result.failed?\n \n result\n end", "title": "" }, { "docid": "1b54861b8b52afeae3005263556ebba8", ...
01af54658b43e2ebf1eb10c1a31a2eaf
POST /permisos POST /permisos.json
[ { "docid": "5c9dd9ca1b5fc53ef385b42f168e43d4", "score": "0.0", "text": "def create\n nuevasFuncionalidades = params[:funcionalidad_id]\n funcionalidadesModelo = []\n codigos_func = \"\"\n #funcionalidadesEliminar=[]\n perfil = params[:perfil]\n @perfil = Perfil.find(perfil[:id])\n \...
[ { "docid": "1ae5faa393f99375be00669dfdde4439", "score": "0.59281844", "text": "def create\n @perfil = Perfil.find(params[:perfil_id])\n @perfil_permiso = @perfil.perfiles_permisos.create(params[:perfil_permiso])\n\n respond_to do |format|\n if @perfil_permiso.save\n format.html { re...
a4146591a90198ff4338a7264c95d468
GET /memos/1 GET /memos/1.json
[ { "docid": "a66d2efcd79ecfb08edd8f45429c0e64", "score": "0.6106932", "text": "def show\n @memo = Memo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @memo }\n end\n end", "title": "" } ]
[ { "docid": "1289e9b743b0aee020253445bd3fb3d7", "score": "0.66538996", "text": "def index\n if params[:user_id] != nil\n @memos = Memo.where(:user_id => current_user.id)\n else\n @memos = Memo.all\n end\n \n \n\n respond_to do |format|\n format.html # index.html.erb\n...
fc6ccf33b2b8e11ceda18dd9d1ed976b
Determine if two bodies are in contact.
[ { "docid": "9c64e09a7d1b9f9ed4d84f8358444874", "score": "0.6881973", "text": "def bodies_touching?(body1, body2)\n validate2(body1, body2)\n MSPhysics::Newton::Bodies.touching?(body1.get_address, body2.get_address)\n end", "title": "" } ]
[ { "docid": "2821aaf065f33fe7a9ffa03213b9845e", "score": "0.7070166", "text": "def bodies_collidable?(body1, body2)\n validate2(body1, body2)\n MSPhysics::Newton::Bodies.collidable?(body1.get_address, body2.get_address)\n end", "title": "" }, { "docid": "e8766c84b0a03982f7c...
f86d7eebb894eebdd3dbb70c57b65fc7
PUT /messages/1 PUT /messages/1.xml
[ { "docid": "92dde335f270ae3c4f4d3ceaa8026b9d", "score": "0.0", "text": "def update\n\n\tend", "title": "" } ]
[ { "docid": "324fee270b220c23ae2d8c9e0089ec1d", "score": "0.6548088", "text": "def update\n @v1_message = V1::Message.find(params[:id])\n\n if @v1_message.update(message_params)\n render json: @v1_message, status: :ok\n else\n render json: @v1_message.errors, status: :unprocessable_ent...
6a5da7f7a2ac5eb38baa2764de1912d3
Opening/Reading files Open the file (default: readonly + binary mode)
[ { "docid": "67392a49a694c3f9c931d55e74d99dbf", "score": "0.6909421", "text": "def open(mode=\"rb\", &block)\n if block_given?\n File.open(path, mode, &block)\n else\n File.open(path, mode)\n end\n end", "title": "" } ]
[ { "docid": "07543aea5eb7b0b7c533693d751422f0", "score": "0.749671", "text": "def open_file(path)\n File.open(path, 'ab+')\n File.open(path, 'r+')\n end", "title": "" }, { "docid": "251bfe21d85eb34c76897968b86471a1", "score": "0.74914306", "text": "def open0(mode)\r\n File.o...
ce86eed889efd605f9f1d3ee4a5d480c
GET /items/1 GET /items/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "41699dd17c12d7e8d1afd1406f087302", "score": "0.80987954", "text": "def item(id)\n get(\"/item/#{id}.json\")\n end", "title": "" }, { "docid": "eb354ffc8205e277e16c339add996ccd", "score": "0.74948645", "text": "def show\n item = Item.find(params[:id])\n render js...
a68f479e5d427738d0655cac3d46fb2e
Bounced DiagnosticCode: diagnostic code created by postfix. Example: mail.bounced_diagnostic_code > smtp; 550 sorry, mail to that recipient is not accepted (5.7.1):
[ { "docid": "0dafc81a30d70d0fcea690dbd08ebd3e", "score": "0.6905246", "text": "def parse_diagnostic_code\n result = `grep -A1 \"Diagnostic-Code\" #{self.full_pathname}`.split(\"\\n\")\n a1 = result[0].to_s.gsub(\"Diagnostic-Code: smtp;\",\"\")\n a2 = result[1].to_s.lstrip\n bounced_diagnostic...
[ { "docid": "2a6e643f452273bb035488c76b8b7b53", "score": "0.592373", "text": "def test_malformed_bounce\n bounce = test_bounce('malformed_bounce_01')\n assert_equal '5.1.1', bounce.code\n end", "title": "" }, { "docid": "d62ad0997722a36eb90eda7fa5db74c3", "score": "0.58445215", ...
95afa442c9d9cbd86e8511594d47e79e
run code returns I DON"T KNOW HOW TO SHOW THIS RETURNS A BOOLEAN current_year vampire_age vampire_year_birth p age_checker
[ { "docid": "19a42be83cc2592642ab8bfa3bd7cac1", "score": "0.0", "text": "def garlic_bread_checker\n if @garlicbread_request == 'yes'\n @garlic_bread_answer = true\n else\n @garlic_bread_answer = false\n end\nend", "title": "" } ]
[ { "docid": "aaded835612bbd3715a60e3794f194d1", "score": "0.77755517", "text": "def age_checker\n if ((@year - @age) == @birth_year)\n true\n else\n false\n end\nend", "title": "" }, { "docid": "a0dae28fcb54e733003923c6024e712d", "score": "0.7421957", "text": "def check_age(a...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "4e8fd3cdfff6ac8a292e0ed5afc98843", "score": "0.0", "text": "def set_clinical_allergy\n @clinical_allergy = ClinicalAllergy.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310465", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60152966", "text": "d...
682bc3dd1c236d4064e318fbf42bc6c5
Removes items from a cart (modifies the caller!)
[ { "docid": "1dcdb8fb86a7c34df4e0ba13e53d3887", "score": "0.7235431", "text": "def remove!(product_ids)\n\t\t\tcart = Cart.perform_request Cart.api_url(\"carts/#{self.id}\", {}), :patch,\n\t\t\t\t{ op: \"remove\",\n\t\t\t\t\titems: product_ids }, true\n\n\t\t\tif cart\n\t\t\t\tself.items = cart[\"data\"]...
[ { "docid": "e7a2926d62f4965d4914d75bf74f192b", "score": "0.83556753", "text": "def remove_items_from_cart\n line_items.each { |i| i.cart = nil }\n end", "title": "" }, { "docid": "878e23375cb115e099ade187133f8dcf", "score": "0.8280585", "text": "def remove_items\n system '...
4afcc93e192c2be7ddb2642e86318ecb
Delete a repository. This endpoint let user delete a repository with name.
[ { "docid": "c15bfaf16c44cbdbeeebe77d8e0903b4", "score": "0.7166701", "text": "def repositories_repo_name_delete(repo_name, opts = {})\n repositories_repo_name_delete_with_http_info(repo_name, opts)\n nil\n end", "title": "" } ]
[ { "docid": "dbeb1e0626ac333787f0d96b5a17f733", "score": "0.80340713", "text": "def delete_repo(r)\n client.delete_repository(r)\n end", "title": "" }, { "docid": "fbcbc955012b2e14b59b4fc600d31fe0", "score": "0.7949266", "text": "def destroy\n @repository = Repository.f...
913d9a7d747fadedbd10f00208c17d4d
builds a list of tags for the tag archive
[ { "docid": "90dd67bec51d4b4b0fd494bc5b0b71f8", "score": "0.8391327", "text": "def build_tag_archive_list(tags)\n build_tag_block(tags, '')\n end", "title": "" } ]
[ { "docid": "afa6faa8fb3b4bf99bf14e159e49a471", "score": "0.71559465", "text": "def build_tags(tags)\n JSON.parse(tags).each { |a| self.tag_list.add(a['text']) }\n end", "title": "" }, { "docid": "94d61373332862ec94bb94964261d7b4", "score": "0.6849085", "text": "def build_tags\n ...
adfc060923e4f9746d2b5415417d4e6c
Calculates the total number of messages
[ { "docid": "edfc51600ad430c93fd8172f9d31f2db", "score": "0.0", "text": "def calculate_total\n self.total = self.parts * self.recipients\n end", "title": "" } ]
[ { "docid": "6d114fd8ee1043c9424b59b3f3279cad", "score": "0.8076692", "text": "def countMessages\n total = 0\n ary = getHpks\n ary.each do |hpk|\n mbx = Mailbox.new hpk\n count = mbx.count\n total += count\n end\n total_redis = rds.get(@config[:total_number_of_messages])\n ...
1594864bb16850fada0f972b3e4e20f6
INPUT => type OUTPUT => mime
[ { "docid": "aa412b2b18cc78a7c641c10861c88ffc", "score": "0.0", "text": "def map_type_to_mime(type)\n case type\n when \"photo\"\n return AppConstants.mime_remote_image\n when \"video\"\n return AppConstants.mime_remote_video\n when \"mu...
[ { "docid": "7d5822f5d88cb5e4d284a5d706cf28f9", "score": "0.79837596", "text": "def mime_type; end", "title": "" }, { "docid": "7d5822f5d88cb5e4d284a5d706cf28f9", "score": "0.79837596", "text": "def mime_type; end", "title": "" }, { "docid": "7d5822f5d88cb5e4d284a5d706cf28...
7b9372a388594f0d72110c2ba6fc76ce
Remove a label from an issue
[ { "docid": "657e9b3399826c13fe55fd6d4133614c", "score": "0.8030119", "text": "def remove_issue_label(repo, issue_number, name, options = {})\n delete \"#{Repository.path repo}/issues/#{issue_number}/labels/#{name}\", options\n end", "title": "" } ]
[ { "docid": "1e00d62259c95411cae4913a0b36eca4", "score": "0.8199152", "text": "def unlabel_issue(label)\n github_client.remove_label(context.repo, context.issue_id, label)\n end", "title": "" }, { "docid": "2286f8e235c8dee61fbac8a6fe667f48", "score": "0.7991107", "text": "def remo...
b0aa36c770dc450d6670a1eae2b4044a
GET /solicitudes_servicios/1 GET /solicitudes_servicios/1.json
[ { "docid": "78927913061330a38ae687982d3a6a74", "score": "0.7166931", "text": "def show\n @solicitud_servicio = SolicitudServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @solicitud_servicio }\n end\n end", "title": ""...
[ { "docid": "3010a154b10579344eeff0b55490ae66", "score": "0.6597588", "text": "def new\n @solicitud_servicio = SolicitudServicio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @solicitud_servicio }\n end\n end", "title": "" }, { "d...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "876cda77d785c2b57f70521955a48a08", "score": "0.0", "text": "def foto_produto_params\n params.require(:foto_produto).permit(:imagem, :dataVencimento)\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...
1094d95462f6219b40942e10c70dc6a0
Gets the threads property value. A collection of all the conversation threads in the conversation. A navigation property. Readonly. Nullable.
[ { "docid": "1a47a99a9486270544526d9c3962f6fe", "score": "0.7101332", "text": "def threads\n return @threads\n end", "title": "" } ]
[ { "docid": "da011f156cbfa220a5a1862f9c646f55", "score": "0.709023", "text": "def threads\n @threads ||= retrieve_threads\n end", "title": "" }, { "docid": "b8ab2683453b2a156bc91c020e8ba080", "score": "0.6830766", "text": "def threads\n\n Thread.list.select { |t| t[thread...
e66f7356b8c0e6fe2cae8f5358d083bb
does task type meet submit requirements
[ { "docid": "cb03b455ec235b789308143b37da250e", "score": "0.6504352", "text": "def ready_to_submit?\n # add other criteria over time\n ready_to_submit = needs_responses?\n\n ready_to_submit\n end", "title": "" } ]
[ { "docid": "c8ee73be341314e60935708bbfae5f6f", "score": "0.67996305", "text": "def validate_task_request?(task_object)\n #if the task object doesnt exist or the episode hasn't been released yet\n if task_object.nil? || (task_object.episode.start_time > Time.zone.now && !headstart_has_begun?(task_...
40a3e4059486dab6ea0ae2e5210e57e8
Puma creates the plugin when encountering `plugin` in the config.
[ { "docid": "4462500b2d6c0a0c97ae5b177d4a83ba", "score": "0.59622294", "text": "def initialize(loader)\n # This is a Puma::PluginLoader\n @loader = loader\n end", "title": "" } ]
[ { "docid": "98251c2bd40568685b025ee0253073b2", "score": "0.61769295", "text": "def register_plugin(plugin)\n @plugins << plugin.new\n end", "title": "" }, { "docid": "7e4e6785096653ed84948daaf59821bc", "score": "0.61429155", "text": "def create\n @concerto_plugin = ConcertoPlu...
859f2ff910d99a612650695bf9eaa20d
GET /abastecimentos GET /abastecimentos.json
[ { "docid": "bb1ef76682f0ee76a74b2ea377571aaf", "score": "0.0", "text": "def index\n @veiculos = Veiculo.where(usuario_id: current_usuario)\n @abastecimentos = Abastecimento.where(:veiculo_id => @veiculos)\n end", "title": "" } ]
[ { "docid": "795bdb10ccc0ba72ac9ce844efafbc6d", "score": "0.70883393", "text": "def index\n @anuncios = Anuncio.all\n render json: @anuncios, status: :ok\n end", "title": "" }, { "docid": "c0866dddd93bf4580f20675ca79d2817", "score": "0.67758954", "text": "def index\n @ativo_...
ab580befcfb6a6599db3ecbfa63e5fd1
Sets the attribute tmp_files
[ { "docid": "f91cb96b42e78d3768f9da0c71a589db", "score": "0.828594", "text": "def tmp_files=(_); end", "title": "" } ]
[ { "docid": "4d3ccc9c24fd03df8e9288c55a9e9bcd", "score": "0.7347403", "text": "def tmp_files; end", "title": "" }, { "docid": "4d3ccc9c24fd03df8e9288c55a9e9bcd", "score": "0.7347403", "text": "def tmp_files; end", "title": "" }, { "docid": "4d3ccc9c24fd03df8e9288c55a9e9bcd...
54478ad637afc5cfb9db19f117db8104
Simple case insensitive matching.
[ { "docid": "2795c5e6734caf6a047fc0ae587ba963", "score": "0.0", "text": "def search_labels(terms)\n regex = Regexp.new(terms, true)\n by_label.select {|label, _| label.match(regex) }.values.flatten.uniq\n end", "title": "" } ]
[ { "docid": "4e7d5ca4e2d19b896432ba02e52ea4dc", "score": "0.86972415", "text": "def case_insensitive_match; end", "title": "" }, { "docid": "d12af63f85cba047eb253d793c303f49", "score": "0.8382639", "text": "def case_insensitive_match=(_arg0); end", "title": "" }, { "docid"...
91c18fb4be2546a18ae3f435b169c1a9
Requests all tickets Returns all free tickets from the semaphore
[ { "docid": "b476540f146323ef47760867c20dc8ef", "score": "0.0", "text": "def drain\n raise NotImplementedError\n end", "title": "" } ]
[ { "docid": "9f126986e95f0458d0d201bc768719de", "score": "0.6264455", "text": "def index\n # @open_tickets are tickets not assgined to any agent\n # @ip_tickets are in progress tickets\n # @closed_tickets are closed tickets to show in history\n @ip_tickets, @closed_tickets, @open_tickets = cu...
b30524b2b04256053b66cb898c0a04d9
Returns a random token.
[ { "docid": "5dfdfb80ca53f2b5e7280b2b04122bbe", "score": "0.0", "text": "def new_token\n SecureRandom.urlsafe_base64\n end", "title": "" } ]
[ { "docid": "e94c754e7cb05e18572d244168bd16f1", "score": "0.8507489", "text": "def random_token\n rand(36**11).to_s(36).upcase[0,6]\n end", "title": "" }, { "docid": "abc2b2e068eb56448a592733b89781b8", "score": "0.83457845", "text": "def random_token\n rand(36**8).to_s(36)\n e...
9889060171919426c0a1281481462279
Delete a video caption.
[ { "docid": "e6021c99915a327fb868dc0104525573", "score": "0.6712647", "text": "def delete\n\t\t\tjson = delete_request({:caption_key => @key})\n\t\t\tres = JSON.parse(json.body)\n\n\t\t\tif json.status == 200\n\t\t\t\tprocess_delete_response(res)\n\t\t\telse\n\t\t\t\traise \"HTTP Error #{json.status}: #{...
[ { "docid": "944d7c3097114cc4832dd66fb9e2559d", "score": "0.7156343", "text": "def destroy\n @caption = @medium.captions.find(params[:id])\n @caption.destroy\n\n respond_to do |format|\n format.html { redirect_to edit_medium_url(@medium) }\n format.xml { head :ok }\n end\n end", ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "deb5354bfd590d285e2a3d1dae12e6f9", "score": "0.0", "text": "def list_params\n params.require(:list).permit(:id, :title, :address, :city, :zipcode, :country, :price, :bedrooms, :details, :agentName, :agencyName, :phone, :email, :geo_location, :bathrooms, :category, :region)\n end", ...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496729", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958585", "text": "def strong_params\n params.require(:request).permit(param_white...
c6e6a618c43a17e982e403a20c97eab4
GET /posts GET /posts.json GET /posts/1 GET /posts/1.json
[ { "docid": "0f4d692d1d4674355b4ae5e61a48b0e2", "score": "0.0", "text": "def show\n render :show\n end", "title": "" } ]
[ { "docid": "915c0178f9e4347098d8a463c2cbe6b0", "score": "0.7474359", "text": "def show\n @posts = Post.find(params[:id])\n render json: @posts\n end", "title": "" }, { "docid": "b230d81461fa965aa542c3777928c608", "score": "0.709429", "text": "def index\n @posts = Post.pagin...
380e249ccfcd23dc5e7c52791c0a33b8
PATCH/PUT /places/1 PATCH/PUT /places/1.json
[ { "docid": "57e39a9a4664ce9ac6dc9e3f07aea7b3", "score": "0.6709586", "text": "def update\n respond_to do |format|\n if @place.update(place_params)\n format.html { redirect_to @place, notice: 'Place was successfully updated.' }\n format.json { render :show, status: :ok, location: @p...
[ { "docid": "d15bfb950d010a38fc3c1397b5665cc6", "score": "0.7153285", "text": "def update\n place = Place.find(params[:id])\n\n if place.update_attributes(params[:place])\n head :no_content\n else\n render json: place.errors, status: :unprocessable_entity\n end\n end", "title":...
fc4ae384a9ea7421a9e6aa1d71cd4525
Returns +true+ iff the current severity level allows for the printing of +ERROR+ messages.
[ { "docid": "aa09ece133590fd4e4135943ddd530f4", "score": "0.6370038", "text": "def error?; @level <= ERROR; end", "title": "" } ]
[ { "docid": "a0f7fe5cf974ecc9de9ec226e788d0d7", "score": "0.77748394", "text": "def error?\n severity == \"ERROR\"\n end", "title": "" }, { "docid": "c0f83023d1dd3c93b0d46347700a332f", "score": "0.7617366", "text": "def error?\n level <= ERROR\n end", "title": ...
746c76ee30aef66c1ba34a804f494aa5
Interleaves all given :to_ary's so that the nth element of each Array is inserted into the nth subarray of the returned Array. If a block is provided, then each subarray is passed to it instead. The maximum number of subarrays and therefore elements used is the size of self. Missing indices are filled in with nils and ...
[ { "docid": "e210d63fb64eb1163fecb64162a4b0b7", "score": "0.48948634", "text": "def zip(*others)\n out = Array.new(size) { [] }\n others = others.map { |ary| ary.to_a }\n\n size.times do |i|\n slot = out.at(i)\n slot << @tuple.at(@start + i)\n others.each { |ary| slot << ary.at(i)...
[ { "docid": "69271ad2bbf8126e856c6e806a31fb0b", "score": "0.5582503", "text": "def multi_array(ary, counter = 0, original_array)\n return ary if counter >= Math.log(original_array.length, 2).to_f.ceil\n ary = compile_array(ary, n = 0, final_array = Array.new)\n counter += 1\n \n multi_array(ary, cou...
f7e7bd4203d68ad398e39322b414304e
POST /ejemplares POST /ejemplares.json
[ { "docid": "388390a3c754aff83dec1810791871b8", "score": "0.6264312", "text": "def create\n @ejemplar = Ejemplar.new(params[:ejemplar])\n\t\n respond_to do |format|\n if @ejemplar.save\n\t\tguardar_log(session[:usuario_id], self.class.name,__method__.to_s, @ejemplar,nil )\n format.html ...
[ { "docid": "1311b7632604fd7a2e2cd53f54a58bf5", "score": "0.712409", "text": "def create\n @establecimiento = Establecimiento.new(establecimiento_params)\n\n if @establecimiento.save\n render json: @establecimiento, status: :created, location: @establecimiento\n else\n render json: @es...
287f24366f0ebe5db79603209964477f
GET /projects GET /projects.xml
[ { "docid": "3db51369f2643ba95257955f73eb9366", "score": "0.0", "text": "def index\n @projects = Project.order(\"name\")\n #render :layout => false\n end", "title": "" } ]
[ { "docid": "dc8505687156cb859adc07f1e0435407", "score": "0.8242623", "text": "def projects\n return get(\"/projects/list\")\n end", "title": "" }, { "docid": "d0b43a945df8ac3143faff08578a6c1d", "score": "0.79247147", "text": "def projects\n get_request 'projects'\n end", ...
a0ace8f311686170bb49c23194e61524
Confirms an admin user.
[ { "docid": "194c60c46d88110af54648c81a83996f", "score": "0.0", "text": "def admin_user\n users_controller = UsersController.new\n users_controller.request = request\n users_controller.response = response\n users_controller.admin_user\n end", "title": "" } ]
[ { "docid": "4f5a8891ce120504a8cc7c741bd446cd", "score": "0.7966088", "text": "def confirm_admin\n @user = current_user\n if !@user.admin\n flash[:alert] = \"You do not have access to this resource since you are not an administrator\"\n redirect_to root_path\n end\n end", "title":...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "36b548f9066d5a817ef872c8e8c74397", "score": "0.0", "text": "def menu_params\n params.require(:menu).permit(:serving_date,\n breakfast_choices: [],\n lunch_choices: [],\n supper_choices: [])\n ...
[ { "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"...
8e392331fa98b09736e2101eb70bc978
POST /ouro_preto/cadastros POST /ouro_preto/cadastros.json
[ { "docid": "b397919f11ab9ba11303a8d2fc3bc8ff", "score": "0.0", "text": "def create\n @ouro_preto_cadastro = OuroPreto::Cadastro.new(ouro_preto_cadastro_params)\n\n respond_to do |format|\n if @ouro_preto_cadastro.save\n SuperarMailer.notificacao(@ouro_preto_cadastro).deliver!\n ...
[ { "docid": "a46ce85ceacc5503013993651513a864", "score": "0.6821156", "text": "def create\n currency_to_number params[:os][:desconto]\n currency_to_number params[:os][:pagamentos_attributes][\"0\"][:valor]\n\n params[:os][:pagamentos_attributes][\"0\"][:cliente_id] = params[:os][:cliente_i...
8778a0efdb11f985245865f5c71d1720
record that field_name has changed in a change_type (:add, :remove) way with change_id (the id that was :add or :remove)
[ { "docid": "09d80a3ca0143994f14361cfb4d8c89d", "score": "0.7691471", "text": "def record_relationship_change(field_name, change_type, change_id)\n\t\t\t\t\tself.changed_attributes_aado ||= []\n\t\t\t\t\tif change_type == :add then\n\t\t\t\t\t\tlast_change = self.changed_attributes_aado.last\n\t\t\t\t\t\...
[ { "docid": "a221094327fc76ffed9904a8eefe7ed0", "score": "0.6609037", "text": "def field_changes\n table_name = if table_name_changed\n prev_table_name\n else\n self.table_name\n end\n\n begin\n cols = table_columns\n old...
d23399fbe0e50161491623260851c949
Example file chooser (in this case an image file chooser). We delay setting size of sketch until we know image size, probably would not work vanilla processing. Note we can wrap much code in the file_chooser block, no need for reflection. As with selectInput vanilla processing.
[ { "docid": "0e1fb803c281170924a4a289e754e25d", "score": "0.7398106", "text": "def setup\n file_chooser do |fc|\n fc.set_filter \"Image Files\", [\".png\", \".jpg\"] # easily customizable chooser\n @img = load_image(fc.display) # fc.display returns a path String\n size(img.wid...
[ { "docid": "c99a152ac73ebbd4c88f25262ea19d38", "score": "0.5955873", "text": "def thumbnail select\n return self.uploads[select].variant(resize: \"400x300!\").processed\n end", "title": "" }, { "docid": "ff0930cc855ebdeed0c03b398fd9e124", "score": "0.5493093", "text": "def select...
e5fe76b32a657e9134ee912132abd98a
Create a new population criteria from the supplied HQMF entry
[ { "docid": "6adebdcf65ab6abc3998aa161ddcc6e3", "score": "0.4550134", "text": "def initialize(entry, doc)\n @doc = doc\n @entry = entry\n @hqmf_id = attr_val('./*/cda:id/@extension')\n @title = attr_val('./*/cda:code/cda:displayName/@value') \n @type = attr_val('./*/cda:code/@cod...
[ { "docid": "12d4aa499807ef7b31f0701e350daa58", "score": "0.6008782", "text": "def build_population_criteria(criteria_def, criteria_id, population)\n criteria = PopulationCriteria.new(criteria_def, @document, @id_generator)\n\n # check to see if we have an identical population criteria.\n ...
db3a2b07921fcc79dfb544acb3e4dde1
Description: Gets the height of the image in pixels, as a string. Output: Height of image (in pixels).
[ { "docid": "570a94e5571af332d9da3d7f5c46682d", "score": "0.74986553", "text": "def height\r\n assert_exists\r\n return @o.invoke(\"height\").to_s\r\n end", "title": "" } ]
[ { "docid": "7e88658bddfb2dc35e3d507b3667eee0", "score": "0.7980621", "text": "def height\n image_ptr[:sy]\n end", "title": "" }, { "docid": "0c5ab49e5f176d267edc89bf2e368b41", "score": "0.79326606", "text": "def height\n @image.height\n end", "title": "" }, { ...
e2778352bf8079cc6cc1e550ad17a055
Retrieve current user's data
[ { "docid": "ec85d74c1718fb248713529fa2c057a3", "score": "0.0", "text": "def get_me\r\n #Pass the auth_token via HTTParty's headers option:\r\n response = self.class.get(\"/users/me\", headers: { \"authorization\" => @auth_token })\r\n @user = JSON.parse(response.body)\r\n end", "title": ""...
[ { "docid": "14f4cc6436cd2c92f61cf0c06bddea91", "score": "0.8177902", "text": "def current_user_data\n\t\t@current_user ||= User.find_by(id: session[:user_id])\n\tend", "title": "" }, { "docid": "f05ebc87cefa91d9233816386e2aff63", "score": "0.7891121", "text": "def my_data\n @user ...
7d1c0680d11dffe9dfc2942489cbb5e0
Run all setups in the order of their nesting (outermost first, innermost last)
[ { "docid": "0f37ebdbf1b55b59b14bad6411088e55", "score": "0.53848565", "text": "def setup\n @suite.ancestry_setup.each { |setup| instance_eval(&setup) } if @suite\n true\n rescue *PassthroughExceptions\n raise # pass through exceptions must be passed through\n rescue Exception => exc...
[ { "docid": "7ef3287c0c51328d77ec3982dcae82f7", "score": "0.6308048", "text": "def traverse(&block)\n\t\t\t@_level += 1\n\t\t\tinstance_eval(&block)\n\t\t\t@setups.pop\n\t\t\t@_level -= 1\n\t\tend", "title": "" }, { "docid": "cfa651debf55b260db3fe466d67ee7de", "score": "0.619811", "te...
90202afeb96b8628b0af424494a7013d
Is the struct value valid?
[ { "docid": "7d17fb53ef023eac95150e308cb413fc", "score": "0.0", "text": "def valid?\n verify\n end", "title": "" } ]
[ { "docid": "c89b3b2cf719b257ebb6e5893541672f", "score": "0.74879265", "text": "def valid?\n !@value.nil?\n end", "title": "" }, { "docid": "fe8b9caf974c49b423548266499bb02e", "score": "0.7431553", "text": "def valid?\n NWN::Gff::Field.valid_for? self.v, self.t\n end",...
f432668d9335d34510384e19183a4a22
only assignement function operator to "save" current user
[ { "docid": "5bfbca95565b3310a6874e4c072eaa90", "score": "0.0", "text": "def current_user=(user)\n @current_user = user\n end", "title": "" } ]
[ { "docid": "a932b53878b2166a754bbc31dfc4f350", "score": "0.75279474", "text": "def save (user)\n if(editable_by? user)\n orig_save\n end\n end", "title": "" }, { "docid": "d57f7b337cc5dc89262875d40826c1ca", "score": "0.7350024", "text": "de...
9cf574417094c5fabe6441a64f94f862
For the board getters and setters the x and y position start from the to left corner with 0, 0 being the top left corner and size 1, size 1 being the bottom right corner
[ { "docid": "7a52000453fc3c3f08773ee299ceb47a", "score": "0.0", "text": "def get_item(x, y)\n begin\n return self.board[y][x]\n rescue StandardError => e\n puts \"That is out of bounds\"\n return false\n end\n end", "title": "" } ]
[ { "docid": "c4b2a6cc046abc28260885267f14a357", "score": "0.71008575", "text": "def initial_position(px, py, d)\n @gameboard[px][py] = d\n end", "title": "" }, { "docid": "94c34eb20d6bee5f087c8808ce35f3e6", "score": "0.70291054", "text": "def boardWithCoords\n @board_content....
8e7199d05761ab037feeb990bda96163
HTTP MOVE request. Move this resource to given destination resource.
[ { "docid": "0dbccb6dd03b901a32233c083af359cc", "score": "0.6133379", "text": "def move(dest)\n puts 'move'\n end", "title": "" } ]
[ { "docid": "b2d5f36c5e5504ec5935aebdc4de82ed", "score": "0.7881085", "text": "def move(src_path, dest_path)\n req = Net::HTTP::Move.new(@basic_path + src_path)\n req['Destination'] = @basic_path + dest_path\n res = @http.request(req)\n validate_status(res, '204')\n end", "title": "" }...
a56b4d6ecc184e775d7c3eb6c53adea7
quis and quid and all derivates (like aliquid) take a different path and use the substantivic endings
[ { "docid": "078fd6ab05539fca7b88287a4ee9f36e", "score": "0.0", "text": "def extract_pronoun_type(m)\n subst = (m[:ending] =~ /i[ds]$/ && m[:stem] == \"qu\") ? \"_s\" : \"\"\n key = if m[:particle] == m[:stem] + m[:ending]\n \"quisquis\"\n else\n # take only...
[ { "docid": "4a2dad2577f2fdb7e00df2f26e1bd793", "score": "0.5579202", "text": "def join(base, path); end", "title": "" }, { "docid": "8d8a31833b5751dc0f06def0092f221b", "score": "0.5182872", "text": "def cpaths; end", "title": "" }, { "docid": "bda124c16b7b8ed9297dd319376e...
f260b0743e3635ff851ba1fb8f391b00
GET /users/1 GET /users/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "4152fb6556ae83f7cdd6c362f17ad9bf", "score": "0.81052274", "text": "def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n ...
f023881734bcebea823004a1def44674
Creates a new category in the database using the specified url params and returns the category object as custom hash to the client if the action is successful. Otherwise, returns the error messages to the client.
[ { "docid": "a91ac8825e3b3635d1edb6c1d6d16a10", "score": "0.7517594", "text": "def create\n @category = Category.new(category_param)\n if @category.save\n render json: get_category_hash(@category)\n else\n render json: @category.errors.full_messages\n end...
[ { "docid": "5afbd6d507e715299bab0ece51cd74a2", "score": "0.7691568", "text": "def create\n category = Category.new(params[:category])\n\n if category.save\n response = formatted_response(true, category, t('api.message.catalog.categories.create.success'))\n else\n response = formatted_...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "60359d4dc203c34e3c6b615786640965", "score": "0.0", "text": "def set_branch\n @branch = Branch.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;...
82645b6220d02cdf54bcdd5c65839452
"Scenario 7: Successfully creating a local association from an exported file"
[ { "docid": "a66a08335352ee47cfd1fa39b48bc875", "score": "0.77381754", "text": "def test_scenario7\n data = [[File.dirname(__FILE__)+'/data/iris.csv', \n false, \n File.dirname(__FILE__)+'/tmp/association.json']]\n puts\n puts \"Scenario 7: Successfully creating a local a...
[ { "docid": "347125fca0a8133725382213c11f54fa", "score": "0.6635364", "text": "def test_scenario3\n data = [[File.dirname(__FILE__)+'/data/tiny_mushrooms.csv', [\"Edible\"], {'p_value' => 2.08358e-17, 'confidence'=> 0.79279, 'rhs_cover'=> [0.704, 176], 'leverage' => 0.07885, 'rhs' => [11], 'rule_id' =...
749a1653cb4c5589f4ca594288f344a0
Parses the awsdirect response body Note: Beaker requires hosts to be specified in this format
[ { "docid": "057652d64878aa88b5724274f56aa354", "score": "0.7649891", "text": "def parse_awsdirect_response_body(response_body)\n host = JSON.parse(response_body)\n hostname = host[\"hostname\"]\n type = host[\"type\"]\n\n abs_resource_host = {\n 'hostname': hostname,\n 'type': ...
[ { "docid": "1a59e022b7ac8a534c77ff1893bfae2a", "score": "0.6250766", "text": "def get_awsdirectreturn_request_body(hostname)\n { \"hostname\": hostname }.to_json\n end", "title": "" }, { "docid": "30c69dce9be5dc95ae9e55dc9fe57d0e", "score": "0.62163496", "text": "def parse_respon...
c634131a907045df2f0e8e7bdfdf2df1
Helpers to configure endpoints
[ { "docid": "d128679673b299b0c8d81562972889c6", "score": "0.0", "text": "def opscode_endpoint(url = node['berkshelf-api']['opscode_url'], &block)\n berkshelf_api_opscode_endpoint url do\n url url\n instance_exec(&block) if block\n end\n end", "title": "" } ]
[ { "docid": "1f10055eadefa335dc9b1ac3e2d40b09", "score": "0.7699521", "text": "def endpoints; end", "title": "" }, { "docid": "1f10055eadefa335dc9b1ac3e2d40b09", "score": "0.7699521", "text": "def endpoints; end", "title": "" }, { "docid": "1f10055eadefa335dc9b1ac3e2d40b09...
eb6fa2dd463f56ff5d893cade3f0b15e
Returns a Loofah::Scrubber if the `id_prefix` attribute is set, or nil otherwise.
[ { "docid": "72e1c71e6764859a23c380bfd3e3b348", "score": "0.56473464", "text": "def wiki_id_scrubber\n @id_scrubber ||= Loofah::Scrubber.new do |node|\n if node.name == 'a' && val = node['href']\n node['href'] = val.gsub(/\\A\\#(#{id_prefix})?/, '#' + id_prefix) unless node[:class] =...
[ { "docid": "5d193f7c6af551f119adec4f8588726e", "score": "0.59418267", "text": "def id_prefix_for_class\n return if !id_prefix_defined? || id_prefix_requires_instance?\n\n @id_prefix_extractor.value_for(nil)\n end", "title": "" }, { "docid": "d856508c7579fd3d1361aed50ae8c743", ...
4aa6b3185706fbf27de6fd64b38f8156
POST /surveys POST /surveys.xml
[ { "docid": "73e23a9a487f17e2497c4e1c9735b2b1", "score": "0.5819833", "text": "def create\n respond_to do |format|\n if current_user.admin? || current_user.creator?\n @survey = Survey.new(params[:survey])\n if @survey.save\n format.html { redirect_to(@survey, :notice => 'Su...
[ { "docid": "1e5c4b006cc945e80f8acb45d1c93c5b", "score": "0.66536057", "text": "def create\n @survey = Survey.new(params[:survey])\n\n respond_to do |format|\n if @survey.save\n format.html { redirect_to(@survey, :notice => 'Survey was successfully created.') }\n format.xml { re...
9d8e10020a5a415aee298dd42d2b6d0c
Find an account ==== Options :user Username associated with the acount to display (string)
[ { "docid": "8a66fd03c85c0e33eb97462144c371ab", "score": "0.65256363", "text": "def account(name)\n summary = self.account_summary(:user => name)\n build_account(summary)\n end", "title": "" } ]
[ { "docid": "47a62d67cf7ac9bbff80b2a68c98db72", "score": "0.71255815", "text": "def find_account(name)\n accts, messages = _find_account(name)\n\n puts (accts.size == 1) ? messages[0] : messages[1]\n display_result(accts) do |node, index|\n if accts.size == 1 || @@option == '-f'\n ...
b779021789d0c88bb2f1c276f8c5f055
POST /use_cases POST /use_cases.json
[ { "docid": "477df67ba08cdfeddeba62ae39417fa9", "score": "0.6942828", "text": "def create\n @use_case = UseCase.new(use_case_params)\n\n respond_to do |format|\n if @use_case.save\n format.html { redirect_to @use_case, notice: 'Use case was successfully created.' }\n format.json ...
[ { "docid": "d1205922b12c35f1f46965ee315a9c95", "score": "0.68076634", "text": "def create\n @usecase = Usecase.new(usecase_params)\n\n if @usecase.save\n render :show, status: :created, location: @usecase\n else\n render json: @usecase.errors, status: :unprocessable_entity\n end\n ...
b54ee9a78010bcb0319c81032065da4a
should return an array of places a Piece can move to
[ { "docid": "b5ed8f9f140c6511e3a08ae1f26c6311", "score": "0.0", "text": "def moves\n # create array to collect moves\n possible_moves = []\n \n # iterate over each of the directions in which a slideable piece can move\n # use the Piece subclass' `#move_dirs` method to get this info...
[ { "docid": "24fefa99c0ba226f87eccff7e836039d", "score": "0.86407125", "text": "def moves\n #don't allow a piece to move into a square already\n #occupied by a piece of the same color\n # ||\n #or move a sliding piece past a piece that blocks it\n\n raise \"Cannot implement moves for a gen...
59d2d2385d462c3ce06275eca2dc8a4b
POST /course_term_items POST /course_term_items.json
[ { "docid": "23b1364c10c652340265895693dcf5b8", "score": "0.7426418", "text": "def create\n @course_term_item = CourseTermItem.new(course_term_item_params)\n\n respond_to do |format|\n if @course_term_item.save\n format.html { redirect_to @course_term_item, notice: 'Course term item was...
[ { "docid": "23372b8f051ba2ab4867c9d4c456186e", "score": "0.7158813", "text": "def course_term_item_params\n params.require(:course_term_item).permit(:course_id, :term_item_id)\n end", "title": "" }, { "docid": "0cb907285fde35185d37e2ffbb0c8451", "score": "0.65273935", "text":...
b02bb0077c5b3bee250cb1b4e4e09aee
Iterates over each value in turn, so that we can have proper Enumerable support
[ { "docid": "db5d20b05dee0b98e0fb8d82433ed905", "score": "0.0", "text": "def each(&block)\n candy.each(&block)\n end", "title": "" } ]
[ { "docid": "4f3177a6f7c27c2aa02aecf20d5b98bc", "score": "0.79704946", "text": "def each_value\n values.each\n end", "title": "" }, { "docid": "4f3177a6f7c27c2aa02aecf20d5b98bc", "score": "0.79704946", "text": "def each_value\n values.each\n end", "title": "" }, ...
918ed754dfb163f7eebfd796d0638c58
Accepts two strokes and determines if they are part of a fraction by performing a linear regression on their centroids.
[ { "docid": "3ab0915cd21e36fb8b90e6d6a904c180", "score": "0.72224355", "text": "def is_fraction? stroke1, stroke2\n\t\t# Get centroids for both strokes\n\t\tx1, y1 = centroid(stroke1)\n\t\tx2, y2 = centroid(stroke2)\n\t\t\n\t\t# Handle case where regression is a straight vertical line (avoid division by ...
[ { "docid": "ef4ab7102caf8c2018f1b85a3dc7cc23", "score": "0.6285919", "text": "def means_and_diffs strokes\n points = strokes.flatten(1)\n sums = points.inject([0, 0]){ |acc, point| acc = [acc[0] + point[0], acc[1] + point[1]] }\n #means = [x_c, y_c]\n means = sums.map{ |sum| (sum / points.le...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "49439c78261bce5e2329978dafd852a3", "score": "0.0", "text": "def cms_banner_params\n params.require(:cms_banner).permit!\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...
9c5b9d39390c179ca18ce0a37bfcb7bb
Sets the attribute hosts
[ { "docid": "c5ba5e13453dfaf544e97d6473045911", "score": "0.65048766", "text": "def hosts=(_arg0); end", "title": "" } ]
[ { "docid": "4da4376f895e192a4d1f09b994cf00d8", "score": "0.7927044", "text": "def hosts=(hosts)\n @host = nil\n @hosts = hosts\n end", "title": "" }, { "docid": "0c8d894087f028b0f19c73e80964efda", "score": "0.7109149", "text": "def host=(host)\n @hosts = nil\n ...
37b3bd8d268049847fe479286844e88a
Ejemplo de CFDI 40
[ { "docid": "263f06d82ed8873239721f0e062b5727", "score": "0.54574203", "text": "def sample_cfdis_create40(facturama)\n\n cfdi = {\n \"Serie\": \"R\",\n \"Currency\": \"MXN\",\n \"ExpeditionPlace\": \"78140\",\n \"Payme...
[ { "docid": "1b32dbfb5c4033670c1e7a8aed770154", "score": "0.66951627", "text": "def mi_carrera\n\n\tend", "title": "" }, { "docid": "ad244bd0c45d5d9274f7612fa6fee986", "score": "0.66901046", "text": "def suivre; end", "title": "" }, { "docid": "13289d4d24c54cff8b70fcaefc85...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "5692eb66daa270b7b675c373b70f93e3", "score": "0.0", "text": "def tbl_content_params\n params.require(:tbl_content).permit(:ContentID, :ContentName, :ContentValue, :ContentType, :ContentStatus, :PlaceHolder)\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...
ab3150eed454fb86d63e7830a6d7844a
DELETE /profiles/1 DELETE /profiles/1.xml
[ { "docid": "8fd6708670cca72da36614c95aea3164", "score": "0.73543763", "text": "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ...
[ { "docid": "7e22d123a5d3ae3e8c4f2cf418e42b4b", "score": "0.7379789", "text": "def destroy\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7e22d123a5d3ae3e8c4f2cf4...
5e1ca512c9bc08b67db23a591e8c47fe
return an array of all the common_tags which tagging with self should add
[ { "docid": "7a7d723986befe02651bfff873ae0c52", "score": "0.82160693", "text": "def common_tags_to_add\n common_tags = []\n common_tags << self.merger\n common_tags << self if self.canonical\n common_tags << self.parents\n common_tags.flatten.uniq.compact\n end", "title": "" } ]
[ { "docid": "505cb7e2784a73be3400081dfed4aed7", "score": "0.67049474", "text": "def available_tags\n available_tags = []\n Tag.all.each do |t|\n available_tags << t.name\n end\n\n tags = []\n self.tags.each do |t|\n tags << t.name\n end\n\n available_tags - tags\n end", ...
c478194dca36998dc486da478266a33e
Append a set of drawable instances to a target layer,
[ { "docid": "cec69c6aad7f0a3f2f9cb775736584f5", "score": "0.7458396", "text": "def append_to(drawables, layer_type)\n drawables.each do |drawable|\n layer_with(layer_type).append(drawable)\n end\n end", "title": "" } ]
[ { "docid": "b921b6c1e112d2ff12817703b6f3e48f", "score": "0.62153584", "text": "def move_layer(from_parallax, from_layer, to_parallax, to_layer)\n drawable_list = @drawables[from_parallax][from_layer].dup\n\n drawable_list.each do |drawable|\n unregister_drawable drawable \n drawable...
17d364b703e6dfd8f4bb91749103067d
GET /asteroids GET /asteroids.json
[ { "docid": "548e9985c9124f47ffd298a571bc9bef", "score": "0.64087236", "text": "def index\n respond_to do |format|\n @asteroids = Asteroid.search(\n params.dig(:search, :value),\n { page: page,\n page_length: page_length,\n sort_order: sort_order,\n sort_d...
[ { "docid": "55d6831ca8885699d6197d66789292f5", "score": "0.6563294", "text": "def index\n @asteroids = Asteroid.all\n end", "title": "" }, { "docid": "9e4dacf91b49fd06774ba6411d4ae35f", "score": "0.5759525", "text": "def index\n\t\t@rooms = Room.order(updated_at: :desc)\n\t\tresp...
6c32857f8cd6a98aa2e2cd25cadafb09
Returns the datacenter object from the VIM library
[ { "docid": "f98c1973ff5cabc375499d18b0beb2b5", "score": "0.77546436", "text": "def dc\n @dc ||= vim.serviceInstance.find_datacenter(datacenter)\n end", "title": "" } ]
[ { "docid": "d91925e92f8f671c85b77cb4594a1a66", "score": "0.7945729", "text": "def datacenter\n vim # ensure connection is valid\n @datacenter ||= begin\n rootFolder = vim.serviceInstance.content.rootFolder\n dc = traverse_folders_for_dc(vim.rootFolder, datacenter_name) || abort('...
6aa18c72f18ddc66208196cf95d27994
Get Company By Id
[ { "docid": "b3d18a53954a1aa34fbb5a5cd3df9eb3", "score": "0.0", "text": "def company_companies_id_get(id, opts = {})\n data, _status_code, _headers = company_companies_id_get_with_http_info(id, opts)\n return data\n end", "title": "" } ]
[ { "docid": "29088463c5ae349b9a3fb78945881d46", "score": "0.84285045", "text": "def get_company_from_id\n Company.find(params[:id]) if params[:id].present?\n end", "title": "" }, { "docid": "85f76d1daf40f5135940744ea04180b6", "score": "0.84206235", "text": "def company(id)\n Co...
649dd214333f033b516a2255f459985d
PATCH/PUT /products/1 PATCH/PUT /products/1.json
[ { "docid": "1054af588f459d34e95f31dea263a5d8", "score": "0.0", "text": "def update\n\t #render :text => \"<pre>\" + params[:product][:brands_id].to_s and return\n\n\t if params[:product][:subcategory_id] == '1'\n\t\t product_params = product_params_computer\n\t else\n\t\t product_params = product_p...
[ { "docid": "306087ac201b8c728342c4a66d77b684", "score": "0.72468925", "text": "def update\n uri = \"#{API_BASE_URL}/products/#{params[:id]}\"\n payload = params.to_json\n rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n begin\n rest_resource.put payload , :content_typ...
ddbe16b0e425507405f1bacf93ff8261
POST /cryptos POST /cryptos.json
[ { "docid": "0f27b404719a1fb2ae41db4a1cde10c3", "score": "0.66056305", "text": "def create\n @crypto = current_user.cryptos.build(crypto_params)\n\n respond_to do |format|\n if @crypto.save\n format.html { redirect_to @crypto, notice: 'Crypto was successfully created.' }\n format...
[ { "docid": "e59ee4107bb8ed629b800d9b15b4b2fe", "score": "0.6047764", "text": "def create\n @crypto = Crypto.new(crypto_params)\n\n respond_to do |format|\n if @crypto.save\n format.html { redirect_to @crypto, notice: 'Crypto was successfully created.' }\n format.json { render :s...
1350c0931b429d85f2b65883344e2554
Parses dublincorerelevant information from the metadata or inserts a fallback value if applicable Will try to guarantee valid data. To that end, OC API requests may be required. metadata: hash (string => string) useSharedNotesForDescriptionFallback: bool passIdentifierAsDcSource: bool args: startTime: optional, unixtim...
[ { "docid": "f8d8cee8231039dbac60848629bd7b03", "score": "0.61460036", "text": "def parseDcMetadata(metadata, getSeriesMetadata=false, useSharedNotesForDescriptionFallback=false, passIdentifierAsDcSource=false, **args)\n # Cast keys to lowercase\n metadata = OcUtil::keysLowerCase(metadata)\n\n #...
[ { "docid": "26223c74712c695f358baab451090b7f", "score": "0.6218532", "text": "def getDcMetadataDefinition(metadata, useSharedNotesForDescriptionFallback, passIdentifierAsDcSource,\n meetingStartTime, meetingEndTime)\n dc_metadata_definition = []\n dc_metadata_definitio...
3a27ce05dcc0a76b082f6694a9e36321
create table `orders` ( `reference_no` varchar(255) not null, `customer_name` varchar(255) not null, `date` varchar(255) not null, primary key (`referece_no`) );
[ { "docid": "c63874bfec069fa5c8ef5d6274e5ec73", "score": "0.50780874", "text": "def initialize(param)\n @reference_no = param[ :reference_no]\n @customer_name = param[ :customer_name]\n @date = param[ :date]\n end", "title": "" } ]
[ { "docid": "ff75ed80fbdeb946c84a4b0f42bd344c", "score": "0.6077067", "text": "def create_customers_table\n db.execute %q{\n CREATE TABLE customers (\n customer_id integer primary key,\n name varchar(50),\n pin integer(4))\n }\n end", "title": "" }, { "docid": "f918...
1d6812302198660a7cdd124d08100f55
PATCH/PUT /passengers/1 PATCH/PUT /passengers/1.json
[ { "docid": "6d7d0ecd22b5e8d0caad36966a07515d", "score": "0.5930537", "text": "def update\n respond_to do |format|\n if @passenger.update(passenger_params)\n format.html { redirect_to passengers_path, notice: (I18n.t 'activerecord.messages.passenger.updated') }\n format.json { rende...
[ { "docid": "c10ac4c44ba6e522220f9835390accff", "score": "0.6398506", "text": "def update\n respond_to do |format|\n if @passanger.update(passanger_params)\n format.html { redirect_to @passanger, notice: \"Passanger was successfully updated.\" }\n format.json { render :show, status:...
9c14df8780c47423b512105df4fa7132
GET /legalentities/new GET /legalentities/new.xml
[ { "docid": "d191eafb81257cb54bf8a0ac543e0706", "score": "0.7914896", "text": "def new\n @legalentity = Legalentity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @legalentity }\n end\n end", "title": "" } ]
[ { "docid": "3417b8715322ba900cbe23e3155e50d1", "score": "0.7182125", "text": "def new\n @entity = Entity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entity }\n end\n end", "title": "" }, { "docid": "9e3ccaa760e0f809a5d490c00...
02a6def5907c4adc5636e3fc50ce77f2
TODO: when workspace_name gets recursive, use `basename`
[ { "docid": "8463823a882ab6e31307da2dbee3160d", "score": "0.75209284", "text": "def project_name\n workspace_name.split('.').first\n end", "title": "" } ]
[ { "docid": "53bd52618cc0d8bd9bff77aa2c44acca", "score": "0.71392125", "text": "def name\n @repo.workdir.split('/').last\n end", "title": "" }, { "docid": "53bd52618cc0d8bd9bff77aa2c44acca", "score": "0.71392125", "text": "def name\n @repo.workdir.split('/').last\n end...
fb6beaa90915c63567bb30e65c13e7f8
options: :name => can specify an alternative queue name
[ { "docid": "e038f6dc914dbd0fed19e366e6be153c", "score": "0.0", "text": "def get(options={})\n opts = parse_opts(options)\n opts[:name] ||= @client.cache_name\n\n Cache.new(@client, call_api(:get, '', opts))\n end", "title": "" } ]
[ { "docid": "b68434707f562ad20863645c0679cc1e", "score": "0.82691216", "text": "def queue(queue_name=nil, options=nil)\n if queue_name\n @queue_options = options || {}\n @queue_name = queue_name.to_s\n else\n @queue_name\n end\n end", "title": "" ...
6614887c6600ca87a9b868c94f090c0d
PUT /home_pictures/1 PUT /home_pictures/1.json
[ { "docid": "b3e4dcd7e8af1939095b4102a2a19735", "score": "0.7102397", "text": "def update\n @home_picture = HomePicture.find(params[:id])\n\n respond_to do |format|\n if @home_picture.update_attributes(params[:home_picture])\n format.html { redirect_to @home_picture, notice: 'Home pictu...
[ { "docid": "a607dda0855ca75d178e7abc928b7f25", "score": "0.70087874", "text": "def update\n respond_to do |format|\n if @home_picture.update(home_picture_params)\n format.html { redirect_to @home_picture, notice: 'Home picture was successfully updated.' }\n format.json { head :no_c...
c3912fe07d5d1fa22e2cc94328889b3c
Returns the value of attribute super_decl. source://rbs//lib/rbs/errors.rb160
[ { "docid": "4cf764607e8aa8744c89a873eed2bb30", "score": "0.658472", "text": "def super_decl; end", "title": "" } ]
[ { "docid": "407b27ef8833f5a2b223f5cd216aaf76", "score": "0.5369565", "text": "def super_class!\n raise \"No super_class for class #{name}\" unless super_class_name\n s = super_class\n raise \"superclass not found for class #{name} (#{super_class_name})\" unless s\n s\n end", "...
d2f6e9123c4048c32edcfa925a4efa6d
Parses this segment out of a string, puts the match into value, returns the rest of the string nil if cannot parse.
[ { "docid": "d4ad4322fb85114b49ab133652f7f4e4", "score": "0.66163856", "text": "def parse(str)\r\n s = str\r\n # puts \"Parsing segment #{name} from #{s} with regexp [#{regexp.source}]\"\r\n m = regexp.match(s)\r\n # puts \"Matched #{m ? m[0] : 'nothing'}\"\r\n\r\n return nil unl...
[ { "docid": "a823943f50a79e0763abc50b7cfa5079", "score": "0.6442073", "text": "def treat_value(string)\n tmp = string.split(\":\",2)\n return tmp[1].nil? ? \"\" : tmp[1]\n end", "title": "" }, { "docid": "28b170a9c04e127c53b6e56debc23159", "score": "0.60467947", "te...
5aaddf29e3eb749f45da3540d9b6783d
required parameters: name: scaling_group_id, type: String optional parameters: name: _method, type: String, optional values: GET|POST name: _region, type: String name: _scheme, type: String, optional values: http|https name: active_scaling_configuration_id, type: String name: instance_id_1, type: String name: instance_...
[ { "docid": "afb6dc9fdbb98da8f01874c957519ac4", "score": "0.71128136", "text": "def enable_scaling_group(scaling_group_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'EnableScalingGroup'\n\t\targs[:query]['ScalingGroupId'] = scaling_group_id\n\t\targs[:region] = optional...
[ { "docid": "622bb31c6de5060b10442c8eb94b5592", "score": "0.722283", "text": "def describe_scaling_instances(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeScalingInstances'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_...
a36c4a78916b2f86748fa97a7b8cd6ef
One event of two must be deleted
[ { "docid": "48e088973fb2659990cc5e5d1c550e02", "score": "0.0", "text": "def send_notification(new_state, current_user_id, recipient_id)\n if current_user_id != user_id\n UserMailer.new_event(id, user.email).deliver_now\n end\n\n if ['verification', 'approval', 'execution'].include? new_sta...
[ { "docid": "883abb6357f2a37f1913e3192410bcad", "score": "0.6894106", "text": "def destroy_or_tag_as_removed\n if self.events.blank?\n destroy\n else\n self.removed = true\n save!\n end\n end", "title": "" }, { "docid": "3dc2288dff65c99f910626bc4b1dfedc", "score":...
39a1e4ea4d455ef40957e18c09253ed4
signs up user by sending email and password
[ { "docid": "0d2ada6bb37ae40a30623106d48a05fc", "score": "0.7236538", "text": "def signup\n @signed_up = false\n new_user = User.new_from_signup(params[:email], params[:password])\n if new_user && new_user.save()\n @signed_up = \"true\"\n Mailing.deliver_account_verify_email(new_user)\...
[ { "docid": "55239ac841507f153ad445b51a3769e2", "score": "0.82881814", "text": "def signup_with(email_address,password)\r\n self.signup_email = email_address\r\n self.signup_password = password\r\n submit_credentials\r\n end", "title": "" }, { "docid": "aaee6574139912fb1b020c6ec018a...
1505b32b41e41fd1c30eea4a22dc77ad
Fills the current bounds using the specified fill color and strokes the bounds using the specified stroke color. Sets the line with if specified in the options. Before returning from this method, the original fill color, stroke color and line width on the document are restored.
[ { "docid": "cc07b2f1665465de436a3f51a7f0d821", "score": "0.693045", "text": "def fill_and_stroke_bounds f_color = fill_color, s_color = stroke_color, options = {}\n no_fill = !f_color || f_color == 'transparent'\n if ::Array === (s_width = options[:line_width] || 0)\n s_width = [s...
[ { "docid": "8176f08ccc28f17160a77d57e057b13d", "score": "0.6947735", "text": "def fill_and_stroke_bounds f_color = fill_color, s_color = stroke_color, options = {}\n no_fill = !f_color || f_color == 'transparent'\n no_stroke = !s_color || s_color == 'transparent' || options[:line_width] == 0\n ...