query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
7672a45220f76e27c52a848441ee2274
Baseline implementation for the update_pool REST call
[ { "docid": "90312e9f84918e6e15e7d7f8ff7df48f", "score": "0.7038085", "text": "def update_pool request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_update_pool_...
[ { "docid": "426ab019edafc9025c235a9671ef8885", "score": "0.7359156", "text": "def update_ip_pool_with_http_info(pool_id, ip_pool, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PoolManagementApi.update_ip_pool ...\"\n end\n # verify th...
5f240ef4fb006e779a9cb6d65c5dc6d0
POST /usuarios POST /usuarios.json
[ { "docid": "3c5e68a0e1165459776e3a9c6b9d0607", "score": "0.6131929", "text": "def create\n @usuario = Usuario.new(usuario_params)\n\n respond_to do |format|\n if @usuario.save\n #Por enquanto, não temos um servidor de email configurado para o modo Production :(\n UserNotifier.se...
[ { "docid": "50cee0926d08d485bf1d16ee830a246b", "score": "0.72946143", "text": "def create\n\t\t@usuario = Usuario.new(usuario_params)\n\n\t\t @usuario.save\n\t\t\trender json: @usuario, status: :created\n\t\t\n\tend", "title": "" }, { "docid": "4f4f787b31951e7770f6ddd8936f2b1c", "score":...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "a5e2e2aa073cf1442ec3e08da667a77a", "score": "0.0", "text": "def update!(**args)\n @custom_strength_options = args[:custom_strength_options] if args.key?(:custom_strength_options)\n @schema_version = args[:schema_version] if args.key?(:schema_version)\n end", "tit...
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
6f55f4cc69bf220a9fc6f3a7f52c2373
Progress function. Expects :started with file, :progress with current line and :finished or :interrupted when done. message Current state (:started, :finished, :interupted or :progress). value File or current line.
[ { "docid": "df296ac78ed5f61cab06567185f9daad", "score": "0.6362743", "text": "def handle_progress(message, value = nil)\n case message\n when :started\n @progress_bar =\n Wallzilla::ProgressBar.new(\"Wallzilla\", Wallzilla::Runner::KEYWORDS_SIZE, STDERR)\n when :finished\n @progress_bar.fi...
[ { "docid": "0a20a25fe2282349ef5fc3ec1a069ff0", "score": "0.6979314", "text": "def handle_progress(message, value = nil)\n case message\n when :started\n @progress_bar = CommandLine::ProgressBar.new(File.basename(value), File.size(value), STDOUT)\n when :finished\n @progress_...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "719efde563ae5ac10e4227ebebead24b", "score": "0.0", "text": "def channel_params\n params.require(:channel).permit(:name, {user_ids:[]})\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74968386", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958337", "text": "def strong_params\n params.require(:request).permit(param_whit...
9df48c29a52b32c9d8c95f216e42d5fe
The axes method returns the origin and vectors representing the axes.
[ { "docid": "14f6145b3902b2b5b53c2c4ded5c1c2e", "score": "0.0", "text": "def to_a\n end", "title": "" } ]
[ { "docid": "20df3af5d08aa6e3b26ecba5fc799804", "score": "0.7575748", "text": "def axes\n end", "title": "" }, { "docid": "e913ba07e90fada8664ddcfd42f4398c", "score": "0.75313365", "text": "def axes; end", "title": "" }, { "docid": "e913ba07e90fada8664ddcfd42f4398c", ...
fc4a2d272b4546df1ce11ae086cf4ba9
Make email header list in each MTA(JSON) module
[ { "docid": "d26c3b1214f39ad92d33f783a250465a", "score": "0.53152716", "text": "def headers; return {}; end", "title": "" } ]
[ { "docid": "a29859a606114ac79608fcad776914da", "score": "0.62201303", "text": "def headerlist; return ['X-ZohoMail']; end", "title": "" }, { "docid": "151eb9dee0a191a701bfe28f2e571fdb", "score": "0.61846495", "text": "def headerlist; return ['X-MXL-NoteHash', 'X-MXL-Hash', 'X-MX-Bo...
27897bdfc7c95123ecc932a2234318c1
verifies coded terms on the crf
[ { "docid": "87831d85807d07401f160dd578f98acc", "score": "0.0", "text": "def data_verify(data)\n data_table = data_tables.detect { |item| item.text.downcase.include? data[0].value.downcase }\n data.each do |element|\n raise 'Data does not match: ' + \"#{data_table.text.downcase} does NOT...
[ { "docid": "55db684097cb6e018dcaf0edc3a21dc4", "score": "0.65279245", "text": "def terms_and_conditions; end", "title": "" }, { "docid": "4e23747963a3e01c05aab657f909ae46", "score": "0.6324287", "text": "def verify_terms(test_data)\n terms = test_data[Place::PLACE_TERM_GRP.name]\n...
e82c7b5294ea885aaf64b60fdae49077
GET /app_usages GET /app_usages.json
[ { "docid": "3eac48a83425192a8c216e6bef8fb8e5", "score": "0.7653987", "text": "def index\n @app_usages = AppUsage.all\n end", "title": "" } ]
[ { "docid": "b2db838dfb584c7d5ec0a0505ef06e19", "score": "0.7567453", "text": "def get_usage\n\t uri_path = '/insights/audience/usage'\n\t response = make_get_request(uri_path)\n\t JSON.parse(response)\n end", "title": "" }, { "docid": "203f635bbf1daae948b5efa6d1bf644b", "score": "0....
a916a77f0fc11f80f7c6f2bc31c56bd8
PATCH/PUT /coursesubjects/1 PATCH/PUT /coursesubjects/1.json
[ { "docid": "40ed279905d04ea4360a4deaf1694202", "score": "0.71426845", "text": "def update\n respond_to do |format|\n if @coursesubject.update(coursesubject_params)\n format.html { redirect_to @coursesubject, notice: 'Coursesubject was successfully updated.' }\n format.json { render...
[ { "docid": "3168564fa1ece676f66843613b5afc36", "score": "0.74145305", "text": "def update\n @course_subject = CourseSubject.find(params[:id])\n\n respond_to do |format|\n if @course_subject.update_attributes(params[:course_subject])\n format.html { redirect_to @course_subject, notice: ...
28fa6f7095ec14bd13bebeebbff2de0a
Parses a JSON into an OpenStruct data set Remember, nested groups are not parsed, so [Hash] access is still needed
[ { "docid": "9636fe6a9c05b9d5818e993a59674813", "score": "0.59826636", "text": "def json_to_ostruct(string, root=nil)\n json = ActiveSupport::JSON.decode(string)\n return json if json.nil?\n ostruct = root ? OpenStruct.new(json[root.to_s]) : OpenStruct.new(json)\n ostruct.keys = root ? json[r...
[ { "docid": "00c368ee6a28684f8f6cc42b360bd5b0", "score": "0.6477363", "text": "def parse(data)\n select_json_library unless @json_obj\n o = @json_obj.parse(data)\n if @create_objects && o.kind_of?(Hash) \n if o.has_key?(\"json_class\")\n class_name = o[\"json_clas...
7651a5c9792a4c4552d8afa7238a15f2
POST /supply_shipments POST /supply_shipments.json
[ { "docid": "27e25a01715b4feab0315f1cb7dba566", "score": "0.7059819", "text": "def create\n @supply_shipment = SupplyShipment.new(supply_shipment_params)\n\n respond_to do |format|\n if @supply_shipment.save\n format.html { redirect_to @supply_shipment, notice: 'Supply shipment was succ...
[ { "docid": "6f446b81b73e652cbb8d0a3668cb6db9", "score": "0.76169246", "text": "def create_shipments(data)\n endpoint_url = \"#{@api_url}/createShipments\"\n payload = data\n RequestMaker.new(@api_user, @api_pwd, @language).\n send_post_request(endpoint_url, payload)\n end", ...
4846481a566e52254726d411e38c6d5d
cancancan methods that get included in controllers
[ { "docid": "34537ca26efbe4495637452c10dd4f5f", "score": "0.0", "text": "def authorize!(*args)\n # you already implement current_user helper :)\n ::Ability.new(current_user).authorize!(*args)\n end", "title": "" } ]
[ { "docid": "30fecf8eb1c14d2f32e8736e0c82b19f", "score": "0.7515434", "text": "def can?(*args); controller.can?(*args); end", "title": "" }, { "docid": "5c8502dd9efc948a21c41e3b0f963082", "score": "0.70762336", "text": "def custom_permissions\n can [:index, :show], :people_controll...
5d8c51e484c4b12105ef3a8b97c96ceb
comprobar si existe un campo con el mismo code
[ { "docid": "e792a84c422fd1c81a6e619230a70c47", "score": "0.6700117", "text": "def code_exists\n if self.code_changed?\n if GeneticBank.exists?(self.code)\n errors.add(:code, \"already exists\")\n end\n end\n end", "title": "" } ]
[ { "docid": "22775225a5dee7f9c2f6a0c3779e9f50", "score": "0.6158792", "text": "def validate_code(oid,code,name=nil)\n valid = true \n map = @mapping[oid] \n \n # if there isnt a mapping for leave it alone , we know nothing about the code system and cannot pass judgm...
c092f90dfb08eaa54fb0c24f401e8d5d
Retrieves the requested file
[ { "docid": "8546b2f5b80aa63aabad89261bc9f7af", "score": "0.0", "text": "def get_file version, filename\n path = directory + version + filename\n raise FileNotFound unless File.exist? path\n body = File.read path\n return body.mime_type, body\n end", "title": "" } ]
[ { "docid": "9d9d280b6ec1ee9d3d935b378ce25551", "score": "0.779398", "text": "def get_file(path)\n server.api.server_get_file(server, path)\n end", "title": "" }, { "docid": "3c8f87225532e5dc1e98fc005504382a", "score": "0.7775331", "text": "def get_file(url)\n get(url)....
66f7e26fa789779d2466eeba5dc50383
GET /account_users GET /account_users.xml
[ { "docid": "9e41b957d7fb1f8f83c09a2523d3f3b9", "score": "0.7180229", "text": "def index\n @account_users = AccountUser.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @account_users }\n end\n end", "title": "" } ]
[ { "docid": "81f820aba49ac09ba424a3c44ecb4bf8", "score": "0.92077947", "text": "def account_users \n make_request(:get,\"#{account_url}/users.xml\")\n end", "title": "" }, { "docid": "167900a26d6bce493c19a68f91909227", "score": "0.7689282", "text": "def account_get(show_users=...
4ee4cb78f8a2e0c4b8da7e75b0f36605
Users who like this link. Permissions: read_stream Returns: array of objects containing the id and name fields.
[ { "docid": "4a92af5b349ddaa3223a5716015af9a1", "score": "0.5641491", "text": "def likes( params={} )\n likes = get_connections(\"likes\", params)\n return map_connections likes, :to => Facebook::Graph::Generic\n end", "title": "" } ]
[ { "docid": "aa316e9411ed3db691679efa8c4d080f", "score": "0.68799573", "text": "def liked\n likers = likedislikes.where(action: 1).map {|like| User.find(like.user_id)}\n end", "title": "" }, { "docid": "ed5a439cc9122b059291aa957201dec6", "score": "0.6846763", "text": "def users_wh...
a65aa062a1fa3d16902185ed4aed8921
Group the specified witnesses into a new comparison set.
[ { "docid": "f0e5110c6550fb3a6a45454fd347a1db", "score": "0.0", "text": "def make_set( witness_ids )\n log_message( \"Creating witness set ...\" ) unless @logging == false\n set = { 'name' => make_guid(), 'witnesses' => witness_ids }\n set_id = @connection.post( \"set\", set )\n return set_id...
[ { "docid": "36e4e2aceec0e851e96b548e54d13561", "score": "0.6123789", "text": "def initialize_comparisons!(comparisons)\n comparisons.each do |groups|\n if groups.size == 1\n one_vs_rest_comparisons << groups.first.strip\n else\n group, comparison_group = groups.map(&:strip)\n ...
10756db97e585e157f43173c355f260f
Compares the similarity of two users in terms of movies rated
[ { "docid": "f20e0d95d8cf24833dc229b92e2d65c0", "score": "0.78879666", "text": "def similarity(other_user)\n similarity_count = 0\n @rating_list.each_value do |rating|\n if other_rating = other_user.rating_list[rating.movie_id] and other_rating.rating.to_i >= rating.rating.to_i - 1 and other_r...
[ { "docid": "8ddbe2c802ea709fe4b5e0703a184033", "score": "0.87405604", "text": "def similarity(user1,user2)\n #retrieves the recorded related to user1 and user2\n #then create an array which contains the movie ids which both user have rated them\n u1=@users[user1]\n u2=@users[user2]\n u1_m...
90a7f52c683c66660b106e36a8d28885
GET /loans GET /loans.xml
[ { "docid": "b2ffc8e6d164e079861f793030b81765", "score": "0.74776876", "text": "def index\n @loans = Loan.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @loans }\n end\n end", "title": "" } ]
[ { "docid": "ee3ce4efac07c038f6e00fe26c3c8b53", "score": "0.6593682", "text": "def loans\n url = \"#{LOANS_PATH}/pre-approved\"\n data = perform_get(url)\n data || {}\n end", "title": "" }, { "docid": "28ea412c9ec6e6897b9ad4c7345302d6", "score": "0.653404...
836d08eb4f74542608bcb106cf1ec264
Recovery function handling errors
[ { "docid": "e0324db9170b7672fd69945750da9585", "score": "0.6340841", "text": "def recover( error = $! )\n \t\tputs \"Parser Recovering: #{error}\"\n \t\texit(1)\n \tend", "title": "" } ]
[ { "docid": "7567722cb6c5ce9eca9cdcff199626e1", "score": "0.7324538", "text": "def recovery()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "30310e31e950abf03e2cbd2fe4294642", "score": "0.7179577", "text": "def recover()\n ...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "0a92b5105f65ca74f86eb4b814c87efa", "score": "0.0", "text": "def podcast_params\n params.require(:podcast).permit(:title, :mp3, :date)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7123669", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.7054077", "text": "def expected_permitted_parameter_names; end", "title": ""...
f0ff1ca05af34a3e605ac3779c68b61e
Allow a video to be reviewed (just videos!)
[ { "docid": "ebabf97858592223d6e16e14aba2eb81", "score": "0.0", "text": "def review\n\n @product = Product.find(params[:id])\n\n # If this product is part of a set and not the first element, redirect to the first elememt\n return redirect_to(:id => @product.product_set.first.id) if (@product.pro...
[ { "docid": "5c08d7d5d99ef71ce40cabbd06a61980", "score": "0.67116857", "text": "def show\n authorize Video\n end", "title": "" }, { "docid": "4c1e3b434ae2d69ab9f73628b39390f0", "score": "0.66435707", "text": "def vvideo\r\n errors.add_to_base(\"Not that many Video Editing Stati...
44226676a11b61613fa6ade29a23f901
require 'point.rb' To solve this one, we make a template of 10 of the digit we are checking and then, for the number of 'replacements', permutate that number from all possible replacement locations. Then for each 'set' of replacement locations, try all possible values. We could prune this better, but we simply discard ...
[ { "docid": "82982d247594cf29af51eb821b305477", "score": "0.77811944", "text": "def problem_111(num_digits = 10)\n digits = (0..9).to_a\n last = [1,3,7,9]\n total = 0\n hits = {}\n (0..9).each do |digit|\n d_found,d_sum = 0,0\n array = [digit] * num_digits\n (1).upto(num_digits-1) do |num_r...
[ { "docid": "dc69264379a93e46073f62ef1edb7d6e", "score": "0.6645487", "text": "def find_zero_to_nine_pandigitals\n solutions = []\n (0..9).to_a.permutation.each do |permutation|\n if permutation[1..3].join.to_i % 2 == 0 and\n permutation[2..4].join.to_i % 3 == 0 and\n permutation[3..5].j...
f5b5fb7ff7ccc9087520d747a00d2df6
Issues an update on the database, for this record, with the provided deltas. WARNING: the record will become stale, and should no longer be saved after an update has been issued.
[ { "docid": "d9ea2b443fa4dbf97eabfa51ee52f0ae", "score": "0.66239464", "text": "def update!(deltas = {})\n return if @deltas.empty? && deltas.empty?\n\n id = @hash['_id']\n raise unless id # TODO: custom exception\n\n if @deltas\n deltas = @deltas.merge(deltas)\n @deltas...
[ { "docid": "d000176215c89fb9396c9cb224dcd45e", "score": "0.6463767", "text": "def update(delta)\n objects.each do |o|\n o.update(delta, self) if o.respond_to? :update\n end\n end", "title": "" }, { "docid": "0a2f14a305346061b67a7c92bb61dd9c", "score": "0.62213016", ...
794147d829e47aeae252d77cfdfd9fd2
PATCH/PUT /ventas/agrupador_clientes/1 PATCH/PUT /ventas/agrupador_clientes/1.json
[ { "docid": "9edb2bad7a160bd0984b25b7c73b41be", "score": "0.70268506", "text": "def update\n respond_to do |format|\n if @ventas_agrupador_cliente.update(ventas_agrupador_cliente_params)\n format.html { redirect_to @ventas_agrupador_cliente, notice: 'Agrupador cliente was successfully upda...
[ { "docid": "b150b98d6b05512910c7313206efb6f0", "score": "0.6820152", "text": "def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, :notice => 'El cliente se ha actualizado correct...
b20ff959ab57bc745969ca40b2b4ff85
GET /jobs/1 GET /jobs/1.json Anyone can see a job, hence it skips the validation in :set_job
[ { "docid": "ded16a6e1208a3dbfbd1c89e3c70ca51", "score": "0.0", "text": "def show\n @job = Job.find(params[:id])\n if @candidate\n if @job.matches.any? { |m| m.candidate_id == @candidate.id && (m.candidate_like == false || m.job_like == false) }\n redirect_to '/dashboard/'\n retu...
[ { "docid": "793ac233f7e545123ddabb85291075fc", "score": "0.70125407", "text": "def set_job\n @job = Job.find_by(id: params[:id])\n raise ActiveRecord::RecordNotFound if @job.nil?\n end", "title": "" }, { "docid": "ad1d0b3c5f93ff253046752574dfa8f1", "score": "0.7005979", "t...
7af56d5952a2aa320fb51d8381161082
POST /documents POST /documents.json
[ { "docid": "effd39f0a2c255248d85c6bd272b9bf1", "score": "0.0", "text": "def create\n @document = Document.new(document_params)\n @document.document_type_id = get_document_type(params[\"document\"][\"auto_process_type\"])\n respond_to do |format|\n if @document.save\n # download file...
[ { "docid": "706f5c0f4f01c5b58d1a75fe4ca43b41", "score": "0.7267415", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, :notice => 'Document was successfully created.' }\n format...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "707ee3b2bfd87d26e6efeba6fe230d1a", "score": "0.0", "text": "def set_price_alert\n @price_alert = PriceAlert.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339844", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6014297", "text": "de...
7d3a5825a984c8d43b4f84a41f209c3a
true for qualified and false for unqualified
[ { "docid": "df3038a7f7c9d245b71efca50c7a2ffc", "score": "0.0", "text": "def initialize\n self.qual = false\n end", "title": "" } ]
[ { "docid": "58de8092d5cd3d1ff4a4eb67e4b43ac2", "score": "0.84141564", "text": "def qualified?\n meta[:qualified].equal?(true) || meta[:qualified].is_a?(Symbol)\n end", "title": "" }, { "docid": "3579279ba39204f506432d003f66abfa", "score": "0.6906597", "text": "def qualifi...
af8fedebe6114c99d5f09ab8f141c24f
get input from the user in the form of search terms
[ { "docid": "e65eb7d2e55b3aaa7086ca89a1802859", "score": "0.7317055", "text": "def get_input\n puts \"Please enter a search term(s)\"\n input = gets.chomp\n puts \"You've entered #{input}\"\n input\nend", "title": "" } ]
[ { "docid": "f7151a2aa2eea5b205d364d54fa80830", "score": "0.7768796", "text": "def search\n\tuser_search = gets.strip.downcase\n\tsearch_input(user_search)\nend", "title": "" }, { "docid": "a6eb5cca3cba18cba9479e4971fec294", "score": "0.77086484", "text": "def get_search_term\n puts ...
6349f5b4f03c073f98585e1bd9150910
provide numerology explanation based on calculated singledigit from user entered birthday
[ { "docid": "f7f459a148f1a7be71b0a4b59996207c", "score": "0.0", "text": "def give_message(num)\n\ncase num \nwhen 1 \n message = \"\\nYour numerology number is #{num}.\\nOne is the leader. The number one indicates the ability to stand alone, and is a strong vibration. Ruled by the Sun.\"\nwhen 2\n ...
[ { "docid": "761c24bd82d0f537b2ad1e8b84f899ab", "score": "0.70098335", "text": "def happy_birth_day\n\tdays = []\n\tmonths = []\n\tyears = []\n\t31.times do |d|\n\t\tdays << d\n\t\tdays.delete(0)\n\tend\n\t12.times do |m|\n\t\tmonths << m\n\t\tmonths.delete(0)\n\tend\n\t2019.times do |y|\n\t\tyears << y\...
c8de4ff2600b97e15b2d0aede5b310b1
The name of the runner
[ { "docid": "7d35013fbabc2ecb367e9effde210962", "score": "0.0", "text": "def name\n self.class.name.titleize\n end", "title": "" } ]
[ { "docid": "09b9c88b5bbe87def13d72bdfcad81a0", "score": "0.8241573", "text": "def name\n data.fetch('runnerName')\n end", "title": "" }, { "docid": "5909b393bb384b93c5d0759479620517", "score": "0.71617293", "text": "def run(name); end", "title": "" }, { "docid": "...
e45a0943bf58e06536f1e04b6ece17d0
If the first part of this regex is plain string content, we have a space or an =, and we're contained within a command or command_call node, then we want to use braces because otherwise we could end up with an ambiguous operator, e.g. foo / bar/ or foo /=bar/
[ { "docid": "da458d5c0fa8e2c86b1b23e77467efe0", "score": "0.0", "text": "def ambiguous?(q); end", "title": "" } ]
[ { "docid": "00676cf1e839549b632661b1f5aece2a", "score": "0.6302717", "text": "def parse_expr\n if @s.scan(/(?=\\w+\\ *=)/)\n parse_assign\n else\n parse_paren or parse_lit or parse_capture or parse_var_ref or parse_global_var_ref or parse_create_node or parse_create_list or parse_call\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "10a46d81ec62e9c97572fe10be5a6233", "score": "0.0", "text": "def set_post\n @post = Post.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163821", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045432", "text": "def action_hook;...
cf7f004584b8c767100c52b1c2c96127
convert_keys recursivly converts the type of the keys in the hash. The keys are converted to either symbols or strings depending on the value of the 'to' parameter.
[ { "docid": "4f289ed2383afea3bdff715ef3b6b189", "score": "0.78450435", "text": "def convert_keys(hash, to)\n hash.each_with_object({}) do |(key, value), result|\n new_key = case key\n when String then to == 'symbols' ? key.to_sym : key\n when Symbol t...
[ { "docid": "acd41de41053b8adede664f9fc6eaf4a", "score": "0.6799375", "text": "def convert_keys(info, conversion_method)\n return nil unless info\n support = {}\n info.each do |k, v|\n con = convert_keys(v, conversion_method) if v && v.class == Hash\n support[k.public_send(co...
a5b3df29e232116a5573e9f14df6e140
Updates the description of the table.
[ { "docid": "80f240d0d173d3805f6943db18adad16", "score": "0.6454079", "text": "def description= new_description\n @gapi.update! description: new_description\n patch_gapi! :description\n end", "title": "" } ]
[ { "docid": "68122e7a01ca32a5ebedf41cbf3f3c4b", "score": "0.7646406", "text": "def update_description(description, row)\n description\n end", "title": "" }, { "docid": "0fbfaf11ee925eff831db893dd9dcd04", "score": "0.7630802", "text": "def update_desc\n end", "title": "" }...
ff94866e16889a474d3e5eafdb997f70
Creates a new model entry.
[ { "docid": "550b37960d0e3079cdc90cfed5011f97", "score": "0.0", "text": "def build_entry\n model_scope.new\n end", "title": "" } ]
[ { "docid": "cafd883555ece28bdc9b138f366c33ff", "score": "0.7665209", "text": "def make_new_entry\n Entry.new\n end", "title": "" }, { "docid": "e4123f0457e0460f3cecdde3b0bc1dff", "score": "0.7619276", "text": "def create(attributes)\n entry = new(attributes)\n ...
0026f287e5a5d1d5d95decb341a91eec
Set prompt and read input from command line
[ { "docid": "d2842767e1c8a5847c0c4df870d09b31", "score": "0.70740896", "text": "def GetInput(prompt, type)\n # set the required prompt\n SCR.Write(path(\".dev.tty.prompt\"), prompt)\n\n res = nil\n\n if type == :nohistory\n res = Convert.to_string(SCR.Read(path(\".dev.tty.nohis...
[ { "docid": "92ded4a079face10658d5a224b9145bd", "score": "0.79144406", "text": "def prompt\n cli.prompt(@prompt)\n end", "title": "" }, { "docid": "a537bb20d39c0cb589cac56ec97331b5", "score": "0.77243555", "text": "def read_command(prompt); end", "title": "" }, { "...
90e3b2eedfdfc8b96381517e99a9028f
Start a server given a zookeeper quorum and array of visible instances. This will modify the configuration.yml and launch the server. param: zk_quorum is the list of zookeeper servers. Default is .env param: visible_instances is an array of instance names that are to be visible by clients of the REST server. param: wai...
[ { "docid": "efeda577d5c34f2ecf497f81d0ac1280", "score": "0.71704036", "text": "def start(zk_quorum = \".env\", visible_instances = [\"default\"], wait_for_load = false)\n if running?\n raise \"KijiREST appears to be running.\"\n else\n #Update the configuration file to reflect th...
[ { "docid": "39541db7083a052ef10f756001c69294", "score": "0.5478527", "text": "def start_server(rackup_path, rackup_config, *params)\n exec('ruby', rackup_path, rackup_config, *params)\n end", "title": "" }, { "docid": "ff4bda99200492e96bc042b12942abbe", "score": "0.5180644", ...
504db17d2d74dd42b1f95228a04c98ab
I worked on this challenge with Jackie Feminella I spent 1 hours on this challenge. Complete each step below according to the challenge directions and include it in this file. Also make sure everything that isn't code is commented. 1. Initial Solution =begin def mode(array) mode_hash = Hash.new(0) array.each do |n| mod...
[ { "docid": "442b820dfbf425bcd746cd831c98c74c", "score": "0.8720194", "text": "def mode(array)\n mode_hash = Hash.new(0)\n array.each {|n| mode_hash[n] += 1}\n max = mode_hash.values.max\n output_array = mode_hash.map {|k, v| if v == max then k end} \n p output_array.compact\nend", "title": "" ...
[ { "docid": "e41fa0a9d2b680424ef2b9d45fee7a90", "score": "0.8861099", "text": "def mode(array)\n\n mode_hash = Hash.new\n for x in 0..(array.length - 1)\n if mode_hash.has_key?(array[x]) == true\n mode_hash[array[x]] = mode_hash[array[x]] + 1\n else\n mode_hash[array[x]] = 1\n end\n ...
36071848c0123aa5fe6129b721f8a847
PUT /garins/1 PUT /garins/1.xml
[ { "docid": "6cf914216aaa9860879a2a75f217cd8d", "score": "0.6108705", "text": "def update\n @garin = Garin.find(params[:id])\n\n respond_to do |format|\n if @garin.update_attributes(params[:garin])\n format.html { redirect_to(@garin, :notice => 'Garin was successfully updated.') }\n ...
[ { "docid": "23b5f5e4dacfb330cb1e0ffd4590ef63", "score": "0.6289442", "text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end", "title": "" }, { "docid": "38979984bdedacd95706689e25f09f9e...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "001c58fcc1a0156a5de4101777dc00c7", "score": "0.0", "text": "def set_new\n @palette = Palette.find(params[:palette_id])\n @palette_color = PaletteColor.new\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...
54729808b15ace81a1ef170c7b663a3d
List of class variables referenced in this function.
[ { "docid": "b30d12e2ffddaff4107856fd151e4d6d", "score": "0.8049633", "text": "def class_vars\n self[@cfunction][:class_vars]\n end", "title": "" } ]
[ { "docid": "73614bc39bc95b3921866902f73b2d9f", "score": "0.8295225", "text": "def class_variables\n @class_variables.keys\n end", "title": "" }, { "docid": "ac0e09505bbc7fdb9e4274e031546c59", "score": "0.7863349", "text": "def class_variables\n field_mirrors(reflectee_se...
aab77988826fd11c8175017373e1f32b
GET /embedded_documents GET /embedded_documents.xml
[ { "docid": "195d6c7a82895146d17f3cc6a38de27e", "score": "0.7923361", "text": "def index\n @embedded_documents = EmbeddedDocument.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @embedded_documents }\n end\n end", "title": "" }...
[ { "docid": "df1a4689ef59e8c193f61deac26a89d4", "score": "0.68008727", "text": "def get_document\n @bookalope.http_get(@url + '/files/document')\n end", "title": "" }, { "docid": "e4d3fdff4a5be5ba5ff5c0a7f85ec394", "score": "0.67739797", "text": "def show\n @document = ListDocu...
1f7cec42b74f2739880a25ae297df062
Create an archive name for this profile and an additional options configuration. Either use :output or generate the name from metadata.
[ { "docid": "c3080712f73c2d129fbfc74d9e5a0249", "score": "0.79381686", "text": "def archive_name(opts)\n if (name = opts[:output])\n return Pathname.new(name)\n end\n\n name = params[:name] ||\n raise(\"Cannot create an archive without a profile name! Please \"\\\n ...
[ { "docid": "5a33f6ec5328c019a37bd9810c43ac4b", "score": "0.631652", "text": "def archive(opts) # rubocop:disable Metrics/AbcSize\n profile_name = @params[:name]\n\n ext = opts[:zip] ? 'zip' : 'tar.gz'\n\n if opts[:archive]\n archive = Pathname.new(opts[:archive])\n else\n ...
13cdbf5dc071f7827c4d7e1f8a71f5b3
Your private API can be specified in the +options+ hash or preferably using the Configuration.
[ { "docid": "7adfbd457f96049ee17cacd3b69a4424", "score": "0.0", "text": "def verify_hcaptcha(options = {})\n options = { model: options } unless options.is_a? Hash\n return true if Hcaptcha.skip_env?(options[:env])\n\n model = options[:model]\n attribute = options.fetch(:attri...
[ { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.72911674", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.72911674", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2",...
0b8ae324c97fe586c0cade1af3ace65d
As for make_filter but takes multiple possible values and does a column IN (1,2,3,4) type thing.
[ { "docid": "58c330d4178921c2ab26c1998ad5c6c2", "score": "0.62798697", "text": "def make_multi_filter(values, columns_mapped_to)\n raise Persistence::UnsupportedOperation\n end", "title": "" } ]
[ { "docid": "15174c0e0d87d50339159977b389877c", "score": "0.75073177", "text": "def in *values\n @items.with_filter(attribute, \"IN\", *values)\n end", "title": "" }, { "docid": "82e6929abc752020b5576eb5f013341e", "score": "0.7446281", "text": "def where_in(values)\n ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "e169dbe27930958d4ddcda444493b325", "score": "0.0", "text": "def shift_actual_params\n params.require(:shift_actual).permit(:date, :name)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6981269", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6783559", "text": "def strong_params\n params.requi...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "f315e37faf309700e279c3f41b6c6e92", "score": "0.0", "text": "def odrder_product_params\n params.require(:odrder_product).permit(:order_id, :product_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74954116", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6956924", "text": "def strong_params\n params.require(:request).permit(param_whit...
a61196d0ba3f925252cf471622d72153
Verifies that the user attempting the action is the user that is signed in, or a manager.
[ { "docid": "ddb3295ed4e6f303f09990c56327a37a", "score": "0.6759958", "text": "def correct_user\n @member = Member.find(params[:id])\n redirect_to(root_url) unless current_user?(@member) || current_user.type == 'Manager'\n end", "title": "" } ]
[ { "docid": "9ca09357410e73ec8677e0c53ecad28d", "score": "0.73042667", "text": "def check_if_manager\n if (!@user) || (@user && @user.user_type != \"Manager\") #if user is not logged in, or a logged in user is not a manager\n redirect_to properties_path, notice: \"Only Managers are authorized to ...
2b4281d5a1d781cc9b3cfd28362e4b4f
Is there a contract used by given account?
[ { "docid": "3bff78e22599c7e810f667b53e354bd7", "score": "0.7602084", "text": "def bought_by?(account)\n account && contracts.bought_by(account).present?\n end", "title": "" } ]
[ { "docid": "221241e51fd749c99e330a9402a541e6", "score": "0.71281546", "text": "def has_contract?(user_id)\n result = false\n self.contracts.each do |contract|\n if contract.client_id == user_id\n result = true\n end\n end\n result\n end", "title": "" }, { "docid...
8fda0d45e0495f30816a87b3eaa28b99
Opens a rootlevel ParamsScope, defining parameter coercions and validations for the endpoint.
[ { "docid": "825ac818679f982339f703f3f0adfe7f", "score": "0.6276802", "text": "def params(&block)\n Grape::Validations::ParamsScope.new(api: self, type: Hash, &block)\n end", "title": "" } ]
[ { "docid": "ffef078c1850ae588e1aef809f1c400c", "score": "0.5820948", "text": "def create_params_initializer\n\n\t\tend", "title": "" }, { "docid": "813e413169217ce307b0242a698d8ab3", "score": "0.569918", "text": "def build(params, scope)\n scope.new(params)\n end", "title...
510a9b1db481f83755736b136c4b79df
Is this Card an Ace? Returns true or false
[ { "docid": "653f7eb2b01aec64a7c01c39df8cb754", "score": "0.72372496", "text": "def ace?\n value == 'A'\n end", "title": "" } ]
[ { "docid": "2ad7738b88ef0622c7fa0bf2d095ad8e", "score": "0.8491775", "text": "def is_ace?(card)\n\t\tcard == \"A\" ? true : false\n\tend", "title": "" }, { "docid": "8e1cb331000708dbc557206a41ba7c35", "score": "0.8070716", "text": "def has_ace\n for card in @cards\n return 1 ...
9e7cfae34cbd9587071ac244e6b3fbeb
Remembers a user in the database for use in persistent sessions.
[ { "docid": "bca35c7993389739562d684900f1cf1b", "score": "0.0", "text": "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "title": "" } ]
[ { "docid": "2851e427c467049c7639c468daea3c35", "score": "0.6719868", "text": "def reload_user\n @user = User.find(session[:user][:id])\n end", "title": "" }, { "docid": "96a75f37098f9b5db8b7c451f485268e", "score": "0.6601541", "text": "def check_new_or_reseted_user\n begin\n ...
4d19e1db7561e82378e93c9f402bb7be
Read a 'fabric.Vlan' resource.
[ { "docid": "7eef9f51b77643994a50db8e46dc583d", "score": "0.49147457", "text": "def get_fabric_vlan_by_moid(moid, opts = {})\n data, _status_code, _headers = get_fabric_vlan_by_moid_with_http_info(moid, opts)\n data\n end", "title": "" } ]
[ { "docid": "8da17855186521f78d1d5148ac6d67da", "score": "0.6736244", "text": "def vlan\n @vlan\n end", "title": "" }, { "docid": "8da17855186521f78d1d5148ac6d67da", "score": "0.6736244", "text": "def vlan\n @vlan\n end", "title": "" }, { "docid": "0b7802d9...
d2d6b57e80bca669df56cd7e649a18f9
Retrieves a RedCollection instance based on the URI provided in the uri parameter. The format of the URI is defined in the documentation for DatabaseManagerget_collection ==== Parameters +uri+ String with the URI to use to locate the collection. +username+ String with the password to use for authentication to the datab...
[ { "docid": "e15a5a5fa7d6e48ef3c50163fdc38662", "score": "0.801146", "text": "def get_collection(uri, username = false, password = false)\n #Now we have uri in format path/to/collection we have to parse collections one by one because\n #of mapping to id\n collections = uri.split(\"/\")\n ...
[ { "docid": "bee88eb4fe66fb8889f392430c2d159a", "score": "0.74222666", "text": "def getCollection(uri, username, password)\n collection = @obj.getCollection(uri, username, password)\n return XMLDB::Base::Collection.getInstance(collection)\n end", "title": "" }, { "docid": "...
34caeb087d76e133ee49e0d9e473c057
DELETE /client_earnings/1 DELETE /client_earnings/1.json
[ { "docid": "38e44e11d58441731735b57739602423", "score": "0.7846396", "text": "def destroy\n @client_earning = ClientEarning.find(params[:id])\n @client_earning.destroy\n\n respond_to do |format|\n format.html { redirect_to client_earnings_url }\n format.json { head :ok }\n end\n e...
[ { "docid": "656c2be08d3edccb1017fde0565003ba", "score": "0.68456924", "text": "def destroy\n @client_fee.destroy\n respond_to do |format|\n format.html { redirect_to client_fees_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b1a17c1ee1af...
daaf6b614d355c5245403445c996f015
Returns the value of attribute exitstatus. source://netssh//lib/net/ssh/connection/session.rb356
[ { "docid": "072bf5c68c868173e32e4886634e0f9d", "score": "0.66849923", "text": "def exitstatus; end", "title": "" } ]
[ { "docid": "ce085d3c0dcd498a71a291b6c2dafc63", "score": "0.7629743", "text": "def exit_status\n @status\n end", "title": "" }, { "docid": "9d6c73ff25875c4344e73ab4db283524", "score": "0.71428204", "text": "def exitstatus\n subexec.try(:exitstatus)\n end", "tit...
3d4417faf7495ec92c3434f39a2e58ab
Retrieves a SAS Logical JBOD by name
[ { "docid": "351c65063798ea181b06127c089bbc46", "score": "0.7855048", "text": "def get_sas_logical_jbod(client, name)\n results = get_sas_logical_jbods(client)\n results.find { |item| item['name'] == name }\n end", "title": "" } ]
[ { "docid": "f15a81b7a9103ffca64b448034c62b6f", "score": "0.67366177", "text": "def get_sas_logical_jbod_attachment(client, name)\n results = get_sas_logical_jbod_attachments(client)\n results.find { |attachment| attachment['name'] == name }\n end", "title": "" }, { "...
b3c5641efaaf639d3b13807d874d3fbd
Set the value of the Place input for this Choreo.
[ { "docid": "0df82bef2d29edfe9278029f042906c9", "score": "0.78248274", "text": "def set_Place(value)\n set_input(\"Place\", value)\n end", "title": "" } ]
[ { "docid": "de1f2b2596e32334febf9882866d3ffa", "score": "0.7769127", "text": "def set_Place(value)\n set_input(\"Place\", value)\n end", "title": "" }, { "docid": "de1f2b2596e32334febf9882866d3ffa", "score": "0.7769127", "text": "def set_Place(value)\n ...
07792d7b20c6d0eec14f8936332f460f
=> ["apples", "corn", "cabbage", "wheat"]
[ { "docid": "4227344057bb8c3e4f7a30c6439479be", "score": "0.0", "text": "def gather(items)\n puts \"Let's start gathering food.\" # => nil\n yield(items) # => nil\n puts \"We've finished gathering!\" # => nil\nend", "title": "" } ]
[ { "docid": "622646e794f6a7db25aa5d8e102c5450", "score": "0.65819407", "text": "def stooges\n %w(Moe Larry Curly)\nend", "title": "" }, { "docid": "7f6128c3dca2c63c72abe7a0399227fb", "score": "0.650355", "text": "def apple_picker(array)\n apples_only = []\n array.each do |fruit|\n ...
df79e125be2dc94516dfbee3d52f7a4a
GET /dept_supervisors/1 GET /dept_supervisors/1.json
[ { "docid": "5d9204d9754c9e600863d267f72e4404", "score": "0.74810576", "text": "def show\n @dept_supervisor = DeptSupervisor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dept_supervisor }\n end\n end", "title": "" } ]
[ { "docid": "4aa10ab20ce4d3dd4e6ac07d3f5698d0", "score": "0.6699495", "text": "def show\n render json: @dept\n end", "title": "" }, { "docid": "7e4d713bbe5f157245a897370ab3ce9d", "score": "0.66390955", "text": "def new\n @dept_supervisor = DeptSupervisor.new\n\n respond_to d...
cdc58519fdd123d4f012081132d4f86f
Public: Set up an external Synchronization ID for each specified Salesforce model. Returns nothing.
[ { "docid": "d284e8dd0c2463f720f1fdbc9a365b0a", "score": "0.7254722", "text": "def setup\n @models.each do |model|\n print \"ADDING SynchronizationId__c to #{model}... \"\n job = client.create(\n :custom_field,\n full_name: \"#{model}.SynchronizationId__c\",\n ...
[ { "docid": "0cafd5f0a92eb9250fa268c1f82605a0", "score": "0.5942787", "text": "def set_client_sync\n @client_sync = ClientSync.where(id: params[:id]).first\n client_sync_hash()\n end", "title": "" }, { "docid": "39ddb213f0445c5d5291e247dc6320f2", "score": "0.5851542", "te...
7c0c1054f522fb34f27ef3169959ba91
adds a listener to obj and proxies event like it would be emitted from self if no listener is registererd to event it also removes the listener from obj
[ { "docid": "5530116c5a94f6a8a78e403179a13256", "score": "0.70464015", "text": "def proxy_event(obj,*events)\n return if obj == self\n events = events.flatten\n events.each do |e|\n if existing = @proxy_listeners[obj].delete(e)\n existing...
[ { "docid": "6a90feaab3beeab55f7258398f52d7d4", "score": "0.682381", "text": "def add_listener(listener)\n @listeners << WeakRef.new(listener)\n end", "title": "" }, { "docid": "2745762d27201cfe324b94f9debb4eb7", "score": "0.6576831", "text": "def add_observer object, func = :...
a0e60e4a92f667f139cca5d993c23109
Offer tokens are fee adjustments that simply hold the coupon code
[ { "docid": "9ae2930eb574f2c907c62a284f4bbce3", "score": "0.74963695", "text": "def offer_tokens\n order.fee_adjustments.offer_token\n end", "title": "" } ]
[ { "docid": "1f25006414381f750ae33d56deb96ed4", "score": "0.60979015", "text": "def applies_with_offer_token?\n offer_tokens.by_discount_code(discount_code).count > 0 unless try(:discount_code).blank?\n end", "title": "" }, { "docid": "c90e3643bc24b47313e669be290791ae", "score": "...
60e56b531021345877ac95777a49922c
Creates a new network
[ { "docid": "f48deaa348dd871fe700faa7454f5814", "score": "0.0", "text": "def initialize(azure_config, name, spec)\n unless spec.is_a?(Hash)\n raise ArgumentError, 'Invalid spec, Hash expected, ' \\\n \"#{spec.class} provided\"\n end\n\n @logger = Bosh::Cl...
[ { "docid": "e71f57f01ac693f1e2476e880bc71a79", "score": "0.8464371", "text": "def create_network(params)\n request(:post, 'api/1/networks', params).network\n end", "title": "" }, { "docid": "c0b0a026dcb4df033a5e8e5e62c3ba4b", "score": "0.77582985", "text": "def create_network...
bfb917c22fe1b58bed5b70983415d556
Get a ZIP of related dispatches. Returns a zip file containing all of the dispatch packages for a destination.
[ { "docid": "054b5718dc90f76d410be19de3db9106", "score": "0.5892431", "text": "def get_destination_dispatch_zip(destination_id, opts = {})\n data, _status_code, _headers = get_destination_dispatch_zip_with_http_info(destination_id, opts)\n data\n end", "title": "" } ]
[ { "docid": "74b677785ac23015fe4654efe13e0e12", "score": "0.5622957", "text": "def get_destination_dispatch_zip_with_http_info(destination_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DispatchApi.get_destination_dispatch_zip ...'\n end\...
46e869b768f9cfd4aab635898c0907ba
How to create a certificate request with our system defaults.
[ { "docid": "79ae5b5981f7232baf45e06464ba77f5", "score": "0.7127923", "text": "def generate(key, options = {})\n Puppet.info \"Creating a new SSL certificate request for #{name}\"\n\n # Support either an actual SSL key, or a Puppet key.\n key = key.content if key.is_a?(Puppet::SSL::Key)\n\n #...
[ { "docid": "3a72262fadb3be9cc714846388289fc6", "score": "0.7699264", "text": "def generate_certificate_request(options = {})\n generate_key unless key\n\n # If this is for the current machine...\n if this_csr_is_for_the_current_host\n # ...add our configured dns_alt_names\n if Puppet[...
bdf91cdd8813ed535a2fb23f609670bf
POST /exeo_japans POST /exeo_japans.json
[ { "docid": "259029258d94521996723a87b9a9b1ff", "score": "0.56902385", "text": "def create\n @exeo_japan = ExeoJapan.new(exeo_japan_params)\n\n respond_to do |format|\n if @exeo_japan.save\n format.html { redirect_to @exeo_japan, notice: 'Exeo japan was successfully created.' }\n ...
[ { "docid": "2ec3ceb87f7b5c7f845e54fe8be2aab3", "score": "0.61082065", "text": "def create\n @saju_answer = SajuAnswer.new(saju_answer_params)\n\n if @saju_answer.save\n render json: { status: :ok }\n else\n render json: { status: :internal_server_error }\n end\n end", "title":...
7cdf5ab648e1e3faed44d83f907e1c05
Return a list of the files to be processed in a directory. We know that this directory doesn't have a .document file, so we're looking for real files. However we may well contain subdirectories which must be tested for .document files.
[ { "docid": "6d452f9cd990728d37dd002f3d67d3e1", "score": "0.74427867", "text": "def list_files_in_directory dir\n files = Dir.glob File.join(dir, \"*\")\n\n normalized_file_list files, false, @options.exclude\n end", "title": "" } ]
[ { "docid": "4eb3e4aea8993417633a11a995fe49b4", "score": "0.7403026", "text": "def get_files(directory)\n Dir.entries(directory).select { |entry| not is_dir?(\"#{directory}/#{entry}\") }\n end", "title": "" }, { "docid": "32f0156c0500bbeff557c8b75512e32c", "score": "0.7383126", ...
3c0cea336c723962096a695126867d0f
Provide a detailed, user friendly representation
[ { "docid": "60885c9507d0790e88a03e0a34688dad", "score": "0.0", "text": "def inspect\n \"<Twilio.Notify.V1.NotificationInstance>\"\n end", "title": "" } ]
[ { "docid": "7bea0b559c41a5f338754e1c5f53f1cb", "score": "0.70753354", "text": "def details \n\t\t\"#{self.id} - #{self.name.capitalize}\"\n\tend", "title": "" }, { "docid": "6143c330d598497e31bfa9b9f780219e", "score": "0.7010032", "text": "def detail\n\t\t\t\to = ''\n\t\t\t\to += \" ...
3524ed6bcd8119ec3ed8b2f8543ace52
GET /appdata/1 GET /appdata/1.json
[ { "docid": "2d92ec2e0a581d70806071c944a174cb", "score": "0.54522526", "text": "def show\n @appdatum=Appdatum.find(params[:id])\n end", "title": "" } ]
[ { "docid": "13a1a2acbb17b8bfa88e6a2b5b1d9448", "score": "0.69472367", "text": "def app data={}\n get '/app', data\n end", "title": "" }, { "docid": "d107537b062ebc29e00b5f2a23e382ca", "score": "0.6625407", "text": "def index\n @appdata = Appdatum.all\n end", "titl...
2571dcaabe43290e0f2d47352c46241d
This is the data that Unfuddle POSTs to the repository callback URL
[ { "docid": "80e06a785bfea0ef0887c4eda2d4b4b0", "score": "0.0", "text": "def changeset(message=\"Story:#{PTID} Implement awesome feature\")\n xml =<<EOF\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<changeset>\n <author-date type=\"datetime\">2010-05-26T17:22:11Z</author-date>\n <author-email>toby.m...
[ { "docid": "977ad066591f2c3ba3c17479f17b4cc0", "score": "0.646365", "text": "def post_data; end", "title": "" }, { "docid": "baab87ae75e57429edbe0338baec0027", "score": "0.5904448", "text": "def raw_post; end", "title": "" }, { "docid": "68d83802d060fa552692c42811f359bc",...
ad7d8df63bd75dbb5804601a7f07079c
Registers a pageview for the user
[ { "docid": "e91ec07c423e2d6f8c86568530687077", "score": "0.65515786", "text": "def pageview(mobile)\n # If more than 15 mins since last pageview, count as a log in\n if self.last_pageview.nil? || (Time.now - self.last_pageview) > 900\n self.register_login(mobile)\n end\n\n self.last_pag...
[ { "docid": "0501dda0672cbe7184e213fcbaa8570c", "score": "0.7470486", "text": "def add_view page\n find_or_create_view(:page => page)\n end", "title": "" }, { "docid": "86f903bd5d34342a4889ca8d90c50005", "score": "0.7017446", "text": "def create_page_view\n PageView.create(:p...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "97bfe299230eda627402d9fac3eda3b6", "score": "0.0", "text": "def product_params\n params.require(:product).permit(:name, :sku, :description, :info, :size, :color, :weight,\n :material, :price, :published, :featured,\n ...
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74959", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957448", "text": "def strong_params\n params.require(:request).permit(param_whiteli...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "e3359342044801fd85b8f2d12b1efca5", "score": "0.0", "text": "def update!(**args)\n @byline_date = args[:byline_date] if args.key?(:byline_date)\n @date = args[:date] if args.key?(:date)\n @daterange = args[:daterange] if args.key?(:daterange)\n @debug_info ...
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
53035aeb1f52247df20aadb8da8ee6b9
Gets the kioskModeRequireMonoAudio property value. Indicates whether or not to require mono audio while in kiosk mode.
[ { "docid": "cbb5194798e27e0271177fa7f91f647f", "score": "0.8563781", "text": "def kiosk_mode_require_mono_audio\n return @kiosk_mode_require_mono_audio\n end", "title": "" } ]
[ { "docid": "22144f6e3be684b16df5e12048a97462", "score": "0.82409686", "text": "def kiosk_mode_require_mono_audio=(value)\n @kiosk_mode_require_mono_audio = value\n end", "title": "" }, { "docid": "d21a416a67ddad16fd3acc0e7e00fd8b", "score": "0.6921762", "tex...
85c2ced85784a5d02197454e63d3e252
GET /grupy/1 GET /grupy/1.json
[ { "docid": "dd57c1d1b6b772ff8ad675c61eb71f3c", "score": "0.0", "text": "def show\n @grupa = Grupa.find(params[:id])\n @miejsca = params[:dzien]? Miejsce.w_dniu_dla_grupy(params[:dzien],@grupa) : @grupa.miejsca.order(\"kraj_id, nazwa\").includes(:kraj,:grupy,:terminy=>[:dzien])\n @json = @miejsc...
[ { "docid": "e0e59ded5e423389ae96de85700420f4", "score": "0.7314408", "text": "def show\n @grup = Grup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grup }\n end\n end", "title": "" }, { "docid": "625c7d98ce7f4b6d7...
359daa2213e450e969fbb285f32c42a1
List Tier 1 Service Interfaces Paginated list of all Tier 1 Service Interfaces
[ { "docid": "0ff9461816314d1415733d48c74e6e6f", "score": "0.6141911", "text": "def list_tier1_service_interfaces_0_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1Gateway...
[ { "docid": "9211d561bd8041a672411220bde3c435", "score": "0.6409223", "text": "def index\n @idti_services = IdtiService.all\n end", "title": "" }, { "docid": "f3fad85822e350d8bca7c80026f910f3", "score": "0.63221484", "text": "def index\n services = accessible_services.includes(...
4b1e12e33668f3a8e41f614275748106
PUT /tasks/1 PUT /tasks/1.json
[ { "docid": "32295d765b2181f623a667c97dcfc120", "score": "0.68328846", "text": "def update\n @task = Task.find(params[:id])\n\n respond_to do |format|\n if @task.update_attributes(params[:task])\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n forma...
[ { "docid": "8626542611c0376934f5646142b41bf4", "score": "0.7574151", "text": "def update\r\n @tasks = Task.find(params[:id])\r\n if @tasks.update(task_params)\r\n render json: @tasks\r\n else\r\n render json: @tasks.errors, status: :unprocessable_entity\r\n ...
cbb6a6f3ce24912767af4075d7e1d77e
Time complexity: ? Space complexity: ?
[ { "docid": "9c9186d8f99c256a97ec642245f51289", "score": "0.0", "text": "def search(array, value)\n # raise NotImplementedError, \"Method not implemented\"\n if array.length == 0\n return false\n elsif value == array[0]\n return true\n else \n return search(array[1..-1], value)\n end\nend...
[ { "docid": "5faa084714c4a46eb2c34115a33416f7", "score": "0.63236105", "text": "def second_anagram?(str1, str2) #=> FINAL RUN TIME O(n * m)\n\n arr1 = str1.chars #> O(n)\n arr2 = str2.chars #> O(m)\n\n arr1.each do |char| #> O(n)\n # debugger\n index = arr2.find_index(char) #> O(m)...
d4992aa2c58ace5f64d2a096bdbd35f3
Return the class related to the type of property stored (String, Integer, etc).
[ { "docid": "fc1ca5216f73f91f3a180dc9166cedc9", "score": "0.0", "text": "def klass\n @klass || super\n end", "title": "" } ]
[ { "docid": "e6167ea9bf48d4aabff63310ece4262c", "score": "0.7554172", "text": "def property_type_name(property)\n class_name(property.class)\n end", "title": "" }, { "docid": "98fc346c3d1285128e7a12598296e639", "score": "0.73454964", "text": "def property_type_key\n r...
b49b81bc5bd4ff64af29c79498ed9061
GET /tblocationreports/1 GET /tblocationreports/1.json
[ { "docid": "edb3c643a3aa5672ebcf6806605e984b", "score": "0.7334855", "text": "def show\n @tblocationreport = Tblocationreport.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tblocationreport }\n end\n end", "title": "" } ...
[ { "docid": "2940c3302556ea6ad49effc38a5309bf", "score": "0.6851263", "text": "def show\n @locationreport = Locationreport.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @locationreport }\n end\n end", "title": "" }, { ...
b3083836c7b9e95a4a59334b2fc5d9ce
Set up our environment.
[ { "docid": "3f73808e79380961ab6b4a0ae89e8961", "score": "0.0", "text": "def clean\n FileUtils.rm_r(COFFEE_DIR) if File.directory?(COFFEE_DIR)\n FileUtils.rm_r(JS_DIR) if File.directory?(JS_DIR)\n FileUtils.mkdir_p(COFFEE_DIR)\n FileUtils.mkdir_p(JS_DIR)\n File.open(APP_COFFEE, \"w\") do |f|\n f....
[ { "docid": "d3102b80f6cdaef7a38b9cd43728f4fc", "score": "0.81923795", "text": "def setup_enviroment\n end", "title": "" }, { "docid": "921e2f0b6c6f91da4ee5825ff90675a6", "score": "0.8001094", "text": "def setup(env)\n end", "title": "" }, { "docid": "7032454619d...
260f0225b46d9adeb729c61d7cb7df19
section 'Television' => :Episode map a library subpath to a Media type => :
[ { "docid": "9229b6baaea2268b3e9a4d8124e9b6f4", "score": "0.0", "text": "def section(path_to_class)\n @sections = @sections.merge(path_to_class)\n end", "title": "" } ]
[ { "docid": "b036962c7b5ec08198a27ad28a4a93a6", "score": "0.5831396", "text": "def media_subtype; end", "title": "" }, { "docid": "b036962c7b5ec08198a27ad28a4a93a6", "score": "0.5831396", "text": "def media_subtype; end", "title": "" }, { "docid": "b036962c7b5ec08198a27ad2...
544975ccb128dde73f7ccfe99b7deb00
When more results are available, use this to continue.
[ { "docid": "b04c634a68ddc495365210f22184c94a", "score": "0.0", "text": "def continue(value)\n merge(dfcontinue: value.to_s)\n end", "title": "" } ]
[ { "docid": "c81eef0ecbb93412ff7ca5f1032b7e48", "score": "0.70982414", "text": "def next_results\n return nil if item_page >= total_pages\n @ecs.send_request(@type,@opts,item_page+1)\n end", "title": "" }, { "docid": "de00c20f1d8b368daf99f522646cc6e9", "score": "0.70637...
60973a0d0fb0c3ea2705a112f5892af5
=begin :type start: Integer :type end: Integer :rtype: Integer =end
[ { "docid": "cb058e5f5d35bfae24e3bb0537c426a3", "score": "0.62152874", "text": "def book(start, end)\n \n end", "title": "" } ]
[ { "docid": "64d692856de49e2a4fbc6969f580c3b8", "score": "0.7373164", "text": "def length\n @end - @start\n end", "title": "" }, { "docid": "bc49820cfa0e0dcc429e5f1c22a20ddf", "score": "0.73468834", "text": "def length\n @end - @start + 1\n end", "title": "" ...
7625562304c9d066f565dc5e5fbe7342
Write a function, persistence, that takes in a positive parameter num and returns its multiplicative persistence, which is the number of times you must multiply the digits in num until you reach a single digit. Example: persistence(39): returns 3, because 39=27, 27=14, 14=4, and 4 has only one digit persistence(999): r...
[ { "docid": "5d1e359ad351632278ca7a82a42e9896", "score": "0.78816986", "text": "def persistence(number)\r\n if number.to_s.length == 1 #count digits in number: convert number into string & count the characters inside that string\r\n p 0 #if...
[ { "docid": "c2530919a94dab915a437ab946f6a9ca", "score": "0.865162", "text": "def persistence(num)\n return 0 if num < 10\n 1 + persistence(num.digits.reduce(&:*))\nend", "title": "" }, { "docid": "cfbe6db8d3e54f3bad5d9e2e0020905b", "score": "0.8600272", "text": "def persistence(num...
05668b51a271dd20133dcd926a4c5a61
rubocop:disable Metrics/CyclomaticComplexity rubocop:disable Metrics/AbcSize
[ { "docid": "e6068c8500e722cdcbb9b5fa44e7c930", "score": "0.0", "text": "def lsof_parser(lsof_cmd)\n procs = {}\n # build this with formatted output (-F) from lsof\n # procs = {\n # '123:sshd' => [\n # 'ipv4:tcp:22:127.0.0.1',\n # 'ipv6:tcp:22:::1',\n # ...
[ { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.65086985", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.65086985", "text": "def used; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba6aa77", "...
c7ac485b1b6a1c493fc75aee2e5123de
GET /publications GET /publications.json
[ { "docid": "bf3375ab8628e066a635940478d3d793", "score": "0.7364029", "text": "def index\n @publications = current_user.publications\n end", "title": "" } ]
[ { "docid": "aa2bcc1b4853359c78c83247b7e2adb6", "score": "0.79564214", "text": "def index\n @publications = Publication.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @publications }\n end\n end", "title": "" }, { ...
24c0469a21c5fa9f690b47f79bcaae73
Retrieves the named cache from the pool.
[ { "docid": "f61b338cb4a89e90513c19796fe76c21", "score": "0.0", "text": "def []( name )\n retrieve(name)\n end", "title": "" } ]
[ { "docid": "e8928081eef1406cf709c00f0223aa48", "score": "0.73677075", "text": "def [](name)\n if (key = gen_key(name)).present?\n Rails.cache.read(key)\n else\n nil\n end\n end", "title": "" }, { "docid": "03993a52ea48dfbe1fed13f7b7488eeb", "sc...
f616233f4cbd14bd3290254603c03bf9
The method should returns a new array containing the values from each hash for the given key.
[ { "docid": "0727aece6c93bfec5e737bc66733998d", "score": "0.0", "text": "def map_by_key(arr, key)\n new_arr = []\n arr.each do |ele|\n ele.each do |k, v|\n if k == key\n new_arr << v\n end\n end\n end\n return new_arr\nend", "title": "" } ]
[ { "docid": "8237fcdc52fe809fab0b148a19733f14", "score": "0.6976688", "text": "def get_values_return_array(hash)\n final_values = []\n hash.each { |key, value| final_values << value }\n final_values.uniq\nend", "title": "" }, { "docid": "776234c931fe9c69952b2f7a55945ca2", "score": "0.6...
4a81f166d6dc4a7d00c7a5060f2aa956
int symbol int > bool/int/nil evaulates the expression and returns a calculated value
[ { "docid": "182485b3881ce030f7fd953cc180040b", "score": "0.0", "text": "def evaluate_const(left, op, right)\n case op\n when :add\n return left + right\n when :sub\n return left - right\n when :mul\n return left * right\n when :div\n ...
[ { "docid": "6aad90fd4e46fee8396114198cad02c9", "score": "0.744084", "text": "def calc(expr)\n Integer(expr)\n end", "title": "" }, { "docid": "35981b09870e67c1a7245a5021bb7115", "score": "0.66040194", "text": "def arithmetic_operation?; end", "title": "" }, { "docid":...
9581c59cd76f7b93be178a2f81238322
Redeem friendship token Immediately connects the requested user with the user mapped by the provided invite token. Permissions Needed: FRIENDSHIPS_ADMIN or (FRIENDSHIPS_USER and owner)
[ { "docid": "3d7e1d16885963220a360f1f8b01a100", "score": "0.61535674", "text": "def redeem_friendship_token_with_http_info(user_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UsersFriendshipsApi.redeem_friendship_token ...\"\n end\n ...
[ { "docid": "a83552d2b83399ff461c00d4af4a99c2", "score": "0.72705066", "text": "def redeem_friendship_token(user_id, opts = {})\n redeem_friendship_token_with_http_info(user_id, opts)\n return nil\n end", "title": "" }, { "docid": "9ce072171cd5d20fd5734f3423f67866", "score": ...
5f3ba5e6c5424b7d7d9c4cffb4d72247
Spins a while if +LOCKED+ bit set and this node is the first of its bin, and then sets +WAITING+ bits on hash field and blocks (once) if they are still set. It is OK for this method to return even if lock is not available upon exit, which enables these simple singlewait mechanics. The corresponding signalling operation...
[ { "docid": "e2611ea363008c8058c80e6841c94caf", "score": "0.49603498", "text": "def try_await_lock(table, i); end", "title": "" } ]
[ { "docid": "ef0b01f8902a4c279eec8c341d65aaa3", "score": "0.64874864", "text": "def lock!(wait = 0.1)\n until redis.call(\"SETNX\", key[:_lock], lock_timeout) == 1\n next unless lock = redis.call(\"GET\", key[:_lock])\n sleep(wait) and next unless lock_expired?(lock)\n\n break u...
49e5902955fa7dd9398b78e95b385c0e
Full name of the Seller
[ { "docid": "20f90a72f012aa7896efc4515aaec26a", "score": "0.8076774", "text": "def seller_name\n seller.profile.full_name\n end", "title": "" } ]
[ { "docid": "bc475b0906e431d69033e24871dbeab3", "score": "0.73110014", "text": "def full_name\n \"#{brand} #{name}\"\n end", "title": "" }, { "docid": "bc475b0906e431d69033e24871dbeab3", "score": "0.73110014", "text": "def full_name\n \"#{brand} #{name}\"\n end", "...
82aad8fb3de9b74c1441251b01d93f3c
Simple Moving Average A simple moving average (SMA) adds recent prices for a specified period and divides the total by that same number of periods. SMA is typically used to indicate whether a security is in an uptrend or downtrend and can also be combined with a longterm moving average to improve the signal&x60;s abili...
[ { "docid": "3b0798306455e1af643ff0f1c3c28b03", "score": "0.0", "text": "def get_security_price_technicals_sma_with_http_info(identifier, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TechnicalApi.get_security_price_technicals_sma ...\"\n e...
[ { "docid": "fcea8d1a22a8c9e2a9a239aaa5188f60", "score": "0.73671144", "text": "def simple_moving_avg(days_back)\n\t\t#get prices from n days_back\n\t\tprices = @price_array[-days_back..-1]\n\n\t\t#calculate SMA\n\t\tprices.inject{ |sum, element| sum + element }.to_f / prices.size\n\tend", "title": "...
94010f572aeb50c2a67b679df40f4f13
Adds a QueryResult to the list of results for this set
[ { "docid": "df1c7543215ec8a6597684043a48b1c0", "score": "0.8535654", "text": "def add_result(result)\n @query_results << result\n end", "title": "" } ]
[ { "docid": "30b8fecba05d9d1c77bca89b02e42189", "score": "0.7860858", "text": "def add_result(result)\n @results << result if result\n end", "title": "" }, { "docid": "900bcb9e1f95d44342abb63bcb9b417a", "score": "0.7771198", "text": "def add_result(r)\n @results << r\n ...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "ac13d3c97a30c47109019175897a244f", "score": "0.0", "text": "def update!(**args)\n @field_restriction = args[:field_restriction] if args.key?(:field_restriction)\n @metadata = args[:metadata] if args.key?(:metadata)\n @tagline = args[:tagline] if args.key?(:tagline)...
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...