query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
edcd5a721985e586232c9109d967e47f
Tries to match our pattern against a certain set of input tokens at the given starting index. Assumes that a sufficient number of tokens exists and does not check bounds. Returns Boolean: match found?, [ReplacementMatch]: the matches
[ { "docid": "352f3bd8e9ece550cd28bd7802a3e406", "score": "0.75150424", "text": "def try_match(tokens, begin_index)\n match_data = []\n \n @pattern.each_with_index do |rule, pattern_index|\n token = tokens[pattern_index + begin_index]\n \n # Check flags\n (@requirements.select...
[ { "docid": "10adf84e6d20eff8c285881682f917a7", "score": "0.68129534", "text": "def matching_tokens(tokens, index)\n # TODO separate space in the tokenizer\n token = tokens[index].gsub(/\\s/, '')\n starts = [token]\n if OPEN_BRACKETS[token]\n direction = 1\n ends = [OPEN_BRACKETS[to...
17f365ac77cead60a28910b48261b8e2
Gets the weather summary data from the darksky website.
[ { "docid": "b4dd5fc2df4b1f9629f0e6197b820e4e", "score": "0.0", "text": "def getSummary\n @parsePage.css('span.summary-high-low')\n end", "title": "" } ]
[ { "docid": "515d6640b6ac4650760f4dcc9f6a6b72", "score": "0.7628142", "text": "def get_weather\n\t\tbet_discrete = false\n\t\tweather_response = open('https://api.darksky.net/forecast/9997fed57baa9664ce7817037eed5024/-33.4449336,-70.6568987?lang=es&units=si&exclude=currently,minutely,hourly,alerts,flags'...
9e25d4440ab1999386d911d16791a823
The deserialization information for the current model
[ { "docid": "6c8a033b6a33c1f2f4e2db67398b8b4b", "score": "0.5906045", "text": "def get_field_deserializers()\n return {\n \"attributeMappings\" => lambda {|n| @attribute_mappings = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttributeMapping.cr...
[ { "docid": "8c867fd2c80799d10790d2085d14eba7", "score": "0.6510734", "text": "def deserialized\n @deserialized ||= @serializer.deserialize @serialized_object\n end", "title": "" }, { "docid": "be6df54ff4d9ca8c6dd1eaa5e0a0615d", "score": "0.63224316", "text": "def get_fiel...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "b9e42052e8a5264f7b88c8814b31593a", "score": "0.0", "text": "def set_core_connection\n @core_connection = Core::Connection.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;...
d06f3ccdedc8117ba30aa7e7fae117ac
TODO DRY into looping over array of classes
[ { "docid": "4c0bb5777142e78bdb7782258be40117", "score": "0.0", "text": "def call\n CollectAllCards.new(game).call\n DealAllCards.new(game).call\n end", "title": "" } ]
[ { "docid": "e0ffe4bb375187a9afb210b5bdde1e45", "score": "0.68550056", "text": "def classes=(ary)\n `for(var result=[],i=0,l=ary.length;i<l;++i){result.push(ary[i].__value__);}`\n `this.__native__.className=result.join(' ')`\n return ary\n end", "title": "" }, { "docid": "ea47c06912...
6ae2c0481f526a29627b9ce6b17f0965
Gets a gravatar for a given email gravatar_default: If a gravatar is used, but no image is found several defaults are available. Leaving this value nil will result in the 'default_image' being used. Other wise one of the following can be set: identicon, monsterid, wavatar, 404 size: Size in pixels for the gravatar. Can...
[ { "docid": "ca5079e1bb2a1649d596344024e20f2c", "score": "0.819764", "text": "def gravatar(email, gravatar_default, size = 40, rating = 'g')\n hash = MD5::md5(email)\n image_url = \"http://www.gravatar.com/avatar/#{hash}\"\n image_url << \"?d=#{CGI::escape(gravatar_default)}\"\n image_url << ...
[ { "docid": "2455e63dac7e8cc75b566c72bab6b9d1", "score": "0.7707364", "text": "def gravatar(email, options = {})\n options[:size] ||= 35\n options[:default] ||= 'identicon'\n options[:rating] ||= 'PG'\n options[:class] ||= 'gravatar'\n options[:secure] ||= reques...
4cf70f54026b8ca585032eca6b11783d
Get the class from the metadata.
[ { "docid": "daa10d7dee0d591fe65ffc6766045cbc", "score": "0.7569292", "text": "def klass\n @klass ||= metadata.klass\n end", "title": "" } ]
[ { "docid": "6c726020fd1bcc0b0ebdf97ca1d7f098", "score": "0.7330803", "text": "def get_class\n Built::Class.get(@class_uid)\n end", "title": "" }, { "docid": "816568c48ab12c88cfdfe4152ff016c9", "score": "0.69055593", "text": "def query_class\n\t\treturn self.client.sys.registr...
5f2cd38fffb95b41507910f1a7bc0881
DELETE /bookmark_tags/1 DELETE /bookmark_tags/1.json
[ { "docid": "6191f641c4fbcfabe95b32d4c5d2546f", "score": "0.78512025", "text": "def destroy\n @bookmark_tag = BookmarkTag.find(params[:id])\n @bookmark_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to bookmark_tags_url }\n format.json { head :no_content }\n end\n ...
[ { "docid": "f3556d6972f6f78f70303c500860537f", "score": "0.726558", "text": "def delete_tag tag\n delete \"tag/#{tag}\"\n end", "title": "" }, { "docid": "4f831421b0c93f1489765ae4831733ea", "score": "0.71941286", "text": "def destroy\n @bookmark.destroy\n respond_to do |for...
3dc00fcc4898295c1c62e0d75c07cb54
Add (Disjunction) a Rangeary (or RangeExtd or Range)
[ { "docid": "fa0385c2fc9d7f9a894642186cb7e0a3", "score": "0.0", "text": "def disjunction(inr)\n self.class.new(self, inr)\n end", "title": "" } ]
[ { "docid": "4f804a860763b86e8b331ec8067c474f", "score": "0.67931485", "text": "def add_range(range = (0..-1))\n @ranges << range\n end", "title": "" }, { "docid": "5a0c3b45654cd5a85660f275a9559334", "score": "0.6520829", "text": "def add_range(cells); end", "title": "...
6145d2dcaa268c3aefeecbb70fa47daa
This will print all PT's whether finished or not. This can not be run until the charts have been processed. After the start button has run and after the builder button has been pressed. This link should probably be on the chartscharting page.
[ { "docid": "c651e04aa0a4f9493ca56964873c454e", "score": "0.5562404", "text": "def pt_print\n @task = Task.includes(:assignment).find(params[:task_id])\n @assignment = @task.assignment\n @titles = Title.build_paragraph_title_collection(@task.id,current_user.id)\n end", "title": "" } ]
[ { "docid": "4a6e54a8ea96995cc231c3ca9df9f3b3", "score": "0.6632965", "text": "def printall\n @assignment = Assignment.find(params[:assignment_id])\n @tasks = Task.where(\"assignment_id = ? and task_type = ?\",@assignment.id,1).all\n @chart = Task.where(\"assignment_id = ? and task_type = ?\",@a...
bb9a389418ef29ff5c36ebd30b8aa73f
recover(requeue = false, &block)
[ { "docid": "833c6c35bf67812acb965d3eded8de80", "score": "0.0", "text": "def on_delivery(&block)\n self.callbacks[:delivery] = block if block\n end", "title": "" } ]
[ { "docid": "e466646c741d3093d7f60942a95495df", "score": "0.81264555", "text": "def recover requeue = false\n send Protocol::Basic::Recover.new(:requeue => requeue)\n self\n end", "title": "" }, { "docid": "a7985cdb2b7590ebecf836eb47b9f01e", "score": "0.762428", "text": "def re...
6a66f76bf70127bd7bdfcfb063cc4359
TODO: actual check frequency
[ { "docid": "8ba7d4fe5cf68a78d60b9a0924ef6e2e", "score": "0.693667", "text": "def in_frequency?\n true\n end", "title": "" } ]
[ { "docid": "ab6a46e19bb0b8aaeff0daec4e8b53a8", "score": "0.7051543", "text": "def check_frequency\n return unless frequency_hash[:interval].is_a? Numeric\n check_daily_frequency\n check_weekly_frequency\n check_monthly_frequency\n check_weekly_days\n check_monthly_days\n end", "ti...
166e3d0d771c674c1a3b47ed5b4e44ae
Create friends if given a name instead of a person_id
[ { "docid": "64dacc5f72682e9251cd6c38e2da46e4", "score": "0.62440336", "text": "def participations_attributes_change(attributes)\n return unless attributes\n attributes.each do |index, participation|\n person_id = participation[:person_id]\n if person_id !~ /^([0-9]+|)$/\n friend =...
[ { "docid": "1ccc8eecd8699a625398065c52877c2e", "score": "0.7673109", "text": "def add_friend(name)\n # If friend does not already exist, create them without a phone number.\n friend = User.find_by_name name.downcase\n if !friend.nil? && !friend.id.nil?\n puts \"Found user...
72a78394d73a3dae7ef84166464e4717
Create the files given the url and the local name of file.
[ { "docid": "74b643940cf896fb29763f725456eec6", "score": "0.66187596", "text": "def get_file(name,url)\n open(name, 'wb') do |file|\n file << open(url).read\n end\nend", "title": "" } ]
[ { "docid": "dc8b983a4bba6c11b38e122a620cbc5f", "score": "0.76481205", "text": "def create_file_from_url(url, file_name)\n ::FileSet.new(import_url: url, label: file_name) do |fs|\n actor = Hyrax::Actors::FileSetActor.new(fs, user)\n actor.create_metadata(visibility: curati...
ccfb9fa3829d0c02a3f40e147eeeb7b7
[Task:] Make setters for the value and type.
[ { "docid": "a4891e82df69e017fdfe1938df83ca68", "score": "0.0", "text": "def test_pay_monthly_fee__business\nbank_account = BankAccount.new(\"Chris\", 1000, \"business\")\nbank_account.pay_monthly_fee()\nassert_equal(950, bank_account.balance())\n\nend", "title": "" } ]
[ { "docid": "6cb335f971ec4e7f2b4495cb45d52e05", "score": "0.65781987", "text": "def value=(val); end", "title": "" }, { "docid": "3ac9e6ce4de9c58d70d21df00296e797", "score": "0.6549506", "text": "def set(value)\n case value\n when DateTime\n set(value.to_time)\n...
cae28626681bca97e1f5a6c737750104
POST /statuses POST /statuses.json
[ { "docid": "37991d1a63f9814607bcfc6451bdfd75", "score": "0.0", "text": "def create\n @status = Status.new(status_params)\n\n respond_to do |format|\n if @status.save\n format.html { redirect_to @status, notice: 'Status was successfully created.' }\n format.json { render :show, s...
[ { "docid": "c28ad5d86fbc4bc993a73f1765d4708e", "score": "0.6963445", "text": "def update_status(status)\n post \"statuses/update\", :post => {:status => status}\n end", "title": "" }, { "docid": "7245d9188c2e1f0ad6cd86fe4a52211b", "score": "0.6957925", "text": "def postTweet(stat...
2f773753cea16096d510cfbe55156145
Two polygons are equivalent if their collection of points is equivalent.
[ { "docid": "84903be3cb05ce1488f38bfd50889177", "score": "0.57509136", "text": "def ==(other)\n @points == other.points\n end", "title": "" } ]
[ { "docid": "46654731d45039ec0e6fdb12c1335f8d", "score": "0.67408794", "text": "def ==(other)\n return false unless other.is_a?(Polygon)\n self.hashable_content == other.hashable_content\n end", "title": "" }, { "docid": "7926071885a44b9653ae939340afb45e", "score": "0.6...
57e87b5d0733822968d76525c5c0c467
movies(u) returns the array of movies that user u has watched
[ { "docid": "8d49936822db12c6f46b4e3e79f558f2", "score": "0.77871686", "text": "def movies(u)\n\t\tif(@user.has_key?(u))\n\t\t\t@user[u].keys\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "c8135ffbb3b8bf469489e6d0e33e414f", "score": "0.8215377", "text": "def movies(u)\r\n\t\tu_movies = []\r\n\t\ttemp = @user_list[u]\r\n\t\ttemp.each do |mov_id, rate|\r\n\t\t\tu_movies.push(mov_id)\r\n\t\tend\r\n\t\treturn u_movies\r\n\tend", "title": "" }, { "docid": "30439b0decaaa...
a2168488319c1b1214ee0293e274454f
Get the "pain" array
[ { "docid": "7f46294d8c9a384fd6c8adf1a99220ef", "score": "0.52879745", "text": "def pain(classes = @pain_classes)\n return @pain_override unless @pain_override.nil? # For testing mostly\n result = {}\n classes.each do |class_name, obj|\n next if class_name =~ /::Hash$/\n x_pa...
[ { "docid": "b69d942d526a77bddf5f3bc995aa960e", "score": "0.5776505", "text": "def list_penalized_arrays(args = {}) \n get(\"/arrays.json/backoffice/penalty\", args)\nend", "title": "" }, { "docid": "1be8babfd7579a2fe8183e2020539c94", "score": "0.56484705", "text": "def working_bike_a...
5e301d664a4f34898085fdf8348c4fba
If there's a current blogger and the display name method is set, returns the blogger's display name Otherwise, returns an empty string
[ { "docid": "48004156056ac900a5e72709df5fe829", "score": "0.87553346", "text": "def blogger_display_name\n if self.blogger and !self.blogger.respond_to?(Magazine.configuration.blogger_display_name_method)\n raise ConfigurationError, \n \"#{self.blogger.class}##{Magazine.configuration.b...
[ { "docid": "68ed8628c4e6a6c5a651322f67ee576d", "score": "0.88222677", "text": "def blogger_display_name\n if self.blogger and !self.blogger.respond_to?(Blogit.configuration.blogger_display_name_method)\n raise ConfigurationError,\n \"#{self.blogger.class}##{Blogit.configuration.blogge...
e7a704e301a9a5e1e05ca08d80146f55
Sets the attribute description
[ { "docid": "1bf92350ba4fb4ebd55139a6d7d04a11", "score": "0.0", "text": "def description=(_arg0); end", "title": "" } ]
[ { "docid": "d5364c1f09542811fb97fd4f8099e2c0", "score": "0.75925654", "text": "def description=(value)\n @description = value\n end", "title": "" }, { "docid": "d5364c1f09542811fb97fd4f8099e2c0", "score": "0.75925654", "text": "def description=(value)\n ...
197b4878b13def9979cebc7282adbe7a
GET /stories/1 GET /stories/1.json
[ { "docid": "324a0b9adca9758fd6d2f9dfc08ec847", "score": "0.0", "text": "def show\n @story = Story.includes(:comments).find(params[:id])\n @comment = Comment.new\n impressionist(@story)\n end", "title": "" } ]
[ { "docid": "af636de7576febeb1bbea645dd57184a", "score": "0.77517796", "text": "def show\n story = Story.find(params[:id])\n render json: story\n end", "title": "" }, { "docid": "d630364f3ee942ebb865792b16d07ae9", "score": "0.7708573", "text": "def index\n @stories = Story.a...
674285ed37f8dbf6903bdf8a0a7c6fd9
Lists resources for REST version specified Retrieves the base resources available for the DocuSign REST APIs. You do not need an integrator key to view the REST API versions and resources. Example: lists all of the base resources available in version 2 of the REST API on the DocuSign Demo system. To view descriptions a...
[ { "docid": "d56a28fd75851702612f235336ed5fef", "score": "0.0", "text": "def get_resources()\n data, _status_code, _headers = get_resources_with_http_info()\n return data\n end", "title": "" } ]
[ { "docid": "a85264ba96d8d387fa275da0bc55f432", "score": "0.73233926", "text": "def index\n @api_v1_resources = Api::V1::Resource.all\n end", "title": "" }, { "docid": "eaa11dc29cd81c2883828fcb0a2479a0", "score": "0.6841851", "text": "def index\n apis = site_account.api_docs_se...
6973eea82c84ceaa3162e5f0a11a325e
Metodo par inserta en el diccionario los nodos y su lista de adyacencias como 'clave'/'valor' respectivamente
[ { "docid": "4354181a9bb31720d3a396a6d140102a", "score": "0.6266126", "text": "def insert(clave, valor)\r\n @grafo[clave] = valor\r\n end", "title": "" } ]
[ { "docid": "2467f91efa95bbded0d5cfb1b4061077", "score": "0.7297009", "text": "def insertar_varios(nodos)\n \n nodos.each do |nodoo|\n \n insertar(nodoo)\n \n end\n \n end", "title": "" }, { "docid": "3c3081a9941ca2022fd345b098e3a04c", "sco...
a729edf90176ebe6c0660089d4e592f0
Return true of false if the given subtree exists or not
[ { "docid": "cfd33ab8b8fc52f643b468e21bb82f7c", "score": "0.78605443", "text": "def has_subtree?(path)\n\t\tbegin\n\t\t\tfind_subtree(path)\n\t\t\treturn true\n\t\trescue PathNotFoundError\n\t\t\treturn false\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "ad52c66c00e84b8cc0e4f78e108c4c80", "score": "0.8092718", "text": "def exist?\n @subtree_testrun_directory.exist?\n end", "title": "" }, { "docid": "e44020e020e9dd36b7a16b16c3832f24", "score": "0.7958296", "text": "def subtree?\n \n ...
67ddcdf3592d4b5ca53921e50153eb9f
def fetchList [Bookmark.new('', 1)] end def empty? list.nil? || list.length.zero? end
[ { "docid": "ffc0d65a3afb378d6e51f7926f0fe78f", "score": "0.0", "text": "def add(bookmark)\n @list << bookmark.add_id(@list.length + 1)\n end", "title": "" } ]
[ { "docid": "940e9166b43ec8b4460621c2ac1cb778", "score": "0.66476774", "text": "def list\r\n @list.empty? ? list! : @list\r\n end", "title": "" }, { "docid": "b867eec78fce441b2efc68f95f878bb6", "score": "0.6607832", "text": "def empty?\n @list.head.nil?\n end", "title": ""...
f6fb8ccae830c05529506948824606d1
Loads in any default front matter associated with the resource.
[ { "docid": "74c815dc998da544ec33c801097ca894", "score": "0.5800184", "text": "def front_matter_defaults\n site.frontmatter_defaults.all(\n relative_path.to_s,\n collection.label.to_sym\n ).with_dot_access\n end", "title": "" } ]
[ { "docid": "733cab09e579d449d725ea76bf86a938", "score": "0.60619456", "text": "def init\n super\n @page_title = page_title\n if @file\n if @file.attributes[:namespace]\n @object = options.object = Registry.at(@file.attributes[:namespace]) || Registry.root\n end\n @breadcrumb_title = \"F...
b33e9f99b5b8d279d7e6cda4e2139ef4
GET /events/new GET /events/new.xml
[ { "docid": "94b44a1a787e2aaf91d24ccc9b0c63a8", "score": "0.0", "text": "def new\n @event = Event.new\n @event.set_hours(params[:start], params[:end])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n end\n end", "title": "" } ]
[ { "docid": "014d3aee04bd3e2beab48a255a846bb4", "score": "0.8013102", "text": "def new\n @event = Event.new \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @events }\n end\n end", "title": "" }, { "docid": "2100dc5cf8bdd4d705e40bfda787...
83d6b1c136ff7bd3d0fb3ae23ca5b2f2
Returns an account client
[ { "docid": "b4c8c0e1f3c0f59edb327dd60cda06d3", "score": "0.0", "text": "def [](name)\n raise NotFound, \"Account #{name} not found\" unless tokens.include? name\n\n token = tokens[name]\n\n if token.expired? and token.refresh_token.to_s.strip.empty?\n @clients.delete name\n ...
[ { "docid": "c85d3d8cd730a4d4b0f29239e166311a", "score": "0.766463", "text": "def account\n client.account\n end", "title": "" }, { "docid": "c85d3d8cd730a4d4b0f29239e166311a", "score": "0.766463", "text": "def account\n client.account\n end", "title": "" }, { "doc...
707db7469ce4c39d8b6b52dcb494843c
[NOTE] Doesn't support direct filters
[ { "docid": "e0a94ae7174627175d113802128c94b4", "score": "0.0", "text": "def load_proxy_list(*)\n doc = load_document(PROVIDER_URL, {})\n doc.xpath('//table[contains(@class, \"table\")]/tr[(not(@id=\"proxy-table-header\")) and (count(td)>2)]')\n end", "title": "" } ]
[ { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.82246053", "text": "def filters; end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.82246053", "text": "def filters; end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9",...
573af92be0a75024c8194ac51cffbb84
number The number to which factorial is supposed to count up to. Examples factorial(5) => 120 Returns the factorial of every number up to the given number.
[ { "docid": "672739447a39fcf49a863e26a2e7bc7b", "score": "0.0", "text": "def factorial(number)\n i = 0\n output = 1\n while i < number\n i +=1\n output = output*i\n end\n return output\nend", "title": "" } ]
[ { "docid": "df27a9f59011ff035a18ed148cfcc539", "score": "0.8281185", "text": "def factorial(number)\n\tsum = 1\n\tsum.upto(number) { |n| sum *= n }\n\treturn sum\nend", "title": "" }, { "docid": "e8c9d8a3892c54061e6dfea9e8dcfea3", "score": "0.8215098", "text": "def factorial(number)\...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "abfbf32566f895e4114bb3240f189a84", "score": "0.0", "text": "def set_checklist\n @checklist = Checklist.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60322535", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6012846", "text": "de...
b58a31c4920a7bc22f489321020003eb
Subtract b from a
[ { "docid": "6886cea7695d0e3b8d265307c1d74c5f", "score": "0.77949136", "text": "def subtract(a,b)\n a-b\nend", "title": "" } ]
[ { "docid": "04d66b511db106637def1e4316188a69", "score": "0.87715966", "text": "def subtract(a, b); a - b end", "title": "" }, { "docid": "74fa52f53fd737633ddf17a71c230a72", "score": "0.862935", "text": "def subtract(a,b)\n a - b\n end", "title": "" }, { "docid":...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "81c67f3dfed7e893d60529bd7124b57f", "score": "0.0", "text": "def album_params\n params.require(:album).permit(:user_id, :title, :access)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74939764", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6955084", "text": "def strong_params\n params.require(:request).permit(param_whit...
f9bbf8a2d96d568101ce0d7b3c1aa502
PUT /categorias/1 PUT /categorias/1.xml
[ { "docid": "98a610c532e4af38f2b2e55095ed285a", "score": "0.6463777", "text": "def update\n @categoria = Categoria.find(params[:id])\n\n respond_to do |format|\n if @categoria.update_attributes(params[:categoria])\n format.html { redirect_to(@categoria, :notice => 'Categoria was success...
[ { "docid": "36b8ee5131991440b8496779f1092df3", "score": "0.6417726", "text": "def update\n @sotto_categoria = SottoCategoria.find(params[:id])\n\n respond_to do |format|\n if @sotto_categoria.update_attributes(params[:sotto_categoria])\n format.html { redirect_to(@sotto_categoria, :not...
7bd23a76cf709055373a54b2c7408c1d
Attempts to turn the light(s) on asynchronously. This method cannot guarantee the message was received.
[ { "docid": "6ddec70bee1426e3cb28d6097e55fc1e", "score": "0.53316945", "text": "def turn_on\n set_power(:on)\n end", "title": "" } ]
[ { "docid": "f95142043b824f1eff0c32d16a906567", "score": "0.6348697", "text": "def turn_on\n $logger.debug \"Turning light #{id} on\"\n put_request($uri + \"/#{$key}/lights/#{id}/state\", {:on => true})\n end", "title": "" }, { "docid": "1b79f3e99a2ccceebe1babd1ce218ee1", "score": ...
700fdd30236e0256bcc11cdc9fb58f1f
def send_msg_to_room(r, m, p=nil)
[ { "docid": "76cb46569283764f5bda42abf103e1d5", "score": "0.8609593", "text": "def send_room_msg\n r = params[:r]\n m = params[:m]\n u = params[:u]\n MsgUtil.send_room_msg(u, r, m)\n success()\n end", "title": "" } ]
[ { "docid": "f6cb48b532977d88ba72d2353112f6c5", "score": "0.6840528", "text": "def send_message(msg); end", "title": "" }, { "docid": "5825c62f1f47e1df0216b24891bc1d0d", "score": "0.6674925", "text": "def sendM(message)\n\t\t@conexion.puts(message)\t\n\tend", "title": "" }, { ...
825f4c4fbc42f54a0ca70d26a89626bc
GET /belge_tips GET /belge_tips.json
[ { "docid": "318cc6ca7f84ed14f4e32157879769a8", "score": "0.73987865", "text": "def index\n @belge_tips = BelgeTip.all\n end", "title": "" } ]
[ { "docid": "8d18147fd420e60550e6aec795b9bf05", "score": "0.70829225", "text": "def venue_tips(id, options = {})\n get(\"venues/#{id}/tips\", options).tips\n end", "title": "" }, { "docid": "8bec1fa2c6835e6414ed08afd341a0ab", "score": "0.69710064", "text": "def index\n ...
f50f2563f8c0b9a98c28b488c5b58c59
Write a function that has one parameter hash It should return the first key from the hash
[ { "docid": "0cb9bba48765b0992a10791f2aecb629", "score": "0.82864594", "text": "def get_first_key(hash)\n return \nend", "title": "" } ]
[ { "docid": "6428eecaae089b3ddffd8860e6da7270", "score": "0.76760477", "text": "def get_first_key(hash)\n return hash.keys[0]\nend", "title": "" }, { "docid": "d8a9e2d7ad126609c3c567dc64c968d4", "score": "0.75357157", "text": "def first_key_from_hash(hash)\n keys=hash.keys\n return...
da7794230a97f8abc886e6985e17e6ce
Create a .ssh folder for the user.
[ { "docid": "1f2089caa321655d2e1d26a11375e04f", "score": "0.83587813", "text": "def create_dotssh\n directory ::File.expand_path(\"~#{new_resource.user}/.ssh\") do\n owner new_resource.user\n group new_resource.group\n mode '755'\n end\n end", "title": "" } ]
[ { "docid": "8b35d6bfc02ff8fa2cfcd3656d434eca", "score": "0.78817654", "text": "def add_ssh_dir\n userHome = new_resource.home || \"/home/#{ new_resource.name }\"\n\n Chef::Log.debug \"Adding user's .ssh directory '#{ userHome }/.ssh'\"\n\n directory \"create_user_ssh_dir\" do\n owner ...
492ccacb4d24eacd3267f698edf3761e
Provided num_one and provided num_two must be rational numbers or ints. Returns the remainder of num_one divided by num_two.
[ { "docid": "a931f986a8b4f90b337edcc6073da192", "score": "0.66351455", "text": "def mod(num_one, num_two)\n return num_one % num_two\nend", "title": "" } ]
[ { "docid": "b4850c67cba8ff9cffbb62cde3c27f23", "score": "0.74463", "text": "def divide_remainder(num1, num2)\n num1 / num2.to_f\nend", "title": "" }, { "docid": "d41e1b2c80220fc325a5eadc034d4665", "score": "0.7190836", "text": "def division (first_number, second_number)\n\t\tif seco...
986f80f5769577e8ce823aaba98e95c5
create annotation download link for a user
[ { "docid": "31069409c54cfc9be94cca3aabd399df", "score": "0.588063", "text": "def make_user_annotations_path(user_value)\n user_id = user_value.is_a?(User) ? user_value.id : user_value.to_i\n user_tz = user_value.is_a?(User) && !user_value.rails_tz.blank? ? user_value.rails_tz : 'UTC'\n da...
[ { "docid": "7bfa9d6b02cbd926727d96c13ea9e36c", "score": "0.73135144", "text": "def annotation_download_link\n if self.link.starts_with?('http')\n self.link\n else\n # assume the link is a relative path to a file in a GCS bucket, then use service account to generate api url\n # will ...
80c8af403ec8e54176e7a476d3523679
These defaults will show us what placeholders are supposed to be there in the event that they don't load. It is not meant to be seen by users just to aid testing. If these appear in an end user page, it is a bug.
[ { "docid": "38e7add3ef8c8d262982e07856c13c60", "score": "0.0", "text": "def setup_defaults\n @program_title = 'PROGRAM TITLE'\n @program_site = 'PROGRAM SITE'\n @request_availability = false\n @meeting_times = ''\n @sourcing_options = ''\n @course_options = ''\n @student_id_required...
[ { "docid": "104cccd3c0c474f24f14c6d2c64624ca", "score": "0.64865166", "text": "def placeholders\n [:firebase_properties, :address, :address_2]\n end", "title": "" }, { "docid": "669237681e16ed57764a3c6bc7966ff6", "score": "0.6368948", "text": "def reset_placeholders\n self...
638b92f75060969e908a39f4f0ae5da4
DELETE /auction_values/1 DELETE /auction_values/1.json
[ { "docid": "04a9af856fb12fe06a35876cd17e6bab", "score": "0.735951", "text": "def destroy\n @auction_value.destroy\n respond_to do |format|\n format.html { redirect_to auction_values_url, notice: 'Auction value was successfully destroyed.' }\n format.json { head :no_content }\n end\n ...
[ { "docid": "6bf12f783aa62f086784e207da638f16", "score": "0.6822444", "text": "def destroy\n @auctionitems = AuctionItem.find(params[:id])\n @auctionitems .destroy\n\n respond_to do |format|\n format.html { redirect_to auction_items_url }\n format.json { head :no_content }\n end\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "698abbe8b394ade5a8f9c2f9ea77030e", "score": "0.0", "text": "def set_creation_category\n @creation_category = CreationCategory.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...
29c8c4b051f8f9d912344a70d11adc7e
Use this for debugging purposes only...
[ { "docid": "3f11419c43ce759af96af5c3c0c9bb70", "score": "0.0", "text": "def what_is_parent?\n puts @@classes[:parent]\n end", "title": "" } ]
[ { "docid": "07cbeffd3225c56b4a5d17ffad4af21a", "score": "0.76367676", "text": "def debug()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "c78eee6c6966cc915ed922822c723baa", "score": "0.7629993", "text": "def debug()\n ...
a4bd6dad60f03f32f98d223e6eb15690
GET /bankets/1 GET /bankets/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "b478e50bcf27145eb63f1b94e6cba26e", "score": "0.74209857", "text": "def get_banks\n HTTParty.get(BASE_URI + 'bank?country=ghana',\n headers: HEADERS).parsed_response\n end", "title": "" }, { "docid": "5b2cb5adec5fe17dadd063ec02fbab7a", "score": "0.7413908",...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "8667b1497bf9727e043c85d6e40da126", "score": "0.0", "text": "def first_login_setup\n redirect_to first_login_path if current_user.sign_in_count < 2\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...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ae8613312ab247dfb7c1b1e3956da94a", "score": "0.0", "text": "def set_event_type\n @event_type = EventType.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60322535", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6012846", "text": "de...
2b86a46d0dcde20806f720599ee25ab2
initializes with an empty knowledge array
[ { "docid": "6f42d145a74ff2698cf82398bfa37aa1", "score": "0.80397236", "text": "def initialize\n @knowledge = []\n end", "title": "" } ]
[ { "docid": "2f368da001237407e71ea138dfdc8e11", "score": "0.86959696", "text": "def initialize\n @knowledge = [] # initialize with an empty array\n end", "title": "" }, { "docid": "efa0df5dc94c680f86b6205b8960c3a1", "score": "0.84588593", "text": "def initialize\n @knowledge = ...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "19ef87bfccd4952b5745d598541c3187", "score": "0.0", "text": "def nivelriesgo_params\n params.require(:nivelriesgo).permit(:nombrenivelriesgo, :fechaingresonivriesgo)\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...
069c62255e2a447772e52ee0d9bfb1d4
DELETE /image/:id ADMIN PRIV deletes image based on url id
[ { "docid": "87fb40134d67cac4743609fa9148b6f8", "score": "0.8022269", "text": "def destroy\n image = Image.find_by_hash(params[:id])\n if image.nil?\n return render json: {status: \"Image Doesn't exist\"}, status: 400\n end\n image.file.purge\n image.delete\n render json: {status: ...
[ { "docid": "ed6d19dd7bb6c59efdf56b76eecedbb1", "score": "0.8339274", "text": "def delete_image\n\t\timage = Image.find(params[:id])\n\t\timage.destroy\n\n\t\tredirect_to admins_path\n\tend", "title": "" }, { "docid": "e33f242b37af43369183ed6142762c65", "score": "0.8108745", "text": "...
19ee8287f7e783d837192c204574b38a
show a juxta sbs view of the specified OCR result vs ground truth
[ { "docid": "e917d90c1b172c4f7835ac7de51e6578", "score": "0.0", "text": "def show\n @result_id = params[:result]\n @work_id = params[:work]\n @batch_id = params[:batch]\n work = Work.find(@work_id)\n @work_title = work.wks_title\n batch_job = BatchJob.find(@batch_id)\n ...
[ { "docid": "fc4668c2e97e4a50f481e3be1bb4d6fb", "score": "0.6217311", "text": "def image_as_text\n `gocr -i ./OCR_is_cool.png 2>/dev/null`\n end", "title": "" }, { "docid": "68164fa9cb1a690856a42e9c26c9ea3d", "score": "0.6202913", "text": "def ocr_with_mistakes\n \n end", ...
534d32ba48ef75c4b8b992a05ac7ade9
def winner(board) result=nil if won?(board) won?(board).select do |pos| if board[pos[0]] == "X" result= "X" elsif board[pos[0]] == "O" result= "O" end 1st if end do end 2nd if result end def changed winner board to this below:
[ { "docid": "ac955b5206cf00af95fd52300a99598d", "score": "0.0", "text": "def winner(board)\n if position = won?(board)\n board[position.first]\n end\nend", "title": "" } ]
[ { "docid": "5cc9216f8a605d5ccd9eb6131c0d7ea6", "score": "0.89140666", "text": "def winner(board)\n\twinning_player = won?(board)\n\nif !winning_player\n\t\treturn nil\n\tend\n\n\twinning_player.each do |i|\n\t\tif board[i] == \"X\"\n\t\t\treturn \"X\"\n\t\telsif board[i] == \"O\"\n\t\t\treturn \"O\"\n\t...
45247b17c151ee3ad28ec75825e926d1
Write a method that takes an arbitrary matrix and rotates it 90 degrees clockwise as shown above.
[ { "docid": "d92a28b0a9c97e2d6f746da7694b338a", "score": "0.69338053", "text": "def rotate90(array)\n matrix_width = array[0].size\n matrix_height = array.size\n new_matrix_width = matrix_height\n new_matrix_height = matrix_width\n results_array = []\n m = 0\n\n new_matrix_height.times do \n re...
[ { "docid": "3068988ed7bfdae094963bcc5e2d03c8", "score": "0.8179925", "text": "def rotate_matrix(matrix)\n \nend", "title": "" }, { "docid": "2a980dccc469fefe82e59814b13ffe65", "score": "0.815899", "text": "def rotate_matrix(matrix, direction)\n if direction == 'clockwise'\n rota...
606739802322a218c6b13b8218b34470
GET /linhkiens GET /linhkiens.json
[ { "docid": "21ff9e6050e80fa08e5e87b069f28efc", "score": "0.0", "text": "def index\n @linhkiens = Linhkien.all\n @linhkien = Linhkien.new\n respond_to do |format|\n format.html\n format.csv { send_data @linhkiens.to_csv }\n format.xls # { send_data @products.to_csv(col_sep: \"\\t...
[ { "docid": "688e633a6b97b8030ee2748163a90321", "score": "0.65362304", "text": "def index\n @litters = Litter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @litters }\n end\n end", "title": "" }, { "docid": "3ad6a5770f00879ce356...
9cca9646c75260b7ee1ccfff73b3c3db
added 20130423 pet owner is inviting a dog walker opposite of above
[ { "docid": "f9f853995fd784ba8968f5a02dcc5e71", "score": "0.0", "text": "def pet_owner_inviting_dogwalker\n logger.debug(\"pet_owner_inviting_dogwalker start\")\n @invitation = Invitation.new(params[:invitation])\n # work around: setting the device's unique user id (uuid) to ip_addre...
[ { "docid": "91184812c6ad46c5fe6dd2c205cfe488", "score": "0.65373796", "text": "def walk_dogs\n Dog.all.each do |dog|\n if dog.owner == self\n dog.mood = \"happy\"\n end\n end \n end", "title": "" }, { "docid": "4ac858a19e91e962f429e96e5b23cb24", "score": "...
864d7d11376af4c82d5899b9c19b9c51
Wrap the response or error, or raise an exception if configured
[ { "docid": "8c1c2f09fb74b45a0fe16f0d1b56fbd7", "score": "0.6342452", "text": "def request(&block)\n Johac::Response.new(yield)\n rescue => e\n @config.raise_exceptions ? (raise e) : Johac::Response.new(e)\n end", "title": "" } ]
[ { "docid": "07e6bdb873ae01254583aeecaf1ff78b", "score": "0.7174023", "text": "def wrap_response_or_fail_unless_success!(response)\n case response.status\n when 200...300\n Response.new(response).tap do |wrapped_response|\n fail UnexpectedResponseError, response.body unless wrap...
3aebccf8da6e7a67a5ab3e71b7e7ac02
The name of the class.
[ { "docid": "2dd7dfa592df4024edcf3054f12e6b69", "score": "0.0", "text": "def class_name\n @test_case['classname']\n end", "title": "" } ]
[ { "docid": "9c45a91e242793f6464edd469a1349ba", "score": "0.8684521", "text": "def class_name\n name.camelcase\n end", "title": "" }, { "docid": "54d861539fb3fd8f638cd5976996a0ec", "score": "0.862049", "text": "def class_name\n @class_name\n end", "title": ...
9a9bea319d3bf575c08bb43d2c66b2ce
Returns the case if the alg solves the pattern and nil otherwise
[ { "docid": "007124d0e1bbae00fbed0b2ff9257420", "score": "0.78597397", "text": "def alg_case_for_pattern(alg, pattern)\n casee = @reverse_engineer.find_case(alg)\n casee && pattern.match?(casee) ? casee : nil\n end", "title": "" } ]
[ { "docid": "823c8886c3aaebd4d1b43ca12ea37736", "score": "0.61251724", "text": "def solved?(board)\n solve(board).last\nend", "title": "" }, { "docid": "ad3f876e85faf15ad90ce3cbe24dcc0c", "score": "0.61042684", "text": "def solution\n return nil\n end", "title": "" }, ...
101fdb3ea93e81fe64d8f77182b2acc2
! because method calls save method...
[ { "docid": "8b0e94075900adfc85f9ec5305bf9ca6", "score": "0.0", "text": "def make_vip!\n self.add_role :VIP\n self.invitation_limit = 10\n self.save\n end", "title": "" } ]
[ { "docid": "c9584bff3624f8ea714cb0237a667edf", "score": "0.7807171", "text": "def save!; end", "title": "" }, { "docid": "aca52100a0ae677212c2946c9a6dcc3b", "score": "0.7750843", "text": "def save!\n _save(false)\n end", "title": "" }, { "docid": "506427d2d56839f7...
162c0622b6006a3919e35520c62baea8
obtain a detailed printable version of the constraint return (String) detailed string representing the constraint
[ { "docid": "cc2f52954a4b955230a33bbf56c32b23", "score": "0.0", "text": "def display\n return \"#{@type} (#{@value})\"\n end", "title": "" } ]
[ { "docid": "4ad9e82a019c8bdcc6cd0f6e642d4420", "score": "0.76352406", "text": "def to_s\n \"#{@source} #{@description} #{@target} (#{@constraint})\"\n end", "title": "" }, { "docid": "d4bf75da5bbd99a73c03e7f59bb84ce4", "score": "0.7454387", "text": "def to_s\n viol_s =...
e9a434b416dbaad406b114d35947228e
fetch the json for the given url and retun an Array of Result objects. if block is given, each json hash is yielded to it before creating the Result object return nil or false to exclude it from the returned results (i.e. when checking for updates).
[ { "docid": "767c717061654cc30232b60b59a5489f", "score": "0.8386839", "text": "def fetch_json(url, &block)\n require 'net/http'\n require 'json'\n\n resp = Net::HTTP.get_response(URI.parse(url))\n json = JSON.parse(resp.body)\n\n return [] unless json.has_key?(KEY) \n return...
[ { "docid": "e70694980426cddd42272f6291ebc5e3", "score": "0.6918611", "text": "def fetch_all_with_url(url, options = {}, &block)\n use_callback = block_given?\n App.delegate.api_client.get(url) do |response, status_code|\n if response.present?\n records = fetch_all_with_...
e99ec8a5d03a891c41870de6a17ff087
the operational funds provided by the donation => for project donations: tip total original cc fee amount + however much of that was covered by the project => for nonproject donations: net amount + tip total original cc fee amount
[ { "docid": "a5c478a61e1711992918f14e04f9552e", "score": "0.691216", "text": "def net_ce_amount_in_dollars\n if self.project\n if self.net_project_amount_in_cents > 0\n MoneyConversion.cents_to_dollars( self.current_tip_amount_in_cents - self.fee_amount_in_cents + self.current_project_fee_...
[ { "docid": "6acc2d04676bff767746663a4e49a728", "score": "0.7490225", "text": "def stripe_donation_total\n donations.via_stripe.executed.map(&:calculate_total_per_nonprofit).sum\n end", "title": "" }, { "docid": "7d52da2e2d202d0017928c32bb3ba9d7", "score": "0.72207844", "text": "d...
79b80bd40d5323259eb6bf14b4209b9e
Calls Sqs::JaquMessage and Sqs::UserMessage with submitted form data Returns an array of message IDs
[ { "docid": "ad1032dc40665fab70f48dd74eb9123d", "score": "0.60134155", "text": "def send_emails(form)\n [Sqs::JaquMessage, Sqs::UserMessage].map { |klass| klass.call(contact_form: form) }\n end", "title": "" } ]
[ { "docid": "a2c8b9c6a2fa13f1a9507a08aadeffd1", "score": "0.5658666", "text": "def message_ids; end", "title": "" }, { "docid": "e0db2c13b032f84e6159c9ab748596cf", "score": "0.5563906", "text": "def process_request_message(processor, sqs_message)\n message = Mimi::Messaging::...
fda847f74d3a2fdd8fa5b5aee5b4d3ef
if there are an filter defined for given column, create and return a filter instance built upon given HTTP params.
[ { "docid": "72b588c3d524e5388d7c3620f0b5dba4", "score": "0.6879714", "text": "def filter? column, params\n return unless params\n return unless filter = @filters[column]\n instance = FilterInstance.new filter, params\n instance.val\n end", "title": "" } ]
[ { "docid": "039b5df4291e7304138830ad068502b2", "score": "0.6287593", "text": "def add_filter col, val, opts={}\n col = self.class.sql_sub(col)\n val = self.class.sql_sub(val)\n if col.to_s.empty? || val.to_s.empty?\n raise LimeExt::Errors::LimeDataFiltersError, 'Error adding filte...
da218f827daf39db7362e4ec1f799172
Show all manager invoices to manager. Show relevant invoices to interpreters and customers.
[ { "docid": "080abfc8c2ad694491e0e38ea2c35e35", "score": "0.70439297", "text": "def index\n if current_user && !current_user.manager?\n @manager_invoices = current_user.manager_invoices.paginate(page: params[:page]).order(start_date: :desc)\n elsif (user_logged_in? && current_user.manager?)\n ...
[ { "docid": "48f148bf09e2fb5cd15c1cec04fb8ea9", "score": "0.7202437", "text": "def show\n @invoices = Invoice.all\n end", "title": "" }, { "docid": "fb801de0a7f51cbce17c8b43c8420ae9", "score": "0.66611606", "text": "def show\n @invoices = Invoice.all\n @invoice = Invoice.new...
0f7a0aaab4e362b5443b8eabb981a12f
Determines whether a URL is allowed by the robot policy.
[ { "docid": "0b5d03f2d0c734acc58856a02954bdcc", "score": "0.8410151", "text": "def robot_allowed?(url)\n if @robots\n @robots.allowed?(url)\n else\n true\n end\n end", "title": "" } ]
[ { "docid": "998bd4b2b6bede71473657fd1fae53d5", "score": "0.8198622", "text": "def robots_allowed?(uri); end", "title": "" }, { "docid": "54e5f0f645425da2eb312ac5c071d1ee", "score": "0.7725434", "text": "def domain_is_allowed?(url)\n true\n end", "title": "" }, { "doci...
cd987d1ad14f591e5d9a081c238caa5d
PATCH/PUT /home_tests/1 PATCH/PUT /home_tests/1.json
[ { "docid": "8d5b67c69a5368fdd48e36a134ee48e6", "score": "0.6431215", "text": "def update\n respond_to do |format|\n if @home_test.update(home_test_params)\n format.html { redirect_to @home_test, notice: 'Home test was successfully updated.' }\n format.json { render :show, status: :...
[ { "docid": "765f860f9a42473cc91d620dc9d2fba2", "score": "0.66635376", "text": "def update\n @testspec = Testspec.find(params[:id])\n\n respond_to do |format|\n if @testspec.update_attributes(params[:testspec])\n format.html { redirect_to @testspec, notice: 'Testspec was successfully up...
2f421fe52d563ad5754fc901d937dcf4
=begin rdoc Is this certificate valid at this point in time. Note this only checks if it is valid with respect to time. It is important to realize that it does not check with any CRL or OCSP services to see if the certificate was revoked. =end
[ { "docid": "16ed173c8cda8679881ac5d387118086", "score": "0.0", "text": "def valid?(time=Time.now.utc)\n time>not_before && time<self.not_after\n end", "title": "" } ]
[ { "docid": "15b4005c92accf0b601c44d2b0d7dc78", "score": "0.761151", "text": "def check_cert_expiring\n cert = certificate_get\n expire_date = cert.not_after\n\n now = Time.now\n # Calculate the difference in time (seconds) and convert to hours\n hours_until_expired = (expire_date - now) /...
17a2ea4ef6d13e3acf10fea9076f52fd
line to distinguish exercise output 2. Write a method that accepts an array and then asked the user which number in the array they want and test with your months array So when a user inputs 8, they should get "September" Remember to change your input to an integer
[ { "docid": "93c119d4add1d0c5021e952bb8afc172", "score": "0.81521106", "text": "def get_month_name(array)\r\n\tputs \"Choose a number from 0 to 12\"\r\n\tinput = $stdin.gets.chomp\r\n\tinput = input.to_i\r\n\r\n\tresult = case input\r\n\t\twhen 1..12 then array[input]\r\n\t\telse \"Not a valid month\"\r\...
[ { "docid": "cf88a1aa197bb7bc9532e4a1abba8a3c", "score": "0.7167459", "text": "def getMonth()\n\tprint \"Enter a month (1 = Jan): \"\n\tretVal = gets().to_i()\n\t\n\tif (1..12).include?(retVal) then\n\t\treturn retVal;\n\telse\n\t\tputs \"Invalid. Month must be between 1 and 12. Got: #{retVal}\"\n\t\tret...
b03668022942aad2e136db661f48c4e9
Grants privileges on schemas. You can specify multiple schemas, roles and privileges all at once using Arrays for each of the desired parameters. See PostgreSQLGrantPrivilege for usage.
[ { "docid": "564490086b0d2785e79cb8cad5a9fdee", "score": "0.81287736", "text": "def grant_schema_privileges(schemas, privileges, roles, options = {})\n execute PostgreSQLGrantPrivilege.new(self, :schema, schemas, privileges, roles, options, :ignore_schema => true).to_sql\n end", "title": ...
[ { "docid": "96a44a7192cbb6b065864598fb2054f7", "score": "0.6882244", "text": "def grant_privileges(username=false, database=false, *privileges)\n grant_or_revoke_privileges('GRANT', username, database, privileges)\n end", "title": "" }, { "docid": "96a44a7192cbb6b065864598fb2054f7", ...
3ea12e0ecce4eb6c2d88bf87f8446bee
The maximum number of blocks that this endpoint wants to process before needing a rekey. source://netssh//lib/net/ssh/transport/state.rb50
[ { "docid": "2e852129685a7118977f1820a526510b", "score": "0.6702317", "text": "def max_blocks=(_arg0); end", "title": "" } ]
[ { "docid": "cc00ff5512a13690536e0e895df4241d", "score": "0.7375075", "text": "def block_size\n\t\t25\n\tend", "title": "" }, { "docid": "4109f78ce726c5300ba27252aaeabe84", "score": "0.7261358", "text": "def block_size; end", "title": "" }, { "docid": "1683972834fb478797e5...
d0669b056a10612f450faa31f8b469ab
If class method, returns target method's name prefixed with double colons. If instance method, then returns target method's name prefixed with hash character.
[ { "docid": "9798767fdbee61e7cc982d6a6c358b86", "score": "0.5948668", "text": "def name\n \"::#{target}\"\n end", "title": "" } ]
[ { "docid": "4fcbcc8a0c43647bf12229903dedaa0f", "score": "0.75379646", "text": "def calc_full_method_name(class_name, method_name)\n mn = method_name.to_s\n class_name + \n (if mn =~ /^.*\\.(.*)$/\n '.' + $1 # class method\n else\n '#' + mn #...
06e8c1488e40d5fe4cfec61e4f402912
Baseline implementation for the set_node_template REST call
[ { "docid": "09a257c961f3b169e07d6a23102b3efd", "score": "0.75369865", "text": "def set_node_template request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n uri, body, query_string_params = transcode_set_node_template_request r...
[ { "docid": "d6d4c749036f531a4b9e66ab7eae5bdf", "score": "0.7075593", "text": "def set_node_template request_pb, options:, &block\n request_json = JSON.parse ::Google::Cloud::Compute::V1::SetNodeTemplateNodeGroupRequest.encode_json(request_pb)\n\n uri = \"/compute/v1/project...
9946550adcf689ca2b8bea0389b1b882
We override respond_to so that we respond to the normal object models as well as accept the method_missing utilized names as well. If it's in +respondable_methods+, we return true.
[ { "docid": "5d93c9f9ae28cbdc03a90d48fa3b1ec6", "score": "0.0", "text": "def respond_to_missing?(method_name, include_private = false) #:nodoc:\n components = method_name.to_s.split('_')\n tense_method = components[0..5].join('_').to_sym\n\n return false unless @tense_lis...
[ { "docid": "10257f9ff3e35108c4ff5af873a33901", "score": "0.82389826", "text": "def respond_to_missing?(*args)\n @object.respond_to?(*args) || super\n end", "title": "" }, { "docid": "f8c1ae9c9aa6ecfd4a3afbe83904fdde", "score": "0.81053156", "text": "def respond_to_mis...
a0ea784f0a66bf7ac39ca1723c8bf935
For purposes of the DH Leipzig/Maryland/etc. research groups (be able to use To Pan, etc.) the CSV files must comply with CITE CTS. The specs are at
[ { "docid": "359a1337532659af7ba26f7923b8f469", "score": "0.0", "text": "def cts_csv_writeline(madhab, tafseer, line_no, opts = {nospecialchars: false})\n # @hash contents example:\n #\n # {\"position_sura\"=>1,\n # \"position_aaya\"=>1,\n # \"position_madhab\"=>1,\n # \"position_taf...
[ { "docid": "5e49b51e00e2ddf6bb5dc31834a4ffa3", "score": "0.6169401", "text": "def process_ce_data_file (input_filename, output_filename)\n\t#Check if the input file is xls. If so, change to CSV\n\tif input_filename.include? \"xls\"\n\t\tcsv_filename = input_filename.gsub \"xls\", \"csv\"\n\t\tce_tsv_to...
d210b75dbaa7fdb185d1d5673a4ea5e1
DELETE /compinfos/1 DELETE /compinfos/1.json
[ { "docid": "b2f0e52db754091165262f14c3c803b2", "score": "0.75265044", "text": "def destroy\n @compinfo.destroy\n respond_to do |format|\n format.html { redirect_to compinfos_url, notice: 'Compinfo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "ti...
[ { "docid": "345667f1c2c29f83d33dffed83824fcf", "score": "0.7729029", "text": "def destroy\n @compinfo = Compinfo.find(params[:id])\n @compinfo.destroy\n\n respond_to do |format|\n format.html { redirect_to compinfos_url }\n format.json { head :ok }\n end\n end", "title": "" ...
04e4bc6a0098d8df48a67b8e220e6fa2
Returns units belonging to current order that are not ready to proceed with digitization and would prevent an order from being approved. Only units whose unit_status = 'approved' or 'canceled' are removed from consideration by this method.
[ { "docid": "3d6ffdf0d90ebfa79e8b628b062414c3", "score": "0.6266042", "text": "def has_units_being_prepared\n units_beings_prepared = Unit.where(:order_id => self.id).where('unit_status = \"unapproved\" or unit_status = \"condition\" or unit_status = \"copyright\"')\n return units_beings_prepar...
[ { "docid": "12f7cfd5034ecf5b1691a2a0b500ab19", "score": "0.65789837", "text": "def get_rented_units\n @units.select { |u| !u.available? }\n end", "title": "" }, { "docid": "a07c20bd641500a5219ae2cf767d2ae3", "score": "0.6155597", "text": "def get_rented_units\n @units.select {...
b7b85aa55b388b39f933b620af0a393f
Problem 2: You have array of integers. Write a recursive solution to determine whether or not the array contains a specific value.
[ { "docid": "bbe60dc9c2c142123deae6763692ab6b", "score": "0.0", "text": "def includes?(array, target)\n\treturn false if array.empty?\n\treturn true if array.last == target\n\n\tincludes?(array[0...-1], target)\nend", "title": "" } ]
[ { "docid": "e92c7b777e5c6cbcf0259b9812c77fea", "score": "0.7588491", "text": "def array_42(array)\n return array.include?(42)\nend", "title": "" }, { "docid": "e92c7b777e5c6cbcf0259b9812c77fea", "score": "0.7588491", "text": "def array_42(array)\n return array.include?(42)\nend", ...
e947a645d79c991b334d40a2d1d2a67c
two part, capture words, use divide and conquer approach
[ { "docid": "0128a91e252352bc47ec1250dc9cbb1d", "score": "0.0", "text": "def get_acceptable_words_new(file)\n @words_buffer = []\n File.open(file) do |f|\n f.each_line {|line|\n # grab word, add 1000 words to each Thread to be processed\n # is a single word per line\n @words_buffer <<...
[ { "docid": "b19c5e1b634459f4ba155ec279970ccd", "score": "0.6710821", "text": "def inside_out s\n #..\n word_arr = s.split(' ')\n\n word_arr.each do |word|\n mid = (word.length / 2).floor\n if word.length % 2 == 0\n first = word[0..mid]\n second = word[mid + 1..-1]\n \n temp_wo...
3f1058bc887c001269a01b06db03b1e1
move is valid if: player enters index within 9cell board array and that cell not already occupied
[ { "docid": "dd9616370870a991b89fc9ec391fe97d", "score": "0.8161836", "text": "def valid_move?(board, index)\n if index.between?(0,8) && !position_taken?(board,index)\n true\n end\nend", "title": "" } ]
[ { "docid": "d2963802ed1e1a2837d00683001eb3a0", "score": "0.8300408", "text": "def valid_move?(board, index)\n if index.between?(0,8) && !position_taken?(board, index)\n true\n end\n end", "title": "" }, { "docid": "9f793e11d8aed0d6a2dddab23ac9648e", "score": "0.8282922", "t...
c80ba518c2f4f629cc49a34bd252a914
For now just one, downloads are big enough as it is and we don't want to annoy travis
[ { "docid": "952be3c4ff561daecbfd9fedf5928def", "score": "0.624274", "text": "def test_youtube\r\n #download_test('http://www.youtube.com/watch?v=CFw6s0TN3hY')\r\n download_test_other_tools('http://www.youtube.com/watch?v=9uDgJ9_H0gg') # this video is only 30 KB\r\n end", "title": "" } ]
[ { "docid": "3b4f9fb641a008a03bd7ac86392c6dbb", "score": "0.6860243", "text": "def download_test(url)\r\n before = Dir['*']\r\n assert system(\"ruby bin/viddl-rb #{url} -e\")\r\n new_files = Dir['*'] - before\r\n assert_equal new_files.size, 2\r\n assert File.size(new_files[0]) > 100000\r\...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "0b36179bff0a18e308d5e7a3acdfbaaa", "score": "0.0", "text": "def set_start_male_hammer_throw\n @start_male_hammer_throw = StartMaleHammerThrow.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163821", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045432", "text": "def action_hook;...
0fd38535d964c827a13eb3d9ba6f1194
Overwritten by subclass Returns an array of [dx, dy] position changes that a piece can make
[ { "docid": "0c13c71e814b8c857e8faaae16bf32ee", "score": "0.0", "text": "def move_diffs\n raise NotImplementedError\n end", "title": "" } ]
[ { "docid": "9fd8375209b7aaf6c3d61965499a28a7", "score": "0.67549956", "text": "def moves\n # All pieces can stay in place\n [[0,0]]\n end", "title": "" }, { "docid": "0416f5f2043f4753be8e4f6d16fda013", "score": "0.65848404", "text": "def build_obstruction_array(x_end, y_...
26920d77c2084c9626c03c63f4351bbc
Metodo para encerrar o evento
[ { "docid": "3759e7e40e7cc15afb0cd033e2867466", "score": "0.0", "text": "def bloquea\r\n\r\n #@sivic_professor = SivicProfessor.find(\"#{params[:id]}\")\r\n\r\n @sivic_professor = SivicProfessor.find(params[:id])\r\n\r\n @sivic_professor.update(:DATA_bloqueio => Time.now, :user_bloqueio => curre...
[ { "docid": "7effd0ae986668c88bd472c58ed8d73f", "score": "0.7427982", "text": "def encode_event(exi_event)\n end", "title": "" }, { "docid": "08e58c65890de474706bb96cfd5615cf", "score": "0.6556125", "text": "def write( event )\n nil\n end", "title": "" }, { "doc...
f7bb618ee1d47b5bceac9f366b2e09ca
might need to make it job_postings.find_by_id...
[ { "docid": "6c1a3d10a355003f31aa3723e20a59c6", "score": "0.0", "text": "def correct_user\n\t\t@job_posting = current_user.job_posting.find_by_id(params[:id]) #testing if nil.\n\t\tredirect_to root_path if @job_posting.nil?\n\tend", "title": "" } ]
[ { "docid": "53ce4a99ca176923e88d7779fe4b61c3", "score": "0.77230114", "text": "def set_job_posting\n @job_posting = @user.job_postings.where(id: params[:id]).first\n end", "title": "" }, { "docid": "e25d236f164c100a94157bb5a693848c", "score": "0.7584953", "text": "def set_job...
0ab0f66c4b371285718964dc40446363
Get the loser names as a string.
[ { "docid": "37926ae292b5d019392bec9fc7918f68", "score": "0.74731994", "text": "def getLoserNames\n self.joinNames @loserNames\n end", "title": "" } ]
[ { "docid": "4082ad0e3443cad7ac9f5ee4e0831786", "score": "0.70841247", "text": "def list_names\r\n names = names.map{|name| name[:name]}\r\n last_name = names.pop\r\n return last_name.to_s if names.empty?\r\n \"#{names.join(' , ')}& #{last_name}\" end", "title": "" }, { "docid": "ef69a2fc...
91a3e632c745ada72c92169d2a7b3386
PATCH/PUT /game_round_assets/1 PATCH/PUT /game_round_assets/1.json
[ { "docid": "71b57d27cd5893da074cd3c6161566d1", "score": "0.73499113", "text": "def update\n respond_to do |format|\n if @game_round_asset.update(game_round_asset_params)\n format.html { redirect_to @game_round_asset, notice: 'Game round asset was successfully updated.' }\n format.j...
[ { "docid": "64b4c5a540fab3ffd7d37f4c1ef60285", "score": "0.6743439", "text": "def update\n @game_asset = GameAsset.find(params[:id])\n\n respond_to do |format|\n if @game_asset.update_attributes(params[:game_asset])\n format.html { redirect_to character_path(@game_asset.character), not...
3c9bdfd905ab207d199eee7fa3ea3ae6
NOTE: We overwrite what the user's may have indicated as the label for the phone number. If the user responds to an sms on this number, we consider it to be their mobile number
[ { "docid": "5df6af87942cd2c4fe1e000bb0bc7890", "score": "0.0", "text": "def responded_to_notification(notification)\n # MARKER - that the value changed\n if notification.is_email? && notification.contact_value != email\n log_event(\"User #{self.log_info} email updated from [#{email || 'null'}...
[ { "docid": "0be20556171958979a3f28dbe39729ec", "score": "0.7613219", "text": "def mobile_phone\n value = format_phone(user_data['mobile_phone'])\n\n set_text('Mobile phone:', 345)\n set_text(value, 345, 'value')\n end", "title": "" }, { "docid": "b0841167834...
9ab3c4d9b53bba8b37af9e08f697793d
A flexible initializer based on the DataMapper "create factory" design pattern.
[ { "docid": "de39af9a134bdf3af78e6a711409f79f", "score": "0.0", "text": "def initialize(opts = {})\n opts.each do |key, value|\n raise \"#{key} is not a variable name in #{self.class.name}\" unless variable_names.include?(key.to_s) || key == :test\n instance_variable_set(\"@#{key}\", v...
[ { "docid": "9e490c3344ef867c81ac0ec3c45edd22", "score": "0.64538646", "text": "def initialize(mappers = {})\n @mappers = mappers\n end", "title": "" }, { "docid": "cd6e982f58d7de302e3f36450db70dc9", "score": "0.6450601", "text": "def initialize(options = {})\n super\n ...
9fe97a7226a08f84b457d105d74638f1
we need to change the velocity with the accelerate method Gosu::offset returns the distance between the origin and the point to which you would get if you moved in the specified angle by the specified distance
[ { "docid": "a3aaf120f28ee03462f24b30267329ff", "score": "0.8247797", "text": "def accelerate\n @velocity_x += Gosu.offset_x(@angle, ACCELERATION)\n @velocity_y += Gosu.offset_y(@angle, ACCELERATION)\n end", "title": "" } ]
[ { "docid": "cb00ed3f06c750a7d52575acf7d18f72", "score": "0.8234004", "text": "def accelerate\r\n @velx += Gosu.offset_x(@angle,ACCELERATION)\r\n @vely += Gosu.offset_y(@angle,ACCELERATION)\r\n end", "title": "" }, { "docid": "d03294da2a7fe043ea34051ab2fc0bf6", "score": "...
4dd2dc9b3429580cbcedf78cdac07e49
Deducts tokens from the friend that had accepted the current users request from their group. Only use when request has been accepted
[ { "docid": "7a39aa91e0e19d1e648cd66a49a6b361", "score": "0.80005187", "text": "def deduct_tokens_from_friend_user_group_request_was_accepted_from\n if @request.status == 'accepted'\n user = User.find(@request.babysitter_id)\n user.subtract_tokens([@request.group_id], @request)\n end\n e...
[ { "docid": "7d1ff0dfebb5a60d0be740d6f7704499", "score": "0.73001707", "text": "def add_tokens_to_current_user_group_request_was_accepted_from\n if @request.status == 'accepted'\n request_group = @request.group_request_was_accepted_by\n current_user.add_tokens(request_group)\n end\n end"...
c82f99c72dc6b283d6157384bc17538b
DELETE /books/1 DELETE /books/1.json
[ { "docid": "c4adc3d901b66237a3dec43afca4433e", "score": "0.7154986", "text": "def destroy\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url, notice: 'Knjiga uspešno izbrisana.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "f20a59ceb31d39f7c2e3a92cdb0d0d0c", "score": "0.7589208", "text": "def destroy\n @book = Book.find(params[:id])\n @book.destroy\n\n respond_to do |format|\n format.html { redirect_to deleted_books_path }\n format.json { head :no_content }\n end\n end", "title": "" ...
8e1d368eee93ea8b2e6d69c1aea46ac9
GET /organizations/new GET /organizations/new.xml
[ { "docid": "ece410bb4bd06464a65adf789b1bb4b2", "score": "0.7719807", "text": "def new\n @organization = Organization.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @organization }\n end\n end", "title": "" } ]
[ { "docid": "0824b807ef4983f3351b757f1384c98b", "score": "0.7631869", "text": "def new\n @organizations = Organization.find(:all)\n @organization_user = OrganizationUser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @organization_user }\n ...
442ab6548b9448d5879b3539dec0f011
GET /ebooks GET /ebooks.json
[ { "docid": "f6bd3a5b09390b0e33b1b782da693aa8", "score": "0.0", "text": "def index\n @ebooks = Ebook.order(\"lower(title)\")\n end", "title": "" } ]
[ { "docid": "7edce61de4899e8fb9c0b48af820391b", "score": "0.69153565", "text": "def index\n @notebooks = Notebook.all\n end", "title": "" }, { "docid": "f4d045c1d882ddc1339a7c97bc909710", "score": "0.6882247", "text": "def index\n @ebooks = Ebook.all\n end", "title": "" ...
f319f9979b80036d70bb8c195db468db
POST /raids POST /raids.xml
[ { "docid": "f13e214e780cfb547e44d8ff47a7d76f", "score": "0.55009556", "text": "def create\n\n respond_to do |format|\n if @raid.save\n flash[:notice] = 'Raid was successfully created.'\n format.html { redirect_to(\"/guilds/#{@raid.guild.id}/raids/#{@raid.id}\") }\n format.xm...
[ { "docid": "2ab02907526d738c4dacf3205469e8a4", "score": "0.5542402", "text": "def do_post(host, port)\r\n\tverb = \"POST\"\r\n\treq_URI = \"/raiders\"\r\n\tversion = \"HTTP/1.1\"\r\n\traider = get_raider_info\r\n\trequest = \"#{verb} #{req_URI} #{version}\\r\\n\"\r\n\tresponse = post_request(host, port,...
2045924f409616c24ae07193f9c89a5c
Remove duplicate message from queue if possible
[ { "docid": "082791f30f7fedba124b96314719a49a", "score": "0.764498", "text": "def scrub_duplicate_message(message)\n messages do |collection|\n idx = collection[message.connection.identifier].index do |msg|\n msg.message_id == message.message_id\n end\n if(idx...
[ { "docid": "423ec797f0dcd16c3c00c081d4533773", "score": "0.66215926", "text": "def duplicate?(msg)\n result = super(msg.md5_of_body)\n logger.debug(\"#{self.queue_name}: message is dupe #{msg.message_id}\") if result\n result\n end", "title": "" }, { "docid": "cbbbc91ff61b6...
33a3c1596ebe37caad2cf2184c7bc1dd
PUT /companies/1 PUT /companies/1.xml
[ { "docid": "fa67b730559e3db31fbce477f1bd97cc", "score": "0.0", "text": "def update\n\n if current_user\n @company = Company.find(params[:id])\n\n @action = Action.new({:points => 2, :entity_changed => \"company\" , :action => \"update\", :user_id => current_user.id })\n @action.save\n\n @...
[ { "docid": "75257bcacbc16f7963754f7d8ca9fb70", "score": "0.7226064", "text": "def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n \n \n format.xml \n else\n \n format.xml { render :...
ddb49ca9c8b25dec42678d06f8086a53
Get separate frame from existing image. Image data is passed in a request stream.
[ { "docid": "7d48d9b94bbb1dfdb6547c5a3ec7a062", "score": "0.68156785", "text": "def create_image_frame_from_request_body\n puts('Get separate frame from existing image from request body')\n\n frame_id = 1 # Index of the frame\n out_path = nil\n storage = nil # We are using default Clo...
[ { "docid": "98a0ee86809c325603567aedc6affcbe", "score": "0.6078323", "text": "def create_image_frame_range_from_request_body\n puts('Get separate frame range from existing image from request body')\n\n start_frame_id = 1 # Index of the first frame in range\n end_frame_id = 4 # Index of th...