query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
afc0e2545eb3afa5f6380050ff167328
Plants + Strain API
[ { "docid": "60a572379cf0e5991c029638572d24fb", "score": "0.5505084", "text": "def get_strains_info(facility_license, id)\n url = \"#{BASE_URL}/strains/v1/#{id}?licenseNumber=#{facility_license}\"\n res = RestClient.get(url, HEADERS)\n JSON.parse(res.body)\n end", "title": "" } ]
[ { "docid": "af070d431e2f006a4189b5083a111a75", "score": "0.6179798", "text": "def admin\n subscription_seach()\n\n url = URI(\"https://ip-geolocation-ipwhois-io.p.rapidapi.com/json/\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\...
99307c4bf3ace00c7fc4daaea7d60ad8
Creates current goal when iterating through sheet
[ { "docid": "5ddae15e563349005ee24277927771f1", "score": "0.6729161", "text": "def create_goal\n @current_goal_in_row = Goal.create!(title: @row['title'],\n what: @row['what'],\n who: @row['who'],\n ...
[ { "docid": "250866cdbea6bf86a256bef242273a5d", "score": "0.7429185", "text": "def create_goals\n @goal_sheet.drop(1).each do |row|\n @row = row\n create_goal\n next vision_to_goals if @range == 'Long'\n goals_to_goals\n end\n end", "title": "" }, { "docid": "6f4c62...
12a6a6d249be0426bec806d5785f29f6
Locates the `images` service.
[ { "docid": "ac4b221acd4ad3b8b9b2dc269f0bf800", "score": "0.82030576", "text": "def images_service\n @images_service ||= ImagesService.new(self, 'images')\n end", "title": "" } ]
[ { "docid": "3e687039aab0cc6356a9ea49826dea19", "score": "0.79121745", "text": "def images_service\n @images_service ||= OpenstackImagesService.new(self, 'images')\n end", "title": "" }, { "docid": "ab919e38ccc969ed0b10420729ce5b9d", "score": "0.7122193", "text": "def services...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "2074c1980d5414a389dfd3b713d4d239", "score": "0.0", "text": "def set_football_event\n @football_event = FootballEvent.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...
aca7030cf48fddd5ccf0cfbd807502fc
Quits the whole program
[ { "docid": "4b148475d86204cff8023d29cc7357a3", "score": "0.0", "text": "def exit\n @daddy.exit\n end", "title": "" } ]
[ { "docid": "073f6533f8b9b3007149d81eba9f7054", "score": "0.77174133", "text": "def quit\n exit(1)\n end", "title": "" }, { "docid": "2d973c175b6b28ea2fe491f2706eede3", "score": "0.76717114", "text": "def quit\n @quit = 1\n end", "title": "" }, { ...
df472411a8290a2c9d813a3bc13b1a4b
TA: Does this belong in the Board?
[ { "docid": "4246cecc24b3c11355da33d62cf2fa6c", "score": "0.0", "text": "def valid_board(move)\n if move[0].between?(0,7) && move[1].between?(0,7)\n return true\n end\n false\n end", "title": "" } ]
[ { "docid": "e34e91d644660e5694b2b0e53110d742", "score": "0.8023919", "text": "def is_object_on_board?\n @board.matrix.any? do |element|\n element == @object.current_position\n end\n end", "title": "" }, { "docid": "d43971207ad34b449f761be9289087db", "score": "0.76853395", ...
c31cedefa8e92de9c9f5f2a7c0c02607
Determines if the given line indicates a heading. An heading is followed by the ':' character and is not an item line.
[ { "docid": "074c48b472be7e1034f663ee49695b79", "score": "0.8249097", "text": "def header_line?(line)\n !item_line?(line) && line.end_with?(':')\n end", "title": "" } ]
[ { "docid": "cec940a8e2ac2c31fda7850cf09cdc98", "score": "0.7437669", "text": "def looks_like_header? line\n /\\A[A-Z0-9][A-Za-z]*(?:\\s[A-Za-z0-9]*)*:\\s*\\Z/ =~ line\n end", "title": "" }, { "docid": "1d3e0cb0bbfbdb477a211b58c641c7b0", "score": "0.73434675", "text": "def hea...
b6b9cd199dfaed08c4c534812e0ac109
Check to see if the all the properties in the model are valid
[ { "docid": "eb3026600e2325c5fc48b9af9bc1323d", "score": "0.0", "text": "def valid?\n true\n end", "title": "" } ]
[ { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.78989387", "text": "def validate_properties\n true\n end", "title": "" }, { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.78989387", "text": "def validate_properties\n true\n end", "title": "" ...
d80a2bc4c0a8c837f3d7616ed47fa4e2
A simple method that calls and returns all the data to render a report
[ { "docid": "6f68e6335c44a2da8299ef1f0e58db12", "score": "0.0", "text": "def get\n return self.title, self.headers, self.formats, self.data, self.chart\n end", "title": "" } ]
[ { "docid": "7430ff37ccd34f0858918f68252be708", "score": "0.7572874", "text": "def reporting_data\r\n\r\n report_sid = params[:report].blank? ? \"\" : params[:report]\r\n render(:nothing => true) and return if report_sid.blank?\r\n opts = (params[:report_options] || {}).reject{|k,v| v.blank?}\r\...
317c5a659e958506791f3e0cc0f9f576
When a client has authenticated with Ably and the client is either anonymous (cannot assume a +client_id+) or has an assigned +client_id+ (implicit in all operations), then this client has a validated +client_id+, even if that client_id is +nil+ (anonymous) Once validated by Ably, the client library will enforce the us...
[ { "docid": "3fdbe1c3b24addd86db9e2f512b89994", "score": "0.6818848", "text": "def client_id_validated?\n !!@client_id_validated\n end", "title": "" } ]
[ { "docid": "29c276bb2351a546137ea4e933a64bd2", "score": "0.697312", "text": "def can_assume_client_id?(assumed_client_id)\n if client_id_validated?\n client_id == '*' || (client_id == assumed_client_id)\n elsif !options[:client_id] || options[:client_id] == '*'\n true # client ID...
c32cac1c13f1999725d5ae7da87c3da6
Redirect as appropriate when an access request fails. The default action is to redirect to the login screen. Override this method in your controllers if you want to have special behavior in case the user is not authorized to access the requested action. For example, a popup window might simply close itself.
[ { "docid": "04ba97a440e9eff5c67f55872d6c137a", "score": "0.72928244", "text": "def access_denied\n store_location\n redirect_to login_path\n end", "title": "" } ]
[ { "docid": "e05b070a87b12e498352ef671f9fb03a", "score": "0.78550166", "text": "def access_denied\n if current_user\n redirect_to root_path, error: \"you weren't authorized to #{params[:action]} in #{params[:controller]}\"\n else\n # the problem is almost certainly lack of login\n...
93f093bce7ddd515a5e7038481be1cbf
Returns the number of seconds the task is or was running at the given point in time
[ { "docid": "582df2bcc541990c30ca497bfb0abd2f", "score": "0.62277347", "text": "def time_elapsed(time = Time.now)\n #no need to synchronize here\n if @stopped_at\n (@stopped_at-@started_at).to_f\n elsif @started_at\n (time...
[ { "docid": "c78e97156b15186ca212f91d5c157c2d", "score": "0.71696645", "text": "def running_time\n a = started_at or return nil\n b = done_at or return nil\n (b - a).to_f / 60.0\n end", "title": "" }, { "docid": "f97ebde1a633206c3da573c06ab4dd1b", "score": "0.68618494", "tex...
5a3d724022cb61a5a924710b65823c55
PUT /sales/1 PUT /sales/1.xml
[ { "docid": "6de904bc7751e7a9490a8d4cf786fed8", "score": "0.0", "text": "def update\n @user=User.find(current_user) #should find current user\n @sale = Sale.find(params[:id])\n @sale.update_attributes(params[:sale])\n quantity=@sale.quantity\n group=TicketGroup.find(params[:ticket_group_id...
[ { "docid": "31eb73745ccd2785d5b653c61ef57aea", "score": "0.63046193", "text": "def update\n @sale = Sale.find(params[:id])\n\n respond_to do |format|\n if @sale.update_attributes(params[:sale])\n format.html { redirect_to(@sale, :notice => 'Sale was successfully updated.') }\n f...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "3eb6c437f94b700cadee3d0e4a2210ec", "score": "0.0", "text": "def category_subscription_params\n # params.require(:category_subscription).permit(:chosen, :text, :price, :user_id, :doc_request_id,\n # file_containers_attributes: [\"file\", \"@original_filename\", \"@content_type\", ...
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
6897a693e2c1e3fcb96f59cd02219ef0
The attributes that Puppet class information is stored in.
[ { "docid": "7e63f2574b034d4fceeda8add50172cd", "score": "0.76830393", "text": "def class_attributes\n # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]\n x = Puppet[:ldapclassattrs].split(/\\s*,\\s*/)\n end", "title": "" } ]
[ { "docid": "299836db597d5e27bb69541eda1785cc", "score": "0.76467603", "text": "def attributes\n Helpers.hashify(self, self.class::ATTRIBUTES)\n end", "title": "" }, { "docid": "7c5717fc63997677b3d7bcf005a65e4a", "score": "0.7641917", "text": "def attributes\n attributes = ...
5bba2ba352d008ff7c1ba0a099adaa8d
collect all project hashes (scope may be :all, or all projects, or :mine, for projects in which the current user has some role)
[ { "docid": "d89051df7875c691ab1fead1041af8ea", "score": "0.0", "text": "def projects(params = {})\n fetch_all('projects', 'projects', params)\n end", "title": "" } ]
[ { "docid": "254af23eab058e7a68851d9c5231954a", "score": "0.7424492", "text": "def aggregate scope\n # TODO fucking slow\n data = {}\n data[:sha] = self.sha\n data[:short_sha] = self.short_sha\n data[:author_name] = self.author.name\n data[:aut...
3c84beb122ba93fd66bfae0016a885f7
belongs_to :reseller attr_accessor :new_reseller_name before_save :create_reseller_from_name
[ { "docid": "399d75c617cc644504f3672ca7790acf", "score": "0.7471351", "text": "def create_reseller_from_name\n # create_reseller(:name => new_reseller_name) unless new_reseller_name.blank?\n end", "title": "" } ]
[ { "docid": "b95ef1e6ec925f3e76736aa2d1efee51", "score": "0.6520517", "text": "def before_create\n # Cloned so we can pass objects as name parameter to new Company\n self.name = self.name.clone.normalize!\n super\n end", "title": "" }, { "docid": "1680dbda0ab259ed81f7dab90bd92d75", ...
d088b18f7d8857ecfc17eac3fab45a4a
Read the PDF files in the TMPDIR
[ { "docid": "7f07f818b08b31051c07809c15622c6f", "score": "0.5342334", "text": "def readFilesInDir(targetdir)\n filedata = Hash.new\n files= Dir.glob(targetdir + \"/*.pdf\")\n files.sort.each do |filename|\n filedata[filename] = readExifData(filename)\n end\n return filedata\nend", "title": ""...
[ { "docid": "9b1de581a40e369fa598635ab1aded49", "score": "0.6896345", "text": "def get_pdf_files\n\t\tfolder = @folder_name.gsub(\"_\", \" \")\n\t\tfolder_name = extract_dir + \"#{folder}\"\n\t\tfiles = Dir.glob(\"#{folder_name}/*\")\n\t\tstore_pdf_file(files)\n\tend", "title": "" }, { "docid...
076cb6f6e3b097ec599df01c7c8ca917
POST /white_papers POST /white_papers.json
[ { "docid": "86b4d050488310e44ceb1f1475a399be", "score": "0.75089514", "text": "def create\n @white_paper = WhitePaper.new(params[:white_paper])\n\n respond_to do |format|\n if @white_paper.save\n format.html { redirect_to @white_paper, notice: 'White paper was successfully created.' }\...
[ { "docid": "efe76f939cd2fdea82c1e0ac53c955dd", "score": "0.6432739", "text": "def new\n if current_user.admin?\n @white_paper = WhitePaper.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @white_paper }\n end\n else\n redire...
8406d69c71d68ba6d67bba0c695a321c
validate :validate_with_official_server Usage: Used as a validation method To be nice to CCP and play within their guidelines, I validate the api_token with the server whenever it is :saved (read: changed)
[ { "docid": "a44307b7fc10f830d2a90f18c313a95b", "score": "0.8492917", "text": "def validate_with_official_server\n\t unless Aura::Api.token_is_valid?(self) \n \t errors.add(:eve_api_key, \"is invalid.\")\n\t end\n\tend", "title": "" } ]
[ { "docid": "e69d7f8758a14e1ae083d810a729c256", "score": "0.74691504", "text": "def update_and_validate(server_token: nil)\n self.server_token = server_token if server_token.present?\n\n validate\n\n errors.blank?\n end", "title": "" }, { "docid": "dac08f154123e3a172de8a66a3c642b2",...
5ac2b3c0c9f63af4e92b3ebc44ffa949
reserve room if available
[ { "docid": "f1c159699ebec9517ee42a3c7abd797f", "score": "0.76721233", "text": "def reserve_room\n unless rooms_available?\n raise NoRoomsError.new(\"All rooms are reserved.\")\n end\n room = @available_rooms.pop\n @reserved_rooms << room\n return room\n end", "titl...
[ { "docid": "8e62be37199e95cb2a0d5fe1dad94d0a", "score": "0.70610166", "text": "def reserveRoom(date, time, scheduleTable)\n j=0\n reservedRooms = []\n while j < scheduleTable.size\n if date == scheduleTable[j][\"Date\"] && time == scheduleTable[j][\"Time\"] && self.buildi...
6ada73dfa3ae16324fbc7550de73776e
need this to test markup in the layouts Demonstrates how to access instance from a subclass if needed
[ { "docid": "64a8f462ccb6c8454f283720dd470188", "score": "0.0", "text": "def access_instance\n\t self.instance\n end", "title": "" } ]
[ { "docid": "cb0a87ecc0b6db2d911e634607e33831", "score": "0.599967", "text": "def show\n #self.class.layout(@page.layout_name || 'application')\n end", "title": "" }, { "docid": "4ff636a0aa2b1e91dc7266e7334bb885", "score": "0.5952439", "text": "def in_class\n end", "title":...
8575e8838738f1048f6ca314022e480e
Actions pour le dboy
[ { "docid": "5d26d5b8224afd0a259c576bd5eb7c1c", "score": "0.0", "text": "def vieworder\n end", "title": "" } ]
[ { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.7529794", "text": "def actions; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.70123166", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", ...
82bafdf324417b42985918887382f0a5
GET /env_monitors/new GET /env_monitors/new.xml
[ { "docid": "0ec130bbb1e5152ae35a40cd13f08ab7", "score": "0.7850504", "text": "def new\n @env_monitor = EnvMonitor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @env_monitor }\n end\n end", "title": "" } ]
[ { "docid": "248c54561ea961f0df781988f8976be7", "score": "0.7085716", "text": "def new\n @url_monitor = UrlMonitor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @url_monitor }\n end\n end", "title": "" }, { "docid": "59f12c3156b...
a2b1089d11bade7ea4d7fcc3407b68a9
TC808 Short list menu no contacts selected
[ { "docid": "b9325ef640d50f5855d31467b5aa690b", "score": "0.5871825", "text": "def test_menuNoContactSelected\n Common.login(Users::USER_EMAIL, Users::PASSWORD)\n \n EnableOldInterfaceSL(false)\n #Generate a random string for Short List name\n randomName = SecureRandom.hex(4)\n randomContact = Secu...
[ { "docid": "889b0bce14f3263ce1711becf4c1e050", "score": "0.6609968", "text": "def display_all_contacts\n\t\t@rolodex.display_contact\n\t\tmain_menu\n\tend", "title": "" }, { "docid": "16c431e38e88e0abee0ffbc88b4b8d59", "score": "0.6187449", "text": "def display_all_contacts\n puts...
0f0d0c763abf8463bb8e2c0ae7d05a56
DELETE /authors/1 DELETE /authors/1.json
[ { "docid": "98d7618e826d4aad9043bfab110bbb68", "score": "0.7087892", "text": "def destroy\n @author.destroy\n end", "title": "" } ]
[ { "docid": "2b79fc51bd66af910ff2e0af19d10ae3", "score": "0.77574736", "text": "def destroy\n @author.destroy\n\n respond_to do |format|\n format.html { redirect_to authors_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "b6d385335e5106dfc945b334de...
8366d1005f346cc9b2d7544f341de8b0
ensure that project is kind of GitlabProject
[ { "docid": "3ca50832104223628e340a13ba89cc8e", "score": "0.0", "text": "def can_write?(project)\n return true if Setting.admin_users.include? self.username\n has_permission_value(project, 30)\n end", "title": "" } ]
[ { "docid": "9ac75cefdd481802b5902e6c19710fb7", "score": "0.6818709", "text": "def assert_project!\n raise \"No project! #{project.inspect} is not a Project\" unless project.is_a?(::Project)\n end", "title": "" }, { "docid": "9b055d58631a7d55bb43e49fb6a8ba8a", "score": "0.6728089"...
286bb72bdab8c91fffaad8127c3e8dd5
Test what happens when bad arguments are passed (nil, too few, etc.)
[ { "docid": "c3f87b8aa55657d1f4bc3be70ff46ddb", "score": "0.0", "text": "def test_has_key_bad_params_array\n assert_raise TypeError do\n Sketchup.active_model.options[0].has_key? []\n end\n end", "title": "" } ]
[ { "docid": "8c19e269d69dd50371d017ac0b6c1a67", "score": "0.7793697", "text": "def test_bad_single_input\r\n\tassert_equal 0, @arg_checker.check_args(['hello'])\r\n end", "title": "" }, { "docid": "e09c4d75d508bee939d364d530172a0b", "score": "0.768953", "text": "def test_nil_args\n ...
97c237f47aa1d6532a0ecf805d7731d1
DELETE /info/customers/1 DELETE /info/customers/1.json
[ { "docid": "7a8eea53ff85d80064e89b3efb850e02", "score": "0.7056075", "text": "def destroy\n @info_customer.destroy\n respond_to do |format|\n format.html { redirect_to info_customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"...
[ { "docid": "93d388920d3b2a8503a9842b3c29b282", "score": "0.7321148", "text": "def delete(options = nil)\n request = Request.new(@client)\n path = \"/customers/\" + CGI.escape(@id) + \"\"\n data = {\n\n }\n\n response = Response.new(request.delete(path, data, options))\n ...
523ab815e6690b92d79bb35905ee957a
Program of a Lambda
[ { "docid": "2c21f4b4d55b888bebf03d78a0c86c14", "score": "0.0", "text": "def my_method\n \n puts \"before proc\"\n \n my_proc = lambda{\n \n puts \"Inside proc\"\n break\n }\n \n my_proc.call\n puts \"after proc\"\n \nend", "title": "" } ]
[ { "docid": "0190890ecf2172d2578493635fa8653c", "score": "0.81559086", "text": "def lambda; end", "title": "" }, { "docid": "45a18e6d543b5e8a7371451b3621ff3c", "score": "0.75984585", "text": "def exec_lambda expr\n wolfram_result expr\n end", "title": "" }, { "doci...
46b4aa68d70a3fe8806da59e35464328
helper functions for reading values from the knobs of my midi keyboard
[ { "docid": "cc515c5815457eb64763395879675f6e", "score": "0.54976916", "text": "def translate_knob(knob_cc)\n case knob_cc\n when 14 then :knob1\n when 15 then :knob2\n when 16 then :knob3\n when 17 then :knob4\n end\nend", "title": "" } ]
[ { "docid": "95fcf7b4e59972534daf6ccc21d6170f", "score": "0.6012177", "text": "def readkeynb; readkey(0.0) end", "title": "" }, { "docid": "35c2f725f6cbfdfd09d3fbbce28eb494", "score": "0.59971565", "text": "def read_knob(filename)\n knob_name = filename.split('/')[-1]\n knob_file = ...
64533b96c2b53ad72f2146035eecfd1b
PUT /tasks/1 PUT /tasks/1.xml
[ { "docid": "6118d31da14c051a72b7a27558b01980", "score": "0.6654039", "text": "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n flash[:notice] = 'Task was successfully updated.'\n format.html { redirect_to(@task)...
[ { "docid": "23b8fd20c4f863cc9fd1d0f2eeefb2e5", "score": "0.76518345", "text": "def update_task\n @user = User.find_by_username(session['user'])\n @access_token = OAuth::AccessToken.new(UsersController.consumer, @user.token, @user.secret)\n @response = UsersController.consumer.request(:put, \"/a...
061e2efbb7edf2b528f88bba45c7b879
Write a function that multiplies three numbers and returns the result add_three
[ { "docid": "bd1deb0c2624db67e5f5c4dd056a997e", "score": "0.82844", "text": "def add_three num1, num2, num3\n\tnum1 + num2 + num3\nend", "title": "" } ]
[ { "docid": "8977a04472e1401ffae0b1c22c7c04ed", "score": "0.85241574", "text": "def add_three num1, num2, num3\n\treturn num1 + num2 + num3\nend", "title": "" }, { "docid": "9587a61faf60a264f29ca70fe1e6af13", "score": "0.84804016", "text": "def mult_then_add(n_1, n_2, n_3)\n\tn_1 * n_...
59dc74d6557f7f3bc26d44783efe860e
Converts hexadecimal string to a binary data string.
[ { "docid": "d9f0cd6e0a0d2d6fa1c732614b7d7ca6", "score": "0.71369", "text": "def data_from_hex(hex_string)\n raise ArgumentError, 'Hex string is missing' unless hex_string\n hex_string = hex_string.strip\n data = [hex_string].pack(HEX_PACK_CODE)\n if hex_from_data(data) != hex_string....
[ { "docid": "642c14430f40eaabac26e719a2ce4f10", "score": "0.7370266", "text": "def hex2bin(string)\n [string].pack('H*')\n end", "title": "" }, { "docid": "b64b4d50fbf218cccecfd0e522c5097a", "score": "0.7268823", "text": "def hex2bin(str)\n hex_string?(str) ? [str].pack('...
2634894827626bceec713c404d4440ad
PUT /projects/add_project_doc PUT /projects/add_project_doc
[ { "docid": "1c164cd529adc2dc6f1e1716d42ff7a1", "score": "0.7371089", "text": "def add_project_doc\n project = Project.find(params[:project_id]) #needed for \"respond_to\"\n doc_id = params[:document][:document_id]\n \n #TODO: More error checking?\n if (params.include?(:project_id) and not...
[ { "docid": "f9d7470d96f17392baa17a0a2558e376", "score": "0.724473", "text": "def add_doc(project, doc_id)\n if (project == nil or doc_id == nil or doc_id.blank?)\n @add_doc_err = true\n return false\n end\n \n doc = Document.find(doc_id) #for adding documents\n doc.update_attrib...
f7bec0b479072742f315e396bb18b8d2
POST /matter_peoples POST /matter_peoples.xml
[ { "docid": "af4a8f922dd89956703838876e072611", "score": "0.57928646", "text": "def create\n authorize!(:create,@user) unless @user.has_access?('People & Legal Team')\n data = params\n matter_ppl_data = data[:matter_people]\n matter_ppl_data.merge!({\n :created_by_user_id => current_us...
[ { "docid": "b99abafc6cf2b9887475aed123de71d3", "score": "0.6174893", "text": "def create\n @matter = Matter.new(params[:matter])\n\n respond_to do |format|\n if @matter.save\n format.html { redirect_to(@matter, :notice => 'Matter was successfully created.') }\n format.xml { ren...
5297ca69ad4b06acfdf09a9e2d7c2495
Create a new Chef::Node. Supports creating the node with its name, run_list, attributes and environment. This injects a rest object into the Chef::Node which uses the client key for authentication so that the client creates the node and therefore we get the acls setup correctly.
[ { "docid": "d0aeb16d76f05c99c63e2ad47cfd15d0", "score": "0.7039409", "text": "def node\n @node ||=\n begin\n node = Chef::Node.new(chef_server_rest: client_rest)\n node.name(node_name)\n node.run_list(normalized_run_list)\n node.nor...
[ { "docid": "8def245c8dfc3587b57e7905f498fdbe", "score": "0.73721915", "text": "def _create_chef_node(&block)\n step(\" creating chef node\", :green)\n @chef_node = Chef::Node.new\n @chef_node.name(fullname)\n set_chef_node_attributes\n set_chef_node_environment\n sync_ipco...
dfabe900e741734f38f6cd3185e1ce31
icon represents complete deletion from system
[ { "docid": "4ce63782b5e51364764346b4845c78fb", "score": "0.6313978", "text": "def delete_icon(model, text: nil, confirm: I18n.t(:remove_confirm, scope: :global), html_options: {})\n options = { method: :delete, remote: true, id: \"delete-icon-#{model.class}-#{model.id}\", data: { confirm: confirm }...
[ { "docid": "c9cec4333acde01bc0f392be27a739eb", "score": "0.7423689", "text": "def delete_icon( options={} )\n icon_tag(:delete, options)\n end", "title": "" }, { "docid": "d49b0b9e5b74e929ccd81b9025957e7e", "score": "0.7400855", "text": "def destroy_icon_tag\n fa_icon :tra...
424c9e907b9bd68400c759a5c954c40b
responses are converted to a hash and sent back
[ { "docid": "13860f873424d120a8c1e66833ebabb1", "score": "0.0", "text": "def build_reply(route_id)\n {:route_id => route_id, :status_code => '500', :response => self.response, :response_text => self.response.response }\n end", "title": "" } ]
[ { "docid": "05e002c8b22b686a0b1ee64aabb3c566", "score": "0.6964374", "text": "def responses; end", "title": "" }, { "docid": "05e002c8b22b686a0b1ee64aabb3c566", "score": "0.6964374", "text": "def responses; end", "title": "" }, { "docid": "05e002c8b22b686a0b1ee64aabb3c566...
1c9f614faa6a25a27a1e99d6db249ac3
if it's not the customer order, we prevent him to go further
[ { "docid": "c37f8b41a6a38ff31ff327a4f84394b6", "score": "0.77128667", "text": "def customer_order?\n if Order.where(id: order.id, user_id: current_user.id).first.nil?\n redirect_to navigation.back(1)\n return\n end\n end", "title": "" } ]
[ { "docid": "b2fd4de15e994354b99af3e29daa1f19", "score": "0.6857707", "text": "def check_unattended_orders\n if session.delete(:just_logined) == true && @current_user\n if @current_user.is_merchant\n @unattended_orders = @current_user.products.collect(&:orders).first.\n where(\"...
9f98ca1d226177dc867d9e8ebc4a1540
mixes in url(), polymorphic_path stuff, and method_missing to catch named_route_path stuff
[ { "docid": "d5387b25c0876d2f1d65cc1b4ac7cbea", "score": "0.0", "text": "def install_helpers(klass)\n klass.module_eval do\n include ActionController::Routing::Helpers\n include Merb::Router::UrlHelpers\n end\n end", "title": "" } ]
[ { "docid": "3a5ddf992ee60ce2ed8a3da6ab5d3e6c", "score": "0.7252759", "text": "def method_missing(method_name, *args, &block)\n if path_method?(method_name)\n Rails.application.routes.url_helpers.try(method_name, *args) || super\n else\n super\n end\n end", ...
e92c0eb56498429b1ec59121f0ba419d
Descarta un tesoro visible para completar el mal rollo
[ { "docid": "c51db0a702a8087a57a8cdcc21cca26d", "score": "0.0", "text": "def discardVisibleTreasure(t)\n @visibleTreasures.delete(t)\n if (@pendingBadConsequence != nil) and !@pendingBadConsequence.isEmpty\n @pendingBadConsequence.substractVisibleTreasure(t)\n end\n dieIfNoTrea...
[ { "docid": "bd4af81b75b3f812c4592fd949bfce04", "score": "0.55841374", "text": "def appear\n refresh\n self.visible = true\n self.opacity = 255\n end", "title": "" }, { "docid": "e9fd047864079aa0a8f92b4e252cc973", "score": "0.5532457", "text": "def appear\n @inposition = ...
4004886643495efbde1c88b1b80c11eb
and returns the string "Hello, " concatenated with the name.
[ { "docid": "7bec3507e66b350e2387ead1cdd642ba", "score": "0.0", "text": "def hello(name)\n \"Hello, #{name}\"\nend", "title": "" } ]
[ { "docid": "8a452e088d66727f4475faf63062ac39", "score": "0.7938259", "text": "def hello(name)\n\treturn 'Hello, ' + name\nend", "title": "" }, { "docid": "04f8df1cbd610dfad653dc8159f53458", "score": "0.7937733", "text": "def hello(name)\n \"\n name: String\n Return a string ...
96546c692dc3355d09850ccb7627b21d
Creates a new user with the email address provided by Omniauth and the the username returned by find_username(). Sets a random password.
[ { "docid": "710d6c6e047537342e45cfdf9519e16e", "score": "0.8018601", "text": "def create_new_user\n username = find_username\n @user = User.new(\n email: auth_email,\n username: username,\n password: Devise.friendly_token[0, 20]\n )\n @user.skip_confirmation!\n @user.sav...
[ { "docid": "3863c9164261d5695df93f09f4b3372e", "score": "0.77011055", "text": "def create_user(name, email, password)\n\n # Password is hashed automatically\n user = User.new(name: name, email: email, password: password)\n user.save!\n end", "title": "" }, { "docid": "e0e93e9dfb6bd...
160c6842b13b9262c60fabb189c537aa
Creates the main window's menu bar.
[ { "docid": "141588f2ea361eb37bff24e6d04f33fd", "score": "0.72603446", "text": "def create_menus\n @file_menu = menu_bar.add_menu(tr(\"&File\"))\n @currency_menu = menu_bar.add_menu(tr(\"&Currency\"))\n @currency_menu.add_action(@import_file_action)\n @currency_menu.add_ac...
[ { "docid": "10cd5be3d4d70cd50147c4e469e74664", "score": "0.72943896", "text": "def add_menu_bar\n # menubar across the top, the width of the whole screen\n menu_bar = FXMenuBar.new(self, LAYOUT_SIDE_TOP|LAYOUT_FILL_X)\n\n # will hold all the commands\n file_menu = FXMenuPane.new(self)\n\n ...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "f15698ba9d35a1fc35f79e783ad0f4a4", "score": "0.0", "text": "def staff_params\n params.require(:staff).permit(:number, :name, :department, :position)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74768823", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.71700543", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist...
6b64e3fafb7d1fb8819bbee0d0f76a62
POST /sunsystems POST /sunsystems.json
[ { "docid": "b1b1a9d829840251069b867da6cd16c6", "score": "0.74018896", "text": "def create\n @sunsystem = Sunsystem.new(sunsystem_params)\n\n respond_to do |format|\n if @sunsystem.save\n format.html { redirect_to @sunsystem, notice: 'Sunsystem was successfully created.' }\n form...
[ { "docid": "ea2ce32a9f1076e3f550a4f60bf6e6e4", "score": "0.6731391", "text": "def sunsystem_params\n params.require(:sunsystem).permit(:y, :name)\n end", "title": "" }, { "docid": "000f65efdb23b1c1e57282c98a88548e", "score": "0.6130344", "text": "def create\n begin\n ...
ff5be8ad5bd2d0d4d69b2a2953372593
for user search function
[ { "docid": "1a2492b264e85f07e42218fef86da950", "score": "0.0", "text": "def search_list\n if params[:keyword].nil? or params[:keyword].empty?\n redirect_back :fallback_location => root_path, :alert => \"Unrecognized user input. \"\n else\n keyword = \"%\" + params[:keyword].strip...
[ { "docid": "ee095bf91f2ab92393964c7656fef73d", "score": "0.79319334", "text": "def search\n\n end", "title": "" }, { "docid": "61bd97fa9eddad78e4d7ea28316bba77", "score": "0.79306126", "text": "def search; end", "title": "" }, { "docid": "8ebcf03a65bb2984f9fadc9722eb8c2b"...
1e686fb43168559f8179e834ec7bace6
Left this out because of the above
[ { "docid": "566c251fa26384354464e6a4a0a40ffc", "score": "0.0", "text": "def artist_name=(name)\n self.artist = Artist.find_or_create_by_name(name)\n artist.add_song(self)\n end", "title": "" } ]
[ { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.6347715", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.6347715", "text": "def used; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "sc...
9ab972fc8d56544fc3a985b5a1df74e3
Allow place nested form attribute to pass
[ { "docid": "51c513b67881d8b4128e3e70699dbd5a", "score": "0.0", "text": "def category_params\n params.require(:JoinTableTalentCategory).permit(:category_id)\n end", "title": "" } ]
[ { "docid": "196b92d5d3b700385c73d6b24d531ac4", "score": "0.6418379", "text": "def set_nested\n end", "title": "" }, { "docid": "f72bf34348753a97a77a8aee760a0caa", "score": "0.6395959", "text": "def nested_form(attribute, options={})\n control_group do\n label(attribute...
c9f04e847811cc26ee46923e9d3140e8
DELETE /tags_books/1 or /tags_books/1.json
[ { "docid": "223de0f253684e622fdad468389d2ce8", "score": "0.74621844", "text": "def destroy\n @tags_book.destroy\n respond_to do |format|\n format.html { redirect_to tags_books_url, notice: \"Tags book was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "e709d186ed680bf2e3dd3364788ba5c3", "score": "0.6980931", "text": "def delete(tag)\n api_client.tags.multi_delete(resource_hrefs: [api_client.get_instance.href], tags: [tag])\n end", "title": "" }, { "docid": "37601b4cbb1006651d37e9f815a82fcc", "score": "0.69570374", ...
edf1658b6581081f4c787b5362ddc271
returns: a HealthVault::WCData::Types::CultureSpecificString Array
[ { "docid": "a3aedc51e5f70ceb94f6da4fccf84941", "score": "0.0", "text": "def description\n return @children['description'][:value]\n end", "title": "" } ]
[ { "docid": "accf0f88b2250f774918e22b947b128b", "score": "0.6476843", "text": "def locale\n result = []\n result << self.language\n result << self.country\n result.compact.reject(&:blank?).join(\"-\").to_sym\n end", "title": "" }, { "docid": "5279bb454396c6a371b141a42148cd1a", ...
c3721271d62d6453e91a4c8f4bd0a9f2
Return an array of values which is exactly the same size as `keys.size` so that a hash can be used to initialize variables.
[ { "docid": "6d5c9f6d4026d948f2a478340d8e477a", "score": "0.6857293", "text": "def value_array(hash, *keys)\n return unless hash.is_a?(Hash)\n keys.flatten!\n keys.map { |v| [v, nil] }.to_h.merge(hash).slice(*keys).values\n end", "title": "" } ]
[ { "docid": "632b52e6325279b41ae6a6b902da526c", "score": "0.65920913", "text": "def values\n vals = []\n each{|k,v| vals << v}\n vals\n end", "title": "" }, { "docid": "1418cc98e8ecb79bbbde78a3cc981fd2", "score": "0.6575854", "text": "def values_at(*keys)\n valu...
8bc8a73b564ea2a0139703423ab35e74
Provides a route to redirect after order completion
[ { "docid": "e2b05c640ef505b59dc91cf825d5e3d4", "score": "0.63690484", "text": "def completion_route(custom_params = nil)\n if @order.payments.present? && openpay_payment?(@order.payments.last.payment_method)\n openpay_payment_path(@order)\n else\n spree.order_path(@order, custom...
[ { "docid": "f1fbb48399bb1b97e286bdcadbb8fd0e", "score": "0.76226705", "text": "def completion_route\n #return order_path(@order) if current_user\n #token_order_path(@order, @order.token)\n end", "title": "" }, { "docid": "7a53cc949eac64675d2531f5462c51fc", "score": "0.7282624",...
ccfedb12fb57b6b87903e94074a7d44b
set_values will add the specified group attributes
[ { "docid": "f8a3dbedf5d6edb993e4a3a0eaf0f81f", "score": "0.6745022", "text": "def set_values(group_values)\n group_values.keys.each do |key|\n prop = Atom::XML::Node.new('apps:property')\n prop_name(prop, key)\n prop.attributes['value'] = group_values[key]\n @d...
[ { "docid": "01302f69f57e42932d93c58baf0a1625", "score": "0.64198387", "text": "def group(value)\n attributes[:group] = value\n end", "title": "" }, { "docid": "681c5cbf6c1e5038fc3bc5eca460995b", "score": "0.6326912", "text": "def update_group(group, attributes)\n gro...
0f9b78ed582c514e49f188fdb44cc0a2
DELETE /airfields/1 DELETE /airfields/1.json
[ { "docid": "109609f161e57b5d8c2d9ac6bb32dff9", "score": "0.72157", "text": "def destroy\n @airfield.destroy\n respond_to do |format|\n format.html { redirect_to airfields_url, notice: 'Airfield was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title...
[ { "docid": "b780c73e03c58087898cf4412b108fdd", "score": "0.75563467", "text": "def destroy\n @airfield = Airfield.find(params[:id])\n @airfield.destroy\n\n respond_to do |format|\n format.html { redirect_to airfields_url }\n format.json { head :no_content }\n end\n end", "titl...
ef4148b65e7650995a82e503a2d8cd6d
Find the most recent dataset
[ { "docid": "01a38ce137946e2bda604e9866984cd5", "score": "0.7005223", "text": "def latest_data\n path = Dir[\"#{storage_path}/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\"].\n sort{|a,b| b.split(\"/\")[-1].to_i <=> a.split(\"/\")[-1].to_i}.\n first\n\n if not path\n...
[ { "docid": "7d119549167c00c554be329516affe5d", "score": "0.7092573", "text": "def latest_data\n files = Dir[\"#{storage_path}/*.csv\"]\n path = nil\n\n Time.now.year.downto(2013) do |year|\n path = files.select{|f| f =~ /_#{year}\\.csv$/}.first\n break if path\n ...
0d286877413518d90f74920037eb4eb0
Enter email address to recover password
[ { "docid": "0280cda63e478c9eb699ce564402db81", "score": "0.0", "text": "def new\n @title = _(\"Recover Password\")\n render\n end", "title": "" } ]
[ { "docid": "2ad81ae6a8af19c04e39ae96c91024f7", "score": "0.7556378", "text": "def recover_password params\n user = find_with_email(params[:email])\n user.send_recover_password\n end", "title": "" }, { "docid": "f07d0ef46ecb98dccb1e92d298fa58da", "score": "0.71617657", "t...
3bbfa1857c79db6cfe0592b904c31510
GET Dashboard of the user
[ { "docid": "2dfb036ea4e123101efe2e3e9d94ab82", "score": "0.6197075", "text": "def dashboard\n @user = User.find(params[:id])\n @wizard = get_next_wizard\n @profile_completion = @user.profile_completion\n @participation_requests = (@user.participation_req...
[ { "docid": "9d566e5f237b5b448c0950aeb94ec688", "score": "0.7708773", "text": "def dashboard\n service_response = AdminManagement::AdminUser::Dashboard.new(params).perform\n render_api_response(service_response)\n end", "title": "" }, { "docid": "17308143f0658df5947f45f6892540d6", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "06f0b63774d2a7c5693dde9f8173e2c2", "score": "0.0", "text": "def set_plan\r\n @plan = Plan.find(params[:id])\r\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;...
21f6cdd4e989a79c60d1eb5054b52f65
Initializes a new instance.
[ { "docid": "796814e31426914af484a3f6650162a9", "score": "0.0", "text": "def initialize(src_path, dest_path, src_storage_name = nil, dest_storage_name = nil, version_id = nil)\n self.src_path = src_path\n self.dest_path = dest_path\n self.src_storage_name = src_storage_name\...
[ { "docid": "9340b0874d627092ce82cffda8dda649", "score": "0.8748081", "text": "def initialize\n end", "title": "" }, { "docid": "c6116a572da53228c0ff0d98bc9a2bfc", "score": "0.8699247", "text": "def initialize\n end", "title": "" }, { "docid": "c6116a572da53228...
eeb78edc2a21339b38dd3fe98b257e30
reduce 121 omitted reduce 122 omitted reduce 123 omitted
[ { "docid": "a88ca7891a5e2122e30a689044338f20", "score": "0.0", "text": "def _reduce_124(val, _values, result)\n lexer.lex_state = EXPR_END\n result = val[0]\n\n result\nend", "title": "" } ]
[ { "docid": "5c6eb2ec68a89de964db1411baa71bb2", "score": "0.70127606", "text": "def _reduce_235(val, _values, result)\n result = nil\n \n result\nend", "title": "" }, { "docid": "bcc77ea412992f9c87aad138efd40a40", "score": "0.6990919", "text"...
bafd6834aef931c1d90e0791ed41b60b
Patch a user&39;s Presence Patch a user&39;s presence for the specified source that is not specifically listed. The presence object can be patched one of three ways. Option 1: Set the &39;primary&39; property to true. This will set the &39;source&39; defined in the path as the user&39;s primary presence source. Option ...
[ { "docid": "43f07c8e0095fda131caf89ccb2f0e0e", "score": "0.73846865", "text": "def patch_user_presence_with_http_info(user_id, source_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PresenceApi.patch_user_presence ...\"\n end\n ...
[ { "docid": "fbb20cdc52d82859d0d7456fe3b060ff", "score": "0.7026577", "text": "def patch_user_presence(user_id, source_id, body, opts = {})\n data, _status_code, _headers = patch_user_presence_with_http_info(user_id, source_id, body, opts)\n return data\n end", "title": "" }, { "...
375b47c10e589952583c995588d51a2c
Returns true if and when server log includes str. Will timeout or raise an error otherwise
[ { "docid": "0bef47403f40c50c6ba199b90e02687e", "score": "0.71189725", "text": "def wait_for_server_to_include(str, log: false)\n sleep 0.05 until @server.is_a?(IO)\n retry_cntr = 0\n begin\n @server.wait_readable 1\n if log\n puts \"Waiting for '#{str}'\"\n begin\n ...
[ { "docid": "36b3855923c67804b8fb3f4ea2e9e96b", "score": "0.6283431", "text": "def check_for_the_message (line) \n File.readlines(get_system_log).grep(line).any? \n end", "title": "" }, { "docid": "8b13cb53fd6883d69f33c0bf13863d64", "score": "0.6020298", "text": "def timeout?\...
0930176a2f199cb5ad66955d51307575
Adds a single method to the current client class. This method yields a request method builder that allows you to specify how: the request is built the response is processed the response is stubbed for testing
[ { "docid": "381961d3687eb51f70b25fbdd25dfcf2", "score": "0.7413402", "text": "def add_client_request_method method_name, options = {}, &block\n\n operations << method_name\n\n ClientRequestMethodBuilder.new(self, method_name, &block)\n\n method_def = <<-METHOD\n def...
[ { "docid": "b645d400ff9acf654aaea001a8704827", "score": "0.6482638", "text": "def method_missing(meth, *args, &block)\n super unless client.respond_to?(meth)\n\n define_singleton_method meth do |*meth_args, &meth_block|\n client.send(meth, *meth_args, &meth_block)\n end\n\n send(meth, *...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "43f85492f7d00729706ed6f9eba505f9", "score": "0.0", "text": "def r_page_params\n params.require(:r_page).permit(:r_language_id, :name, :template, :properties)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7497761", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6959097", "text": "def strong_params\n params.require(:request).permit(param_white...
6d3003cd898a99dd9fd3de3aea0141b7
Im still not happy about this but at least it is out of PseudoEntity.
[ { "docid": "2ceeda568eab6c6a28869e048144398a", "score": "0.0", "text": "def shift_time(options={:distance => :days, :direction => :either, :base => nil, :min => nil, :max => nil})\n random_time_shift options\n end", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.64294016", "text": "def private; end", "title": "" }, { "docid": "a3c677de4120a6b1a1688fb1c77520ce", "score": "0.61971533", "text": "def pos; end", "title": "" }, { "docid": "a3c677de4120a6b1a1688fb1c77520ce", ...
e86bc3e8f0c7b27e9ffcaa6dcc2d8ea3
POST /course_tables POST /course_tables.json
[ { "docid": "21ef3452caabe5eb5eda35ce4e554ed1", "score": "0.7315525", "text": "def create\n @course_table = CourseTable.new(course_table_params)\n\n respond_to do |format|\n if @course_table.save\n format.html { redirect_to @course_table, notice: 'Course table was successfully created.'...
[ { "docid": "3315667bec9c55be0fb38b247ecd6745", "score": "0.6593564", "text": "def course_table_params\n params.require(:course_table).permit(:coursename, :teachername, :coursenum, :courseroom, :avaliablenums)\n end", "title": "" }, { "docid": "392923f7ee0eae6127c165fdf9fc3bcd", "...
a35bddf5b4cf7227d78c4974d40e3fa9
POST /courses POST /courses.xml
[ { "docid": "925afbc66c3a23ee8357ddc1a1cd6d7a", "score": "0.6125684", "text": "def create\n @course = Course.new(params[:course])\n @course.user_id = self.current_user\n respond_to do |format|\n if @course.save\n format.html { redirect_to(courses_path, :notice => 'Course was successf...
[ { "docid": "1053c44257e71d16f9c2cd2b0aaffe5c", "score": "0.65853244", "text": "def update_courses\n uri = \"https://apis-dev.berkeley.edu/cxf/asws/course?departmentCode=#{CGI.escape(self.department_code)}&_type=xml&app_id=#{@@app_id}&app_key=#{@@app_key}\"\n puts uri\n begin\n doc = Depart...
2c2e2d8777d7448d4f59d735514094ca
Get a single notification type Permissions Needed: NOTIFICATIONS_ADMIN
[ { "docid": "b3301d30553cb7c29bb643361f656cdf", "score": "0.0", "text": "def get_notification_type(id, opts = {})\n data, _status_code, _headers = get_notification_type_with_http_info(id, opts)\n return data\n end", "title": "" } ]
[ { "docid": "2bbb15a1b7ba0f455d790ddc34033b0d", "score": "0.6967841", "text": "def permission_type\n return @permission_type\n end", "title": "" }, { "docid": "9be75233bf2626b1b24cea3d60c093a9", "score": "0.68911576", "text": "def permission\n @permissio...
572f3c06c7dc9885b258489fd8b483d3
Public saves the entity entity An object that behaves as an EntityStore::Entity (see mixin) Returns nothing
[ { "docid": "008be65541dffee5949344d7ad810e63", "score": "0.78377163", "text": "def save_entity(entity)\n update_entity_sql = \"UPDATE entities SET version = :version WHERE id = :id\"\n\n use_store do |db|\n db.executeUpdate(update_entity_sql, withParameterDictionary:{ version: entity.ve...
[ { "docid": "ed45875802e206671f22273ce6368044", "score": "0.8623238", "text": "def save(entity)\n raise NotImplementedError\n end", "title": "" }, { "docid": "e075e55cd6a7c07461dc0183ecc4f1a0", "score": "0.79308945", "text": "def save!\n save_entity || raise(EntityNotSa...
2903ca602e223984d415d37a9c4f22d4
DELETE /reports_translations/1 DELETE /reports_translations/1.xml
[ { "docid": "eef89c3f37ea2b2afcb9506253ad1dcf", "score": "0.7473253", "text": "def destroy\n @reports_translation = ReportsTranslation.find(params[:id])\n @reports_translation.destroy\n\n respond_to do |format|\n format.html { redirect_to(reports_translations_url) }\n format.xml { hea...
[ { "docid": "1deb3d7d14fd98f154a903b6c2431b71", "score": "0.754008", "text": "def destroy\n @reports_translation = ReportsTranslation.find(params[:id])\n @reports_translation.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_reports_translations_url) }\n format.xml ...
bbe27e42efa21f3561ffc63b8f2850e8
Returns the currently logged in user or nil if there isn't one
[ { "docid": "755507691761263f70bb288c75f5356c", "score": "0.0", "text": "def current_user\n return unless session[:user_id]\n @current_user ||= User.find_by_id(session[:user_id])\n end", "title": "" } ]
[ { "docid": "9078cde62aaba7e6eaeefa2af2ed11e6", "score": "0.88379467", "text": "def current_user\n begin\n unless session[:user_id].nil?\n return User.find(session[:user_id])\n end\n rescue\n return nil\n end\n return nil\n end", "title": "" }, { "docid": "9...
8b80e18b742bdd25f5ec2ab9666f1ef6
format min value completely
[ { "docid": "fbd1c20766c47b6bcec9e316eb5d62b9", "score": "0.83144933", "text": "def format_min_value\n \t return format_value(@points.first) \n end", "title": "" } ]
[ { "docid": "7478188789701ba5d4aa6e80b44834ff", "score": "0.89112127", "text": "def min_format!(min)\n min = min_format(min)\n return min\n end", "title": "" }, { "docid": "5d4c8b4510253d50e81b8834cc05ef61", "score": "0.84411263", "text": "def ...
dae0f839c045f02bcc3711b96f989619
Checks whether Tomcat instance is Tomcat 7 compatible
[ { "docid": "297ab0135ecc7e80e1e6e2d314eef9ae", "score": "0.8483547", "text": "def tomcat_7_compatible\n @version < TOMCAT8\n end", "title": "" } ]
[ { "docid": "74473da02e322f5699ef0db5245f3abc", "score": "0.6981865", "text": "def detect\n @tomcat_version ? [tomcat_id(@tomcat_version), tomcat_support_id(@support_version)] : nil\n end", "title": "" }, { "docid": "5ce26ba54b4341ae695fd4dc1bba3f29", "score": "0.6132415", "te...
bfc2135e638eb0784f4c410c97ee5700
SQLite uses the :sqlite database type.
[ { "docid": "0d74334c25d970d4353f015286994a4e", "score": "0.9018241", "text": "def database_type\n :sqlite\n end", "title": "" } ]
[ { "docid": "7d9320122fea3455eb2b61ce34fc2eda", "score": "0.7367465", "text": "def uses_sqlite3?() false end", "title": "" }, { "docid": "ffbb2186b39616bbc7ef1d6759542a9a", "score": "0.72468454", "text": "def sqlite3_db(settings)\n options = {:adapter => \"sqlite3\"}\n optio...
f0ef998d9c9f680aff5c6d37098298bc
Confirms a loggedin user.
[ { "docid": "e3a8eaa71065e9ea155de42af1575319", "score": "0.0", "text": "def logged_in_user\n unless logged_in?\n store_location\n flash[:danger] = 'Please log in.'\n redirect_to login_url\n end\n end", "title": "" } ]
[ { "docid": "71b4815350ad43bbdc0f6266ba0d6a96", "score": "0.6876832", "text": "def confirm\n user = User.find(params[:id])\n authorize user\n if user.state != \"active\"\n user.confirm!\n user.make_user_a_member\n\n # assume this type of user just activated someone from somewhere ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "037e213f1a54ad32527e219c6cee9f08", "score": "0.0", "text": "def role_group_right_params\n params.require(:role_group_right).permit(:role_id, :group_right_id, :parameter)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74968386", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958337", "text": "def strong_params\n params.require(:request).permit(param_whit...
de6864257ae7be2d6d80fe70791cb79a
PATCH/PUT /itineraries/1 or /itineraries/1.json
[ { "docid": "91fac8a8e12988b2eaa3ed3d77bfdc55", "score": "0.0", "text": "def update\n @short = params[:short]\n @tour = @itinerary.tour\n @story = @tour.story\n\n respond_to do |format|\n if @itinerary.update(itinerary_params)\n @grid = ItinerariesGrid.new(itinerary_grid_params) d...
[ { "docid": "4e7a755a1cd8c9a1b350fb1995c116bc", "score": "0.72625595", "text": "def update\n @itinerary = Itinerary.find(params[:id])\n\n if @itinerary.update(itinerary_params)\n head :no_content\n else\n render json: @itinerary.errors, status: :unprocessable_entity\n end\n end", ...
34257cd934a27eb1c9b4665734a475c8
Run a garbage collection pass. This is 'static', as it does not care about the task's state: it will simply remove from the plan any task that is not useful in the context of the plan. This is mainly useful for static tests, and for transactions Do not use it on executed plans.
[ { "docid": "4495d02833b75e01d57cacaeff6d055c", "score": "0.7174675", "text": "def static_garbage_collect\n if block_given?\n for t in unneeded_tasks\n yield(t)\n end\n else\n for t in unneeded_tasks\n ...
[ { "docid": "fb0ff6dce2ae8205286b77ba649f3ac0", "score": "0.7250618", "text": "def test_garbage_collection_final\n\tt = Roby::Tasks::Simple.new\n\te = EventGenerator.new(true)\n\tplan.real_plan.add [t, e]\n\tengine.garbage_collect\n\tassert_raises(ArgumentError) { plan.add(t) }\n assert !plan.know...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "5d84d848f2f7f54dac41dcea3e956a07", "score": "0.0", "text": "def charm_item_params\n params.require(:charm_item).permit(:Name, :ProductID)\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...
f9fbd2c83a46ac490811367092808fd7
POST /obroty POST /obroty.json
[ { "docid": "064085d2a40ba673eef65ac4f0eb3707", "score": "0.6883756", "text": "def create\n @obroty = Obroty.new(obroty_params)\n\n respond_to do |format|\n if @obroty.save\n format.html { redirect_to @obroty, notice: 'Obroty was successfully created.' }\n format.json { render :s...
[ { "docid": "70bbcc364e7b409f10e4e9511536431f", "score": "0.60491014", "text": "def post(rectype,attribs,http)\r\n endpoint=\"#{URL_PREFIX}/t#{rectype}s.json\"\r\n req = Net::HTTP::Post.new(endpoint,initheader = {'Content-Type' =>'application/json'})\r\n req.body = attribs.to_json\r\n http.request(re...
f72cdcc73f7198662ecd43e83ab1f363
Logs a message to stderr. Unless otherwise specified, the message will be printed in red.
[ { "docid": "b9366fae5c65c778d27bc9129484e44e", "score": "0.8320317", "text": "def error(message)\n message = message.red unless message.color?\n puts(stderr, message)\n end", "title": "" } ]
[ { "docid": "980f4d32c81c8764dac4a302d2327ed0", "score": "0.8162828", "text": "def error(message)\n STDERR.puts red(message)\n end", "title": "" }, { "docid": "115d3ba4a11e6b9ccad108f55c01068e", "score": "0.8014615", "text": "def puts_err(msg)\n STDERR.puts(msg.to_s.red)\...
0b2bf5c5b3acf2b3a73c7f0a40008498
field :title, type: String field :text, type: String field :author, type: String field :date, type: Time field :priority, type: Integer field :is_complete, type: Boolean
[ { "docid": "16ac3f53f429e5a6a3185acd71c38187", "score": "0.0", "text": "def update\n @request = Request.find(params[:id])\n\n if params[:priority]\n @request.priority = params[:priority]\n elsif params[:is_complete]\n @request.is_complete = params[:is_complete]\n end\n\n @reques...
[ { "docid": "b3987baf0a0210695688bd4803273b5e", "score": "0.5711868", "text": "def journal_title_fields\n []\n end", "title": "" }, { "docid": "4d451aec5cf23709c595f82c41924fa4", "score": "0.5705211", "text": "def title_fields\n []\n end", "title": "" }, { "docid":...
ff8c91223137151c5ef979d4b480c7d9
form to send email
[ { "docid": "8765c17532fb6bf4436275b484415d7d", "score": "0.0", "text": "def forgot_password\n @user = User.new\n end", "title": "" } ]
[ { "docid": "347e1f65379be01ca277b903b7e70d94", "score": "0.80015326", "text": "def send_email(form)\n @form = form\n mail( to: 'jr.loves.maths@gmail.com',\n subject: 'Form feedback from ASM website.' )\n end", "title": "" }, { "docid": "9b75854fe3233af6b9c4cbc6930d1f2b", ...
3270dfc6bb8a443c31119a0f466bfcbf
Use this as before_filter for every CheckID request based action. Loads the current openid request and cancels if none can be found. The user has to log in, if he has not verified his ownership of the identifier, yet.
[ { "docid": "93d3d6e1ba1d042b23560bcb45b92083", "score": "0.6051856", "text": "def ensure_valid_checkid_request\n self.openid_request = checkid_request\n if !openid_request.is_a?(OpenID::Server::CheckIDRequest)\n redirect_to root_path, :alert => t('openid.identity_verification_request_invalid'...
[ { "docid": "2e040d92156a092a0f0162ffa96cd6da", "score": "0.70711905", "text": "def handle_checkid_request\n if allow_verification?\n save_checkid_request\n redirect_to proceed_api_openid_provider_path(consumer_id)\n elsif openid_request.immediate\n render_response(openid_request.ans...
9c0fe40469f954a49606b1086eb6aa32
Complexity is nlogn a is the array item is the item desired start_i is the array initial index end_i is the array end index
[ { "docid": "85a97b5e0f8c8baa336c5f1df9de5185", "score": "0.54410857", "text": "def binary_search(a, item, start_i=0, end_i=a.size-1)\n\tif start_i >= end_i\n\t\treturn nil\n\tend\n\tmid = (start_i + end_i) / 2\n\tif item < a[mid]\n\t\treturn binary_search(a, item, start_i, mid-1)\n\telsif item > a[mid]\...
[ { "docid": "6ac0768c33cc1fb05ddabe3fe4727243", "score": "0.6204586", "text": "def ari_slice(arr)\n start_diff=nil\n start_idx=nil\n rtn=[]\n idx=0\n until idx>arr.length-1\n if arr[idx+1] && arr[idx+2]\n if arr[idx]-arr[idx+1]==arr[idx+1]-arr[idx+2] &&start_diff.nil?\n start_diff=arr...
a267b9b3c5673f93d76babfea14ce85c
Returns the parent feed's base_uri if any.
[ { "docid": "99f4e1fb9abb6afcec29975814583ce0", "score": "0.9157859", "text": "def base_uri\n parent_feed = self.feed\n if parent_feed != nil\n return parent_feed.base_uri\n else\n return nil\n end\n end", "title": "" } ]
[ { "docid": "077e66f98a1844a22f63632850bf8855", "score": "0.7834072", "text": "def parent_uri\n is_root? ? nil : parent.uri\n end", "title": "" }, { "docid": "f7c25814f62d317189da3bcab44c527f", "score": "0.70556176", "text": "def base_uri\n # should be redefined in children...
3c39d7f6a85ad38235665549c453df59
Returns the repository objects configured for the application.
[ { "docid": "fd959d04dd35cf7a7d1a5ffeac139784", "score": "0.6737", "text": "def repositories\n opts[:repositories]\n end", "title": "" } ]
[ { "docid": "f0a08de32a8f645c5aa3f49679e8e28c", "score": "0.7392715", "text": "def repositories\n # TODO : merge with current data\n load_repos\n end", "title": "" }, { "docid": "52ccfbdf3571bfd8d1fd6d6c96b22367", "score": "0.7347744", "text": "def repositories\n Repos...
fd152e23aaf139c3efee6b4c6fa5363b
Les users peuvent seulement
[ { "docid": "d466cffa2d804dabe9d8fee77d9e2f70", "score": "0.0", "text": "def index\n @agences = Agence.all\n\n end", "title": "" } ]
[ { "docid": "b13705a7a49e3f4a5b64aede28a4fa68", "score": "0.67262745", "text": "def view_all_users\n # !! get all user so can interact after viewing them? all_users\n # User.select(:username).each_with_index {|user, index| puts \"#{index+1}. #{user.username}\"}\n #??????\n User.select...
4b1aa079cf0b79a1af38dc6641638ff7
Open chest, the contents will be determined in child class
[ { "docid": "5a7b7f4a5d4fd5bf89d064d30d9e5c73", "score": "0.720433", "text": "def open(playerObj)\r\n @newChest.openChest(playerObj)\r\n\t#return loot\r\n end", "title": "" } ]
[ { "docid": "dd8dbacf3510e3bd23ccb8b509f24f54", "score": "0.6886192", "text": "def chest\n Arcanus.load unless @chest\n @chest\n end", "title": "" }, { "docid": "3c29ee82fb803bee94893aa4792e64b4", "score": "0.62198865", "text": "def initialize\n\t@contents = [] #init array tha...
b64f2f3db3e63f16bc647ebf5568493a
function to update all title screen elements (except for logo)
[ { "docid": "d4ad1d073d946ef8f14eda18bd4295ad", "score": "0.0", "text": "def updateScene\n for key in @scene.keys\n next if @scene[key].id?(\"logo\")\n @scene[key].update\n end\n end", "title": "" } ]
[ { "docid": "c5a57248a37b13f8007e403531bd7dc2", "score": "0.7236691", "text": "def title_screen\n # Title screen header\n TitleScreenHeader.new(self, @@theme_colour, 'images/watts_logo_white.png')\n\n # Title screen content\n flow(:height => 640, :width => 1080, :scroll => true) do\n bac...
cc1a97bd9f18fdd900e1743869adb24c
return the word version of a two or one digit number
[ { "docid": "9373fd6404366cdcd816e9045c3a3d10", "score": "0.71459115", "text": "def return_two_digit_number(num,suffix=nil)\n\t\tif num < 20\n\t\t\t@@words << @@words_to_19[num]\n\t\t\tunless suffix.nil? || num == 0 \n\t\t\t\t@@words << suffix\n\t\t\tend\n\t\telse\n\t\t\t@@words << @@tens_array[num/10]\n...
[ { "docid": "96a04a46b65315d599c0e64880a2de99", "score": "0.7697338", "text": "def in_words number\n\n\tif number.to_s.length == 1\n\t\tif number == 0\n\t\t\treturn \"zero\"\n\t\telsif number == 1\n\t\t\treturn \"one\"\n\t\telsif number == 2\n\t\t\treturn \"two\"\n\t\telsif number == 3\n\t\t\treturn \"th...
7da9e1392b263da4e5f4ac0d8339bb18
original method worked, but renter not tied to thier rent def annual_breakdown annual_breakdown = Hash[all_renters.zip(all_annual_rents)] end
[ { "docid": "830f082de715a4dcac19b94b66257989", "score": "0.0", "text": "def all_renters\n all_renters = occupied_units.map do |unit|\n unit.renter.name\n end\n end", "title": "" } ]
[ { "docid": "29429fbd6b23da6195f680723df0178d", "score": "0.66519606", "text": "def all_renters\n # self -> @apartments\n rentals.map do |rental|\n # self -> a) rental b) person c) apt\n\n rental.person\n end\n end", "title": "" }, { "docid": "94fa44d117e1c5bceca84354caea1...
b5dea4ab923721116968afe4cc460167
Provide a default URL as a default if there hasn't been a file uploaded: def default_url For Rails 3.1+ asset pipeline compatibility: asset_path("fallback/" + [version_name, "default.png"].compact.join('_')) "/images/fallback/" + [version_name, "default.png"].compact.join('_') end Add a white list of extensions which a...
[ { "docid": "7c2df092bf966c61e878b084aa00d56c", "score": "0.0", "text": "def extension_white_list\n %w(avi AVI mov MOV mkv MKV mpg MPG mpeg MPEG mp4 MP4 m4v M4V flv FLV)\n end", "title": "" } ]
[ { "docid": "dda9f3cd47d730e2bed75e4a9b997b2b", "score": "0.776683", "text": "def default_url\n #\"/assets/fallback/\" + [version_name, \"default.jpg\"].compact.join('_')\n ActionController::Base.helpers.asset_path(\"fallback/\" + [version_name, \"default.jpg\"].compact.join('_'))\n #\"uploads/#...
e13979c7c2b98b79d0d383ddd8b46678
Locates the `operating_systems` service.
[ { "docid": "59d01e342149c3f28e7dfe9eb783d059", "score": "0.7931339", "text": "def operating_systems_service\n @operating_systems_service ||= OperatingSystemsService.new(self, 'operatingsystems')\n end", "title": "" } ]
[ { "docid": "6e599b4e332a3a181995cca00b563d5d", "score": "0.72941184", "text": "def find_operating_systems(opts = {})\n data, _status_code, _headers = find_operating_systems_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "2ccaf501b8d44171104f01b9365515ea", "sco...
9f8473abe7bdf8641e6df8fbd0a7a18b
Build a label tag (or return false, or "") based on the rules for passing nil/false/a string/an array/a hash into the options hash
[ { "docid": "ad1623982c5223077ff6d747e1810169", "score": "0.73691696", "text": "def build_label_tag(field, opts, key = :label, defaults = { :class => \"control-label\" }, &block)\n label_opts = extract_sub_options(opts, key, defaults)\n\n # False indicates complete fall-back to FormBuilder'...
[ { "docid": "e29e0fb6b0607a0fcdd455e1cc582195", "score": "0.72822744", "text": "def options_for_label(options) #:nodoc:\n options.slice(:label, :required).merge!(options.fetch(:label_html, {}))\n end", "title": "" }, { "docid": "0850901b845698f8ffca61baa6c1f46e", "score": "0.7...
249f0257e2a98562ab4c0c27c8a7fedf
DELETE /photos/1 or /photos/1.json
[ { "docid": "78fe7bc13003f95b76d8472a0bd4b052", "score": "0.0", "text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_url, notice: \"Photo was successfully destroyed.\" }\n\n end\n end", "title": "" } ]
[ { "docid": "8c44675cc38f771a77d962a50eed3bb7", "score": "0.7478701", "text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, ...
45d372c5feb95886653719ecbd155a80
Used to specify a message that you expect or allow an object to receive. The object returned by `receive` supports the same fluent interface that `should_receive` and `stub` have always supported, allowing you to constrain the arguments or number of times, and configure how the object should respond to the message.
[ { "docid": "4862c4b4ab5dde4feb535bff3f58e72a", "score": "0.57487905", "text": "def receive(method_name, &block); end", "title": "" } ]
[ { "docid": "a6c6d7d6269db9dfd8d85c787607b219", "score": "0.6223046", "text": "def should_receive(*args)\n flexmock_define_expectation(caller, *args)\n end", "title": "" }, { "docid": "29fa7e1ef11369c74e3441e288d1a43a", "score": "0.6176534", "text": "def should_receive(method_...
5131babb786be3e337d5c5b8eff12618
> "Mon", "Tue", ...
[ { "docid": "d72fd2d1da722e007f0e41e27b6ced9c", "score": "0.0", "text": "def day() @date.strftime(\"%a\") end", "title": "" } ]
[ { "docid": "25bd0ceddf1a77aa4de6f5cd8252538b", "score": "0.65006477", "text": "def weekday (wday)\n case wday\n when 0\n return \"Sunday\"\n when 1\n return \"Monday\"\n when 2\n return \"Tuesday\"\n when 3\n return \"Wednesday\"\n when 4\n return \"Thursday\"\n ...