query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
7dd4f1207880e9a8f89821d29fdb45a8
PUT /perodizations/1 PUT /perodizations/1.json
[ { "docid": "d8eaf90168aa9eeb1b5738de261c6cfe", "score": "0.6576654", "text": "def update\n @perodization = Perodization.find(params[:id])\n\n respond_to do |format|\n if @perodization.update_attributes(params[:perodization])\n format.html { redirect_to @perodization, notice: 'Perodizat...
[ { "docid": "470369b7ff586fc5881b51a88bb20440", "score": "0.62707907", "text": "def update\n authorize! :update, CompetenceType\n @competence_type.update!(competence_type_params)\n render json: {status: :ok}\n end", "title": "" }, { "docid": "4cf4099e532bf79be32896520e049f68", "...
d65a78636318dd65e362d8de6a5665ec
Add a scanner to the default configuration.
[ { "docid": "21497c3b155466131e534f6ab9e99a21", "score": "0.6796463", "text": "def add_scanner(scanner_class_name, scanner_opts = {})\n scanners = I18n::Tasks::Configuration::DEFAULTS[:search][:scanners]\n scanners << [scanner_class_name, scanner_opts]\n scanners.uniq!\n self\...
[ { "docid": "78320519d526c9a2bc6582936aaa56ab", "score": "0.6761449", "text": "def add_scanner(scanner_class_name, scanner_opts = T.unsafe(nil)); end", "title": "" }, { "docid": "7c66c1049157874eeca9b8a4573e207f", "score": "0.66386664", "text": "def apply_default_scanner_config!\n ...
2d8fabeaf99e14a5aaaa8a3bfabde3b2
add text to the image
[ { "docid": "a16fcf520956217ce97409ce49b56d5d", "score": "0.0", "text": "def label(words, x,y,size=12, color=\"fff\", font_family=\"Helvetica\", font_style=\"normal\")\n @yield += %Q!<text x=\"#{x}\" y=\"#{y}\" font-family=\"#{font_family}\" font-style=\"#{font_style}\" font-size=\"#{size}px\" fill=\"...
[ { "docid": "2af83e8df064cd35f627c521ddc7e665", "score": "0.8300545", "text": "def add_text\n if model.text_bool\n @text = model.image_text\n @text = word_wrap(@text, line_width: 35)\n if file\n @width, @height = ::MiniMagick::Image.open(file.file)[:dimensions]\n end\n ...
f11172f7a83aade87d9655d18a40de9f
update_design_checks Description: This method takes in a list of design checks and processes each one to determine if the check was updated and if it was then the database is updated. Parameters: [check_xxx] where xxx identifies the check id of the design check being passed in. Return value: None Additional information...
[ { "docid": "02bf0abfa1c1bb43c6101cf52edc54b6", "score": "0.7036866", "text": "def update_design_checks\n\n audit = Audit.find(params[:audit][:id])\n subsection_id = params[:subsection][:id]\n \n # Keep track of the audit state to determine where to redirect to\n original_state = a...
[ { "docid": "e6c62ecb6a71c6cf5a8abf4b71a51cb6", "score": "0.59411114", "text": "def test_update_design_checks\n\n # Log in as a designer and get the audit listing.\n designer = @rich_m\n\n audit = Audit.find(audits(:audit_mx234b).id)\n assert_equal(designer.id, audit.design.designer_id)\n ...
fb9e8706a7a6d3c9f6b4c33217dd979f
Sets the passwordMinutesOfInactivityBeforeLock property value. Minutes of inactivity before a password is required.
[ { "docid": "e9e1aaf032861dc1ea0f80adfa92cc0f", "score": "0.8519618", "text": "def password_minutes_of_inactivity_before_lock=(value)\n @password_minutes_of_inactivity_before_lock = value\n end", "title": "" } ]
[ { "docid": "0b8f427cb1c2c64fd4a8cf3bda89f405", "score": "0.7825815", "text": "def passcode_minutes_of_inactivity_before_lock=(value)\n @passcode_minutes_of_inactivity_before_lock = value\n end", "title": "" }, { "docid": "10a72a4f3d4f7fd1a9e989019c999b4e", "scor...
4494275e56fb353477d4456767a4dea9
Verifies that all required fields for the type are present. :command_id, :request_id, and :is_request are all required.
[ { "docid": "ac90a4328a60cfc2cb90c239af8deb3f", "score": "0.61082697", "text": "def validate(data)\n # Make sure they passed in a command_id and request_id\n if(data[:command_id].nil?)\n raise(DnscatException, \"Required field missing: :command_id\")\n end\n if(data[:request_id].nil?)\n ...
[ { "docid": "416ea18aaad585815a87a22d36cc71f2", "score": "0.6748964", "text": "def validate\n required_attributes = [\n :name,\n :md5,\n :description,\n :type\n ]\n\n required_attributes.map do |ra|\n self.send(ra)\n end.include? nil\n\n end", ...
fc7fb347f5d28c108c4e85f172e98af8
=begin Needs to use default array punctuation for arrays > 2. No punctuation default for arrays == 2 Create if statement for array.size == 2 that uses no punctuation Set default punctuation to ',' =end
[ { "docid": "ab46052ccbb7dd30c3a7679538e9cd3c", "score": "0.58037436", "text": "def joinor(array, punctuation=', ', conjunction='or')\n return array.join if array.size <= 1\n return \"#{array[0]} #{conjunction} #{array[1]}\" if array.size == 2\n number_string = String.new\n for i in (0..(array.size -...
[ { "docid": "5f8018c206842af4042e6435619608b4", "score": "0.65470654", "text": "def array_to_paragraph(array)\n if array.size == 0\n 'None.'\n else\n array.to_sentence(:last_word_connector => ' and ').html_safe + '.'\n end\n end", "title": "" }, { "docid": "c4971c77425ec25...
ac5a039bb965686996a2bde953a55cff
=== dfdx function: Return f'(x) for argument x === The f'(x) used this time is " f'(x) = 3x^2 32x + 73 "
[ { "docid": "61b6fdfaea04bc2573eb471ddeab9916", "score": "0.8693784", "text": "def dfdx ( x )\n return (3 * (x**2)) + ((-32) * x) + (73)\nend", "title": "" } ]
[ { "docid": "7e76274aad55e8b881babac8037b1174", "score": "0.7238829", "text": "def cdf(x)\r\n 1 - q(x)\r\n end", "title": "" }, { "docid": "5d0caf140188b715d5259fb4921747da", "score": "0.72166985", "text": "def df_dx(f, x, dim)\n if GPhys === f\n mdl = NumRu:...
ef767606bb8f3013c185adcfa995e083
Read and print the records in an array of hashes values_hashes the array of hashes mapping Header Record values to Record values
[ { "docid": "7a77b56a27d2009a20e0c91df0ca9fba", "score": "0.7035366", "text": "def printRecords(values_hashes)\n\tvalues_hashes.each_with_index{\n\t\t|item, i|\n\t\tputs \"Reading Record #{i+1}\"\n\t\tputs \"Left dashboard switch (0 or 1): #{item['LD']}\"\n\t\tputs \"Right dashboard switch (0 or 1): #{it...
[ { "docid": "b57870e1bcd58efd9b96e1b888c9f6fb", "score": "0.6390086", "text": "def records\n # Get to the end of the header\n @fh.seek(20)\n records = []\n while not @fh.eof?\n record = @fh.readpartial(800).unpack(\"Z260VVQVa520\")\n break if @fh.eof?\n records.push({\n ...
f668097c9a15e0fe6d84b3928d01880e
returns: right side of the operation
[ { "docid": "ffed59a558df7a4077022277c835f5af", "score": "0.6905009", "text": "def right\n return @right\n end", "title": "" } ]
[ { "docid": "591b311f241ce124acea4dd59a9feefd", "score": "0.7339433", "text": "def right\n operands.last\n end", "title": "" }, { "docid": "2d9722b1bd24aa8e305a7c92edf39556", "score": "0.73175764", "text": "def right(x); end", "title": "" }, { "docid": "72a9d8b...
15d20ea844f6ef26be30533ba6f8b3ed
PATCH/PUT /groupes_de_sessions/1 PATCH/PUT /groupes_de_sessions/1.json
[ { "docid": "1fcc5d358d6645abd62040b292595499", "score": "0.72241837", "text": "def update\n respond_to do |format|\n if @groupe_de_sessions.update(groupe_de_sessions_params)\n format.html { redirect_to @groupe_de_sessions, notice: 'Groupe de sessions was successfully updated.' }\n ...
[ { "docid": "c53fdbafebb96b41db600e393e5b003e", "score": "0.68526185", "text": "def touch\n session_check!\n begin\n JSON.parse(put(full_path(\"sessions/#{session_id}\")))\n rescue => error\n handle_request_exception(error)\n end\n end", "title": "" }, { "...
d159bb35400fd90a2c67006079e61a41
def multiply(num1,num2) return num1 num2 end
[ { "docid": "ba7dda9497c102aed98b8701db95ce66", "score": "0.0", "text": "def multiply(*num)\n result = 1\n num.each {|n| result *= n}\n result\nend", "title": "" } ]
[ { "docid": "2aef38647d25208a6281b2f86eab8de1", "score": "0.952666", "text": "def multiply(num1, num2)\n num1 * num2\n end", "title": "" }, { "docid": "2aef38647d25208a6281b2f86eab8de1", "score": "0.952666", "text": "def multiply(num1, num2)\n num1 * num2\n end", "title": ...
487404fbb7f305c8c4966411daf6ebc2
GET /reports/1 GET /reports/1.json
[ { "docid": "fa5edac2e562df9b70784d523c66196f", "score": "0.0", "text": "def show\n authorize @report\n end", "title": "" } ]
[ { "docid": "ced6e6f1efc254443c13b63043bb5b52", "score": "0.78875566", "text": "def reports(params = {})\n JsonObject.new( api.json_response(\"reports/\", params) )\n end", "title": "" }, { "docid": "4b1bbf79725e0b23213cf21d2a96fdd9", "score": "0.75881416", "text": "def index\...
885de18720c44fcfbf089afb4762526d
Get and return the list of tables in the database Params: None Returns: tables (array): An array of tables.
[ { "docid": "7cc333911c30b024f5187ba8480d327c", "score": "0.7064709", "text": "def sqlite3_all_tables\n return @dbh.execute(\"select * from sqlite_master where type='table';\")\n end", "title": "" } ]
[ { "docid": "b3081834214b50470b21724b04c4a5cc", "score": "0.8530486", "text": "def tables()\n tables = []\n @client.query(\"SHOW TABLES;\").each do |table|\n tables.push(table.values[0])\n end\n\n tables\n end", "title": "" }, { ...
de810d6adb82a7626f411f79c0a14373
This is mostly for testing
[ { "docid": "4acdf5040050d4022034a300939b58c5", "score": "0.0", "text": "def clear\n query { |db| db.execute \"DELETE FROM #{TABLE} WHERE 1\" }\n end", "title": "" } ]
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.684538", "text": "def desired; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.6757984", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "...
d565fac7bb2feb170a6208f36b5a44e7
Wrap form elements in div _name_.
[ { "docid": "4945690064f9b3d4218e39542f028b46", "score": "0.5463603", "text": "def group name, &block\n Tagz.tag :div, { :class => \"group-#{name}\" }, &block\n end", "title": "" } ]
[ { "docid": "6aa1b7a828fcb11f9c9cf18252e2e4ce", "score": "0.6426993", "text": "def form_input_group(&block)\n content_tag(:div, capture(&block), class: \"col-lg-10\")\n end", "title": "" }, { "docid": "0f5df38658d6b6697578da4c370e6db8", "score": "0.6180591", "text": "def new_neste...
d143f6c3816dee9414cd86aa586a9b58
interface %s ip ospf transmitdelay %d
[ { "docid": "4d61361db0c536c28eb8e339cddc2cfa", "score": "0.7084127", "text": "def transmit_delay=(val)\n no_cmd = (val == default_transmit_delay) ? 'no' : ''\n delay = (val == default_transmit_delay) ? '' : val\n config_set('interface_ospf', 'transmit_delay',\n @interface....
[ { "docid": "9de070c9203e98f3e34a3f34a5cbaede", "score": "0.6346888", "text": "def traffic(iface)\n fstr = lambda { |qx| \"/sys/class/net/#{iface}/statistics/#{qx}_bytes\" }\n\n rx_file = fstr.call(\"rx\");\n tx_file = fstr.call(\"tx\");\n rx1 = File.read(rx_file).to_i\n tx1 = File.read(tx...
d6e876d1514ebff4fd28fb1242bff076
Initializr the VCDConnection, and creates an OpenNebula client. The parameters are obtained from the associated OpenNebula host
[ { "docid": "74b702d82dd0f423a9e40d3a7ab7eba0", "score": "0.6452609", "text": "def initialize(hid)\n \tinitialize_one\n\n @one_host = ::OpenNebula::Host.new_with_id(hid, @one)\n puts @one_host.info\n rc = @one_host.info\n\n if ::OpenNebula.is_error?(rc)\n \traise \"E...
[ { "docid": "7f800d57b82008e71ca325ebd99eeb76", "score": "0.625686", "text": "def init_conn_cinder\n os_endpoint_cinder = Rails.application.config.os_endpoint_cinder\n @conn[:cinder] = Faraday.new(:url => \"#{os_endpoint_cinder}\") do |faraday|\n faraday.adapter :net_http_persistent\n ...
f32563ee07b6da554faf5851467bf3a6
Hook used by `Pipeline` to get the class that should be used for composition
[ { "docid": "b447ec1f51001c4a2d0659f7322dcbb0", "score": "0.0", "text": "def composite_class\n Relation::Composite\n end", "title": "" } ]
[ { "docid": "73d74de7e013ab9d82d174dca1284d23", "score": "0.6793301", "text": "def get_class\n @class ||= Class.new\n end", "title": "" }, { "docid": "6ff0a3ab082a54262f23dcbd89fdce01", "score": "0.6777326", "text": "def class\n __getobj__.class\n end", "title": "" }, ...
63e966423fdeccb708539953a1912778
GET /stations GET /stations.json
[ { "docid": "422c6ded017f96d0525778769f3565f9", "score": "0.65436405", "text": "def index\n #@stations = Station.all\n @stations = Station.page(params[:page]).order(:id)\n end", "title": "" } ]
[ { "docid": "c704b502e46b5917979bf95075ae38f9", "score": "0.7821422", "text": "def get_stations(params = {})\n request_list('stations', params) do |details|\n Ncdc::Results::Station.new(details, self)\n end\n end", "title": "" }, { "docid": "e809f5acd2898205df905f511489d5f...
033cf299b640fd1396a353378467a124
Load ~/.aprc file with custom defaults that override default options.
[ { "docid": "01dafc3b7fae937d4ba3872df47fd127", "score": "0.8135891", "text": "def merge_custom_defaults!\n dotfile = File.join(ENV[\"HOME\"], \".aprc\")\n if File.readable?(dotfile)\n load dotfile\n merge_options!(self.class.defaults)\n end\n rescue => e\n $stderr.puts \"Could not...
[ { "docid": "3c1c4f1a32c91433ef884f62b734bcfa", "score": "0.77475727", "text": "def merge_custom_defaults!\n load_dotfile\n merge_options!(AmazingPrint.defaults) if AmazingPrint.defaults.is_a?(Hash)\n rescue StandardError => e\n warn \"Could not load '.aprc' from ENV['HOME']: #{e}\"\n ...
ec2a2119e38322fab8fba5dce4760c3b
Returns a primary key hash for updates. Wide models override this.
[ { "docid": "b2ede5ffaf5087ad69e716a30f8641d0", "score": "0.6914503", "text": "def id_for_update\n { self.class.primary_key.to_s => __id }\n end", "title": "" } ]
[ { "docid": "0c2df7bb60f88427c8bde2f6847a01e4", "score": "0.810935", "text": "def pk_hash\n model.primary_key_hash(pk)\n end", "title": "" }, { "docid": "958fc6fe1f37ddeea17fed6e8c76ded1", "score": "0.7210635", "text": "def primary_key\n self.class.primary_key == :id ? ...
a45879b28951494e4c087944b3e21bca
Returns the Widget Configurations based on query criteria defined in WidgetQueryParameters. If no query params are specified then all the Widget Configurations of the specified view are returned.
[ { "docid": "cf0f482f5fa650170e9ca1bddcd38587", "score": "0.6513067", "text": "def list_widget_configurations_with_http_info(view_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiDashboardApi.list_widget_configurations ...'\n ...
[ { "docid": "715766a7e8fb093b61bb264420e445e7", "score": "0.7140306", "text": "def list_widget_configurations(view_id, opts = {})\n data, _status_code, _headers = list_widget_configurations_with_http_info(view_id, opts)\n data\n end", "title": "" }, { "docid": "0d0c88a992155255f0...
b974c9f6bbb37b38b6a7a61d122dc0c7
Override the Fixnum multiplication operation to allow for Point multiplication
[ { "docid": "af8488ba6b2e6ea99371f363752cd57b", "score": "0.0", "text": "def *(other) \n if other.is_a?(Point)\n return other * self\n else\n return mult_org other\n end\n end", "title": "" } ]
[ { "docid": "d3145d13aaa7e904a7c01f2c59d21508", "score": "0.6943094", "text": "def multiply\n\t22*44\nend", "title": "" }, { "docid": "d5d6c53de7811ecbc9e3bf00f4dd2bc3", "score": "0.68394375", "text": "def multiply(x, y) x*y; end", "title": "" }, { "docid": "5e57b0f1c26cb1...
134b6cabaffc6fb1ecb331a6af04e979
Get Survey Get information about a survey.
[ { "docid": "e19e98fb59627f20cca04d6b10a94fec", "score": "0.6340229", "text": "def get_survey_0(id, opts = {})\n data, _status_code, _headers = get_survey_0_with_http_info(id, opts)\n return data\n end", "title": "" } ]
[ { "docid": "13f864855fcee29f91b2fa284c7049e7", "score": "0.8360416", "text": "def get_survey\n url = ApiRequest.base_path(\"questionpro.survey.getSurvey\")\n result = self.class.get(url, body: self.options)\n \n self.full_response = result\n self.status = result['status']\n\n ...
31e71643d4ba0660f0e373531928153b
Converts a events dbrow into a 2dminensional array (table with rows) which can easily be displayed in a html table or exported to excel
[ { "docid": "2f25a37cbf7d20322fdeaad7b0ffb39d", "score": "0.6931416", "text": "def get_events_as_string_array\n @table = []\n event_type = nil\n\n @rentog_events.each_with_index do |lr, index|\n row = []\n\n lr.attributes.each do |attr_values|\n\n if attr_values[0] == \"vi...
[ { "docid": "e336d162984e6634a3fb06cfd831d800", "score": "0.6310534", "text": "def load_array_row(row)\n cells = []\n row.each_with_index do |value, i|\n translate = translate_column?((i + 1).to_s)\n key = \"key#{@rownum},#{i + 1}\"\n cells << Cell.new(\"column#{i...
8d0e0e158db62cf133ed516fd845ba45
int64 Message Comment ID
[ { "docid": "57e00f1c24c460b81bb67d25bd109060", "score": "0.0", "text": "def id\n @attributes[:id]\n end", "title": "" } ]
[ { "docid": "f1467245470fe44624f795e6f47f602f", "score": "0.6825303", "text": "def message_id; @message_impl.getMessageId; end", "title": "" }, { "docid": "464c65eef1a2f6f150fd6c6d8e7ca8e6", "score": "0.68140024", "text": "def message_id\n message.message_id\n end", ...
29b99efd671bdd3d3f07958ad8f11ec2
The initializer that be called from controller to load middle object
[ { "docid": "5b9ef5be8b2d54604d0d248906ef4bc4", "score": "0.0", "text": "def members_with_schedule *xmember_ids\n xmembers = members.where(id: xmember_ids)\n xmembers.each do |member|\n member.load_schedule_in_day self.date\n end\n xmembers\n end", "title": "" } ]
[ { "docid": "0954ee8471fdcd16f6936edb6335a8fb", "score": "0.6736684", "text": "def initialize(obj)\n @controller = (obj if obj.is_a?(Blacklight::Controller))\n @blacklight_config = @controller&.blacklight_config || obj\n @key = @blacklight_config.lens_key\n end", "title": ""...
dfa0b399720d1a4595d925febb07cac3
Updates comment within case instance
[ { "docid": "c9f1d59fc74d672c0ab1430c98d641e3", "score": "0.0", "text": "def update_comment_with_http_info(id, case_id, case_comment_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CaseInstancesCaseManagementApi.update_comment ...\"\n ...
[ { "docid": "4c6ca9d6bee3b79187cb6e8a92e3dbd0", "score": "0.7193777", "text": "def update_comment(content)\n if self.comment\n self.comment.content = content\n self.comment.save\n else\n self.create_comment(:content => content)\n end\n end", "title": "" }, { "docid": ...
162dcef4562381b44322076555339c37
Set the value of the ClientKey input for this Choreo.
[ { "docid": "aae39bf8353c50540adbba5dfea1be84", "score": "0.704637", "text": "def set_ClientKey(value)\n set_input(\"ClientKey\", value)\n end", "title": "" } ]
[ { "docid": "f64aa39ad75b50f2f7488c59fbc8c547", "score": "0.5901681", "text": "def client_id=(client_id)\n if client_id.nil?\n fail ArgumentError, 'invalid value for \"client_id\", client_id cannot be nil.'\n end\n @client_id = client_id\n end", "title": "" }, { "doci...
17858135bfa4fd13a57aa9f82bb1675c
=> "yep, it's true" Lets put that in a method
[ { "docid": "dd18f94c24f5cd161b69b1e5c6ddb99d", "score": "0.0", "text": "def if_returns_value(bool)\n if bool\n \"yep it's true\"\n else\n \"nope, it's not true\"\n end\nend", "title": "" } ]
[ { "docid": "6d4ddaf871fa7513c1d7d069ed8d8c57", "score": "0.7020304", "text": "def say (v, msg)\n if v == true\n puts '+ %s' % [msg]\n end\nend", "title": "" }, { "docid": "372b94512a9f1e9a10eca2d731ef20be", "score": "0.6981979", "text": "def want_fries_with_that?(true_or_false)\...
fb47dfc4926d1c890c46e0edc8ca3d4d
This tells us if the curators made us orphan all old versions in the resource history in order to make display look pretty. In this case we still may call this and want to show some version of the files because there was never a version remaining in which these files were added to the dataset. I hope once we get the ve...
[ { "docid": "7a82a133ed060940e1b08f24767714b2", "score": "0.56308985", "text": "def borked_file_history?\n # I have been setting resources curators don't like to the negative identifier_id on the resource foreign key to orphan them\n return true if Resource.where(identifier_id: -id).count.posit...
[ { "docid": "1a0162b607f70bd90cdd791a41039cb1", "score": "0.63208985", "text": "def valid_versions\n valids = versions.reject{ |v,f| !f.exists? }\n valids.delete(:original) if self.pdf.filename == self.original.filename\n valids\n end", "title": "" }, { "docid": "8f0ea47317e...
5c068a8ee9d2f378219fc0a14851beff
GET /plotsubplots/1 GET /plotsubplots/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "a60604b530cddbf4bb2fb671e359a3ab", "score": "0.6590443", "text": "def set_plotsubplot\n @plotsubplot = Plotsubplot.find(params[:id])\n end", "title": "" }, { "docid": "adaa5d5ab3a627b10c1d61bdc91758e2", "score": "0.6518364", "text": "def subplot; end", "title"...
2ad08c2fe8c6162b27b754ae98aa23bb
Level Deprecated: Show that a particular function is deprecated By default those messages shown in strong blue
[ { "docid": "c44d44acebc396bd02eb93d948e5470c", "score": "0.73312396", "text": "def deprecated(_message)\n not_implemented(__method__)\n end", "title": "" } ]
[ { "docid": "a155b04c4d5154b8dd15bf5f1c94bb6b", "score": "0.8255402", "text": "def deprecated(old, new)\n $stderr.puts \"WARNING: #{old} is deprecated. Use #{new}\"\n end", "title": "" }, { "docid": "77b0c109415e0f3e761fd3df7d4dff39", "score": "0.81804806", "text": "def deprecated...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "45aa0eb0059abd672f3e87dd55241f71", "score": "0.0", "text": "def set_modification_comment\n @modification_comment = ModificationComment.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...
47c3f99294eb907645fae96c728b2ed4
Write the following methods so that each ohutput is `true`
[ { "docid": "28dc7a50b6198cff3a6d118dbf40eaf0", "score": "0.0", "text": "def add (num1, num2)\n\tnum1 + num2\nend", "title": "" } ]
[ { "docid": "14c6d6891ad527d77c6e8e8bde6f93d9", "score": "0.7470994", "text": "def boolean; end", "title": "" }, { "docid": "65ef78e4ed035c61d12ca2f0ade7bbc5", "score": "0.74120605", "text": "def true?; end", "title": "" }, { "docid": "65ef78e4ed035c61d12ca2f0ade7bbc5", ...
e9d1f89344823a135d7fd8c668aff946
Round the top number on the stack
[ { "docid": "f6bd5b5d6bc8fbe6cb4e3904c802fb3c", "score": "0.8123785", "text": "def round\n raise StandardError.new(\"Not enough numbers on stack\") if @stack.length<1\n num = pop\n result = num.round\n push(result)\n return result\n end", "title": "" } ]
[ { "docid": "9d47768b89a57889e55d250330d748d4", "score": "0.7055208", "text": "def round\n push pop.round\n end", "title": "" }, { "docid": "6e88774bedf8a5057d08643b57e1eba1", "score": "0.63150233", "text": "def top()\n x = pop()\n push(x)\n x\n end", ...
656dabd4ae313b62cf676f4fc85bc363
Assert that a +group+ resource exists in the Chef run with the action +:modify+. Given a Chef Recipe that modifies "apache2" as a +group+: group 'apache2' do action :modify end The Examples section demonstrates the different ways to test a +group+ resource with ChefSpec.
[ { "docid": "0c2df0f45a55ff3feb25930671b05e4a", "score": "0.7832023", "text": "def modify_group(resource_name)\n ChefSpec::Matchers::ResourceMatcher.new(:group, :modify, resource_name)\n end", "title": "" } ]
[ { "docid": "3376710f3b04b779046382c688c2e8cb", "score": "0.7064366", "text": "def manage_group(resource_name)\n ChefSpec::Matchers::ResourceMatcher.new(:group, :manage, resource_name)\n end", "title": "" }, { "docid": "8c1cf41ae3a0e0832108fa291a6e79c8", "score": "0.694107", "...
84f316d61ee5b4f31357c14b7af52909
GET /clientes/new GET /clientes/new.json
[ { "docid": "dd9d7853e11c14d74c33759a1b79ead4", "score": "0.74757344", "text": "def new\n @cliente = Cliente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cliente }\n end\n end", "title": "" } ]
[ { "docid": "80f2d36ca290a76c416621e07bc09b42", "score": "0.7944187", "text": "def new\n @title = t('view.clients.new_title')\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end", "title": "" }, {...
3421943a547d9d165bb4c680ce9a2456
Get current domain feature label Output: Retrieve and remove target
[ { "docid": "23240797d84757c32588f911592dba67", "score": "0.0", "text": "def retrieveFeatureAsArray feature, remove = false\r\n\t\toutput = getSingleFieldArray feature\r\n\t\tdropFeatures [feature] if remove\r\n\t\toutput\r\n\tend", "title": "" } ]
[ { "docid": "e771eb86fe83df6ea6f7e41a94eb2b41", "score": "0.60016483", "text": "def remove_target\n options[:remove_target]\n end", "title": "" }, { "docid": "f98edd8aeaff60adec1954b235e5404c", "score": "0.58939236", "text": "def target_term; @terms[@target]; end", "title...
b706563b3b16a27e06aa1b55bd2f4f68
DELETE /movimientos_stocks/1 DELETE /movimientos_stocks/1.json
[ { "docid": "5b6216009fda28f959ac56c0df999143", "score": "0.7118885", "text": "def destroy\n @movimiento_stock = MovimientoStock.find(params[:id])\n @detalles_movimientos_stocks = DetalleMovimientoStock.find(:all,:conditions=>['id_movimiento_stock = ? ',@movimiento_stock.id])\n @detalles_movimi...
[ { "docid": "dee36ed462106566d79e5ac747fa2317", "score": "0.76478374", "text": "def destroy\n @stock.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dee36ed462106566d79e5a...
b9c71bc7d3eb05a57339a812e03798af
switch for get methods
[ { "docid": "2e2afa42286017715240820462905c08", "score": "0.0", "text": "def switch_to_post(uri)\n switch_to uri, \"POST\"\n end", "title": "" } ]
[ { "docid": "9d4a27a7b2ed4d844162111f1a1729a5", "score": "0.79205894", "text": "def get; end", "title": "" }, { "docid": "9d4a27a7b2ed4d844162111f1a1729a5", "score": "0.79205894", "text": "def get; end", "title": "" }, { "docid": "9d4a27a7b2ed4d844162111f1a1729a5", "sc...
328e2d6fdd5d6479a114abc3d96097b7
GET /formatos/1 GET /formatos/1.json
[ { "docid": "166e095cab519ee2bb432d8739fd6e47", "score": "0.64539605", "text": "def show\n render json: @formato\n end", "title": "" } ]
[ { "docid": "68575245429ae5c17176b140fc38d32a", "score": "0.6788275", "text": "def index\n @formatos = Formato.where(ativo: true)\n \t\n render json: @formatos\n end", "title": "" }, { "docid": "8dc41bfffd30be2203153c3ed924a1b7", "score": "0.64816993", "text": "def show\n @...
9a00a8bddb74480eef9c901236c0d8ca
:lg, :sm or :xs
[ { "docid": "3b81f95777429e73ce510db1b514c2bc", "score": "0.0", "text": "def size\n \"btn-#{ @options[:size] }\" if @options[:size]\n end", "title": "" } ]
[ { "docid": "9565abd6507bd530d38b7dc8c655a059", "score": "0.621547", "text": "def in_gallons\n @size / 768\n end", "title": "" }, { "docid": "84c0ecec51ffcf2df89a598d66f920ef", "score": "0.5785666", "text": "def high_or_wide\n if width > height\n 'wide'\n else\n ...
37789b62dc653f3d94db0b8a27048ac0
Public: set_move Uses check_input to set a valid move for the player. Returns: String: the move selected. State Changes:
[ { "docid": "1febc40437de0f01caa07147341e8995", "score": "0.78855896", "text": "def set_move\n system \"clear\"\n puts @name + \", select your move: (\" + rules.prompt.upcase + \")\"\n @move = check_input(@rules.valid)\n @move = \"SCISSOR\" if @move == \"SCISSORS\"\n @move = @rules.random_...
[ { "docid": "a868f98734e33d8418f2a1d8635a7977", "score": "0.73545873", "text": "def select_move\n puts \"It's #{@player.color}'s turn. Please enter your move/command.\"\n input = gets.chomp.downcase.split(\"\")\n check_move_input(input)\n end", "title": "" }, { "docid"...
eaf2fbd4bd26ac8d8e3f51d38303bfe1
uses the handsetdetection API to determine the mobile device used. Also logs results to a mobile.log file
[ { "docid": "1b49dcb06bcd81176f6e5bd774cfb345", "score": "0.6635221", "text": "def handset_detect\n sel_hdr = [\"Accept\",\"Accept-Language\",\"Accept-Encoding\",\"Connection\",\"Cache-Control\",\"User-Agent\",\"x-wap-profile\"]\n hdr = {}\n sel_hdr.each { |v| hdr[v] = request.headers[v] if requ...
[ { "docid": "436929defe7181580adab6977e5b5190", "score": "0.6572131", "text": "def test_ultimate_device_detect_http_hardware_info\n headers = {\n 'user-agent' => 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-gb) AppleWebKit/533.17.9 (KHTML, like Gecko)',\n 'x-local-hardwarei...
95652759cc6beea04c16c7fa9d3c0574
Anything that is not a variable, constant, or method/.method call will be counted as a complex expression.
[ { "docid": "9748cdaa285aedb909d4e770c14678b7", "score": "0.6187133", "text": "def non_complex_expression?(condition); end", "title": "" } ]
[ { "docid": "4c840ab704667cbe42e1e15efd5579ef", "score": "0.6110591", "text": "def expression; end", "title": "" }, { "docid": "4c840ab704667cbe42e1e15efd5579ef", "score": "0.6110591", "text": "def expression; end", "title": "" }, { "docid": "4c840ab704667cbe42e1e15efd5579...
3a839af1064e73502883b2d48acbc0fa
GET /siswas/1 GET /siswas/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "ff75d4328c5ba7f5bec861b86aef42da", "score": "0.7120666", "text": "def show\n @siswa = Siswa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @siswa }\n end\n end", "title": "" }, { "docid": "a434e10b725ef4...
9e0c858ae63f30f6e1d0f8d1b675b082
PATCH/PUT /items/1 or /items/1.json
[ { "docid": "e083a941842026e95c81f723d2c39153", "score": "0.0", "text": "def update\n respond_to do |format|\n if @item.update(size: item_params[\"size\"], itemType: item_params[\"itemType\"], quantity: item_params[\"quantity\"])\n format.html { redirect_to @item, notice: \"Item was succes...
[ { "docid": "0886720a82e037d1feaa9397bf1e4d5f", "score": "0.7586373", "text": "def update\n item = Item.find(params[\"id\"])\n item.update_attributes(items_params)\n respond_with item, json: item\n end", "title": "" }, { "docid": "3a9fdd4b5babca0965fa6dd44462c43b", "score": "0.7...
ec2cbe933d00b5701d8264dc7097501e
GET /collocs GET /collocs.json
[ { "docid": "395bc4b9d184f983e7ea39cf1a5df464", "score": "0.682234", "text": "def index\n @all_collocs = Colloc.all;\n @collocs = Colloc.paginate(:page => params[:page], :per_page => 6)\n end", "title": "" } ]
[ { "docid": "82ded55dc0e41c4a9fa5cbe2abd63928", "score": "0.62466407", "text": "def index\n @cofee_locs = CofeeLoc.all\n end", "title": "" }, { "docid": "3bf475699bfa29462aadd813b207818d", "score": "0.5850384", "text": "def locations\n customer = Customer.find_by(id: params[:id...
3118b2e0ddda4b88df8774cec17bec64
GET /data_forms/1 GET /data_forms/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "312798fa69ee7bcd7be50e37da3e8505", "score": "0.7260808", "text": "def retrieve_forms()\n start.uri('/api/form')\n .get()\n .go()\n end", "title": "" }, { "docid": "6705d2e0ebe2594489492da121e031ce", "score": "0.721365", "text": "def index\n @f...
257bd138a8e6800b6ffab61ba51cd2f7
Creates a preprocessor block that will be executed after all data is loaded, but before the site is compiled.
[ { "docid": "cabed6da4c2f61e6c8778eb4ada6a864", "score": "0.5992097", "text": "def preprocess(&block)\n if @rules_collection.preprocessor\n raise Nanoc::Errors::DoublePreprocessBlockError\n end\n\n @rules_collection.preprocessor = block\n end", "title": "" } ]
[ { "docid": "fdc0644603e6c5b091c45625d38506d8", "score": "0.61216587", "text": "def yaml_preprocessor(&block)\n @yaml_preprocessor = block if block_given?\n end", "title": "" }, { "docid": "fdc0644603e6c5b091c45625d38506d8", "score": "0.61216587", "text": "def yaml_preprocesso...
ffbf8ed32e97469644a0d64375e46e77
When the boolean is true, return a new string containing all the odd characters. When the boolean is false, return a new string containing all the even characters. If you have no idea where to begin, remember to check out the cheatsheets for string and logic/control
[ { "docid": "705f3efcebb450c9ac883fdb194abf54", "score": "0.7280252", "text": "def odds_and_evens(string, return_odds)\n if return_odds==true \n string.split(\"\").each_with_index.map { |x,z| x if z.odd?}.compact.join\n elsif return_odds==false \n string.split(\"\").each_with_index.map {|x,z| x if z....
[ { "docid": "e03f328cfef4570166d41c4dfdd63dd7", "score": "0.8054507", "text": "def odds_and_evens(string, return_odds)\ni = 0\nstring_length = string.length\nnew_string = \"\"\n# First to check if return_odds is true (odd characters)\n if return_odds == true\n while i <= string_length - 1\n if i...
efdc0c44c852e6b38fd03adff66548bc
DELETE /register_orders/1 DELETE /register_orders/1.json
[ { "docid": "e8ad289bc87c8207e6e047be8ab0473b", "score": "0.76692075", "text": "def destroy\n @register_order.destroy\n respond_to do |format|\n format.html { redirect_to register_orders_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "8e531349d930fb6fede4efc401d68904", "score": "0.74655724", "text": "def destroy\n @order.destroy\n\n render json: { operation: 'OK' }, status: :ok\n end", "title": "" }, { "docid": "d95245ee8d8e63ffab2dfbac802158ee", "score": "0.73730165", "text": "def destroy\n ...
a6b30145ba655ade0719a477c5aa033b
POST /course_has_subjects POST /course_has_subjects.json
[ { "docid": "6b373f2b98f2be65d48ebdcf5fc5249d", "score": "0.6780413", "text": "def create\n @course_has_subject = CourseHasSubject.new(course_has_subject_params)\n\n respond_to do |format|\n if @course_has_subject.save\n format.html { redirect_to @course_has_subject, notice: 'Course has...
[ { "docid": "0c770a71774218a3f2921c5cec0fd3fc", "score": "0.72679913", "text": "def subjects()\n require_authentication!\n options = make_options(\"getSubjects\")\n response = self.class.post(\"/WebUntis/jsonrpc.do;jsessionid=#{@session_id}?school=#{@school}\", options)\n raise response[\"err...
6cb5d573dee41b9bf58d20812a460d84
PATCH/PUT /projects/1 PATCH/PUT /projects/1.json
[ { "docid": "bbfb4d841748449310d0d515e7d79761", "score": "0.0", "text": "def update\n @project.taggables.destroy_all\n respond_to do |format|\n if @project.update(project_params)\n @project.addCollab\n format.html { redirect_to @project, notice: 'Project was successfully updated....
[ { "docid": "e7f8ee5641911e33622dcbebcce61d0d", "score": "0.7309948", "text": "def update\n @project.update_attributes!(project_params)\n json_response(@project)\n end", "title": "" }, { "docid": "1ccd064902bda09d4ae7f92d826f3d43", "score": "0.7225876", "text": "def update\n ...
70114300eb8e95173190745824be352f
Subtraction: just sum opposite components
[ { "docid": "b614b4f7d830426a1deadf83d5c98447", "score": "0.6452815", "text": "def -(other)\n ret = Dint.new\n ret.positive = @positive + other.negative\n ret.negative = @negative + other.positive\n ret\n end", "title": "" } ]
[ { "docid": "bdf0fb3a1d90bcd6ea39c4243a5ebce6", "score": "0.7493794", "text": "def subtract(n1, n2); n1 - n2 end", "title": "" }, { "docid": "04d66b511db106637def1e4316188a69", "score": "0.7426038", "text": "def subtract(a, b); a - b end", "title": "" }, { "docid": "54d281...
9ce0440abbd25d13d50e4877ce95c921
Transaction this operation belongs to. ds is Sequel dataset representing the table
[ { "docid": "b4a6747f7d034a5070b2449bb84cf8e8", "score": "0.0", "text": "def execute ds\n raise\n end", "title": "" } ]
[ { "docid": "f3a23e8e587bf28f6316bcd9f42d122d", "score": "0.7037214", "text": "def transaction(**opts, &block)\n Transaction.new(dataset.db).run(**opts, &block)\n end", "title": "" }, { "docid": "082ac83b72a05df3adf786531741be74", "score": "0.6744582", "text": "def transac...
bec1a7e8712b98eb499e286cedf25c79
POST /calcs POST /calcs.json
[ { "docid": "ff728a3efe29ff72e6eab7a8875d9fe0", "score": "0.0", "text": "def create\n @calc = Calc.new(params[:calc])\n\n respond_to do |format|\n if @calc.save\n format.html { redirect_to @calc, notice: 'Calc was successfully created.' }\n format.json { render json: @calc, statu...
[ { "docid": "d130c21390b9f24d65349df47599da6a", "score": "0.6597991", "text": "def create\n @calendar = Calendar.new(calendar_params)\n \n if @calendar.save\n render json: @calendar, status: :created\n else\n render json: {message: \"could not create calendar\", errors: @calendar.er...
a1133049591b313f8ca2627a6ac9b54b
outputs an array containing the path to all required js files this list is deduced from the options passed
[ { "docid": "362c41abf2392f852393a0081018a112", "score": "0.58962625", "text": "def js_dependencies_array\n if scripts != :none\n get_vendor_scripts\n get_gem_scripts\n end\n @js_array\n end", "title": "" } ]
[ { "docid": "691d5674a987e9cd460a824cd1386a51", "score": "0.68371665", "text": "def concat_js_files\n\tjavascript_compile_list.map { |f| File.read(f) }.join\nend", "title": "" }, { "docid": "06968ce4905d85a89aea85b51b3d4c65", "score": "0.6746446", "text": "def js_files\n [\n ...
0b5b25535da499b7411d668d57f8ef7e
opts can have keys: :dependent_modules if not nil then array of strings that are depenedent modules
[ { "docid": "e8908d0de407ceb289bf72282a5d1cff", "score": "0.0", "text": "def version_parse_check_and_normalize(version_specific_input_hash, opts = {})\n integer_version = integer_version(version_specific_input_hash)\n klass = self.class.load_and_return_version_adapter_class(integer_version)\n ...
[ { "docid": "a2a558674a1a268dda59f461514930c0", "score": "0.647801", "text": "def dependent_modules\n\n end", "title": "" }, { "docid": "d0e0d95508285afe1b7da6bb3822b8a5", "score": "0.6435432", "text": "def modules(opts={})\n # compute cache key for these options\n key ...
2cb0794dab48377a50d29d65d4d3a8a2
Compile Masters in both Monolithic and Split Infrastructures, and Primary Masters in Split Infrastructures. Calculate the number of jrubies by the number of jrubies that will fit into RAM rather than CPU. minimum_cpu_jrubies recommended by support maximum_cpu_jrubies based upon config_puppetserver minimum_mb_puppetserv...
[ { "docid": "cd678582bfa5fddbea1fa532e299008a", "score": "0.683577", "text": "def calculate_master_settings(resources, with_activemq, with_orchestrator)\n return [{}, {}] unless node_meets_minimum_system_requirements?(resources)\n\n minimum_cpu_jrubies = 1\n maximum_cpu_jrubie...
[ { "docid": "06773a4968a1d596e658dcb71db18cf6", "score": "0.7824731", "text": "def calculate_monolithic_master_settings(resources, with_compile_masters, with_external_postgresql)\n return [{}, {}] unless node_meets_minimum_system_requirements?(resources)\n\n percent_cpu_threads = wit...
1b89290d8f41c6a43fac2703b3c8259a
Get services to which the given nsgroup belongs to Returns information about services that are associated with the given NSGroup. The service name is passed by service_type parameter
[ { "docid": "50af72796859efa1765e1a1fcde3106e", "score": "0.59175193", "text": "def get_service_associations(nsgroup_id, service_type, opts = {})\n data, _status_code, _headers = get_service_associations_with_http_info(nsgroup_id, service_type, opts)\n return data\n end", "title": "" }...
[ { "docid": "d6e014c761df82022475e3b4520d6a13", "score": "0.6669419", "text": "def find_by_group(group)\n service_list.select { |_, metadata| metadata[:groups].include?(group) }.keys\n end", "title": "" }, { "docid": "e3579249ccc617348f57faff9c19d786", "score": "0.66013604", "...
cca1cf9019f96fbde0d4a8831baf5ba0
I N S T A N C E M E T H O D S Create a new TemplateFactory from the given configuration object, which should specify a loader class for templates.
[ { "docid": "7bcb1b198f62a544f7ab4dc50c8b55da", "score": "0.6527411", "text": "def initialize( config )\n\t\t@config = config\n\t\t@cache = nil\n\t\t\n\t\tif config.templates.cache\n\t\t\t@cache = Arrow::Cache.new(\n\t\t\t\t\"Template Factory\",\n\t\t\t\tconfig.templates.cacheConfig,\n\t\t\t\t&method(:te...
[ { "docid": "7d185a57ae4f7aba8f1509659f4d1da8", "score": "0.65177673", "text": "def load_template(template_name)\n Template.new template_path(template_name)\n end", "title": "" }, { "docid": "ff0f4044c7f04e5abff195b69dea309c", "score": "0.63630813", "text": "def create_templat...
fde7074375d1b0ba1cfd7e9251ef2850
takes in two arguments of two different arrays and uses the concat method to add the contents of the second array to the first (FAILED 12) increases the length of the first array (FAILED 13)
[ { "docid": "1dcfdafd5a5e07051cf5ac5a13fbc7be", "score": "0.0", "text": "def using_insert(arr, elem)\n\narr.insert(4,elem)\nend", "title": "" } ]
[ { "docid": "fb9a0f0fa2696d03b48eb62f195a666f", "score": "0.82747465", "text": "def using_concat(first_array, second_array)\n first_array.concat(second_array)\nend", "title": "" }, { "docid": "d5ba618cb774a929928c2c40f18f7f4c", "score": "0.8242607", "text": "def using_concat(array_on...
4da5c4e1ad697c3091d10236f555e319
Ingest data from array block using headers (listed first)
[ { "docid": "0535067febc58cb39e6eb82e13d5d5a3", "score": "0.57137626", "text": "def translate_header_and_data(block)\n keys = block.shift\n keys.map! { |key| key.strip.to_sym }\n\n csv_array = []\n block.each do |entry|\n csv_entry = {}\n entry.compact.each_with_index do |item, ix|\n csv_e...
[ { "docid": "da31e882f1427f8d9f5ef19296954021", "score": "0.60598147", "text": "def prepare_data(input_data, columns, header, prefix)\n # prepare an array of data for backends and frontends\n result = Array.new\n input_data.each do |item|\n zabbix_host = item[0]\n columns.each do |haproxy_item|\...
70eb936350ccb623fb3622ec8452fe00
DELETE /privilege_levels/1 DELETE /privilege_levels/1.json
[ { "docid": "6ecf86bc11f8306466a8548095992af7", "score": "0.7988637", "text": "def destroy\n @privilege_level.destroy\n respond_to do |format|\n format.html { redirect_to privilege_levels_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "090c77d1c5e1d0094f2b1d79dfe679b3", "score": "0.7104839", "text": "def destroy\n @level_permission.destroy\n respond_to do |format|\n format.html { redirect_to level_permissions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6...
5542283453a62dd2c04b2cdd6fc109ae
Make sure you define the other required methods, too
[ { "docid": "96204d1517f6858847c3b0c36bc9fafa", "score": "0.0", "text": "def guess(your_guess)\n if your_guess > @answer\n @guess = :high\n elsif your_guess < @answer\n @guess = :low\n else\n @guess = :correct\n end\n end", "title": "" } ]
[ { "docid": "1e5e53c4b9e93d9482caa25c8f435412", "score": "0.7806481", "text": "def methods; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.72786516", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4...
fffe10c8798d6bb9533121dad420cacb
Write BIFF record COLINFO to define column widths Note: The SDK says the record length is 0x0B but Excel writes a 0x0C length record.
[ { "docid": "9670c0cb2b2b0de02181396dcd9fc878", "score": "0.5174211", "text": "def biff_record\n record = 0x007D # Record identifier\n length = 0x000B # Number of bytes to follow\n\n coldx = (pixels * 256 / 7).to_i # Col width in internal units\n reserved = ...
[ { "docid": "caae84da03b2f4697d4d653c6e1dbee4", "score": "0.7186831", "text": "def colInfoRecord(first_col, last_col, width, xf_index, options)\n get_biff_data(0x007D, [ first_col, last_col, width, xf_index, options, 0].pack('v6'))\n end", "title": "" }, { "docid": "4b8cb18e7e58439a...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "39cb2eff70de9151ea0746d202c761bc", "score": "0.0", "text": "def baz77_params\n params.require(:baz77).permit(:foo1, :foo2, :foo3, :foo4, :foo5)\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...
5cba35811aef36fa2efc19b766866735
TODO: move over to the new in_parallel stuff
[ { "docid": "959c65e8313198bf67b0a6f37bca21f4", "score": "0.0", "text": "def stream(filter=nil)\n centre, stream = nil\n stream_params = {centre: params[:id]}\n stream_params.merge!(stream: filter) if filter\n\n Service::API.in_parallel do\n centre = CentreService.fetch(params[:id])\n ...
[ { "docid": "9fdeeadbf34f8a8cd294e9bc45fd918e", "score": "0.8052576", "text": "def in_parallel?; end", "title": "" }, { "docid": "9fdeeadbf34f8a8cd294e9bc45fd918e", "score": "0.8052576", "text": "def in_parallel?; end", "title": "" }, { "docid": "1e61e1d12617fc47dd76aa6bf0...
7c0245d109ff377d0af2df31f18919f9
Sort array elements with indices.
[ { "docid": "386968ab2f45e115497791070075ca40", "score": "0.780707", "text": "def sort_with_index(arr)\n arr.map.with_index.sort_by(&:first)\n end", "title": "" } ]
[ { "docid": "357f3e822152d0feb49257298136953f", "score": "0.79267305", "text": "def sort_index\n indices = (0...self.length).to_a\n \n # Sort the indices by their element (but keep indices)\n indices.sort { |e1,e2| self[e1] <=> self[e2] }\n end", "title": "" }, { "docid": "df8ebb...
9287c0dcc6befe3c5b535069747fff4a
Returns the string to show on the form button depending on the action.
[ { "docid": "924ffc760dfc647619cde00d239f104d", "score": "0.67799425", "text": "def submit_text\n edit_action? ? 'Save changes' : 'Create my account'\n end", "title": "" } ]
[ { "docid": "90570744d80f5ed46677d1538b72a507", "score": "0.78802305", "text": "def btn_txt\n return params[:action] == \"new\" ? \"Create my account\" : \"Update account\"\n end", "title": "" }, { "docid": "9e8dd35c3a15c911c842d939260418c7", "score": "0.71398634", "text": "def bt...
238e93429c27fe10308c8afe85708099
GET /mychats/1 GET /mychats/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "4942c513eeac4743bcbe323385d604d1", "score": "0.7667061", "text": "def index\n @chats = Chat.where(to_id: current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @chats }\n end\n end", "title": "" }, { "docid": "0...
2bed667b424aba5b307960ac1fa45978
DELETE /dislikes/1 DELETE /dislikes/1.json
[ { "docid": "23e502014ab4f3ceaee0b67ab379b14e", "score": "0.75349975", "text": "def destroy\n @dislike = Dislike.find(params[:id])\n @dislike.destroy\n\n respond_to do |format|\n format.html { redirect_to dislikes_url }\n format.json { head :no_content }\n end\n end", "title": ...
[ { "docid": "0b61fb11bafcb96a22c173665297788c", "score": "0.7768666", "text": "def unlike!\n post(\"/likes\", :method => :delete)\n end", "title": "" }, { "docid": "40edec9f9e4bfa6c359ec51136f6ad3a", "score": "0.7714312", "text": "def delete_likes\n end", "title": "" },...
e99abbd926311154671cc6705c1f89d6
assembles list of new tables for the global secondary indexes, crafted as updates that can be sent to AWS::DynamoDB::Client.update_table API (from describe_table) values need to come first
[ { "docid": "dd1cd6ddd20222403c2994bc44f5fd6a", "score": "0.532751", "text": "def load_gsi_creates(api_indexes, res_indexes)\n creates = []\n res_indexes.each do |res_index|\n creates.push(create: res_index) unless api_indexes && api_indexes.index { |x| x.index_name == res_index[:index_name] }\n en...
[ { "docid": "fb1b29fedbc0568687d89f0e0cfa9344", "score": "0.6155392", "text": "def buildTables()\n @tableByName = {} ;\n @tableById = {} ;\n @tableByOrder = {} ;\n @stopList.each{|entry|\n @tableByName[entry.getValue(:name)] = entry ;\n @tableById[entry.getValue(:id)] = entry ;\n ...
826dfa5553a84a91fa10f26cd6eddf39
Set the activity for which topic. ==== Parameters activityFor:: Topic fo the Activity.
[ { "docid": "779363e0baa406688486d5ef453be3e9", "score": "0.72062695", "text": "def setActivityFor(activityFor)\r\n\t\t\t\t\t@activityFor = activityFor\r\n\t\t\t\tend", "title": "" } ]
[ { "docid": "ed5e4649c0522213ab4fc1b69147e1ec", "score": "0.6280934", "text": "def set_activity\n @activity = Activity.find(params[:activity_id])\n end", "title": "" }, { "docid": "66496da64fe81eef6d1611ba1bdd902a", "score": "0.62277704", "text": "def set_activity\n @ac...
e597c868568856370bc7948801aeacca
The relationships for this pivot table.
[ { "docid": "ee723042013e5d37a9649ab001016472", "score": "0.7301453", "text": "def relationships\n r = Relationships.new\n r << Relationship.new(cache_definition, PIVOT_TABLE_CACHE_DEFINITION_R, \"../#{cache_definition.pn}\")\n r\n end", "title": "" } ]
[ { "docid": "769a7374e083ac484c200f8b035a22fb", "score": "0.8271215", "text": "def relationships\n return [] if empty?\n\n map { |pivot_table| Relationship.new(pivot_table, PIVOT_TABLE_R, \"../#{pivot_table.pn}\") }\n end", "title": "" }, { "docid": "71694067a50086b47a38aa5f7d7c2...
c40acd81cb571516798e1308fbbe7e3c
GET /themes/1 GET /themes/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "3b571b03d192aab3ec989951aa481af0", "score": "0.811455", "text": "def retrieve_themes()\n start.uri('/api/theme')\n .get()\n .go()\n end", "title": "" }, { "docid": "dc1f6baf700401be36d0d8497bd0cb57", "score": "0.79298437", "text": "def index\n ...
f3627e4e93563e9ce6d31d0dbc16fcea
Used by the migration template to determine the parent name of the model
[ { "docid": "f2cc65d4515a0711e240f76fd6afc64c", "score": "0.7383946", "text": "def parent_class_name\n options[:parent] || \"ApplicationRecord\"\n end", "title": "" } ]
[ { "docid": "85a50d11d19f13a03a5d35fadce6b573", "score": "0.8391792", "text": "def parent_model_name\n self.class.parent_model_name\n end", "title": "" }, { "docid": "00afe6b8fba32bec7a48c524dadf2366", "score": "0.81173545", "text": "def parent_name\n self.class.paren...
9b49432848eea17495ea0f58a7196db1
happiness is attached (owned by) friend
[ { "docid": "6033f88d1d0c9b2c6e27238bde00d859", "score": "0.0", "text": "def start_conversation(friend, topic) \n case(topic)\nwhen \"politics\" \n friend.happiness -= 2\n self.happiness -= 2\n return \"blah blah partisan blah lobbyist\"\nwhen \"weather\"\n friend.happiness += 1\n self.h...
[ { "docid": "ce1938a3b45375d697b58581567f9e0b", "score": "0.65273434", "text": "def call_friend(friend)\n self.happiness += 3\n friend.happiness += 3\n\n \n return \"Hi #{friend.name}! It's #{self.name}. How are you?\"\nend", "title": "" }, { "docid": "b8d47d43b3f1b4cb4325f3b83179...
76018776a06d1dd54d549fd4e1edac0d
The creature shall enter an infertility period
[ { "docid": "716367b77ec773fe327bd350daca8220", "score": "0.62831944", "text": "def enter_infertility\n @infertility = @p_o_i\n end", "title": "" } ]
[ { "docid": "4d753e28a34226c9bcd467a7d1431244", "score": "0.61666507", "text": "def aide3()\n\n @indiceFortFlag = TRUE\n @timer.add(120)\n end", "title": "" }, { "docid": "fd08b4ad82ce839da0327354539963df", "score": "0.6119798", "text": "def dead\r\n @energy < 0\r\n @gameover...
b530521c340c811584c2a74f8b2a99d1
GET /daily_stage_values GET /daily_stage_values.json
[ { "docid": "a4feac123adf71c2c76c9bd1f9a9b97d", "score": "0.68716794", "text": "def index\n if params[:task_board_id]\n @daily_stage_values = TaskBoard.find(params[:task_board_id]).daily_stage_values\n last_date = @daily_stage_values.order(\"created_at DESC\").first\n @daily_stage_value...
[ { "docid": "a7f3735f358ff3db5d73d8ec228bf06b", "score": "0.70711887", "text": "def daily_stage_value_params\n params[:daily_stage_value]\n end", "title": "" }, { "docid": "f9bc4b62393dc90eeb154eb5dbec403c", "score": "0.6333871", "text": "def set_daily_stage_value\n @dail...
b2032053fe92c797ba791a1a55283884
Initialiser, given either a single parameter that's a sequence of red, green and blue components or three scalar R, G and B values
[ { "docid": "b7f3778cd73c76920e4b478d22f72f06", "score": "0.6791838", "text": "def initialize(r, g, b)\n @r = r\n @g = g\n @b = b\n end", "title": "" } ]
[ { "docid": "519701477567dfef65a678daa49e1aa6", "score": "0.7780531", "text": "def initialize(red, green, blue)\n @r = red\n @g = green\n @b = blue\n end", "title": "" }, { "docid": "46966aceb417ae454df51e0e7dbac083", "score": "0.7729583", "text": "def initialize(red...
1a4d7147e7d5ef33e542c87b72a069da
Load configuration data as a hash
[ { "docid": "759f3cfe3767b092e799339a0165dab6", "score": "0.6625902", "text": "def data\n YAML::load_file(files[:config])\n end", "title": "" } ]
[ { "docid": "6f6b0d3c1f53c19a4668690dcfe5cde4", "score": "0.71592253", "text": "def config_data\n {}\n end", "title": "" }, { "docid": "66258d9a79a0c8a4a8c3d6b67dc10590", "score": "0.69097555", "text": "def to_hash\n @configuration_data\n end", "title": "" }, {...
2d4ff49fbc6c308676fa629cadb46e5a
Gets the average daily number of contributions by the user.
[ { "docid": "f8657799a739f112af684c267f132297", "score": "0.6685476", "text": "def get_average_day(user)\n daily = get_daily(user)\n get_average(daily)\n end", "title": "" } ]
[ { "docid": "5b32e2a50a3751819c49e3fc43c9593f", "score": "0.69518834", "text": "def average_daily_electricity_consumption_per_user\n users = self.users.map{|u| u.avg_daily_electricity_consumption}.compact.flatten.reject(&:nan?).reject(&:zero?)\n ct = users.length\n if ct > 0\n users...
da9b32a56b74cbaf422c6d00b1c32cf5
NOTE: This resource override this method to enable 'prerelease' option.
[ { "docid": "60134787926d0f24684593f9b5c8e9e8", "score": "0.0", "text": "def installed_gems\n gems = []\n\n cmd = [attributes.gem_binary, 'list', '-l']\n cmd << '--prerelease' if attributes.prerelease\n\n run_command(cmd).stdout.each_line do |line|\n next unless /\\A(...
[ { "docid": "e710563bf727eb362b6e382f8ca92867", "score": "0.761738", "text": "def make_prerelease\n fail AlreadyPreRelease if prerelease?\n @special = PRE_RELEASE.first\n end", "title": "" }, { "docid": "756ea4d4fcfcf9264fa5785121e903d3", "score": "0.75585824", "text": "d...
5e1c29bf8f4cd7740d67876b60cd4fd7
Shows the especific blog post It doesn't have any data, lets see line 2 > the "before_action" > it call the methods listed > see now set_blog method Conectd to set_blog GET /blogs/1 GET /blogs/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "4149237b1482f475b4aab77180643a5e", "score": "0.8097373", "text": "def set_blog\n # this is shows the blogs, is like this code where written in show method\n @blog = Blog.friendly.find(params[:id])\n end", "title": "" }, { "docid": "bbf175e060838d8c946364cf4ddeafc3", ...
37dbd3aa605198be6a1fb0110a2befb5
Get an array of pins that match a path.
[ { "docid": "dbff41729c088b7b98f31b282ae78126", "score": "0.7215994", "text": "def get_path_pins path\n api_map.get_path_suggestions(path)\n end", "title": "" } ]
[ { "docid": "6b6df21845de53c8e38528091fa2d8bd", "score": "0.71928257", "text": "def locate_pins params\n return [] unless params['data'] && params['data']['uri']\n library = library_for(params['data']['uri'])\n result = []\n if params['data']['location']\n location = ...
25e7caeadf678ad7f5accff1638bfe47
Display list of the most popular 100 names that don't have descriptions.
[ { "docid": "32a45991a84e582143510617eeb7eaff", "score": "0.65930843", "text": "def needed_descriptions # :nologin: :norobots:\n # NOTE!! -- all this extra info and help will be lost if user re-sorts.\n data = Name.connection.select_rows %(\n SELECT names.id, name_counts.count\n FROM name...
[ { "docid": "41b6a2e8d68a884e0a7823ce4f6b86f8", "score": "0.6300402", "text": "def show_most_popular\n @card_sets = CardSet.order(\"impressions_count DESC\")[0..19]\n end", "title": "" }, { "docid": "f0444cc735ac9f0777e6e8c0239d230b", "score": "0.60358465", "text": "def print_most...
a09030d12e187cb9f21615910b081c41
To keep compatibility with the API, we use the params format given in the documentation.
[ { "docid": "654979f7414b417baa181d12ef2bf38b", "score": "0.0", "text": "def accepted_params\n [\n :Amount,\n :isPreAuth,\n :ServiceId, \n :RequestLang, \n :FullName, \n :Email, \n :Phone, \n :MaxInstallments,\n :MerchantTrns,\n :...
[ { "docid": "c538062fc97a3f5dfd4ad79a86b1eb3f", "score": "0.7196004", "text": "def params\n '(%s)' % @format\n end", "title": "" }, { "docid": "32ca9709c6df074ea5815c4bce9fdeb7", "score": "0.6839504", "text": "def params\n raise NotImplementedError\n end", "title": "" ...
9463f11a74d56a181d84997d079378c1
Returns results of a 'workers' command.
[ { "docid": "9ca76aca00cc0054c95bb1a5ae3ea7b6", "score": "0.7608075", "text": "def workers\n workers = []\n if response = send_command('workers')\n response.split(\"\\n\").each do |line|\n if line.match /^(\\d+)\\s([a-z0-9\\:\\.]+)\\s([^\\s]*)\\s:\\s([a-z_\\s\\t]+)$/\n func_par...
[ { "docid": "6a80d49b44ef57eb21eaf0dc7648509d", "score": "0.74514705", "text": "def list_workers\n return workers.join(', ')\n end", "title": "" }, { "docid": "bce90466d85c2e0fd098518f90a14d54", "score": "0.72391933", "text": "def workers\n Worker.all\n end", "title": "" ...
8ebd4bd572df95eb3f47b76403c95ab6
Sort the first word's chars, if current word's chars sort same, is anagram
[ { "docid": "6a94e80f8e7b2ad5c56e6e8869469a8b", "score": "0.7290956", "text": "def find_anagrams(words)\n word = words.shift.split(//).sort; words.select{|w|w.split(//).sort == word}\n end", "title": "" } ]
[ { "docid": "b984284d36f27632be7849dc8e33b146", "score": "0.8188418", "text": "def anagram_canonical_form(word)\n\tword.downcase.chars.sort\nend", "title": "" }, { "docid": "a6cba4deb86265d733a5ac03dcfcf1e9", "score": "0.8010684", "text": "def word_unscrambler(str, words)\n anagram =...
a413ef030d3232205851cf5ad47c8703
GET /users/1 GET /users/1.xml
[ { "docid": "72736353aea5874eb42f8d8047798140", "score": "0.0", "text": "def show\n @user = User.find(params[:id])\n @bets = @user.bets.all(:include => :game, :order => 'games.played_at ASC')\n @bonus_bets = @user.bonus_bets.all(:include => :bonus)\n\n @prev_user = @user.previous\n @next_u...
[ { "docid": "81f820aba49ac09ba424a3c44ecb4bf8", "score": "0.80139303", "text": "def account_users \n make_request(:get,\"#{account_url}/users.xml\")\n end", "title": "" }, { "docid": "ecc296ddabf83c44bc2e12a4a9eba06b", "score": "0.7118081", "text": "def show\n @users = User...
537f6cfdea9be5cf41480434380ea1e5
DELETE /activity_event_type_pricing_associations/1 DELETE /activity_event_type_pricing_associations/1.json
[ { "docid": "8eb10798de71f3646e00653ddfd0b7af", "score": "0.77892053", "text": "def destroy\n authorize @activity_event_type_pricing_association\n activity_event_type_pricing_association = @activity_event_type_pricing_association.destroy\n render json: activity_event_type_pricing_associati...
[ { "docid": "88edf59119bc31496c3ff2e382046d9e", "score": "0.63796115", "text": "def destroy\n @event_charge = @event.charges.find(params[:id])\n @event_charge.destroy\n\n respond_to do |format|\n format.html { redirect_to event_path(@event, anchor: 'charges') }\n format.json { head :no...
e23a0e6da8b49382dddcb2eaf954ecdf
rake command string to run on hosts passes on useful troubleshooting env vars
[ { "docid": "19ffa8800febe10f21ebb3ad931349dc", "score": "0.7082533", "text": "def rake_cmd\n cmd = 'bundle exec rake'\n %w(\n SIMP_RPM_LUA_debug\n SIMP_RAKE_PKG_verbose\n SIMP_RPM_verbose\n ).each do |env_var|\n if value = ENV[env_var]\n cmd = \"#{env_var}=#{value} #...
[ { "docid": "008174c8b1044edd172bde1201bda936", "score": "0.656732", "text": "def rake_cmd\n execute_heroku rake_cmd_str\n end", "title": "" }, { "docid": "7725104ae04d19a6f7169354b24224ce", "score": "0.64729476", "text": "def run_remote_rake(rake_cmd)\n rake_args = ENV['RAKE...
8e732ecd928ab876937c68caccf39c71
rule_must_be_supported validates that the rule type is supported by each of the alert's data sources. It implicitly validates that rule_type is the name of a Rule::Base subclass.
[ { "docid": "e13c264a25cfb365c119239081bc8fc1", "score": "0.8492008", "text": "def rule_must_be_supported\n data_sources.distinct.pluck(:type).each do |source_type|\n supported_rules = source_type.constantize.supported_rules\n if supported_rules.none? { |rule_class| rule_class.name == rule_t...
[ { "docid": "2e2d90f2dee8beddc628daf21789d83e", "score": "0.88820046", "text": "def rule_must_be_supported\n unless supported_rule?\n errors.add :rule_type, 'is not supported by one or more of the alert’s data sources'\n end\n end", "title": "" }, { "docid": "132cdcdd26434eb7458f0...
8ff5e42de4225ea91f31fb01bf375813
PUT /profile_pictures/1 PUT /profile_pictures/1.xml
[ { "docid": "9edf615b1778f636cd5b868f17e2c839", "score": "0.6259261", "text": "def update\n @profile_picture = ProfilePicture.find(params[:id])\n if @profile_picture.update_attributes(params[:profile_picture])\n flash[:warning] = 'Profile Picture was successfully updated.'\n respond_to do...
[ { "docid": "d1c6c0248da3df587af944d405918a54", "score": "0.6735257", "text": "def update\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n if @picture.update_attributes(params[:picture])\n flash[:notice] = 'Picture was successfully updated.'\n format.html { red...
233fb49e18f712e6d58a140862d2a267
Never trust parameters from the scary internet, only allow the white list through. Allow the size parameter
[ { "docid": "407e4a5c47e20c982e849cee9d315372", "score": "0.0", "text": "def locker_params\n params[:locker].permit(:bag_size)\n end", "title": "" } ]
[ { "docid": "464bfdadb4d22e12d3276645b06cc041", "score": "0.777416", "text": "def size_params\n params.require(:size).permit(:name, :desc, :modifier)\n end", "title": "" }, { "docid": "027ce54b824d1f834f8e574c926d8a96", "score": "0.7757766", "text": "def size_params\n par...
699f5912111d2d3265860c52290d76ec
Generate repo structure based on file_structure array By providing a directory location and an array of paths to generate, this will build a repository directory structure. If a specific entry ends with a '/', then an empty directory will be generated. Example file structure array: file_struct = %w[ roles/defaults/main...
[ { "docid": "3f679d9ce16973acc0ec467d8f43e10d", "score": "0.7557895", "text": "def build_repo(repo_path, file_structure)\n file_structure.each do |entry|\n path = repo_path.join(entry)\n dir, filename = path.split unless entry.end_with?(\"/\")\n FileUtils.mkdir_...
[ { "docid": "2688be133a8fd7a36de96a2cb384b96c", "score": "0.60986775", "text": "def create_structure\n @config.do.folder_structure.each_pair do |folder, target_folder|\n unless !target_folder.empty? && File.directory?(@config.deploy_folder.join(folder.to_s))\n @logger.print \"C...