query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
7e0946e4854d7173a6d748ca0ea218f9
Return probability of seeing x.
[ { "docid": "08e2b906a7da002b91521e8f4334a13f", "score": "0.59368855", "text": "def sample(x, skip_cache = false)\n # Loop over points and compute contribution\n # from each. Stdev is @bandwidth\n y = 0.0\n\n return @cache[x] if !skip_cache && @cache[x]\n\n @points.each do |mean...
[ { "docid": "bd403e0abb77ddb37069b12ac464ece1", "score": "0.7396999", "text": "def probability\n return @probability\n end", "title": "" }, { "docid": "6e669b8795498d623c6b5102b461f99b", "score": "0.7358398", "t...
69dc26b8ab913adc14c3cf01f8fa55e8
Returns a fake action view instance to use with our renderers
[ { "docid": "36c6f3e30372d4a207b28cfeff966fc3", "score": "0.70908904", "text": "def mock_action_view(assigns = {})\n controller = ActionView::TestCase::TestController.new\n ActionView::Base.send :include, ActionView::Helpers\n ActionView::Base.send :include, ActiveAdmin::ViewHelpers\n ActionV...
[ { "docid": "9ac598b098eb65667f645cc0c6278053", "score": "0.75540096", "text": "def mock_action_view(base = MockActionView)\n controller = ActionView::TestCase::TestController.new\n\n base.new(view_paths, {}, controller)\n end", "title": "" }, { "docid": "8b0bb2b4a047a7abaad36df5907e47...
4b73608dcb832406f651590ba5ab2286
Block until prompted returns true
[ { "docid": "08a464a0b7a5885049785c2a14e0b1a0", "score": "0.8310266", "text": "def wait_for_prompt\n while !@prompted do\n sleep(0.2)\n end\n end", "title": "" } ]
[ { "docid": "486d634ad5edfbb9a1dabcc1086f3cc4", "score": "0.78765094", "text": "def wait_for_prompt\n while process_thread.alive? && !prompted?\n sleep 0.2\n end\n process_thread.alive?\n end", "title": "" }, { "docid": "d1d840476421359f08e493d8d67bac26", "score":...
e1ccb217439683fbdacc8367435785c3
Chat messages from server
[ { "docid": "0b52425a99aba4ae1d7a6a80043fffb1", "score": "0.0", "text": "def initialize(service_manager,banned_words = GameOverseer::CONFIG[:banned_words])\n @banned_words = banned_words\n @unprocessed_messages = []\n @service_manager = service_manager\n end", "title": "" } ]
[ { "docid": "58edfd10d3dd290d9bbef1b826bc9462", "score": "0.73034966", "text": "def chat; end", "title": "" }, { "docid": "e5967e80eadf150d9bb9f570da86e9d7", "score": "0.71719706", "text": "def send_msg(text)\n post(:msgType => :chat, :text => text, :name => @config['user'])\n ...
150cd3d3fb9eaa600ebdedc8b2372090
=begin Gets TextFormat of a particular Fragment
[ { "docid": "93a4d04eab00c6c326cbb8583b392224", "score": "0.71808404", "text": "def get_text_format page_number, fragment_number, segament_number = 0\n begin\n \n if @filename == ''\n raise 'filename not specified'\n end\n \n if page_nu...
[ { "docid": "debadf400e941f9b6da5adf44c6acde5", "score": "0.66006136", "text": "def format\n get_text(@xpaths[\"format\"])\n end", "title": "" }, { "docid": "7a6b39b26119dad7638f93643ba697a5", "score": "0.6561568", "text": "def format\n @text\n end", "title": "" ...
d9ac8fbd106273ef6becf79089fdb0a8
Unpublished posts are visible but flagged
[ { "docid": "6755ca943abc0d050bd2ef370167c554", "score": "0.6929879", "text": "def given_an_unpublished_post_exists\n post_1.update(publish: false)\n end", "title": "" } ]
[ { "docid": "9a25dbf7c636a71a479fb047b08179b5", "score": "0.7363989", "text": "def isUnpublished?\n return !published\n end", "title": "" }, { "docid": "27952e1ac639799bb0dc5f2729f16913", "score": "0.732405", "text": "def unpublished?\n !published?\n end", "title":...
a0996d416c45c41e4f2478094a8c9ca0
Verifies PPV/Subscription/Collection client purchase (such as InApp) and entitles the user.
[ { "docid": "ae5a11a1e41370d3c65b8bba61d5bf50", "score": "0.0", "text": "def validate_receipt(external_receipt)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'externalReceipt', external_receipt)\n\t\t\tclient.queue_service_action_call('transaction', 'validateReceipt', 'KalturaTransaction', kparams...
[ { "docid": "7fb2ce044f4fcda6749ad2dfabf87012", "score": "0.6536862", "text": "def confirm_purchase(purchase)\r\n purchase.confirm\r\n end", "title": "" }, { "docid": "a53a87ba710ecd89353e06f0c0cac9bd", "score": "0.62395835", "text": "def confirm!\n return false if purcha...
2c340d4e66a069fd492be9d758d9ba46
See README.md for instructions on how to do this
[ { "docid": "5cf8f9ac4a6684e6381d311811273d89", "score": "0.0", "text": "def fizzbuzz(fizz)\n if fizz % 5 == 0 && fizz % 3 == 0\n return \"FizzBuzz\"\n elsif fizz % 5 == 0\n return \"Buzz\"\n elsif fizz % 3 == 0\n return \"Fizz\"\nend\nend", "title": "" } ]
[ { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.6703943", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.6703943", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc8...
a80414f9b553851facdefec9f0f550b5
Computes the path to a video asset either in the Sprockets environment or the public directory. External URIs are untouched. ==== Examples With files within Sprockets: video_path 'video.mp4' => '/assets/video.mp4' video_path 'subfolder/video.mp4' => '/assets/subfolder/video.mp4' video_path '/subfolder/video.mp4' => '/a...
[ { "docid": "652d29ff97133d98c1128552fdc8faeb", "score": "0.77048475", "text": "def video_path(source, options = {})\n asset_path source, sprockets_helpers_settings.default_path_options[:video_path].merge(options)\n end", "title": "" } ]
[ { "docid": "e7f6f063c3a920e659aff623874a7e91", "score": "0.6759001", "text": "def video_asset_path(type)\n path = String.new\n unless @afdoc.external_video(:h264).first.nil?\n filename = @afdoc.external_video(:h264).first.datastreams[\"descMetadata\"].get_values(:name)\n path = File.join...
846b7725384f04c24eeca53c87e7f19f
Baseline implementation for the undeploy_conversation_model REST call
[ { "docid": "5fe158ca87f58809197ffdcddea60367", "score": "0.7911031", "text": "def undeploy_conversation_model request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_...
[ { "docid": "4788bf3a8c78e001ca49b108ae718eb8", "score": "0.6964819", "text": "def undeploy_issue_model request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_undeplo...
f540583fd454c61983d67812669989fc
Move Cursor One Page Down
[ { "docid": "29223bccd46ba9d0930983764ebc3aa6", "score": "0.81441116", "text": "def cursor_pagedown\n end", "title": "" } ]
[ { "docid": "a1657ac069c92bd67b6bc3e17245493b", "score": "0.8202726", "text": "def cursor_pagedown\r\n end", "title": "" }, { "docid": "7198cfcd70105e361f15a69bbf432b31", "score": "0.77765775", "text": "def cursor_pageup\r\n end", "title": "" }, { "docid": "a21c1fdd1c233...
5f44342c418f954d875ba6eca1f847df
Update the navigation property filter in drives
[ { "docid": "871a6fc9632506375ac39537afff49c9", "score": "0.0", "text": "def to_patch_request_information(body, request_configuration=nil)\n raise StandardError, 'body cannot be null' if body.nil?\n requ...
[ { "docid": "7adc251c52a36c5cf6b79d80b5bf8a17", "score": "0.5566501", "text": "def update\n reload\n update_model_filter\n end", "title": "" }, { "docid": "ed4f0388c0cc7f215c1277e550f8a01e", "score": "0.5503697", "text": "def apply_filter\n ...
025e3b0f88fcece4fc60c7b3888a918c
this method is required to avoid custom_active_storage bug when seeking for paperclip equivalent method
[ { "docid": "8381593f082200b4e433fe89b8b849c2", "score": "0.0", "text": "def content\n object = FakeObject.new\n end", "title": "" } ]
[ { "docid": "a2ca487d2dd3459a92f73188aa45e4c4", "score": "0.68606496", "text": "def storage\n ManagedImage.originals_storage\n end", "title": "" }, { "docid": "640a5d02748d5285b2203b566fc46264", "score": "0.6798771", "text": "def blob\n active_storage_blob\n end", "title":...
6830a0fe808df66ac87a60a9ce2ae174
reduce 124 omitted reduce 125 omitted reduce 126 omitted reduce 127 omitted reduce 128 omitted reduce 129 omitted reduce 130 omitted reduce 131 omitted reduce 132 omitted reduce 133 omitted reduce 134 omitted reduce 135 omitted reduce 136 omitted reduce 137 omitted reduce 138 omitted reduce 139 omitted reduce 140 omitt...
[ { "docid": "0f16314e910e2ed0a147877d91c34bf1", "score": "0.0", "text": "def _reduce_195(val, _values, result)\n result = new_assign val[0], val[2]\n \n result\nend", "title": "" } ]
[ { "docid": "7e1ad6c70501b45f5a3b2b701b8c1700", "score": "0.6646738", "text": "def _reduce_598(val, _values, result)\n yyerrok\n \n result\nend", "title": "" }, { "docid": "56bd5579a3a2de64f1337e1168c579a4", "score": "0.6610375", "text": "def _re...
e31d92c67da362c2d4282abc0d4565a2
Changes the number of results that are displayed per page. Redirects to first page if referring page was paginated. Redirects to previous page if page was not paginated. Redirects home if no referring page.
[ { "docid": "60f284d2f098076c9bbf23c129529b4f", "score": "0.78412575", "text": "def change_results_per_page\n session[:results_per_page] = params[:results_per_page]\n referring_page = request.referer\n flash[:notice] = t(:results_per_page) + \" #{params[:results_per_page]}\"\n if referring_pa...
[ { "docid": "3c70d12ebebb1cb84e7e43c74b9b5b0b", "score": "0.662493", "text": "def redirect_paginated_to(url)\n redirect_to url_for(url) + \"?page=#{pagination_page}\"\n end", "title": "" }, { "docid": "fe63dca5425d9b5a21982fc9648ad015", "score": "0.65200424", "text": "def repagina...
2c58fcc464e87693cc37864e87499b31
Sets the sequence property value. Relative position of this question when displaying a list of questions to the requestor.
[ { "docid": "042e6d4f94613bda16ccf25110fd732b", "score": "0.8185084", "text": "def sequence=(value)\n @sequence = value\n end", "title": "" } ]
[ { "docid": "69dc493e830057729f7f18e826897775", "score": "0.72819984", "text": "def set_sequence\n seq = next_sequence\n self.SeqNo = format('%08d', seq.to_s.reverse.to_i).reverse\n end", "title": "" }, { "docid": "5e5fba8b2e74008817ccf9d1c951d3a0", "score": "0.727929", "...
5e451aed1ca8f175174e0874c42d2344
POST /aspect_feedbacks POST /aspect_feedbacks.json
[ { "docid": "36ce88a2f0336fe1ae7d8de6d934a626", "score": "0.76809233", "text": "def create\n @aspect_feedback = AspectFeedback.new(aspect_feedback_params)\n \n respond_to do |format|\n if @aspect_feedback.save\n format.html { redirect_to @aspect_feedback, notice: 'Aspect feedba...
[ { "docid": "142b6efde4782da1aa02bc4ae6935937", "score": "0.7068468", "text": "def aspect_feedback_params\n params[:aspect_feedback]\n params.require(:aspect_feedback).permit(:rating_before, :rating_after, :name)\n end", "title": "" }, { "docid": "8d1de412340b33616052079dc3...
6c29abb45a4ce7c3e1a086cad67210ec
action about GET /about/me
[ { "docid": "93cee065f6342a7d402213d1a02a5040", "score": "0.6503356", "text": "def about_me\n @breadcrumbs << [I18n.t('pages.about.breadcrumb'), about_path]\n @breadcrumbs << [I18n.t('pages.about.me.breadcrumb')]\n end", "title": "" } ]
[ { "docid": "617c5cf36a0bd9e46d2530177aa5a3e1", "score": "0.73857296", "text": "def set_about_me\n @about_me = AboutMe.find(params[:id])\n end", "title": "" }, { "docid": "96a7571896c88b5bd80f11fa84625834", "score": "0.72190195", "text": "def about\n\n end", "title": ""...
9692aeb3552e22ae4d875d244b1b8c03
Test if AST node is a valid assign target
[ { "docid": "8d194fae74e93b8aa17b6ecfe538fcaa", "score": "0.64136595", "text": "def assignment?\n Types::ASSIGNABLE_VARIABLES.include?(node.type)\n end", "title": "" } ]
[ { "docid": "2cad68e25ff2bba83ee222e43d6f333e", "score": "0.7365027", "text": "def assignment?(node); end", "title": "" }, { "docid": "2cad68e25ff2bba83ee222e43d6f333e", "score": "0.7365027", "text": "def assignment?(node); end", "title": "" }, { "docid": "2cad68e25ff2bba8...
0bac04166573a60bbda3c41af83a9099
Creates a change analysis from two sets of stack data. The format is a flat hash of all related stacks.
[ { "docid": "0b47dbffcc9fcf83dcc0de60a9bacb26", "score": "0.5711472", "text": "def initialize(old_data, new_data)\n @old_data = old_data.is_a?(StackDataSet) ? old_data : StackDataSet.new(old_data)\n @new_data = new_data.is_a?(StackDataSet) ? new_data : StackDataSet.new(new_data)\n analyze\...
[ { "docid": "b077114d9a00739c1403e0ef22238937", "score": "0.595159", "text": "def diff_and_cache(state)\n change_stacks = (@seed.keys + state.keys).uniq.map do |stack_id|\n stack = @connection.stacks.get(stack_id)\n if(@seed.fetch(stack_id, :stack_status) != state.fetch(stack_id,...
2462e2d4616ec751a02c48a6517af141
GET /organisations/1 GET /organisations/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "6751782fac52ff7eac80d2724273cb56", "score": "0.7495181", "text": "def index\n @organisations = Organisation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @organisations }\n end\n end", "title": "" }, { "docid": "87f...
ec5c7a95303f841bc773661012333d64
Write a method that takes in 2 numbers and prints their sum, then call that method.
[ { "docid": "cd9853c9b6528c205cd38dc7f10abd7f", "score": "0.0", "text": "def add(x, y)\n puts x + y\n return x + y\nend", "title": "" } ]
[ { "docid": "8589f76a7809f68ea15d5535b9ef7328", "score": "0.8478929", "text": "def sum_of_two_numbers(num_1, num_2)\n puts num_1 + num_2\nend", "title": "" }, { "docid": "b418b8170b4152108a885ba48416577d", "score": "0.8387362", "text": "def sum_method(first_number, second_number)\n ...
59551f522a9ce20dca2fe3ba162de503
GET /weekly_activity_summaries/1 GET /weekly_activity_summaries/1.xml where 1 = studentID return all the WeeklyActivitySummaries if :today is specified and there is no record for this week. then create one
[ { "docid": "f3b81ae8e77e4d64dc140a82963beee9", "score": "0.7990316", "text": "def show\n \n if params[:today] != \"\" \n # the client provides todays date to avoid timezone errors\n clientDate = Time.parse( params[:today])\n week = clientDate.strftime(\"%U\").to_i # the...
[ { "docid": "b44ff1b1a6cb77e5294107914cdf1e39", "score": "0.69234324", "text": "def getAllStudentLoginData\n \n # load all student login data, topic_activity_summaries, student_assignments, weekly_activity_summaries\n \n if params[:today] != \"\" \n \tcreateInitialWeeklyActivitySummary par...
e421a66c2d0b46f3f93b60a380677517
Set the value of the EndDate input for this Choreo.
[ { "docid": "32c4896623729f9c0b5ae43ba5beca52", "score": "0.64751494", "text": "def set_EndDate(value)\n set_input(\"EndDate\", value)\n end", "title": "" } ]
[ { "docid": "c519f3bae58b4f012e87dcc837c39491", "score": "0.7709554", "text": "def set_end_date(end_date)\n @end_date = end_date\n end", "title": "" }, { "docid": "edc693e72b137de482ec829c9af4b4db", "score": "0.7667414", "text": "def end_date=(value)\n @end_date = v...
49ff3393c32765ca8b98cdb4517e49d0
POST /trucks POST /trucks.json
[ { "docid": "80a78278f4eb02cc7a4c853dce7e9d08", "score": "0.0", "text": "def create\n @truck = Truck.new(truck_params)\n\n if @truck.images.count>0\n @truck.images.attach(params[:truck][:images])\n end\n\n respond_to do |format|\n if @truck.save\n format.html { redirect_to @tr...
[ { "docid": "f3713f9b867f5cee230fa6b69a2fbb1f", "score": "0.70370346", "text": "def create\n @truck = Truck.new(truck_params)\n\n respond_to do |format|\n if @truck.save\n format.html { redirect_to @truck, notice: 'Truck was successfully created.' }\n format.json { render :show, ...
a2f0c803776ab6d55c374ce011b7806d
Removes user added action with given id index. ==== Description This only removes actions added with the addAction command. You cannot remove default game actions, such as reload. This command has local effect. The action will only be removed on the computer that executes the command ==== Syntax unit removeAction index...
[ { "docid": "5258b44d0bd47c27c4eebdcd754696bc", "score": "0.6631813", "text": "def removeAction _obj, _args\n \"_obj removeAction _args;\" \n end", "title": "" } ]
[ { "docid": "dd97e9894ae3fc13093cecb07bdc7c3b", "score": "0.7004312", "text": "def remove_action(action)\n unless action\n raise Occi::Core::Errors::MandatoryArgumentError, 'Cannot remove a non-existent action'\n end\n actions.delete action\n end", "title": "" }, ...
8e59341b2387b781e3036d776b2e1cf2
Fetch a dispatch route by id.
[ { "docid": "57bd7f2761fa0fa0d56c57032201c72d", "score": "0.7662291", "text": "def get_dispatch_route_by_id(access_token,\r\n route_id)\r\n # Prepare query url.\r\n _path_url = '/fleet/dispatch/routes/{route_id}'\r\n _path_url = APIHelper.append_url_with_tem...
[ { "docid": "7c2945c3cdd5b61f739aee783eada82d", "score": "0.7678445", "text": "def get_route_by_id(id)\n require_relative 'route'\n Route.new(@api, @api.do_request(\"GET\", get_base_api_path() + \"/routes/#{id}\"))\n end", "title": "" }, { "docid": "7c2945c3cdd5b61f739aee783e...
f76c52dd1c12aa8fb104080966b3f031
Get all venues sport has a facility at
[ { "docid": "dc0115e3efa1d73146e71a20a3d4b82f", "score": "0.6931875", "text": "def is_at_facility\n self.venues\n end", "title": "" } ]
[ { "docid": "efc7180bbde21c9b10f61679202f3738", "score": "0.65796983", "text": "def is_at_facility?(venue)\n self.venues.include?(venue)\n end", "title": "" }, { "docid": "aee67b4d86302510ce183fc6e7df12c6", "score": "0.6231053", "text": "def venues(options = {})\n self.class.re...
8c3db81b2edb72b4921452fe142facf4
Imports the private key from its material representation.
[ { "docid": "7ade35ad1255ff165cf1df3c674947bf", "score": "0.6840516", "text": "def import_private_key(private_key_bytes)\n @virgil_crypto.import_private_key(private_key_bytes, @password)\n end", "title": "" } ]
[ { "docid": "9956398a44afe154491bba858886bc61", "score": "0.6879621", "text": "def import_gpg_key\n return if key_imported?\n keyfile = File.join(Dir.tmpdir, 'hashicorp.asc')\n GPGME::Key.import(File.open(keyfile))\n end", "title": "" }, { "docid": "86796fd15b76b7a14a6bc4ae6...
d54e2e199bf242fba8eb580808f1de27
COLORS = ["red", "green"]
[ { "docid": "ee13407d6097857520d1f0f7176bfb04", "score": "0.0", "text": "def initialize(input)\n @input = input\n @train_threads = []\n @people_threads = []\n @current_stations = {}\n @lock = Mutex.new\n end", "title": "" } ]
[ { "docid": "7652f300378a4bb0740027bede4aea34", "score": "0.83135974", "text": "def color\n color = [\"red\", \"yellow\", \"green\"]\n end", "title": "" }, { "docid": "76a213fb6ab1ccabcf95c0deb65ea239", "score": "0.79653853", "text": "def colors\n %w[#008ae0 #00a4f4 #00bdf3 #00...
3847c90dd31063aad471af50fdd14cde
Execute block without raising errors
[ { "docid": "4ef2976bb3e1070991d5f8cb79522b81", "score": "0.0", "text": "def safe(quiet = false)\n begin\n yield\n rescue NoFreeConnectionError => e\n disable!\n custom_data['disabled_reason'] = :no_free_connections\n custom_data['disabled_description'] = 'Cannot fin...
[ { "docid": "e779468c9f759b02d098a26a43ee5910", "score": "0.78631353", "text": "def __execute__\n @result = @block[*@args]\n rescue Exception => e\n @result = e\n ensure\n # Prevent multiple executions\n def self.__execute__; nil; end\n end", "title": "" }, { "doc...
a2ff6170d2cb57153ea7d006e9df3cb6
Equality for being able to test it.
[ { "docid": "e35dd107a30e4bba113eb154779f4057", "score": "0.0", "text": "def ==(other); eql?(other); end", "title": "" } ]
[ { "docid": "fc009218ca0f247c13dc9d365a8e0d4a", "score": "0.7970093", "text": "def equal(expected); end", "title": "" }, { "docid": "1a192c5a4478f849f88832c933c5f2a1", "score": "0.796181", "text": "def eq(expected); end", "title": "" }, { "docid": "4dd9111ee6393382da8dec67...
9143ff5fbfadd2e597748b7b0ac3057e
updates the member's user in sfdc with the devise change password token
[ { "docid": "28212c03bce7ac0ab2ad59014c367761", "score": "0.6651532", "text": "def update_password_token(token)\n data = { token: token }\n self.class.http_put(\"accounts/update_password_token/#{user.username}\", data)\n end", "title": "" } ]
[ { "docid": "80305607ef79f4abc8feee488b5927ec", "score": "0.7033336", "text": "def update_user\n end", "title": "" }, { "docid": "09dacfd5acf197af0a443775d6ee594b", "score": "0.7028889", "text": "def update\n @token = params[:id]\n @user = User.load_from_reset_password_token(...
c245a2daf3ae7733b2ba457b24440449
GET /stories/new GET /stories/new.xml
[ { "docid": "54278f3bd91c93cd08832b33820228db", "score": "0.76421404", "text": "def new\n @story = Story.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @story }\n end\n end", "title": "" } ]
[ { "docid": "5da16b2c91298b65822f602999d1754d", "score": "0.86241126", "text": "def new_stories\n get('/newstories.json')\n end", "title": "" }, { "docid": "1ce8c6100a3d082b498ee1b93f6395e4", "score": "0.7971792", "text": "def new\n path = \"/view/new\"\n retrieve_storie...
38fa733745d59b6399f3d8be6fd6fe5e
Returns printable target model name to show in view or email.
[ { "docid": "dd355dd6d5e0600b9c6631ce94198c4d", "score": "0.672905", "text": "def printable_target_name\n resolve_value(_printable_notification_target_name)\n end", "title": "" } ]
[ { "docid": "5dd40da26b4f0cca7228491fd06b9bbf", "score": "0.70093423", "text": "def display_name\n \"#{Target.type_of(self).titleize} #{id}\"\n end", "title": "" }, { "docid": "da5ecde8ea71edb3f1e06bc2553fa576", "score": "0.69759554", "text": "def model_name\n model.name\n ...
1d233902d5ee48acc0437dc876810dd0
PATCH/PUT /invoiceable_fees/1 PATCH/PUT /invoiceable_fees/1.json
[ { "docid": "faa2bfdf676547a85f2902e5bd1f6b1c", "score": "0.7443711", "text": "def update\n respond_to do |format|\n if @invoiceable_fee.update(invoiceable_fee_params)\n format.html { redirect_to @invoiceable_fee, notice: 'Invoiceable fee was successfully updated.' }\n format.json {...
[ { "docid": "65389df00d15546500b525003dedf232", "score": "0.6975224", "text": "def update\n respond_to do |format|\n if @client_fee.update(client_fee_params)\n format.html { redirect_to client_fees_path, notice: 'Client fee was successfully updated.' }\n format.json { head :no_conte...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "d9a9dcbe2e372d9bf700113150153273", "score": "0.0", "text": "def update!(**args)\n @copy = args[:copy] unless args[:copy].nil?\n @is_in_my_books = args[:is_in_my_books] unless args[:is_in_my_books].nil?\n @is_preordered = args[:is_preordered] unless args[:is_p...
[ { "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...
fda40d384cf59be3df7da2359ccc391e
Public: View partner detail by click partner's company name Examples
[ { "docid": "9037a5c6bf683fcc258870c155867835", "score": "0.72798336", "text": "def view_partner_detail(search_key)\n find_link(search_key).click\n end", "title": "" } ]
[ { "docid": "ae79e9df25d1f903190767b95316ad7c", "score": "0.7226406", "text": "def view_partner_details(search_key)\n find_link(search_key).click\n end", "title": "" }, { "docid": "ff5f618a4e88edce003830a2b04fd7ad", "score": "0.648443", "text": "def get_partner_name\n sea...
bea1267a6413a40ebf9abafbebb4ea31
Does some regexing on the returned string from the registry in order to get the actual data we want (e.g. MAFAX87)
[ { "docid": "ec487a3103af4a0ce7c21977a937620b", "score": "0.0", "text": "def get_bccon_group\r\n text = get_single_registry_key('SOFTWARE\\Wow6432Node\\SSTAI\\Connector Container\\Connectors\\SapBCCONOut', 'Filter')\r\n return text.match(/\\(ident=([A-Z]+[0-9]*)\\)/).captures.first rescue nil # Get...
[ { "docid": "255c3bca8d319ab2b33cd2cf75be7e15", "score": "0.5614125", "text": "def getReg(hive,key)\r\n\treturn registry_get_values(hive).find_all{|item| item[:name] == key}[0][:data]\r\nend", "title": "" }, { "docid": "636cd4c8e05db8d93236f1d5b8712a49", "score": "0.55332583", "text":...
c3f8ee1d5f51be4e41424f1636a9068a
The resulting edit method looks like this one:
[ { "docid": "7012274be2eee44cd518698781e91e54", "score": "0.0", "text": "def edit\n instance_variable_set(\"@#{@model_name}\", @klass.find(params[:id]))\n end", "title": "" } ]
[ { "docid": "03269b7353e60e7e373ef0b15969a043", "score": "0.8553366", "text": "def edit() end", "title": "" }, { "docid": "03269b7353e60e7e373ef0b15969a043", "score": "0.8553366", "text": "def edit() end", "title": "" }, { "docid": "f88aeaba1175a4da259885b7696cec80", "...
6557446d384c32d943290d44ab42488f
Returns the likeable ids of this type sorted by most likes in the last days window.
[ { "docid": "a1de74cc2b2377f62843548b85bfa65f", "score": "0.55728054", "text": "def recently_liked(days, options = {})\n options = options.reverse_merge(per: 24)\n Pyramid::Likeable::Likes.recent(self.likeable_type, days, options)\n end", "title": "" } ]
[ { "docid": "98308f4889b949206e71836f4d7f68f2", "score": "0.61443174", "text": "def liked_ids_for(klass)\n ids = Recommendable.redis.smembers(Recommendable::Helpers::RedisKeyMapper.liked_set_for(klass, id))\n ids.map!(&:to_i) if [:active_record, :data_mapper, :sequel].include?(Recommendable...
1590183865c239d02998d609cd09068a
Returns CartReservations that correspond to the IDs in the items array
[ { "docid": "28635f2a802b64afd7dde3535fff6787", "score": "0.83762366", "text": "def cart_reservations\n CartReservation.where(id: @items)\n end", "title": "" } ]
[ { "docid": "1231fbc2aff507d95c80830e496569ad", "score": "0.69340664", "text": "def renewable_reservations\n user_reservations = reserver.reservations\n renewable_reservations = []\n @items.each do |item|\n cart_item_count = item.quantity #renew up to this many of the item\n matching_r...
49c5ec5f62ff33584b4319cc0a23d490
shell command object groups
[ { "docid": "18c7fd383cd11d2a2703b784ccc49e70", "score": "0.63840455", "text": "def test_arg_shell_command_object_groups_structure\n config = @config.dup\n config[:shell_command_object_groups] = []\n assert_raise(ArgumentError){TacacsPlus::Server.new(config)}\n config[:shell_c...
[ { "docid": "8f9acf59d46631d4744502a0823f1624", "score": "0.6774851", "text": "def outer_shell(group)\n end", "title": "" }, { "docid": "8e1028f7695c29eee069de94223b17bc", "score": "0.6774067", "text": "def _create_group_commands\n ::Guard.groups.each do |group|\n next if...
d0df87b1bea9b55706b1c7c4184cdaba
PATCH/PUT /posts/1 PATCH/PUT /posts/1.json
[ { "docid": "4d648180d2750bee43946a825d3c892d", "score": "0.0", "text": "def update\n @calendar = Calendar.find(params[:calendar_id])\n @event = Event.find(params[:event_id])\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to [@calendar,@event,@post],...
[ { "docid": "2a642a611c63a85b6ef6e72d09830e50", "score": "0.7186324", "text": "def update\n render json: Post.update(params[\"id\"], params[\"post\"])\n end", "title": "" }, { "docid": "e2c68cadce474543233abd080997b452", "score": "0.7040601", "text": "def update\n respond_w...
802e27ec2e5d423f6c10dbf3a5d1568c
PUT /posts/1 PUT /posts/1.json
[ { "docid": "42a74e21c36708a0b395584cdced9e64", "score": "0.0", "text": "def update\n @post = Post.find(params[:id])\n authorize! :update, @post\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully upda...
[ { "docid": "fef606243741752603cf8b7a9b458009", "score": "0.70573425", "text": "def update\n user = User.find_by({token: env['HTTP_TOKEN']})\n post = user.posts.find(params[:id])\n post.update(post_params)\n render json: post\n\n end", "title": "" }, { "doc...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "d3de5ab1797d93469617e2aa5c3d00e3", "score": "0.0", "text": "def set_bulb\n if @shard == \"odd\"\n @bulb = Bulb.find(1)\n else\n @bulb = Bulb.find(2)\n end\n params.delete :shard_override\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...
194ec89279926ab7e3b1ebcf80c22943
Returns a hash containing all user attributes
[ { "docid": "6a7f62a395e2a952d3c53f17dc4f0a24", "score": "0.0", "text": "def to_hash\n hash = {}\n instance_variables.each do |var|\n hash[var.to_s.delete('@')] = instance_variable_get(var)\n end\n hash\n end", "title": "" } ]
[ { "docid": "7489d46b14ca34e642148a2b251dd84c", "score": "0.7640047", "text": "def attributes_from_user\n return {} unless @current_user&.loa3?\n\n {\n 'first_name' => @current_user.first_name,\n 'last_name' => @current_user.last_name,\n 'birth_date' => @current_u...
30eb295ecf08ae7417427142723fd001
GET /schedules/1 GET /schedules/1.xml
[ { "docid": "140074d16ee716c316e6e8eef2ea310f", "score": "0.0", "text": "def show\n @blocks = @schedule.blocks(:for_registration => true).sort_by { |b| b.start }\n @attendances = if current_person\n current_person.attendances\n else\n []\n end\n \n respond_to do |format|\n ...
[ { "docid": "fd9ff3532876e63492a04b727b9eb13d", "score": "0.7369666", "text": "def index\n @schedules = Schedule.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @schedules }\n end\n end", "title": "" }, { "docid": "8885e877d62e5c...
c2350108c1b0d888db1f63034445b308
define what happens when the measure is run
[ { "docid": "d109c9cf33d5d23ad772e45b6290a319", "score": "0.0", "text": "def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n \n #use the built-in error checking \n if not runner.validateUserArguments(arguments(model), user_arguments)\n return false\n end\n\...
[ { "docid": "99ab945a1927e84fe17934e1440b9eb0", "score": "0.7556993", "text": "def measure(&block); @measure = block; end", "title": "" }, { "docid": "98be183bacea0b93f865dcb476b3ac9c", "score": "0.71152234", "text": "def measure(&block)\n @measure = block\n end", "title": "" ...
c5da6b15af5f33c1de4660f9e59ec3c4
Charge the object item Params: +data+:: data to send Returns: response dictionary
[ { "docid": "0b85da14ea4ab025a33b66eb9ae75a35", "score": "0.6557974", "text": "def charge(data = nil)\n @charge_mixin.json_dict = @json_dict\n @charge_mixin._deleted = @_deleted\n @charge_mixin.charge(data)\n @json_dict = @charge_mixin.json_dict\n @_deleted = @charge_mixin._delet...
[ { "docid": "1b763b584e80d17911657f6782975b70", "score": "0.60468763", "text": "def charge\n render json: DrinkCommand::ChargeSerializer.new( do_charge! ), status: :created\n end", "title": "" }, { "docid": "ee0987e2280229471bf8e02ed32d76e3", "score": "0.58428633", "text": "def da...
9f157893311fd9d76af858c6ab54e40c
Delete Alert Deletes an alert using alert id, tiny id or alias
[ { "docid": "ebdb4aab67e9fa7d6edc21083730f3ac", "score": "0.7101321", "text": "def delete_alert_with_http_info(identifier, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AlertApi.delete_alert ...\"\n end\n # verify the required paramete...
[ { "docid": "16ccac465702674ba37743913d021512", "score": "0.79099894", "text": "def delete_alert(alert_name, project_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'DELETE'\n\t\targs[:path]['AlertName'] = alert_name\n\t\targs[:path]['ProjectName'] = project_name\n\t\targs[:patt...
05fe899e900dcfab7cced8a06ee21741
DELETE /fundstore_categories/1 DELETE /fundstore_categories/1.json
[ { "docid": "56bb67fa892c0547469c2026d89dbb90", "score": "0.7557115", "text": "def destroy\n @fundstore_category.destroy\n respond_to do |format|\n format.html { redirect_to fundstore_categories_url, notice: 'Fundstore category was successfully destroyed.' }\n format.json { head :no_conte...
[ { "docid": "040029ab8f2de7687d208fada21276c4", "score": "0.7252344", "text": "def destroy\n @fee_category.destroy\n respond_to do |format|\n format.html { redirect_to fee_categories_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "976f2bb9...
946643c8263dd05a96499eb41162b07e
GET /thread_objects GET /thread_objects.json
[ { "docid": "310bd0b9c42e5d25a1b0e136899487db", "score": "0.7778271", "text": "def index\n @thread_objects = ThreadObject.all\n end", "title": "" } ]
[ { "docid": "5bb73c324141e4c6fde69df5b0163e21", "score": "0.75250787", "text": "def index\n @thread_objs = ThreadObj.all\n end", "title": "" }, { "docid": "33a6c96e627af346e7fe99f01320e4c1", "score": "0.70622396", "text": "def index\n @chat_threads = current_user.chat_threads.o...
3a8e8b3377a9e6f0a5f87279c1060583
Parses data to populate all the subject and course data for the semester calls: add_sections_to_course
[ { "docid": "41fcdd87d6f85ae776cbb4d88fea365d", "score": "0.56888384", "text": "def add_subjects_to_semester(current_semester,data)\n subject_catalog = data['subject']\n Subject.transaction do\n subject_catalog.each do |subject|\n puts \"-------\\n#{subject['subjectCode']}\\n-------\\n\"\n ...
[ { "docid": "2361746999e244fdb95d096c95756af1", "score": "0.7374522", "text": "def parse_courses(semester, courses, cs_data_available)\n semester[:classes].each do |course|\n course[:sections].select{|x| course[:role] == 'Student' && x[:is_primary_section]}.each do |section|\n parsed...
e5c207c646bf15e3169ca14478cede8d
return a list of all substrings of a string that are palindromic Requirements Input: string Output: array of strings Palindromic: each substring must consist of the same sequence of characters forwards as it does backwards Consider all characters, case matters use all_subrstings method Test cases palindromes('abcd') ==...
[ { "docid": "24bbeb04c1c1ef07bc7a5f582168760d", "score": "0.0", "text": "def substrings_at_start(string)\n arr = []\n for i in 0..string.length - 1\n arr << string[0..i]\n end\n arr\nend", "title": "" } ]
[ { "docid": "9bfb11ad2ce84c8f977c025cf7ec5682", "score": "0.8713475", "text": "def palindromic_substrings(string)\n substrings = all_substrings(string)\n palindromes = []\n substrings.each do |substr|\n if substr == substr.reverse\n palindromes << substr\n end\n end\n palindromes\nend", ...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "a31aafd316ed3af5fe8f822e92f0295b", "score": "0.0", "text": "def movie_review_params\n params.require(:movie_review).permit(:user_id, :movie_id, :review)\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...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "a2230dfb4c26a2b18c289514f07e69c8", "score": "0.0", "text": "def set_newcomer\n @newcomer = Newcomer.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...
8bab789d8537c9dd80fe1013480dc69d
DELETE /buddy_data/1 DELETE /buddy_data/1.json
[ { "docid": "1f9f679e98c971f443a8536dc2b8e622", "score": "0.7406161", "text": "def destroy\n @buddy_datum = BuddyDatum.find(params[:id])\n @buddy_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to buddy_data_url }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.6896384", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "...
21d1e3624587377305264f207df59553
Return a list of roles.
[ { "docid": "a7d95f4b58468d540dea0566f6615c64", "score": "0.7219646", "text": "def display_roles\n roles = []\n roles << 'Admin' if admin?\n roles << 'Coordinator' if coordinator?\n roles << 'Instructor' if instructor?\n roles << 'PU Staff' if pu_staff?\n roles << 'Proofreader' if proof...
[ { "docid": "be168d7c75df5b88ee256c8e85f7a7f1", "score": "0.8473601", "text": "def list\n get('roles')['roles']\n end", "title": "" }, { "docid": "dfab255d99499ec4df74592d553f134e", "score": "0.8304805", "text": "def get_all_roles\n _get('roles', ApiRole, true...
5d9104db4532361fd6b6c0e0995d571d
returns number of matches or false for breakage
[ { "docid": "db26fcd8f12bde8ccb9c7cbf801ed8a1", "score": "0.0", "text": "def validate_linear(d, start, where)\n # warn [\"vallin\", d, start, where].inspect\n fail unless Array === d\n case where[0]\n when :grpent\n # must be inside an array with nested occurrences\n val...
[ { "docid": "0d3bbd35493e6a03727a1d1489298aef", "score": "0.8472252", "text": "def matches_count?(count); end", "title": "" }, { "docid": "e82317aecd3687d7383180067d3c3b4b", "score": "0.785022", "text": "def number_match_count\n\t\t\ttotal_match_count - exact_match_count\n\t\tend", ...
7b17313f7f1ccae0b38a0d471b0cf98f
verify current and previous hash match
[ { "docid": "58ef3a5b0a7d570c2d999015ed9ce733", "score": "0.6817519", "text": "def verify_hash(split_line)\r\n if @prev_hash != split_line[1].to_i(16)\r\n puts \"Line #{@line_cnt - 1}: Previous hash was #{split_line[1]}, should be #{@prev_hash_x}\"\r\n puts 'BLOCKCHAIN INVALID'\r\n @exe...
[ { "docid": "c361796c979c120d9f59d76da2086e49", "score": "0.77395576", "text": "def check_prev_hash(prev_hash, curr_hash, _b_num)\n return 4 unless prev_hash.eql? curr_hash\n\n 0\n end", "title": "" }, { "docid": "5517ec265587454286b42a864e96397c", "score": "0.76704335", "text"...
0ba5b1ca81f02a4913a1f5e2b125ada9
service to delete the gallery input : gallery_id output : Gallery deleted successfully!
[ { "docid": "28144c1b9157fa3cf66d7ca4d83348f0", "score": "0.7533655", "text": "def delete_gallery\n @retval = Hash.new()\n unless params[:selected_ids].blank?\n params[:subchapter_id] = params[:parent_id] #for sync service\n gallery_ids = JSON.parse(params[:selected_ids])\n for galle...
[ { "docid": "d22f29f160f8440812a6a7d65690aea7", "score": "0.7966119", "text": "def destroy\n @gallery = Gallery.find(params[:id])\n @gallery.destroy\n\n respond_to do |format|\n format.html { redirect_to galleries_url, :notice => \"Gallery was successfully delete.\" }\n format.json { h...
f7f076027601cd863529e103bb070814
TODO: combine this and listing code that copies data from property so that both models can share the same code to clone property data.
[ { "docid": "c2b281d43d1b237aae4f4fcfb9ee151b", "score": "0.0", "text": "def create_default_listing\n \n end", "title": "" } ]
[ { "docid": "759f3b560ffa8cb5d0feaf15b6258f2a", "score": "0.6857124", "text": "def dup\n super.copy_properties(self)\n end", "title": "" }, { "docid": "4be50fb0550a195a39788f651919de09", "score": "0.67488676", "text": "def copy_associations_from_property\n unless self.prope...
401cf611d5843b9a7d5fd8e416a093f9
load_workflow_state and persist_workflow_state can be overriden to handle the persistence of the workflow state. Default (non ActiveRecord) implementation stores the current state in a variable. Default ActiveRecord implementation uses a 'workflow_state' database column.
[ { "docid": "b6f5bfdd59344fb749eb1dffe30829ba", "score": "0.797428", "text": "def load_workflow_state\n @workflow_state if instance_variable_defined? :@workflow_state\n end", "title": "" } ]
[ { "docid": "1457ad55930008c37dfca9158cfabea1", "score": "0.7742941", "text": "def load_workflow_state\n get_workflow_state || super\n end", "title": "" }, { "docid": "97551b95ff078cd90f8a617f4fec6c3a", "score": "0.7449374", "text": "def persist_workflow_state(new_value)\n up...
02984abe5a8ac80112df04d6a51fdb7f
Initializes a Field instance given the definition passed to the scoped_search call on the ActiveRecordbased model class.
[ { "docid": "e1515dd73e161d5482a587e80568e121", "score": "0.5803076", "text": "def initialize(definition, options = {})\n @definition = definition\n @definition.profile = options[:profile] if options[:profile]\n \n case options\n when Symbol, String\n @field = ...
[ { "docid": "12cc72315ef0483e791b7027733170ca", "score": "0.67208165", "text": "def initialize(definition,\n field = nil,\n aliases: [],\n complete_enabled: true,\n complete_value: nil,\n default_operator:...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "702445fece8aef56ea2362aa843ea25d", "score": "0.0", "text": "def smszfblog_params\n params.require(:smszfblog).permit(:zfbid, :qian)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74954116", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6956924", "text": "def strong_params\n params.require(:request).permit(param_whit...
ea5e43b5ac2d0cc09e1ae7a4b4e363f8
Can be called multiple times to add additional exposed methods. Type can be one of the following: :integer, :float, :decimal, :datetime, :date, :timestamp, :time, :text, :string, :binary, :boolean Or for associations, :has_many, :has_one Or for virtual associationsm :has_many, :has_one
[ { "docid": "7429303ffaacca6e208fee5c6889a27e", "score": "0.6311306", "text": "def expose(method_name, type)\n (self.naked_models_exposed_columns ||= []) << NakedModel::Column.new(method_name.to_s, type)\n if (type.to_sym == :has_many || type.to_sym == :has_one) && !reflect_on_association(metho...
[ { "docid": "9a75192d16a82eb5927086b3704a6253", "score": "0.6545865", "text": "def add_type(type)\n end", "title": "" }, { "docid": "9a75192d16a82eb5927086b3704a6253", "score": "0.6545865", "text": "def add_type(type)\n end", "title": "" }, { "docid": "52484b648895cd...
d6808f01265d3c2d44ff43fcb4820dd9
Create new instance of view. == Parameters flowcell_record:: Instance of FlowcellRecord to create a config.txt file from.
[ { "docid": "cb5356a7a38a124e076bf63e265955d8", "score": "0.49303493", "text": "def initialize flowcell_record, lanes = [1,2,3,4,5,6,7,8]\n @lanes = convert_lanes(filter_lanes(flowcell_record, lanes))\n @input_dir = flowcell_record.paths.unaligned_dir\n end", "title": "" } ]
[ { "docid": "7139cc0b57f15cf64267161fe76de59d", "score": "0.55582607", "text": "def createFlowcellDefinitionXML()\n obj = FlowcellDefinitionBuilder.new(@fcName, @baseCallsDir)\n end", "title": "" }, { "docid": "7139cc0b57f15cf64267161fe76de59d", "score": "0.55582607", "text": "def...
05fae871f44bc084ae3761b4d75c55c9
Detects collision with the ball. If it happens bounces ball back to the game.
[ { "docid": "f06fabbb78014d05cf8d9ce58e7037c7", "score": "0.83193165", "text": "def ball_collision(ball)\n angle = ball.angle\n if 90 < angle && angle < 270\n # detect bounce from the right side\n ball_right_collision(ball)\n elsif angle < 90 || angle > 270\n ...
[ { "docid": "0fa9fcf5b1e61cde8725dbd42b49c0a6", "score": "0.785722", "text": "def ball_collision(ball)\n move_x, move_y = count_move_vector(ball)\n mx, my = pixels_to_grid(ball.x, ball.y)\n if inside?(mx, my)\n ball.angle = (ball.angle + 180) % 360\n @blocks[my][mx]...
bd3a7dfddc30bc69012064ac1ec450c4
Given a hash with numeric values, return the key for the smallest value
[ { "docid": "edccae6b54f0f500364f28e658e6f592", "score": "0.0", "text": "def key_for_min_value(name_hash)\n new_numbers = []\n if name_hash.length == 0\n nil\n else\n first_value = name_hash.first[1]\n return_key = \"\"\n name_hash.collect do |key, value|\n if first_value >= value\n ...
[ { "docid": "10348c0f7efbf074c6402f6f47742839", "score": "0.88218015", "text": "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |key, value|\n if value < lowest_value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nen...
9fd7ae46373fbea85853eb4f6e3eeb84
A normal block level/container tag.
[ { "docid": "877a772947eccd9869ffa0b797500c97", "score": "0.6491736", "text": "def full_tag(name, attributes, indent_outer, indent_inner, &block)\n\t\t\tif block_given?\n\t\t\t\tif indent_outer\n\t\t\t\t\t@output << \"\\n\" if @level.last > 0\n\t\t\t\t\t@output << indentation\n\t\t\t\tend\n\t\t\t\t\n\t\t...
[ { "docid": "e997d167464be890f1d0945e288b7aa6", "score": "0.6596177", "text": "def block_node\n parent if block_literal?\n end", "title": "" }, { "docid": "885fcb9297609c4741ba31abb4b5146a", "score": "0.64487827", "text": "def full_tag(name, attributes, indent_outer, inden...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "ac51be562042029909f446255991eed1", "score": "0.0", "text": "def update!(**args)\n @cursor = args[:cursor] if args.key?(:cursor)\n @partition = args[:partition] if args.key?(:partition)\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...
83c989adb502e3f8fc206c20b6f72894
generate an address string for geocoding
[ { "docid": "18df6675da20d378c90cd2d8fcdc47ea", "score": "0.0", "text": "def address_for(pattern, match_data, truck)\n extracted_part = if pattern[:included_parts].empty?\n match_data[0].strip\n else\n pattern[:included_parts].inject(\"\") do |memo, part|\n memo += (part....
[ { "docid": "5d2d594732c72599a64200c8c662419f", "score": "0.8527237", "text": "def geocoded_address\n \"#{address1} #{address2} #{address3} #{address4} #{locality} #{region} #{postal_code} #{country}\"\n end", "title": "" }, { "docid": "d17e181dcfb1fe99f24e13e79ee08a69", "score": ...
fc904f83d0c19e03e3a6801c7f331729
Este es un getter
[ { "docid": "c3238615ed7f210f04cc7fa012e08842", "score": "0.0", "text": "def instance_var\r\n @@class_variable\r\n end", "title": "" } ]
[ { "docid": "5a3dc0e6482d536f380828c82e0f7fb7", "score": "0.83085674", "text": "def getters; end", "title": "" }, { "docid": "1fd669a638293fd8fd6c51cd8485b47a", "score": "0.7493179", "text": "def get()\n \n end", "title": "" }, { "docid": "66f796af0ce4a5738b4e818...
ea21672a14f86f383bf11453393a3a3c
Update an existing Service Modifies the specified Service.
[ { "docid": "ea8aee44e5457e7d9e9b0f38afca15cb", "score": "0.0", "text": "def update_service_insertion_service_with_http_info(service_id, service_definition, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesServiceInsertionA...
[ { "docid": "3c189e91abb3ddfe774e25a68064aa1c", "score": "0.78450537", "text": "def update(id, service)\n @service = Locomotive::Service.get(id)\n raise NotFound unless @service\n if @service.update_attributes(service)\n redirect resource(@service), :message => {:notice => 'Service ...
af2010a229a7c09f1d5372eed211ed9c
PATCH/PUT /logs/1 PATCH/PUT /logs/1.json
[ { "docid": "701eeb702be94ce1426c37426e6f43ac", "score": "0.6072313", "text": "def update\n respond_to do |format|\n if @log.update(log_params)\n format.html { redirect_to @log, notice: 'Log was successfully updated.' }\n format.json { render action: 'show', status: :ok, location: @...
[ { "docid": "60c9f38bf8c1264df70ec80a5a2b16cc", "score": "0.6369519", "text": "def update\n @log = Log.find(params[:id])\n\n if @log.update(log_params)\n head :no_content\n else\n render json: @log.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "do...
a2ea940b5f038a1feb4d5a0bbfbf964f
PATCH/PUT /citations/1 PATCH/PUT /citations/1.json
[ { "docid": "8322a45ff6930af45f53073b4740653b", "score": "0.6846946", "text": "def update\n if @citation.update(citation_params)\n render :show, status: :ok, location: @citation\n else\n render json: @citation.errors, status: :unprocessable_entity\n end\n end", "title": "" } ]
[ { "docid": "0f7695554316cd28127c2a028c409b62", "score": "0.69271386", "text": "def update\n # { clinic: {id: references, \"license_id\"=>nil, \"name\"=>string } }\n \n if @clinic.update_attributes(params[:clinic].except(:api_license_id))\n head :no_content\n ...
e7c6d18fa04fc0dc96685a93805519aa
Fetch test economy details Author: Puneet Date: 15/04/2019 Reviewed By:
[ { "docid": "f6a0c50e9aeb159ac35f45dfb6bab0ba", "score": "0.75962466", "text": "def fetch_test_economy_details\n get('')\n end", "title": "" } ]
[ { "docid": "accd210344d9dd7b88e424797d5aa028", "score": "0.5818908", "text": "def details(trade_review_id)\n API::request(:get, \"trade_reviews/#{trade_review_id}\")\n end", "title": "" }, { "docid": "1fb3995f2906597e6d942473d758769a", "score": "0.57214123", "text": "def ...
4ed2d0d5dadba11bed002ceee3b17986
Before saving the record to database we will crypt the password using SHA1. We never store the actual password in the DB.
[ { "docid": "808afee14a5a9781b3232e87b76d8bbb", "score": "0.8340174", "text": "def crypt_password\n\t\twrite_attribute \"password\", self.class.sha1(password)\n\tend", "title": "" } ]
[ { "docid": "c633dfb601507f835a724d41141ad43d", "score": "0.8381367", "text": "def crypt_password\n \t\twrite_attribute \"password\", self.class.sha1(password) unless self.password.empty?\n end", "title": "" }, { "docid": "2643df335973f88d8625e1d9370acdbb", "score": "0.8363648", "...
11d0ba95499be8634fcad24a0849ab89
override hash to maintain the property that a.eql?(b) ==> a.hash == b.hash
[ { "docid": "9d17b8a8350ea7c8d7e13806b9455c9a", "score": "0.0", "text": "def hash\n \"#{@ipv4}#{@port}\".hash\n end", "title": "" } ]
[ { "docid": "bdb56567da14bb61caedb443f06ddc47", "score": "0.7519983", "text": "def ==(other)\n super || @hash == other.hash\n end", "title": "" }, { "docid": "36cb49d8d72d23f278d7bd9eeacc26fa", "score": "0.7207335", "text": "def ==(other)\n self.hash == other.hash\n en...
ac46fdb07c2c7d2474c07c0b59215115
Inventory year billing summary Billing summary grouped by month an resource
[ { "docid": "a1b241f2aee347a2e562b1c2432fa394", "score": "0.66230935", "text": "def products_billing_summary_by_stock(year)\n\n current_year = DateTime.now.year\n\n # Build the result holder\n total_cost = 0\n stock_items = if current_year == year\n ...
[ { "docid": "acde240e3900578e4e6f5cb4b8186be2", "score": "0.61702687", "text": "def make_year_stats(months)\n rows = months.map{|month|\n items = Item.all(:conditions => {\n :date => month_range(month),\n :type => [\"Expense\", \"Income\"]\n }).group_by(&:category)\n\n mak...
3c6084f9ebde47b8b870eb50d55ab350
This method adds a new Task to OmniFocus based on the new_task_properties passed in
[ { "docid": "6911ab835055c508b0135b7ffc6c2126", "score": "0.68015707", "text": "def add_task(omnifocus_document, new_task_properties)\n # If there is a passed in OF project name, get the actual project object\n if new_task_properties['project']\n proj_name = new_task_properties[\"project\"]\n pro...
[ { "docid": "edeffe8e1dc126179634eab2eaab4b0d", "score": "0.68185544", "text": "def new_task\n @task = Task.new\n end", "title": "" }, { "docid": "219e166f82adcfeaf400810697f83ba7", "score": "0.6542437", "text": "def add_task(new_task)\n @agenda << new_task\n end", "ti...
c9f3cb37e150f6341959df59e4d7b803
development, staging and prod are ok; everything else not so much
[ { "docid": "6e9511cc6f3bfaa47d9fce098cbf6be0", "score": "0.0", "text": "def valid?(host)\n # TODO: replace with /\\.artsy.net$/\n # (it's stricter for now to generate test data)\n return true if host =~ /^www.artsy.net$/\n\n # TODO: uncomment after this is verified working, to ignore dev requests\n ...
[ { "docid": "11c4b0c2125cfd372898dc38ae7a3fc6", "score": "0.7108453", "text": "def health_with_staging_environment_setup\n\n\tENV[Constants::ENVIRONMENT_VAR_FOR_STAGING] = '1'\n render plain: 'OK'\n end", "title": "" }, { "docid": "0e307583a81349e0dfbe9a6cf2778a3a", "score": "0.707005...
1097a7e7758f08d32addfc88ea3fdcab
GET /users GET /users.json
[ { "docid": "ef11304738e3e605641c54dd4c5d149e", "score": "0.0", "text": "def index\n if current_user && current_user.admin\n @users = User.all\n else\n redirect_to authenticated_root_path, :alert => \"Access denied\"\n end\n end", "title": "" } ]
[ { "docid": "9f7c735ace683c5c2b12c914cc9ad8a8", "score": "0.84081405", "text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end", "title": "" }, { "docid": "543509c6588e2f79a8dbcd1cdcdaf7b9", "score": "0.836071", "text": "def users\...
56b05cac82ff3f8962386ca6e4006526
diff calls this method in context of new record
[ { "docid": "3a08390e2f146a0c0b9c620981fa2cd9", "score": "0.0", "text": "def follower_uids\n if new_record?\n @reserved_follower_uids\n else\n if instance_variable_defined?(:@persisted_follower_uids)\n @persisted_follower_uids\n else\n uids = nil\n uids = InMemor...
[ { "docid": "8656459868656191c9cde7a91dcaa545", "score": "0.66002584", "text": "def create_diff(diff_attributes = {})\n record_state = self.class.record_state(record)\n snapshot_state = self.state\n from = {}\n to = {}\n\n record.class.track_changes_fields...
06260d59407dadd20bf947a59b3be2ea
F for ICC(2,1) and ICC(2,k)
[ { "docid": "8cba3084230b727109721007482b29a2", "score": "0.5797979", "text": "def icc_2_1_fs(pp,alpha=0.05)\n fj=jms.quo(ems)\n per=1-(0.5*alpha)\n vn=(k-1)*(n-1)*((k*pp*fj+n*(1+(k-1)*pp)-k*pp)**2)\n vd=(n-1)*(k**2)*(pp**2)*(fj**2)+((n*(1+(k-1)*pp)-k*pp)**2)\n v=vn.quo...
[ { "docid": "17492d26776b7c5dfea8d5246723a7e0", "score": "0.6440641", "text": "def hcf(i,j)\n \nend", "title": "" }, { "docid": "b2753a4e6016cb18de6b4710eb99d8da", "score": "0.62999886", "text": "def icc_1_1_ci(alpha=0.05)\n per=1-(0.5*alpha)\n \n fu=icc_1_f.f*Dis...
0f23edaf51f2a738d517c8bbb2bea3ea
hide_gridlines() Set the option to hide gridlines on the screen and the printed page. There are two ways of doing this in the Excel BIFF format: The first is by setting the DspGrid field of the WINDOW2 record, this turns off the screen and subsequently the print gridline. The second method is to via the PRINTGRIDLINES ...
[ { "docid": "ba52ca31999219f4359abde7f431b226", "score": "0.8049084", "text": "def hide_gridlines(option = 1)\n if option == 0\n @print_gridlines = 1 # 1 = display, 0 = hide\n @screen_gridlines = 1\n elsif option == 1\n @print_gridlines = 0\n @screen_gridlines = 1\n else\n...
[ { "docid": "ec81c7d0fd86f898568deb6ea936414e", "score": "0.55513084", "text": "def toggle_grid\n if @show_grid\n self.show_grid = false\n else\n self.show_grid = true\n end\n end", "title": "" }, { "docid": "0fbac8918be9681add7c518e97728ea9", "score": "0.5...
f5bc90c2733b891bffd0631c459c7df3
Init user object Author: Alpesh Date: 11/01/2018 Reviewed By: Sunil
[ { "docid": "2a06e9989e74dc3a0461b2416f1791c8", "score": "0.0", "text": "def init_user_obj_if_needed\n\n return success if @user.present?\n\n r = generate_login_salt\n return r unless r.success?\n\n password_e = User.get_encrypted_password(@password, @login_salt_hash[:plaintext])\n\n ...
[ { "docid": "beabdf38c7bf8850e9cf4e7a6767638d", "score": "0.7416852", "text": "def user_init; end", "title": "" }, { "docid": "7137f96a00a9014bfb3f7e8d25777d25", "score": "0.7387329", "text": "def initialize\n\t\t@user = \"User 1\"\n\tend", "title": "" }, { "docid": "678a8...
a846b492c3f7517d27b4e11800e428fb
Handle the cases where a double quote is next to a single quote
[ { "docid": "f1a08e0c7d3dd99d6e36b64bb246ae42", "score": "0.7520553", "text": "def single_inside_double_quote(str)\n str.gsub(/(\\\")(\\')(\\S)/, @ldquote + @lsquote + '\\3')\n .gsub(/(\\\")(\\')(\\S)/, '\\1' + @rsquote + @rdquote)\n end", "title": "" } ]
[ { "docid": "6ea2afbca694cea818af95fe2e60fff4", "score": "0.8117472", "text": "def parse_smart_quotes; end", "title": "" }, { "docid": "7d690eb18b939ada9cc3ac2ff4434c48", "score": "0.78397226", "text": "def workaround_quotations(text)\n if single_quote?(text) && !double_quote?(...
6c71b8563450367d5b4b969bfdd9107d
Copia directoria local a remote ::local:: directorio local ::remote:: directorio remote
[ { "docid": "c7f8ed16f66b83f42645b3476b539e6f", "score": "0.5996202", "text": "def cp_dir(local, remote)\n @actions << {:action => :cpdir, :local => local, :remote => remote}\n end", "title": "" } ]
[ { "docid": "1a54cdafac096acee3489d282315ddd7", "score": "0.63814425", "text": "def get(remote, local)\n @fs.copyToLocalFile(Path.new(remote), Path.new(local))\n end", "title": "" }, { "docid": "8c0e15a959e8955f5045fe7da0638dd6", "score": "0.6185499", "text": "def serveur_to_local...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "089f232e74e7a01242314b5777f7ba1b", "score": "0.0", "text": "def course_fact_params\n params.require(:course_fact).permit(:kind, :position, :icon, :number, :title, :description)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
d03fde6467b89b54e8125e10f0f569dc
Check if there is a cycle in the final path. Use for testing in irb.
[ { "docid": "d35147ac848b65fe228d99ba668e1752", "score": "0.60898906", "text": "def check_for_cycle\n i = @final_coordinates.length - 1\n while i > 0\n puts \"------\"\n for x in (0..(i - 1)) \n puts \"#{self.legal_moves(@final_coordinates[i]).include?(@...
[ { "docid": "587477c76517e4550f969cdbc46c7a48", "score": "0.6915111", "text": "def cycles?\n check_for_cycles(@head, @head)\n end", "title": "" }, { "docid": "9429a8efca73e808ee9b200d16a0a262", "score": "0.67984325", "text": "def has_cycle?\n !@graph.acyclic?\n end", "titl...
5a470d6b5d375166c91732e5dccab3f5
Defines a route without block smoothly
[ { "docid": "d91f5f346320d8960c2f1b7608c2446d", "score": "0.0", "text": "def on(path, options = {})\n verb = (options.delete(:type) || 'GET').to_s.upcase\n return bound_filter(verb, path, options) if FILTER_NAMES.include?(verb)\n method_name = options.delete(:to)\n process_bou...
[ { "docid": "021d7be77e91679eea3a5ee8f43a9d58", "score": "0.73404205", "text": "def create_route\n nil\n end", "title": "" }, { "docid": "c2a222197a48cca8d0f1cb837c49a51a", "score": "0.7130785", "text": "def routes(&block); end", "title": "" }, { "docid": "13126e11...
e612ead7a9edc6545d6433237b68c35c
output script in raw binary format
[ { "docid": "aad4cc3b1ab28d3473f0ad7b3bcbe80a", "score": "0.0", "text": "def to_payload\n payload = Bitcoin::Protocol.pack_var_int(stack.size)\n stack.each{|e|\n payload << Bitcoin::Protocol.pack_var_int(e.htb.bytesize)\n payload << e.htb\n }\n payload\n end", "title": "" } ]
[ { "docid": "612ffc927115efaa2755e52164c0b3d7", "score": "0.66918504", "text": "def binary\n e = Executable.new\n e.download\n e.extract\n e.binary\n end", "title": "" }, { "docid": "e9d89ed87ce5dcce048582e0c8b2ea19", "score": "0.6501495", "text": "def...
f072d24f7a23e456c49f05c44c5ad807
PUT /heroes/1 PUT /heroes/1.json
[ { "docid": "57bf4d33d479510b1127ed9b4f8fc440", "score": "0.7362485", "text": "def update\n @hero = Hero.find(params[:id])\n\n respond_to do |format|\n if @hero.update_attributes(params[:hero])\n format.html { redirect_to @hero, notice: 'Hero was successfully updated.' }\n format...
[ { "docid": "2fcb80052fce5b0df3cf38c5184bd17c", "score": "0.7766109", "text": "def update\n respond_to do |format|\n if @hero.update(hero_params) \n format.json { render json: @hero, status: :ok, location: api_v1_heroes_url(@hero) }\n else \n format.json { render ...
bc641eee26e6722eea2f12d833be4e2d
Baseline implementation for the get_entry REST call
[ { "docid": "f6b9dfbd838558eb03bcdafd3eb84e97", "score": "0.63999623", "text": "def get_entry request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_get_entry_request...
[ { "docid": "3b7ab3124e04ea8ee8777d6284e26e2f", "score": "0.7249991", "text": "def get_entry(entry); end", "title": "" }, { "docid": "95cef9e34537e5ae9a527cee5b3ae206", "score": "0.6759436", "text": "def request_entry(resource_class, id, format, use_format_param=false)\n @clien...
6d578494d141ac19fd98c4bc05a01145
List DNS records Returns an array containing DNS record object
[ { "docid": "8a4f2fd76eb4f010395e743f277dd14d", "score": "0.8103453", "text": "def list_dns_records_array(domain)\n dns_records = []\n doc = Nokogiri::XML(list_dns_records(domain))\n doc.xpath('/namesilo/reply/resource_record').each do |r|\n record = DnsRecord.new\n record.re...
[ { "docid": "faafdfd089c28a71126ce51cbf3e706f", "score": "0.8490993", "text": "def dns\n doc = request(\"dns-list_records\")\n raise ApiError if (doc/:result).innerHTML == \"error\"\n (doc/:data).inject([]) { |records, dns| records << Dns.new_from_xml(dns); records }\n end", "title"...
4abdab5c61d66e9d501d1e9318529883
Installation Return the prefix
[ { "docid": "9f16f928d7a33265e7f13311f9846d6c", "score": "0.0", "text": "def prefix\n File.read(File.join(TEMPLATE_PATH, \"prefix\")) rescue \"*filter\"\nend", "title": "" } ]
[ { "docid": "654acf4afa8a42f74582fa79aaeff204", "score": "0.81783026", "text": "def prefix_dir\n get('prefix', 'install')\n end", "title": "" }, { "docid": "388163d61a70861fc7f2953ce9975d4e", "score": "0.8165432", "text": "def prefix_dir\n get(\"prefix\", ...
35352cf3c276e03eb9c70c68bc7521d4
Creates and outputs a "Clear" button on the screen using a label and a border. If the button is clicked, the filled squares are cleared, making the filled_squares collection empty.
[ { "docid": "61334e4476664cf08fd3c21988bfa65e", "score": "0.7244368", "text": "def draw_buttons\n x, y, w, h = 390, 50, 240, 50\n state.clear_button ||= state.new_entity(:button_with_fade)\n\n # The x and y positions are set to display the label in the center of the button.\n # Try cha...
[ { "docid": "9fdc864d420852454633a001d1ac6a07", "score": "0.71325225", "text": "def draw_buttons args\r\n x, y, w, h = 720, 80, 240, 50\r\n args.state.clear_button ||= args.state.new_entity(:button_with_fade)\r\n\r\n # The x and y positions are set to display the label in the center of th...
a6f20367624958433244c6d9dba66546
allowed squares are squares upon which a ship can rest its hull
[ { "docid": "352bac69e51474a8bc2bbd748d4d06f9", "score": "0.59956497", "text": "def make_heat_map allowed_squares, heat_map = {}\n\n score_point = lambda do |point|\n case @opponent.grid.value_for_point point\n when :unknown \n 1.0\n when :empty \n 0.0\n ...
[ { "docid": "290dd3bcb3b4b3a88bfd154fcf03b2ae", "score": "0.64719594", "text": "def available_squares\n self.squares.select{|square| square == ' '}\n end", "title": "" }, { "docid": "75b2c03a4c2b970a232964cfaa450929", "score": "0.6429974", "text": "def valid_squares(move_array, pi...