query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
baa643831583a4586e5495f9a61bdb9a
Visits a page, and extracts the links that it finds there. Links can be in the href attributes of HTML anchor tags, or they can just be URLs that are mentioned in the content of the page; the spider is flexible about what it crawls. Each link that it finds will be added to the queue of further pages to visit.
[ { "docid": "050699fb1780b928e6615601c682083a", "score": "0.6350044", "text": "def crawl_page(uri)\n # Don't crawl a page twice\n return if @visited.include? uri.to_s\n\n # Let's not hit this again\n @visited << uri.to_s\n\n doc = Nokogiri::HTML(Net::HTTP.get_response(uri).body)\...
[ { "docid": "160fcdd2cab6f69f867a5c839c6bf980", "score": "0.77649045", "text": "def collect(page)\n page.body.css('a[href]').each do |a|\n attr = a.attribute('href')\n src = page.response.effective_url\n url = attr.value\n unless @config.skipped?(url)\n ...
07f096bf5795a40a32064d04de830e4f
PATCH/PUT /tpersonas/1 PATCH/PUT /tpersonas/1.json
[ { "docid": "abe90e1167ca2051b2e7e5a172bdda22", "score": "0.6897948", "text": "def update\n respond_to do |format|\n if @tpersona.update(tpersona_params)\n format.html { redirect_to @tpersona, notice: 'Tipo de persona actualizado.' }\n format.json { render :show, status: :ok, locati...
[ { "docid": "abce1dfbfa7adc8a127622108f732a95", "score": "0.67325455", "text": "def update_person(api, cookie, perstoupdate, person)\n pers_id = perstoupdate['id']\n option_hash = { content_type: :json, accept: :json, cookies: cookie }\n pers = nil\n res = api[\"people/#{pers_id}\"].patch person.to_j...
8656073823fa08a749594bf5d21eeaa4
GET /forum_items/new GET /forum_items/new.xml
[ { "docid": "dee7ca55170cbd60b4c7f079f154fdfa", "score": "0.7560344", "text": "def new\n\t\tunless params[:forum_id].nil?\n\t\t\t@forum = Forum.find(params[:forum_id])\n\t\t\t@forum_item = ForumItem.new(user: current_user)\n\t\t\t@forum_item.forum = @forum\n\t\t\t@forum_item....
[ { "docid": "746c84786249d0855f83597cccea2d26", "score": "0.7499273", "text": "def new\n @forums_forum = Forums::Forum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @forums_forum }\n end\n end", "title": "" }, { "docid": "53f4a0...
2ddbec483661ab31ff1e272608694794
POST /goods POST /goods.json
[ { "docid": "2dc6c07627bd126de47a177af6046532", "score": "0.5925458", "text": "def create\n @good = Good.new(good_params)\n\n respond_to do |format|\n if @good.save\n #format.html { redirect_to @good, notice: 'Good was successfully created.' }\n format.html{render :_OK}\n ...
[ { "docid": "28c7be2755dbbffb687aca03fe533c70", "score": "0.68935907", "text": "def create\n @goods = []\n @debug = []\n \n params[:goods].each { | elem |\n good_id = elem[0]\n unless elem[1][:ordered].nil?\n # raise(\"we have:\\n#{good_id}\\n#{elem[0].inspect}\\n\")\n q...
5592795c4f969437add2866690def0b4
Class to create the player.
[ { "docid": "48cad344648357c61087482f0385e4b9", "score": "0.0", "text": "def my_init (*args)\n @name = args[0]\n @type = args[1].downcase.capitalize\n @health = args[2]\n @power = args[3]\n @speed = args[4]\n @item = []\n end", "title": "" } ]
[ { "docid": "0414a14cdfafb8eacca5c7abbb240b23", "score": "0.75830525", "text": "def create_player\n @client.request_cmd(\n {\n 'player_create' => 1,\n 'app_version' => @version\n }\n )\n end", "title": "" }, { "docid": "d38189190e38ed6612006e6262d4...
6808dda5270577c0985eab8118052a0d
Authenticates a user against LiveJournal with account information and returns a LiveJournal::User object upon success, returns false on error otherwise. Setting the usejournal is required for community blog integration.
[ { "docid": "36003955ef31cf5d80123fd02d7b8455", "score": "0.74718696", "text": "def authenticate\r\n lj_user = LiveJournal::User.new(self.username, self.password)\r\n lj_user.usejournal = self.usejournal if is_community?\r\n login = LiveJournal::Request::Login.new(lj_user)\r\n login.run\r\n ...
[ { "docid": "99a67990131375badcffda5f198a4e93", "score": "0.61489844", "text": "def auth_user(username, password)\n return false if username.nil? || password.nil?\n\n response = @connection.link.bind_as(base: @config.base,\n size: 1,\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "e82350b343ad685272315c04981fa14b", "score": "0.0", "text": "def set_steplog\n @steplog = Steplog.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook;...
a061e5eadaac23ad06b99702983f9670
====== Comparable: RxINC: This is a cutnpaste to get things working for mspec. Need to either overwrite or allow a mixin.
[ { "docid": "8b10c008ce9dbe25bac58cbf959f3497", "score": "0.0", "text": "def ==(other)\n return true if self._equal?(other)\n return false unless other._isArray\n lim = self.size\n unless lim._equal?(other.size)\n return false\n end\n ts = Thread.__recursion_guard_set\n added = ...
[ { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.6501764", "text": "def spec; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.6501764", "text": "def spec; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "sc...
a666abf4ae6f979d6db63ef4c4362a5f
GET /marriage_acts GET /marriage_acts.json
[ { "docid": "51883c5d636c8810865990eeea10df31", "score": "0.7519237", "text": "def index\n @marriage_acts = MarriageAct.all\n end", "title": "" } ]
[ { "docid": "cbeae3e0a975e8b3ded9dfff5109ee7a", "score": "0.6497711", "text": "def index\n @marriage_talks = MarriageTalk.all\n end", "title": "" }, { "docid": "8661b2578dd85891ddb9e743bcd463f1", "score": "0.64030284", "text": "def index\n @medicaments = Medicament.all\n\n r...
20bafb01d45ce501d152161b958ad636
Check if proper Lockable module methods are present & unlock strategy allows to unlock customer on password reset
[ { "docid": "1134703fa720c74bfa443db741c1d821", "score": "0.6682548", "text": "def unlockable?(customer)\n customer.respond_to?(:unlock_access!) &&\n customer.respond_to?(:unlock_strategy_enabled?) &&\n customer.unlock_strategy_enabled?(:email)\n end", "title": "" } ]
[ { "docid": "e246b04b3025d4fdb8c1335635b512a0", "score": "0.68278265", "text": "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "...
6790481f8e946268d675cd943446eabb
Send observed_method(object) if the method exists.
[ { "docid": "3d8e9b1f81fad2dba3a0def22e329492", "score": "0.0", "text": "def update_with_masterdb(observed_method, object) #:nodoc:\n if object.class.connection.respond_to?(:with_master)\n object.class.connection.with_master do\n update_without_masterdb(observed_method, object)\n ...
[ { "docid": "f78076beae36622df1bda712a04e981f", "score": "0.7616121", "text": "def update(observed_method, object) #:nodoc:\n send(observed_method, object) if respond_to?(observed_method)\n end", "title": "" }, { "docid": "ff3c8986c1723c4bbbfe18c773276f9d", "score": "0.6669817", ...
b99c12d6ff2783fcb4ad9d01a9b9ecf1
Create a new Phone
[ { "docid": "c7835b17f158ae488acf08ae923b06bf", "score": "0.0", "text": "def post_telephony_providers_edges_phones(body, opts = {})\n data, _status_code, _headers = post_telephony_providers_edges_phones_with_http_info(body, opts)\n return data\n end", "title": "" } ]
[ { "docid": "6385d4beccb72b6741527c3912986a49", "score": "0.81810176", "text": "def create_phone(phone_fixture)\n\t\t# create a phone using our addNew()\n \t@params = phone_fixture.attributes\n\t\t@params.delete(\"id\")\n \t@phone = Phone.addNew(@params)\n \t@phone\n end", "title": "" }, { ...
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "7c30eb555b491f497d8a91b91469723f", "score": "0.0", "text": "def update!(**args)\n @custom_channels = args[:custom_channels] if args.key?(:custom_channels)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end", "title": "" } ]
[ { "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...
f47297734fd41f07b33cfd65067e1b88
IP address is currently active
[ { "docid": "5dc759e55c1163771647ddd315975c91", "score": "0.7232507", "text": "def connection_alive?(ip)\n %x{ping -c 1 -W 1 #{ip}}\n $?.exitstatus == 0\n end", "title": "" } ]
[ { "docid": "a324d8493bfce001f6ba30af0fa334eb", "score": "0.7998259", "text": "def ip_is_active(ip)\n `ping -c 1 #{ip}`\n $?.exitstatus == 0\nend", "title": "" }, { "docid": "0446a07e89f8934f0e828a8c38ef9b11", "score": "0.7907112", "text": "def connection_is_active \n IP_LIST.each...
3a5d405ec7c3dc42beaaee9a4e6ff778
Return a Directory object for a path. Raise error if path doesn't exist.
[ { "docid": "1c4dd8f7888dc3403bab3ad8a79bd7b9", "score": "0.57415044", "text": "def ifs_getDir(p, miqfs = nil)\n # If this is being called from a FileObject instance, then MiqFS owns contained instance members.\n # If this is being called from an Ext3 module method, then self owns contained instanc...
[ { "docid": "a62c4b0c950ccba4c383efa383aca9f4", "score": "0.71242446", "text": "def dir(path)\n #Directory.new(name)\n path = localize(path)\n raise FileNotFound unless File.directory?(path)\n Pathname.new(path)\n end", "title": "" }, { "docid": "84949b413d38a2b9fece432...
d59305aa9d692dcdcbb7646771d9085f
The name of the interface. Used to reference the interface throughout your application's execution lifetime.
[ { "docid": "91e644a93417c342384abe351ed9b0c3", "score": "0.0", "text": "def name(value)\n model.name = value\n end", "title": "" } ]
[ { "docid": "e1d816daa927f18943ad6d42f4a76c3e", "score": "0.76806563", "text": "def name\n \"#{self[:interface]} #{self[:sid]}\"\n end", "title": "" }, { "docid": "17e589d2a9b755378d32b8dfe0bdbb59", "score": "0.7448836", "text": "def name\n\t\t\"Interface Fingerprinter\"\n\tend", ...
016c00ba83bb51fb06ccfccc89745112
Delete files at keys starting with the +prefix+ on all services.
[ { "docid": "72ae41e6498428346dbc286885feae9f", "score": "0.7263962", "text": "def delete_prefixed(prefix)\n perform_across_services :delete_prefixed, prefix\n end", "title": "" } ]
[ { "docid": "f5dc7dd702b49cebd5be072e1c3ccfdd", "score": "0.7275687", "text": "def delete_keys_with_prefix (prefix)\n\n call_misc(\n 'outlist', lib.abs_fwmkeys(@db, prefix, Rufus::Tokyo.blen(prefix), -1))\n # -1 for no limits\n\n nil\n end", "title": "" }, { "doci...
1486614c877d9ab04038dcfab8b38744
shows all listings page
[ { "docid": "a796fc7388e5f9f21f1a90e3effd9a69", "score": "0.70034176", "text": "def index\n\t if params[:city]\n\t @searchlistings = Listing.where(city: params[:city]).paginate(page: params[:page], per_page: 10)\n\t else\n\t @searchlistings = Listing.all.paginate(page: params[:page], per_page: 10...
[ { "docid": "3e50b0ca0f9c678c431244eeeb7223b3", "score": "0.8212963", "text": "def index\n # Retrieve all listings to display\n @listings = Listing.all\n end", "title": "" }, { "docid": "7fc1c99a6c67b0e1ea72aa07dbd0ec57", "score": "0.81015426", "text": "def index\n @list...
5cc59475035f8b0db80c0b71588c0a8d
Keystroke to quit processing.
[ { "docid": "9434dd0efcff594c1e9ac309f149e42c", "score": "0.0", "text": "def skip_all\n @options.key?(:skip_all) ? @options[:skip_all] : \"q\"\n end", "title": "" } ]
[ { "docid": "92bb6f08950f7216afdc5affd7d74b19", "score": "0.72820616", "text": "def key_q_action_performed(event)\n puts \"Quit\"\n @event_listener.quit\n end", "title": "" }, { "docid": "2a282895e4f91a89ce846cb95c40ab1d", "score": "0.6930161", "text": "def quit\n # Does n...
d1feafb7a462a5171a90c0bf57e9a7e9
use request_permission_summary to retrieve who can manage the item
[ { "docid": "c6be20ed8eba378b9ea131668f4907b1", "score": "0.6297053", "text": "def people_can_manage\n contributor = self.contributor\n return [[contributor.id, \"#{contributor.first_name} #{contributor.last_name}\", Policy::MANAGING]] if policy.blank?\n creators = is_downloadable? ?...
[ { "docid": "b58161b643c2fadebb5d6a6197facb52", "score": "0.7206716", "text": "def get_active_permission() end", "title": "" }, { "docid": "b58161b643c2fadebb5d6a6197facb52", "score": "0.7206716", "text": "def get_active_permission() end", "title": "" }, { "docid": "de83e6...
b9378324425bc22f4e783bb0158c554f
Returns the active membership status, of this member
[ { "docid": "d2f5b04041aeda04ac0a7c7d19852488", "score": "0.70574635", "text": "def membership_active?\n active_at?(Time.now)\n end", "title": "" } ]
[ { "docid": "e0908def1345e54e2240501382ef5b2c", "score": "0.71776664", "text": "def asf_member_status\n ASF::Member.member_status name\n end", "title": "" }, { "docid": "f75659f37b16a2b4f5c9b09a6db653c2", "score": "0.7032222", "text": "def membership_status(entity)\n\t\tif mem...
a3a8a4ab794ac23c7fe1de56164e43ed
How many pages the report returned.
[ { "docid": "b59777783e229031a588fbf98f325b02", "score": "0.0", "text": "def total_pages\n xml do |xml|\n @total_pages ||= xml.css(\"paymentOrdersResult > totalPages\").text.to_i\n end\n end", "title": "" } ]
[ { "docid": "09730ec2c7d603054ced98da08eda431", "score": "0.8473661", "text": "def page_count\n @total_pages\n end", "title": "" }, { "docid": "7de3139703a3c05cacf5f3e6d9ddefe5", "score": "0.8268516", "text": "def number_of_pages\n return @number_of_pages\n ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "613eb4f92da7574ae0c47b3ba7640545", "score": "0.0", "text": "def post_params\n params.require(:form).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...
5016a4e145abb611d19065487cf86446
==================Method for getting the regions==============
[ { "docid": "adfb5b7a64074fb04527e245399bbbb7", "score": "0.78398407", "text": "def get_regions()\n\t\t{\"include_regions\"=>@include_regions,\"exclude_regions\"=>@exclude_regions}\n\tend", "title": "" } ]
[ { "docid": "9e6650de349bddf8d1c504e11964f924", "score": "0.81084377", "text": "def listRegions\n\t\t\treturn MU::Config.listRegions\n\t\tend", "title": "" }, { "docid": "1dbb43643a52d4b8fd4bc5a404e0da4a", "score": "0.79639965", "text": "def regions\n @root\n end", "ti...
d22dd8f63972a0991422fa779653248b
define the arguments that the user will input
[ { "docid": "bf8b596e7fb21480baf81d9dfccbb849", "score": "0.0", "text": "def arguments(model)\n args = OpenStudio::Measure::OSArgumentVector.new\n\n # the name of the space to add to the model\n hhw_setpoint = OpenStudio::Ruleset::OSArgument.makeDoubleArgument(\"hhw_setpoint_temperature\", true)...
[ { "docid": "c62750f6e8d591e4a244028ec8cd5a7a", "score": "0.7418197", "text": "def arguments\n end", "title": "" }, { "docid": "49665d066ffcf52f2c37b2b1c268e6fd", "score": "0.73753476", "text": "def arguments; end", "title": "" }, { "docid": "49665d066ffcf52f2c37b2b1c26...
70b3646141194c23e9f94ee622fa3aaf
I worked on this challenge [by myself, with: ]. Your Solution Below
[ { "docid": "c7a014118bb40070e21fc58f20dbfede", "score": "0.0", "text": "def factorial(number)\n i = 1\n while number >= 1\n \ti *= number\n \tnumber -= 1\n end\n return i\nend", "title": "" } ]
[ { "docid": "b9960478999684c2b536f76e22f6fc63", "score": "0.6290555", "text": "def solution4(input)\n end", "title": "" }, { "docid": "bca12d2414c241325b8beea187f866fa", "score": "0.60854334", "text": "def isLucky(n)\r\nhalf1 = []\r\nhalf2 = []\r\nn_string = n.to_s\r\n\r\n\r\nfirstha...
239b92dbc656a1cd89e41e54be25c718
DELETE /check_links/1 DELETE /check_links/1.json
[ { "docid": "16f84f8fc88436d1ec0e54cc9d144029", "score": "0.7352633", "text": "def destroy\n @check_link.destroy\n respond_to do |format|\n format.html { redirect_to check_links_url, notice: 'Check link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "45db0dd30998091a7c52fa8553fa3637", "score": "0.7126856", "text": "def destroy\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to links_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "82ec189bdce2de5d528b27e0ec732a1...
7a25a46feae70e59a467029c113de43e
GET /talklinktypes GET /talklinktypes.json
[ { "docid": "36256e0971e616f7636ed0c5afa8ec64", "score": "0.79279566", "text": "def index\n @talklinktypes = Talklinktype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @talklinktypes }\n end\n end", "title": "" } ]
[ { "docid": "4f686ee586b9be47882e6cf5cc630d9c", "score": "0.7133965", "text": "def show\n @talklinktype = Talklinktype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @talklinktype }\n end\n end", "title": "" }, { "do...
514cf24b669ed40fdd99b8f3e4054aac
should be the same, except it will add a $10 shipping fee
[ { "docid": "d72518b26b53a71e7a0f5b33a6e37077", "score": "0.0", "text": "def total()\n if super() > 0\n return super() + 10\n else\n return super()\n end\n end", "title": "" } ]
[ { "docid": "6630f425efa9a33c47d2c7590736ea24", "score": "0.74432826", "text": "def marketplace_fee\n ((subtotal * buyer_fee_variable) + buyer_fee_fixed).round(2)\n end", "title": "" }, { "docid": "aada78b8831c5ef64eb6060c78b0adef", "score": "0.73818964", "text": "def shipping_cos...
eecb235d02fc20d14890202dd677bef2
GET /paises GET /paises.json
[ { "docid": "3cd943005aeef8e75dcac02234c3dc9c", "score": "0.0", "text": "def index\n @paises = Pais.all\n @pais = Pais.new\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @paises }\n format.xls { send_data @paises.to_xls(\n :col...
[ { "docid": "3f38c6d00619b661defcd6b6cea46027", "score": "0.70765555", "text": "def buscar_estados\n render json: Estado.by_pais(params[:pais_id])\n end", "title": "" }, { "docid": "6b3c409c69f39c81860e83ad46f9021d", "score": "0.6959102", "text": "def index\n @paises = Pais.all...
a4d83884cfd4adc018209f59b0b8bfdb
vi: set ft=ruby : Generate a 'random' password, used for internal Tower services
[ { "docid": "4ecf054130f62c334b9ae5393a82490f", "score": "0.7378154", "text": "def generate_password(length)\n chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789'\n password = ''\n length.times { password << chars[rand(chars.size)] }\n password\nend", "title": "" } ]
[ { "docid": "2e278db2ae7211bf9c05909ae0a91410", "score": "0.8344275", "text": "def generate_password\n pwd = `pwgen 12 1`\n return pwd\n end", "title": "" }, { "docid": "ac41bba428bd0e933fc57575ad7cf544", "score": "0.8111205", "text": "def generate_password\n pass = \"...
4908efa045fad38834372cf653ec88f6
Extract b3 context from the supplied carrier and set the active span in the given context. The original context will be returned if b3 cannot be extracted from the carrier.
[ { "docid": "352e33bbb06df44c0fb104cbacbe2cc3", "score": "0.677097", "text": "def extract(carrier, context, &getter)\n getter ||= default_getter\n header = getter.call(carrier, @b3_key)\n return context unless (match = header.match(B3_CONTEXT_REGEX))\n\n span_c...
[ { "docid": "c7ee7dd7c821525714c317ffefd9a9e0", "score": "0.6227984", "text": "def inject(carrier, context, &setter)\n span_context = Trace.current_span(context).context\n return unless span_context.valid?\n\n sampling_state = if B3.debug?(context)\n ...
8dfb9f08e44eb8a5e0234797076c8fe5
POST /alunos POST /alunos.json
[ { "docid": "b28013777b2e1aed9667e9b98cbdf20e", "score": "0.5773576", "text": "def create\n\n @aluno = Aluno.new(aluno_params)\n\n respond_to do |format|\n if @aluno.save\n format.html { redirect_to @aluno, notice: 'Aluno foi criado com sucesso.' }\n format.json { render action: ...
[ { "docid": "c9581a0a0b7146267f2e4cef46a7f300", "score": "0.6584107", "text": "def create\n @alunoo = Alunoo.new(alunoo_params)\n\n respond_to do |format|\n if @alunoo.save\n format.html { redirect_to @alunoo, notice: 'Alunoo was successfully created.' }\n format.json { render :s...
cdc1270349548f4d5dd3565d6cda6750
PUBLIC METHODS Heading defines the main means of addressing the model
[ { "docid": "99d9be25791d7f64bdbbea5f3191048c", "score": "0.0", "text": "def heading\n\t\tname + \" (\" + form.name + \")\"\n\tend", "title": "" } ]
[ { "docid": "4f0dca958f4c2c346cde5712ffdba4f7", "score": "0.7811159", "text": "def model\n end", "title": "" }, { "docid": "afc4151049de4a403982da492f69b399", "score": "0.77944857", "text": "def model; end", "title": "" }, { "docid": "afc4151049de4a403982da492f69b399", ...
7388ae13d347060e70d597072aab5e46
Returns raw MD5 digest of a key.
[ { "docid": "5c699d8b5dd5d34b6b32ba4c01a1c27e", "score": "0.77827597", "text": "def _hash_digest(key)\n m = Digest::MD5.new\n m.update(key)\n\n # No need to ord each item since ordinary array access\n # of a string in Ruby converts to ordinal value\n return m.digest\n end", "title": "...
[ { "docid": "b2f7b89f50cd245e724da3041d209d0b", "score": "0.7677006", "text": "def md5_sum(key)\n md5 = Digest::MD5.new\n buffer = ''\n with_input_io(key) do |io|\n while io.read(65536, buffer)\n md5 << buffer\n end\n end\n md5.base64digest\n end", "title": "" }, ...
19f7a53bc0491bfdfa8963c5cc48544d
set_nav_bar_button :left, title: "Results", action: :open_data_screen set_nav_bar_button :left, title: "Sign In", action: :register_controller set_nav_bar_button :right, title: "", action: :right_data_screen set_nav_bar_button :left, title: "Results", action: :open_data_screen set_nav_bar_button :right, title: "About U...
[ { "docid": "ad83c90cc95bbaf7e702e80cb1efe57b", "score": "0.6196973", "text": "def open_data_screen\n open OpenDataScreen.new(nav_bar: true)\n # open HelpScreen.new(nav_bar: true)\n end", "title": "" } ]
[ { "docid": "bf3580460c361db2fdd0da34ff7cec39", "score": "0.69563246", "text": "def on_load\n set_nav_bar_button :left, title: \"Back\", action: :close_help_screen\n end", "title": "" }, { "docid": "fb3bf605168c57b020566c9c56fddcc0", "score": "0.6748109", "text": "def nav_login_bu...
05122d7ca847764bc947ec50ed278b13
Get Basic Area Retangle
[ { "docid": "b013589536571e67f70beddac5e7fdf4", "score": "0.6065598", "text": "def basic_area_rect(index)\n rect = Rect.new\n rect.x = contents_width / 4 * index\n rect.y = 0\n rect.width = contents_width / 4\n rect.height = contents_height\n rect\n end", "title": "" } ]
[ { "docid": "62c6177cf1ed4f9a2312a928665f0e99", "score": "0.74191314", "text": "def get_area()\n @space.get_area()\n end", "title": "" }, { "docid": "07027e863cae8869ba02a0076d86e137", "score": "0.71581596", "text": "def area\n return @base * @altura\n end", "title":...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "9ffa082c4446a28582a58ba8be8c7235", "score": "0.0", "text": "def proyecto_params\n params.require(:proyecto).permit(:name, :proyecto)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7496205", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957069", "text": "def strong_params\n params.require(:request).permit(param_white...
7929dfdb3f14505545aeebf3e6877b43
Convert a string name to an actual data reference.
[ { "docid": "e32905cd2e0ae01515a45d854faf3023", "score": "0.4951281", "text": "def lookup(mapping, type, reference)\n return reference unless String === reference\n data = mapping[reference]\n @errors << \"Reference to a missing #{type}: #{reference}\" unless data\n return data\n e...
[ { "docid": "45de678b5289819e9e37fd68f7e6aa44", "score": "0.616477", "text": "def constantize(name)\n Reference.get(name)\n end", "title": "" }, { "docid": "45de678b5289819e9e37fd68f7e6aa44", "score": "0.616477", "text": "def constantize(name)\n Reference.get(name)\n e...
9ac9f06afe7228c1c6357dadba356c4a
when true extended attributes will be added to parents serialize methods
[ { "docid": "796d2db3a100035d3612d61e360e9c00", "score": "0.0", "text": "def serialized\n @serialize ? extended.collect(&:to_sym) : []\n end", "title": "" } ]
[ { "docid": "31c605de67413c0dc87587f7532b9bbe", "score": "0.75631225", "text": "def serialize\n super(ATTR_NAME_ARY)\n end", "title": "" }, { "docid": "31c605de67413c0dc87587f7532b9bbe", "score": "0.75631225", "text": "def serialize\n super(ATTR_NAME_ARY)\n end", "title": ...
447bb3a9adfe22d44406ee669c492c81
def do_editor_event(_event) case _event.signature when EditorContract::FILE_AFTER_OPEN if _event.context.file self.add2history(_event.context.file) add_to_tree(_event.context.file) end when EditorContract::FILE_AFTER_CLOSE if _event.context.file end end end
[ { "docid": "ff3ce3c6304a53a53ba6bd2ec005b80f", "score": "0.0", "text": "def root\n if !defined?(@root)\n @root = TreeNode.new(nil, 'KRoot'){|_node|\n _node.rif= 'root'\n _node.label=''\n }\n end\n return @root\n end", "title": "" } ]
[ { "docid": "47a32cbb77963f52212d7e5256383230", "score": "0.6197572", "text": "def file_edit\n file = getfilename()\n $log.debug \" got file_edit: #{file} \"\n return if file == \"\"\n add file, file\n end", "title": "" }, { "docid": "3deef6d7cc1edb6b9dd4ab8d9dec82e6", ...
119e9127f70e90ec65d53bf713e5ec57
creates an email verification notice
[ { "docid": "50fdbcf2496b0a121a4f483163d17b26", "score": "0.7198474", "text": "def verify_email\n # remove any notice(s) for past email addresses\n pending_notices.all({ :data.not => self.email, type: 'email' }).destroy\n\n unless n = pending_notices.first_or_create({ data: self.email, type: 'em...
[ { "docid": "00f29430b3b1ec3b7e0f6d2978e34721", "score": "0.69594", "text": "def create\n verify_email = VerifyEmail.new(verify_params)\n\n if verify_email.save\n user = User.find_by(email: verify_email.email)\n \n response = user.nil? ? \n { message: Message.availab...
8c9ee4c18d3c3d344125d5e2548e6f8a
List of supported tags. They can be attributes, simple descendans or collections (e.g. , , )
[ { "docid": "f19f475195d8a6e147e9741e4a211684", "score": "0.8296325", "text": "def supported_tags\n [\n # attributes\n # NONE\n\n # simple tags\n :threat, :description, :original_threat, :notes, :overrides,\n\n # nested tags\n :name, :cvss_base, :risk_factor...
[ { "docid": "73bce372ca30d46456a381a8e859f59b", "score": "0.82260096", "text": "def supported_tags\n [\n # attributes\n\n # simple tags\n :alert, :riskdesc, :desc,:severity,\n :confidence, :solution,:otherinfo,\n\t:reference,:cweid,:wascid\n ]\n end", "title":...
232cd0f5423e8307041c73da7d31dd2e
Get tier1 segments by configuration state Returns all tier1 segments with configuration state on the enforcement point specified in the request
[ { "docid": "3b01f485df903668e2688d09c494d24e", "score": "0.64684576", "text": "def get_tier1_segments_by_state_0_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentStateApi.get_tier1_segmen...
[ { "docid": "e01566282812ab501e043e509f6f71f3", "score": "0.65634656", "text": "def get_tier1_segments_by_state_with_http_info(tier_1_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentStateApi.get_tier1_segments...
4169c4dea8c7dc7c9cd867e790cf3e5b
Gets the action property value. The action property
[ { "docid": "461ee76afff6216d39eb448b1ce275f1", "score": "0.8210879", "text": "def action\n return @action\n end", "title": "" } ]
[ { "docid": "9ab9ef49679ddccfc3ece37de95aab25", "score": "0.89268875", "text": "def action\n action_property ? action_property.ruby_value : nil\n end", "title": "" }, { "docid": "2ad5733bd80d07dee8da736a248ba7ea", "score": "0.7982814", "text": "def action\n @action\n ...
cd3885a7d14f8a880036239e013d42fb
purchase method takes a floating number and adds that to the total
[ { "docid": "759c590706ed1595136ff3cc6c822f1f", "score": "0.80750126", "text": "def purchase(price)\n @total += price\n end", "title": "" } ]
[ { "docid": "73c2d6a4577af8308bbeff099d7317c9", "score": "0.7844724", "text": "def purchase(purchase_price)\n puts @total += purchase_price\n end", "title": "" }, { "docid": "49794a4cac27ce6f9bb0bda821d81e64", "score": "0.7709652", "text": "def purchase(purchase_amount)\n @tota...
02938655acaa14dadc30106b841964bd
all noncompleted & nonaccepted quests where parent quest is completed or there is no parent quest
[ { "docid": "1a2efaff63823da553b9d0a36d75bc55", "score": "0.79502743", "text": "def available_quests\n ret = Quest.nin(_id: self.completed_quests + self.accepted_quests)\n ret.any_of({:parent_id.in => self.completed_quests}, {parent_id: nil})\n end", "title": "" } ]
[ { "docid": "55841ea5e5eea4fd3bafe13c2a8383f2", "score": "0.75613445", "text": "def completed_quests; quests.select{|quest| quest.completed?}; end", "title": "" }, { "docid": "8f687ef90796bba95cfcb523f1f98bf4", "score": "0.7182876", "text": "def active_quests\n quests.select{|quest...
f8191b5dd6ebf53fd6d7b9b4c6ac3185
Translates MIPS instructions into human readable descriptions
[ { "docid": "76a541d3e31ee2229febeac1c62cb494", "score": "0.0", "text": "def insr(numero)\n\ttipo=Hash[32,\"add\",34,\"sub\",8,\"jr\"] #Campo aluop\n\trs=\"0b\"+numero.slice(6..10)\n\trs= \"%d\" % rs\n\trt=\"0b\"+numero.slice(11..15)\n\trt= \"%d\" % rt\n\trd=\"0b\"+numero.slice(16..20)\n\trd= \"%d\" % rd...
[ { "docid": "dec6a6023c51f8f512d46e372f4874ef", "score": "0.601328", "text": "def format_instructions(instructions)\n out = +''\n i = 0\n while i < instructions.length\n begin\n definition = lookup(instructions[i])\n rescue ArgumentError => e\n out << \"ERROR: #{e}\"\n next\n e...
5867bc97417d8c541fca62292e8d2e04
======================================================== Shorthand for error type TerminalLog Params: +message+:: message of the log
[ { "docid": "ab9449fe0ae2ddf8685067d182270e29", "score": "0.8087694", "text": "def terminal_error message\n terminal_message ERROR, \"error\", message\n end", "title": "" } ]
[ { "docid": "8497131766e1a05e7af7fe4ea38e78eb", "score": "0.7942716", "text": "def error(message)\n log(message, :error)\n end", "title": "" }, { "docid": "6f4443fe281b9f7c01c7d7341918553f", "score": "0.7751313", "text": "def error(message)\n log(:error, message)\n end...
a22ee37b7db79194b0635f752357c1c6
Sets a constraint for this process
[ { "docid": "27e7b3aa770378d53966188dddbe0710", "score": "0.5939873", "text": "def constraint(hash = {})\n @constraints << Constraint.new(self, hash)\n end", "title": "" } ]
[ { "docid": "a2662dcdc7dbf08115804c3b91f9b37c", "score": "0.7633193", "text": "def set_constraint\n @constraint = Constraint.find(params[:id])\n end", "title": "" }, { "docid": "4fd9eccb2b808707c495718d12180141", "score": "0.70432615", "text": "def set_mass_constraint\n @...
e2a7ddb4fb36bbbac0702bd8b448a648
Sets the sorted BAM file of the second parental
[ { "docid": "4a1a0d27f0e3b3f2ec501f14200dcbdf", "score": "0.5871043", "text": "def parental_2(opts)\n raise BFRToolsException.new(\"Missing path for parental 2\") if opts[:path] == nil\n path = Pathname.new(opts[:path])\n raise BFRToolsException.new(\"Unable to open #{path}\") unless path....
[ { "docid": "125986547a57a0b1d8808e0b6136d4d5", "score": "0.54658574", "text": "def parental_1(opts)\n raise BFRToolsException.new(\"Missing path for parental 1\") if opts[:path] == nil\n path = Pathname.new(opts[:path])\n raise BFRToolsException.new(\"Unable to open #{path}\") unless path...
b99acd205ef4af2c88370b394dd478c8
show all the player's on our database
[ { "docid": "016867db6191353a0c095566c36ed806", "score": "0.0", "text": "def list\n @tplayers = Person.all\n @pass_str = 'Pass this str'\n end", "title": "" } ]
[ { "docid": "5b6eb31997d1cb47f432f442c3eab9b4", "score": "0.8099837", "text": "def show\n @players = Player.all\n end", "title": "" }, { "docid": "366df4faebae61de9ac176684305075e", "score": "0.8077882", "text": "def view_players\n @players = Player.get_all_players\n end", ...
9fa63c8f9dc38d896e21938d56bf68aa
Helper method to print out added fields
[ { "docid": "4387e4d904b8bec83c21799d19e2c907", "score": "0.0", "text": "def inspect_added\n added.empty? ? nil : \"added=#{Inspect.from_hash(added)}\"\n end", "title": "" } ]
[ { "docid": "6dd293e716e7eb335e5fb904abe28345", "score": "0.7868546", "text": "def print_details\n puts \"This field is named #{self.name} and it's ID is #{self.external_id}. It is a #{self.data_type} field, and it is #{self.required ? \"required\" : \"not required\"}.\"\n end", "title": "" }, ...
a47e819d2b0fb80055e83b47f0389c98
Given the base URL build the complete URL string for a yum repo
[ { "docid": "2f01703febb66b55d9dd71b5c044f025", "score": "0.6895218", "text": "def yum_common_repo_url\n \"https://download.postgresql.org/pub/repos/yum/common/#{yum_repo_platform_family_string}/#{yum_repo_platform_string}\"\n end", "title": "" } ]
[ { "docid": "c95d44e502baaa8187b900a297440f05", "score": "0.85989237", "text": "def yum_repo_url(base_url)\n \"#{base_url}/#{new_resource.version}/#{yum_repo_platform_family_string}/#{yum_repo_platform_string}\"\n end", "title": "" }, { "docid": "deba821cd55327db3d47f96bb1bfdb6a",...
8129941e1f4a4a75cefafccce3a41498
DELETE /libri/1 DELETE /libri/1.json
[ { "docid": "e135df5af303fc12362836c83d6c177c", "score": "0.0", "text": "def destroy\n @libro = Libro.find(params[:id])\n @libro.destroy\n\n respond_to do |format|\n format.html { redirect_to libri_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.7648302", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "...
ba3e7b0e3741674210d804f577d43d36
Access the request url.
[ { "docid": "40e22978e088c403af36fda92aa0ecd1", "score": "0.8502484", "text": "def url; request.url; end", "title": "" } ]
[ { "docid": "e4f2bba1dd456a42f5d622c9f76e9a42", "score": "0.8586411", "text": "def url\n @request.uri.to_s\n end", "title": "" }, { "docid": "d7de394c0cabdbeb47a2af42c7150e83", "score": "0.85142285", "text": "def request_url\n @request_url = url if requestable?\n ...
67fabdd5be57175c23331ddf65ce76d2
Returns the value of attribute connection_prelude. source://redisclient//lib/redis_client/config.rb15
[ { "docid": "6a4ba01910156c56f5d814f0c8eefd91", "score": "0.7019868", "text": "def connection_prelude; end", "title": "" } ]
[ { "docid": "dc35a375b5fb3cac3699b9a3474cf62b", "score": "0.61833346", "text": "def client_config\n cc = Settings.dig(:connection, connection_type)\n return cc unless host\n\n uhost = URI(host)\n cc.host = uhost.hostname\n cc.port = uhost.port\n cc.scheme = uhost.scheme\n cc\n end",...
168b92282b149d6a853a8ec2caff8941
Retrieving audit detailed information
[ { "docid": "f94aa4ea22e79eb8595c35cbe7023780", "score": "0.6849642", "text": "def fetch(audit)\n @audit = self.class.get(\"/audits/#{audit}\", @options)\n @audit.parsed_response\n end", "title": "" } ]
[ { "docid": "6789c82b9b0b59d8cdd2ec2e22ed4688", "score": "0.79048795", "text": "def details\n audit_formatter.details\n end", "title": "" }, { "docid": "5947b4f783f82228897313c8e04e5752", "score": "0.72313565", "text": "def audit\n audit_content([])\n end", "title"...
fbcde3e7c822932412b7038b39dea0ff
PATCH/PUT /scanners/1 PATCH/PUT /scanners/1.json
[ { "docid": "8a68fce795762242d6d37a061a465f4b", "score": "0.60554093", "text": "def update\n respond_to do |format|\n if @scanner.update(scanner_params)\n format.html { redirect_to @scanner, notice: 'Scanner was successfully updated.' }\n format.json { render :show, status: :ok, loc...
[ { "docid": "e0eff41424978e07306d3d0969c6dace", "score": "0.63855195", "text": "def update\n @scanner = Scanner.find(params[:id])\n\n respond_to do |format|\n if @scanner.update_attributes(params[:scanner])\n format.html { redirect_to @scanner, notice: 'Scanner was successfully updated....
993036afbfb5d25ce9597d62bb8f1ce9
TODO: Improve this method for run server using production environment.
[ { "docid": "daa6cb688037f44c41b9207b5ba631c9", "score": "0.7181533", "text": "def start_server\n init \"Postview starting #{@server} on #{@options[:Host]}:#{@options[:Port]}\" do\n ENV['RACK_ENV'] = \"production\"\n config = @config.to_s\n @postview = eval(\"Rack::Builder.new{(\\n#{@so...
[ { "docid": "8bbbe87ddd36f03aee5f3f321da89aae", "score": "0.74390876", "text": "def start_server\n if ENV['RACK_ENV'] == 'production'\n run APP\n else\n Rack::Server.start(\n app: APP,\n Port: $PORT\n )\n end\nend", "title": "" }, { "docid": "ee4b006b6b53c0703dfad384d921cf8c...
4c1f2b693b39512a4ce527a7c655c43a
PATCH/PUT /individuals/1 PATCH/PUT /individuals/1.json
[ { "docid": "ba0dc7f13c3fe73678f49191b4d080e2", "score": "0.7047703", "text": "def update\n\t respond_to do |format|\n\t if @individual.update(individual_params)\n\t format.html { redirect_to @individual, notice: 'Individual was successfully updated.' }\n\t format.json { render :sho...
[ { "docid": "c823c45a0236402c1758b4c240b6f447", "score": "0.7398141", "text": "def update\n @individual = Individual.find(params[:id])\n\n respond_to do |format|\n if @individual.update_attributes(params[:individual])\n format.html { redirect_to @individual, :notice => 'Individual was s...
d9b99cc394877b7b3ccb346279909655
overrides the default paragraph functionality, by setting a variable to indicate what block we're working on. otherwise, it just returns the text. We don't want p tags, anywhere.
[ { "docid": "574f28737dffe193e8bc48439f60831d", "score": "0.711906", "text": "def paragraph(text)\n debug \"~~PARAGRAPH~~\"\n if text.include? \"Request\"\n @@body_block = \"request\"\n debug \"\\t Set Body Block: request\"\n debug \"\\t \" + text\n # we don't need this text any...
[ { "docid": "ddff979f0c1012bdaa528b1f7cd96c17", "score": "0.7224518", "text": "def paragraph\n paragraphs(1)\n end", "title": "" }, { "docid": "1362d294b78434f7fbeacdf858680743", "score": "0.72044116", "text": "def paragraph(text)\n text\n end", "title": "" ...
c03012f7bbf73cfaa45631e61de2439e
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIE...
[ { "docid": "d5ee5615b863d390773571a99b583e4c", "score": "0.0", "text": "def quickstart topic_id:\n # [START pubsub_quickstart_create_topic]\n # [START require_library]\n # Imports the Google Cloud client library\n require \"google/cloud/pubsub\"\n # [END require_library]\n\n # Instantiates a clien...
[ { "docid": "5a848e1a78e814f4addafb82445f2b93", "score": "0.60679644", "text": "def version; 1; end", "title": "" }, { "docid": "5a848e1a78e814f4addafb82445f2b93", "score": "0.60679644", "text": "def version; 1; end", "title": "" }, { "docid": "5a848e1a78e814f4addafb82445f...
61894036501d8a6867dbfb04e9afb791
Squirt the metrics over UDP
[ { "docid": "c937035c376db527355734076fe0d64d", "score": "0.53197175", "text": "def send(data, sample_rate=1)\n sampled_data = {}\n\n if (sample_rate < 1)\n data.each_pair do |stat, value|\n if rand <= sample_rate\n sampled_data[stat] = \"#{value}|@#{sample_...
[ { "docid": "561d15c52a6e5be5c149188edcf2033b", "score": "0.6590877", "text": "def send_to_statsd(metric)\n @logger.debug{ \"#{self.class} #{prefix} sending #{metric} to #{@host}:#{@port}\" }\n socket.send_datagram metric, @host, @port\n end", "title": "" }, { "docid": "bd7...
97635e19daffd81d6647d5bf86113ef8
To drive that last one home...let's turn the tables and have the string show a modified output, while the array thwarts the method's efforts to modify the caller's version of it.
[ { "docid": "b22fa468398ee86331df209cf9d52cc8", "score": "0.0", "text": "def tricky_method_two(a_string_param, an_array_param)\n a_string_param << 'rutabaga'\n an_array_param = ['pumpkins', 'rutabaga']\nend", "title": "" } ]
[ { "docid": "f71df585906bfd6cf9951f0ad7eb32cd", "score": "0.620009", "text": "def finalize_array(add_cases_to_array)\n\tadd_cases_to_array.unshift(\"xX_\")\n\tadd_cases_to_array<<\"_Xx\"\nend\n\n\n\n\n\n\n\n\n### 5 TURN FINALIZED ARRAY INTO FINAL STRING\n##################################\n#\t\tTakes ret...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "bceb360f0a4008447ec90357606731d4", "score": "0.0", "text": "def set_order\n begin\n @order = Order.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n end\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.6032574", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6015663", "text": "def...
67fe51c7894dea43cefaa425764b7c80
function to assist with production of HTML and regular expressions Escape HTML characters so that raw text can be safely inserted as HTML
[ { "docid": "a411188f2d4f0612923ea88fb40bc0c2", "score": "0.75211537", "text": "def htmlEscape(string)\n return string.gsub(htmlEscape.special) {|c| htmlEscape.replacement[c]}\nend", "title": "" } ]
[ { "docid": "abccbae7d0b74e12c0d4ab4ffd089614", "score": "0.843338", "text": "def html_escape(s); end", "title": "" }, { "docid": "abccbae7d0b74e12c0d4ab4ffd089614", "score": "0.843338", "text": "def html_escape(s); end", "title": "" }, { "docid": "abccbae7d0b74e12c0d4ab4f...
c7e651dcc5945617ce73bf46dcbf759b
Public: Get item info by item number item_number Integer of the item number Returns Hash containing item info, or an error code if the call failed
[ { "docid": "d85fc10bc6b7386a521d91ab93fbbdcf", "score": "0.74408966", "text": "def get_info(item_number)\n request_data = build_request_data({ itemnumber: item_number })\n\n response = soap_client(ITEM_API_URL).call(:get_item_info, message: request_data)\n response = response.body[:get_it...
[ { "docid": "0e75be872f00eab6d9c5db0d4a591c68", "score": "0.74837035", "text": "def get_info (item_number)\n return @not_registered_msg unless self.is_valid_bidder\n \n item_number = item_number.to_i\n \n item = @db[@items_coll].find_one('number' => item_number)\n if item == nil then\n ...
ee28edad5fb0060dfb79b4ab606b2efb
data should be a graphable data object
[ { "docid": "6aa4b51529ddaa6584ad60131782bf12", "score": "0.0", "text": "def initialize(data, chart_type = nil, options = {}, title)\n @data = check_data_param(data)\n @options = options\n @changed = true\n @chart_type = chart_type || :line\n @title = title\n end",...
[ { "docid": "2a469b36c9117baebb361a9b3b553c86", "score": "0.77469844", "text": "def graph_data\n end", "title": "" }, { "docid": "bfcb328b3b42c5b98dcfeca43f0f9202", "score": "0.66351503", "text": "def convert_to_lod(data)\n data.each do |key, value|\n ...
5590867a7647a3b319537055179ac431
Sets the attribute token
[ { "docid": "bc4e361c23f37ee4d9fd272d99e44e72", "score": "0.0", "text": "def token=(_arg0); end", "title": "" } ]
[ { "docid": "e49ae5fbaf7e66b8c10a29da9f84e2f4", "score": "0.7710749", "text": "def token=(t)\n\t\twrite_attribute(:token, t)\n\tend", "title": "" }, { "docid": "8e6e955883286472932b5805c51df8a9", "score": "0.75711656", "text": "def token=(token)\n write_attribute :token, token\n ...
ea9f31dfd0242efd3c75b0004a8f3dd3
Creates and schedules with priority an outofband fiber that runs the supplied block. If any uncaught exception is raised while the fiber is running, it will bubble up to the main thread's main fiber, which will also be scheduled with priority. This method is mainly used trapping signals (see also the patched `Kerneltra...
[ { "docid": "e5908e772cdeddc2354bc9361478c1db", "score": "0.8008348", "text": "def schedule_priority_oob_fiber(&block)\n oob_fiber = Fiber.new do\n Fiber.current.setup_raw\n Thread.backend.trace(:unblock, oob_fiber, nil, @caller)\n result = block.call\n rescue Exception => ...
[ { "docid": "885ba03fa3eae75a5deb0fe09fbb9ea3", "score": "0.7842921", "text": "def schedule_priority_oob_fiber(&block)\n f = Fiber.new do\n Fiber.current.setup_raw\n block.call\n rescue Exception => e\n Thread.current.schedule_and_wakeup(Thread.main.main_fiber, e)\n en...
72973fddb0d43724093f3326f0aef51f
GET /clients/1 GET /clients/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "c0ffa931d98d5ce1e2041a93d545d9ea", "score": "0.77658874", "text": "def index\n @clients = Client.all\n\n render json: @clients\n end", "title": "" }, { "docid": "11367d36e4c90c8a0de89176b3b870a4", "score": "0.77151686", "text": "def index\n @clients = current_us...
b742929231e932fe7b7719562317d90e
Will execute the query and map it to a Struct where each of the fields is an attribute. Note: that in order to execute this, this expectes the fields to be in `element>'table', so you can't access normal Dhis2Snapshot values.
[ { "docid": "18943a559508a7b5e5d88052c4b34135", "score": "0.6074868", "text": "def query_to_results(query, fields)\n to_pluck = fields.map do |key|\n parts = key.to_s.split(\"__\")\n k = parts.map { |part| \"'#{part}'\" }.join(\"->\")\n Arel.sql(\"element->'table'->#{k}\")\n ...
[ { "docid": "59196ab315ce11c39154a078417b4400", "score": "0.61883694", "text": "def attrtable() @records.get_data(GRT_ATTRTABLE); end", "title": "" }, { "docid": "3227c2e35ba5d7ce97475fc29e1ab8b9", "score": "0.608556", "text": "def attrtable_record() @records.get(GRT_ATTRTABLE); end",...
8324e9035cb2667fedfd18645b5c0528
used in tests, use it to clear datasource
[ { "docid": "2064dc79965cdd0af12bfd8cd5d96fc5", "score": "0.0", "text": "def reset\n end", "title": "" } ]
[ { "docid": "acadc10e5826482ed56afcc89bb3863b", "score": "0.7249416", "text": "def teardown\n\t\t# puts \"Clear data here!\"\n\tend", "title": "" }, { "docid": "8aa6f8e4b5972116dc1232e2d8969a1c", "score": "0.712783", "text": "def clear\n adapter.exec(clear_sql)\n end", "title"...
72972b80df97072ec9f27161cbb7418a
FIXME: update orgs as part of `refresh`
[ { "docid": "4333ae2bc01d18546427bcb2d4540328", "score": "0.58444947", "text": "def orgs\n @orgs ||= begin\n client.organizations.map(&:login)\n rescue Octokit::Unauthorized, Faraday::ConnectionFailed\n []\n end\n end", "title": ...
[ { "docid": "04de9b29bd625cb76e879c6e174a6333", "score": "0.6626598", "text": "def orgs\n OrgsAPI.new(self)\n end", "title": "" }, { "docid": "f118c367f29d1608bc7e966ecdfee466", "score": "0.6434059", "text": "def orgs\n client.organizations\n end", "title": "" }, { ...
68e27000c150d3166ee13f2995e90cf4
GET /functions/1 GET /functions/1.json
[ { "docid": "067a4f6e7c085d5b5a4d97c325cb10f0", "score": "0.0", "text": "def show\n @activities = @function.group_activities\n .paginate(:page => params[:page], :per_page => 10000)\n .group_by {|t| t.created_at.to_date }\n respond_to do |format|\n for...
[ { "docid": "274d459766b26fe7ae38067b797f75cd", "score": "0.69712096", "text": "def get(function_id:)\n path = '/functions/{functionId}'\n .gsub('{functionId}', function_id)\n\n if function_id.nil?\n raise Appwrite::Exception.new('Missing required paramet...
41e5a3cb84f2f6667e7f965af2ab4893
GET /attendances/new GET /attendances/new.json
[ { "docid": "636d7a2eb17ccf84351312f5047e50d6", "score": "0.8206529", "text": "def new\n @attendance = Attendance.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attendance }\n end\n end", "title": "" } ]
[ { "docid": "02eacc7daba54655adbed699a64a8f22", "score": "0.7890733", "text": "def new\n @event_attendance = EventAttendance.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event_attendance }\n end\n end", "title": "" }, { "docid":...
733fb1523aa503605422171604098ad4
customize rack app for testing, if block is given, reverts to default rack app after testing is done
[ { "docid": "3dcdbd90e1421060ffdf9b2dc60cf910", "score": "0.62926465", "text": "def set_app!(identity_options = {})\n old_app = app\n self.app = Rack::Builder.app do\n use Rack::Session::Cookie, secret: '1234567890qwertyuiop'\n use OmniAuth::Strategies::Identity, identity_options\n r...
[ { "docid": "04aefb9bcdad387a56d4aa832818d4b1", "score": "0.73820806", "text": "def mock_app(base=Sinatra::Base, &block)\n @app = Sinatra.new(base, &block)\n end", "title": "" }, { "docid": "d8b9efda7bddf6fb103fb91ff787582f", "score": "0.7267362", "text": "def mock_app...
f7f67ae6892e4f27211c85c253e4042d
Get Expedia Perstay Fees Get Expedia Perstay Fees
[ { "docid": "57273c4597aefc89b6154c2f1b9dec2b", "score": "0.61530656", "text": "def expedia_perstay_fees_get(opts = {})\n data, _status_code, _headers = expedia_perstay_fees_get_with_http_info(opts)\n data\n end", "title": "" } ]
[ { "docid": "5d31470c41f6c4824b5862fc5d5cace4", "score": "0.6443354", "text": "def expedia_perstay_fees_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ExpediaTablesApi.expedia_perstay_fees_get ...'\n end\n # resource p...
ce16a376294f35d3a23c1ff594673022
Sets the vibration power setting
[ { "docid": "1c4d7740492e9b64e5745fcda42dd342", "score": "0.62605065", "text": "def set_vibration_rate(rate, pad_index = 0)\n vibration_rate[pad_index] = [[0, rate].max, 100].min\n end", "title": "" } ]
[ { "docid": "8b186b064da410cb07cd08d1c4d92b19", "score": "0.74623936", "text": "def override_power=(v)\n @dyio.command_to.set_override_power v\n end", "title": "" }, { "docid": "f69303cab9b7e28ec469b5ae930e5289", "score": "0.74426925", "text": "def power=power\n s...
0b4df6581d796deab76cc8be83964c25
Iterates through each operand in the collection.
[ { "docid": "47b70f832661960c296ea590fb041832", "score": "0.0", "text": "def each\n return to_enum :each unless block_given?\n 0.upto(size-1) { |i| yield self[i] }\n self\n end", "title": "" } ]
[ { "docid": "6ae9d799965f70d61a5310392ae9e93a", "score": "0.72257626", "text": "def each\n [@lval,@rval,@operator].each { |child| yield child }\n end", "title": "" }, { "docid": "509c4b3d3ad038a786fd5cc7242e8588", "score": "0.63952214", "text": "def each_operand(predicate, &bl...
aadbc7a5e180b19631c8f6f7f2c18a21
GET /messages/1 GET /messages/1.json
[ { "docid": "794afbd2516629bf8cd760e65feb5077", "score": "0.0", "text": "def show\n @message = Message.find(params[:id])\n @book = Book.find_by_id(:book_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @message }\n end\n end", "title"...
[ { "docid": "7b0403c18d8a0a044bf54412d195f2ca", "score": "0.75848913", "text": "def show\n @v1_message = V1::Message.find(params[:id])\n\n render json: @v1_message\n end", "title": "" }, { "docid": "abbd37c0579c33e8268f5fe452dd0b23", "score": "0.75048095", "text": "def messages...
bdb978a6190eb063f13225877f3beba3
Returns results from our inmemory store if: querying the users or cities table a limit is provided
[ { "docid": "a329a065a48732ffc8c5af75e24e00ac", "score": "0.53728706", "text": "def execute_and_clear(sql, name, binds)\n ret = nil\n if sql.include? \"SELECT \\\"users\\\".* FROM \\\"users\\\"\" and sql.include? 'LIMIT'\n logger.debug \"Returning in-memory users\"\n ...
[ { "docid": "05b582fe56aaf098d19a968b32377106", "score": "0.62033415", "text": "def get_all(query_options={}, current_page=1, limit=15) # :yields: rows,page,next_page_flag\n opts = @default_query_options.merge(query_options)\n page = current_page.to_i\n page = 1 if page < 1\n while tr...
6bdfd6f4cabe1c3533e5dc73b87da865
not needed at the moment
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.78198576", "text": "def private; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.7075563", "text": "def probers; end", "title": "" }, { "docid": "65ffca17e416f77c52ce148aeafbd826", ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "accff5f61daa8757d022a9ccc4d76b20", "score": "0.0", "text": "def set_venda\n @venda = Venda.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...
66d683c8be686ab21d4aeb283f870564
Adds an overlay using the combined values of other overlays.
[ { "docid": "c1a2c4151fe0109689bd94c20cbbfb2e", "score": "0.7072403", "text": "def define_combined_overlay(*names)\n combined_name = names.join(\"_\").to_sym\n value = names.map { |name| overlay_value(name) }.join(\"_\")\n @overlays << [combined_name, value]\n end", "title": "" } ...
[ { "docid": "237431a507597e54933b235bb617b04b", "score": "0.70991427", "text": "def append_overlays(value)\n each do |bit|\n bit.overlay(bit.overlay_str + value) if bit.has_overlay?\n end\n self\n end", "title": "" }, { "docid": "c62a401b6e51db51155019f3eb0e...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "8de0c0fc1a3ea6ed05dc37a5cdd41a6d", "score": "0.0", "text": "def wallet_transaction_params\n params.require(:wallet_transaction).permit(:amount, :type)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.69497335", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6812623", "text": "def strong_params\n params.require(:listing_member).permi...
4a6f8952b590806af5a7801ce32a2226
Check whether the user is approved student, teacher, or admin
[ { "docid": "d9b972ed0b198055781a52e98f69d027", "score": "0.0", "text": "def authorize_approved!\n\tunless is_student? || is_teacher? || is_admin?\n\t respond_to do |format|\n\t format.html {redirect_to root_url}\n\t\tformat.json {render json: {}, status: 401}\n\t end\n\treturn false\n end\n\ttru...
[ { "docid": "96c0ed8aa0f4c4b6e5977288149c960e", "score": "0.8005738", "text": "def approved_user?\n \t(self.user && self.user.approved) || (self.user && self.user.admin?)\n \tend", "title": "" }, { "docid": "4f0a940c3a0d22b185cca3194224802d", "score": "0.7513126", "text": "def ver...
a105ef88c4c8dee7849b4c87d4f4fc86
Rest call to openstack for delete an floatingip
[ { "docid": "75e4a7902650d140d028eee62494bb1d", "score": "0.7324012", "text": "def delete_floatingip(floatingip_id)\n response = @conn[:nova].delete do |req|\n req.url \"/v2/#{@tenant}/os-floating-ips/#{floatingip_id}\"\n req.headers = self.headers\n end\n\n if response.statu...
[ { "docid": "34e34f9cf99d7dc61200c8d4a1bdca98", "score": "0.76310456", "text": "def delete(ip)\n _params = {:ip => ip}\n return @master.call 'ips/delete', _params\n end", "title": "" }, { "docid": "5c9ede6f2435847f5173d4fdff1b5772", "score": "0.75738925", "text": "def del...
721f032a4c3d2f209ed9d28457162c0a
after_save :clear_app_menu_cache after_destroy :clear_app_menu_cache
[ { "docid": "2ca68813b602cd567811a497df61ac11", "score": "0.0", "text": "def validate\n !!URI.parse(link)\n rescue URI::InvalidURIError\n errors.add('link', :should_be_a_valid_url)\n end", "title": "" } ]
[ { "docid": "e982214f0ccaa92b5e51a1568539cead", "score": "0.7217809", "text": "def after_create(menu_live_event)\n expire_cache_for(menu_live_event)\n end", "title": "" }, { "docid": "c543ec5ab0275637f7021366a598b710", "score": "0.7166444", "text": "def clear_menu_cache\n Rails...
8860c2b163606ee7a81f5af4f7212a5b
Override the request phase to be able to pass the lang parameter to the redirect URL. Note that this needs to be the last parameter to be passed to the redirect URL.
[ { "docid": "5c02998b536ba5199d06d1ef084f6abc", "score": "0.66798156", "text": "def request_phase\n mpassid_thread.join if mpassid_thread.alive?\n authn_request = OneLogin::RubySaml::Authrequest.new\n lang = lang_for_authn_request\n\n with_settings do |settings|\n url...
[ { "docid": "b23130f4f68d90d42e2ed45266bdcd23", "score": "0.6760144", "text": "def set_localization_with_clf_mods\n begin\n ActionController::Base.session_options[:domain] = request.domain(self.tld_length)\n rescue\n ActionController::Base.session_options = {:domain => req...
edeea0ff6fbb9e4c5ec624e2b51480fe
The current state i.e. one on top of the state stack. NB: if the state stack is empty, this will throw an error rather than returning nil. source://rouge3.30.0/lib/rouge/regex_lexer.rb:283
[ { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.0", "text": "def state; end", "title": "" } ]
[ { "docid": "c49c9bff5a7314988fc8c3148013e618", "score": "0.78599095", "text": "def current_state ( )\n return @chain.last.statename if @chain.size > 0\n return nil\n end", "title": "" }, { "docid": "8e43b6015428220a0010a16e033fb8ee", "score": "0.758762", "text": "def sta...
68bc6f3410b1e6ea98f29f3af5a904e4
Loads a plain Ruby translations file. eval'ing the file must yield a Hash containing translation data with locales as toplevel keys.
[ { "docid": "47595dbb6f60aae53f58aed17f061b15", "score": "0.0", "text": "def load_rb(filename); end", "title": "" } ]
[ { "docid": "92d367bd42f6244134d668f6b3041121", "score": "0.7348538", "text": "def load(file)\n if !@loaded.include?(file) && File.file?(file)\n locale = YAML.load_file(file)\n @translations.update(locale[$1] || {}) if @locale =~ /^(\\w+)(_|-)/\n @translations.update(loc...
384f82961133ceb4cc6c4f6e01532108
schedule: hash of scheduling options that can include: Required: start_at: Time of first run DateTime or Time object. Optional: run_every: Time in seconds between runs. If ommitted, task will only run once. delay_type: Fixed Rate or Fixed Delay. Default is fixed_delay. end_at: Scheduled task will stop running after thi...
[ { "docid": "e056663b431870396ad535bae37bee24", "score": "0.5710591", "text": "def schedule(name, data, schedule)\n puts \"Scheduling #{name}...\"\n raise \"Schedule must be a hash.\" if !schedule.is_a? Hash\n hash_to_send = {}\n schedules = []\n schedule[\"payload\"] = data.to_j...
[ { "docid": "8c84a3c495f3433701c1b6b12d71a54c", "score": "0.7515543", "text": "def schedule! options = {}\n options = options.dup\n\n if run_every = options.delete(:run_every)\n options[:run_interval] = serialize_duration(run_every)\n end\n\n @schedule_options = options.reverse...
9efce891cdca585bf991f12c66b4ff49
TODO parsing the WKT needs a gis service to be available so that the WKT can be validated and converted to a coordinate chain
[ { "docid": "eccf6f06861a22bd5be4716270089406", "score": "0.61913806", "text": "def parse_well_known_text(raw_location_reference)\r\n\r\n Rails.logger.debug \"parse_well_known_text #{raw_location_reference}\"\r\n # reset the current state\r\n reset\r\n\r\n @location_reference = raw_location_r...
[ { "docid": "89363add824428017d5bf9f06cc01b03", "score": "0.6442556", "text": "def wgs84\n self['4326']\n end", "title": "" }, { "docid": "a28d5d0c07f1604116b3a4c7f299c04d", "score": "0.6426316", "text": "def extract_coordinates(point); end", "title": "" }, { "docid": ...
929ad8c329f9affc0379735e6d186754
refactored out this commonality for the pairtype methods
[ { "docid": "90ae066dc54cf3908f2d9f95acef59d0", "score": "0.0", "text": "def cards_frequency\n\t\thash = Hash.new(0)\n\t\tcards_values.each {|item| hash[item] += 1}\n\t\thash\n\tend", "title": "" } ]
[ { "docid": "dc785b0d09d467b96d04ee4241760124", "score": "0.73234516", "text": "def pair; end", "title": "" }, { "docid": "3e20b25bf7e4d47193e5992c3473a482", "score": "0.68021756", "text": "def pairs; end", "title": "" }, { "docid": "3e20b25bf7e4d47193e5992c3473a482", ...
0a645602ef1db84b52bc2fd36e1db22d
Install Install and update a module
[ { "docid": "b162aadc1bee3b1880a98cfe5b901a70", "score": "0.6902004", "text": "def install_module(mod)\n ::GDO::Core::Log.info \"ModuleInstaller.install_module(#{mod.name})\"\n \n # Install tables\n install_module_tables(mod)\n \n # copy db vars into old object\n if mod...
[ { "docid": "b0e9e767a080f81dee06586cf512a9ba", "score": "0.757357", "text": "def update\n install\n end", "title": "" }, { "docid": "f10cae4cd69e78e0a56e88c729c76f59", "score": "0.7354224", "text": "def update\n self.install\n end", "title": "" }, { "docid": "f10c...
849c3766db77100d2224b3d3edf736a0
calculations and recommendations based on assessment attributes
[ { "docid": "33d95bcc3cc61f716575514b9b97ee91", "score": "0.0", "text": "def current_bmi\n @current_bmi = (self.weight * 703) / (self.height**2)\n end", "title": "" } ]
[ { "docid": "ea5cc9f3964d9b27b1e71d8ca88e17e2", "score": "0.67034245", "text": "def update_assessment_score\n if self.resource_type == Resource::Type::COLLECTION\n scores = self.all_assessed_items.pluck(:assessment_score).select(&:present?)\n self.assessment_score = scores.length > 0 ?\n ...
37075252f7ec4a69ea78d80f8480192a
Store input as a string
[ { "docid": "975614bb1b4c39faf5afe3ae58799ed8", "score": "0.0", "text": "def decrypt(word)\n vari = word\n count = 0\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n while count < vari.length\n position = 0\n vari = word\n\n#Determine where in alphabet is is using .index\n position = alphabet.i...
[ { "docid": "c12f604405af886ef696e5c630bf5845", "score": "0.7644007", "text": "def to_str\n input\n end", "title": "" }, { "docid": "57e552999a02ff67fa950a1a335db0a0", "score": "0.7484917", "text": "def to_s\n input\n end", "title": "" }, { "docid": "eedc5710a72c88...
7ef6060e58b0bb3fa159a9cb62afe1ed
moves task to be on its own
[ { "docid": "7688698116eca6866b5bc62a6f19ae73", "score": "0.0", "text": "def make_root\n if self.rep_parent.nil?\n return super\n else\n return self.rep_parent.make_root\n end\n end", "title": "" } ]
[ { "docid": "4d697d9f389f9d958a48ec1b1ba43f4c", "score": "0.6978939", "text": "def move(from, to)\n @tasks.insert(index(to), @tasks.delete_at(index(from)))\n end", "title": "" }, { "docid": "de8acfbd11a6fa66967653da4ac6633e", "score": "0.66674745", "text": "def move_task(initi...