query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
11cd8a9f7034f8ae8ae91f951693ac8f
We hold in memory a list of the tags that were appended to the path when this page was selected. This method adds tags to that list. It is normally called only once, to populate the list.
[ { "docid": "c4d40b7f5087c2682b04389b15e8b2da", "score": "0.5528654", "text": "def add_request_tags(tags=[])\n if tags.any?\n tags.collect! { |tag| Tag.find_by_title(Rack::Utils::unescape(tag)) }\n self.requested_tags = (self.requested_tags + tags.select{|t| !t.nil?}).uniq\n ...
[ { "docid": "b787bb97590951fcd73a69136b09a64e", "score": "0.6498821", "text": "def set_tags(page)\n tags = page.data['tags']\n\n if tags\n tags = (tags.kind_of?(Array) ? tags : tags.split)\n else\n tags = []\n end\n\n tags << page.data['category']\n ...
779b59fd0b4f913ddadd79e78a8c58ad
Helper Methods Retrieve a file from Sharepoint. This is not a standard Web Service method, buth rather a convenience method that is part of ViewpointSPWS.
[ { "docid": "e40a8aee20d1872d20c21b6ff531720e", "score": "0.70185685", "text": "def get_file(file_ref)\n p1 = Pathname.new @spcon.site_base.request_uri\n p2 = Pathname.new \"/#{file_ref}\"\n target = p2.relative_path_from p1\n @spcon.get(target.to_s)\n end", "title": "" } ]
[ { "docid": "64378add1faa7a0a511496a631aac83c", "score": "0.6905582", "text": "def get_file\r\n\r\n @file_import = FileImport.find_by_id(params[:id])\r\n filename = nil\r\n filepath = nil\r\n document = nil\r\n case params[:sid].to_s\r\n when \"file\"\r\n filename = @file_import.fi...
434b4520fc16ae7bb1fa89bf4bcb10d4
=> this makes finding exspouses easier (although what about spouses that died?)
[ { "docid": "4abe03d29b486e3cdb327bed3ff90bb7", "score": "0.5130178", "text": "def find_current_spouse_relative #darn jeff and all of his women\n current_spouse = nil\n\n current_marriage_array = self.reverse_marriage_branches.where(:marriage_end => nil) + self.marriage_branches.where(:marr...
[ { "docid": "2011c491fa159746e4f473f638fb4aa5", "score": "0.63268274", "text": "def spouse\n spouses.select{ |s| s.alive? }.sort{|a,b| a.age <=> b.age}.first\n end", "title": "" }, { "docid": "8423adf2545c93436caddf5c9103c17a", "score": "0.6035197", "text": "def spouse\n nil\n ...
0814798572385669b51e9c6c53913ffb
get_book_series converts the book_series_id given by the routing to
[ { "docid": "231df76102102155802a5f1f21d8c7f3", "score": "0.7195928", "text": "def get_book_series\n @book_series = BookSeries.find(params[:book_series_id])\n @book_series_1 = BookSeries.first\n end", "title": "" } ]
[ { "docid": "128b8058ea35e2eb517dbaacc967d871", "score": "0.69469506", "text": "def get_chapter\n @book_series = BookSeries.find(params[:book_series_id])\n @book_series_1 = BookSeries.first\n @collection = @book_series.collections.find(params[:collection_id])\n @book = @collection.books.find(...
fa6608e6a6f7e946f7611e1add57f0ea
Encodes a line of pixels using 8bit grayscale alpha mode.
[ { "docid": "da169b4256a3517043bc8a0b7e563b57", "score": "0.7253062", "text": "def encode_png_pixels_to_scanline_grayscale_alpha_8bit(pixels)\n pixels.pack(\"xn#{width}\")\n end", "title": "" } ]
[ { "docid": "3aeeecfe11694c75f1d998bf9f1547da", "score": "0.7264548", "text": "def encode_png_pixels_to_scanline_truecolor_alpha_8bit(pixels)\n pixels.pack(\"xN#{width}\")\n end", "title": "" }, { "docid": "53bafb08f33e1570b853b21a1372a0cc", "score": "0.6612649", "text": "...
1ed6622ddb47a0349b4d5f01236e6f45
Log a user in by authorization cookie if necessary.
[ { "docid": "1bc2652f973bbb106ceac0a6af3e2dde", "score": "0.68833643", "text": "def check_authorization\n authorization_token = cookies[:authorization_token]\n if authorization_token and not logged_in?\n user = User.find_by_authorization_token(authorization_token)\n user.login!(session) i...
[ { "docid": "f97c7cf2bee549c3de90ccfdd9302772", "score": "0.76988995", "text": "def login_from_cookie\n if cookies[:auth_token] \n user = User.find_by_cookie(cookies[:auth_token])\n\n # is a user found and is the cookie still valid\n if user && user.remember_token?\n se...
a7df166ef99804f8a2e776e71acee3ff
Closes the file. If +unlink_now+ is true, then the file will be unlinked (deleted) after closing. Of course, you can choose to later call unlink if you do not unlink it now. If you don't explicitly unlink the temporary file, the removal will be delayed until the object is finalized.
[ { "docid": "7fba203e853dbdc71373b86c305e0deb", "score": "0.81392604", "text": "def close(unlink_now=false)\n _close\n unlink if unlink_now\n end", "title": "" } ]
[ { "docid": "d4fb41a9384578cfb226fea4bc545b6c", "score": "0.8169154", "text": "def close(unlink_now=false)\n if unlink_now\n close!\n else\n _close\n end\n end", "title": "" }, { "docid": "8dc62fc5a7e8aed311484bfbb8cbe434", "score": "0.81238675", "text": "def close...
8f8fd1fe903122c9fa2908d172c645b8
MANAGE USERS GET /admins/edit/:user_uid
[ { "docid": "22ef3ae353e0ff63c27ea662c0648258", "score": "0.0", "text": "def edit_user\n session[:prev_url] = request.referer if request.referer.present?\n end", "title": "" } ]
[ { "docid": "a81867017658f9e655b5dd05f34fa8a2", "score": "0.7732407", "text": "def admin_edit\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "a81867017658f9e655b5dd05f34fa8a2", "score": "0.7732407", "text": "def admin_edit\n @user = User.find(params[:id])\n ...
138412f363f405528c04022ba9d7b19a
reduces units evenly when army_size_max is reduced
[ { "docid": "dc2107ee52cda1262a8415198cac96e4", "score": "0.6778204", "text": "def update_units\n if !self.size_present.blank? && !self.size_max.blank? && self.size_present > self.size_max\n self.details.reduce_units_to_size_max\n end\n end", "title": "" } ]
[ { "docid": "f31600deaab4db5501e554bf6a9841c6", "score": "0.73763543", "text": "def reduce_max_size\n @max_size /= 2\n end", "title": "" }, { "docid": "42132451c6a62aea9d0bbe45f319cd37", "score": "0.6790132", "text": "def shrink_to_fit; end", "title": "" }, { "doci...
3ca78d2da0e1db36522d63a072c9a748
Create a nonBoolean flag for a client
[ { "docid": "0c8ca6970ca070f0458aa01d6842806f", "score": "0.5761249", "text": "def add_flag(flag_key, flag_value=nil)\n # Let's instantly create a flag that's added to the client.\n flg = FlagConfig.find_or_initialize_by(key: flag_key) do |f|\n f.display_value = \"#{flag_key}\"\n f.save\n...
[ { "docid": "4bf86ab008d409c491b92ee8dae48c25", "score": "0.6724013", "text": "def toggle_client_flag(ct, params)\n return if ct.nil?\n\n if(flag = ct.client_flags.select { |x| x.yes_no_flag and x.yes_no_flag.key == params[:flag_name]}.first)\n flag.toggle_value\n flag.sav...
68c6de5a3636daaf0b7c5fbfb71ec9f4
AddOperation adds the operation to the Graph managed by s. If there is a name prefix associated with s (such as if s was created by a call to SubScope), then this prefix will be applied to the name of the operation being added. See also Graph.AddOperation.
[ { "docid": "7f06a4c185c402109f204f2b08a9a7dd", "score": "0.65035915", "text": "def AddOperation(args)\n args.name = args.type if args.name == ''\n args.name = namespace + '/' + args.name if namespace != ''\n op = graph.AddOperation(args)\n end", "title": "" } ]
[ { "docid": "88bf2985454e4b18703b86e5e97917e3", "score": "0.6332635", "text": "def add_operation(new_operation)\n @operations << new_operation\n end", "title": "" }, { "docid": "ef8618e79bf2ea9b35ae0f876fcfb21e", "score": "0.5476805", "text": "def operation(name, opts = {}, &block...
a993e99ff4c4a042e75461d502c228f2
END FORWARDERS starting a new page
[ { "docid": "97045840cb0d98ad9ab67284a2314928", "score": "0.0", "text": "def page=(page)\n @state = PageState.new(page)\n @content = []\n @characters = []\n @mediabox = page.objects.deref(page.attributes[:MediaBox])\n end", "title": "" } ]
[ { "docid": "30f91fc450065abe53a21a06c7e28b34", "score": "0.74005204", "text": "def start_page; end", "title": "" }, { "docid": "2fe024759d7d5e93796262b7dd549286", "score": "0.70400476", "text": "def begin_page(arg = nil)\n @content << \" * Empezando la página...\\n\"\n end", ...
c2ba6e6950558944ec4bdbb399f991eb
This lets JS access these properties of folder like in item_drawer.js, item.name works
[ { "docid": "cbeb80f73e4ce8e6e818dd3e9664d169", "score": "0.0", "text": "def serializable_hash(options = nil)\n {\n :name => name,\n :id => id,\n :coords => coords,\n :folders => folders,\n :documents => documents,\n :location_id => location.id\n }\n end", "title"...
[ { "docid": "de47e7faff4b83d770f0d996abf2db67", "score": "0.60625094", "text": "def name\n @item[\"name\"]\n end", "title": "" }, { "docid": "3d4e00b89f4235c4a2f24537fe5941dd", "score": "0.60029566", "text": "def item_name\n name\n end", "title": "" }, { "docid": "...
d59f6e976733ad6ea4e432de1a5ce333
to print bill of users
[ { "docid": "34941f4c5f75ce9bf5ea6e1b0cfc124d", "score": "0.7016541", "text": "def print_bill\n\t#fetch user details from user and shoping cards\n\t\tstatement14=@connection.prepare(\"select u.user_name,u.user_add,u.user_mobile \n\t\t\tfrom users u,cards c where u.user_id=c.user_id and c.card_no=?\")\n\t...
[ { "docid": "c4c3097f4aa5b51a7a2615f61e6dd0ea", "score": "0.68165815", "text": "def print_billcoins\r\n\t\t@billcoins.each_pair {|k, v| puts \"#{k}: #{v} billcoins\" unless k==\"SYSTEM\"}\t# don't print SYSTEM billcoin count\r\n\tend", "title": "" }, { "docid": "75581f0b075b7907594f14b998166c...
b3b42099e6ed69cd3927c030d421d461
GET /qus/new GET /qus/new.json
[ { "docid": "2c2564a7d12b025661c6b5e64d7df0d7", "score": "0.7259004", "text": "def new\n @qu = Qu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @qu }\n end\n end", "title": "" } ]
[ { "docid": "802f981ab85f678d78def95c2bb29a56", "score": "0.7202906", "text": "def new\n @new_comm = NewComm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_comm }\n end\n end", "title": "" }, { "docid": "106693f77fbae5a9073ae8...
b72762631445951801758bb2126c2d4a
Storing flash in lti token when http
[ { "docid": "7dbf2681d8048256790a037a20b68487", "score": "0.7293094", "text": "def http_flash(contr)\n # Set lti flashes (inside lti_token) if it's http_session as flashes will not work without session\n # Session flashes works in renders but not redirect_to\n session_nil = contr.ses...
[ { "docid": "6b49b614f0330858ad2d56d2dd879c06", "score": "0.6575752", "text": "def store_flash(res)\n cookie = @current.to_json\n res.set_cookie(\"_rails_lite_app_flash\", value: cookie, path:\"/\")\n \n end", "title": "" }, { "docid": "fe608980c781b6e19d4f9de6d3bd19b5", "score"...
9e7197bc4461af8bfd8449333f93d075
P A S S W O R D E R R O R S Generate messages for password errors.
[ { "docid": "4bf3df6863b6b82011e7f5ac7db0cb8e", "score": "0.66336066", "text": "def password_errors(params)\n # Use PdUser model's valid? method to generate error messages\n # for a password mismatch (if any).\n self.password = params[:pd_user][:password]\n self.password_confirmation = params...
[ { "docid": "36efdd11a21c3b1c5cce90a4ad7efb86", "score": "0.6943869", "text": "def rename_password_error_messages\n if @user.errors.messages[:password_confirmation] == [\"doesn't match Password\"]\n @user.errors.messages[:password_confirmation] = [\"doesn't match New password\"]\n end\n\...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ec491f2446f921bf6e09b9727e4207f5", "score": "0.0", "text": "def set_house\n @house = House.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...
a3e5ecfea7ea730c982c5350186b9e9b
Helper function to create and keep track of all the counters
[ { "docid": "d7e028b983f2cfd09d75ab818212052a", "score": "0.0", "text": "def report_counter_metric(metric, type, value)\n @processors ||= {}\n\n if @processors[metric].nil?\n @processors[metric] = NewRelic::Processor::EpochCounter.new\n end\n\n report_metric metric, type, @proc...
[ { "docid": "68e3c101ef50f28668faadcbcf77e243", "score": "0.797736", "text": "def getCounters; Hash.new; end", "title": "" }, { "docid": "3e454829c6b49d30993ea6e88cf04fcb", "score": "0.75476813", "text": "def counters\n if !defined?(@counters)\n @counters = {}\n ...
bd15692c016e1de492dfe0b4bad0ae13
example: l = Line.new l.x2=val print l =>
[ { "docid": "f9f91027f7e8d712cba8ad22cbba29cf", "score": "0.0", "text": "def x2= value\r\n value = value.to_s\r\n @attributes['x2'] = value\r\n value.to_number\r\n end", "title": "" } ]
[ { "docid": "496136623171e5a75fc88b2b64dd6aa8", "score": "0.6836412", "text": "def xyline(*args, &block); XYLine.new(*args, &block) end", "title": "" }, { "docid": "496136623171e5a75fc88b2b64dd6aa8", "score": "0.6836412", "text": "def xyline(*args, &block); XYLine.new(*args, &block) e...
f944d0bc9300296c97f853a208727f1a
GET /env_prefs/1 GET /env_prefs/1.json
[ { "docid": "a6f06c5ee638e9e51fdb938f1085a198", "score": "0.733047", "text": "def show\n @env_pref = EnvPref.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @env_pref }\n end\n end", "title": "" } ]
[ { "docid": "1bfeda2eae54df30b564f10beae638a9", "score": "0.66328526", "text": "def new\n @env_pref = EnvPref.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @env_pref }\n end\n end", "title": "" }, { "docid": "40b110f01032333486c08...
b3185fb4e4a3e3ec869c475a01fdff70
PATCH/PUT /bombermen/1 PATCH/PUT /bombermen/1.json
[ { "docid": "5d1b9b6b5003f8d3dbfbff16e43ee86e", "score": "0.68524736", "text": "def update\n respond_to do |format|\n if @bomberman.update(bomberman_params)\n format.html { redirect_to @bomberman, notice: 'Bomberman was successfully updated.' }\n format.json { render :show, status: ...
[ { "docid": "dd3646ee7e64581f510c7f5c731a55b6", "score": "0.6680221", "text": "def update\n @bom = Bom.find(params[:id])\n\n respond_to do |format|\n if @bom.update_attributes(params[:bom])\n format.html { redirect_to @bom, notice: 'Bom was successfully updated.' }\n format.json ...
36c6d2fc071125a287bf9dfaa2a18b0b
acwake wake the machine when power source (AC/battery) is changed (value = 0/1)
[ { "docid": "70fb5e1c7ca0f781667fc1dd20eab5fa", "score": "0.6693047", "text": "def acwake\n return nil unless @property_hash.has_key? 'acwake'\n return nil unless @property_hash['acwake'] == '0' || @property_hash['acwake'] == '1'\n \n @property_hash['acwake'] == '1' ? :true : :false\n end", ...
[ { "docid": "b457baf06b55623b8ceee35742522a10", "score": "0.658128", "text": "def wake\n write_bytes(255)\n # delay(50) # ?\n end", "title": "" }, { "docid": "0f90ab1c00a86b3f2f85ab0d091938f6", "score": "0.65226775", "text": "def sleep\n @awake = false\n end", "title": ...
cdc1edc76ca4d47c1ff4b979ad0c04a3
Hash def, or raw String def
[ { "docid": "4075eba10d6d5295a78a0701041498b1", "score": "0.0", "text": "def initialize aDef = {}\n if aDef.kind_of? Hash \n wrong = aDef.collect { |k,v| DEFAULTS.include?(k) ? nil : k}.compact\n raise \"Wrong definition, invalid constructs #{wrong}\" unless wron...
[ { "docid": "b78a8c3fbbda0dc6b3ed59f810316f24", "score": "0.72455883", "text": "def hash(*) end", "title": "" }, { "docid": "12e03e2f19e8569f66b5edfe84a15ea4", "score": "0.72024107", "text": "def hash_string\n hash_value.to_s(36)\n end", "title": "" }, { "docid": "95ed...
ce32a09ad2cda0b57087063995980551
Public: Simple action to test API authentication.
[ { "docid": "cb8f51e0c35fcc0ef8c375034b1d7cba", "score": "0.0", "text": "def test\n render :json => {:message => \"Successfully Authenticated\"}\n end", "title": "" } ]
[ { "docid": "b25b194b8bebd30d5135160b459fd00b", "score": "0.74839693", "text": "def auth_test(options = {})\n post('auth.test', options)\n end", "title": "" }, { "docid": "b25b194b8bebd30d5135160b459fd00b", "score": "0.748168", "text": "def auth_test(options = {})\...
28f9f95a3dc8cc1923ba639046384ee1
send out a request to flickr, this will fail because there is no api_key set a mock connection would be better here...
[ { "docid": "77aac375af02521153d2f5cb08308d73", "score": "0.0", "text": "def test_a_request\n response = client.get 'test.echo'\n assert response =~ /stat=\"fail\"/\n assert response =~ /code=\"100\"/\n assert response =~ /msg=\"Invalid API Key \\(Key not found\\)\"/\n end", "title": "" ...
[ { "docid": "d448c339b47399f3f108fdcc572660e9", "score": "0.7479477", "text": "def request_flickr_api(method, params={})\n puts \"Requesting the flickr api request for the method #{method}\"\n query = {\"method\" => method}.merge! params\n query.merge! @default_query\n response = HTTP...
7a60929c2eb72e3f5e43335c25e283f0
Returns groups in a group set as a an array of parsed responses
[ { "docid": "5a0f01186360a3a8d9991adf90ec15e0", "score": "0.6877816", "text": "def get_groups_in_group_set(group_set_id)\n group_set_data = Array.new\n\n @url = \"http://#{$canvas_host}/api/v1/group_categories/#{group_set_id}/groups\"\n puts \"@url is #{@url}\"\n \n @getResponse = HTTP...
[ { "docid": "1bf6ae31e048ee3d6a95fc45c655459a", "score": "0.7273196", "text": "def getGroups\n groups = $gm.get(\"/groups\", @token, \"per_page=100\")\n group_ids = Array.new\n\n groups['response'].each do |group|\n group_ids.push({\n 'name' => group['name']...
69286c703f8c520c77e873b58866f5ba
GET /drip_emails/new GET /drip_emails/new.json
[ { "docid": "2a091144ffbaf28a1a46e0ae19f35c96", "score": "0.7723961", "text": "def new\n @drip_email = DripEmail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @drip_email }\n end\n end", "title": "" } ]
[ { "docid": "1db5d88597da03d5fdcfbab9111b7bea", "score": "0.7916047", "text": "def new\n @email = @recipient.emails.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email }\n end\n end", "title": "" }, { "docid": "4c279cf3d2cd811348...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "b5abd534b35146f5baf9d21696041e05", "score": "0.0", "text": "def community_params\n params.require(:community).permit(:name, :image, :at_the_beginning, :domain)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6980957", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6783065", "text": "def strong_params\n params.requi...
fc048b03d35ab84015ec2c4e0f62b119
update the social media popularities this is separated out to avoid making too many calls
[ { "docid": "825fb7244b6343475e2eab54e1604a0a", "score": "0.6890175", "text": "def update_popularity\n @articles.map! do |article|\n article[:twitter_pop] = get_twitter_popularity(article[:url]).to_i\n article[:facebook_popularity] = get_facebook_popularity(article[:url]).to_i\n end\n en...
[ { "docid": "3d87b5d4d1c7c83282fad1331dcc13c4", "score": "0.64764565", "text": "def update_popularity\n self.popularity = (self.votes_for - self.votes_against)*10 + self.comments.count*5\n end", "title": "" }, { "docid": "efde4d01650c765d67c297d620ada166", "score": "0.6147535", "t...
b880d8ef01a4e73dbe5538927f586181
returns array of playlist_id for a song
[ { "docid": "a55df33edf9091cffa8a57bbfda6d10e", "score": "0.72439003", "text": "def find_playlists_for_song(song_name)\n track_array = self.find_track_ids_for_song_name(song_name)\n # this array contains matching playlists id for track_ids\n matching_playlists_array = []\n # enumerate...
[ { "docid": "e659c60421d877230f70da21b77c96cf", "score": "0.7567243", "text": "def tracks #returns array of tracks in the playlist\n PlaylistTrack.all.map do |playTrack|\n if playTrack.playlist_id == self.id\n song = RSpotify::Track.find(playTrack.track_id).id\n ...
7d341d853d82944c09d461dc3a518e50
Is delivery required for this order?
[ { "docid": "45a68ec4fc7a32ffe0e4238ba81e53e8", "score": "0.812666", "text": "def delivery_required?\n total_weight > BigDecimal(0)\n end", "title": "" } ]
[ { "docid": "86da059ebddf232faaa604ff259248ec", "score": "0.793383", "text": "def needs_delivery?\n # can write logic here for delivery methods\n false\n end", "title": "" }, { "docid": "4b5a9b99c100dd4058b8312f5551d5eb", "score": "0.7782593", "text": "def is_delivery_receipt_r...
4453672829b2433965d080196c185944
TODO MAXIBON create the default contest for maxibon and the periodicity type (daily and 60gg), the contest prizes and generate time to win
[ { "docid": "f87c060067b8b1693ab64d578f9961ff", "score": "0.6321096", "text": "def createMaxibonWins\n Apartment::Database.switch(\"maxibon\")\n if Property.count == 0\n Property.create(:name => \"Maxibon\", :activated_at => \"29/05/2014\")\n end\n contest = Contest.create(:title => \"Ma...
[ { "docid": "de89006a5bcea45235b09a418906c94d", "score": "0.65847903", "text": "def create60ggWins(contest,cp)\n beginning_date = contest.start_date.to_date\n day_range = (contest.end_date.to_date - contest.start_date.to_date).to_i\n total_prizes = 10\n winner_inserted = 0\n \n while wi...
477868f326bd3fa08753e1332b19f902
Public: Returns an Operation by service, port and operation name.
[ { "docid": "5b8ad952e3eb98990c3040d396daa29b", "score": "0.7511002", "text": "def operation(service_name, port_name, operation_name)\n verify_operation_exists! service_name, port_name, operation_name\n\n port = @documents.service_port(service_name, port_name)\n endpoint = port.location\n\...
[ { "docid": "d195e54ad5b29f6dd26826d74ced5a7e", "score": "0.73614377", "text": "def operation(service_name, port_name, operation_name)\n operation = @wsdl.operation(service_name.to_s, port_name.to_s, operation_name.to_s)\n verify_operation_style! operation\n\n Operation.new(operation, @wsdl, @ht...
9febae2a6b39828fbb74ee4b9a1d0c32
Add a new list to an account
[ { "docid": "e4b3f430374019a3486cc1294652616e", "score": "0.77760273", "text": "def add_list(list)\n Services::ListService.add_list(list)\n end", "title": "" } ]
[ { "docid": "8647a7401af11b66ae76a92b0e63e9be", "score": "0.76778716", "text": "def add_list(access_token, list)\n\t\t\tServices::ListService.add_list(access_token, list)\n\t\tend", "title": "" }, { "docid": "1acc6299e882b6f611980a499e17d509", "score": "0.75496733", "text": "def add_l...
2dc3190e3c1251a41a9ecb6f04b2649e
Provides conversion from different input types into the SignerKey to use in ManageData operation.
[ { "docid": "9777524fabac3466b11b2ad6057ed666", "score": "0.6578913", "text": "def SignerKey(input = nil)\n case input\n when Transaction\n SignerKey.pre_auth_tx(input.hash)\n when /^[0-9A-Za-z+\\/=]{44}$/\n SignerKey.hash_x(Stellar::Convert.from_base64(input))\n when /^...
[ { "docid": "cea19b6d7b404ca9c6f0315273218989", "score": "0.6673331", "text": "def key(*args)\n key = super \n if converter_name = key.options[:as_string]\n key_name = key.name.to_sym \n available_as_string key_name, converter_name\n attr_prote...
14b50aefb5033ca0ac66feeb50f1ab8f
DELETE /devices/1 DELETE /devices/1.json
[ { "docid": "8ad1505fe611ec7d215b486f1c7c222c", "score": "0.7365186", "text": "def destroy\n @device = Device.find(params[:id])\n @device.destroy\n\n head :no_content\n end", "title": "" } ]
[ { "docid": "926f32b2d558672aae3df73ff3da8c60", "score": "0.76682556", "text": "def delete\n Device.find(params[:device_id]).destroy\n end", "title": "" }, { "docid": "39696c18ce0c9aa316d25d955bf8eda3", "score": "0.75099915", "text": "def delete(options = {})\n options = { mo...
b298f3778bf13726beb2e7304db9f59d
GET /stores/reports/new GET /stores/reports/new.json
[ { "docid": "5d48730d5b3d99f033370859b143f837", "score": "0.816323", "text": "def new\n @stores_report = Stores::Report.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stores_report }\n end\n end", "title": "" } ]
[ { "docid": "064e5a750cddcc484e7037f7496ea0c8", "score": "0.75947386", "text": "def new\n @report = Report.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @report }\n end\n end", "title": "" }, { "docid": "064e5a750cddcc484e7037f749...
2e31da83942f7bdd60c4f4debd09fdd3
GET /recommend/recommend_apps GET /recommend/recommend_apps.json
[ { "docid": "053bfc1b453f0892904f91e9b4ff38e3", "score": "0.6269187", "text": "def index\n @recommend_recommend_apps = Recommend::RecommendApp.paginate(:page => params[:page])\n breadcrumbs.add I18n.t(\"helpers.titles.#{current_action}\", :model => Model_class.model_name.human), recommend_recommend...
[ { "docid": "0d7a298a205e3271d8feb9ad87d59c09", "score": "0.7100015", "text": "def index\n @recommend_apps = Welcome.approved.recommend.order('recommend DESC').limit(8)\n @new_apps = Welcome.approved.newapp.limit(8)\n end", "title": "" }, { "docid": "7124b79e900efc278249380b7c2de470", ...
1f4971194968ba6b699a15b90f610358
Filter only the calls that a value returned.
[ { "docid": "6e8d2ee9bf9903af505c72d880c13fca", "score": "0.66889906", "text": "def return_values\n Calls.new(select(&:returned?))\n end", "title": "" } ]
[ { "docid": "80ed6301f4112f47c56ed59ee7435423", "score": "0.6726055", "text": "def filter(value)\n true\n end", "title": "" }, { "docid": "e8e7b7cf85c91aee2e6e060b3f50196c", "score": "0.6374961", "text": "def filter(values); end", "title": "" }, { "docid": "e8e...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "519a61c8f345516e2f362eaa964a4724", "score": "0.0", "text": "def pokemon_params\n params.require(:pokemon).permit(:nome, :tipos, :imagem, :evolucao, :anteEvolucao)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74959", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957448", "text": "def strong_params\n params.require(:request).permit(param_whiteli...
67c9b47a1fd599931989aba0c05d4bff
Implement spaceship for comparable
[ { "docid": "4a9b734225fe8038b004a375ed57e0bc", "score": "0.0", "text": "def <=>(other)\n self.name <=> other.name\n end", "title": "" } ]
[ { "docid": "f6607d4e37d2172b4a60313195e4c5c6", "score": "0.6836759", "text": "def test_spaceship\n assert_nil( 1.m <=> 1.L )\n # PETER : meter and liter are like apples and oranges.\n # returns nil instead.\n # assert_equal( 0, (1.m <=> 1.L) )\n assert_equal( 1, (1.m <=> 1.cm) )\n end"...
5d718fd9ac38b76c3ecccda6882da831
=> "" Examples word_1 = "Lovelace" word_1.map! do |ch| if ch == 'e' '3' elsif ch == 'a' '4' else ch end end p word_1.map! => "Lov3l4c3"
[ { "docid": "47bbce96a9aae1c9bea7b49d21178277", "score": "0.0", "text": "def multiply(num1, num2)\n return 0 if num2 == 0\n if num2 > 0\n sum = num1 + multiply(num1, num2 - 1)\n else\n sum = -(num1 + multiply(num1, -(num2) - 1))\n end\n sum\nend", "title": "" } ]
[ { "docid": "5b739e70a19967a652f68872a51b667f", "score": "0.7792043", "text": "def map_word(word)\n vowels =[\"a\", \"e\", \"i\", \"o\", \"u\"]\n word_map = \"\"\n word.split(\"\").each_with_index do |letter, index|\n # To handle \"qu\" treats \"u\" after \"q\" as a consonant.\n if letter == \"u...
c51389a7eaa426fa68fc3ec5d460a15a
Allows us to use this which we set on the form
[ { "docid": "4377f3ab945075b530c9b572d267218b", "score": "0.0", "text": "def save_with_payment\n if valid? # That it is a valid user if added validation to form\n customer = Stripe::Customer.create(description: email, plan: plan_id, card: stripe_card_token) # Charges a customer and Stripe returns...
[ { "docid": "b3b09a9c9c1a6edc630c5ca12336afc3", "score": "0.70311", "text": "def set_form\n end", "title": "" }, { "docid": "9d17c779b21f2755fea966084d279bde", "score": "0.6565948", "text": "def modifier_form?; end", "title": "" }, { "docid": "9d17c779b21f2755fea966084d...
d8b995e6deedf0b994b807ebd5ead0db
Updates a version [Arguments] :details (required) Details of the version to be updated
[ { "docid": "e6aa9f6103ad718ec496b15160f0354d", "score": "0.8018875", "text": "def update(details)\n details.each do |k, v|\n self.send(\"#{k.to_s}=\", v)\n end\n self.class.update(self.version_key, details)\n end", "title": "" } ]
[ { "docid": "876e90bb1bdd967f182d1acf496e661a", "score": "0.7124834", "text": "def update!(**args)\n @version = args[:version] if args.key?(:version)\n end", "title": "" }, { "docid": "3cf2a92ce246036fcb4a3e5464835ab7", "score": "0.693863", "text": "def update!(**args)...
d8d53d00b5fbb89dd42c3bb9048b6e38
POST /plays POST /plays.json
[ { "docid": "c567a3a10e39a2901081ba684cf38ab5", "score": "0.66025686", "text": "def create\n @play = @author.plays.build(play_params)\n\n respond_to do |format|\n if @play.save\n format.html { redirect_to play_path(@play), notice: 'Play was successfully created.' }\n format.json ...
[ { "docid": "12f3e2c50486ddaf8692b7b9441d3919", "score": "0.70877475", "text": "def create\n @play = Play.next\n\n respond_to do |format|\n if @play.save\n format.html { redirect_to @play, notice: 'Play was successfully created.' }\n format.json { render :create, status: :created...
bd7dfe6b0c23275ce8d534360200d77f
Test assertEmpty failure collection:: Collection for assertion message:: The assertion message
[ { "docid": "4243b19d2566293ea950d91c91f92437", "score": "0.87683046", "text": "def assertEmptyWithMessageFailTest collection, message\n rescue_assertion /#{ASSERT_EMPTY_ERROR}/, message do\n assertEmpty collection, message\n end\n end", "title": "" } ]
[ { "docid": "1111b05b79f9a5076b9615f3715f2202", "score": "0.8763729", "text": "def assertEmptyWithMessageTest collection, message\n assertEmpty collection, message\n end", "title": "" }, { "docid": "8e37cdb999306134af5e3f6fefaf85d8", "score": "0.8751093", "text": "def assertEm...
576c89ee57625df189d656cc9171ba76
def image_params params.require(:image).permit(:body) end
[ { "docid": "5ba8c91999e88664d02dc6d8a3319908", "score": "0.0", "text": "def find_image\n @image = Image.find(params[:id])\n end", "title": "" } ]
[ { "docid": "808e970a309669474125d1fe83f54f05", "score": "0.89052016", "text": "def image_params\n params.require(:image).permit!\n end", "title": "" }, { "docid": "f5c292a530f28e1602ea3738929dd20a", "score": "0.8895079", "text": "def image_params\n params.require(:image)...
a79370084133d02aac554c12eb1478c3
Authenticated user can acces his inboxes using this view Init the backbone app
[ { "docid": "1777dbd197fbd17e9ffacd4b45926d28", "score": "0.0", "text": "def show\n @mailboxes = current_account.mailboxes\n inbox = current_account.mailboxes.find_by_name(\"INBOX\")\n @messages = inbox.messages.order(\"uid DESC\").limit(50) if inbox\n end", "title": "" } ]
[ { "docid": "202edaeb7898864c967fa27c6a45c2d5", "score": "0.65691596", "text": "def index\n authorize Box, :index?\n @boxes = current_user.boxes\n end", "title": "" }, { "docid": "20a5a94c507b92d4bfc2a9260ab32c4e", "score": "0.6395457", "text": "def index\n @boxes = Box.wher...
18d0c3c805382ffaa845b2d8099baeb8
Sets the playing field's number of columns
[ { "docid": "bc8fb49cdaf6933753c2257f7ffe6905", "score": "0.0", "text": "def parse_columns(columns)\n match.playing_field.columns = columns\n end", "title": "" } ]
[ { "docid": "94c854b97fca33e2b9e3171cbfec3c70", "score": "0.72748494", "text": "def columns=(n)\n @columns = n\n end", "title": "" }, { "docid": "d65ab8a0b678d0775f256fc3cc74e362", "score": "0.67738694", "text": "def num_columns\n 20\n end", "title": "" }, { "d...
e1292ae27aba4a55d09a72de6d102077
Search using subjects and course numbers
[ { "docid": "2630095277148f11ce47ff98ea69e72b", "score": "0.0", "text": "def catalog_search(dept = nil, num = nil)\n # Construct the URL\n endpoint = base_url + endpoints[\"CATALOG\"]\n endpoint << \"/#{dept}\" unless dept.nil?\n endpoint << \"/#{num}\" unless num.nil?\n ...
[ { "docid": "1b993d7ab884e35be6e25254493dec6f", "score": "0.72878593", "text": "def search\n # if the dropdown menu is not used, search all courses\n if params[:subject_id].blank?\n @courses = Course.where(\"lower(name) LIKE ?\", \"%#{params[:search_text]}%\".downcase)\n # if dropdown menu ...
a4398bffaa740bc5dbb358fb7c7c265f
returns info on the given auction item
[ { "docid": "0e75be872f00eab6d9c5db0d4a591c68", "score": "0.7402389", "text": "def get_info (item_number)\n return @not_registered_msg unless self.is_valid_bidder\n \n item_number = item_number.to_i\n \n item = @db[@items_coll].find_one('number' => item_number)\n if item == nil then\n ...
[ { "docid": "91f9e2b9b207600ab48c6f604c9de0c2", "score": "0.7082191", "text": "def iteminfo\n @iteminfo ||= Dmm::Iteminfo.new(@attrs[:iteminfo])\n @iteminfo\n end", "title": "" }, { "docid": "8c91bf91d660985a3a59d4f0f5ab7394", "score": "0.7016379", "text": "def item\n ...
d9a571cf3356422c583460573b8bd995
See if we have processed a node already in that case return the cached THL node. Otherwise, invoke the process() function on it, which will put it in the cache.
[ { "docid": "56ffa1f477660c2e207971824593ca74", "score": "0.852715", "text": "def get_cached_or_process(node)\n node_id=node.id_\n if @cache_nodes.has_key?(node_id)\n @cache_nodes[node_id][:thl_node]\n else\n # If we don't have the corresponding node cached yet, do it now\n ...
[ { "docid": "adbdfa5af23a93b6b23524f7a35b6b73", "score": "0.6181376", "text": "def cache_node(node)\n cs = @c_start\n if cs.next_node != node\n remove_from(node,false,true)\n node2 = cs.next_node\n GeoTree.join_nodes(cs,node)\n GeoTree.join_nodes(node,node2)\n e...
030b26664122bb22ee5ab900dd10e486
Sends an HTTP request with the given file as a stream
[ { "docid": "dd003c6a2451fb55132b83f86a4a5c36", "score": "0.68745875", "text": "def make_file_request(method, url, file_path, mime_type, entry = nil)\n if not File.readable?(file_path)\n raise ArgumentError, \"File #{file_path} is not readable.\"\n end\n file = File.open(fil...
[ { "docid": "0d761e48cd74cf6dfcf9b6d3ef036a6a", "score": "0.74492097", "text": "def send_file_contents( file, filename )\n response.status = 200\n prepare_file_headers( file, filename )\n stream_body( file.stream )\n end", "title": "" }, { "docid": "c3fca858bc8cccc588d96fe242d55b9c"...
dfcebd3b9651b11e7432f1c566db21b5
Checksums the entire contents of the given [header] Writes the resultant checksum into indices 148155 of the same [header], and returns the modified header. 148155 is the "size" range in a tar/ustar header.
[ { "docid": "1166073503fe2fcc66ce62fccc48c77e", "score": "0.79505", "text": "def checksum_header(header)\n\n # blank out header checksum\n replace_string_range(header, TAR_CHECKSUM_OFFSET_START, TAR_CHECKSUM_OFFSET_END, ' ')\n\n # calculate new checksum\n checksum = 0\n\n for i in 0..(TAR_...
[ { "docid": "ee1a280806270866312091f7856a8040", "score": "0.68809676", "text": "def calculate_checksum(header)\n checksum = 0\n \n header.each_byte do |byte|\n checksum += byte\n end\n \n checksum.to_s(8).rjust(6, \" \") + \"\\0 \"\n end", "title": "" }, { ...
ccf2c3240e3ee015d47b6c4f1d96a4a9
self.included(includer) Converts a string data to a Ruby value.
[ { "docid": "235e0e992b72715a5709bcd23674be55", "score": "0.0", "text": "def edit_data_string_to_obj(data, format)\n case format\n when 'JSON', 'json'\n if data.nil?\n {}\n else\n Chef::JSONCompat.to_json_pretty(data, quirks_mode: true)\n ...
[ { "docid": "ca2da6a1c101d95b000bfafe4419504e", "score": "0.6220915", "text": "def process_include! file, data, target_data\n data\n end", "title": "" }, { "docid": "4710c0f4b07b5120b5f5867ec6a1ff0b", "score": "0.6014207", "text": "def include string\n @include << string\n ...
06fce3cd3fd6a9c69f501c678ee149bc
keep only the elements that start with a vowel
[ { "docid": "c1b87ed58bb471033a5dd1d0ac36bb4e", "score": "0.80390835", "text": "def select_elements_starting_with_vowel(array)\n array.reject { |e| e.chars.first.scan(/[aeiou]/).empty? }\nend", "title": "" } ]
[ { "docid": "f79ef7da83109ab745cf3af966a5bf4e", "score": "0.7714644", "text": "def select_elements_starting_with_vowel(array)\n array.select{|a| /(?<vowel>[aeiou])/.match(a.chr)}\nend", "title": "" }, { "docid": "67725518545930508dd58a95cc9f0936", "score": "0.77031124", "text": "def ...
4671d17101127f3eec749ba31477dc00
GET /tutor_schedules GET /tutor_schedules.xml
[ { "docid": "6fba8a286b93e32beca642ab6160829c", "score": "0.62707806", "text": "def index\n @search = TutorSchedule.search params[:search]\n @tutor_schedules = @search.paginate :page => params[:page], :per_page => 10, :order => 'id DESC'\n\n respond_to do |format|\n format.html # index.html...
[ { "docid": "796140ee1215d76a3765656386f79a34", "score": "0.77987415", "text": "def live_schedule\n get('sports/en/schedules/live/schedule.xml')\n end", "title": "" }, { "docid": "5b1e979362a770475b24264e5b94cd90", "score": "0.77198464", "text": "def tournament_schedule(tourna...
eed2271d4764bc48047c70e9ab950fc3
Sends a list of tickets (in SOAP format) to Remedy individually (each ticket in the list as a separate web service call). Args : +tickets+ List of savonformatted (hash) ticket creates (new tickets).
[ { "docid": "e1915b1e8b850dd3a9c11aa8caee3f6c", "score": "0.8202673", "text": "def create_tickets(tickets)\r\n fail 'Ticket(s) cannot be empty' if tickets.nil? || tickets.empty?\r\n client = Savon.client(wsdl: File.join(File.dirname(__FILE__), '../config/remedy_wsdl/HPD_IncidentInterface_Create_WS...
[ { "docid": "1cb64a1355ca7d9b27ee86086b30d840", "score": "0.82951456", "text": "def create_tickets(tickets)\r\n fail 'Ticket(s) cannot be empty' if tickets.nil? || tickets.empty?\r\n\r\n tickets.each do |ticket|\r\n send_ticket(ticket, @servicenow_data[:servicenow_url], @servicenow_data[:redir...
99f07abb29c46733327b38da76a14d27
Test that token_expiration_time returns valid date from a valid token
[ { "docid": "c3d49a76e21515767e60f6aa41aece6a", "score": "0.8500343", "text": "def test_token_expiration_valid\n @ts.instance_variable_set(:@token, 'eyJ0eXAiOiJKV1QiLCJhbGciO'\\\n 'iJITUFDLVNIQTUxMiJ9.eyJpc3MiOiJvc3Vv'\\\n 'c2wtdGltZXN5bmMtc3Rh...
[ { "docid": "5643d6df78d1a756369969ca005e6517", "score": "0.80968887", "text": "def test_token_expiration_invalid\n assert_equal(@ts.token_expiration_time,\n Hash[@ts.instance_variable_get(:@error) =>\n 'improperly encoded token'])\n end", "title": "" }, {...
1f34d0d1a873b23ed8ac8702ccba7b08
GET /support_zones/1 GET /support_zones/1.json
[ { "docid": "afa9c3e25b9ab07017a662f729d0bc86", "score": "0.73245484", "text": "def show\n @support_zone = SupportZone.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @support_zone }\n end\n end", "title": "" } ]
[ { "docid": "4bb5f2ba42c1df87f07ad6f1790a3f4a", "score": "0.7139713", "text": "def index\n respond_with @zones\n end", "title": "" }, { "docid": "0aa03a35cb22b7a672d8cd33568e0e3f", "score": "0.69202405", "text": "def show\n @zone = @shop.zones.find params[:id]\n\n respond_to...
e0af80d268aec7d68d063d3fb5a5d577
Responds to the Ajaxbased Find Trader form on the Review page (for starters)
[ { "docid": "da0f2be3cdf9b6aeff4e830b3c1b2c9a", "score": "0.0", "text": "def search\n t = \"%#{params[:trader_text]}%\"\n @traders = Trader.where(\"(first_name LIKE ? OR last_name LIKE ?)\", t, t)\n @traders = @traders.joins(:professions).where(\"professions.id = ?\", params[:profession]) if par...
[ { "docid": "a50cab5351863d3cda1f4f41d5672671", "score": "0.6038821", "text": "def review\n end", "title": "" }, { "docid": "76c78c72f7179f37315b77d95e5f42e9", "score": "0.6008961", "text": "def review\n respond_to do |format|\n format.js do\n @resource = StashEn...
5aea98ff280980b9f35aef38a288241f
Helper method to resolve the folder path into a suite Id If the Suite doesn't exist, create it Returns the ID of the suite
[ { "docid": "0418db5bb662e65670ed0ca642230d46", "score": "0.7951755", "text": "def get_or_create_suite_id(suite_name, suite_comment_if_new = nil)\n parent_id = nil\n suite_id = nil\n # Two cases, either there's a folder path, or there isn't\n # If there is, we will find the parent fol...
[ { "docid": "4ee7be0a07d37f64713848fa194e565b", "score": "0.6263001", "text": "def test_suite_by_id suite_id\n args = { :testsuiteid => suite_id }\n make_call(\"tl.getTestSuiteByID\", args, \"1.0\")\n end", "title": "" }, { "docid": "5c01db7401eb0a2dd9e0865bb5b99edb", "score"...
f1f005cd76e893a0b221de98ad57e317
GET /tipo_correccions/1 GET /tipo_correccions/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "463f870c5eb34d5f53e8208a40e3dfae", "score": "0.69511133", "text": "def index\n @tipo_correos = TipoCorreo.all\n end", "title": "" }, { "docid": "ccb650cf7fce7fb04da8e0c7650e6ca4", "score": "0.6938934", "text": "def show\n @tipo_correccions = TipoCorreccion.all\n e...
07e185edb55aec48b3bf881a0ba615db
I N I T I A L I Z E
[ { "docid": "d42c4eaf54cd744610a8129650563bd6", "score": "0.0", "text": "def initialize(file)\n @file = file\n @extension = File.extname(file)\n @location = File.dirname(File.expand_path(file))\n\n self.stencil = '.erb'\n\n @context = Context.new(@location)\n end", "...
[ { "docid": "afbc4c54dabf4c09a70792d90ead3525", "score": "0.5902153", "text": "def sn\n end", "title": "" }, { "docid": "8d0e128ad87cd20a86507c09c46a6f67", "score": "0.58160055", "text": "def termitidae()\n end", "title": "" }, { "docid": "14b1e93abb94798f11ca7...
71dfe3f0d1bf8920f5db27fffecf74a3
Set current user's side of acceptance. If end up with both sides have set agreement, the OfferBundle will be finalized.
[ { "docid": "2ef810d21f51d8836b711d24b66c4ac8", "score": "0.54727143", "text": "def accept\n\n @trade.agree_to_offer!(auth_user, :comment => params[:comment])\n if @trade.completed?\n flash[:notice] = t(\"trading.trade_completed.notice\")\n #trade is completed. Set appropriate va...
[ { "docid": "28b31ec8e5e023093365beaa8eae9c44", "score": "0.6699199", "text": "def accept_terms_and_conditions(user_agreement)\n self.accepted_terms_version = user_agreement.version\n save\n end", "title": "" }, { "docid": "5acef9a8d7b248661b6143d89e2debfb", "score": "0.66720283", ...
015b6f48382b5992fedac5738d4ab69a
Defines the files all packages MUST have. Implementations refine this method further.
[ { "docid": "6f09a2b5e9f846ce4f8f63392edcba58", "score": "0.0", "text": "def define\n lib('.', 'package.rb')\n end", "title": "" } ]
[ { "docid": "e0ccca0f3ea05acfb2ed9b5380e19cd8", "score": "0.7206431", "text": "def pkg_files\n @pkg_files ||= [spec_file, 'sources', '.gitignore']\n end", "title": "" }, { "docid": "4059b0a09d35e52bbeafa3a9f62dd9db", "score": "0.71086615", "text": "def pkg_files\n ...
79adf28437baf8f675cc0adff860b566
DELETE /subscriptions/1 DELETE /subscriptions/1.json
[ { "docid": "494754ef12dcf1bc1a077196ef626f2f", "score": "0.7179454", "text": "def destroy\n @subscription = Subscription.find(params[:id])\n @owner = @subscription.owner\n @subscription.destroy\n\n respond_to do |format|\n format.html { redirect_to polymorphic_url([@owner, :subscription...
[ { "docid": "30fc9e44c2b99529d801849a7cf8d875", "score": "0.8083866", "text": "def delete options={}, headers={}\n @connection.delete \"subscriptions.json\", options, headers\n end", "title": "" }, { "docid": "51a1995bd2f00c038962fac05d60b434", "score": "0.7971629", "t...
fef2be3585a168667cc658692698ecb7
PUT /markery/1 PUT /markery/1.xml
[ { "docid": "99726522095d3b4ddfb151d0072c89c7", "score": "0.51102287", "text": "def update\n @marker = Marker.find(params[:id])\n\n respond_to do |format|\n if @marker.update_attributes(params[:marker])\n flash[:notice] = 'Marker was successfully updated.'\n format.html { redirec...
[ { "docid": "2ce9c6e638f787fbeb2a2007e1848310", "score": "0.61727345", "text": "def update\n @mark = Mark.find(params[:id])\n\n respond_to do |format|\n if @mark.update_attributes(params[:mark])\n flash[:notice] = 'Mark was successfully updated.'\n format.html { redirect_to(@mark...
f70b00c031600fcb091580267b6d4afa
PATCH/PUT /approaches/1 PATCH/PUT /approaches/1.json
[ { "docid": "d31ed08285dfee11bde7bf5ddb0e57fe", "score": "0.6455853", "text": "def update\n respond_to do |format|\n if @approach.update(approach_params)\n format.html { redirect_to @approach, notice: 'Approach was successfully updated.' }\n format.json { render :show, status: :ok, ...
[ { "docid": "24e9e2e524b2e45b35d5dfce43307c67", "score": "0.6321403", "text": "def update\n @approach = Approach.find(params[:id])\n\n respond_to do |format|\n if @approach.update_attributes(params[:approach])\n flash[:notice] = 'Approach was successfully updated.'\n format.html ...
942497ef8d3345407bdae999362acaab
POST /pairs POST /pairs.json
[ { "docid": "69d5e9e6a9d0df4e304310402921959b", "score": "0.6897303", "text": "def create\n @pair = Pair.new(pair_params)\n\n respond_to do |format|\n if @pair.save\n format.html { redirect_to pairs_path }\n format.json { render :show, status: :created, location: @pair }\n e...
[ { "docid": "21f40adedc6eaf87bd8ce1478369ead1", "score": "0.66439277", "text": "def create\n @pair = Pair.new(pair_params)\n\n respond_to do |format|\n if @pair.save\n format.html { redirect_to @pair, notice: \"Pair was successfully created.\" }\n format.json { render :show, stat...
b0318884995071c19193a22354bad0a7
GET /members/1 or /members/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "d743f502b758a7352730ff7d6044c6b3", "score": "0.8072263", "text": "def my_members(params = {})\n get(\"/members\", params)\n end", "title": "" }, { "docid": "2eb3a656ce97b066f36c71fd7f539be3", "score": "0.7448844", "text": "def show\n members = MemberRepo.fi...
ebea3dbba249ec10f9689e579fcea88a
GET /bank_transfers/1 GET /bank_transfers/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "b7dbc0d05b9768f9c56289dc0a736d03", "score": "0.7147349", "text": "def index\n @banktransfers = Banktransfer.all\n end", "title": "" }, { "docid": "00fc9d7a40df705db4f97b05d96e51c6", "score": "0.7006736", "text": "def index\n @bank_transfers = current_user.bank_tran...
6ff95c100f6f24c7b16e44d451a545b0
Selective configuration of one element at position +pos+. The connection is being established automatically with respect to the configuration.
[ { "docid": "8a04e6f6e9dac2b03b3d4b58a5bbbe80", "score": "0.565321", "text": "def configure(pos, task, port, widget, policy = Hash.new)\n @container_hash[pos].configure(task, port, widget, policy)\n connect(pos)\n end", "title": "" } ]
[ { "docid": "b0177d62b26106c769139d611ba8f2f7", "score": "0.58345", "text": "def connect(pos)\n @container_hash[pos].connect\n end", "title": "" }, { "docid": "ef047c9263d47bb1c01dc5dae973bdc9", "score": "0.5090299", "text": "def pos=(pos)\n @pos = pos\n end", "t...
dc78a782f450f517d987e0b78c0db33a
Returns the value of attribute autoloaders. source://railties/7.0.4/lib/rails/application.rb99
[ { "docid": "535b9d19bfa0522c9d4ac560f8bfbcd6", "score": "0.6279564", "text": "def autoloaders; end", "title": "" } ]
[ { "docid": "003b313ae0480dc9f8b3a42b8a10af22", "score": "0.63865894", "text": "def environment_loaders\n name = compiler.loaders.public_environment_loader.loader_name\n end", "title": "" }, { "docid": "003b313ae0480dc9f8b3a42b8a10af22", "score": "0.63865894", "text": "def...
142468304457f37b78d750a433f21271
parse list of items/ride into hash structure
[ { "docid": "14db8dac904e76c5495c64d0d26630b2", "score": "0.6227601", "text": "def parse_items(items)\n hash = Hash.new\n items.split(',').each { |x| hash[x.split(' ')[1]] = x.split(' ')[0] }\n hash\n end", "title": "" } ]
[ { "docid": "7a58bc04d21fc3fd2264341ca6e0719c", "score": "0.61252767", "text": "def list(items)\n\tsplit_list = items.split\n\tlist_hash = Hash.new(1)\n\tsplit_list.each do |x|\n\t\tlist_hash[x] =1\n\tend\n\tlist_hash\nend", "title": "" }, { "docid": "8a70d669e31b6c9d251b30d7cb128ac6", "s...
7969d69e0eea83765da1d83d405987ee
Examples: post('/places/:place_id/reviews', :rating => 3, :text => "My review text that should be a certain length.")
[ { "docid": "22091cad82356670102b374233d060ba", "score": "0.0", "text": "def post(path, params = {})\n path = \"/api#{self.version}#{path}\"\n @response = @access_token.post(path, params, { 'Accept'=>'application/xml', 'Content-Type' => 'application/xml' })\n result = Crack::XML.parse(@response....
[ { "docid": "44fad517e8e43f0171a753843339c0ef", "score": "0.6756918", "text": "def review_params\n params.require(:review).permit(:place_id, :content, :score)\n end", "title": "" }, { "docid": "a3094f540c94120b53e1b88e8ed0e98b", "score": "0.64295864", "text": "def review_param...
e35694a8d62853b9d23445f3b9c63726
GET /zabydovnuks GET /zabydovnuks.json
[ { "docid": "ed8dfedec75ed1a9173462b80b84c17b", "score": "0.70116067", "text": "def index\n @zabydovnuks = Zabydovnuk.all\n end", "title": "" } ]
[ { "docid": "5dcb4b095f8bc0dadf14400e503dd383", "score": "0.6683829", "text": "def show\n @zayavka = Zayavka.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @zayavka }\n end\n end", "title": "" }, { "docid": "082fdbe0...
142ab77839b1e0cf4e43a265c8738638
GET /theses GET /theses.json
[ { "docid": "6ce522c51a3a7b5543cda990364c5aef", "score": "0.6013917", "text": "def index\n @theses = Thesis.all\n \n end", "title": "" } ]
[ { "docid": "9d1087baf0b517bfb12e243a0a060402", "score": "0.6402527", "text": "def index\n @dteors = Dteor.all\n @thems = get_tem\n respond_to do |format|\n if get_tem\n format.html # index.html.erb\n format.json { render json: @dteors } \n else\n format.ht...
183465cacd329f6c15aa4faad7d551fb
POST /ignitor_times POST /ignitor_times.json
[ { "docid": "03d0a8f100b1ada921cd7080bf11edce", "score": "0.69386387", "text": "def create\n @ignitor_time = IgnitorTime.new(params[:ignitor_time])\n\n respond_to do |format|\n if @ignitor_time.save\n format.html { redirect_to @ignitor_time, notice: 'Ignitor time was successfully create...
[ { "docid": "a329cc80d05c6b27bb7ab9d6020b9b7e", "score": "0.6206052", "text": "def trip_time_resolution\n method = \"tripTimeResolution\"\n post_request(method)\n end", "title": "" }, { "docid": "a329cc80d05c6b27bb7ab9d6020b9b7e", "score": "0.6206052", "text": "def trip_time_re...
2b5d876f0a8acd50a5152f99978fa4ba
POST companies creates the company object from values in the company create form
[ { "docid": "1049b2b4fc88906eca9ea6286b77c233", "score": "0.7955037", "text": "def create\n\n # if company is added from crunchbase and :name is defined (not always the case due to Crunchbase limitations)\n if params[:add_from_crunchbase] && params[:name]\n\n # cleans the name so that only alp...
[ { "docid": "a68078e3d704a0d30ab8d479016cd94c", "score": "0.8093165", "text": "def create\n param = params[:company]\n params[:company].each do |key,value|\n unless value.blank?\n val = value.strip\n param[key] = val\n else\n param[key] = value\n end\n end\n ...
6b579495dfd9fe0db324dba9a96f6cf4
define method that will take block code as argument
[ { "docid": "a63334d5dc4366f5c2ad10270c018f46", "score": "0.0", "text": "def display_favorite_things\nputs \"This method is gearing up to start!\"\n# yield to block code in method call, passing three colors\nyield(\"blue\",\"purple\",\"pink\")\n# yield to block code in method call, passing three sports\n...
[ { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.8142532", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.8142532", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "...
3bd490c3fede26117df60ba9703f83ff
PUT /leavemanagements/1 PUT /leavemanagements/1.json
[ { "docid": "d36b28100864e336ed3c74cbe2e4c2c7", "score": "0.67480963", "text": "def update\r\n @leavemanagement = Leavemanagement.find(params[:id])\r\n respond_to do |format|\r\n if @leavemanagement.update_attributes(params[:leavemanagement])\r\n format.html { redirect_to @leavemanageme...
[ { "docid": "0f8872308cd71e90aed963baf02fd23e", "score": "0.61382806", "text": "def update\n request = RestClient.put File.join(API_SERVER,\"rest-api/departments\"), { \n 'id' => params['id'], \n 'name' => params['department']['name'], \n 'description' => params['department']['des...
5671ca07a35a1ca5f6d41f6b4190babb
GET /list_product_recipes/1 GET /list_product_recipes/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "af6ec53ba13a068dc8155bbc36de0ced", "score": "0.7753451", "text": "def recipes # /v1/user/:id/recipes (GET)\n recipes = ::Recipe.all\n render json: recipes, :each_serializer => RecipeSmallSerializer, root: false, status: 200\n end", "title": "" }, { "docid": "f9976986...
c04191882dfe45d2842aa404f55805eb
DELETE /post69s/1 DELETE /post69s/1.xml
[ { "docid": "8b68281cf3399545ca03b1cc62f4a0d4", "score": "0.6808344", "text": "def destroy\n @post69 = Post69.find(params[:id])\n @post69.destroy\n\n respond_to do |format|\n format.html { redirect_to(post69s_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.7063635", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "df26116eb86dbadafed7137f9e3c2f9e", "score": "0.688393", "text": "def delete!\r\n return nil unless exis...
389290d7dd9bb702e92e9474b7572be9
POST /orders POST /orders.json
[ { "docid": "3202d96dcfe85be54708e7d73f0ef63c", "score": "0.0", "text": "def create1\n @order = Order.new(order_params)\n if @order.save\n flash.notice = \"The order record was created successfully.\"\n redirect_to @order\n else\n flash.now.alert = @order.errors.full_messages.to_s...
[ { "docid": "ee8d8e8e024d35ee13910acc551b370b", "score": "0.81998754", "text": "def create_order\n post_request \"orders\"\n end", "title": "" }, { "docid": "845035633d004ad773ad8d0df67d69fd", "score": "0.7508254", "text": "def create\n response = Unirest.post(\"http://loca...
53994e392bd36e55b059843367c8db50
subset of remaining chrs that are found in remaining otus
[ { "docid": "3a10d2a7d75bf39269cbb6ddded38abd", "score": "0.6506076", "text": "def useful_chrs \n chrs = []\n # useful chars are:\n # chars not used that contain states of remaining taxa that have > 1 state\n states = @otus_remaining.inject([]){|sum, o| sum = sum | @STATES_BY_OTU[o]} # all re...
[ { "docid": "e642c463443db1c872fbe457ab469f11", "score": "0.5808933", "text": "def update_chrs\n @chrs_eliminated = []\n\n if @chosen_states == []\n @chrs_eliminated = [] # @all_chrs\n @chrs_remaining = @all_chrs\n else\n if @otus_remaining.size == 1\n @chrs_remaining = []\...
fc6b5b91fde504c62484097c7bae0885
Gets the gren color selection hash
[ { "docid": "0e80bccd5132c3abb143db111b6aa1d8", "score": "0.5532409", "text": "def green_hash\n {\n :type => :bar,\n :text => SET_GREE,\n :help => SET_GREH,\n :var => 0,\n :max => 255,\n :min => -255,\n :color => Color.new(0, 255, 0),\n :perc => ...
[ { "docid": "a16e60fbf65dea7871728a89139f1ccd", "score": "0.63561594", "text": "def hglrc\n return @@hglrc\n end", "title": "" }, { "docid": "a6ada8e48e1070a1c7f4e9763e524d33", "score": "0.6313185", "text": "def context_list_color_names()\n return $gimp_iface.ggimp_...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "bdedd6af3908a89d099ca675548b7b96", "score": "0.0", "text": "def transferencia_params\n params.require(:transferencia).permit(:partido_id, :fecha_datos, :numero, :razon_social, :rut, :region_id, :descripcion, :monto, :categoria, :fecha)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.requ...
69c3adcf819ac8aa493258379732997b
validates_uniqueness_of :name, :scope => :province_id
[ { "docid": "3922acb0b5baf93ec025ecda21a8f84a", "score": "0.0", "text": "def abbr\n province.try(:abbr) || country.abbr\n end", "title": "" } ]
[ { "docid": "6c015ba6fe1f21df36894a572f93e4ed", "score": "0.6646875", "text": "def name_is_unique\n return if self.name.nil?\n errors.add(:name, 'has already been taken') if Institution.where(name: self.name).reject{|r| r == self}.any?\n end", "title": "" }, { "docid": "75968e4bd93eec6...
4966ffac31ddd656f3caf2f406561ad4
Attempts to run each validator given in "validators" in the configuration. If the validator is not found, will emit a warning and continue.
[ { "docid": "e2a305cb513a5d567c7f2a76988db536", "score": "0.7164175", "text": "def each_validator(validators_configuration, &block)\n return to_enum(:each_validator,\n validators_configuration) unless block_given?\n validators_configuration.each_pair do |key, configuration|\...
[ { "docid": "915b511c7c2fd10cd9f3c554916fe15d", "score": "0.63606733", "text": "def each_validator\n self.class.validations.each do |attribute, validators|\n validators.each { |validator| yield(attribute, validator) }\n end\n end", "title": "" }, { "docid": "9fb7b180eb8bba2af8f384...
4364b4dac7989223adbc7405e97bc3ac
POST /caves POST /caves.json
[ { "docid": "674baf9f7f6bc0e5d28d87645fd368d5", "score": "0.0", "text": "def create\n @cafe = Cafe.new(cafe_params)\n\n respond_to do |format|\n if @cafe.save\n format.html { redirect_to @cafe, notice: 'Cafe was successfully created.' }\n format.json { render :show, status: :crea...
[ { "docid": "a3d79d88c7a63ef818c96b37ae75c01b", "score": "0.6000662", "text": "def save\n Rubycious::Client::Post.new.save(@params)\n end", "title": "" }, { "docid": "2780e8baf77dee30691f5ebfe8d137f8", "score": "0.58748424", "text": "def upload\n data = params[:json_data]\n...
dd89111514b437e4b598741c8c74bd69
Delete a 'asset.Subscription' resource.
[ { "docid": "e53ecc0c330ed5f298a0b0b7e9b40bca", "score": "0.6747256", "text": "def delete_asset_subscription(moid, opts = {})\n delete_asset_subscription_with_http_info(moid, opts)\n nil\n end", "title": "" } ]
[ { "docid": "a0d4e65b91617bf9aa7c871413c6a7a3", "score": "0.78929824", "text": "def delete_subscription subscription\n subscriber.delete_subscription subscription: subscription_path(subscription)\n end", "title": "" }, { "docid": "50b72fc0f5bafe3b0ec55c0247d8674f", "score"...
b344136f6cbc79474d7aaeed3ce6ad15
I worked on this challenge by myself. 2. Pseudocode Input: topic, title, name, date, thesis Output: string of paragraph Steps: create a method called essay_cheater that take the following parameters: essay_topic, title, name, date, and thesis statement create an if statement for the 3 topics type create a generic templ...
[ { "docid": "d511c0bc04bd4d146cd8350911ec9171", "score": "0.6583934", "text": "def history_essay(topic, title, name, date, thesis)\n\tif topic == \"person\"\n\t\tprint \"#{title}. This essay is about a biography of #{name}. He/she was born on #{date}. #{thesis}.\"\n\telsif topic == \"place\"\n\t\tprint \...
[ { "docid": "0c2713d214394c03c556fdd1c56e08c2", "score": "0.7417048", "text": "def essay_template(title, author, date, thesis, character, quality, moment, pronoun)\n\tif pronoun == \"male\"\n\t\tpossessive = \"his\"\n\t\tsubject = \"he\"\n\t\tobject = \"him\"\n\telsif pronoun == \"female\"\n\t\tpossessiv...
1017a04c958ee696a57353275bd1e124
Do we have any patterns in our path, yo?
[ { "docid": "81f095ec139c79b7eab9bf2c0befa20f", "score": "0.0", "text": "def expandable?\n if defined?(@expandable)\n @expandable\n else\n false\n end\n end", "title": "" } ]
[ { "docid": "435b0fa265705b7fd3e1ea362e655dfd", "score": "0.7258872", "text": "def matches?(path)\n false\n end", "title": "" }, { "docid": "37f0523ff39f249992cdf2b9f93b353c", "score": "0.7201725", "text": "def matched?(path)\n true\n end", "title": "" }, {...
ae25f61b4e8b06892dfc0656cf62a522
if the word is guessed display the winner with the most points
[ { "docid": "d57a656497561db9e6303c2e22d29b98", "score": "0.67767763", "text": "def winner\n if (@board == @word)\n if (@player_one_points > @player_two_points)\n puts \"Player one is the winner with #{@player_one_points} points! Player two lost with #{@player_two_points} points.\"\n ...
[ { "docid": "c021fb5a353dfa1bd4e35487a8f2b3db", "score": "0.68728375", "text": "def highest_score_from(words)\n contestants = words.map{ |word| [word, score_word(word)] }.to_h\n\n winning_word = {word: \"\", score: 0}\n\n contestants.each do |word, score|\n if score > winning_word[:score]\n wi...
dd7aba6e0d27ff496158ce2e1428ceb2
Description: This helper method returns a javascript formatted array of subjects for use with jqueryui's autocomplete
[ { "docid": "5e2ca11041a656968b36fb07e44cac43", "score": "0.81997985", "text": "def subject_list_for_autocomplete\n subject_list = \"[\"\n all_subjects do |subject|\n subject_list+=\"{label:\\\"#{subject.to_s}\\\",title:\\\"#{subject.title}\\\",value:\\\"#{subject.code}\\\"},\\n\"\n sub...
[ { "docid": "0efd4b7dcf7d968a4b750a7f2656a336", "score": "0.7064722", "text": "def message_subjects\n list = []\n active_div.divs(:class=>\"inbox_subject\").each do |div|\n list << div.text\n end\n return list\n end", "title": "" }, { "docid": "ae52a81ea6fd794cdc4add9ac65658...
1a5249b2cb5460320b5e18af640bae62
Draws a circle on the canvas.
[ { "docid": "93497f488f1fb8f1f761c765c26890b3", "score": "0.72243714", "text": "def circle(x0, y0, radius, stroke_color = T.unsafe(nil), fill_color = T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "eaeba4cea5af716626df11bbf12596c0", "score": "0.8315093", "text": "def draw\n @drawing_api.draw_circle(@x, @y, @radius)\n end", "title": "" }, { "docid": "d1c619ef57dbb843191d00a7eb2bf88b", "score": "0.7770735", "text": "def drawCircle(x,y,r,fillp=false,color=\"black\"...
717164d436cbdac813c700d5c4a35fb2
Returns whether the user has correctly guessed every letter in word
[ { "docid": "79433c92a1a8c0a932d8d8d534bb5a77", "score": "0.8294315", "text": "def guessed_entire_word(word, guessed_letters)\r\n word_array = word.split('')\r\n\r\n word_array.each do |letter_in_word|\r\n did_guess_letter = false\r\n guessed_letters.each do |letter|\r\n if letter_in_word ==...
[ { "docid": "da31461c8a6e680eb609626b96f3a18d", "score": "0.8896924", "text": "def guessed_all_correct?\n if letter_counter == word.length\n return true\n end\n false\n end", "title": "" }, { "docid": "fd9b94705796bb5cdf65e59a67330168", "score": "0.8646561", "text": "de...
9d813e91b438fe57767d3aef8e5517e6
Print the loaded config, set via either dotenv or the environment.
[ { "docid": "c276aafeece986f233e985c90099b3b2", "score": "0.72346604", "text": "def config\n # unless ENV.key?('TAXI_ENV')\n # raise StandardError, 'Tried to print environment without $TAXI_ENV set. ' \\\n # 'Abort printing production credentials.'\n # end\n\n Config.instan...
[ { "docid": "571ec939168a4c52bc3183578f8fbc2b", "score": "0.6964791", "text": "def print_config\n self.config_to_hash.each { |k, v| puts \"#{k}: #{v}\" }\n end", "title": "" }, { "docid": "3d04537b5cf80ccdc4c9c9499d801e8c", "score": "0.6631488", "text": "def config_via_run...