query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
b7d33b6b3d00c6d19ce0d730a24452e9 | same as score= but, for readabillity i put this code too | [
{
"docid": "269d23097b0d7eed5b3eb2b764fd6984",
"score": "0.0",
"text": "def text=(value)\n\t\t@score = value\n\t\tre_render_text\n\tend",
"title": ""
}
] | [
{
"docid": "8ecaf647f536b0bd12fb07d6e189ff9d",
"score": "0.78787893",
"text": "def score; end",
"title": ""
},
{
"docid": "8ecaf647f536b0bd12fb07d6e189ff9d",
"score": "0.78787893",
"text": "def score; end",
"title": ""
},
{
"docid": "8ecaf647f536b0bd12fb07d6e189ff9d",
... |
d34c9c74fc49641c94030dbcadfa784c | check end time greater start time | [
{
"docid": "11eecad03b1b47b637971c526ae7c3c2",
"score": "0.80573046",
"text": "def end_time_greater_start_time\n return nil unless time_start && time_end\n if time_start.to_time > time_end.to_time\n errors.add(:time_start, 'debe ser menor a la hora final')\n end\n end",
"title": ""
... | [
{
"docid": "5cfaaaad85cf816cb01b9ecc76c6d120",
"score": "0.82233846",
"text": "def check_end_time_greater_start_time\n if start_time >= end_time\n errors.add(:start_time, \"start_time can't be greater than end_time\")\n end\n end",
"title": ""
},
{
"docid": "7753c3dbc930311e3ed04... |
a66dab24ff0ffb01a99389900c0d04d3 | each must be called without arguments and only yield Strings. | [
{
"docid": "e948a63a379f5b934104e7cc23feb93d",
"score": "0.0",
"text": "def each(&block)\n\t\t\t\treturn to_enum unless block_given?\n\t\t\t\t\n\t\t\t\twhile chunk = gets\n\t\t\t\t\tyield chunk\n\t\t\t\tend\n\t\t\tend",
"title": ""
}
] | [
{
"docid": "5bfc306fe79b31dc5a0c232a02838dd8",
"score": "0.681855",
"text": "def each\n # Include every to be inside enumerable:\n yield \"pizza\"\n yield \"spaghetti\"\n yield \"salad\"\n yield \"water\"\n yield \"bread\"\n end",
"title": ""
},
{
... |
16f518154f351cd1bc3c51a6532db8d8 | GET /status_kepegawaian GET /status_kepegawaian.json | [
{
"docid": "89ed23f5fa45190a14f50c4b7b08ad4a",
"score": "0.7066818",
"text": "def index\n @status_kepegawaian = StatusKepegawaian.all\n end",
"title": ""
}
] | [
{
"docid": "328a9b7d96dbd5d95b6940936545b355",
"score": "0.67023826",
"text": "def set_status_kepegawaian\n @status_kepegawaian = StatusKepegawaian.find(params[:id])\n end",
"title": ""
},
{
"docid": "f3e04857f6f3fd993c4a31cd98d6f453",
"score": "0.67006874",
"text": "def inde... |
2a6fffc31b9b33ad638eabbb1650d3e9 | POST /complaints POST /complaints.json | [
{
"docid": "2e4db54c1614940ed59223104e21dbd4",
"score": "0.0",
"text": "def create\n @complaint = Complaint.new(complaint_params)\n \n if @complaint.user_email.blank?\n flash[:DupError] = 'لطفا ایمیل را وارد کنید.'\n end\n if @complaint.save\n SendComplaint.send_complaint_to_Ins... | [
{
"docid": "a1675ea453112a61c668d7687b0bab47",
"score": "0.6820398",
"text": "def create\n @complaint = current_user.complaints.build(complaint_params)\n\n respond_to do |format|\n if @complaint.save\n format.html { redirect_to @complaint, notice: \"Complaint was successfully created.\... |
fc4eaf5c120e44a056b7e5f9978f7594 | Source location is not available | [
{
"docid": "d8111bc5b6a549059fa8ebf3ed8b0948",
"score": "0.70678586",
"text": "def source_location(*); end",
"title": ""
}
] | [
{
"docid": "3d8ca9360b418f50f0757f1401012541",
"score": "0.79874355",
"text": "def source_location; end",
"title": ""
},
{
"docid": "56bf19dbfd3862c9f52bb6d8d561ef2f",
"score": "0.7647415",
"text": "def source_path; end",
"title": ""
},
{
"docid": "c175eefd106a2fb8520d7a1... |
f827e7d4b180f7c36996781038a9f3b2 | Write a method that takes in 2 numbers as arguments and prints their sum. Then call your method: | [
{
"docid": "75c15424e4ace6977d3a4e65ba7104ec",
"score": "0.0",
"text": "def add(a, b)\n a + b\nend",
"title": ""
}
] | [
{
"docid": "7943a482f5273ff0ce3a756a70efd648",
"score": "0.8438412",
"text": "def sum_these_numbers (a, b)\n puts a + b\nend",
"title": ""
},
{
"docid": "27b8b4cac77095a75de6d5b1c1cfd62a",
"score": "0.84250647",
"text": "def sum_two_num(a, b)\n puts a + b\nend",
"title": ""
}... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "c9ddcf8126fa7afff32c2240c6957d74",
"score": "0.0",
"text": "def set_invoice_article\n @invoice_article = InvoiceArticle.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... |
8ed00556d4122e3eccfd9b5389522ebd | PUT /users/1 PUT /users/1.json | [
{
"docid": "f5c1bc7a118e477f0a49c04184cd87c1",
"score": "0.0",
"text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, :notice => 'User was successfully updated.' }\n format.js... | [
{
"docid": "b5edb8a9b2cad14c7874c5f42c5809e9",
"score": "0.7438286",
"text": "def test_put_user\n json_data = '{\"name\":\"test\", \"last_name\":\"test\", \"document\" : \"098\"}'\n put '/users/4', json_data\n assert_equal 204, last_response.status, 'Código de respuesta incorrecto'\n end",
... |
e1ee9f7c3920ac9a911d388eae005fe7 | ================================= Instance Methods ================================= | [
{
"docid": "dcb6cb37a877ea2c63cc040d54cfbaa3",
"score": "0.0",
"text": "def competitor_sgid\n competitor&.to_sgid_param\n end",
"title": ""
}
] | [
{
"docid": "18250542a2b1999be90588db1d071d92",
"score": "0.7403467",
"text": "def initialize\n\t\t\n\tend",
"title": ""
},
{
"docid": "cdd58dace22c11a7043a695fbef6319a",
"score": "0.7381441",
"text": "def initialize\n\n end",
"title": ""
},
{
"docid": "cdd58dace22c11a704... |
0490adc2e020eb739213522b38e2cd97 | Sets the value to the given value | [
{
"docid": "74dc5937a2113df48974f17fc347d627",
"score": "0.0",
"text": "def value=(value)\n @value = value\n recta.value_y = (100 - value) / 100\n render\n end",
"title": ""
}
] | [
{
"docid": "c39e75e717f8082736d27ab7e0a178b9",
"score": "0.88349056",
"text": "def set_value(value)\n _set(:value, value)\n end",
"title": ""
},
{
"docid": "fe61adf3744b2b94fde27db3e4c0cb10",
"score": "0.8789804",
"text": "def set_value(value)\n @value = value\n end",... |
2a39beb389367d4093d5f32ef8fd7409 | GET /messages/conversation/:user_id list messages you have had with another user Needs to mark all messages as read | [
{
"docid": "2e4da499d8b2f9895d9ae2b0b3ee2e9a",
"score": "0.68029016",
"text": "def conversation\n @messages = Message.get_conversation(current_user, params[:user_id])\n render json: @messages, each_serializer: MessageConversationSerializer\n end",
"title": ""
}
] | [
{
"docid": "95cd7db5facce0d2d9215d0c995f7929",
"score": "0.7628869",
"text": "def read_messages\n @useConversations = Message.where(\"user_id = (?)\", current_user.id).pluck(:conversation_id)\n if @useConversations.count > 0\n @useConversations = @useConversations.uniq # Unique\n @useCon... |
a8931770ba4d5e1950b800e1126484b0 | Retrieve the search term | [
{
"docid": "2b252768d4eed35b54e8cbe65b1b5057",
"score": "0.6446545",
"text": "def query_string\n @search.getQueryString\n end",
"title": ""
}
] | [
{
"docid": "b6a06280ddc95fc04ebab08d680c543c",
"score": "0.84382945",
"text": "def get_search_term\n get_text SEARCH_TERM_USED\n end",
"title": ""
},
{
"docid": "1961fb15f0c62e7c8e262e4016583867",
"score": "0.83009374",
"text": "def searchterm\r\n @@st.get_searchterm(refer... |
0c0fa39db7f4f1badfa74fbc0049ff52 | =============== = Version Mgt = =============== | [
{
"docid": "1bf40315363a79702c1236b18b641354",
"score": "0.0",
"text": "def version_mgt_checkin\n severity = Version.out_of_date_severity params[:version]\n render :json => { :out_of_date => severity, :store_link => store_link }\n end",
"title": ""
}
] | [
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.8212083",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
"score": "0.8212083",
"text": "def version; end",
"title": ""
},
{
"docid": "41de0d9efb42153ab12adf4dad158176",
... |
4b88dee03d39ed7bbe8e2d3f99e2c928 | GET /vas_questions GET /vas_questions.json | [
{
"docid": "b1cf957fd1a9ed71125d676e0dbb4e09",
"score": "0.7352957",
"text": "def index\n @vas_questions = VasQuestion.all\n end",
"title": ""
}
] | [
{
"docid": "82fc080dea262a79e0a7089773f9a8e2",
"score": "0.80927265",
"text": "def questions\n self.class.get(\"/2.2/questions\", @options)\n end",
"title": ""
},
{
"docid": "54ff5624e6a8f6243810476f02476332",
"score": "0.754031",
"text": "def index\n @api_v1_questions = Api::... |
b31d870ac3fc32e2ad03596a1c1de9e8 | TODO: Moves the element to a specific pixel position within its slot | [
{
"docid": "6118babc3fda6bd0c2f747a2222e0d12",
"score": "0.0",
"text": "def move(left, top)\n \n end",
"title": ""
}
] | [
{
"docid": "78232a883e2ae3bce765a1349a5ce00e",
"score": "0.7453353",
"text": "def move_to_element()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "2eb281ebe55efcccc088b1eb1cffba99",
"score": "0.6528525",
"text": "def eb_placement\n ... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "36a70fdd0b4bf66ef4f56ec47bdc7466",
"score": "0.0",
"text": "def set_race\n @race = Race.friendly.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n redirect_to root_path\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... |
2fd1d8160865e86fc6d6e45343805e94 | Initializes a new visualization. | [
{
"docid": "02c6e2c6456a01eaebc817772fa8bd59",
"score": "0.0",
"text": "def initialize(options={})\n @project = Project.new(options)\n\n @naming = :relational\n @full_names = false\n\n @repository_names = {}\n\n if options[:repository_names]\n options[:rep... | [
{
"docid": "b925647e21e823e9306da28fbdbdab85",
"score": "0.67777675",
"text": "def initialize(to_visualize: nil)\n @object = to_visualize\n @table = Table.new\n end",
"title": ""
},
{
"docid": "01e85c9a30b105a699b6a16e11843123",
"score": "0.65709966",
"text": "def new\n ... |
d8b9b3a54d740f95e11771d9cf3cda28 | This is used by acts_as_tree | [
{
"docid": "a4b0dd4adb9086f006a59b7567307a26",
"score": "0.0",
"text": "def has_children?\n children.size > 0\n end",
"title": ""
}
] | [
{
"docid": "6269600ab7c9fdcedee3cc5c7d29b6c4",
"score": "0.7315092",
"text": "def display_tree(tree_parent) # Need to work on this\nend",
"title": ""
},
{
"docid": "1ec6bc58978a9abd4d91d1d912631562",
"score": "0.72317195",
"text": "def tree; end",
"title": ""
},
{
"docid"... |
414dee08e0e0c1fa31798c832ce26b9e | test action to process a feed | [
{
"docid": "0c5fe734719bbc00d00874485dd9d4fb",
"score": "0.0",
"text": "def make_it_so\n @feed_map = FeedMap.find(params[:id])\n @feed_map.feed.to_products\n end",
"title": ""
}
] | [
{
"docid": "29d6ed35a17d4e93f694c177103af9c5",
"score": "0.6932328",
"text": "def test_get_feed\n get :feed\n assert_response :success\n end",
"title": ""
},
{
"docid": "b16d7cef724df5ea23fbf6d6c159d4e4",
"score": "0.6556162",
"text": "def feed\n end",
"title": ""
},
... |
9c36c01aa8eb34e5b03eb42ea1ae0b1b | Complete path for the action of controller | [
{
"docid": "78ff4ba2822b0459e0bc8511d842a9a4",
"score": "0.0",
"text": "def adapt(ctrl, action)\n\t\t\tparameters = ctrl.instance_method(action).parameters\n\t\t\tparameters.map! do |parameter|\n\t\t\t\tparameter_type, parameter_name = parameter\n\t\t\t\tpath_part = self.class::Part.new parameter_name, ... | [
{
"docid": "7eddb9d5f0fbef2a33a22754dc151354",
"score": "0.79653",
"text": "def action_path\n \"#{params[:controller]}/#{params[:action]}\"\n end",
"title": ""
},
{
"docid": "c191580413373faa53df68e645a073dc",
"score": "0.78321224",
"text": "def controller_path; end",
"title"... |
d3e54ed8ee6cc032ff3364aeab660989 | Crafts the ReadRequest packet to be sent for read operations. | [
{
"docid": "1a6e782cd42bdb3b542422e19c164f6d",
"score": "0.7064633",
"text": "def read_packet(read_length: 0, offset: 0, credit_charge: 1)\n read_request = set_header_fields(RubySMB::SMB2::Packet::ReadRequest.new)\n read_request.read_length = read_length\n read_request.offset ... | [
{
"docid": "237f6cbc03c41c958774ec51f7691430",
"score": "0.74387324",
"text": "def read_packet(read_length: 0, offset: 0)\n read_request = set_header_fields(RubySMB::SMB1::Packet::ReadAndxRequest.new)\n read_request.parameter_block.max_count_of_bytes_to_return = read_length\n read_r... |
1513f38d6862972dbb04f0cd2be390ff | Checks if the query job is using standard sql. | [
{
"docid": "0697456467f030435b83f28d34ba9429",
"score": "0.8019257",
"text": "def standard_sql?\n !legacy_sql?\n end",
"title": ""
}
] | [
{
"docid": "e395c90dda6943f32029cdf2ccfc5e2b",
"score": "0.75249684",
"text": "def legacy_sql?\n val = @gapi.configuration.query.use_legacy_sql\n return true if val.nil?\n val\n end",
"title": ""
},
{
"docid": "e395c90dda6943f32029cdf2ccfc5e2b",
"score":... |
a878dc370819aa64b8de36e775c04349 | Returns the number of devices that a search query found Unrestricted usage of all advanced filters Return results count or nil on failure | [
{
"docid": "d4f713c423e66dc34ff3cba138eb70cf",
"score": "0.0",
"text": "def count(string)\n url = @url + 'count?q=' + string + '&key=' + @key\n res = @http.get(url)\n if res[0].nil? or res[0] == ''\n print_error(\"Problem grabbing results count!\")\n return nil\n else\n result... | [
{
"docid": "7ffefd0ed3b559e19ca7916d552098fa",
"score": "0.7033273",
"text": "def count\n connection.get(\"select\", params: { q: query })[\"response\"][\"numFound\"].to_s.to_i\n end",
"title": ""
},
{
"docid": "40165573dbafcc1746036c54a2232247",
"score": "0.6871952",
"text":... |
493ccfe5323cc4ccd20a0b4fd0feda8d | Inserting new node after a given node | [
{
"docid": "194d14257a77c9138757fbe15d8535ed",
"score": "0.72050947",
"text": "def after_node_insertion(previous_node, new_data)\n return unless previous_node\n\n new_node = Node.new(new_data)\n\n new_node.previous_node = previous_node\n new_node.next_node = previous_node.next_node\n\n pr... | [
{
"docid": "f677e595185f7487ad7f92a8e40a4b57",
"score": "0.8540526",
"text": "def insert_after(new_node)\n # Interface method\n end",
"title": ""
},
{
"docid": "b7e95addf99a3d4277e9d1607942d324",
"score": "0.83266",
"text": "def insert_after( node, value )\n new_no... |
6037d66c9a13a68d94aedca667e355f9 | Gets the UDP idle timeouts of this SNAT translation addresse. | [
{
"docid": "259bc5942be3219769aad0fa6b13c2f9",
"score": "0.5777589",
"text": "def udp_timeout\n super\n end",
"title": ""
}
] | [
{
"docid": "3b100277d652f1ac36e72b669f8dd3f8",
"score": "0.6329027",
"text": "def get_timeouts\n @bridge.get_timeouts\n end",
"title": ""
},
{
"docid": "3b100277d652f1ac36e72b669f8dd3f8",
"score": "0.6329027",
"text": "def get_timeouts\n @bridge.get_timeouts\... |
a9cf298b54305ce26a61705ccda9ab33 | When invoking Order.new we like to get its order_number set. | [
{
"docid": "948ba0133f073ac62f1352de16c82b33",
"score": "0.0",
"text": "def after_initialize()\n if(self.new_record?)\n maximum_order_number = Order.maximum(:order_number)\n self.order_number = maximum_order_number ? maximum_order_number + 1 : 1\n #also lets add a registration date\n ... | [
{
"docid": "b7261c7f2b06c7b75b4a952164cb84b1",
"score": "0.81562567",
"text": "def set_order_number\n self.order_number = Order.generate_order_number\n end",
"title": ""
},
{
"docid": "e98c519db04346dd4b0158863f931440",
"score": "0.7533824",
"text": "def order_number\n sel... |
e979e7519221ba1fe5f2c0220f4d9568 | NOTE: card_security_code should not be present in JSON | [
{
"docid": "47a5bb870421abc3913da752085f0fc7",
"score": "0.0",
"text": "def add_payment(post, payment)\n post[:token_name] = payment.token\n post[:customer_name] = payment.name\n # NOTE: cvv should be present on the second and succeeded purchase requests\n post[:card_security... | [
{
"docid": "ddabce08f5811071cd3f331b06f9c98b",
"score": "0.6825962",
"text": "def card(gateway_code, data = nil)\n @cs_mixin.json_dict = @json_dict\n @cs_mixin._deleted = @_deleted\n @cs_mixin.card(gateway_code, data)\n @json_dict = @cs_mixin.json_dict\n @_deleted = @cs_mixin._d... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "2aa519fd1021d8d976ec79b85a3fad34",
"score": "0.0",
"text": "def set_hosted_event\n @hosted_event = HostedEvent.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;... |
f565cb4c3c3d2ca5c8aa509a9029d07b | POST /vehicle_models POST /vehicle_models.xml | [
{
"docid": "4d0f4a654c68db84861cbbabb962e5f6",
"score": "0.6746939",
"text": "def create\n @vehicle_model = VehicleModel.new(params[:vehicle_model])\n\n respond_to do |format|\n if @vehicle_model.save\n format.html { redirect_to(@vehicle_model, :notice => 'Vehicle model was successfull... | [
{
"docid": "76ecaffbc0e7d976996aa5872dd3199a",
"score": "0.67461956",
"text": "def create\n @make = Make.find(params[:make_id])\n @vmodel = @make.vmodels.build(params[:vmodel])\n\n respond_to do |format|\n if @vmodel.save\n format.html { redirect_to(@make, :notice => 'Vehicle model ... |
3c35ef70a204c783494ba12aed9323c8 | Stop the currently playing music. | [
{
"docid": "0444bb3f4813c1aaa1e41a3bfbd0dbfd",
"score": "0.7826409",
"text": "def stop_music\n MSPhysics::Music.stop\n end",
"title": ""
}
] | [
{
"docid": "3f0a6f1ef148cb2fbbc8ad91a1466da8",
"score": "0.80663824",
"text": "def stop\n if @player_ready\n @@media_player.pause\n @@media_player.stop\n end\n @@current_song = 0\n end",
"title": ""
},
{
"docid": "2d5570572e80fdffb74fc6a4dcf7e334",
"score"... |
740c76c7b32329d8431196b0721f105b | villain loses battle, gets sent to insane asylum | [
{
"docid": "bdc493ffa3204901849aa09c3e1a16b2",
"score": "0.65564394",
"text": "def villain_lost(villain)\n if villain.hp <= 0\n villain.update(insane_asylum: true)\n end\n end",
"title": ""
}
] | [
{
"docid": "9d8ca9188306a132bf7bc677dc530ebc",
"score": "0.70292825",
"text": "def villain_battle_sequence(hero, villain)\n Battle.start_a_battle(hero, villain)\n battle = Battle.all.last\n hero_hp = hero.hp\n villain_hp = villain.hp\n while villain.hp > 0 && hero.hp >... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "4a9c7acd3804f86357415e66af5c8a74",
"score": "0.0",
"text": "def set_item\n @item = Item.find(params[:id])\n @owner = User.find(@item.user_id)\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60320485",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6013371",
"text": "de... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "a74974b7537a5f5e4d1bbe42663b541a",
"score": "0.0",
"text": "def cheese_params\n params.permit(:name, :description, :category, :brand, :origin, :cheese_pic)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74964964",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6957765",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
a60831c102963e0e26f5b8cc1010d920 | This method reads the type of assessment selected for creation, then clicks the Create button and instantiates the proper class. If the assessment is going to be made in the builder, then EditAssessment is called. If from Markup text... | [
{
"docid": "352311e65286db758c5c71d0ace9fdf5",
"score": "0.7887243",
"text": "def create\n builder_or_text = frm.radio(:value=>\"1\", :name=>\"authorIndexForm:_id29\").set?\n\n frm.button(:value=>\"Create\").click\n\n if builder_or_text == true\n EditAssessment.new(@browser)\n else\n ... | [
{
"docid": "1a058ff819ffde85d3a0614e073dfe69",
"score": "0.6336079",
"text": "def save\n frm.button(:name=>\"modifyPartForm:_id89\").click\n EditAssessment.new(@browser)\n end",
"title": ""
},
{
"docid": "fd30c823796aca17812c901056d9fe31",
"score": "0.6249461",
"text": "def cr... |
97820f58ce245febfd04d758e6c1b497 | Redirects user to user order page if signed in | [
{
"docid": "e091181306843138306fd823b76e6238",
"score": "0.6628891",
"text": "def after_sign_in_path_for(root_path)\n session[\"new_user_order_return_to\"] || new_user_order_path(current_user)\n end",
"title": ""
}
] | [
{
"docid": "e04a458742243d962d66bfd0873c7b2f",
"score": "0.80027354",
"text": "def check_user_auth\n unless user_signed_in?\n session[:redirect_to_order] = 1\n redirect_to account_path\n return\n end\n end",
"title": ""
},
{
"docid": "c74e6225e9dacb2a3f6d022f019d0e6b",
... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "48777e7395361d7784a25c956cc83a3f",
"score": "0.0",
"text": "def developer_params\n params.require(:developer).permit(:name)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.79429054",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.69583875",
"text": "def permitted_params\n params.permit!\n end",
"title... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "d2608f433e10bcd76b03e2907424d2e0",
"score": "0.0",
"text": "def set_review\n @review = Review.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... |
93ced1cc1692535ae54df8f1c11264b7 | Return the current user session, creating it if it does not exist. | [
{
"docid": "75fa4c2e06add17ac4775a233fc5985e",
"score": "0.73482764",
"text": "def user_session\n @user_session ||= UserSession.new(session, cookies)\n end",
"title": ""
}
] | [
{
"docid": "7227baf7ea3269b89f872aa2acb201fe",
"score": "0.7741931",
"text": "def current_user_session\n return @current_user_session if defined?(@current_user_session)\n @current_user_session = UserSession.find\n end",
"title": ""
},
{
"docid": "7227baf7ea3269b89f872aa2acb201fe",
... |
3cd8c0d0d48757c91bdb261e7621cedc | GET /schedules/1 GET /schedules/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "67add2f10eeb42fc566de0e4a4c2bda4",
"score": "0.80702317",
"text": "def show\n @schedule = getSchedules()[params[:id]]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedule }\n end\n end",
"title": ""
},
{
"docid": "b48... |
9d8c659eb67e35620e898ac2e8235412 | Valida un CFDI contra el esquema xsd | [
{
"docid": "ad5d6a5d9b801554f2849f55e2eb5d1e",
"score": "0.7602226",
"text": "def valida_cfdi(archivo_path)\n schema_cfd_path = 'app/assets/extras/cfdv32.xsd'\n schema_cfd = Nokogiri::XML::Schema(File.read(schema_cfd_path))\n schema_tfd_path = 'app/assets/extras/TimbreFiscalDigital.xsd'\n ... | [
{
"docid": "d09daea23f86a5bad97a3a67d09f9c73",
"score": "0.68864095",
"text": "def validate_schema\n \n # open(\"http://www.sat.gob.mx/cfd/3/cfdv32.xsd\")\n doc = Nokogiri::XML( File.read(@file) )\n \n #puts \"KEYS: \" + doc.root.keys.to_s\n #puts \"Schema: \" + doc.root[\"... |
7d6956655f38ad7ad27005f3871624d7 | my custom fields are :name, :heard_how | [
{
"docid": "09cd7f77648e5a14156c7612987d36f8",
"score": "0.0",
"text": "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) do |u|\n u.permit(:name, :email, :password, :password_confirmation, :image, :provider, :token, :token_secret, :uid, :user_id)\n end\n devise... | [
{
"docid": "24cc687fe9a6b24ce3adccd3fecb65d0",
"score": "0.64074594",
"text": "def add_custom_field(name, value)\n add_field name, value\n end",
"title": ""
},
{
"docid": "779830e70b27b34c5ae122b225d718e5",
"score": "0.634972",
"text": "def custom_field(name)\n ... |
bdb935fb280612939cf4d634167b48d3 | return list of extension file.vsh in :vhome/ext//.vsh | [
{
"docid": "462515d9a4bb6ac6006ec43b7d65bae9",
"score": "0.85418487",
"text": "def extensions(vm)\n Dir[vm.fs[:vhome] + '/ext/*/*.vsh']\nend",
"title": ""
}
] | [
{
"docid": "e9bc08d170b9a93d63e0cd44b081c21a",
"score": "0.6858308",
"text": "def extensions\n path.basename.to_s.split(\".\").drop(1)\n end",
"title": ""
},
{
"docid": "b26ecc4e6feadd3d5e4426278a2f8b59",
"score": "0.6734875",
"text": "def path_extnames(path); end",
"titl... |
a0df70968649b4fd26ac8da178de3ae1 | Update with your Mailgun API key and email details | [
{
"docid": "64f821b5911764a560878e8eb8a0b13e",
"score": "0.0",
"text": "def send_email(name, email, amount)\n mg_client = Mailgun::Client.new #'Your Mailgun API key'\n message_params = { from: 'me@me',\n to: email,\n subject: 'Payme: Thanks',\n ... | [
{
"docid": "80253a017288e4b1dac75efb6bf3ebfe",
"score": "0.68540186",
"text": "def profile_update_email(data)\n\n mandrill_mail :template => 'account_update',\n :subject => \"Account Updated\",\n :to => {\n :email => data[:email],\n ... |
df54b443c5355d0907646ef66871ed76 | POST /ripple_transactions POST /ripple_transactions.json | [
{
"docid": "183b0c6fb55e31d4bef3e826844e0c84",
"score": "0.73111665",
"text": "def create\n @ripple_transaction = RippleTransaction.new(ripple_transaction_params)\n\n respond_to do |format|\n if @ripple_transaction.save\n format.html { redirect_to @ripple_transaction, notice: 'Ripple t... | [
{
"docid": "541c7bf80210f98889e93e12a89e7cbb",
"score": "0.67803544",
"text": "def ripple_transaction_params\n params.require(:ripple_transaction).permit(:to_address, :from_address, :to_amount, :from_amount, :to_currency, :from_currency, :to_issuer, :from_issuer, :transaction_state, :transaction_ha... |
1e20defc425c33b4aca85ae5126c7505 | Returns the announced schema. If no announce schema files are installed and unstage is true, returns the effective schema. Returns nil otherwise. | [
{
"docid": "6e3ea3060bafa28fb1249070bfa4f827",
"score": "0.8788372",
"text": "def announced_schema(unstage = false)\n if has_announced_schema?\n load_schema_from_files(announced_files)\n elsif unstage\n effective_schema(unstage)\n else\n nil\n end\n... | [
{
"docid": "5ceed6eaa9e3787b35d11c764bd3d7cb",
"score": "0.75507224",
"text": "def effective_schema(unstage = false)\n if has_effective_schema?\n load_schema_from_files(effective_files)\n elsif unstage\n physical_schema\n else\n nil\n end\n end... |
1a0a1c07f828d1a890cc85085f75a0b7 | GET /societies/1 GET /societies/1.json | [
{
"docid": "ebb6397b70d410b91df78ca9ef71b67b",
"score": "0.69755733",
"text": "def show\n @society = Society.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @society }\n end\n end",
"title": ""
}
] | [
{
"docid": "c3df6d85c9727e04314f5d630e600bc3",
"score": "0.7658303",
"text": "def index\n @societies = Society.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @societies }\n end\n end",
"title": ""
},
{
"docid": "594be5d752bbfb62... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "7b7264df1dabf5157ccf8cd017176e80",
"score": "0.0",
"text": "def assignment_params\n params.require(:assignment).permit(:title, {assignment_file: []}, :description, :course_id, :total_score)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74964964",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6957765",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
09d4eff46c92c9dc80e1d85ec7568e5d | the record count for entries within the authorization lookup table for a given user_id or user. Used to determine if the table is complete | [
{
"docid": "69e6f9a075bea704c71c5376eb442c2d",
"score": "0.6457663",
"text": "def lookup_count_for_user(user_id)\n user_id = user_id.nil? ? 0 : user_id.id unless user_id.is_a?(Numeric)\n sql = \"select count(*) from #{lookup_table_name} where user_id = #{user_id}\"\n ActiveRec... | [
{
"docid": "9912edca6a61c6c99cd1479b8b5c0364",
"score": "0.6830886",
"text": "def lookup_count_for_user(user)\n lookup_class.where(user_id: user || 0).count\n end",
"title": ""
},
{
"docid": "82b4680eee45640dcbfaf8102fd8bbe5",
"score": "0.6569787",
"text": "def lookup... |
6b0fc3dc911520ce9f21242a3dd8f872 | meth Return the number of elements that can be milled at the current setting of start_degree, end_degree and degree increment | [
{
"docid": "436f968cdd56a6bcce3f649ece4c0354",
"score": "0.6740083",
"text": "def num_steps()\r\n # - - - - - - - - - - - - - - - - \r\n sweep / degree_increment\r\n end",
"title": ""
}
] | [
{
"docid": "8b572ff8c0e4678a47fbe7c7669f72cb",
"score": "0.6348317",
"text": "def allocations\n @allocation_count_finish - @allocation_count_start\n end",
"title": ""
},
{
"docid": "dd5ac6bd88fb683e6b1d20b127d40d6f",
"score": "0.6282975",
"text": "def size\n @used - ... |
f5fe74f144a9279a8c575870f564beaf | Replicate this array to make a tiled array; this is the matlab function repmat. | [
{
"docid": "449dfd3220453ce0ce0af378af02a970",
"score": "0.7525296",
"text": "def tile(*reps)\n if dim == 0 || reps.member?(0)\n # Degenerate case: 0 dimensions or dimension 0\n res = NArray.new(typecode, 0)\n else\n if reps.size <= dim\n # Repeat any ... | [
{
"docid": "9af9e202f7ed94dddc02e0ff23d726ba",
"score": "0.6383687",
"text": "def tile_board\n board_array.each do |row|\n 9.times {row << Tile.new}\n end\n end",
"title": ""
},
{
"docid": "bdffe3ef63a349e9ca3901a876f8eb52",
"score": "0.6228689",
"text": "def deep_clone()... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "0e30b313c0a7cf558bc15315c6d58244",
"score": "0.0",
"text": "def object_rule_params\n params.require(:object_rule).permit(:load_object, :extract_object, :active, :is_primary, :custom_from_clause)\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... |
55f890e6acfd25b130247fd0cb93f1cd | Wait for some text to NOT be present (the wait in happenning browser side). | [
{
"docid": "ea9267ff35fb2466f84657502c6d835f",
"score": "0.83061564",
"text": "def wait_for_no_text(locator, original_text, timeout_in_seconds=nil)\n\t\t script = \"var element;\n\t\t try {\n\t\t element = selenium.browserbot.findElement('#{locator}');\n\t\t }... | [
{
"docid": "d98f4618a587db7a0cce6318aa47e1f9",
"score": "0.81923795",
"text": "def wait_for_text_not_present(text)\n assert !60.times{ break if (is_text_present(text) rescue false); sleep 1 }\n end",
"title": ""
},
{
"docid": "76f68dc8df1178688c42e0d9772eb940",
"score": "0.7807132",
... |
82dde71006ed24bd23d8a2c0c8279ab3 | GET /networks GET /networks.json | [
{
"docid": "1b1b3f051dde05de944d7cbe96f6a6ae",
"score": "0.61679024",
"text": "def index\n @networks = Network.all\n @json = Network.all.to_gmaps4rails do |network, marker|\n marker.json({ :id => network.id, :foo => network.name })\n end\n respond_to do |format|\n format.html # ind... | [
{
"docid": "551a3a68c06418ec69ab199c7f34a66b",
"score": "0.8014707",
"text": "def network_list\n @network_list ||= self.class.get(\"/networks/list.json\")\n end",
"title": ""
},
{
"docid": "a1cef6a133d4029bc6b00596ad3304da",
"score": "0.79410267",
"text": "def get_networks\n ... |
ca8d6b229491bacac477a707ad2179e5 | GET /pathfinder_classes GET /pathfinder_classes.json | [
{
"docid": "e4d484844bb52d1804794c908c478437",
"score": "0.7824572",
"text": "def index\n @pathfinder_classes = PathfinderClass.all\n end",
"title": ""
}
] | [
{
"docid": "5e7d8e2f03b5d8cde6405bbe563dc7c5",
"score": "0.68024284",
"text": "def classes\n load_and_get! :classes\n end",
"title": ""
},
{
"docid": "41b52a458d801b3768ea8b09ca96550c",
"score": "0.66428316",
"text": "def get_classpaths\n @classpaths.join(\":\")\n end",
"... |
19c27bd09b5e55e66661b96a43f02e33 | Same as superadminify, but modifies the User model for the directoryadmin role. Takes no arguments and returns nothing. | [
{
"docid": "493a4960c2a960cec37a65d93ad1cf5a",
"score": "0.70762694",
"text": "def directoryadminify\n without_access_control do\n User.module_eval do\n def role_symbols\n @role_symbols = [ :directoryadmin ]\n end\n end\n\n request.session[:auth_via] = 'cas'\n ... | [
{
"docid": "aea89cf0a3612f0d9d8e3c8bc6166489",
"score": "0.6749608",
"text": "def upgrade_to_main_user\n self.is_main_user = true \n self.save \n \n admin_role = Role.find_by_name(USER_ROLE[:admin]) \n self.add_role_if_not_exists(admin_role ) \n end",
"title": ""
},
{
"doci... |
e94cdb7449c58a6976f912dfdaff0d88 | Returns the users role This is used by the Declarative Authentication Gem | [
{
"docid": "042a97d423092cff97092d9225c539a8",
"score": "0.0",
"text": "def role_symbols\n return [role.name.to_sym]\n end",
"title": ""
}
] | [
{
"docid": "4c05874ac6b91e43fc38fba685169502",
"score": "0.8072596",
"text": "def user_role\n return @user_role\n end",
"title": ""
},
{
"docid": "4c05874ac6b91e43fc38fba685169502",
"score": "0.8072596",
"text": "def user_role\n return @user_r... |
224fedafd5b269e5581142c4baddad2e | def resolve_absolute_path(paths, filename, accept) if file_reader.respond_to?(:resolve_absolute_path) file_reader.resolve_absolute_path(paths, filename, accept, self) else super(paths, filename, accept) end end | [
{
"docid": "50186875260b805e5ea21e265bfae4d1",
"score": "0.0",
"text": "def load(uri, force_native = false)\n if file_reader.respond_to?(:load) && !force_native\n file_reader.load(uri, self)\n else\n super(uri)\n end\n end",
"title": ""
}
] | [
{
"docid": "1fa23f981e7fa65c03a4ed26ebba55b4",
"score": "0.85973394",
"text": "def resolve_absolute_path(paths, filename, accept); end",
"title": ""
},
{
"docid": "668a0c5381914b38d2ffb1a5231913e9",
"score": "0.75736314",
"text": "def resolve_absolute_path(paths, filename, accept)\n ... |
589f44af1e8b9c1cc8cb8bec7485af3c | Return value for a division exact date | [
{
"docid": "70d7bda9b7e1d182ab1cd4b40d05e02f",
"score": "0.66942054",
"text": "def get_invoices_value_division_date(division, date, value)\n invoices = Invoice.where([\"invoices.return = '0' AND company_id = ? AND division_id = ? AND date_processed >= ? AND date_processed <= ?\", self.id, division.id... | [
{
"docid": "31b3a9cb78b4ebe5bf7369b08c180b11",
"score": "0.6445936",
"text": "def get_invoices_value_exact_date(date, value)\n invoices = Invoice.where([\"invoices.return = '0' AND company_id = ? AND date_processed >= ? AND date_processed <= ? AND processed = '1'\", self.id, \"#{date} 00:00:00\", \"#... |
3e94aebb2b3d496ce54a14a9af602db7 | Todo: Add description for test test_string_enum_array | [
{
"docid": "1f2e2f5dec5f994b8f95353a6a0bad48",
"score": "0.8236285",
"text": "def test_string_enum_array()\n # Parameters for the API call\n days = JSON.parse('[\"Tuesday\", \"Saturday\", \"Wednesday\", \"Monday\", \"Sunday\"]')\n\n # Perform the API call through the SDK function\n result = ... | [
{
"docid": "4cc623be273afb6b9cc3ce5d7b2773f1",
"score": "0.7761564",
"text": "def test_send_string_enum_array()\n # Parameters for the API call\n days = APIHelper.json_deserialize(\n '[\"Tuesday\",\"Saturday\",\"Wednesday\",\"Monday\",\"Sunday\"]'\n )\n\n # Perform the API call through ... |
b450c0cf87fe9d2aec7a61e9eccba667 | generate the risc label lazily | [
{
"docid": "c98f7cde21317f81310620ecb4f002d5",
"score": "0.672923",
"text": "def risc_label(compiler)\n @risc_label ||= Risc.label(self,name)\n compiler.add_constant(@risc_label.address)\n @risc_label\n end",
"title": ""
}
] | [
{
"docid": "c3f15ce073440987181fd52b4c5aa56c",
"score": "0.6910688",
"text": "def next_label\n @codegen.next_label\n end",
"title": ""
},
{
"docid": "2851b4dfb07dc17037f9338ef57678e5",
"score": "0.6787092",
"text": "def generate_label\n self.label||= SecureRa... |
591eb278833b236d2ec1ebe243fe7a45 | Finds all relevant tokenized sentences to given input by comparing nonstopword token overlaps | [
{
"docid": "6b57222673c08a91a6b726c5df4a7e9c",
"score": "0.71652645",
"text": "def find_relevant(sentences, input)\n relevant = []\n slightly_relevant = []\n\n tokenized = NLP.tokenize(input).map(&:downcase)\n\n sentences.each do |sent|\n tokenized.each do |token|\n i... | [
{
"docid": "4d74bb02dc86252527d3a82b4e2a9075",
"score": "0.7302603",
"text": "def find_relevant(sentences, input)\n relevant = []\n slightly_relevant = []\n\n tokenized = NLP.tokenize(input).map(&:downcase)\n\n sentences.each do |sent|\n tokenized.each do |token|\n if sent.map { ... |
7fe28b82dffe2d016544abdb1720ea34 | Does nothing by default | [
{
"docid": "4004741b7c7db080cc3acf0994354ab9",
"score": "0.0",
"text": "def shutdown\n if @server.respond_to?(:stop)\n Log.dev \"Stopping @server\"\n @server.stop\n else\n Log.dev \"Cannot stop @server, skipping this step.\"\n end\n end"... | [
{
"docid": "0da88382807359d074ac704b066ec6ac",
"score": "0.8063765",
"text": "def noop\n\t\t# DO NOTHING\n\tend",
"title": ""
},
{
"docid": "b1f5e22274c9f8e637ac0b8c42229ee8",
"score": "0.7889762",
"text": "def do_nothing\n\tend",
"title": ""
},
{
"docid": "ddeb2ffb0515d3... |
5b5d61fb30bc0d14cf424c9d2bc9b376 | Send notification of new event | [
{
"docid": "c2e00f9c460ec17e8d3c0d5cb3ab3704",
"score": "0.76169163",
"text": "def notify_new_event(event)\n @event = event\n mail to: Settings['content_mail'],\n subject: I18n.t(\"mailers.content_list_mailer.notify_new_event\")\n end",
"title": ""
}
] | [
{
"docid": "22621dc1dc85f78130bd6781e4f21b67",
"score": "0.74152213",
"text": "def notify(event)\n @notifications.push event.message\n end",
"title": ""
},
{
"docid": "c4bb2fe50346b4c2fe426995237abbd2",
"score": "0.730021",
"text": "def new_event_notification(event, creator)\... |
473dcb68230f56339c78cbef634cd52b | DELETE /guide_ranges/1 DELETE /guide_ranges/1.json | [
{
"docid": "199fd786d9f6fd98ba46ae00e20de4b4",
"score": "0.8093939",
"text": "def destroy\n @guide_range = GuideRange.find(params[:id])\n @guide_range.destroy\n\n respond_to do |format|\n format.html { redirect_to guide_ranges_url }\n format.json { head :no_content }\n end\n end",... | [
{
"docid": "3f1ce073cdaa354888e697e98fce11f7",
"score": "0.69845855",
"text": "def destroy\n @iprange.destroy\n respond_to do |format|\n format.html { redirect_to ip_ranges_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bcadd4cf1de77e9a3... |
e1cc1e841efbdf4b8a43a4f14397f8a7 | GET /adverts GET /adverts.json | [
{
"docid": "4673645d4ccaf169775f574b36e2a1f2",
"score": "0.0",
"text": "def index\n flash[:alert] = Base64.decode64(params[:mf]) if params[:mf].present?\n if params[:keywordfilter].present?\n @adverts = current_user.adverts.select do |advert|\n advert.property.address.include? URI.unes... | [
{
"docid": "5c786380f0bf3538f0837ad888b37c65",
"score": "0.7539546",
"text": "def index\n @adverts = Advert.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @adverts.map(&:attributes) }\n end\n end",
"title": ""
},
{
"docid": "e2a... |
54df97a51ea0efcb00999bda8660abec | PATCH/PUT /varietes/1 PATCH/PUT /varietes/1.json | [
{
"docid": "b203917521c82b982e7ffd997c776744",
"score": "0.64622164",
"text": "def update\n respond_to do |format|\n if @variete.update(variete_params)\n format.html { redirect_to @variete, notice: 'Variete was successfully updated.' }\n format.json { render :show, status: :ok, loc... | [
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.65816104",
"text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.65816104",
"t... |
a025f4cd8dc522101238690335075ef3 | Are class variables scoped to the block they are accessed in? This is true in Ruby 1.9.2, but not 1.8.7 or 1.9.3... | [
{
"docid": "2ab7f1305074635d214f5e2a27bee974",
"score": "0.73452884",
"text": "def cvars_are_block_scoped?\n c = Class.new { def set_it!() @@cvar = :something end }\n c.new.set_it!\n begin\n remove_class_variable(:@@cvar) != :something\n rescue NameError\n true\n e... | [
{
"docid": "f47d1f0478c3ad31bbf204a9f60b55a8",
"score": "0.666061",
"text": "def class_variable\n @@class_variable\nend",
"title": ""
},
{
"docid": "6f15ce3061bed27ad323430a1140763d",
"score": "0.65713286",
"text": "def fix_class_reference\n d \"Searching for local var #{name}\"\... |
4cec342654f8b74b2e0610dc44b5293a | Complete the kangaroo function below. | [
{
"docid": "c3eb766ad3f2c3fe9b32ec2c69b115fd",
"score": "0.0",
"text": "def kangaroo(x1, v1, x2, v2)\n if (v1>v2) && (x2-x1)%(v1-v2) == 0\n 'YES'\n else\n 'NO'\n end\nend",
"title": ""
}
] | [
{
"docid": "be04cb55a462491abd1acf5950c83572",
"score": "0.67528266",
"text": "def jack_handey; end",
"title": ""
},
{
"docid": "ad244bd0c45d5d9274f7612fa6fee986",
"score": "0.67111963",
"text": "def suivre; end",
"title": ""
},
{
"docid": "4a8a45e636a05760a8e8c55f7aa1c76... |
7531927cfa7ef89ad62c52cfba937c5d | PATCH/PUT /tempdbs/1 PATCH/PUT /tempdbs/1.json | [
{
"docid": "ac32e12493ad39905579154bd96de9c7",
"score": "0.6117027",
"text": "def update\n respond_to do |format|\n if @tempdb.update(tempdb_params)\n format.html { redirect_to @tempdb, notice: 'Tempdb was successfully updated.' }\n format.json { render :show, status: :ok, location... | [
{
"docid": "b4fbe2bb4554c75214ec612a847f458e",
"score": "0.6320283",
"text": "def update_tenant_circle(args = {}) \n id = args['id']\n temp_path = \"/tenantcircles.json/{circleId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantcircleId\")\n args.delete(key)\n path = temp_path.... |
154951706467e25e6742b0e342df0495 | Generate the submit script and submit the job using qsub. | [
{
"docid": "48fa70985c22584909ca55bfdccd43c5",
"score": "0.7570188",
"text": "def submit_job\n unless inputfile_identifier.nil?\n set_version if version.nil?\n submit_script = generate_submit_script(input_deck: inputfile_identifier)\n\n if !submit_script.nil?\n Dir.chd... | [
{
"docid": "fa23f153b33f54ecbbf55b45bee27424",
"score": "0.78005725",
"text": "def submit_job\n input_deck = generate_input_deck\n # results_script = generate_results_script\n\n if !input_deck.nil? #&& !results_script.nil?\n submit_script = generate_submit_script(input_deck: input_... |
88e54ffcaeda41d20b426e589f73f2d7 | For internal use. Must be called with cache lock held Returns with the cache lock held must be unlocked by caller. | [
{
"docid": "32fae0dac64cec7f33fa1f2f263b7608",
"score": "0.0",
"text": "def dataStoresByMor_locked\n raise \"dataStoresByMor_locked: cache lock not held\" unless @cacheLock.sync_locked?\n return(@dataStoresByMor) if @dataStoresByMor\n dataStores_locked\n @dataStoresByMor\n end",
"title"... | [
{
"docid": "157d4a88a386243ea01f87cf394d4588",
"score": "0.7784103",
"text": "def cache; end",
"title": ""
},
{
"docid": "157d4a88a386243ea01f87cf394d4588",
"score": "0.7784103",
"text": "def cache; end",
"title": ""
},
{
"docid": "157d4a88a386243ea01f87cf394d4588",
"... |
4ff5519207af812f7a1dc3b9dd9e0268 | Sets the user status setting to Idle. | [
{
"docid": "f0e1d276bd6337d6da3448b55e5a6621",
"score": "0.7951741",
"text": "def idle\n update_profile_status_setting('idle')\n end",
"title": ""
}
] | [
{
"docid": "8c43c5e0ff7bdb5137bd844d0cadb9e2",
"score": "0.68231636",
"text": "def inactive!\n self.update_attribute(:status, ConfigCenter::User::INACTIVE)\n end",
"title": ""
},
{
"docid": "e74ce7711e37172ec53392e8f1906e33",
"score": "0.676814",
"text": "def set_idle\n self... |
51caf4f5ad35756b422327f8fde685db | GET /recipes GET /recipes.xml | [
{
"docid": "de3e8af64248df052b24c53a3a6b46ed",
"score": "0.652329",
"text": "def index\n\n @user = User.find(params[:user_id])\n\n @recipes = Recipe.where(:user_id => @user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @recipes }\n end... | [
{
"docid": "55108bc7f1d9b6763a7e81f13e8e557a",
"score": "0.7358593",
"text": "def index\n @recipes = Recipe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @recipes }\n end\n end",
"title": ""
},
{
"docid": "2b3646daea13e94b5fb... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "a25e7d8694a36b2fd38e30e8b1eb4553",
"score": "0.0",
"text": "def update!(**args)\n @hash_algorithm = args[:hash_algorithm] unless args[:hash_algorithm].nil?\n @memory_cost = args[:memory_cost] unless args[:memory_cost].nil?\n @rounds = args[:rounds] unless args[:rou... | [
{
"docid": "184b1b1ed771473d3eb9f338c0734c38",
"score": "0.73066413",
"text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end",
"title": ""
},
{
"docid": "5076c5a88404ae72986f958710f5687a",
"score": "0.72631145",
"text": "def update... |
b13d934fe40bdb8dd122e06324a75700 | This method: ensures that the env.attributes[:admin_set_id] is set ensures that the permission template for the admin set is correct | [
{
"docid": "8538da4b97742eed82f6aec7c0224a38",
"score": "0.7893988",
"text": "def ensure_admin_set_attribute!(env)\n # These logical hoops copy the prior behavior of the code;\n # With a small logical caveat. If the given curation_concern\n # has an admin_set_id, we now verify that... | [
{
"docid": "f272ce585a18b123b5943e7b46cc1a79",
"score": "0.83362037",
"text": "def ensure_admin_set_attribute!(env)\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n ... |
dd56f6722aede316293df14cf82fdccc | Purge all queues known to Msgr, if they exist. | [
{
"docid": "651f677c33c312d216bf37bc29454eda",
"score": "0.6128058",
"text": "def drain\n @routes.each do |route|\n connection.purge_queue(route.name)\n end\n end",
"title": ""
}
] | [
{
"docid": "b95b1133d87d3cc60cef0d2a1edbf156",
"score": "0.8085476",
"text": "def purge\n @queues = {}\n end",
"title": ""
},
{
"docid": "7978edd10a6dd8beb946f7d39f54e31d",
"score": "0.75796413",
"text": "def clear_all\n @queues&.values&.each { |e| e.clear }\n end... |
e0501af29c8832fac385a7b28436e010 | We take one argument variable. | [
{
"docid": "80c0343676b4e866fc796e6c72d75c71",
"score": "0.0",
"text": "def print_all(f)\n puts f.read\nend",
"title": ""
}
] | [
{
"docid": "36e8605673f311df96c775ecaf2fa4b9",
"score": "0.7613184",
"text": "def argue(argument)\n argument\nend",
"title": ""
},
{
"docid": "8981cff616213f94bbbe5ceac9b15223",
"score": "0.7267083",
"text": "def argue(argument)\n return argument\nend",
"title": ""
},
{
... |
b6329cd7b610c3a4369cf43b73d269db | =begin This function is used to get all buddies of an object. =end | [
{
"docid": "a383e83c9bdb7ea3c08ae44a927862bf",
"score": "0.62195086",
"text": "def fetch_all_buddies\n self.class.joins(:buddy_mappers).where(\"buddy_mappers.buddeable_child_id=?\", self.id)\n end",
"title": ""
}
] | [
{
"docid": "050af749c8c4e0a06661df99d446d8f5",
"score": "0.6558277",
"text": "def buys\n orders[:buys]\n end",
"title": ""
},
{
"docid": "050af749c8c4e0a06661df99d446d8f5",
"score": "0.6558277",
"text": "def buys\n orders[:buys]\n end",
"title": ""
},
{
"d... |
f2e2974568d66ba99734eb9b601fc9c6 | Gets the text associated to a th element. The element is select by its xpath. If not found an empty string is returned | [
{
"docid": "bd2c4689b8b595e4b04b5dc8f43313c5",
"score": "0.0",
"text": "def [](key)\n element = @xml.elements[key.to_s]\n\n return '' if (element && !element.has_text?) || !element\n\n element.text\n end",
"title": ""
}
] | [
{
"docid": "f49ca90ea716379198e5034e60bdd00e",
"score": "0.68636894",
"text": "def get_cell_text(header_index, row_index)\n rows[row_index].all('td')[header_index].text\n end",
"title": ""
},
{
"docid": "785bf6ea8eb8baca5a2695772436b05c",
"score": "0.6753946",
"text": "def fi... |
dc26a8acc96ff22eec6ffdf1c01343d3 | GET /mains/1 GET /mains/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "2eddf40549fdea0c53364ae2d6ab4524",
"score": "0.70973927",
"text": "def index\n @mains = Main.all\n end",
"title": ""
},
{
"docid": "ee2100d904729abc252dbe1a367b05b3",
"score": "0.63773036",
"text": "def index\n @main_items = MainItem.all\n end",
"title": ""
... |
7bfeb3c750d686cdb3a6482b3232962d | GET /jinetes/1 GET /jinetes/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "93d6831cbfefa126cfac81a1b04ce389",
"score": "0.69680095",
"text": "def index\n @jinetes = Jinete.all\n end",
"title": ""
},
{
"docid": "fe60c8394e21347279d541fcaf8983ce",
"score": "0.6408152",
"text": "def index\n @jems = Jem.all\n\n respond_to do |format|\n ... |
6ad87e2c06f4c2c6b6096f9c88a412e0 | Finds the specific place | [
{
"docid": "d9e5678d2dfa147a58a3129879953f23",
"score": "0.0",
"text": "def set_place\n @place = Place.find_by(id: params[:id])\n end",
"title": ""
}
] | [
{
"docid": "5c1a129c8633dd417785bce4373f646d",
"score": "0.6934181",
"text": "def find_location; end",
"title": ""
},
{
"docid": "1a5c9a47bb0a84437d50c83c8e5cc640",
"score": "0.69057935",
"text": "def locate(name); end",
"title": ""
},
{
"docid": "3015be70448d6abc0d00a7e8... |
7c02b2855bc96934ed80a426575f2603 | Send a command to the debconfcommunicate pipe and collect response | [
{
"docid": "c456f88e70409ea92a72913ab5fc14a0",
"score": "0.8133379",
"text": "def send(command)\n Puppet.debug(\"Debconf: send #{command}\")\n\n @pipe.puts(command)\n response = @pipe.gets(\"\\n\")\n\n raise(Puppet::Error, 'Debconf: debconf-communicate unexpectedly closed pipe') unle... | [
{
"docid": "961f209cff248ea961afad79da7c0dc5",
"score": "0.60666084",
"text": "def cliq_run command\n\n # Build shell command to run\n cmd = \"/usr/bin/sshpass -p #{@config['password']} /usr/bin/ssh -p 16022 Admin@#{@config['server']} '#{command} output=xml'\"\n\n # Open a process and run our c... |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "7239539f393277ea538f482620ef0cc9",
"score": "0.0",
"text": "def project_params\n params.require(:project).permit(:name, :status, :plan_start_time, :plan_end_time, :start_time, :end_time, :charge)\n end",
"title": ""
}
] | [
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.7121987",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.70541996",
"text": "def expected_permitted_parameter_names; end",
"title": "... |
ac1df5b77904a686064f2eeb626d87c9 | Check ARGV to see if someone asked for "console" | [
{
"docid": "0fa00454d800145dc36c435f307f0d44",
"score": "0.6389698",
"text": "def requesting_console?\n @requesting_console\n end",
"title": ""
}
] | [
{
"docid": "bbb841c9046518ecf32dc71479172fda",
"score": "0.7050839",
"text": "def commandline\n ui == \"commandline\"\n end",
"title": ""
},
{
"docid": "ca9d099d996c4b96d0e5e1f098fd93ac",
"score": "0.638266",
"text": "def console?\n defined?(::Rails::Console) && $stdout.... |
79af6bca438adb71acfee5a55d419a4c | Removes brackets and double quotes from the standard to_s function. | [
{
"docid": "fcf82094681eab96a7a8d4241e214ff0",
"score": "0.6457273",
"text": "def pretty\n to_s[1..-2].gsub('\"', '')\n end",
"title": ""
}
] | [
{
"docid": "baaf6365c628da5c8f3b508533bfa0a1",
"score": "0.6724384",
"text": "def to_s_without_spaces\n to_s.gsub(/\\s/, '')\n end",
"title": ""
},
{
"docid": "c4815b0c7d8eec2c6d267d31a1170c37",
"score": "0.6406237",
"text": "def to_s\n string_without_parentheses\n end",
... |
812a0d9b32076c53b0d990bf07fe0c63 | Get the prev node, or nil if none | [
{
"docid": "a3362199aab9575879bd2378673beccc",
"score": "0.72360283",
"text": "def prev\n if self[:prev_id]\n Likewise::Link.find_by_id self[:prev_id]\n end\n end",
"title": ""
}
] | [
{
"docid": "699eb435450de208579fe232ce89c491",
"score": "0.87997544",
"text": "def get_prev()\n return @prev_node\n end",
"title": ""
},
{
"docid": "14cfb309a76d4a7557255e81f7c49fed",
"score": "0.83871084",
"text": "def prev_element_of(node)\n\t\treturn valid(node) ? node.previou... |
1db3f61bc1ff647d2f8ec1d247be2706 | VirtualPath+ appends a virtual path fragment to this one to produce a new VirtualPath object. p1 = VirtualPath.new("/usr") VirtualPath:/usr p2 = p1 + "bin/ruby" VirtualPath:/usr/bin/ruby p3 = p1 + "/etc/passwd" VirtualPath:/etc/passwd This method doesn't access the file system; it is pure string manipulation. | [
{
"docid": "c8fe799e827ce3d2db7f86f9b5cd3fcb",
"score": "0.71370643",
"text": "def +(other)\n other = VirtualPath.new(other) unless VirtualPath === other\n VirtualPath.new(plus(@path, other.to_s))\n end",
"title": ""
}
] | [
{
"docid": "e6951d497c083e3166c04c5145047bb1",
"score": "0.65993357",
"text": "def join(*args)\n args.unshift self\n result = args.pop\n result = VirtualPath.new(result) unless VirtualPath === result\n return result if result.absolute?\n args.reverse_each {|arg|\n arg = V... |
6214ab9d195e5a392ae28cae61e84a1c | This method takes the shellcode generated so far and iterates through the chosen or compatible encoders. It attempts to encode the payload with each encoder until it finds one that works. | [
{
"docid": "a014d352f39fe81bf340bcc88128a75c",
"score": "0.7817422",
"text": "def encode_payload(shellcode)\n shellcode = shellcode.dup\n encoder_list = get_encoders\n if encoder_list.empty?\n cli_print \"No encoder or badchars specified, outputting raw payload\"\n return sh... | [
{
"docid": "5fbad11153f7531215dad3bfd26c6965",
"score": "0.81056964",
"text": "def encode_payload(shellcode)\n shellcode = shellcode.dup\n encoder_list = get_encoders\n cli_print \"Found #{encoder_list.count} compatible encoders\"\n if encoder_list.empty?\n shellcode\n el... |
371d447311f7a86c2f04699385f7379b | PATCH/PUT /receivers/1 PATCH/PUT /receivers/1.json | [
{
"docid": "45123f505f61061e87b181c76c5d42b1",
"score": "0.5861613",
"text": "def update\n if @receiver.update(receiver_params)\n redirect_to @receiver, notice: 'Receiver was successfully updated.'\n else\n render :edit\n end\n end",
"title": ""
}
] | [
{
"docid": "4e10c766131eb22cc68564a33b35a9ad",
"score": "0.6833986",
"text": "def update_new_receiver\n \n @receiver_added = Receiver.last\n $receivers << @receiver_added\n respond_to do |format|\n format.html\n format.json {render json: $receivers}\n end\n end",
"title": "... |
34a81e0bc7c7789e1ccc4aea0e534e1c | Standardize various ways of writing sp. nov. Convert to: Amanita "spT44" | [
{
"docid": "033a5114b78960265bb009b31ecc2613",
"score": "0.69658107",
"text": "def standardize_sp_nov_variants(name)\n words = name.split\n if words.length > 2\n genus = words[0]\n epithet = words[2]\n epithet.sub!(/^\"(.*)\"$/, '\\1')\n name = \"#{genus} \\\"sp-#{epithet}\\\"\... | [
{
"docid": "edc6059beb47fbace29a706ec88b2cd1",
"score": "0.6288173",
"text": "def standardize\n strip_and_squeeze.\n ampersands_into_text.\n into_ampersand_if_second_to_last.\n remove_indian_languages.\n remove_screening_details.\n replace_non_film_pre... |
e12710b5ded82c6bcab624497d854b32 | Associations with other models TODO: need to fix association with user belongs_to :user, foreign_key: "owner" | [
{
"docid": "7706d14e84ea544cde6b554e4ea70419",
"score": "0.0",
"text": "def initialize(attributes = {})\r\n attributes.each do |name, value|\r\n send(\"#{name}=\", value)\r\n end\r\n @record_id = nil\r\n end",
"title": ""
}
] | [
{
"docid": "7761b9d28779d527c44440ad5b28ea0b",
"score": "0.66869754",
"text": "def owner_association\n owner_ref(self).send(owner_association_name.to_sym)\n end",
"title": ""
},
{
"docid": "9889701f5d2a86807dd4e0b69a47db8f",
"score": "0.6295387",
"text": "def association_owne... |
7cd7daffe95fb4bbe2756a2756721b22 | Since we do some custom things related to the Rails asset path, make sure everything is hooked up and the production cachebused assets are served up. | [
{
"docid": "4bbe09fb203356a0ac63f40c838a08ed",
"score": "0.0",
"text": "def test_login_assets\n visit \"/admin/login\"\n assert_content(\"Admin Login\")\n\n # Find the stylesheet on the Rails login page, which should have a\n # cache-busted URL (note that the href on the page appears to be r... | [
{
"docid": "60048fb32bc8a2c48749411924b6f2cb",
"score": "0.687046",
"text": "def request_debug_assets?; end",
"title": ""
},
{
"docid": "60048fb32bc8a2c48749411924b6f2cb",
"score": "0.687046",
"text": "def request_debug_assets?; end",
"title": ""
},
{
"docid": "02d91c2342... |
b108bdb3d1556f9c65721227e92c19a8 | Returns the level in the tree where the node with the passed value is (integer) eg: Returns 1 if passed the root's value, 2 if passed one of its children's values, etc Returns nil if there is no node with passed value | [
{
"docid": "957a3df4a56b9c44848c893d9417e5c9",
"score": "0.8184417",
"text": "def level(value)\n current_node = @root\n tracker = 1\n\n until current_node.nil? || current_node.value == value\n tracker += 1\n current_node = current_node.value < value ? current_node.right : current_node... | [
{
"docid": "b03ea523ff09752fadb7e6c001fe29ad",
"score": "0.7334997",
"text": "def depth(value, node = root)\n return 0 if node.data == value # root node is 0 edges\n\n levels = 1 # Including root edge\n until node.nil?\n node = node.left if node.data > value\n node = node.right if nod... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "14c57cd8241533ad8235efca6e6e29a2",
"score": "0.0",
"text": "def correspondence_params\n params.require(:correspondence).permit(:email, :name, :team, :restaurant_id, :token)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69780594",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.678054",
"text": "def strong_params\n params.requi... |
f3f235e4f6e9d1b3874bd77f1cf27a73 | => Only pull this once per Poll Cycle | [
{
"docid": "2e5ab71f7ccd0e011252c1646fabb7e8",
"score": "0.0",
"text": "def overview\n @overview ||= rmq_manager.overview\n end",
"title": ""
}
] | [
{
"docid": "cb2e72278bc5763d380aea6f2a354399",
"score": "0.656573",
"text": "def poll(_) end",
"title": ""
},
{
"docid": "4ae20284714e2fd3a6e9f9afd38b51e3",
"score": "0.59085023",
"text": "def poll!\n find_and_process_next_available(messages)\n end",
"title": ""
},
{
... |
802e27ec2e5d423f6c10dbf3a5d1568c | PUT /posts/1 PUT /posts/1.json | [
{
"docid": "ae464d9b2165d2b18fb564047d601852",
"score": "0.6183895",
"text": "def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: '' }\n format.json { head :no_content }\n ... | [
{
"docid": "2a642a611c63a85b6ef6e72d09830e50",
"score": "0.73082465",
"text": "def update\n render json: Post.update(params[\"id\"], params[\"post\"])\n end",
"title": ""
},
{
"docid": "e2c68cadce474543233abd080997b452",
"score": "0.7122766",
"text": "def update\n respond_... |
4da2d6ca32bfde2c79d19fe995f1aa77 | Add more helper methods to be used by all tests here... Returns true if a test user is logged in. | [
{
"docid": "8f8d73281df0f661ca9caf77549cebd8",
"score": "0.0",
"text": "def logged_in?\n !session[:user_id].nil?\n end",
"title": ""
}
] | [
{
"docid": "d3bd31426cd1b5328cd0dc4c26964cbe",
"score": "0.7793476",
"text": "def user_logged_in?\n # Because helper methods are not available in tests,\n # we can’t use the `current_user` method,\n # but the `session` method is available.\n ! session[:user_id].nil?\n end",
"title": ""
... |
b657849b4d624a6d28fa18afb0dc0129 | Returns true if this activity has any muscle groups targeted, otherwise false | [
{
"docid": "d9095e3446168a8cec9b667270da91ec",
"score": "0.7480576",
"text": "def targets_any_group?\n self.muscle_groups.each_char do |c|\n return true if c == \"1\"\n end\n return false\n end",
"title": ""
}
] | [
{
"docid": "ee16842c6c54a6315405d41c7bd884ed",
"score": "0.75987595",
"text": "def targets_group? group\n index = Activity::MUSCLE_GROUP_VALUES.index(group)\n return false if index.nil?\n return false if muscle_groups[index] == \"0\"\n return true\n end",
"title": ""
},
{
"doci... |