query_id stringlengths 32 32 | query stringlengths 7 6.75k | positive_passages listlengths 1 1 | negative_passages listlengths 88 101 |
|---|---|---|---|
2159f2fd1551a518c0bb086c84667c62 | Simple Range SR CHECK N1: DATA RECORD in DATA CAMPAGNA | [
{
"docid": "07145554bf3ef2887e6cbf34746a86e4",
"score": "0.65979457",
"text": "def data_range(record)\n #carico la campagna attiva\n camp = Campagne.find(:first,:conditions => [\"active = true\"])\n #a meno che la data non rientri nel range della campagna\n unless record.data >= camp.inizio ... | [
{
"docid": "7eb9eaa1116abe8005377b29f33e7fb7",
"score": "0.5899247",
"text": "def test_raw_range_1\r\n r = GerbilCharts::Models::RawRange.new\r\n\r\n \t[10,20,10,0,0,1001,19920,882991.22].each do |v|\r\n\t\tr.update v\r\n\tend\r\n\r\n\tr.min_max do |mn,mx|\r\n \tassert mn==0\r\n\t\tassert mx==882... |
11dfecc53539a6916e4ad37cdfc43cc9 | Deprecated: Iterate over all logical paths with a matcher. Remove from 4.x. args List of matcher objects. Returns Enumerator if no block is given. source://sprockets//lib/sprockets/legacy.rb79 | [
{
"docid": "fda0665d07e3652c4008c1299881bb41",
"score": "0.67417854",
"text": "def each_logical_path(*args, &block); end",
"title": ""
}
] | [
{
"docid": "ce477e50a26c53bfd4dfbeb6564900a7",
"score": "0.728574",
"text": "def each_logical_path(*args, &block)\n return to_enum(__method__, *args) unless block_given?\n\n filters = args.flatten.map { |arg| Manifest.compile_match_filter(arg) }\n logical_paths.each do |a, b|\n if ... |
d8f6412c38dcd39d6126eb172f77212f | ==Metodo multiplicacion Multiplica dos matrices ya sean densas o dispersas | [
{
"docid": "65a756df1fa867e010229d372c0337f6",
"score": "0.6349913",
"text": "def *(other)\n\t\tif(@fil == other.col)\n\t\t\tmult = Matriz.new(@fil, other.col)\n\t\t\tmult.fil.times do |i|\n\t\t\t\tmult.col.times do |j|\n\t\t\t\t\tmult[i,j]= 0\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t@fil.times do |i| \n\t\t\t\... | [
{
"docid": "5554b267ca9c5fe285b16de1effcd962",
"score": "0.7607977",
"text": "def *(other)\r\n #Si el multiplicador es una constante numerica, es decir, un escalar se multiplica miembro a miembro de la matriz\r\n if(other.is_a? Numeric)\r\n c = Array.new(@m){Array.new(@n){0}}\r\n for i in... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "1f91f36d7c9801bc05d3910f32fb1c4a",
"score": "0.0",
"text": "def set_analytics_models_log\n @analytics_models_log = AnalyticsModelsLog.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... |
3d5c79d527d277ec26a35766f5021c8b | rajoute le bonus de l'arme a la valeur d'attaque | [
{
"docid": "4fb31123035f85e03233e2469343c935",
"score": "0.0",
"text": "def compute_damage\n return rand(1..6) * @weapon_level\n end",
"title": ""
}
] | [
{
"docid": "d76c6d74ea581ce661d54a310f3984f6",
"score": "0.7416835",
"text": "def give_bonus\n\t\t@bonus = 0.1\n\tend",
"title": ""
},
{
"docid": "c83f6746ef51c860fcfc18708fdae593",
"score": "0.70931345",
"text": "def bonuscalc\n self.bonus = money * 0.1\n end",
"title": ""
... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "ebedee1ebb4ae6adef65a8d185cb8a79",
"score": "0.0",
"text": "def asignar_departamento_usuario_params\n params.require(:asignar_departamento_usuario).permit(:usuario_id, :departamento_id, :empresa_id, :user_id)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74939764",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6955084",
"text": "def strong_params\n params.require(:request).permit(param_whit... |
f8babe858a3199e36322965c714e8318 | EXPERT Return the one integer in an array that is even or odd while the rest are of opposite parity, e.g. oddball([1,2,3]) => 2, oddball([2,4,5,6] => 5) | [
{
"docid": "31edcc00f1ba72d1c2aeaef970f43958",
"score": "0.7688899",
"text": "def oddball(arr)\n even_num = []\n odd_num = []\n arr.each_with_index do |el, idx|\n if el.odd?\n odd_num << el\n else\n even_num << el\n end\n end\n\n if even_num.length == 1\n return even_num[0]\n ... | [
{
"docid": "e0c8087b606086895463502e862b28f4",
"score": "0.8088978",
"text": "def odd_integers(array)\n array.select { |num| num.odd? }\nend",
"title": ""
},
{
"docid": "e0c8087b606086895463502e862b28f4",
"score": "0.8088978",
"text": "def odd_integers(array)\n array.select { |num|... |
cd6e3dfa193d43676716b49af3a32261 | If it is greater than or equal to 10, sum the digits of the resulting number. Keep repeating until there is only one digit in the result, called the "digital root". Do not use string conversion within your method. | [
{
"docid": "4b1637cd1ef4653452c5eff7ee3c01c3",
"score": "0.780147",
"text": "def digital_root(num)\n# sum variable \n# while loop => num > 0 \n# mod 10 add that to the sum var \n# div num by ten and reassign to num \n# check if sum >= 10 => digital_root(newNum) => return this\n\n sum = 0\n while num >... | [
{
"docid": "71ecb2a8d257de81d714b57c9a94c7b7",
"score": "0.8185717",
"text": "def digital_root(n)\r\n while n > 9\r\n n = n.digits.inject(:+)\r\n end\r\n n\r\nend",
"title": ""
},
{
"docid": "5d6d45c67494a9cc877c3397f82e5eb2",
"score": "0.81728065",
"text": "def digit... |
0c2698ebfadbab6290832d2f5b8b0ad2 | do we need this? why not... | [
{
"docid": "a952ec97d7bc06b09c33746710bf8aee",
"score": "0.0",
"text": "def transpose\n new_data = (0...num_cols).map{ Array.new(num_rows) }\n each_index do |i,j|\n new_data[j][i] = @data[i][j]\n end\n DataFrame.new(new_data, col_names, row_names)\n end",
"title": ""
}
] | [
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.7102083",
"text": "def desired; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.68857914",
"text": "def used; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
... |
8a2ff85e2afe4e44a05e4c4f261eb139 | GET /question_results/1 GET /question_results/1.xml | [
{
"docid": "42b90342cd24a0f5e30fa38726b81558",
"score": "0.7177011",
"text": "def show\n @question_result = QuestionResult.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @question_result }\n end\n end",
"title": ""
}
] | [
{
"docid": "02ff7906ac90795b3cb8ef55a3d94ed7",
"score": "0.7085778",
"text": "def index\n @question_responses = QuestionResponse.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @question_responses }\n end\n end",
"title": ""
},
{
... |
560e8dd240a8d7990048fa5a6f491fc7 | Set the value of the IfMatch input for this Choreo. | [
{
"docid": "63733be3c57d3c1d5c93006d6189e34f",
"score": "0.76993597",
"text": "def set_IfMatch(value)\n set_input(\"IfMatch\", value)\n end",
"title": ""
}
] | [
{
"docid": "90adceef03f50fbb0a99df9fa973bbdc",
"score": "0.7750346",
"text": "def set_IfMatch(value)\n set_input(\"IfMatch\", value)\n end",
"title": ""
},
{
"docid": "90adceef03f50fbb0a99df9fa973bbdc",
"score": "0.7748227",
"text": "def set_IfMatch(value)\n ... |
d984677f7ff5dbdcf5e815b59bebdf81 | List Users A Zoom account can have one or more users. Use this API to list users on your account. Note: Starting August 18, 2019, if an account holds more than 5000 users, the response data will no longer be sorted by email. Scopes: &x60;user:read:admin&x60; | [
{
"docid": "5fce6dc87673033bea75beeab80f63ee",
"score": "0.0",
"text": "def users_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UsersApi.users ...'\n end\n if @api_client.config.client_side_validation && opts[:'status'] ... | [
{
"docid": "ce170bfc491a0365c151cd26d9085bd0",
"score": "0.8130701",
"text": "def list_users(params = nil, headers = nil)\n get(\"/api/v2/users\", params, headers)\n end",
"title": ""
},
{
"docid": "1e41c5f46776839be1e0cf9c5a937104",
"score": "0.7976833",
"text": "def list_us... |
89efa07bcd05b8d87ed8e5158e1c3420 | TODO: Require all query objects when autoloading. | [
{
"docid": "0e4fd2d45ad8e0622c9ca80ce4253da9",
"score": "0.0",
"text": "def geometry_query\n ::UnderlyingGeometryQuery.new( geometry.to_json )\n end",
"title": ""
}
] | [
{
"docid": "bae1084159f766f9837b4a20e212c2cf",
"score": "0.69586045",
"text": "def define_queries; end",
"title": ""
},
{
"docid": "4241b3d4fd233000708fd6bbea00f693",
"score": "0.6877068",
"text": "def load\n exec_queries unless loaded?\n\n self\n end",
"title": ""
... |
49f56bdfc656378a6167078bc65841f7 | Check if a file is a symlink. NOTE: This can be converted to allowing even in safe, since we use Pathutilin_path? now. | [
{
"docid": "82a734d600db5f9c7a800a44a1eb628f",
"score": "0.8020224",
"text": "def symlink?(entry)\n site.safe && File.symlink?(entry) && symlink_outside_site_source?(entry)\n end",
"title": ""
}
] | [
{
"docid": "5450b30eecb5e37bd1d18e6e50d95279",
"score": "0.8543446",
"text": "def symlink?(path)\n GLib.g_file_test(path, GLib::GFileTest::G_FILE_TEST_IS_SYMLINK)\n end",
"title": ""
},
{
"docid": "6b4e4d2a99ae427d9fee227ad54d6819",
"score": "0.85346425",
"text": "def symlink?(fi... |
8b9dc999b981a9b4f14adbc405ab807d | most_recent_recipe should return the recipe most recently added to the user's cookbook. | [
{
"docid": "412372d4ae8989f222ece4568f0b9a54",
"score": "0.75525004",
"text": "def most_recent_recipe\n self.recipe_cards.last.recipe.name\n end",
"title": ""
}
] | [
{
"docid": "ec2f106847be5fe99f086070fdc1b6b9",
"score": "0.82663",
"text": "def most_recent_recipe\n most_recent_recipe = RecipeCard.all.select do |recipes|\n recipes.user == self\n most_recent_recipe.last\n end\n end",
"title": ""
},
{
"docid": "83637a067fa7b80a4a... |
9d6c10ec166b0ecaeed4b75501a32b5e | test cases if are_anagrams("mean","mean") == true puts "true" else puts "false" end if are_anagrams("mean","neam") == true puts "true" else puts "false" end if are_anagrams("naem","neam") == true puts "true" else puts "false" end if are_anagrams("lots of things","of lots things") == true puts "true" else puts "false" e... | [
{
"docid": "f4f7b52e8c45ea671898103f59e23fb3",
"score": "0.0",
"text": "def missing(string)\nnormalchars = \"abcdefghijklmnopqrstuvwxyz\".split('')\n# .squeeze removes duplicate characters\nsortstring = string.split('').sort.join.squeeze\n\tmissingchars = []\n\ti = 0\n\twhile i < normalchars.length\n\t\... | [
{
"docid": "59ee7ec58c998b700eb5cd741fa6abdc",
"score": "0.7920927",
"text": "def are_anagrams?(word1, word2)\n return false unless word1.length == word2.length\n\n word1.split(\"\").each do |char1|\n included = false\n word2.split(\"\").each do |char2|\n included = true if char1 == char2\n... |
57e77c1befcbc79c4275ab8788c83941 | if user is logged in, return current_user, else return guest_user | [
{
"docid": "dc9b439921803869ee7d9eab42d25c24",
"score": "0.7838403",
"text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end",
... | [
{
"docid": "609284527cf3af1acad5af51e7ea333a",
"score": "0.88830566",
"text": "def current_or_guest_user\n if current_user\n current_user\n else\n guest_user\n end\n end",
"title": ""
},
{
"docid": "609284527cf3af1acad5af51e7ea333a",
"score": "0.88830566",
"text":... |
13ef296107b37e0bba204301bb0aef48 | called by the filter before calling destroy | [
{
"docid": "0b2d87288c287651fd1c30bc2a1cf945",
"score": "0.0",
"text": "def admin_user\n redirect_to(root_path) unless user_signed_in? and current_user.admin?\n end",
"title": ""
}
] | [
{
"docid": "95d5b6961ebea5f990561d74d1c94364",
"score": "0.74240625",
"text": "def before_destroy() end",
"title": ""
},
{
"docid": "b9d8b8fce19d4df2d2be0d28398068f6",
"score": "0.69440854",
"text": "def destroyed?; end",
"title": ""
},
{
"docid": "b9d8b8fce19d4df2d2be0d2... |
d387fb37b007e725b392d0fcf9aa6f3f | TODO: replace `eval` with `Class.new` | [
{
"docid": "26eb9ad759cf9a82ec080e4d0fcaa3dc",
"score": "0.0",
"text": "def register_resource_controller(config)\n eval \"class ::#{config.controller_name} < ActiveAdmin::ResourceController; end\"\n config.controller.active_admin_config = config\n end",
"title": ""
}
] | [
{
"docid": "8e95772a68908d578016ef7dd60ba1b7",
"score": "0.74320734",
"text": "def instance_eval\n end",
"title": ""
},
{
"docid": "b4623657eb0e5b526496f18a1213e441",
"score": "0.69300306",
"text": "def to_klass (sym)\n\t\tputs \"eval #{sym.to_s}\"\n\t\teval sym.to_s\n\tend",
... |
8100c761eabc0ae3cfb42292b236fbbd | Provides operations to manage the connectedOrganizations property of the microsoft.graph.entitlementManagement entity. | [
{
"docid": "0cd188b02911b8b48b8adc8a14458a10",
"score": "0.7163883",
"text": "def connected_organizations()\n return MicrosoftGraph::IdentityGovernance::EntitlementManagement::ConnectedOrganizations::ConnectedOrganizationsRequestBuilder.new(@path_parameters, @request_adapter)\n ... | [
{
"docid": "897f1ebb197a0fe0cc48de0a30e2aa80",
"score": "0.62586683",
"text": "def managed_organizations\n if principal.try(:is_admin_or_instance_manager?)\n Organization.all\n else\n members_management_roles = roles.select do |role|\n role.has_permission?(:manage_members)\n ... |
413a0d57423a8b1b9f489f5421fcddc2 | PUT /agenda_types/1 PUT /agenda_types/1.json | [
{
"docid": "cc0d1b7cd7085243747dd2b0952fc0ac",
"score": "0.7414105",
"text": "def update\n @agenda_type = AgendaType.find(params[:id])\n\n respond_to do |format|\n if @agenda_type.update_attributes(params[:agenda_type])\n format.html { redirect_to @agenda_type, :notice => 'Agenda type ... | [
{
"docid": "2a559dcc492323393a3ed8e923f21d9b",
"score": "0.64262515",
"text": "def create\n @agenda_type = AgendaType.new(params[:agenda_type])\n\n respond_to do |format|\n if @agenda_type.save\n format.html { redirect_to @agenda_type, :notice => 'Agenda type was successfully created.'... |
f40f24ebb680e2a7efe6a490cae962ac | GET /mirrors GET /mirrors.json | [
{
"docid": "75243126e0794d56a89f8bb25e08b970",
"score": "0.7511286",
"text": "def index\n @mirrors = Mirror.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mirrors }\n end\n end",
"title": ""
}
] | [
{
"docid": "779bc223cd8cced75a9539406d22c902",
"score": "0.7279424",
"text": "def index\n @mirrors = Mirror.all\n end",
"title": ""
},
{
"docid": "6e9460768a5ef7efeb7de759c1bea444",
"score": "0.6572614",
"text": "def mirrors\n response = self.get_with_key('mirrors.xml')\n ... |
f52a17b8fa75d272580f1bad92ef3853 | Public: Publish a retrying event to retrial queue. Returns nothing. | [
{
"docid": "50713de5652e67f0a27cd38b5632a376",
"score": "0.5204888",
"text": "def publish(payload, delivery_info, properties)\n if !properties[:headers]\n Hightops::Connection.instance.channel.default_exchange.publish(payload, routing_key: retry_queue_naming.to_s, content_type: 'application/... | [
{
"docid": "16fccb461f4ffc5262f4cee48ed2fd42",
"score": "0.6528725",
"text": "def on_retry\n keyword = consume_keyword(:retry)\n\n Retry.new(location: keyword.location)\n end",
"title": ""
},
{
"docid": "c1c2af3c258a2c1489e81e95ce32e1b4",
"score": "0.6383595",
"text": "d... |
b9d590a2fa098eef16496c3283887b89 | DELETE /bills/1 DELETE /bills/1.json | [
{
"docid": "e3a3e94ba1cfc26c8b36dc994d29f9d9",
"score": "0.0",
"text": "def destroy\n @bill = Bill.find(params[:id])\n @monthlybill = @bill.monthlybill\n @bill.destroy\n\n respond_to do |format|\n format.html { redirect_to monthlybill_bills_path }\n #format.html { redirect_to @day.... | [
{
"docid": "6d4db9d1512f30356c3ada2d0724fb6f",
"score": "0.7336548",
"text": "def destroy\r\n @bill = Bill.find(params[:id])\r\n @bill.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to bills_url, only_path: true }\r\n format.json { head :no_content }\r\n end\r\n ... |
ff4a0b4b8b13073fb20dc7dc4021337d | game name, in quicklisting form | [
{
"docid": "65cf7e832b2da287dae93724b8591710",
"score": "0.0",
"text": "def listing\n \"[\\##{id}] \\\"#{name}\\\"\"\n end",
"title": ""
}
] | [
{
"docid": "40907543bed6077b60c9c94c288e52c7",
"score": "0.7160774",
"text": "def name\n :game\n end",
"title": ""
},
{
"docid": "f65e999a7773edb31b684b40ffc683ad",
"score": "0.70596296",
"text": "def name\n \"game_#{id}\"\n end",
"title": ""
},
{
"docid":... |
57362e16265556a5dc8c4d57542e646f | Does the hash match the tokens? Uses the same tokens that were used to encrypt. | [
{
"docid": "8c0b745124e311da6b4f2d1d4a49c18f",
"score": "0.6835675",
"text": "def matches?(hash, *tokens)\n hash = new_from_hash(hash)\n return false if hash.blank?\n hash == join_tokens(tokens)\n end",
"title": ""
}
] | [
{
"docid": "3b165c851b8bc5cc8fd8b2cf297128a7",
"score": "0.75806504",
"text": "def matches?(hash, *tokens)\n hash = new_from_hash(hash)\n\n #return if the hash is nil or empty to save time\n return false if hash.nil? || hash == {}\n\n tokens = tokens.first # we no lon... |
5ca66d8599e5e86d9c8d2795f4c94034 | Return the URL to the CAS login page | [
{
"docid": "7e3ab72138625b3f9a5558731c737b01",
"score": "0.8227336",
"text": "def login_url\n Client.cas_url(:login, :service => @service_url)\n end",
"title": ""
}
] | [
{
"docid": "af7875b847b9d55f404cf153c18872d2",
"score": "0.866282",
"text": "def login_url\n \"#{cas_server_url}/login\"\n end",
"title": ""
},
{
"docid": "74a69729cf82929e2ad9f713b10d5598",
"score": "0.7652926",
"text": "def login_url(service_url=request.url)\n url ... |
114abad897d856212d5deade6d9745d5 | Shows the items in this inventory to a GameObject. Returns a string to output. | [
{
"docid": "97c4636aeb7f041db2026c1b52f77363",
"score": "0.0",
"text": "def show(observer, short_description = false, empty_value = \"\")\n names_shown = []\n ids_shown = []\n lines = []\n targets = observer.target( list: items, quantity: \"all\")\n if targets.nil? || ... | [
{
"docid": "06271d8aaeec5a65655fb062fd55199e",
"score": "0.8261239",
"text": "def show_inventory\n\t\tinsert_text(\"Your inventory contains the following items:\\n\")\n\t\t@player.inventory.inventory.each_with_index do |item, i|\n\t\t\tinsert_text(\"Inventory slot #{i + 1}\")\n\t\t\tinsert_text(item.to_... |
c92e04cd94969fe166bc5e610f424d52 | Exists the value with key | [
{
"docid": "e4703fc0b431b3a0503e28e8d139cbd0",
"score": "0.0",
"text": "def key?(key, options = {})\n @adapter.key?(key, options)\n end",
"title": ""
}
] | [
{
"docid": "c5546ae33174adc28af59e88704a73ef",
"score": "0.82805073",
"text": "def exist?(key)\n @hash.include?(key)\n end",
"title": ""
},
{
"docid": "d11282911e9fdf08a2a8ff746f393da5",
"score": "0.8265078",
"text": "def exist?(key); end",
"title": ""
},
... |
994d64a38b192c7599703ba22a5570f9 | Only permits admin users | [
{
"docid": "7c271bd9b68de6b48c87e70de7f7ec1b",
"score": "0.7668168",
"text": "def require_admin!\n authenticate_user!\n\n if current_user && !current_user.admin?\n redirect_to root_path\n end\n end",
"title": ""
}
] | [
{
"docid": "cddbbcba67515b929fcc04c04f771eec",
"score": "0.85660857",
"text": "def admin_only!\n authenticate_user! && begin\n forbidden unless current_user.admin?\n end\n end",
"title": ""
},
{
"docid": "c5095a4918b2f55019d0956a22af4137",
"score": "0.8522955",
"text": "d... |
9f19cbeae3367abb060cd32c43ba6afd | Sum all contiguous positive numbers Sum all contiguous negative numbers Returns an array with alternating postive and negative numbers | [
{
"docid": "ab9d10eec4232662ffe3abde92e57890",
"score": "0.6465022",
"text": "def simplify_array(array)\n simpler_array = Array.new\n is_positive_number = nil\n\n cumulative_sum = 0\n array.each do |number|\n if is_positive_number.nil? || is_positive_number == (number >= 0)\n ... | [
{
"docid": "e61b8e6a9c2161925da21bb44e3f5374",
"score": "0.7296967",
"text": "def positive_sum(arr)\n sum = 0\n arr.each do |number|\n if number > 0\n sum += number\n end\n end\n sum\n end",
"title": ""
},
{
"docid": "4fb477aad1be9c746ae43859d4a9c08e",
"sc... |
d1a5d9ea6caa7700e74c3d29c50d2c5b | DELETE /rncs/1 DELETE /rncs/1.json | [
{
"docid": "c21ca0989c59e7ecd330254bf7d2a18d",
"score": "0.6639561",
"text": "def destroy\n @rnc.destroy\n respond_to do |format|\n format.html { redirect_to rncs_url, notice: 'Rnc was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "4c1c164b581dbae14285797e584e8fb7",
"score": "0.70111907",
"text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "689d5a07a403c4b765ba178e4aff08a3",
"score": "0.6905687",
"text": "def delet... |
5654b25d2f217455f90963edf6c212e3 | Returns file number of thumbnail file depending on metadata | [
{
"docid": "f6e4ce6896358a303212d23a1fb445b1",
"score": "0.74451435",
"text": "def thumbnail_file\n # Find the first TitlePage if one exists\n if metadata_hash[\"image_metadata\"].nil?\n return nil\n end\n\n image_obj = metadata_hash[\"image_metadata\"].select {|x| x[\"logical\"] == \"T... | [
{
"docid": "33d7e1e727c44624c591b2216ef1c0c3",
"score": "0.653375",
"text": "def thumbnail_file_name\n return FILE_PREFIX + id.to_s + \".jpg\"\n end",
"title": ""
},
{
"docid": "4646d205d0f7a4f8f87f83cc74e81ca0",
"score": "0.6310006",
"text": "def first_image_index_record_number\... |
cb279a70035a799e00c73533303a2577 | Writes the +stop_lock+ file and changes its ownership to the gear user. | [
{
"docid": "a67965af1e9776b4aea7f911a5d98d1e",
"score": "0.74419296",
"text": "def create_stop_lock\n unless stop_lock?\n File.new(stop_lock, File::CREAT|File::TRUNC|File::WRONLY, 0644).close()\n @container.set_rw_permission(stop_lock)\n end\n end",
"title": ""
... | [
{
"docid": "aa323b338053ceaed38fbd51955c07a6",
"score": "0.6729951",
"text": "def lock()\n FileUtils.touch(@my_lock)\n end",
"title": ""
},
{
"docid": "45676b9a2a5804d07ce0d4fdafa68604",
"score": "0.64082175",
"text": "def lock\n if @locking\n @locking_file = Fil... |
fd897534f9dabe706945c3cdd958ab81 | Since we only support searches by unique indexes, we always return an empty array for not found, or an array with the found element. | [
{
"docid": "2f4cfc4ef4b0b647a12066590c0cf0ae",
"score": "0.0",
"text": "def find_with_options(options)\n conditions, order, limit, offset = extract_conditions!(options)\n index, key = conditions_to_view_and_key(conditions)\n if index.nil?\n raise \"Find without conditions not suppo... | [
{
"docid": "4c22991f3e6eae77a0fbf5b91f101244",
"score": "0.64059305",
"text": "def find_elements(element_name, element_array, original_array)\n @result_index = []\n element_array.each_index { |e| @result_index << original_array.at(e) if element_array.at(e) == element_name.to_s }\n return @result_inde... |
9e25d4440ab1999386d911d16791a823 | The deserialization information for the current model | [
{
"docid": "eb4186a967ae10d9c43876bf6871467a",
"score": "0.0",
"text": "def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"rules\" => lambda {|n| @rules = n.get_collection_of_object_valu... | [
{
"docid": "613f62eeb3655523fae5d548dc6e7875",
"score": "0.6580273",
"text": "def get_field_deserializers()\n return {\n \"downloadUrl\" => lambda {|n| @download_url = n.get_string_value() },\n \"fileName\" => lambda {|n| @file_name = n.get_string_val... |
849e207582670fc342ed9b9890250a0b | This way, we keep these methods separated from other potential parts of the program | [
{
"docid": "c08bce83f1b235003e0f72aedb5c3cf7",
"score": "0.0",
"text": "def selection_criteria?(candidate)\n experienced?(candidate)\n enough_points?(candidate)\n knows_languages?(candidate)\n current_application?(candidate)\n old_enough?(candidate)\nend",
"title": ""
}
] | [
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.66300017",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.66300017",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a... |
fc53c56d6ee4e75027ac7aae46ae6911 | Clicks a radio button or checkbox and toggles it state | [
{
"docid": "071b38bbee5640914cd860fc4936f0ff",
"score": "0.722434",
"text": "def toggle_with_click\n click\n \n # Cheat since we don't have an even yet \n sleep(0.1)\n\n element(true).isSelected\n end",
"title": ""
}
] | [
{
"docid": "9ae398eb42a65fd83c6d08b4bcdcb1ae",
"score": "0.69064504",
"text": "def uncheck\r\n self.click if checked?\r\n end",
"title": ""
},
{
"docid": "a2524ffa26e8221357892f4a918df53a",
"score": "0.6905236",
"text": "def click(event)\n status.present = event.target.checked... |
d468c5c5cb1765bc1f44e3b3438447d2 | Called when annotation is used | [
{
"docid": "31728e9e811dd3248d825f06f4a7e468",
"score": "0.0",
"text": "def call(this, *args, &blk)\n set(\"#{this.owner}##{this.name}\", date: normalize_datetime(@date))\n this.call(*args, &blk)\n end",
"title": ""
}
] | [
{
"docid": "d7d962a997306a2d5bad6c2a9bfaf11d",
"score": "0.82364446",
"text": "def annotation; end",
"title": ""
},
{
"docid": "d7d962a997306a2d5bad6c2a9bfaf11d",
"score": "0.82364446",
"text": "def annotation; end",
"title": ""
},
{
"docid": "d7d962a997306a2d5bad6c2a9bfa... |
ccfbede2be092c260d482a1b822bdb5f | Displays the result of yielding if the log level is Logger::FATAL or greater. | [
{
"docid": "05b7250ed8c6c3cc178ccb59c3e7570e",
"score": "0.6858051",
"text": "def fatal\n logger.add(Logger::FATAL, nil, facility) { yield } if logger\n end",
"title": ""
}
] | [
{
"docid": "91d25ff6a478a0982a3d2be888ae20df",
"score": "0.6900394",
"text": "def silently\n old_level = LOGGER.level\n LOGGER.level = Logger::FATAL\n ret = yield\n LOGGER.level = old_level\n ret\n end",
"title": ""
},
{
"docid": "a80e0e5c0a0570c9ceacbdfeb794bc8e"... |
2a2c8267109fb99eae44f457b5b52f25 | DELETE /trumpets/1 DELETE /trumpets/1.json | [
{
"docid": "f88b9c7a15fb10b531d3a1035e0bf6eb",
"score": "0.7123497",
"text": "def destroy\n @trumpet.destroy\n respond_to do |format|\n format.html { redirect_to trumpets_url, notice: 'Trumpet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title"... | [
{
"docid": "67dceeec17f01bb8b455018111b8aa0e",
"score": "0.74147016",
"text": "def destroy\n @trumpet = Trumpet.find(params[:id])\n @trumpet.destroy\n\n respond_to do |format|\n format.html { redirect_to trumpets_url }\n format.json { head :no_content }\n end\n end",
"title": ... |
9b2623493fc0edc4f030ef0860cbbf18 | Add inline formatting to the given element. The inline formatting is meant to be interpreted by prawn. | [
{
"docid": "04ec6af7d14b0ff927b21991c69afed4",
"score": "0.71972954",
"text": "def inline_format(element, style = {})\n (style[:style] || []).each do |s|\n element = content_tag(element, tag_name(s))\n end\n # TODO: CYMK support\n element = content_tag(element, :color, rgb: style[:color... | [
{
"docid": "805b9488001d8dffb63c2c7648e77081",
"score": "0.70497257",
"text": "def add_inline_style(content)\n add_style(:inline, content)\n end",
"title": ""
},
{
"docid": "063672cfd9e7db562e53cd35460371ca",
"score": "0.6542014",
"text": "def format_inline_text(t... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "a8e1c14d359c7005009d3f4bbfd63c56",
"score": "0.0",
"text": "def update!(**args)\n @event_type = args[:event_type] if args.key?(:event_type)\n @failure_policy = args[:failure_policy] if args.key?(:failure_policy)\n @resource = args[:resource] if args.key?(:resource)... | [
{
"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... |
1e281b8be9bbfdc4f44b356178c8fd84 | POST /desks POST /desks.json | [
{
"docid": "a3b0b1a3480899cb837bd615dfdd64f8",
"score": "0.66070265",
"text": "def create\n @desk = Desk.new(desk_params)\n\n respond_to do |format|\n if @desk.save\n @slot = Slot.where(name: @desk.desk).first\n @slot.update_attribute(:status, false)\n format.html { redir... | [
{
"docid": "58c4327f035096825679cb5ae025d3b1",
"score": "0.71932644",
"text": "def create\n @desk = Desk.new(desk_params)\n\n respond_to do |format|\n if @desk.save\n format.html { redirect_to @desk, notice: 'Desk was successfully created.' }\n format.json { render :show, status... |
46ee0113ad1a1d4747bbdf4e62ffb5be | record_delete compares PID of entry accepted and removes it's associated logout, if there is one | [
{
"docid": "60de620ebee1a42f583e1f3aa990a547",
"score": "0.71244836",
"text": "def record_delete(record)\n # assign picked record PID to variable\n record_pid = $wtmp_entries[record][\"pid\"]\n # Search through each entry in $wtmp_entries array\n $wtmp_entries.reverse.each do |entry|\n # Looks fo... | [
{
"docid": "519c20edd8ce1ad83e15fa0ddb9b07f1",
"score": "0.640614",
"text": "def delete(record)\n record.del\n end",
"title": ""
},
{
"docid": "632b6c6658bcdb79b4a3b7afad6b0572",
"score": "0.62857884",
"text": "def remove_record(record)\n atoms = condense_record(... |
beee15ec28e810b6b1f791f1988745d1 | Converts email to all lowercase. | [
{
"docid": "d3b6c058bc8ad36584f931372c1d8e28",
"score": "0.0",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
}
] | [
{
"docid": "2b2c0688ba3acfcff4c2f18ffcd0d792",
"score": "0.8383631",
"text": "def normalize_email\n self.email.downcase!\n end",
"title": ""
},
{
"docid": "61c6f9455ec34c2acd15663a017f23dc",
"score": "0.8339932",
"text": "def downcase_email\n email.downcase!\n e... |
0767c02ef9d0239d2304640ba3f845a5 | Shortcut helper that returns all the ActionController::API modules except the ones passed as arguments: class MyAPIBaseController < ActionController::Metal ActionController::API.without_modules(:UrlFor).each do |left| include left end end This gives better control over what you want to exclude and makes it easier to cr... | [
{
"docid": "0d3c43ddb39126e870d25e712d73e1f2",
"score": "0.64060783",
"text": "def without_modules(*modules); end",
"title": ""
}
] | [
{
"docid": "34b98a360fa700cd77df60693a0ac96c",
"score": "0.6121545",
"text": "def api_only!\n hide_namespaces \"assets\", \"helper\", \"css\", \"js\"\n\n options[:rails].merge!(\n api: true,\n assets: false,\n helper: false,\n template_engine: nil\n ... |
06fa93a482e29080bdaf7d9e64dcd238 | Write a method that computes the difference between the square of the sum of the first n positive integers and the sum of the squares of the first n positive integers. input integer output integer rules square of the sum less the sum of the squares data structure array algorithm: compute the square of the sum initializ... | [
{
"docid": "0a5c060ba088c190f02b55fa62ec8c5f",
"score": "0.73513806",
"text": "def square_of_sum(n)\n (0..n).to_a.sum ** 2\nend",
"title": ""
}
] | [
{
"docid": "03ca43e64a645d861c04e4764994e034",
"score": "0.868463",
"text": "def sum_square_difference(n)\n array = (1..n).to_a\n square_of_sums = (array.reduce(:+))**2\n sum_of_squares = array.map { |n| n**2 }.reduce(:+)\n square_of_sums - sum_of_squares\nend",
"title": ""
},
{
"docid":... |
db8e6ce6122cc5d949029797a2c9db63 | str outputs: str reqs: find the highest scoring word in a str add value of each char in the word based on char position in the alphabet find the max value for the words rtn the word with max value rules: letter score is based on position in alphabet a == 1, b == 2, ... struct: arr algo: create an arr of alpha_chars ini... | [
{
"docid": "75a7a423b78cbec0d4c7057eefc9c3d8",
"score": "0.78349257",
"text": "def alphabet_score(str)\n alpha_chars = ('a'..'z').to_a\n max_score = 0\n max_word = ''\n arr = str.split(' ')\n arr.each do |word|\n word_score = word.chars.map { |char| alpha_chars.index(char) + 1 }.sum\n if word... | [
{
"docid": "2d80af0aef476e3988f2929e26fc62fb",
"score": "0.7867902",
"text": "def high(string)\n letter_scores = ('a'..'z').zip(1..26).to_h\n words = string.split\n\n word_scores = words.map do |word|\n score = 0\n word.chars.each { |char| score += letter_scores[char]}\n score \n end\n w... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "9b275b53f640fad14037d73d49e74615",
"score": "0.0",
"text": "def round_params\n params.require(:round).permit(:judge_id)\n end",
"title": ""
}
] | [
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.requ... |
6af98aa033f6182e60009677596de96c | This method allows to close the connection with a client and also to free the resources of a thread by terminating it. | [
{
"docid": "dadfe89c253273f6bcac8378b73ffde0",
"score": "0.0",
"text": "def shutdown(client)\n client.close\n puts \"SHUTDOWN #{client}\"\n @clients[client].terminate\n end",
"title": ""
}
] | [
{
"docid": "a83d8994c58040c35486479363adf8ba",
"score": "0.7713638",
"text": "def close\n @client.close\n Thread.current.exit\n end",
"title": ""
},
{
"docid": "1cf39aeae1f8eb760fe764424bff5302",
"score": "0.76324993",
"text": "def close_connection\n @client.close\n end",
... |
7679454d918b8e6fddc50ef2f2c82708 | If the given +verb+ is irregular in the given +person_ and | [
{
"docid": "627dd35346795873d54b1f971bc31c1b",
"score": "0.6684186",
"text": "def get_irregular( verb, person, tense )\n\t\tself.log.debug \" looking for irregular verb: %p, %p person, %p tense\" %\n\t\t\t[ verb, person, tense ]\n\n\t\tirregular = IRREGULAR_VERBS[ verb ] or return nil\n\t\tself.log.deb... | [
{
"docid": "d876c606f43b63c4743fbc431a21b3f5",
"score": "0.704676",
"text": "def get_irregular(verb, person, tense)\n #verb an irregular?\n irregular = IRREGULAR_VERBS[verb]\n return nil unless !irregular.nil?\n \n #see if specific person match\n if !irregular[person].nil?\n resul... |
1eaa91611e15f643148f4b16b35c2eda | PUT /roundtrips/1 PUT /roundtrips/1.xml | [
{
"docid": "835c8c5eba7698e8bb62b1d6ef4b09b7",
"score": "0.6522859",
"text": "def update\n @roundtrip = Roundtrip.find(params[:id])\n\n respond_to do |format|\n if @roundtrip.update_attributes(params[:roundtrip])\n format.html { redirect_to(@roundtrip, :notice => 'Roundtrip was success... | [
{
"docid": "23b5f5e4dacfb330cb1e0ffd4590ef63",
"score": "0.5992565",
"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": "fbd7c46b15ae2792fd842ba0d764b7d0... |
60c408ced7784395336d98f77fd0131a | Adds a where condition that requires column to contain all keys. Example: User.hstore_has_all_keys(:properties, "favorite_color", "favorite_song") User.hstore_has_all_keys(:properties, ["favorite_color", "favorite_song"]) | [
{
"docid": "aec79e6751b14d6c6676d1a4a7c40c98",
"score": "0.85074276",
"text": "def hstore_has_all_keys(column, *keys)\n where(\"#{connection.quote_column_name(column)} ?& ARRAY[:keys]\", :keys => keys.flatten)\n end",
"title": ""
}
] | [
{
"docid": "5b673264d01870f589caa471f89c50e5",
"score": "0.7869474",
"text": "def hstore_has_any_keys(column, *keys)\n where(\"#{connection.quote_column_name(column)} ?| ARRAY[:keys]\", :keys => keys.flatten)\n end",
"title": ""
},
{
"docid": "87adce39a166dd0598c95d092088582b",
... |
7c01c8833639961d5d90adf03a5436d0 | Returns the number of instructions in the function | [
{
"docid": "663a854725edaf65b11d391193a166c6",
"score": "0.8347751",
"text": "def number_of_instructions\n\t\n\t\tif @inst_num != -1\n\t\t\treturn @inst_num\n\t\tend\n\t\n\t\titer = @ida.Func_tail_iterator_t.new(@func)\n\t\tctr = 0\n\t\t\n\t\tbegin \n\t\t\tstart_offset = iter.chunk().startEA\n\t\t\tend_... | [
{
"docid": "ea5fa07ec3ddbe52dc476ef436ceef29",
"score": "0.8035205",
"text": "def instruction_count\n @instruction_count\n end",
"title": ""
},
{
"docid": "e021a2ab5cf412be38472ea051b872c9",
"score": "0.7898998",
"text": "def number_of_instructions\n\t\n\t\tif @inst_num != ... |
f8a263d6268ebd28032ef6aeca5456f1 | Time complexity: O(n) Space complexity: O(n) | [
{
"docid": "e3ec5865d88785c3dcc1cc25bf4bd4dc",
"score": "0.0",
"text": "def factorial(n)\n raise ArgumentError if n < 0\n return 1 if n == 1 || n == 0\n return n * factorial(n - 1)\nend",
"title": ""
}
] | [
{
"docid": "9bfaea331eedce3072d8464bb5cccee1",
"score": "0.6537027",
"text": "def fast_two_sum?(arr)\n # O(n) in time and space\n result = []\n complements = {}\n\n arr.each_with_index do |el, i|\n if complements[el]\n result.push([complements[el], i])\n else\n complements[-el] = i\n... |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "d33cfaf331f70638089270829f6a8d31",
"score": "0.0",
"text": "def update!(**args)\n @instance = args[:instance] if args.key?(:instance)\n @update_mask = args[:update_mask] if args.key?(:update_mask)\n end",
"title": ""
}
] | [
{
"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... |
27876eb855c3e6eb09103de98385cdca | Removes all nil values from the hash. Returns nil if no changes were made, otherwise returns the hash. | [
{
"docid": "22b2004634fbdc311d32fc9c0ae6b576",
"score": "0.68189454",
"text": "def compact!\n hsh = {}\n any = false\n each do |k, v|\n if v.nil?\n any = true\n else\n hsh[k] = v\n end\n end\n return unless any\n replace hsh\n sel... | [
{
"docid": "beee79af4a347366c4e2eb9e4ab85337",
"score": "0.79846334",
"text": "def strip_nulls!(hash)\n hash.each_key do |key|\n case value = hash[key]\n when Hash\n strip_nulls!(value)\n hash.delete(key) if value.empty?\n when nil then... |
625482742e1dabf8e36285f36b583dfa | DELETE /unit_of_measure_conversions/1 DELETE /unit_of_measure_conversions/1.json | [
{
"docid": "0dbdb7c4592e6489923c99ccbf749a94",
"score": "0.7379131",
"text": "def destroy\r\n @unit_of_measure_conversion = UnitOfMeasureConversion.find(params[:id])\r\n @unit_of_measure_conversion.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to unit_of_measure_convers... | [
{
"docid": "2d1f96a779e0b0fe5d5dd2356e5d2522",
"score": "0.71544254",
"text": "def destroy\n @units_of_measure.destroy\n respond_to do |format|\n format.html { redirect_to units_of_measures_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "... |
9bffdf6ea4d94c6639b3ec7ff5d85f7a | methode qui retourne une array avec la liste des noms de communes | [
{
"docid": "d2d7073a7a4a5d7bb2bc587b985400e4",
"score": "0.0",
"text": "def towns_names()\n town_names = []\n doc = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/val-d-oise.html\"))\n doc.css('a.lientxt').each do |x|\n names = x.text\n names.downcase!\n town_names.push(names)\n ... | [
{
"docid": "9d8cf6128ebeac71291d6b56da8cb350",
"score": "0.60657096",
"text": "def names\n [\n \"Charge de travail\" , #00\n \"Travail en groupe\" , #01\n \"Maths\" , #02\n \"Codage\" , #03\n \"Théorique\" ... |
72c51ccd71ed70ffd27bfa6c88519b96 | test of simple stats based on example document | [
{
"docid": "184657a97298a97f157dd786959b3000",
"score": "0.6739869",
"text": "def test_stats\n assert @page != nil\n\n wc = @analyzer.word_count @view\n puts wc\n # word count from MS Word: 3.648 (including UI text from Mahara)\n assert_equal 3759, wc\n\n external_links = @analyzer.ext... | [
{
"docid": "1408810b5b57e6a518fab7cead9cae6a",
"score": "0.6360896",
"text": "def exams_statistics\n end",
"title": ""
},
{
"docid": "49a2978670ff68e1b171a95f5aa5bd30",
"score": "0.63105714",
"text": "def statistics; end",
"title": ""
},
{
"docid": "1001a5cb3bd0bf7e43504... |
7438f56b99d805feb91afe4e97bdbf5d | GET /tictacs/1 GET /tictacs/1.json | [
{
"docid": "8f4d29c64a0e5839ab338f07c032a7d8",
"score": "0.6203166",
"text": "def show\n @tictac = Tictac.find(params[:id])\n\n end",
"title": ""
}
] | [
{
"docid": "f3c65809a110b777e1b153905b36214d",
"score": "0.6183634",
"text": "def new\n @tictac = Tictac.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tictac }\n end\n end",
"title": ""
},
{
"docid": "31a215d8ce40eddda2f7ff79304... |
4511519528e1f0029b2feb9660a813bb | Say if DER can be built (not default value, not optional without value, has a value) | [
{
"docid": "23bc3c3818c222119dec7d117cfa133d",
"score": "0.64486575",
"text": "def can_build?\n value? && (@default.nil? || (@value != @default))\n end",
"title": ""
}
] | [
{
"docid": "2f9f8cd2d608169fddc166d6f6ac4c59",
"score": "0.57071084",
"text": "def digital?\n digitals.present?\n end",
"title": ""
},
{
"docid": "f9aef5c9801d733f655f3a95c57d329d",
"score": "0.5635147",
"text": "def allows_value?(v)\n v.nil? || VERIFICATION[self.type][v]\n e... |
616df2fac5094c493d7e6a91526f5d6d | change attributes of wishlisted class, like credit/audit | [
{
"docid": "742c96ed4fdef5beb9dafd39b023a2f4",
"score": "0.6311762",
"text": "def update\n @wishlist_class = WishlistClass.find(params[:id])\n @wishlist_class.update_attributes(params[:wishlist_class])\n end",
"title": ""
}
] | [
{
"docid": "6e2751e1c4281d9c9e1b5b245cf35f66",
"score": "0.6371409",
"text": "def set_awarded_attributes\n end",
"title": ""
},
{
"docid": "d14f241cc0d7a82c6b2cf4ef38540628",
"score": "0.622506",
"text": "def attribute_update(key, original, modified)\r\n case key.downcase\r\n ... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "30b8a845a537622c849368b2bd6688ff",
"score": "0.0",
"text": "def community_params\n params.require(:community).permit(:label, :boundry_coordinates, :private, community_businesses_attributes: [:id, :anchor, :champion, :recommended])\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... |
a5a8d13701d5c2101ef50f5b956bec08 | Adds definition for existing word. Also adds new words to define | [
{
"docid": "f7ea26f8ab2741cf550526e890ddc026",
"score": "0.8167207",
"text": "def add_definition(word, definition)\n if (@data.has_key?(word) and @data[word].nil? and definition.is_a? String)\n log \"'#{word}' defined as: '#{definition}'\"\n @data[word] = definition\n @undef_words.dele... | [
{
"docid": "9f882c7417ddc63028a5fb934780c60d",
"score": "0.8123896",
"text": "def add_word(word, definition)\r\n @dictionary[word] = definition\r\n end",
"title": ""
},
{
"docid": "792d72b0edd2acba3ffec25718390d69",
"score": "0.7770241",
"text": "def add_definition(word, definiti... |
062d56beb5ccc32d72c049efe81a5477 | PUT /comments/1 PUT /comments/1.xml | [
{
"docid": "84a83db0dde63f086b4f1594222a5d2e",
"score": "0.634739",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n flash[:notice] = 'Comment was successfully updated.'\n format.html { redi... | [
{
"docid": "232be70437fbc4698ad886dc38fade53",
"score": "0.6621902",
"text": "def update\n @comment = @post.comments.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to(@post, @comment) }\n format.xml { head... |
5e4cc21ab4dc07f63c6f3ae4ec16ef37 | NOTE: The following solutions did not achieve the desired time complexity. They acheived O(N2) Brute force: | [
{
"docid": "ca4f096112573561eccd05074fd13a42",
"score": "0.0",
"text": "def solution2(a)\n\n counts = Hash.new(0)\n\n a.each do |int|\n counts[int] += 1\n end\n\n non_divisors = []\n\n a.each do |int|\n div_count = 0\n for i in 1..int do\n div_count += counts[i] if int % i == 0\n e... | [
{
"docid": "2481cbf165330db256eee896a32c82e4",
"score": "0.69554555",
"text": "def solution(a)\r\n n=a.size\r\n i=1\r\n for k in a.sort do\r\n\tif k!=i \r\n\t then \r\n\t return 0\r\n\t break;\r\n\tend\r\n i+=1;\r\n end\t\r\n return 1 if a.inject(:+) ==n... |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "13198677bfe67a1c61961c5f9b6b420d",
"score": "0.0",
"text": "def masterpiece_params\n params.require(:masterpiece).permit(:recipe_id, :user_id, :description, :masterpiece_img)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7493595",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6954758",
"text": "def strong_params\n params.require(:request).permit(param_white... |
0200080ac28fc336a61bab84a8e57b0d | if set to true, all functions will return a round result by default instead of the accurate result SOLVE POLY 2 Solve second degre polynomial equation | [
{
"docid": "e02f6d8edc5b2a6381a96f8658da8c2a",
"score": "0.5859751",
"text": "def solve_poly_2(a, b, c)\r\n delta = b**2 - 4*a*c\r\n\r\n if (delta < 0) #no solution\r\n nil\r\n\r\n elsif (delta == 0) #one solution\r\n [(- b) / (2*a.to_f)]\r\n\r\n elsif( ... | [
{
"docid": "7658a4253030c646e7b9e3863ef5e2bf",
"score": "0.6976565",
"text": "def solution1 (value)\n\tvalue.round(2)\n\tend",
"title": ""
},
{
"docid": "59146e6c6407b76da50ac2e316419000",
"score": "0.6831445",
"text": "def solution(value)\n value.round(2)\nend",
"title": ""
}... |
24e9768cb52013127be3b16790fb6202 | This method is defined here in order to be used by `authorized_find!` in the subclasses. | [
{
"docid": "70707ef5df9bf63a8a579d98b0cbd34c",
"score": "0.0",
"text": "def find_object(id:)\n GitlabSchema.object_from_id(id, expected_type: ::Metrics::Dashboard::Annotation)\n end",
"title": ""
}
] | [
{
"docid": "838fc2a5d447bdb8b30167717d2f1f1a",
"score": "0.6043314",
"text": "def find; raise NotImplementedError\n end",
"title": ""
},
{
"docid": "6262cc28abfed3242648d90f6392d8f9",
"score": "0.5887219",
"text": "def before_find\n end",
"title": ""
},
{
"docid... |
e93bac85e494e2bfdb61140516bf98fe | other number that are a multiple of 3 or 5. For instance, if the supplied number is 20, the result should be 98 (3 + 5 + 6 + 9 + 10 + 12 + 15 + 18 + 20). You may assume that the number passed in is an integer greater than 1. Examples multisum(3) == 3 multisum(5) == 8 multisum(10) == 33 multisum(1000) == 234168 | [
{
"docid": "d63773366fa964a33b528da366be52bf",
"score": "0.81823236",
"text": "def multisum(number)\n (1..number).select { |multiple| multiple % 3 == 0 || multiple % 5 == 0 }.inject(:+)\nend",
"title": ""
}
] | [
{
"docid": "a8c7497f623b3cb241f5189deb365971",
"score": "0.8271622",
"text": "def multisum(num)\n multiples = []\n 1.upto(num) do |x| \n if x % 3 == 0 || x % 5 == 0\n multiples << x\n end\n end\n multiples.inject(:+)\nend",
"title": ""
},
{
"docid": "f265ecd18933ddc9ff545eff80... |
3b7b08d3ce9e4040b379f05ed89640cc | Returns the value of attribute owner. | [
{
"docid": "d0ac53758175f2dc2b7dd385ce0714e0",
"score": "0.5960309",
"text": "def owner; end",
"title": ""
}
] | [
{
"docid": "73c3c550c8304238d862118f05311e87",
"score": "0.83432174",
"text": "def owner\n @attributes[:owner]\n end",
"title": ""
},
{
"docid": "631109060f96898ff1c85eba6e970ca5",
"score": "0.8095028",
"text": "def owner\n attribute_prop(6)\n end",
"title": ""
... |
c5588e67d08946663cfe698d1dc544e5 | GET /campaigns/new GET /campaigns/new.xml | [
{
"docid": "32d341d3a35c7aa6698003963609b525",
"score": "0.69903827",
"text": "def new\n @campaign = Campaign.new\n @statuses, @types, @owners = prepare_options_for_select(Status.all, Type.all, User.all)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :x... | [
{
"docid": "d822db83856db9ae9c4bc04e41cc5688",
"score": "0.79266053",
"text": "def new\n @campaign = Campaign.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @campaign }\n end\n end",
"title": ""
},
{
"docid": "4bef63419b2b27280d... |
0be8deb550f7847f7297c6a128ac60a8 | PUT /api/v1/schemas/:id PATCH /api/v1/schemas/:id | [
{
"docid": "810abe144b85a73d8c5429b5ccb6a82d",
"score": "0.67121595",
"text": "def update\n check_schema_ownership(@schema)\n if current_user != @schema.owner\n _user = @schema.user_schemas.find_by(user: current_user)\n if !_user || !_user.can_read_write?\n render json: {\n ... | [
{
"docid": "101b1820e81f2c94510bdc5350e90aac",
"score": "0.7065538",
"text": "def update\n @entity_schema = EntitySchema.find(params[:id])\n\n respond_to do |format|\n if @entity_schema.update_attributes(params[:entity_schema])\n format.html { redirect_to @entity_schema, notice: 'Entit... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "14718771926baf0c15629c1c16aaede1",
"score": "0.0",
"text": "def set_award\n @award = Award.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.603186",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6015241",
"text": "def ... |
65759e7d689ba3608d41077dd1f87dc2 | Updates IsInternal as False for public release and True for internal release | [
{
"docid": "ef21db2792aff57d9ffe0ca8b227d158",
"score": "0.0",
"text": "def update_definition_xml(xml, args)\n doc = Nokogiri::XML(File.open(xml))\n internal = doc.at_css(\"IsInternalExtension\")\n internal.content = is_internal?(args)\n File.write(xml, doc.to_xml)\nend",
"title": ""
}
] | [
{
"docid": "0fb6679b1ee69467e6806af75d1f9846",
"score": "0.77190936",
"text": "def internal?\n @internal ||= false\n end",
"title": ""
},
{
"docid": "9469650b671a030661ff0a9095838349",
"score": "0.7513271",
"text": "def internal?\n @internal\n end",
"title... |
974e4bd2385fc8f7d5ce641bb8a3e3da | The xmlSerialize metod is called during xml writing. Use the writer argument to write its own xml serialization. An important note: do _not_ create a parent element. Any element implementing XmlSerializble should only ever write what's considered its 'inner xml'. The parent of the current element is responsible for wri... | [
{
"docid": "22ec157e6d1efade296609122cfd3cd6",
"score": "0.0",
"text": "def xml_serialize(writer)\n serialize_priv(writer, @privileges)\n end",
"title": ""
}
] | [
{
"docid": "70d8020785c693f43b8af08d1eee58f6",
"score": "0.77048177",
"text": "def xml_serialize(writer)\n end",
"title": ""
},
{
"docid": "237afcfe8fa9bd67546f962cc98b9af7",
"score": "0.6892957",
"text": "def xml_serialize(writer)\n writer.start_element('{http://sabred... |
ccb290712f8722696be8dfa998d967a4 | Sets the resourceId property value. Optional. Used to uniquely identity the resource. If passed in, the prompt uri will be cached against this resourceId as a key. | [
{
"docid": "8322a8ff7c9af082ee2fc2f47c297aef",
"score": "0.76594627",
"text": "def resource_id=(value)\n @resource_id = value\n end",
"title": ""
}
] | [
{
"docid": "fd03f8382af2d63dd47f2f460e33de90",
"score": "0.723304",
"text": "def resource_id(resource_id)\n Apipie.set_resource_id(@controller, resource_id)\n end",
"title": ""
},
{
"docid": "7fed884d85b038c736f4fc8f935ae2b2",
"score": "0.66807646",
"text": "def amazon_re... |
70132dadd369448633ae42f06566f149 | todo check for sql injecttion!!!!!!! | [
{
"docid": "90372f0d86936e5dbc5bef1cac88bf57",
"score": "0.0",
"text": "def new_customer_req\n parms = {}\n puts \"Please enter first name:\"\n new_firstname = gets.chomp.strip.capitalize\n parms[:firstname] = new_firstname\n puts \"Please enter last name:\"\n new_lname = gets.chomp.st... | [
{
"docid": "6083b3270475087151b3dc8ea22926fd",
"score": "0.801253",
"text": "def sql; end",
"title": ""
},
{
"docid": "6083b3270475087151b3dc8ea22926fd",
"score": "0.801253",
"text": "def sql; end",
"title": ""
},
{
"docid": "ac21bda441eb5a0a7a8655ae4477501a",
"score"... |
03d9642db6871e65732eefd7a6e1aade | Array of values of all properties with name +name+ | [
{
"docid": "319eec0a92807c704e9b624380dfe555",
"score": "0.8638243",
"text": "def propvaluearray(name) #:nodoc:\n @properties.select{ |f| f.name? name }.map{ |p| p.value }\n end",
"title": ""
}
] | [
{
"docid": "c6dc65db8a2ed4616225ccfc8161d751",
"score": "0.7359897",
"text": "def all_values(name)\n @values[name.to_sym] || []\n end",
"title": ""
},
{
"docid": "9ccb43dd6744dcae8eefe5f6dcff8558",
"score": "0.7011707",
"text": "def proptextlistarray(name) #:nodoc:\n @pr... |
3f52973818698070d105a2c20fdb77a5 | Serializes information the current object | [
{
"docid": "c73801903a148df9874f4ff2bc947496",
"score": "0.0",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"azureOperationalInsightsBlockTelemetry\", @azure_operational_ins... | [
{
"docid": "d162e297d0f84ca205afa381c3f6a428",
"score": "0.7830697",
"text": "def serialize\n Marshal.dump(self)\n end",
"title": ""
},
{
"docid": "762bca0e2db3ff19d91cc4521bb1e1d9",
"score": "0.7645999",
"text": "def serialize(object) end",
"title": ""
},
{
"docid": ... |
99c5e36a172218901fd772219052a4d0 | Anzeige der Liste der MessageDetails | [
{
"docid": "b9cffddfb5789df9a504a03d2b431f7d",
"score": "0.0",
"text": "def show_msgtype_details_inner\n @ofmessagetype = Ofmessagetype.find params[:id_ofmessagetype]\n save_session_time_selection\n @timeSlice = params[:timeSlice]\n @update_area = params[:update_area]\n @instance = prep... | [
{
"docid": "b906c8cc2872dd8a94e9657fad726b25",
"score": "0.6602383",
"text": "def to_s\n '#<Twilio.Api.V2010.MessageList>'\n end",
"title": ""
},
{
"docid": "5b73adcfb782c3b635da62b31682352e",
"score": "0.65668714",
"text": "def get_driver_me... |
e1e09d6652022f596d3d852e714500f9 | GET /historial_estado_presupuestos GET /historial_estado_presupuestos.json | [
{
"docid": "1c630363b6caa871d98f7e263752530b",
"score": "0.69819266",
"text": "def index\n\t\tauthorize! :index, HistorialEstadoPresupuesto\n @historial_estado_presupuestos = HistorialEstadoPresupuesto.all\n end",
"title": ""
}
] | [
{
"docid": "660c82d27a71e52077ce64dacb321109",
"score": "0.7466806",
"text": "def set_historial_estado_presupuesto\n @historial_estado_presupuesto = HistorialEstadoPresupuesto.find(params[:id])\n end",
"title": ""
},
{
"docid": "891451aa27a113cf5d546c01eee60fc7",
"score": "0.6873... |
da58524a1ff2af1592e6f4003ccf3109 | hardcode the service if not set | [
{
"docid": "ea80b6cf14f842241fd98d9f5666dad0",
"score": "0.6804346",
"text": "def service\n self.original_service or Service.find_by_name(\"CityElection\")\n end",
"title": ""
}
] | [
{
"docid": "61d88b770f273a20f46213ecb31cc2df",
"score": "0.7588514",
"text": "def service\n nil\n end",
"title": ""
},
{
"docid": "b8168dd3443a8d509ae7f9e51d9710c9",
"score": "0.7526207",
"text": "def service\n @service ||= ServiceStore.instantiate_service!( self.service_i... |
fe244de24ad8a3949ce0dca2f82cd0d9 | PATCH/PUT /admin/size_helpers/1 PATCH/PUT /admin/size_helpers/1.json | [
{
"docid": "21524f51d926b7de2fc48d9f7c9516fd",
"score": "0.7542104",
"text": "def update\n respond_to do |format|\n if @admin_size_helper.update(admin_size_helper_params)\n format.html { redirect_to admin_size_helper_path(@admin_size_helper), notice: 'Size helper was successfully updated.... | [
{
"docid": "73c45916de11fd96cd9df251dfea4297",
"score": "0.7270107",
"text": "def update\n authorize @size_helper\n\n respond_to do |format|\n if @size_helper.update(size_helper_params)\n format.html { redirect_to @size_helper, notice: 'Size helper was successfully updated.' }\n ... |
c393b5fb875c4271b7785d69a7f0fc10 | :callseq: on_args_add: (Args arguments, untyped argument) > Args | [
{
"docid": "c71fdaa276b1239dfb3522c45df4acc3",
"score": "0.7148088",
"text": "def on_args_add(arguments, argument)\n if arguments.parts.empty?\n # If this is the first argument being passed into the list of arguments,\n # then we're going to use the bounds of the argument to override ... | [
{
"docid": "3de7e0c5c9fbfe45852bd3ab780f3b72",
"score": "0.87867767",
"text": "def on_args_add(arguments, argument); end",
"title": ""
},
{
"docid": "c0325d30ab3072175e1d5f840abb3819",
"score": "0.7970929",
"text": "def on_args_add_star(arguments, argument); end",
"title": ""
}... |
7b6e8cc4b57d43245ad4122d03bdea91 | List all existing addons a user has access to | [
{
"docid": "d3c4cbbc8575dee14e1ead3a3dc750bf",
"score": "0.62424546",
"text": "def list_by_user(account_email_or_account_id_or_account_self)\n @client.addon.list_by_user(account_email_or_account_id_or_account_self)\n end",
"title": ""
}
] | [
{
"docid": "6364604672248ce0cd72036718cc82eb",
"score": "0.73276675",
"text": "def list()\n @client.addon.list()\n end",
"title": ""
},
{
"docid": "3cadd6181703d9a87316d9230f10d8b1",
"score": "0.68439794",
"text": "def addons()\n header(\"oF - Installed addons...\")\n ... |
14bead12f73ab496c0361e11e049cc80 | POST /make_payments POST /make_payments.xml | [
{
"docid": "0374ed0c28a2479242bdddd767980f3c",
"score": "0.6164949",
"text": "def create\n @make_payment = MakePayment.new(params[:make_payment])\n #@make_payment.company_id = Company.find_by_subdomain(request.subdomain).id\n @make_payment.company_id = @company.id\n @make_payment.user_id = s... | [
{
"docid": "67af5c08016760e5459c4ac166532674",
"score": "0.6960457",
"text": "def payment_request\n @payment = Payment.create(payment_params)\n sepa_direct_debit = SEPA::DirectDebit.new(recipient_params)\n sepa_direct_debit.add_transaction(debtor_params)\n # with this xml request will be set... |
4bbe8342fce172df6935693c8360719b | Look at the journal Nature (hrid: a3195844) as a pathological case (but pieces aren't loaded there yet) hrid: a567006 has > 1000 on test. | [
{
"docid": "e67056839aff61430425307f00d19dd5",
"score": "0.0",
"text": "def pieces_per_location\n @pieces_per_location ||= pieces.group_by { |piece| holdings_by_id[piece['holdingId']]&.dig('location', 'effectiveLocation', 'code') }\n end",
"title": ""
}
] | [
{
"docid": "4d74e6614905f5b5e4e66f27fe0467a4",
"score": "0.55102134",
"text": "def thesis\n 'Thesis/Dissertation' if record.find { |a| a.tag == '502' }\n end",
"title": ""
},
{
"docid": "e1a417d181f45d549743aec7078950d7",
"score": "0.5506098",
"text": "def isHumanSample()... |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "9d5485a132722e9a5a5691efea62a10f",
"score": "0.0",
"text": "def set_booking\n @booking = Booking.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... |
902ee7629bab010451fb18a3f1585c0a | Ketan: Generate the worker job | [
{
"docid": "f3878e4df667a9d63b41750a8a0b70a5",
"score": "0.710676",
"text": "def gen_submit(count = 1)\n\n ov=$VERBOSE\n $VERBOSE=nil\n workerExecutable = `which worker.pl`\n workerWrapper = `which run-worker.sh`\n $VERBOSE=ov\n\n # workerContact = \"http://communicado.ci.uchicago.ed... | [
{
"docid": "c03049b055e02f76ea9cb1e66d3b6370",
"score": "0.6959857",
"text": "def create_job\n\n end",
"title": ""
},
{
"docid": "b25335f81604509e40309e4802018ee6",
"score": "0.6882216",
"text": "def work(job); end",
"title": ""
},
{
"docid": "b25335f81604509e40309e48020... |
1e36557a37fed457f0337a8a2977432b | Marks +self+ as persistent record. If another record is passed, uses its persistence attributes (id, timestamps). If nil is passed as an argument, marks +self+ as persisted record and sets +id+ to memorized value. | [
{
"docid": "1f7e9dbb6313a42bcbab915cbbc15d47",
"score": "0.6304285",
"text": "def to_persistent!(existing = nil)\n if existing\n self.id = existing.id\n self.created_at = existing.created_at if respond_to?(:created_at)\n self.updated_at = existing.updated_at if respond_to?(:upd... | [
{
"docid": "c9a6bcb53c174ea1cf04056c5aca0e51",
"score": "0.6455037",
"text": "def save()\n saved = persister.save(@decorated, @id)\n\n if saved\n @id = saved.id\n self\n end\n end",
"title": ""
},
{
"docid": "421fa152d83515c0d17c478fa2544592",
"score": "0.61419916",
... |
4f89e53b1c4b0a48866cf92ad52e391c | Returns the path of the attachment as defined by the :path option. If the file is stored in the filesystem the path refers to the path of the file on disk. If the file is stored in S3, the path is the "key" part of the URL, and the :bucket option refers to the S3 bucket. | [
{
"docid": "fd6166eceb3109dd3158fb83a836cbc4",
"score": "0.0",
"text": "def path style = nil #:nodoc:\n original_filename.nil? ? nil : interpolate(@path, style)\n end",
"title": ""
}
] | [
{
"docid": "f18c3f0ffb5af3e19e4a84e529399bb4",
"score": "0.7685948",
"text": "def path\n attachment.path\n end",
"title": ""
},
{
"docid": "63c20bd1b97493595ae043f0fb5e0d8c",
"score": "0.75917035",
"text": "def path(options={})\n attached_file.path(options)\n end"... |
e677d75a0164bbb08a25266cde261dcb | POST /messageboxes POST /messageboxes.json | [
{
"docid": "301e2c5cea9cb0b0c06bf588281c7e26",
"score": "0.70968854",
"text": "def create\n @messagebox = Messagebox.new(messagebox_params)\n\n respond_to do |format|\n if @messagebox.save\n format.html { redirect_to @messagebox, notice: 'Messagebox was successfully created.' }\n ... | [
{
"docid": "6db64f2a9596a02d984b067243ed3397",
"score": "0.6483891",
"text": "def create\n @postbox = current_user.postboxes.new(postbox_params)\n\n respond_to do |format|\n if @postbox.save\n format.html { redirect_to @postbox, notice: 'Postbox was successfully created.' }\n fo... |
2b4de9d8b13f4fcdda6b83126c3272f1 | Repository Methods Adds a new image to the repository and deletes the temp_file uid:: _Integer_ owner of the image path:: _String_ path of the tmp file metadata:: Additional metadata for the file [return] _Image_ Newly created image object | [
{
"docid": "1d2328c521a9da34bfef9498923cb6a4",
"score": "0.6711653",
"text": "def add_image(uid, file, metadata={})\n image = @rm.add(uid,file.path,metadata)\n file.unlink\n\n return image\n end",
"title": ""
}
] | [
{
"docid": "3cda172855d526aed8137c8c0994f0fa",
"score": "0.6742638",
"text": "def create_temp_with_image\n image, filename, content_type = create_image\n temp = TempImage.new\n temp.transaction do\n temp.image.attach(io: image, filename: filename, content_type: content_type) if temp.save\n... |
63b3d0fcb1b9f904c070856380505e88 | Only authorize request with the correct API token (see `config/initializers/api_token.rb`) | [
{
"docid": "0c93a2dde7279aa984ee5723db7d71c2",
"score": "0.8204283",
"text": "def authorize\n unless params[:token] == Rails.configuration.api_token\n return render(plain: \"Unauthorized API token\\n\", status: :unauthorized)\n end\n end",
"title": ""
}
] | [
{
"docid": "6ee46b8101c026a5a3c9a95867075f7d",
"score": "0.8015804",
"text": "def authorize!\n api_key = ApiKey.find_by_access_token(params[:access_token])\n head :unauthorized unless api_key\n return false\n end",
"title": ""
},
{
"docid": "b7865811f0ab5607274e0c4109242ddf",
"... |
77b876a08f2e1d413801490b97ed89e0 | an enum pending, approved, or rejected | [
{
"docid": "e68b9bd9e37e87c36cb9202585c85b7a",
"score": "0.66396266",
"text": "def status\n return \"approved\" if voters.empty?\n\n statuses = votes.map(&:status).uniq\n\n case statuses\n when [\"approved\"]\n return \"approved\"\n when [\"pending\"]\n return \"pending\"\n e... | [
{
"docid": "5b2cbe7338c0935422a2e4dcb8fe1a62",
"score": "0.76322633",
"text": "def status\n accepted? ? :accepted : :pending\n end",
"title": ""
},
{
"docid": "9815906033d9d1f6873bc6f08804b71e",
"score": "0.73629427",
"text": "def status_enum\n [['Not Reviewed'],['Approved'],['... |
8c301b31eb2b794d2dce28c9bcf606d3 | GET /ratings GET /ratings.json | [
{
"docid": "0b80b8adb8ca854e81878a1ced3c39cf",
"score": "0.71991116",
"text": "def index\r\n @ratings = Rating.all\r\n end",
"title": ""
}
] | [
{
"docid": "22b94507799b4c83b9983d5b40541a99",
"score": "0.80119395",
"text": "def ratings\n Birdman::Requester.get(\"shows/#{id}/ratings\")\n end",
"title": ""
},
{
"docid": "7ebf5c757950bb4556c9386cc3ae652e",
"score": "0.7963769",
"text": "def index\n @ratings = Rating.all\n... |
792525cb0dac692d8b02fd99006b600d | =============================================================== Bin Tip Criteria controller code =============================================================== | [
{
"docid": "a682b9dd026bffc23a1be92577627d7b",
"score": "0.46153378",
"text": "def get_existing_bintip_criteria_setup\n return if session[:current_prod_schedule]== nil\n sched_nr = session[:current_prod_schedule].id\n \n return BintipCriterium.find_by_production_schedule_id(sched_nr)\n\nend",... | [
{
"docid": "a010d7e8b5d7d57c4bc6ff9384c13394",
"score": "0.60134786",
"text": "def calc_bins_tipped_req\n #return @rw_run.rw_active_tipped_bins.length()\n @conn.select_one(\"select count(*) as count from rw_active_bins where rw_run_id = #{@rw_run.id.to_s} and ( upper(reworks_action) = 'TIPPED' OR... |