query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
f027266fea1af7d273d1677fa35fb79d
The search matches a location name or synonym on a given string and language.
[ { "docid": "2d65dc8964141a590e044d093337c8f4", "score": "0.5357713", "text": "def getAutocompleteLocation( str, country, language)\n params = Hash.new\n params['str'] = str\n params['country'] = country\n params['language'] = language\n return doCurl(\"get\",\"/autocomplete/location\",par...
[ { "docid": "f683bd54cfbeb88f5fcc68d409e90e07", "score": "0.6256366", "text": "def search(word)\n \n end", "title": "" }, { "docid": "55b8b0b9878070c841aae0e6c7bbbabd", "score": "0.60179985", "text": "def search(term)\n all.select do |unit|\n unit.aliases.any...
4e934f7a254802859edf52ea98c9bb1f
POST /material_codes POST /material_codes.json
[ { "docid": "28127201f51eb55a9c0116cbedb3cf19", "score": "0.77951056", "text": "def create\n @material_code = MaterialCode.new(params[:material_code])\n\n respond_to do |format|\n if @material_code.save\n format.html { redirect_to @material_code, notice: 'Material code was successfully ...
[ { "docid": "a18e420eda79d8b1c92980664639c8e4", "score": "0.6751625", "text": "def new\n @material_code = MaterialCode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @material_code }\n end\n end", "title": "" }, { "docid": "e0b6bcc...
5d1493cb36f2dc2fa77a725a9980b24e
Ok here's the deal. For reporting we need to be able to send a set of recognitions that reference unique recipients I accomplish this in Report::Recognitionpoint_activity_query I do so, by dup'ing a recognition, and assigning it a reference recipient Essentially, this makes the recognition class a mock or a decorator o...
[ { "docid": "9c6b78705f01c30f3726dcc4b5c547a0", "score": "0.5926334", "text": "def dup_for_reference\n dup.tap do |r|\n r.created_at = self.created_at\n # r.id = nil # done by dup\n # r.instance_variable_set(\"@association_cache\", self.instance_variable_get(:association_cache))\n en...
[ { "docid": "944a33ef1245e81d73b82b853e45eedc", "score": "0.58412015", "text": "def dup_for_reference\n dup.tap do |r|\n r.created_at = self.created_at\n r.instance_variable_set(\"@association_cache\", self.association_cache)\n end\n end", "title": "" }, { "docid": "16ae8637b...
9ec8b3c087da4d018baee9faddd47209
this action executes when the purchase form is submitted
[ { "docid": "b779fbe46394b4bf48619452b0d34972", "score": "0.664579", "text": "def create\n puts \"create*******\"\n puts purchase_params\n user = User.find(session[:user_id])\n email = user.email\n \tpackage_id = params[:purchase][:package]\n \tpurchase_package = Package.find package_id\n ...
[ { "docid": "b7671dd6c0d3ccef4e76da668fd6fc97", "score": "0.7679369", "text": "def before_submit_purchased!\n end", "title": "" }, { "docid": "817415bff5da061aba507679ae39825a", "score": "0.72929674", "text": "def purchase_action\n # from cart\n if params[:product_id] == '0'\n ...
0c0d03894a9e8e4617803dc1a097901f
returns the array of movies that user u has watched
[ { "docid": "7d06dd88f077bf6ec1fab7a385b1244f", "score": "0.7091919", "text": "def movies(user_id)\n set.usr_map[user_id].collect {|movie_id, rating| movie_id}\n end", "title": "" } ]
[ { "docid": "30439b0decaaaf7653500c4623ef8e67", "score": "0.87245774", "text": "def movies(user)\n movies_he_watched = []\n @training_set.each do |record|\n if record.user == user.to_i\n movies_he_watched.push(record.movie)\n end\n end\n return movies_he_watched\n end", ...
99748c291dbdb404fe8380a8b80bfd47
If `type` is an interface, and `self` has a type membership for `type`, then make sure it's visible.
[ { "docid": "6f10490cdad5eb14802c061e5a4859a7", "score": "0.6797543", "text": "def visible_interface_implementation?(type, context, warden)\n if type.respond_to?(:kind) && type.kind.interface?\n implements_this_interface = false\n implementation_is_visible = false\n ...
[ { "docid": "585a3e447b8152da8a74c44dfc5601c4", "score": "0.58582586", "text": "def check_type\n \t self.type = TYPES[0] if !TYPES.include?(self.type)\n\t end", "title": "" }, { "docid": "59e44188cbf9bbecc2e94fef92a61a4a", "score": "0.57667893", "text": "def applies_type?(scope, ty...
fc05db703ea1543a761929a743bcfbcd
return (bool) true if all of the components are read.
[ { "docid": "a2db0d8338b7b7a1c6f8087e4377091e", "score": "0.0", "text": "def available_parameters( params, runs )\n @runs = runs\n\n Maadi::post_message(:More, \"Organizer (#{@type}) Parameters are ready\")\n return true\n end", "title": "" } ]
[ { "docid": "e1456d41d57ab240f4bd6c5ba060108d", "score": "0.7373459", "text": "def read_all?\n return true if authorized_via_parent\n # This is expensive, so try to avoid it\n # TODO: look in to creating a cache for\n # these look ups that's invalidated upon\n # object ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "5116c18ff19243ec0652a0a9a970a749", "score": "0.0", "text": "def set_informasi_berita_terkini\n @informasi_berita_terkini = InformasiBeritaTerkini.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
ee74f8441e2e82f2f600cb741b99523c
PATCH/PUT /employee_hours/1 PATCH/PUT /employee_hours/1.json
[ { "docid": "1ce272f98ad792c53fb37c7f5a8e4968", "score": "0.7479173", "text": "def update\n respond_to do |format|\n if @employee_hour.update(employee_hour_params)\n format.html { redirect_to employee_hours_path, notice: 'Employee hour was successfully updated.' }\n format.json { re...
[ { "docid": "0e407665ec20e7f1711c3b53a2002428", "score": "0.7435222", "text": "def update\n respond_to do |format|\n if @employee_hour.update(employee_hour_params)\n format.html { redirect_to @employee_hour, notice: 'Employee hour was successfully updated.' }\n format.json { render ...
b95f058124807bfb694246edce1c8c57
appends link parameters dependant upon the path
[ { "docid": "0995eb017701cdf4a80331ceb84a60d1", "score": "0.5452193", "text": "def append_link_type(key_url)\n if key_url.start_with?('y/')\n 'https://www.indeed.com/compan' + key_url\n elsif key_url.start_with?('?jk=')\n 'https://www.indeed.com/viewjob' + key_url\n elsif key_url.start...
[ { "docid": "791361525a30b1c4b7a566d76d043ebb", "score": "0.6225743", "text": "def append_to_path(path)\n @path+= path\n end", "title": "" }, { "docid": "fef36f77ea53efe02ac4e724f49afcba", "score": "0.6087973", "text": "def append_path_if_exists(path)\n lambda do |release, ...
77ada73da83fa98a298fd7fcaee52aee
pops a message off the queue and passes the headers and payload into the block. +pop+ will automatically acknowledge the message unless the options sets :ack to false.
[ { "docid": "a5a1077f5c175caf2a95348e8a22347b", "score": "0.76369786", "text": "def pop(&blk)\n opts = @options.pop\n @queue_completion.completion do |queue|\n @requeue_options_completion.completion do |requeue_options|\n queue.pop(opts) do |metadata, payload|\n ...
[ { "docid": "2b0b1cef5c86440f11ce9fcee8ae3457", "score": "0.7784386", "text": "def pop(&block)\n opts = options.pop\n @queue.pop(opts) do |metadata, payload|\n thread(Reply.new(self, metadata, (payload.nil?) ? nil : payload)) do |reply|\n block.call(reply)\n end...
c28ea245a5ec5f772627997feb7fc0a8
Returns photos for a venue.
[ { "docid": "fb724d6c0060d9747de8e03f5be52da7", "score": "0.7471649", "text": "def photos(id, group = 'checkin', options = {})\n get(\"venues/#{id}/photos\", {:group => group }.merge(options)).photos\n end", "title": "" } ]
[ { "docid": "5d4c8ced72c84507211b6062e2786797", "score": "0.8564003", "text": "def venue_photos venue_id, options={}\n response = get(\"/venues/#{venue_id}/photos\", options)[\"response\"][\"photos\"]\n response[\"items\"].map!{|item| Foursquared::Response::Photo.new(self, item)}\n respons...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "266af8b555ebc18fe781ac17094bbba4", "score": "0.0", "text": "def set_hotsale\n @hotsale = Hotsale.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
21db07d1b58e0125e42f3f17fbab46d2
Apply arbitrary transformation (passed as a Proc or as a block)
[ { "docid": "22598586ee8cbb0c62d5915a03c84312", "score": "0.6097152", "text": "def apply(prc, &blk)\n prc ||= blk\n prc[self]\n end", "title": "" } ]
[ { "docid": "e0cc22d63abf9b1b5672af7d8f4eed65", "score": "0.74164647", "text": "def apply(transform)\n Proc.new do |object, &block|\n transform.call block.call(object)\n end\n end", "title": "" }, { "docid": "9406ff19abc1ce06de698191603cb44b", "score": ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "23306d107f59202eda67362bfab9ed74", "score": "0.0", "text": "def set_user\n @user = User.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6031952", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015048", "text": "def...
05a54eee11d0cd449c2569fe2de95e59
makes sure this can be used in a Chain
[ { "docid": "234ad570529208e9ab0fc23efb19b989", "score": "0.0", "text": "def initialize(value, success); end", "title": "" } ]
[ { "docid": "3348909c0296e7fbe2cda8729aab1d01", "score": "0.7593333", "text": "def chain; end", "title": "" }, { "docid": "3348909c0296e7fbe2cda8729aab1d01", "score": "0.7593333", "text": "def chain; end", "title": "" }, { "docid": "0b56eee9f06cd7a44fd0314772956d98", "...
5bf33c4871e9fbd0f26925b401d4737f
Performs a search for borrowed items and returns various data about the search
[ { "docid": "42d1a02860164f53084d988f0e6013a9", "score": "0.64925313", "text": "def process_search(search_params, page)\n if !search_params\n flash[:search_error] = \"No search was specified\"\n return\n end\n\n page = 1 if page < 1\n \n results, paginator = find_borrowed_items_...
[ { "docid": "dd783fcae797b064a7f880fbf2230814", "score": "0.77005917", "text": "def find_borrowed_items\n \n # set saved search params only once from\n # params from the UI form\n if params[:page].to_i < 1\n prepare_saved_search_params\n end\n \n params[:search].to_yaml \n ...
d315cbed51ef32d17dd882bf0ec80eef
This method is to be called only by Connection
[ { "docid": "b7f1a7187a942115390fb4362a757b99", "score": "0.0", "text": "def connection_established(connection)\n connections << connection\n end", "title": "" } ]
[ { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.70952433", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799cef78", "score": "0.70952433", "text": "def connection; end", "title": "" }, { "docid": "6301b48e459f10c66e62f7a8799c...
ba0009ad0ae19c160c0f69e9778a5fe8
Return a warning message that the feature is now on by default and that the flag will be removed in the next major version of Lita.
[ { "docid": "32a5fcb3ed81be5005bb44090d604bbf", "score": "0.71171373", "text": "def flag_removal_warning_for(object)\n I18n.t(\n \"lita.feature_flag.flag_removal_warning\",\n name: name,\n object_name: object_name(object),\n version_default: version_threshold,\n ve...
[ { "docid": "8e97ab52463e52e42c0a9a81822a1619", "score": "0.781468", "text": "def change_warning\n I18n.t(\n \"lita.feature_flag.change_warning\",\n description: description,\n version: version_threshold,\n )\n end", "title": "" }, { "docid": "825033e5abc271c...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "abc6f643d9b1c3455d1ce13abceebc86", "score": "0.0", "text": "def wanted_person_params\n params.require(:wanted_person).permit(:name, :image, :wanted_for, :bounty)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74768823", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.71700543", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist...
06b0f4b3e23bf883e756996bae5dbe8d
Generate a new Captcha
[ { "docid": "e4839eb89a896755f547e6c16e781d0f", "score": "0.76050746", "text": "def generate_rucaptcha\n generate_rucaptcha_session_id\n\n res = RuCaptcha.generate\n session_val = {\n code: res[0],\n time: Time.now.to_i\n }\n RuCaptcha.cache.write(rucaptcha_sesion_k...
[ { "docid": "afb200fabc5911cf021122517bae1c13", "score": "0.7457487", "text": "def captcha(client)\n c = @captcha_factory.new\n ba1 = RubyAMF::IO::ByteArray.new(c.encrypted_code_with_timestamp)\n ba2 = RubyAMF::IO::ByteArray.new(c.img)\n client.result('captcha', [ba1, ba2], true)\n end", ...
1b294e3ad78d36ac4992d08b371f4774
Example 1: exampleArray = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]] diagonalSum(exampleArray) => 4 Example 2: exampleArray = [[1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0], [0, 0, 0, 0, 1]] diagonalSum(exampleArray) => 5
[ { "docid": "f25e0baf618bcd7eb02332113cf3ccdf", "score": "0.69686884", "text": "def diagonal(matrix)\r\n\tsum = 0\r\n\tmatrix.each_with_index do |sub,index|\r\n\t\tsum += sub[index]\r\n\tend\r\n\treturn sum\r\nend", "title": "" } ]
[ { "docid": "36d4b016818ec6a7e7225532ad90390a", "score": "0.7401416", "text": "def diagonalSum(matrix)\n sum = 0\n matrix.length.times { |i| sum += matrix[i][i] }\n sum\nend", "title": "" }, { "docid": "feb452ba4de7878bb66100da60edd5c5", "score": "0.7102772", "text": "def diagonal_...
15c9cb5e53c5d1303a61a42ed2638491
GET /prize_balls/1 GET /prize_balls/1.json
[ { "docid": "605a22b715bfdadfdbe8a4938641ed4d", "score": "0.7459517", "text": "def show\n render json: @prize_ball\n end", "title": "" } ]
[ { "docid": "40446d85342ce24a527e7b038739e3c3", "score": "0.7196183", "text": "def update\n if @prize_ball.update(prize_ball_params)\n render json: @prize_ball, meta: { errors: nil }\n else\n render json: @prize_ball, meta: { errors: @prize_ball.errors.full_messages }\n end\n end", ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "ac0eee3b4387028fdcdeed422ebe9123", "score": "0.0", "text": "def query_params\n params.require(:query).permit(:val)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
7b775aa1d9effa4b7e53d0285d28ccc7
array7 = ["apple", "orange", "pear", "avis", "arlo", "ascot" ] find_a(array7) QUESTION8
[ { "docid": "e6f540127220c54d5984198e63892f9d", "score": "0.0", "text": "def sum_array(array8)\n array8.inject {|n,array8| n+array8}\nend", "title": "" } ]
[ { "docid": "ea3510d7c5f496f7763e357f6ee8e909", "score": "0.79730433", "text": "def find_a(array7)\n array7 = array7.select {|n| n[0].include?(\"a\")==true} \nend", "title": "" }, { "docid": "2175c5995b951347c5c3f8b973a6ac37", "score": "0.74352175", "text": "def find_a(array)\n a_ar...
509f040fb34690510f416d219611f136
PATCH/PUT /alert_statuses/1 PATCH/PUT /alert_statuses/1.json
[ { "docid": "ad6ac248673d93c2b56d522a7e7bb78a", "score": "0.69644934", "text": "def update\n respond_to do |format|\n if @alert_status.update(alert_status_params)\n format.html { redirect_to @alert_status, notice: 'Alert status was successfully updated.' }\n format.json { render :sh...
[ { "docid": "0877792cf5c7faaa76dd7eba1b17ecd5", "score": "0.67607105", "text": "def update\n if @api_v1_alert.update(api_v1_alert_params)\n head :no_content\n else\n render json: @api_v1_alert.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "b...
1b3d159da1bfd9dee7976267eca88445
what that user thought of that thing before they changed their mind
[ { "docid": "e91820c91f4c4c6409837eeea3e04f7c", "score": "0.0", "text": "def previous\n all = Vote.find_with_deleted :all, :conditions => {:railser_id => railser_id, :concept_id => concept_id, :railevance_id => railevance_id, :characteristic_id => characteristic_id}\n all.sort_by(&:created_at)[-2]\...
[ { "docid": "a4e931e734083956cc97e48b6b5b614f", "score": "0.6274047", "text": "def meaningness()\nend", "title": "" }, { "docid": "43e7fb9a2a5d12f3e8c5dca66a74dc8f", "score": "0.6182269", "text": "def humans; end", "title": "" }, { "docid": "43e7fb9a2a5d12f3e8c5dca66a74dc8...
737d46ba1917c6191d8112601c33412e
GET /images/1 GET /images/1.xml
[ { "docid": "3747e24a47b9b3ae9593b31682af3f28", "score": "0.67038393", "text": "def show\n @image = Image.find(params[:id])\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @image.to_xml }\n end\n end", "title": "" } ]
[ { "docid": "6ae970456f0561628b443df6e12d6b1a", "score": "0.7367316", "text": "def index\n @images = Image.find_images\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @images }\n end\n end", "title": "" }, { "docid": "06bd6a763f09e9...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "ab4a3a1baff7ccfba18c2d14c11e6c05", "score": "0.0", "text": "def webseries_params\n params.require(:webseries).permit(:titulo, :playlist)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whit...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "fe009e934973a30850a8b651fccdaa88", "score": "0.0", "text": "def set_videowork\n @videowork = Videowork.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...
0d214e006da6c5203ebe31d75a7cb43c
Indicates queue is empty.
[ { "docid": "c339c0f22c82f5b99283b2c29f5a2ffa", "score": "0.0", "text": "def empty?\n @native.empty?\n end", "title": "" } ]
[ { "docid": "8be8014236eaf3c384dfb7c3e8022f5a", "score": "0.8859611", "text": "def empty()\n @queue.empty?\n end", "title": "" }, { "docid": "86c3ef3397c34d4395969b2da4c3a657", "score": "0.88283527", "text": "def empty?\n @queue.empty?\n end", "title": "" }, { ...
029a94b88e197df6586ba77bece433f6
Log request statistics and debugging details.
[ { "docid": "9cbd981a941842d0945499d8c96dc592", "score": "0.7405034", "text": "def request(event)\n log_action_summary(event)\n log_request_details(event)\n log_response_details(event)\n end", "title": "" } ]
[ { "docid": "403ecca8798702fbd26447da6c084b12", "score": "0.79049945", "text": "def log_request\n # REQUEST_LOG.info( {\n # time: Time.now.to_s,\n # ip: request.remote_ip,\n # path: request.path,\n # site: request.ho...
8efede668864eab7ef0dae9bd0845b93
Checks whether the key appears to be valid.
[ { "docid": "f0544a3a47a994606365c34d3780282e", "score": "0.687607", "text": "def valid?(rng = nil, thorough = false)\n rng ||= Botan::RNG.new\n flags = thorough ? 1 : 0\n rc = LibBotan.botan_pubkey_check_key(@ptr, rng.ptr, flags)\n rc.zero?\n end", "title": "" } ]
[ { "docid": "9aa02cdc2f669b19a207db39dba507e4", "score": "0.84240264", "text": "def valid?(key); end", "title": "" }, { "docid": "a74f44f35defec13dc3f4d8d3d13baa5", "score": "0.8286505", "text": "def valid?\n not @key.nil?\n end", "title": "" }, { "docid": "833d29a...
e8ca865ff5242840c38c05832a0633ed
Depth 1. This method name, as well as all the other ones like it, are named after the sections they create.
[ { "docid": "55e43c7c8858ec7673dddfe0d8378f27", "score": "0.0", "text": "def cvList(xml)\n xml.cvList {\n xml.cv(:id => \"PSI-MS\", :fullName => \"Proteomics Standards Initiative Mass Spectrometry Vocabularies\", :uri => \"http://psidev.cvs.sourceforge.net/viewvc/*checkout*/psidev/psi/psi-ms/mzML...
[ { "docid": "87dc79c3b96b6d1cbb634c62ca4bb7dd", "score": "0.6742599", "text": "def sections; end", "title": "" }, { "docid": "98b0440e352b4d7cb8861cca95fbb99f", "score": "0.6696755", "text": "def sections(*) end", "title": "" }, { "docid": "338ac812358fd2df02d160ea4f4a89bf...
f4b0c72118b6e9dbc7db95197bcbbb8a
replacement for Cirneco which isn't working with Ruby 2.6.6 (because of Maremma?)
[ { "docid": "bea6708aaed28c2aa9cb0bb3e44d9af3", "score": "0.0", "text": "def put_doi(doi, options = {})\n unless options[:username].present? && options[:password].present?\n return OpenStruct.new(body: { 'errors' => [{ 'title' => 'Username or password missing' }] })\n end\n\n ...
[ { "docid": "54a53621e5fd3fc0cc3d2ff2901a893e", "score": "0.5860658", "text": "def chazelle\n end", "title": "" }, { "docid": "e27d5d02e3eed534e8cefa202334cb5e", "score": "0.57439655", "text": "def ci; end", "title": "" }, { "docid": "5cdb4d7bb82aec52a912b8f68a6c157b", ...
cd7c1a88d50035c12f8ba948d2d78987
PUT /contests/1 PUT /contests/1.xml
[ { "docid": "d374ca142acba9f59028bf8348f8b481", "score": "0.69578606", "text": "def update\n @contest = Contest.find(params[:id])\n\n respond_to do |format|\n if @contest.update_attributes(contests_params)\n flash[:notice] = 'Contest was successfully updated.'\n format.html { red...
[ { "docid": "c3beb7d339a3cfd002eb35c6bc0c7993", "score": "0.69793266", "text": "def update\n @contest = Contest.find(params[:id])\n\n respond_to do |format|\n if @contest.update_attributes(params[:contest])\n flash[:notice] = 'Contest was successfully updated.'\n format.html { re...
4a644be753da160be154b549703ad88f
Get a list of all the gyms that a specific lifter has memberships to
[ { "docid": "9ffbaf7fa74e7bdd7977e0ea8c6f3dea", "score": "0.7930952", "text": "def gyms\n #Access the Memberships.all array\n #Determine whether or not the memberships are mine/lifters\n my_memberships = self.memberships\n #create array of gyms from the memberships array\n my_memberships.m...
[ { "docid": "de44276bb659de91a4815c823dfb27d6", "score": "0.84853727", "text": "def gyms\n gym_member = memberships.select do |member|\n member.lifter == self\n end\n gym_list = gym_member.map do |member|\n member.gym\n end\n gym_list\n end", "title": "" }, { ...
ae45a50c8aeef742ebd93af6fd326e11
Returns true if the connection is in the process of being initialized (e.g., it is not closed, but is not yet fully open).
[ { "docid": "00340f2891d608b2ea2957b65067d779", "score": "0.0", "text": "def opening?\n !(open? || closed?)\n end", "title": "" } ]
[ { "docid": "93e16090c64caa6be22ba338da2b2675", "score": "0.7705663", "text": "def connected?\n return false unless @connection\n return false unless @connection.started?\n true\n end", "title": "" }, { "docid": "33f879708d33095222ca7f0c21771bf9", "score": "0.7663337", "text...
7367aac68179ef635db01e8c2731c58b
GET /quizzes GET /quizzes.json
[ { "docid": "d5a516346e1794c9eff4fc8659ddc390", "score": "0.57011294", "text": "def index\n if user_signed_in? && current_user.admin?\n @quizzes = Quiz.all.order(due_date: :asc)\n elsif user_signed_in?\n @quizzes = current_user.enrolled_courses.first.quizzes.order(due_date: :asc)\n els...
[ { "docid": "4f6131d9074fe6f95a24ec5b9e9d98d0", "score": "0.7750826", "text": "def index\n @quizzes = Quiz.all \n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @quizzes }\n end\n end", "title": "" }, { "docid": "c5867010fbf...
256a58919cc72bd73190f3bbec8fee53
return value is 0..11 C Cis/Des D Dis/Es E F Fis/Ges G Gis/As A Ais/B H
[ { "docid": "3e2bce8b03c0fdff06fc2031544a138e", "score": "0.0", "text": "def tones\n @tones ||= events.map do |event|\n event[\"pitches\"].index(event[\"pitches\"].max)\n end\n end", "title": "" } ]
[ { "docid": "058b8823bf6bcf51f193a61e5b53d840", "score": "0.62530273", "text": "def value_face(card)\n case card\n when 10\n return \"T\"\n when 11\n return \"J\"\n when 12\n return \"Q\"\n when 13\n return \"K\"\n when 14\n return \"A\"\n else\n return card\n end\nend", "ti...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "5c1d1db69444bfce2cf17ef744bd1b5f", "score": "0.0", "text": "def alunoprofessor_params\n params.require(:alunoprofessor).permit(:aluno_id, :professor_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74968386", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958337", "text": "def strong_params\n params.require(:request).permit(param_whit...
b7302edb7516a7c52b4b3dae821d3ada
Read document text annotations.
[ { "docid": "524db2c3f004f5e6ecbb9e8b14d32f8d", "score": "0.6452154", "text": "def get_document_text_annotations_with_http_info(name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PdfApi.get_document_text_annotations ...\"\n end\n # ve...
[ { "docid": "70b01dd97cfa845223c11139c3f00120", "score": "0.734124", "text": "def get_document_text_annotations(name, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = get_document_text_annotations_with_http_info(name, opts)\n rescue ApiError => error\n ...
71e13f283d0cc33cc8d07339b3d997cb
GET /stadia/1 GET /stadia/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "86199f180cefc5b298b2d1b7581a6aa1", "score": "0.72155005", "text": "def index\n @api_stadia = Api::Stadium.all\n render json: @api_stadia\n end", "title": "" }, { "docid": "e9470dea650ae44f64be99b795632b46", "score": "0.7079188", "text": "def show\n @denuncia = D...
53253625d45c0d7d9e31872bed125257
Method to delete specified animal branch, call if lowerlevels are 0
[ { "docid": "c8cb22f8b4754a7213c3bbcf81812ca8", "score": "0.5326331", "text": "def delete_exp_area()\n\n @raw.json_hash[\"Animals\"].tap do |animal|\n animal.delete(@ani)\n end\n\n json_prune()\n\n end", "title": "" } ]
[ { "docid": "a56018631d040b30c0cb91363f30b486", "score": "0.6443238", "text": "def delete_tree(type, path, opts = {})\n if opts[:no_checkout]\n delete_tree__body(type, path, opts)\n else\n checkout(@branch) do\n delete_tree__body(type, path, opts)\n ...
5923df47c484dd5479204ad1c9cde167
Generate all words (tokens) used in tweets and all tokens used in users' locations, descriptions or names each tagged according to their origin.
[ { "docid": "7855d6c6256c4a0d961f14c024de9d87", "score": "0.6141992", "text": "def process thing\n case thing\n when Tweet then gen_tweet_tokens(thing)\n # when TwitterUserProfile then gen_profile_tokens(thing)\n end\n end", "title": "" } ]
[ { "docid": "c2c9211f59ed84385e170b998c161566", "score": "0.63764864", "text": "def tokenize_tweet_text t\n # skip default message from early days\n return [] if (! t) || (t =~ /just setting up my twttr/);\n # downcase\n t = t.downcase;\n # Remove semantic non-words, except hasht...
023e88ead89622fdf06d14a919ee0770
Problem The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? Result Ans = 6857 real0m7.600s user0m7.501s sys0m0.068s Methods
[ { "docid": "0501b77be6fb740b0eb03a9aeed9f126", "score": "0.7069459", "text": "def highest_prime_factorial(x)\n\tfor i in 2..(x/2)\n\t\tif x % (x/i) == 0\n\t\t\tabort((x/i).to_s) if (x/i).prime?\n\t\tend\n\tend\nend", "title": "" } ]
[ { "docid": "a41aa6133aacd416aa711bc818926c56", "score": "0.8392187", "text": "def largest_prime_factor\n num = 600851475143\n factors = []\n\n def is_prime?(n)\n for x in (2...n) do\n if n % x == 0\n return false\n end\n end\n return true\n end\n\n for y in (2...1000) do\n...
708ee35590480c0b8640bf4184942351
Builds a string with either/both/none of the two size fields.
[ { "docid": "8d7bd3311d12e63f312632305e65c9b8", "score": "0.78150445", "text": "def build_piping_sizes_string\r\n if size_1.blank? && size_2.blank?\r\n return \"\"\r\n elsif size_1.blank?\r\n return size_2\r\n elsif size_2.blank?\r\n return size_1\r\n...
[ { "docid": "562082e984d69bf0cb6845b657f52ed6", "score": "0.6180972", "text": "def to_long_s\n text = self.to_s + \" of \"\n values = self.all_values\n values_length = values.length\n values.each_with_index {|index, value| \n text += \"#{value}\"\n text += (index != values_length - ...
6183f347725b63c124d8453f46e215a8
this function is called as a callback from http post server. We could just use the announce function as the callback, but using this function allows us to add in different stats for post announcements.
[ { "docid": "86ab82a009fb27cf8afb6461621972d4", "score": "0.6611958", "text": "def http_announce announcement\n announce announcement\n end", "title": "" } ]
[ { "docid": "a66afaba139a86a38ecc41c5344f9b7c", "score": "0.65370053", "text": "def announce; end", "title": "" }, { "docid": "2ccb2ae8fd5943d0bab5aa9cd25c1b23", "score": "0.573017", "text": "def announce(options)\n options = options.rekey\n\n if file = options[:file]\n ...
63835757027b6bd5d7ed700f7b49adc9
Chocoblob Coin Search example (with cuts) (see _On Lisp_, sec, 22.5 (pp. 298302)
[ { "docid": "77c3b6500fac14a78c70eb88bf0d92de", "score": "0.0", "text": "def coin? x\n [[\"LA\", 1, 2], [\"NY\", 1, 1], [\"Boston\", 2, 2]].member? x\nend", "title": "" } ]
[ { "docid": "c42eac59f34f8bbaa628d0c7abd653d2", "score": "0.63659865", "text": "def find_icecream(coins, icecream_list)\n sorted_list = icecream_list.sort\n ptr_a = 0\n ptr_b = sorted_list.length-1\n sum = add(sorted_list, ptr_a, ptr_b)\n while 1\n if sum == coins\n break\n elsif sum < co...
f544d378df9108e399cc39cf813bcc18
Returns the value of attribute config. source://stripe//lib/stripe/connection_manager.rb18
[ { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.0", "text": "def config; end", "title": "" } ]
[ { "docid": "f75169c725e26f03109043b1910a6748", "score": "0.69283724", "text": "def get_config(name)\n @@_cdata[self.object_id][name.to_sym] || nil\n end", "title": "" }, { "docid": "0e5af244b9a1636ea454ff63f8ce3339", "score": "0.6805762", "text": "def config\n self.class.const...
b1df64257113428660eb81e9af76f55f
GET /category_product_features GET /category_product_features.json
[ { "docid": "ac8d42da38d38ab6d635ed3f0f7421c2", "score": "0.8169302", "text": "def index\n @category_product_features = if params[:category_id]\n Category.find(params[:category_id]).category_product_features\n else\n CategoryProductFeature.by_category\n end.page(params[:page])\n\n r...
[ { "docid": "25b71298da808916c0dfa1c6157a2bb2", "score": "0.7828814", "text": "def show\n @category_product_feature = CategoryProductFeature.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category_product_feature }\n end\n end"...
f561be9076e77c8b1dfae6b48616768f
DELETE /post6s/1 DELETE /post6s/1.xml
[ { "docid": "de904e11d2e16080b263d6a1adfbff81", "score": "0.7158619", "text": "def destroy\n @post6 = Post6.find(params[:id])\n @post6.destroy\n\n respond_to do |format|\n format.html { redirect_to(post6s_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.69416845", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "df26116eb86dbadafed7137f9e3c2f9e", "score": "0.6772896", "text": "def delete!\r\n return nil unless ex...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "06935c3e5b1045fa95972b68f0529705", "score": "0.0", "text": "def channel_group_params\n params.require(:channel_group).permit(:group_id, :channel_id, :date)\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...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "283f8a93ba669be3865fa31289c9d5cf", "score": "0.0", "text": "def set_video\n @video = Video.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...
c54f778a04e60708efaa502371a3e10c
GET : api/v1/tasks optional filter parameters : event_id Filter by event identity
[ { "docid": "8cc38b0984f2d2003204011bc1c75016", "score": "0.0", "text": "def index\n render_collection filter_tasks(filter_params),\n status: :ok\n end", "title": "" } ]
[ { "docid": "a31f4c82a4cd3ff128438d7b75a9f63c", "score": "0.6666175", "text": "def task(project_id, task_id, req_params = {})\n params = { query: [project_id, task_id], req: req_params }\n\n data = endpoint(name: 'Tasks', params: params).do_get\n\n resource 'Task', data\n end", ...
2bbd0d36a44df784953faf38e9fc0158
POST /homologacions POST /homologacions.json
[ { "docid": "9131c1d67ce23863357d164ef86b05ea", "score": "0.72418463", "text": "def create\n @homologacion = Homologacion.new(params[:homologacion])\n\n respond_to do |format|\n if @homologacion.save\n format.html { redirect_to @homologacion, notice: 'Homologacion was successfully creat...
[ { "docid": "924ee62fa4ad56db17a1443c05409d4a", "score": "0.7140185", "text": "def create\n @homing = Homing.new(homing_params)\n\n if @homing.save\n render :show, status: :created, location: @homing\n else\n render json: @homing.errors, status: :unprocessable_entity\n end\n end", ...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "76c77f19eaf2def187b397ee245f5093", "score": "0.0", "text": "def update!(**args)\n @key = args[:key] if args.key?(:key)\n @synonyms = args[:synonyms] if args.key?(:synonyms)\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...
f06652ea1d217e37c32fa049fb054054
splitdir each 200 splitdir by 10
[ { "docid": "10814cdb7f64650db45c6cd0aeff06bf", "score": "0.0", "text": "def usage\n $stderr.puts(\"Usage:\")\n $stderr.puts(\" #{File.basename($0)} <dir> each 200\")\n $stderr.puts(\" #{File.basename($0)} <dir> into 10\")\n exit(1)\nend", "title": "" } ]
[ { "docid": "4652dd93d956605f03f4e3e27455d155", "score": "0.61428636", "text": "def split_files(path)\n pwd = FileUtils.pwd\n puts \"Splitting files in #{path}\"\n $tables.each_key do |table|\n next if table == :sentinel\n puts \"Handling #{table}...\"\n table_path = File.join(path, table)\n ...
eece566eb2b8525fa58289643755eb22
This method returns an Arguments object. Before "evaluation" the arguments may be one of three things: 1. An Arguments object; just yield immediately 2. An Array; pass to a new Arguments object and yield 3. An ArgumentList AST node; evaluate it
[ { "docid": "bf771dba441e0540eabfbc70dd54659d", "score": "0.67831403", "text": "def eval_arguments(&continuation)\n case argument_list\n when Arguments\n yield argument_list\n when Array\n yield Arguments.new(argument_list)\n else\n argum...
[ { "docid": "218cec94a38d85f6f4cd6b7dd4ebb954", "score": "0.74135065", "text": "def arguments\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 37 )\n\n\n return_value = ArgumentsReturnValue.new\n\n # $rule.start = the first token seen before mat...
212d366807080a4ac76ff60864331ec1
Write a method that returns the remainder of its two arguments. You may use the modulo operator.
[ { "docid": "7d29d2cdd592c819474b076f721d4153", "score": "0.7963782", "text": "def my_modulo(dividend, divisor)\n dividend % divisor\nend", "title": "" } ]
[ { "docid": "6868b6676467e0a0abb234809986cc41", "score": "0.8578244", "text": "def remainder(num1, num2)\n return num1 % num2\nend", "title": "" }, { "docid": "0de66960226c68c0995813c340239036", "score": "0.85543", "text": "def modulo(num1, num2)\n\tremainder=num1%num2\nend", "ti...
2db3d5e55503b6338dbdd0c341aaffe1
UNIT TESTS FOR METHOD random_neighbor Equivalence cases: no neighbors > nil 1 neighbor > that neighbor more than 1 neighbor > a randomly chosen neighbor EDGE CASE tests the get neighbor function on a location with no neighbors should return nil
[ { "docid": "5a0d6249b04243e65aee54c680137ae0", "score": "0.8024578", "text": "def test_random_neighbor_no_connections\n assert_nil @loc1.random_neighbor\n end", "title": "" } ]
[ { "docid": "2b835e5eff3095db3d8f0ff65551f0ae", "score": "0.82473314", "text": "def test_random_neighbor_with_no_neighbors\n \tloc = Location.new('Lonely City')\n \tassert_nil loc.random_neighbor?\n end", "title": "" }, { "docid": "15007db280ff06790b3aaabd09faac6a", "score": "0.7701127...
800ca784ae87dbb6877721f3671d287f
DELETE /repositories/1 DELETE /repositories/1.json
[ { "docid": "6f169a55369a4cd9947ac74061835098", "score": "0.72305214", "text": "def destroy\n @repository.destroy\n respond_to do |format|\n format.html { redirect_to repositories_url, notice: 'Repository was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "2808997024d95463f70998ad9b79c711", "score": "0.7701404", "text": "def destroy\n @repo = Repo.find(params[:id])\n @repo.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "08fcaa8d14a357ab558850cb351a316c...
6459b481b04789a2dacf58599d2d8c0a
Remove a label from a GitHub issue
[ { "docid": "1e00d62259c95411cae4913a0b36eca4", "score": "0.84833294", "text": "def unlabel_issue(label)\n github_client.remove_label(context.repo, context.issue_id, label)\n end", "title": "" } ]
[ { "docid": "a011a68f9f1354ccb0b476f4fa1092bf", "score": "0.82322973", "text": "def remove_issue_label(repo, issue_id, label)\n # GH will create an event for removing the label, even if it doesn't exist\n # so we should check for that first\n return if client.labels_for_issue(repo, issue_id).sel...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "daed890da9228164e6acdc76c49c6829", "score": "0.0", "text": "def set_sport_type\n @sport_type = SportType.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...
e9673f6a7d592ba00caabb891dfdff55
Reset the identifier mangling options. Overrides any already set on the instance. Only for internal use by shared adapters.
[ { "docid": "b86ee20adcb4b23656e4e07f7ec83bde", "score": "0.7883933", "text": "def reset_identifier_mangling\n @quote_identifiers = @opts.fetch(:quote_identifiers){(qi = Database.quote_identifiers).nil? ? quote_identifiers_default : qi}\n @identifier_input_method = @opts.fetch(:identifier_input...
[ { "docid": "60e4b952489bab357fd86183ab30edba", "score": "0.6343857", "text": "def reset\n @options, @aliases = {}, {}\n end", "title": "" }, { "docid": "60e4b952489bab357fd86183ab30edba", "score": "0.6343857", "text": "def reset\n @options, @aliases = {}, {}\n end", "titl...
e6371987daf16266f036435b2598f29e
Auto generated FRBR relationship Returns all FRBR objects for the relationship has_as_its_genre to which_concepts?
[ { "docid": "46f1beabadcff407dcf27d26963683a7", "score": "0.8495344", "text": "def concept_genres\n find_related_frbr_objects( :has_as_its_genre, :which_concepts?) \n end", "title": "" } ]
[ { "docid": "d8e76bf890123fd5e93bc08a48dd5df2", "score": "0.8347418", "text": "def concept_genres\n\t\tfind_related_frbr_objects( :has_as_its_genre, :which_concepts?) \n\t end", "title": "" }, { "docid": "dc6fccb584db27727f17b0eb97f4e990", "score": "0.7572331", "text": "def related...
9bf48c4bad8f0ea2ad509b55ac878bd9
And simplify the method:
[ { "docid": "54c450875831085e9da299ae82fc3f78", "score": "0.0", "text": "def fibonacci_last_digit2(nth)\n FIB_DIGITS[nth % 60]\nend", "title": "" } ]
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.61727774", "text": "def desired; end", "title": "" }, { "docid": "bc658f9936671408e02baa884ac86390", "score": "0.60665995", "text": "def anchored; end", "title": "" }, { "docid": "4fe655da88e61d28e8b9a9ed964af838"...
db7182271a36fc99039cf8b80b1500e3
GET /apply_leaves GET /apply_leaves.json
[ { "docid": "d35c708c15b788f36383a8b7ce83089c", "score": "0.0", "text": "def index\n end", "title": "" } ]
[ { "docid": "32d978bf740cb3dbd0cf5f0204738911", "score": "0.6773353", "text": "def leaves\n end", "title": "" }, { "docid": "d10e72c0b40e5a078022af9b8b25536e", "score": "0.66849774", "text": "def index\n @leaves = current_user.leaves\n end", "title": "" }, { "docid"...
156768cb93aea079fa3678795f14857c
GET /reviews/1 GET /reviews/1.json
[ { "docid": "ae7ed48f6b79c8c6bc65ee51220d90c7", "score": "0.7130125", "text": "def show\n @review = Review.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @review }\n end\n end", "title": "" } ]
[ { "docid": "93de6ec59735daf31c2bf1692e44c55f", "score": "0.7905385", "text": "def get_review(id)\n get(\"1/reviews/#{id}\")\n end", "title": "" }, { "docid": "9537122a27d68b6ea128e8d65cfa0858", "score": "0.77390724", "text": "def get_reviews\n @review = Review.find(par...
624f76c1e6e3aeb84bf41195de059f82
Build an instance of ModelBuildInstance
[ { "docid": "263252da80ab04241372fc9e20c76f7b", "score": "0.0", "text": "def get_instance(payload); end", "title": "" } ]
[ { "docid": "c3875b2d62c5e66895e4911ab128c93c", "score": "0.7954311", "text": "def build *args\n new(*args).model\n end", "title": "" }, { "docid": "7a4267d71f6cb81112a42cbc1db9ba1e", "score": "0.7118957", "text": "def build_object\n @object ||= singleton_build_object_bas...
1f8278737aaae9f89f827029f2424d78
DELETE /enq_faces/1 DELETE /enq_faces/1.json
[ { "docid": "10f20ce06826b69913fddc1e69efc458", "score": "0.7754493", "text": "def destroy\n @enq_face = EnqFace.find(params[:id])\n @enq_face.destroy\n\n respond_to do |format|\n format.html { redirect_to enq_faces_url }\n format.json { head :no_content }\n end\n end", "title"...
[ { "docid": "7ca6a98e3cf0e87b2b2f56a830e379ad", "score": "0.72923434", "text": "def destroy\n @face = Face.find(params[:id])\n @face.destroy\n\n respond_to do |format|\n format.html { redirect_to(faces_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "do...
14ef0e8eafa12d69b48edb226ff287c9
Return a hash describing privileges of the specified user on this enrollment
[ { "docid": "f1a1f03dea9d3731406db107233b1802", "score": "0.6654522", "text": "def privileges(user)\n\n\t\t# create a new privileges object with no rights\n\t\tp = TinyPrivileges.new\n\n\t\t# user must be specified\n\t\treturn p if user.nil?\n\n\t\t# an admin has full privileges\n\t\treturn p.grant_all i...
[ { "docid": "fba5badf8edee8955354294e690449c6", "score": "0.6356318", "text": "def value\n @privileges\n end", "title": "" }, { "docid": "1316347aa6c5bff1fbb74e64d07067a4", "score": "0.6218003", "text": "def privileges(user)\n\t\treturn TinyPrivileges.contract_chil...
44430c534ccdfdab8b58f8bbc15cf29e
GET /mapping_data_obats/1 GET /mapping_data_obats/1.xml
[ { "docid": "387cb88030200320daf951e3a9933389", "score": "0.6432375", "text": "def show\n @mapping_data_obat = MappingDataObat.find(params[:id])\n pagination(params[:id], \"show\")\n\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @mapping_da...
[ { "docid": "e6194f6848d199e2b6e3a205a0bc18aa", "score": "0.6587024", "text": "def index\n @mappings = Mapping.find(:all)\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @mappings.to_xml }\n end\n end", "title": "" }, { "docid": "48bb72e...
195b50d6cc5b7a2dfcb723d2c494420a
sharing:transfer EMAIL transfer an app to a new owner
[ { "docid": "5c056b870cde9ee34592f6bdffb83d1f", "score": "0.7263457", "text": "def transfer\n email = args.shift.downcase rescue ''\n raise(CommandFailed, \"Specify the email address of the new owner\") if email == ''\n heroku.update(app, :transfer_owner => email)\n display \"App owne...
[ { "docid": "e618d9fcfb35a759f2eb8c0a671718d2", "score": "0.8329762", "text": "def transfer\n unless target = shift_argument\n error(\"Usage: heroku sharing:transfer EMAIL\\nMust specify EMAIL to transfer an app.\")\n end\n validate_arguments!\n org_from_app!\n\n action(\"...
bcf0d26081e4fedbe1146492a83f058b
This is a writer (for balance) because you input the argument def deposit = deposit
[ { "docid": "ca31b936e12c8dc5481d76aab233e065", "score": "0.7472866", "text": "def deposit(num)\n @balance += num\n end", "title": "" } ]
[ { "docid": "66bd8ec8d7d8bbf5008a84a00c235a0e", "score": "0.77178943", "text": "def deposit(deposit_amount)\n puts \"Added #{deposit_amount} to your account\"\n @amount+=deposit_amount\n puts \"Account have #{@amount}\"\n end", "title": "" }, { "docid": "ef873f60abaa5ca607fb41201c35...
46fa5e375c81463fdb7491cff01bb3e8
% resolver : !FIXME > !FIXME
[ { "docid": "5937ebd81f24c7c41b1d0b2689f646cf", "score": "0.8885911", "text": "def resolver() end", "title": "" } ]
[ { "docid": "fba9e8e0ef903e1ae3a5b9386a08c70a", "score": "0.8600129", "text": "def resolver; end", "title": "" }, { "docid": "b1e64bfc36cce91bdcde8306c3245939", "score": "0.7742112", "text": "def resolve; end", "title": "" }, { "docid": "822dd2bf5f9b4ca9a785a825ba398e92", ...
f60cbed0dc98318305a357b3e88bb5c5
POST /course_offerings POST /course_offerings.json
[ { "docid": "3f310d57c4ebd38a1b30899f340e6532", "score": "0.6901845", "text": "def create\n @course_offering.course_enrollments.build(\n user_id: current_user.id,\n course_role_id: CourseRole.lead_instructor.id)\n\n respond_to do |format|\n if @course_offering.save\n format.ht...
[ { "docid": "0f17541156472745e7259a1681226b92", "score": "0.69031185", "text": "def create\n @offer = Offer.new(offer_params)\n @offer.college = current_college\n # Using class variable to set the course application of the created offer\n @offer.course_application = @@course_application\n\n ...
c65c59535e280929be94e7a7a0170b35
Return list of descendants
[ { "docid": "8a3383edd2166e675a329ea4a8e7f814", "score": "0.821126", "text": "def descendants\n list = []\n children.each do |child|\n list << child\n list.concat(child.descendants)\n end\n list\n end", "title": "" } ]
[ { "docid": "4ab5164a541847852de324ebc7ebcb53", "score": "0.84561616", "text": "def descendants\n @descendants\n end", "title": "" }, { "docid": "74ca33b7e7c561798d2d607d2d3d2c19", "score": "0.8367414", "text": "def descendants\n _descendants.flatten.uniq\n end", "titl...
0aa24f079c338709735bc38e504c5ccf
Time complexity: O(n) Space complexity: O(1)
[ { "docid": "1d98f5fe1d8824d377045a835f08e0a4", "score": "0.0", "text": "def reverse_inplace(s)\n if s.length <= 1\n return s\n end\n \n return s[s.length-1] + reverse_inplace(s[0, s.length-1])\nend", "title": "" } ]
[ { "docid": "94b952c4eec254dafeaf15d164f67032", "score": "0.6514153", "text": "def slow_solution(m, a)\n n = a.size\n return 1 if n == 1\n distinct = 0\n n.times do |back|\n (back..n - 1).each do |front|\n if a[back..front] == a[back..front].uniq\n distinct += 1\n else\n br...
ab4d31e1000ab2090a7d067e59e6e1de
Send headers needed to connect through proxy
[ { "docid": "da36be5ea70523caa90eab6e4e773bac", "score": "0.7715329", "text": "def connect_through_proxy\n add_headers\n write(join_headers)\n end", "title": "" } ]
[ { "docid": "cef1ceb832dbf0f319c1b00c89e2fed3", "score": "0.8237916", "text": "def proxy_connect_headers; end", "title": "" }, { "docid": "c40ef223f489b07b11ffe4949a55cc2e", "score": "0.800299", "text": "def proxy_connect_header; end", "title": "" }, { "docid": "e8c25f8e5b...
0ad2fcc1a034b13e8c6c526835004602
List Roles List [roles]( on your account Scopes: `role:read:admin` Prerequisites : Pro or higher plan. For setting the initial role, you must be the Account Owner. For subsequent role management, you must be the Account Owner or user with role management permissions.
[ { "docid": "bd3529d57832f8198d5e3bf207b443da", "score": "0.71357393", "text": "def roles(opts = {})\n data, _status_code, _headers = roles_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "61f394b57a1edcdf63769df903a5c7a3", "score": "0.83186156", "text": "def list_roles(options={})\n request({\n 'Action' => 'ListRoles',\n :parser => Fog::Parsers::AWS::IAM::ListRoles.new\n }.merge!(options))\n end", "title": "" }, { ...
648eb0d916f9c27d06dd8af1e3329b12
VALUES Define a new deploy value. Conceptually, a deploy value is a value (currently only strings supported) with a unique name (expressed as a ruby symbol). For convenience, they define a bunch of metadata also, e.g. allowed values, info/help text, etc.
[ { "docid": "6218b84a7835cd930b3221a0e2ef4051", "score": "0.4821011", "text": "def define(dict)\n raise \"Can't define value without at least an identifier and intial value.\" unless dict.count > 0\n\n # ordered hash FTW\n identifier = dict.keys[0]\n\n predefined_values = dict.values[...
[ { "docid": "2bc4e66cc77518c6d58202bfb4f266a3", "score": "0.5467251", "text": "def values=(value)\n @values = value\n end", "title": "" }, { "docid": "2bc4e66cc77518c6d58202bfb4f266a3", "score": "0.5467251", "text": "def values=(value)\n @value...
6576877f250aff8cc5a5fdb06b71f5b9
convenience wrapper for `register_setting` batch operations accepts a hash of key / default value pairs
[ { "docid": "227df0b47a61cc17f3bf361d6a2a4632", "score": "0.62803674", "text": "def register_settings(settings)\n settings.each do |key, default_value|\n register_setting(key, default_value)\n end\n end", "title": "" } ]
[ { "docid": "6593654ad04120640e91088818cbbd57", "score": "0.6247607", "text": "def register_setting(key, default_value)\n self.class.validate_value(default_value)\n\n @defaults[key] = default_value\n\n # update cache\n @settings[key] = @records[key] || default_value\n end...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "5db79f42a165fc2de584700f16d350ba", "score": "0.0", "text": "def set_yp\n @yp = Yp.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...
5cf7a79e9cfa800ad272f277d9b4ff06
GET /gt_categories/1 GET /gt_categories/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "04779fc6a7223751fb3e79f2b7a6f82c", "score": "0.80543816", "text": "def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end", "title": "" }, { "docid": "cee36b9377ea86f9af324faadcdf1a0c...
506a288e2038faf1ec2ab2dfc8a82263
This method overrides the method in the immediate superclass SshDataProvider.
[ { "docid": "0b9814616ef575499132a88d1d1130e9", "score": "0.0", "text": "def provider_full_path(userfile) #:nodoc:\n basename = userfile.name\n subid,visid = named_according_to_LORIS_convention!(userfile)\n Pathname.new(remote_dir) + subid + visid\n end", "title": "" } ]
[ { "docid": "e3080810f400665fed235511ef99d9da", "score": "0.61637086", "text": "def ssh_type; end", "title": "" }, { "docid": "e3080810f400665fed235511ef99d9da", "score": "0.61637086", "text": "def ssh_type; end", "title": "" }, { "docid": "e3080810f400665fed235511ef99d9da...
11457f68bcdf83f38e8083405339c8e4
return the correct hash keys to search according to type avoid duplivate codes
[ { "docid": "ec8ccd81fc7ea6d205d61dee741bbbe6", "score": "0.0", "text": "def search_space type\n if type == \"alias\" \n keys = @conf.aliases\n else\n keys = @conf.script_aliases\n end \n end", "title": "" } ]
[ { "docid": "59d3e5165a2bf45e6da3d516ed51431b", "score": "0.6785751", "text": "def get_keys_of_type(type)\n @keys.select { |key| key.type == type }\n end", "title": "" }, { "docid": "9af701b6a805cf259c475044c65d8205", "score": "0.6663961", "text": "def hash; [searchable_id, search...
b4263a43f34411f4dde2e4b435e248de
newis initialized with an argument of a name
[ { "docid": "cd04bf2f811e3341a5f72d68b5f5da03", "score": "0.0", "text": "def initialize(name)\n @name = name \n @@all << self\n end", "title": "" } ]
[ { "docid": "28303d104feeafd53114514631157315", "score": "0.71820545", "text": "def initialize(arg={})\n if arg.is_a?(String)\n @name = arg\n send(\"set_#{@name}\".to_sym)\n else\n merge!(arg)\n end\n end", "title": "" }, { "docid": "7866e43415b454926b27c4c4881d63b0",...
23104bb10354618eb8410e0a45389d7a
Returns true if the radio set has one or more radio buttons where label matches the given value.
[ { "docid": "76a73755480c9092713f39649379327f", "score": "0.637197", "text": "def include?(str_or_rx)\n radio(label: str_or_rx).exist?\n end", "title": "" } ]
[ { "docid": "6e76e96356c4ccc7fee397e3c4e4e2b3", "score": "0.5947151", "text": "def label?(label)\n self.labels.keys.include?(label)\n end", "title": "" }, { "docid": "d7d89688025b008a6397b4062271c4e9", "score": "0.58074456", "text": "def has_label?(label_set, label)\n l...
3b8851753abace78ac7d99f7e44b39b2
Method filter issues, that belong only specified tag range
[ { "docid": "8f3eeb4f5fa2c17632c7228fe44d8930", "score": "0.6595936", "text": "def filter_by_tag(issues, newer_tag = nil)\n issues.select do |issue|\n issue[\"first_occurring_tag\"] == (newer_tag.nil? ? nil : newer_tag[\"name\"])\n end\n end", "title": "" } ]
[ { "docid": "b55981055485b49c158f7622a24758e5", "score": "0.76319796", "text": "def filter_issues_for_tags(newer_tag, older_tag); end", "title": "" }, { "docid": "a46fc653d73e09ea82f1965e4b7536f7", "score": "0.6896141", "text": "def filter_by_tag(issues, newer_tag = T.unsafe(nil)); en...
19637368a56df41e7807e8825c0251c3
Instantiates a new MailDropr client with the given credentials
[ { "docid": "3f0b2131fef0405144fe9ceeddec92a0", "score": "0.6332201", "text": "def MailDropr(options = {})\n MailDropr::Base.new(options)\nend", "title": "" } ]
[ { "docid": "a18da94b36f4b16ca444b79e097323fe", "score": "0.62283933", "text": "def create_client(credentials)\n credentials = load_oauth2_service_account_credentials(credentials)\n oauth_options = OAUTH2_CONFIG.merge({\n :issuer => credentials[:oauth2_issuer],\n :sign...
13818994cd41ea546ce64de5acafa3c7
calls predicted_deaths and speed_of_spread methods for predictions
[ { "docid": "3c2601d775cb23c551573022db188e89", "score": "0.0", "text": "def virus_effects\n number_of_deaths = predicted_deaths()\n speed = speed_of_spread()\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak and will spread across the state in #{speed} months.\\n\\n\"\n ...
[ { "docid": "3ad55a24c67eb51cc44d2c916112fdce", "score": "0.71852374", "text": "def runPrediction\n\n end", "title": "" }, { "docid": "8ae80dc3bf2d44902d41b75322efd717", "score": "0.7115868", "text": "def predicted_deaths\n \n # calls the private method to calculate the numbe...
208cfa3ba670207fe7b3e30a62636c45
Helper method to make a new Message instance and convert its payload to a string. +flags+ may be ZMQ::DONTWAIT. Returns 0 when the message was successfully dequeued. Returns 1 under two conditions. 1. The message could not be dequeued 2. When +flags+ is set with ZMQ::DONTWAIT and the socket returned EAGAIN. With a 1 re...
[ { "docid": "b381d03ce76cac43ec4322a48d10cbd6", "score": "0.54030114", "text": "def recv_string string, flags = 0\n message = @receiver_klass.new\n rc = recvmsg message, flags\n string.replace(message.copy_out_string) if Util.resultcode_ok?(rc)\n message.close\n rc\n end", ...
[ { "docid": "18f683826f1f90c80516b60854963552", "score": "0.6279032", "text": "def recvmsg message, flags = 0\n #LibZMQ.zmq_recvmsg @socket, message.address, flags\n __recvmsg__(@socket, message.address, flags)\n end", "title": "" }, { "docid": "5baf47f81a76e1cac0d71dcdf7b87188",...
ee681bd5ea8b9a589bd02889e3a0ce1f
rubocop:enable Lint/DuplicateMethods Returns true if the collection contains all bits in the register
[ { "docid": "1b8c98858f664581ee990c5123388fe6", "score": "0.54174244", "text": "def whole_reg?\n size == parent.size\n end", "title": "" } ]
[ { "docid": "9ae836904d99b720b22e884a21b090b5", "score": "0.65045947", "text": "def contains_all?(other)\n (other & self) == self\n end", "title": "" }, { "docid": "ee7dcc7d035e126dfe48135b0ff4a66b", "score": "0.64429975", "text": "def my_all?\n return self unless block_given?\...
66e17474059ff90edb51ae5126d04e21
acts_as_token_authentication_handler_for User Looks at what to do after sign in
[ { "docid": "be35be59ec9c503fe83b216f820ace68", "score": "0.0", "text": "def after_sign_in_path_for(resource)\n\n # save list if there is a temp_list in the session\n if session[:complaint].present?\n \n # save list\n @complaint = current_user.complaints.create(session[:complaint])\n \n # clear session\n...
[ { "docid": "db6531f17e41c469ce436ed1bcfc72c3", "score": "0.7483272", "text": "def after_token_authentication\n if params[:authentication_key].present?\n @user = User.find_by_authentication_token(params[:authentication_key]) # we are finding the user with the authentication_key with which de...
adc6ea936c42b1daef30726d0c70621d
Method: tilt? (Proton::Page) Checks if the file is supported by tilt.
[ { "docid": "5a504db874ac127b7e490b2690dd9f98", "score": "0.63854265", "text": "def tilt?\n !! tilt_engine\n end", "title": "" } ]
[ { "docid": "1a7cc9685b46542a2efe026016d664d0", "score": "0.6391892", "text": "def template?\n return false if source_file.nil?\n !::Tilt[source_file].nil?\n end", "title": "" }, { "docid": "bea5c46890bddda971e58ba337de061e", "score": "0.59224623", "text": "def supp...
f61eb8f2bfa43e18bdcb89e8bd0d8e91
GET /respuesta GET /respuesta.json
[ { "docid": "8df4d38112a35e7dc54aa17ad6dd7d8a", "score": "0.66256154", "text": "def index\n @respuesta = Respuestum.all\n end", "title": "" } ]
[ { "docid": "e93e8a74b447adc5748c25dbf0949faf", "score": "0.7413997", "text": "def show\n render json:@respuesta, :only =>[:id, :descripcion, :imagen],status: :ok\n end", "title": "" }, { "docid": "6e3654e06e02e365524391e29ed99f27", "score": "0.71833235", "text": "def show\n @r...
a4b67d84766d5036c74a945b28cc25ca
Generates an error message and appends it to errors array.
[ { "docid": "0492bdbfc29c26d954de7bb40bd2b792", "score": "0.70632863", "text": "def add_error(*args)\n errors << error_message(*args)\n end", "title": "" } ]
[ { "docid": "4e3449f658cef85aee03683dd554d6a8", "score": "0.7320734", "text": "def error(message)\n @errors = [] unless @errors.present?\n @errors.append(message)\n end", "title": "" }, { "docid": "4e3449f658cef85aee03683dd554d6a8", "score": "0.7320734", "text": "def error(mess...
bccbb1cc076541c034b6f576aa17d11a
GET /regions GET /regions.json
[ { "docid": "244fd8713ff470c20d28458c3fa27d05", "score": "0.6429445", "text": "def index\n @regions = Region.all.order(\"name ASC\").paginate(:page => params[:page], :per_page => 15)\n end", "title": "" } ]
[ { "docid": "a3281fc0222f16dfd7315f0b6efe7b48", "score": "0.78764933", "text": "def index\n\n @regions = Region.all\n\n render json: @regions\n\n end", "title": "" }, { "docid": "2f5024d15e1eccd0d522a783b937f077", "score": "0.76631045", "text": "def index\n @regions = Region...
b3aa3b6dcf423d52af0338c8fb96d42c
Uploads the changes to the Directed Edge database. The optional method parameter may be used for either add or remove which do only incremental updates to the item.
[ { "docid": "38979984bdedacd95706689e25f09f9e", "score": "0.0", "text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end", "title": "" } ]
[ { "docid": "2ae830abc42b817a7ef7e9b013b102b8", "score": "0.58765393", "text": "def update\n push_to_db\n end", "title": "" }, { "docid": "a2159e3f7f72536f0efe1e466337e29f", "score": "0.5796094", "text": "def upload\n raise NotImplementedError\n end", "title": ...