query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
a28e478681ac9d29c5dd796aa824781d
PATCH/PUT /users/1 PATCH/PUT /users/1.json
[ { "docid": "c615c4fa1be2af4f9756929184f7adbc", "score": "0.0", "text": "def update\n if @user.update(user_params)\n render :show, status: :ok, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" } ]
[ { "docid": "f0686f191a0def3b6c3ad6edfbcf2f03", "score": "0.7243395", "text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n ...
9066281f30e4606145bb5e97fe3711a3
Visit the page for creating a new model instance.
[ { "docid": "5681e6187e9771cd860f77796e027a00", "score": "0.75768197", "text": "def visit_new_page(model, **opt, &block)\n visit_action_page(model, :new, **opt, &block)\n end", "title": "" } ]
[ { "docid": "f7bc6069ca7cf8b802df35a556838923", "score": "0.7175349", "text": "def new\n @page = Page.new\n end", "title": "" }, { "docid": "f7bc6069ca7cf8b802df35a556838923", "score": "0.7174939", "text": "def new\n @page = Page.new\n end", "title": "" }, { "docid...
9dda83ab7134732d48ec77ba111c08f3
Method to add an item to a list input: list, item, quantity steps: output: value
[ { "docid": "6cce61fbd9cac0cc9b9f5f9403b5c218", "score": "0.7910358", "text": "def add_to_list(list,item,quantity)\n\tupdate_item(list,item,quantity)\nend", "title": "" } ]
[ { "docid": "e027a2500470ac20493111a548edeee0", "score": "0.80049086", "text": "def add_item(item, quantity, list)\n\tlist[item] = quantity\n\titem\nend", "title": "" }, { "docid": "e59c4c55df1480bc2880cac221c475ca", "score": "0.79320234", "text": "def add_item(list, item, quantity=0)...
0733315e6dd75ff21155c7b6f77d09d1
Initialize a LocalBitcoins::Client instance options[:api_key] options[:api_secret]
[ { "docid": "38c1889cd780555fd13e516086b9922f", "score": "0.71179193", "text": "def initialize(options = {})\n raise ArgumentError.new('Options hash required') unless options.is_a?(Hash)\n\n @client_id = options[:client_id]\n @api_key = options[:api_key]\n @api_secret = options[:a...
[ { "docid": "80e426a0cd465af4277be0352fe22976", "score": "0.71312344", "text": "def initialize(options={})\n unless options.kind_of?(Hash)\n raise ArgumentError, \"Options hash required.\"\n end\n\n @use_hmac = options[:use_hmac]\n @client_id = options[:client_id]\n ...
82f09d0266857233d244c20fd078e23d
pulled from rails: lib/rails_generator/commands.rb
[ { "docid": "e144b4a40289b22bb36767bca49fdf10", "score": "0.0", "text": "def gsub_file(relative_destination, regexp, *args, &block)\n path = destination_path(relative_destination)\n content = File.read(path).gsub(regexp, *args, &block)\n File.open(path, 'wb') { |file| file.write(content) }...
[ { "docid": "1f6c05c03e30549491b72ec96553510b", "score": "0.7282654", "text": "def migrate_commands; end", "title": "" }, { "docid": "bbb4713d14bc9a64b901678ccc29e71e", "score": "0.72483903", "text": "def define_additional_commands; end", "title": "" }, { "docid": "bbb4713...
5f416b2f7df6af17ffe7afb5b1a2cd1d
GET /versions GET /versions.xml
[ { "docid": "ea1c46dd10aa90178e47b1ca3ba9b08b", "score": "0.0", "text": "def index\n authorize! :read, Version\n # There is a filter option on the version page We need to provide results based on filter.\n \n # Was a product search filter provided\n if (params[:product] && Product.all.coll...
[ { "docid": "03c2863cbb027392b25b811136e5d83e", "score": "0.7627453", "text": "def get_versions\n url = build_url(BASE_URL, VERSIONS_ENDPOINT)\n\n response = get(url)\n\n JSON.parse(response)['response']\n end", "title": "" }, { "docid": "1e16761f6f52096ee8a883f9e4dd0d67", ...
8b640c76c22e0ac0a08d1adb1ba87064
DELETE /crop_mixes/1 DELETE /crop_mixes/1.json
[ { "docid": "3522ac5c0e494699a1db9e9975ac3e61", "score": "0.7915002", "text": "def destroy\n @crop_mix.destroy\n respond_to do |format|\n format.html { redirect_to crop_mixes_url, notice: 'Crop mix was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "ti...
[ { "docid": "037dc2a1758a6c04c3ab3910204acff0", "score": "0.73499197", "text": "def destroy\n @crop.destroy\n respond_to do |format|\n format.html { redirect_to crops_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dfa1cfdf5fe1df460b1cc815...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "6721ee8c8fc7c68d7db5fd0ca8a5f826", "score": "0.0", "text": "def set_product\n @product = Product.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310465", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60152966", "text": "d...
29dbd3905d2d7b6dc7c622955a49dd51
Define a dimension to measure while running.
[ { "docid": "262960a8910d6bfa0d722d28e2866893", "score": "0.6140592", "text": "def dimension(name, &plock)\n dimensions[name] = plock\n end", "title": "" } ]
[ { "docid": "ea177a32f374d1878bb4ef9f96ff6f6b", "score": "0.73414373", "text": "def dimension(name, size, is_shared = true)\n symbol = (\"dim_\" + name.gsub(/\\s+/, \"_\").downcase).to_sym\n instance_variable_set(\"@#{symbol}\", add_dimension(name, size, is_shared))\n end", "title": "" ...
13dfa851fa3090d4f7edbecb08517d6e
Reads a 32bit unsigned integer.
[ { "docid": "384ec37ddce37b4c94121e8d0731d5b9", "score": "0.7392403", "text": "def uint32(pos = 0)\n byteslice(pos, 4).unpack(\"N\")[0]\n end", "title": "" } ]
[ { "docid": "686a99066e2c63027be395279afec75a", "score": "0.85884124", "text": "def read_uint32\n read(4).unpack(UINT32).first\n end", "title": "" }, { "docid": "686a99066e2c63027be395279afec75a", "score": "0.85884124", "text": "def read_uint32\n read(4).unpack(UINT32).fi...
127abadfa9d3f0de389d31a9d06def36
DELETE /images/1 DELETE /images/1.json
[ { "docid": "3e8fd6cda007fc23bbf554e0b92ad3dd", "score": "0.7262224", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n head :no_content\n end", "title": "" } ]
[ { "docid": "d1bf143e8d2595438228d99d62b31e6d", "score": "0.8074402", "text": "def delete\n render json: Image.delete(params[\"id\"])\n end", "title": "" }, { "docid": "8e911b1a5d8964b2e3d3b8ce2c8449be", "score": "0.80066633", "text": "def destroy\n json_respond compute().delet...
cc9bf1bc6214ecfb9a051ebfdced5438
Private: initalize Creates an instance of the AI_Player class. Parameters: name String: Name of the player. Returns: A new AI_Player object. State Changes:
[ { "docid": "e83837acdd3580e1cc7069432ea6eb8c", "score": "0.59606576", "text": "def initialize(name)\n @name = name\n @move = \"\"\n @score = 0\n end", "title": "" } ]
[ { "docid": "6d2050eca966e4ba45865b4114942627", "score": "0.7061895", "text": "def initialize(new_name)\n\t\t@name = new_name\n\t\t\n\t\tif self.class == Player\t\t#Player for the first game app.rb \n\t\t\t@life_points=10\n\t\t\t@@all_players << self\t #adds new players if necessary \n\t\tend\n\n\...
45524063b3bdb4d0cc5313ad4eed5267
PUT /arguments/1 PUT /arguments/1.xml
[ { "docid": "8fa82f1560881d00f9ae176b6aaaf3bf", "score": "0.0", "text": "def update\n @argumentable = params[:argumentable].constantize.find(params[:argumentable_id])\n @argument = Argument.find(params[:id])\n if verify_recaptcha()\n flash.delete(:recaptcha_error)\n respond_to do |form...
[ { "docid": "c2c0b673628fdc28b181d18c0afd2d5b", "score": "0.65826035", "text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "title": "" }, { "docid": "e1fb789f8232f9cc5d5eb3620def997a", "score": "0.64...
4978f95de67c339a13fa0837c897da1b
Check if AEM Truststore exists.
[ { "docid": "1a25a5260bd0bfe97dc9d7690bdb6700", "score": "0.0", "text": "def exists\n @client.call(self.class, __callee__.to_s, @call_params)\n end", "title": "" } ]
[ { "docid": "b44e246bd0a65dbdb827b1df6133fc1a", "score": "0.6359781", "text": "def has_appstore?\n !appstore_url.blank?\n end", "title": "" }, { "docid": "a67869648e396991e82f47785df22620", "score": "0.60174114", "text": "def truststore\n RubyAem::Resources::Truststore.new(@c...
798624269d3f3421c7fe9b0c230166b4
GET /code_provinces/new GET /code_provinces/new.json
[ { "docid": "1bb1e846862afae5d664ff2b3f36f339", "score": "0.8293503", "text": "def new\n @code_province = CodeProvince.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @code_province }\n end\n end", "title": "" } ]
[ { "docid": "c5c6b52b42b764b7b5eefe7379a976da", "score": "0.8319714", "text": "def new\n @breadcrumb = 'create'\n @province = Province.new\n @regions = Region.order(:name)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @province }\n ...
68f4fedb73130c1ac17aaf74c18a96fd
Define shortcut methods to make things easier in the view
[ { "docid": "efc867503ed18302d1dd258b353b76bb", "score": "0.0", "text": "def challenge_img\n if !read_attribute(:challenge_img).nil? then\n if ENV['RAILS_ENV'] == \"development\" then\n return read_attribute(:challenge_img)\n elsif ENV['RAILS_ENV'] == \"production\" then\n retu...
[ { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.69697726", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.69697726", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c",...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "3a1a648da7c37bb6bef6e80807e9f825", "score": "0.0", "text": "def set_account\n response = @account_api.find(params[:id])\n @account = response[:account]\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;...
ce7e7b4622318ba0faae0559a457992e
Returns `true` if `self` and `other` have the same attributes and values.
[ { "docid": "a2f1d59bccf8832f6faec590994af8f4", "score": "0.0", "text": "def ==(other)\n super &&\n @address == other.address &&\n @affinity_labels == other.affinity_labels &&\n @agents == other.agents &&\n @auto_numa_status == other.auto_numa_status &&\n @certificate == oth...
[ { "docid": "d52d1042a4b5533455a8d5852ae59fd7", "score": "0.87464195", "text": "def eql?(other)\n self.class.attributes.each do |attr|\n return false unless send(attr).eql?(other.send(attr))\n end\n end", "title": "" }, { "docid": "6116481353e0f0ca7013e10c66d7d724", "s...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "18c977c4448352d4c70f1b28afaedcc7", "score": "0.0", "text": "def student_params\n params.require(:student).permit(:uin, :first_name, :last_name, :email, :phone)\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...
2fe11b46724035a891a61f2ac68ea17c
Save One Image The save function allows you to save an image from the display window. In this example, save is run when a mouse button is pressed. The image 'line.tif' is saved to the same folder as the sketch's program file.
[ { "docid": "cb92f63f407ff85de26a50af3b536833", "score": "0.0", "text": "def setup\n size(200, 200)\nend", "title": "" } ]
[ { "docid": "f31690d4a4f4466860a694fd4895a58e", "score": "0.69591427", "text": "def save(path=nil)\n file_path = path.nil? ? (filename || 'image.png') : File.join(path, (filename || 'image.png'))\n base.write(file_path)\n end", "title": "" }, { "docid": "dc59b08595b79dd966fc1b4fd...
8277e48e63c7e1b3664b7f4a2b65c1c2
Accepts a TransloaditFile, a hash of TransloaditFiles or a template, and converts it into a Transloadit::Assembly. If a hash of versions are given, the version information is saved in assembly's payload, so that later in the webhook it can be used to construct a hash of versions.
[ { "docid": "94fb26a4f682b3dc780cdb82fa5540dd", "score": "0.69075406", "text": "def transloadit_assembly(value, context: {}, **options)\n options = { steps: [], fields: {} }.merge(options)\n\n case value\n when TransloaditFile then transloadit_assembly_update_single!(value, con...
[ { "docid": "1190f0abdca256aa3eba81015cc97998", "score": "0.5586033", "text": "def create_assembly_template_aux(opts = {})\n merge_message = nil\n nodes = self[:nodes].inject(DBUpdateHash.new) { |h, node| h.merge(create_node_content(node)) }\n port_links = self[:port_links].inject(DB...
96bb74a862d6022f4bac81a8b41bba93
Generate meta tag for status of onboarding
[ { "docid": "3fb21548da31ed63e33512e8af2c92f9", "score": "0.7187698", "text": "def is_onboarding_meta_tag\n \"<meta name='is_onboarding' content='#{is_onboarding?}'/>\"\n end", "title": "" } ]
[ { "docid": "2cccf9042622ef07d17ed3afde4d6d16", "score": "0.5921501", "text": "def status\n \"#{@description} #{@status}\"\n end", "title": "" }, { "docid": "2b109c19d4e729dbb6187e6e2fa396b3", "score": "0.578069", "text": "def status_title\n content_tag(:h1, t(:h1, scope: :st...
a7c70508a59be3ce89de40e65e4999be
read file and validate it
[ { "docid": "3ed10fa1d25063fd894ce29676b8c3ab", "score": "0.57485604", "text": "def read(filename)\n @maze = File.open(filename, 'r').readlines\n @maze.each(&:strip!)\n validate\n @maze\n end", "title": "" } ]
[ { "docid": "0ade5c8b58cd3eaf8dc29ee823774564", "score": "0.8006141", "text": "def validate_file(file)\n if file.respond_to? :read\n src = file.read\n else\n src = read_local_file(file)\n end \n\n return validate_text(src)\n end", "title": "" }, { "docid":...
d11dcb166f6a117ab8a4067aa82e6e69
Wraps the API credentials into a Hash containing `client_id`, `client_secret`, and `auth_code`. Required for the application to run
[ { "docid": "18d3f54f0fe966d6df97567fa93f9279", "score": "0.82880336", "text": "def credentials\n {\n client_id: client_id,\n client_secret: client_secret,\n auth_code: auth_code\n }\n end", "title": "" } ]
[ { "docid": "d0876657eb19756a2fd6a201b2b1fdd5", "score": "0.7196265", "text": "def auth\n { username: api_key, password: api_secret}\n end", "title": "" }, { "docid": "77d708bf9d921c6218c5ebfafbc91934", "score": "0.7189721", "text": "def auth\n {\n user: api_key,\n...
1951be80b2173a633f084951c7650681
DELETE /topics/1 DELETE /topics/1.json
[ { "docid": "d3faaf52f40cdc61019b41b7f036a5b9", "score": "0.7606265", "text": "def destroy\n @topic = Topic.find(params[:id])\n @topic.destroy\n\n respond_to do |format|\n format.html { redirect_to topics_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "c9bfed9f1c6d5669db3534f5cf3d801a", "score": "0.80882245", "text": "def DeleteTopic id\n \n APICall(path: \"topics/#{id}.json\",method: 'DELETE')\n \n end", "title": "" }, { "docid": "f22e19d20009ace206522b523d2a1cd8", "score": "0.77483875", "text...
89f3c0a669b7df9599891d13c0940038
PUT /command_officers/1 PUT /command_officers/1.xml
[ { "docid": "2106c2db66156a184779c4fac4e4685b", "score": "0.5953009", "text": "def update\n @command_officer = CommandOfficer.find(params[:id])\n\n respond_to do |format|\n if @command_officer.update_attributes(params[:command_officer])\n format.html { redirect_to(incident_timesheet_pat...
[ { "docid": "23b5f5e4dacfb330cb1e0ffd4590ef63", "score": "0.58947074", "text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end", "title": "" }, { "docid": "38979984bdedacd95706689e25f09f9...
ddd2abe0e5227f24273c28e8a9dc3cd2
Parser for parsing whats left after applying extract_bnf_grammar_from_yacc_spec
[ { "docid": "9e6f7826414c9cc09a57d126293708e9", "score": "0.5391967", "text": "def ruby_bnf_grammar_parser\r\n parser = nil\r\n time_and_puts(\"Generating parser for Ruby BNF grammar\") do\r\n begin\r\n parser = Parse.generate_parser <<-'EOG'\r\nGrammar BnfGrammars\r\n Tokens\r\n Blank ...
[ { "docid": "48ae1fa3432da43059b32f88716a0a16", "score": "0.6653977", "text": "def extract_bnf_grammar_from_yacc_spec(yaccFile)\r\n bnfg = \"\"\r\n File.open(yaccFile, \"r\") do |f|\r\n lines = f.readlines\r\n line = lines.shift while line !~ /^%%/\r\n paren_level = 0 # > 0 when in C co...
6c2aeecec0def1f0bea735e196c83064
We can add Procs inside Methods
[ { "docid": "82fdce89989214fe7cdb3c0b1a491f7d", "score": "0.67964697", "text": "def add_and_proc(method_param_1, method_param_2, prc)\n sum = method_param_1 + method_param_2\n p prc.call(sum)\nend", "title": "" } ]
[ { "docid": "7ec1299a69cdd6881cc5e7df49256e76", "score": "0.6888983", "text": "def add(&proc)\n @procedures << proc\n end", "title": "" }, { "docid": "7603bcd12732fabf4d678b38494cd9bd", "score": "0.6809643", "text": "def add(&proc)\n procedures << proc\n end", "tit...
7c935ff477f108cc6319b0264ef81896
def test implementa il test non parametrico di Siegel tra campioni estratti dopo un numero di transizioni pari a transitions_n_A e transitions_n_B
[ { "docid": "9283e31af103cc29c6b2a59e14a31613", "score": "0.68205804", "text": "def siegel_test(graphs_n, nodes_n, transitions_n_A, transitions_n_B)\n\n # genera i grafi del campione A\n campioni_A = test(graphs_n,nodes_n,transitions_n_A, :freq_plot => false)\n \n # genera i grafi del campione B\n ca...
[ { "docid": "be08f751717d5af80958af451c92bde1", "score": "0.63483465", "text": "def test_extract_valid_transitions\n\n\t @valid_csv_files.each_index do |csv_file_index|\n \t smc = StateModelCreator.new # Create model\n \t system_model = smc.load_table(@valid_csv_files[csv_file_index])\n \t \n\t\t ...
eb2a28f8f448e02f0dc50906c3a1710e
This version of self.find_by_access_key(access_key) caches to disk. It is not actually faster for small db loads def self.find_by_access_key(access_key) file = 'tmp/access_keys/' + access_key.gsub(/[^09AFaf]/, '_') FileUtils.mkdir_p(File.dirname(file)) if FileTest::exist?(file) f = File.new(file) s = YAML.load(f) f.clo...
[ { "docid": "c41b453253eb88b2ba90e48e349d5b1a", "score": "0.0", "text": "def validate_http_referer(ref)\n # This expects 'ref' to be a valid (or at least mostly valid) url. It may through an exception if it isn't\n ref_uri = Addressable::URI.heuristic_parse(ref, :scheme => 'http')\n address_uri ...
[ { "docid": "e4c5dc4bb30c87e6fc6b8cbb796c7527", "score": "0.59677434", "text": "def fetch( key )\n key = key.to_s.strip unless key.nil?\n raise \"Invalid key\" if key.nil? or key == ''\n\n id,value,hits = @db.get_first_row(\n \"SELECT id,value,hits \"+\n \"FROM #{TABLE_NAME} \"+\n ...
b23aa5dde697a8a9b6747e8039f30ae1
POST /photos POST /photos.json
[ { "docid": "fbb23a7b01b1834be3eedfb65fa97dff", "score": "0.6464411", "text": "def create\n @photo = Photo.new(photo_params)\n\n respond_to do |format|\n if @photo.save\n format.html { redirect_to @photo, notice: 'Photo was successfully created.' }\n format.json { render :show, s...
[ { "docid": "064d7e5aefffa183a4ade6bf3e3e955c", "score": "0.7361035", "text": "def create\n @photos = Photo.new(photos_params)\n if @photos.save\n render json: { id: @photos.id, url: @photos.gallery.url,\n size: @photos.gallery_file_size }\n else\n render json: { id...
a48be9c2e9b8d7dcf7ab8181062d34d8
Public: Store (or vendor) on the receipt. Returns a String.
[ { "docid": "7880dfa4d3419f3fff232f2e8adee629", "score": "0.0", "text": "def store\n attributes[\"store\"]\n end", "title": "" } ]
[ { "docid": "dc013778dea2bd27a3e196dcadf7367f", "score": "0.6660525", "text": "def receipt\n end", "title": "" }, { "docid": "dc013778dea2bd27a3e196dcadf7367f", "score": "0.6660525", "text": "def receipt\n end", "title": "" }, { "docid": "bb826f2a543005967fca2ef6fd18ae57...
41a55c8a623be56c234c754ecdd6f557
Getter for the complete list of previous passages
[ { "docid": "a60a01b178bfef17e6119272fa2ebce2", "score": "0.64628184", "text": "def get_all_previous_passages\n if get_total_distance > 400\n if get_passages.count > 0\n get_passages.where('length_in_meters < ? and length_in_meters > 50', get_passage_distance)\n else\n get_pass...
[ { "docid": "0fe4d7efd8e2209a4927b7afa83e7ccd", "score": "0.7811597", "text": "def get_previous_passage\n get_all_previous_passages.last\n end", "title": "" }, { "docid": "77f1d2af25d201b496f1acf7c6770352", "score": "0.70421916", "text": "def getPrev\n\t\treturn @prev\n\tend", ...
1b907d8ce412b91766a0322f62e942a2
Send a confirmatory text when a patient creates a visit
[ { "docid": "48cb042d2fc18ecdc613e98a8c2692ad", "score": "0.0", "text": "def notify(number, name, doctor_name, time)\n\t\taccount_sid = 'AC0f7b2e3b01c8a0a5403793f47886a449'\n\t\tauth_token = 'a8ee6497354061ab6d3f96160e36f1ff'\n\n\t\t# set up a client to talk to the Twilio REST API\n\t\t@client = Twilio::...
[ { "docid": "f7295ef8ac759179387b9f9617da694a", "score": "0.6802402", "text": "def new_visit(visit)\n @visit = visit\n email = visit.doctor.email rescue nil\n return unless email \n mail to: email, subject: \"New visit created by patient\", from: 'admin@drlena.com'\n end", "title": ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "881595e9bf3718389c5151d3ec666ce2", "score": "0.0", "text": "def premium_car_wash_params\n params.require(:car_wash).permit( :widget_type, :widget_content )\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...
a15fd5f132640cf9e34758480eddc7ee
Returns an array of descendant nodes. This is a shorthand for `node.each_descendant.to_a`.
[ { "docid": "e332e49bc82a79353871b85bf8369764", "score": "0.8369176", "text": "def descendants\n each_descendant.to_a\n end", "title": "" } ]
[ { "docid": "e28d310d59ebb88d0964c3fb71f314b3", "score": "0.8235895", "text": "def descendants\n each_descendant.to_a\n end", "title": "" }, { "docid": "d240c20a1eeb2104cb11c8a9ee06b2cb", "score": "0.8067952", "text": "def descendants\n\t\t\t\tdescendant_array = []\n\t\t\t...
251868519807d0d4b645de7c01b37f39
List Syndication Feeds by filter with paging support
[ { "docid": "06d30a906f83106a17e905de926f8d71", "score": "0.7359883", "text": "def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter);\n\t\t\tclient.add_param(kparams, 'pager', pager);\n\t\t\tclient.queue_service_action_c...
[ { "docid": "6fdf3844d365167cb4227e090108956d", "score": "0.6581318", "text": "def get_rss\n all( :conditions => ['published_at IS NOT NULL'], :order => 'published_at DESC', :limit => per_page )\n end", "title": "" }, { "docid": "07e601392b37101b4618512454d2a292", "score": "0.6556...
4e3896cd2414ee9a35e10020dc0f36b5
Get details for an IP address.
[ { "docid": "167de9faa315e58896b6f40eba72c45f", "score": "0.7144377", "text": "def getAddressInfo(path)\n Ipvalidation.validate(path)\n call(path)\n end", "title": "" } ]
[ { "docid": "91fbd6a3b7ca6a6a8108bd621a6bae38", "score": "0.706162", "text": "def get_ip(ip_name, resource_group = armrest_configuration.resource_group)\n get(ip_name, resource_group).properties.ip_address\n end", "title": "" }, { "docid": "04780f31ee984d95dd7f46b1518a2def", ...
0a3a4b039db31a817d30724ed8c3b719
Sets the value of value
[ { "docid": "34d7ac1c948fea70f965d80a49c8bd9e", "score": "0.86220396", "text": "def value(value)\n\t\t@value=value\n\tend", "title": "" } ]
[ { "docid": "fe61adf3744b2b94fde27db3e4c0cb10", "score": "0.8960657", "text": "def set_value(value)\n @value = value\n end", "title": "" }, { "docid": "3beefb1e50317449640ae53e84527b5a", "score": "0.88523364", "text": "def setValue(value)\n @value = value\n end", "titl...
3f276be81ddc64ff2306964be53d0dd9
repeats block until it returns true or timeout reached; timeout not strictly enforced, use other timeout techniques to avoid freeze
[ { "docid": "f592143efcd7f3c11dcd0ca25a3f4e3d", "score": "0.0", "text": "def wait_for(seconds, interval: 1, stats: nil)\n if seconds > 60\n Kernel.puts(\"waiting for operation up to #{seconds} seconds..\")\n end\n iterations = 0\n\n start = monotonic_seconds\n ...
[ { "docid": "03c57ce31d9238e897cfd68723d90733", "score": "0.7918963", "text": "def wait_until_true timeout = 5\n begin_t = Time.now\n\n until yield\n return :timeout if Time.now - begin_t > timeout\n sleep 0.1\n end\n\n :completed\n end", "title": "" }, { "docid": "4341...
307cb4ec8e0b4751ee35fe21aa155cf5
Show an "Are you sure?" prompt.
[ { "docid": "110dd1025eeea6be95048f8836246d17", "score": "0.0", "text": "def delete_confirm\n return appctrl_not_permitted() unless ( @current_user.admin? )\n\n # Nobody can delete admin accounts. You must assign the admin\n # privilege to someone else, then, since you can't revoke your\n # o...
[ { "docid": "4e35b5bbdf3a6af50b5cedbed4d4fbe1", "score": "0.75196725", "text": "def confirm_with(answer)\n ask 'Please confirm', answer\n end", "title": "" }, { "docid": "37ebca4877edbdebcdae7c220cf3002e", "score": "0.7182161", "text": "def confirm\n msg = 'Are you sure?'\n...
7f65c7e0d7e8a073eda0937b8af54b31
Retrieves a prepopulated TeachingEventAddAttendee for the candidate. Retrieves a prepopulated TeachingEventAddAttendee for the candidate. The `accessToken` is obtained from a `POST /candidates/access_tokens` request (you must also ensure the `ExistingCandidateRequest` payload you exchanged for your token matches the re...
[ { "docid": "3bbed826304e1d29af658f5ef0713d05", "score": "0.7315225", "text": "def exchange_access_token_for_teaching_event_add_attendee(access_token, body, opts = {})\n data, _status_code, _headers = exchange_access_token_for_teaching_event_add_attendee_with_http_info(access_token, body, opts)\n ...
[ { "docid": "6a5a8e02aa8bb7246e0794fc1489b6d0", "score": "0.6060217", "text": "def add_teaching_event_attendee(body, opts = {})\n add_teaching_event_attendee_with_http_info(body, opts)\n nil\n end", "title": "" }, { "docid": "a1fae21364c42e843673a5b29f525cc7", "score": "0.599...
c2fa6d94c404c59dde32204f67f8bb30
Store the value at the given key
[ { "docid": "2f92b2bbbaf1185a370a1f5bd911bcaf", "score": "0.7491015", "text": "def store(key, value)\n raise NotImplementedError\n end", "title": "" } ]
[ { "docid": "31a0ea8339ceb310b2820fabaac50f88", "score": "0.8174592", "text": "def store_value(key, value)\n @store[key] = value\n end", "title": "" }, { "docid": "f8397bece7bac91db181c5423dbbb0b9", "score": "0.8163559", "text": "def store(key, value)\n @keys[key] =...
922d9d9e4598dd14ceb0e46eab0795e4
Override this if you only want some requests to use facebook
[ { "docid": "62e2e6090258cc1d54a70a67047060d3", "score": "0.6143345", "text": "def authenticating_with_facebook?\n self.facebook_api_params_provided? && facebook_request_params_provided? && !authenticating_with_unauthorized_record?\n end", "title": "" } ]
[ { "docid": "638ffd2528052a389ffc7d71ff586c09", "score": "0.74914694", "text": "def facebook\n end", "title": "" }, { "docid": "9a8e70419461689949066c0ae61bc98b", "score": "0.7340844", "text": "def has_facebook\n false\n end", "title": "" }, { "docid": "6b100c30b4ae4a...
84ab5e50ad662ba726e089b4c266245d
sends an upload request for every file that needs to be uploaded. returns a list of files uploaded
[ { "docid": "257e12d67f98109877f47c8f25e07697", "score": "0.5988433", "text": "def tango_upload(course, assessment, submission, existing_files)\n # first, figure out which files need to get sent\n ass_dir = assessment.folder_path\n begin\n COURSE_LOGGER.log(\"Dir: #{ass_dir}\")\n\n if ...
[ { "docid": "ad3a0aa31947207338e65bbf001827a4", "score": "0.765126", "text": "def receive_uploads\n trace :info, \"UPLOAD\"\n resp = send_command(PROTO_UPLOAD)\n\n # decode the response\n command, tot, left, size = resp.unpack('I4')\n \n if command == PROTO_OK then\n filename = res...
5b611b006ac7a5104c996aa997f71f97
Given a Nokogiri object, find all links to puzzles and extract the puzzle ID from them
[ { "docid": "e8df772e8c1faa81e30a5c7a9bf15858", "score": "0.74670416", "text": "def extract_puzzle_ids(doc)\n\t\threfs = doc.css(\"a\").map do |link|\n\t\t\tlink.attribute(\"href\").value\n\t\tend\n\n\t\tpuzzle_hrefs = hrefs.select do |href|\n\t\t\thref.end_with?(\".puz\")\n\t\tend\n\n\t\tids = puzzle_hr...
[ { "docid": "af0e9b4c77363abaa7a49efc29cd793f", "score": "0.5507699", "text": "def get_random_problem\n page = HTTParty.get(get_random_problem_url)\n parse_page = Nokogiri::HTML(page)\n problem = []\n parse_page.css(\"p\").length.times do |n|\n problem << parse_page.css(\"p\")[n].text\n ...
fce939ec9b84b315a3186134ccb291e2
PATCH/PUT /get_starteds/1 PATCH/PUT /get_starteds/1.json
[ { "docid": "e2d805396d385927e75eaafb43b46c84", "score": "0.67991674", "text": "def update\n respond_to do |format|\n if @get_started.update(get_started_params)\n format.html { redirect_to @get_started, notice: 'Get started was successfully updated.' }\n format.json { render :show, ...
[ { "docid": "42520d36742ba8bf5919972566325e1f", "score": "0.65797424", "text": "def update\n respond_to do |format|\n if @default_start.update(default_start_params)\n format.html { redirect_to @default_start, notice: 'Default start was successfully updated.' }\n format.json { render...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "8fc4a7a1b2d90ee5e6799728e5417278", "score": "0.0", "text": "def set_reservation_request\n @reservation_request = ReservationRequest.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;...
4cf05942462a21d3e2868a9448df56b6
Test if the association happens on the same day.
[ { "docid": "b147539fde7bd0525721559bc3ceb2e4", "score": "0.6461519", "text": "def same_day?\n date_indicator.eql?('S')\n end", "title": "" } ]
[ { "docid": "3f05d8313b9a22943a9bdce28f2a0573", "score": "0.68268424", "text": "def happened_same_day_as(other_event)\n self.timestamp.localtime.to_date == other_event.timestamp.localtime.to_date\n end", "title": "" }, { "docid": "08f912d1630d9570b5136328e0c686f5", "score": "0.6801951...
24290f306b97a618ef997f564a0a709f
The list of geographic subjects
[ { "docid": "f22fc3cc8fde29415650abd063eeedd8", "score": "0.85979515", "text": "def subjects_geographic\n get_item_data_by_name('SubjectGeographic')\n end", "title": "" } ]
[ { "docid": "ae52a81ea6fd794cdc4add9ac65658dc", "score": "0.6594975", "text": "def subject_list\n list = []\n subjects.each { |subject| list << subject.name }\n list.to_sentence\n end", "title": "" }, { "docid": "cfc17de812f9d2cf6b662ed305fba3e1", "score": "0.6589374", "text...
f1471520cd7b52e49b03c94a1245221a
serialize the data into json and save in a cookie add to the responses cookies
[ { "docid": "f205d90311914c399ed358b0f79a1a0b", "score": "0.6681723", "text": "def store_session(res)\n res.set_cookie('_req_room_session', path: '/', value: data.to_json)\n end", "title": "" } ]
[ { "docid": "8ddc42d80f5824ba132a1d1c34b67e25", "score": "0.7343701", "text": "def serialize_into_cookie(record); end", "title": "" }, { "docid": "87f2c15cbd25cf746e1e2bea7105da02", "score": "0.72299963", "text": "def set_data_in_cookie(data)\n cookies[:merged_response] = {...
a72725de8384ba48ae194e7faec0e632
draw the horizontal portion of the path with star character (if any)
[ { "docid": "edc87e365ba4f6601c9bbfe4b7735f31", "score": "0.7535002", "text": "def draw_horizontal_stars(line, start_char, end_char)\n start_char.upto(end_char) { |char_idx| @lines[line][char_idx] = STAR_CHAR }\n end", "title": "" } ]
[ { "docid": "9e9db4af5012ee18ee1cdc9b30a26899", "score": "0.7243039", "text": "def draw_horizontal(line, start_char, end_char)\n start_char.upto(end_char) { |char_idx| @lines[line][char_idx] = PATH_CHAR } \n end", "title": "" }, { "docid": "5e82bc1e6b3708f8b36af0c5c26064fb", "score": ...
82c3f551bc711e0f99da2124436d06a4
initializes this RestTaxonomyCoordinate with a json hash
[ { "docid": "6ff85f2a79debd943ffb66cf15f7264a", "score": "0.0", "text": "def init_jaxb_json_hash(_o)\n if !_o['stated'].nil?\n _oa = _o['stated']\n if(_oa.is_a? Hash)\n @stated = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @stated =...
[ { "docid": "fc3e9ab4fbbe721b7c11236d3d3797cc", "score": "0.70457035", "text": "def init_jaxb_json_hash(_o)\n if !_o['taxonomyCoordinate'].nil?\n _oa = _o['taxonomyCoordinate']\n if(_oa.is_a? Hash)\n @taxonomyCoordinate = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa...
abe376a267a5e238aac9168f3798d02b
PATCH/PUT /pos_details/1 PATCH/PUT /pos_details/1.json
[ { "docid": "31c742fc2d579794c879daee5663f87e", "score": "0.72991127", "text": "def update\n respond_to do |format|\n if @pos_detail.update(pos_detail_params)\n format.html { redirect_to @pos_detail, notice: 'Pos detail was successfully updated.' }\n format.json { render :show, stat...
[ { "docid": "1e8d96dea741f8c70ca77df3fc381693", "score": "0.64800084", "text": "def update_detail\n end", "title": "" }, { "docid": "1e8d96dea741f8c70ca77df3fc381693", "score": "0.64800084", "text": "def update_detail\n end", "title": "" }, { "docid": "1b6271726104c5505f...
6934592d16f8c11a941fcace3d88d33d
When multiple nodes (excluding the profile node itself) are deleted, switching back and forth from different perspectives retain the status of the graph i.e. nodes stay deleted (deleting the profile node itself is a different scenario, which is covered in a different test as the flow is different)
[ { "docid": "603a68fb9f3e8e780709eb3230f17210", "score": "0.7805089", "text": "def test_del_multiple_non_profile_nodes\r\n\r\n @place_holder.login_goto_profile(@provider_url)\r\n\r\n # Switch the perspective to 'Graph'\r\n @place_holder.add_to_or_view_on_graph('initially form the profile view wh...
[ { "docid": "7bcecb58d446aa7244d84468948dd5c8", "score": "0.71746767", "text": "def test_del_profile_node_add_back\r\n\r\n provider_profile_url = PropertiesReader.get_provider_profile_url\r\n @place_holder.login_goto_profile(provider_profile_url)\r\n\r\n # Switch the perspective to 'Graph'\r\n ...
6c96cd0cc3c40554198aeac8fe1b86c6
Session should be commited if it was loaded, any of specific options like :renew, :drop or :expire_after was given and the security permissions match. Skips if skip is given.
[ { "docid": "82c3731b99529bad60500d35626ed123", "score": "0.70652926", "text": "def commit_session?(env, session, options)\n if options[:skip]\n false\n else\n has_session = loaded_session?(session) || forced_session_update?(session, options)\n has_sessi...
[ { "docid": "43afcc7bcd7737bab1b7ce8c742f3a24", "score": "0.6967865", "text": "def skip_session_commit\n request.session_options[:skip] = true\n end", "title": "" }, { "docid": "634e36535df6b04cb311d48022eb14c4", "score": "0.57500947", "text": "def save_without_session_maintenance...
6e8c4d499f5277780f724cbf377ddf30
POST /pagos POST /pagos.json
[ { "docid": "91ec497677a71b66e0920f88e4e47906", "score": "0.63804686", "text": "def create\n @pago = Pago.new(params[:pago])\n\n respond_to do |format|\n if @pago.save\n format.html { redirect_to @pago, notice: 'Pago was successfully created.' }\n format.json { render json: @pago...
[ { "docid": "fd44d6bba199a76d1d4ff063ddab527a", "score": "0.6830087", "text": "def create\n\t\t@pago = Pago.new(pago_params)\n\t if @pago.save\n\t render :json => @pago, status: :ok\n\t else\n\t render :json => {}, status: :internal_server_error\n\t end\n\tend", "title": "" }, ...
7c1e83dd928f349dc1cf83b9326c9d04
POST /log_units POST /log_units.json
[ { "docid": "06f8d9ed952901be7284657e00127224", "score": "0.6695456", "text": "def create\n @log_unit = LogUnit.new(params[:log_unit])\n @log_unit.user = current_user\n\n respond_to do |format|\n if @log_unit.save\n format.html { redirect_to @log_unit, :notice => 'Log unit was succes...
[ { "docid": "93570f97f38755d4fb40c82947c0a032", "score": "0.60140127", "text": "def new\n @log_unit = LogUnit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @log_unit }\n end\n end", "title": "" }, { "docid": "d6fbadee9b97792ca1...
35a9cb123b26cf33171cb45f42e87e03
Makes files 'safe', also fixes weird issue with IE posted filenames...
[ { "docid": "c3e919471cae5377eca695fd43adab95", "score": "0.6869487", "text": "def sanitize_filename(value)\n # get only the filename, not the whole path\n just_filename = value.gsub(/^.*(\\\\|\\/)/, '')\n # Finally, replace all non alphanumeric, underscore or periods with underscore\n ...
[ { "docid": "82bcb62d65cfd087990e68a694013153", "score": "0.7208446", "text": "def sanitize(filename)\r\n # Bad as defined by wikipedia: https://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words\r\n # Also have to escape the backslash\r\n bad_chars = [ '/', '\\\\', '?', '%', '*', ':', '|', ...
4d0d59f22a8b05fefe45156dfe60da0f
Builds the enum from string
[ { "docid": "84647cc057c23ae79a571772657c9637", "score": "0.0", "text": "def build_from_hash(value)\n constantValues = TiffSaveCompression.constants.select { |c| TiffSaveCompression::const_get(c) == value }\n raise \"Invalid ENUM value #{value} for class #TiffSaveCompression\" if constantValues...
[ { "docid": "3f37c27cb349ce5b37aeae0b8e465238", "score": "0.66046983", "text": "def build_from_hash(value)\n constantValues = ExchangeStatus.constants.select { |c| ExchangeStatus::const_get(c) == value }\n raise \"Invalid ENUM value #{value} for class #ExchangeStatus\" if constantValues.empty?\...
0c6ca5e5dfdd983322beecda5f05fac8
Return the description text of the notification change by combining the action description and the actor name.
[ { "docid": "781de576a79522222378cda8c5200ffa", "score": "0.76155144", "text": "def full_description\n actor.name + describe_action\n end", "title": "" } ]
[ { "docid": "cc30f608f980ac41139e17275d83a0ca", "score": "0.6906182", "text": "def action_info\n [@name].concat(@description)\n end", "title": "" }, { "docid": "1a072aa24c2139727e4364b11faa7ff4", "score": "0.68809277", "text": "def describe_action\n case notification_object...
7d9ad72246c0a68b332584bf7fe592bd
str The String to chomp Examples chomp("Hi!\n") => "Hi!" chomp("Hello!") => "Hello!" Returns a chomped String if the string ends with newline, otherwise returns the string
[ { "docid": "d57c60a3019c0cda39da4f5ffc1265c3", "score": "0.75787723", "text": "def chomp(str)\n if str[str.length - 1] == \"\\n\"\n i = 0\n output = \"\"\n while i < str.length - 1\n output << str[i]\n i+=1\n end\n return output\n else\n ...
[ { "docid": "4006d8af724e3cc16671020ec4b7c0c0", "score": "0.79542094", "text": "def chomp(str)\n\tif str[-1] == \"\\n\"\n\t\treturn str[0..-2]\n\tend\n\treturn str\nend", "title": "" }, { "docid": "52dc43173000a82bfc3b396a10b90ca3", "score": "0.75152844", "text": "def chomp(str)\n ...
4a0152e71bf1056b43b492af41668088
initialize class with starting values
[ { "docid": "3fa5b1104ee1a7256036461ff6914c67", "score": "0.0", "text": "def initialize\n login = self.read_login_data\n @base_url = login['base_url']\n @user = login['user']\n @password = login['password']\n end", "title": "" } ]
[ { "docid": "8e3629bb42b471c640e3e1bd665bf3b2", "score": "0.71103776", "text": "def initialize(*) end", "title": "" }, { "docid": "8e3629bb42b471c640e3e1bd665bf3b2", "score": "0.71103776", "text": "def initialize(*) end", "title": "" }, { "docid": "8e3629bb42b471c640e3e1bd...
82055e5ed82c6b8afe0568bc841166a0
grab google to access google for user data
[ { "docid": "dd1047c01d375d0c9a942d65268635e0", "score": "0.60172325", "text": "def google_token\n x = self.authentications.find_by(provider: 'google_oauth2')\n return x.token unless x.nil?\n end", "title": "" } ]
[ { "docid": "1931e1f57242134f0b7659180fef8b35", "score": "0.67638665", "text": "def profile\n if logged_in? && @options[:service] == \"cp\"\n user, domain = @email.split(\"@\")\n http = Net::HTTP.new(\"www.google.com\")\n response = http.get(\n \"/m8/feeds/p...
fd59be894868b0b280b75b3d50a0259e
Renders a CSS partial.
[ { "docid": "5691f10b381c9c2dc8d6e6af2be557b2", "score": "0.0", "text": "def render_stylesheets(filenames, combined_filename=nil)\n filenames_str = combined_filename || filenames.join().gsub(\"/\", \"_\")\n tmp_filename = \"#{TMP_PATH}/#{filenames_str}.css\"\n \n filenames.map! do |fi...
[ { "docid": "799eadf5689a3a3ed98357f0dd06fa7d", "score": "0.6573368", "text": "def render_css\r\n @part_css\r\nend", "title": "" }, { "docid": "799eadf5689a3a3ed98357f0dd06fa7d", "score": "0.6573368", "text": "def render_css\r\n @part_css\r\nend", "title": "" }, { "docid...
1e6e3eb3dfde0291c4b11c25865f6fbb
Bind mount a path under this node's mount namespace (e.g. /etc, /var/run).
[ { "docid": "66a846cb379bfaad3dc5080b126f32df", "score": "0.7541698", "text": "def mount(path, user = nil, group = nil)\n source = \"#{mount_point}/#{path}\"\n FileUtils.mkdir_p(source)\n FileUtils.chown_R(user, group, source) if user || group\n execute(\"mount --bind #{source} #{path...
[ { "docid": "4b82a985da3ec7069f8b8b13f9b373b6", "score": "0.8007048", "text": "def bind_mount(path, user, group)\n source = \"#{@runstatedir}/#{path}\"\n FileUtils.mkdir_p(path)\n FileUtils.mkdir_p(source)\n FileUtils.chown_R(user, group, source)\n system(\"#{@ns.nsenter} mount -...
d46aa370ef54cc13fb9ea777b1da22b0
GET /profiles/1 GET /profiles/1.xml
[ { "docid": "7a488daa9dc02d95274beeb93613a68b", "score": "0.0", "text": "def show\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.js # _show.html.erb\n format.html # _show.html.erb\n format.xml { render :xml => @profile }\n end\n end", "title": "...
[ { "docid": "a6f53e408a2076f75db363f33215b44b", "score": "0.73511946", "text": "def profile\n get('/my/profile')\n end", "title": "" }, { "docid": "93edd2ba7f3c41892d9400fad4224664", "score": "0.731931", "text": "def list_profiles\n # /profiles returns a list of profile...
4a079f54553182f7fa54352f2d061f29
MERGENOTE refactor and simplify
[ { "docid": "adbb2479cccf8585a62d6424d5345d8c", "score": "0.0", "text": "def incubation_time_with_unit\n incubation_time.nil? ? \"\" : \"#{incubation_time} (#{incubation_time_unit.symbol}s)\"\n end", "title": "" } ]
[ { "docid": "5bfc645a05205b989e1b40fdc92eba72", "score": "0.59548795", "text": "def condense; end", "title": "" }, { "docid": "5bfc645a05205b989e1b40fdc92eba72", "score": "0.59548795", "text": "def condense; end", "title": "" }, { "docid": "5bfc645a05205b989e1b40fdc92eba72...
b8a73185788d1d9b7406f32334fd09ad
GET /occurrences/1 GET /occurrences/1.xml
[ { "docid": "89b4fcccbbc49f12fab8a51141ca0700", "score": "0.6696038", "text": "def show\n @occurrence = Occurrence.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @occurrence }\n end\n end", "title": "" } ]
[ { "docid": "2fd4909fa8a9062be2b25b8971bd5a20", "score": "0.63518995", "text": "def occurrences\n Validator.validate_nokogiri(@doc)\n data = []\n xpath = \"//*/list[@list-content='occurrences']/list-item\"\n @doc.xpath(xpath).each do |occ|\n obj = {}\n occ.xpath(\"*/named-content\")...
78a5dee3c976369ea0208088e591ac1b
GET /betas GET /betas.xml
[ { "docid": "e60d5d1fd2b90cff822f7b987b397eb3", "score": "0.7601045", "text": "def index\n @betas = Beta.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @betas }\n end\n end", "title": "" } ]
[ { "docid": "842e389d10c8913ac28964ea73d624cd", "score": "0.720528", "text": "def show\n @bet = Bet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bet }\n end\n end", "title": "" }, { "docid": "8100a4f03877672826c...
bac41764c749129a2491422400ff7a82
Returns true if UsingYAML will warn about potential typos (or similar) which might otherwise be masked.
[ { "docid": "62bf60f936e75a4eea115de6bbc2bb20", "score": "0.0", "text": "def squelched?\n defined?(@@squelched) && @@squelched\n end", "title": "" } ]
[ { "docid": "4cc7d3fa50d33904a9ab1ba415a9464c", "score": "0.6186183", "text": "def yaml_file?\n false\n end", "title": "" }, { "docid": "abc290bd629f8c4ce5a675d90dd094d1", "score": "0.57739973", "text": "def has_yaml_props?\n file? && data[0][0..2] == \"---\"\n end...
d752720779a66d74f8a766a86e525887
underscore the fields in the way they are returned by savon
[ { "docid": "5ed2eb72f561a848cf389123a182c566", "score": "0.0", "text": "def underscore(string) \n\t\t\tstring.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'\\1_\\2').gsub(/([a-z\\d])([A-Z])/,'\\1_\\2').tr(\"-\", \"_\").downcase \n\t\tend", "title": "" } ]
[ { "docid": "7f78f282e87cfc6eb06c16b266e4ce19", "score": "0.6516298", "text": "def _fields; end", "title": "" }, { "docid": "f6787a48566d75bfe6fb37faf054ff18", "score": "0.64765596", "text": "def fields; @_fields; end", "title": "" }, { "docid": "53c40b036f64d7df493983a16e...
b33dde160299024a507bcf8610495f32
Cancels the agreement by the current user to babysit by clearing the columns for babysitter_id and group_id in the request and sets the status of the request back to waiting Deducts the tokens from the current user group they were allocated for agreeing to babysit Deduct the tokens from all the requesters groups that t...
[ { "docid": "4386aa5b9e3fd4194cfc9c337b157b0a", "score": "0.6310857", "text": "def cancel_babysitting_date\n request = Request.find(params[:id])\n send_cancelation_notification_email(request)\n deduct_tokens_from_current_user(request)\n deduct_tokens_from_original_request_groups_not_accepted(...
[ { "docid": "f6835b37dc9f001973eb0cf47b6e8b24", "score": "0.78902876", "text": "def cancel_babysitting_agreement\n self.update_columns(status: 'waiting', babysitter_id: nil, group_id: nil)\n end", "title": "" }, { "docid": "7a39aa91e0e19d1e648cd66a49a6b361", "score": "0.69163924", ...
3a9969009d8cd42488d7dae41fc098a6
POST /corridas POST /corridas.json
[ { "docid": "22a9f5bb25324047d971628d1b1b393f", "score": "0.7201008", "text": "def create\n @corrida = Corrida.new(corrida_params)\n\n respond_to do |format|\n if @corrida.save\n format.html { redirect_to @corrida, notice: 'Corrida creada satisfactoriamente.' }\n format.json { re...
[ { "docid": "3fdff8496269a81efd3e2a913a381748", "score": "0.6279199", "text": "def corrida_params\n params.require(:corrida).permit(:fechaInicio, :fechaFin, :estado)\n end", "title": "" }, { "docid": "de66c761761308610aeb8fa05d569787", "score": "0.6273325", "text": "def create...
f835c146cf811b26ae709209a568b5bb
POST /payments POST /payments.json
[ { "docid": "5344dffa175eb0551c6bf40c4dd69870", "score": "0.60349184", "text": "def create\n @payment = Payment.new(payment_params)\n @payment.client = @client\n respond_to do |format|\n if @payment.save\n format.html { redirect_to client_path(@client) , not...
[ { "docid": "6dcdff2de9aa207796fb9a4857f343ff", "score": "0.7499752", "text": "def payment(params)\n check_token\n\n Request.perform(:post, URI.parse(Urls::PAYMENTS_URL), headers_for_other, params.to_json)\n end", "title": "" }, { "docid": "9f35017219540746d60a776507eefa81", ...
60b60932d9594a430f9e0c222f77893e
Gets a value indicating whether the given boolean identifier has not been set in the temporary world storage.
[ { "docid": "051d4582aacbab69a19875889ea39592", "score": "0.7605434", "text": "def not_set_temp(identifier)\n not (get_temp_bool identifier)\nend", "title": "" } ]
[ { "docid": "143ed9447d962929b9737c51412096f7", "score": "0.8082828", "text": "def get_temp_bool(identifier)\n storage = world_status.TempDataStore.TryGetBoolean(identifier)\n \n if storage.nil? then\n false\n else\n storage.Value\n end\nend", "title": "" }, { "do...
cc8acf45a436133e896a1155a745c29e
PATCH/PUT /ratings/1 PATCH/PUT /ratings/1.json
[ { "docid": "b4baa522eb8e3d8e68741b46717032bc", "score": "0.6515297", "text": "def edit\n if @rating.update(rating: params[:rating].to_i)\n puts \"Actualizado\" \n else\n puts \"Error\"\n end\n redirect_to root_path\n end", "title": "" } ]
[ { "docid": "7db339d82d6b2d81316123b99c839c44", "score": "0.76426756", "text": "def update\n @rating = Rating.find(params[:id])\n\n respond_to do |format|\n if @rating.update_attributes(params[:rating])\n format.json { render json: @rating, status: :ok, location: nil }\n else\n ...
7aefc13f129ef538e5e0b491f162bc66
Commit the schema changes to the DB
[ { "docid": "63b089ed4ab0216ed5ad6cc0b8cb3e65", "score": "0.79921305", "text": "def commit!\n @schema.save_changes\n @elements.each{|e| e.save_changes}\n end", "title": "" } ]
[ { "docid": "05bfeb7fcd8ae61b9729003768a6b010", "score": "0.7218427", "text": "def commit_tables\r\n end", "title": "" }, { "docid": "2a15885a8782d6467f6264c15579ce6c", "score": "0.7129433", "text": "def active_record_update_schema\n\t\t\tend", "title": "" }, { "docid...
3ed85b8898257904e8970074001e5a7d
Create an instance of this Harr class that holds a Ruby value. Like a String, Number or true.
[ { "docid": "fd6ce04ed25d8b2fbf547681c325a90f", "score": "0.6919263", "text": "def new_with_value(value)\n HarrObject.new(self, value)\n end", "title": "" } ]
[ { "docid": "f2dcb543679a6a1a9d82cada53002141", "score": "0.6745435", "text": "def ruby_value\n self.value\n end", "title": "" }, { "docid": "22fff240b8a592620c0f179cb7fd5314", "score": "0.66644514", "text": "def initialize val\n case val\n when Array\n @h...
cea1ed2850d75772e9757bf5a3670898
GET /notes GET /notes.json
[ { "docid": "54c810a43e0ba8869e9e8bc014a6fd12", "score": "0.0", "text": "def index\n @trashed_notes = current_user.notes.where(:trash => true)\n if params[:q]\n @notes = current_user.notes.find_all_by_query(params[:q]).where(:trash => false)\n if @notes.empty?\n render \"search/no_...
[ { "docid": "087ae0244972391ee162117afe3cfda0", "score": "0.84703827", "text": "def get_notes\n Resources::Note.parse(request(:get, \"Notes\"))\n end", "title": "" }, { "docid": "cabc88080b1c9a5163867c110a0e7c03", "score": "0.78022486", "text": "def notes_get(opts = {})\n ...
6faa38ac7e17e79edeb2e76a9dda4c21
GET /portal_clazzes/1 GET /portal_clazzes/1.xml
[ { "docid": "f49e4ca2bcf28edd029301dcb18880ec", "score": "0.570851", "text": "def show\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE (did not find instance)\n # authorize @clazz\n @portal_clazz = Portal::Clazz.where(id: params[:id]).includes([:teachers, { :offerings => [:learners] }]...
[ { "docid": "fd77a0e5efd2b246f5b144a54166cab3", "score": "0.67649525", "text": "def index\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE\n # authorize Portal::Clazz\n # PUNDIT_REVIEW_SCOPE\n # PUNDIT_CHECK_SCOPE (did not find instance)\n # @clazzes = policy_scope(Portal::Clazz)\...
d4c23412f58db1a3f78376d3deb1b366
before_action :set_answers, only: [:index, :edit, :destroy]
[ { "docid": "cd6011780c7b3dc3c0cbe6c66b607150", "score": "0.0", "text": "def index\n # @answers = Answer.includes(:user).order(created_at: :desc)\n @answers = Answer.page(params[:page]).reverse_order\n end", "title": "" } ]
[ { "docid": "0f07e8d5ab944f1c4a9e4fed41da7957", "score": "0.7213553", "text": "def set_answers\n @answer = Answer.find(params[:id])\n end", "title": "" }, { "docid": "6d8dbfa51077d830ba1b1a23e9b18a68", "score": "0.7116962", "text": "def index\n @answers = Answer.all\n end", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "1745dc448395cc2661e5f4505453f361", "score": "0.0", "text": "def set_classification_code\n @classification_code = ClassificationCode.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.61642385", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60448", "text": "def action_hook; ...
22bd0b83f901208cbb697e16c50c2c18
Internal: Shortens a URL with the given options. url A String URL. code Optional String code. options Optional Guillotine::Service::Options to specify how the code is generated. returns a String code.
[ { "docid": "aadc2d7e4aa55fc22ab7af3541334467", "score": "0.75581056", "text": "def get_code(url, code = nil, options = nil)\n code ||= if options && options.with_charset?\n shorten_fixed_charset(url, options.length, options.charset)\n else\n shorten(url)\n end\n end", ...
[ { "docid": "8d41264b1a88b3c4b6349f6e1753ecd2", "score": "0.7447305", "text": "def shorten url, options = {}\n shorten! url, options rescue url\n end", "title": "" }, { "docid": "24729ddc3204a79ade3dcffdafe40723", "score": "0.67019546", "text": "def shorten_url\n if params[:lon...
cc71181c7a02d1d1ccfbd5b472d0a6ca
DELETE /phone_types/1 DELETE /phone_types/1.xml
[ { "docid": "40b680273f0b576c4463a450246fbf70", "score": "0.7524391", "text": "def destroy\n @phone_type = PhoneType.find(params[:id])\n @phone_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(phone_types_url) }\n format.xml { head :ok }\n end\n end", "title...
[ { "docid": "072a7858e6d04ae1f9f092e56dc25c59", "score": "0.6982653", "text": "def destroy\n @phone_type = PhoneType.find(params[:id])\n @phone_type.destroy\n \n respond_to do |format|\n format.html { redirect_to phone_types_url }\n format.json { head :no_content }\n en...
0479b9f923277cfb4a52180c7befa5fe
pulbic method returns 0 for a 0 input or calculates the binary
[ { "docid": "6a80a68ad093aad99b0f54a6dad3022f", "score": "0.0", "text": "def convert(integer:)\n integer == 0 ? \"#{integer}\" : calculate(integer: integer)\n end", "title": "" } ]
[ { "docid": "ce697fd82a603a81e92438bc6936385d", "score": "0.6571385", "text": "def binary(num)\n if num < 0\n positiveNumBinary = calculate_binary(num.abs, 'negative')\n else\n return calculate_binary(num, 'positive')\n end\n\nend", "title": "" }, { "docid": "49d21fc83c06e1e3c2e77d3b...
25f11f039f624909dd9868ab7d06fee0
Gosu implementation Inputs: none Outputs: none
[ { "docid": "a90b32c8c19e75174d09fa3829557451", "score": "0.0", "text": "def update\n @buttonPvAi.update\n @buttonPvP.update\n @buttonReturn.update\n end", "title": "" } ]
[ { "docid": "64ecf4bb47342c97dbb7efe629dc7867", "score": "0.6552962", "text": "def draw\n \n if @visible > 0 #Draw the Ruby if @visible is a number bigger than 0\n @image.draw(@x - @width / 2, @y - @height / 2, 1)\n end\n \n @hammer_image.draw(mouse_x - 40, mouse_y - 10, 1) #Dr...
6c85909945de0be30ccf32bdf2d39fc2
Check a root partition and return map with infomations (see variable rootPartitions).
[ { "docid": "62ee773ffb4a005fdf5f413feb583cd5", "score": "0.49613973", "text": "def CheckPartition(partition)\n partition = deep_copy(partition)\n freshman = {\n :valid => false,\n :name => \"unknown\",\n :arch => \"unknown\",\n :label => Ops.get_string(partiti...
[ { "docid": "38241ff825d7cf2cf9fce1d6cf4b7528", "score": "0.60611004", "text": "def FindRootPartitions\n return if @didSearchForRootPartitions\n\n ModuleLoading.Load(\n \"reiserfs\",\n \"\",\n \"Linux\",\n \"Reiser FS\",\n Linuxrc.manual,\n true\n ...
ee919d40d07b36a800f9dc77dab02970
Listen for messages. This will block if there are no messages published to the queue.
[ { "docid": "66875448a9fd1e27da3eb55c880bf7a5", "score": "0.0", "text": "def messages\n Enumerator.new do |y|\n loop do\n y << @redis.blpop(@name).last\n end\n end\n end", "title": "" } ]
[ { "docid": "02a55d7fb0a295212272305ab35fd3f6", "score": "0.77204174", "text": "def listen\n amqp_listen do |msg|\n do_handle(msg)\n end\n end", "title": "" }, { "docid": "3fb7ca082489d51aec6ff256c0f8d4f8", "score": "0.7677237", "text": "def listen\n ...
5e568d1522016acfff7454d5da9bd133
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% The vote buttons %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[ { "docid": "ef9280d4c06d863abde65fa81ec08659", "score": "0.67371905", "text": "def click_upvote_button\n find(@upvote_button).click\n end", "title": "" } ]
[ { "docid": "05f5cb83eec533d291391005e97fd837", "score": "0.7406604", "text": "def voteOnShow\r\n\r\n end", "title": "" }, { "docid": "13dbf482ea517c1f88568f5be33a134f", "score": "0.72245544", "text": "def collectible_vote_buttons entity, styling={} # Style can be 'h', with more to c...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "47451f2280212274b9c49dffadd6a17c", "score": "0.0", "text": "def set_equipment_pdf\n @equipment_pdf = EquipmentPdf.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310596", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6014974", "text": "de...
d1b80cd563b065e6bbe88cbdce300937
GET /members/1 GET /members/1.xml
[ { "docid": "b2b7de89aa2a08b7a910cde1cc01324d", "score": "0.6829355", "text": "def show\n @member = Member.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @member }\n end\n end", "title": "" } ]
[ { "docid": "d743f502b758a7352730ff7d6044c6b3", "score": "0.7652717", "text": "def my_members(params = {})\n get(\"/members\", params)\n end", "title": "" }, { "docid": "30473413cf31e4509844e06a2ed30d05", "score": "0.7189777", "text": "def index\r\n @members = Member.fi...
f260b0743e3635ff851ba1fb8f391b00
GET /users/1 GET /users/1.json
[ { "docid": "94157aaf9743e7900e2240601a3c7b45", "score": "0.0", "text": "def show\n @user = User.find(params[:id])\n\n # defined in application_controller.rb\n get_projects_by_uid_and_groups params[:id], @user.groups.map(&:id)\n \n respond_to do |format|\n format.html # show.html.erb\...
[ { "docid": "9f7c735ace683c5c2b12c914cc9ad8a8", "score": "0.7716454", "text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end", "title": "" }, { "docid": "a95dfe28d6b386aafc5fb53749e84258", "score": "0.7510281", "text": "def user\n...
82482c6b4fd7aeac9e74d6e04a6c9fed
A pangram is a sentence that contains every single letter of the alphabet at least once. For example, the sentence "The quick brown fox jumps over the lazy dog" is a pangram, because it uses the letters AZ at least once (case is irrelevant). Given a string, detect whether or not it is a pangram. Return True if it is, F...
[ { "docid": "67aa8e2b0609a315a87886a9ba09b938", "score": "0.64597243", "text": "def panagram?(string)\n \n \n #array a-z \n \n #split string, do .uniq \n \n #reject all punctuation and spaces \n\n #compare with a-z \n \n alphabet = [* \"a\"..\"z\"] \n\n \n if alphab...
[ { "docid": "317345785f8dc9f8923ede3e6561a1ac", "score": "0.8617812", "text": "def pangram?(str)\n letters = \"abcdefghijklmnopqrstuvwxyz\".split(\"\")\n\n str.downcase!\n\n letters.all? { |letter|\n str.include? (letter)\n }\nend", "title": "" }, { "docid": "5cb6cf28456d66be0431121b70...
ed78e48921430471917f05974baed9f6
Declares the parameter as required.
[ { "docid": "65e5dfd536e29f70eb9a8b54647c75ca", "score": "0.0", "text": "def isrequired\n # TODO: determine if the \"required\" functionality is needed; does not appear to be used in Puppet\n @required = true\n nil\n end", "title": "" } ]
[ { "docid": "2909d9cf574f9c17518a8b940c07ba01", "score": "0.78387076", "text": "def required!\n self.required = true\n end", "title": "" }, { "docid": "4bf4acac8fa04141fef4a2bf4d29fd52", "score": "0.769617", "text": "def required=(value)\n @required = value\n end",...
bd8032a7a97046cdca643b3eb2849e1e
create new user from omni data
[ { "docid": "69d2dd76e326393b1671a4daa3e3da4f", "score": "0.73167264", "text": "def user_from_omni omni=@omni\n #raise omni.to_yaml\n return User.new(\n :email => omni[:info][:email],\n :name => omni[:info][:name],\n :password => pw=Devise.friendly_token[0,20],\n :password_confi...
[ { "docid": "8f3d8a5c6cbde6c943f05bb2dca77863", "score": "0.77176094", "text": "def createUser(data)\n\t\tUsuario.create(:login => data['login'], :password => data['password'],\n\t\t\t:nombre => data['nombre'], :apellidos => data['apellidos'])\n\tend", "title": "" }, { "docid": "ffecf21578b5c...
901b99202623a91cf4b9cc3148a26d6c
for testing private methods, courtesy of
[ { "docid": "137676244318f77b2b225372eb7a1a19", "score": "0.0", "text": "def describe_internally *args, &block\n example = describe *args, &block\n klass = args[0]\n if klass.is_a? Class\n saved_private_instance_methods = klass.private_instance_methods\n example.before do\n klass.class_eval...
[ { "docid": "d129cc756661d2db1b6e7ead9a68728c", "score": "0.7795402", "text": "def in_private; end", "title": "" }, { "docid": "9033a4004eb88fe2a1f0a7e5671e3d95", "score": "0.7580578", "text": "def private_method; end", "title": "" }, { "docid": "d3c96e42392398d4f63dc20a89...
ddc5b15ae71b331a689dc15fb858819f
PATCH/PUT /scales_scalevalues/1 PATCH/PUT /scales_scalevalues/1.json
[ { "docid": "00b88f058dc6d24048f2f421e6156095", "score": "0.7948536", "text": "def update\n respond_to do |format|\n if @scales_scalevalue.update(scales_scalevalue_params)\n format.html { redirect_to @scales_scalevalue, notice: 'Scales scalevalue was successfully updated.' }\n forma...
[ { "docid": "fed4146d31e828810ab911dfd142c402", "score": "0.780264", "text": "def update\n respond_to do |format|\n if @scalevalue.update(scalevalue_params)\n format.html { redirect_to @scalevalue, notice: 'Scalevalue was successfully updated.' }\n format.json { head :no_content }\n...
fa4b9793a23fc7910cfc1e876ea4f28c
The draw method is used to draw the input point. This is useful for showing an InputPoint from within the draw method of a tool that you have implemented in Ruby. Additional examples are available in the Plugins/examples directory.
[ { "docid": "45128cea23c91ae50a731e5b05932e96", "score": "0.0", "text": "def draw(view)\n end", "title": "" } ]
[ { "docid": "a91f82c1958d01f1557b75838c326a72", "score": "0.7006412", "text": "def draw_point(point, content)\n\t\t\t\traise NotImplementedError\n\t\t\tend", "title": "" }, { "docid": "e76bc40f85db81d95c2a73f63a4cc400", "score": "0.6703668", "text": "def draw(view)\r\n @drawn = fal...
8e19ec868fb96d7073fc83ea9ca966b0
We don't want the leaf_representative, we want the direct representative member to pass to MemberImageComponent. This will be an additional SQL fetch to member_list_for_display, but a small targetted oneresult one.
[ { "docid": "d5a763890ba0276a87b38a61cf0b5af6", "score": "0.5772354", "text": "def representative_member\n # memoize with a value that could be nil....\n return @representative_member if defined?(@representative_member)\n\n @representative_member = work.representative\n end", "title": "" ...
[ { "docid": "8ce4bd32fd33dd419672791c1d0a3e6d", "score": "0.7542457", "text": "def member_list_for_display\n @member_list_display ||= begin\n members = ordered_viewable_members.dup\n\n # If the representative image is the first item in the list, don't show it twice.\n start_image_number...