query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
0f23893334ef74719b857705248fde33
Secure this endpoint with a secret username/password so that only the StorageRoom server can POST to it. Enter this username/password in the Webhook Definition in the StorageRoom web interface.
[ { "docid": "089b4fd183609a18dbefc67f997664e4", "score": "0.5807425", "text": "def require_http_basic\n authenticate_or_request_with_http_basic(\"StorageRoom\") do |username, password|\n username == 'storage_room' && password = 'secret'\n end\n end", "title": "" } ]
[ { "docid": "65bd72f8a5082e0e13aafd3ab8fee861", "score": "0.64022505", "text": "def shopify_webhook_secret\n end", "title": "" }, { "docid": "ef5bdd6f6f5359f14637e7aabbaa5ec6", "score": "0.58870584", "text": "def secret\n \"sylwia\"\n end", "title": "" }, { "docid":...
41eaaac01f0865979c8060658084f062
The bishop can move like the queen but only diagonally. ascending and descending methods are the same as the queens.
[ { "docid": "eb6d8ae95d4ba7bf90290c99c21ccd6f", "score": "0.0", "text": "def list_moves(location = @location, list = [])\n list.push(*ascending(location))\n list.push(*descending(location))\n end", "title": "" } ]
[ { "docid": "9d050a1c30d9d951bf8bfc597290b5b4", "score": "0.6537163", "text": "def check_diagonals(pos)\n row, col = pos\n if self.color == :while\n\n else\n end\n\n\n def spaces_ahead_empty?(position, spaces_forward)\n row, col = position\n if self.color == :while\n board[row - spa...
0e70f9f33af09e35e3826596adfb4d1b
The toplevel workspace, see WorkSpacemain source://irb//lib/irb/context.rb155
[ { "docid": "efa7967c369e2852cbce412d933637df", "score": "0.0", "text": "def main; end", "title": "" } ]
[ { "docid": "c230aacfb04c2f3d1c185f230eb261a3", "score": "0.73965794", "text": "def workspace; end", "title": "" }, { "docid": "60ad7dce777bee7a2735fa85f8543091", "score": "0.70391756", "text": "def workspace()\n @connection.workspace\n end", "title": "" }, { "docid": ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "ef66a2138ec463f73ee8685378bbe4b9", "score": "0.0", "text": "def doc_type_params\n params.require(:doc_type).permit(:name)\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...
3098bebef59b1fb4d1646a9985915d77
Endpoint for lowlevel request. For easy host highjacking & instrumentation. Params are not used directly but kept for instrumentation purpose. You probably don't want to use this method directly.
[ { "docid": "32d080ecc88fdc993564d378f5983655", "score": "0.0", "text": "def http_request(method, path, query, body, params = nil, host = @host)\n uri = \"http://#{host}#{path}\"\n @client.request(method, uri, query, body, HEADERS)\n end", "title": "" } ]
[ { "docid": "bcb05c6ac798adb0a13ae03d0f3ae59f", "score": "0.7220816", "text": "def custom_request(verb, uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end", "title": "" }, { "docid": "bcb05c6ac798adb0a13ae03d0f3ae59f", "score": "0.7220816", "text": "def custom_request(verb...
49bfe1695d6d855f93b018548b155aaa
The Add method should return the sum of the input when called with a multiple positive integer numbers up to 1000.
[ { "docid": "901412f788627c179efd83bdb3872566", "score": "0.0", "text": "def test_Add_Should_ReturnSum_When_CalledWithTwoOrMoreIntegersWithCustomSeparatorDeclaration14\n # Arrange.\n @inputValue = '//$\\n1$0$1000'\n @expectedResult = 1001\n\n # Act.\n @actualResult = se...
[ { "docid": "8922b52992b7fc4494384f8720b929f3", "score": "0.73103553", "text": "def add(number)\n \n end", "title": "" }, { "docid": "576a7399151404eb24e394217876afcc", "score": "0.72273755", "text": "def add(numbers)\n\tnumbers.inject(:+)\nend", "title": "" }, { ...
13c91af5e7c8cc4fed9295090457bd1c
Get self as an Array Returns : [x, y]
[ { "docid": "8a8f8f35eca2bc9cf8165b2a8ab6c8b9", "score": "0.82608557", "text": "def to_a\n [@x, @y]\n end", "title": "" } ]
[ { "docid": "5690fac8fa8060a5b878528ea3395d2f", "score": "0.8859223", "text": "def to_a\n return [self.x, self.y]\n end", "title": "" }, { "docid": "5a1d6ee1ebccfa3787970dfec8476d0d", "score": "0.8258015", "text": "def to_array\n [{:x => @x, :y => @y}]\n end", "t...
9e199a7078ba1ffbec8eb34d008b3b0d
Instantiate and return a chatserver on the specified host and port
[ { "docid": "71b12983b44cb79538cb330fc201749b", "score": "0.5731858", "text": "def initialize( listenHost=\"0.0.0.0\", listenPort=1138, interval=0.20 )\n\t\t@socket\t\t\t= TCPServer::new( listenHost, listenPort )\n\t\t@users\t\t\t= []\n\t\t@reactor\t\t= IO::Reactor::new\n\t\t@pollInterval\t= interval\n\t...
[ { "docid": "3d416d5fb983083acc0568a7b6bc1431", "score": "0.6686472", "text": "def create_server_socket\n if @hostname\n s = TCPServer.open(@hostname, @port)\n else\n s = TCPServer.open(@port)\n end\n @port = s.addr[1]\n\n s.setsockopt(Socket::SOL_SOCKET, Socket::SO...
b815de2eac291cc494f97571b57a9718
Build a table of contents from a Markdown file
[ { "docid": "37842b307ea94c94fd0358d6e2f6138d", "score": "0.6380389", "text": "def generate_toc(filename = nil)\n filename ||= @template_path\n data = read_file(filename)\n base = 2 # Minimum indentation depth\n indent = [0] # Indentation Level tracker\n last = base\n ...
[ { "docid": "7db08d9f8907a53755d31faee723b4ff", "score": "0.68838716", "text": "def preprocessMarkdownForHTML(markdown)\n output = \"\"\n inInstructions = false\n \n markdown.split(\"\\n\").each do |line|\n # parse an instructions list\n # use a dummy HTML tag so our final regex doesn't...
27738da841fd0d8302fe1eb6a689549f
POST /posting_records POST /posting_records.json
[ { "docid": "3f6ee3922a16150d57a1b39f91343006", "score": "0.6554394", "text": "def create\n @posting_record = PostingRecord.new(posting_record_params)\n\n respond_to do |format|\n if @posting_record.save\n format.html { redirect_to @posting_record, notice: 'Posting record was successful...
[ { "docid": "83524feaf842dc18ac242e5a8ff6972c", "score": "0.67467386", "text": "def add_record(record={})\n post '/records', record\n end", "title": "" }, { "docid": "e0cf583461d55b8654c508d99264f0bb", "score": "0.6581922", "text": "def create_records(domain_id, records)\n po...
2d281743a4f0f5955b3665735f91eb83
Write out the csv row using the selected csv writer
[ { "docid": "fc9242d2f37d696d42ba27dab1e2535b", "score": "0.69468945", "text": "def write_csv_row(row_data, header_list=[])#:nodoc: \r\n if csv_writer == :faster\r\n ::FasterCSV::Row.new(header_list, row_data).to_csv(@options[:csv])\r\n else\r\n ::CSV.generate_line(row_data, @options[:csv...
[ { "docid": "3add9366c1dc1d797b5abbab17a8f6b8", "score": "0.7221952", "text": "def write_row (row, output_filename, has_written)\n FasterCSV.open(output_filename, \"a\") do |csv|\n csv << @header_row unless has_written > 0\n csv << row\n end\n end", "title": "" }, { ...
4a6fe49ce7cf4feadf30bc5a53a4a8e2
validation process for url
[ { "docid": "63b9ca592dd669c2c5952f6e08b36e99", "score": "0.72169054", "text": "def valid_url?\n @url =~ URI::regexp\n end", "title": "" } ]
[ { "docid": "14eb1de313412a8234847643d64c8dc0", "score": "0.81420296", "text": "def validate_url\n self.url = ExternalWork.format_url(self.url)\n errors.add_to_base(t('invalid_url', :default => \"Not a valid URL\")) unless self.url_active?\n end", "title": "" }, { "docid": "5b81fb1c185...
ff11d24dfed593ec79e1dfeeb5bdcb52
Generates files with random content with random file size according to the given Params
[ { "docid": "ec599f07ca43344b93530dc64f9b33bd", "score": "0.56770045", "text": "def run\n dir_counter = 0\n total_file_count = 0\n if Params['is_clear_target_path']\n target_path_all_regexp = File.expand_path(File.join(Params['target_path'], '*'))\n Dir[target_path_all_regexp...
[ { "docid": "92123d0be012f36f6a9d5cc3fe29355f", "score": "0.6486941", "text": "def write_random_file(p0) end", "title": "" }, { "docid": "8635391fb8e2886b86ad8621c3be1294", "score": "0.6424877", "text": "def create_file_with_ids\n #manager_counter = ExperimentManager.all.size\n ...
1e09a77acb7d897f1db0bffe9523ecff
The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target (an Amazon SNS topic or an Amazon SQS queue).
[ { "docid": "d242f7562d88e37b34e11d1cc974c7bd", "score": "0.5528207", "text": "def role_arn\n data[:role_arn]\n end", "title": "" } ]
[ { "docid": "0803152ce078ac79ee678008b005c0a7", "score": "0.6081004", "text": "def arn\n @remote_id || \"arn:aws:sns:#{zfind(:region)}:#{zfind(:accound_number)}:#{name}\"\n end", "title": "" }, { "docid": "4571d799d822a0d2611c36b8b3ffb534", "score": "0.59939337", "...
6260da39e065d06b86d4fc3d4abc4448
Production WORKING NOT Tested
[ { "docid": "122c3f047f7540e2d0311c2b5fd3f0af", "score": "0.0", "text": "def split_prod vses, package_handler\n \n vses.each do |vs_name|\n #Find rules per VS\n entries = package_handler.policy_handler.entries_by_vs vs_name\n rules = entries.find_all{|entry|...
[ { "docid": "335774f245f356ad309a5fd0a5bc6b15", "score": "0.64700806", "text": "def production_loaded\n end", "title": "" }, { "docid": "335774f245f356ad309a5fd0a5bc6b15", "score": "0.64700806", "text": "def production_loaded\n end", "title": "" }, { "docid": "2605866110...
3b989d8efa1ffd401bc6e076b08a0fde
GET /users/new GET /users/new.xml
[ { "docid": "9ca9f130fbada81717996475f04df970", "score": "0.0", "text": "def new\n @user = User.new(:invitation_token => params[:invitation_token])\n @user.email = @user.invitation.recipient_email if @user.invitation\n @hide_dashboard = true\n end", "title": "" } ]
[ { "docid": "eb2f813d46891748e182b979d3bf5d7f", "score": "0.7911266", "text": "def new\n @user = @users.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end", "title": "" }, { "docid": "90e268258e6b050fdb473af3ee963...
69a6b7105b27bf79236e473056193d2d
Request method can be use with get
[ { "docid": "dbc0adb139291a0a41045029a20cd034", "score": "0.0", "text": "def request(method, path, options)\n response = connection.send(method) do |request|\n request.url(path, options)\n end\n response.body\n end", "title": "" } ]
[ { "docid": "c46636676fdb99e242815395ce2d6e7b", "score": "0.83210224", "text": "def request_method\n :get\n end", "title": "" }, { "docid": "0ffe5b55a5033d390fdd937f12242050", "score": "0.81317544", "text": "def get\n request_method('GET')\n end", "title": "" ...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "28689d4ccab3ecc610b8167c1c2eda78", "score": "0.0", "text": "def dosificacion_params\n params.require(:dosificacion).permit(:fecha_dosificacion, :dosificacion, :toma, :administracion, :reciennacido_id, :area_id, :etiqueta_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74768823", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.71700543", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "9e603cad10741c802932dfafe3489e32", "score": "0.0", "text": "def set_networking_accessory\n @networking_accessory = NetworkingAccessory.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...
e445b13617231cd479e732eec8712d7e
generate the (very likely) path of a library given its name
[ { "docid": "a5763ace48c671b840a3305f63b699a7", "score": "0.7528728", "text": "def library_path(library_name)\n File.join(_lib_dir, library_name)\n end", "title": "" } ]
[ { "docid": "39ea8ebedbbfdf036d34b70ea81bcf35", "score": "0.6964543", "text": "def library_name(path)\n base = path.basename.to_s\n base.chomp(path.extname)\n end", "title": "" }, { "docid": "7e1938b365bb05a7c4ef1b9f098e6913", "score": "0.67516553", "text": "d...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b93f251587fc2cfe02b2a0922a1bd083", "score": "0.0", "text": "def set_failure\n @failure = Failure.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...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "39a97f76f43052a86725c377df29dcc2", "score": "0.0", "text": "def set_socioeduk_jovem_controle_pertence\n @socioeduk_jovem_controle_pertence = Socioeduk::JovemControlePertence.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...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "5c0059e3a2da044d0c1087db5ed95ae2", "score": "0.0", "text": "def set_moviedetail\n @moviedetail = Moviedetail.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...
2592797b2e06ab23c687d66c0e14710e
PLCloud REST OpenNebula utils
[ { "docid": "d1dd4b70a5fb94afc44bf5e2d6bf54e0", "score": "0.0", "text": "def onetemplate_create(name, image_id, host_name)\n temp_config = template_config(name, image_id, host_name)\n Rails.logger.debug(\"Creating PLCloud template using config: #{temp_config}\")\n\n b64_config = encode_b64(temp_...
[ { "docid": "3534283cb37be17f182a840d35f988f9", "score": "0.61795014", "text": "def getRestCall(arg_url)\n #uri = URI.parse('https://m70.purecloud.local/api/1.6/volume')\n url = @baseUri + arg_url\n uri = URI.parse(url)\n \n #get session\n session = getSession\n \n #Pass Session i...
9d5cc1a5fc83f6d2d55953a70744d7e3
can this person respond to the claim? that is, did the person place a bounty on the issue? OR is this person a developer of a team that created a bounty
[ { "docid": "f34b2cc92173cf7a9acd3f4d473f54f7", "score": "0.7193281", "text": "def person_can_respond?(person)\n issue&.can_respond_to_claims?(person)\n pact&.can_respond_to_claims?(person)\n end", "title": "" } ]
[ { "docid": "2a4e0df14d5601f00d328cc15e8a3ddc", "score": "0.68581986", "text": "def claimable?\n # can this invite be confirmed!\n ( pending? or declined? ) and !roster.full?\n end", "title": "" }, { "docid": "43939dc72b5fe02c5931abd7d9b6f616", "score": "0.6661504", "text": "d...
503cd10bf19e7c9503b0c262b3d2528a
Decode Marshal encoded properties
[ { "docid": "9c20c4b756456f94e147d57a00e9d846", "score": "0.7580779", "text": "def decode_properties(string)\n ::Marshal::load(string.unpack('m')[0])\n end", "title": "" } ]
[ { "docid": "b48225f115581ccd0c07bb654c6740fc", "score": "0.615423", "text": "def raw_properties\n parse_raw_map descriptor.values\n end", "title": "" }, { "docid": "c63a3ee7da687b5e477e1b64f539ff4e", "score": "0.61020666", "text": "def marshal_load(serialised); end", "title":...
0720cd1c0e26bf096a0dfa85c1901f5c
for locale lang set information
[ { "docid": "bb16b9f6fb4ea6b6aa96f7759f0ee6eb", "score": "0.0", "text": "def default_url_options(options = {})\n { locale: I18n.locale }.merge options\n end", "title": "" } ]
[ { "docid": "c5316c393421155dcb3119d6aa255906", "score": "0.7672986", "text": "def apply_locale; end", "title": "" }, { "docid": "41d5d9fe5d4f840955426ab41f922b0e", "score": "0.7649592", "text": "def available_locales_set; end", "title": "" }, { "docid": "733f290f73e2f4c47...
621908ecfbe8ee01cb79fec1e3fcce52
TODO: What is this for, exactly?
[ { "docid": "a2a3c4baa9c8418f01bc55fc1ff4b77a", "score": "0.0", "text": "def sessionstate\n \"/snapshots/visualizations/#{session_state_file_name}\"\n end", "title": "" } ]
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.6850748", "text": "def desired; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6386669", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", ...
81680e3ae5cf5241d5191668223f0a47
2: Define a recursive function that returns true if a string is a palindrome and false otherwise
[ { "docid": "ecd6a95956ad781d6c9c99b4128ec76e", "score": "0.86245924", "text": "def palindrome(str)\n if str.length == 1 || str.length == 0\n true\n else\n if str[0] == str[-1]\n palindrome(str[1..-2])\n else\n false\n end\n end\nend", "title": "" } ]
[ { "docid": "cc324160957becd0ebaaf0ea0512fa5e", "score": "0.8700005", "text": "def palindrome_without_recursion?(string)\n string = string.downcase.tr(' ', '')\n return true if string.length <= 1\n\n i = 0\n j = string.length - 1\n\n while i < j\n return false unless string[i] == stri...
912c0e0cf8816366872f1b29941d2de1
DELETE /events/1 DELETE /events/1.json
[ { "docid": "db4eac2f67ac44c0a3a805d4a0c9447d", "score": "0.0", "text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'Event was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "ca8002b7f734bce1f1a27f7ec6e59e9d", "score": "0.80864286", "text": "def destroy # DELETE /api/events/:id\n @event.destroy\n render :json => \"Event deleted\", :status => 201\n end", "title": "" }, { "docid": "3281a9c9361cdbd7e683034a763917de", "score": "0.7834...
7a38d6bb2ad705aa320e8cf86fbb3475
Specify the sort order you want Elasticsearch to use for sorting the results with already existing sort orders being removed.
[ { "docid": "118b6ae261a380e5d83fdc08d7c12061", "score": "0.0", "text": "def resort(*args)\n fresh.tap do |criteria|\n criteria.sort_values = args\n end\n end", "title": "" } ]
[ { "docid": "f60b88ed66537fa8c6df041a5d131c15", "score": "0.7378831", "text": "def index_sort_order\n @query = {}\n @query['sort_key'] = params['sort_key'] unless params['sort_key'].blank?\n\n if @query['sort_key']&.starts_with?('-')\n \"#{@query['sort_key'].delete_prefix('-')} DESC...
0fa9aab5a9106e9c85d84db3e93be435
Sets the attribute pointer
[ { "docid": "7141265da2901466efd384a47d7421b5", "score": "0.0", "text": "def pointer=(_arg0); end", "title": "" } ]
[ { "docid": "f3fd190d639903b24965dd1487316176", "score": "0.7309247", "text": "def set_attr_ptr! name, data\n return unless attr = get_attr(name)\n glEnableVertexAttribArray(attr[:loc])\n glVertexAttribPointer(attr[:loc], 3, GL_FLOAT, false, 0, data)\n end", "title": "" }, { "docid"...
90f36f36ce6b84c25b9fe6cb92fbe375
DELETE /clients/1 DELETE /clients/1.json
[ { "docid": "5d323280c31a910baf2ae1e04c22f2aa", "score": "0.7493746", "text": "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Cliente apagado com sucesso.' }\n format.json { head :no_content }\n end\n end", "title": "" } ...
[ { "docid": "378fab01059d123cf9ccb0a85fc2d9b6", "score": "0.7798713", "text": "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :ok }\n end\n end", "title": "" }, { ...
dcddc6d630e52daa538de794740f134e
checks to see if permalink is still current, if not redirect to current slug
[ { "docid": "77e5b30b6546077a6edcb8b156cfbafc", "score": "0.63404226", "text": "def ensure_current_kase_url\n if (@tier && !@tier.friendly_id_status.best?) || (@topic && !@topic.friendly_id_status.best?) || \n (@kase && !@kase.friendly_id_status.best?)\n redirect_to member_url([@tier, @top...
[ { "docid": "3ba4d6dfbed2dda5169b415fbb2e8e79", "score": "0.6621589", "text": "def redirect_slug_with_post_id\n if BSON::ObjectId.legal?(params[:slug]) and post = posts.find(params[:slug])\n redirect_to public_post_path(post), status: :moved_permanently\n end\n end", "title": "" ...
61535d60e3279342d6713968803367eb
Returns true if the node is a directory, else false
[ { "docid": "60fa2090af2949837e6a20f966444e64", "score": "0.0", "text": "def dir?\n raise NotImplementedError, 'dir? is an abstract method'\n end", "title": "" } ]
[ { "docid": "6cd40d9f6d984c31d8d4526a0a5a3d97", "score": "0.8245702", "text": "def node_kind_dir?\n node_kind == Core::NODE_DIR\n end", "title": "" }, { "docid": "6cd40d9f6d984c31d8d4526a0a5a3d97", "score": "0.8245702", "text": "def node_kind_dir?\n node_kind == Cor...
e6cd59162e2bce971bb415b8cff24021
POST /web_clips POST /web_clips.xml
[ { "docid": "c92b6b0dea69e8af70eb44453e58a11a", "score": "0.57401854", "text": "def create\n @web_clip = WebClip.new(params[:web_clip])\n\n respond_to do |format|\n if @web_clip.save\n format.html { redirect_to(@web_clip, :notice => 'Web clip was successfully created.') }\n forma...
[ { "docid": "96a02848d7ea8dcf1da0cb75c973fce0", "score": "0.52308226", "text": "def create\n @clip_app = ClipApp.new(params[:clip_app])\n\n respond_to do |format|\n if @clip_app.save\n flash[:notice] = 'ClipApp was successfully created.'\n format.html { redirect_to(@clip_app) }\n...
c0e7a5e8e7b3b421bc18611dfbabc0de
This is what would happen when user first opens form.
[ { "docid": "8f63a1f48495c557bde26219f4196438", "score": "0.0", "text": "def test_reuse_image_for_user\n requires_login(:reuse_image, :mode => 'profile')\n assert_response('reuse_image')\n assert_form_action(:action => 'reuse_image', :mode => 'profile')\n end", "title": "" } ]
[ { "docid": "2c94bb84bffaf2e2b4b4522f55e5b1ac", "score": "0.6431852", "text": "def ask_to_import_from_previous_forms\n\n end", "title": "" }, { "docid": "82a101f28f286f01b821e9aec55cea7c", "score": "0.60253716", "text": "def on_editing_entry(state, event, *event_args)\n super\n\n ...
1afb1b9817ad3ecae8c132dce4e72121
since we need to find a pair, have to iterate on both the arrays for each element in list1 we just need to look at elements less than (sumnode1.value) in List2 Time complexity O(mn)
[ { "docid": "66bc78f256a4015a54caad8c0af16eb8", "score": "0.76014286", "text": "def find_pair_to_sum(x)\n prep_sorted_lists # To prepared two sorted lists\n node1 = list1.head\n node2 = nil\n flag = false\n break_node = list2.end # Set the break node as end of secondlist\n while(node1.v...
[ { "docid": "9936577c5b64af39df933888cc941628", "score": "0.7776722", "text": "def find_restaurant(list1, list2)\n hash1 = {}\n least_idx_sum = nil\n output = []\n \n list1.each_with_index do |el, idx|\n hash1[el] = idx\n end\n \n list2.each_with_index do |el, idx|\n ...
e71e3f4d44061253a0260821b621bcb4
Convert data to the given return type.
[ { "docid": "7851f5ca0f5ba0cc716214e1fd32f225", "score": "0.7584303", "text": "def convert_to_type(data, return_type)\n return nil if data.nil?\n case return_type\n when 'String'\n data.to_s\n when 'Integer'\n data.to_i\n when 'Float'\n data.to_f\n when ...
[ { "docid": "39ad5e61a760f0dbdd184a5868dedbc2", "score": "0.80689675", "text": "def convert_to_type(data, return_type)\n return nil if data.nil?\n case return_type\n when 'String'\n data.to_s\n when 'Integer'\n data.to_i\n when 'Float'\n data....
9a3ba748d8c9e2abc3ef7c0081feee41
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.promo_mailer.activate.subject
[ { "docid": "5ef0499f9757fef6c10b1b37be743724", "score": "0.0", "text": "def activate(deal)\n @deal, @merchant = deal, deal.merchant\n @deal_url = merchant_promo_url(@merchant, @deal)\n\n mail :to => @merchant.email\n end", "title": "" } ]
[ { "docid": "2316f65233b6fb2d5ca6cbcf9856af69", "score": "0.6779542", "text": "def deliver_invitation(options = {})\n super(options.merge(subject: _('A Data Management Plan in %{application_name} has been shared with you') % {application_name: Rails.configuration.branding[:application][:name]}))\n en...
d554e00ec75added2a3ca92baebdb2bc
iterate over all words in array return 'true' if any word is > 4 letters long
[ { "docid": "9f9c7fa1b4a0eb642a1cb2125e048335", "score": "0.77518386", "text": "def long_planeteer_calls(words)\n words.any? {|word| word.length > 4}\nend", "title": "" } ]
[ { "docid": "9bc1c4ea0031b793178d6f2af7f51100", "score": "0.80324835", "text": "def long_planeteer_calls(array)\n array.any? { |word| word.length > 4}\nend", "title": "" }, { "docid": "475af4f77a20d4029e3ff945259e532f", "score": "0.79920286", "text": "def long_planeteer_calls(array)...
3c04a5cef6c3415fe3677481b51177e7
update the existing data
[ { "docid": "89fbd7929fba25d9d926f0a27f58671a", "score": "0.0", "text": "def accept_data\n #debugger\n hash = {}\n hash[:date] = params[:my_param] \n hash[:employee_id] = params[:ids]\n Tasksheet.where(hash).update_all(status: \"accept\")\n end", "title": "" } ]
[ { "docid": "147138a710a0ff53e9288ae66341894f", "score": "0.8015305", "text": "def update\n\t\t\n\t\tend", "title": "" }, { "docid": "797f43c62ff7ec26aa2f5cda90b55f74", "score": "0.7857466", "text": "def update\n record.assign_attributes(data)\n record.save! if record.change...
15836fbd3e08724cd0d5e8bd64759fda
Returns the schema understood by this format. This method is required by the Format contract.
[ { "docid": "69d25f8ae36be61d9600ee814374c817", "score": "0.7416107", "text": "def schema\n @schema\n end", "title": "" } ]
[ { "docid": "3865d5f20f09ed1653dd81ace0a19ce8", "score": "0.7376589", "text": "def schema\n @_schema\n end", "title": "" }, { "docid": "d5948b6fc55377d02aa49a2048711e05", "score": "0.7343077", "text": "def schema\n return @schema\n end", "titl...
b61d62e0162500037e1ade113cbe2583
Resets connection, by logging off and creating a new connection.
[ { "docid": "ce3498253677c04bcdb20fc4962873c4", "score": "0.782954", "text": "def reset!\n logoff rescue nil\n begin\n new_connection(@config)\n @active = true\n rescue Java::JavaSql::SQLException => e\n @active = false\n raise Oracle...
[ { "docid": "bdb3d176b2c7cadb308d81c46b3ca0f7", "score": "0.8428679", "text": "def reset_connection!\n @connection = nil\n end", "title": "" }, { "docid": "d27fb4f958ad8ccb461e24d65bdb1a72", "score": "0.7965523", "text": "def reset_connection!\n @@socket = nil\n en...
544bc9903d34b4d315e422339ca8b0d9
Removes text (all text or only invisible one) from a previously uploaded PDF.
[ { "docid": "a228d927312da46a1f3c39625905c4b4", "score": "0.60571927", "text": "def remove_text_with_http_info(pdf_remove_text_parameters, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PDFApi.remove_text ...'\n end\n # verify the requir...
[ { "docid": "860d5d7c4abf1667be80bd7d99e1a562", "score": "0.6980879", "text": "def remove_text(pdf_remove_text_parameters, opts = {})\n data, _status_code, _headers = remove_text_with_http_info(pdf_remove_text_parameters, opts)\n data\n end", "title": "" }, { "docid": "e92bedffe4...
7d548c9e677676f5c1d1bf953af3f44d
Converts from Marc8 to UTF8 if neccesary. Also replaces escaped unicode codepoints using custom Horizon "" format Or standard MARC 'lossless encoding' "&xHHHH;" format.
[ { "docid": "95970a6c691a93c34ccba5c0679a2c54", "score": "0.7046087", "text": "def convert_text!(text, error_handler)\n text = AnselToUnicode.new(error_handler, true).convert(text) if convert_marc8_to_utf8?\n\n # Turn Horizon's weird escaping into UTF8: <U+nnnn> where nnnn is a hex unicode\n ...
[ { "docid": "2cdc518710d0c11c0484fa590cbb9c99", "score": "0.66043985", "text": "def preprocess(input)\n input = input.to_s.encode('UTF-8',\n :invalid => :replace,\n :undef => :replace)\n\n input.gsub!(/(?:\\r\\n|[\\r\\f])/, \"\\n\")\n input.gsub!(\"\\u0000\", \"\\ufffd\")\n...
ba3b34f796117e3504ebe932c76641a4
GET /tarefas/1 or /tarefas/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "6d3060fc264579e1c257aa899aa88198", "score": "0.6866801", "text": "def show\n @tarefa = Tarefa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tarefa }\n end\n end", "title": "" }, { "docid": "a5be4187...
8504e3ce8125543d10574e715ed02b9a
recursively try to find the pattern in the major mode and its parent modes.
[ { "docid": "6e0ca4db370d66799dde030484ff18f1", "score": "0.48408017", "text": "def resolve(pattern, parents)\n keymap_result = keymap[pattern]\n\n case keymap_result\n when Incomplete # try to find a full or longer match in parents\n resolve_incomplete(pattern, parents, keymap_resu...
[ { "docid": "d15cd0f105ad3c8093ec0542cd1d92b3", "score": "0.57122594", "text": "def scan_patterns\n @max_level = 0\n @root.bfs do |r|\n reached = false\n curr_instances = yield(r.parent_id)\n curr_instances.each do |c_instance|\n q = @query.new.extend(Pbuilder::Que...
0bc01bad4fdbbc98bf5487e926f718d6
gets the current settings of the current assignment
[ { "docid": "4c92022dc03bc0efa65bb568c70c0429", "score": "0.0", "text": "def update_due_date_nameurl(dd)\n @due_date_nameurl_not_empty = due_date_nameurl_not_empty?(dd)\n @due_date_nameurl_not_empty_checkbox = @due_date_nameurl_not_empty\n @metareview_allowed = meta_review_allowed?(dd)\n @dro...
[ { "docid": "2d668802f8990f4b888d2455be415e9d", "score": "0.73884755", "text": "def settings\r\n @@settings\r\n end", "title": "" }, { "docid": "b1418f84f9b0b52ab5d0f8e0309e46f9", "score": "0.73601186", "text": "def get_settings\n settings.get\n end", "...
d0d241162d243f5cbbcf6900df2f865f
Evalutate the node and all children
[ { "docid": "073848e09a8b26d9ae16781a3cb55d2e", "score": "0.54066044", "text": "def evaluate(mode = [:nodes])\n case @type\n when :comparison\n left = @children[0].evaluate(mode)\n right = @children[1].evaluate(mode)\n if mode.last == :subquery\n left = left[0] if left.length ...
[ { "docid": "0770c6873428d0dfebdea2e2c545834c", "score": "0.6924863", "text": "def eval\n return if self.children.empty?\n \n # Remove parenthesis\n if self.children.first.val.class == LeftParen\n self.children = self.children[1..-2]\n end\n \n return if self.children.empty?\n ...
e81bc22d26e848a3ede3508c05a4233c
Full Zookeeper host address ie. 'localhost:9983'
[ { "docid": "215b57fc22607f36d0784c62191d20a0", "score": "0.8093792", "text": "def zkhost\n \"#{host}:#{zkport}\"\n end", "title": "" } ]
[ { "docid": "ae245456eef4934a636d16f855497636", "score": "0.68244046", "text": "def flume_zookeeper_port\n node[:flume][:master][:zookeeper_port]\nend", "title": "" }, { "docid": "ced275f646cc393a6ba505afbe134a85", "score": "0.68191254", "text": "def host; @client.host; end", "...
64b6579adfbad1bff1e56d19b780a65e
callseq: reader.is_open? > true or false Check whether the reader is open.
[ { "docid": "405eafe3c8b64f7da424afd7d2b41a22", "score": "0.76467824", "text": "def is_open?\n @open\n end", "title": "" } ]
[ { "docid": "b52703ef3ab8a4f5acd60483a17b8690", "score": "0.77616316", "text": "def open?\n is_open\n end", "title": "" }, { "docid": "7baa62f9b6268fa6a52c85859ed7852a", "score": "0.7711518", "text": "def open?\n return @opened\n end", "title": "" }, { "docid": "0b...
5fe246531b10b4e39538b6023a78cf08
GET /homework_deliveries/1 GET /homework_deliveries/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "ec5a6b43b94ebd3aeb3a2a00f0f63088", "score": "0.7143656", "text": "def index\n @homework_deliveries = HomeworkDelivery.all\n end", "title": "" }, { "docid": "35fed3d323555a67783f511c576fb311", "score": "0.61588126", "text": "def index\n @deliveries = Delivery.all\n ...
1a5ec7ba3931843153d2bed4b673e3bb
To display output immediately on windows using git bash
[ { "docid": "d7d84bbdfa66c23bfab328d204d879c2", "score": "0.0", "text": "def word_sizes(sentence)\n sentence.split.each_with_object(Hash.new(0)) do |word, obj|\n word = word.gsub(/[^a-z]+/i, '')\n obj[word.size] += 1\n end\nend", "title": "" } ]
[ { "docid": "808483b0425722ffb8d1110e0dd23f9e", "score": "0.6482058", "text": "def git_shell_out(cmd)\n cmd = Mixlib::ShellOut.new(['git']+cmd, cwd: base)\n cmd.run_command\n if cmd.error?\n nil\n else\n cmd.stdout.strip\n end\n en...
362bf1f8ab3998b5d0337a79eb51e989
Get the struct value
[ { "docid": "3c9798ef2950aee1ce4fadd010742864", "score": "0.66623944", "text": "def get(fbe_value = StructMap.new)\n fbe_begin = get_begin\n if fbe_begin == 0\n return fbe_value\n end\n\n fbe_struct_size = read_uint32(0)\n get_fields(fbe_value, fbe_struct_size)\n get_...
[ { "docid": "1f7df3e8b3d28a31d5499d9609a712c9", "score": "0.754149", "text": "def get_struct(field)\n field['structValue']\n end", "title": "" }, { "docid": "07e4f61f96eb2d904f5db830770f6633", "score": "0.75190765", "text": "def get; @value end", "title": "" }, { "doci...
7746e3a26eb8c26f81a606946cfda979
create a new block of multiple rooms
[ { "docid": "8c2a992f3dd83f99f1a9e5a1045597c5", "score": "0.6970483", "text": "def make_block(start_year, start_month, start_day, end_year, end_month, end_day, block_name, room_quantity, cost)\n block_range = DateRange.new(start_year, start_month, start_day, end_year, end_month, end_day)\n block = ...
[ { "docid": "e390617fcea98c772e9bdf242b9eafb0", "score": "0.772926", "text": "def create_room_block(room_ids, check_in_date, check_out_date, room_rate)\n requested_date_range = Date_Range.new(check_in_date, check_out_date)\n room_ids.each do |room_id|\n room = @rooms[room_id]\n if !room.c...
60cacfac8a0265e5b20e373bc33b98d0
Recursively create paths for all listed paths.
[ { "docid": "bfb96f18c689b269edb67e4269fb2a27", "score": "0.0", "text": "def create\n\t\t\t\teach(&:create)\n\t\t\tend", "title": "" } ]
[ { "docid": "2312183932a18532644b858921fbd1b9", "score": "0.69791335", "text": "def recreate_paths!(collection = nil)\n raise 'No collection given' unless collection.is_a? Array\n collection.each do |obj|\n obj.recreate_path!\n self.recreate_paths!(obj.children) unless obj.childre...
6d4bfb48c7b08630a7edaacdaefa8a2a
winner method should accept a board and return the token, "X" or "O"
[ { "docid": "f5634b9cf46e37431145edb9ec6e589b", "score": "0.0", "text": "def winner(board)\n won?(board) ? board[won?(board).fetch(0)] : nil\nend", "title": "" } ]
[ { "docid": "de0d454de7a1937004211f0e93144194", "score": "0.8952297", "text": "def winner\n if winner = won? == false\n return nil\n else\n win_token = @board[won?[0]]\n end\n if win_token == \"X\"\n return \"X\"\n elsif win_token == \"O\"\n return \"O\"\n end\n en...
a46c8ab026582415dcefcb41146c9b41
Gets bottomline of a specific product
[ { "docid": "8b447f18392a7f9245425935f0f412c5", "score": "0.6343574", "text": "def get_product_reviews_bottomline(params)\n app_key = params[:app_key]\n product_id = params[:product_id]\n get(\"products/#{app_key}/#{product_id}/bottomline\")\n end", "title": "" } ]
[ { "docid": "c2a87b7a62d8872a6fc859fad592630e", "score": "0.7425411", "text": "def get_product_bottom_line(params, headers = {})\n app_key = params[:app_key]\n sku = params[:product_id]\n get(\"/products/#{app_key}/#{sku}/bottomline\", {}, headers)\n end", "title": "" }, { "...
0fcdc3b774156f49d40bf33d9f87036c
Create a record for the given data (or entity)
[ { "docid": "ec4ef511fc1622b126b32aed07f0f69a", "score": "0.0", "text": "def create(data)\n adapter.exec_prepared(\"create_#{table_name}\", create_sql(data.keys), *data.values)\n last\n end", "title": "" } ]
[ { "docid": "36beb7bc854f5162beb091afd858c8ec", "score": "0.8059791", "text": "def create_record(data = nil)\n set_record(data || {})\n end", "title": "" }, { "docid": "6ae9e49d98ebe99f91736f92497ee9ba", "score": "0.79400396", "text": "def create(record); end", "title": "" }...
2e73a3da662711dacc78efb289ad1715
Output a RNA string by substituting 't' to 'u'.
[ { "docid": "9ade21fbd34fb22bf7ec24cb2fa8af32", "score": "0.70741314", "text": "def rna\n self.tr('t', 'u')\n end", "title": "" } ]
[ { "docid": "ce84ed58122385b7589565fc707d1f15", "score": "0.709297", "text": "def dna_to_rna(dna)\n dna.gsub(/[T]/, 'U')\nend", "title": "" }, { "docid": "495069227ce13d6a9578ae946ad19eb7", "score": "0.70423436", "text": "def transcribe(dna)\n dna.gsub('T', 'U')\nend", "title": ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0ee4b9d3d2705b5118765fb669cf0162", "score": "0.0", "text": "def set_edition_type\n @edition_type = EditionType.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...
8bd710cfae308b897e4fba1796ffd381
find_all_words_wa(stuff) => "wall" Identify all the elements in the stuff array that begins with the letters "wa". select returns all the elements for which the block is true
[ { "docid": "0777a5ce8d3fb99b180a35557ec2b7b0", "score": "0.78758526", "text": "def find_all_word_wa(array)\n\t array.select { |element| element[0..1] == \"wa\" }\n\tend", "title": "" } ]
[ { "docid": "23a513e87ccdd01d0c247cdc8b80badf", "score": "0.7487718", "text": "def find_all_word_wa(array)\n\t array.find { |element| element[0..1] == \"wa\" }\n\tend", "title": "" }, { "docid": "60d32223ab69ad92f0b6b937a82b913e", "score": "0.69213015", "text": "def find_a(a_word_arr...
79d3ff2cb8b8d4fe1cf068227a447a51
For example, the base [1, 4, 6] gives us the following pyramid 15 5 10 1 4 6
[ { "docid": "99b57f443a472d35133f4dd301a70403", "score": "0.0", "text": "def sum(new)\n arr = []\n new.each_with_index do |n, i|\n if i < new.length - 1\n sum = n + new[i + 1]\n arr << sum\n end\n end\n return arr\n end", "title": "" } ]
[ { "docid": "186d0f330c815384864bfedae4feb25f", "score": "0.7980482", "text": "def pyramid_sum(base)#********************************************************************************************************************************************************************************************************\r\n...
b3211624db1ec616c3b81212fdaa44c8
GET /konsulters GET /konsulters.json
[ { "docid": "33e4d3cf375b7567f6e267b6e60d53b9", "score": "0.7665499", "text": "def index\n @konsulters = Konsulter.all\n end", "title": "" } ]
[ { "docid": "8e2296e39c63cff5e26fc2d3f2943551", "score": "0.69380724", "text": "def index\n\t kiosks = Kiosk.all\n\t render json: { kiosks: kiosks } \n\tend", "title": "" }, { "docid": "0a97dfc5f9fb90f6a3038c0ac575f83b", "score": "0.68837076", "text": "def index\n @kids = Kid.all...
1262271d4b30dcc716fe425376065006
DELETE /actions_actions/1 DELETE /actions_actions/1.json
[ { "docid": "252b2941b119c8fa274eb87724ac4bb5", "score": "0.73251146", "text": "def destroy\n @actions_action.destroy\n respond_to do |format|\n format.html { redirect_to actions_actions_url, notice: 'Le lien entre actions a été supprimé.' }\n format.json { head :no_content }\n end\n ...
[ { "docid": "7ca7e8ba9bdfdf617b6cbfda6d8cca1d", "score": "0.80856985", "text": "def delete\n ruta = \"/actions/#{id}\"\n client.delete(ruta)\n end", "title": "" }, { "docid": "14b6f1f92ddb7b9e9b354c96543a678e", "score": "0.73494184", "text": "def destroy\n @single_acti...
d0848cee9ea416dfbd5b07103b6fd1ec
get every test to pass before coding runner below
[ { "docid": "28d50018453db534f9445e37aff36983", "score": "0.0", "text": "def runner\n # code runner here\nend", "title": "" } ]
[ { "docid": "4214d9c38556c2b02453744c9abd3771", "score": "0.7492311", "text": "def pass(suite, test, test_runner); end", "title": "" }, { "docid": "e820a876acc56d01d07c4fe31f07d454", "score": "0.74173", "text": "def run_tests\n count = 0\n puts \"Starting test run...\"\n self...
598d798abfbab089b7278da2f4ad2425
Build a Rack::Router instance
[ { "docid": "294a19022f7880cb6719ab6ec24a56f5", "score": "0.7651933", "text": "def r(method, path, params=[])\n Rack::Router.new(method, path, params)\n end", "title": "" } ]
[ { "docid": "fe2c680c43c27b95f310842ce9d9d439", "score": "0.69809574", "text": "def initialize(options = {}, &blk)\n @_app = options[:default_app] || proc{|env| ::Rack::Response.new(\"Not Found\", 404).finish }\n @use_destinations = options.key?(:use_destinations) ? options.delete(:use_dest...
c59ef6c255328fe7b5bb24847baed1f8
POST /cameras POST /cameras.json
[ { "docid": "b310353d330079762b94bea0812c5e9f", "score": "0.67253524", "text": "def create\n @camera = current_user.cameras.build camera_params\n\n respond_to do |format|\n if @camera.save\n format.html { redirect_to @camera, notice: 'Camera was successfully created.' }\n format....
[ { "docid": "c7546338acf322c68cbd5632c4accb03", "score": "0.6402462", "text": "def create\n @camino = Camino.new(camino_params)\n\n respond_to do |format|\n if @camino.save\n format.html { redirect_to @camino, notice: 'Camino was successfully created.' }\n format.json { render :s...
5af3f31621730540c82bf85d2c3bcb4b
DELETE /strands/1 DELETE /strands/1.json
[ { "docid": "3790ec05bbb73c0faaa3c797862167f1", "score": "0.6884793", "text": "def destroy\n @strand.destroy\n respond_to do |format|\n format.html { redirect_to strands_url, notice: 'Товар удалён' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "c5a5c7b0eb437b2c3172008b2b99bc03", "score": "0.7036098", "text": "def destroy\n id = params[:id]\n @physical_rack = PhysicalRack.any_of({_id: id}, {name: id.gsub('-', '.')}).first\n @physical_rack.destroy\n\n respond_to do |format|\n format.html { redirect_to physical_racks_...
e6da1c92f7fee8863af6d4f5a5e84366
Expected cost in dollers or equivalent
[ { "docid": "78bbce1d8654b4b13445d435350be960", "score": "0.6244442", "text": "def extra_cost\n if extra_cost_cents.present?\n read_attribute(:extra_cost_cents) / 100.0\n else\n 0\n end\n end", "title": "" } ]
[ { "docid": "75e881a71fd6bdf953f59028ccd00651", "score": "0.76114655", "text": "def actual_cost\n self.cost/1000.to_f\n end", "title": "" }, { "docid": "3ed57492e7953ec5bcbdda8bcb8fece7", "score": "0.7501408", "text": "def cost_in_dollars\n self.cost / 100.to_f\n end", "ti...
696ce83327111a91dac0a9e83ad04499
Applies a host template to a collection of hosts. This will create a role\nfor each role config group on each of the hosts.\n\nThe provided hosts must not have any existing roles on them and if the\ncluster is not using parcels, the hosts must have a CDH version matching\nthat of the cluster version.\n\nAvailable since...
[ { "docid": "a75bc7f5e4010bdef61fe4857c3e2f70", "score": "0.47978953", "text": "def api_v11_clusters_cluster_name_host_templates_host_template_name_commands_apply_host_template_post(host_template_name, cluster_name, opts = {})\n api_v11_clusters_cluster_name_host_templates_host_template_name_command...
[ { "docid": "433658a6c41386c3f94f2c843d2fb220", "score": "0.62941366", "text": "def hosts\n Put.warn \"\\nStarted configuring ansible hosts.......\\n\"\n @ansible.groups.each do |group|\n Put.info \"Adding group [#{group['name']}]\"\n\n response = Rest::SubutaiConsole.comm...
2bf82e29be41b2c0e2d36e4c0ae8f7d1
Attempts to interpolate accession numbers from different ranges. The results are returned as an array of individual accession numbers that can be indexed and searched in solr. For example, ranges that are shown in the ead as: A1994.34.19A1994.34.30 Will be broken down into individual accession number and stored in solr...
[ { "docid": "55ccc3b64e6541bfeb975129218bae91", "score": "0.7748511", "text": "def compute_range(range, accessions = Array.new)\n return accessions if range.nil?\n first, last = range.split(/-/)\n fparts = first.strip.split(/\\./)\n lparts = last.strip.split(/\\./)\n (fparts[2]..lparts[2])...
[ { "docid": "6fb56c672a88fd216592d8c4ca16b702", "score": "0.6404673", "text": "def from_ranges; end", "title": "" }, { "docid": "6fb56c672a88fd216592d8c4ca16b702", "score": "0.6404673", "text": "def from_ranges; end", "title": "" }, { "docid": "9f741e4aaeab8addd2e5be76022c...
2834562df9491a73a49e73aa33a1832f
GET /status_de_la_notificacions/new GET /status_de_la_notificacions/new.json
[ { "docid": "f97f4cce03d2ef892bf537693ddb6d4b", "score": "0.7690297", "text": "def new\n @status_de_la_notificacion = StatusDeLaNotificacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_de_la_notificacion }\n end\n end", "title":...
[ { "docid": "afcfc8269e8222795f2bb9fe21dc838d", "score": "0.7667805", "text": "def new\n @new_status = NewStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_status }\n end\n end", "title": "" }, { "docid": "de67e3c2bff55466...
1a4b5f0aa101b18b8a0643b461c7a5a8
what is the sum of amicable numbers:
[ { "docid": "5784a623d6d7c16ce3b3f449e82eab9c", "score": "0.82186353", "text": "def sum_of_amicable_numbers(n)\r\n amicable_numbers(n).reduce(:+)\r\nend", "title": "" } ]
[ { "docid": "46c7c025337c7f30a56bf54bb5825d1a", "score": "0.7745235", "text": "def sumAmi(num)\n\t#initialize total to 0\n\ttotal = 0\n\t#for every number under num\n\tfor i in 1 .. num-1\n\t\t#if it is an amicable number\n\t\tif isAmicable(i)\n\t\t\t#add i to total\n\t\t\ttotal += i\n\t\tend \n\tend\n\t...
012db220cd0d4e4dc9727e9c0c6a6b6b
DELETE /stis/1 DELETE /stis/1.xml
[ { "docid": "9f9c28995b2d86968a23b0baf18bed2b", "score": "0.70797306", "text": "def destroy\n @sti = Sti.find(params[:id])\n @sti.destroy\n\n respond_to do |format|\n format.html { redirect_to(stis_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "e1d6f603cb5ea1e475ea71422432aeae", "score": "0.66520494", "text": "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "title": "" }, { "docid": "75f6a2a4e311f27e6a34f7a6a77c3d8e", "score": "0.6605622", "text": "def destroy\n @...
e961715a3396fa6ecfc5ebc5817bf848
Read a &39;fabric.FcoeUplinkPcRole&39; resource.
[ { "docid": "dc8080ca4c75141ed00a0e52569bc510", "score": "0.547743", "text": "def get_fabric_fcoe_uplink_pc_role_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FabricApi.get_fabric_fcoe_uplink_pc_role_list ...'\n end\n ...
[ { "docid": "14ed739edc5a2f42f28ac54291a2bc7a", "score": "0.61976093", "text": "def patch_fabric_fc_uplink_pc_role(moid, fabric_fc_uplink_pc_role, opts = {})\n data, _status_code, _headers = patch_fabric_fc_uplink_pc_role_with_http_info(moid, fabric_fc_uplink_pc_role, opts)\n data\n end", ...
8446fbe6289ca7131c646c967426f8a0
4. Add instence method called 'eats_at' Returns the hours of the day with AM or PM Return value should be like "11 AM"
[ { "docid": "27f9484d451a658970586bad23a0c7de", "score": "0.82979786", "text": "def eats_at\n if (@meal_time) <= 11\n \"#{@meal_time} AM\"\n else\n \"#{(@meal_time - 12)} PM\"\n end\n end", "title": "" } ]
[ { "docid": "b92bd529e19514c98365a3f515832555", "score": "0.8271812", "text": "def eats_at\n if @meal_time < 12\n return \"#{@meal_time} AM\"\n else\n return \"#{@meal_time - 12} PM\"\n end\n end", "title": "" }, { "docid": "e93b5feea2b95086a79e002d908f13a2", "score": ...
012e4306347fc3cfcf9985b7db1655e6
Returns the episode for the given number.
[ { "docid": "e1136f286b7b526b01ab6e56d9727f27", "score": "0.75250584", "text": "def ep(ep_num)\n idx = @episodes.map(&:number).index(ep_num.to_i)\n return nil if idx.nil?\n @episodes[idx]\n end", "title": "" } ]
[ { "docid": "0f6f9196dada942340ec379f2085830a", "score": "0.71989274", "text": "def episode_number\n @ole.EpisodeNumber\n end", "title": "" }, { "docid": "e6e68ee5db451dc5a66515b40f82003f", "score": "0.70932215", "text": "def episode_number(value)\n @ole.EpisodeNumber = v...
51c9ee0bef8847521286a604dbb36b5b
scrapes the profile page for basic account information
[ { "docid": "37dcc221bc5a040468e734fa2abfa76f", "score": "0.0", "text": "def get_profile_data\n response = Faraday.get profile_url\n\n if response.success?\n html = Nokogiri::HTML(response.body)\n\n # Portraits use spritemaps, so we extract positions and map to \n ...
[ { "docid": "80bcc35ef919a7d4272eaeba6fbba076", "score": "0.74693894", "text": "def profile\n get_request(\"/1.0/user\")\n end", "title": "" }, { "docid": "3e426691b3305215629e4ae58dfc1dfa", "score": "0.744343", "text": "def profile\n get('account/profile')\n end",...
3a534ae8803a71af3cf748716159a6e1
Get test run tag.
[ { "docid": "c1ccf91cb60268322cced37afc67044e", "score": "0.6541425", "text": "def get_test_run_tag_using_get(project_id, run_id, tag_id, opts = {})\n data, _status_code, _headers = get_test_run_tag_using_get_with_http_info(project_id, run_id, tag_id, opts)\n data\n end", "title": "" }...
[ { "docid": "f5faebaa354e094877e8d94855876780", "score": "0.6244772", "text": "def get_test_run_tag_with_run_using_get(run_id, tag_id, opts = {})\n data, _status_code, _headers = get_test_run_tag_with_run_using_get_with_http_info(run_id, tag_id, opts)\n data\n end", "title": "" }, { ...
8d55239b3800db5873dc668f02ba4333
Execute functions hooked on a specific action hook. This function invokes all functions attached to action hook `$tag`. It is possible to create new action hooks by simply calling this function, specifying the name of the new hook using the `$tag` parameter. You can pass extra arguments to the hooks, much like you can ...
[ { "docid": "c10a1f03cc162dee9836d53db43af945", "score": "0.7237074", "text": "def do_action(tag, *arg )\n # global $wp_filter, $wp_actions, $wp_current_filter\n # TODO continue\n end", "title": "" } ]
[ { "docid": "8c4feb42284539e5a8c592459169725a", "score": "0.67755413", "text": "def add_action(tag, function_to_add, priority = 10, accepted_args = 1 )\n add_filter(tag, function_to_add, priority, accepted_args )\n end", "title": "" }, { "docid": "2e988c95274288ec57ea11df4ea5fb12", "s...
0a67661d2bc6776631e2505a2a93a7b9
GET /learning_modalities/1 GET /learning_modalities/1.json
[ { "docid": "9898b947cc3fda3f8b23fc2b9e18c643", "score": "0.7600361", "text": "def show\n @learning_modality = LearningModality.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @learning_modality }\n end\n end", "title": ""...
[ { "docid": "5834439f2b9851115bb3d755dd5aafc8", "score": "0.7691725", "text": "def index\n @learning_modalities = LearningModality.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @learning_modalities }\n end\n end", "title": "" }, ...
efae8d64b69a8d9167817384b1eb2bf0
is there a translation record? if not, is there a rule? create translation record else, create empty ClassRecommender rule and return empty hash all the hard work of creating a hash return a hash
[ { "docid": "ca04e7e441e3125c69180b9b057025e9", "score": "0.0", "text": "def map\n \n # output a hash; empty by default\n Hash.new \n \n end", "title": "" } ]
[ { "docid": "a8e094be246af033d1cd7e9b7774359e", "score": "0.59494203", "text": "def map\n \n # parse source data \n @source_record = parse_input\n\n # validate the source record\n return Hash.new if !source_valid?\n\n # create sha1 from URL\n #token = Dige...
3046d3d9b995fe60094f95119e6e6d26
GET /searchings/1 GET /searchings/1.json
[ { "docid": "7c22a214f4f070888ea55fcb9e49bf58", "score": "0.0", "text": "def show\n @searching = Searching.find(params[:id])\n\n @searching.searching_bhk_configs.build\n @searching.searching_areas.build\n @searching.searching_facilities.build\n\n @bhk_configs=BhkConfig.all\n @areas=Area...
[ { "docid": "14c7cc2549906e19ccf91acc5524d54b", "score": "0.7587103", "text": "def index\n @searchings = Searching.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @searchings }\n end\n end", "title": "" }, { "docid": "860f93f31f29...
521f3cf9abf90de8098a17beff4e88e1
POST /cash_flows POST /cash_flows.json
[ { "docid": "75b304ad4e922df3782a65d36bd726c8", "score": "0.7044876", "text": "def create\n @cash_flow = CashFlow.new(params[:cash_flow])\n\n respond_to do |format|\n if @cash_flow.save\n format.html { redirect_to root_path, notice: 'Cash flow was successfully created.' }\n else\n ...
[ { "docid": "9afc93a4b4800fd5200ac21b4f33e941", "score": "0.6655381", "text": "def create\n @cashflow = Cashflow.new(cashflow_params)\n\n respond_to do |format|\n if @cashflow.save\n format.html { redirect_to @cashflow, notice: 'Cashflow was successfully created.' }\n format.json...
1ab399b3af103aeee81882331c05aa8c
Merge two hashes of VM settings This function merges all settings from `right` into `left` and returns `left` as a mutated value. Any scalar settings, such as `box`, present in `left` will be preserved. Array settings, such as `provisioners` present in `right` will be prepended to `left` such that they are run earlier.
[ { "docid": "bd1d29c813e62562d0887cd6830dc9a1", "score": "0.72122747", "text": "def merge_nodes!(left, right)\n array_keys = %w[\n providers\n provisioners\n synced_folders\n forwarded_ports\n private_networks\n public_networks\n ]\n\n array_keys.each do |key|\n ...
[ { "docid": "c59da487cd0f92988234625cdc699401", "score": "0.7008615", "text": "def merge_nodes(left, right)\n retval = right.clone\n\n array_keys = %w[\n providers\n provisioners\n synced_folders\n forwarded_ports\n private_networks\n public_networks\n guest\n ...
81b8b422aed977400831ed2821d7ce9c
GET /departments GET /departments.xml
[ { "docid": "cf7fcc394623d4870448213ecb315352", "score": "0.59932166", "text": "def index\n @department = Department.new(params[:department])\n cond = Department.paginated_departments_conditions_with_search(params)\n @departments = Department.paginate :conditions => cond.to_sql, :page => params[...
[ { "docid": "a7db1ef69fc725c6ea8496367fff9618", "score": "0.7218725", "text": "def list\n\t\t@departments = Department.paginate :page => params[:page], :per_page => 10\t#Pagination\n \trespond_to do |format|\t\t\n \t\t format.html \n \t\t\tformat.xml { render :xml => @departments }\t\t#Re...
d96014136b638695f6a16608e60b5f39
remember we are inheriting from ActiveRecord.Base through BaseWithoutTable. So if we override things we must use super!
[ { "docid": "5084fb14be004809f36f83b1dfcf0d41", "score": "0.0", "text": "def initialize(user, attributes={})\n super(attributes)\n self.user_record = user\n end", "title": "" } ]
[ { "docid": "e21e8506fc488800618fb6f83e35d311", "score": "0.71729845", "text": "def inherited(base); end", "title": "" }, { "docid": "86f8b83ac9310e02e22e2a8f9315733f", "score": "0.6911497", "text": "def descends_from_active_record?\n if self == Base\n false\n e...
026d54ba0203ac0bba65f849c2525823
Convert the timezone setter argument. Returns argument given by default, exists for easier overriding in extensions.
[ { "docid": "f6e2dc9a1a0976a0934baabb610a90b4", "score": "0.83001757", "text": "def convert_timezone_setter_arg(tz)\n tz\n end", "title": "" } ]
[ { "docid": "bae1f8113e415bcdb8a00762477d1c54", "score": "0.7681783", "text": "def timezone=(_arg0); end", "title": "" }, { "docid": "7c972d2e4eae8e07b7cbebc583cd6e56", "score": "0.7004943", "text": "def time_zone=(_arg0); end", "title": "" }, { "docid": "9a181f10341caf2d4...
2d5a4dcc44c959266d4eea8f08396d07
Helper method for bottomup implementation
[ { "docid": "67b56bb51f26e6348eacabf07dd632c8", "score": "0.0", "text": "def knapsack_table(weights, values, capacity)\n\n end", "title": "" } ]
[ { "docid": "3f2e33df52d04bd1c71a1ae33e015205", "score": "0.71544623", "text": "def down!\n bottom\n end", "title": "" }, { "docid": "5f3539b467d5e3b7c2367343e6cc2735", "score": "0.7083513", "text": "def bottom; end", "title": "" }, { "docid": "0481bb49c50503a6eb0fda8a...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "88a490a147a357756757808834795bb3", "score": "0.0", "text": "def contac_reemper_params\n params.require(:contac_reemper).permit!\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...
8d7b47eedfde6c833fc4506fcf00328f
Called before container start, can be used to e.g. add temporary mounts
[ { "docid": "e6a60bbe52dc6b85b1170acb51411e3a", "score": "0.71935546", "text": "def pre_start(opts = {})\n if volatile_is_systemd?\n # systemd by default does not monitor udev events in containers, which\n # means that there are no device units to depend on, e.g. for network\n #...
[ { "docid": "cd1367df845fd91663a90501bddc1536", "score": "0.6480219", "text": "def post_mount(opts)\n return unless volatile_is_systemd?\n\n ContainerControl::Commands::WithMountns.run!(\n ct,\n ns_pid: opts[:ns_pid],\n chroot: opts[:rootfs_mount],\n block: Proc.new ...
f74e402903ba83f7724d5b869d037f7c
To not count the same projects multiple time for the number of launches Learn more at Use the `FASTLANE_OPT_OUT_USAGE` variable to opt out The resulting value is e.g. ce12f8371df11ef6097a83bdf2303e4357d6f5040acc4f76019489fa5deeae0d
[ { "docid": "a58073d5b1ed947f28931b7d3383ed9b", "score": "0.0", "text": "def generate_p_hash(app_id)\n if app_id.nil?\n return nil\n end\n\n return Digest::SHA256.hexdigest(\"p#{app_id}fastlan3_SAlt\") # hashed + salted the bundle identifier\n rescue\n return nil # we don't ...
[ { "docid": "6491c73f88e738e33f2e82e0ac5514d5", "score": "0.55372006", "text": "def usage\n grouped_tasks = task_names.group_by(&:size)\n name_sizes = grouped_tasks.keys\n biggest_name = name_sizes.max || 0\n tasks.each { |task| task.print_usage(biggest_name + 2) }\n\n exit(2)\n ...
1d3765843b498ac79d3f5147d1f2c3df
caches subtotal_items and caches each order_item's provider_item_precio
[ { "docid": "5b25bfd2e7e61de0df9eed0966c9e897", "score": "0.7556172", "text": "def update_subtotal_items!\n subtotal = @customer_order.order_items.collect do |order_item|\n order_item.cache_provider_item_precio!\n order_item.subtotal\n end.sum\n @customer_order.assi...
[ { "docid": "91700b371d2ef1fb0a83e235c639891b", "score": "0.63902146", "text": "def items_sub_total\n order_items.inject(BigDecimal(0)) { |t, i| t + i.sub_total }\n end", "title": "" }, { "docid": "91700b371d2ef1fb0a83e235c639891b", "score": "0.63902146", "text": "def items_su...
100e0d678469ba4ed97697f199c070cd
GET /requests GET /requests.json
[ { "docid": "0e4f3e16a2c73e7dc68e969054b6c5aa", "score": "0.6333824", "text": "def index\n @requests = Request.all\n end", "title": "" } ]
[ { "docid": "ff35d8a60fdbaad33b71eebbd3c9889b", "score": "0.71195513", "text": "def index\n @requests = Request.all\n\n render json: @requests\n end", "title": "" }, { "docid": "cc1985fd610ad530de1d9e3afb35c84c", "score": "0.6854284", "text": "def index\n @requests = Request...
63d6836d5ab5a8597c45aa06e85936d7
one more optimization, but still slow
[ { "docid": "74564264f1686bcc41e20e21a5010b08", "score": "0.0", "text": "def solution(a)\n s = 0\n e = 1\n a.each { |v| \n s += v * e\n e *= -2\n }\n\n s = -s\n\n x = 0xAAAAAAAA\n r = (s + x) ^ x\n r = (\"%b\" % r).reverse.split(//).map { |b| b.to_i }\n r == [0] ?...
[ { "docid": "373c2968f03891cfcfd165f661599cdf", "score": "0.68242925", "text": "def optimize\n \n end", "title": "" }, { "docid": "c34ff85954326e75e0f7ecc28949f561", "score": "0.650679", "text": "def optimize\n end", "title": "" }, { "docid": "bdd5a19756e5b7...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "2d032b9ecc67a8ad34e1dbe721a90e71", "score": "0.0", "text": "def test_result_params\n params.require(:test_result).permit(:system_under_test, :passed, :run_by_whom, :test_details)\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...
1097a7e7758f08d32addfc88ea3fdcab
GET /users GET /users.json
[ { "docid": "e644eba8540267b34a2b8f840f5f8242", "score": "0.0", "text": "def index\n @users = User.all.order_by([[sort_column, sort_direction]]).page(params[:page]).per(25)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @users }\n end\n end", ...
[ { "docid": "9f7c735ace683c5c2b12c914cc9ad8a8", "score": "0.84070665", "text": "def get\n users = User.all.as_json\n render(json: users.as_json, status: :ok)\n end", "title": "" }, { "docid": "543509c6588e2f79a8dbcd1cdcdaf7b9", "score": "0.836007", "text": "def users\...
05b89d68a25b248f0544553656c43432
Creates or finds a library collection by description. If an actor is given, will use the actor to create the object. Otherwise, will just use the new method on the model given
[ { "docid": "79df13b08015561d866834837dc1d05f", "score": "0.6880261", "text": "def find_or_create_library_collection(description, user, params)\n collection = LibraryCollection.where(desc_metadata__description_tesim: description).first\n if collection.nil?\n collection = LibraryCollection.new\n c...
[ { "docid": "c259de75da1924698a5ad1ad09cf3763", "score": "0.55714256", "text": "def new_collection\n Models::Collection.new\n end", "title": "" }, { "docid": "a96d643fc50f958926e07a7781421ec4", "score": "0.5533466", "text": "def find_or_create_collection(collection)\n\t ...