query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
f25899d159d8ce0e1638c6098f7009f6
From merb/core_ext/hash.rb, line 87
[ { "docid": "02ba0a8996c58eed15285356225459ab", "score": "0.0", "text": "def hash_to_params hash\n params = ''\n stack = []\n\n hash.keys.sort{ |a, b| a.to_s <=> b.to_s }.each do |k|\n v = hash[k]\n if v.is_a?(Hash)\n stack << [k,v]\n else\n params << \"#{k}=#{v}&\"\...
[ { "docid": "24fd6a67aa1e6225f3f51fa3551b97db", "score": "0.67619425", "text": "def assume_strict_hashes; end", "title": "" }, { "docid": "f2fcbb888bee6d8224eb94659ed77a9c", "score": "0.66986597", "text": "def hash_key; end", "title": "" }, { "docid": "ef200ff818c310e9a179...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "be4019cfe7c57771be6bb65657a30b57", "score": "0.0", "text": "def certificate_params\n params.require(:certificate).permit(:certificate)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7476646", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.7168696", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist =...
d2d02d95f25ddc3fc3368120816ecad2
GET /donations/1/print GET /donations/1/print.pdf
[ { "docid": "91122a3629d2d0ac9be0149b30bfdad3", "score": "0.7643068", "text": "def print\n @donation = Donation.includes(transaction_items: :item).find(params[:id])\n @donor = @donation.donor\n respond_to do |format|\n format.html\n format.pdf do\n if params[:new].present? && !@...
[ { "docid": "00300820a33a32229932c6080e8c6c55", "score": "0.70807284", "text": "def show\n respond_to do |format|\n format.html\n format.pdf do\n pdf = Receipt.new(@donation)\n send_data pdf.render, \n filename: \"#{@donation.id}\",\n type: 'ap...
b90d3a22996124a2cc80df286f7aa88a
:startdoc: :callseq: version > Server::Version An object representing the version of the remote Taverna Server.
[ { "docid": "597a424a795906f866aa96bf14339bd8", "score": "0.6956916", "text": "def version\n @version ||= _get_version\n end", "title": "" } ]
[ { "docid": "6b875086a9839ce2ac4e714e5e2738fc", "score": "0.8199437", "text": "def server_version\n ServerVersion.new(server_info['version'])\n end", "title": "" }, { "docid": "f338a3eae4d9bd11c74ac4031c5bdeb2", "score": "0.8178992", "text": "def server_version\n ServerVe...
d1a4ae0ff993a44312f1a042c10baf60
def unregisterProgressHandler Arguments: topicId ( Long )
[ { "docid": "c498447ed53078edd79cb6e07fa7ccca", "score": "0.7749796", "text": "def unregisterProgressTopic( topicId )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::Long( topicId )\n\n # BIMserver request\n request( { topicId: topicId } )\n end", "title": "" } ]
[ { "docid": "0c45a438a419e663a93a309682137fd1", "score": "0.7875199", "text": "def unregisterProgressHandler( topicId, endPointId )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::Long( topicId )\n #BIMserverAPI::TypeCheck::Long( endPointId )\n\n # BIMserver request\n reque...
e2fa7753b531167368bcca407297e867
Which pieces of information to include:
[ { "docid": "e45727753850795bb2100a85b5f68cf6", "score": "0.0", "text": "def prop(*values)\n values.inject(self) { |res, val| res._prop(val) or fail ArgumentError, \"Unknown value for prop: #{val}\" }\n end", "title": "" } ]
[ { "docid": "ac48c0bf237ebe517111acbf7365ed73", "score": "0.6754968", "text": "def info; end", "title": "" }, { "docid": "ac48c0bf237ebe517111acbf7365ed73", "score": "0.6754968", "text": "def info; end", "title": "" }, { "docid": "ac48c0bf237ebe517111acbf7365ed73", "sc...
8e2b14f0a39e817b24e9814858e1e79c
used by public method transform()
[ { "docid": "4e907e58d765493e440619e8fc7e1346", "score": "0.0", "text": "def mm_template(svg, doc, count, docwidth='50%')\n\n puts ('docwidth: ' + docwidth.inspect).debug if @debug\n \n style = \"float: right; width: #{docwidth || '50%'}; \\\noverflow-y: auto; height: 70vh; \"\n puts ('style:...
[ { "docid": "8a5c98e585ff4bf3b01e0f9c26f9024b", "score": "0.9124862", "text": "def transform() end", "title": "" }, { "docid": "9beb7be53eb5305c63284a0f0a9521ea", "score": "0.89225155", "text": "def transform\n end", "title": "" }, { "docid": "f53478c78bfb65847a5452ef55...
bc8886e4199732764857309a3380d765
Write a method that takes a string of lower case words and returns an array of letters that do not occur in the string. This problem requires a different approach from the one we used in most_frequent_letter and we will need to show some care in how we set up the hash or process it to get the result. Do you see why? We...
[ { "docid": "393728e9df384cd36e6defa22ad0d785", "score": "0.0", "text": "def missing_letters(str)\n\nend", "title": "" } ]
[ { "docid": "8c7cdb0d0b5092ba9ece72e85b357b37", "score": "0.79473644", "text": "def non_unique_letters(string)\n arr = string.chars.select {|char| char.ord <= 'z'.ord && char.ord >= 'a'.ord}\n #Look at each word, then check if it is included in the rest of the array\n result = arr.select.with_index {|...
639bfc7b7dad76c6ef6d01909a4930ca
Before filter to load the configuration data.
[ { "docid": "5761c64c985178a290380f99de296a36", "score": "0.0", "text": "def find_settings\r\n @settings = Settings.load\r\n end", "title": "" } ]
[ { "docid": "a86e48ec1ccb91e48831b45496d94124", "score": "0.7453155", "text": "def before_load\n# DEBUG\n# logger.debug( \"\\r\\n========= conf: #{config.inspect} ===========\\r\\n\" )\n if ( config[:override_filtering] ) # Do the 1-time override of the component session:\n compo...
289542e19df4278f09c217fd8e4e215c
The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
[ { "docid": "5c693221d020316d12b5e07677ceefb6", "score": "0.0", "text": "def add_default_slots day\n start_hours = [\n 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20\n ]\n start_hours.each do |start_hour|\n start_time = DateTime.new(day.year, day.month, day.day, start_hour, 0, 0, '+00:00')\n e...
[ { "docid": "0873733430cc54bffe5c851995212e4c", "score": "0.7840786", "text": "def seed_data\n # Don't log the output of seeding the db\n silence_warnings { load_or_raise(Apartment.seed_data_file) } if Apartment.seed_data_file\n end", "title": "" }, { "docid": "b4ef602f8f06...
82b9ec455ee34615f5c9e106fba1cb41
The default stats_data values, automatically handled by the Stat superclass
[ { "docid": "f3989bed6d2d35ff0c0f6ddedc4cc9c4", "score": "0.6943272", "text": "def default_data\n { 'media' => 0, 'units' => 0, 'time' => 0 }\n end", "title": "" } ]
[ { "docid": "6b80733f839d259299e7bd2b60a94de8", "score": "0.74225646", "text": "def stats_data\n data = super || default_data\n # Generate percentile data\n if global_stat\n data['percentiles'] = %w[media units time].each_with_object({}) do |key, out|\n # Find the first per...
7c0bebb871a8194244b88018df183d9f
display the previous generated schedules
[ { "docid": "d1723eb31cc2c9febff92d6931d67ed1", "score": "0.0", "text": "def generate_prev\n session[:solution] == nil && generate\n \n session[:marker] -= NPREVIEWS\n\n if session[:marker] < 0\n if session[:solution].length.remainder(NPREVIEWS) == 0\n session[:marker] = session[:s...
[ { "docid": "88bf935b3d5b494f7404be002d3a6046", "score": "0.69395894", "text": "def display_schedules\n puts label\n puts scheduled_meetings\n end", "title": "" }, { "docid": "1002ca9918bed865be7e74ead03d20f4", "score": "0.6193847", "text": "def show\n @interviewer = Intervi...
4468fa6122e9abced3c13e8bcbbbd223
Se vuelve a poblar a partir de un mating pool. Se realizan mutaciones unicamente ya que los cruces producen
[ { "docid": "820023966a17469f3a543ecf8ea127f1", "score": "0.6941179", "text": "def poblar(matingPool = nil)\n @poblacion = []\n @tamPoblacion.times do\n if matingPool == nil\n nuevoCromosoma = Cromosoma.new(@cantReinas)\n else\n cromosomaA...
[ { "docid": "35fc22d445de8d87428589086457d3cc", "score": "0.6190819", "text": "def mutate_matingpool\n (0...@mating_pool.size).each do |i|\n j = rand 0...@num_genes\n chromosome = @mating_pool[i].clone\n gene = chromosome[j]\n gene = gene.zero? ? 1 : 0\n chromosome[j] = gene\n...
e0e0a93d7060d8ef567aef1f447f09b0
Get the directory in which files are calibrated Return:: _String_: Directory to calibrate files to
[ { "docid": "d13233ea8537ebc5ea6bbeffd9b86629", "score": "0.7832763", "text": "def getCalibratedDir\n return @MusicMasterConf[:Directories][:Calibrate]\n end", "title": "" } ]
[ { "docid": "c3a571902c33eeef7a10d8d6f20898cc", "score": "0.6281447", "text": "def files_dir\n return File.absolute_path(File.join(@root_dir, 'weather'))\n end", "title": "" }, { "docid": "2dd0cd8e263507c7ed3e8fbb9c905a3b", "score": "0.61671996", "text": "def getCalibrated...
52d05d325154a9af0b27e2d15c896460
PATCH/PUT /trips/1 PATCH/PUT /trips/1.json
[ { "docid": "29d0916bf5f7e96d77830224b9aec5d1", "score": "0.0", "text": "def update\n\n @trip.link = cut_link(@trip.link)\n\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render...
[ { "docid": "ace544e760996192072da81787dd771c", "score": "0.7320285", "text": "def update\n respond_to do |format|\n format.any(:trips_json, :json) do\n if @trip.update(trip_params)\n head :no_content\n else\n render json: @trip.errors, status: :unproce...
be0b1710e5c3205aa24cc08ddac31eb1
Pipe characters define block params/args Creating a Method that Employs Blocks =begin Clarification: Paramater = Variable used within method definition, Argument = Value corresponding to said parameter, as defined when called Blocks are often passed as arguments to methods =end Simple MethodAttached Example
[ { "docid": "1303ad631651eb36eb33f57bf8ed95db", "score": "0.0", "text": "def my_method\n puts \"Inside my method\"\n yield \"Argument Passed\" # Yields to/runs attached block if applicable, can be caled multiple times\n # Sidenote because this is still confusing, yield is just a function and I c...
[ { "docid": "7df0c9c2d6616a32176d6c2ae1a26c74", "score": "0.7219795", "text": "def BlockArg(name); end", "title": "" }, { "docid": "c8d5d758e2195f17be17544149f0cceb", "score": "0.6824113", "text": "def ArgBlock(value); end", "title": "" }, { "docid": "cbe6aeafb82ff0087f572...
2f126efd900d609e69dbca49a7570d2c
Check if all conditions eval to true for this context.
[ { "docid": "70ca39895dfd1a236b3bdc581abc2b59", "score": "0.5769317", "text": "def matches_context?(context)\n @conditions.all? { |cblock| cblock.call(context) }\n end", "title": "" } ]
[ { "docid": "aee660bfb21cfcff7d5353094ddc4e00", "score": "0.67226803", "text": "def active?\n # find first condition that doesn't pass (nil if all pass)\n self.conditions.find { |c| !c.evaluate? }.nil? # true if all pass\n end", "title": "" }, { "docid": "229b4e83e82bd8edb7a340e9a43d0...
f5a52c371361b3c207d0ebd60ce87d01
Method to list all reservation instances
[ { "docid": "c0aaff89b4ac66f896d4d3b479aabfb5", "score": "0.78650147", "text": "def list_reservations\n return @reservations\n end", "title": "" } ]
[ { "docid": "ab04319129ac4dad40279938ab092969", "score": "0.8252216", "text": "def index\n @instance_reservations = InstanceReservation.all\n end", "title": "" }, { "docid": "c1c394d513a94e911dce0c71d653127d", "score": "0.8042192", "text": "def index\n @reservable_instances = R...
3176ee71595856d94adfcb9e1f8fe6fd
List the youngest revision available for browsing
[ { "docid": "7016ee117f17f3bc99ba21b36b2988e7", "score": "0.6695305", "text": "def do_youngest\n rev = @fs.youngest_rev\n puts rev\n end", "title": "" } ]
[ { "docid": "b96032c7cd3b428866c24d9dcc943fc7", "score": "0.7023308", "text": "def youngest_rev\n Svn::Repos.open(@repos_path).fs.youngest_rev\n end", "title": "" }, { "docid": "f3c636f608ee127bcb0eea4fa10010c6", "score": "0.67769814", "text": "def latest_revision\n revisions.f...
5911aa5e25f6b3e2d628513a54cf59b5
Creating item's stock count
[ { "docid": "13285993729f8b5e3bd77ed0de1d05f2", "score": "0.733081", "text": "def stocked_items_count\n # Creating items\n item_ids = \"SELECT id FROM items WHERE create_user_id = :user_id AND active = 'true'\"\n # Except for self stock\n ItemStock.where(\"item_id IN (#{item_ids}) AND user_id...
[ { "docid": "84669285c4ad14b35f5a96259828b3a7", "score": "0.7069359", "text": "def inc_stock\n\t\t@stock += 1\n\tend", "title": "" }, { "docid": "0689bca2454c145e9ee7a1952b8150bd", "score": "0.70398724", "text": "def brand_toy_stock item\n\t$num_stock = 0\n\t$same_brand.each {|item| $...
b826cb82caf77a517597335c64c6d9b3
handle GET requests (requesting collections and elements). This will also support SimpleDB query syntax given in the following form: Use it from ActiveResource with: find(:all, :from => :query, :params => "")
[ { "docid": "d8273999cf9757d03a77ac348ed3835a", "score": "0.6977587", "text": "def do_GET(req, res)\n domain, resource, id, format = parse_request_path(req.path_info)\n if domain && resource && id && format == 'xml' # element or query\n unless id == 'query'\n attributes = sdb_ge...
[ { "docid": "975f2965243be80257df55bfc67eb2b2", "score": "0.6639457", "text": "def process_get\n # Parse query arguments.\n conds, tables, joins, max_page_len = send(\"get_#{action}\")\n\n # Let user request detail level.\n self.detail = parse_enum(:detail, [:none, :low, :high]) || :none\n\n ...
82c5774f88fd1a1338025ab44e10d2f6
GET /monographs/1 GET /monographs/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "6b1a1bfd1825077ed820a86187869fd7", "score": "0.6966126", "text": "def index\n @generic_monographs = GenericMonograph.all\n end", "title": "" }, { "docid": "64d2e183d1d6ab6dce7ca33416ed7b6e", "score": "0.66354847", "text": "def index\n @mosaics = Mosaic.all\n\n r...
7335d32b6748475659fbfaa61dd9308b
GET /memberships or /memberships.json
[ { "docid": "d77ae68eb0a6727017013f187eb4eeb2", "score": "0.0", "text": "def index\n @memberships = Membership.all\n unless current_student.try(:isAdmin?)\n render(:file => File.join(Rails.root, 'public/403'), :formats => [:html], :status => 403, :layout => false)\n end\n end", "title"...
[ { "docid": "07e687b19b2cd72fc033bf2ee3e6e1fb", "score": "0.7826197", "text": "def memberships\n @list.client.get(\"#{url}/memberships\")\n end", "title": "" }, { "docid": "6103d512d0cf35d0b35611a326d21740", "score": "0.7706688", "text": "def GetMemberships params = {}\n\n ...
ec40deba6358c85a1cde89a337105035
params method to prevent weird injections from frontend. Only allow parameters required for model initialization.
[ { "docid": "6c25faedfa998fbe2e73f9cfb4d9dc3d", "score": "0.0", "text": "def stock_params\n params.permit(:tickername, :stock_id, :quantity, :portfolio_id)\n end", "title": "" } ]
[ { "docid": "ec31fa6cc39a6a2a73766fb39b9a443f", "score": "0.7255859", "text": "def initialize( params )\n super( Parametrization.permit( params, whitelist, model_name ) )\n @params = @params.with_indifferent_access # After building the internal params hash, make it a little friendlier.\n end...
17782cf90c7c652ec6f78621c5262ba3
nArray creates a new 2D array of height 'height' and width 'width.' => height > number of columns in new 2D array => width > number of rows in new 2D array
[ { "docid": "4a03fa65aa3eec56fef0da2b8bfbb79e", "score": "0.7816866", "text": "def nArray(height, width)\r\n a = Array.new(height)\r\n a.map! { Array.new(width) }\r\n return a\r\nend", "title": "" } ]
[ { "docid": "6d3678ee8abc6cd39761e285af5a850a", "score": "0.66035545", "text": "def grid(n, m)\n # note: if code was written like grid = Array.new(n, Array.new(m))\n # this is distributing the same array made by Array.new(m) to each column\n # mutating a value in one sub array will affect ALL ar...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "4c1acadee4fff397fdbfca8226401b53", "score": "0.0", "text": "def attendance_params\n params.require(:attendance).permit(:date, :course_id, :latitude, :longitude)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7942467", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.6957796", "text": "def permitted_params\n params.permit!\n end", "title":...
cf02dfc986949ed4991d7781ab191d88
ensure that there are no line items referencing this product
[ { "docid": "826f911b6e8eba377acdb53ab89e2eac", "score": "0.0", "text": "def ensure_not_referenced_by_any_line_item\n if line_items.empty?\n return true\n else\n errors.add(:base, 'Line Items present')\n return false\nend\nend", "title": "" } ]
[ { "docid": "88c0337284c08a432c1799f6821a65c9", "score": "0.8540937", "text": "def ensure_not_referenced_by_any_line_item\n if line_items.any?\n errors.add(:base, 'Line items with this product present')\n false\n end\n end", "title": "" }, { "docid": "6cdab59512374d...
3117b92a0c0c70a29dfce071982887fc
update_sha256 received server to server message with changed user sha256 signature (verify gifts request, sha256 changed user signature etc) user info on this server is oldest. mark that user info is outofdate (remote_sha256_updated_at) a client on this server must download fresh user info from login provider (user or ...
[ { "docid": "f8aece5ccbf3b5429d8bb40bb9d3dc42", "score": "0.7760562", "text": "def set_changed_remote_sha256 (sha_signature)\n logger.debug2 \"user = #{self.debug_info}, sha_signature = #{sha_signature}\"\n update_attribute :remote_sha256_updated_at, Time.zone.now\n # find \"active\" friends of ...
[ { "docid": "9d185e542fa342c3e91a8c19ce937380", "score": "0.7516632", "text": "def update_sha256 (force)\n old_sha256 = self.sha256\n new_sha256 = self.calc_sha256(SystemParameter.secret)\n return if !force and (old_sha256 == new_sha256)\n # loop - system secret may have to change to keep sha...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "34062356f411a03a72c256bc657289b6", "score": "0.0", "text": "def set_payer_b_record\n @payer_b_record = PayerBRecord.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6032574", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015663", "text": "def...
7d362b3585d6a2c9e25611cfa2e5d746
Gets the history of States and Reasons for an Opportunity.
[ { "docid": "e17f6990fb17951e2be95e7a622ebab2", "score": "0.5302367", "text": "def get_state_history_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OpportunitiesApi#get_state_history ...\"\n end\n \n # verify the...
[ { "docid": "dda8f0f69ac9d568f64eae7bc3bfb4a7", "score": "0.6517632", "text": "def history_states\n return @history_states\n end", "title": "" }, { "docid": "364437589d73b148df1c1c573acecc1f", "score": "0.59373385", "text": "def history()\n workflow_events...
74e05ffbbed4d7ed5176d9b64a4c77fe
Find if patient was every able to schedule in the past
[ { "docid": "3e59f5fee7d5c2ec93d9aa920c2569d0", "score": "0.74078757", "text": "def could_schedule_in_the_past?\n Condition.start_at_past.can_schedule.select { |condition| condition.allowed? self }.any?\n end", "title": "" } ]
[ { "docid": "dc10200260f3fa7ab1a7c8eb03a48cf6", "score": "0.705019", "text": "def in_the_past?\n race_datetime < DateTime.current\n end", "title": "" }, { "docid": "2891f8a6f8cf2913e43070f7f0e959b2", "score": "0.6990214", "text": "def check_if_ever_registered_for_past_camp\n re...
bae4de8142b6c35182f623e87c24b8b7
def edit_ajax self.edit render :action => 'edit', :layout => false end
[ { "docid": "e0142fa270319f287c0ac79d8a304562", "score": "0.0", "text": "def repeat_task(task)\n @repeat = Task.new\n @repeat.status = 0\n @repeat.project_id = task.project_id\n @repeat.company_id = task.company_id\n @repeat.name = task.name\n @repeat.repeat = task.repeat\n @repeat.r...
[ { "docid": "afb940fbea05a59c5bc05a2f7c899969", "score": "0.81121665", "text": "def edit\n render_with_callback 'edit'\n end", "title": "" }, { "docid": "f1eeb9b219c3c1f68d9749312331768c", "score": "0.8064799", "text": "def edit\n render layout: false\n end", "title": "" ...
fd059ca62d2e88cff9a480044106f590
sparky.human_years >this would cause an error assume the method definition below is above the "private" keyword
[ { "docid": "6c42d1fad7dc6217ecd1566c9562b66f", "score": "0.6464556", "text": "def public_disclosure\n \"#{self.name} in human years is #{human_years}\"\nend", "title": "" } ]
[ { "docid": "d9e032e029025cd1f51cbd140633a8ac", "score": "0.7132333", "text": "def human_years \n age * DOG_YEARS\n end", "title": "" }, { "docid": "42727549405a4e609cf8b801d0777cf3", "score": "0.7102588", "text": "def year; end", "title": "" }, { "docid": "427...
fbfcf716b21b5afc6734fee924e43cbb
List the names of attributes
[ { "docid": "58cc0d61ae29ad2c0e7f59a61e06d05d", "score": "0.0", "text": "def list_attrs(type, attrs)\n params = []\n type.allattrs.each do |name|\n kind = type.attrtype(name)\n params << name.to_s if attrs.include?(kind) && name != :provider\n end\n puts @format.wrap(params.sort.joi...
[ { "docid": "33edd9ad1700ff59004c8d7cd1c581b2", "score": "0.85901344", "text": "def list_attributes \n attributes = Attribute.all \n attributes.map {|attr| attr[:attr_name]}\n end", "title": "" }, { "docid": "7853d17ef656c8dbe50d0803e9b12869", "score": "0.85901076", "text": "de...
73b5003c5788125402431f3591e5ee03
Fetch all Research Resources
[ { "docid": "742fba11a10bfd6d795acd75cb6f446d", "score": "0.0", "text": "def view_research_resourcesv3_with_http_info(orcid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DevelopmentMemberAPIV30Api.view_research_resourcesv3 ...'\n end\n ...
[ { "docid": "fdb3e36a4089df18ab049d130797dec7", "score": "0.67619914", "text": "def resources(model:)\n query_service.find_all_of_model(model: model)\n end", "title": "" }, { "docid": "4e1a859f501392a3f0eb3dc618a54020", "score": "0.6744244", "text": "def resources(model:)\n ...
9f849cba4c344e86a4f1cdb77619aba3
:callseq: to_a(xpath = nil) > array_of_elements Returns an array of element children (not including nonelement children). With no argument, returns an array of all element children: d = REXML::Document.new 'seanelliott' elements = d.root.elements elements.to_a => [, ] Omits nonelement children. children = d.root.childr...
[ { "docid": "34286ee279481d8c037f1320c727b994", "score": "0.5783908", "text": "def to_a(xpath = T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "7253d2b502b20e50cc80623546bc7f9f", "score": "0.68701005", "text": "def to_a()\r\n @to_a ||= elements.map{ |e| element_class.new(@parent, :element => e) }\r\n end", "title": "" }, { "docid": "2cf364ac0d354859d6e6ad1d2c4462d2", "score": "0.66457945", "text": "def ge...
0623ebbe68cb125a1aa1fec35681fa87
Convert the github data into a Hashie::Mash object, so that delegation works. Returns a Hashie::Mash object.
[ { "docid": "3909c928dcb3a59d994735fb23a2b5e7", "score": "0.79099244", "text": "def github_data\n @github_data ||= Hashie::Mash.new(read_attribute(:github_data))\n end", "title": "" } ]
[ { "docid": "1c6c83cceb14768f46795250f96247cf", "score": "0.6378547", "text": "def mash\n @mash ||= Hashie::Mash.new(json)\n end", "title": "" }, { "docid": "72a675d019a6e7ceafc5c886c801bece", "score": "0.62552553", "text": "def data\n Github::Api.new(github_id).parse\n en...
de5910ceb6ba6925066b9afcb07bfd24
If you want to, set the logger manually to any output you'd like. Or pass false or nil to disable logging entirely.
[ { "docid": "ea53a3abd8285eafe0ca9a2bcbc8d265", "score": "0.6730452", "text": "def logger=(logger)\n case logger\n when false, nil then @logger = nil\n when true then @logger = default_logger\n else\n @logger = logger if logger.respond_to?(:info)\n end\n end", "titl...
[ { "docid": "83628e819e6aef5b8d5cc211e6f470f9", "score": "0.7558211", "text": "def toggle_logging\n logger = Morrow.config.logger\n\n @logger_orig_level ||= logger.level\n\n # If the logging level is set to debug, assume the test-runner wanted all\n # the logging output\n return if @logger...
9cd52a97f08280fe1fdb52f090e726a8
Execute the block in a secondary repository of the current user
[ { "docid": "3e8bf9c2b8f7d7a9448f0dee5d5d0532", "score": "0.62026536", "text": "def in_secondary_repository &block\n current_idenitifer = Pathname.new(Dir.pwd).basename\n in_repository \"#{current_idenitifer}_secondary\", &block\nend", "title": "" } ]
[ { "docid": "8894bc2eafdbedb2ae429f0d69b6a036", "score": "0.6525913", "text": "def execute(block)\n block.call\n end", "title": "" }, { "docid": "be34a8d15e7551888f417605438c3a2c", "score": "0.6322856", "text": "def execute(&block)\r\n block.call\r\n end", "title": "" },...
470ddf7c3147d51eff48ec4322e8e155
TODO execution pirce, execution qunatity ?
[ { "docid": "00e6b53f0debf71f69cd2a3c89ff1da5", "score": "0.0", "text": "def initialize(asset_id, quantity, price)\n @quantity = quantity\n @price = price\n @timestamp = Time.now\n @status = Order::NA\n @asset_id = asset_id\n h = Digest::SHA2.new\n @id = h << \"#{timestamp}#{asset_id...
[ { "docid": "8235ebf7058af650a1d4fa0d7e5d7c56", "score": "0.77267396", "text": "def executor; end", "title": "" }, { "docid": "8235ebf7058af650a1d4fa0d7e5d7c56", "score": "0.77267396", "text": "def executor; end", "title": "" }, { "docid": "8235ebf7058af650a1d4fa0d7e5d7c56...
a43d0ddb21b0617214130e4a0f05c136
Filters yield events that should not be handled.
[ { "docid": "3463f3c5efabd753fbadf31dbe5587ad", "score": "0.6205134", "text": "def filter(event)\n @logger.debug('filtering event:')\n @logger.debug(event)\n unless filter_send_event(event)\n @logger.debug('event type should not be sent')\n return false\n end...
[ { "docid": "21c3f219adfea4ac323eb0d9fde2d486", "score": "0.75911", "text": "def suppress_events\n self.events_suppressed = true\n yield\n self.events_suppressed = false\n end", "title": "" }, { "docid": "2b63c8050bd3cfd7db2bd8dd0946b414", "score": "0.70228654", "text": "def...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "efae82b7de6a052529a75144657b80af", "score": "0.0", "text": "def end_params\n params.require(:end).permit(:product_id, :product_page, :position)\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...
201ffda8476b3af4b82431ea9449ece1
PUT /extensions/1 PUT /extensions/1.json
[ { "docid": "f27799c16ec4817c857817e38a2110ae", "score": "0.6059979", "text": "def update\n @extension_line = ExtensionLine.find(params[:id])\n\n respond_to do |format|\n if @extension_line.update_attributes(params[:extension_line])\n format.html { redirect_to @extension_line, notice: '...
[ { "docid": "1000895493a2db7c8474077c29f6f3ba", "score": "0.6633257", "text": "def update\n respond_to do |format|\n if @extension.update(extension_params)\n\n format.html { redirect_to request.referrer, notice: 'Extension was successfully updated.' }\n\n format.json { render :show,...
954f9a9d6e9614944567f94bf3ad34d7
Generates an xml comment from user input.
[ { "docid": "5ec22a493462d1042c98f40b2733498c", "score": "0.7084934", "text": "def generateComment\n\n\tprint(\"\\nEnter a comment: \")\n\tcomment = $stdin.readline.chomp\n\n\treturn \"<!-- #{comment} -->\"\n\nend", "title": "" } ]
[ { "docid": "15c13b3dbb8ff87a2c269f3130f496ab", "score": "0.6735611", "text": "def comment(text)\n @xml << \"<!-- #{text} -->\"\n nil\n end", "title": "" }, { "docid": "eaa22369bd29ff2577e28b75e6fbbcb0", "score": "0.62896305", "text": "def comment(text)\n@out << \"<!-- #{text} ...
f1c68f6209778fd48cb8181dca30c121
OVERRIDE Bulk edit/copy a set of issues
[ { "docid": "aaad79c8ab71e3eca4c231b1b2b1f15a", "score": "0.7865812", "text": "def bulk_edit\n @issues.sort!\n @copy = params[:copy].present?\n @notes = params[:notes]\n\n if @copy\n unless User.current.allowed_to?(:copy_issues, @projects)\n raise ::Unauthorized\n end\n en...
[ { "docid": "f36f087b34550fb1b84fe7f38b837078", "score": "0.7828563", "text": "def bulk_edit\n @issues.sort!\n @copy = params[:copy].present?\n @notes = params[:notes]\n\n if @copy\n unless User.current.allowed_to?(:copy_issues, @projects)\n raise ::Unauthorized\n end\n el...
b55990fbc51132f17cc01c64571bbd91
Unsubscribe from a friend, a group or an imaginary friend specified by a unique ID. [unofficial]
[ { "docid": "f8d9446f376157242d915550e7197782", "score": "0.7122354", "text": "def unsubscribe_from(id)\n post(ROOT_URI + '/a/unsubscribe', 'stream' => id)\n end", "title": "" } ]
[ { "docid": "722e4de5e9631ca5b2adf26f8a1c1646", "score": "0.7022655", "text": "def unsubscribe\n if Friend.unsubscribe_friend(params[:requestor], params[:target])\n render json: {\n success: true\n }\n else\n render json: {\n success: false\n }\n end\n end", ...
9eaf459e62d6bd836313ce19d610d3e4
PUT /violations/1 PUT /violations/1.json
[ { "docid": "5c1c30dcb305bf6209c4756aacc4768c", "score": "0.7041897", "text": "def update\n @violation = Violation.find(params[:id])\n\n respond_to do |format|\n if @violation.update_attributes(params[:violation])\n format.html { redirect_to @violation, notice: 'Violation was successful...
[ { "docid": "7c882287a987756d115f64cc604e5ee9", "score": "0.7302073", "text": "def update\n respond_to do |format|\n if @violation.update(violation_params)\n format.json { head :no_content }\n else\n format.json { render json: @violation.errors, status: :unprocessable_entity }\...
f81058333562d2116aca806471abf6e4
GET /oss GET /oss.json
[ { "docid": "1a3fb7a040f2a4a5b56131cad155974b", "score": "0.6103015", "text": "def index\n @oss = apply_scopes(Os).order(\"#{sort_column} #{sort_direction}\").page(params[:page]).per(NUMERO_POR_PAGINA)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: ...
[ { "docid": "05651cb178c38962d269afde1aa2b937", "score": "0.634106", "text": "def index\n @oss = apply_scopes(Os).order(\"#{sort_column} #{sort_direction}\").page(params[:page]).per(NUMERO_POR_PAGINA)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "3f163c4fc6ed8154b572857efb575191", "score": "0.0", "text": "def set_item\n @item = Item.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60328794", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6017492", "text": "de...
31e5e443eda95365495ed79985cee4a3
cleans the opts array of keys meant for path, if key ends with '/' or EOL
[ { "docid": "6b365899a84a2cb5411d645d8fc9edf0", "score": "0.73099846", "text": "def sanitize_opts_of_endpoint_data(opts, path)\n opts.delete_if {|k,v| path.match(/:#{k}(\\/|$)/) }\n end", "title": "" } ]
[ { "docid": "678e3715b78348f0ee8dfdc72c7a42fb", "score": "0.5801196", "text": "def sanitize_opts!\n @opts.each_key do |key|\n unless VALID_OPTS.include? key\n raise Monga::Exceptions::InvalidClientOption, \"`#{key}` is invalid option for Client. Following options are valid: #{VALID_O...
57d2862f5a2940d3bfb2cc55ad9bf583
Public: insert Adds the location name to the 'locations' table as a new record and assigns an id. Parameters: None. Returns: New values as strings for the new product record. State Changes: Inserts values into 'locations' table in the database as a new location record.
[ { "docid": "f031df86ba3b0cb94b4c0d1967e05175", "score": "0.7396558", "text": "def insert\n DATABASE.execute(\"INSERT INTO locations (location_name) \n VALUES ('#{@location_name}')\")\n @id = DATABASE.last_insert_row_id\n end", "title": "" } ]
[ { "docid": "5b5149fb58504c802e128c32e5d36e3c", "score": "0.68573385", "text": "def add_to_database\n CONNECTION.execute(\"INSERT INTO locations (name) VALUES ('#{self.name})';\")\n self.id = CONNECTION.last_insert_row_id\n \n return self\n end", "title": "" }, { "docid": "31a2a9...
ba7e4df1fc89d25969c105d7d3cd75db
POST /bollywood_reviews POST /bollywood_reviews.json
[ { "docid": "2e9a1358bcb252e7b6a201214efb52cb", "score": "0.745114", "text": "def create\n @bollywood_review = BollywoodReview.new(params[:bollywood_review])\n\n respond_to do |format|\n if @bollywood_review.save\n format.html { redirect_to @bollywood_review, notice: 'Bollywood review w...
[ { "docid": "2655773b66c481d3207d720e9488410e", "score": "0.72881436", "text": "def create\n @boo_k_review = BooKReview.new(boo_k_review_params)\n\n respond_to do |format|\n if @boo_k_review.save\n format.html { redirect_to @boo_k_review, notice: 'Boo k review was successfully created.'...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "cd67477131f9bd8cdfe45af8116ff456", "score": "0.0", "text": "def allergy_params\n params.require(:allergy).permit(Allergy.safe_attributes)\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...
24002ed09f25a3547c8e80a7526cba4c
use skip_initial_page_search when you know the page doesn't exists (i.e. when you have already searched it)
[ { "docid": "a5a61cb9fe93baaba3d7e05617b8434e", "score": "0.0", "text": "def submit_album_page( album_data, image_path=nil, allow_page_overwrite=true, skip_initial_page_search=false, show_review_dialog=true, must_review=false )\n\n\t\tshow_review_dialog = true if must_review\n\n\t\tif ! allow_page_overwr...
[ { "docid": "8bfcdb3aa6b80a883d1aeed067c1dce9", "score": "0.68002325", "text": "def search_page_of\n\n end", "title": "" }, { "docid": "76c30f8d575dc55863664dca148f9901", "score": "0.67167234", "text": "def search_for_no_results\n visit('/locations?keyword=asdfdsggfdg')\n end...
de3c15f92f169abc1aa483508e6d55b9
RETURNS AN ARRAY OF THREE SPACES
[ { "docid": "fd978d37279afe84211e3fc3d323ce72", "score": "0.0", "text": "def look_ahead(direction)\n looking_array = warrior.look(direction)\n end", "title": "" } ]
[ { "docid": "d96e94329d41a35bb35a9f0585c200f3", "score": "0.6433885", "text": "def name_array(name)\n\tname.split(' ')\nend", "title": "" }, { "docid": "32459b29d682c4a02a0c5d166f830b93", "score": "0.63884336", "text": "def generate_array\n array = @string.scan(/.../) \n array.j...
2edbac3b68f19f2f67e363ff25762339
Part 3 Total price to make :
[ { "docid": "ec1aa6f430af0d9ea5a0eff7d2cb3fc1", "score": "0.0", "text": "def making_price\r\n @mp = (@cocktails.to_i * 8) + (@beers.to_i * 3) + (@waters.to_i * 0.15)\r\n puts \"The total cost to make the drinks is #{@mp}\"\r\n end", "title": "" } ]
[ { "docid": "32455a0d22b5dbc228b2e6b553c2a10a", "score": "0.73469967", "text": "def total_price\n \tproduct.price * quantity #this calculates the total price of each line_item\n end", "title": "" }, { "docid": "edb15bc086fb6609ef46cf366496ba04", "score": "0.73257434", "text": "def s...
d30745861d62ab7f9c1d53ecec255feb
Move Action Waiting (This is for specialized attacks)
[ { "docid": "ea790bc2bd3b76c8fa43f9bff19d2fbe", "score": "0.7678609", "text": "def move_action_waiting\n @move_actions.size > 0\n end", "title": "" } ]
[ { "docid": "7fe279bc7f1fb0d2487acbb369f19c08", "score": "0.7097646", "text": "def run\n move\n check_must_attack\n end", "title": "" }, { "docid": "e4e2a8d7625a729cec11894437eb5bdb", "score": "0.7007931", "text": "def process_move\n\t\tblock_successful = false\n\t\t\n\t\tbegin...
5ae47cc0ef4fa07d254146abfd6c9f30
DRY up our routes by creating a reusable DB query function
[ { "docid": "d9c87f462a1894e54fc9b8a02c020bc6", "score": "0.0", "text": "def db_query( sql )\n db = SQLite3::Database.new 'database.db'\n db.results_as_hash= true\n puts \"++++++++++++++++++++++++++++++++++++\"\n puts sql #for debugging\n puts \"++++++++++++++++++++++++++++++++++++\"\n result = db...
[ { "docid": "a1d2c800cba1d172fd450378b5368a23", "score": "0.59576094", "text": "def queries; end", "title": "" }, { "docid": "a1d2c800cba1d172fd450378b5368a23", "score": "0.59576094", "text": "def queries; end", "title": "" }, { "docid": "921bab78fba869c9ff213b07e59908d2",...
5f188722128a1f57ddf100c1a7977fe6
Find the highest priority process
[ { "docid": "cdf06c6320d4735088d1ef8081e837c8", "score": "0.8071372", "text": "def highest_priority\n # Find first non empty priority level\n # and return the first process\n @lists.reverse_each do |list|\n return list.first unless list.empty?\n end\n end", "title": "" } ]
[ { "docid": "e3441fe7e59fe384931c1824a897f4c2", "score": "0.7224474", "text": "def min_priority\n min[1] rescue nil\n end", "title": "" }, { "docid": "a8372abdda2f2b5e1a5ba7761d251fb2", "score": "0.7121981", "text": "def top_priority\n top_priority_and_value = @queue.last\n ...
3db80bee43cf82c5db8225620bf714e9
Get necessary details from saas. Author: Alpesh Date: 18/01/2018 Reviewed By:
[ { "docid": "259aeab558c9a1e327ba6b8b689a6ccd", "score": "0.6786324", "text": "def get_details_from_saas\n total_gas_for_mint = GlobalConstant::ContractDetails::StakeCurrency.gas[:approve].to_i(16) + GlobalConstant::ContractDetails::GatewayComposer.gas[:requestStake].to_i(16)\n params = {\n ...
[ { "docid": "aa9dd6797b38dbd7934ad5142dc89b73", "score": "0.617281", "text": "def collect_soa_details(lookup_name)\n _log \"Checking start of authority\"\n response = resolve(lookup_name, [Resolv::DNS::Resource::IN::SOA])\n return nil unless response && !response.empty?\n\n data = response.fi...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "8138048229c435f02e3d16d9b3eccdd2", "score": "0.0", "text": "def part_params\n params[:part].permit(\"part_id\", \"name\")\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7120904", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70538116", "text": "def expected_permitted_parameter_names; end", "title": "...
36987f3fbc72884bff9810d9d7cec766
////////////////////////////////////////////////////////////////////////// Public Methods ////////////////////////////////////////////////////////////////////////// Draw the icon on the window
[ { "docid": "552de18c1cff7b06230866f50ccb9061", "score": "0.7771379", "text": "def draw()\n if self.iconIndex != nil\n bitmap = Cache.system(\"IconSet\")\n @cIcon.img_bitmap = bitmap\n @cIcon.src_rect = Rect.new(self.iconIndex % 16 * 24, self.iconIndex / 16 * 24, \n ...
[ { "docid": "d7338d39a41fb00091f847afe9fc905b", "score": "0.73786575", "text": "def gab_draw_icon\n dx = 12\n dy = 12\n icon_index = @index\n draw_icon(icon_index, dx, dy)\n end", "title": "" }, { "docid": "65d828940060899f6151b61ca7a56712", "score": "0.7232433", "text": ...
6df7b7f1ab27d0fa863a23145839542d
Computes the total gain as a percentage of the initial investment
[ { "docid": "a91691417637fb0af8fb7a26155ce57f", "score": "0.7047085", "text": "def overall_yield\r\n (total_gain * 10000/ initial_value).round / 100.0\r\n end", "title": "" } ]
[ { "docid": "6db05f4c8d1218c40e255701be3aa276", "score": "0.82811064", "text": "def total_gain\r\n (((current_value - initial_value) - @commission) * 100).round / 100.0\r\n end", "title": "" }, { "docid": "b92f205fdfba73fda00c4466293d3104", "score": "0.72663695", "text": "def delt...
9fffa1cd1e5b7ea9b89b3a60739d2b75
Returns new mapped role for given role used by SafeAttributes. This method should only be used to test own role mapper implementations without need for a full application. See AttributeExt specs for details. See +role_mapper+ method in SafeAttributes module for how to set a role mapper.
[ { "docid": "16dac324cd863d815ba3d78b1055c109", "score": "0.70106924", "text": "def safe_attributes_role(role = nil)\n return AttributeExt::SafeAttributes.role_mapper.call(role) unless AttributeExt::SafeAttributes.role_mapper.nil?\n return AttributeExt::SafeAttributes.default_role if role.nil? ...
[ { "docid": "bb3dd2ad85607b6638f0bc943ea21c3c", "score": "0.6183803", "text": "def assign_role(role = :villager)\n klass = role.to_s.classify.constantize\n if klass.new.is_a?(Player)\n self.update_attribute(:type, role.to_s.classify)\n klass.find(self.id)\n else\n false\n end\n...
0ba0a44046f5d1399aa071d0d9e248c2
List read roles for an archive. Returns all read roles a given archive is restricted to.
[ { "docid": "ed3aabd3b677866e63c2bafff5e777d2", "score": "0.6946989", "text": "def list_archive_read_roles_with_http_info(archive_id, opts = {})\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LogsArchivesAPI.list_archive_read_roles ...'\n end\n #...
[ { "docid": "41286bd9cedec6b706df998d28d06e59", "score": "0.83255804", "text": "def list_archive_read_roles(archive_id, opts = {})\n data, _status_code, _headers = list_archive_read_roles_with_http_info(archive_id, opts)\n data\n end", "title": "" }, { "docid": "e20549a06d3b76d27...
2a6ed19efb0906fd0f2a5e240adf4f58
start with face down
[ { "docid": "19a2ce66ea1676e997aba2c06498dbdb", "score": "0.0", "text": "def initialize(value)\n @value = value\n @face = :down\n end", "title": "" } ]
[ { "docid": "c8d2d395264c8b4127883e7961d1e598", "score": "0.77983344", "text": "def face_down!\n\t\t@status = :face_down\n\t\tself\n\tend", "title": "" }, { "docid": "84aac1eeec0f6f37f331864f67989eea", "score": "0.7331185", "text": "def turn_face_down\n @is_face_up = false\n end",...
370ee7b0c94e5a7f48c04c673d9a1f95
Set the array of path elements to clip the drawing of the gradient fill.
[ { "docid": "01aeddfec4f6e9c1d670e1fdebe2edb7", "score": "0.0", "text": "def arrayofpathelements=(pathElements)\n arrayOfPathElements = pathElements\n if arrayOfPathElements.respond_to? \"patharray\"\n arrayOfPathElements = arrayOfPathElements.patharray\n end\n @eleme...
[ { "docid": "e47b4760e23df387554013c31f454660", "score": "0.5195302", "text": "def clip(rect)\n self.dup.clip!(rect)\n end", "title": "" }, { "docid": "b98e21789e64a14bd5a4b48525486753", "score": "0.5182588", "text": "def draw_clipped(x1, y1, x2, y2, &block)\n end", "title": ...
2723a1607a1ac1e32e387e5872d8cbcb
Initializes an object to calculate the checksum of a file. The given ``digest_klass`` should implement the ``DigestClass`` interface. Note that the builtin Ruby digest classes duck type this properly: Digest::MD5, Digest::SHA1, etc.
[ { "docid": "aecb44ed066c90d79a8cf738d71873e9", "score": "0.721575", "text": "def initialize(path, digest_klass)\n if digest_klass.is_a?(Class)\n @digest_klass = digest_klass\n else\n @digest_klass = load_digest(digest_klass)\n end\n\n @path = path\n end", "title": "" } ]
[ { "docid": "6024868a929f022fd5958a6eec52d8ce", "score": "0.69196683", "text": "def checksum_file(digest_class, path)\n digester = digest_class.new\n digester.file(path)\n digester.hexdigest\n end", "title": "" }, { "docid": "eae54eb041e41d4957e3bfb3f125c297", "s...
2609342c6a2b46ab00b52057382e8f2e
Constructor. Sets up some defaults for the solaris 10 platform and calls the parent constructor
[ { "docid": "d204ebd0c7738d82acb1aac5d53149e7", "score": "0.6705862", "text": "def initialize(name)\n @name = name\n @make = \"/opt/csw/bin/gmake\"\n @tar = \"/usr/sfw/bin/gtar\"\n @patch = \"/usr/bin/gpatch\"\n @sed = \"/opt/csw/bin/gsed\"\n @shasum = \"/opt/csw...
[ { "docid": "5b0742d8682a12072eeb1436e3f98e99", "score": "0.6546159", "text": "def initialize\n\t\t\t@os_name = get_os_name\n\t\tend", "title": "" }, { "docid": "da253d49bdaea2b1b83b62208b203c93", "score": "0.6106659", "text": "def initialize(path,platform,archs=[])\n super(path)...
bcf01dedcbca83aee3c1d111761bc813
Serialize the a ProtocolMessage instance to a string
[ { "docid": "a53c0fe9b3ab050ba96491d963f00252", "score": "0.0", "text": "def serialize\n \n end", "title": "" } ]
[ { "docid": "edab499c1f4a3379b3bf534b864ac7da", "score": "0.7310175", "text": "def serialize(message)\n message.to_msgpack\n end", "title": "" }, { "docid": "67432bfabfff39e155bb6ecb076e604a", "score": "0.72832966", "text": "def serialize_to_string\n sio = ProtocolBuffers...
ef1d0d5cec0db64461bc8da61753e2c0
GET /descriptors GET /descriptors.json
[ { "docid": "217b957b82f17f66e9a220e64f89458c", "score": "0.6888409", "text": "def index\n @descriptors = Descriptor.all\n end", "title": "" } ]
[ { "docid": "9f1445d04ec6758184ce614307b57411", "score": "0.57881224", "text": "def descriptors\n @descriptors ||= (attributes + parameters)\n end", "title": "" }, { "docid": "5d2525d30bb20086481778a218a1c30e", "score": "0.5671843", "text": "def index\n respond_to do |forma...
bfbcddcc918ef40f76e5014276919dbc
Preview this email at
[ { "docid": "1a7028c65fe5bee4b410f20066bebf81", "score": "0.0", "text": "def appointment\n ReminderMailer.appointment\n end", "title": "" } ]
[ { "docid": "947d18f31928dcf9761bdcbda7f18565", "score": "0.71475905", "text": "def preview\n @email = Email.find(params[:id])\n render :text => @email.body\n end", "title": "" }, { "docid": "f9cb02c07e98bbf5e69bcea1540cfe24", "score": "0.71186084", "text": "def preview\n @e...
7a78f139b5e1c944f2ff6d548e52454b
Returns the maximum bound for the graph's yaxis Param node: The node_id of the node of interest
[ { "docid": "97aa8f1420af07fd93175b573e672420", "score": "0.0", "text": "def upperQuartile(node)\n\t\t# Max humidity value from the node in the past day\n\t\tmax_hum = Reading.select(:humidty, :recorded_at).where(node_id: node, recorded_at: Time.zone.now.beginning_of_day..Time.zone.now.end_of_day).maximu...
[ { "docid": "0e9c0bb95d3d7d3a53e1af137ea9bfee", "score": "0.62651354", "text": "def max_point\n # generate the bounding box if not already done\n bounding_box\n # return the max\n @max\n end", "title": "" }, { "docid": "90c0d35d161eef42f3d88503ce207ce0", "score": "0...
5786752c9a6791ede11f3185cb0a3d3f
DELETE /fb_logouts/1 DELETE /fb_logouts/1.json
[ { "docid": "11f4152164cdf8868f71b02a1283dbff", "score": "0.7941662", "text": "def destroy\n @fb_logout = FbLogout.find(params[:id])\n @fb_logout.destroy\n\n respond_to do |format|\n format.html { redirect_to fb_logouts_url }\n format.json { head :no_content }\n end\n end", "ti...
[ { "docid": "7795113a40e721c0e69d8ec121eea354", "score": "0.6947967", "text": "def logout\n request(:post, '/api/logout/')\n end", "title": "" }, { "docid": "82d542ee5c9b2f5b33f8c166e6103b42", "score": "0.69052106", "text": "def logout\n query_rest('logout_ok', :action =>...
28f2aca59811d5c6482f3f593e90083e
Returns the standard deviation of the marking time of the staff.
[ { "docid": "a699dc9588847de6c1e5f5151f738948", "score": "0.6853839", "text": "def marking_time_stddev\n # An array of time in seconds.\n time_diff = valid_submissions.map { |s| s[:published_at] - s[:submitted_at] }\n standard_deviation(time_diff)\n end", "title": "" } ]
[ { "docid": "3bba0d3c9190e2898408054377946b00", "score": "0.6879469", "text": "def standard_deviation\n return Math.sqrt(self.variance / (self.length - 1))\n end", "title": "" }, { "docid": "3bafdf5649109983a0e8193248f9c988", "score": "0.6767664", "text": "def stdev\n return Ma...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "c848236192cfa505dd6173361867a4f5", "score": "0.0", "text": "def favorite_series_params\n params.fetch(:favorite_series, {})\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74964964", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957765", "text": "def strong_params\n params.require(:request).permit(param_whit...
62a369e86382e9e3e1d50ee6717740e8
Request creation receives a reference to the socket over which the client has connected
[ { "docid": "c73142e8784b41841d763651cde7cca2", "score": "0.0", "text": "def initialize(socket)\n # Perform any setup, then parse the request\n @socket = socket\n @http_method = ''\n @uri = ''\n @extension = ''\n @headers = Hash.new\n @params = Hash.new\n #parse re...
[ { "docid": "9c40ef9413bfaa6a42425b7d5d7c2500", "score": "0.7101462", "text": "def cork_socket(socket); end", "title": "" }, { "docid": "31b76afce45759d480981c6f9f7f79e9", "score": "0.70865935", "text": "def socket; end", "title": "" }, { "docid": "31b76afce45759d480981c6f...
e3cedf745b33c69f1813207237de9535
Strip the image of extra data (comments, profiles, etc.)
[ { "docid": "937d1b57c0b4e0b6e7d3cf3331088228", "score": "0.5971364", "text": "def strip\n @status = FFI::GMagick.MagickStripImage( @wand )\n end", "title": "" } ]
[ { "docid": "bdd0a86e4a462fd20aec53b5d97ffbae", "score": "0.6425136", "text": "def strip_extra_content(item, locale=I18n.locale)\n strip_tags(exclude_base64(raw_value(item, locale)))\n end", "title": "" }, { "docid": "2753876d0f39570b3ee57802c71c7c5e", "score": "0.6330926", "text"...
7e768c6f157d76ec844ce71be8ead0c5
Deleted a key and value associated with it
[ { "docid": "86220d3b1d84d8c58682b9bdca45d381", "score": "0.8152601", "text": "def delete(key); end", "title": "" } ]
[ { "docid": "2c5de3f651e373808629f278a0f5a9f6", "score": "0.8360955", "text": "def delete(_key) end", "title": "" }, { "docid": "6b373c08a14460aaeeb54de7abc8f2a3", "score": "0.79285204", "text": "def delete(key)\n end", "title": "" }, { "docid": "08bea026a677570d523d053...
d54e93007cd48e6a9eb9ae327884cb0c
uses the same format as
[ { "docid": "664da1fd4ddf38e416cd8f79ec37a579", "score": "0.0", "text": "def set_mentions\n self.entities = { user_mentions: Twitter::Extractor.extract_mentioned_screen_names_with_indices(body) }\n end", "title": "" } ]
[ { "docid": "2b8546ebac55b2f2e16e77a2e31ae03f", "score": "0.7892263", "text": "def formats; end", "title": "" }, { "docid": "2b8546ebac55b2f2e16e77a2e31ae03f", "score": "0.7892263", "text": "def formats; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", ...
199d215f2b21dbfb3307d7e1e2d66970
action create DELETE /admin/articles/:id
[ { "docid": "24e566e3b829719512b53b3e63edf3c4", "score": "0.7670878", "text": "def destroy\n @article = Article.find params[:id]\n @article.destroy\n \n append_flash :warning, \"Article was successfully deleted\", true\n redirect_to admin_articles_url\n end", "title": "" } ]
[ { "docid": "ccaf17f99b60511a325de28933cc304e", "score": "0.79991597", "text": "def destroy\n if admin\n @article = Article.find(params[:id])\n @article.destroy\n else\n redirect_to articles_path\n end\n end", "title": "" }, { "docid": "6c53b7458c3cd01d43f9582955041c8...
7da826b0aa7bdab9bb2cf979d5bc002e
Doc is an PublishedDocument
[ { "docid": "09eef887e46e4ed2a812ab134fd827b4", "score": "0.0", "text": "def consume(doc)\n raise Errors::ActionMethodNotImplemented, 'Consume actions must overwrite the consume method.'\n end", "title": "" } ]
[ { "docid": "449057f71b50f0fec2f7a262797c9e9d", "score": "0.74371314", "text": "def get_existing_published_document(doc)\n @caller.get_existing_published_document(doc)\n end", "title": "" }, { "docid": "5835c6663918bb3b8dda0688ed116e72", "score": "0.70014596", "text": "def...
2dde90306ecd43865a16f20990491feb
write tree to xml
[ { "docid": "1de1505d3f300ba1f4e56a52ccd7a738", "score": "0.79529065", "text": "def write_tree(file, tree)\n # target = stream to write to\n # indent = indent in spaces\n builder = Builder::XmlMarkup.new(target: file, indent: 2)\n # first node == tree\n # step down to others\n builder.tree(entropy:...
[ { "docid": "a37310b2dca6d2658e77781bab13e195", "score": "0.80091214", "text": "def WriteTree \n\t\twriteNodes(@root)\t\n\tend", "title": "" }, { "docid": "c0064867c1211c214e7caa014cb5ad9e", "score": "0.7205207", "text": "def write(xml)\n end", "title": "" }, { "docid...
4fb787a9fad0b637e88a1bdff40b39f4
Create a new span linked to the given tracer. Call the finish() method once the tracer operation is over or use the finish_at(time) helper to close the span with the given +time+. Available options are: +service+: the service name for this span +resource+: the resource this span refers, or +name+ if it's missing +span_...
[ { "docid": "45103fab1d907465e96b0f634503054c", "score": "0.6162154", "text": "def initialize(tracer, name, options = {})\n @tracer = tracer\n\n @name = name\n @service = options.fetch(:service, nil)\n @resource = options.fetch(:resource, name)\n @span_type = options.fetch(:span_...
[ { "docid": "8b558cacbca6f66d50d16e00e2b9e632", "score": "0.64622766", "text": "def internal_create_span parent, span_id, parent_span_id, name, kind,\n start_time, end_time, labels\n span_id = span_id.to_i\n parent_span_id = parent_span_id.to_i\n ...
6d6552bef05cf5307e9ce947d67e3bc7
def to_s return name end
[ { "docid": "9a6eaff930a84a478a9072012f05a136", "score": "0.0", "text": "def adoption(animal_name, client_name)\n\n # finds animal object from Shelter's array and adds it to given client's pet array\n # how to find the client's pet array? \n $happitails.get_clients.each do |client_object| \n ...
[ { "docid": "2e3568e46836d5a1b2843b4ade9178ae", "score": "0.9820401", "text": "def to_s() @name end", "title": "" }, { "docid": "9abaf728b516cc848ccdeca8bcdc32db", "score": "0.9819524", "text": "def to_s; name end", "title": "" }, { "docid": "08d2898bd948ff8d76f15a378978be...
9c6fd23646e0ac20040fbfa2c53e5b41
Update a metadata proxy Update a metadata proxy
[ { "docid": "ca4d2a1cb78b1c9f39b7a70cb4354068", "score": "0.67027336", "text": "def update_metadata_proxy_with_http_info(proxy_id, metadata_proxy, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.update_metadata_proxy ...\"\n end\n...
[ { "docid": "5423a1a8ef0d08c7a02a8f5d8906bd9d", "score": "0.76726675", "text": "def update_metadata_proxy(proxy_id, metadata_proxy, opts = {})\n data, _status_code, _headers = update_metadata_proxy_with_http_info(proxy_id, metadata_proxy, opts)\n data\n end", "title": "" }, { "do...
a24c134822e02604f19f696f24197a5a
Returns the Ory Network Project selected in the Ory Network Console Use this API to get your active project in the Ory Network Console UI.
[ { "docid": "1dc73bcabb5f6d3af6379c3333fddbab", "score": "0.6117792", "text": "def get_active_project_in_console(opts = {})\n data, _status_code, _headers = get_active_project_in_console_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "fa270c946c4c876d066642723d468aee", "score": "0.64370084", "text": "def find_active_project\n if @textmate.documents.first\n active_path = @textmate.documents.first.path\n @projects.find {|p| active_path =~ /^#{p.path}/}\n end\n end", "title": "" }, { "d...
5b7291c20816fe1d68719312acb276c2
check if kind of relationship is group membering
[ { "docid": "ea190f23c955d208612df60ece834bb0", "score": "0.8064129", "text": "def group_member?\n kind == 'group_member'\n end", "title": "" } ]
[ { "docid": "161a9e8d6838217cfed53caaa9c819b4", "score": "0.75590175", "text": "def belongs_to_group?\n self.group ? true : false\n end", "title": "" }, { "docid": "00a5e357ccc566255ae3de604e89a470", "score": "0.7254458", "text": "def is_member_of?(group)\n current_person.dogs...
f7b0caedf6ef69c1af1d0da0d38d7419
Returns an Array of file paths that match a valid path and maps to a known template engine. app.template_files 'views/foo' => ['views/foo.erb', 'views/foo.md']
[ { "docid": "989dcccce7dd23adcc0a3c42471be0a3", "score": "0.7831796", "text": "def template_files path\n exts = template_engines.keys.map{|e| \".\" << e if e }.join(\",\")\n Dir[\"#{path}{#{exts}}\"]\n end", "title": "" } ]
[ { "docid": "ead396ee190eb6a9ed3dd55a4ba327a7", "score": "0.7517655", "text": "def files\n templates.map(&:filename)\n end", "title": "" }, { "docid": "777d9c20f1c66126ffc6cf277616c3b2", "score": "0.74883574", "text": "def template_files\n Pathname.glob(staged_roo...
aedd39b961f0faf3cb2b4e27e8ea6282
def best all(:limit => 10, :order => 'strokes_total DESC') end
[ { "docid": "3340e9bf5450d78c138e91084a5d1d91", "score": "0.0", "text": "def available_users\n User.all - users\n end", "title": "" } ]
[ { "docid": "bf9742c7082e64892c640f91b7d98bb8", "score": "0.7233229", "text": "def bests\n \n end", "title": "" }, { "docid": "fa98a4a89e2637fb41358ae79fe836ed", "score": "0.66813195", "text": "def worst\n top\n end", "title": "" }, { "docid": "2670e923c3ae909d...
fee268600237cb5a6522365fc74d7206
creating helpdek user for livia employee user
[ { "docid": "d971a1d83d99d4df81666260a9cd5849", "score": "0.6830947", "text": "def create_helpdesk_user(company,password,role_id)\n if APP_URLS[:use_helpdesk]\n begin\n if role_id !=''\n url = URI.parse(APP_URLS[:helpdesk_url] + \"/users/clepsotda\")\n if url.scheme == 'h...
[ { "docid": "1c144d6d4afcee131a439affe0c4bd5e", "score": "0.6973831", "text": "def create_employee_user\n email = self.work_email\n user = User.new(email: self.work_email, password: 'appsimpact@#123', role: 'employee')\n user.save\n self.user_id = user.id\n end", "title": "" }, { ...
d9f6aa52f1f9087af5c958f26a3f41ea
wow, this is gross
[ { "docid": "3e58958e3863272bbeca9ce8f32d4d5d", "score": "0.0", "text": "def runs\n @_runs ||=\n begin\n [].tap do |runs|\n prev = nil\n digits.each_cons(2) do |a, b|\n if a == b\n if prev.nil?\n runs << 2\n prev = a\n...
[ { "docid": "ebfd3747e955fae2fd0785c2327b1a41", "score": "0.66805845", "text": "def breathe\n \"i get oxygen from the water\"\n end", "title": "" }, { "docid": "6e1471c709e987fdc94dc507cf7b6626", "score": "0.6596108", "text": "def does\n puts \"ALL THE THINGESSSS!!!eleventy\"\nend"...
7bbc54a7428abeaf83dbe20288ea0e28
PUT /casts/1 PUT /casts/1.xml
[ { "docid": "e187ae95b299863224b22873e2cda98b", "score": "0.53486466", "text": "def update\n @check=true\n if !admin_signed_in?\n @check = false\n redirect_to (:controller => :home, :action => :index)\n return\n end\n @cast = Cast.find(params[:id])\n\n resp...
[ { "docid": "8f553fe24c2b5c22a1a14de33f04562d", "score": "0.65773517", "text": "def update\n @cast = Cast.find(params[:id])\n\n respond_to do |format|\n if @cast.update_attributes(params[:cast])\n flash[:notice] = 'Cast was successfully updated.'\n format.html { redirect_to(@cast...
eea9c776c79a91561f00cdd3b7e010ef
Runs the dynamic Sass code and computes the CSS for the tree.
[ { "docid": "b370b36a814780cc30165c0067984353", "score": "0.0", "text": "def render; end", "title": "" } ]
[ { "docid": "81a641575718fa8e13a905fa7a6eb4cc", "score": "0.68692046", "text": "def compile_scss\n puts \"\\nCompiling assets for stylestats...\".color(:blue)\n if is_rails?\n\n # Get rake tasks\n Rails.application.load_tasks unless @config.is_dev?\n compile_scss_...
dbbfab8a9dbb76611a80951f646034e2
Write your code here!
[ { "docid": "d0e81868d3f23775d22c4e097d9aee2f", "score": "0.0", "text": "def game_hash\n hashketball = {\n :home => {\n :team_name => \"Brooklyn Nets\",\n :colors => [\"Black\", \"White\"],\n :players => {\n \"Alan Anderson\" => {:number =>0, :shoe=>16, :points=>22, :rebounds=>1...
[ { "docid": "f45f5fa6d32a5d296e5153caa3d92701", "score": "0.74495405", "text": "def code; end", "title": "" }, { "docid": "f45f5fa6d32a5d296e5153caa3d92701", "score": "0.74495405", "text": "def code; end", "title": "" }, { "docid": "f45f5fa6d32a5d296e5153caa3d92701", "...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "d02e8df1fb10ff5c52979cf5cd9448ea", "score": "0.0", "text": "def url_link_params\n params.require(:url_link).permit(:url)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6980629", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.67819995", "text": "def strong_params\n params.requ...
97ed3d3d68f5ed22fa4271837e8220a6
TODO: Merge following tests into one case with parameters
[ { "docid": "c70b6f134bfff398c7be00612e7dca85", "score": "0.0", "text": "def test_emit\n d = create_driver\n\n d.run do\n sleep 2\n end\n\n emits = d.emits\n assert_equal true, emits.length > 0\n assert_equal [\"tag1\", @test_time, {\"k1\"=>\"ok\"}], emits[0]\n assert_equal_even...
[ { "docid": "0ed5036e40dc2ffbabaa5175a4fecb06", "score": "0.6129535", "text": "def stest_method_1(test); end", "title": "" }, { "docid": "932bc9dc71b64bafde4421a65d562475", "score": "0.6099254", "text": "def test_exercise_1122\n verify_method :exercise_1122,\n ...
d6ba81095fb92cab39c0bd6988f8cab9
Translation returning a new list. See translate!
[ { "docid": "d1e8ef2964ad6e5c779256beddda0587", "score": "0.0", "text": "def translate(integer)\n self.dup.translate!(integer)\n end", "title": "" } ]
[ { "docid": "e53b6a4197cf223e0ad9b72c79cfc3aa", "score": "0.6894813", "text": "def get_translated_list(list_name)\n list = get_controlled_vocab(list_name)\n list.map!{ |e| [I18n.t(\"#{list_name}.#{e}\".to_sym), e]}\n list.sort { |x,y| x.first <=> y.first }\n end", "title": "" }, { "...
b955b536a9cbcf1dbe6d392934984409
method to get rank based on team score and speaks the solution is to use a weighted system where the speaks are treated with a value of 1 and the a single point for score is at minimum larger than the maximum number of speaker points for the tournament the worlds tournament has 9 rounds with a max speaker rating of 100...
[ { "docid": "798337c1d97033057d9b95a74432119c", "score": "0.7972072", "text": "def calc_rank\n return (self.score * 20001) + self.speaks;\n end", "title": "" } ]
[ { "docid": "6b1c37c0ad4e930f2816ec5785fc2893", "score": "0.65632665", "text": "def calculate_team_ranking_score(number_of_meetings = 2, number_of_bests = 3)\n team_ranking_results = []\n events = []\n if @badge.category_type.code != 'U25' &&\n @badge.meetings.distinct.count >= number_of_m...
db4855efb94661b7db4f0a41d8b19bdf
GET Displays a receipt.
[ { "docid": "cca3dab4cd64277ec2f46b9a5720f648", "score": "0.0", "text": "def receipt\n @auth_code = params[:x_auth_code]\n end", "title": "" } ]
[ { "docid": "a29674d0ce2974dd2c75cc2e18fc1fcd", "score": "0.7481614", "text": "def show\n @receipt = Receipt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @receipt }\n end\n end", "title": "" }, { "docid": "5dbd91e1...