query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
b6b9cd199dfaed08c4c534812e0ac109
Check to see if the all the properties in the model are valid
[ { "docid": "aaed13bfd19e2a15fd94563d8afb348a", "score": "0.0", "text": "def valid?\n attack_complexity_validator = EnumAttributeValidator.new('String', ['L', 'H'])\n return false unless attack_complexity_validator.valid?(@attack_complexity)\n attack_vector_validator = EnumAttributeValidat...
[ { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.78992486", "text": "def validate_properties\n true\n end", "title": "" }, { "docid": "162d0e63d65b0cd6795543bab63498f2", "score": "0.78992486", "text": "def validate_properties\n true\n end", "title": "" ...
3fe544cf0438c57f3a71ca3f0202a2ed
PATCH/PUT /tours/1 PATCH/PUT /tours/1.json
[ { "docid": "ed449c7d4110c2d09c6077c0023ef4e4", "score": "0.6192293", "text": "def update\n respond_to do |format|\n if @tour.update(tour_params)\n format.html { redirect_to @tour, notice: 'Tour was successfully updated.' }\n format.json { render :show, status: :ok, location: @tour ...
[ { "docid": "9a2c2ad41d6eaacbea85b00ae37cc8cc", "score": "0.64515835", "text": "def update\n @tour = Tour.find(params[:id])\n\n respond_to do |format|\n if @tour.update_attributes(params[:tour])\n format.html { redirect_to @tour, notice: 'Tour was successfully updated.' }\n forma...
f8fafe4a009372e5945919c64e1d1efc
PUT /events/1 PUT /events/1.xml
[ { "docid": "63e961b29c9ff8cd0ff62fbe88f3b89f", "score": "0.6586422", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n flash[:notice] = 'Event was successfully updated.'\n format.html { redirect_to(@...
[ { "docid": "22348ebd79d657994d5e45c8477d9ee6", "score": "0.68006223", "text": "def save_event(event)\n method = (event.id == nil || event.id == '') ? :post : :put\n query_string = (method == :put) ? \"/#{event.id}\" : ''\n @connection.send(Addressable::URI.parse(events_url + query_string)...
643cf48a374602b12fcccbf6167f2dbb
Increment the click_count field by one
[ { "docid": "9bf3705d9ef87548d680eae20d766ef7", "score": "0.9157501", "text": "def increment_click_count\n update(click_count: click_count + 1)\n end", "title": "" } ]
[ { "docid": "1e565d032bacfa7155a866cc3d5b14b8", "score": "0.84287626", "text": "def register_click!\n self.update_attribute(:clicks, self.clicks + 1)\n end", "title": "" }, { "docid": "a6c412708cddaf919b4f6ea2f24424a8", "score": "0.83772624", "text": "def register_click!\n ...
d5301989e87c25e982228b6fdf84f6a3
character or characters of the argument. If the argument has an odd length, you should return exactly one character. If the argument has an even length, you should return exactly two characters. Algorithm The median can be defined by more elementary arithmetical operations An odd number divided by 2 = X.5 and X.0 + 1 a...
[ { "docid": "70e93ee7eb291f51c7de0b892cc0a4c6", "score": "0.76428723", "text": "def median(string)\n case\n when string.size.odd?\n string[string.size/2.floor]\n else\n string[string.size/2 - 1] + string[string.size/2]\n end\nend", "title": "" } ]
[ { "docid": "2a906cb34042da19743768bc0b142d5e", "score": "0.7165314", "text": "def median_number_of_characters(array_of_text)\n array_of_numbers = number_of_characters(array_of_text)\n return median(array_of_numbers)\n end", "title": "" }, { "docid": "b0a4852daa2ace56feca0e554a9d1674",...
f2402ce4ef58e76cd0226ad392501258
Don't notify if this is for achievement.
[ { "docid": "d3997d502cf906c15f23a43629914040", "score": "0.7421675", "text": "def notify_broker_update\n without_locking { quest.achievement? } ? true : super\n end", "title": "" } ]
[ { "docid": "68fb0deb9e9d2db17d7b0a48e325e27a", "score": "0.7038897", "text": "def notify_broker_update\n (completed? || achievement?) ? true : super\n end", "title": "" }, { "docid": "00b2b75b8073e8b0ea3558311bc409a9", "score": "0.6963501", "text": "def notify_broker_destroy\n ...
971fae99e92d119a2dfb418b855e6abd
POST /projects POST /projects.xml
[ { "docid": "9642b047841d4dd993892cc965b1d6b5", "score": "0.0", "text": "def create\n @user = User.find(session[:user_id]) \n \n @client = @user.clients.find(params[:project][:client_id])\n \n @project = @client.projects.new(params[:project])\n @project.user_id = User.find(session[:u...
[ { "docid": "a3e0e91e8696656e45fd93fd2f5a4826", "score": "0.74479765", "text": "def create_project\n @user = User.find_by_username(session['user'])\n @access_token = OAuth::AccessToken.new(UsersController.consumer, @user.token, @user.secret)\n @response = UsersController.consumer.request(:post, ...
293f5a117f43431c80fdcda9a0bd7d0b
for use in request specs
[ { "docid": "f2921ab5c1e290ecf4079ad4dc3b0fb0", "score": "0.0", "text": "def sign_in_as_a_user\n @user ||= FactoryGirl.create :user\n login_as @user\n end", "title": "" } ]
[ { "docid": "f98d6a9eea49481686b2aeab00386c37", "score": "0.7380359", "text": "def request_stubs; end", "title": "" }, { "docid": "f98d6a9eea49481686b2aeab00386c37", "score": "0.7380359", "text": "def request_stubs; end", "title": "" }, { "docid": "780ab222d816203ff517b1d6...
7fcfce77d20f2301510f75ac042783cd
Return the names of all the has_many custom_fields of this object
[ { "docid": "c17159e32e9e198b237e6be00ca9905e", "score": "0.7859594", "text": "def has_many_custom_fields\n group_custom_fields('has_many') { |rule| [rule['name'], rule['inverse_of']] }\n end", "title": "" } ]
[ { "docid": "4a1d23d98575199db1d4dd474a6d6c11", "score": "0.7689163", "text": "def custom_fields\n CustomField.all(self)\n end", "title": "" }, { "docid": "6306afe7ae56b275a44f6a50bef78240", "score": "0.7017373", "text": "def field_names\n fields.keys\n end...
af1fbc14ee01968b09fd19af51dd4ffd
Returns a 4digit Integer object, equal to last year.
[ { "docid": "dd6fbe4f9b8ef4aa610686c6f2ff4365", "score": "0.71005094", "text": "def last_year\n (Time.now - (3600*24*365)).strftime(\"%Y\").to_i\n end", "title": "" } ]
[ { "docid": "b9d3af95b98d59a92b18f85e7451ffcb", "score": "0.76904076", "text": "def year; Integer.new(object.year); end", "title": "" }, { "docid": "a09213321992e16f16f728621e5bd6c2", "score": "0.7475445", "text": "def year(input) = new_year(input).year - 1791", "title": "" }, ...
9cf28183dbe61d591cebe025cc3ae55a
The valid options for the storage client
[ { "docid": "6044782cefa45d2f60e71bb8d4fe0280", "score": "0.648092", "text": "def valid_options; end", "title": "" } ]
[ { "docid": "cbc51a37eefba5cfe438d116253b0b03", "score": "0.7679665", "text": "def storage_options\n { client: :default }\n end", "title": "" }, { "docid": "e71328de97f6bdb2d5865a35b23ffe65", "score": "0.70278776", "text": "def storage_options_defaults\n {\n co...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "708304207b70e322c2b85894387b7cfc", "score": "0.0", "text": "def set_gommi\n @gommi = Gommi.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;...
767dcdbdfc71fa145f06fdbad2b1468a
Encrypts a value for the attribute specified Example class User attr_encrypted :email end
[ { "docid": "cc43beb96b8c9735d309c6ba6725cc7b", "score": "0.79545796", "text": "def attr_encrypted_encrypt(attribute, value, options = {})\n options = attr_encrypted_encrypted_attributes[attribute.to_sym].merge(options)\n if options[:if] && !options[:unless] && (options[:allow_empty_value] || not_e...
[ { "docid": "0312daa3f890732b75c76f350f9fd01c", "score": "0.8133033", "text": "def encrypt(attribute, value)\n self.class.encrypt(attribute, value, evaluated_attr_encrypted_options_for(attribute))\n end", "title": "" }, { "docid": "87934a01df1bb331fae1056458084723", "score": "0.80...
966299625f2806587add050a2c59bc21
Return the number of active client threads. Returns 0 if :threaded is set to false.
[ { "docid": "c3c11cd37f7e390c16302968780513ea", "score": "0.8628058", "text": "def active_client_threads\n # If threaded return a count from the clients list\n return @clients.length if @threaded\n\n # Else return 0 if not threaded\n return 0\n end", "title": "" } ]
[ { "docid": "253fa5500231ff5415cce81e21bade62", "score": "0.7552613", "text": "def thread_count\n @worker_threads_count.value\n end", "title": "" }, { "docid": "4e2bdeffd908c4da90acacf9e0704c2e", "score": "0.73057467", "text": "def user_threads_count\n user_threads_lock.syn...
ab8225ed2bfe25b3a0d97c7c73b2a9b1
json objects list the filters as :filters, not :filters_attributes this renames those submitted params so that they will be applied properly by update_attributes
[ { "docid": "206b00210dcc764c1c482d609c88ad37", "score": "0.688811", "text": "def rename_json_fields_to_fields_attributes(target_hash)\n # Grab the fields params out of the full submitted params hash\n if params[\"fields\"]\n to_move = params[\"fields\"]\n elsif params[\"model\"][\"fields\"...
[ { "docid": "b1c362077e19c578628d94dfa17fe24f", "score": "0.7224715", "text": "def filter_attributes=(filter_attributes); end", "title": "" }, { "docid": "e56433ae806582048899711537f4ba81", "score": "0.69664216", "text": "def edit_params\n # TODO: Figure out how to permit filter ...
c33babe8b1cd080b0bf77ca4318b445d
PUT /leave_requests/1 PUT /leave_requests/1.json
[ { "docid": "1dfddbde36eaa1d69b862a3fc47f2290", "score": "0.72400683", "text": "def update\n @leave_request = LeaveRequest.find(params[:id])\n\n respond_to do |format|\n if @leave_request.update_attributes(params[:leave_request])\n format.html { redirect_to @leave_request, notice: 'Leav...
[ { "docid": "645c60eb873fecc482ca3b61bb35ab33", "score": "0.7229147", "text": "def update\n respond_to do |format|\n if @leave_request.update(leave_request_params)\n format.html { redirect_to @leave_request, notice: 'Leave request was successfully updated.' }\n format.json { render ...
6c6d1530db3c21be69b6ca05a5953a47
The monitoree already reported. Give them an update
[ { "docid": "d3e6728db4a80c3d5a57cbe50528d642", "score": "0.6861688", "text": "def already_reported; end", "title": "" } ]
[ { "docid": "b6c9a5cfd10761f893c5744f210ad7ba", "score": "0.6451466", "text": "def notify_new_finding\n # TODO: make the method avoid the creation of a Notification record\n end", "title": "" }, { "docid": "13f9c962c6b0dc87f96633ddacd34c9e", "score": "0.6234575", "text": "def noti...
0f721fde6d88d4f49a2375a0910dc703
GET /produces GET /produces.json
[ { "docid": "bd15b316be6715ce8e9d448ca9c97a33", "score": "0.0", "text": "def index\n @produces = Produce.all\n # 生产任务按工序分类\n @produce_tasks = ProduceTask.joins(:work).where(\"works.sequence > 7\").order(:work_id).group_by(&:work_id)\n end", "title": "" } ]
[ { "docid": "78ee0b4ee909d0e612fffa492b8b9a77", "score": "0.6594876", "text": "def index\n respond_to do |format|\n format.html \n format.json { render :text => get_json }\n end\n end", "title": "" }, { "docid": "e598981c29e12853565f6e9b535bc1ef", "score": "0.6520717", ...
ca478917d0d0583997af6024cbf673ab
DELETE /relationships/1 DELETE /relationships/1.json
[ { "docid": "c2db4739887ee2a2c33b17dc0ded4c11", "score": "0.67751414", "text": "def destroy\n @relationship.destroy\n redirect_to relationships_url, notice: 'Relationship was successfully destroyed.'\n end", "title": "" } ]
[ { "docid": "d53f3eeb5995e971159499020cfb6289", "score": "0.7596125", "text": "def delete_relationship(id)\n @client.raw('delete', \"/config/relationships/#{id}\")\n end", "title": "" }, { "docid": "9fdadb51a9a1808940e8c43e3aa9c552", "score": "0.75204116", "text": "def destroy\n ...
4eafd80393824738916074ebe31dca1a
Get the limit and offset from url
[ { "docid": "bd6d4b831748e146ff4562c1898272f7", "score": "0.66970974", "text": "def limit_offset\n @limit = params[:limit].to_i > 0 && params[:limit].to_i < 30 ? params[:limit].to_i : 30 rescue 30\n @offset = params[:offset].to_i >= 0 ? params[:offset].to_i : 0 rescue 0\n end", "title": "" }...
[ { "docid": "1ff6bfa31818f0ec0e6a2023ba441553", "score": "0.67674196", "text": "def api_offset_and_limit(options=params)\n if options[:offset].present?\n offset = options[:offset].to_i\n if offset < 0\n offset = 0\n end\n end\n limit = options[:limit].to_i\n if limit < 1...
7c15134c70c5757d5b7af939cd1d69a8
AirDrop users of client Author: Pankaj Date: 23/02/2018 Reviewed By:
[ { "docid": "dbe5934adf9fb854c018aaeaa14a9980", "score": "0.54791504", "text": "def airdrop_users\n\n service_response = Economy::AirdropToUsers.new(params).perform\n\n render_api_response(service_response)\n\n end", "title": "" } ]
[ { "docid": "fa2e4f08536e441ef26f7f3796bda1af", "score": "0.6244845", "text": "def created_by\n\t\t\treturn \"Atanas Komsiyski,Aleksandra Nenkova,Stanislav Stoyanov,Reece Tait\"\n\t\tend", "title": "" }, { "docid": "6347cb04635be78fee84ba9e2ad172c4", "score": "0.6102307", "text": "def...
6e30e1ea8647c49cab76681c0766cf36
if it's already in the cache, return it if it's not already in the cache, add it in any case, return it
[ { "docid": "b3ba8c69db62f7e1b03ae9618ff9ad5a", "score": "0.0", "text": "def read_through_cache\n read_cache || load_to_cache\n end", "title": "" } ]
[ { "docid": "c11d4952a64045fd56749cf2b03243cc", "score": "0.69467026", "text": "def add(el)\n element_in_cache?(el) ? update_last_usage!(el) : add_element_to_cache(el)\n end", "title": "" }, { "docid": "1a1ce08785ab08162f915c44135607d6", "score": "0.68052655", "text": "def add(key...
ae207657f42c97585d818ff9272ae867
cleanup temp dir upon exit
[ { "docid": "46911b43f54e87c3126d242168319d66", "score": "0.0", "text": "def do_at_exit\n at_exit do\n FileUtils.rm_rf(settings.data_path)\n Datyl::Logger.info \"Ending Resolver\"\n end\nend", "title": "" } ]
[ { "docid": "e3b23eb9b1120dedc213d78a7758e83a", "score": "0.8404055", "text": "def clean_up\n FileUtils.rm_r @tmp_dir\n end", "title": "" }, { "docid": "c6233b1771ecdfbbf025918ec51cbee2", "score": "0.8264364", "text": "def clean_temp_dir\n if @temp_dir && File.exist?(...
b2d9eeb9a37f22718070a2dc0a721038
Create the directories the generated docs will live in if they don't already exist.
[ { "docid": "86fb86c20bcf58e20954e6840f2dbefe", "score": "0.7291242", "text": "def gen_sub_directories\n @outputdir.mkpath\n end", "title": "" } ]
[ { "docid": "54fd3d0f19478215d9336ac116d2331d", "score": "0.7999038", "text": "def gen_sub_directories\n FileUtils.mkdir_p RDoc::Generator::FILE_DIR\n FileUtils.mkdir_p RDoc::Generator::CLASS_DIR\n rescue\n $stderr.puts $!.message\n exit 1\n end", "title": "" }, { "docid": "54fd...
10216f28e9be7245e40106d8ddaa847c
A private worker method for the update method. Update a single logical mongo_db stanza that can be specified over multiple physical mongo_db stanzas.
[ { "docid": "8a2a1dc5b7fdde955f9a8fd1ee0abb60", "score": "0.6567012", "text": "def update_mongo_db(mongo_db)\n # ensure the mongoDB is logically a singleton. This means all mongoDB config stanzas have the same config id.\n raise \"The mongoDB configuration for service #{@service_name} is incons...
[ { "docid": "2010259cadefde50e17641e1dcda7511", "score": "0.6387102", "text": "def update_db\n # Implement in sub-classes.\n end", "title": "" }, { "docid": "4ec0b89c97aab48750f9a0d1e0616341", "score": "0.6257077", "text": "def updateStudentLanguages(dbName)\n @db = @conn[...
910a71966560100e46aa54cd9dba07d8
returns the authorised items from the array of the same class items for a given action and optionally a user. If user is nil, the items authorised for an anonymous user are returned. All assets must be of the same type and match the asset class this method was called on if filter_by_permissions is true, then as well as...
[ { "docid": "aeaa30415306649514ee09158b3ef01c", "score": "0.75380415", "text": "def authorize_asset_collection(assets, action, user = User.current_user, filter_by_permissions = true)\n return assets if assets.empty?\n user_id = user.nil? ? 0 : user.id\n if Seek::Config.auth_loo...
[ { "docid": "f0aa34cdf87f6ecf61ea706c80ba9452", "score": "0.74795383", "text": "def authorize_asset_collection assets, action, user=User.current_user,filter_by_permissions=true\n return assets if assets.empty?\n user_id = user.nil? ? 0 : user.id\n if Seek::Config.auth_lookup_en...
2da84170484a5c393186099221ddaad5
Wird nur gezeigt, wenn der User noch nicht angemeldet ist
[ { "docid": "333e6798a6fcd21c631cffa7a82c6a0c", "score": "0.0", "text": "def index\n \n end", "title": "" } ]
[ { "docid": "38054aefb8ffd0224ffb6d177f869799", "score": "0.7130203", "text": "def user_have\n unless current_user\n redirect_to root_path, :alert => \"Зарегистрируйтесь или войдите\"\n end\n end", "title": "" }, { "docid": "1d26db666c9a212f52e614ef588ae2c8", "score": "0.70408...
c6b276447e85143b1e1695914a558d47
def create question = Question.new(question_params) if question.save redirect_to root_path else status 406 render :index end end
[ { "docid": "65a2e353a75879399d7b8198ec5d2cc0", "score": "0.9061751", "text": "def create\n @question = Question.new(question_params)\n\n if @question.save\n respond_to do |format|\n format.json { render json: @question.to_json }\n format.html{redirect_to root_path}\n end\...
[ { "docid": "6a5a1a3cacc35c07559d2045feade2a5", "score": "0.8842725", "text": "def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n format.html { redirect_back(fallback_location: root_path) }\n format.json { render :show, status:...
29247c78b81dfd4401975072572efd36
Just to show that everything works TODO: Remove after everything runs well
[ { "docid": "7e417337d671cfe992b09448f3bd21db", "score": "0.0", "text": "def test\n render json: { test: 'Tested.' }\n end", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.6638", "text": "def private; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.6262284", "text": "def probers; end", "title": "" }, { "docid": "07f4aba74008200310213b63a5f3de3f", ...
667fab3674c54c34265aa831d36e718b
DELETE /posts/1 or /posts/1.json
[ { "docid": "40cf30a9dcc9231356a40773562fac90", "score": "0.0", "text": "def destroy\n @post.destroy\n redirect_to posts_url, notice: \"Post was successfully destroyed.\"\n end", "title": "" } ]
[ { "docid": "986a008952e7a38a2e1e1a9d75b2a1f3", "score": "0.7517701", "text": "def delete\n \n #get post specified by id\n @post = Post.find(params[:id])\n end", "title": "" }, { "docid": "75a785bddc2252b3dfe08070dcb44399", "score": "0.75039047", "text": "def delete(args)\n ...
1be3272d32514bc0386b5052fa6e0b48
Return the command's alias or name
[ { "docid": "84c8b59808fca025c36b8ed0ee6ce059", "score": "0.0", "text": "def name\n # Initialize a nil value to something meaningful\n @name ||= ''\n @name\n end", "title": "" } ]
[ { "docid": "fd9b3a8bf337d7265496cdad4ca6517a", "score": "0.7971013", "text": "def command(name)\n @commands.find { |c| c.name_or_alias?(name) }\n end", "title": "" }, { "docid": "b177bab2cfadbcfec497ef68bfcfe1dc", "score": "0.7961926", "text": "def command\n stri...
07a5c3de3c6d39b9c9d2d36540242c8c
Returns a hash with the values for a jqgrid json row.
[ { "docid": "2f0302a1aa0b2c3c25468e646c20dfc1", "score": "0.0", "text": "def row_from_record(r, columns, options)\n attribs = r.attributes\n\n # Localize Date, Time or DateTime fields\n locale_classes = [Time, Date, DateTime]\n if options[:translate].is_a?(Array) && I18n\n ...
[ { "docid": "98c7419ccc3935ff17a94ca75c31294b", "score": "0.71232873", "text": "def hash\n @rows.hash\n end", "title": "" }, { "docid": "8ff7a28be9da2504e7b3381421e67fcd", "score": "0.68739945", "text": "def current_row_as_hash\n data = current_row_as_array\n return nil ...
d2c9ef4f38f0d2d03b1b344a38f75989
was called make_move in chess.rb
[ { "docid": "02325d835ea746ad9d5b1175d74427ca", "score": "0.0", "text": "def move_to_coord\r\n \twhile true\r\n\t start_coord, end_coord = get_user_input\r\n\t chosen_piece = @board[ start_coord[0], start_coord[1] ]\r\n\r\n\t if chosen_piece == \"___\" \r\n\t \tputs \"Please select a non-empty coor...
[ { "docid": "1fc9f17584d8cae1c69402926871e568", "score": "0.7930001", "text": "def move!; end", "title": "" }, { "docid": "be764c2c9e6ea636357553cc312dc474", "score": "0.77772254", "text": "def make_move(_game, piece)\r\n piece\r\n end", "title": "" }, { "docid": "...
f31a3ad502e14f87bc5a851f303cd19d
By now, it returns a tie suggesting a relation from SuggestedRelations to another subject without any current relation Options:: type: the class of the recommended subject
[ { "docid": "9cd2d72f258087f33f3332467342768c", "score": "0.60497713", "text": "def suggestion(options = {})\n candidates_types =\n ( options[:type].present? ?\n Array(options[:type]) :\n self.class.subtypes )\n\n candidates_classes = candidates_types.map{ |t| t.to_s.classify...
[ { "docid": "23b141c3491b5f5056ca529c3b7be7e0", "score": "0.6972033", "text": "def suggestion(options = {})\n candidates_types = options[:type].present? ?\n Array(options[:type].to_s.classify) :\n SuggestedRelations.keys\n\n candidates_classes = candidates_types.map(&:constantize)\n \n...
0e0df32124b9f4734b93ebd009f47cc0
DELETE /posts/1 DELETE /posts/1.json
[ { "docid": "bacd279aad48d93dc56e7eb92c594235", "score": "0.0", "text": "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json do\n render :json => { :notice => \"Snippet deleted\" }\n e...
[ { "docid": "d2938d0d96fc4adb30b185ea6e647cdf", "score": "0.80476254", "text": "def delete\n render json: Post.delete(params[\"id\"])\n end", "title": "" }, { "docid": "f027d5be71066122f716d1cbeb3b697e", "score": "0.76900804", "text": "def destroy\n @post.destroy\n respond_t...
895e5d8a10e4a3f6611ef20d1b55e5cf
=========================================================================== Admin actions ===========================================================================
[ { "docid": "f547500a132be98d4e46b51cfa4fc237", "score": "0.0", "text": "def admin_index\n return if !user_is_allowed('pages', 'view') \n @domain = Domain.where(:domain => request.host_with_port).first\n @home_page = @domain ? Page.index_page(@domain.site_id) : nil\n if @do...
[ { "docid": "db2dfae624d1b925cc4609a18175f5b2", "score": "0.8084573", "text": "def admin\n end", "title": "" }, { "docid": "db2dfae624d1b925cc4609a18175f5b2", "score": "0.8084573", "text": "def admin\n end", "title": "" }, { "docid": "db2dfae624d1b925cc4609a18175f5b2", ...
b4dd6dc71c7bce931080d8865ceca493
PATCH/PUT /circuits/1 or /circuits/1.json
[ { "docid": "b171f7628f4f274bf10da7604fe7b757", "score": "0.7165823", "text": "def update\n respond_to do |format|\n if @circuit.update(circuit_params)\n format.html { redirect_to @circuit, notice: \"Circuit was successfully updated.\" }\n format.json { render :show, status: :ok, lo...
[ { "docid": "28fb175ea6ef63b75ddf826647c3b45f", "score": "0.74550086", "text": "def update\n @circuit = Circuit.find(params[:id])\n\n respond_to do |format|\n if @circuit.update_attributes(params[:circuit])\n format.html { redirect_to @circuit, notice: 'Circuit was successfully updated....
39c3e1b0f22a77051e35d97c0929d0ce
Return the number of rows on the board
[ { "docid": "838cff6ddfc2ac713e725cb8e5625cd5", "score": "0.0", "text": "def rows\n @rows\n end", "title": "" } ]
[ { "docid": "61566e2b4acfde57cd5148cdfbe3ed90", "score": "0.8516378", "text": "def nrows\n @board.length\n end", "title": "" }, { "docid": "accfe3423f2dd579ca934701ced39527", "score": "0.8176621", "text": "def ncols\n @board.first.length\n end", "title": "" }, ...
92bc4ad9fd723bc0e8d8d1a56be7ff34
Sets the cyan (C) component of the CMYK colour as a percentage value.
[ { "docid": "04c9914bbfbbbfe0eb5fe0d6f1d4bbf9", "score": "0.80122477", "text": "def cyan=(cc)\n @c = Color.normalize(cc / 100.0)\n end", "title": "" } ]
[ { "docid": "b2d67252d0e66217bce9d1aa33233978", "score": "0.6810639", "text": "def cyan\n @c * 100.0\n end", "title": "" }, { "docid": "9481355b82ab62cef77de933815a7f26", "score": "0.6405741", "text": "def c=(cc)\n @c = Color.normalize(cc)\n end", "title": "" }, { ...
7c7cf49f425b6a38624bd92f16ec7cad
Create a proposal TODO: Org ID is hardcoded to Fisheries Department in requests, need to use dyn_variable Option: DEFAULT_VALUE 'mode': 'blank'
[ { "docid": "4c5b4100e98ec0f98b6b5714d64f575c", "score": "0.7180879", "text": "def create_proposal(title, oversight_department, admin_org, opts={})\n \n lo_cat = \"Scientific method\"\n lo_cat_text = \"LO Cat Text\"\n \n defaults = {\n :propose_person => '%%_username%%', #user the dyn...
[ { "docid": "63ef004826a00c30e1b29ab49604b258", "score": "0.71671665", "text": "def create_proposal(title, oversight_department, admin_org, opts={})\n \n lo_cat = \"Scientific method\"\n lo_cat_text = \"LO Cat Text\"\n \n defaults = {\n :propose_person => '%%_username%%', #user is the...
9997301f8415b5e44c937aa26691181e
these are bookings that actually happened but are in the past that means the petsitter_acceptance_confirmation is true but the end_date is less than today(the date today is way ahead of the enddate)
[ { "docid": "dd4b868f90044e0984832f72484d8367", "score": "0.6172437", "text": "def past_pet_stays\n\t\tpetowner_of_concern = Petowner.find( params[:id] )\n\t\t@bookings = petowner_of_concern.bookings.where('end_date < ? AND petsitter_acceptance_confirmation = ? ' , Time.now.to_date , true).order(\"start_...
[ { "docid": "696161459df509090f7f01f444ba6ae2", "score": "0.7038625", "text": "def booking_after_today\n\t\tif(start_date < Date.today)\n\t\t\terrors.add(:start_date, \"must not be in the past!\")\n\t\tend\n\tend", "title": "" }, { "docid": "c6bd40fbe0e8901545d24a4cdc39576f", "score": "0....
4401cbf1d206915c3ea05741f2337449
Sets the attribute rate_scale
[ { "docid": "9c958e942126c4ceb15a8a1829d0220d", "score": "0.7409633", "text": "def rate_scale=(_arg0); end", "title": "" } ]
[ { "docid": "d9aaadd880ddc20321e14dbfd26b7854", "score": "0.7723893", "text": "def set_scale(scale)\n @scale = scale\n end", "title": "" }, { "docid": "40e3bbc99ab84b82a3fce90241b8a984", "score": "0.76500064", "text": "def set_RatingScale(value)\n set_input(\"RatingSc...
225b404c4851cb4f9ecc2d1cf6786f0d
F045 Task type: Individual analysis. Individual upload of the file is carried out. It moves to another tab. It returns to a master tab.
[ { "docid": "a5ae798998170ec28fa927e8446fc9aa", "score": "0.5282845", "text": "def test_045\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_pa...
[ { "docid": "cfcdae954c47bb3f811497cb99d9f45c", "score": "0.586427", "text": "def task\n # should improve on this and be less kludgy in the future...?\n # could build a table of experiment_urls in the initializer\n # and then do a lookup into that table by name...\n if @via_turk and not @prev...
8ed00556d4122e3eccfd9b5389522ebd
PUT /users/1 PUT /users/1.json
[ { "docid": "91080c7449cdb6ccfffa15cdfeaab8e1", "score": "0.0", "text": "def update\n @user = current_user\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html {\n flash[:notice] = 'User was successfully updated.'\n redirect_to(:action =...
[ { "docid": "b5edb8a9b2cad14c7874c5f42c5809e9", "score": "0.7438286", "text": "def test_put_user\n json_data = '{\"name\":\"test\", \"last_name\":\"test\", \"document\" : \"098\"}'\n put '/users/4', json_data\n assert_equal 204, last_response.status, 'Código de respuesta incorrecto'\n end", ...
d4a1edaae4d92d004632cf64501ce2e7
DELETE /users/1 DELETE /users/1.json
[ { "docid": "a337aaafc17b3c974af7b446afc149ff", "score": "0.0", "text": "def destroy\n if user_signed_in? && current_user.admin?\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n ...
[ { "docid": "8e69eb3ff3374e0db6fa9eb17958df65", "score": "0.78750724", "text": "def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end", "title": "" }, { "docid": "6f74a32c6fdb67babd4a903e37b5baa4", "score": "0.77518034", "text":...
178d02b5ce585ccfc74807b94c5fdf82
Like IPv4prefix=, this method allow you to change the prefix / netmask of an IP address object. ip = IPAddress("172.16.100.4") puts ip => 172.16.100.4/16 ip.netmask = "255.255.252.0" puts ip => 172.16.100.4/22
[ { "docid": "09fcafb7f06caeec6d1ea5502e3ef6e0", "score": "0.7639196", "text": "def netmask=(addr)\n @prefix = Prefix32.parse_netmask(addr)\n end", "title": "" } ]
[ { "docid": "dbefdce0b6b6ba17aadaba66335cac68", "score": "0.74604535", "text": "def netmask=(val)\n\t\t@ip = mask(@ip, val)\n\t\t@netmask = val\n\tend", "title": "" }, { "docid": "b4f2f5f48e3809f4cc7048866312bc0c", "score": "0.742633", "text": "def netmask\n @network_conf[:mask] ...
06e0647bfddec7a338c06148f9408f9b
Generate 0 to 5 addresses for each user, picking one for default billing & one for default shipping; randomize ZIP codes
[ { "docid": "2c2cf69893d67f0aad61c52830fdabec", "score": "0.60247517", "text": "def generate_user_orders\n User.all.each do |user|\n\n # Assume 80% of users have placed orders\n if rand < 0.8\n generate_addresses(user)\n generate_cards(user)\n generate_orders(user)\n ...
[ { "docid": "4c046b8ec479a549097115b2dee78fbf", "score": "0.8587876", "text": "def generate_addresses(user)\n rand(1..5).times do\n a = Address.new\n a.first_name = user.first_name\n a.last_name = user.last_name\n a.street_address_1 = Faker::Address.street_address\n a.street_a...
802b08074edea61036ec57b490059dee
metodo que multiplica dos matrices (Sobrecarga del operador )
[ { "docid": "acaebd997717345e6ade6e086fffeaf6", "score": "0.6816941", "text": "def *(other)\n # Han de coincidir el numero de columnas de una con el numero de filas de la otra\n raise ArgumentError , 'Las matrices no se pueden multiplicar debido a sus dimensiones (A.col == B.fil)' unless @ncol == oth...
[ { "docid": "5554b267ca9c5fe285b16de1effcd962", "score": "0.78140163", "text": "def *(other)\r\n #Si el multiplicador es una constante numerica, es decir, un escalar se multiplica miembro a miembro de la matriz\r\n if(other.is_a? Numeric)\r\n c = Array.new(@m){Array.new(@n){0}}\r\n for i i...
939185706611b2efc4ce5eca85f45af1
DELETE /autos/1 DELETE /autos/1.json
[ { "docid": "7d924a09c1d7993e76d93befcf37e70d", "score": "0.7032528", "text": "def destroy\n @auto.destroy\n respond_to do |format|\n format.html { redirect_to autos_url, notice: 'Auto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ...
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.69992703", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "5fce1db2d1ed9aeccca516d7fdcb3a76", "score": "0.0", "text": "def gongjijin_params\n params.require(:gongjijin).permit(:single_customer_id, :account_no, :workflow_state)\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...
5439550fab5acd1118c78d7420e3f58a
Takes two ordered arrays and combines them in nondecreasing order
[ { "docid": "dc3fe230d370aa0b89e0aab688a6fd6e", "score": "0.0", "text": "def merge(left, right)\n result = []\n\n while !left.empty? && !right.empty?\n if left.first <= right.first\n result << left.shift\n else\n result << right.shift\n end\n end\n #...
[ { "docid": "f129e0ed934c106097bfb36ab0411547", "score": "0.7833805", "text": "def combine_arrays(arr1, arr2)\n\tcombo = arr1 + arr2\n\tswapped = true\n\n\twhile swapped\n\t\tswapped = false\n\t\t(combo.length-1).times do |i|\n\t\t\tif combo[i] > combo[i+1]\n\t\t\t\tcombo[i], combo[i+1] = combo[i+1], com...
eebdd2ebaf87273801352e518d83b661
GET /product_lines/1 GET /product_lines/1.xml
[ { "docid": "7ff5c818c4105621c2679a5a2cc0f966", "score": "0.7439965", "text": "def show\n @product_line = ProductLine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @product_line }\n end\n end", "title": "" } ]
[ { "docid": "efb6a1ac400aad773e50c95d93726f94", "score": "0.6990373", "text": "def show\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @line_item }\n end\n end", "title": "" }, { "docid": "34...
1ee19246a9ebb797a8f3ea869671d3c9
Update a user's CallForwarding
[ { "docid": "d5fe3be67db0cb031ef1e89537885208", "score": "0.6472699", "text": "def put_user_callforwarding(user_id, body, opts = {})\n data, _status_code, _headers = put_user_callforwarding_with_http_info(user_id, body, opts)\n return data\n end", "title": "" } ]
[ { "docid": "c56de9fcd04e15e9aca9dd6922c7bd1d", "score": "0.6588306", "text": "def update_forward(username, forward_to, action=\"KEEP\", enable=true)\n msg = EmailMessage.new\n msg.update_forward(forward_to, enable, action)\n response = @apps.request(:update_forward, user...
757879fbd2b1ace9db777b642771688d
GET /oai_recs GET /oai_recs.json
[ { "docid": "590918d5fa53ad1adc665396861caf02", "score": "0.7492908", "text": "def index\n @oai_recs = OaiRec.all\n end", "title": "" } ]
[ { "docid": "35b40fdb0efeec210d94d5f3c241bb8f", "score": "0.661035", "text": "def index\n @oaipmh_records = OaipmhRecord.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @oaipmh_records }\n end\n end", "title": "" }, { "docid": "b4...
f4343d6c2651a38f598ff6bca86ebcb3
Initializes various data for a Unix_procobject. This should not be called manually but through "Unix_proc.list".
[ { "docid": "21a2e70e9d14f9010120260d03328233", "score": "0.0", "text": "def initialize(data)\n @data = data\n end", "title": "" } ]
[ { "docid": "0044d84cdf189e48ac693ee1dd207870", "score": "0.6109399", "text": "def initialize(args = {})\n @args = args\n @objects = {}\n \n #These variables are used to free memory in the subprocess, by using ObjectSpace#define_finalizer. The Mutex is the avoid problems when writing to the f...
64c04df4982ad5b9d171fc18fba6200c
Used in the user key show page to indicate whether or not the key has expired.
[ { "docid": "146567931138f1767b1e3793e334a2bc", "score": "0.68084466", "text": "def expired?\n return false if self.time_expired.nil?\n return self.time_expired < Date.today\n end", "title": "" } ]
[ { "docid": "bf1949235ef30b91590bff9d289e9a34", "score": "0.7613229", "text": "def expired?(key)\n @data_expires_at[key] < Time.now.to_f\n end", "title": "" }, { "docid": "e60899c1bafd9426e737206376da03ca", "score": "0.75254095", "text": "def is_key_expired?(key)\n #calling...
7695029de42d664f35628fb88ce0374e
Structmembers struct.members => array Returns an array of strings representing the names of the instance variables. Customer = Struct.new(:name, :address, :zip) joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345) joe.members => ["name", "address", "zip"]
[ { "docid": "39c2ef2a3b2874a598889f27f11f64dc", "score": "0.53837943", "text": "def members\n end", "title": "" } ]
[ { "docid": "cd2775b34c1aa7ac711ddac0a21f5a60", "score": "0.7744137", "text": "def test_Struct_InstanceMethods_member\n\t\tjoe = Customer_New2.new(1,1,1)\n\t\tassert_equal([:name,:address,:zip], joe.members)\n\tend", "title": "" }, { "docid": "ab8424099eb199925c627b8cc4c1af6a", "score": "...
aa4ec19ac43cd540f09facbde9c9341a
Indicates conciliation based on the type of account
[ { "docid": "e1c0e8c1116529598eb2571b6cee15db", "score": "0.59838575", "text": "def get_status\n if verification? && account_to.is_a?(Bank)\n 'pendent'\n else\n 'approved'\n end\n end", "title": "" } ]
[ { "docid": "e779546e11ef479c0bcefb52c603a7c0", "score": "0.67678225", "text": "def account_type\n count = User.where.not(schedule_id: nil).where(organization_id: id).count\n\n count > 1 ? IntercomAccountTypes::ENTERPRISE : IntercomAccountTypes::INDIVIDUAL\n end", "title": "" }, { "doc...
3c0cea336c723962096a695126867d0f
Provide a detailed, user friendly representation
[ { "docid": "d55ed9c8b3f6a4dcb40019451242faa0", "score": "0.0", "text": "def inspect\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Taskrouter.V1.WorkspaceCumulativeStatisticsContext #{context}>\"\n end", "title...
[ { "docid": "7bea0b559c41a5f338754e1c5f53f1cb", "score": "0.7074551", "text": "def details \n\t\t\"#{self.id} - #{self.name.capitalize}\"\n\tend", "title": "" }, { "docid": "6143c330d598497e31bfa9b9f780219e", "score": "0.7009431", "text": "def detail\n\t\t\t\to = ''\n\t\t\t\to += \" ...
e802786feff37e4f5c50333720c68b7a
GET /articles GET /articles.xml
[ { "docid": "d245ae8f774ca1293a937c6f9bdebff9", "score": "0.0", "text": "def index\n @channel, @articles = find_articles(params[:channel_id])\n\n respond_to do |format|\n format.html { render :layout => 'admin' } # index.html.erb\n format.xml { render :xml => @articles }\n format.js...
[ { "docid": "9b2ae244078a489c28d52b4984ce970f", "score": "0.7521566", "text": "def index\n @articles = Article.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @articles }\n end\n end", "title": "" }, { "docid": "804c6c1f3...
f622da651040622c082427fb11de7193
function to verify idno and vcode
[ { "docid": "c4e2d76e1406301e23b68a8b6d99be82", "score": "0.78743833", "text": "def verify?(idno, vcode)\n if idno==''|| vcode==''\n flash[:error]=\"Fields can not be blank\"\n return false\n end\n\n #check if student exists\n student = Profile.find(idno)\n if student.id==3 #prem...
[ { "docid": "1f0dade2dcb475838cb4e3ac5cbe5ccb", "score": "0.77808607", "text": "def verify?(idno, vcode)\n if idno==''|| vcode==''\n flash[:error]=\"All fields are required.\"\n return false\n end\n\n #check if student exists\n begin\n student = Profile.find(idno)\n if stu...
fd51a1cee6e34f81857ad71235cdedce
Say hi to everybody
[ { "docid": "533d008409a840a24c8bcdd3d6818b87", "score": "0.0", "text": "def say_hi\n # It now looks at the @names instance variable to make decisions. \n # If it’s nil, it just prints out three dots. No point greeting nobody, right?\n if @names.nil?\n puts \"...\"\n # If the @names obje...
[ { "docid": "85391f60a1858647d71409b56ea78615", "score": "0.75231713", "text": "def greet\n self.say \"Hello, I am #{@config[:nick]}. I am the resident uber-bot. To learn more, type '.about'.\"\n end", "title": "" }, { "docid": "1b5c790977e3af47f3c31feb277dda47", "score": "0.7...
03266a2391abe2b1317463dc97138c3c
Extracts a list of all usersnames mentioned in the Tweet text along with the indices for where the mention ocurred. If the text is nil or contains no username mentions, an empty array will be returned. If a block is given, then it will be called with each username, the start index, and the end index in the text.
[ { "docid": "351465e07e06ac0046f6a7c645c805d2", "score": "0.78261554", "text": "def extract_mentioned_screen_names_with_indices(text) # :yields: username, start, end\n return [] unless text\n\n possible_screen_names = []\n text.to_s.scan(Twitter::Regex[:extract_mentions]) do |before, sn, a...
[ { "docid": "480982d0bb22a2edc384a2678b4fad4b", "score": "0.79259527", "text": "def extract_mentioned_screen_names(text, &block) # :yields: username\n screen_names = extract_mentioned_screen_names_with_indices(text).map{|m| m[:screen_name]}\n screen_names.each(&block) if block_given?\n scr...
403979c83890e4c5a416c5d27ba94b4c
Check to see if anybody has rated (liked or disliked) this object
[ { "docid": "c53c86c222c550d004ef83abcecbc6d6", "score": "0.82344824", "text": "def rated?\n liked_by_count > 0 || disliked_by_count > 0\n end", "title": "" } ]
[ { "docid": "4c877e580639dc72ec50c0ee6963ba5b", "score": "0.79425925", "text": "def rated_anything?\n likes.count > 0 || dislikes.count > 0\n end", "title": "" }, { "docid": "3143be19530cad529581fa6b0516da6c", "score": "0.7045536", "text": "def can_rate?(person)\n perso...
1db979a966942d4128ebab000cb558d6
hooks are asynchronous processes that are external to our system. we can't just execute tests in sequentially and expect everything to keep up, we have to wait for external services to complete their API calls to us
[ { "docid": "d95abcfeb7be672408bd7a8ec59fd4ef", "score": "0.0", "text": "def wait_for_webhook(goal: 1)\n wait_for_action_invocation(Internal::SftpgoController, :hook, goal:)\n end", "title": "" } ]
[ { "docid": "19bf6430e3db397d84d74ba75e0fa86d", "score": "0.6535948", "text": "def setup\n setup_job\n setup_hook\n end", "title": "" }, { "docid": "b21cc775d3bb8f607b847da351e42ec6", "score": "0.6468549", "text": "def with_hooks\n run_around_hooks do\n run_be...
ecafb3171a2e9c7a6cef3f4f11dfc81d
Start accession on an object (start specified workflow, assemblyWF by default, and version if needed)
[ { "docid": "3ea0e8e0a7b4b0ec387110f9867e02dc", "score": "0.0", "text": "def start(params = {})\n resp = connection.post do |req|\n req.url path\n req.params = params\n end\n return true if resp.success?\n\n raise_exception_based_on_response!(resp...
[ { "docid": "66740f0a9abbbad7c0f377f0df7c7b51", "score": "0.67696136", "text": "def start_the_wf\n self.workflow_action = \"start\"\n trigger_workflow \n end", "title": "" }, { "docid": "a4acc1449a2cdbbc74e3cec09f6a8166", "score": "0.64613765", "text": "def start(workflow_defin...
78c5ffe8a73b187a894de553dee4f237
POST /text_messages POST /text_messages.xml
[ { "docid": "3c7e06b9043c1a871b53c0928560b676", "score": "0.61252785", "text": "def create\n @text_message = @profile.text_messages.build(params[:text_message])\n\n respond_to do |format|\n if @text_message.save\n flash[:notice] = 'TextMessage was successfully created.'\n format....
[ { "docid": "e18d18e71266c27bcbba27d76e6fe2b4", "score": "0.66470283", "text": "def post(content)\n post_to(\"/api/v1/messages/\", {:body => content})\n end", "title": "" }, { "docid": "b6ed71ca8e6c861e16075e894c0e652b", "score": "0.6454137", "text": "def message(user, text)\n ...
8e165ae42d6b7939b4e42c624009e3fc
Read a boolean value.
[ { "docid": "8609e51bce2168ab0a90553bdbff7389", "score": "0.79706436", "text": "def read_bool\n token = @reader.read_uint8\n case token\n when 0\n false\n when 1\n true\n else\n raise ::EncodingError, \"unknown BGV boolean value 0x#{token.to_s...
[ { "docid": "34e8d2032d95c6755867e34204a5d17e", "score": "0.8676041", "text": "def read_bool\n b = read( 1 ) or return nil\n b[0] != 0\n end", "title": "" }, { "docid": "8136aeb260a693400546f4c3c16fb494", "score": "0.8659056", "text": "def read_boolean\n ...
8e5ee61af0a6717fe7156a3398ccc804
POST /child_pics POST /child_pics.json
[ { "docid": "71a933394f2181251057546c4d218da2", "score": "0.680899", "text": "def create\n @child_pic = ChildPic.new(child_pic_params.merge({sender_id: @current_user.id}))\n\n respond_to do |format|\n if @child_pic.save\n format.html { redirect_to :home, notice: 'Das Foto wurde gespeich...
[ { "docid": "df2eae888bd999006aac62cbe29f2db1", "score": "0.70022947", "text": "def child_pic_params\n params.require(:child_pic).permit(:image)\n end", "title": "" }, { "docid": "a7434c937fe2dc4952bab66d811be4ab", "score": "0.665265", "text": "def set_child_pic\n @child_...
c6ff39210ec62edc74f0983b5a5eaea5
PATCH/PUT /comapanies/1 PATCH/PUT /comapanies/1.json
[ { "docid": "cc3b0730aa197b2a5bd64262aed5272a", "score": "0.63022906", "text": "def update\n respond_to do |format|\n if @comapany.update(comapany_params)\n format.html { redirect_to @comapany, notice: 'Comapany was successfully updated.' }\n format.json { render :show, status: :ok,...
[ { "docid": "1c35f89f4e93251128bbf53c08021b3d", "score": "0.6470713", "text": "def update\n @company_id = company_params[:company_id]\n @reponse = HTTParty.put(\"https://rails-api-ipo.herokuapp.com/api/v1/companies/#{@company_id}.json\",\n :body => {:company_name => company_params[:company_name]...
27b8e92c0ae0ddcc56d1244213598eb9
recalculates the patient and stores the information for the given measure and population within the patient model. NOTE: this method assumes that the calculator has already been setup with the measure and population index.
[ { "docid": "4207acd4e6c0024aafb805b43fadda24", "score": "0.73018783", "text": "def update_calc_results!(measure, population_set_index, calculator)\n # 'rationale' and 'finaleSpecifics' used for logic coloring. 'values' is the stored result for 'OBSERV'\n # on continuous variable measures.\n pop...
[ { "docid": "c811087a09481c993e9d50a3fd033669", "score": "0.6886924", "text": "def calculation_results (measure) \n # Remove any calc results and related fields that might have been loaded.\n # We want to ensure that any results used in the testing are those generated by the test\n # as opposed ...
54eb8eaee4425a6a15133f56eb7e8ab5
Method that searches the owned notifications for those not yet sent
[ { "docid": "c82e7c384501da553dd60357d57081e7", "score": "0.7315974", "text": "def find_pending\n notifications.where sent: false\n end", "title": "" } ]
[ { "docid": "3e4546d50ce5e7f6733be4eb1b61392c", "score": "0.68771297", "text": "def unread_unsent_notifications\n @unread_unsent_notifications ||= notification.class.for_target(notification.target)\n .joins(:deliveries)\n .where.not(id: notification.id)\n .where('notify_user_not...
ae1b3590bb7c7ba8af29b6aeb6c756ef
Destroys the central repository. Shuts down any server processes and deletes the repository. WARNING: calling this may result in loss of data. Only call this if you really want to wipe it out for good!
[ { "docid": "e0329c886448a4ea434d1299308c9cc7", "score": "0.5894592", "text": "def destroy_central\r\n raise NotImplementedError\r\n end", "title": "" } ]
[ { "docid": "618964cc9c7e472bb29c06f663b4f8b7", "score": "0.8091687", "text": "def destroy\n @repository.destroy # use the repository object to destroy itself/directory\n end", "title": "" }, { "docid": "bddc562f99346165e9c17ce163417866", "score": "0.73302346", "text": "de...
522e0da0bf8bf968202c04b2a6134da6
Perform the quorum's methodology using the given characteristics.
[ { "docid": "2c3035e3b0f0dd28eb680b341d3b9cdb", "score": "0.5247409", "text": "def acknowledge(characteristics, considerations)\n Leap.instrument.quorum name do\n considerations.unshift characteristics\n process.call(*considerations[0...process.arity])\n end\n end", "title"...
[ { "docid": "36f049ae4e05a45bb17b86bbd8827934", "score": "0.51464", "text": "def report(characteristics, considerations, options = {})\n Leap.log.committee \"Convening committee\", name\n quorums.each do |quorum|\n Leap.log.quorum \"Assessing quorum\", quorum.name\n next unless qu...
ed2718784208be7eb2ee17fa5624873b
Returns the number of working minutes left in the current hour
[ { "docid": "da94225cf63cc819d6f877d0a45a2320", "score": "0.73615456", "text": "def minutes_left_in_hour(start)\n return @values[start.hour].wp_diff(start.min,60)\n end", "title": "" } ]
[ { "docid": "b8f5d2666b4c95010d0812585e9992ff", "score": "0.71381444", "text": "def time_worked_in_hours\n return 0 if self.end_time.nil?\n return ((self.end_time.hour * 60 + self.end_time.min) - (self.start_time.hour * 60 + self.start_time.min)) / 60\n end", "title": "" }, { "docid": ...
ee600347110a236b27b6a6b8bd987592
[hycoverride] allow object_name to be passed down
[ { "docid": "64528566f19e13ce2acf2f3d5f914c3c", "score": "0.0", "text": "def object_metadata(data, object_name = nil)\n data = data.map { |d| eval(d) }.flatten # rubocop:disable Security/Eval\n\n data.each_with_index do |obj, index|\n next if obj.nil?\n # allow the object_key to be valid ...
[ { "docid": "3ac2f0031eb83db279b9f377b9d01e37", "score": "0.7481236", "text": "def object_name\n @object_name ||= object.is_a?(Symbol) ? object : object.class.to_s.underscore.gsub('/', '-')\n end", "title": "" }, { "docid": "4a9cf7ece6c1939dff63b67155baf055", "score": "0.74604756", ...
3abe41a297533bb2444793919ff1204f
Compares self Color with a given one
[ { "docid": "5537b04e2a7c545032a3c3ea606daaf4", "score": "0.62661016", "text": "def compare_with(o_color, params = {})\n\t\t\t@method = params[:method] if params[:method] && METHODS.include?(params[:method])\n\t Euclidean.calculate(self, o_color) if @method == :euclidean\n\t\tend", "title": "" }...
[ { "docid": "2b1ca22861c87991aa6b93d15f8bd67f", "score": "0.74573267", "text": "def ==(other_color)\n other_color = Colorist::Color.from(other_color)\n other_color.r == self.r && other_color.g == self.g && other_color.b == self.b\n end", "title": "" }, { "docid": "00027e2d6adf0ae...
3e659df933a847c862ea1492a06f7bb3
Called when the connection was successfully established.
[ { "docid": "7e755a7d4fb29fcfcd086d09c006074f", "score": "0.0", "text": "def connected!\n @waiting_for_cap = true\n @capabilities.clear\n\n transmit :CAP, 'LS'\n transmit :PASS, @options['password'] if @options['password']\n transmit :NICK, @options['nickname']\n transmit :U...
[ { "docid": "76f838c70d423d70e47e2e8a9b34198d", "score": "0.8136386", "text": "def connection_successful\n @callbacks[:connect].call(self) if @callbacks[:connect]\n end", "title": "" }, { "docid": "a44884cd536dd200b32a70a80f8f2e77", "score": "0.7680247", "text": "def conne...
14488a4868ed43078836e409c5f92239
GET /service_providers GET //service_providers.json
[ { "docid": "3c6fe43579354ba1c45464c138914203", "score": "0.0", "text": "def report_review\n # load report\n @report_html_hash = Hash.new\n\n @service_providers_paged.each do |service_provider|\n @report_html_hash[service_provider.id.to_s] = service_provider.report_html_as_google_chart(get...
[ { "docid": "bcaae81335b2a9f77a59f5b7102d2baf", "score": "0.705199", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @service_providers }\n end\n end", "title": "" }, { "docid": "493f936c49f2ca69dfc085b52c0513ba", ...
da9a49dcab0275d7375d81d37d38fb10
Returns the value of attribute exception. source://shouldamatchers//lib/shoulda/matchers/action_controller/rescue_from_matcher.rb72
[ { "docid": "f5cc358536014ae4f00727558d578b6f", "score": "0.0", "text": "def exception; end", "title": "" } ]
[ { "docid": "15052920f6407d135f216756a074f9c5", "score": "0.6292082", "text": "def value\n raise\n end", "title": "" }, { "docid": "024cf34505364436b73e9df5cb8b6b31", "score": "0.5914376", "text": "def __value\n unless defined?(@value)\n __get_value\n en...
73cff53ebd1f7ed5845b8ac9149aed42
Hardcoded default connection name
[ { "docid": "6c1311d8d227d63dcdfe9a884e55cfc6", "score": "0.7559036", "text": "def default_connection_name\n 'Episodic::Platform::Base'\n end", "title": "" } ]
[ { "docid": "a6de15123aee4d710700e11623e1f809", "score": "0.786655", "text": "def default_connection\n connections[default_connection_name]\n end", "title": "" }, { "docid": "d2114a594b276d7743f4093acee4a115", "score": "0.7684295", "text": "def default_connection=(...
67fae163579561871a6afb7bf9acb0d8
give a seperate redis connection to the same database but use the hiredis driver to stop errors about the evma server
[ { "docid": "288b4f493922cb643500ecffddc86c99", "score": "0.7992108", "text": "def redis_connection\n Redis.new driver: :hiredis, db: 13\nend", "title": "" } ]
[ { "docid": "0cd200d68855366f07ee11c8d267d284", "score": "0.7378582", "text": "def connect_to_redis(&block)\n require 'eventmachine'\n require 'em-hiredis'\n run_the_eventmachine(&block)\n setup_em_exception_handler\n end", "title": "" }, { "docid": "37f782a9c1c03182219...
ab31bebeb2994f60f21766ef8244256c
After forces yielding before transformation
[ { "docid": "e0cc22d63abf9b1b5672af7d8f4eed65", "score": "0.0", "text": "def apply(transform)\n Proc.new do |object, &block|\n transform.call block.call(object)\n end\n end", "title": "" } ]
[ { "docid": "29746e02e06d7c21ac462f280ad1e94a", "score": "0.64878637", "text": "def apply_force(force, offset); end", "title": "" }, { "docid": "29746e02e06d7c21ac462f280ad1e94a", "score": "0.64878637", "text": "def apply_force(force, offset); end", "title": "" }, { "docid...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "debad9d2d9983f563f5ffb135f7d094a", "score": "0.0", "text": "def car_brand_params\n params.require(:car_brand).permit(:name, :initial, :logo)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
7b2bae1aaf0fe0fe6125f230ef9310c2
search for requesting pickup
[ { "docid": "428d838c844409759b8e39ed36bbf30c", "score": "0.0", "text": "def index_pick_up\n @requests = Request.where(status: \"request_pick_up\")\n end", "title": "" } ]
[ { "docid": "1f407d3d6bb33cbc644d9c0a20ea7b72", "score": "0.6028507", "text": "def pickup\n end", "title": "" }, { "docid": "01119a29f4a7f8e718e80c22f036132f", "score": "0.5992402", "text": "def pickup_params\n params[:pickup]\n end", "title": "" }, { "docid": "d3...
f4837cd024726e570ea7cd51c985e606
Get method which runs requests and optionally sleeps if necessary based on ratelimiting
[ { "docid": "d96fcef3fb576b3fa70e81046cbe2981", "score": "0.56064874", "text": "def get(uri)\n request = Net::HTTP::Get.new uri\n request.basic_auth(@username, @password)\n response = Net::HTTP::start(uri.host, uri.port, use_ssl: true) do |http|\n http.request request\n end\n ...
[ { "docid": "212ecaef8f8ec81dc6de8ab600c6d9f7", "score": "0.6844796", "text": "def call(options: {})\n request_available = @rate_limiter.await_request(10)\n raise RateLimitError unless request_available\n raw_response = execute_request(@request, options: options)\n parsed_response = parse(raw...
b951a87e57c6b171bb775a08f54ab937
Checks if the word is validate.
[ { "docid": "4169ad65aefeb3f9a3368b804d069770", "score": "0.68348694", "text": "def check?(word)\n Hunspell.Hunspell_spell(self,word.to_s) != 0\n end", "title": "" } ]
[ { "docid": "029ac41226e475cda7664cc0c2c2c9a3", "score": "0.7249258", "text": "def check_word(word)\n valid_words.include?(word)\n end", "title": "" }, { "docid": "73ce32be915155880aa8e98e5519d5dd", "score": "0.72333753", "text": "def validate_word_match\n if valid_word?(@wor...
d142b90f69b465724bf553bd91ccf89b
destroy is for controllers and models delete is for URLs
[ { "docid": "3c2893139d0320253e77992a70a1e245", "score": "0.0", "text": "def destroy\n role = project.roles.find(params[:id]) # make sure roles is plural\n if role.destroy\n flash[:notice] = 'The role was destroyed'\n else\n flash[:alert] = 'The role could not be destroyed'\n end\n...
[ { "docid": "dc7978b571fa1af94fbce826dcf38dc1", "score": "0.80218124", "text": "def destroy; delete end", "title": "" }, { "docid": "6bb3a558b061c5cc40b1cd6dc1938a35", "score": "0.78622097", "text": "def destroy\n\n end", "title": "" }, { "docid": "6bb3a558b061c5cc40b1c...
dd992601e0be0c5e55ece68d0ffc8456
Return the role the invitation is asking for. We can ask for management of a task, or beeing a guest of an event.
[ { "docid": "b5e5798fb0bd180a4c0cd91fb13159df", "score": "0.7248814", "text": "def role\n if task.subclass_name == \"event\"\n return :guest\n else\n return :manager\n end\n end", "title": "" } ]
[ { "docid": "37e42350c995302e4a1cd338030055d4", "score": "0.73593855", "text": "def role\n if @collaboration\n if @collaboration.attributes[:status] == \"accepted\"\n \"collaborator\"\n else\n \"(invited)\"\n end\n else\n \"owner\"\n end\n e...
77cdbb40edb2f3bfc8903e3a1eab93af
returns all groups with the given parent group uuid. if name is not blank, then only the children matching the name will be returned.
[ { "docid": "e845b0e4c2f098de13f56ea9ee7d91c6", "score": "0.788824", "text": "def get_groups_by_parent parent_group_uuid\n parent_group_uuid = parent_group_uuid.uuid if parent_group_uuid.is_a?(Group)\n \n @resources.find_all{|res|res.parent_uuid == parent_group_uuid && (name.blank? || ...
[ { "docid": "459afc387906919295b3c493889f82b4", "score": "0.64803606", "text": "def parent_groups(group_id=nil) \n # {{{\n groups = []\n group_id ||= user_group_id\n return groups unless group_id && group_id > 0\n \n parents = User_Group_Hierarchy.select { |e| \n e....
23ffbe69e4b310921d5b65b090a62893
Returns, depending on direction, the relation key
[ { "docid": "d4f7f8deabb0cc4ee38887b350d43c66", "score": "0.63885444", "text": "def key(direction = nil)\n case direction.try :to_s\n when nil then \"#{start_node_id}:#{label}:#{end_node_id}\"\n when 'out' then \"#{start_node_id}:#{label}:out\"\n when 'in' then \"#{end_node_id}:#{l...
[ { "docid": "619f42d12f525d8914e78d1346b27a45", "score": "0.8320469", "text": "def relation_key\n self[:relation_key] || name.to_s\n end", "title": "" }, { "docid": "cc7e8ceddb3e156c80482b3d09af7741", "score": "0.7097198", "text": "def relation_foreign_key(relation)\n ...
5c89fe975b7b05dcf27eb6caad93a78c
POST /po_affiliation_statuses POST /po_affiliation_statuses.json
[ { "docid": "a1afea1d79beb2744144b8cdd416f25d", "score": "0.6675157", "text": "def create\n @po_affiliation_status = PoAffiliationStatus.new(po_affiliation_status_params)\n\n respond_to do |format|\n if @po_affiliation_status.save\n format.html { redirect_to @po_affiliation_status, noti...
[ { "docid": "2ab480d8debcb3f31538d676a662114f", "score": "0.6789791", "text": "def index\n @po_affiliation_statuses = PoAffiliationStatus.all\n end", "title": "" }, { "docid": "163c759cc0b62b474fdf22a5f13477c0", "score": "0.64550793", "text": "def set_po_affiliation_status\n ...
17efae0eeab8163fcec945a69d0e6c89
GET /time_cards GET /time_cards.json
[ { "docid": "492e1edb9d3c4e8995b0bae9b54fcdaf", "score": "0.7517845", "text": "def index\n @time_cards = TimeCard.all\n end", "title": "" } ]
[ { "docid": "e7055fc0f85145158110595cf508c1da", "score": "0.6913936", "text": "def index\n card_list = Rails.cache.fetch 'cards', expires_in: 1.hour do\n generate_card_list\n end\n render json: card_list\n end", "title": "" }, { "docid": "bba422b10f526cab85668dd4efab7...
b6bfa75cf5c566660d5cd7e3fdf48cc6
Returns a morpheme with the given label and of the given type. The constructor makes a duplicate of the label, and then freezes it, so that the label cannot be altered later. The morpheme object itself is also frozen upon construction.
[ { "docid": "b38ffa0ad5698fa93ede8fd0b3c4f1c8", "score": "0.7728008", "text": "def initialize(label, type)\n @label = label.dup\n case type\n when ROOT, PREFIX, SUFFIX\n @type = type\n else\n raise \"morpheme type parameter is not a valid morph type.\"\n end\n freeze\n @lab...
[ { "docid": "b832aed2e06f3b2dfd03567595b562de", "score": "0.55618876", "text": "def get_morpheme(key = '')\n return make_syllable if self.nomorph\n\n # make_word will sometimes pass in nil\n if key.nil? \n key = ''\n end\n\n # Use the morphemes we've already ...
5fc9e2a898e76648036a45437a6e7fcc
Unposts all amenities for a unit or property by posting an empty list to the batch update endpoint.
[ { "docid": "90f3c2c7da866df0c5225a46dcf55248", "score": "0.6588231", "text": "def unpost_amenities_for(object)\n case object\n when Rentlinx::Unit\n post_amenities_for_unit_id(object.unitID, [])\n when Rentlinx::Property\n post_amenities_for_property_id(object.propertyID, []...
[ { "docid": "d0dc468f555d138931c3883df97d6018", "score": "0.5721049", "text": "def unpost_amenity(amenity)\n case amenity\n when Rentlinx::UnitAmenity\n unpost_unit_amenity(amenity.unitID, amenity.name)\n when Rentlinx::PropertyAmenity\n unpost_property_amenity(amenity.proper...
031ba9ee699c020e9b823a9720334a02
Prepends a marker "=>" or an empty marker to the +line+.
[ { "docid": "2b764bc36f019569515790a85293bc5f", "score": "0.6700336", "text": "def add_marker(marker_lineno)\n tuple[0] =\n if lineno == marker_lineno\n \" => #{ line }\"\n else\n \" #{ line }\"\n end\n end", "title": "" } ]
[ { "docid": "1c43caa1ab6a5803c5b23f3f9b8de85a", "score": "0.6566948", "text": "def line=(_); end", "title": "" }, { "docid": "1c43caa1ab6a5803c5b23f3f9b8de85a", "score": "0.6566948", "text": "def line=(_); end", "title": "" }, { "docid": "1c43caa1ab6a5803c5b23f3f9b8de85a",...
4f57266ec1477d162321f7c2f77c32ee
Collect a list of parent categories Each category the monkey stops as he climbs up the tree Compliments of DHH
[ { "docid": "d39b33406231ef82fb088a92516dc017", "score": "0.0", "text": "def ancestors\n node, nodes = self, []\n nodes << node = node.parent while node.parent\n nodes\n end", "title": "" } ]
[ { "docid": "01805187060a66948d264bf69e028b1d", "score": "0.826397", "text": "def parent_categories\n c = self\n categories = []\n until c.parent.blank? do\n c = c.parent\n categories.unshift c\n end\n categories\n end", "title": "" }, { "docid": "fea8cb211385135624f...
aeab6c07baf8bfefe04edf49acf455d9
GET /hackers GET /hackers.json
[ { "docid": "9951cf2bbd1b17ae104c32cdf6242764", "score": "0.5146955", "text": "def index\n # Never show a hacker list.\n redirect_to entries_path\n end", "title": "" } ]
[ { "docid": "71c3730a64189c767ea3c4569bc71f96", "score": "0.71273506", "text": "def show\n @hacker = Hacker.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hacker }\n end\n end", "title": "" }, { "docid": "8fefc2512f...
fd25aecfe1ef8b47cbfa9245c6a6cbe4
contains?(value) returns true if the passed in value is in the list and otherwise returns false.
[ { "docid": "ef618e646d09121a3aca18529bdc506c", "score": "0.7109332", "text": "def contains?(value)\n ObjectSpace.each_object(Node) do |obj|\n true if value == obj\n end\n end", "title": "" } ]
[ { "docid": "540b0c435fb4f0bda27ac7db9254c417", "score": "0.8120781", "text": "def contains(value)\n end", "title": "" }, { "docid": "728e0969e68f04f0299a0fec72356334", "score": "0.78342354", "text": "def contains?(value)\n return err_empty_list if @head.nil?\n\n find(value).ni...
e8d73b7741c550062162b79b8b106ca0
Return the index of the Pokemon who can learn or has learn the specified skill
[ { "docid": "2b59fbb1e866d2f4d46dccd1b0558bbd", "score": "0.0", "text": "def can_learn_or_learnt_index(id)\n can_learn_or_learnt?(id, true)\n end", "title": "" } ]
[ { "docid": "d159ea775a28c1e70d2c72556cefc8b0", "score": "0.7112472", "text": "def pokemon_skill_index(id)\n has_skill?(id, true)\n end", "title": "" }, { "docid": "0678a6d2676d0f7618b6f82ca33c115a", "score": "0.69080424", "text": "def get_skill_position(skill)\n return f...