query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
db891608fa0d82697bd293163e40d303 | Gets shared edges with another wire | [
{
"docid": "61057aece86b617003b2daca4b404f18",
"score": "0.82361394",
"text": "def shared_edges(other)\n return nil unless other.is_a?(Wire)\n\n result = []\n @directed_edges.each do |de|\n other.directed_edges.each do |other_de|\n result << de.edge if de.edge.id == other_... | [
{
"docid": "bb34fc00d01aba2686f46794cb6db6f8",
"score": "0.6933623",
"text": "def edge a, b\n # works for both digraph and undirected graph\n @edges[a].each{|e| return e if e.connects? a, b}\n end",
"title": ""
},
{
"docid": "4387973d0be4a4961e3fd0e79b8a76c8",
"score": "0.6634044"... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "c81d65adb669f91745f76bd78a0c8d1d",
"score": "0.0",
"text": "def hiring_results_params\n params.fetch(:hiring_results, {})\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74954116",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6956924",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
fb8ad7f443b686fcadb07059918cb2be | Class method to set and change the global configuration. | [
{
"docid": "55cbebb806485ce1f17a414e21532a9a",
"score": "0.0",
"text": "def configure\n yield(configuration)\n end",
"title": ""
}
] | [
{
"docid": "0f3a1820838d2253c56414fd2d7a2c49",
"score": "0.75885355",
"text": "def initialize\n self.global_config = {}\n end",
"title": ""
},
{
"docid": "51ddc1ad61a866a2dc13e9fbb46bf6a2",
"score": "0.7405473",
"text": "def set_global (options)\n if options\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "e1855e2c3fbc643f2b936bfa68d09834",
"score": "0.0",
"text": "def set_favorite\n @favorite = Favorite.find_by(user_id: current_user.id, tutorial_id: 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... |
29a83c75207cc95a7f0a978c86650d16 | Add data by item | [
{
"docid": "e0ac02faa665ad53f909e1a803f14323",
"score": "0.6812954",
"text": "def add_data_by_item(plugin, context_name, item )\n\n message = \"{\n 'action': 'create',\n 'resource': 'dataContext[#{context_name}].item',\n 'values': [\n {\n 'Sample': '#{item[0]}',\n 'YesNo':... | [
{
"docid": "6fd221533de71262fdff8d86236e7c6f",
"score": "0.8087326",
"text": "def add_item item ; add item, @items; end",
"title": ""
},
{
"docid": "6d3d91d8075b74a05de0da0b4f85a543",
"score": "0.7730037",
"text": "def add data \n @items = @items.push data \n end",
"title": ... |
34df158ddb6fee941f5a29306901a469 | POST /consignation_lines POST /consignation_lines.xml | [
{
"docid": "6004f8c9289aa2e9431d125e00c5c7f3",
"score": "0.7027906",
"text": "def create\n @consignation_line = ConsignationLine.new(params[:consignation_line])\n\n respond_to do |format|\n if @consignation_line.save\n format.html { redirect_to(@consignation_line, :notice => 'Consignat... | [
{
"docid": "e86a9bae401b5f689035929df48a344f",
"score": "0.6497234",
"text": "def create\n @line = Line.new(params[:line])\n\n respond_to do |format|\n if @line.save\n flash[:notice] = 'Line was successfully created.'\n format.html { redirect_to(lines_path) }\n format.xml... |
1376cd1b08ddafb2282781e8472ab09b | Return an array of the parsed file content | [
{
"docid": "c57f83bc0ad520561a7c9436dbd9a89a",
"score": "0.0",
"text": "def parse_gemfile\n @original_string.split(\"\\n\").reject do |row|\n Annotation.source_string? row\n end.map do |row|\n if Gem.gem_string? row\n Gem.from_s row\n elsif Source.source_string? r... | [
{
"docid": "fe1501b436e1a19f216b67b598a6f506",
"score": "0.73493904",
"text": "def read_contents\n\t\treturn File.open(self.file_name).read.split(/\\n/) if self.file_name\n\tend",
"title": ""
},
{
"docid": "afdcf505fd7d2c6bc7048de290b2289e",
"score": "0.7220815",
"text": "def parse_f... |
f8b99e2f1d5f26d2239ee85d05291c30 | Render a link with an icon an no text | [
{
"docid": "38ef684cc137b21fd35bf72bb07bfef6",
"score": "0.0",
"text": "def service_external_icon_link(identity_feed, link_css = nil, wrapper = nil, target = 'blank', id = nil)\n path = identity_feed.feed.display_uri || identity_feed.feed.uri\n service_icon_link(path, identity_feed.feed.service, l... | [
{
"docid": "f722fb37fd7e230bb80195225a7f725d",
"score": "0.72228354",
"text": "def icon_to(text, *args)\n if args.first.is_a?(Hash)\n return icon_tag(:clear) unless args[0].delete(:if)\n end\n link_to(icon_for(text), *args)\n end",
"title": ""
},
{
"docid": "df66451a... |
36e9f288245e15987f7806be27572ec2 | Returns all siblings of the current node. subchild1.siblings => [subchild2] | [
{
"docid": "2c065f2b4f5a314903b6e54eb56e83af",
"score": "0.70087475",
"text": "def siblings\n self_and_siblings - [self]\n end",
"title": ""
}
] | [
{
"docid": "5f9b7ed3f273fad284b2920d6dd6afc7",
"score": "0.7799361",
"text": "def siblings\n return [] if next_sibling.nil?\n [next_sibling] + next_sibling.siblings\n end",
"title": ""
},
{
"docid": "257c0fc1e0b615cf344f961927916f86",
"score": "0.7701847",
"text": "def sibling... |
d5899b7a4473723e996b6fcc03a6e8ba | True if the format is not understood ("Unknown Format") | [
{
"docid": "d7cf961310067e99ed703dac774d035a",
"score": "0.8943871",
"text": "def unknown_format?\n if @unknown_format\n true\n else\n false\n end\n end",
"title": ""
}
] | [
{
"docid": "3cf2aede444672eb7ff1eab0ac2ba1ad",
"score": "0.8128186",
"text": "def invalid_format?(format)\n return true unless FORMATS.include?(format)\n end",
"title": ""
},
{
"docid": "2a5fd31f47bd9462cf7695a89ca81af5",
"score": "0.7735033",
"text": "def valid?\n i... |
23a73efa18310d1b5ab43166c73bcc97 | hour of day starts at 2am | [
{
"docid": "81074d902ef4397df6559faa13be5834",
"score": "0.64257485",
"text": "def test_hour_of_day_end_of_day_day_start_2am\n assert_result :hour_of_day, 23, \"2013-01-01 01:59:59\", false, day_start: 2\n end",
"title": ""
}
] | [
{
"docid": "12146d30d604f39cf0970cdd011adcb2",
"score": "0.7598121",
"text": "def beginning_of_hour; end",
"title": ""
},
{
"docid": "12146d30d604f39cf0970cdd011adcb2",
"score": "0.7598121",
"text": "def beginning_of_hour; end",
"title": ""
},
{
"docid": "12146d30d604f39c... |
c761a933b8c8a4b7ef80a9be35c999de | POST /candidates POST /candidates.json | [
{
"docid": "64d7da568982a8236d779dad7f5bc3b1",
"score": "0.65715146",
"text": "def create\n\t\trequire_admin!\n\n\t\t@candidate = Candidate.new(candidate_params)\n\n\t\trespond_to do |format|\n\t\t\tif @candidate.save\n\t\t\t\tformat.html { redirect_to @candidate, notice: 'Candidate was successfully cre... | [
{
"docid": "0f8caf8f137b0e0ed251b4b7ae086f08",
"score": "0.71803164",
"text": "def create\n @candidate = @election.candidates.build(candidate_params)\n\n respond_to do |format|\n if @candidate.save\n format.html { redirect_to election_candidate_url(@election, @candidate), notice: 'Cand... |
2f59511a46636810c6a9b986179d1df8 | NOTE we don't check for the user/taxon values In the feed, because they might have been doing something else, elsewhere. | [
{
"docid": "45fd18877c753c9df9ec1b1d63f945e0",
"score": "0.0",
"text": "def expect_no_data_feed\n # Test passes if there's no activity at all:\n unless page.body =~ /#{I18n.t(:activity_log_empty)}/ or\n page.body =~ /#{I18n.t(:no_record_found_matching_your_criteria)}/\n if page.body... | [
{
"docid": "d283168d42ad4737f10af1e937ffeca5",
"score": "0.5368021",
"text": "def gleaning_attributes= attrhash\n super\n return unless attrhash\n if value_hash = attrhash['RSS Feed']\n # The 'value(s)' are a hash of feeds\n value_hash.values.map { |url| assert_feed url, true }\n e... |
b2f7ae048a37f1351c78b1be9b614b5d | pirates_say_arrrrrrrrr("are you really learning Ruby?") => "eenu" pirates_say_arrrrrrrrr("Katy Perry is on the radio!") => "rya" pirates_say_arrrrrrrrr("Pirates say arrrrrrrrr") => "arrrrrrrr" so I can use .count to find the number of occurrences in the string, "Peter is a noob".count('e') => 2 I can also use .scan, re... | [
{
"docid": "8df9341029323bd785399a7f82363a86",
"score": "0.7560622",
"text": "def pirates_say_arrrrrrrrr(string)\n to_return = \"\"\n add_next = false\n string.size.times do |index|\n current_char = string[index, 1] # kindly enough, Josh Cheek put in a comment\n# explainging the above line, that t... | [
{
"docid": "3ae18d57df9b64cdacbf7b002265f8f0",
"score": "0.78543544",
"text": "def pirates_say_arrrrrrrrr(string)\n\tnewString = \"\"\n\tindex = 0\n\tadd_next = false\n\tstring = string.split(\"\").each do |letter|\n\t\tif letter == \"r\" || letter ==\"R\"\n\t\t\t#puts string[index], index\n\t\t\tif ind... |
e63ff27b83e95ec558cd127a6550a6f9 | request ids that owner owns | [
{
"docid": "bd857512f04bf3b3ae0fe4084d835e29",
"score": "0.7393983",
"text": "def owner_requests\n @owner_requests ||= owner_request_ids\n end",
"title": ""
}
] | [
{
"docid": "7be600acbdc6c74e645b35121e2462d0",
"score": "0.79539585",
"text": "def owner_id_list\n id_list(owner_requests)\n end",
"title": ""
},
{
"docid": "11978b35073d7e4ff4ef2c5c820795e9",
"score": "0.71901745",
"text": "def user_owner_ids\n owner_ids(\"User\")\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "962f659ff80aa0fb4993ea70bd3b5e2c",
"score": "0.0",
"text": "def set_workout\n @workout = Workout.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60320485",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6013371",
"text": "de... |
7d05752a6beb3ab09a9da47b21df5b10 | Returns true if this event was succesfully completed, false otherwise. | [
{
"docid": "557390da9df979d52074cbd976385300",
"score": "0.0",
"text": "def completed?\n disposition_code.try(:success?)\n end",
"title": ""
}
] | [
{
"docid": "4d10328ecfc9cd100473a03d1273c5d6",
"score": "0.7844257",
"text": "def completed?\r\n return true\r\n end",
"title": ""
},
{
"docid": "5fb1848b85d166b3d2691ed47cd8233d",
"score": "0.7806854",
"text": "def completed?\n self.success? || self.failure?\n end",
... |
731d920d44a524c88b0922db6bc3a4db | :category: Footers Add group footer to display the minimum value of the +cols+ given as header symbols. | [
{
"docid": "7de9d1918dc6ec286d0c983c5c0ed166",
"score": "0.80616957",
"text": "def min_gfooter(*cols)\n hsh = {}\n cols.each do |c|\n hsh[c] = :min\n end\n gfooter('Group Minimum', **hsh)\n end",
"title": ""
}
] | [
{
"docid": "8e44dd11f2735d465cd9dc7fa779965a",
"score": "0.7935673",
"text": "def min_footer(*cols)\n hsh = {}\n cols.each do |c|\n hsh[c] = :min\n end\n footer('Minimum', **hsh)\n end",
"title": ""
},
{
"docid": "8e44dd11f2735d465cd9dc7fa779965a",
"score": ... |
e842d0d0e49fc45e032eeb4b4cde96e1 | person = fixture symbol or Person | [
{
"docid": "990fff5567ab865d404c007570c2c314",
"score": "0.0",
"text": "def goto_login_page_and_login_as(person, password = \"secret\")\n person = case person\n when Symbol\n people(person)\n when Person\n person\n else\n raise \"Don't recognize #{person}\"\n end\n \n ... | [
{
"docid": "8e51fce7650c209bdae05b163c65c4ed",
"score": "0.71006155",
"text": "def random_person\n # create random name\n name = \"\"\n NAME_LENGTH.times { name << (97+$random.rand(26)).chr}\n name\n\n if $person_class == String\n name\n elsif $person_class == Symbol\n name.to_sym\n elsif $... |
dc4fd50e48ff1098e78eabcc6cf9fdf3 | GET /fireflies/1 GET /fireflies/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "e12a62650d1f454c370d02f73105d4b2",
"score": "0.7309641",
"text": "def index\n @fireflies = Firefly.all\n end",
"title": ""
},
{
"docid": "76fae392847ff2f1aa59ca2adfb00071",
"score": "0.6579985",
"text": "def index\n @filials = Filial.all\n\n respond_to do |forma... |
5671c61804d8ef0a6d18f19176109641 | challenge create custom code to remove nil | [
{
"docid": "728a1c0ded13035503b94f752be5c75a",
"score": "0.0",
"text": "def compakt(array)\n final = []\n array.each { |char| final << char unless char.nil? }\n final\nend",
"title": ""
}
] | [
{
"docid": "b17a5e73b18d3162a6a8b98a898d7e72",
"score": "0.722652",
"text": "def null!; end",
"title": ""
},
{
"docid": "929a76b6880b3c013c088731a7bc3351",
"score": "0.7213521",
"text": "def null; nil end",
"title": ""
},
{
"docid": "f77f1343ba35535aa635c10d6a79dd12",
... |
7c7fd1c678d845195c4f34fe28947eda | check every space and if every space is taken, return true if not every space is taken, return false | [
{
"docid": "9f4e099e6d93eaf5dce12a474729ba97",
"score": "0.62477714",
"text": "def full?(board)\n board.each do |space|\n if space == \"X\" || space == \"O\"\n else\n return false\n end\n end\n true\nend",
"title": ""
}
] | [
{
"docid": "890f1fa55269c32319a3a9a6953e3322",
"score": "0.6905645",
"text": "def full?\r\n @board.each do |space|\r\n if space == \" \"\r\n return false\r\n end\r\n end\r\n true\r\n end",
"title": ""
},
{
"docid": "44bb03152db43509061ea80ccd485c87",
"score": "... |
c1ec2a325b655819b1a7a17007525aa2 | Displays the state of the board | [
{
"docid": "b5e3a8d962668263a8d9b8b8e10c269e",
"score": "0.74311256",
"text": "def display_board\n\t\tsystem \"clear\" or system \"cls\"\n\t\tprint \" 1 2 3 4 5 6 7 8 \\n\\n\"\n\t\t(0..7).each do |row|\n\t\t\tprint \"#{(row+97).chr} \"\n\t\t\t(0..7).each do |collumn|\n\t\t\t\tprint \"#{@board[row][c... | [
{
"docid": "0a5047a88faa5e0c237fe7d93e88e2a3",
"score": "0.82298946",
"text": "def display_board\n board =\n \" _______ _______ _______\n | | | |\n A| #{@state[:A1]} | #{@state[:A2]} | #{@state[:A3]} |\n |_______|_______|_______|\n | |... |
18d9decca3950b1977df178a2a2116ea | DELETE /users/1 DELETE /users/1.xml | [
{
"docid": "dd915cbc28b2bb2e5977e85822bee01d",
"score": "0.6532693",
"text": "def destroy\n @user = @current_user\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_back_or_default(users_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "f2aa64556d41c1306c893cf55febd02e",
"score": "0.7177572",
"text": "def delete\n @user = User.find(params[:id])\n @user.rvsps.delete_all()\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "96de0b7071c3329b2d3b62faaa9a04cb",
"score": "0.0",
"text": "def set_event\n @event = Event.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... |
92191ab5fc095b9562c013c4e4c8a250 | check if configuration corresponds to runtime | [
{
"docid": "5d6040667051704348f5f4efedf486a1",
"score": "0.0",
"text": "def is_sound?\n @conf[:sandboxes].each do |v|\n name = v[:name]\n lxc = LXC.container(name)\n return false unless lxc.exists?\n end\n return true\n end",
"title": ""
}
] | [
{
"docid": "79d713b61ddeef4d1845846d478ac00b",
"score": "0.6629761",
"text": "def detect\n dynatrace_service_exist? ? process_config : nil\n end",
"title": ""
},
{
"docid": "7ef968e3abc0e9c5e928ce5808b36c7f",
"score": "0.66026944",
"text": "def config\n mode == \"autoins... |
cf0fd69e7791901c4d82b2bfc70dc488 | scrape a single price using selectors and method determined by type, valid values for type: :normal :sale :sale_original_price | [
{
"docid": "8b58e1685809fb7d7a38817e33708e11",
"score": "0.8344758",
"text": "def scrape_single_price(type)\n # start of treating price as a string so unwanted chars can be removed\n # before converting to a float\n price = nil\n\n # if the price is just a single CSS element\n if self.ret... | [
{
"docid": "3521fe1cd672edaab8c170c7f7041554",
"score": "0.73011523",
"text": "def scrape_price\n # get the prices\n self.normal_price = self.scrape_single_price(:normal)\n self.sale_price = self.scrape_single_price(:sale)\n if self.retailer.sale_original_price\n self.sale_original_pric... |
12193fb86e3beff3a4255fea5cc9bc4f | GET /requests or /requests.json | [
{
"docid": "e6e7800baeabb9c27eb95101059a02e3",
"score": "0.0",
"text": "def index\n @requests = Request.all\n @allCategories = Category.all\n @allItems = Item.all\n end",
"title": ""
}
] | [
{
"docid": "002236c886efd9f75c3a0d3b05ed4115",
"score": "0.68269736",
"text": "def request_get\n render json: { 'body' => 'GET Request' }, status: :ok\n end",
"title": ""
},
{
"docid": "be86c797817bd28d743e7f67eac20664",
"score": "0.6642686",
"text": "def get(url, options = {})\n... |
e2f87ba10472e466f51563a77341c120 | this method handles creation of new posts and editing of existing posts | [
{
"docid": "13a03ab36331ef376ad41a9eaffd8f42",
"score": "0.65977186",
"text": "def save_post\n if params[:id] && request.get?\n # want to edit a specific post -- go for it\n @post = Post.find(params[:id])\n @tags = @post.tag_names\n render :action => :new\n \n elsif !param... | [
{
"docid": "ede886cc26e448521f507f704b9fe034",
"score": "0.7242462",
"text": "def create_posts\n end",
"title": ""
},
{
"docid": "ede886cc26e448521f507f704b9fe034",
"score": "0.7242462",
"text": "def create_posts\n end",
"title": ""
},
{
"docid": "6629816f27557fe36da703... |
76372c898c90fa4da5afc77172b814f2 | Solr query. Returns solr json. | [
{
"docid": "87c2b66ce006ee3c3e9522cbe58ba9d7",
"score": "0.0",
"text": "def search\n search_parameters = SolrParams.new\n\n yield(search_parameters)\n\n params = search_parameters.to_h\n\n # If making a search use the /search handler otherwise use /select. /select\n # queries wi... | [
{
"docid": "476363759223b9ac1b8b21ac1fa1ee33",
"score": "0.74285823",
"text": "def solr_select\n solr_params = {\n :q => params['q'],\n :fq => params['fq'], # Multiple fq key value pairs get collapsed to one by Rails creating wrong result sets from Solr\n :fl => params['fl'],\n :s... |
62bbefecb77abc45e771760697fc90c0 | For testing: sr = Etsy::Api::Receipt.new.shop_receipts((Time.now 2.weeks).to_i); ehr = Etsy::Handler::Receipts.new(sr); ehr.handle | [
{
"docid": "c6c3e2c77b099018c36767ec47780afa",
"score": "0.62147456",
"text": "def handle\n # Loop through every receipt in the results and determine what to do with them\n @receipts['results'].each do |receipt|\n # First, if there's not been a change in a couple days, just skip i... | [
{
"docid": "dc013778dea2bd27a3e196dcadf7367f",
"score": "0.5910516",
"text": "def receipt\n end",
"title": ""
},
{
"docid": "dc013778dea2bd27a3e196dcadf7367f",
"score": "0.5910516",
"text": "def receipt\n end",
"title": ""
},
{
"docid": "107a447088a265920f23d00fc05b8698... |
c54cf4e0c85339b65323cb137583041b | Gets the resourceLocation property value. The resource URI for the result. | [
{
"docid": "e911ed812d319fb1beed21f500c7dac8",
"score": "0.8127793",
"text": "def resource_location\n return @resource_location\n end",
"title": ""
}
] | [
{
"docid": "83cafc8ebadd071e1c424a36ddb65631",
"score": "0.7781399",
"text": "def resource_location\n self.class.resource_path\n end",
"title": ""
},
{
"docid": "6322aaa6b9440039986f619ca81b1d99",
"score": "0.74628514",
"text": "def location_uri\n return @locat... |
883c24e43362c16de50f6c3bc30ae4d3 | DELETE /shipping_lines/1 DELETE /shipping_lines/1.json | [
{
"docid": "150527754e1ab654db5dcccb6ba7ff3f",
"score": "0.8140101",
"text": "def destroy\n @shipping_line = ShippingLine.find(params[:id])\n @shipping_line.destroy\n\n respond_to do |format|\n format.html { redirect_to shipping_lines_url }\n format.json { head :no_content }\n end\... | [
{
"docid": "07289f87aa35332881c5b0f613addd8e",
"score": "0.79331917",
"text": "def destroy\n @shipping_line.destroy\n respond_to do |format|\n format.html { redirect_to shipping_lines_url, notice: \"Shipping line was successfully destroyed.\" }\n format.json { head :no_content }\n end... |
eb1da1f240a0306ac3df4fa6bcb7896f | def show brand = Brand.find_by(id: params[:id]) render json: BrandSerializer.new(brand, options).serialized_json end | [
{
"docid": "2c171072c10db9b1ef5c12c160c62374",
"score": "0.9263512",
"text": "def show\n brand = Brand.find_by(name: params[:name]) \n\n render json: BrandSerializer.new(brand, options).serialized_json \n end",
"title": ""
}
] | [
{
"docid": "32d0c9489e79e5e88d5d586af7cfec92",
"score": "0.91454196",
"text": "def show\n @brand = Brand.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @brand }\n end\n end",
"title": ""
},
{
"docid": "f3b86b8613e8b... |
6c5d0e9b153e62c88734f8c9670a6f37 | Apply for a collection of Positions PUT /positions/apply | [
{
"docid": "ecdbdddef5ee0e571522f731eee5a685",
"score": "0.71438074",
"text": "def apply\n positions_hash = params[:position]\n positions = self.extract_apply positions_hash\n @applied = Position.apply(positions, current_user)\n\n redirect_to :root\n end",
"title": ""
}
] | [
{
"docid": "147246d0dc0ecc2461983e5001e21247",
"score": "0.6892988",
"text": "def update_positions\n params[:positions].each do |id, index|\n Slide.where(:id => id).update_all(:position => index)\n end\n\n respond_to do |format|\n format.js { render :text => 'Ok' ... |
4533c0b5d95dc8f00e4c48d5c168e327 | Pick unit ids from list of [id, volume] pairs. | [
{
"docid": "84e88f9b35837f7a4a9feadf3f445bc3",
"score": "0.71459675",
"text": "def pick_unit_ids_from_list(available_yours, available_ally, volume_left)\n unit_ids = Set.new\n # Duplicate to prevent messing around with original arrays.\n [available_yours.dup, available_ally.dup].each do |... | [
{
"docid": "245ea292271dd233ae2dccfe61c9be3c",
"score": "0.61509824",
"text": "def pick_unit_ids(player_id, planet_ids, ally_player_ids, ally_planet_ids,\n total_volume)\n relation = Unit.select(\"id, type\")\n block = lambda do |row|\n [row['id'], PORTAL_UNIT_VOLUMES[row['type']... |
e2bdb9fdac1beaca0106f9b2eecc1c65 | undecided on how to search images in docker hub. | [
{
"docid": "2041c881766e2542faddaf36b6789fc6",
"score": "0.0",
"text": "def container_search\n res = @search_context\n res.each do |r|\n @results.add(r)\n end\n end",
"title": ""
}
] | [
{
"docid": "d77752e613348b2ffbcc0b1eceb22004",
"score": "0.6843978",
"text": "def descargarImagen\n Docker::Image.search('term' => 'sshd')\n image = Docker::Image.create('fromImage' => 'ubuntu:14.04')\nend",
"title": ""
},
{
"docid": "b952ff9c6e7f007bc9f6352e04336bf5",
"score": "0.... |
cb87ff0a42d791739b6b9367d1f6fa86 | GET /contacts/1 GET /contacts/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "f856271e9547c8a8f1e4a8fec61cb6b5",
"score": "0.7591177",
"text": "def show\n @contact = Contact.find(params[:id])\n\n render json: @contact\n end",
"title": ""
},
{
"docid": "b5a68395dd9943fde02e8ecc1bcb6570",
"score": "0.7570335",
"text": "def index\n @contacts... |
f3d7a2994a4af1808be8dd5312cd5973 | Returns the thread on given board with given number | [
{
"docid": "e90cced4ddb3f69f98f228e6385ae90b",
"score": "0.80099744",
"text": "def get_thread(board, number)\n url = @host + \"/#{board}/thread/#{number}.json\"\n request = HttpRequest.new(:get, url)\n response = execute(request)\n\n begin\n dto... | [
{
"docid": "675846d477dd8bf749dc5afba3f38f92",
"score": "0.66887504",
"text": "def board_for(player_num)\n @boards[player_num - 1]\n end",
"title": ""
},
{
"docid": "639492d6013aea173aa603984718084c",
"score": "0.6657048",
"text": "def get_thread id\n @threads[id]\n end",... |
508f6ac164b87586fe1af22f82d28678 | Handler for Basic.Ack. By default, it just executes hook specified via the confirm method with a single argument, a protocol method class instance (an instance of AMQ::Protocol::Basic::Ack). | [
{
"docid": "a22cf1f5547d49d6c15a77457da81cfc",
"score": "0.6727722",
"text": "def handle_basic_ack(method)\n self.exec_callback(:ack, method)\n end",
"title": ""
}
] | [
{
"docid": "282b7d794acad7bd56a6b6a7a0085782",
"score": "0.68729955",
"text": "def ack\n @mq.callback{\n @mq.send Protocol::Basic::Ack.new(:delivery_tag => properties[:delivery_tag])\n }\n end",
"title": ""
},
{
"docid": "ee4af082a2af5579e62021904c1c0727",
"score": "0... |
8b0935c264126cda203cefbb21897402 | GET /schoolrooms GET /schoolrooms.json | [
{
"docid": "4b6e6256309d9ebc0b80c2bafd9ccd3f",
"score": "0.0",
"text": "def index\n redirect_to(rooms_path)\n end",
"title": ""
}
] | [
{
"docid": "13682bd0857836e9179ecdc2b1f3cce2",
"score": "0.7478707",
"text": "def rooms()\n require_authentication!\n options = make_options(\"getRooms\")\n response = self.class.post(\"/WebUntis/jsonrpc.do;jsessionid=#{@session_id}?school=#{@school}\", options)\n raise response[\"error\"][\... |
5a985003739e6eddae8870492c2c4c4b | adds http:// if it isn't there | [
{
"docid": "c08980e01be324c88447a12305d0e8dd",
"score": "0.0",
"text": "def absolute_website_url\n if author.website.blank?\n nil\n elsif author.website[0,7] == \"http://\" or author.website[0,8] == \"https://\"\n author.website\n else\n \"http://#{author.website}\"\n end\n e... | [
{
"docid": "b74d9d93b9b5a1b4ebe70ed88258cd58",
"score": "0.87360126",
"text": "def add_http_if_needed\n if !full_url.match(/^((http|https):\\/\\/)/)\n \"http://\" + full_url\n else\n full_url\n end\n end",
"title": ""
},
{
"docid": "5a2c95242af19169c1af369bb57cf81c",
... |
91cc293667d2b6b1b1aa52ce323afbb7 | class User < ActiveRecord::Base has_attached_file :avatar end | [
{
"docid": "d672a64cd244d579152dbe20e7f38040",
"score": "0.0",
"text": "def geocode?\n !(address.blank? || (!latitude.blank? && !longitude.blank?))\n end",
"title": ""
}
] | [
{
"docid": "fb3162fc2567c59c58af66333f42775f",
"score": "0.75153124",
"text": "def user_avatar(user_id)\n user = User.find!(user_id)\n if user.avatar.attached?\n image_tag user.avatar\n else\n image_tag \"../images/Littlefinger_Main.jpg\"\n end\n end",
"title": ""
},
{
... |
81827eaed30124939d6516275fd0797e | DELETE /rules/1 DELETE /rules/1.json | [
{
"docid": "0eee706279ddfcba0560dbeaa2402b85",
"score": "0.7588715",
"text": "def destroy\n @rule.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "94835745ecfd4ebb29982e86d7dfba58",
"score": "0.767555",
"text": "def destroy\n return if @name.nil?\n delete_rest \"rules/#{@name}\"\n end",
"title": ""
},
{
"docid": "8f5626d3ef2f099b2999043d18cae5cd",
"score": "0.7470095",
"text": "def destroy\n @rule.de... |
877a4c03a923a3a18dfa583118d2e4ce | GET /gemes/1 GET /gemes/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "72259f4dfc8d94c0a1c619887b322fe4",
"score": "0.69098836",
"text": "def index\n @gemes = Geme.all\n end",
"title": ""
},
{
"docid": "fd88a2245ad619bb7740cfc430408c01",
"score": "0.6370943",
"text": "def new\n @programme = Programme.new\n gon.programmes = Programm... |
92224a786551f0983e131e7795394653 | PUT /albums/1 PUT /albums/1.json | [
{
"docid": "b09dc0082d0b23ea9c8e55ac7a2ee3c6",
"score": "0.66655827",
"text": "def update\n\n @album = Album.find(params[:id])\n create_or_update_album(params, \"edit\")\n end",
"title": ""
}
] | [
{
"docid": "bce0559a581c2b0865efc67b79de0a21",
"score": "0.7266428",
"text": "def update\n if @album.update(album_params)\n render json: @album, status: :ok\n else\n render json: @album.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9fa11b7... |
fd5ccb2baa582bcab4581ba0ae3ab511 | Encodes a scanline of a pixelstream using UP filtering. This will modify the stream. | [
{
"docid": "90653b106c7633b078016cb4bc721b02",
"score": "0.6691622",
"text": "def encode_png_str_scanline_up(stream, pos, prev_pos, line_width, pixel_size)\n line_width.downto(1) do |i|\n b = prev_pos ? stream.getbyte(prev_pos + i) : 0\n stream.setbyte(pos + i, (stream.getbyte(p... | [
{
"docid": "7c38c4155b1b56d09cca478d4e1f008b",
"score": "0.6349715",
"text": "def encode_png_scanline_up(original_bytes, previous_bytes, pixelsize = 3)\n encoded_bytes = []\n for index in 0...original_bytes.length do\n b = previous_bytes[index]\n encoded_bytes[index] = (o... |
b3718c1d62a6826074f166be475d5db2 | Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.contact_mailer.confirmation.subject def confirmation | [
{
"docid": "df8bcebc7e53ab0e98a6449aa6754435",
"score": "0.5947641",
"text": "def confirmation(email)\n @greeting = \"Hallo\"\nmail to: email,\nfrom: ENV[\"MAIL_USERNAME\"],\nsubject: \"Vielen Dank, Wir haben Ihre Nachricht erhalten!\"\nend",
"title": ""
}
] | [
{
"docid": "8928fe4f050d7ebd3e9aa992b07e320a",
"score": "0.7481628",
"text": "def subject_for\n ActiveSupport::Deprecation.warn \"subject_for\"\n I18n.t(:\"subject\", scope: [:notifications, :mailer],\n default: [:subject])\n end",
"title": ""
},
{
"docid": "... |
a5f48312025fca1aaa3e8a3cac84ba39 | retrieve the zone id | [
{
"docid": "49202d0da683d80c7d9db5eb7c8c4c31",
"score": "0.847556",
"text": "def get_zone_id\n uri = URI.parse(@cf_uri)\n params = \"name=#{@zone}\"\n request = \"Net::HTTP::Get.new(uri.path+'?'+params, headers)\"\n response = \"json.fetch('result').first['id']\"\n make_request(params, ur... | [
{
"docid": "3325b0cbf40e524551973f23f67d8619",
"score": "0.8560925",
"text": "def zone_id\n route_53_client.\n list_hosted_zones[:hosted_zones].\n each.\n select { |z| z[:name] == zone }.\n map {|z| z[:id] }.\n first\n end",
"title": ""
},
{
"docid": "b... |
75d910263372eafcd2164140db7ebdb8 | Overrides the JSON method to include some values from the email_client | [
{
"docid": "c3eb1cc5efcec0d3b267249de86bf493",
"score": "0.7188314",
"text": "def to_json\n {\n email_client: ENV['EMAIL_CLIENT'],\n id: email_client.id,\n sent: email_client.sent?,\n to: @to,\n to_name: @to_name,\n from: @from,\n from_name: @from_name,\n subje... | [
{
"docid": "5e16efdf5fdff87f6db327ed52cc8fe6",
"score": "0.73289853",
"text": "def for_email(values={})\n as_json.merge(values)\n end",
"title": ""
},
{
"docid": "dc700679be261f016f9ce385ae32cc5d",
"score": "0.7214291",
"text": "def as_json options ={}\n super(:only => [:email... |
c227fb5d0d3f68401999f7cc41b6172a | GET: /beers/:id (returns a single record) | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "c51c84f79ccb8e44447a6696a1ed1aac",
"score": "0.81257623",
"text": "def get_beer\n @beer = Beer.find(params[:id])\n end",
"title": ""
},
{
"docid": "1875ceed8e15b51e183ef55daed3cffc",
"score": "0.78815824",
"text": "def show\n @beer = Beer.find(params[:id])\n end",... |
a794934dea9660482dbe03cbef208306 | returns an array with all defined attribute names | [
{
"docid": "dded8ebd70038cc29622a238b431fe14",
"score": "0.7923086",
"text": "def attributes\n @attrs.keys\n end",
"title": ""
}
] | [
{
"docid": "c4698ec2f29d218c3b880dbe94bb22eb",
"score": "0.8505624",
"text": "def attribute_names\n names = []\n @attributes.each {|values| names << values.keys if values}\n names.flatten.uniq\n end",
"title": ""
},
{
"docid": "f5449dbb98bc4fb3a8e9410fd6f79ca7",
"score": "0.847... |
9ac53189b2ee167a10e50ee708ea204d | Overridden from SslRequirement to allow local requests | [
{
"docid": "a7d53df16b9c416ce11bf019178bcbd5",
"score": "0.65328497",
"text": "def ssl_required?\n return false if local_request? || RAILS_ENV == 'test'\n super\n end",
"title": ""
}
] | [
{
"docid": "364181178d0b9d0933e73bca13bcaf2d",
"score": "0.70016843",
"text": "def ssl?; end",
"title": ""
},
{
"docid": "4747f3f3433aae3377693d006fa5ddfe",
"score": "0.6794168",
"text": "def ssl_required?\n\n true\n end",
"title": ""
},
{
"docid": "ed76217264bb228f25... |
5928556b04c4e089e3f39cd1f0cf5ba3 | POST /tests POST /tests.json | [
{
"docid": "2579a090253af296e07e94218ca8b0bf",
"score": "0.62666476",
"text": "def create\n @testcase = Testcase.new(params[:testcase])\n\n respond_to do |format|\n if @testcase.save\n format.html { redirect_to @testcase, :notice => 'Test was successfully created.' }\n format.js... | [
{
"docid": "935f41397d2070970950fcf91d906b7b",
"score": "0.7214356",
"text": "def v2_tests_post(test_detail, opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: TestsApi#v2_tests_post ...\"\n end\n \n # verify the required parameter 'test_detail... |
e49d9653ee944129dbc01531f69ad471 | Local variables are extracted from first frame of backtrace. source://honeybadger//lib/honeybadger/notice.rb128 | [
{
"docid": "f4a344696272cc01c12fbb15872830e1",
"score": "0.5594191",
"text": "def local_variables; end",
"title": ""
}
] | [
{
"docid": "7b5c97cac650483de851ecfe52d893c2",
"score": "0.6600871",
"text": "def full_backtrace=(_arg0); end",
"title": ""
},
{
"docid": "ca25df88e425b4f805079e6b476322cc",
"score": "0.6592002",
"text": "def use_full_backtrace; end",
"title": ""
},
{
"docid": "73270207b9... |
1d958455eb05d0b4c33be58e3a263dde | DELETE /phonos/1 DELETE /phonos/1.json | [
{
"docid": "34cfca22641604fbcc32a1452f6f68d4",
"score": "0.7518028",
"text": "def destroy\n @phono = Phono.find(params[:id])\n @phono.destroy\n\n\n respond_to do |format|\n format.html { redirect_to phonos_url }\n format.json { head :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "eeaef51566f475145f33f978642e27b2",
"score": "0.7419488",
"text": "def destroy\n @phone1 = Phone1.find(params[:id])\n @phone1.destroy\n\n respond_to do |format|\n format.html { redirect_to phone1s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
... |
572b0314923dc54f37a87338bc81b50a | Causes the set of ondisk host key files to be used to be set to the given array. Any host key files that were specified previously are lost. | [
{
"docid": "6f9415b9f7c7bbffa367dfd6ed1d1be7",
"score": "0.7705968",
"text": "def set_host_key_files( files )\n @key_manager.clear_host!\n files.each { |file| @key_manager.add_host_key file }\n end",
"title": ""
}
] | [
{
"docid": "f71b01a10e06b6219d1d130bbb7d291a",
"score": "0.694943",
"text": "def set_key_files( files )\n @key_manager.clear!\n files.each { |file| @key_manager << file }\n end",
"title": ""
},
{
"docid": "da363cd6d214703d2de01e68f9f4bc16",
"score": "0.59334075",... |
ccf7f89b5c7b349c7b23288770d757a8 | tested with 1000, though it takes a while | [
{
"docid": "1445593c4984a144cf358ef7bfe03391",
"score": "0.0",
"text": "def nr_chunks\n ENV['NR_CHUNKS'] ? ENV['NR_CHUNKS'].to_i : 10\n end",
"title": ""
}
] | [
{
"docid": "834f78682ad3c456a1aaf4193baefef4",
"score": "0.60827535",
"text": "def eu1\n # .00028s | 1000 silent iterations\n total = 0\n (1..1000).each { |i| total += i if i % 3 == 0 or i % 5 == 0 }\n return total\nend",
"title": ""
},
{
"docid": "42a376771c0483184eed81072ec4d0af",
... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "1cb656d66683cc87f7e0520ff5088319",
"score": "0.0",
"text": "def port_mapping_template_params\n params.require(:port_mapping_template).permit(\n :service_name, :target_port, :transport_protocol, :application_protocol, :appliance_type_id)\n end",
"title": ""
}
] | [
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.7121987",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.70541996",
"text": "def expected_permitted_parameter_names; end",
"title": "... |
5f32761b6c8f6e549096bd3e6300e941 | POST /quick_poll_responses POST /quick_poll_responses.json | [
{
"docid": "b39bb374f9367ac690bad6b629b3dc25",
"score": "0.67881286",
"text": "def create\n\n response = params[:quick_poll_response]\n quick_poll_id = response[:quick_poll_id]\n browser_fingerprint = response[:browser_fingerprint]\n \n logger.info(\"browser fingerprint = \" + browser_fin... | [
{
"docid": "38bd5e3f80f90eb91f43bd482e21f991",
"score": "0.65147835",
"text": "def create\n\n response = params[:quick_poll_response]\n response[:user_id] = current_user.id\n response[:value] = params[:value] # i have no fucking idea what's going on here and it's too fucking late to think ab... |
9df9b155f4580aa08bb10635b33b1396 | Expected sequence of events: :before_call will save our cross application request id to the thread :after_call will write our response headers/metrics and clean up the thread | [
{
"docid": "a71c9c5a88145a685a2c64ceed3b6fe1",
"score": "0.52754635",
"text": "def register_event_listeners(events)\n NewRelic::Agent.logger\n .debug('Wiring up Cross Application Tracing to events after finished configuring')\n\n events.subscribe(:before_call) do |env| # THR... | [
{
"docid": "ee61f6a120e1627ab7c2d9146b5a6edd",
"score": "0.6350613",
"text": "def after_request(&block); end",
"title": ""
},
{
"docid": "0566d1ba0fc0ac90c801dd10df186c37",
"score": "0.6186507",
"text": "def finish_request(*args)\n proxy_callback :finish_request, *args\n ... |
f0275a301316d0b8574ebb207a847e30 | !/bin/ruby Complete the breakingRecords function below. | [
{
"docid": "daa126a5aeb7197f4ec52bac0e584e41",
"score": "0.0",
"text": "def breakingRecords(score)\n min = max = score.first\n result = [0, 0]\n score.drop(1).each do |num|\n if num > max\n max = num\n result[0] += 1\n elsif num < min\n min = num\n result[1] += 1\n end\n ... | [
{
"docid": "fd79fc0b57e0515a345efafc9670d0fc",
"score": "0.6057252",
"text": "def breaking_records(scores)\n min, max = scores[0], scores[0]\n record_breaks = [0,0]\n scores.drop(1).each do |score|\n if score < min\n min = score\n record_brea... |
a285867c20cda54161b18fab321f7f01 | Call Looksee.lookup_path on this object. (Added by Looksee.) | [
{
"docid": "0a298a6e9e676a398cdc610dcf34195e",
"score": "0.83392537",
"text": "def lookup_path(*args)\n Looksee.lookup_path(self, *args)\n end",
"title": ""
}
] | [
{
"docid": "7154a3351ef05f7b564f64881af0d9b0",
"score": "0.7439654",
"text": "def lp(*args)\n Looksee.lookup_path(*args)\n end",
"title": ""
},
{
"docid": "0cb75389f0d57048ce162370167c9213",
"score": "0.71011096",
"text": "def dump_lookup_path(*args)\n p lookup_path(*args)\n ... |
d9796e38c4413775bc328342211e8a1b | Constructs a new worker. | [
{
"docid": "db33f8394222aef08ef30d565cfe8cb2",
"score": "0.0",
"text": "def initialize(retryable)\n @retryable = retryable\n end",
"title": ""
}
] | [
{
"docid": "61cd8e27b9f5b7f7441d801d7ee3189e",
"score": "0.7554682",
"text": "def initialize(worker)\n @worker = worker\n end",
"title": ""
},
{
"docid": "23d3fb9d505b8b25be77325a96bd3e8a",
"score": "0.74488586",
"text": "def new(*constructor_args)\n @proxy.new do |*ca... |
58a8d0b7a6182cef709e24cdfe8e5b3c | Specifies which directories contain the source code for your project. When a failure occurs, RSpec looks through the backtrace to find a a line of source to print. It first looks for a line coming from one of the project source directories so that, for example, it prints the expectation or assertion call rather than th... | [
{
"docid": "763dafab9f30be351014bd549b8bf0f5",
"score": "0.6771182",
"text": "def project_source_dirs; end",
"title": ""
}
] | [
{
"docid": "d2241f0a0811a568ea5ca10b14b684fe",
"score": "0.6848285",
"text": "def source_paths\n [__dir__]\nend",
"title": ""
},
{
"docid": "d2241f0a0811a568ea5ca10b14b684fe",
"score": "0.6848285",
"text": "def source_paths\n [__dir__]\nend",
"title": ""
},
{
"docid": "... |
645fefe6447add27c0e73a6d665c4f6b | Render and deliver the chart | [
{
"docid": "7b2387d4bb50d9371263c39f15788192",
"score": "0.0",
"text": "def getchart()\n #\n # We use a random table to simulate generating 12 months of data\n #\n\n # Create the random table object with 4 cols * 12 rows, using 3 as seed\n rantable = ChartDirector::... | [
{
"docid": "10f0fd08053a77cd94b99ad428d49cd6",
"score": "0.77458507",
"text": "def draw\n \"<div class='line-graph-container'><div class='y-axis'></div><div class='line-graph' data-chart='#{self.get_data}'></div></div>\".html_safe\n end",
"title": ""
},
{
"docid": "31beb7536bc44139... |
5190538988df4ec9b658f0ddb6c83fa0 | GET /categories GET /categories.json | [
{
"docid": "9b92e329c2aba4fc443115c528729cdb",
"score": "0.0",
"text": "def index\n @categories = Category.sorted\n end",
"title": ""
}
] | [
{
"docid": "efcb5e10780279c84a4be599091f0268",
"score": "0.8529297",
"text": "def categories\n call_api('/categories')\n end",
"title": ""
},
{
"docid": "3cba43678b445865af5afd71d9719de9",
"score": "0.84926367",
"text": "def get_categories()\n response = RestClient.get @ho... |
00df63d443121ecfcef55956f520aee6 | This is for the frbr related data | [
{
"docid": "089292b0f30b8269a7e5e92ff1e28867",
"score": "0.5816835",
"text": "def related\n @work = Work.find(params[:id])\n mode = params[:mode]\n logger.debug \"MODE:#{mode}\"\n \n retrieve_frbr_objects_using_mode(@work, \"frbr_\"+mode) #hide frbr_ from URL\n @sub_partial_path = \"s... | [
{
"docid": "3abef5b8fc20b9e1da97af9962196118",
"score": "0.5803306",
"text": "def frbr_id\n @frbr_id ||= facets_frbrgroupid if frbr?\n end",
"title": ""
},
{
"docid": "80363631cebade0e9ef3f8882509b99d",
"score": "0.5773903",
"text": "def details; end",
"title": ""... |
d58a30078debd0043c1647c703c64ec8 | improved method add put message into $stderr | [
{
"docid": "974db2bd6b31e56e353ffdc7dbdecbde",
"score": "0.0",
"text": "def add(severity, message = nil, progname = nil, &block)\n if message.nil?\n if block_given?\n msg = yield\n else\n msg = progname\n end\n end\n\n case severity\n #when WARN\n #\t$stde... | [
{
"docid": "f58c94f05ce6618e2871f5d9ab5bd81b",
"score": "0.767358",
"text": "def error(msg) $stderr.puts(\"Error: #{msg}\") end",
"title": ""
},
{
"docid": "198f143900cdb263f4cf0bb41f13b269",
"score": "0.7543136",
"text": "def err(message)\n stderr.puts message\n end",
"t... |
3a2058f0ec8614cc33f5b20974f397f1 | DELETE /timesheets/1 DELETE /timesheets/1.json | [
{
"docid": "05006c1105985eb7c25555059019b506",
"score": "0.77474433",
"text": "def destroy\n @timesheet.destroy\n respond_to do |format|\n format.html { redirect_to timesheets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "fee394ae29d4840786fb2645fad5b7a6",
"score": "0.7728515",
"text": "def destroy\n @timesheet = Timesheet.find(params[:id])\n @timesheet.destroy\n\n respond_to do |format|\n format.html { redirect_to timesheets_url }\n format.json { head :no_content }\n end\n end",
"t... |
5d4e9827d41653dacf9dcb44344db4bd | a Class name: what is this a batch of? This mocks out the behavior of Hydra::PCDM::PcdmBehavior | [
{
"docid": "32571446f3d3c27fd49bf166f21ff471",
"score": "0.0",
"text": "def in_collection_ids\n []\n end",
"title": ""
}
] | [
{
"docid": "e1b92a5a3a16220dcb04794db6632171",
"score": "0.5423964",
"text": "def any_instance_recorders; end",
"title": ""
},
{
"docid": "b4ec3c8884708900bb86f877b43501db",
"score": "0.5408212",
"text": "def behavior; end",
"title": ""
},
{
"docid": "b4ec3c8884708900bb86... |
e774635a23543bdc9d6dfb669803c08a | DELETE /like_lists/1 DELETE /like_lists/1.json | [
{
"docid": "07ea02b6b91249e383d9ba2102548c2a",
"score": "0.7781825",
"text": "def destroy\n @like_list.destroy\n respond_to do |format|\n format.html { redirect_to like_lists_url, notice: 'Like list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"... | [
{
"docid": "835c46035f10a367f7e177a0a34f5992",
"score": "0.755934",
"text": "def delete\n render json: Like.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "dbc3867d41a707ee41dd04495ecdc8f4",
"score": "0.7242584",
"text": "def delete_list(user, list)\n delete(\"/#{u... |
f56d98ba198e121b4138eb9ee4889a3e | This method is used to invoke ransomware_mac to encrypt file | [
{
"docid": "8da66a9dcdbb1ec898f8c391df7b1924",
"score": "0.63967735",
"text": "def start_attack()\n\tthreads = []\n\tdest_folders = ['/tmp/*']\n\tif windows?\n\t\t# if the temporary folder does not exist, then create it\n\t\tdest_folders = ['C:/tmp/*']\n\tend\n\tDir.glob(dest_folders) do |full_file_path... | [
{
"docid": "c994e53e29d2f61b71c4367a8a08c8c3",
"score": "0.68127024",
"text": "def encrypt(file_name, password); end",
"title": ""
},
{
"docid": "324f1d27a7bc6d0f350f2bad0eca9042",
"score": "0.64537615",
"text": "def encrypt_file_ccrypt(decrypted_pathname, encrypted_pathname, key)\n ... |
9878116f7b10aad94578359c26f2b469 | use ERB and binding to evaluate templates pass the rendered html to render_content | [
{
"docid": "7530d83d55147273c286b6d2e9fb2906",
"score": "0.0",
"text": "def render(template_name)\n \n # 1 - path = set up your path\n # 1a look up ActiveSupport#underscore\n # 1b think of following path views/#{controller_name}/template_name.html.erb\n # 2 - file = File.read(path)\n #... | [
{
"docid": "a2040615a98c5e3c3c6dbc1a6e7cf282",
"score": "0.7794342",
"text": "def process_template(content)\n ERB.new(content, 0, \"%<>\").result(binding)\n end",
"title": ""
},
{
"docid": "e4584e366224a98355023968125d5067",
"score": "0.7719098",
"text": "def render(c... |
b84f7dc843d0ada0740872ec9a89813b | DELETE /article_groups/1 DELETE /article_groups/1.json | [
{
"docid": "a53874f066f1f09a5d7cd2a17e027f5b",
"score": "0.7753876",
"text": "def destroy\n @article_group.destroy\n respond_to do |format|\n format.html { redirect_to article_groups_url, notice: t('helpers.flashes.destroyed', :model => ArticleGroup.model_name.human.titleize) }\n format.... | [
{
"docid": "343df95f9074f3588ef6b4ed7e4525a9",
"score": "0.78290164",
"text": "def destroy\n @articles_group.destroy\n respond_to do |format|\n format.html { redirect_to articles_groups_url, notice: 'Articles group was successfully destroyed.' }\n format.json { head :no_content }\n en... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "115e4af09e16ec32ddb4df23c7b6460b",
"score": "0.0",
"text": "def set_match_participant\n @match_participant = MatchParticipant.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... |
d2f02f57bd2b3fa81adb6e54dedf26a5 | def edit end def update end | [
{
"docid": "0a242797786ad9abba79a3d0952ff0c6",
"score": "0.0",
"text": "def destroy\n @ssh_key.destroy\n flash[:success] = \"Removed ssh_key: #{ @ssh_key.name }\"\n redirect_to ssh_keys_path\n end",
"title": ""
}
] | [
{
"docid": "03269b7353e60e7e373ef0b15969a043",
"score": "0.90029114",
"text": "def edit() end",
"title": ""
},
{
"docid": "03269b7353e60e7e373ef0b15969a043",
"score": "0.90029114",
"text": "def edit() end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
... |
13ecd62989ddb2f3f3717a2342e99509 | Adds a report to the report collection, and sets the run interval according to the +cron_def+ parameter. | [
{
"docid": "4cbfc23e33c6bb35b966fc9020428d7b",
"score": "0.7581875",
"text": "def report(report_class, cron_def = nil)\n @reports << report_class.new(cron_def)\n end",
"title": ""
}
] | [
{
"docid": "c9503f860fe24f435bb8064b96e2e636",
"score": "0.63623655",
"text": "def run\n schedule_data_reports\n end",
"title": ""
},
{
"docid": "78b04e44f1264df051af181e4d7997a8",
"score": "0.6252953",
"text": "def add_report\n # TODO: should traverse listener queue f... |
6b47706738adc239543195be506c82a3 | Get User's Voicemails Retrieve a user's Zoom Phone voicemails. Scopes: `phone:read`, `phone:read:admin` Prerequisite: 1. Business or Enterprise account 2. A Zoom Phone license | [
{
"docid": "f797849ebc136a7736ed0a7e0e847f97",
"score": "0.46310756",
"text": "def phone_user_voice_mails(user_id, opts = {})\n data, _status_code, _headers = phone_user_voice_mails_with_http_info(user_id, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "06b0ee50baf102499bf5212451ca4dee",
"score": "0.55616903",
"text": "def phone_user_voice_mails_with_http_info(user_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PhoneApi.phone_user_voice_mails ...'\n end\n # verify the r... |
c8355409dadc22a31facc2695470c409 | GET /competitors/1 GET /competitors/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "d9a13e6060db040cb8eb31669cf62ed5",
"score": "0.7955939",
"text": "def show\n @competitor = Competitor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competitor }\n end\n end",
"title": ""
},
{
"docid": ... |
916edd05b931dae25d24f93580bebb6a | DELETE /foods/1 DELETE /foods/1.json | [
{
"docid": "cecb829b2e35bd84b40e8cebd218b1c9",
"score": "0.6527647",
"text": "def destroy\n @store_detail = StoreDetail.find(params[:store_detail_id])\n @food = Food.find(params[:id])\n @food.destroy\n respond_to do |format|\n format.html { redirect_to store_detail_foods_path(@store_... | [
{
"docid": "689d5a07a403c4b765ba178e4aff08a3",
"score": "0.72070444",
"text": "def delete\n client.delete(\"/#{id}\")\n end",
"title": ""
},
{
"docid": "81fea0de18bbf5c2afe4065a48a2d216",
"score": "0.718766",
"text": "def destroy\n @food = Food.find(params[:id])\n @food... |
94fd1780acf9c7e06bf18404a10c3b4b | this is special action we've created to give us list of proposed books | [
{
"docid": "8e4fd0f5683fd2283d959eda46c1fc8f",
"score": "0.69305587",
"text": "def proposed\n @books = Book.proposed.by_category.paginate(:page => params[:page]).per_page(10)\n end",
"title": ""
}
] | [
{
"docid": "450330309e5ce291f21d17c61a3e6027",
"score": "0.74354964",
"text": "def index\n @proposed_books = current_user.ProposedBook\n end",
"title": ""
},
{
"docid": "4b62a803083c6274998f54f563e45e18",
"score": "0.7076968",
"text": "def index\n @provided_books = ProvidedB... |
9236e036c68b712fc4ca77d4b2b0e0e9 | Creates a new empty bitmap with white colour (O) | [
{
"docid": "22fb5c2daf7ab0fb8a7f7b5a646eab47",
"score": "0.0",
"text": "def initialize(width, height)\n @width = width.to_i\n @height = height.to_i\n @data = Array.new(@height) { Array.new(@width, '0')}\n end",
"title": ""
}
] | [
{
"docid": "c9b0ccd76e00f929ee7839f02a66a256",
"score": "0.72950435",
"text": "def black_bitmap\n bitmap = Bitmap.new(80, 60)\n bitmap.fill_rect(0,0,80,60,Color.new(10,10,10))\n return bitmap\n end",
"title": ""
},
{
"docid": "77e9321d37fca1238c7027b9ced37a65",
"score": "0.6932... |
26642a1bba8953f72a4efe699fd81fc5 | Returns the list of constants matching the options hash. | [
{
"docid": "b6c5dd5dc33b38a8012ab0a51b14cf54",
"score": "0.57175505",
"text": "def constants(opts = T.unsafe(nil)); end",
"title": ""
}
] | [
{
"docid": "8ba90f869d848c78d0c40a24585270dc",
"score": "0.69124305",
"text": "def constants\n\t\tselect {|x| x.class == Constant }\n\tend",
"title": ""
},
{
"docid": "a536113d85eb2d46ad70a64680c3d4e0",
"score": "0.6661126",
"text": "def list\n @@list ||= constants.inject({}){|a, ... |
9955e5ef47be12be3a10a37a649120e1 | alerts contact of event the message is passed to the remote XMPPBot with DRb | [
{
"docid": "29d6e04c5757d57853e151159a0dcb19",
"score": "0.0",
"text": "def notify(message, time, priority, category, host)\n begin\n @xmpp.send_message_all(XmppBot.format.call(message, priority, category, host))\n self.info = \"sent jabber message\"\n rescue => e\n ... | [
{
"docid": "b45da09fe446a99bbccbfc0fef992804",
"score": "0.6003303",
"text": "def message(event) end",
"title": ""
},
{
"docid": "4d120602e249911998a84c752fb0c782",
"score": "0.59611183",
"text": "def on_message(msg); end",
"title": ""
},
{
"docid": "4d120602e249911998a84... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "677ef9964f61965cac1d2e350dd1a6b7",
"score": "0.0",
"text": "def set_score\n @score = Score.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;... |
da3ca30c210d46d0a6df2fd02f3e9095 | Finds the users id and updates their parameters | [
{
"docid": "abbbaa559b71f4a003117061ca881828",
"score": "0.0",
"text": "def update\n @user = User.find(params[:id])\n if @user.update(user_params)\n redirect_to @user\n else\n render action: \"edit\"\n end\n end",
"title": ""
}
] | [
{
"docid": "6db2edfa0eb15ce2b6127bdf260d5b70",
"score": "0.738972",
"text": "def edit\n @users = User.all\n check = Check.get \"\"\n get_login_id\n set_edorg_options\n set_role_options\n @is_operator = is_operator?\n @is_lea = is_lea_admin?\n @is_sea = is_sea_admin?\n @users.e... |
507a42fd3b78355ec809701ce41a8266 | $read, $write = Socket.pair(:UNIX, :DGRAM, 0) | [
{
"docid": "7f2092f98bbba76ff1b7dc7deabe3e3a",
"score": "0.0",
"text": "def start_capture\n\tpid = fork do\n\t\t$read.close\n\t\t#cap = Capture.new(:start => true, :iface => 'eth0', :promisc => true)\n\t\tcap = Capture.new(:start => true, :iface => 'vmnet8', :promisc => true)\n\t\tcap.stream.each do |p|... | [
{
"docid": "ff4dac388479017ee0ca8fde1ecc399e",
"score": "0.6976129",
"text": "def ioctl_socket\n Socket.new(Socket::AF_INET, Socket::SOCK_DGRAM, 0)\n end",
"title": ""
},
{
"docid": "0d31e9bc9a3dcbfb03da5303a3c612e1",
"score": "0.63735217",
"text": "def socket; @socket ||= Fa... |
d3172d7d6e8136f514233321cda19cd4 | =begin Checks the presence of scope attribute value. =end | [
{
"docid": "7498885698f17193805fb02097f748fb",
"score": "0.0",
"text": "def in_scope?(request_scope)\n [*request_scope].all?(&scopes.method(:include?))\n end",
"title": ""
}
] | [
{
"docid": "5ca8ac53f0d0540823ff2227a89984b3",
"score": "0.6657309",
"text": "def scope_condition() \"1\" end",
"title": ""
},
{
"docid": "311526caf75b30eb1800eac4ee5f4120",
"score": "0.66500604",
"text": "def valid_scope(valid_scopes, scope)\n\t\tend",
"title": ""
},
{
"... |
faf17af1ebfeaf2809570c43fe3c5b2d | T I M E | [
{
"docid": "cbd49548b07d72f4d11c7212c6a68243",
"score": "0.0",
"text": "def ts?\n !ts_sec.nil?\n end",
"title": ""
}
] | [
{
"docid": "8d0e128ad87cd20a86507c09c46a6f67",
"score": "0.61699206",
"text": "def termitidae()\n end",
"title": ""
},
{
"docid": "11e4115f2d6fd06ec19d87168fa95b75",
"score": "0.5977257",
"text": "def eagle_view(m, t)\n return (EVALUE**((t*t)/m));\nend",
"title": ""
},
... |
b1ec69e03a92cdccd9fb6aefed792151 | By using the greedy approach let's keep a running max_profit until we reach the end So we've to keep track of lowest price and check if we can get better profit We go through the list once O(n) | [
{
"docid": "f9f6863e1af4e7eec2e555c24ccc8787",
"score": "0.7448631",
"text": "def get_max_profit_v3(yesterday_stock_prices)\n\n min_price = yesterday_stock_prices[0]\n max_profit = 0\n\n # go through every price on the list\n yesterday_stock_prices.each do |current_price|\n\n # ensure m... | [
{
"docid": "7a3178d8b6a312024882c9dbcc88abf0",
"score": "0.8211189",
"text": "def max_profit(prices)\n min_price = prices[0]\n best_profit = 0\n \n prices.each do |price|\n if price < min_price\n min_price = price\n else\n profit = price - min_price\n if profit > best_profit\n ... |
76fc7afdf599e4726af6567c44fd68bd | Represents the current framework being configured. DuckTest.config do puts current_framework => :testunit end | [
{
"docid": "97e9b80a5bc0a14dbdf8f06cba98a4e9",
"score": "0.749402",
"text": "def current_framework\n @current_framework ||= self.default_framework\n return @current_framework\n end",
"title": ""
}
] | [
{
"docid": "f1a0ecea28d1b161929848c3c256deb5",
"score": "0.72305125",
"text": "def current_framework=(value)\n @current_framework ||= self.current_framework\n @current_framework = value.to_sym\n return @current_framework\n end",
"title": ""
},
{
"docid": "508f61ddab78d34774... |
6517e75a6a1e979633e1dd786956bd2f | Generate a feature that has 2 scenarios. The first one should pass and the second one should fail | [
{
"docid": "90a188df086d4044eda8eb272ceb71d7",
"score": "0.7777745",
"text": "def failure_feature_with_two_scenarios\n feature = failure_feature_title + failure_scenario + success_scenario\n steps = failure_step + success_step + \"\\nend\"\n write_feature failure_filename, feature,\... | [
{
"docid": "efcfd5d00d1388d0220dd91d5bbea3ee",
"score": "0.77517897",
"text": "def tagged_failure_feature_with_two_scenarios\n feature = \"@feature\\n\" +\n failure_feature_title +\n \" @failing\" +\n failure_scenario + \"\\n\" +\n \" @passing\\n\" +\n ... |
a96d95646aa87652b5af6a812cc64b43 | Sets the Vanity context. For example, when using Rails this would be set by the set_vanity_context before filter (via Vanity::Railsuse_vanity). | [
{
"docid": "34c03ab5e6fbaa1aa8ed9b14bdd77be4",
"score": "0.825793",
"text": "def context=(context)\n Thread.current[:vanity_context] = context\n end",
"title": ""
}
] | [
{
"docid": "4c2117dec7e48a2ddac4bb2179516a55",
"score": "0.694424",
"text": "def context\n Thread.current[:vanity_context]\n end",
"title": ""
},
{
"docid": "4c2117dec7e48a2ddac4bb2179516a55",
"score": "0.694424",
"text": "def context\n Thread.current[:vanity_context]\n ... |
04c4066a9852e2d0a2bde8c96dfe1064 | Function that render the upload csv file form | [
{
"docid": "62bf743bb4fc978d739264924efae93c",
"score": "0.6562368",
"text": "def view_upload_csv\n @title_page = 'Upload questions'\n erb :upload, layout: :session\nend",
"title": ""
}
] | [
{
"docid": "9277fc1dc19111e45d1a09eb9f402493",
"score": "0.67065096",
"text": "def upload_csv\n datafile = params['csv-file']\n begin\n response = Request.post_request(URL_QUESTION, {\n questions: parse_json(datafile['tempfile'])\n })\n rescue\n redirect '/upload-csv'\n end\n @quest... |
4040d571fa53ce4b0ae71daf9c23d1ca | Stores the data import item instance to use/manipulate it | [
{
"docid": "e5794011c8e596b111181c369a8caa88",
"score": "0.76136017",
"text": "def data_import_item=(value)\n @data_import_item = value\n end",
"title": ""
}
] | [
{
"docid": "4304ad0eef162d0a1bdc912251dfbc0a",
"score": "0.6886409",
"text": "def data_import_item=(_value)\n nil\n end",
"title": ""
},
{
"docid": "545df5faab7da44319c22ec609655845",
"score": "0.66618145",
"text": "def data_import_item=(value)\n nil\n ... |
8c1049c52c5302f1ad6a0d0415c772d9 | POST /sci_episodes POST /sci_episodes.json | [
{
"docid": "51f9ace28537b08e46084a2878711f34",
"score": "0.7627624",
"text": "def create\n @sci_episode = SciEpisode.new(params[:sci_episode])\n\n respond_to do |format|\n if @sci_episode.save\n format.html { redirect_to @sci_episode, notice: 'Sci episode was successfully created.' }\n... | [
{
"docid": "08fb0e9709720722a893bbcb92f6fc99",
"score": "0.7387133",
"text": "def create\n @episode = Pusher.create_episode(params[:episode])\n\n if @episode.valid?\n render json: @episode, status: :created, location: @episode\n else\n render json: @episode.errors, status: :unprocessa... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "b2570e9e5cafbdc86baad913af0794f1",
"score": "0.0",
"text": "def inchicken_dish_params\n params.require(:inchicken_dish).permit(:name, :information, :price)\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... |
f368726253f32b570c21ac46916a35e4 | GET /loadings GET /loadings.json | [
{
"docid": "8a0afe38c24beaa827e2002f525d8649",
"score": "0.6268399",
"text": "def index\n @loadings = Loading.where(tenant_id:params[:tenant_id]).order(date: :DESC)\n end",
"title": ""
}
] | [
{
"docid": "72fa67c293f9e118ebea3516b57fbe93",
"score": "0.73924243",
"text": "def index\n @loadings = Loading.all\n end",
"title": ""
},
{
"docid": "fdade8612915ba9d448ad640307de4ae",
"score": "0.6443346",
"text": "def index\n @listings = Listing.all\n render json: @li... |
32672e7ffc54f60966b24c78785909b0 | creating the commands methods : | [
{
"docid": "6013e32da54201d027731f1ed224de4d",
"score": "0.0",
"text": "def commands\n @commands = []\n\n @tables_arr.each do |table|\n table_name = table[:table_name].singularize.gsub(/\\s+/m, '_').downcase\n\n # if table_name.length <= 1\n # command = \"rails g model #{table_nam... | [
{
"docid": "46e4946b1e097c6421fc25068e5e3003",
"score": "0.8738677",
"text": "def commands\n\t\tend",
"title": ""
},
{
"docid": "5d510b0db1979d7edc1c9bb339529cd6",
"score": "0.8735988",
"text": "def commands; end",
"title": ""
},
{
"docid": "5d510b0db1979d7edc1c9bb339529c... |