query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
98f53fd84c261dffa4bfd46f24b8c576
GET /apps/1/hints GET /apps/1/hints.json
[ { "docid": "9129f67bd7f471bdcd115a8248576a1e", "score": "0.6773271", "text": "def index\n @title = t('view.hints.index_title')\n hints = @tag ? @tag.hints : @app.hints\n hints = hints.public unless current_user\n \n @hints = hints.order('importance ASC').paginate(\n page: params[:pag...
[ { "docid": "c4f885fc8c23ea3a03ae6601d73d102f", "score": "0.71610427", "text": "def show\n @title = t('view.hints.show_title')\n @hint = (current_user ? @app.hints : @app.hints.public).find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render jso...
f45bd971671eee6bfa6958e8bfd966eb
The +to+ domain address set on the initial stream header must not change during stream restarts. This prevents a user from authenticating in one domain, then using a stream in a different domain.
[ { "docid": "64242a5d055192cd9a77fe91134a1a16", "score": "0.56681657", "text": "def domain_change?(to)\n to != @session.domain\n end", "title": "" } ]
[ { "docid": "2192741b7d40fdf24aa5d3cd084a6564", "score": "0.5485331", "text": "def domain_change?(to, from)\n to != @domain || from != @remote_domain\n end", "title": "" }, { "docid": "8e6dc2aa142345c1b580008b923876d1", "score": "0.5459025", "text": "def route_iq\n ...
d6ba912d8e2ba2ccac446cc8861261fc
ensures that each new record has a UUID assigned to the 'id' field.
[ { "docid": "6c61c57ae60e73aa6f14dbbd1901fd4e", "score": "0.6178055", "text": "def set_primary_key\n self.id = SecureRandom.uuid unless (id && id.uuid?)\n true\n end", "title": "" } ]
[ { "docid": "d681b487d8246853a6a120999fd7e463", "score": "0.70114744", "text": "def before_create()\n require 'uuidtools'\n self.id = UUID.timestamp_create().to_s\n end", "title": "" }, { "docid": "6350ba796dd2bd547399908acd351d70", "score": "0.6885351", "text": "def create_uui...
d6ce1e22aabac4e82099f58017df5ce0
mailler generique pour toutes actions
[ { "docid": "a7653109fe0ba49fb8c7a8df09307d81", "score": "0.0", "text": "def notify(message, phone, date, errors)\n @message = message\n @phone = phone\n @date = date\n @errors = errors\n #@class_name = class_name\n #@method = method || nil\n\n mail(to: 'apimail...
[ { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.7969808", "text": "def actions; end", "title": "" }, { "docid": "6c8e66d9523b9fed19975542132c6ee4", "score": "0.78101116", "text": "def add_actions; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a24...
084a441234d92bdb4d57bfdd900b7562
When called with a block, defines the asset host url to be used. The block must return a string that starts with a protocol (E.g. http). The block will be passed the rootrelative url of the asset. When called without a block, returns the block that was previously set.
[ { "docid": "189b711a1a3745f63048907358af5feb", "score": "0.71896875", "text": "def asset_host(&block)\n @set_attributes ||= {}\n if block_given?\n @set_attributes[:asset_host] = true\n @asset_host = block\n else\n if @asset_host\n @asset_host\n ...
[ { "docid": "026ee56a0da56cce3a76d8fa7520ef8c", "score": "0.70518905", "text": "def compute_asset_host # :nodoc:\r\n return nil if options[:asset_host] == false\r\n\r\n if host = options[:asset_host] || sprockets_helpers_settings.asset_host\r\n if host.respond_to?(:call)\r\n ...
b1986515fe65988e99e5a1bf3fae3e4f
GET /link1s/1 GET /link1s/1.json
[ { "docid": "303aee9dba67f67082e25201f8b2211d", "score": "0.7503629", "text": "def show\n @link1 = Link1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @link1 }\n end\n end", "title": "" } ]
[ { "docid": "62ab1aed72b2b4d6e1e6b518d5a461ea", "score": "0.772287", "text": "def index\n @link1s = Link1.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @link1s }\n end\n end", "title": "" }, { "docid": "11dcd8b6ad3f164b39ad1043c...
7df18efc583f36a5b58cb95d8217ec3c
Find the first route that matches an incoming request
[ { "docid": "5c02f329cbe013d058a48d620ca4ae6f", "score": "0.78309363", "text": "def find_route(request)\n @routes.find {|r| r.match?(request) }\n end", "title": "" } ]
[ { "docid": "564809c2aadc59d36856d2f59addec05", "score": "0.7658396", "text": "def match(req)\n @routes.select{|rt| rt.matches?(req) }.first\n end", "title": "" }, { "docid": "a29ac171eff1ee4a58d1cd4e10497ed6", "score": "0.7455128", "text": "def match_for(path)\n @routes.select...
21e4bed90c01fdf9174e07ca66dbf894
== is used for comparison of two instances directly
[ { "docid": "334b1806386638880d98394437be0861", "score": "0.0", "text": "def ==(other)\n other.id == id\n end", "title": "" } ]
[ { "docid": "c9f28ee35eaf35e1d32d005f20b3d642", "score": "0.8475425", "text": "def ==(other); equals(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.84004337", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386...
891317af7f58f617fad0b0e6acb49fb5
If no file name is supplied, use the name of the table for the file name
[ { "docid": "de31d73e267a5c6e090ded69d226c8c3", "score": "0.70382047", "text": "def file_name\n if @options[:file_name].nil?\n if @options[:parser].nil?\n tn = @options[:table_name]\n @options[:file_name] = File.join(Dir.pwd, tn + '.txt')\n else\n @options[:file_name] = ...
[ { "docid": "078122daad514f7000d015c2efc9714e", "score": "0.8107425", "text": "def table_name\n if @options[:table_name].nil?\n fn = @options[:file_name]\n @options[:table_name] = File.basename(fn).gsub(File.extname(fn), '')\n end\n @options[:table_name]\n end", "title": "" }, ...
3f27d6c93ed0e81f05a37ffce7ff51dc
a simple helper for readability
[ { "docid": "8dc2472634900b5cb678b3aa3d6e2b87", "score": "0.0", "text": "def doing(&block)\n block\n end", "title": "" } ]
[ { "docid": "43f0dd8ef7a8eac6d29500de95da0282", "score": "0.6626537", "text": "def formatted; end", "title": "" }, { "docid": "43f0dd8ef7a8eac6d29500de95da0282", "score": "0.6626537", "text": "def formatted; end", "title": "" }, { "docid": "57db8fb8618db6d48ca87408eff5135e...
04bce121d95c2577ab38a9a996edd322
Define the default report. Displays IAD and SFO times.
[ { "docid": "0f9259a3d3905190c11f46c15294f06b", "score": "0.75327325", "text": "def default_report()\n # display ET and PT only\n print \"#{process_time(@city[:utc_offset], @city[:utc_dst], \"UTC\", @city[:utc_variance])} \"\n print \"#{process_time(@city[:iad_offset], @city[:iad_dst], \"IAD\", @c...
[ { "docid": "052dc1612150e2ccb47f087555b4fe40", "score": "0.6622824", "text": "def create_report\n\ttitle_report(\"Sales Report\")\n\tprint_report \"********************\"\n\t# Displays the time when the salee report was generated.\n\ttime_date\n\tprint_report \"********************\"\n\t# Prints all the...
62120ed049c6c646f330310ac0a27f56
parameters used to instantiate the JS object
[ { "docid": "7a9244094cf903c52fdf90efb5a22a0e", "score": "0.0", "text": "def js_config\n res = super\n res.merge!(:clmns => columns)\n res.merge!(:model => data_class.name) if data_class\n res.merge!(:pri => data_class.primary_key) if data_class\n res\n end", "title": "" ...
[ { "docid": "20068d0e503ff290613115cf75dafb30", "score": "0.7144841", "text": "def js_object(args={})\n params = ''\n args.each_pair do |k, v|\n params += \"#{k}:#{v}, \"\n end\n \"{ %s title:\\\"#{@graph_list.currentItem.text}\\\", type:\\\"#{@symbols[@graph_list.currentRow]}\...
95a189ab4c8aed64ee09b0fbfa4daa28
=begin CharacterDatainsertData(offset, str) [DOM] insert a string at the specified character offset. =end [DOM]
[ { "docid": "3b95c61d31f70cb6d8e72977806409ba", "score": "0.77706707", "text": "def insertData(offset, str)\n if offset < 0 || offset > @value.length\n raise DOMException.new(DOMException::INDEX_SIZE_ERR)\n end\n @value[offset, 0] = str\n end", "title": "" } ]
[ { "docid": "789bde1703cfca0d83d78e06c46d1123", "score": "0.75257915", "text": "def insert(string, offset = 0)\n `#@native.insertData(offset, string)`\n\n self\n end", "title": "" }, { "docid": "a5176da53f7f82fb6a91eff36d5ba981", "score": "0.7486721", "text": "def insert(text, ...
9c276547ec0cbc06df2359fdd5928207
A legacy shorthand for attached_disk_obj
[ { "docid": "4967de2314972f6326742dc8e262e1f0", "score": "0.6265253", "text": "def get_as_boot_disk(writable = true, auto_delete = false)\n attached_disk_obj(boot: true,\n writable: writable,\n auto_delete: auto_delete)\n end", "ti...
[ { "docid": "feb18625f5d976eb7b01f3161ebd220b", "score": "0.65360713", "text": "def disk\n @disk\n end", "title": "" }, { "docid": "feb18625f5d976eb7b01f3161ebd220b", "score": "0.65360713", "text": "def disk\n @disk\n end", "title": "" }, { "docid": "feb186...
edc3af39747f6b38cbe1181f6c7a20d9
POST /listers POST /listers.json
[ { "docid": "2f5e7642a3d978d74f10f838c315c31f", "score": "0.5738759", "text": "def create\n @lister = Lister.new(lister_params)\n\n respond_to do |format|\n if @lister.save\n\n # Added for the redirect to the buyer search.\n format.html { redirect_to buyers_search_url, notice: 'L...
[ { "docid": "f26490697a3a3ac1745ddceb5f14f233", "score": "0.68518114", "text": "def beers_list\n \t@url = 'https://api.punkapi.com/v2/beers' \t\t\n \tresponse = RestClient.get beer_url\n \tjson_response = JSON.parse response.body\n\n \tcreate_list = ::Beers::Create.call(\n \t\tuser: @current_user...
0b1a16e6927e221a4549033bb3b676cb
def start_time self.my_related_model.start Where 'start' is a attribute of type 'Date' accessible through MyModel's relationship end
[ { "docid": "9ba39afa37732aeee83f063cac019456", "score": "0.0", "text": "def booking_params\n params.require(:booking).permit(:fan_id, :user_id, :start_date, :end_date, :status)\n end", "title": "" } ]
[ { "docid": "9ffd6955878b86c457531e695628172a", "score": "0.7689046", "text": "def start_time\n self.date\n end", "title": "" }, { "docid": "07d8646d7145a10f1f6656aba2fc4607", "score": "0.7272953", "text": "def start_time\n by_date\n end", "title": "" }, { "docid":...
f3afc280590592e154f0e449ace3106c
Returns a list of changes
[ { "docid": "0f0e2942b0631943a17e005c89c2f886", "score": "0.6744074", "text": "def changes\n records = {}\n comments_query =\n '//ol[@class=\"commentlist snap_preview\"]//div[@class=\"comment_message\"]/p'\n\n homepage.xpath(comments_query).each do |change|\n id = change.xpat...
[ { "docid": "05208f310807d22e6262d539de2007ff", "score": "0.79637986", "text": "def changes\n arr = []\n git.status.each{ |f| arr << f if f.type =~ /A|D/ }\n arr\n end", "title": "" }, { "docid": "03250d398ff55b6eabb1a8a46cf2d330", "score": "0.7777894", "text": "def ...
aa32fdbd15a00567fe15d0f15fb02edd
GET /takeouts GET /takeouts.json
[ { "docid": "dfde891f6eecd5080455d6e3247801c9", "score": "0.7418837", "text": "def index\n @takeouts = Takeout.all\n end", "title": "" } ]
[ { "docid": "29b52b5bae5c0a8fbb04955905916302", "score": "0.6888952", "text": "def index\n if params[:workpoint_id]\n @outs = Workpoint.find(params[:workpoint_id]).outs\n else\n @outs = Out.all\n end\n respond_to do |format|\n format.json {\n render :json => @outs, :layo...
23574c2a318a2e4b8903316c3ba4d8b5
DELETE /hurdle_matches/1 DELETE /hurdle_matches/1.json
[ { "docid": "f7f4d4246dd78dbfb9c32ecafb2fb41d", "score": "0.7823967", "text": "def destroy\n @hurdle_match = HurdleMatch.find(params[:id])\n @hurdle_match.destroy\n\n respond_to do |format|\n format.html { redirect_to hurdle_matches_url }\n format.json { head :no_content }\n end\n ...
[ { "docid": "dfd5c66f432ac332869bf934e933461e", "score": "0.74630755", "text": "def destroy\n @bowling_match.destroy\n respond_to do |format|\n format.html { redirect_to bowling_matches_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "db7ed...
9bd2786258099961dccd9e04071fd174
GET /articles GET /articles.json
[ { "docid": "a3e2284c636fa2822bc0d36ebd9b2cbe", "score": "0.76510435", "text": "def index\n @articles = Article.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @articles }\n end\n end", "title": "" } ]
[ { "docid": "19a11bbe551c564fa7cca7d31c8cbc3f", "score": "0.81214875", "text": "def show\n @articles = Article.find(params[:id])\n render json: @articles\n end", "title": "" }, { "docid": "d3f6690e96780612b04d7c8ac2519fb1", "score": "0.7839265", "text": "def index\n @artic...
b562dd4a16a14645eb7d7dce77008f6c
Exercise 1 : Summary : One.rb outputs some text
[ { "docid": "f2810fb1cb6e851d20fd00b9b3f6cc00", "score": "0.0", "text": "def dude\n\tputs \"This is file 1\"\t\t\t\t\t\t\nend", "title": "" } ]
[ { "docid": "d9b8cd19d2bffcf249ba8f862789a79a", "score": "0.6888887", "text": "def main\n puts \"What main dish would you like? \"\n puts \"\"\n puts \"1. Chicken Fried Steak ($4.00)\"\n puts \"2. Pizza ($2.00)\"\n puts \"3. Baked Potato ($3.00)\"\nend", "title": "" }, { "docid": "044b62...
bb5ded7c4b1dd67c2c0333927e413509
Quick access to the source directory identified by your project model
[ { "docid": "e09d310eba5facb48269cb9f28cf937c", "score": "0.7541275", "text": "def src_dir\n return model.src_dir\n end", "title": "" } ]
[ { "docid": "2f329da1801e2022d36badb4a494ac1b", "score": "0.7621752", "text": "def source_dir\n get(\"source\", nil)\n end", "title": "" }, { "docid": "a63bf309b7c71e03e6600a639b36f3e4", "score": "0.75471956", "text": "def source_dir\n Dir.pwd\nend", "title": ""...
08c6fcaf08a2b30b516ed9bbaef406c4
The number of times to repeat the value, minus one. This value must not be negative.
[ { "docid": "a0df8e8e64caaa5b7267fbceea0b1e63", "score": "0.62574136", "text": "def repeat_count_m1\n return @repeat_count_m1 unless @repeat_count_m1.nil?\n @repeat_count_m1 = repeat_count_m1_raw.value\n @repeat_count_m1\n end", "title": "" } ]
[ { "docid": "949938243c27f9f5d40c7f49f6cc245b", "score": "0.7795588", "text": "def repeat_count\n return @repeat_count unless @repeat_count.nil?\n @repeat_count = (repeat_count_m1 + 1)\n @repeat_count\n end", "title": "" }, { "docid": "949938243c27f9f5d40c7f4...
8d88367f68e4826bf49b0975d8445786
config/initializers/shared_count_api.rb (for instance) SharedCountApi.configure do |config| config.apikey = 'myapikey' config.url = 'mydedicatedurl' only use if you have a dedicated url plan end elsewhere client = SharedCountApi::Client.new
[ { "docid": "2a7319fb4f6818acdf16a0534c034d7a", "score": "0.0", "text": "def configure\n yield self\n true\n end", "title": "" } ]
[ { "docid": "b943aabded73c99562a78136a9ac58b6", "score": "0.69793713", "text": "def api_client; settings.api_client; end", "title": "" }, { "docid": "d0c87a25f4ffb4a104cc5ce061bfb352", "score": "0.69293076", "text": "def config api_key, secret\n self.api_key = api_key\n self.sec...
1a5a96307234d7c0ab5928a0f6508429
Build a url from the base url and query parameters hash. Query parameters should not be URL encoded because this method will handle that
[ { "docid": "4cec81965c3e87824830e4174188ba44", "score": "0.6797948", "text": "def build_url(url, params = nil)\n if params.respond_to? :each\n params.each do |key, value|\n # Convert dates to CC date format\n if value.respond_to? :iso8601\n params[key] ...
[ { "docid": "e1c029681e277634a8d3989aa86adccd", "score": "0.83338636", "text": "def build_url(params)\n \"#{@base_url}?#{params.to_query}\"\n end", "title": "" }, { "docid": "574add16ba3658ba80e5953b55954858", "score": "0.8151979", "text": "def build_uri\n URI.parse(b...
d1dbce910dc720d09280e8f2fdd396bd
Creates a tab series (identified by +name+) and a scope around a specific section of the view. The specified tabs generate the required HTML tags and on the availability of the plugin provided image and stylesheet resources it completes the UI element. The +name+ argument also designates the HTML id attribute of the ta...
[ { "docid": "7ae8b9180a94c8bb8ef290624d8d820d", "score": "0.62038636", "text": "def tabs_for(name, *args, &proc)\n raise ArgumentError, \"Missing block\" unless block_given?\n options = args.extract_options!\n\n raise ArgumentError, \"Class should be :primary or :secondary\" unless [:primary, :s...
[ { "docid": "9d6d264d79c71295fdbae8dfdf7cb54e", "score": "0.6465583", "text": "def def_tabs(tabs_name,options={},&block)\n tabs[tabs_name] = Tabs.new(:name => tabs_name,:block => block,:render_proc => options[:render_proc])\n end", "title": "" }, { "docid": "660d4ebe5606cc0e74f966a638ca15...
1b470b7dccab78571a110312fd2d2818
Build select option html from date value and options build_options(15, :start => 1, :end => 31) => "1 2 3..."
[ { "docid": "74fe0e4e29967b362f7d8d674a8630d6", "score": "0.74060214", "text": "def build_options(selected, options = {})\n start = options.delete(:start) || 0\n stop = options.delete(:end) || 59\n step = options.delete(:step) || 1\n leading_zeros = o...
[ { "docid": "1ce03d7fa5470b949561db185c4672fc", "score": "0.72618484", "text": "def build_era_name_options(selected, options = {})\n start = options.delete(:start) || 0\n stop = options.delete(:end) || 59\n step = options.delete(:step) || 1\n ...
73eaab68db536a0367bc90d05df263e2
Generates a master YAML index of ATT&CK Tactic > Technique > Atomic Tests
[ { "docid": "547ca65fcce059ff26b7ec3d45fc1e02", "score": "0.65713537", "text": "def generate_yaml_index_by_platform!(output_doc_path, platform)\n result = {}\n\n ATTACK_API.techniques_by_tactic.each do |tactic, techniques|\n result[tactic] = techniques.collect do |technique|\n [\n ...
[ { "docid": "3b9ae91d79cac65b98f1422cbc8a2afe", "score": "0.7405486", "text": "def generate_yaml_index!(output_doc_path)\n result = {}\n\n ATTACK_API.techniques_by_tactic.each do |tactic, techniques|\n result[tactic] = techniques.collect do |technique|\n [\n technique['extern...
95c911e12b5165e1f828dcbd748b5b79
PUT /readings/1 PUT /readings/1.xml
[ { "docid": "d989ac847f6082284b6913123388e342", "score": "0.6228989", "text": "def update\n @reading = Reading.find(params[:id])\n\n respond_to do |format|\n if @reading.update_attributes(params[:reading])\n format.html { redirect_to(@reading, :notice => 'Reading was successfully update...
[ { "docid": "c2c0b673628fdc28b181d18c0afd2d5b", "score": "0.5985818", "text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "title": "" }, { "docid": "55a6120b99ccce2a73829df63e8f7849", "score": "0.593...
a4a6732f97b123d19cedb99fbb5db88a
Generates the RBS lines for this object's comments.
[ { "docid": "627e5e0eca8f14d0332c325ba7ef2232", "score": "0.0", "text": "def generate_comments(indent_level, options)\n comments.any? \\\n ? comments.map { |c| options.indented(indent_level, \"# #{c}\") }\n : []\n end", "title": "" } ]
[ { "docid": "054ee93f45b2e1019da0c6587fd39a08", "score": "0.64560175", "text": "def generate_rbs(indent_level, options)\n generate_comments(indent_level, options) +\n generate_body(indent_level, options)\n end", "title": "" }, { "docid": "c406a4387a4bd9c77a73a36cd14dc99b"...
8b8e701b7d492f8a3c9bf9824b28756c
==== Description Just the pathname of where to upload to
[ { "docid": "942620f911af55ef978452241971fc9d", "score": "0.0", "text": "def destination_path\n @_destination_path ||= \"#{@rf['project_id']}/#{@rf['booking_id']}/\" end", "title": "" } ]
[ { "docid": "a1b5a1afedf6332f5ba18d9c66798f48", "score": "0.83114254", "text": "def path\n \"/#{UPLOAD_DIR}/#{filename}\"\n end", "title": "" }, { "docid": "b92c736d6066fc9cc26603958c014c09", "score": "0.7984325", "text": "def upload_full_path\n @upload_full_path ||= File.join(...
4016e8629010168874ca1613ef0fecc0
Evaluates the supplied 'code' in the given context
[ { "docid": "c03310d0aee82fe94a200e91a9601d05", "score": "0.7481489", "text": "def evaluate( code )\n Kernel.eval( code, self )\n end", "title": "" } ]
[ { "docid": "fe07cda195f0471c32022f6bb676a3b1", "score": "0.7460882", "text": "def eval(code)\n @eval_handler.call(code)\n end", "title": "" }, { "docid": "978b1e2d5dc5496b632aeb171e4f23ec", "score": "0.7077546", "text": "def evaluate_context(context)\n evaluate(c...
0e84d2ae3bf9137dcb60c6b8658dcb93
permet l'alternance de joueurs
[ { "docid": "fd62ed728380009f29e22401b2513897", "score": "0.0", "text": "def turn\n\t\t@board.play_turn(@fighters, @board)\n\t\tend_game\n\tend", "title": "" } ]
[ { "docid": "c5a91b87b886e8dd7108e2de1ed7b7fc", "score": "0.60715926", "text": "def pasar_turno\n @indice_jugador_actual = (@indice_jugador_actual + 1) % @jugadores.size\n end", "title": "" }, { "docid": "c5a91b87b886e8dd7108e2de1ed7b7fc", "score": "0.60715926", "text": "def p...
0a97823874ae0ce19b7d2f0bbf27c6a6
aka the Checkout section
[ { "docid": "15016d4054b72a44f807fbc6145119e0", "score": "0.0", "text": "def show\n @categories = Category.all\n @provinces = Province.all\n\n @customer = Customer.new\n end", "title": "" } ]
[ { "docid": "3a81d3398793d001e2d6efce551a718f", "score": "0.702125", "text": "def enter_checkout; end", "title": "" }, { "docid": "ae0c8eb36525d8fa86e90b82fff8f07c", "score": "0.6723191", "text": "def checkout\n # Your code here\n end", "title": "" }, { "docid": "28d43...
5f7b4a86accc4b67b8e5d6216ce8229e
Essentially, define an accessor for +name+ with +block+. Why use let instead of def? I honestly don't know.
[ { "docid": "b3813fb8e969115abb22b198bf87b6aa", "score": "0.64791286", "text": "def let name, &block\n define_method name do\n @_memoized ||= {}\n @_memoized.fetch(name) { |k| @_memoized[k] = instance_eval(&block) }\n end\n end", "title": "" } ]
[ { "docid": "92adda6947083f84accc3dd2bb82c52f", "score": "0.7680081", "text": "def named(name, &block)\n @name = name\n if block_given?\n instance_eval(&block)\n arg\n else\n self\n end\n end", "title": "" }, { "docid": "f979302a5e06eccba98adc413ed282eb", "scor...
7ae859c39d2f111c2feabec8809bdf66
Legacy claimsApi code previously allowed servicePayrelated service branch values (servicePay.militaryRetiredPay.payment.serviceBranch, servicePay.separationPay.payment.serviceBranch) that are not accepted by EVSS. Rather than refuse those invalid values, this maps them to an equivalent value that EVSS will accept. Note...
[ { "docid": "98f7bfac9038418c9a5386d896ebdbce", "score": "0.8287297", "text": "def transform_service_pay_service_branch\n %w[militaryRetiredPay separationPay].each do |pay_type|\n if pay_type_service_branch?(pay_type)\n branch = form_data['servicePay'][pay_type]['payment']['serviceBr...
[ { "docid": "5bc0561ea98bbd7b00eee4f30650b17d", "score": "0.79035175", "text": "def transform_service_branch\n received_service_periods = form_data['serviceInformation']['servicePeriods']\n\n transformed_service_periods = received_service_periods.map do |period|\n name = period['serviceB...
faa90f7631d190d2b630f54e3035a549
TODOS: do actual math and get points for the 3slot hexagon, rather than scaling the fullsize hexagon
[ { "docid": "91d86c853c809bd7750a7a683fbd716e", "score": "0.0", "text": "def render_box(slots)\n element, attrs = BOX_ATTRS[slots]\n h(element, attrs: attrs)\n end", "title": "" } ]
[ { "docid": "f85b8150bf27991b05e27ae6af3a6189", "score": "0.72709423", "text": "def hexagon length, x_start, y_start\n hex = [[length + x_start, y_start],\n [((length/2) + x_start), (length * Math.sqrt(length/2)) + y_start],\n [((-length/2) + x_start), (length * Math.sqrt(length/2)) + y_st...
a0a2378ee754f9f066264ac8cfb236fe
Returns the adspaceItems' ID as integer representation
[ { "docid": "5c03a07eca3319ae048c0af9c3a5b8cf", "score": "0.64939296", "text": "def to_i\n @adspace\n end", "title": "" } ]
[ { "docid": "4c3c6e21518a491bd76f0c1753a70d3e", "score": "0.67945343", "text": "def to_i\n @id\n end", "title": "" }, { "docid": "4c3c6e21518a491bd76f0c1753a70d3e", "score": "0.67945343", "text": "def to_i\n @id\n end", "title": "" }, { "docid": "4c3c6e2151...
05fbe2556b15f7b1959b9f798ddd48d2
GET /pets GET /pets.json
[ { "docid": "5ed67f6bcd79de4a5f44d176e2b717ed", "score": "0.65229636", "text": "def index\n @pets = @client.pets# Se muestran las macotas asociados a este cliente\n end", "title": "" } ]
[ { "docid": "0fab89a021467a80a7188e7cfce80a17", "score": "0.76066303", "text": "def show\n @pet = Pet.find(params[:id])\n render json: @pet\n end", "title": "" }, { "docid": "7dad6f5e2862593587d2c6dec9b1c054", "score": "0.7532614", "text": "def index\n @pets = Pet.all\n\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "3c2d441dae1c57b167c05812c4247327", "score": "0.0", "text": "def set_product\n @product = Product.find_by(slug: params[:slug])\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...
58d2d56c2702582000c0773ac0c62adb
GET /sales/1 GET /sales/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "1a8f11c70759e8247c216fe2cf3c982a", "score": "0.78285635", "text": "def sales; JSON[Api::get_sales(self)]; end", "title": "" }, { "docid": "0ce5890d301b14b0afc923ab592fca09", "score": "0.7794042", "text": "def index\n @sales = Sale.all\n\n respond_to do |format|\n ...
a12b19719fd5133a98a847cb9050e587
Downloads a file to disk from the configured Nexus server.
[ { "docid": "9498cf7691e70d7a82ad30f90a6aeeef", "score": "0.0", "text": "def retrieve_from_nexus(node, source, destination_dir, options = {})\n require 'nexus_cli'\n config = data_bag_config_for(node, DATA_BAG_NEXUS)\n if config.empty?\n raise DataBagNotFound.new(DATA_BAG_NE...
[ { "docid": "486b63130c97e50960d95cbfc04557e0", "score": "0.69260365", "text": "def download\n open(download_url, \"rb\")\n end", "title": "" }, { "docid": "06d9e70c74604286d5aece75ec4baa0e", "score": "0.68445605", "text": "def download(url)\n base.get(url, @file_path)\...
6ed5f8779549542b49c8ca446ba9b697
PATCH/PUT /blogs/1 PATCH/PUT /blogs/1.json
[ { "docid": "55b4629ad22c085dc416b5f30486eaae", "score": "0.6308801", "text": "def update\n respond_to do |format|\n if @blog.update(blog_params)\n format.html { redirect_to @blog, notice: 'Blog was successfully updated.' }\n format.json { render :show, status: :ok, location: @blog ...
[ { "docid": "7dde9e6733d8b9d1f7ecce6323d1f2ec", "score": "0.6742763", "text": "def update\n if @blog.update(blog_params)\n render json: @blog\n else\n render json: @blog.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "9c60232812804c494624ff0c...
f1c423c1160b653975adf60dfedb8888
DELETE /offices/1 DELETE /offices/1.json
[ { "docid": "a45f2cf83cda2552ea4d71f91a772c95", "score": "0.0", "text": "def disable\n @office = Office.find(params[:id])\n authorize! :update, @office\n \n @office.active_flag = 0\n\n track_event(\"Disabled Listing\");\n\n respond_to do |format|\n if @office.save\n format.h...
[ { "docid": "0ffc27c7a31eeb9c5de395a373b69e34", "score": "0.691941", "text": "def destroy\n @office = Office.find(params[:id])\n @office.destroy\n\n respond_to do |format|\n format.html { redirect_to offices_url }\n format.json { head :no_content }\n end\n end", "title": "" }...
263cb625370e9331577cb676e70adc55
Clicks the edit button, then instantiates the EditQuestionPool page class.
[ { "docid": "b5cc2a29f6e0a79a9782fae829991217", "score": "0.7177051", "text": "def edit_pool(name)\n frm.span(:text=>name).fire_event(\"onclick\")\n EditQuestionPool.new(@browser)\n end", "title": "" } ]
[ { "docid": "a47877373cc1204ae2dc8e9b6f1fc092", "score": "0.67914826", "text": "def edit\n @presenter = Fe::AnswerPagesPresenter.new(self, @answer_sheet, params[:a])\n unless @presenter.active_answer_sheet.pages.present?\n flash[:error] = \"Sorry, there are no questions for this form yet.\"\n ...
fab01271d660c4ca2f023c78bbfc13a4
Solve system AX = B. arg < X, A < self.polu A is a symmetric positive definite matrix.
[ { "docid": "a68dbd59279f93e8a3401e6e98672b6b", "score": "0.52819794", "text": "def posolve!(arg, uplo = RAtlas::LOWER)\n info, lstore, xstore = \n Lapack::posv!(uplo, arg.storage, @storage)\n if info > 0\n raise RNum::SingularError, \\\n ...
[ { "docid": "f549cc9dd9d13447b3a7be300e561fb9", "score": "0.6201851", "text": "def cho_solve(a, b, uplo:'U')\n Lapack.call(:potrs, a, b, uplo:uplo)[0]\n end", "title": "" }, { "docid": "3f433170f726dcb47f51fe9576cb32f5", "score": "0.6125", "text": "def lu_solve(lu, ipiv, b, trans:...
8dffae670c3e283c1d683dd4d4efb517
Push event based additional details to each property details Trackers::Buyer.new.push_events_details(PropertyDetails.details(10966139))
[ { "docid": "e181e0f60b043278f9a57143ea5d3661", "score": "0.67147046", "text": "def push_events_details(details, is_premium=false, old_stats_flag=false)\n new_row = {}\n new_row[:percent_completed] = PropertyService.new(details[:_source][:udprn]).compute_percent_completed({}, details[:_source] )\n ...
[ { "docid": "08da16c7980d2861201d2db6c319ca95", "score": "0.6895762", "text": "def add_properties(event_details_hash)\n event_details_hash.each do |key, value|\n self.send(\"#{key}=\", value)\n end\n end", "title": "" }, { "docid": "b4e35e2859682f5a56dbc69ecf08e4e8", "score": ...
fc79c6b60885cd29cf6a4bb9c53afd26
def ponytail_it? true if weather[:windspeed] >= dress_preferences[:wind_speed_ponytail] || weather[:humidity] >= dress_preferences[:humidity_hair] end
[ { "docid": "e90a32f500807910c2d56fcb74d97a08", "score": "0.0", "text": "def need_umbrella?\n return \"umbrella\" if weather[:precipProbability] >= dress_preferences[:precipitation_probability_umbrella]\n end", "title": "" } ]
[ { "docid": "18f1df34fd962e94e0bd7aab34823689", "score": "0.7215287", "text": "def winter_coat_for_today\r\n @weather_service.snowing? || (@weather_service.current_temp < 40)\r\n end", "title": "" }, { "docid": "641dae95d1c0d34754ada4f0212b3d66", "score": "0.71118253", "text": "de...
09c4172de6c7f99ab3ae2d40b4342e17
default find if other doesn't match
[ { "docid": "44f66282fc5cd67b62791b7029360c56", "score": "0.0", "text": "def find_by_extended query, *option\n raise NotImplementedError, 'this should be overridden by concrete client'\n end", "title": "" } ]
[ { "docid": "2c046db09834fa2301e44bcbd8c2b259", "score": "0.6611354", "text": "def find_by!(arg, *args); end", "title": "" }, { "docid": "147485588eab60e292509a495349cd5a", "score": "0.65635353", "text": "def find(*args, &block); end", "title": "" }, { "docid": "147485588e...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "e5f6051d071c59704850603c01057c4e", "score": "0.0", "text": "def set_breed\n @breed = Breed.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...
8525f2d66a96a3d56f45a4c07d20ccc3
delete all segments named 'segment' from the hl7 message
[ { "docid": "24f7809e1e7b1667d2edff8f3cee1775", "score": "0.727583", "text": "def delete( segment )\n @segments.delete_if{ |s| s.class.to_s.rpartition('::')[2]==segment.to_s }\n @segments_by_name.delete(segment.to_sym)\n end", "title": "" } ]
[ { "docid": "86500d25111677f9cd244e1abbb59624", "score": "0.65864664", "text": "def remove_segment_association(segment)\r\n group_messages_segment = self.group_messages_segments.where(:segment_id => segment.id).first\r\n group_messages_segment.news_feed_link_segment.destroy\r\n end", "title": ...
e5ff3e8679eb4d0a446a39dd8bb80070
GET /send_histories GET /send_histories.json
[ { "docid": "b5706f3b3ac0730b3e6ff2cc4b4793a8", "score": "0.71735764", "text": "def index\n @send_histories = SendHistory.all\n end", "title": "" } ]
[ { "docid": "9a6be4f06edf5579a1bfa5e6d060804b", "score": "0.67949396", "text": "def index\n @histories = History.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @histories }\n end\n end", "title": "" }, { "docid": "0b7411958e1a022...
496fdc53f86c7618c6643d663c6501aa
Helper for select_ methods
[ { "docid": "65f3aaf3762224f0d047245847f00e59", "score": "0.0", "text": "def selected_ids(what_param)\n id_list = filter_params[what_param]\n id_list.present? && !id_list.empty? && id_list.map(&:to_i)\n end", "title": "" } ]
[ { "docid": "435ec51293e0f5fc7b9e081e4382879f", "score": "0.85068446", "text": "def select; end", "title": "" }, { "docid": "2922ea024319263819ee712b7757afef", "score": "0.81910354", "text": "def select(*args) end", "title": "" }, { "docid": "04c3d447503b1b0cf10889161bcd94...
26cca08d89c4e94435d23b15e6879fd9
Returns true if video content is an episode
[ { "docid": "f8a54514f363914d3f119cd0e1199380", "score": "0.8572123", "text": "def episode?\n content_type == \"Episode\"\n end", "title": "" } ]
[ { "docid": "0c4f646c8b5e5f30459c3511cd931bdf", "score": "0.7138559", "text": "def finished?\n @episodes.last.watched?\n end", "title": "" }, { "docid": "d7064de8c396744c6d28cb31afdcc2b7", "score": "0.7015842", "text": "def video?\n @streams.any? { |stream| stream.is_a? Vid...
15eb6c074941793a5c0ca06b142f8f6e
Loads the CSS from a file in `/public`. It contains the styles for the console.
[ { "docid": "a952b48cf9f1ffac17da28632f73a0be", "score": "0.60435426", "text": "def css_code\n '<style type=\"text/css\">' <<\n asset('webconsole.css') <<\n '</style>'\n end", "title": "" } ]
[ { "docid": "96c371c65d4d6c5218c077ce9214dd09", "score": "0.6830971", "text": "def css\n project_file_read(\"all.css\")\nend", "title": "" }, { "docid": "f635788b1ced59f83234638a9ee8cd6c", "score": "0.6733709", "text": "def load_css_from_local_file_with_rails_path!(path)\n rails_p...
fd505f8278ef287eef0881c955d99e23
GET /sport_facilities/1 GET /sport_facilities/1.json
[ { "docid": "33268fb50505611e603d653ae25a913d", "score": "0.76929164", "text": "def show\n @sport_facility = SportFacility.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sport_facility }\n end\n end", "title": "" } ]
[ { "docid": "f6a1ad482ce00e2961974a4641544613", "score": "0.70743996", "text": "def show\n @user_sport = UserSport.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_sport }\n end\n end", "title": "" }, { "docid": ...
9eae57a9946381ecf9cd968fcd5292ca
GET /lemmas/new GET /lemmas/new.xml
[ { "docid": "115400521b5863a2389c3fab16e30423", "score": "0.71221584", "text": "def new\n @lemma = Lemma.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lemma }\n end\n end", "title": "" } ]
[ { "docid": "afa429c920e975a4eb1ec6f76c54ee7c", "score": "0.7328819", "text": "def new\n @want = Want.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @want }\n end\n end", "title": "" }, { "docid": "0c9cd1c18424889757fd4bbf0350619...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "5ecbcd100b07e065ecfb3c51582c8c2b", "score": "0.0", "text": "def challenge_params\n params.require(:challenge).permit(:date, :title, :text, :comments, :enabled, :approved, :answerPic, :answerText)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7497917", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69572496", "text": "def strong_params\n params.require(:request).permit(param_whit...
e2c854fd9f1179e51871f72f90d1431f
Retrieves the list of students from a specific course
[ { "docid": "b8b11811ac21d843abaa28192143af34", "score": "0.6586794", "text": "def getStudents\n User.joins(:courses).where('enrollments.course_id = ?', self.id).references(:enrollments)\n end", "title": "" } ]
[ { "docid": "9b790ae0b9df12ebc20d8ca681b93de8", "score": "0.8189728", "text": "def getStudents(course)\n students = []\n course.students.each do |student| \n students << student.id\n end\n return students\n end", "title": "" }, { ...
b7bbafa07aa488ae29b0d47821de9fdb
Logged in as TOSCANA admin. Change PJ selected. List of tasks automatically changed.
[ { "docid": "8cb585cf81e02f2bdf9a0c18222e5c61", "score": "0.0", "text": "def test_wd_st_017\n printf \"\\n+ Test 017\"\n open_diff_administration_page\n selected_pj_id = @selenium.get_selected_value($diff_administration_xpath[\"new_pj_select\"])\n tasks = Task.find_all_by_pj_id(selected_pj_id...
[ { "docid": "01e25ab29395d9af1c0081a2717b35a6", "score": "0.64015067", "text": "def set_task\n\t\t\t@task = current_user.projects.find(params[:project_id]).tasks.find(params[:id])\n\t\tend", "title": "" }, { "docid": "ccf1e4ce4a0cbad398581911931dbaaf", "score": "0.6248417", "text": "d...
fb5a6eb5010b315e101895e0de8596a0
GET /tasks/1 GET /tasks/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "6369065fe2a43f0985bd65ea3e736786", "score": "0.76285976", "text": "def show\n @task = Task.find(params[:id])\n render json: @task\n end", "title": "" }, { "docid": "6369065fe2a43f0985bd65ea3e736786", "score": "0.76285976", "text": "def show\n @task = Task.find(p...
4cd2367364d932e14a9ed3c727e8ce92
DELETE /event_categories/1 DELETE /event_categories/1.json
[ { "docid": "8bf6c4081952b2527945b1f6c9489f8c", "score": "0.7492328", "text": "def destroy\n @event_category.destroy\n\n respond_to do |format|\n format.html { redirect_to event_categories_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.event_category')) }\n ...
[ { "docid": "914ff61670393a13336b355735f3578c", "score": "0.78341365", "text": "def destroy\n @event_category = Event::Category.find(params[:id])\n @event_category.destroy\n\n respond_to do |format|\n format.html { redirect_to event_categories_url }\n format.json { head :no_content }\n...
eedd4ce57718820dffd79a068cc569e6
Create a list of all available CSL styles This function returns a set of option tags for every CSL style available in RLetters (similar to +options_from_collection+ in Rails), which can be put inside a select item. See the configuration of the CSL styles at +config/initializers/csl_style_names.rb+ and the files themsel...
[ { "docid": "d3896ec23c0a6898d4ce952dc7b5e58b", "score": "0.7158574", "text": "def options_from_csl_styles(current = '')\n list = [ [ I18n.t('users.show.default_style'), '' ] ]\n\n APP_CONFIG['available_csl_styles'].each do |loc|\n list << [ APP_CONFIG['csl_style_names'][loc], loc ]\n end\n...
[ { "docid": "6a3885bd3fe7187dd447a33647e0ad0a", "score": "0.635629", "text": "def html_options(selected = nil)\n # Use Rails because it preloads the style options.\n styles = Rails.configuration.style_options\n options = ''\n\n styles.each do |id, title|\n if !selected.nil? && ...
162dcef4562381b44322076555339c37
Set the value of the ClientKey input for this Choreo.
[ { "docid": "aae39bf8353c50540adbba5dfea1be84", "score": "0.70487", "text": "def set_ClientKey(value)\n set_input(\"ClientKey\", value)\n end", "title": "" } ]
[ { "docid": "f64aa39ad75b50f2f7488c59fbc8c547", "score": "0.59025383", "text": "def client_id=(client_id)\n if client_id.nil?\n fail ArgumentError, 'invalid value for \"client_id\", client_id cannot be nil.'\n end\n @client_id = client_id\n end", "title": "" }, { "doc...
4a2135046d0b7cd752e336d2cb6b79d2
Get the ActiveRecord::Relation that represents zero records.
[ { "docid": "56fd2b720aca8a7ed9f889ef9bb3a3cf", "score": "0.5482326", "text": "def relation_none(model)\n validate_model(model)\n model.none\n end", "title": "" } ]
[ { "docid": "5ec0451bcb5e4ff772283c4de15369d4", "score": "0.63227284", "text": "def zeros_like\n return self.class.zeros_like(self)\n end", "title": "" }, { "docid": "9875bc9acc915841965ffef17d10a11e", "score": "0.61834264", "text": "def zero\n r(0)\n end", "...
1d64ee26d6374b8d8ad1c5b37582b278
PUT /searchonprojects/1 PUT /searchonprojects/1.json
[ { "docid": "ac6fed68a326bf0bf980860d502cdb0b", "score": "0.70079356", "text": "def update\n @searchonproject = Searchonproject.find(params[:id])\n\n respond_to do |format|\n if @searchonproject.update_attributes(params[:searchonproject])\n format.html { redirect_to @searchonproject, no...
[ { "docid": "e7f8ee5641911e33622dcbebcce61d0d", "score": "0.6757226", "text": "def update\n @project.update_attributes!(project_params)\n json_response(@project)\n end", "title": "" }, { "docid": "5a94f5203b7ab8e08038db3cba0099f8", "score": "0.66722935", "text": "def update(par...
3304d6f36685a610ab91952a8fd0cb5f
This method should turn off storage whenever CSRF cannot be verified. Any known way on how to let the IdP send the CSRF token along with the SAMLResponse ? Please let me know!
[ { "docid": "52fedb5e6bd685cd18e47ce5da91243e", "score": "0.0", "text": "def store?\n !mapping.to.skip_session_storage.include?(:saml_auth)\n end", "title": "" } ]
[ { "docid": "4013a9fc2cad9658c686c52e7a5b12f1", "score": "0.6871109", "text": "def _csrf_protection!\n return if @csrf_token.nil?\n\n csrf_token = @csrf_token\n @builder.resolve do\n input(type: :hidden, name: FormHelper::CSRF_TOKEN, value: csrf_token)\n end...
547a1e2391f1416bbee11a9e31bcf047
I added secret encrypt and decrypt methods that are a little more complicated, they are only accessed if the user knows their name.
[ { "docid": "89aed07a9751182465cd4dae1f56f978", "score": "0.0", "text": "def encrypt2(word)\n\tx = 0\n\twhile x < word.length\n\t\tif word[x] == \"z\"\n\t\t\tword[x] = \"c\"\n\t\t\telsif word[x] == \"y\"\n\t\t\tword[x] = \"b\"\n\t\t\telsif word[x] == \"x\"\n\t\t\tword[x] = \"a\"\t\t\n\t\t\telse\n\t\t\two...
[ { "docid": "1bd2e73346dbd84a3e089708f39a8c33", "score": "0.710296", "text": "def secret\n decrypt_secret\n end", "title": "" }, { "docid": "1bd2e73346dbd84a3e089708f39a8c33", "score": "0.710296", "text": "def secret\n decrypt_secret\n end", "title": "" }, { ...
e31576dc1d9bbea3e1d324738eb7b037
Returns the write concern error document as it was reported by the server, if any.
[ { "docid": "75a9ee70bef39f42380f4ede8a7792ec", "score": "0.8361915", "text": "def write_concern_error_document\n document['writeConcernError']\n end", "title": "" } ]
[ { "docid": "bee6ae1dff7f476c52939ddbd58298b8", "score": "0.61768174", "text": "def error\n doc['error']\n end", "title": "" }, { "docid": "f728b001c3d1033551dee01979970aa9", "score": "0.6081331", "text": "def aggregate_write_concern_errors(count)\n return unl...
b443b4bbb68b173b7cce7e4cdfb20601
A fog connection to the bucket
[ { "docid": "60ae90e2508560f46699e44045bdd823", "score": "0.69910467", "text": "def connection\n @_connection ||= begin\n connection_keys = Hash[keys.zip([access_key_id, secret_access_key])]\n Fog::Storage.new(connection_keys.merge(provider: provider))\n end\n end", "title": "" } ]
[ { "docid": "42252baa61118754dfa2c9dbfba89dd1", "score": "0.77086055", "text": "def connection\n @connection ||= Fog::Storage.new(provider: 'AWS', aws_access_key_id: access_key, aws_secret_access_key: access_secret, region: region)\n end", "title": "" }, { "docid": "64214faed5ae2d5f46...
219d75b34cf179b59453b30f318b2c49
lexer rule t__86! (T__86) (in ANTLRv3Grammar.g)
[ { "docid": "8791909cb510750566bdff09157cd993", "score": "0.77748394", "text": "def t__86!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 31 )\n\n type = T__86\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - ...
[ { "docid": "477c5361be2ab0bc87da71d4437faa16", "score": "0.77024436", "text": "def t__86!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 64)\n\n type = T__86\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - ...
10c154f0d26ef2fcb5f86c5649a41671
Fetch a list of ewallets This endpoint lists all ewallets in descending order of creation.
[ { "docid": "4674e529170d3804be28a5d42d32c240", "score": "0.0", "text": "def wallet_list(wallet_list_request, opts = {})\n data, _status_code, _headers = wallet_list_with_http_info(wallet_list_request, opts)\n data\n end", "title": "" } ]
[ { "docid": "8d567bc2437e092d16cef0c4a2e3b5dd", "score": "0.6053751", "text": "def all\n response = get('findAll', {'page' => 1, 'limit' => 50}).body\n if response.success?\n response.result = response.body['data'].map do |id, offer|\n HasOffers::Models::Offer.parse(offe...
760eac0d8d9e3ce40c3cc9e46b9d0f64
POST /call_types POST /call_types.json
[ { "docid": "0a327d8e7b0a30a9d20281c2205d3b74", "score": "0.69538295", "text": "def create\n @call_type = CallType.new(params[:call_type])\n\n respond_to do |format|\n if @call_type.save\n format.html { redirect_to @call_type, notice: 'Call type was successfully created.' }\n for...
[ { "docid": "aa271bea833c4fd5a1026cb86c7b455c", "score": "0.68596625", "text": "def create\n @typecall = Typecall.new(params[:typecall])\n\n respond_to do |format|\n if @typecall.save\n format.html { redirect_to @typecall, notice: 'Typecall was successfully created.' }\n format.j...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "ebacc111d19ea7ea73204347a33b928a", "score": "0.0", "text": "def game_params\n params.require(:game).permit(:active, :type, :time)\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...
3153913e6ebe01d8135ec7ed6808157a
API GET Universal Posts
[ { "docid": "a42cfc19a43116406f76a608c64ce54d", "score": "0.6096695", "text": "def universal_posts\n #@delete = Postuniversal.delete_all\n @alluniversal_posts = Postuniversal.all.order('id desc')\n @featured = FeaturedVideo.where(key: 'featured_universal').first;\n render json: {code: '201',status: '...
[ { "docid": "79797eddf33e2dcf1b5c734f9f86889b", "score": "0.75937474", "text": "def api_posts #self.api_posts()\n TumblrFeed.client.posts(self.uid)\n end", "title": "" }, { "docid": "aa4257c08b0461ed4c316a034ce23cc0", "score": "0.7101717", "text": "def get_posts\n url = 'ht...
e1333bb3269ea69b488fa9d761de8209
Create or update DNS security profile binding map API will create or update DNS security profile binding map
[ { "docid": "3b19056de3cfa7cc38fdcd04a46f9367", "score": "0.630596", "text": "def patch_dns_security_profile_binding(domain_id, group_id, dns_security_profile_binding_map_id, dns_security_profile_binding_map, opts = {})\n patch_dns_security_profile_binding_with_http_info(domain_id, group_id, dns_sec...
[ { "docid": "81f99246aa107083179af06dcbd228ef", "score": "0.6645134", "text": "def update_dns_security_profile_binding_0_with_http_info(domain_id, group_id, dns_security_profile_binding_map_id, dns_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config...
2301e504c9c5abe370662c03311feab4
Path to the library.
[ { "docid": "d3c9b1936e61707d6c573b17a3987b38", "score": "0.0", "text": "def location\n return unless @file\n @location ||= (\n dir = File.dirname(@file)\n File.basename(dir) == 'meta' ? File.dirname(dir) : dir\n )\n end", "title": "" } ]
[ { "docid": "a84c99dc844d34e4222b0bed198d20a6", "score": "0.8582801", "text": "def library_path\n Pathname.new(__FILE__).dirname.join '../../'\n end", "title": "" }, { "docid": "990dd95dc781e1afb9cb26a809b040b1", "score": "0.8575226", "text": "def lib\n path '/lib'\n ...
27565a065fd08a9745808deae9efb815
Increments next available id
[ { "docid": "22210d925b3ab8a3a2e1a22383487be6", "score": "0.87574476", "text": "def increment_id #nodoc\n @_next_id += 1\n end", "title": "" } ]
[ { "docid": "61cad9de7fed4f026cd33945b475048d", "score": "0.87824947", "text": "def next_id\n @id ||= 0\n @id += 1\n end", "title": "" }, { "docid": "4c4ed41594736b136e17a6cb407d270a", "score": "0.8743605", "text": "def next_id\n @next_id ||= -1\n @next_id += 1\n e...
7f0cef66f688be2205eb3676adf659df
Get a stored position
[ { "docid": "9d633b63c80b03405249ce7bcc76c583", "score": "0.0", "text": "def pos(type = @type)\n @respawns[type] ||= []\n end", "title": "" } ]
[ { "docid": "7d118a110817adae4bc45344b9ae5f58", "score": "0.7659123", "text": "def position\n return @position\n end", "title": "" }, { "docid": "7d118a110817adae4bc45344b9ae5f58", "score": "0.7659123", "text": "def position\n return @position\...
0364c6e56f1eba7163e2da1e18d3229e
PUT /residents/1 PUT /residents/1.json
[ { "docid": "ad95665324538c58fc4fe5ddb84bcb01", "score": "0.63052016", "text": "def update\n head :forbidden\n return false\n\n #@resident = Resident.find(params[:id])\n #\n #\n # if @resident.update_attributes(params[:resident])\n # head :no_content\n # else\n # render ...
[ { "docid": "6a9332fe1d77ba6c4eeea7623b31efe0", "score": "0.67567533", "text": "def update\n @residential = Residential.find(params[:id])\n\n respond_to do |format|\n if @residential.update_attributes(params[:residential])\n format.html { redirect_to @residential, notice: 'Residential w...
d21caf54d1be3c651056a5dc67dbea02
building recursivity method is private => no for Array
[ { "docid": "97141c6fbe65d0f639f4fa97012f4c69", "score": "0.0", "text": "def addfilter( newfilter )\n if not subfilter\n @subfilter = newfilter\n else\n subfilter.addfilter( newfilter )\n end\n return self\n end", "title": "" } ]
[ { "docid": "bdfb6b4bdee5c5c0d60220fd691fdb7f", "score": "0.70051473", "text": "def my_controlled_flatten(n=1)\n #here\n return self if n < 1\n\n results = []\n self.each do |el|\n if el.class == Array\n #here\n results += el.my_controlled_flatten(n-1)\n else\n ...
d6f49428f04073c431ba72a517aac19f
Gets the physicalMemoryInBytes property value. Total Memory in Bytes. Default is 0. To retrieve actual values GET call needs to be made, with device id and included in select parameter. Supports: $select. Readonly. This property is readonly.
[ { "docid": "b4f8ec2fe62dace0a631c7ff55e2708c", "score": "0.7836854", "text": "def physical_memory_in_bytes\n return @physical_memory_in_bytes\n end", "title": "" } ]
[ { "docid": "22233de8d9a579bb96ff9d053833d524", "score": "0.74688166", "text": "def total_physical_memory\n return @config['hw']['memory']['physical']['total']\n end", "title": "" }, { "docid": "7dd96da728ac8ba37a6c122eedba3957", "score": "0.74027115", "text": "def memory_...
80d87e78064ccf83634a2ff0971d4759
Check that the passed value: a) Matches the Ruby type expected b) Fits into the slot c) Does not overflow When the validation fails should raise
[ { "docid": "c1db59e400a9dac3487c7d37f8d0b334", "score": "0.60432184", "text": "def validate!(value)\n raise \"#{name} value required, but got nil in #{name}\".strip if value.nil? && req?\n raise \"Value expected to be #{rtype} but was #{value.class}\" if !value.nil? && rtype && !value.is_a?(rt...
[ { "docid": "36ec163813c67d9cb9cd84bce9fa2f03", "score": "0.7008096", "text": "def validate!(value)\n raise \"#{name} value required, but got nil\".strip if value.nil? && req?\n raise \"#{name} value expected to be #{rtype} but was #{value.class}\" if !value.nil? && (!value.is_a?(Integer) && !v...
d25bde51635fb7921f6f70d64a418b74
============================= Functions for data retreival ============================= returns an HTTParty Response obj that match winners will be extracted from
[ { "docid": "788cf91c20752010411ee99ce5d34563", "score": "0.60005134", "text": "def getMatchHistory(max_match_id = nil)\n\tbegin\n\t\tif max_match_id then\n\t\t\tresponse = HTTParty.get(\"https://api.opendota.com/api/publicMatches?less_than_match_id=#{max_match_id}\")\n\t\telse\n\t\t\tresponse = HTTParty...
[ { "docid": "afe90495a8b887fc99328d871d05efa0", "score": "0.69656026", "text": "def get_matches\n @data ||= begin\n str = APIS[ @league.downcase.to_sym ]\n str = str.gsub( '$year$', @year.to_s )\n\n get( str ) ## use \"memoized\" / cached result\...
d5ac130204b12d29859a8bb8cbc35612
!/usr/bin/ruby :nodoc: all Extension configuration script for DNS_SD C Extension. $Id: extconf.rb,v 1.8 2005/03/20 22:50:43 cmills Exp $
[ { "docid": "dcdaa540354e4f2f16ea9fc0ae96ff96", "score": "0.0", "text": "def check_for_funcs(*funcs)\n\tfuncs.flatten!\n\tfuncs.each do |f|\n\t\tabort(\"need function #{f}\") unless have_func(f)\n\tend\nend", "title": "" } ]
[ { "docid": "bf6120c71a92b18d46352a7576da4f79", "score": "0.6017089", "text": "def extension_conf_files\n manifest.grep(/extconf.rb\\Z/)\n end", "title": "" }, { "docid": "a7ae1674711091ee8bafc47d269823b6", "score": "0.59102327", "text": "def config_file\n <<~EOS\n #!/bin/...
52212e0d1ce27629dfd0027e5a8c5ffd
Expands abbreviations in the inline image hash according to the rules in the PDF spec.
[ { "docid": "b6bef0b8c61d7fdb790e9f51c1bc7381", "score": "0.60140413", "text": "def expand_abbreviations(hash)\n new_hash = {}\n hash.each do |key, value|\n new_hash[ABBREVIATIONS[key] || key] = ABBREVIATIONS[value] || value\n end\n new_hash\n end", "title": "" } ]
[ { "docid": "aca74b31ce7b7492a9ee4d9a43ab7e30", "score": "0.59128773", "text": "def img_name\n abbrev + '.png'\n end", "title": "" }, { "docid": "9c73475993ddbeecb3d187a72a8f4f2e", "score": "0.5679844", "text": "def generate_card_flag acronym\n \"https://qasecommerce.cielo.com....
5161ac77c6480e37458e8914321cfbb3
TODO: get rid of this. A report cannot exist witout an item.
[ { "docid": "455ca2eff5094c7b61b8c4acb924b945", "score": "0.0", "text": "def ensure_item\n self.item = Item.find_or_create_by_external_uid(@uid)\n end", "title": "" } ]
[ { "docid": "f4ccae17b78d20faae4544804cfc2cfe", "score": "0.65930915", "text": "def report\n \t@error = NewsItem.new\n end", "title": "" }, { "docid": "c3b9d8804ec5f85db76c849adad71414", "score": "0.64609635", "text": "def get_report_items(_args)\n raise NoMethodError, \"Subc...
458f04b13aa654647122b837158936c3
redefine your position_taken? method here, so that you can use it in the valid_move? method above.
[ { "docid": "9ffe4d58273090198c7192b32d87b679", "score": "0.0", "text": "def position_taken?(board, position)\n position = position.to_i - 1\n if board[position] == \"X\" || board[position] == \"O\"\n true\n end\nend", "title": "" } ]
[ { "docid": "925974888641d3474d6e8f43478dd9e5", "score": "0.84095275", "text": "def position_taken?(board, position)\n return false if valid_move?(board, position)\n return true unless valid_move?(board, position)\nend", "title": "" }, { "docid": "c3a06411de78e7ca82b9f6e428f8277b", "sco...
8781445679ca876c15abafe522b14d36
Syncronize Items in this folder. If this method is issued multiple times it will continue where the last sync completed.
[ { "docid": "7f8481b8b850a51d6f5f47c2a936de73", "score": "0.69542414", "text": "def sync_items!(sync_state = nil, sync_amount = 256, sync_all = false, opts = {})\n item_shape = opts.has_key?(:item_shape) ? opts.delete(:item_shape) : {:base_shape => :default}\n sync_state ||= @sync_state\n\n ...
[ { "docid": "43a85075c6d7d4bdbac7aea5067296a7", "score": "0.6564311", "text": "def sync\n local_directories.each do |local_directory|\n if settings[:dry_run]\n log.info(sync_command(local_directory))\n else\n IO.popen(sync_command(local_directory)).each { |l...
80b082326e5de11f184ee1ffbb87f857
POST /snails POST /snails.json
[ { "docid": "dc64d09147b11f59a12efbbff8aaf450", "score": "0.64796144", "text": "def create\n @snail = Snail.new(name: params[:snail][:name], owner: params[:snail][:owner], description: params[:snail][:description], speed: Random.new.rand(1..10), endurance: Random.new.rand(1..10), motivation: Random.ne...
[ { "docid": "c165533c352bf8e009f66b82021b9a04", "score": "0.6837508", "text": "def create\n @snail = Snail.new(snail_params)\n\n respond_to do |format|\n if @snail.save\n format.html { redirect_to @snail, notice: 'Snail was successfully created.' }\n format.json { render :show, s...
4cba8e6b4d77ee4fde50a1a019c6d6e2
Public: Return Reddit listings or build if not already built. Called in DiscussItApi. Returns Array of Listing instances.
[ { "docid": "6309274a3383738d953706e3bddebb0f", "score": "0.6739121", "text": "def listings\n return @listings ||= build_all_listings\n end", "title": "" } ]
[ { "docid": "7cc58f1c656ddf0de853567e2a1e77b9", "score": "0.7000855", "text": "def reddit\n all.select {|listing| listing.class == Listings::RedditListing }\n end", "title": "" }, { "docid": "e53a061f367e3c4bc1486797430a8c26", "score": "0.6929434", "text": "def reddit\n a...
40fd354d258a5fc07888da78d0e1f4b1
Optional selector which identifies collection of numbered objects. With this, sequence can skip existing numbers to avoid duplicates.
[ { "docid": "c350f2511733873af766cb0721df4621", "score": "0.547833", "text": "def sequence_selector\n\t\t\t\t\tnil\n\t\t\t\tend", "title": "" } ]
[ { "docid": "b80a52bb28820e08e5d143508b8ae2d1", "score": "0.5521147", "text": "def pick(_list = nil, _n = nil, skip: nil)\n #This is a stub, used for indexing\nend", "title": "" }, { "docid": "8411a70116a1f6f8ece6f68ffac6424a", "score": "0.5466393", "text": "def index_collection_numb...
01c1580552bc9f24754366f22dab293a
======= POST /users =======
[ { "docid": "6cdb79d4e0146871e220bf091a9bdc81", "score": "0.0", "text": "def create\n puts \"\\n******* create *******\"\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n els...
[ { "docid": "abbd4ae1bf5b73d33895ce37a232ee4e", "score": "0.74758315", "text": "def create\n uri = \"http://localhost:3000/api/v1/users\"\n payload = params.to_json # converting the params to json\n rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n begin\n rest_resource...
4bd7c8d22947439f56cbd3a9fa9f4cda
PUT /xiaozuofangs/1 PUT /xiaozuofangs/1.json
[ { "docid": "bc1e32482a865fb4caba535093757bc2", "score": "0.60959095", "text": "def update\n @xiaozuofang = Xiaozuofang.find(params[:id])\n\n respond_to do |format|\n if @xiaozuofang.update_attributes(params[:xiaozuofang])\n format.html { redirect_to @xiaozuofang, notice: 'Xiaozuofang w...
[ { "docid": "c42bde476d51212fa13cbbdb620fb4b8", "score": "0.6748776", "text": "def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gs...
bc56f353070228b4a25e5ea920e8d6ec
Get span for an entity with specified path Get span for an entity with specified path.
[ { "docid": "f3ddc537f9bd333e888c47fafba6d441", "score": "0.56999487", "text": "def get_span_with_http_info(intent_path, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FederationInfraSitesApi.get_span ...'\n end\n # verify the required p...
[ { "docid": "16fcc58c2294db4b997344bd712d8cc1", "score": "0.6595665", "text": "def get_span(intent_path, opts = {})\n data, _status_code, _headers = get_span_with_http_info(intent_path, opts)\n data\n end", "title": "" }, { "docid": "169be8353b29ff489ca59b30e79f448d", "score"...
741c69442b3432fe26047b80c51c4623
These methods list records in the directory.
[ { "docid": "4c6a428166bee623dba782a9499525a3", "score": "0.0", "text": "def list_option\n list_politicians\n list_voters\n puts\n puts \"(R)eturn to the main menu?\".center(80).green\n menu_return = gets\n end", "title": "" } ]
[ { "docid": "baf53e2c7b0c0d2dd5465f2884cdddf0", "score": "0.69430274", "text": "def index\n @file_records = FileRecord.all\n end", "title": "" }, { "docid": "baf53e2c7b0c0d2dd5465f2884cdddf0", "score": "0.69430274", "text": "def index\n @file_records = FileRecord.all\n end", ...
0cf28046a3844fe661c41203c815b2e4
GET /seguimiento_respuestas/1 GET /seguimiento_respuestas/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "a93db32efbc0441377d331b6e0d3d264", "score": "0.6982967", "text": "def index\n @seguimiento_respuestas = SeguimientoRespuesta.all\n end", "title": "" }, { "docid": "8d1b90399538ddf502d6a4b8263d2098", "score": "0.6913553", "text": "def index\n @respuesta = Respuesta....
2f82d9b9c26590e69ccbf842d35bf6d8
Output msg as a ANSIcolored program/section header (white on blue).
[ { "docid": "7f6aa94137ccbdc4a7b7371da8b5a0c2", "score": "0.81695247", "text": "def header( msg )\n\t\tmsg.chomp!\n\t\t$stderr.puts ansi_code( 'bold', 'white', 'on_blue' ) + msg + ansi_code( 'reset' )\n\t\t$stderr.flush\n\tend", "title": "" } ]
[ { "docid": "7008222880aa6ef88af18988818a4b1e", "score": "0.81620985", "text": "def header( msg )\n\t\tmsg.chomp!\n\t\t$stderr.puts ansiCode( 'bold', 'white', 'on_blue' ) + msg + ansiCode( 'reset' )\n\t\t$stderr.flush\n\tend", "title": "" }, { "docid": "7008222880aa6ef88af18988818a4b1e", ...
b0a8187e3dc346cc37b062369df19580
This endpoint is deprecated.
[ { "docid": "e3451a3a09ed7b3c2a54b0e22448459c", "score": "0.0", "text": "def get_project_cluster_logs_using_get(device_session_id, project_id, run_id, opts = {})\n get_project_cluster_logs_using_get_with_http_info(device_session_id, project_id, run_id, opts)\n nil\n end", "title": "" }...
[ { "docid": "c6163bd7e4e5188e65863a98b29acc70", "score": "0.68382174", "text": "def endpoint; end", "title": "" }, { "docid": "c6163bd7e4e5188e65863a98b29acc70", "score": "0.68382174", "text": "def endpoint; end", "title": "" }, { "docid": "c6163bd7e4e5188e65863a98b29acc70...
6c8d9543a5b3849fa88caa5500d38945
Get the special value for the monster card.
[ { "docid": "41e1bafe4467150eacb355cbdc60daf7", "score": "0.64010996", "text": "def getSpecialValue\n combatLevel + @levelChangeAgainstCultistPlayer\n end", "title": "" } ]
[ { "docid": "3a41a1410f7d2d28aeb8f76e55e434a5", "score": "0.68230593", "text": "def get_metal_value(metal)\t\n\ts, g, i = get_single_value \n\tif (metal == \"Silver\")\n\t\treturn s\n\telsif (metal == \"Gold\")\n\t\treturn g\n\telsif (metal == \"Iron\")\n\t\treturn i\n\telse\n\t\tretun nil\n\tend\nend", ...