query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
2158c14dda22de7605585fbfabd944ac
Delete an email Deletes an email and removes it from the inbox. Deleted emails cannot be recovered.
[ { "docid": "240a240942e7756dae11f1756ea80be9", "score": "0.0", "text": "def delete_email_with_http_info(email_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EmailControllerApi.delete_email ...'\n end\n # verify the required paramete...
[ { "docid": "e97728124db4c1d3cff574fbb6701209", "score": "0.77415735", "text": "def delete_email(email)\n res = @user.session.request(\"CakeMail::API::ClassList\", \"DeleteEmail\", { :email => email, :list_id => @id, \n :user_key => @user.user_key })\n end", "title": "" }, { "d...
e1e87df552ac9b327d6cb8c8e8eebb60
Appends an error to the model if mould_id is not a String
[ { "docid": "4c46a6a1886f02c3dda8a7250456c06f", "score": "0.65630996", "text": "def mould_id_is_a_string\n value_is_a_string(target: :mould_id, value: mould_id)\n end", "title": "" } ]
[ { "docid": "d251e44ba01727dc48a89ad265bb04e1", "score": "0.7152709", "text": "def id_for_error\n \"##{@id}\" unless @id.nil?\n end", "title": "" }, { "docid": "f7ed08dd363a2b6927f8a3fda10e71c0", "score": "0.6173826", "text": "def error string\n end", "title": "" ...
1a45b8467065091e137bddd86f739106
Used in the link_to_cart helper.
[ { "docid": "6ebd71da956c694ef8a88db7368e72a7", "score": "0.0", "text": "def simple_current_order\n return @simple_current_order if @simple_current_order\n\n @simple_current_order = find_order_by_token_or_user\n\n if @simple_current_order\n @simple_current_order.last...
[ { "docid": "16488e202f5139c2527d05a3eac9d6f6", "score": "0.71962047", "text": "def link_to_cart(text = 'Your cart')\n\n css_class = '' # Good as empty\n \n if @cart\n unless @cart.empty?\n text += \": (#{@cart.size}) #{number_to_currency(@cart.price)}\"\n ...
02c6400071435fdc4ce66b9c141d88cc
Return a hash description of the task.
[ { "docid": "bcf7f0ff8934169732cbc8ec3fe503c9", "score": "0.0", "text": "def to_h\n {\n id: id,\n http_request: http_request,\n schedule_time: schedule_time.to_i,\n queue: queue\n }\n end", "title": "" } ]
[ { "docid": "39cb171e5a4cba0f3cf82979445a4b85", "score": "0.74600697", "text": "def task_name\n \"#{key}: #{summary}\"\n end", "title": "" }, { "docid": "e2e9fca2c668825d66cea5244a0eb788", "score": "0.74502146", "text": "def get_description(task); end", "title": "" }, { ...
6377700a2547f6673d7a127e3d175527
PATCH/PUT /event_instances/1 PATCH/PUT /event_instances/1.json
[ { "docid": "63c9fbbba7f2b6993b02dd502e19fdda", "score": "0.67783517", "text": "def update\n respond_to do |format|\n if @event_instance.update(event_instance_params)\n format.html { redirect_to @event_instance, notice: 'Event instance was successfully updated.' }\n format.json { re...
[ { "docid": "c1e91edfe4a0b5c098fb83a06d3cccfc", "score": "0.6638242", "text": "def update\n @event.update(event_params)\n head :no_content\n end", "title": "" }, { "docid": "0050f781a1e526879347940817ef65b8", "score": "0.6588464", "text": "def update\n #TODO params -> strong...
462ada952dc55deafc8e1dd571b80926
Constructs the Answer based on passed in value and links to question
[ { "docid": "04fbb4a54cbd9b316a2881192ab2c9b3", "score": "0.59692055", "text": "def initialize(value:, question:)\n raise ArgumentError, \"Not a valid Question instance\" unless question.is_a?(Question)\n\n raise ArgumentError, \"Argument value/question mismatch\" unless question.valid_answer?(...
[ { "docid": "150e8d32c0239979711706c7ca06f700", "score": "0.72724485", "text": "def make_answer(question, questionnaire, answer_value)\n\t\tanswer = Answer.new\n\t\t# GAMBIARRA\n\t\tif answer_value[1] == \"true\"\n\t\t\tanswer.answer = true;\n\t\telse\n\t\t\tanswer.answer = false;\n\t\tend\n\t\tanswer.qu...
ede1977a2cf8ac9bbcdb41f114406a6d
DELETE /phone_services/1 DELETE /phone_services/1.json
[ { "docid": "88261a677fac4b2fcaf1f5e53aaa3bac", "score": "0.76854604", "text": "def destroy\n @phone_service.destroy\n respond_to do |format|\n format.html { redirect_to phone_services_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "a77543d77fd7af9b0499d182d6f9cc20", "score": "0.71355546", "text": "def destroy\n @phone_service_account.destroy\n respond_to do |format|\n format.html { redirect_to phone_service_accounts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { ...
739a9611bbc9d323b67fcde5e98d3aa1
def selected_models? model_items = ['model_new','model_list'] model_items.include?(item_selected) end
[ { "docid": "66f581ec1be6a41f9b308f442bde16de", "score": "0.7582719", "text": "def selected_reservations?\n model_items = ['reservation_new','reservation_list']\n model_items.include?(item_selected)\n end", "title": "" } ]
[ { "docid": "f12a39166081232b2bcc21f2e6072400", "score": "0.69903797", "text": "def selected?\n items.any?(&:selected?)\n end", "title": "" }, { "docid": "f12a39166081232b2bcc21f2e6072400", "score": "0.69903797", "text": "def selected?\n items.any?(&:selected?)\n end",...
77997966e1598eadd655fbc70a40cc98
Helper for displaying warning/notice/error flash messages
[ { "docid": "72d0329a9ed91730059b4a143f7c201b", "score": "0.0", "text": "def flash_messages(types)\n types.map{|type| content_tag(:div, \"#{flash[type]}\".html_safe, :class => type.to_s)}.join.html_safe\n end", "title": "" } ]
[ { "docid": "85a721fc708f2ae422c2b8ddb89cd209", "score": "0.82734776", "text": "def notice\n if flash[:success]\n %{<div class=\"flash\" id=\"success\">#{flash[:success]}</div>}\n elsif flash[:error]\n %{<div class=\"flash\" id=\"error\">#{flash[:error]}</div>}\n elsif flash[:warning] ...
04424ce65ea9a8de1715d1d79d2f2c45
For if the mailer has been explicitly disabled, for some reason.
[ { "docid": "794d8e29e0786809be6ca6d16d077e30", "score": "0.0", "text": "def test_should_warn_when_nil_mailer_configured\n Sinatra::Application.settings.expects(:mailer).returns(nil)\n Logging.logger[FailedJobWorker].expects(:warn)\n FailedJobWorker.new.perform({\"aardvark\" => \"horseradish\"})...
[ { "docid": "8cf35185003ec5f5d99e5f584fadba34", "score": "0.7343878", "text": "def mail_enabled\n return @mail_enabled\n end", "title": "" }, { "docid": "5afb52099dedbc4190d832f20b157b8d", "score": "0.7340108", "text": "def disabled?\n !Agent.confi...
7893c56ee49184b8293d338d3d5404ae
GET /experiements/new GET /experiements/new.json
[ { "docid": "922067e456d3b898b2f640e90677079b", "score": "0.0", "text": "def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.json { render json: @experiment }\n end\n end", "title": "" } ]
[ { "docid": "c9cee246af7fbfb295e86d7ed3a0dcfb", "score": "0.73588127", "text": "def new\n @pto = Pto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pto }\n end\n end", "title": "" }, { "docid": "87550d45e78153fa3ac66c5cc23f1e85", ...
934a448dae65a9ae4b9eb5872f7746c9
Sets the owner of a cart if none is set already Permissions Needed: SHOPPING_CARTS_ADMIN or owner
[ { "docid": "3d5f270b11d1f1dc9f950b2f9610e529", "score": "0.6037275", "text": "def set_cart_owner_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: StoreShoppingCartsApi.set_cart_owner ...\"\n end\n # verify the required...
[ { "docid": "e70c92a85bf885198198a5369c660970", "score": "0.7087371", "text": "def owner\n cart.user.id\n end", "title": "" }, { "docid": "f48dc0d74487b9232351a256e8ba7536", "score": "0.6940499", "text": "def set_cart_owner(id, opts = {})\n set_cart_owner_with_http_info(id, o...
c337f36abe094d67d07bc2c49027b555
POST /emp_requisitions POST /emp_requisitions.json
[ { "docid": "6bc97702464d61dfe0b38c0d1f893860", "score": "0.6549635", "text": "def create\n @emp_requisition = EmpRequisition.new(emp_requisition_params)\n\n respond_to do |format|\n if @emp_requisition.save\n format.html { redirect_to @emp_requisition, notice: 'Emp requisition was succ...
[ { "docid": "4d553ca290818107ae06be519500742d", "score": "0.687376", "text": "def set_emp_requisition\n @emp_requisition = EmpRequisition.find(params[:id])\n end", "title": "" }, { "docid": "9af3bee8cc4cf949b147524fbc13968d", "score": "0.6782722", "text": "def emp_requisition_...
490f0703f7da1fe667360ebdd53d922b
Construct a TestCase. Requires a description, input, and output at construction time, and the resulting TestCase is immutable.
[ { "docid": "d0e1233087e129725632fe934e517736", "score": "0.58918244", "text": "def initialize(description, input, output, language_context)\n @description = description\n @input = input\n @output = output\n @language_context = language_context\n end", "title": "" } ]
[ { "docid": "836d706255ffa3906a7400526b148901", "score": "0.5983283", "text": "def create(testcase_input)\n\t\tinput = {}\n\t\tinput[\"name\"] = testcase_input[\"name\"]\n\t\tinput[\"path\"] = testcase_input[\"className\"]\n\t\tinput[\"status\"] = testcase_input[\"status\"]\n\t\tinput[\"test_type\"] = \"...
9b4c8e8b5936160ca6c3402ae7f8b4a9
automatically follow your own Questions
[ { "docid": "03f0c52ffa41b9b532edc7ee855accc1", "score": "0.5844596", "text": "def create_follow\n user.follow_questions.create(question: self)\n end", "title": "" } ]
[ { "docid": "d223a5ec175540eee6ba0e4834b5f84a", "score": "0.6628909", "text": "def ask_questionaire\n alert_reserved_and_exit if git.reserved_branch?\n announce\n ask_title\n ask_label\n ask_pivotal_ids if config.use_pivotal_tracker\n ask_jira_ids if config.use_j...
52a4640b301c90f09f9975d57771a670
Returns true if a translation exists for a given key, otherwise returns false.
[ { "docid": "9c9485dd1a2101a6dcdca9fb37302127", "score": "0.6431996", "text": "def exists?(key, _locale = T.unsafe(nil), locale: T.unsafe(nil), **options); end", "title": "" } ]
[ { "docid": "b0c9689f066f27a9dd92f0c065188ba3", "score": "0.7618886", "text": "def key_exist?(key)\n FastGettext.key_exist?(key)\n rescue Errno::ENOENT => error\n Yast.y2warning(\"File not found when translating '#{key}' on textdomain #{@my_textdomain}'. \"\\\n \"Error: #{error}. Back...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "70eea435e5fdf4b086abe85736037469", "score": "0.0", "text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @operations = args[:operations] if args.key?(:operations)\n end", "title": "" } ]
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
612adfc0af6f07e72bc187ecef5b0556
GET /complications/1 GET /complications/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "e8e62036a8bed31a0dc0d9614e9ee9da", "score": "0.68860024", "text": "def index\n @comps = Comp.all\n\n render json: @comps\n end", "title": "" }, { "docid": "9545db099fceabe55d8dc5e8e600a91e", "score": "0.6833636", "text": "def index\n @complications = Complicatio...
ec66d9d0484e3073aa513f1ad8f9bc14
reset_password_period_valid? defined in Devise::Models::Recoverable
[ { "docid": "1c15fcf869cafc0f8d3097281885ff97", "score": "0.79147285", "text": "def password_reset_pending?\n reset_password_token.present? && reset_password_period_valid?\n end", "title": "" } ]
[ { "docid": "086f0a7c022542d1891048fb45e58ed8", "score": "0.8502277", "text": "def reset_password_period_valid?\n reset_password_sent_at && reset_password_sent_at.utc >= self.class.reset_password_within.ago.utc\n end", "title": "" }, { "docid": "ae30a23f93def5d35681c45490590a29", ...
72d7ae98c71f89d88a8827634b2d9da0
Fetch admin kyc action logs. Author: Alpesh Date: 21/10/2017 Reviewed By: Sunil
[ { "docid": "4f37c9feb6abfab7234476573b084784", "score": "0.8098631", "text": "def kyc_action_logs\n service_response = AdminManagement::Kyc::FetchActionLogs.new(params).perform\n render_api_response(service_response)\n end", "title": "" } ]
[ { "docid": "444626d3671ba1829f4ea6466a3b9296", "score": "0.6699562", "text": "def log_admin_action\n BgJob.enqueue(\n UserActivityLogJob,\n {\n client_id: @client_id,\n user_id: @user_kyc_detail.user_id,\n case_id: @ca...
7dfbf6868f9a305f9be8cbd2fa3c21e8
Subclasses should implement this classlevel method.
[ { "docid": "35690024d67e51252d72f01d21390815", "score": "0.0", "text": "def request(resource, request_type, params)\n api_params = process_params(params)\n response = nil\n time = Benchmark.measure do\n response = resource.send(request_type.to_sym, { query: api_params })\n end...
[ { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.69645613", "text": "def override; end", "title": "" }, { "docid": "003f93545faf95741b6daf49b5599d9c", "score": "0.67313945", "text": "def _self; end", "title": "" }, { "docid": "7d3206fdee515addbaa426dffb5132aa", ...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "aa7e7066bab084a6ba42d502bdb43d3f", "score": "0.0", "text": "def rugby_world_cup_host_country_params\n params.require(:rugby_world_cup_host_country).permit(:name, :total_attendance, :matches, :stadium_capacity, :held_at)\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...
6d645300a8fd3483dae4d72195dc989f
Determine if the hash has the given key or alias ==== Parameters key:: The key or alias to look up ==== Returns TrueClass:: True of False
[ { "docid": "d4a3576b7fd0d8f8c6fd8c787b994d97", "score": "0.7984299", "text": "def has_key?(key)\n #if the key is an alias, lookup the real key\n key = aliasing_hash_aliases[key] if aliasing_hash_aliases.include?(key)\n \n super\n end", "title": "" } ]
[ { "docid": "b7a213ad8f771c28372148bcf0d87f14", "score": "0.7686659", "text": "def has_key?(key); end", "title": "" }, { "docid": "b7a213ad8f771c28372148bcf0d87f14", "score": "0.7686659", "text": "def has_key?(key); end", "title": "" }, { "docid": "64d20666593cdfe9e4da89ee...
8d388b7b06302801fb7ba639eb5e1449
there are various object types which can be the only result. This method handles redirecting to all of them
[ { "docid": "52dd9ba8a18f3bf6f82a72f3377b2d9b", "score": "0.65934616", "text": "def redirect_to_page(result, options={})\n modified_params = options[:params].dup\n modified_params.delete(:type) if modified_params[:type] == ['all']\n modified_params.delete(:sort_by) if modified_params[:sort_by] =...
[ { "docid": "3ff358a5c25b3379e7bf6f73fe7cd822", "score": "0.65815425", "text": "def redirect_to_page(result_set, options={})\n if options[:more_results]\n modified_params = options[:params].dup\n modified_params.delete(:type) if params[:type] == ['all']\n modified_params.delete(:sort_by...
6f886502b0858ad90a465984c76632b9
4) rj = ~rk
[ { "docid": "8099ff2eb6f5e02c8dcbe61f19278dd7", "score": "0.0", "text": "def prod4(match)\n set_label(match[:label])\n lhs_ix = match[:lhs_ix].to_i\n rhs_ix = match[:rhs_ix].to_i\n check_valid_reg_ix(lhs_ix)\n check_valid_reg_ix(rhs_ix)\n add_instruction(match[:op], nil, lhs_ix, rhs_ix,...
[ { "docid": "5b305b04f81c7870a67f672de2e68e3f", "score": "0.56638044", "text": "def josephus_survivor_rm(n, k)\n n == 1 ? 1 : (josephus_survivor_rm(n - 1, k) + k - 1) % n + 1\nend", "title": "" }, { "docid": "8eccc24a735e2300a7cd20a02c963db6", "score": "0.56620634", "text": "def sk! ...
4577502f487b211846c762ba21a63c7a
validates_exclusion_of :search_engine, :in => [ SEARCH_ENGINE_OFFICIAL, SEARCH_ENGINE_YATS ]
[ { "docid": "8bb7f327abc8bdf3edc070696884704a", "score": "0.0", "text": "def build_all\n build_extract_users\n build_query\n end", "title": "" } ]
[ { "docid": "ae15ba612498f261040fb13347f0bdf5", "score": "0.69424653", "text": "def search_exclusions\n config[\"search_strings\"][\"exclusions\"]\n end", "title": "" }, { "docid": "f678d65b9e2d5d7d1ab66d59408377dc", "score": "0.63309133", "text": "def allowed_types\n [Search...
edff93559b711689c4a4ccd9656c728f
Mail containing the link of a lesson
[ { "docid": "e0d40569dffc7752d62730793d75c4db", "score": "0.74599296", "text": "def see_my_lesson(emails, sender, lesson, message)\n @sender = sender\n @message = message\n @lesson_link = sender.id == lesson.user_id ? lesson_viewer_url(lesson.id, token: lesson.token) : lesson_viewer_url(lesson.i...
[ { "docid": "3986c2acb6393c07a0fa92feff9bfef3", "score": "0.76761705", "text": "def send_link\n if current_user.trial?\n render :nothing => true\n return\n end\n if @ok\n UserMailer.see_my_lesson(@emails, current_user, @lesson, @message).deliver\n string_emails = ''\n @e...
28a0c88817e60681aec18dc93858b9bf
check if user is logged in?
[ { "docid": "bed1f345c0fcf96148491abe4f0b27a6", "score": "0.0", "text": "def logged_in?\n !!session[:user]\n end", "title": "" } ]
[ { "docid": "5e8797ab67adadcb571fb446716121fe", "score": "0.88964415", "text": "def userIsLoggedIn()\n user = getUser()\n if user != nil\n true\n else\n false\n end\n end", "title": "" }, { "docid": "22ba2a6c1fd641fead2b88113346f450", "score": "0.8674219", "text...
a0a87d5c9637d62fea82f24ac9a0524d
DELETE /parsers/1 DELETE /parsers/1.json
[ { "docid": "62dabed1f36eb362cf09fcb60d7ba33a", "score": "0.68527734", "text": "def destroy\n @parser.destroy\n respond_to do |format|\n format.html { redirect_to parsers_url, notice: 'Parser was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": ...
[ { "docid": "d74c3713050af73f4d74f57cb2f15c6b", "score": "0.7210981", "text": "def destroy\n @parser.destroy\n respond_to do |format|\n format.html { redirect_to parsers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "07f45367f4e6df716fe6b...
7e045141c2713a8d099e2795eb575e67
loop until don't have nil in row1
[ { "docid": "a222ab0c6e396e17549c3c4ba425a5c4", "score": "0.6949903", "text": "def row1_dup_nil(row)\n if (row.any? {|item| item.nil?})\n row = dup_nil(row)\n row1_dup_nil(row)\n else\n row\n end\n end", "title": "" } ]
[ { "docid": "5bd8a994b40b38d616578f8e51ea1598", "score": "0.6505076", "text": "def check_rows\n\t\t@grid.each do |row|\n\t\t\tunless(row.include?(nil))\n\t\t\t\tif(row.uniq.length == 1)\n\t\t\t\t\treturn row.uniq.first\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\treturn nil\n\tend", "title": "" }, { ...
d0d1b47a0c04212208b3e310de05b6aa
DELETE /changes/1 DELETE /changes/1.json
[ { "docid": "6bd1ed101009738de97b2ae1fab5b685", "score": "0.7088201", "text": "def destroy\n @change.destroy\n respond_to do |format|\n format.html { redirect_to changes_url, notice: 'Change was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "...
[ { "docid": "16926d0a968ef848c0e3f7f0f5b56547", "score": "0.7384417", "text": "def destroy\n @change.destroy\n respond_to do |format|\n format.html { redirect_to changes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f7927652e45adba485c8a...
ce027768cb62401f83a562ad6382ca84
Return the class, separator ('.' or ''), and method name for the given method.
[ { "docid": "cef3ecf6142d16d50c9ff2401c32f861", "score": "0.64827573", "text": "def qualify_method_name(method)\n if method.owner.singleton_class?\n class_name = singleton_method_owner_name(method)\n [ class_name, '.', method.name ]\n else\n [ method.owner.name, '...
[ { "docid": "4b883cc85cf20017db1992aa5a13df87", "score": "0.7628874", "text": "def method_name\n @method.to_s.split('/').last.to_s\n end", "title": "" }, { "docid": "4fcbcc8a0c43647bf12229903dedaa0f", "score": "0.7568552", "text": "def calc_full_method_name(class_name, met...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "06e70198cd86d39b7b7278a4094d3812", "score": "0.0", "text": "def update!(**args)\n @kind = args[:kind] if args.key?(:kind)\n @metadata = args[:metadata] if args.key?(:metadata)\n @origination = args[:origination] if args.key?(:origination)\n @time_provided ...
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
3ec33028175e7ca0096b7438f66e3fdd
=begin :type x: Integer :rtype: Void =end
[ { "docid": "99fdf03acd384ef6d471c62395084b48", "score": "0.0", "text": "def push(x)\n @arr.push(x)\n end", "title": "" } ]
[ { "docid": "319844747af69d9b07ea6b54b97db82d", "score": "0.67966765", "text": "def x\n @x ||= 0\n end", "title": "" }, { "docid": "319844747af69d9b07ea6b54b97db82d", "score": "0.67966765", "text": "def x\n @x ||= 0\n end", "title": "" }, { "docid": "d216b3...
d158752dd336e987555e01cc1d44299c
Returns the slot's DB id
[ { "docid": "067b9752a1717ae4b35dc0af322fd455", "score": "0.89453167", "text": "def slot_id\n Slot.first(name: @slot).db_id\n end", "title": "" } ]
[ { "docid": "5c414ecaca6e0714b9c547c88c494bca", "score": "0.70794123", "text": "def db_inst_id\n \"#{id}\"\n end", "title": "" }, { "docid": "ae51e38fa5a676681e39d9a07848800c", "score": "0.6925565", "text": "def ret_db_id\n IDInfoTable.db_id_from_guid(IDInfoTable.ret_guid_f...
bc27d997bdddbe2b4dd7d50086d51ca3
Returns the first Song that matches +name+. +name+ may be either a Regexp or a String. The match will be made caseinsensitive.
[ { "docid": "f878d3b3cdcf5e66495fdf7fb023e8c3", "score": "0.74465644", "text": "def find(name_regex)\n name_regex = Regexp.new(name_regex.to_s, true) # make case-insensitive\n @songs.detect { |s| s.name =~ name_regex }\n end", "title": "" } ]
[ { "docid": "5f805b181286f098293803564a572ecb", "score": "0.703546", "text": "def find_with_name(name)\n name = name.to_s.titleize\n find_by_name(name)\n end", "title": "" }, { "docid": "8e454821f24063a984609789881afd1f", "score": "0.7009479", "text": "def find(name...
dd886ea88e7d2ab64c8ad56966f9d6c5
generating the time Stamp, with 15 min interval For Example: time_interval(20) current Time: 20170426 10:45:05 0700 Return: 20170426 11:05:00 0700
[ { "docid": "2dc8923d8e8644c8dcba1f547b3622ab", "score": "0.7182662", "text": "def time_interval(inter_val_num)\n\n require 'rubygems'\n require 'active_support'\n require 'active_support/time'\n inter_val_num = 20\n cur_time = Time.now\n comp_time = cur_time - cur_time.sec - cur_time.min%15*60\n ...
[ { "docid": "a4fa8c611d555c1f44fa1ab7b1e8a881", "score": "0.66847736", "text": "def ux_topaz_time_range( student, interval_num)\n # multiplier is minutes per interval\n multiplier = student.session_interval\n\n start_time = Time.parse( '8:00') + (interval_num-1) * multiplier.minutes\n end_tim...
0eece8d14feac62981ef1fbdeea0231c
validates :artist, presence: true validates :start_date, presence: true Find a hubspot contact by it's email
[ { "docid": "b80bb8f3689d87617f88b855cdb8b79a", "score": "0.54961705", "text": "def hubspot_contact(email)\n Hubspot::Contact.find_by_email email\n end", "title": "" } ]
[ { "docid": "36004cca0f2f9f6b18b5d98e61090f5e", "score": "0.597856", "text": "def valid_email_for_solr\n valid_email? ? 1 : 0\n end", "title": "" }, { "docid": "2b4517fe4d09f3bddeba26f33147e964", "score": "0.59703475", "text": "def index\n if (params[:artist_email])\n @art...
878df2a1954492eaf52694d797b9eda0
Produces a relative path from two absolute paths. If the destination is not a direct subclass of the source then a relative path will be returned.
[ { "docid": "b6d4bf4ba64f1747a19ca43c56fa3375", "score": "0.6371104", "text": "def make_relative! from, to\r\n make_relative from, to, true\r\n end", "title": "" } ]
[ { "docid": "3abbe33f84d22048e0bdd3a7b0bd4428", "score": "0.7298172", "text": "def relative_path_from(other)\n a = @path.split(SEPARATOR_PAT)\n b = other.path.split(SEPARATOR_PAT)\n while a.first && b.first && Pathname.pathequal(a.first, b.first)\n a.shift\n b.shift\n en...
9047d418d27cd9a5e46f37f52f9b9e50
Bsearch find middle element of the array check if the num is greater than or less than the middle element check the side that the num is on.
[ { "docid": "c51f3fda5400350181db7eda4dd4137a", "score": "0.8300877", "text": "def bsearch(array, num)\n return nil if array == []\n\n mid_element = array.length / 2\n\n if array[mid_element] == num\n return mid_element\n elsif array[mid_element] > num\n calls = bsearch(array[0...mid_element],...
[ { "docid": "412102176cc4ea6d38c317622a8bcda4", "score": "0.8695169", "text": "def bsearch(arr, num)\n probe_index = arr.size/2\n mid_ele = arr[middle_index]\n return nil if mid_ele != num && arr.size == 1\n return middle_index if mid_ele == num\n\n if num > mid_ele\n searched_half ...
1b7b21bf2909f95a27b0ae5d0acc620b
Informs user of successful order and total order price
[ { "docid": "66294dc36ebb39843f114ab1ef33f498", "score": "0.0", "text": "def finalize_order(drink_instance)\n system \"clear\"\n nailed_it_graphic\n if @order_array.count == 1\n if drink_instance.is_menu_item?\n puts \"You have successfully ordered a #{drink_instance.name} for ...
[ { "docid": "1bcab7ff6f45e794beebfe47071efd1f", "score": "0.6986735", "text": "def total\n render_success(Order.total_price)\n end", "title": "" }, { "docid": "5bb70fe6fb1c0d9529721fb1d04a7564", "score": "0.68748397", "text": "def pay\n total = 0\n @order.order_items.each do...
a6bbc932c6eacceecc330ab7295baea9
writes file name and web address to a data file.
[ { "docid": "91f45a1842d466ab85f747a3332c5c2f", "score": "0.0", "text": "def filemap_out(page, num, dir, datafile)\n datafile.puts(num.to_s + \".html - \" + page.uri.to_s)\nend", "title": "" } ]
[ { "docid": "4b8ef12ec89caf230351e2ceda3e66b7", "score": "0.73803", "text": "def writeFile name, data\n end", "title": "" }, { "docid": "f4597bb8e96f3c48950071c7dc017ea0", "score": "0.7021342", "text": "def write_to_file(file_name, data)\n debug \"Writing content to the file: '#{f...
c988473d568649aba872b88ca21b0474
should return the recipe most recently added to the user's cookbook
[ { "docid": "db7362c89810edbd9170f4d9cac9c514", "score": "0.7429258", "text": "def most_recent_recipe\n\t\trecipes.sort { |recipe| recipe.date }.first\n\tend", "title": "" } ]
[ { "docid": "2be968b22b29d8eb09dadc523a117a6b", "score": "0.89574003", "text": "def most_recent_recipe\n recipes.last\n # should return the recipe most recently added to the user's cookbook.\n end", "title": "" }, { "docid": "fd7a7e4e4f9f26c3696b896c36e427f8", "score": "0.7564423",...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "3ab90f84bdcac3aa1c12a6355ecfeccf", "score": "0.0", "text": "def update!(**args)\n @application_date = args[:application_date] if args.key?(:application_date)\n @content_language = args[:content_language] if args.key?(:content_language)\n @doc_type = args[:doc_type]...
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
4a0b8e51c9e890b5babfdbce975321af
Returns the powerset of the Enumerable Example: [1,2].powerset => [[], [1], [2], [1, 2]]
[ { "docid": "b28057bb0c5a332423ffee00721a58f2", "score": "0.8084247", "text": "def powerset\n return to_enum(:powerset) unless block_given?\n a = to_a\n (0...2**a.size).each do |bitmask|\n # the bit pattern of the numbers from 0..2^(elements)-1 can be used to select the elements of the set....
[ { "docid": "f1034a61c5f44f422864197bd29927b2", "score": "0.8277323", "text": "def powerset(set)\r\n return [set] if set.empty?\r\n\r\n item = set.pop\r\n subset = powerset(set) \r\n subset | subset.map { |x| x | [item] }\r\nend", "title": "" }, { "docid": "dd6a5bd6cc56c4eccb1ac4cf1e9d9b...
994b8c088c61fccd311f55bc004a2e66
Borrow and take ownership of a persistent connection. If a new connection is created, it will be started prior to being returned.
[ { "docid": "38ecff937e19fedaf2f8efbdc1d4cb40", "score": "0.0", "text": "def borrow(site, verifier)\n @pool[site] = active_entries(site)\n index = @pool[site].index do |entry|\n (verifier.nil? && entry.verifier.nil?) ||\n (!verifier.nil? && verifier.reusable?(entry.verifier))\n end\n...
[ { "docid": "6476517ef8e29c046509d8b64c905b9b", "score": "0.6623794", "text": "def establish_connection\n @conn = build_connection\n end", "title": "" }, { "docid": "79d97e29c4399a5511938df562e07d8d", "score": "0.6621012", "text": "def private_acquire_connection\n @conn...
3f375a16042a34ca78947cb08c84f7f0
An array for optional fields
[ { "docid": "7b73ac7743509e255ae5dd809b4442e3", "score": "0.0", "text": "def optionals\r\n %w[\r\n text\r\n media\r\n tag\r\n priority\r\n expiration\r\n ]\r\n end", "title": "" } ]
[ { "docid": "969ec71b35b5feff26a9f0b5a77ddab9", "score": "0.7634312", "text": "def _optional\n @optional & [*@opts[:extra_fields]].map(&:to_sym)\n end", "title": "" }, { "docid": "697ac394e2ec62bf82ea57c34bddb13f", "score": "0.7435686", "text": "def required_fields\n []\n ...
8315a21213c5ec4740200e29650a00c6
TODO: Make app checkout work with admin checkout workflow
[ { "docid": "187912d9ff0da6a3e2aed873c9336bd4", "score": "0.70752287", "text": "def app_checkout\n @order = Order.find(params[:id])\n\n (EffectiveOrders.authorized?(self, :update, @order) rescue false)\n\n checkout = EffectiveOrders.app_checkout[:service].call(order: @order)\n ...
[ { "docid": "b9ba4e674220aa145e79313c46f78f3e", "score": "0.785718", "text": "def checkout\n end", "title": "" }, { "docid": "487eee20d33ada58080f98a81e2e1d4a", "score": "0.75909585", "text": "def checkout\n\tend", "title": "" }, { "docid": "3f648251b7ccbd0c5a6ce1031dedb3...
c55e37ea6db1831c3ec7a74bd1cf4f10
POST /nodes POST /nodes.json
[ { "docid": "4e3319672764c487f7f15807ddcdeb83", "score": "0.61168474", "text": "def create\n @node = Node.new(params[:node])\n @node.creator = current_user\n\n respond_to do |format|\n if @node.save\n if params[:topic_id]\n @node.topic_node_memberships.create!(:topic_id => p...
[ { "docid": "3c9c6c785cb17cdede9ccddca90e20b1", "score": "0.7448032", "text": "def method_missing(method, *args, &block)\n data = { method: method, parameters: args }\n request.post(path: nodes_path, data: data, auth_token: auth_token)\n end", "title": "" }, { "docid": "12ae9f550...
2ce6f38307d60770098f767887496672
method that takes in the values and then prints & returns them
[ { "docid": "ff89c418ac0f132f481ef53949834354", "score": "0.0", "text": "def name_swap(real_name)\n\tnew_name = name_handler(real_name)\n puts new_name\n return new_name\nend", "title": "" } ]
[ { "docid": "84c15678642d900bf50b7d3cafe00c8e", "score": "0.7335237", "text": "def print_info\n self.values.each do |value|\n puts value\n end\n end", "title": "" }, { "docid": "02d127a26619d54d30626e14a8c7c611", "score": "0.7319027", "text": "def print_items\n re...
14fbee302587c77e8acd3735e1decc34
An object representing the current response.
[ { "docid": "016243dcb40af9330651330776e1f884", "score": "0.73120904", "text": "def response\n @response ||= Response.new\n end", "title": "" } ]
[ { "docid": "34e0acdb16cfbacb7e38da34ac157009", "score": "0.76344264", "text": "def __getobj__\n @response\n end", "title": "" }, { "docid": "4a6f331a9c619ea18a3c97d1e1361ead", "score": "0.76145905", "text": "def response\n @_response\n end", "title": "" }, ...
b1989801f6c90ac163d1859c1a5e30df
PUT /costan PUT /costan.xml
[ { "docid": "bb86570b0faace9a2accb3ce6d22d00e", "score": "0.0", "text": "def update\n respond_to do |format|\n if @profile.update_attributes profile_params\n format.html { redirect_to(@profile, notice: 'Profile was successfully updated.') }\n format.xml { head :ok }\n else\n ...
[ { "docid": "c2c0b673628fdc28b181d18c0afd2d5b", "score": "0.63598377", "text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "title": "" }, { "docid": "b1bd6f7ba194cdd14ecbfb5cd0c1b1b7", "score": "0.61...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b464b1978cc50f8693fd60c7dc14f9dc", "score": "0.0", "text": "def set_inquiry\n @inquiry = Inquiry.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60322535", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6012846", "text": "de...
0f3ca037f0f88b13e8a4fa19b2e811a6
Stringupcase! is a destructive method, so why does this code print HEY you instead of HEY YOU? Modify the code so that it produces the expected output.
[ { "docid": "a42066ad1f4eb384c0d20a3ab78b2b19", "score": "0.0", "text": "def shout_out_to(name)\n name.chars.each { |c| c.upcase! }\n\n puts 'HEY ' + name\nend", "title": "" } ]
[ { "docid": "e857aed4e063c4abd5ee26779d0830f0", "score": "0.7990933", "text": "def upcase!() end", "title": "" }, { "docid": "34378d975ad6aeda57a7cf516f20989d", "score": "0.79601496", "text": "def shout(str); str.upcase end", "title": "" }, { "docid": "df9cda9f6a0abf2f9a28...
0b9fce8697e6edb00fc7214e3a26c1f8
Si no esta encarcelado para el alquiler
[ { "docid": "0f3ab7ab7cdd4720b36786ad8d4577b8", "score": "0.6007017", "text": "def paga_alquiler(cantidad)\n if @encarcelado\n return false\n else \n paga(cantidad) \n end \n end", "title": "" } ]
[ { "docid": "402d60ce0d47d90a6eeb224b666e985c", "score": "0.60422415", "text": "def if\n end", "title": "" }, { "docid": "5c1068b72fca0fb0934f5f6bc3795870", "score": "0.60089684", "text": "def iniciar_sesion\n\t\t@esta_logueado = true\n\tend", "title": "" }, { "docid"...
59cc7b3704267d59cab26e0d2a6fb233
PATCH/PUT /libraries/1 PATCH/PUT /libraries/1.json
[ { "docid": "c3cd148a7929bf9507ecc8565d30bb75", "score": "0.6048139", "text": "def update\n respond_to do |format|\n if @library.update(library_params)\n format.html { redirect_to @library, notice: 'Library was successfully updated.' }\n format.json { head :no_content }\n else\...
[ { "docid": "fa16209f5ac39ae638cdf45c17fd5f18", "score": "0.66559386", "text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end", "title": "" }, { "docid": "fa16209f5ac39ae638cdf45c17fd5f18", "score": "0.66559386", "t...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "7a2d4bd130de335171ef42b1da6bd9e7", "score": "0.0", "text": "def set_jogging_log\n @jogging_log = JoggingLog.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...
c82562152d18a4f8291136676459363c
Set the value of the SessionToken input for this Choreo.
[ { "docid": "c5c16b2614491b42b0f6e01d51fb6b29", "score": "0.7176745", "text": "def set_SessionToken(value)\n set_input(\"SessionToken\", value)\n end", "title": "" } ]
[ { "docid": "38a1e84d3c38d22821bb24ea572fa437", "score": "0.64960337", "text": "def set_session_token!\n @session[session_key] = password_token\n end", "title": "" }, { "docid": "61a94446b0ee4b80b66f67a65345136c", "score": "0.61645293", "text": "def set_session_token\n self.ses...
abebdbd8d863e21944745c917db390c3
modified from kheer: app/data_exporters/save_data_for_cellroti_export.rb
[ { "docid": "b8fe8b5e43a2b76ee0c7bd2542e44e91", "score": "0.0", "text": "def createLocalizationData(outputFile, numOfFrames)\n\t\t\tFileUtils::rm_rf(outputFile)\n\n\t\t\t# Note: Cellroti ingests this line-by-line assuming each line is valid JSON\n\t\t\t# Also note that localizations are assumed to be ord...
[ { "docid": "731e7e4cb7ff12bca93023bab7780159", "score": "0.6888516", "text": "def export_data(collection, timepoint, method='od')\n if method.include? 'cal'\n filename = \"jid_#{jid}_item_#{collection.id}_#{todays_date}_#{method}\"\n else\n filename = \"jid_#{jid}_ite...
c4a22bfe774e2b122bcf5f09d9ff41dc
GET /incoming_service_taxes/1 GET /incoming_service_taxes/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "f3cd11d5fb5c9ad94ca4b6d89f082e2a", "score": "0.7426506", "text": "def get_all_taxes\n self.class.get(\"/aldebaran-taxes/v2/taxes\", :basic_auth => @auth)\n end", "title": "" }, { "docid": "0420771985665fbd270e62b7c9c77870", "score": "0.717339", "text": "def get_taxes_...
6da71494fb979f5b43f652f181737394
DELETE /statuses/1 DELETE /statuses/1.json
[ { "docid": "881ed97c855e0816826d9872e6e2a690", "score": "0.71055555", "text": "def destroy\n @status = current_user.statuses.find(params[:id])\n @status.destroy\n\n respond_to do |format|\n format.html { redirect_to filmy_url, notice: 'Usunięto film z listy.' }\n format.json { head :n...
[ { "docid": "d95d0b2ba25bc660df76d6a3f914ea1b", "score": "0.7985862", "text": "def status_destroy(id)\n post(\"/statuses/destroy/#{id}.json\")\n end", "title": "" }, { "docid": "1f16cdc82f0053a2ffd04a714a00fa26", "score": "0.7628132", "text": "def delete_status(status_id)\n ...
b0fcfeddb40b740deb3701d94f07919c
has_many :dependent_anomalies, class_name: "DependentAnomaly", primary_key: "ssn"
[ { "docid": "cb5f214f4b440df52782b664d555e68a", "score": "0.0", "text": "def name\n \"#{first_name} #{last_name}\"\n end", "title": "" } ]
[ { "docid": "5d0ecaab86546ab9a3d09f23aa158104", "score": "0.5941182", "text": "def dependent\n employee.dependents.where(ssn: dependent_ssn).first\n end", "title": "" }, { "docid": "3458a71aaec781f30787622dca003bde", "score": "0.5878886", "text": "def association_key_name; end", ...
d8a3655a682f3886b55c3e700a84dec3
Return string with verbose print of result.
[ { "docid": "42c3d463da6e4b6784ee30c6bd2a0947", "score": "0.0", "text": "def verbose_result\n \"#{@name} yielded password '#{@password}'\"\n end", "title": "" } ]
[ { "docid": "a81de9aa2fd3081d27140ad344eed18c", "score": "0.7323889", "text": "def vprint(string)\n if @options[:verbose]\n print string\n end\nend", "title": "" }, { "docid": "910cb17fe51272878aa3670657dbe3d5", "score": "0.72925097", "text": "def verbose(string_to_output)\n put...
d868a9ca108c34b5ce09badaa0e15c90
POST /special_instructions POST /special_instructions.json
[ { "docid": "97f12d1c0ef165a1183fb8bafe4d0683", "score": "0.6995141", "text": "def create\n @special_instruction = SpecialInstruction.new(params[:special_instruction])\n\n respond_to do |format|\n if @special_instruction.save\n format.html { redirect_to @special_instruction, notice: 'Sp...
[ { "docid": "1355e5bf0f24bab4c3757ccd4268a8d9", "score": "0.6271048", "text": "def new\n @special_instruction = SpecialInstruction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @special_instruction }\n end\n end", "title": "" }, { ...
984160b200a0b8c102d5c4e3f7f05399
POST /parks POST /parks.json
[ { "docid": "2fe4b9084ba76f6d9f065257f097453c", "score": "0.62655866", "text": "def create\n @park = Park.create!(park_params)\n json_response(@park, :created)\n end", "title": "" } ]
[ { "docid": "d60c1937ab62a8c6c507ed7ec130a3c2", "score": "0.6116405", "text": "def create\n @park = Park.new(params[:park])\n\n if @park.save\n render json: @park, status: :created, location: @park\n else\n render json: @park.errors, status: :unprocessable_entity\n ...
df58cecd407a2ffaa74b7f0c0b440915
Returns an ingress endpoint (ELB enpoint)
[ { "docid": "9107ca5ec8de3e75c493ceb68f04bad1", "score": "0.7527423", "text": "def get_ingress_endpoint(namespace, ingress_name)\n stdout, _, _ = execute(\"kubectl get ingress #{ingress_name} -n #{namespace} -o json -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'\")\n stdout\nend", "title"...
[ { "docid": "9ff2fcad2d2bfbd3254270a6386488e5", "score": "0.62284917", "text": "def ipn_endpoint; end", "title": "" }, { "docid": "9ff2fcad2d2bfbd3254270a6386488e5", "score": "0.62284917", "text": "def ipn_endpoint; end", "title": "" }, { "docid": "853d20eab436db60ac0a0295...
620931acfd1a89a00e1482378541e55f
Outputs nonarray value in the form of hash For object, use to_hash. Otherwise, just return the value
[ { "docid": "7cf6853d057278cc9b49eba79367fea4", "score": "0.5905827", "text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map{ |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n ...
[ { "docid": "a34f3dad821ba9744bc8d807b65489ad", "score": "0.67211187", "text": "def hash\n [value].hash\n end", "title": "" }, { "docid": "a34f3dad821ba9744bc8d807b65489ad", "score": "0.67211187", "text": "def hash\n [value].hash\n end", "title": "" }, { "d...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "b960e7319d4f9b14603cc86f68697d4a", "score": "0.0", "text": "def pokemon_params\n params.require(:pokemon).permit(:name, :type1, :type2, :parent, :evolution_method, :sprite, :sprite_shiny, :hp, :attack, :defense, :sp_attack, :sp_defense, :speed, :generation_id)\n end", "title": ""...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
108bfc4459ee0034f39528aa8b92045f
Sets the style of the range.
[ { "docid": "bd1c79ea0ab760cb7ca122233aaa5282", "score": "0.0", "text": "def cells_ranges_post_worksheet_cells_range_style_with_http_info(name, sheet_name, opts = {})\n warn \"Warning: #cells_ranges_post_worksheet_cells_range_style_with_http_info() is deprecated.\"\n if @api_client.config.debug...
[ { "docid": "ca5502732d1e511e6784d33e41d95072", "score": "0.7424748", "text": "def style=(value)\n @style = value\n end", "title": "" }, { "docid": "583709e645cedf13eff797fd912d151d", "score": "0.7353821", "text": "def style=(value)\n @style = Vedeu::S...
d5a8a1d75aca38462b4215eb8ec15f3d
TODO: user or delete
[ { "docid": "c7b0140480d204fcfe1dabe55cf57e6a", "score": "0.0", "text": "def action\n if action_name == 'advanced_search'\n :post\n else\n :get\n end\n end", "title": "" } ]
[ { "docid": "79f6c1dc625b7028742c1da69decc7cf", "score": "0.6765517", "text": "def delete\n \n end", "title": "" }, { "docid": "1bdafdf7501ddcf11548064240fd82a9", "score": "0.63182175", "text": "def delete\n\n\tend", "title": "" }, { "docid": "a860d99cfb28f6db953...
959085ea2837cfe20314542c0f907562
Sum of two points
[ { "docid": "2ed1410757756a1c49dd05076ebbb37f", "score": "0.63061565", "text": "def bbpAdd(first_point, second_point)\n bbp(first_point.x + second_point.x, first_point.y + second_point.y)\n end", "title": "" } ]
[ { "docid": "bdc6b2af9262a52ea3b65dbf32fff61e", "score": "0.73952127", "text": "def add( point1, point2 )\n\n\treturn point1.dup if point2 == @INFINITY\n\treturn point2.dup if point1 == @INFINITY\n\n\tif point1[0] == point2[0] \n\t\tif point1[1] + point2[1] % @p == 0\n\t\t\treturn @INFINITY.dup\n\t\telse...
a2e7cd9cc46d79c27b8a7e08064c33e5
Given data and a file name, store the data in JSON format into Redis
[ { "docid": "7bbf09d441e76199c2f625baf151ef09", "score": "0.77308786", "text": "def store(filename, data)\n @file_name = filename\n @data = data\n\n redis = Redis::Client.build\n\n # Save data and set to expire this data after an hour\n redis.set(key(@file_name), data.to_json, (6...
[ { "docid": "aed22dc5c449d0eb9fbee9fff9733eae", "score": "0.70135766", "text": "def save(data)\n\t\t\tfail 'Data must be JSON formatted' unless json_format?(data)\n\t\t\tredis.lpush key, data\n\t\tend", "title": "" }, { "docid": "78767207dbec2355f0c50ee42e65deaa", "score": "0.6899317", ...
00b4d010c5dcd795cc32783c4d64f953
Change between the two images to walk down
[ { "docid": "1be0efc1ca96b7933259ebcbafc3e62a", "score": "0.0", "text": "def walk(&block)\n if @walk_cnt > 10\n yield\n @walk_cnt = 0\n else\n @walk_cnt += 1\n end\n end", "title": "" } ]
[ { "docid": "c00e8d861081a93fd71865b060268c96", "score": "0.79346347", "text": "def walk_down\n @walk_cnt = 11 if @image == @images[2] or @image == @images[3] # Turn straight away\n walk { @image = (@image == @images[0])? @images[1] : @images[0] }\n end", "title": "" }, { "docid": "95e...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "bb9b7afa5def3bad2cc954cb6f6bf299", "score": "0.0", "text": "def update!(**args)\n @devices = args[:devices] if args.key?(:devices)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end", "title": "" } ]
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
d4308fb8f51faa3011bef1ce4c3d40c9
% clear_bit! : (!FIXME) > !FIXME
[ { "docid": "3046ec6f89c5c08e07a25dc3640b7404", "score": "0.9007196", "text": "def clear_bit!(p0) end", "title": "" } ]
[ { "docid": "856639f336879c7bb650ab2cdb3cb6fb", "score": "0.93154985", "text": "def clear(bit)\n end", "title": "" }, { "docid": "5bbfff7f56be618eaec87a46efaf81f2", "score": "0.82528925", "text": "def clear_bit num, position\n mask = ~(1 << position)\n render_binary(num & mask, 5...
be7b5055d5d30fd66c4e35064feef6a7
Used by active model serializers to configure the resopnse
[ { "docid": "8915cb40eb5ffa69b285a53b569dc243", "score": "0.60122895", "text": "def default_serializer_options\n {root: false}\n end", "title": "" } ]
[ { "docid": "250b0efcbc313a0267d36fe3348f41dc", "score": "0.6606824", "text": "def cassette_serializers; end", "title": "" }, { "docid": "15f6af6f1deb2a317c1a6bc8f273ed7c", "score": "0.65703976", "text": "def custom_serializer_opts\n {}\n end", "title": "" }, { "docid"...
197da8a665460f2e29d8915189d6bf93
Use in API to parse incoming article requests
[ { "docid": "fce12e846be794e37fdf9b17ed188043", "score": "0.63696533", "text": "def call\n articles = JSON.parse(Base64.urlsafe_decode64(@params['articles']))\n Success(articles)\n rescue StandardError\n Failure(Value::Result.new(status: :bad_request, message: 'Article list not ...
[ { "docid": "706a3e8940ca01be3fbda67f9135ce9e", "score": "0.6729565", "text": "def scrape\n @articles = []\n # CODE HERE\n url = 'http://api.nytimes.com/'\n uri = URI.parse(url)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = false\n request_url = url + 'svc...
8fd04f6e5d532133feb77bd2ac2acd98
The below methods are not implemented in IO class
[ { "docid": "2fd4cd3930ae2ff87510e1b284e6db80", "score": "0.0", "text": "def in_range?\n @chunk_range&.include?(tell)\n end", "title": "" } ]
[ { "docid": "c83ef2c3516f62369dcc1d01f8b26f74", "score": "0.77881616", "text": "def io; end", "title": "" }, { "docid": "c83ef2c3516f62369dcc1d01f8b26f74", "score": "0.77881616", "text": "def io; end", "title": "" }, { "docid": "c83ef2c3516f62369dcc1d01f8b26f74", "scor...
cf1cbb13d19f70b3dbc64a72e9bba90f
Smart search of one of user shows by title
[ { "docid": "37fe04abfbf9e8cf5be6f6111d039425", "score": "0.0", "text": "def show(title)\n found = shows.values_at *matcher.match(title)\n case found.count\n when 0\n raise MyShows::Error.new \"show with title \\\"#{title}\\\" was not found\"\n when 1\n found.first\n ...
[ { "docid": "38199403a1ce451bd81b08150d20598b", "score": "0.7317555", "text": "def search_by_title\n @favors = Favor.find(:all, \n :conditions => [\"title LIKE ?\", \"%#{params[:search]}%\"], \n :select => \"DISTINCT title\",\n :o...
5e5890d60e554673a419a5e123c805ea
GET /files/new GET /files/new.xml
[ { "docid": "695af52b660463d92cabed5c895da05f", "score": "0.0", "text": "def new\n authorize! :create_file, @active_project\n \n @file = @active_project.project_files.build()\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { ruby_code_from_view.ruby_code_fr...
[ { "docid": "be659584083f8fd0666b0a10b9321761", "score": "0.7320815", "text": "def new\n @xml_file_download = XmlFileDownload.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @xml_file_download }\n end\n end", "title": "" }, { "doc...
bd858f519d3b978086ef72fcb19960f7
POST /computer_images POST /computer_images.json
[ { "docid": "365a98dba1dfcfae48b4836b78304bfa", "score": "0.6980057", "text": "def create\n @computer_image = ComputerImage.new(computer_image_params)\n\n respond_to do |format|\n if @computer_image.save\n format.html { redirect_to @computer_image, notice: 'Computer image was successful...
[ { "docid": "457f589782dd14d0823d6e5557b2563d", "score": "0.69117653", "text": "def upload_image_file(args = {}) \n post(\"/files.json/captiveportal/images\", args)\nend", "title": "" }, { "docid": "095aef3367de8351da8844756defc6a4", "score": "0.6669094", "text": "def create\n json...
d396093019fb22b0f9febd585f055c72
Closes both the Reader object and the wrapped data stream.
[ { "docid": "8e49ca780175de4feae048acea158c59", "score": "0.6023645", "text": "def close\n @io.close\n @tar.close\n end", "title": "" } ]
[ { "docid": "0e85aec581c762ba24870b31521b6feb", "score": "0.7675433", "text": "def close\n @reader.close\n end", "title": "" }, { "docid": "0e85aec581c762ba24870b31521b6feb", "score": "0.7675433", "text": "def close\n @reader.close\n end", "title": "" }, ...
03afd3efc0ea1fd4d1a855300ef7878d
PUT /web_profiles/1 PUT /web_profiles/1.xml
[ { "docid": "bbf809c9c74640c7fde1b797735374e2", "score": "0.6459651", "text": "def update\n @web_profile = WebProfile.find(params[:id])\n\n if @web_profile.update_attributes(params[:web_profile])\n flash[:notice] = 'WebProfile was successfully updated.'\n redirect_to(@web_profile) \n e...
[ { "docid": "9f37c662639edef08da39923901bbf44", "score": "0.679299", "text": "def update\n @profile = current_user.profiles\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Profile was successfully updated.'\n format.html { redirect...
a8264a250bcad049b5d76b68dd0b8576
Builds the 'ALTER TYPE ... ALTER' CQL statement
[ { "docid": "5cb793a76bcc275918c2db14d885cff5", "score": "0.55938345", "text": "def alter(type)\n Statements::AlterField.new(context: self, type: type)\n end", "title": "" } ]
[ { "docid": "1e99e426421383c4e1ae06d28ae79193", "score": "0.6622664", "text": "def change_type_statement\n [\"set_column_type #{name.inspect}\", column_type.inspect, change_options].compact.join(\", \")\n end", "title": "" }, { "docid": "63b1343ba996ddf2e83c7637e00ae110", "sco...
827e1f9a421686d3d0bc4f502180f344
rescue_from AsgAccessFail, :with => :error_503
[ { "docid": "9c7a73287ab72d4693bba8e61ded2019", "score": "0.0", "text": "def thumbnails\n # パラメータをチェック\n @video_id = param_id\n video = Asg.find_or_create_asg(@video_id, params[:size])\n # サムネイルをviewにセットする\n @thumbnails = video.thumbnails\n end", "title": "" } ]
[ { "docid": "255cbac85026e0e057ed24efa0941f31", "score": "0.65883046", "text": "def handle_http_503(message = nil, view = :service_unavailable)\n message ||= t('application.errors.service_unavailable')\n handle_http_error(:service_unavailable, message, view)\n end", "title": "" }, { ...
687eabce4073669c9af5a54d7b28ff97
Delete an item Delete an item on the UltraCart account.
[ { "docid": "3cde307e4cb7029e1029182df1d8a255", "score": "0.0", "text": "def delete_item_with_http_info(merchant_item_oid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ItemApi.delete_item ...'\n end\n # verify the required parameter 'm...
[ { "docid": "5e8f287125f17cddb92bf62f22b0b8f1", "score": "0.7893478", "text": "def remove_item(item)\n @cart.delete(item)\n end", "title": "" }, { "docid": "195b36976bae284ce67930cfc89305bd", "score": "0.75354344", "text": "def delete(object)\n cart_item = item_for(object)\n ...
6f35406284988fd8f830c802cb6fef7f
Outputs an abbreviation tag for 'circa'. ==== Example output: c
[ { "docid": "0768109f08ec9ea99f4fdb61c082f20e", "score": "0.8036858", "text": "def circa_tag\n return content_tag(\"abbr\", \"c\", {:title => \"circa\"})\n end", "title": "" } ]
[ { "docid": "cad732686a808d92c0d18f9ab982b2b2", "score": "0.8084611", "text": "def circa_tag\n content_tag(:abbr, 'c', { title: 'circa' })\n end", "title": "" }, { "docid": "61c22a99f46b5d50fbf7cfd580648658", "score": "0.6430205", "text": "def abbrev\n cardface.abbrev\n end", ...
c367b57bc9cc1fbe02ed28a9a1d85e3d
AJAX ping or form submit
[ { "docid": "67bc1ece1a09e2695971e2e3d83f82d3", "score": "0.50686574", "text": "def ping\n end", "title": "" } ]
[ { "docid": "f5cfbf20fb98ce051805a8be5973de92", "score": "0.6681347", "text": "def ping\n @site = Site.find(params[:id])\n return if !self.authorize?\n \n session[:job_key] = \n ::MiddleMan.new_worker(:class => :ping_worker,\n :args => {:site_id => params[...
1e1988198792370790ca7cca2ffbd851
Sidekiq::Client is responsible for pushing job payloads to Redis. Requires the :pool or :config keyword argument. Sidekiq::Client.new(pool: Sidekiq::RedisConnection.create) Inside the Sidekiq process, you can reuse the configured resources: Sidekiq::Client.new(config: config)
[ { "docid": "8c4bfe693235956f9bf7e5a352a0848d", "score": "0.0", "text": "def initialize(*args, **kwargs); end", "title": "" } ]
[ { "docid": "400040b6d33415705d3ad3e72103c456", "score": "0.6683637", "text": "def redis(_r_pool = nil, &block)\n Sidekiq.redis do |conn|\n conn.with(&block)\n end\n end", "title": "" }, { "docid": "fdc02690d0e86e1162d95f64b7a6c3b8", "score": "0.6652459", "text": "...
79de5d6eea5f28fee8ffea8b54c8c779
Creates new pool Args name (String) Pool's name vs_info (Array) Pool's nodes Examples create("webpool", ["10.0.0.2", "10.0.0.3"]) Creates new pool called "webpool" with 2 nodes
[ { "docid": "121111be528195b5cff9ca53b03c8607", "score": "0.77503556", "text": "def create(name=nil, nodes=[])\n @driver.addPool([name], [nodes])\n end", "title": "" } ]
[ { "docid": "2b8eae9fc6e3601c9be3639b275a93e4", "score": "0.73899883", "text": "def create_pool(pool)\n _params = {:pool => pool}\n return @master.call 'ips/create-pool', _params\n end", "title": "" }, { "docid": "913a95f2be93c5a35751297e240bea64", "score": "0.73562276", ...
21328907fe4ee795a8ceec549371c5bb
PUT /property_users/1 PUT /property_users/1.json
[ { "docid": "903ebdf0819b218439a47e87aae14b54", "score": "0.7151289", "text": "def update\n @property_user = PropertyUser.find(params[:id])\n\n respond_to do |format|\n if @property_user.update_attributes(params[:property_user])\n format.html { redirect_to @property_user, notice: 'Prope...
[ { "docid": "f3eeed7f9657e819153b1c033a977dca", "score": "0.7232736", "text": "def update\n respond_to do |format|\n if @users_property.update(users_property_params)\n format.html { redirect_to @users_property, notice: 'Users property was successfully updated.' }\n format.json { ren...
3b6dec09dcb9497508da92d54373e4fe
initializes the underlying array for the stack
[ { "docid": "0ac1581513f24850edddb0950e01bc24", "score": "0.6643847", "text": "def initialize\n @array = []\n end", "title": "" } ]
[ { "docid": "949f957d4d7f39731ba12a3bd328e2a3", "score": "0.72551787", "text": "def init_state_array\n @state = Array.new(@height + @buffer_height) { Array.new(@width) { 0 } }\n end", "title": "" }, { "docid": "b8b5db831de672d8971ac29faa273378", "score": "0.72309387", "text": "def...
01d1426d2725a09f15899a25080643b4
True if all answers are blank.
[ { "docid": "134cc37a11e87d754edfb2c2be414f4d", "score": "0.8960065", "text": "def blank?\n answers.all?(&:blank?)\n end", "title": "" } ]
[ { "docid": "65afc903e1c1b0579ce3cfc8334fca73", "score": "0.783023", "text": "def empty?\n each_wh.all? { |val| val.to_s.empty? }\n end", "title": "" }, { "docid": "28c49f9b938c1ff07b5f48cc3b07ef85", "score": "0.7622284", "text": "def blank?\n !any?\n end", "ti...
18205adc6e8b2b391dd8b589a5ac9505
Metodo que extrae el primer elemento de la lista
[ { "docid": "d8f9118d21c9f48e20c9b04da474fc99", "score": "0.0", "text": "def extract_head\n if(@head == nil)\n return nil\n end\n valor = @head\n @head = @head.next\n if(@head == nil)\n @tail = nil\n else\n @head.prev = nil\n valor.next = nil\n end\n valor.valu...
[ { "docid": "8bdea08b1333f17067b16d2ec5b26cd2", "score": "0.6806125", "text": "def extraer_por_cabeza\n\t\tif(@head==nil)\n\t\t\tputs \"No hay nada que extraer (lista vacia)\"\n\t\telse\n\t\t\taux=@head\n\t\t\t@head=@head.nest\n\t\t\tif(head!=nil)\n\t\t\t\t@head.prev=nil\n\t\t\tend\n\t\t\taux.nest=nil\n\...
c1d1e80ff5878876763569222c579b51
Helper methods Does table exist?
[ { "docid": "e9e9e89fa9cca27199064f48f066ca01", "score": "0.77985394", "text": "def exists?(table_name)\n @admin.tableExists(TableName.valueOf(table_name))\n end", "title": "" } ]
[ { "docid": "ebd8346f843d1bd5e9344c45c3a38efe", "score": "0.8839171", "text": "def table_exists?\n true\n end", "title": "" }, { "docid": "be3d27d6884c224d327753d894959884", "score": "0.88118404", "text": "def table_exists?\n db.table_exists?(table_name)\n ...
91803c2d16b72f8c5b30473b76a1e4c6
Charge Charges a card represented by a card nonce or a customer&39;s card on file. Your request to this endpoint must include _either_: A value for the &x60;card_nonce&x60; parameter (to charge a card nonce generated with the &x60;SqPaymentForm&x60;) Values for the &x60;customer_card_id&x60; and &x60;customer_id&x60; p...
[ { "docid": "61ba38a1a0449e6b6e68805c407a1ca5", "score": "0.5554362", "text": "def charge_with_http_info(location_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TransactionsApi.charge ...\"\n end\n # verify the required parame...
[ { "docid": "2c06ab2e5eb1d20dabf4596ddd44293a", "score": "0.75482273", "text": "def charge_credit_card(params = {})\n request = token_request(payment_method: {\n type: 'card', register_card_token: 0\n })\n response = PaybywayConnector.auth_payment(request).parsed_response\n {\n...
86248d6f67c44808a81cfdaf20433df2
PUT /experience_details/1 PUT /experience_details/1.json
[ { "docid": "6259fbd7eecd2d9952c7b2775ded4f8c", "score": "0.7593812", "text": "def update\n logger.info\"PARAMS #{params.inspect}\"\n @experience_detail = ExperienceDetail.find(params[:id])\n \n if @experience_detail.update_attributes(params[:experience_detail])\n flash[:notice] = \"Expe...
[ { "docid": "e702845814eac254a33382e222a270c0", "score": "0.7847154", "text": "def update\n respond_to do |format|\n if @experience_detail.update(experience_detail_params)\n format.html { redirect_to @experience_detail, notice: 'Experience detail was successfully updated.' }\n forma...
a2295b20f1258991577ec3dc5b593d3e
Interpretacion de las instrucciones del programa Interpretador de la instruccion ASSIGN.
[ { "docid": "f18983c4e88ea5aaecd35ca4b9722e8d", "score": "0.5300692", "text": "def assign_Interpreter(assign)\n\tidVar = assign.branches[0].term\n\ttype = $symTable.lookup(idVar)[0]\n\texprVal = expr_Interpreter(assign.branches[1])\n\t$symTable.update(idVar, [type, exprVal])\nend", "title": "" } ]
[ { "docid": "82d13c9689c4007001ba2dd6649ff9d6", "score": "0.63703454", "text": "def verifyAssign(instr)\n\tsymbol = instr.get_symbol\n\tvalues = instr.get_values\n\tidentif = values[0].get_value\n\t# Si al buscar en la tabla, la variable no ha sido declarada, \n\t# devuelve un mensaje\n\tif $var_iter.in...
dd02148ba1c0beba087fd73c57c35df5
Sets the vsync state on / off
[ { "docid": "e470d9e20aa3ac30ae3501787fc76556", "score": "0.8166554", "text": "def vsync=(bool)\n @vsync = bool\n GLFW.swap_interval = @vsync ? 1 : 0\n end", "title": "" } ]
[ { "docid": "4aa6bc36c20a35de0e352f8e9c4c0a40", "score": "0.7631378", "text": "def fix_vsync\n @vsync_enabled = !PARGV[:\"no-vsync\"]\n end", "title": "" }, { "docid": "e855c1747a7973ec8fe657e77c729e66", "score": "0.59786904", "text": "def tv_off\n unless @tv[:on].nil? ||...
a3f20f975614b5211a2022b96752fca9
PUT /delivered_orders/1 PUT /delivered_orders/1.xml
[ { "docid": "fd53e4cfe3336d838598ed9f94c50c40", "score": "0.68089616", "text": "def update\n @delivered_order = @order.delivered_order\n\n respond_to do |format|\n if @delivered_order.update_attributes(params[:delivered_order])\n format.html { redirect_to(@order, :notice => 'Delivery de...
[ { "docid": "9d6a946edf3bc3faa86b429fd08ec860", "score": "0.6757362", "text": "def order_delivered_update\n # Find the order in the database by the id\n @order = Order.find(params[:order_id])\n # Update order status\n @order.update(status:\"Entregue\")\n # Go back to order acceptance page ...