query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
75cedc6fb8e14d9e9d1a7703a2bec3e8
We only add the transaction amount to the net_amount after the transaction has been settled and we know we'll be collecting the money.
[ { "docid": "f7ef3e0a7146d7fbe67a52ae19834d6f", "score": "0.70524657", "text": "def add_amount_to_net\n increment(:net_amount, amount)\n save!\n end", "title": "" } ]
[ { "docid": "b2fa7ae08bef7ffb24da85a894622fd0", "score": "0.73822135", "text": "def check_outstanding\n self.ur_transactions.inject(0){|p,n| p += n.trans_amount }\n end", "title": "" }, { "docid": "f88a5a9f8c9a3702937aeeb578eb3dd1", "score": "0.6690555", "text": "def recalculate_o...
05262d669cc5df5e0e0888e0d61e0aae
GET /follower_links GET /follower_links.json
[ { "docid": "fd861cce64d73668c561b6c5223b6dfb", "score": "0.75170803", "text": "def index\n @follower_links = FollowerLink.all\n end", "title": "" } ]
[ { "docid": "e538bab28ff0d162f064509683c273f3", "score": "0.73158604", "text": "def followers\n @connections = Connection.getfollowing(params[:auth_token], 1)\n\n respond_to do |format|\n# format.html # show.html.erb\n format.json { render json: @connections }\n end\n end", "title...
ca734f7bac6b96269e1e9905ce0cd1e8
PATCH/PUT /weekly_reports/1 PATCH/PUT /weekly_reports/1.json
[ { "docid": "6ecd4f2747e0de857886244127275ef2", "score": "0.7189996", "text": "def update\n @weekly_report.published = true if @weekly_report.reported_time < Time.now\n respond_to do |format|\n if @weekly_report.update(weekly_report_params)\n format.html { redirect_to @weekly_report, no...
[ { "docid": "3d3d0140510526494a189f9510ab7e71", "score": "0.6623248", "text": "def update\n respond_to do |format|\n if @weekly_histogram.update(weekly_histogram_params)\n format.html { redirect_to @weekly_histogram, notice: 'Weekly histogram was successfully updated.' }\n format.js...
e6b8554097b0d483adc589c820418431
Returns a Sharp derived from this object.
[ { "docid": "89afad18e8fbc10392a0f7e3c68da9d5", "score": "0.8393996", "text": "def sharp; Sharp.new(self); end", "title": "" } ]
[ { "docid": "0059a031e9b80ac1803774e3b5f1a79d", "score": "0.6036741", "text": "def base\n self\n end", "title": "" }, { "docid": "b0025eed6085fb3f80204f96cd659d11", "score": "0.59812015", "text": "def new\n RObject.new(self)\n end", "title": "" }, { "docid": "9...
dc6faeabbeed8ce9e8f9e5ac7b088e8d
Destroys records in batches. Person.where("age < 10").in_batches.destroy_all See Relationdestroy_all for details of how each batch is destroyed.
[ { "docid": "5957713cd5c1bc2f8b6b105964e65017", "score": "0.6871161", "text": "def destroy_all\n each(&:destroy_all)\n end", "title": "" } ]
[ { "docid": "a4627d63b8451c586b588a4360044374", "score": "0.70460886", "text": "def purge_in_batches!\n scope = model\n scope = scope.where(@table.conditions) if @table.conditions\n\n instrumentation_name = 'next_batch.db_purger'\n start_instrumentation(instrumentation_name)\n\n ...
795d5d0e8f48e8024e0bef6e0ca28e2f
Link object files into an application
[ { "docid": "7d0c181cebe79a1416ca3a7ddeaea9b9", "score": "0.67877877", "text": "def link_app(project)\n begin\n # Check for object files\n raise \" No object files found\" if @obj_files.empty?\n\n # Build the linker command\n command = \"g++ -o #{project.name} \" + @obj_...
[ { "docid": "24383b8adea1524077087ed8b4710364", "score": "0.7612945", "text": "def link_it(exe_name, obj_list)\n linker = build_linker_fields\n cmd_str = \"#{linker[:command]}#{linker[:includes]} \" +\n (obj_list.map{|obj|\"#{$yml_cfg['linker']['object_files']['path']}#{obj} \"}).join +\n ...
520c8b822b513625dde61d5ce9dcb682
Evals the 'x [ is][ not] set' notation...
[ { "docid": "988d16b97fa8fa2615aa361a445c8487", "score": "0.60099655", "text": "def eval_set (cond)\n\n m = SET_REGEX.match cond\n\n return nil unless m\n\n val = m[1]\n n = m[3]\n\n ldebug do\n \"eval_set() for >#{cond}< \"+\n \"m[1] is '#{val}', m[3...
[ { "docid": "74818295802ef739b8f7b932877baa24", "score": "0.62363565", "text": "def andNot(set)\n raise \"something\"\n end", "title": "" }, { "docid": "32d25b469ba30ff262ec54d6070b3ac9", "score": "0.596576", "text": "def check_disjunctive_assignment(node); end", "title": "" ...
16e371938009be56c64f5fe2f6075797
Cuts a stem of the given `word` with specified `suffix`. This method cares only about the lengths and not about contents. ```ruby cut_stem('abc', 'c') => 'ab' ```
[ { "docid": "02f9acb82d4677a7cfacc7e60108ae13", "score": "0.8857317", "text": "def cut_stem(word, suffix)\n stem_length = word.length - suffix.length\n word[0...stem_length]\n end", "title": "" } ]
[ { "docid": "9e5b135038dda0122146f7a8019cefcd", "score": "0.68177414", "text": "def possible_stems(word, suffix)\n myaso.stems.select cut_stem(word, suffix)\n end", "title": "" }, { "docid": "23fb18f7f743106b08455f1d2e1c8a0d", "score": "0.6289828", "text": "def trim_suffix(s, ...
649b4756c0d332958f3ae5cef2e7c88a
Returns :online (fulltext) or :related, based on our guess of whether the 856 links are for online access or not just based on whether it's marked "Online" in format facet, at present.
[ { "docid": "23787421e7c10857edc12dc3e1997fb5", "score": "0.7023011", "text": "def related_links_type(document)\n if document[\"format\"] && document[\"format\"].include?(\"Online\")\n :online\n else\n :related\n end\n end", "title": "" } ]
[ { "docid": "ba51fbd063637cc91f640abf2eca430c", "score": "0.62006974", "text": "def available_online?\n pseudo_facet?('available_online')\n end", "title": "" }, { "docid": "91ee5b119b421ba3de31ed8ce1d04b1b", "score": "0.6122563", "text": "def online_holding_info_for(docume...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "c346222ce1d49eba439f9d8677b7385e", "score": "0.0", "text": "def deck_params\n params.require(:deck).permit(:name)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.79439425", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69581985", "text": "def permitted_params\n params.permit!\n end", "title...
e36c72c011bf37272c6d0e99555c0bd8
Produce a helpful title for the page to be used in the view
[ { "docid": "cd19112806f09349eca8cad2b0d98b71", "score": "0.0", "text": "def set_page_title\n if params['listing_user_id']\n @page_title = \"My Tours\"\n else\n @page_title = \"All Tours\"\n end\n end", "title": "" } ]
[ { "docid": "3208d596cba743157151aa393c81ba9d", "score": "0.84769225", "text": "def title_help \n\n\t\t#Define general page title\n\t\tbase_title = \"Rex Ruby on Rails Learning | PagesHelper\"\n\t\tif(@title.nil?)\n\t\t\tbase_title\n\t\telse\n\t\t\tbase_title = \"Rex Ruby on Rails Learning | #{@title} | ...
267138c3bc098917e5b87964017381fa
This is too integrated to test. I can't provide an actual game object to test
[ { "docid": "50324e6730f20e8b6e3ecfcd190a320f", "score": "0.0", "text": "def helper_for_loss_count(passed_id, game)\n (passed_id == game[\"away_team_id\"] && game[\"away_goals\"] < game[\"home_goals\"]) ||\n (passed_id == game[\"home_team_id\"] && game[\"home_goals\"] < game[\"away_goals\"])\n end...
[ { "docid": "3935a10db0c00bd86657c88a0f53312f", "score": "0.6471715", "text": "def in_game?; end", "title": "" }, { "docid": "09d2e4d427c244fdcbf94ce0b72feeaa", "score": "0.6462611", "text": "def game_state; @game_object.game_state; end", "title": "" }, { "docid": "2fa4f8c...
e8e2ce561d882e7d5b12f26fd9cd1ba0
Create an account status Create an account status record for an account.
[ { "docid": "a8c3511f07618f6e45dd08f30ee772c9", "score": "0.6941144", "text": "def create_account_status_using_post(account_status_request, opts = {})\n data, _status_code, _headers = create_account_status_using_post_with_http_info(account_status_request, opts)\n data\n end", "title": ""...
[ { "docid": "9db9a73b34e936b1e2fdeb573af25e94", "score": "0.76518035", "text": "def create\n @account_status = AccountStatus.new(account_status_params)\n\n respond_to do |format|\n if @account_status.save\n format.html { redirect_to @account_status, notice: 'Account status was successfu...
ebeee5ebe95716a96bc9aa8890d20df6
Returns the value of attribute parameters.
[ { "docid": "d776711817bf6bc1f145594060bfb5e1", "score": "0.0", "text": "def parameters; end", "title": "" } ]
[ { "docid": "b9cecd7b88e594ec6949403523c8df8c", "score": "0.8139697", "text": "def parameters\n attributes.fetch(:parameters)\n end", "title": "" }, { "docid": "f31e94ab4c80c9602f143633ed89cf37", "score": "0.7489523", "text": "def attribute_value\n @attributes...
b54dedfeb11040ec7d442d4c88532f3e
DELETE /curiosidades_japons/1 DELETE /curiosidades_japons/1.json
[ { "docid": "bfc6177464c413a4b29009c9243989e1", "score": "0.71069777", "text": "def destroy\n @curiosidades_japon.destroy\n respond_to do |format|\n format.html { redirect_to curiosidades_japons_url, notice: 'Curiosidades japon was successfully destroyed.' }\n format.json { head :no_conte...
[ { "docid": "86faa8c555419d7144a0c7003f760dff", "score": "0.68340015", "text": "def delete\n render json: Item.delete(params[\"id\"])\n end", "title": "" }, { "docid": "09fc2820d9479cac0697e20c559268bf", "score": "0.6815582", "text": "def delete\n render json: Alien.delete(para...
900cbe52077332fa287169d61b7b57b7
Extracts dates from slice of MARC 008 field to_field "date_range", extract_marc("008[0614]"), marc_date_range or, if you have marcxml, get the correct bytes from 008 into the accumulator then call this see does NOT work for BC dates (or negative dates) because MARC 008 isn't set up for that
[ { "docid": "dd4954420fc715c0ad2dce111d070618", "score": "0.66359377", "text": "def marc_date_range\n lambda do |_record, accumulator, context|\n val = accumulator.first\n date_type = val[0]\n unless date_type.match?(/[cdeikmqrs]/)\n accumulator.replace([])\n r...
[ { "docid": "df5dea68e6bccae0c9952bf0af8d9db9", "score": "0.6615437", "text": "def extract_date1_and_date2(marc_record)\n field = MarcSelector.first(marc_record, '008')\n return [nil, nil] if field.nil?\n date1 = field.value[7..10].strip\n date2 = field.value[11..14].s...
97f8146a152b0ebb065f62b7e166b098
Convience method for configuring Sprockets::Helpers.
[ { "docid": "1d91ddc6cd00e22a835bd1f1a92579c0", "score": "0.0", "text": "def configure\n yield settings\n end", "title": "" } ]
[ { "docid": "5facb9ff91fd786a49d6248ddb045613", "score": "0.7957521", "text": "def configure_sprockets_helpers\n Sprockets::Helpers.configure do |config|\n case serve_assets\n when \"remote\"\n config.manifest = manifest\n config.debug = false\n config.asset_...
46bf158a7b8ee8f87db671dc2abf00be
Another way to attach a biz process
[ { "docid": "28445ae4d3e7b5d49139391d47e40c3e", "score": "0.0", "text": "def create_person\n @system = System.find(params[:id])\n @system_person = SystemPerson.new(params[:system_person])\n @system_person.system = @system\n if @system_person.save\n flash[:notice] = 'Contact was successfu...
[ { "docid": "137851b230e377902abf0348b617d7ab", "score": "0.71301043", "text": "def attach\n send_cmd(:attach, Process.pid)\n if wait('to attach'){ @attached == true }\n STDERR.puts \"*** attached to process #{pid}\"\n else\n raise ArgumentError, 'process already being traced?'\n en...
4e0b2092cccabb6e2e8c63d6e7c56d0c
Returns default URL options.
[ { "docid": "e67fa9e081f2b01f2ef2f4b0e55611ab", "score": "0.8002644", "text": "def default_url_options(options={})\n # FIXME: options isn't used!\n {\n # FIXME: I18n.locale was getting confused by assets...\n :locale => I18n.default_locale\n }\n end", "title": "" } ]
[ { "docid": "8ccbc5b0e701712770e95f218211bc2e", "score": "0.8918546", "text": "def url_options\n default_url_options\n end", "title": "" }, { "docid": "e0f4b0ba08d5c10b67cf1cdad1dc37b3", "score": "0.8918303", "text": "def default_url_options(options = {})\n options\n e...
24f61c79c9e6dced8e470500c59cc0ff
GET /invitation_sents/1 GET /invitation_sents/1.xml
[ { "docid": "00bcdc7283bbf3e9293f51b8b6daa91b", "score": "0.7139917", "text": "def show\n @invitation_sent = InvitationSent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @invitation_sent }\n end\n end", "title": "" } ]
[ { "docid": "cfbf6cdb59129603dec08da1a52ba1b0", "score": "0.7002815", "text": "def show\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @invitation }\n end\n end", "title": "" }, { "docid"...
cd2960b4b647f20ce6d0a0bd372063c3
returns true if there is a temps section in the frame
[ { "docid": "8cec2956ab6e4b5d5997c71942b6a7f8", "score": "0.7562385", "text": "def temps?\n has_node? :TEMPS\n end", "title": "" } ]
[ { "docid": "c9d858e6a5089224bc249bcd8a1c5c59", "score": "0.69680816", "text": "def in_temp_location?\n holding_data.dig 'in_temp_location' == 'true'\n end", "title": "" }, { "docid": "ce7da67e95213e8c121f77ea90bbf15d", "score": "0.6599155", "text": "def timeframe?\n ...
b9b3fdf4614c2d011404be0f3a4f61c5
PATCH/PUT /fund_applications/1 PATCH/PUT /fund_applications/1.json
[ { "docid": "817e4d8b7211b25dd2ba1451f201c498", "score": "0.7090185", "text": "def update\n respond_to do |format|\n if @fund_application.update(fund_application_params)\n format.html { redirect_to @fund_application, notice: 'Fund application was successfully updated.' }\n format.js...
[ { "docid": "75ac98d2a402bb769e0aab327596a7d6", "score": "0.6657038", "text": "def update\n @app = App.find(params[:id])\n\n if @app.update(app_params)\n head :no_content\n else\n render json: @app.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "do...
0b137624fe2aae572bedf4aebb6b0367
Transition a ticket via Abandon to Closed status.
[ { "docid": "5a6f0ce33b8065ba3274ed1375b62a4b", "score": "0.62431705", "text": "def abandon\n Jiralicious::Issue::Transitions.go(@key, @abandon, {})\n end", "title": "" } ]
[ { "docid": "7aaa906c8b1da8ac4dcbfa39848fc7d1", "score": "0.71624273", "text": "def close(ticket)\n ticket.update!(status: Ticket::STATUS.closed, closed_at: Time.current)\n end", "title": "" }, { "docid": "6ae22742cbb58348e86c5fb98cb1f685", "score": "0.68642706", "text": "def reop...
cc445693d79b6e7b189eb6f7c015957e
create a new user oauth should pass nil password
[ { "docid": "4623887820cdc60714740614cd3c956a", "score": "0.0", "text": "def create_user(login,\n password=nil,\n options={})\n\n @user = User.create(login,password,options)\n\n start_session(@user)\n\n\n if new_user_handler\n Rengine::WorkRe...
[ { "docid": "5d5b2f82e01a5d8d7f059c2c3e7941b5", "score": "0.76456434", "text": "def create_using_oauth\n return if @user # Previous filter was successful and we already have a user\n\n auth = request.env[\"omniauth.auth\"]\n kind = params[:action].titleize # Should give us Facebook, Twitter, Lin...
9d6e165600c6ffb9b1aaa3ab1b0a845a
Get pregame win probabilities Pregame win probabilities
[ { "docid": "d587ccb55631a9471051ddc80767b241", "score": "0.0", "text": "def get_pregame_win_probabilities_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: MetricsApi.get_pregame_win_probabilities ...'\n end\n # resource pat...
[ { "docid": "0355296dbb26cfa8495d5f56a0d7a7ae", "score": "0.7069144", "text": "def get_conditional_probabilities(teams, name, round)\n puts \"*****************\"\n puts name\n puts \"*****************\"\n winner = select_team(teams, name)\n start, finish = winner.get_opponents(round)\n opponents = ...
3e8679ac6bc74585d23bc55b8ad8a17f
This converts an ENV hash into a string of ENV settings
[ { "docid": "b31c5b484c0a3df60ee6d9900a9f08a6", "score": "0.6722041", "text": "def env_setup\n @env_map.each_pair.map{ |k,v| \"#{k}=#{v}\" }.join(' ')\nend", "title": "" } ]
[ { "docid": "27c623b55c037ecc7eb0f843a20de5f0", "score": "0.75822085", "text": "def to_str\n ENV[@name]\n end", "title": "" }, { "docid": "7187006d1e04dae3ffe8de857b566119", "score": "0.7324529", "text": "def env_string_hash(env)\n env.map { |k, v| [k.to_s, v.to_s] }\nend...
e3bf926bfdb1a77d4a0fe7b6e291a82f
============================================================================== service_nasi?() ============================================================================== Is the 'service' field set to 'nasi'?
[ { "docid": "662fa703499ec50a41d7fc319fec55a1", "score": "0.7972098", "text": "def service_nasi?()\n return true if (@service == TAC_PLUS_AUTHEN_SVC_NASI)\n return false\n end", "title": "" } ]
[ { "docid": "07477e8e6ce184b4d6b17b68064aadd2", "score": "0.7634779", "text": "def service_nasi!()\n @service = TAC_PLUS_AUTHEN_SVC_NASI\n end", "title": "" }, { "docid": "a1beeb4252d1ec8e0ea8d014f95cb292", "score": "0.6793369", "text": "def service_is_nuniverse?(params = {}...
86790879642258c1df25bc10f247d319
Gets one's research stats from agents Expects: characterid ( Integer | String ) Get stats for this Character See also: Reve::Classes::Research
[ { "docid": "bbf56e7e9e1e495eba6ccd545ab603f2", "score": "0.5128129", "text": "def research(opts = { :characterid => nil })\n args = postfields(opts)\n h = compute_hash(args.merge(:url => @@research_url))\n return h if h\n process_query(Reve::Classes::Research,opts[:url] || @@research...
[ { "docid": "514433143ceff652c50976fdab202761", "score": "0.59085244", "text": "def get_character(char_id)\n characters[char_id.to_i]\n end", "title": "" }, { "docid": "5fc174579b85e1c9a284956451ba3fb7", "score": "0.57801837", "text": "def character(id, options = {})\n # ...
7de4f532d6f2bbbb5dd21b5834a52437
Write your code here.
[ { "docid": "db5d83251d7e50fba35acd622da407e8", "score": "0.0", "text": "def dictionary \n\tdictionary = {\n\t\t:hello => \"hi\", \n\t\t:to => \"2\",\n\t\t:two => \"2\",\n\t\t:too => \"2\",\n\t\t:for => \"4\",\n\t\t:four => \"4\",\n\t\t:be => \"b\",\n\t\t:you => \"u\",\n\t\t:at => \"@\",\n\t\t:and => \"&...
[ { "docid": "f45f5fa6d32a5d296e5153caa3d92701", "score": "0.7117752", "text": "def code; end", "title": "" }, { "docid": "f45f5fa6d32a5d296e5153caa3d92701", "score": "0.7117752", "text": "def code; end", "title": "" }, { "docid": "f45f5fa6d32a5d296e5153caa3d92701", "sc...
d4a1edaae4d92d004632cf64501ce2e7
DELETE /users/1 DELETE /users/1.json
[ { "docid": "15bbd6148634eeae1703a9d0983f5a27", "score": "0.0", "text": "def destroy\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "be9d8ff5c0124f1d5efc98ec2baa3fc1", "score": "0.7590564", "text": "def test_delete_user\n delete '/users/2'\n data = JSON.parse last_response.body\n\n assert_equal 'Daniel', data['name'], 'Propiedad name incorrecta'\n assert_equal 'Arbelaez', data['last_name'], 'Propiedad last_nam...
302c30fb6ff17aae9a7c3422bb9b1af6
has before_action methods: logged_in_user, correct_user
[ { "docid": "ddc3813b8c288161c19e3c7f999fe8bd", "score": "0.0", "text": "def edit\n # @user = User.find(params[:id]) <-- not needed; @user defined in correct_user\n end", "title": "" } ]
[ { "docid": "633c174aec03151235a0dfa2d702cb1f", "score": "0.69108206", "text": "def correct_user\n \n redirect_to(login_path) unless current_user?(@user)\n end", "title": "" }, { "docid": "4efc7567798893fd5b492926081297dc", "score": "0.6902442", "text": "def correct_user\n# ...
1ceb237c6320c2cd2d867e589dc457e0
Get the metadata for an album on Last.fm using the album name or a musicbrainz id. See playlist.fetch on how to get the album playlist. Options +artist+:: The artist name in question +album+:: The album name in question +mbid+:: The musicbrainz id for the album +lang+:: The language to return the biography in, expresse...
[ { "docid": "d847188f3bd48ae1e98c1d34ee09ac51", "score": "0.66444933", "text": "def info(options={})\n get(:standard, {:method => \"album.getInfo\"}.merge(options))\n end", "title": "" } ]
[ { "docid": "f92f6ff1dc514c1d1f755f1737cd6a9d", "score": "0.6659986", "text": "def get_metadata_file album\n Albatross::ThrowIf.is_nil? album, \"album\"\n \"storage/dropbox/#{album}.yml\"\nend", "title": "" }, { "docid": "b1ba8ffddb7d0e7999f6d0110b1f72d7", "score": "0.6630844", "tex...
41c4b122509739730843c3a5900a4946
Just for testing... This method will always fail with an exception!
[ { "docid": "5238e2c68c8bdff9e72fb0d82b09c1e3", "score": "0.0", "text": "def handle_just_fail!(origin_client_id, params)\n raise \"I am failing..... I am failing..... I am failing to the see...\"\n end", "title": "" } ]
[ { "docid": "8b79e8f7bbe83880e51794d26cd62a8f", "score": "0.7532533", "text": "def try; end", "title": "" }, { "docid": "3dd49bf89ca13eba8cb278cfe6edcd89", "score": "0.7335141", "text": "def rescue_result; end", "title": "" }, { "docid": "37013b22997a7d16cf75d139ba2a2aef",...
6d3df012d8dfac6ac14d0b3407b2e77c
Verify that Print correctly initializes its attributes from the Web API.
[ { "docid": "ad774d9e7b48fa71f9a464d97979e10f", "score": "0.6785478", "text": "def test_attributes\n assert_equal \"Untitled\", @print.title\n assert_equal \"12345678-abcd-abcd-abcd-12345678abcd\", @print.guid\n assert_equal Time.utc(2015, 9, 13, 21, 0, 5), @print.date_added\n assert_equal 50...
[ { "docid": "9193709a98d5e2471a421281c395e4a0", "score": "0.5678477", "text": "def test_print\n\n # Test a new board\n get(:print, :id => audits(:audit_mx234b).id)\n\n audit = assigns(:audit)\n assert_equal('252-234-b0 m', audit.design.part_number.pcb_display_name)\n assert_equal('2.0', ...
8e78dfdc623658fead59691b15ea0870
PATCH/PUT /contact_categories/1 PATCH/PUT /contact_categories/1.json
[ { "docid": "b43820bc5e65f2fa2a2140a85b96d6a6", "score": "0.69803375", "text": "def update\n respond_to do |format|\n if @contact_category.update(contact_category_params)\n format.html { redirect_to @contact_category, notice: 'Contact category was successfully updated.' }\n format.j...
[ { "docid": "db8c730f4aecce9c10f9fd82db193c6a", "score": "0.68457156", "text": "def user_category_edit\n @user = User.where(contact: params[:contact]).first\n @user.categories.destroy_all\n params[:category_ids].each do |category|\n @user.user_categories.create!(category_id: category, user_...
b83baa95c38f20a77f449dea6da66b09
Forces a reparse of the site configs.
[ { "docid": "e2d152bdd115229aae8852aae8e89b24", "score": "0.62180364", "text": "def configs!\n @configs = begin\n # This global is set when Origen is first required, it generally means that what is considered\n # to be the pwd for the purposes of looking for a site_config file is the p...
[ { "docid": "5f0b2026219434f6f8b39d73cf1e8572", "score": "0.61356586", "text": "def site\n if GramV2Client.configuration.site\n if super.to_s != URI.parse(GramV2Client.configuration.site).to_s\n reload_config\n end\n end\n super\n end", "title": "" }, { ...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "06f516cbacb6b0945619e7945c258b3c", "score": "0.0", "text": "def user_level_params\n params.require(:user_level).permit(:level)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.69497335", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6812623", "text": "def strong_params\n params.require(:listing_member).permi...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "8873d0d9a4343d031d2fecd8e6512fcf", "score": "0.0", "text": "def set_contratante\n @contratante = Contratante.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...
7cf9b218b9d7915d55325f8cfeac591f
get the robocall campaign for the current user
[ { "docid": "e4b2a311554cb7f816ca30c58f9b4d1d", "score": "0.7361178", "text": "def get_robocall_campaign\n\t\tbegin\n @robocall_campaign = current_political_campaign.robocall_campaigns.find(params[:id]) unless current_political_campaign.nil?\n\t if current_political_campaign.nil? && current_user.is...
[ { "docid": "337852c97a1c1e61d2334049986942da", "score": "0.6832934", "text": "def campaign; Campaign.get(self.campaign_id); end", "title": "" }, { "docid": "337852c97a1c1e61d2334049986942da", "score": "0.6832934", "text": "def campaign; Campaign.get(self.campaign_id); end", "titl...
0ed5cd4081ccbd0322e1b1f4eaff51c8
Matching Criteria by year, quarter & month
[ { "docid": "ff32c87d5d03eb31adc7e9cab527b1c2", "score": "0.7278228", "text": "def matchByYearQuarterMonth(fiscal_year, quarter, month)\n jsonObj = {\n :$match => {\n @fieldYear => fiscal_year,\n @fieldQuarter => quarter,\n ...
[ { "docid": "72fe66998acd43d12a9c5d444222d81e", "score": "0.7028818", "text": "def specific(*args)\n number, year, type = number_and_year_and_type_from_args(*args)\n index = number.pred % number_of_quarters(*args)\n opts = args.extract_options! # at this point...
61f4c893e282379607472ba566179e66
Space optimized, reversal only requires 1 additional variable (tmp) everything else is done inline meaning this operates in O(1) space every word needs to be reversed twice meaning 2n with n number of chars in string, giving O(n) time complexity
[ { "docid": "ed77b8df2d9d277ac9db688354c01624", "score": "0.73593", "text": "def reverse_word_by_word_optimized(s)\n last_word_bound = 0\n current_word_bound = 0\n while current_word_bound < s.size\n if s[current_word_bound] == \" \"\n # reverse the current word\n my_reverse_sub(s, last_w...
[ { "docid": "652de6457e26225c2c960cb5732aff91", "score": "0.761944", "text": "def reverse_words(my_words) #with string_reverse\r\n return my_words if my_words.length < 2\r\n return string_reverse(my_words) if !my_words.include?(\" \")\r\n\r\n first = 0\r\n\r\n my_words.length.times do |last |\r\n ...
379c26d8a07cbdb7f2c47d6d26b52177
added meow, but didn't need to for passing this lab
[ { "docid": "52173433f1b8b72d1cedaa25e3800483", "score": "0.0", "text": "def meow\n puts \"meow!\"\n end", "title": "" } ]
[ { "docid": "7ec57c3874853e50086febdbdd3221bf", "score": "0.6359553", "text": "def wedding; end", "title": "" }, { "docid": "7f5073ed8a81fec00b09ae99ac8f7c94", "score": "0.6253408", "text": "def additions; end", "title": "" }, { "docid": "549cdd4767cacb4029e22f746ccd68b5",...
cfcdc607ca64a8b73e431722f6207ec4
Get verified account based on id. Get verified account based on id.
[ { "docid": "b03beb0f2b44ec818174b0e7f8de9ca4", "score": "0.0", "text": "def get_iav_using_get_with_http_info(nucleus_bank_link_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IAVApi.get_iav_using_get ...'\n end\n # verify the require...
[ { "docid": "ea7ec4b8a4ed525b00d8e351c07f8ea5", "score": "0.6994253", "text": "def find(id)\n response = JSON.parse(@client.get(\"paypal_accounts/#{id}\").body)\n Promisepay::PaypalAccount.new(@client, response['paypal_accounts'])\n end", "title": "" }, { "docid": "3108b6a56f6af4...
ef73b314bc5f739f69073d615b32b949
Issues a GlobalPlatform INSTALL command that loads an application's file. The command should be followed by a LOAD command (see gp_load). Args: file_aid:: the AID of the file to be loaded sd_aid:: the AID of the security domain handling the loading data_hash:: params:: token:: load token (needed by some SDs) Returns a ...
[ { "docid": "7866eab8da3c5732fa26f5c277f22f4a", "score": "0.733447", "text": "def gp_install_load(file_aid, sd_aid = nil, data_hash = [], params = {},\n token = [])\n ber_params = []\n \n data = [file_aid.length, file_aid, sd_aid.length, sd_aid,\n ...
[ { "docid": "b7b4e38fe67136edc2fa41e3bd09a011", "score": "0.5680844", "text": "def gp_install_selectable(file_aid, module_aid, app_aid, privileges = [],\n params = {}, token = [])\n privilege_byte = 0\n privilege_bits = { :mandated_dap => 1, :cvm_management => 2,\n ...
f5213e5f03c043875ce8b6eca5ca5a7e
POST /event_reviews POST /event_reviews.json
[ { "docid": "53007dd13e07f13663500a6a7d2195c5", "score": "0.75765055", "text": "def create\n @event_review = EventReview.new(event_review_params)\n\n respond_to do |format|\n if @event_review.save\n format.html { redirect_to @event_review, notice: 'Event review was successfully created....
[ { "docid": "c4576b8ab29005b356ac671ff5d594f5", "score": "0.6595921", "text": "def create_review(booking, options = {})\n post(\"bookings/#{booking}/reviews\", reviews: [options]).pop\n end", "title": "" }, { "docid": "aae5cfd0c60dca21c639e8979fadca32", "score": "0.65923434", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "c11acf822466032bfdbc8e2d47c198da", "score": "0.0", "text": "def set_confarticle\n @confarticle = Confarticle.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...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "bdeb969ea90717b58a3bcb2426414e9a", "score": "0.0", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @traits = args[:traits] if args.key?(:traits)\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...
263a62ab0327ae8ff2782947f56091de
is the position is between 1 and 9 and the position is not already taken
[ { "docid": "80b2833692677a0e0df35c48a7fb0585", "score": "0.0", "text": "def valid_move?(input)\n index = input.to_i\n if index.between?(1,9) && !taken?(index)\n true\n else\n false\n end\n end", "title": "" } ]
[ { "docid": "0407ec3ce6f179d81e5ef3f92b4f96d4", "score": "0.7639555", "text": "def valid_move?(position)\r\n position.to_i.between?(1, 9) && !position_taken?(position.to_i - 1)\r\n end", "title": "" }, { "docid": "1aae5356af5fcb0ccf0b0af5ff1d71a3", "score": "0.7606231", "text": ...
d491a6b63e9e15aa9fcc70d3fc352b1f
Approach 2: One Pass Algorithm Say the given array is: [7, 1, 5, 3, 6, 4] If we plot the numbers of the given array on a graph, we get: The points of interest are the peaks and valleys in the given graph. We need to find the largest peak following the smallest valley. We can maintain two variables minprice and maxprofi...
[ { "docid": "4d0c4e0a0a0401f9c8873972a5c8ed1f", "score": "0.77186835", "text": "def max_profit(prices)\n max_profit = 0\n min_price = 1_000_000\n\n 0.upto(prices.length - 1) do |i|\n if prices[i] < min_price\n min_price = prices[i]\n elsif prices[i] - min_price > max_profit\n max_profi...
[ { "docid": "05365b785ab3d73c45e70eeb86fc2e19", "score": "0.826418", "text": "def max_profit(prices)\n i = 0\n valley = prices.first\n peak = prices.first\n max_profit = 0\n\n while i < prices.length - 1\n while i < prices.length - 1 && prices[i] >= prices[i + 1]\n i += 1\n end\n valle...
c4019d2f01a3d874fed40aed2da603a8
Scrapes all items and collects them in one chunk of text
[ { "docid": "22009d0c7d26a2d934f5ae12070287b6", "score": "0.0", "text": "def scrape(url, hash)\n text = \"\"\n html = Nokogiri::HTML(open(url))\n html.css(\"div#content\").css(\"a\").each do |l|\n if l['href'].include? \"cgi-bin\"\n link = \"http://thomas.loc.gov\" + l['href']\n ...
[ { "docid": "fde1d7ad02baef934fa93b2bc27b9b71", "score": "0.6789779", "text": "def getAllContents()\n assert_exists\n @container.log \"There are #{@o.length} items\"\n returnArray = []\n @o.each { |thisItem| returnArray << thisItem.text }\n return re...
1097a7e7758f08d32addfc88ea3fdcab
GET /users GET /users.json
[ { "docid": "8b1dbac81472eff58cb602a4a1473ebb", "score": "0.0", "text": "def index\n @users = User.all\n end", "title": "" } ]
[ { "docid": "8a29471646191d84def95f7af1e081bf", "score": "0.82109934", "text": "def users(args = {})\n get(\"/users.json\",args)\n end", "title": "" }, { "docid": "fd6f331d604ba2ad8967a7e5ed218329", "score": "0.7873764", "text": "def show\n begin\n user = User.find...
ce822d631f24fa6eb6c23c1c00df697a
Enables capturing of row level changes into barkdata_changecapture table.
[ { "docid": "062382438d78e909e1adb0966f376fb6", "score": "0.57579553", "text": "def disable_changecapture\n Barkdata::Changelog.disable(self)\n end", "title": "" } ]
[ { "docid": "7483aea88226f81127624f541adc6ea0", "score": "0.71966076", "text": "def enable_changecapture\n Barkdata::Changelog.enable(self)\n end", "title": "" }, { "docid": "6dd6c8d654becd02c6d9fa8400ef13fe", "score": "0.5761774", "text": "def row_changes\n @api....
044b045acd09972294679f5b9d44e425
def sunset_animation system("clear") sunset_1 sleep(1) system("clear") sunset_1 sleep(1) end
[ { "docid": "bcd2dc0a0f27b439f6a90db72bf64323", "score": "0.0", "text": "def title\n puts \" \"\n puts \" \"\n puts \" \"\n puts Paint[' __ _ _ __ __ __ ___ __ ', :red, :bold]\n puts Paint[' / / (_)_ ...
[ { "docid": "69ccad26b642761539f394c9fd5a489f", "score": "0.8195173", "text": "def start_animation\n system(\"clear\")\n trek_small_upper_left\n sleep(1)\n system(\"clear\")\n trek_small_lower_right\n sleep(1)\n system(\"clear\")\n trek_small_lower_left\n sleep(1)\n system(\...
410a21645676882f93838083f3e0188d
Update Battle Hud EX
[ { "docid": "2e0ad2671aa4b72598d259f866cce937", "score": "0.77473885", "text": "def update_battle_hud_ex\n refresh_battle_hud if $game_temp.mbhud_force_refresh\n return if @battle_hud_ex == nil\n @battle_hud_ex.update\n end", "title": "" } ]
[ { "docid": "13544972e72d31eace97b5351b51edbd", "score": "0.673733", "text": "def hud_update\n # check activation of HUD parts\n check_huds\n # update minimap\n update_minimap\n # update hotkey assignment display\n update_hotkeys\n # iterate through all the HUD sprites\n [@hud, @m...
20d6a804df11e5168ca39f6d3e04e0c6
Append a child to this element, optionally under a provided namespace. The namespace argument is ignored if the element argument is an Element object. Otherwise, the element argument is a string, the namespace (if provided) is the namespace the element is created in.
[ { "docid": "3bfdebbaf1a3e0bd26b54d6f05291fa1", "score": "0.48914585", "text": "def << element\n if node_type() == :text\n at(-1) << element\n else\n newnode = Node.new( element )\n newnode.parent = self\n self.push( newnode )\n end\n at(-1)...
[ { "docid": "f65ede30238a53dd9a4301b472aa8828", "score": "0.6661259", "text": "def add_child element_name, doc\n ns_uri = @namespaces[prefix_part(element_name)]\n ns_prefix = eval_xpath(doc)[0].namespaces.key(ns_uri)\n ns_prefix = ns_prefix.sub(/xmlns/, '')\n ns_prefix = ns_prefix...
721fd95b1bd0970b809b47a59553fe6d
Decode a JSON string into Ruby. Options :symbolize_keys :: If true, will use symbols instead of strings for the keys. :adapter :: If set, the selected adapter will be used for this call. source://multi_json//lib/multi_json.rb119
[ { "docid": "aa7963058325a913c699ff7bc8e54286", "score": "0.0", "text": "def decode(string, options = T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "918fd73bb11af0703715474f954e7668", "score": "0.7374974", "text": "def decode(json_string)\n parsed_json = JSON.parse(json_string)\n @decoded = []\n @encoded = parsed_json.delete(KEY_STORE)\n case parsed_json.keys.first\n when KEY_DATA\n return pars...
58a9b498abc3ea0d36bf0b1967989fc5
Return the time taken (in seconds) to process the message. This duration includes the middlewares and the actual process method.
[ { "docid": "4e58cc47dd3dad3d65318d51319de430", "score": "0.66304624", "text": "def process_duration\n return 0.0 unless process_ended_at && process_started_at\n\n (process_ended_at - process_started_at).ceil(3)\n end", "title": "" } ]
[ { "docid": "f1b29172ae3ad786cf7300cb889f7b5c", "score": "0.66521347", "text": "def execution_time\n @process.instance_variable_get(:@execution_time).total\n end", "title": "" }, { "docid": "4262c0166461205edb3bb5ea4788ae01", "score": "0.63694125", "text": "def time_request\n\...
3fc764faa5fdddf4d14adb6590659765
Ensure valid credentials, either by restoring from the saved credentials files or intitiating an OAuth2 authorization. If authorization is required, the user's default browser will be launched to approve the request.
[ { "docid": "bc9a9dbcfc348f19b8f23841c184a558", "score": "0.63313866", "text": "def authorize\n client_id = Google::Auth::ClientId.from_file(CREDENTIALS_PATH)\n token_store = Google::Auth::Stores::FileTokenStore.new(file: TOKEN_PATH)\n authorizer = Google::Auth::UserAuthorizer.new(client_id, SCO...
[ { "docid": "fdf03d140fe16dc072651520e61398ac", "score": "0.69324857", "text": "def authorize\r\n client_id = Google::Auth::ClientId.from_file CREDENTIALS_PATH\r\n token_store = Google::Auth::Stores::FileTokenStore.new file: TOKEN_PATH\r\n authorizer = Google::Auth::UserAuthorizer.new client_id, SCOPE...
c4e5ff3d076581ac23ed037b46240ce4
To allow for adding new components at other places other than the immediate parental nesting.
[ { "docid": "c7609df5e8c6e870bdfe30e4284f466c", "score": "0.0", "text": "def as tag, kpos: Enhancement.stack.last, &block\n Enhancement.stack << (@os = os = refc(tag))\n\n # We must add our actual parent to the kinder parent\n # registry, and remove it before we're done here.\n ...
[ { "docid": "9535c103677391eb269d0c5da43122a3", "score": "0.7006729", "text": "def <<(component)\n @sub_components << component\n component.parent = self\n end", "title": "" }, { "docid": "c0f58e6f34ca0c6a41bccf88fc0e07be", "score": "0.68506676", "text": "def add_top_level_comp...
df28bc7f336a7c053d773f0fd4c9aa73
Public: Serialize the whole representation as JSON. Returns a String with the serialization.
[ { "docid": "3abb4c052acaa2f0f37062a35b60591f", "score": "0.0", "text": "def as_json(*opts)\n links.update(embedded).as_json(*opts)\n end", "title": "" } ]
[ { "docid": "1e793b23217ea8cbe77437bf4f961163", "score": "0.7890412", "text": "def to_json_string\n MARC::JSONLWriter.encode(self)\n end", "title": "" }, { "docid": "c0316006221b00f6bc983ef260f72f2f", "score": "0.78339636", "text": "def serialize\n JSON.generate(to_h)\n...
0d3aea6381458a07aee96d5a912e3c52
object whose policy must respond to `:contact_registrants?` or nil (which uses current_user)
[ { "docid": "5dfad49ade7739d5551cb8e7d5208d2c", "score": "0.0", "text": "def authorization_object\n nil\n end", "title": "" } ]
[ { "docid": "d57ddbe75a3f5eec1c2c8c6ea2b52480", "score": "0.6442381", "text": "def require_requestor_recipients!\n return true if memberships.requestor.any?\n send_registration_required_notice!\n false\n end", "title": "" }, { "docid": "c0a0f4f3890ed37bc20600d89cfee947", "score"...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "cc78204ac1dc68ea6dde68d9d141809a", "score": "0.0", "text": "def set_route\n @route = Route.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6165094", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.60450804", "text": "def action_hook...
a6527a2ee7f77ed7a93a4b65ae76ef25
Obtain an InputSet object, used to define inputs for an execution of this Choreo.
[ { "docid": "f8d996fb44a483923da55677c9ea943f", "score": "0.64574385", "text": "def new_input_set()\n return GetInputSet.new()\n end", "title": "" } ]
[ { "docid": "d8eb34cfc5a1e737977f7023d4849c46", "score": "0.67388546", "text": "def new_input_set()\n return CreateObjectInputSet.new()\n end", "title": "" }, { "docid": "7c0d7c433cd4eb8e36bdc3a383e9ec33", "score": "0.65784514", "text": "def new_input_set()\n return R...
0dddf46e469c1585857d7222e0bf6197
Notification and Event Handlers
[ { "docid": "d809ad7c1e0c5edaa0978a403f45af36", "score": "0.0", "text": "def updateSearching(sender)\n info = ''\n @mdItemController.selectedObjects.to_a.each do |item| \n item.attributes.to_a.each do |attr_name|\n info += \"#{attr_name} = #{item.valueForAttribute(attr_name).to_s} \\n\"...
[ { "docid": "ff1cb32628977acc28cd1a7e6b85541e", "score": "0.74341726", "text": "def events; end", "title": "" }, { "docid": "ff1cb32628977acc28cd1a7e6b85541e", "score": "0.74341726", "text": "def events; end", "title": "" }, { "docid": "ff1cb32628977acc28cd1a7e6b85541e", ...
f41c5c494523d77037b9a46b03605fde
Initialize Login Flow for APIs, Services, Apps, ... This endpoint initiates a login flow for API clients that do not use a browser, such as mobile devices, smart TVs, and so on. If a valid provided session cookie or session token is provided, a 400 Bad Request error will be returned unless the URL query parameter `?ref...
[ { "docid": "9431b275fd32788ae671f424d7613228", "score": "0.5846873", "text": "def initialize_self_service_login_flow_without_browser(opts = {})\n data, _status_code, _headers = initialize_self_service_login_flow_without_browser_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "f0a7de764228754d2fb963a1d4090919", "score": "0.70087975", "text": "def initialize_login_flow(opts = {})\n initialize_login_flow_with_http_info(opts)\n nil\n end", "title": "" }, { "docid": "498fd535d20e2c94d8026910d36695bf", "score": "0.6292335", "text": "def...
a90ccbf8b88db6664a0c30932a9738db
Rename a file by appending a suffix as an extension.
[ { "docid": "6aa944a28f04f6d19a215988858749c5", "score": "0.67286557", "text": "def rename_file(file_path, suffix)\n renamed_source_file = \"#{file_path}.#{suffix}\"\n File.rename(file_path, renamed_source_file)\n\n if File.exist?(renamed_source_file)\n @logger.info(...
[ { "docid": "c7c8754407dc6c3b2ed9d5d05a1ac6c0", "score": "0.7494403", "text": "def append_suffix(filename, suffix)\n return filename.match(/\\.#{suffix}$/) ? filename.to_s : \"#{filename}.#{suffix}\"\n end", "title": "" }, { "docid": "489cfe7b3719782d49027af9964289e2", "score": "0...
4cba7998b848d51cb5818b4838b09dec
Originally based on English gem. That code was (a) deprecated, (b) used confusing naming conventions (based on Rails original names, like 'camelize' instead of 'camel_case'), and (c) was not threadsafe (making use of $ variables in gsub). I have dispensed with things like "modulize" since (a) the meaning of that is sor...
[ { "docid": "d82e2e3d393f6798ff867f2db2906af2", "score": "0.0", "text": "def lowercase ; downcase ; end", "title": "" } ]
[ { "docid": "2c08e51cde9d14947b58da27972e4c7c", "score": "0.72608155", "text": "def modulize\n #gsub('__','/'). # why was this ever here?\n gsub(/__(.?)/){ \"::#{$1.upcase}\" }.\n gsub(/\\/(.?)/){ \"::#{$1.upcase}\" }.\n gsub(/(?:_+|-+)([a-z])/){ $1.upcase }.\n gsub(/(\\A|\\s)(...
8b607e4c31bada2ead6b47575e475456
variables that hold the value, parent node, left node, and right node
[ { "docid": "b3e8e91957b7304832d261fbf779b602", "score": "0.71930534", "text": "def initialize (value, parent = nil, left = nil, right = nil) #initialize all nodes to nil on creation.\n\t\t@value = value\n\t\t@parent = parent\n\t\t@left = left\n\t\t@right = right\n\n\t\t\n\tend", "title": "" } ]
[ { "docid": "db4749f170fca629738027e318070159", "score": "0.75539386", "text": "def initialize\n\t\t@value, @parent, @left_child, @right_child = nil\n\tend", "title": "" }, { "docid": "ab36d8c276d51555bb0b78593c7317c8", "score": "0.71889365", "text": "def initialize( value = nil ) #c...
21dc28436738cabd6766c3db0e8f4ceb
GET /sick_leaves GET /sick_leaves.json
[ { "docid": "7a55fe5d8da868f9bc0cabc4982c0d68", "score": "0.73738176", "text": "def index\n @sick_leaves = SickLeave.all\n respond_to do |format|\n\t\t\tformat.html { render :index }\n\t\t\tformat.json { render json: Oj.dump(@sick_leaves) }\n\t\tend\n end", "title": "" } ]
[ { "docid": "d10e72c0b40e5a078022af9b8b25536e", "score": "0.687287", "text": "def index\n @leaves = current_user.leaves\n end", "title": "" }, { "docid": "76c1ad6ffff5fa9849af6398a7358326", "score": "0.65894204", "text": "def index\n @personal_leaves = PersonalLeave.all\n re...
973aac4ad38ff18936b857a47cd4472d
check current user logged? require login
[ { "docid": "065c4e09c3dd21ed1817dd8e31b8b265", "score": "0.0", "text": "def require_login\n \n unless logged_in?\n redirect_to new_log_in_path\n end \n end", "title": "" } ]
[ { "docid": "701beea8e313ed29034018f1c4475941", "score": "0.81552017", "text": "def require_login\n if @current_user != nil\n end\n end", "title": "" }, { "docid": "00cd728e6f735a3e2ff69fbed72bd4ac", "score": "0.81222177", "text": "def check_if_logged_in\n redirect_to logi...
e96b84cc2aed3189a5694ca5b1192d9c
Need to call this inside draw
[ { "docid": "ec022a3b8f1e6b813ab53856a6584240", "score": "0.617001", "text": "def draw\n super if defined? super\n # Systems may report interesting stuff\n @systems.each_value do |system|\n system.draw\n end\n end", "title": "" } ]
[ { "docid": "7a3c5c1fb79b6b3d27a5d88d55c9e2f1", "score": "0.80858475", "text": "def draw\n\t\t\n\tend", "title": "" }, { "docid": "7a3c5c1fb79b6b3d27a5d88d55c9e2f1", "score": "0.80858475", "text": "def draw\n\t\t\n\tend", "title": "" }, { "docid": "7a3c5c1fb79b6b3d27a5d88d...
d9aae508e7177cea02f1d193fa0c6ffb
This is a lot like a subset of index, but the layout is quite different, so merging it into one action is tedious. Gets called from jQuery in /news and rendered by jQuery append(html).
[ { "docid": "f9e22d0161ebcfd308e21fa9e82211e9", "score": "0.0", "text": "def upcoming\n @conferences = Conference.where(\"conferences.start_date > ?\", Date.today).order(Arel.sql('start_date ASC'))\n render layout: false\n end", "title": "" } ]
[ { "docid": "534bc25975919bc24e2f3fb8161098a2", "score": "0.6586696", "text": "def news_list_to_html(news)\n H.section(:id => \"newslist\") {\n aux = \"\"\n news.each{|n|\n aux << news_to_html(n)\n }\n aux\n }\nend", "title": "" }, { "docid": "8b4a...
f26919cc0ae685aa5a5b5b1d2d79fad4
Returns details of a previous transfer
[ { "docid": "d431fb4af18d789ad4ea95b7ac481b35", "score": "0.0", "text": "def get_peertransfers_token(token, opts = {})\n data, _status_code, _headers = get_peertransfers_token_with_http_info(token, opts)\n data\n end", "title": "" } ]
[ { "docid": "86caa3f0b94a8edc26f7f5d97ebbd698", "score": "0.65231365", "text": "def get_Previous()\n \t return @outputs[\"Previous\"]\n \tend", "title": "" }, { "docid": "86caa3f0b94a8edc26f7f5d97ebbd698", "score": "0.65231365", "text": "def get_Previous()\n \t return...
f259a64c986d457d142f545b471cb349
A long description of the song. TODO: belongs in view!
[ { "docid": "dcb315e2c791672b28b001f53b762ab6", "score": "0.81702256", "text": "def description\n\t\ts = \"#{title}, a song \"\n\t\ts+= \"by #{artist_names} \" if artists.length > 0\n\t\ts+= \"on Stoffi\"\n\tend", "title": "" } ]
[ { "docid": "7d50c909f7344d68f5d061f25d4de8eb", "score": "0.76434404", "text": "def meta_description \n if @song and !@song.new_record?\n \"Lyrics and info about #{@song.title} by Dinshaw.\"\n else\n @cms_page.title.blank? ? \"Dinshaw: Original singer songwriter. New York City\" : @cms_pa...
3a2fc37970c95845b6be06fc3d15b551
Apply an overlay on the image
[ { "docid": "72725993990e5a47dce6f05a967a894c", "score": "0.57782304", "text": "def overlay(what, where=:marked)\n return if not_registered\n @mim.overlay what, where\n end", "title": "" } ]
[ { "docid": "f418c0520a798a75f5d563352285f6bd", "score": "0.8014095", "text": "def do_overlay_image(image, hash)\n #puts \"get image\"\n #puts \"#{hash.inspect}\"\n #puts \"Image: #{hash[:image_path]}\"\n #puts \"File exists? #{File.exists?(hash[:image_path])}\"\n overlay_i = Magick::Image...
2dde462df1abd7093789ff3e7c484202
Genera un dump de la base de datos y retorna un Hash con el nombre del archivo y su path absoluto
[ { "docid": "9f1e5198e0575c85f5901342d13cb58a", "score": "0.0", "text": "def generate_dump\n backup_file = \"#{generate_directory}/#{backup_description}.sql\"\n env_info = YAML.load(File.read('config/database.yml'))[Rails.env]\n dbadapter = env_info['adapter']\n dbuser =...
[ { "docid": "cc134d5f947d09140b0dbd8316464e69", "score": "0.6734172", "text": "def marshal_dump\n {\n name: name,\n path: path.realpath\n }\n end", "title": "" }, { "docid": "57a3d5023cbb625752df49c5ec6e7d44", "score": "0.67311364", "text": "def to_h\n ...
4947ef602f1574973d2fc182cb947e36
tests that foreign images will not be converted to use server's address
[ { "docid": "841be6377314c851f9d630fdc6c28d06", "score": "0.6268821", "text": "def test_foreign_images_will_not_be_converted\n data = post_book('id' => 2)\n assert_equal('http://www.example.com/images/books/calculus.jpg',\n data[0]['data']['image'])\n end", "title": "" } ]
[ { "docid": "a1fd23c41e94899370200390f0b84d07", "score": "0.6342282", "text": "def imagekit_should_handle_remote?\n true\n end", "title": "" }, { "docid": "879fa07e79af71dfa6c64110a420f9ac", "score": "0.6214666", "text": "def test_valid_nonlocal_uris\n [\n ['file://example...
90de4e21ae5fb5d2eb7aab3390291c31
GET /pkmns GET /pkmns.json
[ { "docid": "eb779a914e7ccaa5c85c889c8b37c64b", "score": "0.52351403", "text": "def index\n @pkmns = Pkmn.all.order(updated_at: :desc).limit(20)\n # sortiert nach \"updated_at\", absteigend, maximal 20 Datensaetze\n if params[:search]\n @pkmns = Pkmn.search_pkmns(params[:search])\n end\nen...
[ { "docid": "38b34e5af55c24ba12972eb3a4837140", "score": "0.55890006", "text": "def index\n @pnms = Pnm.all\n end", "title": "" }, { "docid": "313a87ea963acc87a0612a881e02cbcb", "score": "0.55345", "text": "def index\n\n @pnsqs = Pnsq.all.order('id DESC').page(params[:page]).pe...
38e366c9d2ac4d8393cba820cb2529a2
Reorder an migration unit within the migration unit group Reorder an migration unit within the migration unit group by placing it before/after the specified migration unit
[ { "docid": "fedb99aa93b8badb393174ac7a554030", "score": "0.5566019", "text": "def reorder_migration_unit_reorder_with_http_info(group_id, migration_unit_id, reorder_migration_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlane...
[ { "docid": "3416f1ebe353d5bc0aed6b29e048a94e", "score": "0.6322122", "text": "def test_reorder_up\n OrderTest.change_order(2, 5)\n assert_equal(2, OrderTest.find(3).order)\n assert_equal(3, OrderTest.find(4).order)\n assert_equal(4, OrderTest.find(5).order)\n assert_equal(5, OrderTest.fin...
7311e1e0d276e32f5e370061a7280cb4
Returns a http request for the given url and parameters
[ { "docid": "f68ba7a3d75d309733bb27cee7911538", "score": "0.0", "text": "def fetch(url, params, method=nil)\n if method && method == 'GET'\n url = build_get_uri(url, params)\n end\n uri = URI.parse(url)\n\n http = Net::HTTP.new(uri.host, uri.port)\n #http.use_ssl = true\n\...
[ { "docid": "bdc462996a1ec6af3417820af96c215a", "score": "0.8013462", "text": "def make_request url, parameters={}, method=:get, settings={}\n raise 'not implemented'\n end", "title": "" }, { "docid": "284b4e0493b3caeadc4ae78940a78d8b", "score": "0.7628805", "text": ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "88666131d807bf882f4922951e6e02be", "score": "0.0", "text": "def set_console_preference\n @console_preferences = ConsolePreference.first\n if @console_preferences.nil?\n @console_preferences = ConsolePreference.new\n end\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.603186", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015241", "text": "def ...
091f1ffc4d16f19d9108a70c91dfa27c
Varghese et. al. use 10_000 but that might take ~5h to complete 1_000 takes ~8' on a 1 core `m3.medium` or ~2.6' on a 2 core `m3.large` aws instance
[ { "docid": "37efe243daab2aff3f1e9a05d7814a81", "score": "0.0", "text": "def np\n 1_000\n end", "title": "" } ]
[ { "docid": "599926eeb7444bf1f9f0cf9d9606f56a", "score": "0.60505855", "text": "def speed_up\n speed_up_by (10)\n end", "title": "" }, { "docid": "5a08a9ebe17128eea6810b36b4cb00ca", "score": "0.59908235", "text": "def speed_up\n speed_up_by 10\n end", "title": "" }, { ...
0a9f02126b4e8dc93648f77f4b7b3a73
TODO: find a place for view helpers
[ { "docid": "d5691f0f11d34e5f240dadd8ab8a858c", "score": "0.0", "text": "def user_url(user)\n \"http://last.fm/user/\" + user\n end", "title": "" } ]
[ { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.7323243", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.7323243", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", ...
f9c3de5c702ccb42f0f4362179a4232f
used by the slices to throw an error when a UUID was expected in a slice command but no UUID value was found
[ { "docid": "b0587bbc602e3425b7683101af79fecd", "score": "0.7620072", "text": "def throw_missing_uuid_error\n raise ProjectRazor::Error::Slice::MissingArgument,\n \"Expected UUID argument missing; a UUID is required for this command\"\n end", "title": "" } ]
[ { "docid": "fd91d8d91e796a15ee9b551d7c22ad33", "score": "0.81241125", "text": "def throw_uuid_not_allowed_error\n raise ProjectRazor::Error::Slice::SliceCommandParsingFailed,\n \"Unexpected UUID argument found; a UUID value is not allowed in this command\"\n end", "title": "...
7a394561c7ca6fb5bc70fd315485e67d
Access URLs (as opposed to the raw `url`) providing public access to the attachment, such as for viewing, playback, download etc. Required because: Access to the original url may be forbidden to the general public The attachment may have been postprocessed (for example, a video file might have been transcoded) to a bet...
[ { "docid": "08fd47c2233e1820a7d23ce99ec28881", "score": "0.0", "text": "def access_urls\n store.access_urls\n end", "title": "" } ]
[ { "docid": "f6955621909a82c67f870665665848f8", "score": "0.7005219", "text": "def url\n \"http://192.41.170.159:3000\"+\"#{attachment.url}\"\n end", "title": "" }, { "docid": "0bd82bd8deb85d90bbf0c921cebddec7", "score": "0.6672589", "text": "def public_url\n self.pic.to_s\n e...
2e193f8c1f95ede28a0244af193cdbad
Unconfigure client PXE boot
[ { "docid": "a91b4da564f8fa5961c6bb1132e26ef8", "score": "0.7370394", "text": "def unconfigure_vs_pxe_client(options)\n options['mac'] = get_install_nac(options)\n if not options['mac']\n handle_output(options,\"Warning:\\tNo MAC Address entry found for #{options['name']}\")\n quit(options)\n en...
[ { "docid": "a7a992e478d7dd04252009f0e29a000f", "score": "0.77402914", "text": "def unconfigure_vs_pxe_client(client_name)\n client_mac = get_client_mac(client_name)\n if !client_mac\n puts \"Warning:\\tNo MAC Address entry found for \"+client_name\n exit\n end\n tftp_pxe_file = client_mac.gsub...
57932b7cef3bf8d96138b85d13818ec0
Offset modifiers used to calculate x and y coordinates over matchdata[:distribution]s of pieces [0] X or Column offset [1] Y or Row offset return Array x and y offsets per direction
[ { "docid": "75d272e00057a31c7c33b7dc8f9ec9d4", "score": "0.0", "text": "def direction_modifier(direction)\n case direction\n when \"+\" then @direction = [0, 1]\n when \"-\" then @direction = [0, -1]\n when \"<\" then @direction = [1, 0]\n when \">\" then @direction = [-1, 0]\n else \n ...
[ { "docid": "d4466933a32097063e7ddf9e69eb590a", "score": "0.6577245", "text": "def offset(dist)\n (Vector[*@xy] + (facing * dist)).to_a\n end", "title": "" }, { "docid": "7c99ef54c0baa55608e36dc7f26ce0dd", "score": "0.6405045", "text": "def offset(x, y)\r\n end", "title": ""...
2a2c2cbcc4973df844e1a19485fad878
Retreives the connection that is used for the database inserter
[ { "docid": "53da665312ad0407c24855d61a2dcb02", "score": "0.7164782", "text": "def connection\n orm_module::Base.connection\n end", "title": "" } ]
[ { "docid": "467227f6bcf3b887fb13c108a4babd22", "score": "0.758246", "text": "def get_DBConn\n return @dbconn\n end", "title": "" }, { "docid": "a1ecc467b641ebc24fa04e879e9b23d5", "score": "0.7414339", "text": "def connection\n @db || connect\n end", "title": "" }, ...
fbe2560a3770e3e7c1db1c4dd4d0a4c4
PATCH/PUT /staffs/1 PATCH/PUT /staffs/1.json
[ { "docid": "2ec510776ef6389190f4b259176c39b8", "score": "0.7365904", "text": "def update\n respond_to do |format|\n if @staff.update(staff_params)\n format.html { redirect_to @staff, notice: (t 'staffs.title')+(t 'actions.updated') }\n format.json { head :no_content }\n else\n...
[ { "docid": "949cfec9b44fb2821b5fd2147e4d7dbe", "score": "0.7524374", "text": "def update\n @staff = Staff.find(params[:id])\n\n respond_to do |format|\n if @staff.update_attributes(params[:staff])\n format.html { redirect_to @staff, notice: 'Staff was successfully updated.' }\n ...
4b387c77a29942dd4b1cdbdcd0b0c83f
custom fields has existed
[ { "docid": "10d9ed75c3a3893c17b27d709bd20373", "score": "0.0", "text": "def test_ut_cbtt11a_t5_rcf_002\n parent_pj_id = 1\n child_pj_id = 3\n # delete redmine setting\n redmine_settings = RedmineSetting.find(:all)\n redmine_settings.each do |redmine_setting|\n redmine_s...
[ { "docid": "7b6d00290ca67efd91aa5d35b4ee38fd", "score": "0.7263155", "text": "def custom_fields_allowed?\n true\n end", "title": "" }, { "docid": "74de4eea222274e21faa3e24fc7faa3d", "score": "0.6941062", "text": "def has_field?(name); @fields.any? { |n, t| n == name } end...
5762762122cf9b3020c3fe8768e8470c
set debug to a true/false value.
[ { "docid": "19769114d3ed3d04adcc61ff9135f119", "score": "0.8862187", "text": "def debug=(truthy=false)\n\t@debug=truthy\n end", "title": "" } ]
[ { "docid": "1f3cd61397d3220057f3de061efd2ea9", "score": "0.8641214", "text": "def toggle_debug\n @debug = @debug == false ? true : false\n end", "title": "" }, { "docid": "c9b6c22cf7465303286a203d973dc28c", "score": "0.83211315", "text": "def debugging(bool)\n @@debug ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b2ba333b97d0dfb36d7b466a07cde38a", "score": "0.0", "text": "def set_income_sub_category\n @income_sub_category = IncomeSubCategory.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...
56427ec96a686aab74b971c7433fd3cd
Public default constructor used by TestRig
[ { "docid": "9cc874c097c09c2ee0f65dc4b3619aca", "score": "0.73829895", "text": "def initialize\n super()\n end", "title": "" } ]
[ { "docid": "700c042555d8ebc7c4de252bf9ffc0af", "score": "0.81060576", "text": "def constructor; end", "title": "" }, { "docid": "8e3629bb42b471c640e3e1bd665bf3b2", "score": "0.8074828", "text": "def initialize(*) end", "title": "" }, { "docid": "8e3629bb42b471c640e3e1bd66...
0d852da38131e80e2d5d30a0d3b22bed
Tell if +type+ is equivalent to current type. NOTE: type can be compatible while not being equivalent, please refer to `hruby_types.rb` for type compatibility.
[ { "docid": "fb88ea7c7ae4f2128622609af3e41e0d", "score": "0.7965623", "text": "def equivalent?(type)\n return (type.is_a?(TypeTuple) and\n !@types.zip(type.types).index {|t0,t1| !t0.equivalent?(t1) })\n end", "title": "" } ]
[ { "docid": "90e00a2c5a717fc0c6d9dd18b3e46af4", "score": "0.8315736", "text": "def equivalent?(type)\n # By default, types are equivalent iff they have the same name.\n return (type.is_a?(Type) and self.name == type.name)\n end", "title": "" }, { "docid": "b7f2c79...
7c2c770b6b753c068eb2cc7d1e173557
POST /post423s POST /post423s.xml
[ { "docid": "692e5a7af0712cfa16d237f9741bb7f7", "score": "0.6109062", "text": "def create\n @post423 = Post423.new(params[:post423])\n\n respond_to do |format|\n if @post423.save\n format.html { redirect_to(@post423, :notice => 'Post423 was successfully created.') }\n format.xml ...
[ { "docid": "c78e0b38d566040be49ce816aa8db91e", "score": "0.64000154", "text": "def post(xmldoc)\n headers = {'Content-Type' => 'text/xml'}\n check_response( @httpcli.post(@endpoint, xmldoc, headers) )\n end", "title": "" }, { "docid": "fa8fcc23911ab0c33dc007eceacc29f5", "score": "...
b48fa06f48a7000bc21ae9d49d671b45
Make class items accessible via methods
[ { "docid": "ff2cd90a09aa4f0ba7244b82c73a124d", "score": "0.0", "text": "def method_missing(method_id, args = nil)\n args.nil? && to_h[method_id] || super\n end", "title": "" } ]
[ { "docid": "f4ad13bf5fa71b1e7bc47220336ffdbf", "score": "0.6524001", "text": "def methods() end", "title": "" }, { "docid": "1e5e53c4b9e93d9482caa25c8f435412", "score": "0.6240111", "text": "def methods; end", "title": "" }, { "docid": "1e5e53c4b9e93d9482caa25c8f435412", ...
eb0b98da7484cebb6cb7a29302562fa0
Get patients with identifiers only
[ { "docid": "e5be166a1bc4ae1efefd909a4bc17570", "score": "0.0", "text": "def build_demographics(people)\n demographics = {}\n people.each do |person|\n next if person.blank?\n next if person.patient.blank?\n next if person.patient.patient_identifiers.first.blank?\n demographics[person.patie...
[ { "docid": "4d9ea4df0b2f6a92c9f28fdb71c5dd24", "score": "0.70403326", "text": "def patients()\n sql = 'SELECT patients.*\n FROM patients\n INNER JOIN diagnoses\n ON diagnoses.patient_id = patients.id\n WHERE disease_id = $1;'\n values = [@id]\n patients = SqlRunner.run( sql, values ...
9191775af56a40f8e938a5fc719fcb2d
Adds a header to the data. The name is converted to a +Symbol+ before it is added. Returns the header object.
[ { "docid": "61dec1ecc1da822686f3969a640719aa", "score": "0.6580594", "text": "def add_header(name)\n add_header_object(Header.new(name, @logger))\n end", "title": "" } ]
[ { "docid": "de3f6e8ca8b24577ab9791405b371ab8", "score": "0.7285228", "text": "def add_header(name, value)\n end", "title": "" }, { "docid": "f2db7e5a0c78f6a0b99ed0a64e8d9f3e", "score": "0.71375614", "text": "def header header, data\n @headers[header] = data\n end", "...
7a67ece5e59f4fd27e16b17a7d1eb85c
Returnes true if this content is localized (based on data source config)
[ { "docid": "8262078ef6d67aaa5d0b890d043042fa", "score": "0.64457417", "text": "def locale_content?(base_filename_or_identifier, kind)\n base_filename_or_identifier =~ locale_exclude_regex(kind) ? false : true\n end", "title": "" } ]
[ { "docid": "f91992d6eb385b1308914755b7cdc9f0", "score": "0.8157638", "text": "def localized?\n true\n end", "title": "" }, { "docid": "c0a03ea750541eb0407526afb403c9e2", "score": "0.7731185", "text": "def localized?\n false\n end", "title": "" }, { ...
a8378eb5d90edd0aa5517bfd9dcc7576
default level is :info
[ { "docid": "1c7b48bbdd2a2afc54c2037142c5ead6", "score": "0.0", "text": "def log_level=(val)\n @@log_level = val\n end", "title": "" } ]
[ { "docid": "4b0ca871500436cfb00e743dd3f5c490", "score": "0.8586634", "text": "def info?; @level <= INFO; end", "title": "" }, { "docid": "4b0ca871500436cfb00e743dd3f5c490", "score": "0.8586634", "text": "def info?; @level <= INFO; end", "title": "" }, { "docid": "f9b62c6e...