query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
d31d721d9a446fbf5f9c17ecda990aa8
Returns a regex that matches a string that has "a", then ten to twelve "z"s, then "a". It should match: azzzzzzzzzza azzzzzzzzzzza azzzzzzzzzzzza It should not match: bzzzzzzzzzzzzzz
[ { "docid": "58ae99929ef359c046cee6257cda5f19", "score": "0.83581275", "text": "def regex_with_ten_to_twelve_zs\n /az{10,12}a/\n end", "title": "" } ]
[ { "docid": "c5299853610eb0f9a2bfd5d2099fba8e", "score": "0.8049029", "text": "def regex_with_exactly_ten_zs\n /az{10}a/\n end", "title": "" }, { "docid": "032afb41eeeca2195489d65f1e1239bc", "score": "0.78974634", "text": "def regex_with_two_or_more_zs\n /az{2,}a/\n end", ...
8a16e890c1dee310f04355e1a728761d
exercise 81 : print list with number
[ { "docid": "e4f9ef06d0dd635d1c750979db891403", "score": "0.0", "text": "def print_with_number(students)\n students.each_with_index do |student,index|\n puts \"#{index+1}. #{student[:name]} (#{student[:cohort]} cohort}) \"\n end\n end", "title": "" } ]
[ { "docid": "3126352aaa608242024af9d6195a4595", "score": "0.71262187", "text": "def print_list(list)\n\tputs \"-\" * 10\n\tlist.each do |item, quantity|\n\t\tputs \"#{item}: #{quantity}\"\n\n\tend\n\tputs \"-\" * 10\nend", "title": "" }, { "docid": "7410ee259ca20aa389e38d260b6c56c8", "sco...
6f284c4ec88708d869be60043a2ef535
Retrieves comment with given id from task with given id that belongs to given container
[ { "docid": "603a9230f4b8eaea7bc8771ca07caab1", "score": "0.6148455", "text": "def get_comment_by_id_with_http_info(id, t_instance_id, comment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UserTaskOperationsAndQueriesBPMApi.get_comment_by_id...
[ { "docid": "4b86b35cb8ca7e236fc533da61c22fdf", "score": "0.7393642", "text": "def find(project_id, task_id, comment_id)\n raw_response = get_request(\"projects/#{project_id}/tasks/#{task_id}/comments/#{comment_id}\")\n parse_response(raw_response, :comment)\n end", "title": ...
c0d70cbe7300ce625be84660495040a6
requires set_key to have executed first
[ { "docid": "29b6a001e0ed06c36bec186fea5de114", "score": "0.0", "text": "def activate_app\n key = Key.new\n key.host = params[:data][:host]\n key.app_dataset_id = params[:data][:app_dataset_id]\n key.api_key = params[:data][:api_key]\n key.app_name = params[:controller]\n\n existing_job...
[ { "docid": "e22966a7dce516e63be52357d4a8f97c", "score": "0.76597905", "text": "def key=(key); end", "title": "" }, { "docid": "865f7852b0f746c604a0efbd7a0bf7e0", "score": "0.7438569", "text": "def updateKey; @key = getKey; self end", "title": "" }, { "docid": "3fbd2a2cb49...
6aa72535939001fb7b50cb0be8e5cbc3
UPDATE INFO / EOS / PLAYLIST
[ { "docid": "23b7bc1f098c3eda607b04dfd8e68499", "score": "0.5749084", "text": "def update(message)\n\t\tmsg = message[-1] if message.class == Array\n\t\t\n\t\tcase\n\t\t\t\n\t\t\twhen message == \"wax_info\"\n\t\t\t@info_box.show_info(wax_info) if @info_win\n\t\t\t\n\t\t\twhen message == \"eos\"\n\t\t\ti...
[ { "docid": "90ba5f31df57d63d7b87d36095e02c9a", "score": "0.6684529", "text": "def update\n @info = get_info()\n end", "title": "" }, { "docid": "0e67bb95ed93a7e18f2b665f4eb45f07", "score": "0.6546817", "text": "def update_info_player(info, new_value)\n RESTful.put(\"#{URL_...
28142168b0e1c5afd1403dcb3196df40
GET /comments/new GET /comments/new.json
[ { "docid": "56ce3fafca3244042c1e56ae09700dab", "score": "0.7015513", "text": "def new\n @comment = current_user.comments.build # crea comentario vacío asociado a current_user\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", ...
[ { "docid": "bfe3a2c256e9edd1fef2efed3abfa4fb", "score": "0.8087922", "text": "def new\n @comment = @commentable.comments.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "title": "" }, { "docid": "6c7d7a3e7c...
b4afc27cf91f20f95cb310396a5abf27
totalRooms : Integer Number of total rooms in the property
[ { "docid": "651f59b3eea889e1379cf378ff55bd8f", "score": "0.83254296", "text": "def total_rooms\n self.dig_for_integer(\"totalRooms\")\n end", "title": "" } ]
[ { "docid": "2bf40d78694f333894506a4aeae45856", "score": "0.8001967", "text": "def total_room_count\n object.listing.s_total_room_count\n end", "title": "" }, { "docid": "02b1f12d140ab6cef3e47c7660836e50", "score": "0.761822", "text": "def number_of_rooms()\n return @rooms.leng...
51cb7b4ba4fe1c389b429fa8133e2ff4
Parse the body (variable header and payload) of a packet
[ { "docid": "9744cb07adef38dda6faa617d150ee8b", "score": "0.5822765", "text": "def parse_body(buffer)\n super(buffer)\n @id = shift_short(buffer)\n @return_codes << shift_byte(buffer) while buffer.bytesize > 0\n end", "title": "" } ]
[ { "docid": "db937d3fa757418ce0b80638f618e313", "score": "0.7180408", "text": "def parse(packet); end", "title": "" }, { "docid": "2307f3a3b73dcba5cd60265fa13a9128", "score": "0.6985101", "text": "def parse_data_packet(packet); end", "title": "" }, { "docid": "8eb302285b52...
207a8b49c4239c00374b54144e8d332c
Set the type for a single Trello card. To reach this command, first use the "settypes" command to put a channel into active mode.
[ { "docid": "c446d15b29b1b61604346a3dea526e91", "score": "0.70756793", "text": "def type(response)\n room_name = response.message.source.room.to_s\n board_id = redis.get(\"#{room_name}-board-id\")\n card_id = redis.get(\"#{room_name}-card-id\")\n board = trello_client.find(:bo...
[ { "docid": "84c5e0c809736a3787a6e5155f6cda4a", "score": "0.75102735", "text": "def set_type_card\n @type_card = TypeCard.find(params[:id])\n end", "title": "" }, { "docid": "9aecc56d791cedc2d36412e2975f4979", "score": "0.7406657", "text": "def set_types(response)\n boa...
c71106688199ffcb65498d9b4dab45fd
Modify this to return href and text
[ { "docid": "5e8553131fb1a31be5a864e25e0c6afc", "score": "0.0", "text": "def get_links(url)\n @driver.get(url)\n data = @driver.execute_script(\"return document.getElementsByTagName('html')[0].innerHTML\")\n\n Nokogiri::HTML(data).css(\"a\").map do |link|\n if (href = link.attr(\"href\"))\n...
[ { "docid": "eb274e2ea4bfba7a1a071feff0db9cbc", "score": "0.72631794", "text": "def link_text\n name\n end", "title": "" }, { "docid": "3e6a102b1a3550d5f44ae38a296641ec", "score": "0.7175822", "text": "def href; end", "title": "" }, { "docid": "be04b6df2daee388aedb9a1e...
9e98417e555aa9270e961a8981fdda24
Baseline implementation for the update_asset REST call
[ { "docid": "c209076b1c19c35e832e6557c048ea5a", "score": "0.65424883", "text": "def update_asset request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_update_asset_r...
[ { "docid": "00347a81973473ec7c110428666182ea", "score": "0.73797405", "text": "def update\n @asset = Asset.find(params[:id])\n\n if @asset.update(asset_params)\n head :no_content\n else\n render json: @asset.errors, status: :unprocessable_entity\n end\n end", "title": "" }, ...
0e8eef746e3c83f3158ac9dbc218f3fb
GET /alliances/new GET /alliances/new.json
[ { "docid": "2580daad5d1e0cbe61496aca9c6cfd31", "score": "0.75955266", "text": "def new\n if !user_signed_in?\n redirect_to root_url, notice: 'You must be signed in too do that'\n return\n elsif current_user.profile.alliance\n redirect_to my_profile_url, notice: 'Sorry you can not cr...
[ { "docid": "826bfa79cf791e6c33ce2ae452331700", "score": "0.7445314", "text": "def create\r\n @alliance = Alliance.new(params[:alliance])\r\n\r\n respond_to do |format|\r\n if @alliance.save\r\n format.html { redirect_to(@alliance, :notice => 'Alliance was successfully created.') }\r\n ...
dbc0959e95f136c87df09d11fb29731b
Compiles an if expression. Takes the current (outer) scope and two expressions representing the if and else arm. If no else arm is given, it defaults to nil.
[ { "docid": "5da3151fa51086c7cdab82f94efcab91", "score": "0.773991", "text": "def compile_if(scope, cond, if_arm, else_arm = nil)\n @e.comment(\"if: #{cond.inspect}\")\n\n res = compile_eval_arg(scope, cond)\n l_else_arm = @e.get_local + \"_else\"\n compile_jmp_on_false(scope, res, l_else_arm...
[ { "docid": "761dfa4b75cc985de41a037ed8897b36", "score": "0.77435464", "text": "def compile_if(scope, cond, if_arm, else_arm = nil)\n @e.comment(\"if: #{cond.inspect}\")\n\n res = compile_eval_arg(scope, cond)\n l_else_arm = @e.get_local + \"_else\"\n compile_jmp_on_false(scope, res, l_else_a...
fdee5189be6edb06f62391da24f3b895
following this article we set fta_type based on the fta asset class ie the model
[ { "docid": "a8ca40281aad4bfa26473ad5b25c7801", "score": "0.5831542", "text": "def global_fta_type\n self.fta_type.to_global_id if self.fta_type.present?\n end", "title": "" } ]
[ { "docid": "32ab54661e39d3b311be62ce729388c3", "score": "0.7014836", "text": "def update_type_info(fta_class: nil, fta_type: nil, subtype: nil, user: nil, validate: false)\n if fta_class || fta_type || subtype\n log = AssetTypeInfoLog.new(transam_asset: self, fta_asset_class: self.fta_asset_clas...
8aacf1ecb757ed171e6619692e19e821
Create a new transformer for binarization.
[ { "docid": "ebd2584c30446a4c7701c3ce34ff9cfc", "score": "0.0", "text": "def initialize(threshold: 0.0)\n super()\n @params = { threshold: threshold }\n end", "title": "" } ]
[ { "docid": "853376a78eab4972c86c4f4831948a3e", "score": "0.62774915", "text": "def transformer\n @transformer ||= Transformer.new self\n end", "title": "" }, { "docid": "89c94aa4b142ef2c7846844452be7d9b", "score": "0.56825584", "text": "def transform!\n raise NotImplementedE...
3201360d3c036d079afe36f6441f8972
post an ad to site
[ { "docid": "aa2085e773e06b021f91c1c19a87b2fb", "score": "0.74669963", "text": "def post_ad(title, post_body, url, address, listing_time)\n @browser.div(:id, 'side-left').div(:class, 'menu').div.a.click\n set_type\n confirm_login_info\n fill_out_event_info title, post_body, url\n ...
[ { "docid": "4b6864c4d1b2c85114b6cc712dfec0bc", "score": "0.6110854", "text": "def post(post)\n NotLoggedInError.new(\"You aren't logged into Blogger.\").raise unless @account.authenticated?\n\n path = \"/feeds/#{@id}/posts/default\"\n data = post.to_s\n \n resp = GoogleAuth.post...
625ec4a129a1687193828cdd554778db
Only allows a trusted parameter 'white list' through
[ { "docid": "4d8ee1eee7360841a6d4e1782fd97561", "score": "0.0", "text": "def resume_params\n params.require(:resume).permit(:name, :attachment)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.791505", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.71997505", "text": "def strong_params\n params.require(:resource).permit(param_whit...
23b4468f30779edaffe23a85b321be58
GET /product_vendors GET /product_vendors.json
[ { "docid": "300c87e889489c4a5606902062eb9d5f", "score": "0.7839737", "text": "def index\n @product_vendors = ProductVendor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @product_vendors }\n end\n end", "title": "" } ]
[ { "docid": "8643b6868fd001e7c855c0ebd0f9350c", "score": "0.7869823", "text": "def index\n @vendors = Vendor.all\n render json: @vendors\n end", "title": "" }, { "docid": "ffc91496019ba479ecd05d9a9803823c", "score": "0.77953553", "text": "def show\n \n @product = Product....
887e6516962f3e82981e0f4d173c2b43
List all DVDs belonging to the subscribed DVD clubs
[ { "docid": "53e36eafd722ce3a0515494f85e28592", "score": "0.0", "text": "def dvds(options= {:order => 'created_at DESC', :limit => 5}, without_mydvds = false)\n #Dvd.all(:conditions => ['owner_id in (?) and state = ? and owner_id != ?', get_visible_user_ids, 'available', without_mydvds ? self.id : 0 ]...
[ { "docid": "f49472304780ec401a4828118c609f83", "score": "0.6502048", "text": "def get_subscribers(subscription_id)\r\n Subscription.new(subscription_id).getSubscriber.list\r\n end", "title": "" }, { "docid": "3fb07c399b7b4f20e8208ccdb3318290", "score": "0.595861", "te...
17cec82255d856fa331acc35283bd8a1
merges localizations from config into the matching translation files
[ { "docid": "3b2700c4306a48160a2b1071a228b55a", "score": "0.7021214", "text": "def merge_i18n(barclamp)\n locales = barclamp['locale_additions']\n locales.each do |key, value|\n #translation file (can be multiple)\n f = File.join CROWBAR_PATH, 'config', 'locales', \"#{key}.yml\"\n if...
[ { "docid": "f38ab80354751c8696ea1abc7d3b985d", "score": "0.67283314", "text": "def update\n files = Dir[Rails.root.join(\"config\", \"locales\", \"*.yml\").to_s]\n\n @languages = {}\n files.each do |f|\n ar = YAML.load_file f\n lang = ar.keys.first\n if @l...
4d94250bd5241a4815f3c494a4bf8d53
Validate the input in +params+. If the optional +additional_profile+ is given, merge it with the validator's default profile before validating.
[ { "docid": "cf13f0b8d77db88bc91ea7c244ecf7dc", "score": "0.7926397", "text": "def validate( params, additional_profile=nil )\n\t\t@raw_form = params.dup\n\t\tprofile = @profile\n\n\t\tif additional_profile\n\t\t\tself.log.debug \"Merging additional profile %p\" % [additional_profile]\n\t\t\tprofile = @p...
[ { "docid": "8713708ab476d496d7cd05885f7090c3", "score": "0.6124102", "text": "def add_profile(opts)\n opts = check_params(opts,[:profiles])\n super(opts)\n end", "title": "" }, { "docid": "042674a14bd34c11ef676dfa7cc0e3c0", "score": "0.59047914", "text": "def validate( p...
58a51a5c7741703e5ebff7b4e9e8aace
assert whether the given object has a StorageBackedAttribute with the given name and set up properly with the given options
[ { "docid": "258a9586a5a440c24c5793219548b436", "score": "0.8049738", "text": "def assert_has_storage_backed_attribute(object, attribute_name, options={})\n options = {:compress => true}.merge(options)\n\n assert object.respond_to?(attribute_name), \"object should respond to :#{attribute_name}\...
[ { "docid": "477ab8d2ab067ad4fbb0d41fe47e6e1f", "score": "0.57911235", "text": "def check_object(object, name = 'user', attribute, boolean)\n expect(object[name].key?(attribute)).to be boolean\n end", "title": "" }, { "docid": "e1f4452f705a98741121a85c66b6a1c4", "score": "0.55938727",...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "c185ed47a60d985c65611053ee48e075", "score": "0.0", "text": "def update!(**args)\n end", "title": "" } ]
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update...
a504d09a94a5e0496608d87cf819978f
TODO: move test util methods to s3 util mixin
[ { "docid": "ecf98c712815c90cfeef48e23ee6cb21", "score": "0.0", "text": "def create_local_file(local_dir_name,media_file_id,filename)\n FileUtils.mkdir_p(local_dir_name)\n local_file_name = local_dir_name + \"/\" + filename\n local_file = File.open(local_file_name, 'w') {|f| f.puts(\"this is jus...
[ { "docid": "f538c803becf092083606bc1db55e142", "score": "0.7265461", "text": "def get_files_from_s3(bucket, key)\n # create the s3 resource object\n s3 = Aws::S3::Resource.new(region: 'us-east-1')\n\n # Create the object to retrieve\n obj = s3.bucket(bucket).object(key)\n\n # Get the item...
ca71bd316a13df864ee8799b9a4404c9
Allows calling get/post/patch/delete in an abstract manner
[ { "docid": "dd04fdad3a721e5acbdb388d71e8ecc6", "score": "0.0", "text": "def request(method, *args)\n public_send(method, *args)\n end", "title": "" } ]
[ { "docid": "7924824b417fbfd9fd4fafcb6018e80b", "score": "0.73503715", "text": "def non_get_methods\n [:post, :put, :delete]\n end", "title": "" }, { "docid": "a30f740be3c3b57c9e5c7615703bfb1d", "score": "0.66322327", "text": "def method_missing(method_name, *args)\n payload ...
ca1f3530a8b8beded83be86c6f1465a1
Return the splash authorization for a client, for each SSID they've associated with through splash. Only enabled SSIDs with Clickthrough splash enabled will be included. Clients can be identified by a client key or either the MAC or IP depending on whether the network uses TrackbyIP.
[ { "docid": "be255ce4f09a2fd31c6ee4811b481062", "score": "0.58437234", "text": "def get_network_client_splash_authorization_status(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => options['network_id'],\r\n 'client_id' => options['clie...
[ { "docid": "67d595fd92d3602dd5c67a91d6bdd68a", "score": "0.52438873", "text": "def update_network_client_splash_authorization_status(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => options['network_id'],\r\n 'client_id' => options['c...
350d9906d71e7acb8ff43a2bd4d6ed25
following methods are about creation of events
[ { "docid": "a2c8c600f5f14aa03148f1638d6634cd", "score": "0.0", "text": "def ask_facebook_event_cancel_message\n\n @term = Term.find(params[:id])\n @current_object = @event = @term.event unless @term.nil?\n\n if facebook_session\n if facebook_session.user.has_permissions?('create_event')\n ...
[ { "docid": "ff1cb32628977acc28cd1a7e6b85541e", "score": "0.79149985", "text": "def events; end", "title": "" }, { "docid": "ff1cb32628977acc28cd1a7e6b85541e", "score": "0.79149985", "text": "def events; end", "title": "" }, { "docid": "ff1cb32628977acc28cd1a7e6b85541e", ...
2311e864c3c6bc08fe81e858ceb869a5
pop removes the last element from the list
[ { "docid": "6ad900ad30a87b4fd02795d030014bb9", "score": "0.0", "text": "def pop\n\t\tpos = @head\n\t\tuntil pos.next_node.next_node.nil?\n\t\t\tpos = pos.next_node\n\t\tend\n\t\t@tail = pos\n\t\t@tail.next_node = nil\n\n\tend", "title": "" } ]
[ { "docid": "a416d69c8ecb6813bfbbf45f4eccd84a", "score": "0.82714903", "text": "def pop\n @list.pop\n end", "title": "" }, { "docid": "027ca817b7cd30328b9e09f7884c4dde", "score": "0.8225752", "text": "def pop\n @size -= 1\n @list.shift\n end", "title": "" }, { "...
db26cb6e93a593f4f89780e3c3840ff0
TODO: make the statement in one line
[ { "docid": "ec2754ddbad09f7edc99b771dc8d9288", "score": "0.0", "text": "def active_lead_name\n if self.active_lead.nil? \n \"Not Assigned\" \n else \n self.active_lead.name\n end\n end", "title": "" } ]
[ { "docid": "b3f09be680dc2bb51593ee662ee34fbe", "score": "0.63554037", "text": "def statement; end", "title": "" }, { "docid": "b3f09be680dc2bb51593ee662ee34fbe", "score": "0.63554037", "text": "def statement; end", "title": "" }, { "docid": "b3f09be680dc2bb51593ee662ee34f...
b74e9925badd142a061c65ddcb3e1bf1
Return the HTML representation of the attributes +attr+. source://kramdown//lib/kramdown/utils/html.rb44
[ { "docid": "c180406afa086620ab2adf8775fc8fed", "score": "0.817378", "text": "def html_attributes(attr); end", "title": "" } ]
[ { "docid": "a7b71326f9f40020aadee9bd516a7521", "score": "0.7969514", "text": "def html_attributes(attr)\n return '' if attr.empty?\n\n attr.map do |k, v|\n v.nil? || (k == 'id' && v.strip.empty?) ? '' : \" #{k}=\\\"#{escape_html(v.to_s, :attribute)}\\\"\"\n end.join('')\n ...
3811ebed436bbb148a4c4f69716fbb9b
The main game loop.
[ { "docid": "6ffa86a4345e321fcb043703fbf1d9e4", "score": "0.0", "text": "def update\n\t\t\n\t\tif @cur_dialog != nil\n\t\t\tif @cur_dialog.update\n\t\t\t\t@cur_dialog = @cur_dialog.get_next_branch\n\t\t\tend\n\t\telse\n\t\t\tif @cur_scene != nil\n\t\t\t\tif @cur_scene.update\n\t\t\t\t\t@cur_scene = @cur_...
[ { "docid": "1a286a4916b886d12bd0bf2f58145e09", "score": "0.81332296", "text": "def main\n\t\twhile @player.alive\n\t\t\tupdate\n\t\t\tdraw\n\t\t\t\n\t\t\tCurses.refresh\n\t\t\t\n\t\t\tsleep(1.0/10.0)\n\t\tend\n\t\t\n\t\tendGame\n\tend", "title": "" }, { "docid": "35724ceca2ab508110520c6a7801...
540ba79c51a54d8920681995b89320bc
Iterate through an xls sheet line by line, yielding each one in turn.
[ { "docid": "7f4718bb7c37373346da45aa2044197f", "score": "0.71374464", "text": "def xls_rows(workbook, sheet_name)\n return enum_for(:xls_rows, workbook, sheet_name) unless block_given?\n\n return unless workbook.first_row(sheet_name)\n rows = workbook.first_row(sheet_name)..workb...
[ { "docid": "18bbd201909d07ca163a17d08c3757d4", "score": "0.7070099", "text": "def xlsx_rows(workbook, sheet_name)\n return enum_for(:xlsx_rows, workbook, sheet_name) unless block_given?\n\n workbook.each_row_streaming(sheet: sheet_name, pad_cells: true) do |row|\n yield row.map { ...
a0bc8bd4a70951eaf0c0c75bfc0b9154
POST /geographic_area_types POST /geographic_area_types.json
[ { "docid": "c13521910c8d362468498c48e2ff0d41", "score": "0.66980994", "text": "def create\n @geographic_area_type = GeographicAreaType.new(geographic_area_type_params)\n @geographic_area_type.created_by_id = @sessions_current_user.id\n @geographic_area_type.updated_by_id = @sessions_current_use...
[ { "docid": "954a9e465432dd955aaad5515e44e6d2", "score": "0.69598836", "text": "def geographic_area_type_params\n params.require(:geographic_area_type).permit(:name)\n end", "title": "" }, { "docid": "454c9be3d904228e59b246626064984c", "score": "0.68679154", "text": "def create\n ...
e6e925af5632aa4deef961107e876b5f
Format main log message.
[ { "docid": "6f47eb5ad6d365b45934c360d669525a", "score": "0.6610945", "text": "def formatted_message(msg)\n \"[Cloudenvoy][#{loggable.class}] #{msg}\"\n end", "title": "" } ]
[ { "docid": "061bac618e85e32c91066dadcb9da5cb", "score": "0.7218379", "text": "def format( event )\n msg = format_obj(event.data)\n severity_text = ::Logging::LNAMES[event.level]\n preamble = \"#{Time.now.utc.strftime(\"%Y-%m-%d %H:%M:%S\")}\\tUTC\\t[#{severity_text}]\\t[#{hostname}]...
f85bdcd7fd492b8b5615caf1cc657cae
new gear no git template url specified cartridge doesn't require build on install already have at least 1 activation
[ { "docid": "993b01120c31dff4188babb2b919b902", "score": "0.0", "text": "def test_post_configure_not_deployable\n cart_name = 'mock-0.1'\n cartridge = mock()\n @cartridge_model.expects(:get_cartridge).with(cart_name).returns(cartridge)\n cartridge.expects(:install_build_required).returns(fals...
[ { "docid": "716196a189d7f6d49d9d405000a9d71d", "score": "0.65865856", "text": "def configure(ident, template_git_url = nil, manifest = nil)\n output = ''\n cartridge = if manifest\n logger.debug(\"Loading #{ident.name} from man...
3f4133a4de3baaa87f55cc4a8deb11fe
DELETE /vocabularies/1 DELETE /vocabularies/1.json
[ { "docid": "752987c731b4ce5bb55803db7b886ade", "score": "0.7342141", "text": "def destroy\n @vocabulary.destroy\n flash[:success] = '単語を削除しました。'\n respond_to do |format|\n format.html { redirect_to vocabularies_url }\n format.json { head :no_content }\n end\n end", "title": ""...
[ { "docid": "99ca7a8bc72bd638a433b4f27f655b5b", "score": "0.80246997", "text": "def destroy\n @vocab = Vocab.find(params[:id])\n @vocab.destroy\n\n respond_to do |format|\n format.html { redirect_to vocabs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, ...
8cc0329db1d320f377fa3c467034cb6b
moved from the patient model. Needs good testing
[ { "docid": "2173df0590ba966968491f09a874f5d9", "score": "0.0", "text": "def demographics_label(patient_id)\n patient = Patient.find(patient_id)\n patient_bean = PatientService.get_patient(patient.person)\n demographics = mastercard_demographics(patient)\n hiv_staging = Encounter.where([\"enc...
[ { "docid": "32b2c497ccd202b2b848434dff0e120e", "score": "0.6276785", "text": "def setup\r\n @patient = patients(:patient_00001)\r\n end", "title": "" }, { "docid": "8776f63c9d9530e8bb0c841bd59713c6", "score": "0.6172587", "text": "def patients\n Observation.select('patient...
9279ef90fd995dcf43173b9379d20dee
GET /api/user_properties/ curl v u admin:admin
[ { "docid": "96604259ff487bfc7f3b35e0a60efdd1", "score": "0.53611916", "text": "def show\n property = Property.by_key(params[:id], nil, current_user.id)\n if property\n respond_to do |format|\n format.json { render :json => jsonp(properties_to_json([property])) }\n format.xml { ...
[ { "docid": "a40ee4d0e2e504ac31b0ca4cb923e0b4", "score": "0.75297564", "text": "def get_properties()\n resp = conn.get('/users/'+name+'/props/')\n \n case resp.code.to_i\n when 200\n return JSON.parse(resp.body)\n when 404\n raise RestAuthUserNotFound.new( resp )\n else\n ...
bb0a21a0fde5843b049eb838278f36ab
measures distance from origin by default, but a second point can be provided. See test below
[ { "docid": "46c9963c2179e644bd9ccbc47637fe56", "score": "0.71910703", "text": "def distance(point1, options={})\n # fill in. see other distance functions for hints.\n end", "title": "" } ]
[ { "docid": "0eea48cb9ff0657fb79d212f4033bfd2", "score": "0.75995404", "text": "def distance(point2)\n end", "title": "" }, { "docid": "93a33e7a5b32c0079a638ded568b8957", "score": "0.74615574", "text": "def distance\n self.distance_from(@origin) * 1.609344\n end", "title": ...
bcbdce79ec512450c32096ca41787b60
GET /follow_relationships GET /follow_relationships.json
[ { "docid": "6bdb5e7e021c8704d5cbdd007e46508e", "score": "0.7428434", "text": "def index\n @follow_relationships = FollowRelationship.all\n end", "title": "" } ]
[ { "docid": "ae38c07ddac72602ce53065d10f3b06f", "score": "0.7364657", "text": "def index\n @relationships = current_user.following_relationships\n end", "title": "" }, { "docid": "df8e0b67b565be7202dfb0dcb53f5335", "score": "0.7227331", "text": "def show_follows \n @user = User...
2d5f62c76b8e02ca53d828e79bb44164
POST /issuers POST /issuers.json
[ { "docid": "4931fad0b0a3ae46eb0030def9a1749d", "score": "0.6036903", "text": "def create\n @issuer = Issuer.new(params[:issuer])\n\n respond_to do |format|\n if @issuer.save\n format.html { redirect_to issuers_path, notice: 'Issuer was successfully created.' }\n format.json { re...
[ { "docid": "545addf4bbde1ab94afac8d743316c54", "score": "0.62565416", "text": "def test_retrieval_of_issuers\n assert_equal [{ :id => '0151', :name => 'Issuer Simulator' }], @gateway.issuers.list\n end", "title": "" }, { "docid": "5aa6fefaadc3b2a9c01c4263c5e7559b", "score": "0.624663...
1fcfdaf9d9be07c3fb71d8ed4bdc6348
This can be for security purposes (probably more important for user)
[ { "docid": "1d69b5c673f93d97b1ce48d575e6b6ad", "score": "0.0", "text": "def task_params\n params.require(:task).permit(:title, :description, :completed_at, :user_id)\n end", "title": "" } ]
[ { "docid": "090f8aeefc03990ee7a067c230c12a5d", "score": "0.64938766", "text": "def security; end", "title": "" }, { "docid": "162b63d96fba382f4ac1d354527bb10c", "score": "0.631902", "text": "def protection; end", "title": "" }, { "docid": "162b63d96fba382f4ac1d354527bb10c...
81376784b0cc9a485183fd749f3035a4
The localonly ip address for the given server
[ { "docid": "da738fba1dc239635acb4beb5c6355fd", "score": "0.0", "text": "def private_hostname_of(server)\n server[:fqdn]\n end", "title": "" } ]
[ { "docid": "d604e3cab0bfab33c7a5d766824cab36", "score": "0.78610057", "text": "def public_ip_of(server)\n server[:cloud][:public_ips].first rescue server[:ipaddress]\n end", "title": "" }, { "docid": "f54e839d775e62f034c5cb8879f42661", "score": "0.7624242", "text": "def serv...
6fc707ce2d88f07e6142360ee8c587be
Find or create record Author: Shlok Date: 14/09/2018 Reviewed By: Kedar
[ { "docid": "9fdb065dcdeaff3ad5cb00a783d4afcb", "score": "0.0", "text": "def find_or_create_record\n\n record = ManagerWhitelisting.where(\n kind: GlobalConstant::ManagerWhitelisting.domain_kind,\n identifier: @domain\n ).first\n\n if record.present?\n retu...
[ { "docid": "dfcee6f4934226b34aae3a5a901d6ca9", "score": "0.6280493", "text": "def create_author(author:)\n Author.create(author.to_h)\n end", "title": "" }, { "docid": "40916fbb5de1481ffd2cd4e4216f8f82", "score": "0.62702674", "text": "def create_author(author:)\n # needs to b...
a2be5b71e03ceae3dce895237d6456ee
Reads a CRL list file from the Mongoid database
[ { "docid": "31104684388c4ce2dbba3d96a1c3765e", "score": "0.5489569", "text": "def read_list(admin)\n CrlEntry.where(ca_name: ca_name, unrevoked_at: nil).each do |crl_entry|\n admin.revoke_cert(crl_entry.serial.to_i, crl_entry.reason, crl_entry.revoked_at, false)\n end\n nil\n end", "t...
[ { "docid": "889e8e7fbf3698a774c4d6c4ff16aab9", "score": "0.66728795", "text": "def load_crl_list(filename_or_io)\n @revoked_certs = {}\n\n if filename_or_io.nil?\n generate_crl\n return nil\n end\n\n data = read_data(filename_or_io)\n\n data.each_line...
5e8e8ca5596c7108073730e02ca592bc
End point: (GET) Usage: FundAmerica::Entity.investor_payments(entity_id)
[ { "docid": "955730bea6e73150de0326ee1d51af5b", "score": "0.90952337", "text": "def investor_payments(entity_id)\n API::request(:get, FundAmerica.base_uri + \"entities/#{entity_id}/investor_payments\")\n end", "title": "" } ]
[ { "docid": "f9141c586e50ed73031a2a6aa9369584", "score": "0.74274457", "text": "def investment_payments(investment_id)\n API::request(:get, \"investments/#{investment_id}/investment_payments\")\n end", "title": "" }, { "docid": "564cab92ea3eadcb0f0b03829e9cc079", "score": "0.7...
3c0cea336c723962096a695126867d0f
Provide a detailed, user friendly representation
[ { "docid": "4788b34cb1432d414ada4bff53c1712d", "score": "0.0", "text": "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Taskrouter.V1.WorkspaceStatisticsInstance #{values}>\"\n end", "title": "" ...
[ { "docid": "7bea0b559c41a5f338754e1c5f53f1cb", "score": "0.7074551", "text": "def details \n\t\t\"#{self.id} - #{self.name.capitalize}\"\n\tend", "title": "" }, { "docid": "6143c330d598497e31bfa9b9f780219e", "score": "0.7009431", "text": "def detail\n\t\t\t\to = ''\n\t\t\t\to += \" ...
f4aa971261bb40282365b8691714aaf5
GET /people/students GET /people/students.json
[ { "docid": "1496529614d6a120d854dc5fdbd2fb74", "score": "0.6751066", "text": "def index\n @people_students = People::Student.all\n end", "title": "" } ]
[ { "docid": "06818b6665f9f27b3933df13442a0ba9", "score": "0.760614", "text": "def my_students(query={})\n self.simple_client.get(\"/api/v1/students?#{query.to_query}\")\n end", "title": "" }, { "docid": "d3414f9c1f424f250603d75b322ad9a8", "score": "0.7549168", "text": "def school_...
6abe4dedffacbe21e587c6d6984fb01e
Get all webhooks Returns data about all webhooks of a company.
[ { "docid": "15ff9184e0e1ce7894896992c2e16a7c", "score": "0.0", "text": "def webhooks_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: WebhooksApi.webhooks_get ...\"\n end\n # resource path\n local_var_path = \"/we...
[ { "docid": "15844ee119a130c7275678b84d5508b5", "score": "0.75497663", "text": "def all_webhooks(**args)\n params = parameters(args) do\n optional_params\n end\n request(:get, 'webhooks', params)\n end", "title": "" }, { "docid": "99daefde95c93d956b543801d9e...
30dd38007cb911cb93808475581a2177
The idea is to make a create that adds another version of the pose with that chapter id here
[ { "docid": "76e7f7e616b7f527e68d520efe8d1700", "score": "0.61730963", "text": "def class_pose\n\n the_id = params.fetch(\"path_id\")\n the_yoga_class = YogaClass.where({ :id => the_id }).at(0)\n\n the_pose = Pose.new\n the_pose.name = params.fetch(\"query_name\")\n the_pose.chapter_id = p...
[ { "docid": "3f8c7f22810e2e43954a846865bc8bad", "score": "0.67718995", "text": "def create\n last_chapter = @section.chapters.where(:level => params[:chapter][:level]).order(:position).last\n if last_chapter.nil?\n position = 1\n else\n position = last_chapter.position + 1\n end\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0a94405efd7bc188d88ba8df6df660d6", "score": "0.0", "text": "def set_dancer\n @dancer = Dancer.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...
cbb6a6f3ce24912767af4075d7e1d77e
Time complexity: ? Space complexity: ?
[ { "docid": "c48f5f1c7000149b5917b75996b253a5", "score": "0.0", "text": "def digit_match(n, m)\n raise NotImplementedError, \"Method not implemented\"\nend", "title": "" } ]
[ { "docid": "5faa084714c4a46eb2c34115a33416f7", "score": "0.63236105", "text": "def second_anagram?(str1, str2) #=> FINAL RUN TIME O(n * m)\n\n arr1 = str1.chars #> O(n)\n arr2 = str2.chars #> O(m)\n\n arr1.each do |char| #> O(n)\n # debugger\n index = arr2.find_index(char) #> O(m)...
c8c0ce0a1ade4358e2819e979a50c2cf
only accept digits as input
[ { "docid": "5d0e51f0ed1a5957071d9693ac6243d6", "score": "0.0", "text": "def is_number(string)\n if string.length == 0\n return false\n end\n return string.scan(/\\D/).empty?\nend", "title": "" } ]
[ { "docid": "2f0efc632f34853188a9145b08400303", "score": "0.72665185", "text": "def is_numeric?\n self =~ /[0-9]/\n end", "title": "" }, { "docid": "ede06c501e66395a8d695b03f18da888", "score": "0.72396463", "text": "def check_int(t) \n t.gsub(/[^\\d]+/, '')\n end", "...
734d35bc196859fbe76b4010fbd1e422
Is this a function line that should be commented?
[ { "docid": "bca0e5f55fd659be54db15c083b53b21", "score": "0.0", "text": "def function_line?(line)\n line.match(/def\\s+\\w+\\??\\s*(\\((\\w+|,)+\\))?/)\n end", "title": "" } ]
[ { "docid": "ee42a5d35916b058b4abf81268dbb756", "score": "0.74177957", "text": "def comment_test5; end", "title": "" }, { "docid": "ee42a5d35916b058b4abf81268dbb756", "score": "0.74177957", "text": "def comment_test5; end", "title": "" }, { "docid": "235f0b82563d6bac18f2bd...
8b08b92d72da013ee8a18caf4548aefa
Resize the image to fit within the specified dimensions while retaining the original aspect ratio. If necessary, will pad the remaining area with the given color, which defaults to transparent (for gif and png, white for jpeg). See for gravity options. === Parameters [width (Integer)] the width to scale the image to [h...
[ { "docid": "354df8708f95bac733dcfa787b4dd46b", "score": "0.5444764", "text": "def resize_and_pad(width, height, background = T.unsafe(nil), gravity = T.unsafe(nil), alpha = T.unsafe(nil), combine_options: T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "b4bb7fea9ca68421d9ddb326f0504ab0", "score": "0.6630792", "text": "def resize_to_fill(img, width, height, gravity = 'Center')\n cols, rows = img[:dimensions]\n img.combine_options do |cmd|\n if width != cols || height != rows\n scale_x = width/cols.to_f\n scale_y = he...
bdb4f54c18da86c6edcbd7a8fb07eb92
POST /warranties POST /warranties.json
[ { "docid": "523d518fccbe3a38f407c679e97fab6f", "score": "0.7813937", "text": "def create\n @warranty = Warranty.new(warranty_params)\n \n # Set check and values\n wc = @warranty.set_create_values(params[:warranty], current_user)\n respond_to do |format|\n if wc\n if @warranty....
[ { "docid": "2f9715a80de757151a761c2bf20d4e93", "score": "0.79609805", "text": "def create\n @warranty = Warranty.new(params[:warranty])\n\n respond_to do |format|\n if @warranty.save\n format.html { redirect_to @warranty, notice: 'Warranty was successfully created.' }\n format.j...
0b9abc07ab6e9de8bf817cbef147b620
toggle all episodes from a season
[ { "docid": "80e8ab3693e49a879a6cbaf01ecced56", "score": "0.74679554", "text": "def toggle_all\n f_tvshow = current_user.followed_tvshows.find_by(tvshow_id: params[:show_id])\n episodes = f_tvshow.episodes\n del = false\n if Episode.where(tvshow_id: f_tvshow.tvshow.id, season: params[:season_...
[ { "docid": "06cb932cff7927be2d5caed68c5b07ef", "score": "0.66874504", "text": "def set_season\n @season = Season.with_deleted.find(params[:id])\n end", "title": "" }, { "docid": "67e64deedbbf5f4dbc5bf01a09c88a6f", "score": "0.6522472", "text": "def set_season\n @season = S...
d183afe1ec6ad724b637a3f7f180dca4
this is unfortunately not concurrent
[ { "docid": "d88301ee04d983c510a87c295a7f9044", "score": "0.0", "text": "def bulk_make_new_connections(num_new_conns_needed)\n num_new_conns_needed.times do\n # try_to_checkout_new_connection will not exceed pool's @size limit\n if new_conn = try_to_checkout_new_connection\...
[ { "docid": "f6d4a510b1064cdde36cfabb37bc801a", "score": "0.7493375", "text": "def threadsafe; end", "title": "" }, { "docid": "711c764f1a0d24d73da19944bacd2f08", "score": "0.7110829", "text": "def concurrency; end", "title": "" }, { "docid": "48aa6ae56116baa2a62ba9233aa5f...
ff671454c0291f4b75edd5732d905410
TODO (colin) implement in Java
[ { "docid": "271be359eb78d3c2de0d59fca18b9ad5", "score": "0.0", "text": "def -(value)\n self.time - (value.is_a?(Timestamp) ? value.time : value)\n end", "title": "" } ]
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.596766", "text": "def desired; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.5656225", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", ...
df5b86f4bb6ba4d8fe3d63d13122ed65
request_count is the notification for friendship requests you received it is stored in application_controller in order to be available in ALL VIEWS of the applicaiton, not only in the users view, if we had defined it in the users_controller now it will be availabe to be displayed in the top bar
[ { "docid": "15fe03ca31538ef3e9b3aba297f029a8", "score": "0.7673603", "text": "def request_count\n if current_user\n current_user.pending_friend_requests_from.map(&:user).size\n end\n end", "title": "" } ]
[ { "docid": "aea272a599e2001dc9787745c35abdd7", "score": "0.6846604", "text": "def index\n @friendships = current_user.friendships\n @friendships_count = @friend\n end", "title": "" }, { "docid": "c234fea6556894fbcd4cae1c235910d3", "score": "0.6636659", "text": "def for_friends...
0913706100ef76548540c6c70daa117e
POST /venue_maps POST /venue_maps.xml
[ { "docid": "f7b29a9d7aee0137b3ab3089d728e08f", "score": "0.65529466", "text": "def create\n @venue_map = VenueMap.create(params[:venue_map])\n\n respond_to do |format|\n if @venue_map.save\n \texpire_action :action => :index\n \t\n format.html { redirect_to(@venue_map, :notic...
[ { "docid": "fd28cfa89a2127673072999728b3842d", "score": "0.633038", "text": "def new\n @venue_map = VenueMap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @venue_map }\n end\n end", "title": "" }, { "docid": "515a8c11a1a4b87f97...
b163e8499470ed76f45bbe42abbe0c3a
Returns the value of the `properties` attribute.
[ { "docid": "a5c4210ab2a68d6520cb212e75233648", "score": "0.73996216", "text": "def properties\n @properties\n end", "title": "" } ]
[ { "docid": "836da00306b482a0089ea320453b419f", "score": "0.7884288", "text": "def properties\n self['properties']\n end", "title": "" }, { "docid": "92b258b956ab6ddb6455e15632e59868", "score": "0.7883089", "text": "def get_properties()\n return @properties\n end", ...
d2ea1792b58f578f2a3741d73ee58784
test "the truth" do assert true end
[ { "docid": "88cb504c79a569287bda1b8b3c81353e", "score": "0.0", "text": "def test_can_set_a_password\n user = User.new(email: 'example3@email.com')\n user.password = \"dc_ror_june_is_awesome\"\n assert_match /[A-Fa-f0-9]{64}/, user.password_digest\n end", "title": "" } ]
[ { "docid": "c2125db88556c19c7c74d67db3bdefbc", "score": "0.91479206", "text": "def test_true\n assert true\n end", "title": "" }, { "docid": "7bea728be8b7c29dd40451830363b35a", "score": "0.914107", "text": "def test_true\n assert true\n end", "title": "" }, { "docid...
74d14c8479f47e93d8a07d837015e97d
Parse Geonames Zip Export
[ { "docid": "fcfb9ddd620a2248a409e1e8d81d8cc9", "score": "0.6978284", "text": "def parse_zip(row)\n # country, zip, @name, state, state_code, procince, province_code, community, community_code, lat, lon, acc = row.split(/\\t/)\n country, zip, @name, a1, @code, a2, a2c, a3, a3c, lat, lon, acc =...
[ { "docid": "ecb4dde06dc35fd4a3bd05b5f661f71b", "score": "0.6813286", "text": "def parse_zip(row)\n _nation, @zip, @name, _a1, _a1c, _a2, @code, _a3, _a3c,\n lat, lon, _acc = row.split(/\\t/)\n\n @kind = :city\n parse_geom(lat, lon)\n # puts \"#{row}\\n---\\n#{@kind} - #{@code} -...
7aff3588759032718e0e4077ba1bf380
Gets the total matches count
[ { "docid": "c523b17b5bf161271d353124550fcd5d", "score": "0.7781055", "text": "def get_matches_count\n get_wons_count + get_losses_count + get_neutrals_count\n end", "title": "" } ]
[ { "docid": "986ab3bd1ac8eca1d78c26bbb92feeab", "score": "0.90838253", "text": "def total_matches\n matches.count\n end", "title": "" }, { "docid": "fba6159aaa6a7564b1c0ad9254259883", "score": "0.87476075", "text": "def matched_count\n results.map(&:matched_count).reduce(...
06925275eec232bb8057e55fedc8f4c1
include this comment elsewhere where needed give warning that how this is used, child_name must be both the step and the child model attribute name
[ { "docid": "ee9a2d90acd7a9e0a0ccc02fcb166d69", "score": "0.6112222", "text": "def create_or_update_then_render_child(parent, child_name)\n child_obj = parent.send(child_name)\n attribute_name_params_template = \"#{child_name}_params\"\n attribute_name_params = send(attribute_name_params_templat...
[ { "docid": "18e690119ed335562917e274a55abac4", "score": "0.6072771", "text": "def child_attributes\n super.merge(\n schema: ->(t) { t.references :child, foreign_key: true },\n model: ->(m) {\n belongs_to :child, inverse_of: :parent, dependent: :destroy\n has_one :par...
133ae78e2f4ac6d8e12fadeaaaba962e
Run the editor command for the given file and line.
[ { "docid": "1b9d1449a3548b4e37427d374d1e74e4", "score": "0.72882533", "text": "def run(file, line)\n system *command_for(file, line)\n end", "title": "" } ]
[ { "docid": "50a81ed0bc664dfda16798284e55266a", "score": "0.7618434", "text": "def run(args)\n case args.size\n when 1\n if @proc.frame\n file = @proc.frame.source_container[1]\n line = @proc.frame.source_location[0]\n else\n errmsg(\"No Ruby program l...
5d547c7794cb218cc4f754bc129bc31f
Make a cookie field for appending to the outgoing header for the specified +value+ and +field_name+. If +value+ is nil, an empty string will be returned.
[ { "docid": "da775d5be1500bd80010b0fb9285a84c", "score": "0.6688854", "text": "def make_field( field_name, value )\n\t\treturn '' if value.nil? || (value.is_a?(String) && value.empty?)\n\t\t\n\t\treturn \"; %s=%s\" % [\n\t\t\tfield_name.capitalize,\n\t\t\tvalue\n\t\t]\n\tend", "title": "" } ]
[ { "docid": "27f289049c41d428d97c1a31fe62bc4d", "score": "0.6087751", "text": "def add_value(cookie_name,cookie_value)\n @cookie_info[cookie_name] = cookie_value\n end", "title": "" }, { "docid": "659d08494a2dab6431f4f34923ba6a18", "score": "0.6046689", "text": "def cookie_value\n...
979e3707d4a9024fffa3dd32ac0dde6f
DELETE /pm/tasks/1 DELETE /pm/tasks/1.json
[ { "docid": "b7d70aa37423cee5f648a733df71d9de", "score": "0.71595824", "text": "def destroy\n @pm_task.destroy\n respond_to do |format|\n format.html { redirect_to pm_tasks_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": ...
[ { "docid": "d625ec15c2e62330f958b41bda0aee7e", "score": "0.7436406", "text": "def delete_task id\n request :delete, \"tasks/#{id}\"\n nil\n end", "title": "" }, { "docid": "bf1d16503658c31238294141a4ebe248", "score": "0.73437387", "text": "def delete()\n\n client....
cced8a2f421b4846706d13a0246fbd78
This was a failed attempt needed to restart the script because I just didn't understand how to sort the steps this sorts the steps by the number of prerequistites properly but doesn't take into account alphabetical order I could not resort alphabetially without blowing out the original order Define Functions
[ { "docid": "30cb080f8279c398b438842c306632f6", "score": "0.687178", "text": "def getStepOrder(steps, letter, order)\n steps.each do |_step|\n order += 1 if _step['prerequisites'].include? letter\n end\n order\nend", "title": "" } ]
[ { "docid": "b22b3546c20a91573ef3c2c8c18b3a0f", "score": "0.6639651", "text": "def main_sort_running_order; end", "title": "" }, { "docid": "c825638fb6d47e5892c3bc345c75ae09", "score": "0.6561151", "text": "def steps_in_order\n steps.order(number: :asc)\n end", "title": ""...
29e50a4eee3ca646ee831bea2aa36154
add attribute and add to before_save filter?
[ { "docid": "a258fa5c35eb0ee571604ff861317653", "score": "0.0", "text": "def time_to_select\n selected_at - search.created_at\n end", "title": "" } ]
[ { "docid": "7f90dd55f10313ff5b7e00767714e5a4", "score": "0.66939044", "text": "def before_save(sender); end", "title": "" }, { "docid": "64d573c0e1e68e551957baa80b4fd44a", "score": "0.6621672", "text": "def before_save(*); end", "title": "" }, { "docid": "63803be209770b0f...
e91c57874a52d2bc29506d4bc88de4a4
This method checks to see if the current user has access to this case in BGS. Cases in BGS are assigned a "sensitivity level" which may be higher than that of the current employee
[ { "docid": "5b984811d918b34b58e74292b672c318", "score": "0.0", "text": "def can_access?(vbms_id)\n MetricsService.record(\"BGS: can_access? (find_flashes): #{vbms_id}\",\n service: :bgs,\n name: \"can_access?\") do\n client.can_access?(vbms_id)\n...
[ { "docid": "3631b7df1c53999826443a8c58abc124", "score": "0.6480858", "text": "def verify_pcb_group\n\n valid_user = false\n\n if @logged_in_user\n\n roles = @logged_in_user.roles.collect { |r| r.name } \n role_list = ['Designer', 'Manager']\n valid_user = (roles & role_list).size >...
261e2ad2044b46deeb26e440fa2f760f
Format an individual element in the Array for building into a String. The default implementation wraps quotes around the element.
[ { "docid": "d776270a02238a6a47a36aa70f17020c", "score": "0.0", "text": "def format_value(v)\n %Q{\"#{v.to_s.gsub('\\\\', '\\\\\\\\\\\\\\\\').gsub('\"', '\\\\\\\\\"')}\"}\n end", "title": "" } ]
[ { "docid": "367c477dcd2121f4da9c4aa14c3723f1", "score": "0.71200055", "text": "def format(arr, opts={})\n # if seperator is an array, it is using different seperators for inner arrays\n seperator = opts[:seperator] || ' '\n #indicates if it should return nil if one of arr's elements is ni...
4ebb286f424bbdf570729e2e792c9843
Reads all children of a has_many relation.
[ { "docid": "0c287d2a871fd3a27d83f2cd26a786ac", "score": "0.61397654", "text": "def read_children(child_class) # :nodoc:\n if new_record? \n nil\n else\n result = Array.new\n _late_connect?\n child_class.in_batches :query, condition_options(child_class) do |attrs|\n...
[ { "docid": "199de37aa45535ca819ace508a309b18", "score": "0.70944357", "text": "def children\n EarLogger.instance.log \"Finding children for #{self}\"\n ObjectManager.instance.find_children(self.id, self.class.to_s)\n end", "title": "" }, { "docid": "29a322a663d5b9a99b362d4...
c66c9076144ccc774cf75682b96ecce5
GET /customer_requests GET /customer_requests.json
[ { "docid": "dad1884311f929f7366a3d6dabccf2dc", "score": "0.7108084", "text": "def index\n @customer_requests = CustomerRequest.all\n end", "title": "" } ]
[ { "docid": "a18813e3bf44e559cb08f9290a4c3a4e", "score": "0.74123734", "text": "def index\n @requests = current_customer.request\n end", "title": "" }, { "docid": "b915f261800be53a4f784dd8ea489e2c", "score": "0.6955296", "text": "def customer(request)\n gateway_request('POST'...
fe1313d3ad41ab31df691a61c152bb0b
Replace this with your real tests.
[ { "docid": "72fd36c52f9358823fcd80b429120869", "score": "0.0", "text": "def test_truth\n assert true\n end", "title": "" } ]
[ { "docid": "16a6d5e8eabd975007f205c109c50890", "score": "0.7377744", "text": "def testing; end", "title": "" }, { "docid": "1068832c8229c37488788b46a0871f26", "score": "0.6993729", "text": "def testing\n end", "title": "" }, { "docid": "8fbc98d9068bd9c82033a031286f0a1e",...
fb5a6eb5010b315e101895e0de8596a0
GET /tasks/1 GET /tasks/1.json
[ { "docid": "84f855a337757af5b582f097431aff4e", "score": "0.0", "text": "def show\n @notes = @task.task_notes\n @tasks = @task.sub_tasks\n if current_user.allowed_to?(:manage_roles) and @task.user\n session[:employee_id] = @task.user.id\n User.current = @task.user\n end\n end", ...
[ { "docid": "1a71110c0b7b1341c80bd129acb3b511", "score": "0.7609859", "text": "def show\n @task = Task.find(params[:id])\n\n render json: @task\n end", "title": "" }, { "docid": "8232c50468301a185d8ad9f041957c9f", "score": "0.75567794", "text": "def task(name)\n get \"#{...
488fab3ff41028a8dd99a0d28332eaa5
check if BST is BST
[ { "docid": "a317524465fd678912eb72ee363fb8fd", "score": "0.0", "text": "def push_node(root, value)\n if value > root.value\n if root.right\n push_node(root.right, value)\n else\n root.insert_right(value)\n end\n end\n\n if value < root.value\n if root.left\n ...
[ { "docid": "4a7142034c27003df743fdb604b7c9f7", "score": "0.80921257", "text": "def is_bst?(root)\nend", "title": "" }, { "docid": "6562cb9fc7946238230fe5df6991e7a3", "score": "0.8037547", "text": "def bst?(root)\n return true if root.nil?\n return false if !root.left.nil? && (m...
08be1f811178325e889d38fcf97f3a76
Maze solving visiting method. Here we perform the basic functionality
[ { "docid": "65c6f7142a5ffbab812e0c7f83a2339c", "score": "0.0", "text": "def check_neighbour(array)\n # Get the next node\n\n path = @setOfNodes.shift\n\n # We take last node to discover its neighbourhood\n x, y = path.last\n\n # Mark node as visited\n @visited[x][y]=1\n\n # The path...
[ { "docid": "ac5d88157f633d5667dada360cf40e21", "score": "0.7517458", "text": "def maze_solver(maze, start_pos, end_pos)\n \n end", "title": "" }, { "docid": "f420922677c43b3afbd03f8630e81f71", "score": "0.7049092", "text": "def solve\n @maze.build_maze\n @laser = Laser.new(...
1ccefc8740c25a8eb09ec137f39ca167
GET posts(.:format) Gets all posts
[ { "docid": "d9c6b0dcd06f1eb7bacec0914eb08b99", "score": "0.0", "text": "def index\n\t\t@allExchanges = ::Exchange.all.order(:created_at).reverse_order\n\t\t# Gets all posts\n\t\t@allPosts = ::Post.all.order(:created_at).reverse_order.page params[:page] \n\t\t@categories = [[\"Apparel & Accessories\", \"...
[ { "docid": "09d856b2bfa3f8de3effb0244fdc93da", "score": "0.8104831", "text": "def index\n @posts = PostService.getAllPosts\n end", "title": "" }, { "docid": "0e4d3285b64b6124e41a7a5c68d0f4b7", "score": "0.80789554", "text": "def index\n # TODO: implement listing all post...
8ee72932ef69df11e88b53564d853e59
Returns the object in the form of hash
[ { "docid": "7f2e5dd34e628cb49304452d2dd73178", "score": "0.0", "text": "def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n next if value.nil?\n hash[param] = _to_hash(value)\n end\n hash\n end", "title...
[ { "docid": "027facb8b195665ceeb78f2c171e2881", "score": "0.8270299", "text": "def to_hash\n object\n end", "title": "" }, { "docid": "d730a9ea60df6695b2c6a153d7d3a8b7", "score": "0.794916", "text": "def hash\n as_hash.hash\n end", "title": "" }, { "docid":...
e76b01463b301660b492ffa97d13c01b
Add a sentence of text. `text' specifies a sentence of text. The return value is always `nil'.
[ { "docid": "db58684bc99735a52461d078a866f9ad", "score": "0.71921355", "text": "def add_text(text)\n Utility::check_types({ text=>String }) if $DEBUG\n text = text.gsub(/[ \\t\\r\\n\\v\\f]+/, \" \")\n text = text.strip.squeeze(\" \")\n @dtexts.push(text) if text.length\n nil\n ...
[ { "docid": "5936d0ce5b85c6d47a7d6a0cfa9995bc", "score": "0.74465656", "text": "def add_text(text)\n @text.push(text)\n end", "title": "" }, { "docid": "7c435462f72f496d39387a6a2dff8ee6", "score": "0.7417764", "text": "def add_text(text); end", "title": "" }, { "docid"...
1cb261701dfac64775f15cc4e04d2cf2
Basically, should we take care of at_exit behavior or something else? Used by the minitest plugin. See lib/minitest/simplecov_plugin.rb source://simplecov//lib/simplecov.rb28
[ { "docid": "a07e2559255cf9341726ba60e833324f", "score": "0.75249213", "text": "def external_at_exit; end", "title": "" } ]
[ { "docid": "703da8231e354c011e9d2bbf366b28f2", "score": "0.7519507", "text": "def at_exit(&block); end", "title": "" }, { "docid": "39ad060f32c942b07f2df3dfc15996a6", "score": "0.74651486", "text": "def at_exit &block\n \"WARNING: Monkey patching Kernel#at_exit see 'spec/spec_helper...
bedd727ddb3b885aeee5dfcb993b366e
PUT /permissions/1 PUT /permissions/1.xml
[ { "docid": "d60b70a17667d260c568b9ecbf840ca5", "score": "0.63331383", "text": "def update\n @permission = Permission.find(params[:id])\n\n respond_to do |format|\n if @permission.update_attributes(params[:permission])\n flash[:notice] = 'Permission was successfully updated.'\n f...
[ { "docid": "823f0bc49edbf01cc05d9e6ad3116794", "score": "0.63865983", "text": "def update\n authorize @permission\n\n if @permission.update(permission_params)\n head :no_content\n else\n render json: @permission.errors, status: :unprocessable_entity\n end\n end", "title": "" ...
223ba4aeca9a8cd96b91f2e3eef8d147
Returns true if the user is authenticated against nucore's user table, false if authenticated by an external system
[ { "docid": "5f4a378467ff2ccda561c2b66781748d", "score": "0.0", "text": "def authenticated_locally?\n encrypted_password.present? && password_salt.present?\n end", "title": "" } ]
[ { "docid": "95f8d3d414b159bfd270247668f80a9b", "score": "0.8047739", "text": "def authenticated?()\n if (@_username)\n return true\n end\n \n return false\n end", "title": "" }, { "docid": "8c8789e01b16f62be0877dcc550c7f1b", "score": "0.80459964"...
c0e59fd941015869b222542c96d22a8a
POST /teams POST /teams.json
[ { "docid": "3ef31b531f2086224f5d96c6ce806576", "score": "0.6915442", "text": "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status:...
[ { "docid": "3280629651000a453e2e1dec9c2eca31", "score": "0.7685347", "text": "def create\n\n\t @team = Team.new\n\n\t #Need the [:teams] because its a hash based on the post, and then\n\t #within that hash, we access the [:name]\n\t @team.name = params[:team][:name]\n\t @team.wins_total =...
2bcb9823c2cb784724124b514af371c6
DELETE /preports/1 DELETE /preports/1.xml
[ { "docid": "022b1a9dc372d25048c96a97994f2ef2", "score": "0.67423", "text": "def destroy\n @preport = Preport.find(params[:id])\n @preport.destroy\n\n respond_to do |format|\n format.html { redirect_to(preports_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "9b192b372b34ff041a4466fffea48e51", "score": "0.6255922", "text": "def delete\n @ports.each{ |port|\n port.delete\n }\n end", "title": "" }, { "docid": "153e58976fdbfa7383392757fbb2a4ab", "score": "0.62444264", "text": "def destroy\n name, ty...
78f18c90678f3a2374b9bdcb8cf6d807
see full_city_name(city) in application_helper.rb
[ { "docid": "f89a8a59ac5fecd7a003a07ea67d22f2", "score": "0.7170695", "text": "def full_name\n if self.country.name == \"USA\" && self.name != \"Washington DC\"\n city_name = self.name + \", \" + self.state.abbreviation + \", \" + self.country.name\n else\n city_name = self.name + \", \" ...
[ { "docid": "9186dd32b7f9508ac4b190f0464290a9", "score": "0.7736206", "text": "def get_city_full_name\n city ? city.get_full_name : ''\n end", "title": "" }, { "docid": "fb81a2ceb95a78c1b196ab04c9e682b0", "score": "0.771799", "text": "def city\n city_name\n end", "titl...
88e1981e7b36657587f1b6a5f0dd61ac
Calls all methods necessary for the game to actually run
[ { "docid": "e23d010715ef389b9eda0bd7e4d4643e", "score": "0.0", "text": "def play\n\t\tloop do\n\t\t\tgetBets\n\t\t\tdealInitialCards\n\t\t\tmakeMoves\n\t\t\tif not @playing\n\t\t\t\tbreak\n\t\t\tend\n\t\t\tdealerScore = @players[DEALER_INDEX].value\n\t\t\tcollectBets(dealerScore)\n\t\tend\n\t\t@out.puts...
[ { "docid": "b9b2d0317c7ce9f1c262dbd37d26609c", "score": "0.7795293", "text": "def play\n #calls to all the methods that produce game!\n end", "title": "" }, { "docid": "dcae017f07d64d5583298638a3cda7d9", "score": "0.7720289", "text": "def run\n start_game\n game_loop\n e...
b46f035797ed9200e550a34a86310a9c
GET /comentarios_estrategia/new GET /comentarios_estrategia/new.json
[ { "docid": "5a214956c0ad9e086c17607a9ffd3e1a", "score": "0.78546757", "text": "def new\n @comentarios_estrategium = ComentariosEstrategium.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comentarios_estrategium }\n end\n end", "title": ""...
[ { "docid": "ad9c755860fe0e04a3acf65606633e49", "score": "0.7372414", "text": "def new\n @estrategia_promocional = EstrategiaPromocional.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estrategia_promocional }\n end\n end", "title": "" }...
b7096fcb9279c9582c8450f358e6c3ec
GET /categories/1 GET /categories/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "86e5d5637eeb2a8cc989235e83e67c7b", "score": "0.8207107", "text": "def get\n payload = {}\n @client.post('categories/get', payload)\n end", "title": "" }, { "docid": "efcb5e10780279c84a4be599091f0268", "score": "0.8070091", "text": "def categories\n call_...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "872a2ee741ce97e88751bde91d39aed4", "score": "0.0", "text": "def post_params\n # params.permit(:content, :color, taggings_attributes: [:id, :tag])\n params.permit(:content, :color, tag_ids: [], asset_ids: [])\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7123669", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.7054077", "text": "def expected_permitted_parameter_names; end", "title": ""...
82da807364896ba76da3de5d48091253
List's all the directories that exist in this repository.
[ { "docid": "e6d1f34f5828c98cb4e87c5e1bd61254", "score": "0.6764903", "text": "def list_directories\n Dir.chdir(path)\n Dir.foreach(EXTENSION) do |element|\n next if element == \".\" or element == \"..\"\n yield element\n end\n end", "title": "" } ]
[ { "docid": "872621478abcfb334e8d34972e2fc2a8", "score": "0.7667861", "text": "def directories\n directory.directoires\n end", "title": "" }, { "docid": "7492db872e9bfdfc80e171ac2e63f9b8", "score": "0.760633", "text": "def listDirectories\n return contentHost.listDirector...
172814f8cc635de5d2aa7bfe3d7a195d
This class should take the field to match with in the constructor: rule = Validation::Rule::Matches(:password) rule.obj = OpenStruct.new(:password => 'foo') rule.valid_value?('foo')
[ { "docid": "aa306540dd41dfc700b0d6d7e173e450", "score": "0.555796", "text": "def initialize(matcher_field)\n @matcher_field = matcher_field\n end", "title": "" } ]
[ { "docid": "f455e8fc6664bec72a7bef4ea590b214", "score": "0.6019821", "text": "def initialize(field, value)\n @field, @value = field, value\n end", "title": "" }, { "docid": "d0e5f27f164e5f92b78f442c5bd0c170", "score": "0.5786257", "text": "def initialize(field, operator, valu...
a10ca2a0d47cea4f509093e8f1cfd1fe
POST /searches POST /searches.json
[ { "docid": "960ce4bcd44bad7c9fa46a0173303524", "score": "0.6264266", "text": "def create\n @search = Search.new(params[:search]) #query string\n @search.save\n redirect_to @search\n end", "title": "" } ]
[ { "docid": "69fcecb5d5eaaf40ec8b2cedc3a2ca4c", "score": "0.75531805", "text": "def create_search(params = {})\n post(\"/searches\", params)\n end", "title": "" }, { "docid": "2dffef85e1b18b784304671583084fa1", "score": "0.71366596", "text": "def create_saved_search(query)...
7406c8c67e0c77f12a86bc14b02a6092
POST /school_districts POST /school_districts.json
[ { "docid": "1e93739fcf2bde18653547f8db351caa", "score": "0.7876577", "text": "def create\n @school_district = SchoolDistrict.new(school_district_params)\n\n if @school_district.save\n render :show, status: :created, location: @school_district\n else\n render json: @school_district.err...
[ { "docid": "47f89193e89de07fffd7397ec826ac25", "score": "0.7539331", "text": "def create\n @district = District.new(params[:district])\n\n respond_to do |format|\n if @district.save\n format.html { redirect_to @district, :notice => 'District was successfully created.' }\n format...
e6f786fd6c8f8f846e4211fc90569858
helper for env var values to ensure a string value is actually true
[ { "docid": "bcd419b9416fee7b2d15cd244d857a6c", "score": "0.0", "text": "def is_true_value(v)\n if v.nil?\n return false\n elsif v == false\n return false\n elsif v.to_s.downcase == 'true'\n return true\n end\n return false\n end", "title": "" } ]
[ { "docid": "99efd3360499734e6919d68ad2616684", "score": "0.7586625", "text": "def valid_env_var?(var)\n var.kind_of?(String) && Dux.presentish?(var)\n end", "title": "" }, { "docid": "be89b0889f389d78db8162c8689caf86", "score": "0.7409585", "text": "def env_var?(value)\n ...
4fa305c3ae25413399e873835f45ca66
Create/update a new locz document with the supplied ID in the locations reference database.
[ { "docid": "f7b75637ae85232110b1eb7570a18d6b", "score": "0.0", "text": "def postLocation( location_id, type, country, language, name, formal_name, resolution, population, description, timezone, latitude, longitude, parent_town, parent_county, parent_province, parent_region, parent_neighbourhood, parent_...
[ { "docid": "e97753fbabdb5c0bf2c3a744ac3612bb", "score": "0.6188109", "text": "def make_location(params)\n new_location = Location.create(name: params[:name], address: params[:address], city: params[:city])\n self.update(location_id: new_location.id)\n end", "title": "" }, { "docid": "...
aa05e1e21cde3fbd3cc5675b68cd8611
DELETE /mk_missatges/1 DELETE /mk_missatges/1.json
[ { "docid": "5c26d4138f08624dd518940292a8fb52", "score": "0.76773226", "text": "def destroy\n @mk_missatge.destroy\n respond_to do |format|\n format.html { redirect_to mk_missatges_url, notice: 'Mk missatge was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"...
[ { "docid": "97521d36d467b9eb4476d7a0b3c4cf15", "score": "0.700707", "text": "def destroy\n @miss.destroy\n respond_to do |format|\n format.html { redirect_to misses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fefd5709f968de4694bec60f7...
e28080409ac378904b40ed63dda0a124
Return paragraph as a HTML fragment with formatting based on properties.
[ { "docid": "967cfa8fb68b512d12d362ec25f4471c", "score": "0.6922232", "text": "def to_html\r\n html = ''\r\n text_runs.each do |text_run|\r\n html << text_run.to_html\r\n end\r\n styles = { 'font-size' => \"#{font_size}pt\" }\r\n styles['text-align'...
[ { "docid": "5b1de6a4e3c59c2f6f7c64a447320f0e", "score": "0.7315442", "text": "def to_html\n result = \"\"\n\n @paragraphs.each do |paragraph|\n result << \"<p>\" + paragraph.to_s + \"</p>\\n\"\n end\n\n result\n end", "title": "" }, { "docid": "19949...