query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
4e98b5e824635102c3c467a73eeba380
Never trust parameters from the scary internet, only allow the white lis
[ { "docid": "7ec2e421bbef6f6be7171f2e3267c818", "score": "0.0", "text": "def customer_params\n\tparams.require(:customer).permit(:l_name, :f_name, :email, :address, :city, :country, :password, :password_confirmation, :latitude, :longitude)\n end", "title": "" } ]
[ { "docid": "257c231996f7890b0847a9d6caedbb80", "score": "0.68631166", "text": "def httponly; end", "title": "" }, { "docid": "17cdd09057550bc0c84c1d753341e2c2", "score": "0.67783743", "text": "def httponly?; end", "title": "" }, { "docid": "17b5cf96637f1e06fed167a5e3f019d...
2991eaef626de6db614fff515c338799
To easily add permitted parameters, use the following method in your subclass : def cart_params super(customer_attributes: [nested: :attribute]) end Note : If you want to remove permitted parameters, you need to rewrite the full permissions nested array
[ { "docid": "9023ddcbfe6b302dd8169d54192d7ad4", "score": "0.71609956", "text": "def cart_params(*attributes)\n @cart_params ||= super(\n *merge_arrays(\n [\n :use_another_address_for_billing, :terms,\n :payment_method_id, :shipping_method_id,\n ...
[ { "docid": "59dc5c1d4645f569db1ab608318375a2", "score": "0.72099257", "text": "def build_permitted_params\n return super unless respond_to?(:_nested_fields)\n\n super.tap do |params|\n _nested_fields.each do |field|\n params << { \"#{field}_attributes\": [:id, :_destroy] }\n ...
165e75878ebdca88e9e9e3ba70de501a
==================================== define methods ==================================== define log method
[ { "docid": "073bade6b3e8d5b17008848025f86efd", "score": "0.69165045", "text": "def log(level, msg)\n $evm.log(level,\"#{@org} Automation: #{msg}\")\nend", "title": "" } ]
[ { "docid": "524c425ed0e016f7a364f3246e314e7f", "score": "0.8758844", "text": "def log; end", "title": "" }, { "docid": "524c425ed0e016f7a364f3246e314e7f", "score": "0.8758844", "text": "def log; end", "title": "" }, { "docid": "524c425ed0e016f7a364f3246e314e7f", "scor...
ec0d2f107db4c8982cdeadec8b81f326
Gets the maximum amount of time Packer may execute for before timing out. Defaults to 2 hours.
[ { "docid": "5d0450f405fdad382236afdf550cf35e", "score": "0.67216706", "text": "def execution_timeout\n @execution_timeout || 7200 # 2 hours\n end", "title": "" } ]
[ { "docid": "1fb73dd8b28ed3d71bc5a8c63ec50d9e", "score": "0.71899855", "text": "def max_run_time\n @timeout\n end", "title": "" }, { "docid": "63fb4387885b73884a14179a7a604285", "score": "0.6906239", "text": "def get_timeout\n payload = get_payload\n payload['sta...
066675d4dedb4f6f6bebce652b9d552f
Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results.
[ { "docid": "d6390eee1cfeac15d4067dcd1a7cf3d1", "score": "0.0", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ShowGroupResultSet.new(resp)\n return results\n end", "title": "" } ]
[ { "docid": "c4ca32683e8ce75eb6a187d63df8fa77", "score": "0.7664935", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = DoneResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "6f7a7d9be674ad4cf17d6743eb1f7836", "score...
67750cd2da806b6bf8b1ba2eaaf98d50
Table with n columns and n+1 rows, n+1 row is to store the sum of each column number of elements as the column, 6th column, assume we have 6 elements to create BST a given cell C(4,6) contains the count of trees which can be made by 6 unique elements given the 4th element is chosen as the root. We know that for one ele...
[ { "docid": "ee949a433d5b1a5996d6e25d61cad81d", "score": "0.61016387", "text": "def dp_possible_trees(n)\n array = Array.new(n+2) { Array.new(n+1) { 0 } }\n (0...n+2).to_a.each do |i|\n array[i][0] = 1\n end\n\n sum = 0\n (1...n+1).to_a.each do |i|\n sum = 0\n (1..i).to_a.each do |j|\n ...
[ { "docid": "032f579338e58ed933619240fe9953ca", "score": "0.66370744", "text": "def calc_tree\n tree = []\n n = 1\n while n <= @n\n result = []\n result = [[0, 1]] if n == 1\n tree.each do |row|\n line1 = []\n line2 = []\n row.each_with_index do |elem, i|\n ...
70f075b0643b8e8f1977a3d45c3d2fd8
method named time_of_day that, given a boolean as an argument, prints "It's daytime!" if the boolean is true and "It's nighttime!" if it's false. Pass daylight into the method as the argument to determine whether it's day or night.
[ { "docid": "af9d946a8a6070ea48ebe6ebdb966b5b", "score": "0.88002646", "text": "def time_of_day(bool)\n puts bool ? \"It's daytime!\" : \"It's nighttime!\"\nend", "title": "" } ]
[ { "docid": "e16d13ee0e679851e6dffc346e0d38ba", "score": "0.8987341", "text": "def time_of_day(boolean) # same as book solution, except they named the parameter daylight.\n if boolean\n puts \"It's daytime!\"\n else\n puts \"It's nighttime!\"\n end\nend", "title": "" }, { "docid": "c...
a56405aaf6107d4ffa868eb2c2a5af49
Shuts down this JMX plugin instance by releasing all connections to remote mbeans.
[ { "docid": "349b40c209fe4cfd1f6a564d7180ebb4", "score": "0.70204544", "text": "def shutdown\n @connections.each do |key, conn|\n begin\n conn.close\n rescue ConnectException\n # ignored, connection already closed\n rescue => e\n notify(:msg => \"[#{@n...
[ { "docid": "6b40b4bf3098ff03ff1401694a536657", "score": "0.6531792", "text": "def shutdown\n synchronize do\n @plugin_instances.each(&:shutdown)\n end\n end", "title": "" }, { "docid": "3fa4d5b49394e34754353d4133c1cacb", "score": "0.6499806", "text": "def shutdown...
eee0654ae2bd6fd24aadc60fe645046c
Reads information about all versions of a job
[ { "docid": "6b98da3af3e80338f9e8cc1c293458c7", "score": "0.6985208", "text": "def versions(id)\n connection.get do |req|\n req.url \"job/#{id}/versions\"\n end\n end", "title": "" } ]
[ { "docid": "1478eb865a7c3a99ec3351585225231c", "score": "0.6284609", "text": "def job_version\n @job_version ||= self.class.version\n end", "title": "" }, { "docid": "6df7cdd33d1008afe4d1bbed0b759f4a", "score": "0.6281735", "text": "def job_info(args)\n resp = http_c...
3c952664329b857ab7ec9758825b221f
Public: Whether tha fault has been marked as ignored.
[ { "docid": "0ab603f2fbce33b053c702bac37ba3a2", "score": "0.6997143", "text": "def ignored?\n @ignored == true\n end", "title": "" } ]
[ { "docid": "13eb2d13b7b6b88401af177b36be3524", "score": "0.7160744", "text": "def fault_tolerant?\n false\n end", "title": "" }, { "docid": "83dfa9c0df91bcd1049e83f0c86e30bc", "score": "0.7025043", "text": "def is_excuse?\n # XXX: TODO\n return true\n #[MISSING]....
ec7771e2a015ccf84f0f4eac4bbdee07
store last url redirect to whatever the user last visited.
[ { "docid": "3c6aee9a83179200fc416d099afa42ef", "score": "0.7054769", "text": "def store_location\n session[:previous_url] = request.fullpath\n end", "title": "" } ]
[ { "docid": "74f672677dc6f11b8abd39b884552ed1", "score": "0.79805183", "text": "def set_last_url\n session[:last_url] = request.fullpath if request.method.casecmp('get') == 0\n end", "title": "" }, { "docid": "084e03ca4d8688b95a84de3f1bc789b5", "score": "0.7680838", "text": "def s...
156b62f057edf42844d9e31d3e038652
convert access flag to string
[ { "docid": "49406376e70c7bc9cc709ee57df200f4", "score": "0.7631203", "text": "def to_s\n ACCESSORS.select{|e| ((e[:value] & @flag) != 0) }.map{|e| e[:name] }.join(' ')\n end", "title": "" } ]
[ { "docid": "535e7e12e6c7e646c6232b34e99cb1b4", "score": "0.77863705", "text": "def flag_to_string(flag); end", "title": "" }, { "docid": "72358a2597aec54f323dfaffad65a859", "score": "0.70720446", "text": "def access_level_str\n return @@access_level_map[access_level][:label]\n en...
08e25c0f75f0fe3cd93ce8bcb3c2eeae
Assigns multiple Users to a Profile To batch assign users to a profile (Admin profile, User profile) (as in qTest Manager admin panel). It requires that your qTest Manager profile is a site admin with Manage Client Users permissions qTest Manager version: 8.4.2+
[ { "docid": "ddabe65f0ae753a2f0f14532db2052d8", "score": "0.6267726", "text": "def batch_assign_user_profile_in_client_with_http_info(body, opts = {})\r\n if @api_client.config.debugging\r\n @api_client.config.logger.debug \"Calling API: UserprofileApi.batch_assign_user_profile_in_client ...\...
[ { "docid": "139898f3a4e351729b0ee4df2e8297dd", "score": "0.66958165", "text": "def batch_assign_user_profile_in_client(body, opts = {})\r\n data, _status_code, _headers = batch_assign_user_profile_in_client_with_http_info(body, opts)\r\n return data\r\n end", "title": "" }, { "d...
df80e454a540a4cb8b8651bb03c3df48
Display a description of a potentiallydangerous task, and prompt for confirmation. If the user answers with anything that begins with 'y', yield to the block. If +abort_on_decline+ is +true+, any non'y' answer will fail with an error message.
[ { "docid": "cc5d8e207089a1d3837d255d718f1ef6", "score": "0.79469055", "text": "def ask_for_confirmation( description, abort_on_decline=true )\n\tputs description\n\n\tanswer = prompt_with_default( \"Continue?\", 'n' ) do |input|\n\t\tinput =~ /^[yn]/i\n\tend\n\n\tif answer =~ /^y/i\n\t\treturn yield\n\t...
[ { "docid": "b76ea9ed34b5331c51bc088207ed9e4f", "score": "0.79013485", "text": "def ask_for_confirmation( description, abort_on_decline=true )\n\t\tputs description\n\n\t\tanswer = prompt_with_default( \"Continue?\", 'n' ) do |input|\n\t\t\tinput =~ /^[yn]/i\n\t\tend\n\n\t\tif answer =~ /^y/i\n\t\t\tretu...
9c51d5e92dd78337481e4a7809ffdeaa
Check if the the number of requests made on this connection is greater than the reconnect interval. If so reconnect to a random node in the cluster. No attempt is made at preventing the reconnecting from going back to the same node
[ { "docid": "84bc541b14093d666571f7ce4d57294a", "score": "0.78086317", "text": "def _maybe_reconnect()\r\n\t\tif @request_count >= @reconnect_interval\r\n\t\t\t$LOG.debug(\"Completed #{@request_count} requests using this connection, reconnecting...\")\r\n\t\t\t_close_socket(@connection)\r\n\t\t\t@node_id...
[ { "docid": "ee34f436f9c2b6d38d686559ef3aa393", "score": "0.68644935", "text": "def _reconnect()\r\n num_nodes = @nodes.size\r\n attempts = 0\r\n new_node_id = @node_id\r\n while attempts < num_nodes\r\n new_node_id = (new_node_id + 1) % num_nodes\r\n new_node = @nodes[new_node_id]\...
47c74b0542104167bbb08e09b03f3b70
By default generate a document if it's a new record. Any edits will require manually checking.
[ { "docid": "10d6c1964999d040f2f4049da401cc05", "score": "0.81626695", "text": "def doc_generate\n\t\treturn @doc_generate if !@doc_generate.nil?\n\t\t@doc_generate ||= new_record?\n\tend", "title": "" } ]
[ { "docid": "cb04236a47d13cc355632c364cb2facb", "score": "0.7256414", "text": "def new_document\n end", "title": "" }, { "docid": "d22ee6e59b783447ffdba68f8446c8c4", "score": "0.69963306", "text": "def create_document\n\t\t@document = Document.new\n\tend", "title": "" }, ...
32e55da6b9610d668af0fa20444e2282
display a project form
[ { "docid": "b360ba08b4127fc01f45c724c9299492", "score": "0.0", "text": "def new\n @projects = Project.new\n end", "title": "" } ]
[ { "docid": "3d9a478791e27e57f75007035e76cfb2", "score": "0.77695906", "text": "def form\n @project = Project.new\n end", "title": "" }, { "docid": "65e4b4b8f4a6b8250c046d2a693a18b4", "score": "0.75012964", "text": "def projectDialog()\n manageprojectui = GUIManageProjects.new(...
f95e942d5fcdace05f3359d2a1275d52
GET /reported_infractions/new GET /reported_infractions/new.xml
[ { "docid": "0726e97160c2aa605c397d40fd10778e", "score": "0.0", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @report_participant_relationship }\n end\n end", "title": "" } ]
[ { "docid": "c7e6059bb336ab9c1f6f984f860c2fd6", "score": "0.6764165", "text": "def new_rest\n @instrument = Instrument.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instrument }\n end\n end", "title": "" }, { "docid": "3e854296...
d82da929f8f6f8a21d22549b26e756f8
Determines if this hand contains at least two pairs.
[ { "docid": "88bf1334dbfd3a7efd33ee1f384b88a6", "score": "0.7582596", "text": "def two_pair?\n return unless size >= 4\n\n the_cards = cards_by_rank.values\n the_cards[0].count >= 2 && the_cards[1].count >= 2\n end", "title": "" } ]
[ { "docid": "ecc365045f34f168044e1be17773c66f", "score": "0.7957842", "text": "def two_pair?\r\n self.create_hash.values.count(2) == 2\r\n end", "title": "" }, { "docid": "560b3675a61487c5f4be94ffd7c2d0bd", "score": "0.7948892", "text": "def is_two_pair?\n repetitions(2).ke...
20feb351b1ce595463086d0f730cb531
link button to submit form
[ { "docid": "ce726aaf516fc2c5c0c12c2e355ef4a5", "score": "0.7200368", "text": "def link_to_submit(*args, &block)\n\t\tlink_to_function (block_given? ? capture(&block) : args[0]), \"$(this).closest('form').submit()\", args.extract_options!\n\tend", "title": "" } ]
[ { "docid": "56a43c4128dd0e45cf8a4149aa2fdbd8", "score": "0.7786177", "text": "def submit_button_to(link, options = {}, properties = {})\n properties = { method: options[:method]&.to_sym || :post, rel: \"nofollow\" }.merge(properties)\n _link_to link, { icon: \"check-circle\", type: \"success\", te...
d4cc92c9f161e1824eaa561de7c88957
Metodo que se encarga de buscar un token en la tabla de simbolos y en sus tablas padres.
[ { "docid": "e30cf2a176bc307a6e81bdc7dcbfa23a", "score": "0.0", "text": "def find nombre\n\t\tif @tabla.has_key? (nombre)\n\t\t\t@tabla[nombre]\n\t\telsif @padre == nil\n\t\t\tnil\n\t\telse\n\t\t\t@padre.find(nombre)\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "6c0cecd97aba9718431cc1237f39cf5e", "score": "0.59743917", "text": "def obtener_token\n\n\t\t# Se consumen los espacios en blanco y los comentrios.\n\t\t@entrada =~ /\\A(\\s|\\t|\\n|\\#.*)*/\n\t\t@entrada = $'\n\t\t$&.each_char do |chr|\n\t\t\tif chr == \"\\n\" # Si es salto de linea, se suma...
5790adb3ab689289c56203f768432b83
WINNER method should accept a board or array and return the token "X" or "O" that has won the game given a winning board
[ { "docid": "161964296b3b361e1f8951c0f1efe5bb", "score": "0.7672603", "text": "def winner(board)\n board_return = won?(board)\n if board_return.class == Array\n if board[board_return[0]] == \"X\"\n return \"X\"\n else\n return \"O\"\n end\n else\n return nil\n ...
[ { "docid": "3af57f0bcea0b71547077bfd0128c76e", "score": "0.82795686", "text": "def winner(board)\n #return token x or o that won the game\n \n if ( won?(board) )\n position_array = []\n (won?(board)).each do |element|\n position_array << board[element]\n end\n choice_X = position_arr...
f90c86c271510c3669ce29a69d37764f
(Plot) Draw one or more scatter plots.
[ { "docid": "f130c433467e2ab540e29e77e962126c", "score": "0.7895444", "text": "def scatter(*args)\n create_plot(:scatter, *args)\n end", "title": "" } ]
[ { "docid": "04ad5ded947c7db5b0d222ec12da6fda", "score": "0.7593891", "text": "def plot_scatter; end", "title": "" }, { "docid": "5ec631042d41d30d36cb3e64f60c4a94", "score": "0.6864335", "text": "def plot_scatter3; end", "title": "" }, { "docid": "70d32156262ddf10112e929ed...
846b2b2962d5426c4affa11a93dfce1e
GET /tool_specialty_options/1 GET /tool_specialty_options/1.json
[ { "docid": "e4a1b027bc544ba8c5260a3ad5cad187", "score": "0.750531", "text": "def show\n @tool_specialty_option = ToolSpecialtyOption.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tool_specialty_option }\n end\n end", "tit...
[ { "docid": "2c30f016f57b0bbe8f0a2654e173a017", "score": "0.7000276", "text": "def new\n @tool_specialty_option = ToolSpecialtyOption.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tool_specialty_option }\n end\n end", "title": "" }, ...
4e558de352ee7d4c1e78ca5540814c23
Reads an int (4 bytes) from the stream
[ { "docid": "1d146f94345446ae90304660ce880140", "score": "0.7982185", "text": "def read_int\n read_num 4\n end", "title": "" } ]
[ { "docid": "a5e2d3edf60f4bb14e64d687148b94fa", "score": "0.8356173", "text": "def read_int\n @io.read(4).unpack('L').first\n rescue => e\n raise IOError, e.message\n end", "title": "" }, { "docid": "67e26e19682e73c0e3a3716ea7618bf7", "score": "0.8121146", "text": "def...
730513f4dd3f3473720a23de712d9d8b
========================================== Activity Time Series Methods ========================================= Get time series data in the specified range for sedentary minutes
[ { "docid": "0adf3b24edc46cb224be419620476f83", "score": "0.5352223", "text": "def activities_minutes_sedentary(base_date, end_date)\n get(\"/user/#{@user_id}/activities/minutesSedentary/#{format_date(base_date)}/#{format_date(end_date)}\")\n end", "title": "" } ]
[ { "docid": "f096da6805a69663521d78e7d0252d35", "score": "0.6669688", "text": "def graph_data(events, minute_range)\n graph_data =[]\n events.each do | e |\n if (Time.now - e.capture_time) / 60 < minute_range\n graph_data << [e.capture_time, e.value]\n end\n end\n return grap...
26ddaca784eba782de66b3d43bc7360a
Calculates STATS Value for Mail Class
[ { "docid": "9572194278c4be4573a5b4731866fe10", "score": "0.5250212", "text": "def determine_class_data_for(mailClass)\n\t\tif mailClass == 'FC'\n\t\t\treturn '10' #Code for First Class Mail\n\t\telsif mailClass == 'PM' or mailClass == 'CM'\n\t\t\treturn '20' #Code for Priority Mail\n\t\telsif mailClass ...
[ { "docid": "600745f81af1ce78324dbbc73f8ab19b", "score": "0.5920224", "text": "def stats; end", "title": "" }, { "docid": "600745f81af1ce78324dbbc73f8ab19b", "score": "0.5920224", "text": "def stats; end", "title": "" }, { "docid": "d90e5ffb1463bccf533809619aa4e409", "...
c159c3d8734c9d870027aa10e051ce6b
Is the daemon active?
[ { "docid": "718b0a504a040c2ba5ee8fcc747f9817", "score": "0.0", "text": "def active?\n return false unless File.exist? alive_file\n\n (last_alive || Time.new(0)) > Time.now - 60\n end", "title": "" } ]
[ { "docid": "3784267fbeb7843921e0d9d11bd30c19", "score": "0.83698016", "text": "def daemonized?\n @deamon == true\n end", "title": "" }, { "docid": "e0c1c8ae79daec73959269d33a205f41", "score": "0.81575394", "text": "def daemon_alive?(daemon)\n `#{@ns.nsenter} ps aux | gre...
645b802d8d69492124dc1229954dae73
Sets the webLink property value. The webLink property
[ { "docid": "55cb05bb594c1113751f6e1bad0ff635", "score": "0.8827693", "text": "def web_link=(value)\n @web_link = value\n end", "title": "" } ]
[ { "docid": "5f3460e6e45dde020dc175c7c4cedceb", "score": "0.8651062", "text": "def web_link=(webLink)\n @web_link = webLink\n end", "title": "" }, { "docid": "47b622b828527aa9392976cb396bf88c", "score": "0.7854618", "text": "def set_web_link\n @web_link = WebLi...
8415719aa0bf8931cb4dd38331767c85
GET /provinces/new GET /provinces/new.json
[ { "docid": "4c5372fba3a0575434c378df53db2eb3", "score": "0.78814304", "text": "def new\n @province = [Region.find(params[:region_id].to_i), Province.new]\n respond_to do |format|\n format.html { render \"layouts/new_edit\" }\n end\n end", "title": "" } ]
[ { "docid": "c5c6b52b42b764b7b5eefe7379a976da", "score": "0.85003257", "text": "def new\n @breadcrumb = 'create'\n @province = Province.new\n @regions = Region.order(:name)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @province }\n...
0d9e33a09c211a9eccdfd232b4958c61
Returns the device configuration as a hash
[ { "docid": "f0a87f550222091f4dc0879067036261", "score": "0.0", "text": "def cluster_conf\n @conf ||= ASM::DeviceManagement.parse_device_config(vcenter_id)\n end", "title": "" } ]
[ { "docid": "88ddb131c38ca31864f50e8a83ca6e11", "score": "0.7519143", "text": "def hash\n return config.hash\n end", "title": "" }, { "docid": "44c48dbc078648b0ed16f5cab282c910", "score": "0.7454701", "text": "def to_hash\n @configuration\n end", "title": "...
08026826dc29c3fc1dc7fcdaace2de31
Method to update the quantity of an item input: list, item name, new quantity
[ { "docid": "033586b53acda68e46890f6a73fa3274", "score": "0.0", "text": "def update_quantity(list, item_name, quantity)\n # steps:\n # check IF item is included in list\n # update the item’s quantity\n # ELSE, print a message to the user\n list.include?(item_name) ? list[item_name] = quantity : ...
[ { "docid": "00220631c0081c97ea4c5988d06a91f1", "score": "0.890151", "text": "def update_quantity(item, list, quantity)\n add_item(item, list, quantity)\nend", "title": "" }, { "docid": "119e0964b46a12e44075c0ea60aaed86", "score": "0.8816985", "text": "def update_quantity(list, item_...
9e8eccd124ade4e14d4d1d020546e182
function(command for DSL) to save images, pages using HTTP GET from another server
[ { "docid": "dfb89349ce6ab7a48858502fbdc02a8d", "score": "0.5837126", "text": "def save_as( url, dest )\n\t\tself.out \"save_as\"\n\t\tto = @code + dest\n\t\tself.out \" :#{to}\"\n\t\t#if !@isTest\n\t\t\t# If file exists - for saving resource of HD\n\t\t\t# we delete it - we don't need copies \n\t\t\t...
[ { "docid": "040cd267dd37c4b579ec4134b4905568", "score": "0.70723915", "text": "def post_file_to_server id, content, size, page_count, extension = \".jpg\"\n\n @s.execute_file_post @s.url_for(\"system/pool/createfile.#{id}.page#{page_count}-#{size}\"), \"thumbnail\", \"thumbnail\", content, related_mime...
e55e82bde70bcc6b78e738d705d5f486
Selecting the dropdown by value
[ { "docid": "f4f27fc3a8923c2e6ec2704d7e38210d", "score": "0.75392723", "text": "def select_item_by_value(webelement,value)\n option=Selenium::WebDriver::Support::Select.new(@driver.find_element(webelement))\n option.select_by(:value,value)\n end", "title": "" } ]
[ { "docid": "467913283a40782eecf282d87ed40390", "score": "0.77059495", "text": "def select_with_value(val)\n guid = @driver.get_sc_guid(val)\n option_locator = \"value=regexi:^#{guid}$\"\n @driver.sc_select(:view, option_locator, self.abs_path)\n stall :select\n ...
1704d2d5120b4748e5542c45baaa186e
Revert current database config to previous (database.php.tmp)
[ { "docid": "85298026b30c7ca203d977cc9212b12d", "score": "0.87715954", "text": "def revert_database_config\n database_temp = @database + '.tmp'\n return unless File.exist?(database_temp)\n\n File.delete(@database) if File.exist?(@database)\n File.rename(database_temp, @database)\n ...
[ { "docid": "dbf8c6e11ef4a2969821de245cac0474", "score": "0.7013675", "text": "def revert_database\n ActiveRecord::Base.establish_connection(default_connection)\n end", "title": "" }, { "docid": "ecd2bdd5b8714bcd9f3f6005aee0dffb", "score": "0.690955", "text": "def rollback_to_...
921268a1028727cd1706ed5e3d73b601
properties for kissmetrics new job
[ { "docid": "f777bfb9fda7317f48f20914df6cc685", "score": "0.0", "text": "def km_properties_for_new_service\n km = self.km_properties\n km[:service_budget] = self.budget_in_currency_without_code(Currency.get_idr.code)\n km\n end", "title": "" } ]
[ { "docid": "3a7396a8b3dd60980339ff72d890c571", "score": "0.7134459", "text": "def km_properties_for_new_job\n km = self.km_properties\n km[:job_budget] = self.budget_in_currency_without_code(Currency.get_idr.code)\n km\n end", "title": "" }, { "docid": "6aeb5635558b22c7ee0e746a098c...
243fbac99319df9dad679706675b9a23
Handle a POST request. All SOAP actions are done through HTTP POST.
[ { "docid": "e6d8805076b4de0955d72730861836c9", "score": "0.77747643", "text": "def do_POST(request, response)\n content_type, params = parse_content_type(request)\n\n # In SOAP 1.1, the action is sent in the SOAPAction header. In\n # SOAP 1.2, it's sent as a parameter to the Content-Type heade...
[ { "docid": "af4a34defe83fba291a3c174b9886e46", "score": "0.6811033", "text": "def send_post_request\n post_req = prepare_request_body\n reputation_web_service_hostname = URI.parse(WEBSERVICE_CONFIG['reputation_web_service_url']).host\n reputation_response = Net::HTTP.new(reputation_web_service_...
694d16c4c3c74f136759492914574e82
GET /users/1 or /users/1.json
[ { "docid": "a50f60c6d619d2da1f7a8ad5ec170ddf", "score": "0.0", "text": "def show\n render json: @user\n end", "title": "" } ]
[ { "docid": "4152fb6556ae83f7cdd6c362f17ad9bf", "score": "0.78865844", "text": "def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n ...
cf1d20add889e346c12c8992a6df101b
DELETE /quotes/1 DELETE /quotes/1.json
[ { "docid": "2ef3ed5d8fff2cfe8a9b7d41ef303ce7", "score": "0.7585356", "text": "def destroy\n @quote.destroy\n respond_to do |format|\n #format.html { redirect_to quotes_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "16a7704a1f2a1be2ab9ee3011004a035", "score": "0.773237", "text": "def destroy\n @quotes.destroy\n respond_to do |format|\n format.html { redirect_to quotes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "92b7f08098582307d14afb9...
995e2138f4e0e720c951b3cc8551ada1
Reads OLE data of a DrawingObject from the document node.
[ { "docid": "2b012238a91bded96a02729b8df5774a", "score": "0.63684446", "text": "def get_document_drawing_object_ole_data_online(request)\n begin\n data, _status_code, _headers = get_document_drawing_object_ole_data_online_with_http_info(request)\n rescue ApiError => e\n if...
[ { "docid": "6db4f9d2ec2de2b4e09b12bc8f0c094d", "score": "0.7057016", "text": "def get_document_drawing_object_ole_data(request)\n begin\n data, _status_code, _headers = get_document_drawing_object_ole_data_with_http_info(request)\n rescue ApiError => e\n if e.code == 401\...
a176708cbbc22b232f1f4b02e422d8d7
store user as well as contributor, to attribute authorship later
[ { "docid": "28ed576aca20623c04581d80b946f37e", "score": "0.0", "text": "def update_activity_feed\n Activity.create(user: user,contributor: contributor, item: self, description: \"answered_the_question\", addition: 0)\n end", "title": "" } ]
[ { "docid": "ac48f0c189347e978b072d14349fed85", "score": "0.68449557", "text": "def store_contributor data\n return nil unless data['id'].present? and data['url'].present?\n\n contributor = Contributor.find_or_initialize_by(github_id: data['id'])\n contributor.update_attributes({\n ...
65ef2ab7607d5e53c661d9ac9dda4af3
PUT /makers/1 PUT /makers/1.json
[ { "docid": "50a7df500289009f74e54f3626befe65", "score": "0.68834484", "text": "def update\n @maker = Maker.find(params[:id])\n\n respond_to do |format|\n if @maker.update_attributes(params[:maker])\n format.html { redirect_to @maker, notice: 'Maker was successfully updated.' }\n ...
[ { "docid": "503e88c6ac59d1667ce8d51b6c86dea9", "score": "0.65175116", "text": "def update\n if @maker.update(maker_params)\n render :show, status: :ok, location: @maker\n else\n render json: @maker.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "doci...
760799e740b4e5071a70e030adf68be7
cache a collection of results
[ { "docid": "1edff0af814a382f20c133442620665c", "score": "0.0", "text": "def cache_multi(bindings, context = {}, &block)\n cache_options = apply_cache_options(context)\n ctx = key_context(context)\n keys = bindings.map do |binding|\n key(binding, ctx)\n end\...
[ { "docid": "6b7315ea33552f55c1b24c1ddd9144b0", "score": "0.7184003", "text": "def caching(&block)\n if defined? @collection\n @collection.each(&block)\n else\n @collection = []\n execute.each do |doc|\n @collection << doc\n yield doc if bloc...
b6ad3d00ab18a50cf64bf3c44d78bd27
POST /users POST /users.json
[ { "docid": "10e5ff14e2bbece59fa13a7281adb3c3", "score": "0.0", "text": "def create\n self.instance = model.new(permitted_params)\n if instance.save\n redirect_to instance, notice: 'Created successfully'\n else\n render :new\n end\n end", "title": "" } ]
[ { "docid": "24c5e44d772da89269600975eeebdfda", "score": "0.719235", "text": "def create\n @user = User.new(user_params)\n @user.save\n json_response(@user, :created)\n end", "title": "" }, { "docid": "6e1490da4a56756e02c8de2a503a156e", "score": "0.7186101", "text": "def cre...
4473e7a577bf0f12ebf8bdb4bedf7c58
Composite two images together Composites two input images together; a layered image onto a base image. The first image you input is the base image. The second image (the layered image) will be composited on top of this base image. Supports PNG transparency. To control padding you can include transparent pixels at the b...
[ { "docid": "e45317494ffb5e3a579550c06f0c527f", "score": "0.49874926", "text": "def edit_composite_basic(location, base_image, layered_image, opts = {})\n data, _status_code, _headers = edit_composite_basic_with_http_info(location, base_image, layered_image, opts)\n data\n end", "title":...
[ { "docid": "9c6d19b9446948015027b422d1953f7e", "score": "0.63545126", "text": "def merge_layer(other_layer)\n if self.type == Layer::LAYER_NORMAL and\n other_layer.type == Layer::LAYER_NORMAL\n\n # Calculate all the new dimensions for the new canvas\n top = [self.bounds.top, other_lay...
6a46a52170a6f227d9d6e4b46012d746
GET /cyclic_servos/new GET /cyclic_servos/new.json
[ { "docid": "0bcabf10a55c5d90d6d6635c5558ea2f", "score": "0.7325541", "text": "def new\n @cyclic_servo = CyclicServo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cyclic_servo }\n end\n end", "title": "" } ]
[ { "docid": "ff776ab942cf80b20cf468535b6dc67a", "score": "0.6922052", "text": "def new\n @serv = Serv.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @serv }\n end\n end", "title": "" }, { "docid": "bdefcae1cec841161a2377f72e605801"...
482a45a7588770c686d8a3d4ec304cc9
Reads a null terminated string off the stream
[ { "docid": "912e780f76346e54fa2ff3a249d19611", "score": "0.60934925", "text": "def read_string(length, encoding: \"UTF-8\", packfmt: \"Z*\")\n if length > 0\n res = read_single(packfmt, length).force_encoding(encoding).encode(encoding)\n track res\n else\n raise ...
[ { "docid": "a72f45796be479225a140ea42df66f88", "score": "0.78143686", "text": "def read_string\n return '' if self[:length].zero?\n self[:data_ptr].read_bytes(self[:length])\n end", "title": "" }, { "docid": "5c3526174c5291efa05ef53590214b27", "score": "0.7773378", ...
d1575760a7973a5b56da87e489421ab6
Creates the javascript to populate the edit boxes with the fields in the selected row. Requires the model name and the field list. The edit boxes are expected to have an ID of the form "[model]_[fieldname]" TODO: Need to check the selected categories as well. TODO: Need to check/uncheck the selected categories as well....
[ { "docid": "af5a2241174747923d0ad3c40f122510", "score": "0.6762925", "text": "def create_row_click_javascript(model, field_list, col_start)\n=begin\n javascript = \"<script type='text/javascript'>\\r\\n//<![CDATA[\\r\\n\"\n javascript << \"$('tr').each(function() {\\r\\n\"\n javascript << \"$(this).c...
[ { "docid": "86ce439d8dfdfafcbdba3cec20a7b995", "score": "0.60478073", "text": "def generate_form_fields(obj)\n \n # Use the model's predefined array of columns if it has one..\n # Otherwise use all non-railsy unique columns..\n if obj.class.respond_to?(:editable_columns)\n colum...
95f40b8c93c8ea0040aedf2daef99ae4
Detach a volume from an instance
[ { "docid": "e2749a585e339c44b68ed8e0121aaf77", "score": "0.7968599", "text": "def detach(options={})\n param = { :uniq_id => @uniq_id }.merge options\n if param[:server]\n param[:detach_from] = param[:server].uniq_id\n param.delete :server\n end\n Storm::Bas...
[ { "docid": "f162f1e597e3337405e1fbfc46ad843a", "score": "0.8891538", "text": "def detach_volume vol, instance\n puts \"Detaching volume from instance\"\n return instance.detach_volume vol.id\n end", "title": "" }, { "docid": "64c69dfa9d3393aae63a6cb2280fab4c", "score": "0.7871175"...
b6ad3d00ab18a50cf64bf3c44d78bd27
POST /users POST /users.json
[ { "docid": "9d1867f2babe414f72207d5e54fa540a", "score": "0.0", "text": "def create\n user = User.where(\"name like '#{params[:user]}'\")\n respond_to do |format|\n if user.first&.authenticate(params[:password])\n login_sucessfull user\n format.html { redirect_to root_path, notic...
[ { "docid": "4794c3e6e2db462f4d8769453efddedd", "score": "0.7717216", "text": "def post_users(users)\n self.class.post('https://api.yesgraph.com/v0/users', {\n :body => users.to_json,\n :headers => @options,\n })\n end", "title": "" }, { "docid": "a3973850c21e121410e21014...
9eeb50b9f51c2748171bb9ffd24cde17
Form to let a user login to their account
[ { "docid": "d268a80bcb6fcb2fc0ab599701f1252c", "score": "0.0", "text": "def new\n @title = 'Login'\n end", "title": "" } ]
[ { "docid": "d30fc3cee98afdc615eb52f5160fe67e", "score": "0.81579036", "text": "def login_account(username, password)\n login_form.email_txt.set username\n login_form.password_txt.set password\n login_form.login_btn.click\n end", "title": "" }, { "docid": "29e13f336cd12a2f6c1fe12b44...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ac8b1027f316cbe6d2a2d2f48c1828ac", "score": "0.0", "text": "def set_administradore\n @administradore = Administradore.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "d...
6edf1c4bf072a914b8ca0f97553d59f6
Store the source lines as instances of NdrImport::NonTabular::Line
[ { "docid": "1e935238f87f82a40377978656ce0b1f", "score": "0.73673236", "text": "def non_tabular_lines=(lines)\n @non_tabular_lines = lines.map.with_index do |line, i|\n NdrImport::NonTabular::Line.new(line, i)\n end\n end", "title": "" } ]
[ { "docid": "0ce9ca4042a4bbcb34208adffa4571b6", "score": "0.68076587", "text": "def src_lines\n @src_lines = src.lines.to_a\n end", "title": "" }, { "docid": "5a5bb40858c5e34d670366b16129f800", "score": "0.65861654", "text": "def source_lines\n @lines ||= begin\n ...
0a9e6be56879d328362101e5ff09978e
lexer rule t__18! (T__18) (in orasource.ruby.g)
[ { "docid": "1d6dab9f9ddb801d38a2cad96f25e22a", "score": "0.0", "text": "def t__18!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 8 )\n\n type = T__18\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n ...
[ { "docid": "a31665535ad69b4a4f95ffcc62dba933", "score": "0.7810723", "text": "def t__65!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 43)\n\n type = T__65\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -...
5823c75f7437cf9f59a185b6d2ebf8b8
GET /posts/1 GET /posts/1.json
[ { "docid": "918f8e91e28083cf11e0185d89fa8622", "score": "0.0", "text": "def show\n @all_comments = @post.comments.includes(:author)\n @parent_comments = @all_comments.select do |comment|\n comment.parent_comment_id.nil?\n end\n end", "title": "" } ]
[ { "docid": "c884d3048f42b4b1b768c271940bbed7", "score": "0.7437435", "text": "def show\n post_id = params[:id]\n render json: V1::Post.get_a_post(post_id)\n end", "title": "" }, { "docid": "fb578f587fdfe1b0a8d3ac27001f9611", "score": "0.736332", "text": "def index\n ...
3d0dcc7138b9161139e116897349b963
GET /planers GET /planers.json
[ { "docid": "2c5c5cb7c75f804281c7def06ffd665f", "score": "0.75847954", "text": "def index\n @planers = Planer.all\n end", "title": "" } ]
[ { "docid": "d461f792c96f59f57b02cd205100a2ea", "score": "0.7097935", "text": "def show\n @plan = Plan.find(params[:id])\n\n render json: @plan\n end", "title": "" }, { "docid": "41a9a758497eff5131d52abc1c7b367d", "score": "0.7049744", "text": "def index\n @plans = Plan.all\...
55e1f8c5761efe076a1ca2f2186bec29
def service_part? part_type == "S" end
[ { "docid": "b67454cc8be3e73422152f68a8e1d98c", "score": "0.0", "text": "def hack\n self.price = 200\n end", "title": "" } ]
[ { "docid": "2bc04b4076d0208ee3535cba1a4bfbd2", "score": "0.6924477", "text": "def part?(name)\n !part(name).nil?\n end", "title": "" }, { "docid": "d60a2b3f4170f78a9cf27f5e36106491", "score": "0.661331", "text": "def service_pt?()\n return true if (@service == TAC_PLUS_AUT...
4edef223e981c0de12895e71ced0679a
TODO: add structured output test cases (when supported on XR)
[ { "docid": "060fe0785fb4334c305af22fb4d4733e", "score": "0.0", "text": "def test_smart_create\n autoclient = Cisco::Shim::Client.create(address, username, password)\n assert_equal(Cisco::Shim::GRPC::Client, autoclient.class)\n assert(autoclient.supports?(:cli))\n assert_equal(:ios_xr, autocl...
[ { "docid": "5a0b0aa6237f87f111dae69ed733bc2a", "score": "0.64022934", "text": "def parse_output(_report, _result, _targets); end", "title": "" }, { "docid": "6a81be4b7356aa9a71a3e3401f737d60", "score": "0.63632077", "text": "def test_print_results\n @d.add_book\n @d.add_book\n ...
258a69e757d11a5d45e7c98df7969a6f
Renvoie si l'arete est double ou non. === Return
[ { "docid": "308a72edce9739dc8485569da82fde4f", "score": "0.588893", "text": "def estDouble()\n return @estDouble\n end", "title": "" } ]
[ { "docid": "de2832ae8595b45495817d7b370f54e7", "score": "0.73834753", "text": "def double?\n type == DOUBLE_TYPE\n end", "title": "" }, { "docid": "0278c400d0d0b227961a9bd96ec2bd6b", "score": "0.6661089", "text": "def nbAreteDouble\n nbDouble = 0\n @aretes.each { |x...
16f5c347fb0b4ac21c150195ba1110fc
wrapper for time_ago_in_words that won't go into minutia
[ { "docid": "7b8d1b65a8fddef9db3eef822c50f5ee", "score": "0.62261677", "text": "def how_long_ago(date)\n if date.to_date == Date.today\n return 'today'\n elsif date.to_date == Date.yesterday\n return 'yesterday'\n else\n return time_ago_in_words(date)+' ago'\n end\n end", ...
[ { "docid": "3ba70ef602c4802bfaa4a94a43138480", "score": "0.8186425", "text": "def ts_in_words tm\r\n time_ago_in_words(tm).gsub('about','') + ' ago' if tm\r\n end", "title": "" }, { "docid": "6b9fcc86eeb291f1f8d20e4775a59f36", "score": "0.8031529", "text": "def time_ago_in_words ...
49c50a7a64e7002efb40fc847bcdd1e0
Create a child context to use for `key`
[ { "docid": "cbb1495b0bc8f0092f3517d883af6b80", "score": "0.6290763", "text": "def spawn_child(key:, irep_node:, object:)\n FieldResolutionContext.new(\n context: @context,\n parent: self,\n object: object,\n key: key,\n irep_node: irep_node...
[ { "docid": "50f006e29a05f186179d6528d52af90a", "score": "0.7545888", "text": "def child(key)\n Context.new(\n parent: self,\n path: \"#{@path}/#{key}\",\n value: value[key],\n models: @models,\n results: @results\n )\n end", "title": ""...
ef6b0edee5bc8533514599cdb0da93aa
dir_alias = name Changes the directory object name.
[ { "docid": "a975f602da89bd99a5b69fee785a0579", "score": "0.8438623", "text": "def dir_alias= name\n #This is a stub, used for indexing\n end", "title": "" } ]
[ { "docid": "f361d313f2d39fa69c3dfea106614b8a", "score": "0.74876875", "text": "def dir_alias()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "1d91ee2b4258eabdce5f8c17a70e223e", "score": "0.6526442", "text": "def alias_name\n name.to_s.p...
25aa140e5c5007d60d40451c2ae32967
Using tree concept to go through the neighbouring positions
[ { "docid": "c7bb1a84210a7dce856d13dc25cb67d8", "score": "0.0", "text": "def handle_pos(pos)\n # debugger\n self.creat_board_num(pos)\n pos_value = self[pos].value\n\n return pos if pos_value > 0\n\n neighbours = self.filter_neighbouring_positions(pos)\n neighbou...
[ { "docid": "357e0eb9b70aac3ae85b761a03f5189b", "score": "0.683323", "text": "def traverse_tree?(positions, letters, game)\n return true if letters == []\n next_positions = indexes_of_letter(letters.shift, game)\n positions.each do |position|\n neighbours = adjacent_from_array(position, next_positi...
07fe89e7d1db71ed6cd54513435c734f
User.where(weekly_subscriber: true).find_each do |user| NewsMailer.weekly(user).deliver_now
[ { "docid": "ec74c3996d63b23f0ae6bbfbf47a369e", "score": "0.0", "text": "def edit\n @voter = Voter.find(params[:id])\n @relevant_visits = Visit.where(voter_id: @voter.id)\n @visit = Visit.new\n end", "title": "" } ]
[ { "docid": "c2722ee7edd1a3459f84dd5a2a45ec4d", "score": "0.76773053", "text": "def perform_weekly\n \t group = Group.create(name: Date.today)\n \t group.save\n users = User.get_all_users_email\n \t users.each do |user|\n \t \tWeeklyMeetingsMailer.with(user: user).send_invitation.deliver_now\n \...
89617e4c02833d4219f01a240f6aab5b
Make a simple function called greet that returns the mostfamous "hello world!". Style Points Sure, this is about as easy as it gets. But how clever can you be to create the most creative hello world you can think of? What is a "hello world" solution you would want to show your friends? Write a function "greet" that ret...
[ { "docid": "32e46c937f8d55b65f065ae81ba5cf0f", "score": "0.0", "text": "def greet()\r\n\r\n x = [\"hello\", \"world!\"]\r\n return x.join(\" \")\r\nend", "title": "" } ]
[ { "docid": "c7058f02f615df9eb537bfb5270088a5", "score": "0.77995294", "text": "def greet\n\t\treturn \"I'm #{GOODMOOD}. How are you?\"\n\tend", "title": "" }, { "docid": "e9822ca2d546d18b1ff11d2d187fe85a", "score": "0.7773081", "text": "def greet(name)\n\tif name.downcase == \"johnny...
cb75180894f5c4a112dfa2ad45028d41
Returns the subtotal by summing the price times quantity for all the items in the cart
[ { "docid": "94ca822b9b28fab729c82fce3cc65825", "score": "0.86577684", "text": "def subtotal\n shopping_cart_items.inject(Money.new(0)) { |a, e| a + (e.price * e.quantity) }\n end", "title": "" } ]
[ { "docid": "1f69846618f120d31d895ed27ede82e6", "score": "0.8562886", "text": "def subtotal\n shopping_cart_items.inject(0) { |sum, item| sum += (item.price) }\n end", "title": "" }, { "docid": "25478e54247970d92dc0667b0022532c", "score": "0.8370276", "text": "def ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "e97cb887edd0ba96ad58f5e9e4ec7443", "score": "0.0", "text": "def set_order_item\n @order_item = OrderItem.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310596", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6014974", "text": "de...
ead94c29a52822148974ca77d26a10e8
To display the selected image/picture more details
[ { "docid": "e07fa1f1275d69d40d965675c5a27808", "score": "0.0", "text": "def show\n @pictimeline = PicTimeLine.find(@params['id'])\n render :action => :show\n end", "title": "" } ]
[ { "docid": "065f3d0f580d4b35a2bbcbbc527d8c1a", "score": "0.72961205", "text": "def afficher\n @image.display\n end", "title": "" }, { "docid": "0891bf8d3ccc956d724004b2a8946073", "score": "0.69414127", "text": "def display id\n get_image(id).display\n end", "t...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "f8e4e03df17a18f8e5da1128861decc4", "score": "0.0", "text": "def set_admin_payment\n @admin_payment = Payment.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60315156", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6018921", "text": "de...
1d39655c348b99025d08354ede9f8d8c
GET /vkontakte_ads/1 GET /vkontakte_ads/1.json
[ { "docid": "8ecc6cf7f4fde6b57bdba99639f1c254", "score": "0.74766433", "text": "def show\n @vkontakte_ad = VkontakteAd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vkontakte_ad }\n end\n end", "title": "" } ]
[ { "docid": "397753e4473df4d73e604f5001dc8ac7", "score": "0.6923371", "text": "def index\n render json: @ads = Ad.all\n end", "title": "" }, { "docid": "d69470a490a7b88ac23963bec0351386", "score": "0.6816877", "text": "def new\n @vkontakte_ad = VkontakteAd.new\n\n respond_to...
d55dbc3d62b185e0d967173d05b50e10
True if user is a member of the organization
[ { "docid": "316f23f9f67695f2217570797d9d456a", "score": "0.0", "text": "def joined?(fun_orga)\n ou_rels.find_by(joined_id: fun_orga)\n end", "title": "" } ]
[ { "docid": "ca2efc841649c78ed98aff4d5e2d19ea", "score": "0.8618406", "text": "def member?\n client.organization_member? org_id, user.login\n end", "title": "" }, { "docid": "6808422a32a7b603dc0810c2dd64c83d", "score": "0.8386929", "text": "def member?\n client.organizati...
57b9f0125ce66092a37b691b331d7942
Return object stating whether role Authoirzation permissions have been initialized or not and a reference
[ { "docid": "d24148e16f7176376aac51d888252687", "score": "0.0", "text": "def realm_roles_by_id_role_id_management_permissions_put_with_http_info(realm, role_id, management_permission_reference, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: RolesB...
[ { "docid": "261aaa3698478c7d8613b61d55563035", "score": "0.7066457", "text": "def authorised\n if self.roles.size > 0\n true\n end\n end", "title": "" }, { "docid": "bafc9e3fb1b47db64ad2624342f46fdf", "score": "0.6836544", "text": "def check_for_role\n self.role = ROLE...
abd9d58767d798274d96e3918ccc57df
Use callbacks to share common setup or constraints between actions. Only allow a list of trusted parameters through.
[ { "docid": "36888bdb6c0e4f47777cdab3e16713f9", "score": "0.0", "text": "def items_params\n params.require(:item).permit(:title,:default_price, :available,:id, {})\n end", "title": "" } ]
[ { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.6046186", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { ...
19a3f8b0ed73f915209114d6a84ad4e9
Lists the securable children under a path (the ones that either have ACLs or have children with ACLs). list('nodes', 'x') > [ 'nodes/x' ] list('nodes', '') > [ 'nodes/x', 'nodes/y', 'nodes/z' ] list('', '') > [ 'clients', 'environments', 'nodes', 'roles', ... ] list('/', '') > [ '/organizations'] list('cookbooks', 'x')...
[ { "docid": "504b721d00206b53367470c5da0c38e1", "score": "0.728262", "text": "def list(path, child)\n # TODO make ChefFS understand top level organizations and stop doing this altogether.\n parts = path.split(\"/\").select { |x| x != \"\" }.to_a\n absolute = (path[0] == \"/\")\...
[ { "docid": "f7fa314c013b78a157711e1ae3081bb1", "score": "0.68058026", "text": "def list_children(path)\n path = \"#{Paths::VFS}/#{path}\" unless path.start_with?(Paths::VFS)\n path = sanitize_path(path)\n\n @api.get(path)\n end", "title": "" }, { "docid": "8baf036f9ea8a921c...
264f87aaa6df92877594fe67d2963014
makes an object based on this template definition. the
[ { "docid": "b7095a79a3377d0d35a76f3df3e758d7", "score": "0.5738254", "text": "def make(addToSingleCollection=true)\n fieldsAlreadySet = Hash.new(false)\n dependentGenerators = Hash.new\n \n allFields = Array.new\n obj = class_for_name(@templateName)...
[ { "docid": "196e375e922b26df9e2620e4090bb92b", "score": "0.6970746", "text": "def build_object(symbol)\n @template.instance_variable_get(\"@#{symbol}\") || Inflections.constantize(Inflections.camelize(symbol)).new\n end", "title": "" }, { "docid": "f2095428bc11c2ab1f378eded8f...
656e606f5cd34768aaeee5b426828b47
POST /companies POST /companies.json
[ { "docid": "0722c5479e4038ff14d18b965c98301d", "score": "0.63130844", "text": "def create\n \n @company = current_profile.companies.build(company_params)\n\n @company.companytype_id = params[:company_id]\n\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @...
[ { "docid": "b898c2fa65abd666971b2f50a2edd2c2", "score": "0.75086176", "text": "def create\n render json: Company.create(params[\"company\"])\n end", "title": "" }, { "docid": "0f0a69a99ad286f874bb552b0e865616", "score": "0.7454409", "text": "def create\n if @company = Company....
04e154107bfea4a912ed613d997ac87e
GET /belongs_tos GET /belongs_tos.json
[ { "docid": "e1da42027482df25923501f12e4b6a72", "score": "0.778014", "text": "def index\n @belongs_tos = BelongsTo.all\n end", "title": "" } ]
[ { "docid": "cbe7fa0441b7c5464ef61d0533f11179", "score": "0.7176711", "text": "def index\n @belong_tos = BelongTo.all\n respond_to do |format|\n\t\t\tformat.html { render :index }\n\t\t\tformat.json { render json: Oj.dump(@belong_tos) }\n\t\tend\n end", "title": "" }, { "docid": "2a7d1...
bd3a7dfddc30bc69012064ac1ec450c4
Given a hash with numeric values, return the key for the smallest value
[ { "docid": "af1c1da082564c39416c78687e05651e", "score": "0.0", "text": "def key_for_min_value(name_hash)\n a = nil\n low_key = a\n low_val = a\n name_hash.each do |key, value|\n if low_key == a || value < low_val\n low_val = value\n low_key = key\n end\n end\n low_key\nend", "t...
[ { "docid": "187165074e32a7573ee53a9cabb44ed4", "score": "0.8880233", "text": "def key_for_min_value(hash)\n lowest_key=nil \n lowest_value= Float::INFINITY\n hash.each do |name,number|\n if number < lowest_value\n lowest_value=number\n lowest_key= name\n end \n end\n lowest_key\nend...
41f88ceca77114c0720ea418449ea40e
Add a new member.
[ { "docid": "60b2dada3b7c6e31cce7dcd5dcbae1c9", "score": "0.65904534", "text": "def new\n @member = Member.new\n end", "title": "" } ]
[ { "docid": "8391465b2d6852fbff64add295cbc9ab", "score": "0.80431664", "text": "def addmember\n\t\t@member=User.new\n\t\tend", "title": "" }, { "docid": "ed457e4170a860596c811829b7dd6208", "score": "0.78187776", "text": "def add_member( member )\n @members[member] = Person.new ( me...
8132832546e5c2fa1ce853b0613fe7a8
Sets the storageRequireDeviceEncryption property value. Indicates whether or not to require device encryption.
[ { "docid": "84d3afd9607030fe92ae30a8cfaf4fae", "score": "0.7979063", "text": "def storage_require_device_encryption=(value)\n @storage_require_device_encryption = value\n end", "title": "" } ]
[ { "docid": "99e8afcc252876e4bbcef260d2b198ef", "score": "0.7143112", "text": "def storage_require_removable_storage_encryption=(value)\n @storage_require_removable_storage_encryption = value\n end", "title": "" }, { "docid": "7c44104b724dc00d594a7bad4ae5202b", "...
179d8560b28818858ec42792ada57fbe
attach a description to the parser
[ { "docid": "bbc65fe3f2615f859e867da6c65e2cfa", "score": "0.0", "text": "def describe(str)\n self.define_singleton_method(:to_s) do\n str\n end\n\n self\n end", "title": "" } ]
[ { "docid": "62400a21f4d9f178e5e59cb674ee36a6", "score": "0.79001147", "text": "def add_description(description); end", "title": "" }, { "docid": "60ad1270c10d5c0c8d6dd2d7de7b9474", "score": "0.7606433", "text": "def description=(desc); end", "title": "" }, { "docid": "60a...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "2a3de31f2c5011ae779048fa1c676e3a", "score": "0.0", "text": "def review_params\n params.require(:review).permit(:puntctuation, :efficacy, :behaviour, :commentary, :user_id, :users_speciality_id)\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...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "bc1d8b93bc79e37bedc6ab885aa89a65", "score": "0.0", "text": "def electronic_prescription_params\n params.require(:electronic_prescription).permit(:transmission_number, :prescriber_spi_number, :prescriber_order_number, :prescriber_reference_number, :prescriber_reference_number_qualifier, ...
[ { "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...
a247412a5eec842ff03233461c5c3456
DELETE /distbutors/1 DELETE /distbutors/1.json
[ { "docid": "4a19d86083a41283e12f8db5234f024e", "score": "0.66952485", "text": "def destroy\n @distbutor.included_countries.destroy_all\n @distbutor.included_states.destroy_all\n @distbutor.included_cities.destroy_all\n @distbutor.excluded_states.destroy_all\n @distbutor.excluded_cities.de...
[ { "docid": "4c1c164b581dbae14285797e584e8fb7", "score": "0.6996186", "text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "title": "" }, { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.6981359", "text": "def delete...
35265b7b3acfe4ad5668c91642a5abdb
Universal Request Handler method
[ { "docid": "5e13abd5bed5a191f75294429a3b36a4", "score": "0.0", "text": "def qbd_request_method\n unless step.fetch('iterator', nil) || step.fetch('object_id', nil).blank?\n if step.fetch('object_class').starts_with?('Spree::StockTransfer')\n # StockTransfers use multiple object classes to...
[ { "docid": "0fa37b7f339135b77e004161b218e4d3", "score": "0.7658497", "text": "def handler\n raise \"unkown request type: #{self.class}\"\n end", "title": "" }, { "docid": "629b2179e67a520aa5f6036b586147b0", "score": "0.757024", "text": "def _on_request; end", "title": "" },...
5e42c2b43a7243f2e252ada63b26a04d
================================================================================================== CARRIERS MEGA ROUTE API ==================================================================================================
[ { "docid": "fe2772be1c747ae78fc0d17ca12c5a10", "score": "0.61057425", "text": "def create_mega_route(body)\n self.class.post(\"/aldebaran-carriers/carriers/#{@cnpj_id}/megaroutes\", :basic_auth => @auth, :body => body.to_json)\n end", "title": "" } ]
[ { "docid": "00353f9b8246ec9b89be54a28b112674", "score": "0.61740386", "text": "def get_car_route\n car = Car.find(params['car_id'])\n positions = Location.device_with_date(params['date'], car.device.id)\n\n render json: positions.to_json\n end", "title": "" }, { "docid": "699...
576b9b53bc4fbabb4efeb20575851ce7
Determine whether current/locator identify the frame containing this running code. This is useful in proxy injection mode, where this code runs in every browser frame and window, and sometimes the selenium server needs to identify the "current" frame. In this case, when the test calls select_frame, this routine is call...
[ { "docid": "a865f91976cbd685ba89a03f378912e6", "score": "0.7984853", "text": "def store_whether_this_frame_match_frame_expression current_frame_string, target, variable_name\r\n raise 'Not supported in Selenium Core at the moment'\r\n end", "title": "" } ]
[ { "docid": "030face51fc7a373cd12006961da3685", "score": "0.73925847", "text": "def has_frame?(frame_name)\n frame_text = self.redirect {$ie.show_frames}\n !frame_text.match(\"#{frame_name}\").nil?\n end", "title": "" }, { "docid": "030face51fc7a373cd12006961da3685", "score": "0.73...
38d77b1fcbabf0c6d388d36b3ed20d11
Returns a new TMail::Mail from +options+. Defaults are:
[ { "docid": "724b5633f01553d59fd327ab1e11c10f", "score": "0.6936805", "text": "def util_mail(options = {})\n options = {\n :from => 'from@example.com',\n :date => Time.at(0),\n :to => 'to@example.com',\n :subject => 'subject for this mail',\n :body => 'Hi! I\\'m a body!'\n ...
[ { "docid": "3bff485427abc0446bab54a21cd946a2", "score": "0.68924075", "text": "def build_email(options={})\n Email.new({\n :sender => self\n }.merge(options))\n end", "title": "" }, { "docid": "8495fc05a7eb827053dbf2a951a483f6", "score": "0.68483275", "text": "def initial...
19226ef45aca03aec4e79892799b23a5
=begin def []= (index, value)
[ { "docid": "f9c29294eb6f6762e80c9341ff5d695c", "score": "0.0", "text": "def []= (index, value)\n get_item(index).payload = value\n end", "title": "" } ]
[ { "docid": "7dd306c4b52f76fc67d9ae78d44cdab8", "score": "0.8427998", "text": "def []=(index, value)\n end", "title": "" }, { "docid": "cd4e448fe52ddfafc897b37293ab168b", "score": "0.83350974", "text": "def []=(index, value)\n value\n end", "title": "" }, { "docid": "...
3e5d9f506109d3e4d5c92773d5d1deff
Returns the hour representing a minute after this Example: (irb)> h = Hour.new("02:45") => 02:30 (irb)> h.succ => 02:31 (irb)> h = Hour.new("23:59") => 23:59 (irb)> h.succ => 00:00
[ { "docid": "d16ffb46bc216e3d4ea32f48ac6aea88", "score": "0.8531249", "text": "def succ\n m = (minute + 1) % 60\n h = (hour + ((minute + 1) / 60)) % 24\n Hour.new(\"%02d:%02d\" % [h, m])\n end", "title": "" } ]
[ { "docid": "66c02e2df17b35ec64c00391c912caf3", "score": "0.80431324", "text": "def succ\n return self.class.new((hour + 1) % 24, 0) if minute == 59\n\n self.class.new(hour, minute + 1)\n end", "title": "" }, { "docid": "5a34def09c951b25e284d4141e1a7195", "score": "0.785674",...
b2535b1a1fbeb0ec77588e4b9f0dad29
PATCH/PUT /members/1 PATCH/PUT /members/1.json
[ { "docid": "d9db2d386ffee30c6c953d4cb4976669", "score": "0.6492895", "text": "def update\n respond_to do |format|\n if @member.update(member_params)\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { render :show, status: :ok, lo...
[ { "docid": "93f938b06d670455d9e72faf16678443", "score": "0.6825534", "text": "def update\n # byebug \n respond_to do |format|\n if self.current_member && self.current_member.id == params[:id].to_i\n if @member.update(member_params)\n format.json { render :show, status: :ok, lo...
5f8136291cb490fffb17e33e9b440d86
Retrieves a specific deduction by using a unique deduction ID
[ { "docid": "555c8b557418d56e1b84a43597b16f2c", "score": "0.6586251", "text": "def get_deduction(xero_tenant_id, deduction_id, opts = {})\n data, _status_code, _headers = get_deduction_with_http_info(xero_tenant_id, deduction_id, opts)\n data\n end", "title": "" } ]
[ { "docid": "6014c8c8ac87754ebb47935c6b375ad3", "score": "0.62270284", "text": "def set_deduction\n @deduction = Deduction.find(params[:id])\n end", "title": "" }, { "docid": "5dc4fbbc8a8d39a9c512d25cd77f4518", "score": "0.61754733", "text": "def lookup_payment(id)\n @payme...
aa1ca15f6a06bef4c6bff7a1f70ac659
NOTE: disable paper trail log
[ { "docid": "4f24df9f108826b1c0d8e36fc921892b", "score": "0.0", "text": "def user_for_paper_trail\n end", "title": "" } ]
[ { "docid": "1ad62a23b13d4b25453a1f69c45d14ed", "score": "0.7304362", "text": "def paper_trail_enabled_for_controller\n false\n end", "title": "" }, { "docid": "1ad62a23b13d4b25453a1f69c45d14ed", "score": "0.7304362", "text": "def paper_trail_enabled_for_controller\n false\n e...
8f80d86118bdea4f7a232286efd242ac
Hack for the post preview in the show action
[ { "docid": "0b95f09f9f7acf80f76bca27123399da", "score": "0.6727927", "text": "def do_show\n super\n @post = @actual_record || @record\n end", "title": "" } ]
[ { "docid": "0c20e5faebee3afd740a75b243c2301f", "score": "0.7624435", "text": "def preview\n # mockup our models for preview.\n @post = Monologue::Post.new post_params\n @post.user_id = monologue_current_user.id\n @post.published_at = Time.zone.now\n # render it exactly as it would display...
a37560d3b3c8b287b2783c237b03a98e
def initialize(pos_x=0, pos_y=0, face="NORTH")
[ { "docid": "aeea49290b8f2e414450cb7de631808e", "score": "0.6971294", "text": "def placement x, y, face\n @pos_x = x\n @pos_y = y\n @face = face\n self\n end", "title": "" } ]
[ { "docid": "1f62521606a7d8208ddec9a4b8a199e7", "score": "0.7204062", "text": "def initialize face, row, left\n @face, @row, @left = face, row, left\n end", "title": "" }, { "docid": "563f968077454abc26f00399c7dabee9", "score": "0.6972105", "text": "def initialize\n @x\n @y\...
ef6b8e632daee4c6c1e4ff32bbd837e6
GET /facilities/1 GET /facilities/1.json
[ { "docid": "a09aaedf005fc1c849cc82dc1b2209f4", "score": "0.741848", "text": "def show\n @facility = Facility.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @facility }\n end\n end", "title": "" } ]
[ { "docid": "7ddcfdccbab4c3d1efb9f1fad7fcae8e", "score": "0.7231704", "text": "def index\n @facilities = Facility.all\n end", "title": "" }, { "docid": "7ddcfdccbab4c3d1efb9f1fad7fcae8e", "score": "0.7231704", "text": "def index\n @facilities = Facility.all\n end", "title"...
6166f9562581c2f6fcf342aa5498efd1
takes an array nested like [[a, b], [c, d]] and returns an array of every element at the "n" index of the second depth. The above exampe would return [a,c]
[ { "docid": "2d7593aed6c9f4eef74be1fd7dee62d1", "score": "0.5867381", "text": "def extract(n)\n arr = []\n self.each do |x|\n arr << x[n]\n end\n return arr\n end", "title": "" } ]
[ { "docid": "89d26289446ca4075283887ccac21dee", "score": "0.6982199", "text": "def my_controlled_flatten(n)\n return self if n < 1\n new_arr = []\n my_each {|el| new_arr += (el.is_a?(Array) ? el.my_controlled_flatten(n-1) : [el])}\n new_arr\n end", "title": "" }, { "docid": "2615...
564ff049d498935190aea6bc263e3676
GET /ventas/1 GET /ventas/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "e5ddad27be49c1ab6899ebcea7208979", "score": "0.73564565", "text": "def index\n get_ventas\n end", "title": "" }, { "docid": "f2b422705bc08ab65b01a3d67511a33c", "score": "0.7226572", "text": "def show\n @venta = Venta.find(params[:id])\n\n respond_to do |format|\...
27bcad9dbb16b12683fd98ad6d1fad18
Resource Key The resource key is the key that we use to build any of the post/put request body, and ideally it's the resoruce value, but occassionally it might be diffrent for any of the reason, so this method will keep that on portable.
[ { "docid": "87c5d3ece66792e8328dcc54fd2fdd4a", "score": "0.7721154", "text": "def resource_key\n resource\n end", "title": "" } ]
[ { "docid": "644e25290ca54cf98cd214efe991e3b8", "score": "0.72611517", "text": "def resource_key\n camelized_resource_name\n end", "title": "" }, { "docid": "d07ae41c6ce610ed17d0cde1217922eb", "score": "0.7225554", "text": "def key\n @key_resource ||= Key.new(@client)...
4e47b58cad1650d55519028cd6f85be2
Provides the best card from the take_it list take_it: array of cards that ha to be played
[ { "docid": "2c903c91fe2727f455688e9e77b8a798", "score": "0.75989705", "text": "def best_taken_card(take_it)\r\n @log.debug(\"calculate best_taken_card\") \r\n w_cards = []\r\n take_it.each do |card_lbl|\r\n card_s = card_lbl.to_s # something like '_Ab'\r\n segno = card_s[2,1] # charac...
[ { "docid": "bf0ba4c5869cbb521dd66df2dc1b7b12", "score": "0.74285364", "text": "def bestOf(cards)\n\tcn=sortOutColors(cards)\n\tbestT=bestTrump(cards)\n\tif bestT then\n\t\treturn bestT\n\tend\n\t\n\tcards.sort {|a,b|compare a,b}\n\tcards.reverse!\n\tputs \"SORTED:\"+cards.to_s\n\t\n\treturn cards[0]\nen...