query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
9ea7b6f910efd85d26d34a5183f183e0 | Just for completeness. We don't want to be caught lying. | [
{
"docid": "2ce28e81b01da3cac36c8fe804070994",
"score": "0.0",
"text": "def is_poxreference?\n true\n end",
"title": ""
}
] | [
{
"docid": "3947117eb2e2811e4841af36cdcd9830",
"score": "0.7061341",
"text": "def continued_exception; end",
"title": ""
},
{
"docid": "f0c49c2fb48b95f09222ccfb18de7296",
"score": "0.69367254",
"text": "def catch_exceptions; end",
"title": ""
},
{
"docid": "e554c413ad3b5d... |
0f0222a30ab2c4e763d06d85c82bf649 | Gather the defines from this information unit and all subunits. | [
{
"docid": "e4c85148736b3ee6ad27245f05ef273c",
"score": "0.68717295",
"text": "def GatherDefines()\n defines = @Defines\n return defines\n end",
"title": ""
}
] | [
{
"docid": "988bd19cf562860ce6bf1a008bde844c",
"score": "0.7014894",
"text": "def GatherDefines()\n defines = @Defines\n defines.concat(@Location.GatherDefines())\n return defines\n end",
"title": ""
},
{
"docid": "2f1273a0ee677e9402fa11eab862dfb6",
"score": "0.686538",... |
dca0ae1dfc1521ef188136e778e61ceb | Checks if this tag is using Comfy::Cms::Block | [
{
"docid": "32d3e6d4c193d8ce4d379cf040502413",
"score": "0.7478081",
"text": "def is_cms_block?\n %w(page field collection).member?(self.class.to_s.demodulize.underscore.split(/_/).first)\n end",
"title": ""
}
] | [
{
"docid": "0917c0d8539cac8c3e5fa210de5b4bf5",
"score": "0.6708856",
"text": "def is_block?\n get_metadata(:for_block)\n end",
"title": ""
},
{
"docid": "74fabdaba74150ebc6cfe96e40f53781",
"score": "0.663545",
"text": "def block?\n block_tag? || block_body? || document?\... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "9a37ec49346d540fb57cb8714ea8fab5",
"score": "0.0",
"text": "def set_order_pack\n @order_pack = OrderPack.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;... |
019cd26e71263b6dd3ddbafe6f5ae725 | PATCH/PUT /productlists/1 PATCH/PUT /productlists/1.json | [
{
"docid": "c09ab8e02e3bd4d5b99364a55904de56",
"score": "0.6896388",
"text": "def update\n respond_to do |format|\n if @productlist.update(productlist_params)\n format.html { redirect_to @productlist, notice: 'Productlist was successfully updated.' }\n format.json { render :show, s... | [
{
"docid": "8c52a2cc60cfc5e02c94eafdb8c23c10",
"score": "0.7023692",
"text": "def update\n params[:list][:product_ids] ||= []\n @list = @user.lists.find(params[:id])\n\n respond_to do |format|\n if @list.update_attributes(params[:list])\n flash[:notice] = 'La lista se ha actualizado... |
65822beb256d099b8dd1d7959df6dca1 | Check for equality like a String | [
{
"docid": "9ed81c278148f81ec36acd171966b731",
"score": "0.6561037",
"text": "def ==(o)\n (o.class == self.class or o.class == \"String\") && o.to_s == to_s\n end",
"title": ""
}
] | [
{
"docid": "a9039b6e69a7e38e9fed33c379020ef8",
"score": "0.7917479",
"text": "def == other\n str == other\n end",
"title": ""
},
{
"docid": "a9039b6e69a7e38e9fed33c379020ef8",
"score": "0.7917479",
"text": "def == other\n str == other\n end",
"title": ""
},
{
"doc... |
746888386029f465f8cced9f38d72ded | get 'stats/:type/:identifier', to: 'tagsentity_stats' get 'tags/:type/:identifier', to: 'tagsentity' get '/stats', to: 'tagsstats' post 'tags', to: 'tagscreate' delete 'tags/:type/:identifier', to: 'tagsdestroy' | [
{
"docid": "d50ed2d5571b15aa3aa22d74460f78e7",
"score": "0.0",
"text": "def create\n @entity = Entity.find_or_create_by(entity_type: tag_params[:entity_type].downcase, identifier: tag_params[:entity_identifier].downcase)\n if @entity.tags.count > 0\n @entity.destroy_all_tags\n ... | [
{
"docid": "48b3c4d4f4737bb94c30231387ed56d9",
"score": "0.604117",
"text": "def index\n @resources = Resource.tagged_with(params[:tag]) if params[:tag]\n @season_tags = Tag.season_tags\n @door_tags = Tag.door_tags\n @level_tags = Tag.level_tags\n end",
"title": ""
}... |
baf06e1a804f1c623230bbd4218e494a | DELETE /snippets/1 DELETE /snippets/1.json | [
{
"docid": "447d8979887cc9043ff1785259020a88",
"score": "0.76914877",
"text": "def destroy\n @snippet = Snippet.find(params[:id])\n @snippet.destroy\n\n respond_to do |format|\n format.html { redirect_to snippets_url }\n format.json { head :no_content }\n end\n end",... | [
{
"docid": "353c3425c4054989a6e366f6b805867a",
"score": "0.792297",
"text": "def destroy\n @snippet = Snippet.find(params[:id])\n @snippet.destroy\n\n respond_to do |format|\n format.html { redirect_to snippets_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
... |
ab26f31d411ca54e5565ce6bb087de47 | Returns a timestamp (String representation) for the reference_time. | [
{
"docid": "2dd3339bc90e06534a03714c93bef1b7",
"score": "0.87412626",
"text": "def reference_timestamp\n reference_time.strftime formatter\n end",
"title": ""
}
] | [
{
"docid": "8ea2b6ddddea1002d272c54ccc5b561f",
"score": "0.6908702",
"text": "def timestamp\n _timestamp.as_time\n end",
"title": ""
},
{
"docid": "98bc47e80ab9cad9cc43c768b451e9f0",
"score": "0.6863267",
"text": "def timestamp\n _timestamp.as_time\n end",
"title": ""... |
0ed0a6c4d15a474cfc0f04778018cc07 | accessor function that converts number to words | [
{
"docid": "2f8955458e5520429ff352a51354b355",
"score": "0.0",
"text": "def generate_number_str(number,and_flag)\n if number == 0\n \"\"\n elsif int_strings.has_key?(number)\n (number < 99) ? int_strings[number] : \"one #{int_strings[number]}\"\n elsif number < 100\n fetch_number_strin... | [
{
"docid": "35b885ff0f304c480a1327d4f6d17472",
"score": "0.8284674",
"text": "def num_to_word(number)\n\n\n\n\n# Refactored Solution\n\n\n\n\n\n\n# Reflection",
"title": ""
},
{
"docid": "32ee8bb7a525ab7514dc920d21e6c221",
"score": "0.74499923",
"text": "def to_words\n num_hash = {\... |
f811ed2622fabcca1884f7d8fe07506a | GET /rutas_usuarios/1 GET /rutas_usuarios/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "99d8efeadccadf05f120bb8f55da2d0a",
"score": "0.73525715",
"text": "def index\n @usuarios = Usuario.por_colegio(colegio.id).order(\"nombre\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usuarios }\n end\n end",
"title": ""
... |
beee7962b80eae775591c282696c881c | === GoodData project structure commands Get tables list | [
{
"docid": "d11e469af44d26a37cbf9bed5278fa36",
"score": "0.0",
"text": "def tables(writer_id)\n handle(@client.get(\"tables\", { writerId: writer_id })) { |result| result[\"tables\"] }\n end",
"title": ""
}
] | [
{
"docid": "7e1f29a9b497b288a87033daf2853133",
"score": "0.759944",
"text": "def list_tables\n @tb_creator.sqlite3_list_tables\n end",
"title": ""
},
{
"docid": "48a904e40be3b7d9eaacbece964da342",
"score": "0.75825864",
"text": "def tables\n []\n end",
"title": ""
}... |
33c1cb755d28b414736ee982a0aee681 | an elseif will create a new condition. | [
{
"docid": "075e52acf6ba39dda1b82c7961e94088",
"score": "0.0",
"text": "def elsif(value)\n raise Argumentrror, \"'elsif' cannot be passed after 'else' or in an 'unless'\" if @switched || @in_else\n @trueCommands << [value,BlockCommand.new]\n end",
"title": ""
}
] | [
{
"docid": "0babe5786f1dc0b716cb7264ef804fca",
"score": "0.7118927",
"text": "def else_clause; end",
"title": ""
},
{
"docid": "f4fbc48554c0ffa1fef7e739fed6fdb9",
"score": "0.7075019",
"text": "def elsif_conditional?; end",
"title": ""
},
{
"docid": "f4fbc48554c0ffa1fef7e... |
b6682dec72c7fb3e7de605f260888cfd | POST /changyongzuoye1s POST /changyongzuoye1s.json | [
{
"docid": "9d3a746132f50cd15cd42ee9169f35cf",
"score": "0.6630955",
"text": "def create\n @changyongzuoye1 = Changyongzuoye1.new(changyongzuoye1_params)\n\n respond_to do |format|\n if @changyongzuoye1.save\n format.html { redirect_to @changyongzuoye1, notice: 'Changyongzuoye1 was suc... | [
{
"docid": "4f91a483c199bc0b08b445068d3f3238",
"score": "0.59710586",
"text": "def create\n BranchCodeName.delete_all\n kiwoomApi = KiwoomApi.new();\n tmp=kiwoomApi.get_branch_code_name();\n puts tmp;\n tmp.each do |key,value|\n tmp1=BranchCodeName.create(\n :branch_c... |
f86af62a483564c17876d8ff96b574fa | This is a specialized Quick Sort (Median of Three) that looks at the first, last, and middle values. It uses the median of those three values as the pivot. | [
{
"docid": "e5f2efc3baf8b90d2786ba3b0c406d7f",
"score": "0.83655167",
"text": "def quick_sort_using_median_of_three(list)\n if list.size <= 1\n list\n else\n middle_index = (list.size/2).floor\n middle_value = list[middle_index]\n\n possible_pivots = {\n 0 => list.first,... | [
{
"docid": "cded6cf6388c556cad369db1275c3ffc",
"score": "0.7454477",
"text": "def quick_m3(array, lb, ub)\n return if ub <= lb\n \n # find sentinels and the median for the pivot\n m = (lb+ub)/2\n array[lb], array[m] = array[m], array[lb] if array[m] < array[lb]\n array[m], array[ub] = ... |
4acfb82ea193e0a27bfa2f9c4aa5e464 | Is there a symlink to us in /etc/munin/plugins ? | [
{
"docid": "6ce635187378b34ad59cf4322a584331",
"score": "0.7550901",
"text": "def installed?\n File.exist?(\"/etc/munin/plugins/#{name}\")\n end",
"title": ""
}
] | [
{
"docid": "0eca36460fff1272c39b6020795731cc",
"score": "0.6715343",
"text": "def symlink_outside_site_source?(entry); end",
"title": ""
},
{
"docid": "a665994f43fda45e7f658d83aa6eca55",
"score": "0.6706262",
"text": "def symlink?() end",
"title": ""
},
{
"docid": "566a1c... |
e2cf9acee05d94c3ebfedecd84fcb169 | Publico: calcula el indice de masa corporal. retorna el valor del indice de masa corporal | [
{
"docid": "cfae9a1957fde20877bc1d6025fc9b02",
"score": "0.5901633",
"text": "def IMC()\n\t\treturn @masa / (@altura * @altura) \n\tend",
"title": ""
}
] | [
{
"docid": "6cdf1551ea94f8c4afe7971f8bf33b02",
"score": "0.6887874",
"text": "def indiceMarcoViejo\n\t\t#Se carga el timestamp del primer marco.\n\t\ttimestampTemp = @arrMarcos[0].timestampCarga\n\t\t#Se crean 2 contadores, uno para accesar cada elemento de arrMarcos y\n\t\t#otro para indicar cual es el... |
a12fa185efd2c534a782bc1729ced46e | GET all the info on the desired note (by id). The URL is given in the list of POI's. | [
{
"docid": "5ab67db8edee76ee7c638b0a1a5f7cd3",
"score": "0.5817756",
"text": "def show\n attrs = \"name, body, latitude, longitude, altitude, privacy_on, updated_at, user_id, id\"\n @note = Note.where(id: params[:id]).select(attrs).first\n end",
"title": ""
}
] | [
{
"docid": "19914f3e997b472267d5c31d7e9b4365",
"score": "0.6588278",
"text": "def get_detail_information(poi_id)\n\t # parse special characters\n\t encoded_poi_id = URI.encode(poi_id);\n # make yelp api call\n poi_url = \"/v2/business/#{encoded_poi_id}\"\\\n '?cc=EN&lang=en&lang_filter=true'\... |
2054b0eeaa26109c0c6a1bfd4e81f370 | Author: Tim saving new search screen | [
{
"docid": "58ff1949bc90c967c933b8771d6a8341",
"score": "0.67176527",
"text": "def saveSearchPage(obj)\n fileinfo = \"#{@reportFolder}/Search #{@step['Parameter1']}\"\n saveScreen(fileinfo)\n msg = 'Saving Search result with html and screenshot'\n value = @reportFolder\n @report << [obj['... | [
{
"docid": "c8bc4a13767ee8b92076e600e2cd8a38",
"score": "0.6622084",
"text": "def save_search\n #breadcrumbs\n add_crumb \"My Profile\", user_path\n add_crumb \"My Saved Searches\", save_search_path, links: false\n @showsearches = Search.all.where(users_id: current_user)\n end",
"title"... |
59a00d07ac19c28eda3ff951a86e0e16 | Anonymize a log line | [
{
"docid": "b3f9ab241e9e1947abcb1570b1396003",
"score": "0.6240812",
"text": "def anonymize(line, options = {})\n if self.teaser.nil? || self.teaser =~ line\n if self.regexp =~ line\n pos_adjustment = 0\n captures.each_with_index do |capture, index|\n unless $~[i... | [
{
"docid": "e2363b1188daaa1911880b4304afdb1d",
"score": "0.6515052",
"text": "def print_in_same_line(log_string); end",
"title": ""
},
{
"docid": "0833c2202f9ec632753f2833a7c5c5e5",
"score": "0.64681065",
"text": "def remove_old_fixed_string(log); end",
"title": ""
},
{
"... |
bebb5fea8fcbde400a290a3b827f1ea0 | POST /immuniasations POST /immuniasations.xml | [
{
"docid": "35fde258ef4239ac6f30b7d4decac690",
"score": "0.6661622",
"text": "def create\n @immuniasation = Immuniasation.new(params[:immuniasation])\n\n respond_to do |format|\n if @immuniasation.save\n flash[:notice] = 'Immuniasation was successfully created.'\n format.html { ... | [
{
"docid": "7fa1af285531c2039495d55f557e7a00",
"score": "0.58056027",
"text": "def create\n @remuneration = Remuneration.new(params[:remuneration])\n\n respond_to do |format|\n if @remuneration.save\n format.html { redirect_to @remuneration, notice: 'Remuneration was successfully creat... |
b07948d27214d6979174640ab6b19afd | PATCH/PUT /dashboards/1 PATCH/PUT /dashboards/1.json | [
{
"docid": "5836b4657ff03b9f9b1ed5b0bbe805a7",
"score": "0.7135872",
"text": "def update\n respond_to do |format|\n if @dashboard.update(dashboard_params)\n format.html { redirect_to @dashboard, notice: 'Dashboard was successfully updated.' }\n format.json { render :show, status: :... | [
{
"docid": "45e228dd41368171d9e3b16bf315d8e4",
"score": "0.73547834",
"text": "def update\n @dashboard = Dashboard.find(params[:id])\n\n respond_to do |format|\n if @dashboard.update_attributes(params[:dashboard])\n format.html { redirect_to @dashboard, notice: 'Dashboard was successfu... |
c4dad3f2170fbd5f4c48eef41762a850 | set the character at the given index to the given character character must be an integer, as is the index the index starts at one, but may be negative to count from the end indexes out of range will raise an error | [
{
"docid": "f14587f6045af2eb0e28c7505df490b9",
"score": "0.7951563",
"text": "def set_char( at , char )\n raise \"char not fixnum #{char.class}\" unless char.kind_of? ::Integer\n index = range_correct_index(at)\n set_internal_byte( index , char)\n end",
"title": ""
}
] | [
{
"docid": "60021c5c11831761487c3fbcf5a832d3",
"score": "0.74217373",
"text": "def setCharAt(j, c)\n end",
"title": ""
},
{
"docid": "f6695e0ac425e11d2e92dff1c1c0de2a",
"score": "0.70089716",
"text": "def setCharacter(index, character)\n # Make sure the index is within range\n ... |
5e2feb3bd7591460d99872b93b91a8cb | resize image on passing png,jpeg,or gd image pass file_name/gd image,new_file_name,percentage,or resize width,resize height | [
{
"docid": "167956fe79a7d5bf8815b75bcdcead1c",
"score": "0.8424325",
"text": "def resize_image(file_name,resize_file_name=\"test\",percentage=0,resized_width=0,resized_height=0)\n\t\timage = GD::Image.new_from_png(file_name) rescue \"\"\n\t\trender_file_as = \"png\"\n\t\tif !image.is_a?(GD::Image)\n\t\t... | [
{
"docid": "bb7bc74a2f5c3b84245eb30391bdafea",
"score": "0.771723",
"text": "def resize_image(img, size)\n processor = ::RedArtisan::CoreImage::Processor.new(img)\n size = size.first if size.is_a?(Array) && size.length == 1\n if size.is_a?(Fixnum) || (size.is_a?(Array) &... |
8261b2a0370365ff14f0ab34c9570c8c | DELETE /wakarus/1 or /wakarus/1.json | [
{
"docid": "ea4b62895b10b5868a307cfa5d3aa0a9",
"score": "0.0",
"text": "def destroy\n if @wakaru.user_id == current_user.id\n @wakaru.destroy\n respond_to do |format|\n format.html { redirect_back(fallback_location: root_path, notice: \"わからなくなりました。\" )}\n format.json { head :n... | [
{
"docid": "0b24cbc6495df3923ea7679acbcd8deb",
"score": "0.6887093",
"text": "def delete_floor_plan(args = {}) \n delete(\"/files.json/floorplan/images\", args)\nend",
"title": ""
},
{
"docid": "b445c184893647d3482f8fbc6a507a52",
"score": "0.6839461",
"text": "def delete(path, params... |
2f4a5c150952efa4bcde157de457aab5 | PATCH/PUT /laguages/1 PATCH/PUT /laguages/1.json | [
{
"docid": "1622226038e20e57cf28b7a87dd7e690",
"score": "0.75584894",
"text": "def update\n respond_to do |format|\n if @laguage.update(laguage_params)\n format.html { redirect_to @laguage, notice: 'Laguage was successfully updated.' }\n format.json { render :show, status: :ok, loc... | [
{
"docid": "68d5aa547e75701d7aee149aec99bdee",
"score": "0.7224501",
"text": "def update\n @lenguage = Lenguage.find(params[:id])\n\n respond_to do |format|\n if @lenguage.update_attributes(params[:lenguage])\n format.html { redirect_to @lenguage, notice: 'Lenguage was successfully upd... |
f898e25a23406d098e336485932320bd | GET /artists/1 GET /artists/1.xml | [
{
"docid": "baa16947a7ce20f48745dcf99aedfb7b",
"score": "0.7412423",
"text": "def show\n @artist = Artist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @artist }\n end\n end",
"title": ""
}
] | [
{
"docid": "7bf206ce9c9e7bc11dfb44aa4eacbe22",
"score": "0.74011564",
"text": "def show\n @artist = Artist.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @artist.to_xml }\n end\n end",
"title": ""
},
{
"docid": "d8b3... |
fd118f25ae7e661fbedad5493565dfc3 | GET /cards GET /cards.json | [
{
"docid": "e496a1b62e90d00f680560c2b397d4a8",
"score": "0.7045741",
"text": "def index\n @cards = Card.all\n end",
"title": ""
}
] | [
{
"docid": "8ae397591fd76b8be3643ea4f0e3651f",
"score": "0.8236156",
"text": "def cards\n @cards = Card.all #Not sure if these need to be Card or Cards, etc\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cards }\n end\n end",
"title": ""
}... |
bde3230766bafd5e4726ac11966dd568 | method that returns a new matrix object that is the transpose of the source matrix | [
{
"docid": "f1e7c82eb1aefaf750f281f34a2322e5",
"score": "0.8177431",
"text": "def transpose\n transposed = Matrix.new(@columns,@rows)\n for i in 0...transposed.rows\n for j in 0...transposed.columns\n transposed.set(i,j,self.get(j,i))\n end\n end\n return transposed\n end",... | [
{
"docid": "9938c5417597379cafd675a0244df356",
"score": "0.84598637",
"text": "def transpose\n\t\tm = Memory.new(@column_count) { |i|\n\t\t\tMemory.new(@row_count) { |j|\n\t\t\t\t@m[j][i]\n\t\t\t}\n\t\t}\n\t\treturn Matrix.__new__(m, @column_count, @row_count)\n\tend",
"title": ""
},
{
"doci... |
ba051921dcff451f33f77eb76e443284 | The default values for a new instance of this class. | [
{
"docid": "4c894fc8a50ed1ab748d8e5fb3f5394a",
"score": "0.7976339",
"text": "def defaults\n {}\n end",
"title": ""
}
] | [
{
"docid": "4539c64ea11e53d650e6b646ced98df8",
"score": "0.809489",
"text": "def defaults\n {}\n end",
"title": ""
},
{
"docid": "148c8f00e25e6f95ac8791465b90980f",
"score": "0.80393094",
"text": "def defaults\n @defaults ||= new.attributes\n end",
"title"... |
4a637c666cea72d70b59f6d6f9662d70 | POST /nav_boxes POST /nav_boxes.json | [
{
"docid": "25edd7e86bf06c83ac4627b2f761c41a",
"score": "0.69605744",
"text": "def create\n\t\t\tlast_nav_box = NavBox.find(:all, :order => 'position').last\n\t\t\tif last_nav_box.nil?\n\t\t\t\tlast_position = 0\n\t\t\telse\n\t\t\t\tlast_position = last_nav_box.position.to_i\n\t\t\tend\n\n @nav_box... | [
{
"docid": "598447b147a5d5fdaf1b512fa6c021ab",
"score": "0.63966197",
"text": "def index\n @nav_boxes = NavBox.find(:all, :order => 'position')\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nav_boxes }\n end\n end",
"title":... |
accefd2f8adab59b47088042f3c8623a | Note that today you cannot issue an HTTP GET request to /USER_ID/achievements. You can only publish achievements for a user or delete existing achievements instances. We are working on support for reading the achievements for a user and this will be available soon. Am Freitag aktualisiert | [
{
"docid": "255c526545a2591a7a402b83aa835d01",
"score": "0.7183083",
"text": "def read_achievements\n end",
"title": ""
}
] | [
{
"docid": "73ea72710690aeac1d5c3b94aaa2f98f",
"score": "0.7819793",
"text": "def index\n @user = User.find(session[:user_id])\n @achievements = @user.achievements\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @achievements }\n end\n end",
... |
4ae9faba037ed6c31f8cc6926053848c | Shortcut to call DBenslave_siblings! on a single target | [
{
"docid": "d5426402bb75c4090cc6608e7e5b45df",
"score": "0.8397012",
"text": "def enslave_sibling!(target)\n enslave_siblings!([target])\n end",
"title": ""
}
] | [
{
"docid": "b86cf90e3f3a244c7e3a4babb02b0296",
"score": "0.726451",
"text": "def enslave_siblings!(targets)\n raise \"Can only call enslave_siblings! on a slave instance\" unless master\n disable_monitoring\n targets.each {|t| t.disable_monitoring}\n pause_replication unless @repl_pa... |
500b2086a0fc6a9a3cb5829d44a890ef | Check for optional ingest PID, if present there may be only one. | [
{
"docid": "f9dea7cb66652f466e939e579fce7a2e",
"score": "0.74442136",
"text": "def ingest_pid_ok?\n\n return true if @elements['ingestPID'].empty?\n\n if @elements['ingestPID'].length > 1\n error \"The manifest document lists more than one ingestPID - at most one can be specfied.\"\n ret... | [
{
"docid": "95b178f8f29cbf9f864e0abf03569601",
"score": "0.6103473",
"text": "def pid?\n @configuration[:pid].to_i != 0\n end",
"title": ""
},
{
"docid": "f9afc87b57da85674eb2cbdc8f5f62a7",
"score": "0.58339876",
"text": "def skip_taxon_id?\n @opts['taxon_id'].... |
fce0ebf5c21a7d6aa7d6e6e8a7eb2e57 | Takes a reference to a thing that is to be shared, and returns the id under which the data is stored. If the data is not present, will compute it by calling the given block. | [
{
"docid": "57ac2e474161e2a1492d464e66493143",
"score": "0.0",
"text": "def add_reference(value)\n ref = @ref_by_value[value]\n\n unless ref.present?\n ref = new_ref!(value)\n @ref_by_value[value] = ref\n @value_by_ref[ref] = value\n end\n\n ref\n end",
"t... | [
{
"docid": "097c4ee935856fe32bcc27f47da98752",
"score": "0.6484182",
"text": "def record_id\n block.id\n end",
"title": ""
},
{
"docid": "3ab1777df2c9364f7cef63e46da4af4c",
"score": "0.6226037",
"text": "def id\n @block\n end",
"title": ""
},
{
"docid": "3... |
ca7c1124424acaade4dd5cbe48e7c9b0 | DELETE /function_sets/1 DELETE /function_sets/1.json | [
{
"docid": "3462be36525876873faaf75efa44c271",
"score": "0.77768075",
"text": "def destroy\n @function_set.destroy\n respond_to do |format|\n format.html { redirect_to function_sets_url, notice: 'Function set was successfully destroyed.' }\n format.json { head :no_content }\n end\n e... | [
{
"docid": "b6890fe5009de2a4197d286916201e47",
"score": "0.6937848",
"text": "def delete_set( set_id )\n return delete_asset( \"set/#{set_id}\" )\n end",
"title": ""
},
{
"docid": "d66e8b055b4dcc0acef6e4d18db6c613",
"score": "0.6749986",
"text": "def delete(set_name)\n url... |
96c191363fbd16668e51052c5e404367 | Return a new (or existing) guest user and save it to the database | [
{
"docid": "ddb61dd44ecb8ce36e125fe3367a41ab",
"score": "0.74861497",
"text": "def create_guest(params={})\n User.find_or_create_by(default_params.merge(params))\n end",
"title": ""
}
] | [
{
"docid": "43245cea541ec23310a04977e8855f06",
"score": "0.8163576",
"text": "def create_guest_user\n u = User.new(:name => \"guest\", :email => \"guest_#{Time.now.to_i}#{rand(100)}@example.com\")\n u.save!(:validate => false)\n session[:guest_user_id] = u.id\n u\n end",
"title": ""
}... |
319533488c75813983785a56b2a3c16f | Steps to take if the user was valid | [
{
"docid": "39696b22904e985be4bf8145a4d8ad42",
"score": "0.0",
"text": "def post_process(user)\n\n user.update_user_organization_filters\n\n UserMailer.send_email_on_user_creation(user).deliver\n end",
"title": ""
}
] | [
{
"docid": "8f62ba386f36a1d4ee9f8831895befe0",
"score": "0.734854",
"text": "def valid_user?\n return true\n end",
"title": ""
},
{
"docid": "cca57e445865cd6bde5afe3c43ffbd8d",
"score": "0.7226748",
"text": "def valid?\n \n \n \n \n \n \n... |
baff8f7f8fa63ea98318d94bac71428a | returns icon url of specified user ==== Args _user_ :: target user ==== Return url of user's icon image if user valid, if not, it will be url of guest image | [
{
"docid": "75b221bb990fe5c994cde0847f06de72",
"score": "0.8025725",
"text": "def icon_name(user)\n iconname = (!user.blank? && !user.icon_url.blank?)? user.icon_url : Settings.icon.user.guest_image\n iconname\n end",
"title": ""
}
] | [
{
"docid": "67fe39de8fabc5e3f385ea646b4abcb5",
"score": "0.75134027",
"text": "def avatar_url(user)\n if user.avatar_url.present?\n user.avatar_url\n else\n default_url = \"#{root_url}images/guest.png\"\n gravatar_id = Digest::MD5.hexdigest(user.email.downcase)\n \"http://grava... |
6b92fef915e613ed0c8b9801a87ab493 | POST /login Action method to validate a user's credentials. And, if successful, set the corresponding session value. | [
{
"docid": "c146a01f342bd814d3611b2eb650ff0f",
"score": "0.0",
"text": "def create\n\t\t# Check the provided credentials against the model authentication method.\n\t\tuser = User.authenticate(params[:email], params[:password])\n\t\tif user\n\t\t\t# If the authentication was successful, set the session v... | [
{
"docid": "f26d3d6bec55fbfec4226b75ca7f2659",
"score": "0.76717496",
"text": "def login\n if request.post?\n user = UserAccount.authenticate(params[:name], params[:password])\n if user\n session[:user_id] = user.id\n uri = session[:original_uri]\n session[:original_uri... |
15ed3719f65d9d481d4fe453abbbd0ce | Create an object for the filter | [
{
"docid": "dc5ef8874acda269fa665307f0d0b302",
"score": "0.66016537",
"text": "def get_filter_object(type, placeholder, value)\n ChaiIo::Filter::Base.get_instance type, placeholder, value\n end",
"title": ""
}
] | [
{
"docid": "69166ad1ee8bfdde51b30acc02b0621b",
"score": "0.8000329",
"text": "def filter_object\n @filter_object ||= @filter_class.new\n end",
"title": ""
},
{
"docid": "55dfad93c89b84b95b40a4c4450ef4f1",
"score": "0.74447006",
"text": "def initialize( name , filt... |
e6b1adf2d0a75d446a1a84ddfa74a533 | Add to the IDs object in the table | [
{
"docid": "6c889937d23ba6037829218e62c87d50",
"score": "0.57385457",
"text": "def add_data_ids(id_old, id_new)\n return id_old.map{|id| id.sort} if id_new.nil?\n id_old = Hash.new if id_old.nil?\n id_new.each do |k, val|\n id_old[k] = Array.new if id_old[k].nil?\n val.each{|v| id_old[k] << v i... | [
{
"docid": "eeda00dc2fd41ccf0df8acdd71e5f03a",
"score": "0.6363373",
"text": "def update_ids\n self.task_id = @task_number\n self.order_id = @order_number\n end",
"title": ""
},
{
"docid": "bf5c5c33ca2a9a7400c701e9521e3de9",
"score": "0.63431036",
"text": "def _insert_values\n... |
10ebab374c98b4712ad9b68793b81092 | Before action Confirms the correct user | [
{
"docid": "2ee00e9a4072fb4679e3b2ddf9002f84",
"score": "0.63026625",
"text": "def correct_user\n @user = User.find(params[:id])\n if @user != current_user\n flash[:alert] = \"Action not authorized\"\n redirect_to(root_url)\n end\n end",
"title": ""
}
] | [
{
"docid": "f0c98a5ef673978ddcc9f07bafb81659",
"score": "0.68614966",
"text": "def appctrl_confirm_user\n redirect_to( signin_path() ) unless @current_user\n end",
"title": ""
},
{
"docid": "3fbbead69d4430b959a1136fcb8ab70e",
"score": "0.6628074",
"text": "def cleared_required\n ... |
29710967805fdaba0d5472ae46bb4f0a | Need to convert from the CONTENT_TYPE we'll get back from the server to the normal ContentType header | [
{
"docid": "14c8d5b713fdb4ac63266efcd549c963",
"score": "0.0",
"text": "def to_http_header(k)\n k.downcase.split('_').collect { |e| e.capitalize }.join('-')\n end",
"title": ""
}
] | [
{
"docid": "9f0c800529fb3771b1fc41213f1394e3",
"score": "0.8127174",
"text": "def parsed_content_type_header; end",
"title": ""
},
{
"docid": "94f069182784eb260fc3655fb8cb9f5c",
"score": "0.801743",
"text": "def content_type\n @content_type ||= headers.find { |k, _| k.downcase... |
237d66762a20dc11fc47d6845cae2615 | Uploads a file from local disk to S3 | [
{
"docid": "1c77db8a3125252258ee9ff58545f523",
"score": "0.7160213",
"text": "def upload(bucket_name, file, key = nil)\n key ||= File.basename(file)\n object = @s3.bucket(bucket_name).object(key)\n object.upload_file(file)\n object.load\n object.version_id\n end",
"title"... | [
{
"docid": "009ee160f4f19e65121cbd0048011933",
"score": "0.8147292",
"text": "def upload_file_to_s3(path)\n if /^#{ FILE_DIRECTORY }(.+[^~])$/.match(path) && File.readable?(path)\n key = Regexp.last_match[1]\n mime = 'text/jpeg'\n datafile = File.open(path)\n filesize = ... |
f6fdd2e205a68e0217d99ec5a7418b30 | Returns the auth token of the user that invoked your app. It allows you to use the Geotix API with the data access scoped to match the users data scope, and with the privileges that you requested on the API when you setup your application. | [
{
"docid": "4a58fa6e0527aeef6720592337fb65f3",
"score": "0.7179912",
"text": "def auth_token\n request.env['HTTP_X_GEOTIX_AUTH_TOKEN']\n end",
"title": ""
}
] | [
{
"docid": "9b9c56c1870be826e83734f70738a274",
"score": "0.6836502",
"text": "def api_token\n client.get(\"/user/api_token\").fetch(\"result\")\n end",
"title": ""
},
{
"docid": "5b063dacedf7ffb355635b54fa989af7",
"score": "0.6787221",
"text": "def auth_token\n @@auth_to... |
949739eafef4050cc258cc9dc616f6f9 | GET /ipsearches/new GET /ipsearches/new.xml | [
{
"docid": "febcbee29582d5368d9369a4db80131a",
"score": "0.7619632",
"text": "def new\n @ipsearch = Ipsearch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ipsearch }\n end\n end",
"title": ""
}
] | [
{
"docid": "f2a6a1920ffe6972b9b91ac16f7f9d20",
"score": "0.67319447",
"text": "def create\n @ipsearch = Ipsearch.new(params[:ipsearch])\n\n respond_to do |format|\n if @ipsearch.save\n format.html { redirect_to(@ipsearch, :notice => 'Ipsearch was successfully created.') }\n form... |
bd3fce2e255d38334e04e1feb48a082a | Push the policy, including all dependent cookbooks. | [
{
"docid": "ca94d9773cf583e02cea75a9821bec04",
"score": "0.46474755",
"text": "def upload\n policyfile_uploader.upload\n end",
"title": ""
}
] | [
{
"docid": "12651497e81e5f2744b0c9bd4a3eccaf",
"score": "0.65878326",
"text": "def sync_cookbooks\n policy_builder.sync_cookbooks\n end",
"title": ""
},
{
"docid": "4d296dbedfd0fa115c5b792cae6e930c",
"score": "0.590865",
"text": "def prepare_cookbooks\n Kitchen.mutex.s... |
58372d392d209470952b4f133aec1956 | standard actions (html format) | [
{
"docid": "ae9589e30e7487e9677f98eb0f5049c8",
"score": "0.0",
"text": "def after_created\n logger.debug(\" ##### after created called for #{@model.inspect}\")\n redirect_to :action => 'show', :id => @model\n end",
"title": ""
}
] | [
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.7639757",
"text": "def actions; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.7266334",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "c4f9b09e5722e7f407ce3376434bd4cf",
"score": "0.0",
"text": "def language_params\n params.require(:language).permit(:language_name, :language_skill, :user_id)\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... |
9a4cfd0b147bc964dcc6d58db42b3d28 | ( implicit GET ) new_link_path GET /links/new | [
{
"docid": "097e7ab37b4545fe2ef7f5f3c76b6b04",
"score": "0.67852575",
"text": "def new\n @link = current_user.links.new\n # @link = Link.new\n end",
"title": ""
}
] | [
{
"docid": "7eed91c20720bbe83959f015b9dba1e8",
"score": "0.75066596",
"text": "def new_link\n @link = Link.new\n end",
"title": ""
},
{
"docid": "37e850865e12a8b672f4e5278cfc7b9d",
"score": "0.73175806",
"text": "def link_new(text = t(\"admin.common.new_link\"), url = new_res... |
288733bd6743c037e35fed46914869b9 | In one cycle, each player plays one Round with every other player: with a certain probability that depends on the distance between 2 players. | [
{
"docid": "70068c70a41a1e0e205e3fc32c3756c8",
"score": "0.7435278",
"text": "def play_one_cycle\n couples = select_players_for_round\n couples.each do |couple|\n play_round(couple.first, couple.last)\n end\n end",
"title": ""
}
] | [
{
"docid": "365d339d278f5edaff99adad88a5afba",
"score": "0.72136307",
"text": "def play\n rounds = rounds_needed_to_win\n while @player_one.wins < rounds && @player_two.wins < rounds\n @rule_set.run_a_round\n report_end_of_round\n end\n report_end_of_game(rounds)\n @player_one.w... |
14eab8595f9afb76d6de404e701b0e2a | CONVERSIONS Returns a string representing this color using hex notation (i.e. rrggbbaa). | [
{
"docid": "69ead620ffc454407a1217955d2f08cd",
"score": "0.6754814",
"text": "def to_hex(color, include_alpha = true)\n include_alpha ? ('#%08x' % color) : ('#%06x' % [color >> 8])\n end",
"title": ""
}
] | [
{
"docid": "33e49e44098cd1cb0ea7fd583c83f73f",
"score": "0.83844435",
"text": "def to_s\n \"#{@hex_color}\"\n end",
"title": ""
},
{
"docid": "13408d1284f57863f75ce98ad04b07cd",
"score": "0.7968127",
"text": "def to_hex\n\t\tr = sprintf(\"%02X\", self.red)\n\t\tg = sprintf(\"... |
a6e5a52a113e3e01f592a112f1df6b56 | Returns an Object with the given title from catalog, taking aliases into account. | [
{
"docid": "8169a45b66aedfc71153f9ae19c14037",
"score": "0.6791196",
"text": "def resource(title)\n @catalog.resource(title) || @aliases[title]\n end",
"title": ""
}
] | [
{
"docid": "e84a6ca6a6e49b2e0ca9a972290f3a5b",
"score": "0.5802404",
"text": "def by_title(title)\n Categories::Finder.by_title(title)\n end",
"title": ""
},
{
"docid": "29006101ebc8fb12217d8bbc1d56858f",
"score": "0.58005655",
"text": "def by_title(title)\n ... |
67bcb6a455146128260e007d1436e0d2 | GET /curves/1 GET /curves/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "43c4e3dff0237388ec7cd422b1b4cd30",
"score": "0.67726785",
"text": "def index\n @bezier_curves = BezierCurve.all\n end",
"title": ""
},
{
"docid": "bb4e487a238db7bea6b43f8d306129ed",
"score": "0.64852697",
"text": "def index\n @price_curves = PriceCurve.all\n end",... |
58f60c30a4aeb2f431fd91b7121fb6d4 | Convert a zone to a slave zone with the specified master name server IP address. | [
{
"docid": "fa1fed33ffa33fd9c0f573b1f19d0f16",
"score": "0.83797747",
"text": "def convert_zone_to_slave(name, master)\n query!(:convert_zone_to_slave, name: name, master: master)\n end",
"title": ""
}
] | [
{
"docid": "6744504b34d7397dfba27a4fd866412e",
"score": "0.7000165",
"text": "def convert_zone_to_master(name)\n query!(:convert_zone_to_master, name: name)\n end",
"title": ""
},
{
"docid": "43edabe1c11190674adee06f3e874ac1",
"score": "0.6513868",
"text": "def master(zone = {})\... |
ccfe5988e1276a65070a468b6a397310 | Executes the +command+, logs the output, and optionally growls. | [
{
"docid": "a20ade2e6dd2af218f6c172981b4dff9",
"score": "0.0",
"text": "def execute(command)\n Kicker::Utils.execute(command)\n end",
"title": ""
}
] | [
{
"docid": "368e9f863b5ac302e12ee05594b3fcc6",
"score": "0.7044627",
"text": "def exec_and_log(command)\n stdout_err, status = Open3.capture2e(command)\n if status.success?\n logger.info \"Running command #{command}: #{stdout_err}\"\n else\n logger.error \"Error running command #{comm... |
74b34b348f4f2a8412daaf08e3635a01 | Get the rails logger. | [
{
"docid": "baed75b8fb71d92f66ed3e20e8f4daa5",
"score": "0.82239556",
"text": "def rails_logger\n defined?(Rails) && Rails.respond_to?(:logger) && Rails.logger\n end",
"title": ""
}
] | [
{
"docid": "645e18bc7513dc33261f2b7f3c1513a5",
"score": "0.8582375",
"text": "def logger\n if !Rails.nil?\n return Rails.logger\n else\n return Logger.new( STDOUT )\n end\n end",
"title": ""
},
{
"docid": "247819abb90d5293d9343a6b1cc10a1f",
"score": "0.852... |
920452975f0879bea583686e36e1e80d | Email field management Difficulty Easy | [
{
"docid": "2848183ded3aa814b0727eb7a7087cc0",
"score": "0.0",
"text": "def set_email_field(email)\n @chrome_driver.find_element(:id, EMAIL_FIELD).send_keys(email)\n sleep 1\n end",
"title": ""
}
] | [
{
"docid": "11cfa3aec071dd3435a7e352f8cbdc97",
"score": "0.69605464",
"text": "def emailform\n end",
"title": ""
},
{
"docid": "11cfa3aec071dd3435a7e352f8cbdc97",
"score": "0.69605464",
"text": "def emailform\n end",
"title": ""
},
{
"docid": "e3ef66cfadfe6a4a3f4f277abd... |
9e25d4440ab1999386d911d16791a823 | The deserialization information for the current model | [
{
"docid": "af6a88d7b142bd155a10a597e61b0480",
"score": "0.0",
"text": "def get_field_deserializers()\n return super.merge({\n \"backgroundColor\" => lambda {|n| @background_color = n.get_string_value() },\n \"backgroundImage\" => lambda {|n| @backgro... | [
{
"docid": "613f62eeb3655523fae5d548dc6e7875",
"score": "0.6580273",
"text": "def get_field_deserializers()\n return {\n \"downloadUrl\" => lambda {|n| @download_url = n.get_string_value() },\n \"fileName\" => lambda {|n| @file_name = n.get_string_val... |
884dcc08609c9376ae4a0d77459176ed | Optimize one file in place, return original as OptimizedPath or nil if optimization failed | [
{
"docid": "7a690162b778f9ebdd3e6220978a455d",
"score": "0.69992346",
"text": "def optimize_image!(original)\n original = Path.convert(original)\n return unless (result = optimize_image(original))\n result.replace(original)\n OptimizedPath.new(original, result.original_size)\n end",
"ti... | [
{
"docid": "21dc5b2a8d61eab28b88da0bdd1147f6",
"score": "0.6958383",
"text": "def optimize!(path)\n @optimizer.optimize_image!(path)\n end",
"title": ""
},
{
"docid": "73792ee88968ade0fdad76e30b805e5e",
"score": "0.6780787",
"text": "def optimize_image(original)\n original... |
95b3ff2f81208df87496d2c7b1d09b7b | DELETE /bankings/1 DELETE /bankings/1.json | [
{
"docid": "a21c8672ae86b0144c141f954840263c",
"score": "0.7326812",
"text": "def destroy\n @banking.destroy\n respond_to do |format|\n format.html { redirect_to bankings_url, notice: 'Banking was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title"... | [
{
"docid": "82d313f35cd937fca1ab90f51223642f",
"score": "0.7492761",
"text": "def destroy\n @bank = Bank.find(params[:id])\n @bank.destroy\n\n respond_to do |format|\n format.html { redirect_to banks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
... |
d639749e04ba5747fa3aed35ac732245 | Twilio Call for Specific Conference | [
{
"docid": "e2b8ef470bd2c4e65918ab7ef2d5da8b",
"score": "0.7495974",
"text": "def initiate_conference\n @call = Call.find(params[:id])\n @call.participants.each do |participant|\n #TWILIO_CLIENT.account.calls.create({from: '+12065382886', to: \"+1#{participant.phone}\", url: \"http://dial-me-... | [
{
"docid": "bdb65f8d1e421adf64d22171baaf8ed8",
"score": "0.72732353",
"text": "def send_request(conference_id, phone_number, db_call_id)\n #for rest_params, just care about those 3 passed params, forget about others for now.\n rest_params = {\n \"method\" => Constants::SINCH_CALL_METHOD,\n ... |
dff436f4d0c17a2ee078fcde569d7c0c | From Make a String of the passed kv | [
{
"docid": "c4bb9a43d61dfa2ddf6cab4732b43443",
"score": "0.0",
"text": "def to_string(column, kv, maxlength = -1)\n if kv.isDelete\n val = \"timestamp=#{kv.getTimestamp}, type=#{org.apache.hadoop.hbase.KeyValue::Type::codeToType(kv.getType)}\"\n else\n val = \"timestamp=#{kv.getTimestamp}, value... | [
{
"docid": "1e78ef3773c4ae470f6975a94363a48e",
"score": "0.6215821",
"text": "def kv_decode(s); Hash[*s.split(10.chr).map {|l| l.split(\":\", 2) }.flatten] end",
"title": ""
},
{
"docid": "325aa0a0b86132a87f53312dd80cead4",
"score": "0.6169599",
"text": "def parse_kv(str)\n str.sp... |
eda08a3dcb6a8b174a482a8540b53b59 | Write a method that returns the factors of a number in ascending order. | [
{
"docid": "8e2271d0c204c74a5e1aaa2aabbf55fc",
"score": "0.84801",
"text": "def factors(num)\n\nend",
"title": ""
}
] | [
{
"docid": "c444951537cf13e98fc151711c579b22",
"score": "0.8575256",
"text": "def factors(num)\n\t((1..num).select {|n| num % n == 0 } ).sort\nend",
"title": ""
},
{
"docid": "c619c2343503908e7551593d4457fce4",
"score": "0.8532261",
"text": "def factors(num)\n factors = []\n for fa... |
5758558a63ae664fc31371b2f686078d | POST /races POST /races.xml | [
{
"docid": "0f03b007294d5032ce4c43f802eddc00",
"score": "0.49032307",
"text": "def create\n @race = Race.new(params[:race])\n @race.user = current_user if logged_in?\n respond_to do |format|\n if @race.save\n #flash[:notice] = 'Race was successfully created.'\n format.html { ... | [
{
"docid": "2ab02907526d738c4dacf3205469e8a4",
"score": "0.5847094",
"text": "def do_post(host, port)\r\n\tverb = \"POST\"\r\n\treq_URI = \"/raiders\"\r\n\tversion = \"HTTP/1.1\"\r\n\traider = get_raider_info\r\n\trequest = \"#{verb} #{req_URI} #{version}\\r\\n\"\r\n\tresponse = post_request(host, port,... |
af72fb1d02cf5f31f6d64042ae5489f1 | Checks if the list is empty. | [
{
"docid": "f805cd94e2e508617d41d6b83cf90204",
"score": "0.0",
"text": "def empty?\n @json_data['metrics'].empty?\n end",
"title": ""
}
] | [
{
"docid": "abe9c90d06b8f3aa9d4568ad63f26751",
"score": "0.8847462",
"text": "def empty?\n list.empty?\n end",
"title": ""
},
{
"docid": "8b31ddddf3a9035ee53735156650de92",
"score": "0.8807614",
"text": "def empty?\n @list.empty?\n end",
"title": ""
},
{
"... |
4059520f59007da40cb5022951ed4bdd | Name: httpRequest Desc: Sends an HTTP request, which requires different code from HTTPS | [
{
"docid": "8f99d0c29d5178416c3c32c4b380c690",
"score": "0.7014813",
"text": "def httpRequest (url)\n\turi = URI.parse(url)\n\thttp = Net::HTTP.new(uri.host, uri.port)\n\tresponse = http.request(Net::HTTP::Get.new(uri.request_uri))\nend",
"title": ""
}
] | [
{
"docid": "054075da802fb3d951592d5ea499d40d",
"score": "0.75139844",
"text": "def do_http_request # :nodoc: internal use only\n http.do_request request # Some URLs can throw an exception here\n end",
"title": ""
},
{
"docid": "5ca561ac60d8d2b3ea30e0b64d9f3dd7",
"score": "0.72338... |
58601acd3c43a95c968e9edf9c72cfc8 | Complete the maxSubarray function below. | [
{
"docid": "68a711370b88d50755ed3e1d7aea2818",
"score": "0.83294886",
"text": "def maxSubarray(arr)\n [_max_subarray(arr, 0, arr.length - 1), _max_subsequence(arr)]\nend",
"title": ""
}
] | [
{
"docid": "7c0ba93ec4efa214d88e14c50054d2a3",
"score": "0.8360859",
"text": "def maxSubarray(arr)\n [_max_subarray(arr), _max_subsequence(arr)]\nend",
"title": ""
},
{
"docid": "757ab3c3f844b75e93d9651ca2b8c524",
"score": "0.7918664",
"text": "def max_sub_array\n (0...self.size)... |
fdfe357a1918b002c1440a0bfb57582a | Allows manipulation of preview api keys in context of the current space Allows listing all api keys of space and finding one by ID. | [
{
"docid": "6f9b7b6c6305e5159ebdbfbca09fe5b9",
"score": "0.7124328",
"text": "def preview_api_keys\n SpacePreviewApiKeyMethodsFactory.new(self)\n end",
"title": ""
}
] | [
{
"docid": "697ac0c3917724cd21c7d047f29a50b5",
"score": "0.6459311",
"text": "def show\n keys = ApiKey.where(user_id: current_user.id)\n @apikeys = []\n keys.each do |key|\n @apikeys << {'access_token' => key.access_token, 'qr' => RQRCode::QRCode.new(key.access_token, :size => 4, :level =>... |
f966950272f304af701d42be78ecbd91 | The story with user inputs | [
{
"docid": "0f561ef15acc2302f1a3c93f86b77df5",
"score": "0.59931135",
"text": "def full_story\n puts \" This is your user story\".colorize(:color => :yellow)\n\n puts \"\n I walk through the color jungle. I take out my\n #{@adjective} canteen. There's a... | [
{
"docid": "f80e68df840b80912435b48d6da8f147",
"score": "0.72370696",
"text": "def storyline(input)\n anime = Anime.all[input -1]\n Scraper.scrape_storyline(anime)\n puts \"\\n#{anime.title}, #{anime.release_date} | Rated: #{anime.rating} | Runtime: #{anime.runtime} | Genre: #{anime.genre} \\n ... |
2f63f1fb8684b3a299455f7207bfc05d | Method to update the quantity of an item input: hash list, item, quantity steps: addeds quanity to existing item add if statement to check for item in hash output: outputs hash with updated quantity | [
{
"docid": "29d852e65be6d7d430c1558bf8a263d1",
"score": "0.7238612",
"text": "def update_quantity(hash_list, item, quantity)\n if hash_list.has_key?(item)\n hash_list[item] = quantity\n puts \"updated #{item} with quantity of: #{quantity}\"\n else\n puts \"item not found.\"\n puts \"please... | [
{
"docid": "78177dbcf5038a94a8e5608ff64e351c",
"score": "0.80580467",
"text": "def update_item_quantity(hash_of_items, item, quantity)\n hash_of_items[item] = quantity\n hash_of_items\nend",
"title": ""
},
{
"docid": "8ead57b705dc18950976d3779465e023",
"score": "0.8037627",
"text":... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "235905f24ef43591f8f389f57cbb2fa6",
"score": "0.0",
"text": "def donnee_params\n params.require(:donnee).permit(:annee, :population, :produits_total, :prod_impots_locaux, :prod_autres_impots_taxes, :prod_dotation, :charges_total, :charges_personnel, :charges_achats, :charges_financieres,... | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7497761",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6959097",
"text": "def strong_params\n params.require(:request).permit(param_white... |
21bbb27720b95402910d783a7f7758fd | Updates a product(s) in Yotpo | [
{
"docid": "783a2973cf4529f681cce89f4b6bc916",
"score": "0.7109772",
"text": "def update_products(params, headers = {})\n request = {\n utoken: params[:utoken],\n products: params[:products],\n return_email_address: params[:return_email_address],\n result_callback_url: p... | [
{
"docid": "914511dbe9ad13334e686d5caf8c875c",
"score": "0.81664294",
"text": "def update!(**args)\n @products = args[:products] if args.key?(:products)\n end",
"title": ""
},
{
"docid": "914511dbe9ad13334e686d5caf8c875c",
"score": "0.81664294",
"text": "def update!(*... |
b74e28586e04fb96399cc052e5f02449 | Mutate traits from parents | [
{
"docid": "a98ab6e7adba2bc7c1afc3c3c7bf6c63",
"score": "0.6867596",
"text": "def inherit_parent_traits(parent)\n\t\t# Add code to mutate traits from parent\n\t\t# Ensure trait values are positive and reasonably bounded\n\t\t@traits = parent.traits\n\t\t@traits.each do |key,value|\n\t\t\ttemp = value + ... | [
{
"docid": "8d6a1e1a30c159b6e376b07170664417",
"score": "0.6360846",
"text": "def adjust_component_with_traits\n traits.each do |trait|\n next if skipped_traits.include?(trait)\n send \"#{trait}_trait\"\n end\n end",
"title": ""
},
{
"docid": "5... |
638c2f85833180f8e29a443c2475add7 | Assembles the content to write to the stream for this chunk. | [
{
"docid": "6547410419a8da432e5be1f6500eefc7",
"score": "0.0",
"text": "def content\n [ppux, ppuy, unit == :meters ? 1 : 0].pack(\"NNC\")\n end",
"title": ""
}
] | [
{
"docid": "340c7901dc0a3276843c294cf1e1ab92",
"score": "0.6573342",
"text": "def update_content\n @buffer = Zip::OutputStream.write_buffer do |out|\n @output_stream = out\n yield self\n end\n end",
"title": ""
},
{
"docid": "eca698088c1fdf9be021f553c65f13ad",
... |
b08c681f8d0b9eedf017da73cf430b63 | Prints out the synopsis. | [
{
"docid": "970158991180923615c05bf510c4cc91",
"score": "0.7427066",
"text": "def synopsis()\n puts \"ruby main-markov-chains.rb [--help] [--number_of_words N|-n N] [--width W|-w W] [--verbose|-v] [--order O|-O o] textfiles\"\nend",
"title": ""
}
] | [
{
"docid": "1921d1d3c8b9cceefdf1f0d270277f89",
"score": "0.78505784",
"text": "def synopsis\n str = \"#{name_full} \"\n str << documentation_lines[0]\n if is_command_group?\n str.gsub!('<<SUBCOMMAND-SYNOPSIS>>', subcommands.commands.map { | c | c.name }.sort.join(' | '))\n end... |
aafdf61e355120bb9cb35205f16de490 | parser rule rule (in ANTLRv3Grammar.g) 158:1: rule : ( DOC_COMMENT )? (modifier= ( 'protected' | 'public' | 'private' | 'fragment' ) )? id ( '!' )? (arg= ARG_ACTION )? ( 'returns' rt= ARG_ACTION )? ( throws_spec )? ( options_spec )? ( rule_scope_spec )? ( rule_action ) ':' alt_list ';' ( exception_group )? > ^( RULE id... | [
{
"docid": "1e22fe5c794e6f03c8e25b53d6bd27fa",
"score": "0.6819206",
"text": "def rule\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 11 )\n @rule_stack.push( @@rule.new )\n return_value = RuleReturnValue.new\n\n # $rule.start = the firs... | [
{
"docid": "0f90c3fb19804e2169792b3033f4e3c9",
"score": "0.66869974",
"text": "def define_rule(rule_token, modifier, options, tree, arg_action_ast, num_alts)\n rule_name = rule_token.get_text\n if (!(get_locally_defined_rule(rule_name)).nil?)\n ErrorManager.grammar_error(ErrorManager::M... |
df61f936f543b4ef453dbc52f4da790c | To play the game, the octopus must step on a tile with her corresponding tentacle. We can assume that the octopus's eight tentacles are numbered and correspond to the tile direction indices. Slow Dance Given a tile direction, iterate through a tiles array to return the tentacle number (tile index) the octopus must move... | [
{
"docid": "92ff77e30ee857a6590748bec2603d76",
"score": "0.73069346",
"text": "def slow_dance(direction, tiles)\n tiles.each_with_index { |tile, i| return i if tile == direction }\n nil\nend",
"title": ""
}
] | [
{
"docid": "9245d209ed3f24e4bf8e306c21f6683d",
"score": "0.7915918",
"text": "def slow_dance(direction, tile_array)\n tile_array.length.times do |i|\n return i if tile_array[i] == direction\n end\nend",
"title": ""
},
{
"docid": "cb57cc9f7d47c9da77f012123856db9c",
"score": "0.780928... |
f239328708fb186bfca95028d9ca4ac1 | compare the actual number of messages in the redis mailbox against a running total of the messages as they get uploaded and downloaded | [
{
"docid": "6d114fd8ee1043c9424b59b3f3279cad",
"score": "0.7737416",
"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 ... | [
{
"docid": "7ebd3c259771ae36d4b36db79a677ec0",
"score": "0.69239247",
"text": "def count\n inbox.size + outbox.size\n end",
"title": ""
},
{
"docid": "16a0a4f1038b330c2dd2fc5a70912de5",
"score": "0.68338054",
"text": "def total_messages\n folders.values.inject(0) { |sum, fol... |
fac9227b55726b4162cd9a3e47b338a4 | GET /category_types GET /category_types.json | [
{
"docid": "b715655928601767632f0824b0f565af",
"score": "0.7295589",
"text": "def index\n @category_types = CategoryType.all\n end",
"title": ""
}
] | [
{
"docid": "d83c08f38d3e155a8797fdcb78c561cb",
"score": "0.7818807",
"text": "def types\n if !@api_key.nil? and @api_key.api_type == \"muni\"\n params[:c] = \"forager\"\n end\n\n if params[:c].blank?\n cat_mask = array_to_mask([\"forager\",\"freegan\"],Type::Categories)\n else\n ... |
9e85116660e3b64cfaad9d00f3c459c9 | Adds success and failure counter instrumentation to a method. A method call will be considered successful if it does not raise an exception, and the result is truey. For successful calls, the metric [name].success will be incremented; for failed calls, the metric name is [name].failure. | [
{
"docid": "279bf512558e8c8a136bcd367566d6d0",
"score": "0.7995673",
"text": "def statsd_count_success(method, name, *metric_options)\n add_to_method(method, name, :count_success) do |old_method, new_method, metric_name|\n define_method(new_method) do |*args, &block|\n begin\n ... | [
{
"docid": "e66288fd31f1562ed36900a6852ee86b",
"score": "0.7447976",
"text": "def statsd_count_success(method, name, sample_rate: nil,\n tags: nil, no_prefix: false, client: nil, tag_error_class: false)\n add_to_method(method, name, :count_success) do\n define_method(method) do |*args, ... |
7c45ac4a97be4db494377fd8f6e18ec7 | Creates a new application to do OAuth authorization with. This allows you to use OAuth to authorize users using Discord. For information how to use this, see the docs: | [
{
"docid": "ba0b6d9a1edc51faca23007361ed5e0d",
"score": "0.69984186",
"text": "def create_oauth_application(name, redirect_uris)\n response = JSON.parse(API.create_oauth_application(@token, name, redirect_uris))\n [response['id'], response['secret']]\n end",
"title": ""
}
] | [
{
"docid": "094d7d451f48a7c8dad4da93ee83a33a",
"score": "0.69853544",
"text": "def create_oauth_application(token, name, redirect_uris)\n request(\n __method__,\n :post,\n \"#{api_base}/oauth2/applications\",\n { name: name, redirect_uris: redirect_uris }.to_json,\n Authoriza... |
c0534aa6413b03341e2f8e5a190e5fb3 | Stores an action in the database and generates the first Bitmap and Canvas records for a particular canvasID if they do not yet have any records in the database. Afterwards, broadcasts the action to all connected clients. | [
{
"docid": "2de44d5ca89f9edf97c1783851da0707",
"score": "0.4674873",
"text": "def get_action_handler(test_message = nil)\n time = Time.now\n if test_message.nil?\n working_message = message\n else\n working_message = test_message\n end\n message_json = JSON.parse(working_message... | [
{
"docid": "8d12afd31c5585458ab98c787cbc5e0e",
"score": "0.55151004",
"text": "def connect\n a = Action.new\n a.action = \"connect\"\n a.result = \"connected\" \n self.actions << a\n a.save\n end",
"title": ""
},
{
"docid": "85eae221f43cdc3b93b093d404ff1748",
"score": ... |
cd648800478132d9ad8ab3b22279ef52 | Get the current game state for the given lobby | [
{
"docid": "d6c80365a0f6e6d2c46bc027caf2eaa8",
"score": "0.8623113",
"text": "def get_current_game_state(lobby_id)\n find_lobby(lobby_id).game_state\n end",
"title": ""
}
] | [
{
"docid": "34aa493d371bc8254a0e1ebf97ddfa81",
"score": "0.7545929",
"text": "def lobby\n games(game_state: \"lobby\").any? ? games(game_state: \"lobby\")[0] : false\n end",
"title": ""
},
{
"docid": "6a8f82d902b31dea78d58cc1fa4bbb57",
"score": "0.7501408",
"text": "def get_game(... |
c0309b418e819be2b51b2eb98ba56bba | Delete a team attribute definition | [
{
"docid": "bb6912d8ba04e0d96fced43462c41fdd",
"score": "0.84387976",
"text": "def delete_team_attribute_definition(name, headers=default_headers)\n @logger.info(\"Deleting the \\\"#{name}\\\" Team Attribute Definition\")\n delete(\"#{@api_url}/teamAttributeDefinitions/#{encode(name)}\", heade... | [
{
"docid": "fe5b668da9aed55a84a2b3c058a23b19",
"score": "0.695668",
"text": "def delete(attribute); end",
"title": ""
},
{
"docid": "5e7b3554d5a056d09bb2508796be62e8",
"score": "0.68441445",
"text": "def remove_attribute(name); end",
"title": ""
},
{
"docid": "5e7b3554d5a... |
5536242d5ce55505fc40c4091b383e29 | Query for survey aggregates | [
{
"docid": "2702d54733dddabe3218d97fe2ae6429",
"score": "0.55907136",
"text": "def post_analytics_surveys_aggregates_query(body, opts = {})\n data, _status_code, _headers = post_analytics_surveys_aggregates_query_with_http_info(body, opts)\n return data\n end",
"title": ""
}
] | [
{
"docid": "6908d4016df8e2944fc4ac3797bd5514",
"score": "0.6601989",
"text": "def index\n @surveys = Survey.all\n\n survey_bars = []\n surveys = []\n\n results = Survey.select(:product, \"SUM(answer)\").group(:product).order(:product)\n\n results.each_with_index do |r, index|\n surve... |
1f90e4e6b0c32e4df66fcc67f1ed4f33 | DELETE /participacaos/1 DELETE /participacaos/1.json | [
{
"docid": "2932167ea74bcdf7a7fb1ec7496bf805",
"score": "0.74755716",
"text": "def destroy\n @aux=@participacao\n @participacao.destroy\n respond_to do |format|\n format.html { redirect_to reuniao_path(@participacao.reuniao), notice: 'Participacão foi removida com sucesso.' }\n format... | [
{
"docid": "9401737f402f5eaf614d166611c77741",
"score": "0.7616906",
"text": "def destroy\n @participante.destroy\n respond_to do |format|\n format.html { redirect_to proyecto_url(params[:proyecto_id]) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"d... |
5ee9d4e13c886bd6a1f998a37051d6e7 | want to be able to do: student = Student.new(name: "Kevin", grade: 12) will only work if there are corresponding attr_accessor for every key which gets taken care of by col_names method in the Student Class. | [
{
"docid": "c1f67317d519a3ca657a9eae99459171",
"score": "0.0",
"text": "def initialize(options = {})\n options.each do |key, value|\n self.send(\"#{key}=\", value)\n end\n end",
"title": ""
}
] | [
{
"docid": "3800d18edde4c46db16c996f16abf597",
"score": "0.6481321",
"text": "def initialize(student_hash)\n # @name=student_hash[:name] #works\n # @location= student_hash[:location] \n # @twitter = student_hash[:twitter] \n # @linkedin = student_hash[:linkedin... |
7f9fb888b180939c93bd4b5edc5aafdc | Based on the current host store, to determine if an entry is a known subdomain | [
{
"docid": "643d7d1b6417cd4d762ad7c735e9049b",
"score": "0.74344295",
"text": "def sub_domain_known?(domain)\n\t\tputs \"Validate sub-domain: #{domain}\" if @verbose\n\t\tdomain=domain.strip.downcase\n\t\tsubs=dump_sub_domains\n\t\treturn subs.include?(domain)\n\trescue Exception => ee\n\t\tputs \"Excep... | [
{
"docid": "17a3bc3f776a4e52b52bcb2531beff02",
"score": "0.75094664",
"text": "def is_subdomain?(da, db)\n\n da == db ||\n db == '' ||\n da[0, db.length + 1] == db + '.'\n end",
"title": ""
},
{
"docid": "ae0d3e3fd8d14724e1fa50c819e8461a",
"score": "0.7372363",
"tex... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "0de22a2ccdd657288aaa7f5710d8a313",
"score": "0.0",
"text": "def course_params\n params.permit(:subject, :id)\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... |
53498a5d3f1dc8206328d4171858761c | === Description Copy a job === Examples new_job = hud.copy_job "jobname", "newjobname" job = hud.find_by_name "jobname" new_job = hud.copy_job job, "newjobname" | [
{
"docid": "318bc8101d7d8132063bfe0bab6c70c8",
"score": "0.85491836",
"text": "def copy_job job, new_job\n job = Hudkins::Job === job ? job : jobs.find_by_name( job )\n job.copy( new_job ) if job # find_by_name didn't return nil\n end",
"title": ""
}
] | [
{
"docid": "ab583e69241d330018a668402867113b",
"score": "0.86691874",
"text": "def copy new_job_name\n # post /createItem?name=NEWJOBNAME&mode=copy&from=FROMJOBNAME\n response = post \"/createItem?\" +\n url_escape(:name => new_job_name, :mode => \"copy\", :from => name)\n # return new job... |
35170e617fd4405db272b46cc334eaa0 | Delete OAuth 2.0 Client Delete an existing OAuth 2.0 Client by its ID. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. Make sure that this endpoint is well protected a... | [
{
"docid": "c19185fc4961412f704ae4bf63eb0ab6",
"score": "0.7324768",
"text": "def delete_o_auth2_client(id, opts = {})\n delete_o_auth2_client_with_http_info(id, opts)\n nil\n end",
"title": ""
}
] | [
{
"docid": "ef1edb7703df8f3d60b5d217378cb07c",
"score": "0.7899214",
"text": "def delete_client(client_id)\n raise Auth0::MissingClientId, 'Must specify a client id' if client_id.to_s.empty?\n path = \"#{clients_path}/#{client_id}\"\n delete(path)\n end",
"title": "... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "1b9fd797f1ebe6b3629c5de2fc2759c3",
"score": "0.0",
"text": "def set_application\n @application = Application.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... |
3e3f6279dc5d803731f9470473640211 | GET /queries/1 GET /queries/1.json | [
{
"docid": "8972758a4c1560daab8562285c641c78",
"score": "0.0",
"text": "def show\n\n @competitors = []\n\n competitors_parse = JSON.parse(@query.competitors_json)\n if competitors_parse.nil? == false && @query.competitors.count == 0\n competitors_parse.each do |competitor_parse|\n ... | [
{
"docid": "15ed7a52748904261a6a6509833f9472",
"score": "0.721383",
"text": "def index\n @queries = Query.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @queries }\n end\n end",
"title": ""
},
{
"docid": "15ed7a52748904261a6a650... |
c41bf37c8473a75f33e3f059f02ed4dd | Locates the service corresponding to the given path. | [
{
"docid": "a8015ae239cb54f9c9728bd97a69bd5c",
"score": "0.70906353",
"text": "def service(path)\n if path.nil? || path == ''\n return self\n end\n index = path.index('/')\n if index.nil?\n return level_service(path)\n end\n return level_service(path[0..(index... | [
{
"docid": "e8e807e295b3bc4c300490e3f7c21425",
"score": "0.72740424",
"text": "def service(path)\n if path.nil? || path == ''\n return self\n end\n index = path.index('/')\n if index.nil?\n return operating_system_service(path)\n end\n return operating_system_... |
25c181f6a05b70f314eaee691cb668bc | Returns a list over all directories in the directory. | [
{
"docid": "c60111abe3802b691bdc3fbbcad19659",
"score": "0.7320262",
"text": "def directories\n directory_entries.map{ |f| FileObject[path, f] }\n end",
"title": ""
}
] | [
{
"docid": "b9e128e1af7bb95633fc454c8cc83fbd",
"score": "0.7909335",
"text": "def all_directories dir\n Dir[\"#{dir}**/\"]\nend",
"title": ""
},
{
"docid": "872621478abcfb334e8d34972e2fc2a8",
"score": "0.7758977",
"text": "def directories\n directory.directoires\n end",
... |
e22d8e20e4d1d907c16d4d9622cc38d9 | GET /drifverier/1 GET /drifverier/1.json | [
{
"docid": "527c444dd9246b4081b5d7f2507b6ed4",
"score": "0.7404622",
"text": "def show\n @drifveri = Drifveri.find(params[:id])\n @ofverdrif = Drifvare.find_by_id @drifveri.ofverdrif_id\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @drifveri }\n ... | [
{
"docid": "020f9fb83b4c872d7ab8f55cae6a566e",
"score": "0.75111055",
"text": "def index\n @drifverier = Drifveri.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @drifverier }\n end\n end",
"title": ""
},
{
"docid": "e3673cfbfa6a... |
011d48bf1f246d84a4bd201f28e35b84 | This method returns all the user periods ordered by date | [
{
"docid": "6f30878a4fccef00a6c4d28e4f9762c6",
"score": "0.7016292",
"text": "def get_periods\n @periods = current_user.periods.all.order(created_at: :desc)\n render json: @periods\n end",
"title": ""
}
] | [
{
"docid": "0c79ea84ad9cd45a53fbbb48c0290b6b",
"score": "0.6564778",
"text": "def index\n UserDate.generate_token_for_user current_user\n @user_dates = current_user.dates.sort_by(&:date)\n end",
"title": ""
},
{
"docid": "0ba6b7beb50bb843927b3353b3a7cfb1",
"score": "0.6377466",
... |
fdd559db2f81492dd66c314608476ffe | POST /empire_state_lists POST /empire_state_lists.json | [
{
"docid": "bc4b4b73a66ed0682bf54751562c1dfe",
"score": "0.7768478",
"text": "def create\n @empire_state_list = EmpireStateList.new(empire_state_list_params)\n\n respond_to do |format|\n if @empire_state_list.save\n format.html { redirect_to empire_state_lists_path, notice: 'Empire sta... | [
{
"docid": "9b20b5def1147464857747fb3468cca8",
"score": "0.6813733",
"text": "def set_empire_state_list\n @empire_state_list = EmpireStateList.find(params[:id])\n end",
"title": ""
},
{
"docid": "c3e68a0ed21177bc054694905fe3256e",
"score": "0.68003255",
"text": "def empire_st... |