query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
61dd4f044eae82ecc7bfaf43bd595646
CreateRefund Initiates a refund for a previously charged tender. You must issue a refund within 120 days of the associated payment. See [this article]( for more information on refund behavior. NOTE: Cardpresent transactions with Interac credit cards cannot be refunded using the Connect API. Interac transactions must re...
[ { "docid": "17ff686a3c02f5b7fccd6029897dfbac", "score": "0.6590792", "text": "def create_refund(location_id, transaction_id, body, opts = {})\n data, _status_code, _headers = create_refund_with_http_info(location_id, transaction_id, body, opts)\n return data\n end", "title": "" } ]
[ { "docid": "5a895f46af6a3e1f4633fa108021cba3", "score": "0.75019854", "text": "def stripe_refund\n return unless charge_id.present?\n Reservation.transaction do\n charge = Stripe::Charge.retrieve(charge_id)\n charge.refunds.create(amount: charge.amount, reverse_transfer: true)\n upd...
973fd927cc200ef187429199587b2a66
GET /latencies/1 GET /latencies/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "a4dde8ad9cb8a530694b6e4c5d15a64c", "score": "0.65797895", "text": "def index\n @latencies = Latency.paginate(:page => params[:page], :per_page => 100)\n # @latencies = Latency.all\n end", "title": "" }, { "docid": "b958273aa3b8b496f8d19698b72c099f", "score": "0.581069",...
39755320bef5ae856c555dc00ee9a88d
one admin at least
[ { "docid": "e6ceb93bf92fff8b2324024e5df94cb7", "score": "0.7959311", "text": "def deny_admin_suicide\n raise 'admin suicided' if User.count(&:admin) <= 1\n end", "title": "" } ]
[ { "docid": "8617d6f904ad79ff490805e0bc380039", "score": "0.79667354", "text": "def admin?; false end", "title": "" }, { "docid": "ddd2cfc4cb885d24ee03e9cd901758ef", "score": "0.78661215", "text": "def admin?() false end", "title": "" }, { "docid": "e38f2ebaebb7ea689d5e54e...
fb66423af8fde247c632cc4e870c84f8
Delegates to application, who should use custom logic to relate +parent+ and +child+.
[ { "docid": "7677949877740a55803d47bb19959d95", "score": "0.59718716", "text": "def make_related(parent, child, resource_config)\n proc = resource_config[:relation][:create]\n proc.call(parent, child) if proc\n child\n end", "title": "" } ]
[ { "docid": "162c8e3a8172885f34c21aa6ee7c77ad", "score": "0.7164948", "text": "def method_delegation_to_ancestor\n \"method_on_child_model:#{ParentModel.method_delegation_to_ancestor}\"\n end", "title": "" }, { "docid": "a34041105ba3b11619ead6754e6bda55", "score": "0.68021584", ...
fa8c6affa5b12718d2baba9137c8e0d8
Reversemap our cloud description into a runnable config hash.
[ { "docid": "37e0ade3ec835501426278e8654f2906", "score": "0.0", "text": "def toKitten(**_args)\n bok = {\n \"cloud\" => \"AWS\",\n \"credentials\" => @credentials,\n \"cloud_id\" => @cloud_id,\n \"region\" => @region\n }\n\n if !cloud...
[ { "docid": "0e2b51040de8eba2bf094004ac4433d4", "score": "0.5925813", "text": "def reverse_mapping\n @@reverse_mapping ||= Hash[Danbooru.config.full_tag_config_info.map { |k, v| [v[\"category\"], k] }]\n end", "title": "" }, { "docid": "135e78eae1ef9dd65282c5d494a2c685", "score": ...
88547985e930275f6f4db9e553c02809
Lists all the local or replicated volumes within a Project.
[ { "docid": "3295576f6440848c18033877d2b191e2", "score": "0.0", "text": "def list_volumes_post(list_volumes_param, opts = {})\n data, _status_code, _headers = list_volumes_post_with_http_info(list_volumes_param, opts)\n return data\n end", "title": "" } ]
[ { "docid": "a916b4690c339b692d34cf57924adb61", "score": "0.7392196", "text": "def list_all_volumes\n d = host_client.remote_exec %Q(ls #{instance.nfs_remote_path})\n d = d.split(\"\\n\")\n d.delete(\"metadata.db\")\n d\n rescue\n []\n end", "title": "" }, { "do...
2ea1e8d5d23de9849e806fd80bf2e9b3
Cookbook Name:: contrail Library:: utils Copyright 2014, Juniper Networks
[ { "docid": "d91fe4d06175f4693dd6d726ea13b35b", "score": "0.0", "text": "def get_all_roles_nodes\n result = search(:node, \"chef_environment:#{node.chef_environment}\")\n if result.any? { |x| x['hostname'] == node['hostname'] }\n result.map! { |x| x['hostname'] == node['hostname'] ? node : x...
[ { "docid": "3d41ee54d7cd41b9802bd21d6c74ec07", "score": "0.5256025", "text": "def fetch_dependencies()\n\t\"berks vendor cookbooks #{(@debug ? '-v' : '-q')}\"\n end", "title": "" }, { "docid": "c7064cf36d9a574890ab002c6c4c2e61", "score": "0.51808554", "text": "def debug_log(msg)...
4f493637caf703aa498f71fa56746ba5
Returns true if the profile is connected.
[ { "docid": "87211b4811cc1895ecf63761382efbea", "score": "0.0", "text": "def can_disconnect?\n connected?\n end", "title": "" } ]
[ { "docid": "f57085c705d707e162429987206de805", "score": "0.79434365", "text": "def is_connected?\n return true\n end", "title": "" }, { "docid": "eccbcab3bd6f973f93c257320ac61414", "score": "0.7892857", "text": "def is_connected?\n return @status == CONNECTED\n en...
3412b2ac44d1fe3ab6efbcb68bd738ee
adds four methods to the page object one to set text in a text area, another to retrieve text from a text area, another to return the text area element, and another to check the text area's existence.
[ { "docid": "bd15ea9a8f81288df777c0a9b3e16595", "score": "0.6148738", "text": "def text_area(name, identifier=nil, &block)\n define_method(name) do\n return platform.text_area_value_for identifier.clone unless block_given?\n self.send(\"#{name}_element\").value\n end\n define...
[ { "docid": "fdbf364b2eb34c302209c819bd550fcc", "score": "0.69617915", "text": "def textareas; end", "title": "" }, { "docid": "3dcb02b3f2d0e636c0edc061352a77e9", "score": "0.68248713", "text": "def text_area; end", "title": "" }, { "docid": "03b063f7c343a73b12cd731d8b9ac3...
6f5b2d702168a78fa8bdd3d33eeca7de
Different to the projects_controller because this one is not limited to owner only.
[ { "docid": "b7403f849d892c96ac78d2cbc710b45f", "score": "0.0", "text": "def show_project\r\n @project = Project.find(params[:id])\r\n @id = @project.id\r\n respond_to do |format|\r\n format.html { render 'project_control/view' }\r\n format.json { render json: @project }\r\n end\r\n...
[ { "docid": "b4688b4c0028f3c1b99591e201c41c83", "score": "0.7005114", "text": "def owner\n\t\tself.project_groups.find_by_project_creator(true).try(:user)\n\tend", "title": "" }, { "docid": "619e5cb492198a568a1425b921107e62", "score": "0.6936825", "text": "def get_owner\n return se...
0ffa011b8c26a8cc8930bf1fb7b8323f
Destructively convert all keys using the block operations. Same as transform_keys but modifies +self+.
[ { "docid": "eb520a1f56d33e88f60af10bce0dbb4f", "score": "0.83460814", "text": "def transform_keys!\n keys.each do |key|\n self[yield(key)] = delete(key)\n end\n self\n end", "title": "" } ]
[ { "docid": "22fc500a8f84e8742dd217e427f53ce6", "score": "0.8278976", "text": "def transform_keys!(&block); end", "title": "" }, { "docid": "f80046b74f5b7b1ae5d907cfa6799e8f", "score": "0.8087593", "text": "def transform_keys(&block); end", "title": "" }, { "docid": "a3554...
98f1d11ae9c952dfa138d016c4e71fa3
return the IP address (preferred) or hostname at which the current request arrived
[ { "docid": "7e6722708c108f1187e70cf8ecd774b8", "score": "0.6961318", "text": "def server_host\n return (\n request.env['SERVER_ADDR'] ||\n request.env['SERVER_NAME'] ||\n request.env['HTTP_HOST']\n )\n end", "title": "" } ]
[ { "docid": "303edf512945cb749cc07ce992157b5b", "score": "0.7828014", "text": "def get_ip\n #if client is \"local=::1\" (running on localhost) then use a default IP address, otherwise use remote\n if request.remote_ip == \"::1\"\n return \"164.82.9.60\" #REPLACE WITH BETTER DEFAULT IP\n end...
fb802e9a70701e89deb28b6041c192ca
Returns the time component from this UUID as a Time.
[ { "docid": "b9bb35cef09d83aa931a49c874fe53eb", "score": "0.62050205", "text": "def to_time\n t = time_bits - GREGORIAN_OFFSET\n seconds = t / 10_000_000\n microseconds = (t - seconds * 10_000_000) / 10.0\n\n ::Time.at(seconds, microseconds).utc\n end", "title": "" } ]
[ { "docid": "2ae06a077f4fc962ec49443fadc26a89", "score": "0.7294193", "text": "def to_time\n @time\n end", "title": "" }, { "docid": "2ae06a077f4fc962ec49443fadc26a89", "score": "0.7294193", "text": "def to_time\n @time\n end", "title": "" }, { "doc...
b39ab148f1c3b3d08ae17eef63841d6b
GET /lojas or /lojas.json
[ { "docid": "6b3f5fd15650d43ac40548505b69d53b", "score": "0.5928992", "text": "def index\n @lojas = Loja.all\n end", "title": "" } ]
[ { "docid": "d6a879df85abc965945f045bb2476ecc", "score": "0.6596967", "text": "def larves\n self.class.get('/monstre_larve.json')\n end", "title": "" }, { "docid": "3d573ab03483a36dfdedd2e11d152c2a", "score": "0.65469825", "text": "def index\n @laudus = HTTParty.get('htt...
98940de16ed802a97196ee52a6248628
Parses course length. e.g. "23" => 2 Returns integer length
[ { "docid": "3eeb2cb55c7a96496c59bea7a70eb80a", "score": "0.6546812", "text": "def parse_length( raw_period )\n return 1 if raw_period.blank?\n\n period_begin = raw_period[0,1].to_i\n if raw_period.size >= 3\n period_end = raw_period[2,3].to_i\n else\n period_end = period_begin ...
[ { "docid": "99bdf05a83517bb373c7fd7d28976284", "score": "0.72283494", "text": "def extract_length(course_d)\n # downcase duration, split on spaces, take first value and convert to float\n duration = course_d.downcase\n years = duration.split(' ')[0].to_f\n # Divide by 12 if duration includes...
4b3de7c7587d4d9c97ebc2b0603098c4
Test is its in starvation
[ { "docid": "bed783c40ea514cb5fb2da14908d245c", "score": "0.0", "text": "def starvation?()\n\n @hunger_counter >= @starvation_level\n end", "title": "" } ]
[ { "docid": "e4514dd4c0571498e33c7ad106aeab5d", "score": "0.70070946", "text": "def sleepy_run; end", "title": "" }, { "docid": "493c619d8d0143cfee3390a40d680b6c", "score": "0.69373053", "text": "def wakeup() end", "title": "" }, { "docid": "fb127afb655b22988cea794c54e71af...
291d066d3ae987b9f94d2d12401698c1
////////////////////////////////////////////////////////////////////////// Properties ////////////////////////////////////////////////////////////////////////// Get the current item GET
[ { "docid": "6e5c89a92448e5b35f877fef4dbfa979", "score": "0.0", "text": "def selected_item\n return (self.index < 0 ? nil : @data[self.index])\n end", "title": "" } ]
[ { "docid": "c57bd75f9c751966ce3b1cb9242aea34", "score": "0.8464925", "text": "def getCurrentItem\n @current_item\n end", "title": "" }, { "docid": "5f5efc37b584c4f08fb502fe337c3e1f", "score": "0.7891875", "text": "def get\n # TODO: Implement single item retrieve\n ...
bc35ba76ffe979af8ceac48d17076fc0
Retourne vrai si le profil de pseudo "unLogin" existe, faux sinon
[ { "docid": "a4cb9fcdee3027931337d74eedec8038", "score": "0.8135983", "text": "def existeProfil?(unLogin)\n\t\n\t\treturn !requete(\"SELECT * FROM profil WHERE pseudo = '#{sanitize(unLogin)}'\").empty?\n\tend", "title": "" } ]
[ { "docid": "c95a6ce50a70e4928392201618f9ce5d", "score": "0.7745182", "text": "def existe?(unLogin)\n\n\t\t\n\t\tres = requete \"SELECT COUNT(*) AS 'cpt' FROM profil WHERE pseudo = '#{unLogin}'\"\n\t\treturn true if res[0][\"cpt\"] == 1 \n\t\treturn false\n\tend", "title": "" }, { "docid": "1...
8a9c480e87d69aea3fda46d0cf6f8c5c
Waits for the given list of +TrackableJob::Job+s to enter the finished state.
[ { "docid": "5915df5dea86c1ad8c52bd72e44ac0d7", "score": "0.7438273", "text": "def wait_for_jobs(jobs)\n jobs.each(&:wait)\n end", "title": "" } ]
[ { "docid": "5b00bd48fda75d5155c1998e30bdca20", "score": "0.6301942", "text": "def wait_until_finished\n @active_requests.dup.each do |n|\n n.join\n end\n end", "title": "" }, { "docid": "79d1d8d711ea950dd564c9a80a41b9d5", "score": "0.6281713", ...
f12c18584213102002b9fc01aab99208
Remembers a artist in a persistent session.
[ { "docid": "d64adc1b26b0681bd1c7e916715180eb", "score": "0.7115317", "text": "def remember(artist)\n artist.remember\n cookies.permanent.signed[:artist_id] = artist.id\n cookies.permanent[:remember_token] = artist.remember_token\n end", "title": "" } ]
[ { "docid": "9a38b3908db2bcf0a9fbf682da872daa", "score": "0.69168323", "text": "def remember(artist)\n\t\tartist.remember\n\t\tcookies.permanent.signed[:artist_id] = artist.id\n\t\tcookies.permanent[:remember_token] = artist.remember_token\n\tend", "title": "" }, { "docid": "c4cf64b01a315cc36...
42d54f1ae6e123ce59c5b500453a031f
readonly same as self.authorize_url(self.id, ...)
[ { "docid": "a63ee83690e11ee27867c24c62d41143", "score": "0.6999325", "text": "def authorize_url(attribs={})\n self.class.authorize_url id, attribs.reverse_merge(credentials: api_creds)\n end", "title": "" } ]
[ { "docid": "441634f661c86b4adbabc17833de1669", "score": "0.71132094", "text": "def authorize_url\n @connection.authorize_url\n end", "title": "" }, { "docid": "9ad057751170558bdcb3cff266e33754", "score": "0.693445", "text": "def authorize_url\n @oauth_client.auth_code...
54b67336797adb6cbcfd09e698c25dfd
Initializes object instance from raw wire JSON
[ { "docid": "d5c404879fb9ecd8ec2b901c6d0a8dff", "score": "0.7197713", "text": "def initialize(json)\n super\n @json = json\n end", "title": "" } ]
[ { "docid": "110367c3bf63e8a567bcb0db8e81d42c", "score": "0.80480963", "text": "def initialize(json)\n @raw_json = json\n end", "title": "" }, { "docid": "e4b50480b2989250a4cb84f7de57007d", "score": "0.7994579", "text": "def initialize(json:)\n @raw_json = json\n end",...
16b118153e91c4d16f0977eb73ddd918
Set effective user/group ID to the ordinary user (the one invoking the script). An optional parameter "setenv:False" will skip setting userrelated environmental variables accordingly. It can be used either as an ordinary function, or with a block parameter. If a block is given, it will revert the UID/GID setting after ...
[ { "docid": "7d198c45af1fec8c5e70ffbfc071f6fb", "score": "0.7637594", "text": "def temporarily_as_user(setenv:true, &procobj)\n return _set_uids(false, false, setenv:setenv, &procobj)\n end", "title": "" } ]
[ { "docid": "5c934cbbecb04d3a21ebcf584fc0fb89", "score": "0.6749621", "text": "def temporarily_as_root(setenv:true, &procobj)\n return _set_uids(true, false, setenv:setenv, &procobj)\n end", "title": "" }, { "docid": "1eccb56f43b4ea8f6ec0547fb708c360", "score": "0.6579732", "text"...
ca8d04684364168dac5b84df519cd7d1
Create the Yarn job history directory\n\nAvailable since API v6.\n
[ { "docid": "ebed3acad567d93f25ac26a02694f4fb", "score": "0.524802", "text": "def api_v11_clusters_cluster_name_services_service_name_commands_yarn_create_job_history_dir_command_post(service_name, cluster_name, opts = {})\n api_v11_clusters_cluster_name_services_service_name_commands_yarn_create_jo...
[ { "docid": "6588e30dc8e60356694f9cbcae1fc06e", "score": "0.59925944", "text": "def new_jobdir\n @target + unique_dir\n end", "title": "" }, { "docid": "c6c6113791b7a025bc66410e85b3b196", "score": "0.5729856", "text": "def write_history; end", "title": "" }, { "docid":...
aa4d7bb9935aae0c3eb0a27cfc2500c7
test class method add_card(card)
[ { "docid": "66d459e0abc74f940a9e980d9e406b3e", "score": "0.80119205", "text": "def test_add\n card_1 = Card.new(:club, 'Jack', 11)\n card_2 = Card.new(:heart, 'Seven', 7)\n card_3 = Card.new(:spade, 'Two', 2)\n card_4 = Card.new(:diamond, 'King', 13)\n cards = [card_1, card_2, card_3, car...
[ { "docid": "bba056fbd8ce527596926b6c29e91e77", "score": "0.88455963", "text": "def add_card(card)\n end", "title": "" }, { "docid": "e1dd4016ac458db36839bec341f608b1", "score": "0.8825253", "text": "def add_card(card)\n\n end", "title": "" }, { "docid": "9d59336db3ded59...
48e683f00d36490ed421c11b605f170d
before_filter on controller that needs login to do anything
[ { "docid": "ead16699aaa195a8935343132815e4b5", "score": "0.0", "text": "def login_required format=nil\n unless logged_in?\n summary = action_summary params[:controller], params[:action]\n alert = \"You need to be logged in to an account on RecipePower to #{summary}.\"\n defer_request p...
[ { "docid": "c990138ccf2bd3d42f5ea65705d019f1", "score": "0.7659542", "text": "def login_filter\n unless logged_in?\n flash[:notice] = \"You must first log in.\"\n redirect_to :controller => 'application', :action => 'index' \n end\n end", "title": "" }, { "docid": "00d75f0a7...
36804d7caf308c300d3a87dd026a7751
def favorite_style return nil if ratings.empty? Style.find(ratings.joins(:beer).group(:style_id).order(score: :desc).limit(1).first.beer.style_id) end def favorite_brewery return nil if ratings.empty? ratings.joins(:beer).group(:brewery_id).order(score: :desc).limit(1).first.beer.brewery end
[ { "docid": "18ef6aad4b15aac3f5d6e150dce48db5", "score": "0.0", "text": "def rated(category)\n ratings.map{ |r| r.beer.send(category) }.uniq\n end", "title": "" } ]
[ { "docid": "2a881cd10358e0721edcbb0ef4accc3c", "score": "0.8312018", "text": "def favorite_style\n return nil if beers.empty?\n beers.select(:style_id).group(:style_id).order('avg(ratings.score)').last.style\n end", "title": "" }, { "docid": "b8d1f3257e95b3e3879e67b622854803", "sc...
e39ca4a4adfb89360f10926d700ba5ed
getting unsync buzz count
[ { "docid": "9db1f19e825f2b524e1e5812a5ca163d", "score": "0.8355517", "text": "def unsync_buzz_count(user)\n insync_id = self.last_insynced_id(user)\n Buzz.limited_buzzs(user.id, self.id).out_of_sync(insync_id).size || 0\n end", "title": "" } ]
[ { "docid": "972ba93ac076a103fa47518164b15009", "score": "0.68712413", "text": "def get_cugs_unsync_count(cugs,show_insyn)\n channel_list = []\n cugs.each do |c|\n buzz_count = c.unsync_buzz_count(self)\n channel_list << {:id => c.id, :name => (self.channel_aliases.where(:channel_id => c....
ae0e77256bb72516cdad0421c45551e3
GET /profesores/new GET /profesores/new.xml
[ { "docid": "706fc79412251b5a09cf21cff9a0e1fc", "score": "0.6464176", "text": "def new\n @departamentos = Departamento.find(:all)\n @profesor = Profesor.new\n @tab = :recursos\n @nav = :profesores\n\n @profesor.activo = true\n if !params[:id].nil? \n @departamentos = Departamento.f...
[ { "docid": "ce6f6c158743b6374903f2dd6af0239d", "score": "0.7563157", "text": "def new\n @prof = Prof.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prof }\n end\n end", "title": "" }, { "docid": "52c3a6b5ddb7040bf0a8ad0d224c067...
43fbf25e2f38b80e38c459d45cb8b2ee
Validates that the file is not narrower than `min`. Requires the store_dimensions plugin.
[ { "docid": "d171eb7dc51f2040e79ccdb2ac17761e", "score": "0.7284275", "text": "def validate_min_width(min, message: nil)\n raise Error, \":store_dimensions plugin is required\" if !get.respond_to?(:width)\n if get.width < min\n errors << error_message(:min_width, message, min...
[ { "docid": "686b4131d62ee3ebe719ef099c4c6231", "score": "0.7588962", "text": "def validate_min_width(min, message: nil)\n raise Error, \":store_dimensions plugin is required\" if !get.respond_to?(:width)\n if get.width\n get.width >= min or add_error(:min_width, message, min...
77a2844b1267a7d1703636818d388945
Create a locator based on a content string, and a boolean indicating if ruby version support multibyte strings or not.
[ { "docid": "3d98f5217131430a4dffc533e092e6e8", "score": "0.0", "text": "def initialize(string, file, line_index = nil)\n @string = string.freeze\n @file = file.freeze\n @prev_offset = nil\n @prev_line = nil\n @line_index = line_index.nil? ? Locator.compute_line_index(@string) : ...
[ { "docid": "1ce3eed9ce50f274b0b06c96c959a441", "score": "0.55391157", "text": "def contains(str)\r\n ContainsText.new(str)\r\n end", "title": "" }, { "docid": "22ee7ce909decb15d7326a2931ae2518", "score": "0.54921764", "text": "def string=(string)\n @scanner = StringScanner...
a4ef5aa5e4d530c6abeadbc0ee4b07db
start events handling allow to subscribe events within freeswitch
[ { "docid": "f75cde9216ddefac80e8f0077b861b32", "score": "0.0", "text": "def subscribe_to_event(events)\n sub_events = events\n sub_events = events.join(\" \") unless events.kind_of?(Array)\n send_data \"event plain #{sub_events}\\n\\n\"\n end", "title": "" } ]
[ { "docid": "a870e2a6abe39d46252176aff4600278", "score": "0.6798997", "text": "def on_start(event)\n end", "title": "" }, { "docid": "a914f52d2379eb2ffcdfc02e49284214", "score": "0.6502849", "text": "def callwide_events()\n on :event => 'error', :next => '/error.json' # For f...
46c035a40cda3d0d0e3809a66b67d211
=begin metodo que recorre los usuarios comparando nombre de usuario, si alguno coincide lo devuelve de lo contrario levanta excepcion =end
[ { "docid": "50dbcf836fe2ddbf94be36b92c5d2585", "score": "0.70037043", "text": "def buscar_usuario(nombre_de_usuario)\n #dos usuarios son iguales si su nombre de usuario es el mismo\n @usuarios.detect(-> do\n raise UsuarioInexistente\n end) {|usuario| usuario.nombre_de_usuario == ...
[ { "docid": "599723de3819ea29c52f7f455924e1de", "score": "0.69082123", "text": "def RepeticionUsuarioCreate(lista_usuarios, nombre_usuario, apellidos_usuarios)\n val = true\n lista_usuarios.each do |usuario|\n if usuario.nombre_usuario == nombre_usuario.upcase\n if usuario.apellidos_usu...
06d6de048f3dea3b195170712979e0a1
^^^ before action callback to set a loan order ^^^ index to show all loan orders and preloading loaner, borrower and artefact entities
[ { "docid": "bb8796a2d4b9a86d27713469964a3e17", "score": "0.70716226", "text": "def index\n @loan_orders = LoanOrder.all.preload(:loaner, :borrower, :artefact)\n end", "title": "" } ]
[ { "docid": "99c4c6890bc0b1b38c870a9310cad918", "score": "0.68165493", "text": "def index\n authenticate_admin!\n @loans = Loan.get_actual_loans\n @loans = sort_loans(@loans, sort_column, sort_direction) \n end", "title": "" }, { "docid": "0d8710ad30073523e201526eb28e3ec0", "sc...
51eec182c1a0608b74bb9250b0cea9ff
Returns the properly quoted column name given the generic term
[ { "docid": "1b7108cbb782324d80056b5d0a23b76b", "score": "0.0", "text": "def nested_set_column(name)\n quote_db_property(nested_set_options[name])\n end", "title": "" } ]
[ { "docid": "4f04807f615094a39f4ec73b8de4690d", "score": "0.7266421", "text": "def quote_column_name(name); end", "title": "" }, { "docid": "aac1c61750455536575d05eb155bc163", "score": "0.71245116", "text": "def qcol(colname)\n %{`#{colname}`}\n end", "title": "" }, { ...
45aa20570f7fe92be2f150ecb8f8f5c1
GET /cotiz_mes_cams/1 GET /cotiz_mes_cams/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "40dad14a63ac1944c4e3e6239d46c901", "score": "0.72069156", "text": "def index\n @cotiz_mes_cams = CotizMesCam.all\n end", "title": "" }, { "docid": "3cd61c4bfe4b316b25e3d455fbcd1c27", "score": "0.65817", "text": "def index\n @cmms = Cmm.all\n render json: @cmms\n...
218350b0381138935c0cadea542fb93d
DELETE /assets/1 DELETE /assets/1.json
[ { "docid": "d6f1e6a9697f43268862beb8c746a51c", "score": "0.760335", "text": "def destroy\n @asset = Asset.find(params[:id])\n @asset.destroy\n\n respond_to do |format|\n format.html { redirect_to assets_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "4b97f22b3a3901152a635660c7ef3b0a", "score": "0.766658", "text": "def delete_asset(id)\n @client.raw('delete', \"/content/assets/#{id}\")\n end", "title": "" }, { "docid": "fa434c603aef770326d3bcfb13e2a884", "score": "0.7558326", "text": "def destroy\n puts \"delete...
4dbcc7cd9cb10c139bafeedba55607d9
As of writing, API only supports a root source folder (0)
[ { "docid": "e4af831cd4e7a07c355597fd784dffc2", "score": "0.0", "text": "def move_users_folder(user, source_folder = 0, destination_user)\n user_id = ensure_id(user)\n destination_user_id = ensure_id(destination_user)\n source_folder_id = ensure_id(source_folder)\n uri = \"#{USERS_URI...
[ { "docid": "c23a5aefe768aa1a6a9577a1e8e5518e", "score": "0.7498198", "text": "def src_folder\n folder/\"src\"\n end", "title": "" }, { "docid": "abc55751bac85cf6a748619201254bb3", "score": "0.74593085", "text": "def default_source_root; end", "title": "" }, { "doc...
b25994a62ec8a1e0fec248fd5fb530a3
PUT /wforums/1 PUT /wforums/1.json
[ { "docid": "62e4393fa9326f6552c13df13bed627f", "score": "0.7025969", "text": "def update\n @wforum = Wforum.find_by_permalink(params[:id])\n\n respond_to do |format|\n if @wforum.update_attributes(params[:wforum])\n format.html { redirect_to @wforum, notice: 'Forum was successfully upd...
[ { "docid": "79b37079894e1e99af9441e3cdb1c4ed", "score": "0.7660526", "text": "def UpdateForum id,params = {}\n \n APICall(path: \"forums/#{id}.json\",method: 'PUT',payload: params.to_json)\n \n end", "title": "" }, { "docid": "56059a23bbafaa008700f13f61fa25d7", ...
b42e269480e2cdede54953b903588727
retrieve all nodes from puppetdb and return then as an array
[ { "docid": "5261b35edcb8c714213a8cdb2436d2c0", "score": "0.7198042", "text": "def get_nodes\n\tq = '[\"=\", [\"node\", \"active\"], true]'\n\n\tif ! q.is_a? String then\n\t\tq=JSON[q]\n\t\tend\n\tparams = {:query => q}\n\n response_nodelist = RestClient.get\"http://#{Tayu.puppetdb_server}:#{Tayu....
[ { "docid": "cd933275041d5205202d4a9b785c41f0", "score": "0.76017463", "text": "def nodes\n\t\t# Query the database\n\t\tnodeQuery = Node.select(:node_id)\n\t\t# Place the query in an array\n\t\tnodeArray = Array.new\n\t\tnodeQuery.each do |node|\n\t\t\tnodeArray.push [node.node_id]\n\t\tend\n\t\treturn ...
39a4b1cf44719993ce291e510fea58b6
Removes an existing tax category
[ { "docid": "5725bd3ee8e0af9637fe4a72037a8b44", "score": "0.0", "text": "def destroy\n super\n end", "title": "" } ]
[ { "docid": "58c9cec8c5796aa780430829f67aec19", "score": "0.6880958", "text": "def remove_category category_name\r\n delete category_name\r\n end", "title": "" }, { "docid": "def3043df2cccd943e856aad6f6f3310", "score": "0.6644063", "text": "def destroy\n authorize_action_fo...
d4c243e794d9f4b22baa590defd8e61c
Set TV tuner saturation or adjust it if [abs] is set to 0.
[ { "docid": "be7d511db605f56ab35630c05252c365", "score": "0.79594696", "text": "def tv_set_saturation _n, _abs=0\n send_cmd(\"tv_set_saturation #{_n} #{_abs}\")\n end", "title": "" } ]
[ { "docid": "fc6e4a9a60d229a745ba4bbea1a80365", "score": "0.756774", "text": "def saturation _value, _abs=0\n send_cmd(\"saturation #{_value} #{_abs}\")\n end", "title": "" }, { "docid": "693334e183653f1041b7c2931d8ed512", "score": "0.6891097", "text": "def saturation=(value)\n ...
475e7c71887fe16685916abf3b530265
Draws a star using the stroke and fill colors. The star is positioned with its center point at coordinates (left, top) with a certain number of points. The outer width defines the full radius of the star; the inner width specifies the radius of the star's middle, where points stem from.
[ { "docid": "8e603c544e43c59800df4af5032b3d67", "score": "0.66938627", "text": "def star(left, top, points = 10, outer = 100.0, inner = 50.0)\n # returns Shoes::Shape\n throw NotImplementedError\n end", "title": "" } ]
[ { "docid": "2a54c726040c87e0e2c2ba02c5a54bfe", "score": "0.7028985", "text": "def draw_star(x, y, outer_radius, inner_radius, star_points=5, rotation=0.deg)\n theta = -90.deg + rotation\n points = star_points*2\n delta_theta = 360.deg/points\n array = []\n star_points.times do\n arra...
d345cc047599aafc1460e08c496f5e3f
gets the document from ES
[ { "docid": "581c89a5b717572b87e01604711b0356", "score": "0.0", "text": "def get(*vars)\n return unless instance.flex_indexable?\n Flex.get(metainfo, *vars)\n end", "title": "" } ]
[ { "docid": "3412261cb67e226e399085b438523c31", "score": "0.71284544", "text": "def index_one_document hsh\n response = client.prepare_index(@index, @type).set_source(hsh.to_indexable_json).execute.action_get\n end", "title": "" }, { "docid": "e41c12e4e7ba6254e8cbe81323d0a84f", "s...
9474748facebcc269b359edb79160704
GET /blog_suggestions/1 or /blog_suggestions/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "5f1e7dea3ab2895a68d9fc57d1649ef8", "score": "0.70100945", "text": "def suggestions\n with_monitoring do\n Faraday.get(suggestions_url, query_params)\n end\n rescue => e\n e\n end", "title": "" }, { "docid": "654a8b5b18d9e72a8f96f99e31517712", "scor...
b4d29f074c04e495919221fc590ea219
PROPFIND requests sent by the WebDav MiniRedirector
[ { "docid": "7d8e876970825ae1e3e7d9e8edbcf4db", "score": "0.5927512", "text": "def process_propfind(cli, request, target)\r\n path = request.uri\r\n print_status(\"Received WebDAV \\\"PROPFIND #{request.uri}\\\" request from #{cli.peerhost}:#{cli.peerport}\")\r\n body = ''\r\n\r\n ...
[ { "docid": "d3ff94e6e24655a251902c4ec9f80702", "score": "0.62418836", "text": "def process_propfind(cli, request)\r\n\t\tpath = request.uri\r\n\t\tprint_status(\"Received WebDAV PROPFIND request from #{cli.peerhost}:#{cli.peerport} #{path}\")\r\n\t\tbody = ''\r\n\r\n\t\tmy_host = (datastore['SRVHOST']...
2dde01c8e5776d9e1df75dff189c5875
Returns the value of attribute exception.
[ { "docid": "f5cc358536014ae4f00727558d578b6f", "score": "0.0", "text": "def exception; end", "title": "" } ]
[ { "docid": "64cfc493ca5694db12a67560444d9580", "score": "0.6680586", "text": "def read_attribute_value()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "85770610c8ec14aaad54b6fce8be997c", "score": "0.66278183", "text": "def extract_at...
e7412dac5a091a8fa7c91bd169aefb65
callbacks to share common setup or constraints between actions.
[ { "docid": "219fdda3b207ea07a262c469acdcbbf6", "score": "0.0", "text": "def set_location\n @location = Location.find(params[:id])\n end", "title": "" } ]
[ { "docid": "311e95e92009c313c8afd74317018994", "score": "0.6223753", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n ...
4c830d226d649cac672a31bbedf028b6
Builds the description of a RDFa property (predicate and object) name: name of the property, symbol with a property name or string with an URI tag: the tat where the property description will be inserted options: content: a string value, true, false or nil. If false or nil is passed the content will not be inserted if ...
[ { "docid": "712955d19f330699771ce0b61e8d3c22", "score": "0.6538792", "text": "def rdfa_property(name,tag,options={})\n property_value = options[:content] || false\n property_uri = name\n property_datatype = options[:datatype]\n if(name.instance_of?(Symbol))\n key = self.class....
[ { "docid": "d18d03b34ccc1ed3e3b89754ea7f2e04", "score": "0.6462214", "text": "def property_description (property) \n ret = {:name => property.name}\n ext_type = EXT_TYPE_TRANSLATIONS[property.primitive.to_s] || EXT_TYPE_TRANSLATIONS[\"String\"]\n \n if property.respond_to? :f...
f6990fe741203c4faf474ceb4e399b28
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.invite_mailer.inviation.subject
[ { "docid": "b2cd2c66a1d23184a99243251fc362f1", "score": "0.0", "text": "def send_invitation(invite)\n @invite = invite\n\n mail to: @invite.recipient, subject: \"Your ImprovCoaches.com Coaching Invite\"\n end", "title": "" } ]
[ { "docid": "ea740e704e8f1173fb87b45dfcaaf989", "score": "0.77523494", "text": "def subject_for(key)\n I18n.t(:subject, scope: [:mailer, key])\n end", "title": "" }, { "docid": "8928fe4f050d7ebd3e9aa992b07e320a", "score": "0.75283015", "text": "def subject_for\n ActiveSuppo...
9a44a99860e30fe7e098af70fc70b38c
Include given module into all or specific features or scenarios.
[ { "docid": "8ac412317782020d7dcb3cd298d21b50", "score": "0.5865633", "text": "def include(mod, opts = {})\n inclusions << Inclusion.new(mod, opts)\n end", "title": "" } ]
[ { "docid": "358c4fce6378d11c06b0c57a6cd4381b", "score": "0.71069473", "text": "def include(mod)\n mod.append_features(self)\n Rubinius.privately do\n mod.included self\n end\n self\n end", "title": "" }, { "docid": "a64900feba4ecf6bb664d8a6107b0052", "score": "0.703204"...
4d88b3311c2d45a6020b90ffdc346c30
Returns the class symbols for each class this player has equipped this item
[ { "docid": "d532e59bf1d59e7cded16053c3297c7e", "score": "0.5429557", "text": "def classes_equipped?\n @equipped.reject { |class_id, equipped| !equipped }\n end", "title": "" } ]
[ { "docid": "db2c4b0e3671e97258c77797b8f0a8d1", "score": "0.67880875", "text": "def equipped( item_class )\r\n return self.equip_slots.select{ |equip_slot| equip_slot.item && equip_slot.item.is_a?(item_class) }.map(&:item)\r\n end", "title": "" }, { "docid": "f6c259c76cead6e4afccbf0...
0e31830ec7ce6fd6ac1a788d3b180243
Sets the attribute log_level
[ { "docid": "5663ee40b83171559e72185bb4ec1955", "score": "0.7656058", "text": "def log_level=(_arg0); end", "title": "" } ]
[ { "docid": "df969e025b2a57f05d6db0101a4e11ac", "score": "0.84962785", "text": "def log_level=(log_level)\n @log_level = log_level\n end", "title": "" }, { "docid": "80732d90a1ff4f3fe7e96baa4abb8c7c", "score": "0.8483513", "text": "def log_level=(value)\n logger.level...
82507fdad8417c29ea6d3c4da3b057e0
GET /metodo_pago_registros GET /metodo_pago_registros.json
[ { "docid": "5a6c34f03916919c5fbfb633b1eeada7", "score": "0.7098979", "text": "def index\n @metodo_pago_registros = MetodoPagoRegistro.all\n end", "title": "" } ]
[ { "docid": "5aecfc6bb6f3111af5c94bbdfb8c2a6f", "score": "0.7003738", "text": "def index\n @registros = Registro.page(params[:page])\n #@registros = Registro.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @registros }\n end\n end", "...
7bc5863e28e95509b9b57e75d7c95996
Returns the provided _answer_string_ after changing character case by the rules of this Question. Valid settings for whitespace are: +nil+:: Do not alter character case. (Default.) :up:: Calls upcase(). :upcase:: Calls upcase(). :down:: Calls downcase(). :downcase:: Calls downcase(). :capitalize:: Calls capitalize(). A...
[ { "docid": "0fd066f73d9cb7b0dfa9558496ba2c97", "score": "0.8475026", "text": "def change_case( answer_string )\n if [:up, :upcase].include?(@case)\n answer_string.upcase\n elsif [:down, :downcase].include?(@case)\n answer_string.downcase\n elsif @case == :capitalize\n ...
[ { "docid": "4b269d380ce919717af488a5eb35ecfb", "score": "0.66156644", "text": "def solution() \n case @answer.type\n when String\n solution= @answer.downcase \n default \n solution= @answer\n end\n solution\n end", "title": "" }, { "docid": "7b2258c9bff773be...
000f6669630f1f44abe4c01d6f5a4fbb
Check whether a string is a floating point number.
[ { "docid": "e82fbb20451addb5c2f20d0fb7e80f61", "score": "0.6934333", "text": "def like_f?\n return false unless self.to_f?\n\n num = self.without_leading_zeros\n (num.to_i != num.to_f) || num.include?(\".\")\n end", "title": "" } ]
[ { "docid": "4d27a93cd8e1aecbb866d014db3b263d", "score": "0.874998", "text": "def value_is_float?(string)\n return false if string.scan(/\\./).length != 1\n sides = string.split('.')\n return sides[0].numeric? && sides[1].numeric? && sides[1].to_i >= 0\n end", "title": "" }, { "doci...
e7a66cca8b4e403eddef531bdf18723f
DELETE /forum_posts/1 DELETE /forum_posts/1.json
[ { "docid": "eb895dfbe96e4670bb6b11479f836ca3", "score": "0.7753245", "text": "def destroy\n @forum_post.destroy\n respond_to do |format|\n format.html { redirect_to forum_posts_url, notice: 'Forum post was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "552eeb269a4875005f7960f05178bdd2", "score": "0.80314887", "text": "def destroy\n @forum_post.destroy\n respond_to do |format|\n format.html { redirect_to forum_posts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "00ccddc6cb6e...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "8d69818e2fae5c987f881a5f45bc5c98", "score": "0.0", "text": "def login_params\n params.fetch(:login, {})\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6980384", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6782743", "text": "def strong_params\n params.requi...
22f61cb8efbb87124c62bae3073ce9dd
Method added by Blacklight; Blacklight uses to_s on your user class to get a userdisplayable login/identifier for the account.
[ { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.0", "text": "def to_s\n email\n end", "title": "" } ]
[ { "docid": "87d4925c91b99b9a24a5f9de4a916898", "score": "0.6966685", "text": "def account_id(user)\n case user\n when Ils::User then user.computing_id\n when ::User then user.login\n else user.to_s\n end.presence\n end", "title": "" }, { "d...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "fcb40dfd1226bf4169c0da7a64636c85", "score": "0.0", "text": "def update!(**args)\n @has_location_interpretation = args[:has_location_interpretation] if args.key?(:has_location_interpretation)\n @install_info = args[:install_info] if args.key?(:install_info)\n @is_ge...
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "t...
45c2e83233fe9e7d14306b2b74ae64df
Find all the matching ?s for [?s, OA.motivatedBy, OA.commenting]
[ { "docid": "90a4c1d843d2ef87bd4a054ebf8ea8ec", "score": "0.5468059", "text": "def motivatedByCommenting\n q = [nil, OA.motivatedBy, OA.commenting]\n @graph.query(q).collect {|s| s.subject }\n end", "title": "" } ]
[ { "docid": "d9c8b1e1059bb51752218d952e95c1f4", "score": "0.52265745", "text": "def find_commentable\n \tparams.each do |name, value|\n \t\tif name =~ /(.+)_id$/\n \t\t\treturn $1.classify.constantize.find(value)\n \tend\n end\n nil\n end", "title": "" }, { "docid": "91222f452eee...
08502474ea5edf1dd9426eeeac5f55ac
Tests whether the provided job matches what this listener wants
[ { "docid": "d7716e77bc0aec69113f9bd025d3ed54", "score": "0.75040054", "text": "def matches?(job)\n !action_name || (job.action_name == action_name)\n end", "title": "" } ]
[ { "docid": "2d9537fb0d941315c034a572d278fe6e", "score": "0.71939945", "text": "def trigger_condition_met?(_job)\n true\n end", "title": "" }, { "docid": "9c99bae5035918ea7e43babfe2f4da4e", "score": "0.6855028", "text": "def valid_job?(job)\n self.class.required_keys.all? { |ke...
1ffbccb78174ef92e634db1b8cb2d135
Meant to be called from the handler. Closes the passed io, or if it's nil, closes the current io
[ { "docid": "9f31483b6d124166d44a7e1d1cddc215", "score": "0.8230618", "text": "def close(io = nil)\n if ! io\n disposeIo @currentIoInfo if @currentIoInfo\n else\n disposeIo io\n end\n end", "title": "" } ]
[ { "docid": "7ddb7e1253fe5b05d01ebb1beef5a35e", "score": "0.8463168", "text": "def close(io)\n io.close if io.respond_to?(:close)\n end", "title": "" }, { "docid": "1d9aef13d3813d451b9e67d205047adc", "score": "0.8308314", "text": "def close\n io.close if @io\n ...
444ae349a24b2d4a28f899ed27871d4d
IT115 Id: 234 Name: Product/Service ID Type: AN Min/Max: 1/48 Description: Identifying number for a product or service
[ { "docid": "6513aa8588e76923746344e2ca9cd507", "score": "0.0", "text": "def IT115=(arg)", "title": "" } ]
[ { "docid": "4a8293f2860abac70321ad80e59659e2", "score": "0.6145894", "text": "def srv_support_level_id\n if srv_line_items.inject(0) { |sum, n| sum + n.qty }\n \"Services\"\n else\n \"\"\n end\n end", "title": "" }, { "docid": "4aeff3c2ff7f9e9013766a4602e26aff", "scor...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "a822c1a955e84cf7906867440b955356", "score": "0.0", "text": "def set_leave_reason_category\n @leave_reason_category = LeaveReasonCategory.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310465", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60152966", "text": "d...
9fe95fc6c64c8e8b97e381b08672dc44
Print the requested template
[ { "docid": "da79e5b3cff3997d4e5a91cebce2e227", "score": "0.0", "text": "def execute!\n config[:sparkle_dump] = true\n config[:print_only] = true\n file = load_template_file\n\n if !file.is_a?(SparkleFormation)\n raise \"Cannot trace non-SparkleFormation template\"\n ...
[ { "docid": "971676602391409c3ad3f99f5b1b681c", "score": "0.8064278", "text": "def printMe()\n\t\tputs @template\n\tend", "title": "" }, { "docid": "cebc415cb34bb0f72f019e4d90b35e3a", "score": "0.68612224", "text": "def print_template\n @invoice = Invoice.find(params[:invoice_id])\...
0f2aa174eba528176419ece90ef51253
Returns a specific Host in the system
[ { "docid": "015bcba52d104707e44dce394ea0168a", "score": "0.0", "text": "def api_v11_hosts_host_id_get_with_http_info(host_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_hosts_host_id_get ...\"\n end\n \n # v...
[ { "docid": "7060b7ef6c732bd291508232636de27f", "score": "0.81377184", "text": "def get_host( name )\n @hosts[ name ]\n end", "title": "" }, { "docid": "07fddcf12a08df4cb91ca3df65a1f83f", "score": "0.76374996", "text": "def get_host(host_id = self.current_host_id)\n if host...
f1abdc16c1593ac50abae0b5dabaeaba
for easier stubbing in tests
[ { "docid": "d90d64cee63ba5d4a6e87d0602b86733", "score": "0.0", "text": "def sender\n ENV['NOTIFICATION_FROM_EMAIL'] || 'noreply@some.gov'\n end", "title": "" } ]
[ { "docid": "8d63b3601b5e061c66b7d9e73398e3ca", "score": "0.70757735", "text": "def stub_implementation; end", "title": "" }, { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.6987691", "text": "def private; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd...
a7a817661c0faa5c863dfc7d8fa829b2
Returns the string representation of the object
[ { "docid": "a408df9f3be79d7c20500741a990725c", "score": "0.0", "text": "def to_s\n to_hash.to_s\n end", "title": "" } ]
[ { "docid": "fbdd4f858146598aaabf84003282a8d1", "score": "0.901777", "text": "def to_s\n @object.to_s\n end", "title": "" }, { "docid": "d69be2e09bbb16dc0e9df0ec2905d3f4", "score": "0.88380826", "text": "def to_s\n\t\treturn self.obj.to_s\n\tend", "title": "" }, ...
8fd82fd34ee37fe433e2078c54f24599
Turn down ALL channels
[ { "docid": "dfcc52bb14aef00db6e87c29bcfaac3a", "score": "0.8346493", "text": "def turnDownAllChannels()\n result = ''\n @base.cmd(\"conf t\") { |c| result += c }\n @base.cmd(\"int ca1/0\") { |c| result += c }\n (0..5).each do |ch|\n @base.cmd(\"cable upstream #{ch} shutdown\") { |c| res...
[ { "docid": "93e190eb6a3e5817274bdbf5a6fd7f3f", "score": "0.6863438", "text": "def turnUpAllChannels()\n result = ''\n @base.cmd(\"conf t\") { |c| result += c }\n @base.cmd(\"int ca1/0\") { |c| result += c }\n (0..5).each do |ch|\n @base.cmd(\"no cable upstream #{ch} shutdown\") { |c| re...
adfb3d6dd7991869f3159968633a2701
Returns a customized function for Representable that checks whether or not an attribute should be serialized. Allows proper patch semantics by distinguishing between nil & unset values
[ { "docid": "cf1a4d8ef027a09f8240f04e1864cd7b", "score": "0.0", "text": "def if_fn(name)\n ivar_name = \"@#{name}\".to_sym\n lambda do |opts|\n if opts[:user_options] && opts[:user_options][:skip_undefined]\n if respond_to?(:key?)\n self....
[ { "docid": "68363c8c5419ec508c635a4745eaf554", "score": "0.6854139", "text": "def is_attribute?; end", "title": "" }, { "docid": "727c3467ec9314e6abfb9dbe6d9811a2", "score": "0.65824157", "text": "def attribute?\n false\n end", "title": "" }, { "docid": ...
5896848ba8861e6e497d8dac18a39cfa
PUT /invoice_ins/1 PUT /invoice_ins/1.xml
[ { "docid": "33dbe205d76244e6a52f2beddc69ad64", "score": "0.0", "text": "def update\n @invoice_in = InvoiceIn.find(:first, :conditions => {:id => params[:id], :user_id => session[:user_id]})\n unless @invoice_in\n flash[:notice] = 'Tato faktura neexistuje!'\n redirect_to :action => :index...
[ { "docid": "99d24a74bc96db3bd84b0451ef3afb5f", "score": "0.7335732", "text": "def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n ...
47c49b3aa43798c020c8ef4bcbe4b5e6
Delegate to SCM adapter.
[ { "docid": "8866b94e10930a542b3eb3fcf944a8a5", "score": "0.0", "text": "def method_missing(s, *a, &b)\n if adapter.respond_to?(s)\n adapter.send(s, *a, &b)\n else\n super(s,*a,&b)\n end\n end", "title": "" } ]
[ { "docid": "96ac61cd16477229a28910df2de1cc06", "score": "0.55905956", "text": "def call\n raise NotImplementedError, \"AbstractCommitAnalyser subclass needs to implement #call\"\n end", "title": "" }, { "docid": "9c7d973df5e7a70246862d9687639b5e", "score": "0.5511209", "text": "d...
84b962e64d234760490d10eb65638b50
defines background color the button in OFF/ON states
[ { "docid": "2b789dbad2a277f4ffc184da0bf777cb", "score": "0.5054842", "text": "def color\n %w{ btn-primary btn-success }[params.valve.cmd]\n end", "title": "" } ]
[ { "docid": "7b009e7c38c36a106d0e4bb9e034e2dd", "score": "0.66929185", "text": "def primary_button_background_color\n block_for('primary_button_background_color', '#286090')\n end", "title": "" }, { "docid": "32ba8eebbdbf1b7d76917a160686d87d", "score": "0.66639656", "t...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "8def68505a0615d35b621b1dce10259d", "score": "0.0", "text": "def actor_params\n params.require(:actor).permit(:name, :age, :actor_gender_id, :actor_country_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...
a661732e5c2ec3f2f9b3e00db560342f
A collection of SortConditions for this sort_state
[ { "docid": "757f8616fa5889359f242d70d2799987", "score": "0.8081352", "text": "def sort_conditions\n @sort_conditions ||= SimpleTypedList.new SortCondition\n end", "title": "" } ]
[ { "docid": "a585b94a78792622609f355e68da3208", "score": "0.6437678", "text": "def sort_criteria\n @sort_criteria ||=\n sort_params.reduce('') do |sum, (key, value)|\n comparables = [\"a[:#{key}]\", \"b[:#{key}]\"]\n comparables.reverse! if value == :desc\n sum + \"...
41db5845ed8983540e7998a73c6b4b98
fields_for(record_or_name_or_array, args, &block) public
[ { "docid": "9e99d0bbdfa5df058aee8c1fa0880b16", "score": "0.8476918", "text": "def fields_for(record_or_name_or_array, *args, &block)\n super\n end", "title": "" } ]
[ { "docid": "93b353ff79fb008a12d443a6e79daf82", "score": "0.74405646", "text": "def fields_for(record_or_name_or_array, *args, &block)\n if options.has_key?(:index)\n index = \"[#{options[:index]}]\"\n elsif defined?(@auto_index)\n self.object_name = @object_name.to_s.sub(/\\[\\]$...
cc8f98afbaca68374a76f761ef07b77b
Ugly, RGL probably has a better way to do this
[ { "docid": "96f24ad97e0d87233c982130059ffa50", "score": "0.0", "text": "def transitions_from(station)\n stations.select do |destination| \n has_edge?(station.to_sym, destination)\n end\n end", "title": "" } ]
[ { "docid": "5971f871580b6a6e5171c35946a30c95", "score": "0.58156323", "text": "def stderrs; end", "title": "" }, { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.5736659", "text": "def private; end", "title": "" }, { "docid": "3b4df29992323899033bb22a35a64989", ...
23eac7865491a9b7ce010e5b20de022e
Select application directory panel
[ { "docid": "4c0d37ae6556f1c356494dd6364fb1fc", "score": "0.58361745", "text": "def browse(sender = nil)\n panel = NSOpenPanel.openPanel\n panel.canChooseDirectories = true\n panel.canChooseFiles = false\n panel.objc_send(\n :beginSheetForDirectory, path_for_browser,\n :file, nil,\n...
[ { "docid": "1f44b173e665d0fd66a147ade2b54b21", "score": "0.7057334", "text": "def chooseDirectory\n\treturn Tk::chooseDirectory\nend", "title": "" }, { "docid": "1f44b173e665d0fd66a147ade2b54b21", "score": "0.7057334", "text": "def chooseDirectory\n\treturn Tk::chooseDirectory\nend",...
c9222884987c84d12947c7125a957576
Distribute the regions in the array passed uniformly across the server array provided
[ { "docid": "d637d466a03e7c4923c5a60ab3858472", "score": "0.62527525", "text": "def distributePrimaryRegions(priRegions)\n c = HBaseConfiguration.new()\n admin = HBaseAdmin.new(c)\n servers = Array.new()\n dServers = Array.new()\n dServers = admin.getClusterStatus.getDeadServerNames()\n serv = admi...
[ { "docid": "7bf6c8ca35a6374750faa3e0cd0d5203", "score": "0.5648439", "text": "def divide_individually(array_with_number_of_addresses)\n possible_ranges = []\n num = self.to_num()\n bits_to_move = 32 - @bits\n remaining_addresses = self.free\n array_with_number_of_addresses.each() {|number...
3817c2c6d381c5d539ddc269a90cb43c
XXX (cmhobbs) this is painful. OpportunityCategories needs to be refactored with the relaunch.
[ { "docid": "c7ea57c550f6edf3e628d9c543aa895e", "score": "0.0", "text": "def award_teacher_point\n Points.give_them_an_teacher_point(User.find(owner_id)) if opportunity_category.name == 'Internship'\n end", "title": "" } ]
[ { "docid": "80385399b5edbcc5d92a8f1dfd1e9a0a", "score": "0.7260747", "text": "def get_categories\r\n OpportunityCategory.where(\"opportunity_id = ?\", opportunity_id).all\r\n end", "title": "" }, { "docid": "90e89312c55ff211a3d9085016d76d89", "score": "0.70268047", "text": "def g...
be536f31fd9ccb079ca685f287e64705
Returns true if the current user is following the other user.
[ { "docid": "29caa6250195ce4891f1841646bf0a89", "score": "0.0", "text": "def matched?(other_user)\n matched.include?(other_user)\n end", "title": "" } ]
[ { "docid": "847d038ef56237f552fafaf3647b5a2c", "score": "0.8531212", "text": "def following?(other_user)\n following.include?(other_user)\n end", "title": "" }, { "docid": "6c6730e4e340ef3149d415c530cb54e7", "score": "0.8511795", "text": "def following?(other_user)\n ...
119896042d00cd4e1ba3751708105f9d
For storing parms and session only in production and staging envionment
[ { "docid": "06a3c12f691572ba17ae062587ffbaf5", "score": "0.0", "text": "def set_raven_context\n Raven.user_context(id: session[:current_user_id]) # or anything else in session\n Raven.extra_context(params: params.to_unsafe_h, url: request.url)\n end", "title": "" } ]
[ { "docid": "b1799e01d02dae62be89c3dbbd24f8ce", "score": "0.69197196", "text": "def setup\n @env = { ActionController::Session::AbstractStore::ENV_SESSION_KEY => '123456', ActionController::Session::AbstractStore::ENV_SESSION_OPTIONS_KEY => ActionController::Session::AbstractStore::DEFAULT_OPTIONS}\n...
d4a1edaae4d92d004632cf64501ce2e7
DELETE /users/1 DELETE /users/1.json
[ { "docid": "15bbd6148634eeae1703a9d0983f5a27", "score": "0.0", "text": "def destroy\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "be9d8ff5c0124f1d5efc98ec2baa3fc1", "score": "0.7590564", "text": "def test_delete_user\n delete '/users/2'\n data = JSON.parse last_response.body\n\n assert_equal 'Daniel', data['name'], 'Propiedad name incorrecta'\n assert_equal 'Arbelaez', data['last_name'], 'Propiedad last_nam...
f05417afc3f5280c97f330cbb99e5a05
when the source user click the reimburse, it will be shown with reimburse list if they click the record in this reimburse list, form will be shown. They can edit
[ { "docid": "dbb8f013edda82c3deb4024a0cac28cb", "score": "0.5741171", "text": "def index\n @reimburse = Reimburse.find_by_id params[:reimburse_id]\n @objects = []\n if @reimburse and current_user.is_associated_with?( @reimburse )\n @objects = ReimburseDetail.where(:reimburse_id => @reimburs...
[ { "docid": "7c3a5f27d0cf1a256c538345cf8157a1", "score": "0.62710726", "text": "def edit\n \t#mapping the genre so that when the form is in edit mode then ahve access to all the genre\n \t@genre = Genre.all.map{ |g| [g.name, g.id]}\n end", "title": "" }, { "docid": "2f13f79d1eb17d8d6...
4966cb136dd6192921e18a7d369a66f5
Return the length of the current trace held by this context.
[ { "docid": "f42ca3fad127f318c4fa5a3c72187206", "score": "0.83569443", "text": "def length\n @mutex.synchronize do\n @trace.length\n end\n end", "title": "" } ]
[ { "docid": "6169b8a3412a42efb3600ee3b169c3cc", "score": "0.8164039", "text": "def length\n @mutex.synchronize do\n return @traces.length\n end\n end", "title": "" }, { "docid": "6169b8a3412a42efb3600ee3b169c3cc", "score": "0.8164039", "text": "def length\n @m...
fd607a86df5ffc0f213140685572fe41
POST /post250s POST /post250s.xml
[ { "docid": "1e15b335c3cd283af97f5534ca632f69", "score": "0.62147725", "text": "def create\n @post250 = Post250.new(params[:post250])\n\n respond_to do |format|\n if @post250.save\n format.html { redirect_to(@post250, :notice => 'Post250 was successfully created.') }\n format.xml...
[ { "docid": "adbd4063f9795c23205a346f6dfd3f22", "score": "0.62846464", "text": "def post uri, args = {}; Request.new(POST, uri, args).execute; end", "title": "" }, { "docid": "cbe6500a6c4a615eb91cd77d6de2788c", "score": "0.6032269", "text": "def post(data, tags_in = {}) ; post_to nil...
50409694a06f1ac67b398dcfee93a753
start of illScrappy def
[ { "docid": "dcd70d65f4713fba15b30903b20886ee", "score": "0.0", "text": "def print_scrappy_settings(encoder_module,badchars,iterations)\n $badchars = badchars.unpack(\"H*\").join.scan(/../)\n if (badchars.unpack(\"H*\").join.scan(/../).join(' ')).index('00') == nil\n $nni = true # no nul...
[ { "docid": "e44ae2cef169d29f78b2b6306add59da", "score": "0.6887716", "text": "def huddlingly()\n end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.67639697", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45...
58e5420dfde47ded47c47519e05d7689
PUT /events/1 PUT /events/1.json
[ { "docid": "5540a3ebcf1b5280e97a97621449dd28", "score": "0.0", "text": "def update\n @event = Event.find(params[:id])\n \n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n ...
[ { "docid": "dc4ff2adcbcefec9118bdd7e8716ad75", "score": "0.76718694", "text": "def update\n event = event.find(params[\"id\"]) \n event.update_attributes(event_params) \n respond_with event, json: event\n end", "title": "" }, { "docid": "c1e91edfe4a0b5c098fb83a06d3cccfc", "scor...
d70e95f55bea2c9234599ead45f2319b
Indicates whether its possible to capture the payment
[ { "docid": "25d42d3f32165a885b382abe358002d7", "score": "0.83002377", "text": "def can_capture?(payment)\n ['checkout', 'pending'].include?(payment.state)\n end", "title": "" } ]
[ { "docid": "8353b7df36898858c09e21e14bfad57a", "score": "0.8588416", "text": "def can_capture?(payment)\n payment.pending? || payment.checkout?\n end", "title": "" }, { "docid": "93b3fbad3a3f58dc38c0b85ac77c2645", "score": "0.8574391", "text": "def can_capture?(payment)\n pa...
86472cf70f01222412820836f2d2e508
Remove the current problem from the selected problem set and refresh the page
[ { "docid": "c8bde6bfae503128e2639807d6671fc2", "score": "0.7598793", "text": "def remove_from_problem_set\n problem_set = ProblemSet.find(params[:problem_set_id])\n @problem = Problem.find(params[:id])\n problem_set.problems.delete(@problem)\n redirect_to(@problem, :notice => \"Removed from ...
[ { "docid": "82b7e25f7fdb266aef5291f7573a8866", "score": "0.65823597", "text": "def destroy\n @admin_problem_collection.problems.destroy(@admin_problem)\n @admin_problem.destroy\n @admin_problem.scoring(@admin_problem_collection)\n redirect_to @admin_problem_collection\n end", "title": "...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "910e7bc5b9aacae7aa6cd5473e0eaac8", "score": "0.0", "text": "def momo_params\n params.require(:momo).permit(:title, :body)\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...
b67ff1810640e77cae3cd89822fef173
PATCH/PUT /discount_codes/1 PATCH/PUT /discount_codes/1.json
[ { "docid": "fcf8fb4e165d107061701be75097e632", "score": "0.73750776", "text": "def update\n set_discount_code\n respond_to do |format|\n if @discount_code.update(discount_code_params)\n format.html { redirect_to admin_discount_codes_url, notice: 'Discount code was successfully updated....
[ { "docid": "07c3c4d26ee54e5cdebd821ddf2da45b", "score": "0.73415405", "text": "def update\n respond_to do |format|\n if @discount_code.update(discount_code_params)\n format.html { redirect_to @discount_code, notice: 'Discount code was successfully updated.' }\n format.json { render...
d8dde6df03c106f451414b789572323b
Mark selected emails as trash emails
[ { "docid": "25ea0454dbe3268c461691b57ff7f09a", "score": "0.60605013", "text": "def emailaction\n case params[:theaction]\n when 'trash'\n Email.update_all([\"trash=?\", true], :id => params[:email_ids])\n when 'read'\n Email.update_all([\"mark_read=?\", true], :id => params[:email_ids...
[ { "docid": "a3ee73bba9f1e20a501be727889543fd", "score": "0.6640827", "text": "def rezm_delete_check_box(email)\n check_box_tag 'to_delete[]', email.id\n end", "title": "" }, { "docid": "217ece454dc4d7cebaf619b2d4413b38", "score": "0.6636718", "text": "def mark_email_for_destructi...
fdb623dffaa5fac1bad1801e24695d59
Fetch metric readings for a particular role.\n\nBy default, this call will look up all metrics available for the role. If\nonly specific metrics are desired, use the metrics parameter.\n\nBy default, the returned results correspond to a 5 minute window based on\nthe provided end time (which defaults to the current serv...
[ { "docid": "1d73ebcfd74b2346a3cf818f2450e633", "score": "0.48306018", "text": "def api_v11_clusters_cluster_name_services_service_name_roles_role_name_metrics_get_with_http_info(role_name, service_name, cluster_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.de...
[ { "docid": "37b18dd9bdb40584422494be4926206f", "score": "0.5385357", "text": "def metrics_time_range(start_time, end_time)\n resource.metrics.for_time_range(start_time, end_time)\n end", "title": "" }, { "docid": "99b0b693af1e47a10e26c256cfde204e", "score": "0.51424277", "text": ...
b42d1fd2df2d5eab1a72eb3d1b33b25e
robot_parts = [1, [2], [3, [4]]] robot_parts_copy = deep_dup(robot_parts) shouldn't modify robot_parts robot_parts_copy[2][1] ["capacitors", "resistors", "inductors", "LEDs"] p robot_parts_copy
[ { "docid": "656e2f4b00aa2257e57f3549a2b5e23b", "score": "0.0", "text": "def fibonacci_recursive(n)\n return [] if n < 1\n return [1] if n == 1\n return [1, 1] if n == 2\n fib_arr = fibonacci_recursive(n-1)\n fib_arr << fib_arr[-2..-1].reduce(:+)\nend", "title": "" } ]
[ { "docid": "21cb1a592459e4d56eaade788d15b6d8", "score": "0.6826385", "text": "def deep_clone; end", "title": "" }, { "docid": "3aa25d96536088252008ace87d426b09", "score": "0.6748737", "text": "def deep_dup; end", "title": "" }, { "docid": "9ee58dab2e2f86a845aad90184a2731b...
9e05e02fad4363b2d973d887102388f5
Artistprint_songs. This instance methods outputs the names of all songs associated with this Artist instance.
[ { "docid": "6667915101e41b92733838286742c922", "score": "0.8458938", "text": "def print_songs\n songs.each {|song| puts song.name}\n end", "title": "" } ]
[ { "docid": "111511e9c99407aa76bd8d8a3d8572c2", "score": "0.86533666", "text": "def print_songs\n # #songs returns an array of the artist's songs\n songs.each do |song|\n print song.name += \"\\n\"\n end \n end", "title": "" }, { "docid": "1a79fa4f42cd269cd2e307e405...
1100684e3735b01e39261319429a62e5
GET /request_quotes/1 GET /request_quotes/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "93d328dcd9c65c1f1701fd06a2dbc5e3", "score": "0.73971796", "text": "def get_quote\n response = RestClient.get(\"https://api.iextrading.com/1.0/stock/#{self.ticker}/quote\")\n JSON.parse(response.body)\n end", "title": "" }, { "docid": "2e5603987a32c502a764dafa77ae8761", ...
f13942796d9074d60698eb3d6a3a6141
Retrieve the value for the "Report" output from this Choreo execution
[ { "docid": "c4063212c71db8a5a94fdb38a6dcd91f", "score": "0.7775036", "text": "def get_Report()\n \t return @outputs[\"Report\"]\n \tend", "title": "" } ]
[ { "docid": "6073b8198cc8c6e3c4dc4fee054a8449", "score": "0.73021257", "text": "def report\n if(report_id?)\n @descriptor.get_report(report_id)\n end\n return @descriptor.reports[0]\n end", "title": "" }, { "docid": "985862e3855512106ec8b935c35fcb8c", "score": "0....
032237dcbc96544615dc3c07ffbc5986
Creates a classvariable attr_writer that can be accessed both on an instance and class level.
[ { "docid": "b4e85f917b26c581eee556d3528ef5e3", "score": "0.61946774", "text": "def cattr_writer(*syms)\n syms.flatten.each do |sym|\n module_eval(<<-EOS, __FILE__, __LINE__)\n unless defined? @@#{sym}\n @@#{sym} = nil\n end\n\n def self.#{sym}=(obj)\n @@#{s...
[ { "docid": "6e1c7d50e1839b5a620ea4789e8ed16e", "score": "0.74233013", "text": "def mattr_writer(*syms, &proc)\n receiver = self\n options = syms.extract_options!\n syms.each do |sym|\n raise NameError.new('invalid attribute name') unless sym =~ /^[_A-Za-z]\\w*$/\n class_exec do\n ...