query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
a68dd1eeb20d82e87f32c382a4a1eb71
Removes a MIMEtype from the mimetype list ==== Parameters key:: The key that represents the mimetype to remove
[ { "docid": "76aea5f6c782693283326fc1092d938a", "score": "0.7734792", "text": "def remove_mime_type(key)\n # :all is the key for */*; it can't be removed\n return false if key == :all\n ResponderMixin::TYPES.delete(key)\n end", "title": "" } ]
[ { "docid": "d5eb1db87a307902b31db61cf385264c", "score": "0.6297467", "text": "def delete_type!(key)\n if @types.include?(key) then\n # The type is present, delete it.\n type = @types.delete(key)\n # And remove its parent.\n type.pare...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "2fac9c3e8bf24938a2b857ec4725ef0f", "score": "0.0", "text": "def profile_params\n params.require(:profile).permit(:user_id, :firstname, :lastname, :weight, :height, :sex, :smoke, :insulin, :year_of_birth, :default_lang, :blood_glucose_min, :blood_glucose_max, :blood_glucose_unit, :carb_m...
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69802505", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781974", "text": "def strong_params\n params.requ...
e1676b4f010f236e8caa3e37a215e99f
POST /bailleurs POST /bailleurs.json
[ { "docid": "2a4fb26041c654d5e77535a75e418ffd", "score": "0.7497285", "text": "def create\n @bailleur = Bailleur.new(bailleur_params)\n\n respond_to do |format|\n if @bailleur.save\n format.html { redirect_to @bailleur, notice: 'Bailleur was successfully created.' }\n format.json...
[ { "docid": "34340cbd0f63624e5ed74324884c3e8c", "score": "0.7429145", "text": "def create\n @bail = Bail.new(bail_params)\n\n respond_to do |format|\n if @bail.save\n format.html { redirect_to @bail, notice: 'Bail was successfully created.' }\n format.json { render :show, status:...
6bafce08e8d95e2b0354091c4ec21519
Check if running in test mode.
[ { "docid": "c3c30f1cbe33f934ca076fa8165a4aaf", "score": "0.781741", "text": "def test?\n self.environment == ENV_TEST\n end", "title": "" } ]
[ { "docid": "f24e8390b38d6bfc668b02e6701532ff", "score": "0.87046105", "text": "def test?\n @@mode == :test\n end", "title": "" }, { "docid": "dd2445810b89fa60d49a40f061575d04", "score": "0.8663531", "text": "def is_test_mode?\n ENV['TEST_MODE'] === 'TRUE'\nend", "title":...
4e9029644a29a93f1daee6ca215e992b
PATCH/PUT /service_requests/1 PATCH/PUT /service_requests/1.json DELETE /service_requests/1 DELETE /service_requests/1.json
[ { "docid": "e7d37e23f3bbc86888fc35dd2fac9930", "score": "0.62219214", "text": "def destroy\n @service_request.destroy\n respond_to do |format|\n format.html { redirect_to service_requests_url, notice: 'Service request was successfully destroyed.' }\n format.json { head :no_content }\n ...
[ { "docid": "dbb344abb971369ada7f4157e97368a9", "score": "0.65308404", "text": "def rm_update path, data, msg\n\n re = rm_request path, data, 'PUT'\n puts re.body\n chk (re.code!='200'), msg + \"\\n#{re.code} #{re.msg}\\n\\n\"\n return true\n\nend", "title": "" }, { "docid": "f26c505b7a9a...
18ddeb5d58d7244b681ec0fa4c15807f
optimises preload followed by flush in to a single usb call def write color, pin preload color flush pin end
[ { "docid": "eb2358ccdab62d0090530d7b7d3c5bca", "score": "0.56407744", "text": "def write color, pin\n @wire.control_transfer(\n function: :ws2812,\n wIndex: color.b << 8 | color.r,\n wValue: color.g << 8 | pin | 0x30\n )\n output_delay(@colors.length)\n end", "title": "" }...
[ { "docid": "5c91b228dc6a698e1863ee30bccf65e5", "score": "0.5779598", "text": "def output pin = nil\n colors_buffer = @colors.map { |i| @wiring_map[i.is_a?(Colorist::Color) ? i : i.to_color] }\n output_pin = @wire.get_pin(LittleWire::DigitalPinMap, pin || @pin)\n raise \"Must specify output pin ...
912c0e0cf8816366872f1b29941d2de1
DELETE /events/1 DELETE /events/1.json
[ { "docid": "fee3b71b54861271f75061d1a93ac5d6", "score": "0.0", "text": "def destroy\n @event.destroy!\n redirect_to admin_events_url, notice: \"イベントを削除しました。\"\n end", "title": "" } ]
[ { "docid": "ca8002b7f734bce1f1a27f7ec6e59e9d", "score": "0.80864286", "text": "def destroy # DELETE /api/events/:id\n @event.destroy\n render :json => \"Event deleted\", :status => 201\n end", "title": "" }, { "docid": "3281a9c9361cdbd7e683034a763917de", "score": "0.7834...
a6c1c8b556b8c20f9a99416b5007911d
Gets the city property value. The city in which the user is located. Maximum length is 128 characters. Returned only on $select. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values).
[ { "docid": "c51127140133d73798a4da046bd3c148", "score": "0.71855104", "text": "def city\n return @city\n end", "title": "" } ]
[ { "docid": "81f475c3bafeacaf776be93511cabb9f", "score": "0.7214847", "text": "def city\n @city ||= retrieve_contact_field(:city)\n end", "title": "" }, { "docid": "a17404c64f869e279aee2cca16f5a311", "score": "0.7128595", "text": "def get_city\n return @city\n end", "t...
b683425f28138e8fde76054bb7a0eb00
Evaluates this clause's truth within a rule base
[ { "docid": "7be98d6b9eca493088979fea58a73d63", "score": "0.7272374", "text": "def evaluate(rule_base)\n rule_base.facts_for(self.entity, self.property).each do |fact|\n if self.applies(fact)\n return Rule::TRUE if self.comparator == fact.comparator\n return Rule::FALSE\n end\n...
[ { "docid": "f683bdb3e14331d7fe8dddf5434fd2ca", "score": "0.6781409", "text": "def evaluate\n #Clone the rule base so we aren't adding new facts to the actual rule base\n rb = self.rule_base.clone\n #Add new facts and evaluate\n new_facts.each {|fact| rb.add_fact(fact)} unless new_facts.nil?\...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "f66d8af7f324b8401e8eaea6ad6fe4ec", "score": "0.0", "text": "def virtual_run_params\n params.require(:virtual_run).permit(:name, :status, :length, :last, :virtual_course_id)\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"...
4dc1f05dde25665c2503838f73228131
Adds a new parameter to the function
[ { "docid": "99fbc89fac338c90d05c3799eebaa4bc", "score": "0.7374071", "text": "def add_parameter(name, type, optional = false)\n param = Parameter.new(name, type, optional)\n @parameters << param\n\n if optional\n @variable = true \n @prototype_template = \"VALUE !function_va...
[ { "docid": "5b5e6058a9cf83d7db652e39267cd85a", "score": "0.84031194", "text": "def add_parameter param\n parameters.add param\n end", "title": "" }, { "docid": "2788260023bf2a7326a0db0065164afc", "score": "0.80518246", "text": "def add_parameter(param)\n @parameters << p...
3061aaa3c27e495b8dad6bfe0dee96cd
Returns the column instance with the provided data
[ { "docid": "aab91402ddb14371c57f409ccffcb243", "score": "0.62464863", "text": "def column\n cast_type = ActiveRecord::Base.connection.send(:lookup_cast_type, definition)\n metadata = ActiveRecord::ConnectionAdapters::SqlTypeMetadata.new(\n type: cast_type.type,\n sql_type: defini...
[ { "docid": "15c1094f4288c9055e1957eab6af155a", "score": "0.78230244", "text": "def column(column)\n Column.new(@data, column)\n end", "title": "" }, { "docid": "1e6b26d064f65bd01eb2da4877f9bb7c", "score": "0.6854939", "text": "def __column_data__\n ColumnData.new(@columns, @...
da5cca54b927200a9ea64fdd3869063f
Authenticate user with remember_token, returns the user if authentication passes via authenticate_with_salt
[ { "docid": "b4b32646c00cf674c6f7ce4a2675a0e1", "score": "0.8593425", "text": "def user_from_remember_token\n User.authenticate_with_salt(*remember_token)\n end", "title": "" } ]
[ { "docid": "77bd6529e0e9b85c956600dc6e73b996", "score": "0.8651638", "text": "def user_from_remember_token\n User.authenticate_with_salt(*remember_token)\n end", "title": "" }, { "docid": "06838a31f7ffc2f0f58228b184ace94e", "score": "0.8620406", "text": "def user_from_remember_to...
5a38ad2821df70181992202633337d93
must be baller and either furnished or rent cheaper than 2100
[ { "docid": "d2a470b492571bcc30f9b2613130ebd4", "score": "0.72810197", "text": "def rent?(furnished, rent, baller)\n baller && (furnished || rent < 2100)\nend", "title": "" } ]
[ { "docid": "e364964909b53fa6e5e270938b2be6d5", "score": "0.72915804", "text": "def rent?(furnished, rent, baller)\n baller && (furnished || rent < 2100 ) ? true : false\nend", "title": "" }, { "docid": "4ad15d87cc189352b9d483433a571103", "score": "0.7152046", "text": "def test_for_...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ca6cf32e48fb07d26991ba580b4c0d53", "score": "0.0", "text": "def set_haiku\n @haiku = Haiku.find(params[:haiku_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...
43ccf55fe5cec694a3e857970ba44f32
first part of the timing expression in the db
[ { "docid": "53b2fdcfc53362a07374f8bd1e98a034", "score": "0.52636534", "text": "def duration_number\n expr = self.timing_duration.blank? ? \"\" : self.timing_duration.split.first\n @duration_number.nil? ? expr : @duration_number\n end", "title": "" } ]
[ { "docid": "90bc16da8541dbeffbe5c9785a1a4f13", "score": "0.64372975", "text": "def min() time[1] end", "title": "" }, { "docid": "f56389827ffca3deee4b77d4c52a2c26", "score": "0.6156904", "text": "def start_time=(_arg0); end", "title": "" }, { "docid": "316eb5edbf5bd1e3496...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "173e9df9ed4f2238e28e328c3b934ca8", "score": "0.0", "text": "def siteview_params\n params.require(:siteview).permit(:renovation_id, :visit_date, :completed)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7497917", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69572496", "text": "def strong_params\n params.require(:request).permit(param_whit...
ea64ead7002b089489a235d76b415e87
delete the data of ranking.
[ { "docid": "16dd94633d3e3a43b3aed86a1da6398e", "score": "0.0", "text": "def delete(time, date_type=RailsRank::Types::Date::HOURLY, session=nil)\n start_kvs_session(session) do |kvs|\n kvs.delete(key_name(time, date_type))\n end\n end", "title": "" } ]
[ { "docid": "5b2d07e822c98219330378b89f6c2fd7", "score": "0.73071474", "text": "def after_delete\n redis.del(rank_key)\n end", "title": "" }, { "docid": "0f6bf5b059f8f671a5cb74708d134643", "score": "0.69645417", "text": "def clear_ranking\n @ranking = {}\n end", ...
4cac11667fde11569aaaae3e71d66f98
def set_access_control_headers headers['AccessControlAllowOrigin'] = request.env['HTTP_ORIGIN'] headers['AccessControlAllowMethods'] = 'POST, GET, OPTIONS' headers['AccessControlMaxAge'] = '1000' headers['AccessControlAllowHeaders'] = ',XRequestedWith,ContentType,AuthKey,AccessToken,Client' end
[ { "docid": "eee86e0f296354a1b91dcb757b2b3d26", "score": "0.8895885", "text": "def set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1000'\n headers['Access-Control-...
[ { "docid": "0028c8f2ba60970f4ab8e3b4af0d8fa1", "score": "0.8939028", "text": "def set_access_control_headers\n headers['Access-Control-Allow-Origin'] = \"*\"\n headers['Access-Control-Request-Method'] = %w{GET POST OPTIONS}.join(\",\")\n end", "title": "" }, { "docid": "400075eb942122...
5c1deb99ca328b3831df997e1de32009
Find the uri's as and array of symbols from the request_path
[ { "docid": "acdcc35427867cc7cb63b1e1c6b221f4", "score": "0.6350938", "text": "def uri(request_path)\n begin\n uri = (request_path.split(\"/\").collect {|r| r.downcase.intern unless r.empty?}).compact\n rescue NoMethodError\n uri = Array.new\n end\n @uri = uri\n end",...
[ { "docid": "39abd011e9b7e14095c1bdf944dfb64c", "score": "0.72025234", "text": "def request_uri_parts(request)\n case CGI.unescape(uri_path(request))\n when URL_ROOT\n ['start', nil, 'html']\n when URL_SNIP\n [$1, nil, $3]\n when URL_SNIP_AND_PART\n [$1, $2, $4]\n...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "cb8a44f4484286a7f50ff99a0632d8b2", "score": "0.0", "text": "def drinking_water_supply_and_sanitation_params\n params.require(:drinking_water_supply_and_sanitation).permit(:Contaminants, :Affected_Districts)\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"...
7c2e941019d966d15941ede9114ff7b1
DELETE /results/1 DELETE /results/1.json
[ { "docid": "0865b7caedcfc3619b689469196ba442", "score": "0.69002604", "text": "def destroy\n @result = Result.find(params[:id])\n @result.destroy\n\n respond_to do |format|\n format.html { redirect_to student_results_path(@student) }\n format.json { head :no_content }\n end\n end"...
[ { "docid": "96ba9323b53f546ee80f152146055235", "score": "0.742324", "text": "def destroy\n @result.destroy\n\n respond_to do |format|\n format.html { redirect_to results_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "026c9bea3794e4885d10...
97efdcad7d9b1df7c9543abbf979498f
Splits the time line at the current time. Returning the past part and the future part.
[ { "docid": "3796e4caadf181d1db17806d24db7eef", "score": "0.86091757", "text": "def split_time_line(time_line)\n time = Time.now\n if time.hour < @starts.h\n past = \"\"\n future = time_line\n else\n offset = (time.hour - @starts.h) * 4 + time.min.div(15) \n ...
[ { "docid": "52ebb7ff9f8e6946462e4bf5fcf08a59", "score": "0.63410556", "text": "def split_time(line,time_part,delimiter)\n\t if time_part == \"start\"\n\t part=line.split(\" --> \").first\n\t else \n\t part=line.split(\" --> \").last\n\t end\n\t time=part.split(\",\").first\n\t s...
cb6b3e83d54fc56fd6cdc595cbad9ee7
Start Solr and wait for it to become available
[ { "docid": "c6668842dbdb7b64cdc342e1efcb4855", "score": "0.0", "text": "def start\n extract\n if managed?\n args = [\"java\", \"-jar\", fcrepo_binary] + fcrepo_options.merge(port: port).map { |k, v| [\"--#{k}\", \"#{v}\"].reject(&:empty?) }.flatten\n\n @pid = spawn(env, *args)\n\...
[ { "docid": "5d17122ce5b211c0d383190be459b725", "score": "0.78446734", "text": "def start\n if @thread.nil? then\n @thread = Thread.start { @solr.sync }\n end\n end", "title": "" }, { "docid": "1056e852636b92cc93169735aa37ac93", "score": "0.7697275", "text": "def s...
3919986271c52704b16c096fa91cfe25
Add a subscription, optionally to a specific tag. Raises an exception on error. Example: subscribe to 'humor' links from solarce r.sub('solarce', 'humor')
[ { "docid": "5ed323b86ae575ca8da23c0e45b43b31", "score": "0.54437256", "text": "def sub(user, tag = nil)\n raise \"Missing user\" unless user\n args = [\"user=#{user.uri_escape}\", (tag ? \"tag=#{tag.uri_escape}\" : nil)]\n get('/api/inbox/sub?' << args.compact.join('&amp;'), 'post')\n nil\n ...
[ { "docid": "84f42156ff9d8d667474ff9414435e00", "score": "0.6766322", "text": "def subscribe(subscription)\n @pipe.send_strings [\"subscribe\", subscription]\n end", "title": "" }, { "docid": "bab776dfc5203eef36b2ae2cf4f2b7fb", "score": "0.62720096", "text": "def subscribe(arg...
0e4e8a0c05d44e99b0d04f764e89cd49
rubocop:enable Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity Checks if the expression is a field or an instance
[ { "docid": "7e2dda2939178d9962f411c84d72b16a", "score": "0.6941256", "text": "def field_or_instance?(expression, placeholder_variable)\n is_field = (expression.is_a? Yarpler::Models::Field)\n is_instance = (expression.is_a? Yarpler::Models::Instance)\n\n is_field_or_instance = is_field || is_i...
[ { "docid": "a453e65c065c8b7230c07d24d6d6e589", "score": "0.62145597", "text": "def field_instance(field)\n raise \"Not implemented\"\n end", "title": "" }, { "docid": "e7f469e1ea44df3c410bc651360df3bc", "score": "0.5598249", "text": "def reflect_field_type\n caller[0] =~ /`(...
ee89b321a6026f1bfadff89864f0d7f8
Microsoft SQL Server 2012 has native support for offsets, but only for ordered datasets.
[ { "docid": "4a740a40ebdd587be8adf0a7f14bf4ab", "score": "0.6155119", "text": "def emulate_offset_with_row_number?\n super && !(is_2012_or_later? && @opts[:order])\n end", "title": "" } ]
[ { "docid": "8f33548051f5566df322af5e51cec398", "score": "0.72392696", "text": "def offset; @offset ||= 1; end", "title": "" }, { "docid": "f9f4e81201b8d56f7459fb0b14cfbda6", "score": "0.70100045", "text": "def require_offset_order?\n true\n end", "title": "" }, { ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "9abbb7daefe6d9072fefe3b3e6759415", "score": "0.0", "text": "def set_record\n @record = Record.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;...
dcf189d0b5cb63d54a5de7b328a8e34c
comment this code out before rails db:seed
[ { "docid": "223cdc1f4b27077f850e6bf59221165f", "score": "0.0", "text": "def user_cannot_back_own_project\n if project.user == user\n errors.add(:user_id, \"cannot back own project\")\n end\n end", "title": "" } ]
[ { "docid": "87ccf5499a8b0867930a5f7f2958bb63", "score": "0.6948161", "text": "def setup_seed_data\n clear_old_files\n move_test_script_files\n\n # setup other elements required for autotesting\n create_marking_scheme\n create_criteria\n create_submission\n process_schema_data\n end...
0a630b776b5be42f2c9b168bc3a67240
DELETE /customers/1 DELETE /customers/1.json
[ { "docid": "b2da7f28fa92fd9b538e9fb3ad2300a7", "score": "0.0", "text": "def destroy\n authorize @customer, :destroy?\n\n if @customer.destroy\n Work.create!(trackable: @customer, action: :destroy, user: current_user, \n parameters: @customer.to_json(except: {customer: [:fullname_and_...
[ { "docid": "316db473129bc832a7eeffc058ea2764", "score": "0.7459997", "text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :ok }\n end\n end", "title": "" ...
0b16a79a8295aaa2baa0a83efe2fe1ed
Streams ServiceInstance records from the API as an Enumerable. This operation lazily loads records as efficiently as possible until the limit is reached.
[ { "docid": "8f205e9ce16bc2bcb7f9cfdd9980ad59", "score": "0.0", "text": "def stream(limit: T.unsafe(nil), page_size: T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "f06d3130175a09fe784d0e6e2b460aa5", "score": "0.6441184", "text": "def all(options = {}, &block)\n return @query.connection.accumulate(\n :path => 'streams',\n :json => 'streams',\n :create => -> hash { Stream.new(hash, @query) },\n :limit => options[:limit],\...
d6cb6769b1d8a17a32643a8f440ca50b
Get the user's background image.
[ { "docid": "320c65e056e9bec10c0c296d4f23df9d", "score": "0.727253", "text": "def getTwitterProfileBackgroundImage\n # Look for the URL of the background image.\n if url=getTwitterProfileBackgroundImageUrl\n return fetchRemoteImage(url)\n else\n # Use the default image.\n ...
[ { "docid": "0200480de63fb58aeb2afa4700f61897", "score": "0.67535275", "text": "def background_image\r\n return nil\r\n end", "title": "" }, { "docid": "48a9c22224dcfd725678849901eab5ea", "score": "0.6663611", "text": "def determine_rotatable_background_image\n if @@backgroun...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "74675cb7f65b981e68ab912ae909e9d1", "score": "0.0", "text": "def provider_type_params\r\n params.require(:provider_type).permit(:name, :status)\r\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"...
fc2f8337d73c58c8338e53da3a82e0cb
Executed after each test
[ { "docid": "b77163783e33fc25e31d14667f10aca9", "score": "0.0", "text": "def teardown\n FileUtils.rm_rf(\"test/resources/repo_with_tags\")\n end", "title": "" } ]
[ { "docid": "ce9ff74b6ea76a7d6b4091d716ce02b3", "score": "0.8668715", "text": "def after_test\n end", "title": "" }, { "docid": "569ed2b3582c51e47c8dd6f94d7c0ab1", "score": "0.8597008", "text": "def after_test(test)\n end", "title": "" }, { "docid": "f1499a5ecde41e61...
36ca7d35ad8ebabac3e5a8cde3f0e5d0
keywords_file is absolute path file flow
[ { "docid": "d64e6f09531cc2860a5d393146822bfe", "score": "0.0", "text": "def scrape_as_saas(hostname, opts={})\n init_logging\n #\"www.epilation-laser-definitive.info\"\n type_proxy = nil\n proxy = nil\n keywords = \"\"\n results_io = nil\n\n keywords_f = opts.fetch(:scraped_f, nil)\...
[ { "docid": "55183b2f27337eb31505861911402a00", "score": "0.60542715", "text": "def get_keyword\n Dir.glob(\"#{@suite.suite_root}/tests/**/*_test.rb\") {|f|\n file_contents = File.read(f)\n return /^#.*@keywords(.*$)/.match(file_contents)[0].gsub(/^#.*@keywords/, '').strip if /#{s...
cfe845f15cfbb11990e2363d740f7f60
GET /abouts GET /abouts.json
[ { "docid": "f8c0fcba4991d9c2d81eb5159da6f1e4", "score": "0.0", "text": "def index\n @posts = Post.last(4)\n \n render 'index'\n end", "title": "" } ]
[ { "docid": "2b2efcfeb846a0dcb4c0f48e94e88b98", "score": "0.7406917", "text": "def about\n get(\"/about\")\n end", "title": "" }, { "docid": "63e34069cc3df10c5d792bddc9ece1a5", "score": "0.73784083", "text": "def index\n @abouts = About.all(:order => \"created_at DESC\", :l...
ebaf3ea67701b47e973d47b75ade9e65
DELETE /phone_mags/1 DELETE /phone_mags/1.json
[ { "docid": "aed2b43aa4ebae9ffdcd1c5c26dad998", "score": "0.8010355", "text": "def destroy\n @phone_mag = PhoneMag.find(params[:id])\n @phone_mag.destroy\n\n respond_to do |format|\n format.html { redirect_to phone_mags_url }\n format.json { head :ok }\n end\n end", "title": ""...
[ { "docid": "7ac9616f9a7353d9bd6e82f364aa4943", "score": "0.7625843", "text": "def delete_mobile_carrier(args = {}) \n delete(\"/mobile.json/#{args[:carrierId]}\", args)\nend", "title": "" }, { "docid": "7ac9616f9a7353d9bd6e82f364aa4943", "score": "0.7625843", "text": "def delete_mobi...
286aec500cede5d3b5ce3c30a8dc57f4
ie [ [ [users_game_name, Card.create], [users_game_name, Card.create], [users_game_name, Card.create] ], [ [users_game_name, Card.create], [users_game_name, Card.create], [users_game_name, Card.create] ], ]
[ { "docid": "e2289ae6ca6d6789b1e939b7a128d1a0", "score": "0.0", "text": "def lobby_a_new_user user_id\n user = User.find_by(id: user_id)\n user_current_game = user.try(:current_game)\n if user.blank? || # player doesn't exist or\n user.current_games_user_name || ...
[ { "docid": "093e1ff785a690261386f27f883dca09", "score": "0.61441636", "text": "def add_cards(cards)\n #cards need to be a 2d array of vale and color\n cards.each do |value, color|\n Card.create(game_id: @game.id, owner: 0, value: value, color: color )\n end\n end", "title": "" }, ...
235eee76a884840e194c6820b1f5312a
PATCH/PUT /states/1 PATCH/PUT /states/1.json
[ { "docid": "d230350055248ea4793d8565c47d5df6", "score": "0.0", "text": "def update\n respond_to do |format|\n if @state.update(state_params)\n require 'json'\n hash = JSON.parse(File.read(\"public/eulma_lors_#{@state.id}.json\"))\n # hash.update(hash) { |key, value| value == ...
[ { "docid": "c8bf2377221afa019d5eb2ef6c598872", "score": "0.6902768", "text": "def update\n respond_to do |format|\n if @requests_state.update(requests_state_params)\n format.html { redirect_to @requests_state, notice: 'State was successfully updated.' }\n format.json { head :no_con...
12112ab46bb872218d361228d6aaeeab
ticket was opened by a guest with an email address
[ { "docid": "f393bd3df307487c962ab871478fd94e", "score": "0.7210189", "text": "def guest_ticket?\n self.email\n end", "title": "" } ]
[ { "docid": "f649ab53a7b06031fc46a5ac72ce7bb5", "score": "0.6732493", "text": "def activation_mail_opened?(email)\n\n\t\t# setting request params\n\t\tparams = {\n\t\t\tbegin: Time.zone.now.to_i,\n\t\t\tascending: \"no\",\n\t\t\tevent: \"opened\",\n\t\t\tsubject: \"Activate your account\",\n\t\t\tto: ema...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "a2991cf2c2e24376ca55aa1034a18438", "score": "0.0", "text": "def update!(**args)\n @documents = args[:documents] if args.key?(:documents)\n @mask = args[:mask] if args.key?(:mask)\n @new_transaction = args[:new_transaction] if args.key?(:new_transaction)\n ...
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.7308486", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72639555", "text": "def update(...
2b8cd03a8d6ae70bf4127106fe1d3eaa
Baseline implementation for the delete_entity REST call
[ { "docid": "a64698a205075cbeb82136301b4cdc5f", "score": "0.70613176", "text": "def delete_entity request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_entity...
[ { "docid": "46dad6c42ead71782b0ccea912e0b1fb", "score": "0.80285835", "text": "def post_delete(entity)\n end", "title": "" }, { "docid": "a70ff8f7fcc59ee523c39f111354c16b", "score": "0.7870897", "text": "def post_delete(_entity)\n end", "title": "" }, { "docid": "...
a051a17690fd88444515e24ddd315e91
Read / write our strings to a plain old instance variable Define it if it doesn't exist the first time we go to read it
[ { "docid": "301e0987bfcbc871f53c8bed79f2369e", "score": "0.0", "text": "def read_attribute\n string = object.send( field_name )\n Logging.debug \"Read attribute #{field_name}, got #{string.inspect} for #{object.inspect}\"\n string\n end", "title": "" } ]
[ { "docid": "3b148d6a318d8fd1b81e2795426c3d71", "score": "0.60605305", "text": "def read_string()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "d20eb50d85ac9f3f58c8bcdd5ef4553b", "score": "0.5928058", "text": "def load_strings(readst...
3295b0490b1c20ba782efcdeeaec18db
runs the complete set of tasks using data in a subject's "proc" directory and a preconfigured template spm job.
[ { "docid": "be7d6198369643f90c62ce87fbf422d6", "score": "0.0", "text": "def run_first_level_stats\n\t\tflash \"Highway to the dangerzone...\"\n\t\tsetup_directory(@statsdir, \"STATS\")\n\t\t\n\t\tDir.chdir(@statsdir) do\n\t\t\tlink_files_from_proc_directory(File.join(@procdir, \"sw*.nii\"), File.join(@p...
[ { "docid": "7b8738159f9f16d9545c908a9ff3b831", "score": "0.6789666", "text": "def run_spm_jobs\n\t\tthisjob = \"#{@subid}_preproc.mat\"\n\t\tflash \"Running spatial preprocessing SPM job: #{thisjob}\"\n\t\tsystem(\"runSpmJob.sh #{thisjob}\")\n\tend", "title": "" }, { "docid": "27ef29d4b11317...
df3478758773e8c44879ff0e5b96bc17
Returns the width of the image
[ { "docid": "d081f273b4de2c05f262d7bc8b91dd6b", "score": "0.0", "text": "def width\n @properties[\"width\"]\n end", "title": "" } ]
[ { "docid": "ad23a5da3b7103fba845cbbd1f9e6d2f", "score": "0.8982567", "text": "def width\n @image.width\n end", "title": "" }, { "docid": "ad23a5da3b7103fba845cbbd1f9e6d2f", "score": "0.8982567", "text": "def width\n @image.width\n end", "title": "" }, { "d...
4b1e12e33668f3a8e41f614275748106
PUT /tasks/1 PUT /tasks/1.json
[ { "docid": "1209b47ecf7c3556a7b4db933247032c", "score": "0.6824846", "text": "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to tasks_url, notice: 'Task was successfully updated.' }\n fo...
[ { "docid": "cac9c96d9b119273d80222fef2554029", "score": "0.761173", "text": "def update\n @task.update!(task_params)\n json_response(@task)\n end", "title": "" }, { "docid": "099e7266a80d49d1d0e30816e04aff39", "score": "0.759024", "text": "def update\n task = Task.find(para...
ae599722960cf490de31d444c34332f3
PATCH/PUT /principal_caracteristicas/1 PATCH/PUT /principal_caracteristicas/1.json
[ { "docid": "922c9ff0726245c6b3b07f26f809d122", "score": "0.6965618", "text": "def update\n respond_to do |format|\n if @principal_caracteristica.update(principal_caracteristica_params)\n format.html { redirect_to @principal_caracteristica, notice: 'Principal caracteristica was successfull...
[ { "docid": "36fd0d228d411db5373eb93fa3822431", "score": "0.66086745", "text": "def update\n respond_to do |format|\n if @objeto.update(caracteristica_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Caracteristica was successfully updated.' }\n fo...
aa22265e1a79c8ca8b6116c2dcc28910
start da server! method => object that receives the method. can be a class or anything responding to send
[ { "docid": "bfd4e833b6c5793fa535f86f9b82289e", "score": "0.0", "text": "def start\n # subscribe is like a callback\n @server_queue.subscribe(block: @block) do |delivery_info, properties, payload|\n consume(delivery_info, properties, payload)\n end\n end", "title": "" } ]
[ { "docid": "f14db66a546f7bd1b89ef1ed7fd10bec", "score": "0.6948349", "text": "def server; end", "title": "" }, { "docid": "f14db66a546f7bd1b89ef1ed7fd10bec", "score": "0.6948349", "text": "def server; end", "title": "" }, { "docid": "f14db66a546f7bd1b89ef1ed7fd10bec", ...
0cff4a5d9201a1ea0666c72916e7432e
Read cluster certificate ID Returns the ID of the certificate that is used as the cluster certificate for MP
[ { "docid": "4b8f6cf7f7909130f4287c290050bcb0", "score": "0.6273743", "text": "def get_cluster_certificate_id_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiNsxComponentAdministrationClusterManagementApi.get_cluste...
[ { "docid": "60c202bd64c8aef1fa6c4703f08e64c6", "score": "0.6666385", "text": "def get_cluster_certificate_id(opts = {})\n data, _status_code, _headers = get_cluster_certificate_id_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "7aacc1c0891c9f6438beea2411868a70", ...
b166af743666626a2756408f90731b9d
Grabbing the column names of the table associated with a class: column names class method have column names stored Send method = invoke a method without knowing the exact name of the method iterate ove rthe column names using send to capture the return value return value = string using join Abstract/flexible ways to gr...
[ { "docid": "939150e5d76665dce5d0d41fb4d79a93", "score": "0.0", "text": "def values_for_insert\n values = []\n self.class.column_names.each do |col_name|\n values << \"'#{send(col_name)}'\" unless send(col_name).nil?\n end\n values.join(\", \")\n end", "title": "" } ]
[ { "docid": "89bb46b2157cf675a0b87120b315e2ed", "score": "0.63877654", "text": "def sql_for_columns; @sql_for_columns end", "title": "" }, { "docid": "7754744fab317c6dfa5b2becb1e1abed", "score": "0.627546", "text": "def columns; self.class.columns; end", "title": "" }, { "...
d3aeb8228c9f1c4663f6736f24d70442
DELETE /delivers/1 DELETE /delivers/1.json
[ { "docid": "102ca7b08cd344c86d77a8761dbb9a17", "score": "0.0", "text": "def destroy\n @deliver.destroy\n respond_to do |format|\n format.html { redirect_to delivers_url, notice: 'Deliver was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "174b723f9e43bfa7501a9cdc389e4c1b", "score": "0.6658198", "text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end", "title": "" }, { "docid": "e4d577130f2ab81066fe39b95180b96d", "score": "0.6618198", "text": "def d...
220ff8ae09f7a6aedda4a9f8d0f09d0d
Advances progress, outputs, and returns true when completed.
[ { "docid": "c890bf8fbab54f65696d1f47bc787ce3", "score": "0.6032856", "text": "def progress_check(count)\n @@progress += count\n @@dialog.setMainProgress(@@progress)\n @@dialog.logMessage(\"Exported #{@@progress} of #{@total} items\")\n @@progress == @total\n end", "title": "" } ]
[ { "docid": "3d9d2a6c7b397b28277b04e5208bcf36", "score": "0.68145925", "text": "def finish\n @finished ||= begin\n @progressbar.finish if @progressbar\n true\n end\n end", "title": "" }, { "docid": "866a8272a7374c65a6582d924b612534", "score": "0.6604204", "t...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "d7bee8baeb2315b46345e745489b8697", "score": "0.0", "text": "def admin_interview_question_params\n params.require(:admin_interview_question).permit(:question, :answer, :sort_id, :is_online)\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...
bbd9acdf27c7ac26ee6fb268e79c1c69
actor is the listener who listen to the message
[ { "docid": "aeea73e79b37160684c8b80ad60e0998", "score": "0.0", "text": "def initialize actor, msg, args, &fun\n @actor = actor\n @msg = msg\n @matcher = PatternMatcher.new args, &fun\n define_method_in_actor\n end", "title": "" } ]
[ { "docid": "e9dd2a9e57a309d5f6de0139e1ca32a3", "score": "0.6546601", "text": "def handle_chat(msg, message)\n @user = msg.actor\n #raise \"#{self.class.name} doesn't implement `handle_chat`!\"\n end", "title": "" }, { "docid": "61714531ec8249d37d497391c9ebf7aa", "score": "0.654119...
807375648e9dbae836f484dc424a89c4
Search for contacts by either name or email.
[ { "docid": "55ad7401ee43b29032094eb5e6497794", "score": "0.7235213", "text": "def search(term)\n # TODO: Select the Contact instances from the 'contacts.csv' file whose name or email attributes contain the search term.\n Contact.all.select do |contact|\n contact.name.downcase.match(term...
[ { "docid": "a2a5e02eacefa0f71a6966921feb48a3", "score": "0.7538281", "text": "def search(term)\n all.select { |contact| contact.name.include?(term) || contact.email.include?(term) }\n end", "title": "" }, { "docid": "e381c02dc17aea6200f86cc97e9b78b6", "score": "0.7482197", "t...
77bf27c621a54310d5ba5af4447cdb3b
Returns the value of the `sso` attribute.
[ { "docid": "06812cc0b135c62898414314ea9cf9bb", "score": "0.76637083", "text": "def sso\n @sso\n end", "title": "" } ]
[ { "docid": "07b8990ac6adfa34b0739aa70fb89e82", "score": "0.6785108", "text": "def sso_cookie\n cookies['WarwickSSO']\n end", "title": "" }, { "docid": "ea8b3e2ef93bfa3650f497de155abc3e", "score": "0.6495024", "text": "def sso_strategy_type\n @attributes[:sso_strategy_typ...
bf2e9a4c917152934fa3cd20f404d703
def titleize (string) temp=string.split temp.each do |p| p.capitalize end temp end
[ { "docid": "ffc9684f7efd5369d3ce0021d933b4dd", "score": "0.9050606", "text": "def titleize (string)\n temp=string.split\n if temp.length==1\n temp[0].capitalize\n else\n temp2=temp[0].capitalize\n i=1\n while i<temp.length do\n if i>0\n if ['and', 'the', 'of', 'for', 'over'].i...
[ { "docid": "d075ff45cfc2acb085e0cc1ac0bc444f", "score": "0.9411094", "text": "def titleize!(string)\n temp = string.split\n temp.each do |word|\n word.capitalize!\n end\n string = temp.join(\" \")\nend", "title": "" }, { "docid": "25f9661f7e4610f24efd1930aa002238", "score": "0.923...
5190538988df4ec9b658f0ddb6c83fa0
GET /categories GET /categories.json
[ { "docid": "b5cb41bad76e94f17666e45835c8ccd1", "score": "0.0", "text": "def index\n @categories = Category.all\n render json: @categories.to_json(:include => :innovations)\n end", "title": "" } ]
[ { "docid": "efcb5e10780279c84a4be599091f0268", "score": "0.8529297", "text": "def categories\n call_api('/categories')\n end", "title": "" }, { "docid": "3cba43678b445865af5afd71d9719de9", "score": "0.84926367", "text": "def get_categories()\n response = RestClient.get @ho...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "82dc420cfade4d2db04aee50d0cbdfb0", "score": "0.0", "text": "def note_params\n params.require(:note).permit(:title, :description, :date, :priority)\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...
a662cad708d561f38205ba5a4dc0608f
Returns a boolean value
[ { "docid": "5a77c23a7f86d2906b5cef2cc805f501", "score": "0.0", "text": "def dungeon_cell_exists? x, y\n # Finds cell coordinates inside dungeon collection to determine if dungeon cell exists\n state.dungeon.find { |d| d.x == x && d.y == y }\n end", "title": "" } ]
[ { "docid": "3e7437ea0f46e9039d6928a2df681752", "score": "0.83572036", "text": "def true?\n true\n end", "title": "" }, { "docid": "3e7437ea0f46e9039d6928a2df681752", "score": "0.83572036", "text": "def true?\n true\n end", "title": "" }, { "docid":...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "3727b6cb0ae6e524456a21e93563d451", "score": "0.0", "text": "def eleve_params\n params.require(:eleve).permit(:nom, :prenoms, :matricule, :date_naissance, :niveau,\n :lieu_naissance, :mere, :tuteur, :domicile, :contact, \n :genre, :redoublant, pere: ...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74779433", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.7168533", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist ...
9f51b29275c017ae49a3331af4e774ea
generate_hash method is defined in CouchExpress::AuthModel::General since it is used for many auth strategies
[ { "docid": "03c53776fb375cda8b89a2add8a961f0", "score": "0.0", "text": "def password_valid?( p, add_validation_errors=true )\n add_to_params( :password, p )\n is_valid = true\n unless p.match(/.{3,40}/)\n is_valid = false \n add_staged_error( :password, 'Password m...
[ { "docid": "b9ad0210b86d9f175d5ac23572c82396", "score": "0.8006605", "text": "def generate_hash\n LiabilityProof.sha256_base64 \"#{user}|#{sum_string}|#{nonce}\"\n end", "title": "" }, { "docid": "e64a5d3349cb9ad40ad2ce5ecf9f2c21", "score": "0.75679094", "text": "def gene...
433e94c1abe8f04ff809547bbe4756cf
toggle menu access based on user privileges
[ { "docid": "ba70f45c8a51958a8dee3bd3617b3d85", "score": "0.6559739", "text": "def show_manage_menu\r\n render 'layouts/manage' if can? :manage_pixi_posts, @user\r\n end", "title": "" } ]
[ { "docid": "b8025165068f0f5af878fab5ec5f8840", "score": "0.6832612", "text": "def menu_admin\n opcion = \"1\"\n datos_login = @view.login_admin\n usuario = User.find_by(name: datos_login[0])\n if usuario == nil\n @view.login_mal\n menu\n elsif usuario.name == datos_login[0] && u...
7159d6219569ca3475a027074233d374
Returns customer by external identifier
[ { "docid": "4038ab91d287b36e9ea761ee8934fb6e", "score": "0.0", "text": "def customers_eid_read(external_id, opts = {})\n customers_eid_read_with_http_info(external_id, opts)\n nil\n end", "title": "" } ]
[ { "docid": "360133f338e28c4eaa1bbb88f8184876", "score": "0.75396436", "text": "def get_customer(id)\n get(\"customers/#{id}\")\n end", "title": "" }, { "docid": "360133f338e28c4eaa1bbb88f8184876", "score": "0.75396436", "text": "def get_customer(id)\n get(\"customers/#{id}\")\...
7f0bc3f79f0618cfb5451d7c9274c88b
POST /teacher_places POST /teacher_places.json
[ { "docid": "9f11a2b1a32957222ca78cba75c5ee58", "score": "0.7504224", "text": "def create\n @teacher_place = TeacherPlace.new(teacher_place_params)\n\n respond_to do |format|\n if @teacher_place.save\n format.html { redirect_to @teacher_place, notice: 'Teacher place was successfully cre...
[ { "docid": "de84b54fa180fc01d242c1efadc1f48d", "score": "0.7049959", "text": "def teacher_place_params\n params.require(:teacher_place).permit(:teacher_id, :place_id)\n end", "title": "" }, { "docid": "8ead39f3e8aacfcd98b175f4b3426ff5", "score": "0.653145", "text": "def set_t...
e6bcbd1fcafd9a23f39993950c6f5640
+write+ must be called with a single argument that is a String.
[ { "docid": "e96e75572a65a6d61e1f0b9d5f2a8664", "score": "0.8376639", "text": "def write(str); end", "title": "" } ]
[ { "docid": "64a1e5451416d6e8b6dd1674888761a1", "score": "0.85935265", "text": "def write(string); end", "title": "" }, { "docid": "fc87ccefe49c2342aabe9f5683d636c6", "score": "0.83142513", "text": "def write(s) end", "title": "" }, { "docid": "5af68b6e9f19d74f5148ce81b0c7...
b04c8f7dfddfcdb99d1c16886f53074e
Example: the longest alphabetical substring in "asdfaaaabbbbcttavvfffffdf" is "aaaabbbbctt". The input will only consist of lowercase characters and will be at least one letter long. If there are multiple solutions, return the one that appears first. =begin rules: longest substring in alphabetical order all lowercase l...
[ { "docid": "60aba582ab8523466c949902cadb91c7", "score": "0.75520945", "text": "def longest(str)\n return str if str.length == 1\n current = str[0]\n longest = ''\n\n 1.upto(str.size-1) do |idx|\n if current[-1] <= str[idx]\n current += str[idx]\n else\n if current.length > longest.le...
[ { "docid": "f6df58e55b4516f26dec319dae67556d", "score": "0.81177646", "text": "def longest_repeated_substring(input)\n len = input.size / 2 # Max size is half total length, since strings cannot overlap\n\n while len > 0\n # Find all substrings of given length\n sub_strings = {}\n for i in 0...inpu...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "a7162dcddc2a3133f81751b7593abfc3", "score": "0.0", "text": "def active_class_params\n params.require(:active_class).permit(:class_name, :max_number)\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...
5b877745727cfd53e684a68c94f69fa1
returns a record for an object, containing all open access data about that object, including its image (if the image is available under Open Access)
[ { "docid": "f74ac386d8457b84d2b6ff6d9afb068e", "score": "0.0", "text": "def object(object_id)\n response = create_request(API_ENDPOINT, \"#{PUBLIC_URI}/#{object_id}\")\n arrange_response(response)\n end", "title": "" } ]
[ { "docid": "31918d9ff46e90c69f1aad53ef84b8e6", "score": "0.625847", "text": "def store_obj_image(obj_id) #:nodoc:\n record = 0x005D # Record identifier\n length = 0x0026 # Bytes to follow\n\n obj_type = 0x0008 # Object type (Picture).\n data = '' # Record da...
0d32eb98f6fda1745a23b5c1e1fbdaab
DELETE /tests/1 DELETE /tests/1.json
[ { "docid": "6a8ca3ee6bdcdbdba917c93c0ea4e711", "score": "0.0", "text": "def destroy\n @content.destroy\n respond_to do |format|\n format.html { redirect_to contents_path, notice: 'Test was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }...
[ { "docid": "fec89fa055a43f61d2f98a3cf89d96a7", "score": "0.7713", "text": "def destroy\n @test.destroy\n respond_to do |format|\n format.html { redirect_to tests_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fec89fa055a43f61d2f98a3cf89d...
d81be8cc4a101e7733f19ee0ee858ca4
Returns `true` if marked as finished otherwise `false`.
[ { "docid": "339750314f91b0c1b452f6361b080c04", "score": "0.80581886", "text": "def finished?\n state.successful? || state.failure?\n end", "title": "" } ]
[ { "docid": "fb172c37e12a05977669768c95de8f3c", "score": "0.88480985", "text": "def finished?\n marked? && (status == :finished)\n end", "title": "" }, { "docid": "7eb227f91ee022b74fed00df4925f6fa", "score": "0.8643469", "text": "def finished?\n @finished\n end", "...
92cbeea5c527113dfe378b521f28bdd3
Given a set of paths, find a common prefix path.
[ { "docid": "49829aa92f02ecc96d681172375600ff", "score": "0.62698346", "text": "def find_base_path(paths)\n return nil if paths.length <= 1\n paths.sort!\n first = paths.first.split('/')\n last = paths.last.split('/')\n i = 0\n while first[i] == last[i] && i <= first.length...
[ { "docid": "6615b3de8f7f9e2af0375165a4b6cc77", "score": "0.72788024", "text": "def detect_common_prefix(list)\n if list.size == 1\n return File.dirname(list.first)\n end\n prefix = ''\n min, max = list.sort.values_at(0, -1)\n min.split(//).each_with_index do |c, i|\n ...
ef7cfc4caed37de8302e23a141405b22
GET /newcomments/1 GET /newcomments/1.xml
[ { "docid": "0f689ad6cf310cbcd170899917b6eab5", "score": "0.71885663", "text": "def show\n @newcomment = Newcomment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @newcomment }\n end\n end", "title": "" } ]
[ { "docid": "37ee9cfe67a1012c0e33ba27bc8b5b92", "score": "0.7196049", "text": "def new\n @newcomment = Newcomment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @newcomment }\n end\n end", "title": "" }, { "docid": "63e0efe213abd...
6458c1fe103aee58e874f67d1909d63a
Returns the health status of the service.
[ { "docid": "e52f84a07e3701acd90b34bc34266537", "score": "0.7641836", "text": "def check_health\n begin\n response = @nexus['/service/local/status'].get(:accept => :json)\n data = JSON.parse(response).fetch('data', [])\n current_state = data.fetch('state', '')\n ...
[ { "docid": "93ad45e72e6eefea64bdb294dfc19aed", "score": "0.8014596", "text": "def health_status\n return @health_status\n end", "title": "" }, { "docid": "93ad45e72e6eefea64bdb294dfc19aed", "score": "0.8014596", "text": "def health_status\n re...
3c65f3a94e896e41133e4d3f2f2a8fcd
DELETE /chaines/1 DELETE /chaines/1.json
[ { "docid": "7994cd34350c65161ea797f91a3f5dbd", "score": "0.65498364", "text": "def destroy\n @chaine = Chaine.find(params[:id])\n @chaine.destroy\n\n respond_to do |format|\n format.html { redirect_to chaines_url }\n format.json { head :no_content }\n end\n end", "title": "" ...
[ { "docid": "b2c7d438e917a51023d5c6bd67ce79fa", "score": "0.76426435", "text": "def destroy\n @chain = Chain.find(params[:id])\n @chain.destroy\n\n respond_to do |format|\n format.html { redirect_to chains_url }\n format.json { head :no_content }\n end\n end", "title": "" }, ...
82756b725aa48e1af2fee0714508bd7b
Returns true, if the color of suit is the same as the color of other suit.
[ { "docid": "a602d833046261d0dda24058aaeb4026", "score": "0.8878648", "text": "def same_color?(other_suit)\n (black? && other_suit.black?) || (red? && other_suit.red?)\n end", "title": "" } ]
[ { "docid": "5ec5f060d78a475c4317be3c63b9d986", "score": "0.8341974", "text": "def different_color?(other_suit)\n (black? && other_suit.red?) || (red? && other_suit.black?)\n end", "title": "" }, { "docid": "0640bd0b1e03fb006bb4788d6d283fb6", "score": "0.7479066", "text": ...
155c228f5745d8d7bbe922c522a95791
Makes answer group serializable
[ { "docid": "7179d722cc7262da6db3edce67815d83", "score": "0.61186075", "text": "def serializable_hash(options = {})\n @answers\n end", "title": "" } ]
[ { "docid": "a126e681346630c4ec31fd99d7ebfee1", "score": "0.6075155", "text": "def serialize; end", "title": "" }, { "docid": "a126e681346630c4ec31fd99d7ebfee1", "score": "0.6075155", "text": "def serialize; end", "title": "" }, { "docid": "a126e681346630c4ec31fd99d7ebfee1...
ac4049422cd228032046743bf2413897
PATCH/PUT /employee_reviews/1 PATCH/PUT /employee_reviews/1.json
[ { "docid": "d9b251445f46005605ac2e33d75c3e20", "score": "0.74608356", "text": "def update\n respond_to do |format|\n if @employee_review.update(employee_review_params)\n format.html { redirect_to @employee_review, notice: 'Employee review was successfully updated.' }\n format.json ...
[ { "docid": "1ba7c35dc730da50783e23e6da47cb1b", "score": "0.7256523", "text": "def update\n @review = Employee.find(params[:id])\n\n respond_to do |format|\n @review.reviewed = true; @review.score = params[:employee][:score];\n if @review.save\n format.html { redirect_to admin_revi...
94647778cd32700b46cd5b6504ce5091
DELETE /articles/1 DELETE /articles/1.json
[ { "docid": "f290eb712225c8e548e3ab2892e7ac97", "score": "0.0", "text": "def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n head :no_content\n end", "title": "" } ]
[ { "docid": "69841214643e03d2e662b4f05e2ebf37", "score": "0.7966318", "text": "def destroy\n @articles1.destroy\n respond_to do |format|\n format.html { redirect_to articles1s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b35eeffb872cea7...
8c78a9e0052e4f3567c61c31799596a4
GET /supporters/new GET /supporters/new.xml
[ { "docid": "4467834b8f230f7816c7828c091099ee", "score": "0.75212437", "text": "def new\n @supporter = Supporter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @supporter }\n end\n end", "title": "" } ]
[ { "docid": "245c6e3bad5e9ae281d91d54faaa0b42", "score": "0.6908549", "text": "def new\n @researcher = Researcher.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @researcher }\n end\n end", "title": "" }, { "docid": "90a420e12d05d...
5259128d55f1a628a49126477638af59
Does the target have the feature `feature` enabled?
[ { "docid": "7028c22b4aaaa0b53c13cafefb824c66", "score": "0.8196966", "text": "def target_feature?( feature )\n features = @app.config[:targets][@app.config[:target]][:features]\n features.key?(feature.to_sym) && features[feature.to_sym]\n end", "title": "" } ]
[ { "docid": "f2f9c8fd169c697f9aa05420e748ad2c", "score": "0.7978759", "text": "def has_feature?(feature_name); end", "title": "" }, { "docid": "62e1395b4732a61623840d5873942639", "score": "0.79422486", "text": "def target_feature?( feature )\n options = extensions[:Middlemac].optio...
500c9fcd1e9e9598f2c0cb8f67e18d0e
Scan direction is used to figure out what we can see. Related to the gamestatepawns since it spits out a list of visible gamestatepawns.
[ { "docid": "7f0b51a76c9719d2118cee1fc888a058", "score": "0.6829694", "text": "def scanDirection(user_pawn, multiplier_x, multiplier_y, passed_gamestatepawns = @gamestatePawns)\n # You see a long way down hallways.\n @view_distance = 4;\n \n pawn_position = getPosition(user_pawn, passed_games...
[ { "docid": "df20de5c8047dcf9f4ec0d3e94188f47", "score": "0.686736", "text": "def scan(go_direction)\n destination = nil\n tmp_direction = go_direction.nil? ? @direction : go_direction\n if tmp_direction == 'up'\n if @floor_idx == (@floors.length - 1) # already at top floor\n destin...
e9bf26eaa5ca06c267b15cf9e2a5f630
:nodoc: Emulation of +apply+ javascript method. +apply+ has this signature my_proc.apply(my_obj, args) where [+my_proc+] a proc [+my_obj+] object inside proc is eval'ed [args] array of arguments for proc +apply+ on javascript is very flexible. Can accept more or less variables than explicitly defined parameters on lamb...
[ { "docid": "c54414ab61a46ea7753fa44a538adf28", "score": "0.6564963", "text": "def js_apply(obj,args)\n arguments=args.dup\n # Modify numbers of args to works with arity\n min_args=self.arity > 0 ? self.arity : (-self.arity)-1\n \n if args.size > min_args and self.arity>0\n arguments=...
[ { "docid": "aa0f8caaa929bc964400fa6e704540b3", "score": "0.66586244", "text": "def apply(&function)\n n = function.arity\n items = pop(n)\n push(function.call(*items))\n end", "title": "" }, { "docid": "c65497f275059c240208f4d58db84cd1", "score": "0.5950487", ...
b944b669889b7ae239cbfdc2249c83bc
a better version of this would go through all of the steps for creating a customer, adding their details, and then creating a reservation, for which they also made a payment. use login method repeatedly to handle repeated steps in the test each test runs independent of the previous ones, so steps are repeated test data...
[ { "docid": "fbad3356c63a294aab1167185a7d72c5", "score": "0.58555", "text": "def login\n visit '/users/new'\n # puts page.body\n fill_in 'user_name', :with=>'Bruce'\n fill_in 'user_email', :with=>'bruce@bruce.com'\n fill_in 'user_password', :with=>'bruce123'\n fill_in 'user_password...
[ { "docid": "476c1faae5f62a818094752497ed3524", "score": "0.67182213", "text": "def test_12_login_while_donating()\n\t\t\n\t\tputs \"---------------------- START OF SCENARIO 12 ----------------------\"\n\t\tsearchOrg($new_orgname)\n\t\tgotoDonFormClickLogin($donation_amount, $normal2_emailId, $normal2_pa...
c143e0937ea93f12c16221ffb435b5a0
same as order except will add $10 shipping fee
[ { "docid": "fcaf39821e0ef4c831648a6c9a343b04", "score": "0.0", "text": "def total\n super()\n return sum += 10\n end", "title": "" } ]
[ { "docid": "260fc8bd69607b5d37508470411da9fb", "score": "0.7366665", "text": "def total\n # TODO: implement total\n # super invokes the `total` method on the _base class_ (Order)\n # it will add a $10 shipping fee, unless total is zero\n if super == 0\n return 0\n else\n retur...
c7a419401c893b516269ae3a2e6c2709
PATCH/PUT /cocheras/1 PATCH/PUT /cocheras/1.json
[ { "docid": "1602a91acf4180fd135bb11f68f60df4", "score": "0.62480617", "text": "def update\n respond_to do |format|\n if @cochera.update(cochera_params)\n format.html { redirect_to @cochera, notice: 'Cochera was successfully updated.' }\n format.json { render :show, status: :ok, loc...
[ { "docid": "41673e2eecb158f69667d0b07eec9602", "score": "0.64191073", "text": "def update\n respond_to do |format|\n if @cajero.update(cajero_params)\n format.html { redirect_to @cajero, notice: 'Cajero was successfully updated.' }\n format.json { head :no_content }\n else\n ...
617fe6ca3a6f00ea9bea77d686b82f66
GET /administrativos GET /administrativos.json
[ { "docid": "b7b55f9ff42593de21e900b0d2c773bb", "score": "0.7123196", "text": "def index\n @administrativos = Administrativo.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @administrativos }\n end...
[ { "docid": "3023bf9cd985dd6d25a28fee25a393a5", "score": "0.6821497", "text": "def show\n @administrativo = Administrativo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @administrativo }\n end\n end", "title": "" }, { ...
b14e3ce24be0bd250610f4778412848d
MES A few functions to manipulate the current user are below. The basic idea is that we don't want to store the user object in the session. This would require serializing the user object to the DB, and retrieving it for each page view. Instead, we store the user ID in the session, and turn it into a user object on dema...
[ { "docid": "101abf8f32e94a2b6b2daed1c2d51a8c", "score": "0.7856803", "text": "def current_user\r\n #MES- If the user is cached, return it\r\n if !@request.user_obj.nil?\r\n return @request.user_obj\r\n end\r\n\r\n #MES- User not cached, is there an ID?\r\n return nil if current_user_...
[ { "docid": "d1d74b765c30fb23e9fe96f233edfd30", "score": "0.80723625", "text": "def current_user\n if session[:user_id]\n #This line makes use of Memoization.\n #Definition: Memoization is the process of storing\n #a computed value to avoid duplicated work by future calls.\n #see: ...
3b844e1e480c78af75a1d654a580828c
Render the intro (which is the first paragraph of the body)
[ { "docid": "9114ec82d9d2e16f898fd7d743de3752", "score": "0.7961832", "text": "def content_for_intro(interpret=false)\n if interpret\n render_for_html((t(I18n.locale,:body)||self.body).paragraphs[0])\n else\n (t(I18n.locale,:body)||self.body).paragraphs[0]\n end\n end", "title": "...
[ { "docid": "a54347498d9975c521d70439b7db60f1", "score": "0.83214706", "text": "def content_for_intro\n render_for_html(body.paragraphs[0])\n end", "title": "" }, { "docid": "a54347498d9975c521d70439b7db60f1", "score": "0.83214706", "text": "def content_for_intro\n render_for_h...
d985fe2512ec7827043ffe886786ca91
decode_ip() Decodes and IP address.
[ { "docid": "4d15c5e6930d8bdb03b3cf0b1058b24f", "score": "0.63032633", "text": "def decode_ip(data_received, answer_offset, answer_data_length)\n host_str = \"\"\n \n i = 0\n while i < answer_data_length\n byte_read = data_received.slice(answer_offset + i, data_received.length - (answer_offset + i...
[ { "docid": "18e5bcff43657ab7dd802d4db5eab1ad", "score": "0.6651113", "text": "def decode(base_addr=0, eip=base_addr)\n decode_blocks(base_addr, eip).to_s\n end", "title": "" }, { "docid": "f0c089733417953dd260577479d98775", "score": "0.6187328", "text": "def parse_ip(ip)\n\t\tif ...
7a9f8108e362b9376dd20c9b21385fbc
Sets the tokenIssuerType property value. Indicates the type of token issuer for the detected signin risk. The possible values are: AzureAD.
[ { "docid": "ac463898a4b0fc554afbe6464105a4b0", "score": "0.8111963", "text": "def token_issuer_type=(value)\n @token_issuer_type = value\n end", "title": "" } ]
[ { "docid": "5c860b0272c594c68ff670f4e89dd754", "score": "0.69030124", "text": "def token_issuer_type\n return @token_issuer_type\n end", "title": "" }, { "docid": "5c860b0272c594c68ff670f4e89dd754", "score": "0.69030124", "text": "def token_issuer_type\n ...
805da6932564e539d844d84a7959b607
Returns a YAML representation of the manifest
[ { "docid": "2c4fd74c71ada95f5e63891c24557afb", "score": "0.57714117", "text": "def to_yaml\n out = []\n to_h.each do |k, v|\n next if v[:hidden]\n out << \"#{k}:\"\n vy = v[:desc].nil? ? '# nil' : v[:desc].inspect # value to yaml\n out << \" desc: #{vy}...
[ { "docid": "03799dbd78fbcf418a03f3e4e94b7c92", "score": "0.7981983", "text": "def to_yaml\n manifest_for_export.\n map(&:to_yaml).\n join('')\n end", "title": "" }, { "docid": "668173fa9425b2738129c9bd9270e98e", "score": "0.7377672", "text": "def generat...
2ffe57560986441cd7cefdb88f2dfacc
Create Entry In Gateway Nonce Author: Tejas Date: 31/05/2019 Reviewed By:
[ { "docid": "ea9addf0174f524be0bd8fbae4b1f9f1", "score": "0.6535194", "text": "def create_entry_in_gateway_nonce\n @gateway_nonce_record = GatewayNonce.new(\n uuid: get_uuid,\n ost_payment_token_id: @ost_payment_token.id,\n nonce: @gateway_nonce,\n statu...
[ { "docid": "908672a51606c98effa66bf0dad76ae4", "score": "0.64636624", "text": "def create\n create_entry\n end", "title": "" }, { "docid": "53621de130a39bc2f1fcf6e0755ece29", "score": "0.64469874", "text": "def create_entry\n system \"clear\"\n puts \"New AddressB...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "9ee8646bdd2ddbe944783e7ea73f6083", "score": "0.0", "text": "def set_cateroty\n @cateroty = Cateroty.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;...
76640ba320dccff1c35f60aee0e12331
If query is not present, set to query everything
[ { "docid": "ac9c55f8ee452d6fab83c319774cd119", "score": "0.71861726", "text": "def set_query\n query = params[:query]\n query = '*' unless query.present?\n query\n end", "title": "" } ]
[ { "docid": "108ad9714e33d058a1f80d0cae541873", "score": "0.7659272", "text": "def queries\n @queries = [general_query] unless general_query.blank? #if options[:q] || options[:query].present?\n end", "title": "" }, { "docid": "a50d1ec131bc0c2854d1b7e2791f0008", "score": "0.72055185", ...
62dc8908070f1657fafeebf97531a7af
info as supplied by SmugMug
[ { "docid": "275c0c1386a2e5704613f409a252e37c", "score": "0.0", "text": "def user_hash\n @user_hash ||= MultiJson.decode(@access_token.get('/services/api/json/1.2.2/?method=smugmug.auth.checkAccessToken').body)['Auth']['User']\n end", "title": "" } ]
[ { "docid": "ac48c0bf237ebe517111acbf7365ed73", "score": "0.7387935", "text": "def info; end", "title": "" }, { "docid": "ac48c0bf237ebe517111acbf7365ed73", "score": "0.7387935", "text": "def info; end", "title": "" }, { "docid": "db48ece60bb6c2f6c89ccedd3ffbc774", "sc...
ffc6f00cf38b0bd782a891471708702c
GET /jobs GET /jobs.json
[ { "docid": "f1bb43a06ab920b7160bf7ec7aa603f4", "score": "0.0", "text": "def index\n @show_active = params[:active].eql?('false') ? false : true\n @selected_date = Date.today\n @sorted_users = User.all.sort_by {|usr| usr.last_name.downcase.to_i == 0 ? 1000 : usr.last_name.downcase.to_i }\n @s...
[ { "docid": "e0d30cb0880ae58f5dd30199afee732c", "score": "0.8199955", "text": "def get_jobs()\n u = self.build_uri(\"/jobs\")\n response = @client.get(u, nil, ACCEPT_RDF)\n return response\n end", "title": "" }, { "docid": "8a0695bb744593e3a36970adb8e0a14d", "score": "0....
8f3c51d54a135df4a9e352a9f323fe74
This submodule requires the developer to define his own mailer class to be used by it when reset_password_mailer_disabled is false
[ { "docid": "00decd6ae7460adbbf34f2e19030aa40", "score": "0.769015", "text": "def validate_mailer_defined\n message = 'To use reset_password submodule, you must define a mailer (config.reset_password_mailer = YourMailerClass).'\n raise ArgumentError, message if @sorcery_config.reset...
[ { "docid": "d2bf4e8ce4e74a7e57dd418b346ba498", "score": "0.78814226", "text": "def validate_mailer_defined\n return unless\n sorcery_config.reset_password_mailer.nil? &&\n sorcery_config.reset_password_mailer_disabled == false\n\n raise Sorcery::Errors::Co...
a8a79697af83c32fe4cd16ac2c2d808a
Evaluate the code on the clipboard.
[ { "docid": "4c49a8d5a3282c4e2d5164acdd5ed2ad", "score": "0.6401807", "text": "def ep\n IRB.CurrentContext.workspace.evaluate(self, paste)\nend", "title": "" } ]
[ { "docid": "1d15653135aa5ad3da368a90fbd5ece0", "score": "0.7000467", "text": "def paste; clipboard_paste; end", "title": "" }, { "docid": "3047e8e2f70a1928e5326985dbb1e7a5", "score": "0.69410956", "text": "def do_clipboard_paste\n dat = if Wx::PLATFORM == \"WXMAC\" \n # X...
9cf42a87a02c95f83f2796b2ff040778
Assumes that if the object doesn't have an `id`, it's new.
[ { "docid": "647bfc995a7de42c43200658cb72a32d", "score": "0.0", "text": "def new_record?\n self.attributes[:id].nil?\n end", "title": "" } ]
[ { "docid": "dd5fc27e2ac159d45d8e58a06040e8dd", "score": "0.70157075", "text": "def create_with_id(id, obj)\n obj.id = id\n obj.save\n end", "title": "" }, { "docid": "09f9fd1b2dd78d1f58383419b26d63d9", "score": "0.6805826", "text": "def id=(val); raise \"Subobjects don't have ...