query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
cf7e6de67ea8048dd76d99c8ff8b5b1e
GET /employees GET /employees.json
[ { "docid": "3241019eb891ad4370847fae9402776b", "score": "0.0", "text": "def index\n if params[:search]\n @employees = Buildingemployee.joins(employee: [:person]).includes(:building).search(params[:search]).group_by{|b| b.building_id}\n elsif params[:char]\n # @employees = Buildingemploye...
[ { "docid": "1bdd8a952d2aa1acc1a3ba2c10d973c9", "score": "0.7759287", "text": "def index\n @employees = Employee.all\n render json: @employees\n end", "title": "" }, { "docid": "469c5150223d3b1eaf8715d1319bea76", "score": "0.7757173", "text": "def index\n @employees = Employ...
5530b82821b83f906336e3cd3c28452b
Boardempty_positions? This method should return a boolean indicating whether or not there is at least one empty position on the grid.
[ { "docid": "c994660cdfc6d00a19ea14e21dd89bf2", "score": "0.86326057", "text": "def empty_positions?\n @grid.any? { |row| row.any?(\"_\") }\n end", "title": "" } ]
[ { "docid": "4d6b39969b1e3a88fd8c3357d60e73db", "score": "0.83269227", "text": "def empty_position?\n return true if @grid.flatten.count(\"_\") > 0\n false\n end", "title": "" }, { "docid": "c1f27f5af917e7076120022b7100ffe1", "score": "0.81875634", "text": "def empty_...
63f632ba39de60a64f9c35f4baadfac6
function gives nutrion info for first side
[ { "docid": "f64c518de239a09b4aebac278b7e4856", "score": "0.5791018", "text": "def give_first_side_nutrition\n puts \"Would you like to see the nutritionals for your #{@first_side_name}\"\n response = gets.strip.downcase\n if response == \"yes\"\n puts @side_nutrition[@user_first_side - 1]\n end\n...
[ { "docid": "12dcce5c8bc914482f097192a5d98ffe", "score": "0.61711514", "text": "def get_nutrition_info(food_item)\n end", "title": "" }, { "docid": "62f17dfcabd2583ccc401b8ebdaa6bbf", "score": "0.61184007", "text": "def main_taxon\n result = ''\n wheels = self.t...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "651f8854023b78937b24af0f852b80a3", "score": "0.0", "text": "def order_params\n params.require(:order).permit(:note, :payment_type, :payment_status, :transfer_status, :tip, :store_id, :cart_id, :user_id,\n :user_attributes => [:id, :firstname, :lastname...
[ { "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...
882cad4238143eb0afa474c4bace9bb2
Retorna elemento driver de filho
[ { "docid": "b45307023f646c5e992a2c4c2150d80a", "score": "0.6278304", "text": "def get_elemento_filho_id(driver, id)\r\n filhoArray = driver.find_element(:id, id)\r\n return filhoArray\r\n end", "title": "" } ]
[ { "docid": "f554197962dc1247278c80b17e475922", "score": "0.63038254", "text": "def find_driver\n return Driver.find(driver_id)\n end", "title": "" }, { "docid": "ee35bb2161673738cbca3e6059f35038", "score": "0.6299404", "text": "def getDriver\n\t\t@driver\n\tend", "title":...
5083331656f1b77c362c809eb589e19e
(the start of the game as well and camp method)
[ { "docid": "bd1171d21f0b748308527ef04501c2e5", "score": "0.0", "text": "def camp\n puts \"You're at your camp #{$name}what will you do?\n \\n1: cook\\n2: rest\\n3: stare into the sky\\n4: quit the game\\n5: venture into the forest\"\n answer1 = (gets).to_i\n\n#cook option\n if answer1 == 1\n pu...
[ { "docid": "7cf1fed304363cf796dadc3fb3575ada", "score": "0.7238713", "text": "def gameflow\n \n end", "title": "" }, { "docid": "67cecc9a4d9a1c6d0ddc845b14ece60b", "score": "0.714985", "text": "def start\n set_player_name\n deal_cards\n show_flop\n player_turn\n...
9805c1f737ac10b8c4958db36541441e
=== Description Helper method for parsing the authentication token
[ { "docid": "dc67e82e16ad1df45840c09c57de6d90", "score": "0.7210732", "text": "def parse_auth_token(token)\n return nil if token.nil?\n if !(token =~ /MarkUsAuth ([^\\s,]+)/).nil?\n return $1 # return matched part\n else\n return nil\n end\n end", "title": "" } ...
[ { "docid": "d9903110d9bb653533b9d24727626bee", "score": "0.7569159", "text": "def auth\n Auth.decode(token)\n end", "title": "" }, { "docid": "d9903110d9bb653533b9d24727626bee", "score": "0.7569159", "text": "def auth\n Auth.decode(token)\n end", "title": "" }, { ...
e52eb0b0f638aed5002594d4d27c3b95
If +enabled+, the server will use SSL.
[ { "docid": "305b5935c8fbc98eaca80e043d2189bf", "score": "0.7904122", "text": "def use_ssl=( enabled )\n\t\tif !enabled || enabled == 0\n\t\t\tsuper( 0 )\n\t\telse\n\t\t\tsuper( 1 )\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "2185e32161c8150dc413b9515c1c741c", "score": "0.8294792", "text": "def enable_ssl\n end", "title": "" }, { "docid": "0ccf4e2b50ba5dabf4a2efb8dcf07005", "score": "0.8085602", "text": "def enable_ssl\n @ssl = true\n end", "title": "" }, { "docid": "59014...
20c641ac7a5a790b52f9f1ab7b034778
Add a callback to run before this command Adds this callback to the list of callbacks that are called and passed the command line parameters before the command runs. The order they are called in is not guarenteed
[ { "docid": "79733f94b62bbb627f468b787849cf61", "score": "0.5701264", "text": "def before(&blk)\n @before ||= Set.new\n @before.add(blk)\n end", "title": "" } ]
[ { "docid": "9b078b111cf00a3598955715287e1481", "score": "0.76530915", "text": "def before(cmd_or_args = nil, args = nil, &block)\n @chain.insert(@chain.index(nil), normalize_callback(cmd_or_args, args, block))\n end", "title": "" }, { "docid": "2ba540caa009c6537b79bd48efacebcd", ...
a6527a2ee7f77ed7a93a4b65ae76ef25
Obtain an InputSet object, used to define inputs for an execution of this Choreo.
[ { "docid": "4dc94811efafa7ada0531ddf4951f3ea", "score": "0.0", "text": "def new_input_set()\n return DownloadBase64EncodedFileInputSet.new()\n end", "title": "" } ]
[ { "docid": "d8eb34cfc5a1e737977f7023d4849c46", "score": "0.6741255", "text": "def new_input_set()\n return CreateObjectInputSet.new()\n end", "title": "" }, { "docid": "7c0d7c433cd4eb8e36bdc3a383e9ec33", "score": "0.65807736", "text": "def new_input_set()\n return Ru...
a43513b7973c189d8d298747cd4313c3
Creates a Video Asset, adding the posted blob to the Video Asset's datastreams and saves the Video Asset
[ { "docid": "970d95053a9b4f6d3191d7ae337f82b3", "score": "0.69486165", "text": "def create_and_save_video_asset_from_params\n if params.has_key?(:video_url)\n video_asset = create_asset_from_video_url(params[:video_url])\n video_asset.save\n return video_asset\n else\n rende...
[ { "docid": "2600e9a7a77a2761ee1a0c9ebc80aa00", "score": "0.74057746", "text": "def create\n @video = Video.new(params[:video])\n @asset = Asset.new(params[:asset])\n @video.asset = @asset\n\n respond_to do |format|\n if @video.save\n format.html { redirect_to(@video, :notice => '...
cb42c795e37493a9102b3122cad99cf1
Sets the data and then uses the superclasses text method to render the template.
[ { "docid": "8d02eb14ed45d177b2b24ace7a4ff6d6", "score": "0.7594374", "text": "def template(data)\n data.template = 'none'\n @data = data.safe\n text\n end", "title": "" } ]
[ { "docid": "2c45d7e5023b7bb83a98ab7b75fbd37b", "score": "0.7404749", "text": "def render\n super(@template, @data)\n end", "title": "" }, { "docid": "992320b23d6bc8e83dd7855e05a8750e", "score": "0.691195", "text": "def render_text(data_hash,template)\n namespace = Open...
11e6b632b361fd8636fdd9f1c85f4a4d
Delete a history DELETE /projects/:project_id/histories/:id
[ { "docid": "7b3dd4b4ca192e000fc2758474de4718", "score": "0.79835594", "text": "def destroy\n @history = History.find(params[:id])\n @history.destroy\n redirect_to project_subproject_path(@history.subproject.project.id, @history.subproject.id), :notice => 'History wurde gelöscht.'\n end", "...
[ { "docid": "488046ec544579f63613b0323a41e8aa", "score": "0.75561225", "text": "def destroy\n @history = History.find(params[:id])\n @history.destroy\n\n respond_to do |format|\n format.html { redirect_to histories_url }\n format.json { head :no_content }\n end\n end", "title":...
c1364e2d9631ff313709b09e97af19dd
Checks if someone won
[ { "docid": "8ee89564540799ebe5bf709f18c35ab6", "score": "0.0", "text": "def win?\n self.check.each do |i|\n if i.same_values?\n self.draw\n return true\n end\n end\n false\n end", "title": "" } ]
[ { "docid": "519233c67558b00c5886e14385636649", "score": "0.76974124", "text": "def won?\n won_checker\n end", "title": "" }, { "docid": "73ce403a1342ec1d24916c25dc108f4c", "score": "0.76279974", "text": "def won?\n end", "title": "" }, { "docid": "73ce403a1342ec1d249...
3163e240871d42ce8594878940767be7
This API is used to reset the Email OTP Authenticator settings for an MFAenabled user.
[ { "docid": "a48723469be01d01b293218f944bd968", "score": "0.6585251", "text": "def mfa_reset_email_otp_authenticator_by_uid(uid)\n if isNullOrWhiteSpace(uid)\n raise LoginRadius::Error.new, getValidationMessage('uid')\n end\n\n query_parameters = {}\n query_parameters['apiKey']...
[ { "docid": "6a0444689a89ca07605a3645081620d3", "score": "0.70214754", "text": "def reset_otp_state\n @user.update(unconfirmed_mobile: nil)\n @user.remove_second_factor_mobile_id if @user.mobile.blank?\n end", "title": "" }, { "docid": "11c39ee63c55f137cfce7a1ee86dabfe", "score": "...
6a31982f4ced748c1e27d68b301fe132
GET /users/new GET /users/new.json
[ { "docid": "754ae7050f4e0b964c5179382ed8c45a", "score": "0.0", "text": "def new\n super\n end", "title": "" } ]
[ { "docid": "886855e8c82b584e43d5e0eb976cb8d6", "score": "0.83422595", "text": "def new\n @new_user = NewUser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_user }\n end\n end", "title": "" }, { "docid": "c0689c28ca79528819a61...
42a454cc613636ca7833a9a0b023597c
Register timed API calls to an owner
[ { "docid": "f3f49fc0fc85773bc4c9247668ec97f7", "score": "0.6175101", "text": "def register(owner, c, method, params = [])\n if self.verify_api_path(c, method)\n if not self.registered?(owner, c, method, params)\n id = @count\n @registry << {\n 'id' =>...
[ { "docid": "aca109323f78b25ca6aec0bd92f93078", "score": "0.6299949", "text": "def call_api\n if rate_limited?\n @calls_dropped << Time.now.to_i\n else\n actually_call_api\n @calls << Time.now.to_i\n end\n end", "title": "" }, { "docid": "853ca29b0b0a9f397dad1555b35a3...
067df1aa03472652dc812b55c0bb1f32
mode: ruby; coding: utf8 file: volume.rb Created: Last Modified:
[ { "docid": "6c90c41811b1745166baab31054efaf2", "score": "0.0", "text": "def volume(options)\n options[:width] * options[:height] * options[:depth]\nend", "title": "" } ]
[ { "docid": "49df955802ac5c28d6da1ba8c25e9d8d", "score": "0.5726003", "text": "def file; end", "title": "" }, { "docid": "49df955802ac5c28d6da1ba8c25e9d8d", "score": "0.5726003", "text": "def file; end", "title": "" }, { "docid": "49df955802ac5c28d6da1ba8c25e9d8d", "sc...
542de042351b9a90d66da43598aa23cf
Complete the 'mixColors' function below. The function is expected to return a STRING_ARRAY. The function accepts following parameters: 1. 2D_INTEGER_ARRAY colors 2. 2D_INTEGER_ARRAY queries
[ { "docid": "b74b6e6b37fade38d312164e29c2582d", "score": "0.69957215", "text": "def mixColors(colors, queries)\n ans = []\n\n queries.each { |query|\n arr = Array.new(3)\n\n colors.each { |color|\n if color[0] <= query[0] && color[1] <= query[1] && color[2] <= query[2]\n ...
[ { "docid": "5869b2a40eec697f759e0c0514a517d6", "score": "0.60148585", "text": "def apply_colors(color_array)\n str = dup\n color_array.reverse.each do |color|\n c = color[:color].empty? ? Color.send(color[:name]) : color[:color]\n str.insert(color[:index], c)\n end\n st...
3269836ef8138f18fa50a015fa243a7d
Load the configuration from the configuration file, or the environment
[ { "docid": "608d1988c384e169bc67e4745e25709e", "score": "0.70671964", "text": "def load_config\n if File.exist?(@options.config_file)\n store = YAML::Store.new(@options.config_file)\n store.transaction do\n @trello_token = store['trello_token']\n ...
[ { "docid": "a36f7f380af52a42e42228652074469c", "score": "0.78442293", "text": "def load_configuration\n config = YAML.load_file( configuration_file )\n raise \"Unable to locate worker config `#{configuration_file}\" unless config \n @config = config[environment]\n raise ...
79bad952b452c15a34870163630b7657
to display the user dashboard
[ { "docid": "aeb6a4872c4e548d4bd3d471f477b576", "score": "0.7354741", "text": "def dashboard\n end", "title": "" } ]
[ { "docid": "fa3f55e63585504155b44e40ef3eb7cc", "score": "0.7578709", "text": "def index\n\t\tredirect_to dashboard_users_path if current_user\n\tend", "title": "" }, { "docid": "371b8ee8eb8e8a55981e0747f090c133", "score": "0.7574506", "text": "def dashboard\n @user = current_user\...
c19b4c3c411bb6e10b4150bd634bcf79
Returns a client itself was logined or not. > true | false
[ { "docid": "b010e4687e48e4227866ac3376a9864c", "score": "0.0", "text": "def login?\n @current_account ? true : false\n end", "title": "" } ]
[ { "docid": "72d89876c67f545ddcc2ea73d1d2a3cb", "score": "0.7174624", "text": "def is_on_client?(client)\n @client.equal? client\n end", "title": "" }, { "docid": "a9e8cec65be4edd0654d48caa7aed8bd", "score": "0.7096869", "text": "def connected?\n @original_client.connec...
222bb8c281710894d96a4b4fe786bb17
An interesting number is one with at least 3 digits, in which the digits are either incrementing or decrementing. Examples: interesting_number(789) => true interesting_number(321) => true interesting_number(798) => false interesting_number(6) => false interesting_number(23) => false When the digits are incrementing, 0 ...
[ { "docid": "7cf3ab26c5edf3cf61e8e31eea99b362", "score": "0.8619241", "text": "def interesting_number(number)\n digits = number.digits\n\n return false if digits.size < 3\n\n number_could_be_incrementing = true\n number_could_be_decrementing = true\n\n (0...digits.size - 1).each do |i|\n number_c...
[ { "docid": "bc0cba7797d07fde60a2b3d0bee29c42", "score": "0.8732996", "text": "def interesting_number(number)\n num = number.digits\n # checking if min 3 digits\n if num.length < 3 \n return false\n end\n # if (num[1] == num[0] += 1 || num[0] -= 1) && (num[1] == num[2] += 1 || num[2...
8cc740f04f740cb519a39d455566e571
Return constant of model type_value
[ { "docid": "8a9aabc8c6db504459456dba41416b42", "score": "0.0", "text": "def type_class; \"constructor_pages/types/#{type_value}_type\".classify.constantize end", "title": "" } ]
[ { "docid": "f076b8d27a9ab573951885889d4ef75e", "score": "0.7769774", "text": "def value_type\n return @value_type\n end", "title": "" }, { "docid": "2774e9806cad7dc08a521ee065a94916", "score": "0.767763", "text": "def value_type\n end", "title": "" ...
11b13549f85362b64469ee43f222171b
this takes the method and returns it to tell the user what they are looking at on on line 74 and in the apply_method method.
[ { "docid": "20c18c165d778ef5acb0dfcb8c0d1b75", "score": "0.0", "text": "def method_to_string(method)\n method = method.to_s\n array = method.split('_')\n string = array.join(\" \")\n string.capitalize!\n end", "title": "" } ]
[ { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.6597153", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.6597153", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", ...
c939710a374dff7eb8faf71344974bab
Bulk database operation. If the number of records exceeds size then it is broken up into batches unless explicitly avoided.
[ { "docid": "f602bc37b938d766b6649f04b9d8f647", "score": "0.76794547", "text": "def bulk_db_operation(op, records, atomic: true, size: nil, **)\n __debug_items((dbg = \"UPLOAD WF #{__method__}\"), binding)\n size ||= BULK_DB_BATCH_SIZE\n succeeded, failed =\n if records.size <= size\n ...
[ { "docid": "363b19e735d8b74688478d9e25c6a91e", "score": "0.7840828", "text": "def bulk_db_operation_batches(op, records, size: BULK_DB_BATCH_SIZE)\n succeeded = []\n failed = []\n counter = 0\n records.each_slice(size) do |batch|\n throttle(counter)\n min = size * counter\n ...
0e188250938f494f64d248cf64e132de
Parse table as Array of Hashe's Each row is a Hash
[ { "docid": "df9fee37484b0d58e881d659518cc13e", "score": "0.0", "text": "def to_array\n map(&:to_hash)\n end", "title": "" } ]
[ { "docid": "4dcd5de2df038bc4d724b40d2bcd206b", "score": "0.7287132", "text": "def hashes\r\n all_rows = rows.to_a\r\n header_row = all_rows.shift or raise Exception::Error, \"no rows in table\"\r\n\r\n headers = header_row.ths.map { |header_cell| header_cell.text }\r\n result = []\r...
291c053e2270def0e27091104f1ac4f7
Convert Excel XLS (9703) Spreadsheet to XLSX Convert/upgrade Office Excel (972003) Workbooks (xls) to modern XLSX format.
[ { "docid": "d09ead25b20fbd9e831629741e96cf3c", "score": "0.53895116", "text": "def convert_document_xls_to_xlsx_with_http_info(input_file, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ConvertDocumentApi.convert_document_xls_to_xlsx ...'\n ...
[ { "docid": "b4f16cd33c29315f224d68496820e2ee", "score": "0.6463522", "text": "def convert_document_xlsx_to_xls(input_file, opts = {})\n data, _status_code, _headers = convert_document_xlsx_to_xls_with_http_info(input_file, opts)\n data\n end", "title": "" }, { "docid": "74f61161...
8b10bbb49a4a815ebd1afc5f63ef5814
Response class to wrap Savon response.
[ { "docid": "7420525236a4733e245e2f33d4215ead", "score": "0.70819736", "text": "def response_class\n Response\n end", "title": "" } ]
[ { "docid": "350f23db5716c026311d879113e86ae9", "score": "0.7731016", "text": "def response(savon_response)\n response_class.new(savon_response)\n end", "title": "" }, { "docid": "f039c0f7a2be5a7e142331673d80b3d9", "score": "0.70191956", "text": "def raw_response\n Midori::...
978afde966ecaa63cb26fd79d08d566d
algorithm to determine if T2 is a subtree of T1.
[ { "docid": "2d088633ebbf08ee44b52a1c4a8c8171", "score": "0.7620403", "text": "def check_subtree(tree1, tree2)\n # due to the depth of T1 being much larger than T2 a BFS seems more logical\n bfs(tree1.head, tree2,head)\nend", "title": "" } ]
[ { "docid": "5f32b5d26456ee7d413b6422eb0c70bf", "score": "0.83753645", "text": "def check_subtree(t1, t2)\n # Pre-compute sizes of each subtree in t1 and t2\n t1_sizes = compute_subtree_sizes(t1)\n t2_sizes = compute_subtree_sizes(t2)\n\n # Check if t2 is subtree of t1\n check_subtree_helper(t1, t2,...
3fb3fd096f1f245a1394413ae84a0ea5
A predicate which checks to see if there is an order item for the provided purchase.
[ { "docid": "274b8ae4691e0e79833be67ccbc34b7e", "score": "0.77593905", "text": "def has?(purchase)\n !find_item(purchase).nil?\n end", "title": "" } ]
[ { "docid": "53912226dfa399ee97cd2de198c3aa83", "score": "0.72160035", "text": "def purchased?(product)\n purchase_items.exists?(product_id: product.id)\n end", "title": "" }, { "docid": "7e094c249707c3fe9c384e51d478bf0c", "score": "0.6554379", "text": "def has_ordered?(item...
2bccb9728c422f3ad0df7b1625c32e08
PATCH/PUT /articles/1 PATCH/PUT /articles/1.json
[ { "docid": "603167fc6d3e2431955131127cd89b85", "score": "0.0", "text": "def update\n authorize! :make_publication, @article if params[:article][:published] == \"1\"\n #binding.pry\n respond_to do |format|\n if @article.update(article_params)\n old_tags = @article.tags.map { |i| i.ta...
[ { "docid": "127193a9b695d95bf6538bf269cb1be9", "score": "0.71689713", "text": "def update\n article = Article.find(params[:id])\n article.update(article_params)\n render json: { article: article }\n end", "title": "" }, { "docid": "151e78e59a997f5d8cfdf193c5d72379", "score": "0...
80f8e330f481c8271ad20c5ebc33bb9a
GET /patientregists GET /patientregists.json
[ { "docid": "4d839442f576d26c316002a388b7b469", "score": "0.0", "text": "def index # 자기가 작성한 것만 보임.\n\n #자기것만 보이도록..\n @patientregists = current_dpatient.patientregists.all\n\n @stdoctorregists = current_dpatient.stdoctorregists.all\n\n\n end", "title": "" } ]
[ { "docid": "a06e41bd2473b9a7f919259eeca62818", "score": "0.67112327", "text": "def get_patient_list\n getProfile\n @patientlist = TherapistPatient.get_my_patients @therapist.user_id\n respond_to do |format|\n format.html { render :template => 'therapist/get_patient_list' }\n format.js...
a6d7011aa8aca9b739e1501f12ea4a8f
GET /kicks GET /kicks.json
[ { "docid": "6964cb5ae474730f759beada2d644bf1", "score": "0.6874621", "text": "def index\n @kicks = Kick.all.order(brand: :asc)\n render json: @kicks\n end", "title": "" } ]
[ { "docid": "9d069d0a768bb8738b74720f51c8412f", "score": "0.6568424", "text": "def show\n @picks = current_user.picks\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pick }\n end\n end", "title": "" }, { "docid": "e67bf2f76147c6ce3a94...
b14ae4618a92d4f748f74fab15d79cf2
Gets the content property value. The content stream, if the item represents a file.
[ { "docid": "1d8e19a5b996f9e166dc835bd45232dd", "score": "0.642865", "text": "def content\n return @content\n end", "title": "" } ]
[ { "docid": "9ff3fc5bdafb6cac14e4b488240f9a52", "score": "0.69963026", "text": "def content\n @content ||= File.read(path, size)\n end", "title": "" }, { "docid": "31f724ead4f0f71df60c7fe94b48ab8d", "score": "0.69940495", "text": "def content\n asset.value || asset.attachme...
0fb6a06925d37e15b635e37d91f6afd3
Return the computed histogram as an array of Bin objects.
[ { "docid": "6d1d605c885725a20396997b8eb3d48f", "score": "0.0", "text": "def to_a\n @result\n end", "title": "" } ]
[ { "docid": "7e20fe7167dd58aff4860fd19069f4e6", "score": "0.6879719", "text": "def write_bins\n []\n end", "title": "" }, { "docid": "27f65e2695e74282c71312d47a6eb438", "score": "0.6823743", "text": "def output_bins\n return @output_bins\n end", "...
6dfe8c7f2a45ef0906b7a2e4c0e58476
Creates an enumerated value named +name+ with a unique autoincrementing index number.
[ { "docid": "ebc82216edc01e910c36aa98a9446bb1", "score": "0.6007051", "text": "def initialize name\n @name = name.to_s.freeze\n @index = self.class.values.size\n self.class.values << self\n end", "title": "" } ]
[ { "docid": "16f7628cce6c902e86cdcd26a65c84ac", "score": "0.66724557", "text": "def add(name, value = current_value)\n type.add(name.to_s, Integer(value))\n @current_value = Integer(value) + 1\n end", "title": "" }, { "docid": "f703698c551de4d9a6bbfd51...
ce2469c60ee91725e77eb4ae460949c8
retracts the given item from the service
[ { "docid": "9c24ec3a7ba578b1d6e6bb6f36b4f662", "score": "0.0", "text": "def receiveItemRetraction\n token = params[:token]\n roomName= params[:roomName]\n collectionName= params[:collectionName]\n nodeName = params[:nodeName]\n item= params[:item]\n itemid = item[\"itemID\"]\n\n res...
[ { "docid": "3899fb532457793aae06dd45ade49892", "score": "0.70832396", "text": "def remove_item(item)\n end", "title": "" }, { "docid": "f539f7626b4a6b40283058d2ae523842", "score": "0.69925654", "text": "def remove item\n end", "title": "" }, { "docid": "b4571e03f1400b...
7025d17cc2d885f3dedd5cb5d1d81aff
=begin === Release all locks set by the current transaction =end
[ { "docid": "777a7bdea44ed58a7f4e183f6151d765", "score": "0.5986559", "text": "def unlock()\n sendReceiveCommand(CliCmdPrecommit)\n end", "title": "" } ]
[ { "docid": "ffa461fc74074178b687546f2c35f2f7", "score": "0.80295646", "text": "def finish\n\t\tself.release_all_locks\n\tend", "title": "" }, { "docid": "0bbe15d3f421d96d5c21ba75a1fb4c20", "score": "0.77838594", "text": "def finish\n\t\t@lock.release_all_locks\n\tend", "title": "...
3b177d52edb15059609e4475052d54a5
Retrieve the failures, key => message [Hash]
[ { "docid": "a6bc82ef7bb9615c7af5f03491cd3a18", "score": "0.8044251", "text": "def failures\n Hash[status.map { |device_key, v| [device_key, v[\"message\"]] } ]\n end", "title": "" } ]
[ { "docid": "57fd4c537e57f81c2dd4035618cc8cf4", "score": "0.7613422", "text": "def key_failures\n key(\"example_failures\")\n end", "title": "" }, { "docid": "1b579ac5ed71f9a0ee2b4ef6f57e52b2", "score": "0.7034221", "text": "def display_failures\n @data[\"display_failures...
b07927ae7001fb53e7eecc32e770c0b9
find the sum of all multiples of 3 or 5 below 1000
[ { "docid": "d36e1d0ee79d6d34b6490f0b37ae871f", "score": "0.75572276", "text": "def test_large_sum\n assert_equal(233168, sum_multiples_upto(3, 5, 1000))\n end", "title": "" } ]
[ { "docid": "f69e9cb8df44a1949b85f902e68b4d98", "score": "0.8284502", "text": "def multiples_of_3_5\n sum = 0\n 1000.times do |i|\n sum += i if i % 3 == 0 || i % 5 == 0\n end\n sum\nend", "title": "" }, { "docid": "833c2e0d88ede9230847827baeac0591", "score": "0.82666194", "text...
0f00580d530c327c973e0e66d5e89168
create_proposal called on proposal creation.
[ { "docid": "ffee53898e4282e779afa9c6d62aa4a9", "score": "0.0", "text": "def create_proposal\n @logger.debug(\"hadoop_infrastructure create_proposal: entering\")\n base = super\n\n adminnodes = [] # Crowbar admin node (size=1).\n servernodes = [] # Hadoop server node (size=1).\n namenodes ...
[ { "docid": "4e226da427a15f99a0c3e485f6c3927a", "score": "0.8202715", "text": "def create_proposal\n @logger.debug(\"Pacemaker create_proposal: entering\")\n base = super\n\n @logger.debug(\"Pacemaker create_proposal: exiting\")\n base\n end", "title": "" }, { "docid": "f945ecc36...
3e30fcad35d6bbbaaaa53627b9a235eb
GET /recipelists/1 GET /recipelists/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "0a2a62961fd362ed1c37fc72882a19a3", "score": "0.7230896", "text": "def index\n @recipelists = Recipelist.all\n end", "title": "" }, { "docid": "73a202d7dd0183f7650fa49016ede36b", "score": "0.7047346", "text": "def index\n @recipes_lists = RecipesList.all\n end", ...
c2a1f3d245cea1394137f919de6eda27
Has this user linked their account to twitter?
[ { "docid": "ea1c27a6c84b8c2c6e5159a674074964", "score": "0.68388397", "text": "def twitter_authentication?\n authentications.any? { |a| a.is_a? TwitterAuthentication }\n end", "title": "" } ]
[ { "docid": "48e62c91666d9dd6f0f93d2889189fa8", "score": "0.79673684", "text": "def check_twitter_linked\n unless current_user.twitter_linked?\n redirect_to link_twitter_influencer_registration_path\n end\n end", "title": "" }, { "docid": "90591e9e658c025f5a787b48aafbc47b", "s...
b84e49e30b1746166824df13eb36726e
Delegation to Query class.
[ { "docid": "3c7749e9621116de4da89ab3cf78eff7", "score": "0.76943994", "text": "def method_missing(method_name, *args, &block)\n if Query.instance_methods(false).include?(method_name)\n Query.new(self).send(method_name, *args, &block)\n else\n super\n end\n end...
[ { "docid": "67148f325bc42171a9c1639571bd0b00", "score": "0.7742131", "text": "def query\n super\n end", "title": "" }, { "docid": "8635cb37ecb37a3343f09b4bd79e49a1", "score": "0.7421842", "text": "def query\n @operation = :query\n self\n end", ...
423748b60388906b441eb44701917eaa
Store provided string in a file with the provided file name under the target storage path through Filepicker.
[ { "docid": "998f37f46bffb76749c843547b6d0b6a", "score": "0.0", "text": "def store_content(content, file_name, path=nil, options = {})\n store_file = Tempfile.new(file_name)\n\n begin\n store_file.write content\n store_file.rewind\n\n return store(store_file, path, options)\n ensu...
[ { "docid": "b055ca1e0218e789f058ba91c68f8acc", "score": "0.7018529", "text": "def custom_file(path, str)\n write_to_file_in_storage_directory(path, str)\n end", "title": "" }, { "docid": "b055ca1e0218e789f058ba91c68f8acc", "score": "0.7018529", "text": "def custom_file(path, ...
b14fd8d1fc38816ba649118816314471
GET /items GET /items.json
[ { "docid": "d35c708c15b788f36383a8b7ce83089c", "score": "0.0", "text": "def index\n end", "title": "" } ]
[ { "docid": "d57502db186679bf451e04276f7c18d6", "score": "0.8122018", "text": "def items\n get_request configure_payload('/items')\n end", "title": "" }, { "docid": "005225439f5ef107aba338963dfc8a47", "score": "0.7835984", "text": "def get_items\n render json: { items: @lis...
92f3be974f9ba17a7ba2974904243059
Make sure the entire catalog is evaluated.
[ { "docid": "5aaea2d43efe4ccf2908567a0f833bb6", "score": "0.5077974", "text": "def fail_on_unevaluated\n fail_on_unevaluated_overrides\n fail_on_unevaluated_resource_collections\n end", "title": "" } ]
[ { "docid": "7de4f197a5614e36b3d0ac49d281f23b", "score": "0.6142795", "text": "def catalog; end", "title": "" }, { "docid": "0e1f78244e060d600b07eea64b05a5ac", "score": "0.5819979", "text": "def clean_catalog\n if @options[:only_include].empty?\n clean_by_includes\n else\n ...
045afd5366714e4ba6e1fc94f7162e8b
Typecast a value to a Float
[ { "docid": "1069d090c13686061dd5d5d72bb16d19", "score": "0.86644626", "text": "def typecast_to_float(value)\n typecast_to_numeric(value, :to_f)\n end", "title": "" } ]
[ { "docid": "0b2f7f2a8b2d1e75daa85bf94908ebcb", "score": "0.895746", "text": "def typecast_value_float(value)\n Float(value)\n end", "title": "" }, { "docid": "6c7cd080bfac621ff188119d6af8c5b3", "score": "0.8279034", "text": "def to_f\n Float(value)\n end", "title"...
761b76df7ffc4371c2de417137c6b850
Public: Method to destroy end the conversation for a user and remove it from his list. Works only for existing records. Returns true or false.
[ { "docid": "b052b2ee340459922ad9341fbe9864eb", "score": "0.0", "text": "def stop\n\n # Legacy transaction\n if topic.kind_of?(Cloud)\n user.clouds_moderated.delete(topic)\n user.clouds.delete(topic)\n\n topic.moderators.delete(user)\n topic.users.delete(user)\n\n topic.sav...
[ { "docid": "79536b549a79af561860806abc6a6d6b", "score": "0.69586253", "text": "def destroy\n @conversation_user.destroy\n respond_to do |format|\n format.html { redirect_to conversation_users_url, notice: 'Conversation user was successfully destroyed.' }\n format.json { head :no_content ...
b8ff6ee5652d64162e395edcbece3b43
Method to display the grid.....................
[ { "docid": "9bb34266c2f3ff6181738d8bb979f3d4", "score": "0.0", "text": "def display_grid(array)\n\tfor i in 0...10\n\t\tfor j in 0...10\n\t\t\tprint \"| #{array[i][j]} | \"\n\t \n end\n \tputs \"\\n\"\n end\nend", "title": "" } ]
[ { "docid": "8759e0b0aa29db463ac940a57605a1ea", "score": "0.85778654", "text": "def display\r\n add_header_to_display\r\n add_horizontal_line_to_display\r\n\r\n @grid.each_with_index do |row, index|\r\n add_row_to_display(row, index)\r\n end\r\n end", "title": "" }, { "docid...
bfdd2fdede758dac08ad29647c61bead
Called from current_user. First attempt to login by the user id stored in the session.
[ { "docid": "4a5668b8d0ad464438cd4fa4158f2657", "score": "0.8351843", "text": "def login_from_session\n self.current_user = User.find_by_id(session[:user_id]) if session[:user_id]\n end", "title": "" } ]
[ { "docid": "ae083ecc57873732aab67adf7b669d4a", "score": "0.85525495", "text": "def try_login_from_session\n self.current_user = User.find_by_id(session[:user_id]) if session[:user_id]\n end", "title": "" }, { "docid": "f51a7636fcfd1cf5473efffab97d7a03", "score": "0.8549002", "tex...
b911d6beae472a6e37a98e5452838462
GET /main_accounts/1 GET /main_accounts/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "af076baf9570fedd83417eb7db08a60f", "score": "0.72317934", "text": "def index\n @main_accounts = MainAccount.all\n end", "title": "" }, { "docid": "0f21bc74568ad4208fa36aa1a85c9e6a", "score": "0.71379024", "text": "def index\n index = json_account_params[:json_id].t...
3bfd1bb3a941f6293ba8c3a296467a5a
The default markup method. You should override this method in your application to call your custom markup methods.
[ { "docid": "83811ed89aefaffed21016ddc3e700d8", "score": "0.0", "text": "def expand(str)\n if str\n xstr = str.dup.html_filter\n# xstr.gsub!(/</, '&lt;')\n# xstr.gsub!(/>/, '&gt;')\n xstr.gsub!(/\\n/, '<br />')\n\n return xstr\n end\n return nil\n end", "title": "" ...
[ { "docid": "b710e95b00bd0ad7b55fc15b2f373774", "score": "0.7257966", "text": "def markup_context; end", "title": "" }, { "docid": "1f557a018b68b77efefe0ac76bbaba6b", "score": "0.69077945", "text": "def definition_as_html() \"default html #{self.class}\" end", "title": "" }, {...
d1eaae2d59e8d4ea1b9528352f3cb67b
GET /chairs/1 GET /chairs/1.json
[ { "docid": "fcbc5941024bf277960dd875b87ab797", "score": "0.6473343", "text": "def show\n @chairs = Chair.all\n end", "title": "" } ]
[ { "docid": "b9ec6ea4417c58cc7df8d4ae2adf53ae", "score": "0.7558157", "text": "def index\n @chairs = Chair.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @chairs }\n end\n end", "title": "" }, { "docid": "09a9a44299bac283551f3197...
9cf1b6c9df87269725730110a0bf18da
Accepts one argument, the card total Prints the value of the cards to the screen
[ { "docid": "2556632f4d94786a58d003e880435242", "score": "0.82577133", "text": "def display_card_total(card_total)\n # code #display_card_total here\n puts \"Your cards add up to #{card_total}\"\nend", "title": "" } ]
[ { "docid": "a38e0597cda8e77fd7dc8647660ac946", "score": "0.8517985", "text": "def display_card_total(card_total)\n puts \"Your cards add up to #{card_total}\"\nend", "title": "" }, { "docid": "65752e9e46bc0fb409e8cdf61ab2af21", "score": "0.8301343", "text": "def display_card_total(n...
a292826cfabd574dea729bb875a02d2b
This method should initialize the contact's attributes
[ { "docid": "310676819c05697696693fb4718c96d1", "score": "0.0", "text": "def initialize(first_name, last_name, email, note='N/A')\n @first_name = first_name\n @last_name = last_name\n @email = email\n @note = note\n @id = @@id\n @@id +=1\n end", "title": "" } ]
[ { "docid": "636a7de482db33cb238061963b9ab154", "score": "0.7437176", "text": "def initialize()\n super\n @odata_type = \"#microsoft.graph.contact\"\n end", "title": "" }, { "docid": "c339fd84ceaa72ba9792339c2a519976", "score": "0.73074895", "t...
5369a9c4ab794b7cda93f3505ae5dd5a
GET /bar49s/1 or /bar49s/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "dd341725e6fd6f6c6e4256cbf93f8364", "score": "0.6511157", "text": "def show\n @bar = Bar.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bar }\n end\n end", "title": "" }, { "docid": "ec0f1c892cb0336e9a00...
2518682406ac6a79a648061048134e85
Setter board[x, y] = obj
[ { "docid": "44aea8e106ea2a2255178bac60acbb4f", "score": "0.8070816", "text": "def []=(pos, obj)\n x, y = pos\n @grid[y][x] = obj\n end", "title": "" } ]
[ { "docid": "dba69ff0fdfbbe3d942acc04fe6e9bd7", "score": "0.7804616", "text": "def set_cell(x, y, obj)\n @grid[x][y] = obj if is_valid?(x, y)\n end", "title": "" }, { "docid": "eeaaabd2514fc7d9476df1d10342384a", "score": "0.7792703", "text": "def set_cell(x,y, obj)\n @gri...
99cdae7857ff9c2efc1475de8b7039f1
DELETE /grupy/1 DELETE /grupy/1.json
[ { "docid": "55a8dad8f6480bdb3a124e345a039897", "score": "0.7529969", "text": "def destroy\n @grupa = Grupa.find(params[:id])\n #@grupa.destroy\n\n respond_to do |format|\n format.html { redirect_to grupy_url }\n #format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "15a6a143ccf1b45fdebca58c0fff9b9a", "score": "0.7322402", "text": "def destroy\n @grupo = Grupo.find(params[:id])\n @grupo.destroy\n\n respond_to do |format|\n format.html { redirect_to grupos_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "...
ffad8ea9295390774f7f00389faf6e5a
PATCH/PUT /doses/1 or /doses/1.json
[ { "docid": "24a519d099e7ecd1e6cfc26a8f28a073", "score": "0.6031541", "text": "def update\n respond_to do |format|\n if @dose.update(dose_params)\n log = @dose.log\n patient = log.patient\n format.html { redirect_to patient_log_path(patient, log), notice: \"dose was successfu...
[ { "docid": "1f957e8396714ab340b20ef5268dceb0", "score": "0.69316554", "text": "def update\n @diocese = Diocese.find(params[:id])\n\n if @diocese.update(diocese_params)\n head :no_content\n else\n render json: @diocese.errors, status: :unprocessable_entity\n end\n end", "title"...
6a5f632d620f8f6fb56d46879c3d263f
PATCH/PUT /faceposts/1 PATCH/PUT /faceposts/1.json
[ { "docid": "bdb9201574400186a7e1b1e79c82d1a5", "score": "0.6846969", "text": "def update\n respond_to do |format|\n if @facepost.update(facepost_params)\n format.html { redirect_to @facepost, notice: 'Facepost was successfully updated.' }\n format.json { render :show, status: :ok, ...
[ { "docid": "268a8837ab76129f50aa6c9a2c5e73c3", "score": "0.6562524", "text": "def update\n @post.update!(post_params)\n render json: {status: :ok}\n end", "title": "" }, { "docid": "779a91b90c7e731678971b5689ec9b70", "score": "0.6527254", "text": "def update\n @post = Post....
fbf936615f25225c2d086931197d4dd8
def move_dirs case self.class when Rook return ORTHOGONAL_DIRS when Bishop return DIAGONAL_DIRS when Queen return ORTHOGONAL_DIRS + DIAGONAL_DIRS end end
[ { "docid": "e33180f36e38ee4accb3128027f86aa1", "score": "0.0", "text": "def moves\n unblocked_moves = []\n self.move_dirs.each do |dx, dy|\n debugger\n unblocked_moves << grow_unblocked_moves_in_dir(dx, dy)\n end \n unblocked_moves\n end", "title":...
[ { "docid": "bab49da0d21b6bbfea1419ef96555791", "score": "0.8189589", "text": "def move_dirs\n #implemented by subclass\n end", "title": "" }, { "docid": "e2a3a83cff85decb345fca59d776c785", "score": "0.8115487", "text": "def move_dirs; end", "title": "" }, { "docid": "...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "e602b0c93514fa138d803eb9218a6ae0", "score": "0.0", "text": "def set_milestone_report\n @milestone_report = MilestoneReport.find(params[: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...
5ef5a48a85090ffd104b5774cbfe5857
initially wrote with arr_num.each. Bad results because .shift was mutating the array while iterating through. LS >
[ { "docid": "1d0ce3854d904d155b6819d01be4ac99", "score": "0.0", "text": "def string_to_integer2(string)\n digits = string.chars.map { |char| HASH[char] }\n\n value = 0\n digits.each { |digit| value = 10 * value + digit }\n value\nend", "title": "" } ]
[ { "docid": "d559eb6bcce7de023ee7813fb3e65bdf", "score": "0.65552354", "text": "def g_num(arr)\n\nindex = 1\n\n arr.length.times do \n\n if arr[0] >= arr[index]\n index += 1\n else\n arr[0] = arr[index]\n end\n\n end\n\np arr[0]\n\nend", "title": "" }, { "docid": "82785e...
c23eb844873835330907b5f5361b52a8
GET /projects/1/take GET /projects/1/take.json
[ { "docid": "7b9da220925978f6e1a360cede734078", "score": "0.6353263", "text": "def take\n respond_to do |format|\n if @project.update(student: current_student)\n format.html { redirect_to @project, notice: 'Project was successfully taken.' }\n format.json { render :show, status: :ok...
[ { "docid": "e32dd264f8519d1d6437a4ba554d8620", "score": "0.6619733", "text": "def show\n @take = Take.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @take }\n end\n end", "title": "" }, { "docid": "6547b8596764f855b...
84b3083f2813ecfd356e575fddb47fcc
============================================================================= hal_SdmmcSendCmd Send a command to a SD card plugged to the sdmmc port.
[ { "docid": "c7f099688c4c9b57432ea5905d3342bf", "score": "0.86225855", "text": "def hal_SdmmcSendCmd(cmd, arg)\n $SDMMC.SDMMC_CONFIG.w 0x00000000\n \n configReg = 0\n # configReg = $SDMMC.SDMMC_CONFIG.wl(0,0)\n configReg = $SDMMC.SDMMC_CONFIG.prepl(configReg)\n\n ...
[ { "docid": "91b0c99179f2e4de05873e209e1f80a6", "score": "0.8661644", "text": "def hal_SdmmcSendCmd(cmd, arg)\r\n $SDMMC.SDMMC_CONFIG.w 0x00000000\r\n \r\n configReg = 0\r\n # configReg = $SDMMC.SDMMC_CONFIG.wl(0,0)\r\n configReg = $SDMMC.SDMMC_CONFIG.prepl(configReg)\r...
6b939ec69555440cb42518aaefe2b9fe
POST /football_events POST /football_events.json
[ { "docid": "c2158870b9a5a546d6cd307c0225e651", "score": "0.7701125", "text": "def create\n @football_event = FootballEvent.new(football_event_params)\n\n respond_to do |format|\n if @football_event.save\n format.html { redirect_to @football_event, notice: 'Football event was successful...
[ { "docid": "806d4b9cd66a3cef7fd8b561200b1b16", "score": "0.71601367", "text": "def test_should_create_event_via_API_JSON\r\n get \"/logout\"\r\n post \"/events.json\", :api_key => 'testapikey',\r\n :event => {:name => 'Test API Event 1',\r\n ...
4504ba6bf5a9096768484f7ed3192aec
Check the validity of the keys
[ { "docid": "b94f094ba81d1c44f77da49bf37d1ee9", "score": "0.0", "text": "def authenticate_with_api_keys\n key = Keyper::ApiKey.find_by(api_key: request.headers[API_KEY])\n unless key&.authenticate(request.headers[API_SECRET])\n raise Keyper::ApiKeyError, I18n.t(:api_key, scope: [:keyper, :erro...
[ { "docid": "c2b93f727d897d580c24393ccc912e32", "score": "0.8444418", "text": "def check_key_valid; end", "title": "" }, { "docid": "0c68302d3f1139c3e96c42b2cfd093a6", "score": "0.81497", "text": "def validate_keys(*valid_keys); end", "title": "" }, { "docid": "0c68302d3f1...
a403e090fed8aadd4963338f69fc3ecc
sort data by year and month
[ { "docid": "b15fcd35623743d8fc355a061537a9bf", "score": "0.6828296", "text": "def sort_bib(bib)\n months = {\n 'jan' => 1,\n 'feb' => 2,\n 'mar' => 3,\n 'apr' => 4,\n 'may' => 5,\n 'jun' => 6,\n 'jul' => 7,\n 'aug' => 8,\n 'sep' => 9,\n 'oct' => 10,\n 'nov' => 11,\n ...
[ { "docid": "b8411bfa6d259c0fa5dcc65da5303ffd", "score": "0.7583646", "text": "def sort_date_by_month()\n # @records_list.sort do |a,b|\n # a.birthday.mon<=>b.birthday.mon\n @records_list.sort do |a,b|\n a.birthday_month<=>b.birthday_month\n end\n end", "title": "" }...
52e3d3c31cbe1e0c2290d38297ce0682
get request, client wants data from the server (doens't make any change) post request, changing stuff on the server (makes changes)
[ { "docid": "81bc5980012b669634ee37d10cd8548c", "score": "0.0", "text": "def send_message(message)\n if @selected\n return @selected.send_message(message, @selected)\n end\n end", "title": "" } ]
[ { "docid": "5a2516e98c1cc06ddba8020bd27f19bf", "score": "0.67232704", "text": "def post()\n return @http.request(@req)\n end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.66698015", "text": "def request; end", "title": "" }, { "doci...
584884f31d77ed0761a7b98272bd58b8
GET /games/new GET /games/new.json
[ { "docid": "c37bd7a2d48ea728aba8a6668a8fdd84", "score": "0.0", "text": "def new\n @game = Game.new\n\n @game.map_id = params[:map_id]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @game }\n end\n end", "title": "" } ]
[ { "docid": "f3c48ac66e56e00a84dd69f137d98f05", "score": "0.80359674", "text": "def new\n @team = Team.find(params[:team_id])\n @game = @team.games.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @game }\n end\n end", "title": "" }, ...
6e6e4f75f25ace0d4d61f22cdff03fcd
This method turns all the card faceup
[ { "docid": "c7e8b7a51320608041e988e7bf308233", "score": "0.8174567", "text": "def turn_all_cards_up\n @cards.each { |card| card.turn_face_up }\n end", "title": "" } ]
[ { "docid": "10b234be4245049d461a2416dfb94432", "score": "0.74587846", "text": "def flip_face_up\n file = \"./cardPics/\"\n file.concat @cardValue.to_s\n file.concat \"_\"\n if @cardSuit == 1\n file.concat \"hearts\"\n elsif @cardSuit == 2\n file.concat \"spade\"\n elsif @card...
ccd10f617779d43706313e9f878066c8
config:: packager config payload:: Payload Retrieve previous versions from asset store and add to history
[ { "docid": "8bd5c4251b910fb32e017272949a0a80", "score": "0.7476472", "text": "def load_history_assets(config, payload)\n if(versions = config.get(:build, :history, :versions))\n versions = [versions].flatten.compact.uniq\n ext = config.get(:target, :package)\n versions....
[ { "docid": "9a6dbde4076248b7e72ec58eda63e7ee", "score": "0.6231989", "text": "def payload_for_updated\n changelog = fetch(:changelog)\n\n changelog.gsub!(/\\(#(\\d+)\\)/, \"(<%{repo_url}/pull/%{pr}|#%{pr}>)\" % {repo_url: fetch(:repo_url), pr: '\\1'}) unless changelog.empty?\n\n revision_...
606ba8b7baf9edd9421eab07d6963725
=begin Write a method that takes a positive integer, n, as an argument, and displays a right triangle whose sides each have n stars. The hypotenuse of the triangle the diagonal side in the images below) should have one end at the lowerleft of the triangle, and the other end at the upperright. =end
[ { "docid": "5ca9bb0a4ee0633b9ca7f2401e80ef9d", "score": "0.76946497", "text": "def triangle(num)\n spaces = num - 1\n stars = 1\n\n num.times do |n|\n puts (' ' * spaces) + ('*' * stars)\n spaces -= 1\n stars += 1\n end\n\nend", "title": "" } ]
[ { "docid": "4f11008d87cde7aba283a54188b268c9", "score": "0.83526987", "text": "def tl_triangle(n)\n stars = n\n n.times do\n puts '*' * stars\n stars -= 1\n end\nend", "title": "" }, { "docid": "348767b5841d448a640f7c910df2c54f", "score": "0.81132495", "text": "def triangle(...
0cdb55063530cc1c52863335983470de
POST /admin/shirt_colors POST /admin/shirt_colors.json
[ { "docid": "c6a10e125e7ef1844877273a4cb42e78", "score": "0.7479431", "text": "def create\n @shirt_color = ShirtColor.new(params[:shirt_color])\n\n respond_to do |format|\n if @shirt_color.save\n format.html { redirect_to admins_shirt_colors_url, notice: 'Shirt color was successfully cr...
[ { "docid": "8cc654a8a5d8a8174f239c971a220a7a", "score": "0.72730416", "text": "def create\n respond_to do |format|\n require 'rest-client'\n response = RestClient.post('localhost:3001/colores/', color_params.as_json, {:Authorization => 'admin irizREhyoG6Ejwr4AcjsQME9'})\n if response.c...
09018e09ad75688be70bcc2df5304e5c
must be implemented for ensurable()
[ { "docid": "e479023003ae35bbbb57684d23be04ff", "score": "0.0", "text": "def destroy\n #search all slots by NAME\n \n true\n end", "title": "" } ]
[ { "docid": "c68681fa99797b1abc929cb53e2dd3dd", "score": "0.5813277", "text": "def attachable; end", "title": "" }, { "docid": "c68681fa99797b1abc929cb53e2dd3dd", "score": "0.5813277", "text": "def attachable; end", "title": "" }, { "docid": "0d2b462639a976447825d8894ca350...
d9b1f8b6be64250e384cc53ac840719e
GET /teams/1 GET /teams/1.xml
[ { "docid": "3a9ebd9343cbf2e5d72d6b40c7d92534", "score": "0.0", "text": "def show\n @team = Team.find(params[:id])\n @player = Player.new( :team => @team, :team_id => @team.id )\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @team }\n end\n ...
[ { "docid": "c70f9f1aa48c10500bb2d40212b49402", "score": "0.73366994", "text": "def index\n @teams = Team.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @teams }\n end\n end", "title": "" }, { "docid": "c10207dc5467eeee3...
d30cf75ce4888bcbeb6f568c109d9fd5
PUT /users/1 PUT /users/1.xml
[ { "docid": "cfc6ffe9f5209d77af2d6585a38b45fe", "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\t@user.roles.delete(Role.find_by_name(\"admin\"))\n if params[:admin] == \"true\"\n @use...
[ { "docid": "796bea4dfdd3ac16e7fb19e770af3338", "score": "0.6381075", "text": "def update_user_attributes(attributes)\n # puts \"update_user_attrbites: [#{attributes.inspect}]\"\n raise ArgumentError, \"username blank\", caller if attributes['username'].empty?\n path = \"/a/feeds/nyit.edu/...
073b5f7d288a62f091693db0fd4bd132
Load the given file name. Path is relative to that of the calling file's.
[ { "docid": "c834d4d327427811532b2c7b9419ebe9", "score": "0.6225772", "text": "def requireFile( name )\n\tKesh::ArgTest::stringLength( \"name\", name, 1 )\n\trequire File.expand_path( File.dirname( Kesh::Loader::ModuleInfo.getCallingFile() ) + \"/\" + name )\nend", "title": "" } ]
[ { "docid": "ea1d68dd5133a440a06a0caab547f153", "score": "0.79940134", "text": "def loaded(name, file)\n self.class.loaded(File.join(@path, name.to_s))\n end", "title": "" }, { "docid": "ddf6f52755e0b6cc4501c66966d6e653", "score": "0.7804039", "text": "def loadFile( name )\n\tKesh...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "5932b0f0fcc39c53a0decdcf3cab23a8", "score": "0.0", "text": "def chip_params\n params.require(:chip).permit(:stat_id, :operator, :ddd, :phoneNumber, :value)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title"...
918a272da04b3a0801757095056dda84
Returns a request model for obtaining the count of sessions
[ { "docid": "b0e8da5e25a0ca1dab3260254fbe117a", "score": "0.7605676", "text": "def total_sessions_request_model(session, app_id, start_time, end_time, build)\n path = growth_analytics_endpoint(session, app_id, 'total_sessions_scalar')\n params = {\n 'app_id' => app_id,\n ...
[ { "docid": "5124b9f9c6c355eba8359452bcf622f3", "score": "0.7589896", "text": "def total_sessions_request_model(session, app_id, start_time, end_time, build)\n path = growth_analytics_endpoint(session, app_id, 'total_sessions_scalar')\n params = {\n 'start' => start_time,\n ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "cc2d72c54959ff422bef70cbc0b466b9", "score": "0.0", "text": "def display_params\n params.require(:display).permit(:name, :active, :order, :resolution)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69811666", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6782836", "text": "def strong_params\n params.requ...
30437f47a0e486e7fef4300aacd35319
returns number of copies, or zero if this obj is not standard uses eager loaded field if available
[ { "docid": "45dbbf3a722add087fb4ee429054e3fa", "score": "0.6342643", "text": "def copy_count\n is_standard? ? (respond_to?(:copy_count_col) ? copy_count_col : copies.count) : 0\n end", "title": "" } ]
[ { "docid": "f3068242a92856808076bd968b02e180", "score": "0.65862393", "text": "def object_count; @objects.length; end", "title": "" }, { "docid": "173a55d4fcbc6716bc723a0294299907", "score": "0.6413512", "text": "def size\n lazy_load if added?\n loaded? ? super : result...
491ac546d0e6654986cbe7ccfe38d692
method_defined?(:sprite) new method: hitbox_y_offset
[ { "docid": "15a62a9ff7c725c384794f3b3c2e3d12", "score": "0.7568126", "text": "def hitbox_y_offset\n return -4\n end", "title": "" } ]
[ { "docid": "a0f1c5d1dcd4d141e91862c1a500c1fb", "score": "0.6761634", "text": "def hit_box(offset)\n [ @x - offset, @y, @width, @height ]\n end", "title": "" }, { "docid": "2b546f18d3ce0dcf6a5176e807fd1603", "score": "0.67139685", "text": "def hit_box(offset)\n [ @x - ( @width ...
e721a58b9c293a10ef2b358e2a40a2ae
POST /perfumes def create
[ { "docid": "c7059dcb29586e6ec62f51f8a531f8d6", "score": "0.0", "text": "def update\n if @perfume.update(perfume_params)\n render json: @perfume\n else\n render json: @perfume.errors, status: :unprocessable_entity\n end\n end", "title": "" } ]
[ { "docid": "6d089ecd0482d1810068048f9d9360aa", "score": "0.72513765", "text": "def create\n @perfume = Perfume.new(perfume_params)\n\n respond_to do |format|\n if @perfume.save\n format.html { redirect_to @perfume, notice: 'Perfume was successfully created.' }\n format.json { re...
77b415e826b1e3dcd1cd7e217e6070d0
Adds +message+ to the hint messages on +attribute+. More than one hint can be added to the same +attribute+. If no +message+ is supplied, :invalid is assumed. If +message+ is a symbol, it will be translated using the appropriate scope (see +translate_hint+). If +message+ is a proc, it will be called, allowing for thing...
[ { "docid": "acbea67d79998fc31188769709714adf", "score": "0.65625256", "text": "def add(attribute, message = nil, options = {})\n message = normalize_message(attribute, message, options)\n if options[:strict]\n raise ActiveModel::StrictValidationFailed, full_message(attribute, message)\n...
[ { "docid": "72baecb62aaeb733fa717a0c831d5136", "score": "0.6416781", "text": "def add(attribute, msg = @@default_error_messages[:invalid])\n @errors[attribute.to_s] = [] if @errors[attribute.to_s].nil?\n @errors[attribute.to_s] << msg\n end", "title": "" }, { "docid": "9518ac810...
8d8ad81d6f9f3f7acc7141f5e84245b4
display views for a controller pass return_ary to return the actions as an array
[ { "docid": "e0cda3996f112ba4d0bcb10032b95a3b", "score": "0.70043546", "text": "def views_for(controller=nil, return_ary=false)\n unless controller.nil?\n list = File.expand_path(\"app/views/#{controller}\")\n # we don't need the . entry or anything that might be considered a partial\n ...
[ { "docid": "73a359d1b4e3f7b83e48eae450058211", "score": "0.6844834", "text": "def index\n respond @action_templates\n end", "title": "" }, { "docid": "492e7f75076c7401323945927949caec", "score": "0.6705213", "text": "def index\n render_json_dump({ actions: [] })\n end", ...
0f568fc9d9c67288363956a80e481733
POST /ride_drivers POST /ride_drivers.json
[ { "docid": "eaa8728b035dab000a3899d374aa2e67", "score": "0.55607104", "text": "def create\n break_flag = false\n @user = current_user\n @ride = Ride.find(params[:ride_id])\n @ride_driver = @user.ride_drivers.build(:ride => @ride)\n\n if RidePassenger.exists?(:ride_id => @ride, :user_id =>...
[ { "docid": "883e1db93060106091f621904a92e912", "score": "0.6969911", "text": "def create\n @ride = Ride.new(driver_ride_params.merge(\n driver: current_user,\n created_by: current_user,\n notification_subscriptions: [RideNotificationSubscription.new(\n user: current_user,\n ...
b63d774753e94b1ab8f460550c3f07bf
Return the details to include in the contents of the inspected object.
[ { "docid": "2e7c31d42b1bab2eab1c7f9ee7fc1e67", "score": "0.7036655", "text": "def inspect_details\n\t\treturn %Q{%s -- %d headers, %0.2fK body (%p)} % [\n\t\t\tself.status_line,\n\t\t\tself.headers.length,\n\t\t\t(self.get_content_length / 1024.0),\n\t\t\tself.body,\n\t\t]\n\tend", "title": "" } ]
[ { "docid": "5c44ec0edd0d45b6db1a8097fa51ac61", "score": "0.748623", "text": "def inspect_details\n ''\n end", "title": "" }, { "docid": "f3110362493fdae1d94eb9c237753ae6", "score": "0.720097", "text": "def details\n return @details\n end", "t...
f8c6e246c6473896d2253d29bf8146d6
Indicates whether mapping of Amazon Web Services Identity and Access Management (IAM) accounts to database accounts is enabled for the DB instance. For a list of engine versions that support IAM database authentication, see [IAM database authentication][1] in the Amazon RDS User Guide and [IAM database authentication i...
[ { "docid": "d2ecdc575ccf1a167a3563c8da0a293e", "score": "0.77329886", "text": "def iam_database_authentication_enabled\n data[:iam_database_authentication_enabled]\n end", "title": "" } ]
[ { "docid": "f86dde9e4d0fd32e66468edfbc406289", "score": "0.6464926", "text": "def enable_db_auth?\r\n enable_db_auth.to_s.to_i != 0\r\n end", "title": "" }, { "docid": "2783caff4eae0e348f154f03364493eb", "score": "0.63620573", "text": "def using_internal_mapping?\n\t\t\t\tacc...
fe95a1975990e60f36ebb83ebd948b4e
Returns whether or not this class has an variable of this type
[ { "docid": "52040650d319d52f69ccfef5979fd99d", "score": "0.57779", "text": "def hasVariableTypeinGroup(vGroup, vt)\n for var in vGroup.vars\n if var.getUType().downcase == vt.downcase\n return true\n end\n end\n\n for grp in vGroup.varGroups\n if hasVariableT...
[ { "docid": "7e67df0f9ebd268f3d23d2748d31b39e", "score": "0.7978483", "text": "def variable_definition?\n @variable\n end", "title": "" }, { "docid": "4c1b226b3876cd68eb01629ff07524d6", "score": "0.7666549", "text": "def instance_variable_defined?(p0) end", "title"...
02b19620b6e2a040aaac025e97d662f7
GET /listings/1 GET /listings/1.json
[ { "docid": "18b333e632d5eeaebd648073f8949844", "score": "0.0", "text": "def show; end", "title": "" } ]
[ { "docid": "e70649c15d97f7df223d71cd23d54d9a", "score": "0.7858516", "text": "def index\n @listings = Listing.all\n render json: @listings\n end", "title": "" }, { "docid": "3201658759b4b14909b3a85172768170", "score": "0.77733076", "text": "def index\n @listings = Listing.o...
06a041fa3258d4f2336bfc04881d8b76
Test that when send fails, the queue still has the item
[ { "docid": "c0696808d2f4b8fc58bab23a02451991", "score": "0.5645312", "text": "def testSendFail\n initTestCase do\n $Context[:SlaveActions] = [\n [ 'DummyTool', 'DummyAction', [] ]\n ]\n $Context[:DummySenderSendError] = RuntimeError.new('S...
[ { "docid": "9ac1dd7ffc37c37ce89cc80e3d0d0ae7", "score": "0.6366705", "text": "def test_isEmptyOnNonEmptyQueue\n @queue.enqueue(100)\n assert_equal( false , @queue.empty? )\n end", "title": "" }, { "docid": "98b905c678a3fb3becc794b1897f7ab8", "score": "0.6350099", "text": "def ...
fe5f2a6441f1b5df85468e8e506fe908
to ensure auto token is unique
[ { "docid": "18a71a816f764bb705b309d8ba06cc56", "score": "0.0", "text": "def generate_authentication_token!\n begin\n self.auth_token = Devise.friendly_token\n end while self.class.where(auth_token: auth_token).exists?\n self.auth_token_expire_at = BxgConfig.user.login_expire_days.days.from...
[ { "docid": "9ae4df89d8b32e4db510f01865e50af2", "score": "0.81073844", "text": "def set_uniq_token\n self.token = Digest::MD5.hexdigest \"#{SecureRandom.hex(10)}-#{DateTime.now.to_s}\"\n end", "title": "" }, { "docid": "a3101e61e767ba919404ca307a34dd77", "score": "0.78513694", "te...
66ce2c0e44d774a74c153dc5f3e4b94b
End def update DELETE /dvds/1 DELETE /dvds/1.json
[ { "docid": "36740ab10ba61fd0189d494d6f634a4d", "score": "0.0", "text": "def destroy\n @dvd.destroy\n respond_to do |format|\n format.html { redirect_to dvds_path, notice: 'Medium was successfully destroyed.' }\n format.json { head :no_content }\n end # End respond_to do\n end", "...
[ { "docid": "8117aac8d35bdd0584e10ef6a8e1fc9f", "score": "0.65714425", "text": "def delete; update(:status => 'DELETED'); end", "title": "" }, { "docid": "8bc08015474ab21e05a24b50591b62d4", "score": "0.65019584", "text": "def destroy\n @dvr.destroy\n respond_to do |format|\n ...
840d0ae0ca7c5af0a087af5d40444455
Common dataset used by create/update commands
[ { "docid": "6e98cd39f600c3579e08293de123861d", "score": "0.0", "text": "def returning_dataset\n relation.dataset.returning(*relation.schema.qualified_projection)\n end", "title": "" } ]
[ { "docid": "0580f2ac042e17f80db83a676a1fe272", "score": "0.68832856", "text": "def dataset\n super.freeze\n end", "title": "" }, { "docid": "0580f2ac042e17f80db83a676a1fe272", "score": "0.68832856", "text": "def dataset\n super.freeze\n end", "title": "" ...
ce58f32f924ceea854c4663b8e300077
GET /form_field_values/1 GET /form_field_values/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "61bf046c90b5fe93f82cec84f88ec5f9", "score": "0.6975137", "text": "def retrieve_form_fields()\n start.uri('/api/form/field')\n .get()\n .go()\n end", "title": "" }, { "docid": "6adeaa5d3f77afb8c8a5e4f83085d609", "score": "0.6958933", "text": "def ...
803b8f6417a7ba76e7ce903b9a42b431
3b) Add the ability to pedal faster and brake. The pedal_faster method should increase the speed by a given amount. The brake method should decrease the speed by a given amount. The bike cannot go negative speeds. Expected output example: my_bike.pedal_faster(10) => 10 Expected output example: my_bike.pedal_faster(10) ...
[ { "docid": "3472a725eb2d2da3ba60ffdccabfcd86", "score": "0.7196986", "text": "def pedal_faster current_speed\n @current_speed += current_speed\nend", "title": "" } ]
[ { "docid": "bcc5314061efd1e0d3aaa8c31de66f63", "score": "0.6903436", "text": "def pedal_faster\n @speed += 10\n puts \"Your speed is #@speed mph!\"\n end", "title": "" }, { "docid": "c7e58a60d83798021f5a9f8d9175bf1b", "score": "0.6867145", "text": "def brake speed\n#...
6bc1a7c461f13d405a5f16d9657e7b2b
Receives a raw Typhoeus::Response object after a request has finished, and returns either +nil+ (indicating that there was no useful data in the response, or that the response was an error) or a Hash containing parsed data extracted from the response.
[ { "docid": "0ccd770df81ca823ec2286a169d99175", "score": "0.0", "text": "def extract(response)\n # Raise on HTTP error codes. A response code of 0 means that the request\n # timed out, which we don't raise for.\n case response.code.to_i\n when 200\n response\n\n when 0\n nil\n\n ...
[ { "docid": "ab39b6bc310d42f71aaeeae4622d48e8", "score": "0.71285784", "text": "def get_response\n if @clean_response.nil? && !@raw_errors.present?\n parse_raw_output(@raw_output)\n else\n @clean_response\n end\n end", "title": "" }, { "docid": "0917fe17376e4c0c20aaf9f8c76...